Small Changes

This commit is contained in:
Felipe Salerno Prado
2016-05-23 16:09:57 +02:00
parent bd5b86a142
commit eba49e6594

View File

@@ -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);