Function to get the width of the data bus.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -101,6 +101,7 @@ struct Configuration
|
||||
TemperatureSimConfig temperatureSim;
|
||||
|
||||
unsigned int getSimMemSizeInBytes();
|
||||
unsigned int getDataBusWidth();
|
||||
|
||||
private:
|
||||
Configuration();
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user