PowerDownChecker and release build setting added

This commit is contained in:
Janik Schlemminger
2014-04-12 11:44:27 +02:00
parent 3914f4678b
commit a1444a4d7b
28 changed files with 285 additions and 112 deletions

View File

@@ -19,7 +19,7 @@
<builder autoBuildTarget="all" buildPath="${workspace_loc:/dram}/build-simulation" cleanBuildTarget="clean" enableAutoBuild="false" id="org.eclipse.cdt.build.core.internal.builder.1698165306" incrementalBuildTarget="all" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="org.eclipse.cdt.build.core.internal.builder"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1509734096" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool command="/opt/gcc/bin/g++" id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.789860529" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug">
<option id="gnu.cpp.compiler.exe.debug.option.optimization.level.2041174282" name="Optimization Level" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
<option id="gnu.cpp.compiler.exe.debug.option.optimization.level.2041174282" name="Optimization Level" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.exe.debug.option.debugging.level.2092267417" name="Debug Level" superClass="gnu.cpp.compiler.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.include.paths.1823643375" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="/opt/systemc/include"/>
@@ -36,7 +36,7 @@
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1847876781" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool command="/opt/gcc/bin/g++" id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.151665950" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.exe.debug.option.optimization.level.1290346028" name="Optimization Level" superClass="gnu.c.compiler.exe.debug.option.optimization.level" valueType="enumerated"/>
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.exe.debug.option.optimization.level.1290346028" name="Optimization Level" superClass="gnu.c.compiler.exe.debug.option.optimization.level" value="gnu.c.optimization.level.most" valueType="enumerated"/>
<option id="gnu.c.compiler.exe.debug.option.debugging.level.1471334523" name="Debug Level" superClass="gnu.c.compiler.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option id="gnu.c.compiler.option.include.paths.1530954752" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="/opt/systemc-2.3.0/include"/>
@@ -91,6 +91,97 @@
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.513647443.1530924826">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.513647443.1530924826" moduleId="org.eclipse.cdt.core.settings" name="release-simulation">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="release optimized and no debug" id="cdt.managedbuild.config.gnu.exe.debug.513647443.1530924826" name="release-simulation" parent="cdt.managedbuild.config.gnu.exe.debug">
<folderInfo id="cdt.managedbuild.config.gnu.exe.debug.513647443.1530924826." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.exe.debug.873153013" name="Linux GCC" nonInternalBuilderId="cdt.managedbuild.target.gnu.builder.exe.debug" superClass="cdt.managedbuild.toolchain.gnu.exe.debug">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.debug.702821554" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.debug"/>
<builder autoBuildTarget="all" buildPath="${workspace_loc:/dram}/build-simulation" cleanBuildTarget="clean" enableAutoBuild="false" id="org.eclipse.cdt.build.core.internal.builder.1967754792" incrementalBuildTarget="all" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="org.eclipse.cdt.build.core.internal.builder"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1523361679" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool command="/opt/gcc/bin/g++" id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1616160496" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug">
<option id="gnu.cpp.compiler.exe.debug.option.optimization.level.1476640436" name="Optimization Level" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
<option id="gnu.cpp.compiler.exe.debug.option.debugging.level.2084361110" name="Debug Level" superClass="gnu.cpp.compiler.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.include.paths.1815741005" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="/opt/systemc/include"/>
<listOptionValue builtIn="false" value="/opt/gmock-1.7.0/include"/>
</option>
<option id="gnu.cpp.compiler.option.preprocessor.def.573530070" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" valueType="definedSymbols">
<listOptionValue builtIn="false" value="SC_INCLUDE_DYNAMIC_PROCESSES"/>
<listOptionValue builtIn="false" value="NDEBUG"/>
<listOptionValue builtIn="false" value="TIXML_USE_STL"/>
</option>
<option id="gnu.cpp.compiler.option.other.other.1076043381" name="Other flags" superClass="gnu.cpp.compiler.option.other.other" value="-c -fmessage-length=0 -std=c++11 -fprofile-arcs -ftest-coverage" valueType="string"/>
<option id="gnu.cpp.compiler.option.debugging.prof.991369502" name="Generate prof information (-p)" superClass="gnu.cpp.compiler.option.debugging.prof" value="false" valueType="boolean"/>
<option id="gnu.cpp.compiler.option.debugging.gprof.1800798786" name="Generate gprof information (-pg)" superClass="gnu.cpp.compiler.option.debugging.gprof" value="false" valueType="boolean"/>
<option id="gnu.cpp.compiler.option.dialect.std.739859284.898203370" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" value="gnu.cpp.compiler.dialect.default" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.2017055434" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool command="/opt/gcc/bin/g++" id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1819935674" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.exe.debug.option.optimization.level.332808037" name="Optimization Level" superClass="gnu.c.compiler.exe.debug.option.optimization.level" value="gnu.c.optimization.level.most" valueType="enumerated"/>
<option id="gnu.c.compiler.exe.debug.option.debugging.level.970853808" name="Debug Level" superClass="gnu.c.compiler.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option id="gnu.c.compiler.option.include.paths.1587784758" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="/opt/systemc-2.3.0/include"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/dram/dram/src}&quot;"/>
<listOptionValue builtIn="false" value="/opt/gmock-1.7.0/include"/>
<listOptionValue builtIn="false" value="../dram/dram/src"/>
</option>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.2899989" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">
<listOptionValue builtIn="false" value="SC_INCLUDE_DYNAMIC_PROCESSES"/>
<listOptionValue builtIn="false" value="TIXML_USE_STL"/>
</option>
<option id="gnu.c.compiler.option.dialect.std.544879672.1958185063" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1172903636" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.1479682613" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug"/>
<tool command="/opt/gcc/bin/g++" id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.756635529" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug">
<option id="gnu.cpp.link.option.libs.81793090" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
<listOptionValue builtIn="false" value="systemc"/>
<listOptionValue builtIn="false" value="sqlite3"/>
<listOptionValue builtIn="false" value="gcov"/>
<listOptionValue builtIn="false" value="pthread"/>
</option>
<option id="gnu.cpp.link.option.paths.897051210" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
<listOptionValue builtIn="false" value="/opt/systemc/lib-linux64"/>
</option>
<option id="gnu.cpp.link.option.debugging.prof.1500435213" name="Generate prof information (-p)" superClass="gnu.cpp.link.option.debugging.prof" value="false" valueType="boolean"/>
<option id="gnu.cpp.link.option.debugging.gprof.347759537" name="Generate gprof information (-pg)" superClass="gnu.cpp.link.option.debugging.gprof" value="false" valueType="boolean"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.2011514805" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool command="as" id="cdt.managedbuild.tool.gnu.assembler.exe.debug.1883832395" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.debug">
<option id="gnu.both.asm.option.include.paths.241845674" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="/opt/systemc-2.3.0/include"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/dram/dram/src}&quot;"/>
<listOptionValue builtIn="false" value="/opt/gmock-1.7.0/include"/>
<listOptionValue builtIn="false" value="../dram/dram/src"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1234202782" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry excluding="testing|src" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src/common"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src/core"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src/scheduler"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src/simulation"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="DRAM.cdt.managedbuild.target.gnu.exe.355512678" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>

View File

@@ -10,4 +10,14 @@
</provider>
</extension>
</configuration>
<configuration id="cdt.managedbuild.config.gnu.exe.debug.513647443.1530924826" name="release-simulation">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-2055719358" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} -E -P -v -dD &quot;${INPUTS}&quot; -std=c++11">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
</extension>
</configuration>
</project>

View File

@@ -1,10 +1,10 @@
<memspec>
<memconfig>
<parameter id="bankwiseLogic" type="bool" value="0" />
<parameter id="bankwiseLogic" type="bool" value="1" />
<parameter id="openPagePolicy" type="bool" value="1" />
<parameter id="adaptiveOpenPagePolicy" type="bool" value="0" />
<parameter id="refreshAwareScheduling" type="bool" value="0" />
<parameter id="maxNrOfTransactionsInDram" type="uint" value="1" />
<parameter id="maxNrOfTransactionsInDram" type="uint" value="50" />
<parameter id="scheduler" type="string" value="FR_FCFS" />
<parameter id="capsize" type="uint" value="5" />
</memconfig>

View File

@@ -9,14 +9,9 @@
using namespace std;
DebugManager& DebugManager::getInstance()
{
static DebugManager manager;
return manager;
}
void DebugManager::printDebugMessage(string sender, string message)
{
#ifndef NDEBUG
if (whiteList.count(sender))
{
if (writeToConsole)
@@ -25,6 +20,7 @@ void DebugManager::printDebugMessage(string sender, string message)
if (writeToFile)
debugFile << " at " << sc_time_stamp() << " in " << sender << "\t: " << message << "\n";
}
#endif
}
void DebugManager::addToWhiteList(string sender)

View File

@@ -16,7 +16,11 @@ class DebugManager
{
public:
~DebugManager();
static DebugManager& getInstance();
static inline DebugManager& getInstance()
{
static DebugManager manager;
return manager;
}
bool writeToConsole;
bool writeToFile;

View File

@@ -29,9 +29,9 @@ unsigned int queryUIntParameter(XMLElement* node, string name)
{
if (element->Attribute("id") == name)
{
assert(!strcmp(element->Attribute("type"), "uint"));
sc_assert(!strcmp(element->Attribute("type"), "uint"));
XMLError error = element->QueryIntAttribute("value", &result);
assert(!error);
sc_assert(!error);
return result;
}
}
@@ -63,9 +63,9 @@ double queryDoubleParameter(XMLElement* node, string name)
{
if (element->Attribute("id") == name)
{
assert(!strcmp(element->Attribute("type"), "double"));
sc_assert(!strcmp(element->Attribute("type"), "double"));
XMLError error = element->QueryDoubleAttribute("value", &result);
assert(!error);
sc_assert(!error);
return result;
}
}
@@ -83,9 +83,9 @@ bool queryBoolParameter(XMLElement* node, string name)
{
if (element->Attribute("id") == name)
{
assert(!strcmp(element->Attribute("type"), "bool"));
sc_assert(!strcmp(element->Attribute("type"), "bool"));
XMLError error = element->QueryBoolAttribute("value", &result);
assert(!error);
sc_assert(!error);
return result;
}
}

View File

@@ -1,5 +1,4 @@
#include "dramExtension.h"
#include <assert.h>
#include "../core/configuration/Configuration.h"
#include "map"
@@ -12,10 +11,8 @@ DramExtension& DramExtension::getExtension(const tlm_generic_payload *payload)
{
DramExtension *result = NULL;
payload->get_extension(result);
if(result == NULL)
{
SC_REPORT_FATAL("DRAM Extension","Extension is null.");
}
sc_assert(result!=NULL);
return *result;
}
@@ -55,7 +52,7 @@ BankGroup Bank::getBankGroup()
if (bankgroups.size() == 0)
{
core::Configuration& config = core::Configuration::getInstance();
SC_ASSERT_(config.NumberOfBanks % config.NumberOfBankGroups == 0, "Number of banks must be a multiple of number of bankgroups");
sc_assert(config.NumberOfBanks % config.NumberOfBankGroups == 0);
for (unsigned int bank = 0; bank < config.NumberOfBanks; bank++)
{

View File

@@ -81,7 +81,7 @@ distribution.
# define TIXMLASSERT( x ) if ( !(x)) { __debugbreak(); } //if ( !(x)) WinDebugBreak()
# elif defined (ANDROID_NDK)
# include <android/log.h>
# define TIXMLASSERT( x ) if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); }
# define TIXMLASSERT( x ) if ( !(x)) { __android_log_assert( "assert", "grinliz", "assert in '%s' at %d.", __FILE__, __LINE__ ); }
# else
# include <assert.h>
# define TIXMLASSERT assert

View File

@@ -69,7 +69,7 @@ xmlAddressDecoder::xmlAddressDecoder(string addressConfigURI)
}
else
{
SC_REPORT_ERROR("xmlAddressDecoder can not find ", addressConfigURI.c_str());
SC_REPORT_FATAL("xmlAddressDecoder can not find ", addressConfigURI.c_str());
}
}

View File

@@ -13,6 +13,7 @@
#include "scheduling/checker/ReadChecker.h"
#include "scheduling/checker/WriteChecker.h"
#include "scheduling/checker/RefreshChecker.h"
#include "scheduling/checker/PowerDownChecker.h"
#include "refresh/RefreshManagerBankwise.h"
#include "refresh/RefreshManager.h"
#include "../common/dramExtension.h"
@@ -39,6 +40,12 @@ ControllerCore::ControllerCore(IWrapperConnector& wrapperConnector, std::map<Ban
commandChecker[Command::WriteA] = commandChecker[Command::Write];
commandChecker[Command::AutoRefresh] = new RefreshChecker(config, state);
commandChecker[Command::PDNA] = new PowerDownChecker(config, state);
commandChecker[Command::PDNP] = commandChecker[Command::PDNA];
commandChecker[Command::SREF] = commandChecker[Command::PDNA];
commandChecker[Command::PDNAX] = commandChecker[Command::PDNA];
commandChecker[Command::PDNPX] = commandChecker[Command::PDNA];
commandChecker[Command::SREFX] = commandChecker[Command::PDNA];
if (config.BankwiseLogic)
{
@@ -59,6 +66,7 @@ ControllerCore::~ControllerCore()
delete commandChecker[Command::Read];
delete commandChecker[Command::Write];
delete commandChecker[Command::AutoRefresh];
delete commandChecker[Command::PDNA];
delete refreshManager;
delete powerDownManager;
}
@@ -128,13 +136,14 @@ bool ControllerCore::isBusy(sc_time time, Bank bank)
{
return (time < lastScheduledCommand.getEnd());
}
else if (lastScheduledCommand.commandIsIn( { Command::SREFX, Command::PDNPX, Command::PDNAX }))
else if (lastScheduledCommand.commandIsIn( { Command::SREFX, Command::PDNPX, Command::PDNAX, Command::SREF, Command::PDNP,
Command::PDNA }))
{
return false;
}
else
{
SC_ASSERT_(false, "last command in command sequence was activate or precharge");
SC_REPORT_FATAL("Core", "Last command in command sequence was activate or precharge. This really doesn't make sense :D.");
return false;
}

View File

@@ -86,7 +86,6 @@ sc_time getExecutionTime(Command command,tlm::tlm_generic_payload& payload)
}
else if(command == Command::PDNA || command == Command::PDNP)
{
assert(config.tCKE == config.clk * 3);
return config.tCKE;
}
else if(command == Command::SREF)

View File

@@ -91,7 +91,9 @@ void MemSpecLoader::loadDDR4(Configuration& config, XMLElement* memspec)
config.Timings.tCKESR = clk * queryUIntParameter(timings, "CKESR");
config.Timings.tCKE = clk * queryUIntParameter(timings, "CKE");
config.Timings.tXP = clk * queryUIntParameter(timings, "XP");
config.Timings.tXPDLL = clk * queryUIntParameter(timings, "XPDLL");
config.Timings.tXSR = clk * queryUIntParameter(timings, "XS");
config.Timings.tXSRDLL = clk * queryUIntParameter(timings, "XSDLL");
config.Timings.tAL = clk * queryUIntParameter(timings, "AL");
config.Timings.tRFC = clk * queryUIntParameter(timings, "RFC");
config.Timings.tREFI = clk * queryUIntParameter(timings, "REFI");
@@ -140,7 +142,9 @@ void MemSpecLoader::loadWideIO(Configuration& config, XMLElement* memspec)
config.Timings.tCKESR = clk * queryUIntParameter(timings, "CKESR");
config.Timings.tCKE = clk * queryUIntParameter(timings, "CKE");
config.Timings.tXP = clk * queryUIntParameter(timings, "XP");
config.Timings.tXPDLL = config.Timings.tXP;
config.Timings.tXSR = clk * queryUIntParameter(timings, "XS");
config.Timings.tXSRDLL = config.Timings.tXSR;
config.Timings.tAL = clk * queryUIntParameter(timings, "AL");
config.Timings.tRFC = clk * queryUIntParameter(timings, "RFC");
config.Timings.tREFI = clk * queryUIntParameter(timings, "REFI");

View File

@@ -46,7 +46,9 @@ struct TimingConfiguration
sc_time tCKESR; //min time in sref
sc_time tCKE; //min time in pdna or pdnp
sc_time tXP; //min delay to row access command after pdnpx pdnax
sc_time tXPDLL; //min delay to row access command after pdnpx pdnax for dll commands
sc_time tXSR; //min delay to row access command after srefx
sc_time tXSRDLL; //min delay to row access command after srefx for dll commands
sc_time tAL; //additive delay (delayed execution in dram)
sc_time tRFC; //min ref->act delay

View File

@@ -59,11 +59,11 @@ void PowerDownManager::sleep(Bank bank, sc_time time)
}
}
ScheduledCommand pdn(IPowerDownManager::getSleepCommand(state), time,
getExecutionTime(IPowerDownManager::getSleepCommand(state), powerDownPayloads[bank]),
Command cmd = IPowerDownManager::getSleepCommand(state);
ScheduledCommand pdn(cmd, time, getExecutionTime(cmd, powerDownPayloads[bank]),
DramExtension::getExtension(powerDownPayloads[bank]));
controller.state.bus.moveCommandToNextFreeSlot(pdn);
controller.getCommandChecker(cmd).delayToSatisfyConstraints(pdn);
if (state != PowerDownState::PDNSelfRefresh && controller.refreshManager->hasCollision(pdn))
{
@@ -71,7 +71,7 @@ void PowerDownManager::sleep(Bank bank, sc_time time)
}
else
{
setState(state);
setPowerDownState(state);
sendPowerDownPayloads(pdn);
}
}
@@ -80,33 +80,19 @@ void PowerDownManager::wakeUp(Bank bank, sc_time time)
{
if (isAwakeForRefresh()) //Request enters system during Refresh
{
setState(PowerDownState::Awake);
setPowerDownState(PowerDownState::Awake);
}
else if (isInPowerDown()) //Request wakes up power down
{
sc_time startOfExitCommand(SC_ZERO_TIME);
switch (powerDownState)
{
case PowerDownState::PDNActive:
startOfExitCommand = max(time, controller.state.getLastCommand(Command::PDNA).getEnd());
break;
case PowerDownState::PDNPrecharge:
startOfExitCommand = max(time, controller.state.getLastCommand(Command::PDNP).getEnd());
break;
case PowerDownState::PDNSelfRefresh:
startOfExitCommand = max(time, controller.state.getLastCommand(Command::SREF).getEnd());
controller.refreshManager->reInitialize(bank,
startOfExitCommand + getExecutionTime(Command::SREFX, powerDownPayloads[bank]));
break;
default:
break;
}
Command cmd = IPowerDownManager::getWakeUpCommand(powerDownState);
ScheduledCommand pdn(cmd, startOfExitCommand, getExecutionTime(cmd, powerDownPayloads[bank]),
ScheduledCommand pdn(cmd, time, getExecutionTime(cmd, powerDownPayloads[bank]),
DramExtension::getExtension(powerDownPayloads[bank]));
controller.getCommandChecker(cmd).delayToSatisfyConstraints(pdn);
setState(PowerDownState::Awake);
if (cmd == Command::SREFX)
controller.refreshManager->reInitialize(bank, pdn.getEnd());
setPowerDownState(PowerDownState::Awake);
sendPowerDownPayloads(pdn);
}
}
@@ -119,7 +105,7 @@ void PowerDownManager::wakeUpForRefresh(Bank bank, sc_time time)
ScheduledCommand pdn(cmd, time, getExecutionTime(cmd, powerDownPayloads[bank]),
DramExtension::getExtension(powerDownPayloads[bank]));
setState(PowerDownState::AwakeForRefresh);
setPowerDownState(PowerDownState::AwakeForRefresh);
sendPowerDownPayloads(pdn);
}
}
@@ -137,7 +123,7 @@ void PowerDownManager::sendPowerDownPayloads(ScheduledCommand& cmd)
}
}
void PowerDownManager::setState(PowerDownState state)
void PowerDownManager::setPowerDownState(PowerDownState state)
{
powerDownState = state;
DebugManager::getInstance().printDebugMessage(PowerDownManagerBankwise::senderName,

View File

@@ -31,7 +31,7 @@ private:
bool isInPowerDown();
void setState(PowerDownState state);
void setPowerDownState(PowerDownState state);
bool canSleep();
bool isAwakeForRefresh();
std::map<Bank, tlm::tlm_generic_payload> powerDownPayloads;

View File

@@ -53,8 +53,9 @@ void PowerDownManagerBankwise::sleep(Bank bank, sc_time time)
}
}
ScheduledCommand pdn(IPowerDownManager::getSleepCommand(state), time, minTime, DramExtension::getExtension(payload));
controller.state.bus.moveCommandToNextFreeSlot(pdn);
Command cmd = IPowerDownManager::getSleepCommand(state);
ScheduledCommand pdn(cmd, time, minTime, DramExtension::getExtension(payload));
controller.getCommandChecker(cmd).delayToSatisfyConstraints(pdn);
if (state != PowerDownState::PDNSelfRefresh && controller.refreshManager->hasCollision(pdn))
{
@@ -76,27 +77,13 @@ void PowerDownManagerBankwise::wakeUp(Bank bank, sc_time time)
else if (isInPowerDown(bank))
{
//Request wakes up power down
sc_time startOfExitCommand(SC_ZERO_TIME);
switch (powerDownStates[bank])
{
case PowerDownState::PDNActive:
startOfExitCommand = max(time, controller.state.getLastCommand(Command::PDNA).getEnd());
break;
case PowerDownState::PDNPrecharge:
startOfExitCommand = max(time, controller.state.getLastCommand(Command::PDNP).getEnd());
break;
case PowerDownState::PDNSelfRefresh:
startOfExitCommand = max(time, controller.state.getLastCommand(Command::SREF).getEnd());
controller.refreshManager->reInitialize(bank,
startOfExitCommand + getExecutionTime(Command::SREFX, powerDownPayloads[bank]));
break;
default:
break;
}
Command cmd = IPowerDownManager::getWakeUpCommand(powerDownStates[bank]);
ScheduledCommand pdn(cmd, startOfExitCommand, getExecutionTime(cmd, powerDownPayloads[bank]),
ScheduledCommand pdn(cmd, time, getExecutionTime(cmd, powerDownPayloads[bank]),
DramExtension::getExtension(powerDownPayloads[bank]));
controller.getCommandChecker(cmd).delayToSatisfyConstraints(pdn);
if (cmd == Command::SREFX)
controller.refreshManager->reInitialize(bank, pdn.getEnd());
setState(PowerDownState::Awake, bank);
sendPowerDownPayload(pdn);
@@ -108,7 +95,8 @@ void PowerDownManagerBankwise::wakeUpForRefresh(Bank bank, sc_time time)
if (isInPowerDown(bank))
{
Command cmd = IPowerDownManager::getWakeUpCommand(powerDownStates[bank]);
ScheduledCommand pdn(cmd, time, getExecutionTime(cmd, powerDownPayloads[bank]), DramExtension::getExtension(powerDownPayloads[bank]));
ScheduledCommand pdn(cmd, time, getExecutionTime(cmd, powerDownPayloads[bank]),
DramExtension::getExtension(powerDownPayloads[bank]));
setState(PowerDownState::AwakeForRefresh, bank);
sendPowerDownPayload(pdn);

View File

@@ -19,8 +19,8 @@ namespace core {
void ActivateChecker::delayToSatisfyConstraints(ScheduledCommand& command) const
{
sc_assert(command.getCommand() == Command::Activate);
ScheduledCommand lastCommandOnBank = state.getLastScheduledCommand(command.getBank());
ScheduledCommand lastCommandOnBank = state.getLastScheduledCommand(command.getBank());
if (lastCommandOnBank.isValidCommand())
{
if (isIn(lastCommandOnBank.getCommand(), { Command::Precharge, Command::AutoRefresh,

View File

@@ -0,0 +1,44 @@
/*
* PowerDownChecker.cpp
*
* Created on: Apr 11, 2014
* Author: jonny
*/
#include "PowerDownChecker.h"
namespace core {
void PowerDownChecker::delayToSatisfyConstraints(ScheduledCommand& command) const
{
sc_assert(
command.commandIsIn(
{ Command::SREF, Command::PDNA, Command::PDNP, Command::PDNAX, Command::PDNPX, Command::SREFX }));
if (command.commandIsIn( { Command::SREF, Command::PDNA, Command::PDNP }))
{
ScheduledCommand lastCommandOnBank = state.getLastScheduledCommand(command.getBank());
if (lastCommandOnBank.isValidCommand()
&& lastCommandOnBank.commandIsIn( { Command::Read, Command::ReadA, Command::WriteA }))
{
command.delayToMeetConstraint(lastCommandOnBank.getEnd(), config.Timings.clk);
}
}
else if (command.getCommand() == Command::PDNAX)
{
command.delayToMeetConstraint(state.getLastCommand(Command::PDNA).getStart(), config.Timings.tCKE);
}
else if (command.getCommand() == Command::PDNPX)
{
command.delayToMeetConstraint(state.getLastCommand(Command::PDNP).getStart(), config.Timings.tCKE);
}
else if (command.getCommand() == Command::SREFX)
{
command.delayToMeetConstraint(state.getLastCommand(Command::SREF).getStart(), config.Timings.tCKESR);
}
state.bus.moveCommandToNextFreeSlot(command);
}
} /* namespace core */

View File

@@ -0,0 +1,38 @@
/*
* PowerDownChecker.h
*
* Created on: Apr 11, 2014
* Author: jonny
*/
#ifndef POWERDOWNCHECKER_H_
#define POWERDOWNCHECKER_H_
#include "../../ControllerState.h"
#include "../../configuration/Configuration.h"
#include "ICommandChecker.h"
#include <systemc>
namespace core {
class PowerDownChecker : public ICommandChecker
{
public:
PowerDownChecker(const Configuration& config, ControllerState& state) :
config(config), state(state)
{
}
virtual ~PowerDownChecker()
{
}
virtual void delayToSatisfyConstraints(ScheduledCommand& command) const override;
private:
const Configuration& config;
ControllerState& state;
};
} /* namespace core */
#endif /* POWERDOWNCHECKER_H_ */

View File

@@ -43,7 +43,6 @@ void PrechargeAllChecker::delayToSatisfyConstraints(ScheduledCommand& command) c
}
else if (lastCommand.commandIsIn( { Command::ReadA, Command::AutoRefresh }))
{
command.delayToMeetConstraint(lastCommand.getEnd(), SC_ZERO_TIME);
}
else

View File

@@ -12,9 +12,7 @@ namespace core {
void PrechargeChecker::delayToSatisfyConstraints(ScheduledCommand& command) const
{
sc_assert(
command.getCommand() == Command::Precharge
|| command.getCommand() == Command::PrechargeAll);
sc_assert(command.getCommand() == Command::Precharge);
ScheduledCommand lastCommand = state.getLastScheduledCommand(command.getBank());
@@ -23,7 +21,7 @@ void PrechargeChecker::delayToSatisfyConstraints(ScheduledCommand& command) cons
if (lastCommand.getCommand() == Command::Read)
{
command.delayToMeetConstraint(lastCommand.getStart(),
max(config.Timings.tRTP , lastCommand.getIntervalOnDataStrobe().getLength()));
max(config.Timings.tRTP, lastCommand.getIntervalOnDataStrobe().getLength()));
}
else if (lastCommand.getCommand() == Command::Write)
{
@@ -31,11 +29,10 @@ void PrechargeChecker::delayToSatisfyConstraints(ScheduledCommand& command) cons
}
else if (lastCommand.getCommand() == Command::PDNAX)
{
command.delayToMeetConstraint(lastCommand.getEnd(), config.Timings.tXP);//TODO right?
command.delayToMeetConstraint(lastCommand.getEnd(), config.Timings.tXP);
}
else
reportFatal("Precharge Checker",
"Precharge can not follow " + commandToString(lastCommand.getCommand()));
reportFatal("Precharge Checker", "Precharge can not follow " + commandToString(lastCommand.getCommand()));
}
state.bus.moveCommandToNextFreeSlot(command);

View File

@@ -13,7 +13,9 @@ namespace core {
void ReadChecker::delayToSatisfyConstraints(ScheduledCommand& command) const
{
assert(command.getCommand() == Command::Read || command.getCommand() == Command::ReadA);
sc_assert(command.getCommand() == Command::Read || command.getCommand() == Command::ReadA);
delayToSatisfyDLL(command);
ScheduledCommand lastCommand = state.getLastScheduledCommand(command.getBank());
@@ -27,9 +29,9 @@ void ReadChecker::delayToSatisfyConstraints(ScheduledCommand& command) const
|| lastCommand.getCommand() == Command::Write)
{
}
else if (lastCommand.getCommand() == Command::PDNAX)
else if (lastCommand.getCommand() == Command::PDNAX || lastCommand.getCommand() == Command::PDNPX)
{
command.delayToMeetConstraint(lastCommand.getStart(), config.Timings.tXP);//TODO DLL also for PDNP and SREF .. not onyl last command
command.delayToMeetConstraint(lastCommand.getStart(), config.Timings.tXP);//TODO DLL ??
}
else
reportFatal("Read Checker",
@@ -42,6 +44,7 @@ void ReadChecker::delayToSatisfyConstraints(ScheduledCommand& command) const
}
}
bool ReadChecker::collidesOnDataStrobe(ScheduledCommand& read) const
{
for (ScheduledCommand& strobeCommand : state.lastDataStrobeCommands)
@@ -97,4 +100,12 @@ bool ReadChecker::collidesWithStrobeCommand(ScheduledCommand& read,
}
}
void ReadChecker::delayToSatisfyDLL(ScheduledCommand& read) const
{
ScheduledCommand lastSREFX = state.getLastCommand(Command::SREFX, read.getBank());
if(lastSREFX.isValidCommand())
read.delayToMeetConstraint(lastSREFX.getStart(), config.Timings.tXSRDLL);
}
} /* namespace controller */

View File

@@ -25,6 +25,8 @@ public:
private:
const Configuration& config;
ControllerState& state;
void delayToSatisfyDLL(ScheduledCommand& read) const;
bool collidesOnDataStrobe(ScheduledCommand& read) const;
bool collidesWithStrobeCommand(ScheduledCommand& read, ScheduledCommand& strobeCommand) const;
};

View File

@@ -13,7 +13,7 @@ namespace core {
void WriteChecker::delayToSatisfyConstraints(ScheduledCommand& command) const
{
assert(command.getCommand() == Command::Write || command.getCommand() == Command::WriteA);
sc_assert(command.getCommand() == Command::Write || command.getCommand() == Command::WriteA);
ScheduledCommand lastCommand = state.getLastScheduledCommand(command.getBank());
@@ -23,8 +23,7 @@ void WriteChecker::delayToSatisfyConstraints(ScheduledCommand& command) const
{
command.delayToMeetConstraint(lastCommand.getEnd(), SC_ZERO_TIME);
}
else if (lastCommand.getCommand() == Command::Read
|| lastCommand.getCommand() == Command::Write)
else if (lastCommand.getCommand() == Command::Read || lastCommand.getCommand() == Command::Write)
{
}
@@ -33,8 +32,7 @@ void WriteChecker::delayToSatisfyConstraints(ScheduledCommand& command) const
command.delayToMeetConstraint(lastCommand.getStart(), config.Timings.tXP);
}
else
reportFatal("Write Checker",
"Write can not follow " + commandToString(lastCommand.getCommand()));
reportFatal("Write Checker", "Write can not follow " + commandToString(lastCommand.getCommand()));
}
while (!state.bus.isFree(command.getStart()) || collidesOnDataStrobe(command))
@@ -54,12 +52,10 @@ bool WriteChecker::collidesOnDataStrobe(ScheduledCommand& write) const
return false;
}
bool WriteChecker::collidesWithStrobeCommand(ScheduledCommand& write,
ScheduledCommand& strobeCommand) const
bool WriteChecker::collidesWithStrobeCommand(ScheduledCommand& write, ScheduledCommand& strobeCommand) const
{
//write to write
if (strobeCommand.getCommand() == Command::Write
|| strobeCommand.getCommand() == Command::WriteA)
if (strobeCommand.getCommand() == Command::Write || strobeCommand.getCommand() == Command::WriteA)
{
bool collision = write.collidesOnDataStrobe(strobeCommand);
@@ -70,8 +66,7 @@ bool WriteChecker::collidesWithStrobeCommand(ScheduledCommand& write,
return collision || casToCas;
}
else if (strobeCommand.getCommand() == Command::Read
|| strobeCommand.getCommand() == Command::ReadA)
else if (strobeCommand.getCommand() == Command::Read || strobeCommand.getCommand() == Command::ReadA)
{
//write to read
if (strobeCommand.getStart() >= write.getStart())
@@ -80,8 +75,7 @@ bool WriteChecker::collidesWithStrobeCommand(ScheduledCommand& write,
(write.getBank().getBankGroup() == strobeCommand.getBank().getBankGroup()) ?
config.Timings.tWTR_L : config.Timings.tWTR_S;
return strobeCommand.getStart()
< clkAlign(write.getIntervalOnDataStrobe().end, Alignment::DOWN) + tWTR;
return strobeCommand.getStart() < clkAlign(write.getIntervalOnDataStrobe().end, Alignment::DOWN) + tWTR;
}
//read to write
else
@@ -92,8 +86,7 @@ bool WriteChecker::collidesWithStrobeCommand(ScheduledCommand& write,
else
{
reportFatal("Write Checker",
"Invalid strobeCommand in data strobe commands "
+ commandToString(strobeCommand.getCommand()));
"Invalid strobeCommand in data strobe commands " + commandToString(strobeCommand.getCommand()));
return true;
}
}

View File

@@ -85,7 +85,7 @@ gp* FR_FCFS::getTransactionForBank(Bank bank)
gp* FR_FCFS::popOldest(Bank bank)
{
assert(hasTransactionForBank(bank));
sc_assert(hasTransactionForBank(bank));
gp* result = buffer[bank].front();
buffer[bank].pop_front();

View File

@@ -49,7 +49,7 @@ void PAR_BS::schedule(gp* payload)
gp* PAR_BS::getTransactionForBank(Bank bank)
{
assert(hasTransactionForBank(bank));
sc_assert(hasTransactionForBank(bank));
if (batch->isEmpty())
{

View File

@@ -89,7 +89,7 @@ public:
virtual void send(const ScheduledCommand& command, tlm_generic_payload& payload) override
{
assert(command.getStart() >= sc_time_stamp());
sc_assert(command.getStart() >= sc_time_stamp());
TimeInterval dataStrobe;
@@ -193,7 +193,7 @@ public:
virtual void send(Trigger trigger, sc_time time, tlm_generic_payload& payload) override
{
assert(time >= sc_time_stamp());
sc_assert(time >= sc_time_stamp());
sc_time delay = time - sc_time_stamp();
if (trigger == Trigger::RefreshTrigger)
@@ -250,6 +250,7 @@ private:
printDebugMessage("Triggering schedule next payload on bank " + to_string(bank.ID()));
if (scheduler->hasTransactionForBank(bank))
{
controller->powerDownManager->wakeUp(bank, sc_time_stamp());
if (controller->isBusy(sc_time_stamp(), bank))
{
@@ -257,7 +258,6 @@ private:
return;
}
controller->powerDownManager->wakeUp(bank, sc_time_stamp());
tlm_generic_payload* nextTransaction = scheduler->getTransactionForBank(bank);
if (controller->scheduleRequest(sc_time_stamp(), *nextTransaction))

View File

@@ -82,7 +82,7 @@ int sc_main(int argc, char **argv)
DramSetup setup;
setup.memconfig = "memconfig.xml";
setup.memspec = "MatzesWideIO.xml";
//setup.memspec = "MICRON_4Gb_DDR4-1866_8bit_A.xml";
setup.memspec = "MICRON_4Gb_DDR4-1866_8bit_A.xml";
DramSetup setup2;
setup2.memconfig = "memconfig.xml";
@@ -95,10 +95,13 @@ int sc_main(int argc, char **argv)
//batchTraces(setup, tracePairs);
//batchSetups(tracePairs[0], {setup});
string traceName("tpr.tdb");
string traceName("tpr5.tdb");
string trace2 = "empty.stl";
string trace1 = "chstone-jpeg_32.stl";
trace1 = "mediabench-adpcmencode_32.stl";
//trace1 = "mediabench-h263encode_32.stl";
//trace1 = "trace.stl";