Code refactoring.

This commit is contained in:
Lukas Steiner
2021-06-15 18:11:45 +02:00
parent 66f72c88b6
commit 1cf97f7187
6 changed files with 11 additions and 11 deletions

View File

@@ -121,8 +121,7 @@ DRAMSys::DRAMSys(sc_module_name name,
DRAMSys::~DRAMSys()
{
if (ecc)
delete ecc;
delete ecc;
delete arbiter;

View File

@@ -65,7 +65,7 @@ public:
std::string simulationToRun,
std::string pathToResources);
virtual ~DRAMSys();
~DRAMSys() override;
protected:
DRAMSys(sc_module_name name,
@@ -95,7 +95,7 @@ protected:
void report(std::string message);
private:
void logo();
static void logo();
void instantiateModules(const std::string &pathToResources,
const std::string &amconfig);

View File

@@ -79,6 +79,7 @@ DRAMSysRecordable::DRAMSysRecordable(sc_module_name name,
DRAMSysRecordable::~DRAMSysRecordable()
{
// Report power before TLM recorders are deleted
if (Configuration::getInstance().powerAnalysis)
{
for (auto dram : drams)
@@ -99,9 +100,9 @@ void DRAMSysRecordable::setupTlmRecorders(const std::string &traceName)
std::string recorderName = "tlmRecorder" + std::to_string(i);
TlmRecorder *tlmRecorder =
new TlmRecorder(recorderName, dbName.c_str());
tlmRecorder->recordMcConfig(Configuration::getInstance().mcconfigUri);
tlmRecorder->recordMemspec(Configuration::getInstance().memspecUri);
new TlmRecorder(recorderName, dbName);
tlmRecorder->recordMcConfig(Configuration::mcconfigUri);
tlmRecorder->recordMemspec(Configuration::memspecUri);
std::string traceNames = Configuration::getInstance().simulationName;
tlmRecorder->recordTraceNames(traceNames);

View File

@@ -46,7 +46,7 @@ public:
std::string simulationToRun,
std::string pathToResources);
virtual ~DRAMSysRecordable();
~DRAMSysRecordable() override;
private:
// Transaction Recorders (one per channel).

View File

@@ -101,7 +101,7 @@ Dram::~Dram()
{
if (Configuration::getInstance().powerAnalysis)
{
reportPower();
Dram::reportPower();
delete DRAMPower;
}

View File

@@ -69,8 +69,8 @@ void DramRecordable<BaseDram>::reportPower()
{
BaseDram::reportPower();
tlmRecorder->recordPower(sc_time_stamp().to_seconds(),
this->DRAMPower->getPower().window_average_power
* Configuration::getInstance().memSpec->numberOfDevicesOnDIMM);
this->DRAMPower->getPower().window_average_power
* Configuration::getInstance().memSpec->numberOfDevicesOnDIMM);
}
template<class BaseDram>