From 072cee7afcd87771175f80183bcad33ca4cc9585 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89der=20F=2E=20Zulian?= Date: Fri, 16 Oct 2015 15:41:46 +0200 Subject: [PATCH] Added support to temperature and power maps generation. --- .../resources/configs/temperature_sim/stack.stk | 4 +++- .../simulator/resources/simulations/sim-batch.xml | 2 ++ .../simulator/src/common/third_party/icewrapper | 2 +- .../core/configuration/Configuration.cpp | 4 ++++ .../core/configuration/temperatureSimConfig.h | 2 ++ .../src/simulation/TemperatureController.cpp | 5 +++++ .../src/simulation/TemperatureController.h | 15 +++++++++++++++ 7 files changed, 32 insertions(+), 2 deletions(-) diff --git a/DRAMSys/simulator/resources/configs/temperature_sim/stack.stk b/DRAMSys/simulator/resources/configs/temperature_sim/stack.stk index 338130b7..df1f506d 100755 --- a/DRAMSys/simulator/resources/configs/temperature_sim/stack.stk +++ b/DRAMSys/simulator/resources/configs/temperature_sim/stack.stk @@ -28,7 +28,7 @@ die DRAM : dimensions : chip length 6100, width 10600 ; - cell length 100, width 100 ; + cell length 1000, width 1000 ; stack: die DRAM_DIE DRAM floorplan "./mem.flp" ; @@ -43,4 +43,6 @@ output: Tflpel(DRAM_DIE.channel1 , "temp_flp_element_ch1.txt" , average , slot ); Tflpel(DRAM_DIE.channel2 , "temp_flp_element_ch2.txt" , average , slot ); Tflpel(DRAM_DIE.channel3 , "temp_flp_element_ch3.txt" , average , slot ); + Tmap (DRAM_DIE, "output1.txt", slot) ; + Pmap (DRAM_DIE, "output2.txt", slot) ; diff --git a/DRAMSys/simulator/resources/simulations/sim-batch.xml b/DRAMSys/simulator/resources/simulations/sim-batch.xml index e4612577..977e01a5 100644 --- a/DRAMSys/simulator/resources/simulations/sim-batch.xml +++ b/DRAMSys/simulator/resources/simulations/sim-batch.xml @@ -21,6 +21,8 @@ + + diff --git a/DRAMSys/simulator/src/common/third_party/icewrapper b/DRAMSys/simulator/src/common/third_party/icewrapper index e84ff691..f118c42b 160000 --- a/DRAMSys/simulator/src/common/third_party/icewrapper +++ b/DRAMSys/simulator/src/common/third_party/icewrapper @@ -1 +1 @@ -Subproject commit e84ff691e99f7ed246ac85b76906961b061aaaf8 +Subproject commit f118c42b5ab865708d9ab1bd1383ce6c99189a8e diff --git a/DRAMSys/simulator/src/controller/core/configuration/Configuration.cpp b/DRAMSys/simulator/src/controller/core/configuration/Configuration.cpp index 313f0f51..69315241 100644 --- a/DRAMSys/simulator/src/controller/core/configuration/Configuration.cpp +++ b/DRAMSys/simulator/src/controller/core/configuration/Configuration.cpp @@ -178,6 +178,10 @@ void Configuration::setParameter(std::string name, std::string value) temperatureSim.SimPeriodAdjustFactor = std::stoi(value.c_str()); else if (name == "NPowStableCyclesToIncreasePeriod") temperatureSim.NPowStableCyclesToIncreasePeriod = std::stoi(value.c_str()); + else if (name == "GenerateTemperatureMap") + temperatureSim.GenerateTemperatureMap = string2bool(value); + else if (name == "GeneratePowerMap") + temperatureSim.GeneratePowerMap = string2bool(value); else { SC_REPORT_FATAL("Configuration", ("Parameter " + name + " not defined in Configuration").c_str()); diff --git a/DRAMSys/simulator/src/controller/core/configuration/temperatureSimConfig.h b/DRAMSys/simulator/src/controller/core/configuration/temperatureSimConfig.h index 141aea78..63f39b5f 100644 --- a/DRAMSys/simulator/src/controller/core/configuration/temperatureSimConfig.h +++ b/DRAMSys/simulator/src/controller/core/configuration/temperatureSimConfig.h @@ -60,6 +60,8 @@ struct TemperatureSimConfig { unsigned int IceServerPort; unsigned int SimPeriodAdjustFactor; unsigned int NPowStableCyclesToIncreasePeriod; + bool GenerateTemperatureMap; + bool GeneratePowerMap; // Power related information std::string powerInfoFile; diff --git a/DRAMSys/simulator/src/simulation/TemperatureController.cpp b/DRAMSys/simulator/src/simulation/TemperatureController.cpp index 91cfb40c..2f67431a 100644 --- a/DRAMSys/simulator/src/simulation/TemperatureController.cpp +++ b/DRAMSys/simulator/src/simulation/TemperatureController.cpp @@ -76,6 +76,11 @@ void TemperatureController::updateTemperatures() thermalSimulation->sendPowerValues(¤tPowerValues); 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); #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 f6e98387..26ece72d 100644 --- a/DRAMSys/simulator/src/simulation/TemperatureController.h +++ b/DRAMSys/simulator/src/simulation/TemperatureController.h @@ -40,6 +40,7 @@ #include #include #include +#include #include "../common/DebugManager.h" #include "../common/Utils.h" @@ -88,6 +89,15 @@ public: targetPeriod = Configuration::getInstance().temperatureSim.DynTemperatureSimPeriod; period = targetPeriod; t_unit = Configuration::getInstance().temperatureSim.DynTemperatureSimUnit; + + genTempMap = Configuration::getInstance().temperatureSim.GenerateTemperatureMap; + temperatureMapFile = "temperature_map.txt"; + std::remove(temperatureMapFile.c_str()); + + genPowerMap = Configuration::getInstance().temperatureSim.GeneratePowerMap; + powerMapFile = "power_map.txt"; + std::remove(powerMapFile.c_str()); + SC_THREAD(temperatureThread); } else { staticTemperature = Configuration::getInstance().temperatureSim.StaticTemperatureDefaultValue; @@ -127,6 +137,11 @@ private: unsigned int cyclesSinceLastPeriodAdjust; unsigned int nPowStableCyclesToIncreasePeriod; + bool genTempMap; + std::string temperatureMapFile; + bool genPowerMap; + std::string powerMapFile; + void printDebugMessage(std::string message); };