Temperature and power map files created with a timestamp

This commit is contained in:
Éder F. Zulian
2015-10-19 10:44:57 +02:00
parent 072cee7afc
commit 672f0abefe
3 changed files with 15 additions and 9 deletions

View File

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

View File

@@ -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 {