diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2014-12-23 09:31:18 -0500 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2014-12-23 09:31:18 -0500 |
commit | 59460b91f35efe24a99424c0018d2f9c002e50c8 (patch) | |
tree | 3371fdc57dd5a032ff4b5fa4b4d51b796b8e71cd /src/mem | |
parent | 2f7baf9dbe7fd2cd716885adacf508a5b89e9eb8 (diff) | |
download | gem5-59460b91f35efe24a99424c0018d2f9c002e50c8.tar.xz |
config: Expose the DRAM ranks as a command-line option
This patch gives the user direct influence over the number of DRAM
ranks to make it easier to tune the memory density without affecting
the bandwidth (previously the only means of scaling the device count
was through the number of channels).
The patch also adds some basic sanity checks to ensure that the number
of ranks is a power of two (since we rely on bit slices in the address
decoding).
Diffstat (limited to 'src/mem')
-rw-r--r-- | src/mem/dram_ctrl.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mem/dram_ctrl.cc b/src/mem/dram_ctrl.cc index 42abc63a8..44ac3d512 100644 --- a/src/mem/dram_ctrl.cc +++ b/src/mem/dram_ctrl.cc @@ -92,6 +92,11 @@ DRAMCtrl::DRAMCtrl(const DRAMCtrlParams* p) : busBusyUntil(0), prevArrival(0), nextReqTime(0), activeRank(0), timeStampOffset(0) { + // sanity check the ranks since we rely on bit slicing for the + // address decoding + fatal_if(!isPowerOf2(ranksPerChannel), "DRAM rank count of %d is not " + "allowed, must be a power of two\n", ranksPerChannel); + for (int i = 0; i < ranksPerChannel; i++) { Rank* rank = new Rank(*this, p); ranks.push_back(rank); |