RefMode (tRFC) is now only configurable during initialization.

This commit is contained in:
Lukas Steiner (2)
2019-07-02 16:25:43 +02:00
parent 41cc447d86
commit 34626448bb
12 changed files with 46 additions and 92 deletions

View File

@@ -332,7 +332,7 @@ std::string Configuration::getPathToResources()
{
return pathToResources;
}
// TODO: Never used
void Configuration::setParameters(std::map<std::string, std::string>
parameterMap)
{

View File

@@ -235,6 +235,7 @@ void ConfigurationLoader::loadDDR3(Configuration &config, XMLElement *xmlSpec)
memSpec->tFAW_ORGR = parameterExists(timings, "FAW_ORGR") ?
clk * queryUIntParameter(timings, "FAW_ORGR") : memSpec->tFAW;
memSpec->tREFI = clk * queryUIntParameter(timings, "REFI");
std::cout << "RefMode: " << Configuration::getInstance().getRefMode() << std::endl;
memSpec->tRFC = clk * queryUIntParameter(timings, "RFC");
memSpec->tRP = clk * queryUIntParameter(timings, "RP");
memSpec->tRP_ORGR = parameterExists(timings, "RP_ORGR") ?
@@ -261,11 +262,10 @@ void ConfigurationLoader::loadDDR3(Configuration &config, XMLElement *xmlSpec)
memSpec->tRFC_old = clk * queryUIntParameter(timings, "RFC");
memSpec->tREFI_old = clk * queryUIntParameter(timings, "REFI");
memSpec->refreshTimings.clear();
for (unsigned int i = 0; i < memSpec->NumberOfBanks; ++i) {
memSpec->refreshTimings.clear();
for (unsigned int i = 0; i < memSpec->NumberOfBanks; ++i)
memSpec->refreshTimings[Bank(i)] = RefreshTiming(memSpec->tRFC_old,
memSpec->tREFI_old);
}
memSpec->tREFI_old);
// Currents and Volatages: TODO Check if this is correct.
XMLElement *powers = xmlSpec->FirstChildElement("mempowerspec");
@@ -309,7 +309,13 @@ void ConfigurationLoader::loadDDR4(Configuration &config, XMLElement *xmlSpec)
memSpec->tFAW_ORGR = parameterExists(timings, "FAW_ORGR") ?
clk * queryUIntParameter(timings, "FAW_ORGR") : memSpec->tFAW;
memSpec->tREFI = clk * queryUIntParameter(timings, "REFI");
memSpec->tRFC = clk * queryUIntParameter(timings, "RFC");
unsigned refMode = Configuration::getInstance().getRefMode();
if (refMode == 1)
memSpec->tRFC = clk * queryUIntParameter(timings, "RFC");
else if (refMode == 2)
memSpec->tRFC = clk * queryUIntParameter(timings, "RFC2");
else // if (refMode == 4)
memSpec->tRFC = clk * queryUIntParameter(timings, "RFC4");
memSpec->tRP = clk * queryUIntParameter(timings, "RP");
memSpec->tRP_ORGR = parameterExists(timings, "RP_ORGR") ?
clk * queryUIntParameter(timings, "RP_ORGR") : memSpec->tRP;
@@ -324,9 +330,6 @@ void ConfigurationLoader::loadDDR4(Configuration &config, XMLElement *xmlSpec)
memSpec->tXPDLL = clk * queryUIntParameter(timings, "XPDLL");
memSpec->tXSDLL = clk * queryUIntParameter(timings, "XSDLL");
memSpec->tRFC2 = clk * queryUIntParameter(timings, "RFC2");
memSpec->tRFC4 = clk * queryUIntParameter(timings, "RFC4");
// TODO: old timings, will me removed
memSpec->tRP_old = clk * queryUIntParameter(timings, "RP");
@@ -339,16 +342,19 @@ void ConfigurationLoader::loadDDR4(Configuration &config, XMLElement *xmlSpec)
memSpec->tWTR_L_old = clk * queryUIntParameter(timings, "WTR_L");
memSpec->tXPDLL_old = clk * queryUIntParameter(timings, "XPDLL");
memSpec->tXSDLL_old = clk * queryUIntParameter(timings, "XSDLL");
memSpec->tRFC_old = clk * queryUIntParameter(timings, "RFC");
unsigned refMode_old = Configuration::getInstance().getRefMode();
if (refMode_old == 1)
memSpec->tRFC_old = clk * queryUIntParameter(timings, "RFC");
else if (refMode_old == 2)
memSpec->tRFC_old = clk * queryUIntParameter(timings, "RFC2");
else // if (refMode_old == 4)
memSpec->tRFC_old = clk * queryUIntParameter(timings, "RFC4");
memSpec->tREFI_old = clk * queryUIntParameter(timings, "REFI");
memSpec->refreshTimings.clear();
for (unsigned int i = 0; i < memSpec->NumberOfBanks; ++i) {
for (unsigned int i = 0; i < memSpec->NumberOfBanks; ++i)
memSpec->refreshTimings[Bank(i)] = RefreshTiming(memSpec->tRFC_old,
memSpec->tRFC2,
memSpec->tRFC4,
memSpec->tREFI_old);
}
memSpec->tREFI_old);
// Currents and Volatages:
XMLElement *powers = xmlSpec->FirstChildElement("mempowerspec");
@@ -422,11 +428,10 @@ void ConfigurationLoader::loadLPDDR4(Configuration &config, XMLElement *xmlSpec)
memSpec->tREFI_old = clk * queryUIntParameter(timings, "REFIAB");
memSpec->tRP_old = clk * queryUIntParameter(timings, "RPPB");
memSpec->refreshTimings.clear();
for (unsigned int i = 0; i < memSpec->NumberOfBanks; ++i) {
memSpec->refreshTimings.clear();
for (unsigned int i = 0; i < memSpec->NumberOfBanks; ++i)
memSpec->refreshTimings[Bank(i)] = RefreshTiming(memSpec->tRFC_old,
memSpec->tREFI_old);
}
memSpec->tREFI_old);
// Currents and Volatages:
XMLElement *powers = xmlSpec->FirstChildElement("mempowerspec");
@@ -493,11 +498,10 @@ void ConfigurationLoader::loadWideIO(Configuration &config, XMLElement *memspec)
memSpec->tRFC_old = clk * queryUIntParameter(timings, "RFC");
memSpec->tREFI_old = clk * queryUIntParameter(timings, "REFI");
memSpec->refreshTimings.clear();
for (unsigned int i = 0; i < memSpec->NumberOfBanks; ++i) {
memSpec->refreshTimings.clear();
for (unsigned int i = 0; i < memSpec->NumberOfBanks; ++i)
memSpec->refreshTimings[Bank(i)] = RefreshTiming(memSpec->tRFC_old,
memSpec->tREFI_old);
}
memSpec->tREFI_old);
// Currents and Volatages:
XMLElement *powers = memspec->FirstChildElement("mempowerspec");

View File

@@ -96,10 +96,8 @@ sc_time MemSpec::getExecutionTime(Command command, tlm::tlm_generic_payload &pay
else if (command == Command::PrechargeAll)
return tRP_old;
else if (command == Command::AutoRefresh)
{
return getElementFromMap(refreshTimings,
DramExtension::getExtension(payload).getBank()).tRFC;
}
DramExtension::getExtension(payload).getBank()).tRFC;
else if (command == Command::PDNAX || command == Command::PDNPX || command == Command::SREFX)
return clk;
else
@@ -132,15 +130,8 @@ sc_time MemSpecDDR4::getExecutionTime(Command command, tlm::tlm_generic_payload
return tRP_old;
else if (command == Command::AutoRefresh)
{
if (Configuration::getInstance().getRefMode() == 4)
return getElementFromMap(refreshTimings,
DramExtension::getExtension(payload).getBank()).tRFC4;
else if (Configuration::getInstance().getRefMode() == 2)
return getElementFromMap(refreshTimings,
DramExtension::getExtension(payload).getBank()).tRFC2;
else
return getElementFromMap(refreshTimings,
DramExtension::getExtension(payload).getBank()).tRFC;
return getElementFromMap(refreshTimings,
DramExtension::getExtension(payload).getBank()).tRFC;
}
else if (command == Command::PDNAX || command == Command::PDNPX || command == Command::SREFX)
return clk;

View File

@@ -46,13 +46,9 @@
struct RefreshTiming
{
RefreshTiming() {}
RefreshTiming(sc_time tRFC, sc_time tREFI) : tRFC(tRFC), tRFC2(SC_ZERO_TIME),
tRFC4(SC_ZERO_TIME), tREFI(tREFI) {}
RefreshTiming(sc_time tRFC, sc_time tRFC2, sc_time tRFC4,
sc_time tREFI) : tRFC(tRFC), tRFC2(tRFC2), tRFC4(tRFC4), tREFI(tREFI) {}
RefreshTiming(sc_time tRFC, sc_time tREFI) : tRFC(tRFC), tREFI(tREFI) {}
sc_time tRFC;
sc_time tRFC2;
sc_time tRFC4;
sc_time tREFI;
};
@@ -110,9 +106,6 @@ struct MemSpec
sc_time tNAW_old; // n activate window, TAW (two bank) in WideIO, FAW (four bank) else
sc_time tRP_old; // precharge-time (pre -> act same bank)
sc_time tRFC_old; // min ref->act delay 1X mode
// TODO: used in DDR4 and LPDDR4, remove in DramDDR3 and DramWideIO or everywhere
sc_time tRFC2; // min ref->act delay 2X mode
sc_time tRFC4; // min ref->act delay 4X mode
sc_time tREFI_old; // auto refresh must be issued at an average periodic interval tREFI
sc_time tCCD_S_old; // max(bl, tCCD) is relevant for rd->rd
sc_time tCCD_L_old;

View File

@@ -50,7 +50,7 @@ RefreshManager::RefreshManager(sc_module_name,
{
auto m = controllerCore.config.getRefMode();
tREFIx = timing.tREFI / m;
tRFCx = m == 4 ? timing.tRFC4 : m == 2 ? timing.tRFC2 : timing.tRFC;
tRFCx = timing.tRFC;
postponeEnabled = controllerCore.config.ControllerCoreRefEnablePostpone;
pullInEnabled = controllerCore.config.ControllerCoreRefEnablePullIn;
maxpostpone = controllerCore.config.ControllerCoreRefMaxPostponed * m;

View File

@@ -48,7 +48,7 @@ RefreshManagerBankwise::RefreshManagerBankwise(sc_module_name,
{
auto m = controllerCore.config.getRefMode();
tREFIx = timing.tREFI / m;
tRFCx = m == 4 ? timing.tRFC4 : m == 2 ? timing.tRFC2 : timing.tRFC;
tRFCx = timing.tRFC;
postponeEnabled = controllerCore.config.ControllerCoreRefEnablePostpone;
pullInEnabled = controllerCore.config.ControllerCoreRefEnablePullIn;
maxpostpone = controllerCore.config.ControllerCoreRefMaxPostponed * m;

View File

@@ -62,13 +62,7 @@ void ActBChecker::delayToSatisfyConstraints(ScheduledCommand &cmd) const
config.memSpec->tWL + config.memSpec->getWriteAccessTime()
+ config.memSpec->tWR + config.memSpec->tRP_old);
} else if (lcb.getCommand() == Command::AutoRefresh) {
auto m = Configuration::getInstance().getRefMode();
if (m == 4)
cmd.establishMinDistanceFromStart(lcb.getStart(), config.memSpec->tRFC4);
else if (m == 2)
cmd.establishMinDistanceFromStart(lcb.getStart(), config.memSpec->tRFC2);
else
cmd.establishMinDistanceFromStart(lcb.getStart(), config.memSpec->tRFC_old);
cmd.establishMinDistanceFromStart(lcb.getStart(), config.memSpec->tRFC_old);
} else if (lcb.getCommand() == Command::PDNPX
|| lcb.getCommand() == Command::PDNAX) {
cmd.establishMinDistanceFromStart(lcb.getStart(), config.memSpec->tXP);

View File

@@ -65,16 +65,8 @@ void ActivateChecker::delayToSatisfyConstraints(ScheduledCommand &command) const
config.memSpec->tWL + config.memSpec->getWriteAccessTime()
+ config.memSpec->tWR + config.memSpec->tRP_old);
} else if (lastCommandOnBank.getCommand() == Command::AutoRefresh) {
auto m = Configuration::getInstance().getRefMode();
if (m == 4)
command.establishMinDistanceFromStart(lastCommandOnBank.getStart(),
config.memSpec->tRFC4);
else if (m == 2)
command.establishMinDistanceFromStart(lastCommandOnBank.getStart(),
config.memSpec->tRFC2);
else
command.establishMinDistanceFromStart(lastCommandOnBank.getStart(),
config.memSpec->tRFC_old);
command.establishMinDistanceFromStart(lastCommandOnBank.getStart(),
config.memSpec->tRFC_old);
} else if (lastCommandOnBank.getCommand() == Command::PDNPX
|| lastCommandOnBank.getCommand() == Command::PDNAX) {
command.establishMinDistanceFromStart(lastCommandOnBank.getStart(),

View File

@@ -54,13 +54,7 @@ sc_time PowerDownChecker::getTimeConstraintToEnterPowerDown(Command lastCmd,
constraint = config.memSpec->tWL + config.memSpec->getWriteAccessTime() + config.memSpec->tWR +
config.memSpec->clk;
} else if (lastCmd == Command::AutoRefresh) {
auto m = Configuration::getInstance().getRefMode();
if (m == 4)
constraint = config.memSpec->tRFC4;
else if (m == 2)
constraint = config.memSpec->tRFC2;
else
constraint = config.memSpec->tRFC_old;
constraint = config.memSpec->tRFC_old;
} else if (lastCmd == Command::PDNPX || lastCmd == Command::PDNAX) {
constraint = config.memSpec->tXP;
} else if (lastCmd == Command::SREFX) {

View File

@@ -70,16 +70,8 @@ const
config.memSpec->tWL + config.memSpec->getWriteAccessTime() + config.memSpec->tWR +
config.memSpec->tRP_old);
} else if (lastCommand.getCommand() == Command::AutoRefresh) {
auto m = Configuration::getInstance().getRefMode();
if (m == 4)
command.establishMinDistanceFromStart(lastCommand.getStart(),
config.memSpec->tRFC4);
else if (m == 2)
command.establishMinDistanceFromStart(lastCommand.getStart(),
config.memSpec->tRFC2);
else
command.establishMinDistanceFromStart(lastCommand.getStart(),
config.memSpec->tRFC_old);
command.establishMinDistanceFromStart(lastCommand.getStart(),
config.memSpec->tRFC_old);
} else if (lastCommand.getCommand() == Command::PDNAX
|| lastCommand.getCommand() == Command::PDNPX) {
command.establishMinDistanceFromStart(lastCommand.getStart(),

View File

@@ -108,11 +108,6 @@ DRAMSys::DRAMSys(sc_module_name __attribute__((unused)) name,
AddressDecoder::getInstance().print();
ConfigurationLoader::loadMemSpec(Configuration::getInstance(),
pathToResources
+ "configs/memspecs/"
+ memspec);
// Setup the memory controller with the propriate xml file
ConfigurationLoader::loadMCConfig(Configuration::getInstance(),
pathToResources
@@ -129,6 +124,11 @@ DRAMSys::DRAMSys(sc_module_name __attribute__((unused)) name,
+ "configs/thermalsim/"
+ thermalconfig);
ConfigurationLoader::loadMemSpec(Configuration::getInstance(),
pathToResources
+ "configs/memspecs/"
+ memspec);
// If a simulation file is passed as argument to DRAMSys the simulation ID
// is prepended to the simulation name if found.
std::string simName;

View File

@@ -108,13 +108,7 @@ Dram::Dram(sc_module_name) : tSocket("socket")
memTimingSpec.RC = memSpec->tRC / clk;
memTimingSpec.RCD = memSpec->tRCD / clk;
memTimingSpec.REFI = memSpec->tREFI_old / clk;
unsigned m = Configuration::getInstance().getRefMode();
if (m == 4)
memTimingSpec.RFC = memSpec->tRFC4 / clk;
else if (m == 2)
memTimingSpec.RFC = memSpec->tRFC2 / clk;
else
memTimingSpec.RFC = memSpec->tRFC_old / clk;
memTimingSpec.RFC = memSpec->tRFC_old / clk;
memTimingSpec.RL = memSpec->tRL / clk;
memTimingSpec.RP = memSpec->tRP_old / clk;
memTimingSpec.RRD = memSpec->tRRD_S_old / clk;