From eba49e6594c2b67e8fac086079cabd57889e145d Mon Sep 17 00:00:00 2001 From: Felipe Salerno Prado Date: Mon, 23 May 2016 16:09:57 +0200 Subject: [PATCH] Small Changes --- DRAMSys/simulator/src/simulation/Dram.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DRAMSys/simulator/src/simulation/Dram.h b/DRAMSys/simulator/src/simulation/Dram.h index b295de1b..5e60ebaf 100644 --- a/DRAMSys/simulator/src/simulation/Dram.h +++ b/DRAMSys/simulator/src/simulation/Dram.h @@ -211,6 +211,8 @@ struct Dram : sc_module // The energy is given in [pJ] and divided by [s] resulting in [pW] then converted to [mW] double averagePower = (totalEnergy / sc_time_stamp().to_seconds()) / 1e9; + tlmRecorder->recordPower(sc_time_stamp().to_seconds(), DRAMPower->getPower().average_power); + // Print the final total energy and the average power for the simulation cout << name() << string("\tTotal Energy: \t") + to_string(totalEnergy) + string("\t[pJ]") << endl; cout << name() << string("\tAverage Power: \t") + to_string(averagePower) + string("\t[mW]") << endl; @@ -243,12 +245,13 @@ struct Dram : sc_module { double currentAveragePower = 0; double currentTotalEnergy = 0; + unsigned long long clk_cycles = 0; do { // At the very beginning (zero clock cycles) the energy is 0, so we wait first wait(powerWindowSize); - unsigned long long clk_cycles = sc_time_stamp().value() / Configuration::getInstance().memSpec.clk.value(); + clk_cycles = sc_time_stamp().value() / Configuration::getInstance().memSpec.clk.value(); DRAMPower->doCommand(MemCommand::NOP, 0, clk_cycles); DRAMPower->updateCounters(false);