Function to get the width of the data bus.

This commit is contained in:
Éder F. Zulian
2016-11-09 17:44:13 +01:00
parent f9555acc32
commit 478ce8d79f
3 changed files with 12 additions and 4 deletions

View File

@@ -244,3 +244,13 @@ unsigned int Configuration::getSimMemSizeInBytes()
return memorySize;
}
// Returns the width of the data bus.
// All DRAM chips on a DIMM operate in lockstep,
// which constituing aggregate data bus width = chip's bus width * # locksteep-operated chips
// The bus width is given in bits, e.g., 64-bit data bus, 128-bit data bus, etc.
unsigned int Configuration::getDataBusWidth()
{
unsigned int dataBusWidth = memSpec.bitWidth * NumberOfDevicesOnDIMM;
return dataBusWidth;
}

View File

@@ -101,6 +101,7 @@ struct Configuration
TemperatureSimConfig temperatureSim;
unsigned int getSimMemSizeInBytes();
unsigned int getDataBusWidth();
private:
Configuration();

View File

@@ -66,10 +66,7 @@ using namespace Data;
struct Dram : sc_module
{
unsigned int burstLength = Configuration::getInstance().memSpec.BurstLength;
// All DRAM chips on a DIMM operate in lockstep,
// which constituing aggregate data bus width = chip's bus width * # locksteep-operated chips
// The bus width is given in bits, e.g., 64-bit data bus, 128-bit data bus, etc.
unsigned int dataBusWidth = Configuration::getInstance().memSpec.bitWidth * Configuration::getInstance().NumberOfDevicesOnDIMM;
unsigned int dataBusWidth = Configuration::getInstance().getDataBusWidth();
// 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 = (burstLength * dataBusWidth) / 8;