diff --git a/src/libdramsys/DRAMSys/simulation/Dram.cpp b/src/libdramsys/DRAMSys/simulation/Dram.cpp index 38094167..016eacee 100644 --- a/src/libdramsys/DRAMSys/simulation/Dram.cpp +++ b/src/libdramsys/DRAMSys/simulation/Dram.cpp @@ -56,7 +56,6 @@ #endif #ifdef DRAMPOWER -#include "DRAMPower/data/energy.h" #include "DRAMPower/command/Command.h" #endif @@ -77,7 +76,6 @@ Dram::Dram(const sc_module_name& name, sc_module(name), memSpec(memSpec), storeMode(simConfig.storeMode), - powerAnalysis(simConfig.powerAnalysis), channelSize(memSpec.getSimMemSizeInBytes() / memSpec.numberOfChannels), useMalloc(simConfig.useMalloc), tlmRecorder(tlmRecorder), @@ -113,7 +111,7 @@ Dram::Dram(const sc_module_name& name, tSocket.register_transport_dbg(this, &Dram::transport_dbg); #ifdef DRAMPOWER - if (powerAnalysis) + if (simConfig.powerAnalysis) { DRAMPower = memSpec.toDramPowerObject(); if (DRAMPower && storeMode == Config::StoreModeType::NoStorage) { @@ -141,6 +139,7 @@ void Dram::reportPower() #ifdef DRAMPOWER if (!DRAMPower) return; + double energy = DRAMPower->getTotalEnergy(DRAMPower->getLastCommandTime()); double time = DRAMPower->getLastCommandTime() * memSpec.tCK.to_seconds(); @@ -167,7 +166,7 @@ tlm_sync_enum Dram::nb_transport_fw(tlm_generic_payload& trans, tlm_phase& phase assert(phase >= BEGIN_RD && phase <= END_SREF); #ifdef DRAMPOWER - if (powerAnalysis && DRAMPower) + if (DRAMPower) { std::size_t rank = static_cast(ControllerExtension::getRank(trans)); // relaitve to the channel std::size_t bank_group_abs = static_cast(ControllerExtension::getBankGroup(trans)); // relative to the channel diff --git a/src/libdramsys/DRAMSys/simulation/Dram.h b/src/libdramsys/DRAMSys/simulation/Dram.h index 6fc8d1c9..efef7f05 100644 --- a/src/libdramsys/DRAMSys/simulation/Dram.h +++ b/src/libdramsys/DRAMSys/simulation/Dram.h @@ -67,7 +67,6 @@ protected: // Data Storage: const Config::StoreModeType storeMode; - const bool powerAnalysis; unsigned char* memory; const uint64_t channelSize; const bool useMalloc;