summaryrefslogtreecommitdiff
path: root/src/mem/dram_ctrl.hh
diff options
context:
space:
mode:
authorWendy Elsasser <wendy.elsasser@arm.com>2014-09-20 17:17:57 -0400
committerWendy Elsasser <wendy.elsasser@arm.com>2014-09-20 17:17:57 -0400
commitb6ecfe918364ce4b7df0f95590b483100bbfcba9 (patch)
treeaae499f62e89e9b15bc23a1258f8a4aa58378eb6 /src/mem/dram_ctrl.hh
parenta384525355c37f8776e03c78e12279c38c5c3097 (diff)
downloadgem5-b6ecfe918364ce4b7df0f95590b483100bbfcba9.tar.xz
mem: Add memory rank-to-rank delay
Add the following delay to the DRAM controller: - tCS : Different rank bus turnaround delay This will be applied for 1) read-to-read, 2) write-to-write, 3) write-to-read, and 4) read-to-write command sequences, where the new command accesses a different rank than the previous burst. The delay defaults to 2*tCK for each defined memory class. Note that this does not correspond to one particular timing constraint, but is a way of modelling all the associated constraints. The DRAM controller has some minor changes to prioritize commands to the same rank. This prioritization will only occur when the command stream is not switching from a read to write or vice versa (in the case of switching we have a gap in any case). To prioritize commands to the same rank, the model will determine if there are any commands queued (same type) to the same rank as the previous command. This check will ensure that the 'same rank' command will be able to execute without adding bubbles to the command flow, e.g. any ACT delay requirements can be done under the hoods, allowing the burst to issue seamlessly.
Diffstat (limited to 'src/mem/dram_ctrl.hh')
-rw-r--r--src/mem/dram_ctrl.hh25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/mem/dram_ctrl.hh b/src/mem/dram_ctrl.hh
index ef8b47a2e..8dcbe817b 100644
--- a/src/mem/dram_ctrl.hh
+++ b/src/mem/dram_ctrl.hh
@@ -368,23 +368,36 @@ class DRAMCtrl : public AbstractMemory
* The memory schduler/arbiter - picks which request needs to
* go next, based on the specified policy such as FCFS or FR-FCFS
* and moves it to the head of the queue.
+ * Prioritizes accesses to the same rank as previous burst unless
+ * controller is switching command type.
+ *
+ * @param queue Queued requests to consider
+ * @param switched_cmd_type Command type is changing
*/
- void chooseNext(std::deque<DRAMPacket*>& queue);
+ void chooseNext(std::deque<DRAMPacket*>& queue, bool switched_cmd_type);
/**
* For FR-FCFS policy reorder the read/write queue depending on row buffer
* hits and earliest banks available in DRAM
+ * Prioritizes accesses to the same rank as previous burst unless
+ * controller is switching command type.
+ *
+ * @param queue Queued requests to consider
+ * @param switched_cmd_type Command type is changing
*/
- void reorderQueue(std::deque<DRAMPacket*>& queue);
+ void reorderQueue(std::deque<DRAMPacket*>& queue, bool switched_cmd_type);
/**
* Find which are the earliest banks ready to issue an activate
* for the enqueued requests. Assumes maximum of 64 banks per DIMM
+ * Also checks if the bank is already prepped.
*
- * @param Queued requests to consider
+ * @param queue Queued requests to consider
+ * @param switched_cmd_type Command type is changing
* @return One-hot encoded mask of bank indices
*/
- uint64_t minBankActAt(const std::deque<DRAMPacket*>& queue) const;
+ uint64_t minBankPrep(const std::deque<DRAMPacket*>& queue,
+ bool switched_cmd_type) const;
/**
* Keep track of when row activations happen, in order to enforce
@@ -475,6 +488,7 @@ class DRAMCtrl : public AbstractMemory
const Tick M5_CLASS_VAR_USED tCK;
const Tick tWTR;
const Tick tRTW;
+ const Tick tCS;
const Tick tBURST;
const Tick tRCD;
const Tick tCL;
@@ -664,6 +678,9 @@ class DRAMCtrl : public AbstractMemory
// To track number of banks which are currently active
unsigned int numBanksActive;
+ // Holds the value of the rank of burst issued
+ uint8_t activeRank;
+
/** @todo this is a temporary workaround until the 4-phase code is
* committed. upstream caches needs this packet until true is returned, so
* hold onto it for deletion until a subsequent call