diff --git a/DRAMSys/simulator/resources/simulations/sim-batch.xml b/DRAMSys/simulator/resources/simulations/sim-batch.xml index 8a9f9407..437a73a1 100644 --- a/DRAMSys/simulator/resources/simulations/sim-batch.xml +++ b/DRAMSys/simulator/resources/simulations/sim-batch.xml @@ -6,6 +6,7 @@ + @@ -25,5 +26,13 @@ chstone-adpcm_32.stl + + + diff --git a/DRAMSys/simulator/src/controller/core/configuration/Configuration.cpp b/DRAMSys/simulator/src/controller/core/configuration/Configuration.cpp index 4d5ccf36..8395c250 100644 --- a/DRAMSys/simulator/src/controller/core/configuration/Configuration.cpp +++ b/DRAMSys/simulator/src/controller/core/configuration/Configuration.cpp @@ -123,6 +123,8 @@ void Configuration::setParameter(std::string name, std::string value) NumberOfMemChannels = string2int(value); else if (name == "ControllerCoreDisableRefresh") ControllerCoreDisableRefresh = string2bool(value); + else if (name == "DynamicTemperatureSimulation") + DynamicTemperatureSimulation = string2bool(value); // Specification for ErrorChipSeed, ErrorCSVFile path and ErrorStoreMode else if(name == "ErrorChipSeed") ErrorChipSeed = string2int(value); diff --git a/DRAMSys/simulator/src/controller/core/configuration/Configuration.h b/DRAMSys/simulator/src/controller/core/configuration/Configuration.h index c88e08c2..905bfb75 100644 --- a/DRAMSys/simulator/src/controller/core/configuration/Configuration.h +++ b/DRAMSys/simulator/src/controller/core/configuration/Configuration.h @@ -78,6 +78,7 @@ struct Configuration unsigned int NumberOfTracePlayers = 1; unsigned int NumberOfMemChannels = 1; bool ControllerCoreDisableRefresh = false; + bool DynamicTemperatureSimulation = false; //MemSpec(from DRAM-Power XML) MemSpec memSpec; diff --git a/DRAMSys/simulator/src/error/errormodel.cpp b/DRAMSys/simulator/src/error/errormodel.cpp index 1fe29ccb..831387e1 100644 --- a/DRAMSys/simulator/src/error/errormodel.cpp +++ b/DRAMSys/simulator/src/error/errormodel.cpp @@ -42,6 +42,7 @@ errorModel::errorModel() { // Get Configuration parameters: + dynamicTemepratureSimulation = Configuration::getInstance().DynamicTemperatureSimulation; busWidth = Configuration::getInstance().Buswidth; burstLenght = Configuration::getInstance().memSpec.BurstLength; numberOfColumns = Configuration::getInstance().memSpec.NumberOfColumns; @@ -49,6 +50,7 @@ errorModel::errorModel() numberOfRows = Configuration::getInstance().memSpec.NumberOfRows; numberOfBitErrorEvents = 0; + // Initialize the lastRow Access array: lastRowAccess = new sc_time[numberOfRows]; for(unsigned int i = 0; i < numberOfRows; i++) @@ -101,7 +103,10 @@ errorModel::errorModel() //weakCells[0].row = 0; //weakCells[0].dependent = true; - setTemperature(89); + if (dynamicTemepratureSimulation == false) { + setTemperature(89); + } + markBitFlips(); } @@ -229,6 +234,7 @@ void errorModel::load(tlm::tlm_generic_payload &trans) void errorModel::markBitFlips() { + double temp = getTemperature(); for(unsigned int row = 0; row < Configuration::getInstance().memSpec.NumberOfRows; row++) { // If the row has never been accessed ignore it and go to the next one @@ -238,7 +244,7 @@ void errorModel::markBitFlips() sc_time interval = sc_time_stamp() - lastRowAccess[row]; // Obtain the number of bit flips for the current temperature and the time interval: - unsigned int n = getNumberOfFlips(temperature, interval); + unsigned int n = getNumberOfFlips(temp, interval); // Check if the current row is in the range of bit flips for this interval // and temperature, if yes mark it as flipped: @@ -494,6 +500,17 @@ void errorModel::setTemperature(double t) temperature = t; } +double errorModel::getTemperature() +{ + if (dynamicTemepratureSimulation == true) { + // TODO Get temperature from 3d-ice simulator or other temperature source + // TODO Check all the criterion before requesting the temperature + return temperature; + } + + return temperature; +} + void errorModel::parseInputData() { std::string fileName = Configuration::getInstance().ErrorCSVFile; diff --git a/DRAMSys/simulator/src/error/errormodel.h b/DRAMSys/simulator/src/error/errormodel.h index 9bcfd54c..aac91278 100644 --- a/DRAMSys/simulator/src/error/errormodel.h +++ b/DRAMSys/simulator/src/error/errormodel.h @@ -52,6 +52,7 @@ class errorModel void refresh(unsigned int row); void activate(unsigned int row); void setTemperature(double t); + double getTemperature(void); private: // Configuration Parameters: @@ -60,6 +61,7 @@ class errorModel unsigned int numberOfColumns; unsigned int bytesPerColumn; unsigned int numberOfRows; + bool dynamicTemepratureSimulation; // Name: std::string name; diff --git a/README.md b/README.md index e64630dd..566dd265 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,7 @@ The XML code below shows a typic configuration: + @@ -231,6 +232,9 @@ Below are listed the configuration sections and configuration fields. - *ControllerCoreDisableRefresh* (boolean) - "1": disables refreshes - "0": normal operation (refreshes enabled) + - *DynamicTemperatureSimulation* (boolean) + - "1": enables the dynamic temperature simulation feature + - "0": static temperature during simulation - **Memory specification**