From 672f0abefe73515d99f95b4df9f07adca26bb8a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20F=2E=20Zulian?= Date: Mon, 19 Oct 2015 10:44:57 +0200 Subject: [PATCH] Temperature and power map files created with a timestamp --- .../simulator/src/common/third_party/icewrapper | 2 +- .../src/simulation/TemperatureController.cpp | 14 ++++++++++---- .../src/simulation/TemperatureController.h | 8 ++++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/DRAMSys/simulator/src/common/third_party/icewrapper b/DRAMSys/simulator/src/common/third_party/icewrapper index f118c42b..2179c985 160000 --- a/DRAMSys/simulator/src/common/third_party/icewrapper +++ b/DRAMSys/simulator/src/common/third_party/icewrapper @@ -1 +1 @@ -Subproject commit f118c42b5ab865708d9ab1bd1383ce6c99189a8e +Subproject commit 2179c985a0692e7ab5ec58c35eb7fa69f34c2252 diff --git a/DRAMSys/simulator/src/simulation/TemperatureController.cpp b/DRAMSys/simulator/src/simulation/TemperatureController.cpp index 2f67431a..a0fda47f 100644 --- a/DRAMSys/simulator/src/simulation/TemperatureController.cpp +++ b/DRAMSys/simulator/src/simulation/TemperatureController.cpp @@ -77,10 +77,16 @@ void TemperatureController::updateTemperatures() thermalSimulation->simulate(); thermalSimulation->getTemperature(temperaturesBuffer, TDICE_OUTPUT_INSTANT_SLOT, TDICE_OUTPUT_TYPE_TFLPEL, TDICE_OUTPUT_QUANTITY_AVERAGE); - if (genTempMap == true) - thermalSimulation->getTemperatureMap(temperatureMapFile); - if (genPowerMap == true) - thermalSimulation->getPowerMap(powerMapFile); + std::string mapfile; + sc_time ts = sc_time_stamp(); + if (genTempMap == true) { + mapfile = temperatureMapFile + "_" + std::to_string(ts.to_default_time_units()) + ".txt"; + thermalSimulation->getTemperatureMap(mapfile); + } + if (genPowerMap == true) { + mapfile = powerMapFile + "_" + std::to_string(ts.to_default_time_units()) + ".txt"; + thermalSimulation->getPowerMap(mapfile); + } #endif // Save values just obtained for posterior use temperatureValues = temperaturesBuffer; diff --git a/DRAMSys/simulator/src/simulation/TemperatureController.h b/DRAMSys/simulator/src/simulation/TemperatureController.h index 26ece72d..c0650f6f 100644 --- a/DRAMSys/simulator/src/simulation/TemperatureController.h +++ b/DRAMSys/simulator/src/simulation/TemperatureController.h @@ -91,12 +91,12 @@ public: t_unit = Configuration::getInstance().temperatureSim.DynTemperatureSimUnit; genTempMap = Configuration::getInstance().temperatureSim.GenerateTemperatureMap; - temperatureMapFile = "temperature_map.txt"; - std::remove(temperatureMapFile.c_str()); + temperatureMapFile = "temperature_map"; + std::system("rm temperature_map*"); genPowerMap = Configuration::getInstance().temperatureSim.GeneratePowerMap; - powerMapFile = "power_map.txt"; - std::remove(powerMapFile.c_str()); + powerMapFile = "power_map"; + std::system("rm power_map*"); SC_THREAD(temperatureThread); } else {