diff --git a/DRAMSys/simulator/src/controller/core/configuration/Configuration.cpp b/DRAMSys/simulator/src/controller/core/configuration/Configuration.cpp index b132f283..62959c6f 100644 --- a/DRAMSys/simulator/src/controller/core/configuration/Configuration.cpp +++ b/DRAMSys/simulator/src/controller/core/configuration/Configuration.cpp @@ -253,6 +253,7 @@ unsigned int Configuration::getSimMemSizeInBytes() unsigned int Configuration::getDataBusWidth() { unsigned int dataBusWidth = memSpec.bitWidth * NumberOfDevicesOnDIMM; + assert(dataBusWidth > 0); return dataBusWidth; } @@ -262,6 +263,15 @@ unsigned int Configuration::getBytesPerBurst() // First multiply to get the number of bits in a burst, then divide by 8 to get the value in bytes. The order is important. Think on a single x4 device. unsigned int bytesPerBurst = (memSpec.BurstLength * getDataBusWidth()) / 8; assert(bytesPerBurst > 0); + + if (NumberOfDevicesOnDIMM > 1) { + // The least significant bits of the physical address are the byte + // offset of the N-byte-wide memory module (a single data word has N + // bytes. N = 2^(# bits for byte offset)). + unsigned int dataWordSizeInBytes = xmlAddressDecoder::getInstance().amount["bytes"]; + assert(bytesPerBurst == (dataWordSizeInBytes * memSpec.BurstLength)); + } + return bytesPerBurst; }