-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added warmup instruction support; updated all sample configuration fi…
…les with 100 million warmup instructions; added 3200 data rate option for DDR4; fixed some command scheduling bugs that were leading to activate-precharge without read or write command; changed the default scheduler to FRFCFS_Cap;
- Loading branch information
Hasan Hassan
committed
Dec 12, 2017
1 parent
7ce65d0
commit cd96ed6
Showing
24 changed files
with
228 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,8 @@ using namespace std; | |
namespace ramulator | ||
{ | ||
|
||
extern bool warmup_complete; | ||
|
||
template <typename T> | ||
class Controller | ||
{ | ||
|
@@ -42,6 +44,7 @@ class Controller | |
VectorStat write_row_hits; | ||
VectorStat write_row_misses; | ||
VectorStat write_row_conflicts; | ||
ScalarStat useless_activates; | ||
|
||
ScalarStat read_latency_avg; | ||
ScalarStat read_latency_sum; | ||
|
@@ -80,6 +83,11 @@ class Controller | |
|
||
Queue readq; // queue for read requests | ||
Queue writeq; // queue for write requests | ||
Queue actq; // read and write requests for which activate was issued are moved to | ||
// actq, which has higher priority than readq and writeq. | ||
// This is an optimization | ||
// for avoiding useless activations (i.e., PRECHARGE | ||
// after ACTIVATE w/o READ of WRITE command) | ||
Queue otherq; // queue for all "other" requests (e.g., refresh) | ||
|
||
deque<Request> pending; // read requests that are about to receive data from DRAM | ||
|
@@ -170,6 +178,12 @@ class Controller | |
.precision(0) | ||
; | ||
|
||
useless_activates | ||
.name("useless_activates_"+to_string(channel->id)+ "_core") | ||
.desc("Number of useless activations. E.g, ACT -> PRE w/o RD or WR") | ||
.precision(0) | ||
; | ||
|
||
read_transaction_bytes | ||
.name("read_transaction_bytes_"+to_string(channel->id)) | ||
.desc("The total byte of read transaction per channel") | ||
|
@@ -340,7 +354,10 @@ class Controller | |
/*** 3. Should we schedule writes? ***/ | ||
if (!write_mode) { | ||
// yes -- write queue is almost full or read queue is empty | ||
if (writeq.size() >= int(0.8 * writeq.max) || readq.size() == 0) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
arthasSin
Member
|
||
if (writeq.size() >= int(0.8 * writeq.max) | ||
/*|| readq.size() == 0*/) // Hasan: Switching to write mode when there are just a few | ||
// write requests, even if the read queue is empty, incurs a lot of overhead. | ||
// Commented out the read request queue empty condition | ||
write_mode = true; | ||
} | ||
else { | ||
|
@@ -350,11 +367,21 @@ class Controller | |
} | ||
|
||
/*** 4. Find the best command to schedule, if any ***/ | ||
Queue* queue = !write_mode ? &readq : &writeq; | ||
if (otherq.size()) | ||
queue = &otherq; // "other" requests are rare, so we give them precedence over reads/writes | ||
|
||
// First check the actq (which has higher priority) to see if there | ||
// are requests available to service in this cycle | ||
Queue* queue = &actq; | ||
|
||
auto req = scheduler->get_head(queue->q); | ||
if (req == queue->q.end() || !is_ready(req)) { | ||
queue = !write_mode ? &readq : &writeq; | ||
|
||
if (otherq.size()) | ||
queue = &otherq; // "other" requests are rare, so we give them precedence over reads/writes | ||
|
||
req = scheduler->get_head(queue->q); | ||
} | ||
|
||
if (req == queue->q.end() || !is_ready(req)) { | ||
// we couldn't find a command to schedule -- let's try to be speculative | ||
auto cmd = T::Command::PRE; | ||
|
@@ -404,8 +431,15 @@ class Controller | |
issue_cmd(cmd, get_addr_vec(cmd, req)); | ||
|
||
// check whether this is the last command (which finishes the request) | ||
if (cmd != channel->spec->translate[int(req->type)]) | ||
if (cmd != channel->spec->translate[int(req->type)]){ | ||
if(channel->spec->is_opening(cmd)) { | ||
// promote the request that caused issuing activation to actq | ||
actq.q.push_back(*req); | ||
queue->q.erase(req); | ||
} | ||
|
||
return; | ||
} | ||
|
||
// set a future completion time for read requests | ||
if (req->type == Request::Type::READ) { | ||
|
@@ -492,6 +526,13 @@ class Controller | |
{ | ||
assert(is_ready(cmd, addr_vec)); | ||
channel->update(cmd, addr_vec.data(), clk); | ||
|
||
if(cmd == T::Command::PRE){ | ||
if(rowtable->get_hits(addr_vec, true) == 0){ | ||
useless_activates++; | ||
} | ||
} | ||
|
||
rowtable->update(cmd, addr_vec, clk); | ||
if (record_cmd_trace){ | ||
// select rank | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
This change (repeated in Controller.cpp) obviously causes the simulation to hang forever if a program is waiting on a few writes and no reads.