Skip to content

Commit

Permalink
Add important programming running status. Fix the parallel memory acc…
Browse files Browse the repository at this point in the history
…ess example.
  • Loading branch information
Liu-Cheng committed Apr 16, 2017
1 parent 4ace83b commit f591001
Show file tree
Hide file tree
Showing 6 changed files with 271 additions and 74 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ depend: $(OBJDIR)/.depend
exe:
./ramulator configs/DDR3-config.cfg --mode=acc dram.trace

gdb:
gdb --args ./ramulator configs/DDR3-config.cfg --mode=acc dram.trace

$(OBJDIR)/.depend: $(SRCS)
@mkdir -p $(OBJDIR)
@rm -f $(OBJDIR)/.depend
Expand Down
7 changes: 3 additions & 4 deletions src/MemWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ void MemWrapper::getBurstReq(){

if(op.type == ramulator::Request::Type::READ){
counter++;
std::cout << counter << " burst requests are received." << std::endl;
}
}
wait(peClkCycle, SC_NS);
Expand Down Expand Up @@ -389,8 +388,8 @@ void MemWrapper::run_acc(const Config& configs, Memory<T, Controller>& memory) {
r.udf.departMemTime = r.udf.arriveMemTime + memClkCycle * latency;
respQueue.push_back(r);
reqStatus[r.udf.reqIdx] = true;
std::cout << "req: " << r.udf.reqIdx << " is returnned at " << sc_time_stamp() << std::endl;
std::cout << "req: " << r.udf.reqIdx << " " << r.arrive << " " << r.depart << std::endl;
//std::cout << "req: " << r.udf.reqIdx << " is returnned at " << sc_time_stamp() << std::endl;
//std::cout << "req: " << r.udf.reqIdx << " " << r.arrive << " " << r.depart << std::endl;
};

std::vector<int> addr_vec;
Expand All @@ -406,7 +405,7 @@ void MemWrapper::run_acc(const Config& configs, Memory<T, Controller>& memory) {
stall = !memory.send(req);
if (!stall){
if (req.type == Request::Type::READ){
std::cout << "req: " << req.udf.reqIdx << " is issued at " << sc_time_stamp() << std::endl;
//std::cout << "req: " << req.udf.reqIdx << " is issued at " << sc_time_stamp() << std::endl;
reads++;
}
// At this time, we can already assume that the write operation is done.
Expand Down
3 changes: 0 additions & 3 deletions src/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,6 @@ void BurstOp::updateAddrVec() {
}
}

// Needs to be fixed latter
BurstOp::~BurstOp(){}

long BurstOp::getDepartPeTime() const{
return departPeTime;
}
Expand Down
9 changes: 7 additions & 2 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ struct BurstOp{

BurstOp(bool _valid = false);

~BurstOp();

private:
long departPeTime;
long arriveMemTime;
Expand All @@ -121,6 +119,13 @@ struct BurstOp{
int getOffset() const;
};

// This is used to identify the memory access port
enum PortType{
VA,
VB,
VP
};

// This macro is used to locate the code position.
#define HERE do {std::cout <<"File: " << __FILE__ << " Line: " << __LINE__ << std::endl;} while(0)

Expand Down
Loading

0 comments on commit f591001

Please sign in to comment.