Avoid some assertions when using gem5

Using preprocessor directives instead of a configuration. It seems to be ok
for now.
This commit is contained in:
Éder F. Zulian
2017-04-05 08:39:58 +02:00
parent ead929d3da
commit 22eca68f6a
6 changed files with 15 additions and 16 deletions

View File

@@ -28,6 +28,17 @@ $$eval(dramsys_pct) {
DEFINES += DRAMSYS_PCT
}
# Check if gem5 should be used
gem5 = $$(GEM5)
isEmpty(gem5) {
message(GEM5 environment variable not found)
message(Gem5 Simulation Disabled)
} else {
message(Gem5 Simulation Feature Enabled)
message(Gem5 home is $${gem5})
DEFINES += DRAMSYS_GEM5
}
message(SystemC home is $${systemc_home})
systemc_target_arch = $$(SYSTEMC_TARGET_ARCH)

View File

@@ -11,5 +11,4 @@
<NumberOfDevicesOnDIMM value = "8" />
<CheckTLM2Protocol value = "0" />
<AddressOffset value = "0" />
<gem5 value = "0" />
</simconfig>

View File

@@ -11,11 +11,9 @@
<NumberOfDevicesOnDIMM value = "8" />
<CheckTLM2Protocol value = "0" />
<AddressOffset value = "0" />
<gem5 value = "0" />
<!-- Gem5 Related Configuration:
In the memory controller file the storage mode should be set to Store
E.g. the DRAM is located at 0x80000000 for gem5
<AddressOffset value = "214748364c8" />
<gem5 value = "1" />
-->
</simconfig>

View File

@@ -190,8 +190,6 @@ void Configuration::setParameter(std::string name, std::string value)
SC_REPORT_FATAL("Configuration", ("Invalid value for parameter " + name + ". This parameter must be at least one.").c_str());
} else
NumberOfDevicesOnDIMM = string2int(value);
else if(name == "gem5")
gem5 = string2bool(value);
else if(name == "AddressOffset")
{
AddressOffset = string2ull(value);

View File

@@ -81,7 +81,6 @@ struct Configuration
bool SimulationProgressBar = false;
unsigned int NumberOfDevicesOnDIMM = 1;
bool CheckTLM2Protocol = false;
bool gem5 = false;
unsigned long long int AddressOffset = 0;
// MemSpec (from DRAM-Power XML)

View File

@@ -390,11 +390,8 @@ struct Dram : sc_module
}
else if (phase == BEGIN_WR)
{
#ifndef DRAMSYS_PCT
if(Configuration::getInstance().gem5 == false)
{
assert(payload.get_data_length() == bytesPerBurst);
}
#if !defined (DRAMSYS_PCT) && !defined (DRAMSYS_GEM5)
assert(payload.get_data_length() == bytesPerBurst);
#endif
if(powerAnalysis == true){DRAMPower->doCommand(MemCommand::WR, bank, cycle);}
@@ -418,11 +415,8 @@ struct Dram : sc_module
}
else if (phase == BEGIN_RD)
{
#ifndef DRAMSYS_PCT
if(Configuration::getInstance().gem5 == false)
{
assert(payload.get_data_length() == bytesPerBurst);
}
#if !defined (DRAMSYS_PCT) && !defined (DRAMSYS_GEM5)
assert(payload.get_data_length() == bytesPerBurst);
#endif
numberOfTransactionsServed++;