Added support to temperature and power maps generation.

This commit is contained in:
Éder F. Zulian
2015-10-16 15:41:46 +02:00
parent 207ca1e5d0
commit 072cee7afc
7 changed files with 32 additions and 2 deletions

View File

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

View File

@@ -21,6 +21,8 @@
<IceServerPort value="11880" />
<SimPeriodAdjustFactor value="10" />
<NPowStableCyclesToIncreasePeriod value="5" />
<GenerateTemperatureMap value="1" />
<GeneratePowerMap value="1" />
</temperature_simconfig>
<memspecs>

View File

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

View File

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

View File

@@ -76,6 +76,11 @@ void TemperatureController::updateTemperatures()
thermalSimulation->sendPowerValues(&currentPowerValues);
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;

View File

@@ -40,6 +40,7 @@
#include <systemc.h>
#include <iostream>
#include <string>
#include <fstream>
#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);
};