diff --git a/DRAMSys/simulator/resources/configs/memconfigs/fr_fcfs.xml b/DRAMSys/simulator/resources/configs/memconfigs/fr_fcfs.xml
index 7f8af9a8..d0f996f0 100644
--- a/DRAMSys/simulator/resources/configs/memconfigs/fr_fcfs.xml
+++ b/DRAMSys/simulator/resources/configs/memconfigs/fr_fcfs.xml
@@ -9,7 +9,7 @@
-
+
+
+
+
+
diff --git a/DRAMSys/simulator/resources/configs/temperature_sim/stack.stk b/DRAMSys/simulator/resources/configs/temperature_sim/stack.stk
new file mode 100755
index 00000000..338130b7
--- /dev/null
+++ b/DRAMSys/simulator/resources/configs/temperature_sim/stack.stk
@@ -0,0 +1,46 @@
+material SILICON :
+ thermal conductivity 1.30e-4 ;
+ volumetric heat capacity 1.628e-12 ;
+
+material BEOL :
+ thermal conductivity 2.25e-6 ;
+ volumetric heat capacity 2.175e-12 ;
+
+material COPPER :
+ thermal conductivity 4.01e-04 ;
+ volumetric heat capacity 3.37e-12 ;
+
+heat sink :
+ sink height 1e03, area 100e06, material COPPER ;
+ spreader height 0.5e03, area 70e06, material SILICON ;
+ heat transfer coefficient 1.3e-09 ;
+ ambient temperature 318.15 ;
+
+layer PCB :
+ height 10 ;
+ material BEOL ;
+
+die DRAM :
+ layer 58.5 SILICON ;
+ source 2 SILICON ;
+ layer 1.5 BEOL ;
+ layer 58.5 SILICON ;
+
+dimensions :
+ chip length 6100, width 10600 ;
+ cell length 100, width 100 ;
+
+stack:
+ die DRAM_DIE DRAM floorplan "./mem.flp" ;
+ layer CONN_TO_PCB PCB ;
+
+solver:
+ transient step 0.01, slot 0.05 ;
+ initial temperature 300.0 ;
+
+output:
+ Tflpel(DRAM_DIE.channel0 , "temp_flp_element_ch0.txt" , average , slot );
+ 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 );
+
diff --git a/DRAMSys/simulator/resources/simulations/sim-batch.xml b/DRAMSys/simulator/resources/simulations/sim-batch.xml
index 02cc12fb..e4612577 100644
--- a/DRAMSys/simulator/resources/simulations/sim-batch.xml
+++ b/DRAMSys/simulator/resources/simulations/sim-batch.xml
@@ -4,16 +4,16 @@
-
+
-
+
-
+
@@ -37,7 +37,7 @@
- chstone-adpcm_32.stl
+ ../../../tests/error/test_error.stl
diff --git a/DRAMSys/simulator/src/error/errormodel.cpp b/DRAMSys/simulator/src/error/errormodel.cpp
index d2dc0129..44ec40d6 100644
--- a/DRAMSys/simulator/src/error/errormodel.cpp
+++ b/DRAMSys/simulator/src/error/errormodel.cpp
@@ -498,7 +498,16 @@ double errorModel::getTemperature()
// TODO here we need to get the current power value from DRAMPower (and
// make adjusts if necessary) and pass it to the Temperature Controller
// with the correct ID for this device.
- double temperature = TemperatureController::getInstance().getTemperature(0, 0);
+
+ // FIXME
+ // make sure the context is set (myChannel has the proper value) before
+ // requesting the temperature.
+ double temperature = 89;
+
+ if (this->myChannel != -1) {
+ temperature = TemperatureController::getInstance().getTemperature(this->myChannel, 0);
+ }
+
return temperature;
}
diff --git a/DRAMSys/simulator/src/simulation/TemperatureController.cpp b/DRAMSys/simulator/src/simulation/TemperatureController.cpp
index 370c4195..e30fc3f5 100644
--- a/DRAMSys/simulator/src/simulation/TemperatureController.cpp
+++ b/DRAMSys/simulator/src/simulation/TemperatureController.cpp
@@ -52,6 +52,8 @@ double TemperatureController::temperatureConvert(double tKelvin)
double TemperatureController::getTemperature(int deviceId, float currentPower)
{
+ printDebugMessage("Temperature requested by device " + std::to_string(deviceId) + " current power is " + std::to_string(currentPower));
+
if (dynamicTempSimEnabled == true) {
currentPowerValues.at(deviceId) = currentPower;
@@ -72,7 +74,7 @@ void TemperatureController::updateTemperatures()
#ifdef THERMALSIM
thermalSimulation->sendPowerValues(¤tPowerValues);
thermalSimulation->simulate();
- thermalSimulation->getTemperature(temperaturesBuffer, TDICE_OUTPUT_INSTANT_SLOT, TDICE_OUTPUT_TYPE_TCELL, TDICE_OUTPUT_QUANTITY_NONE);
+ thermalSimulation->getTemperature(temperaturesBuffer, TDICE_OUTPUT_INSTANT_SLOT, TDICE_OUTPUT_TYPE_TFLPEL, TDICE_OUTPUT_QUANTITY_AVERAGE);
#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 10913ce7..fe9b5335 100644
--- a/DRAMSys/simulator/src/simulation/TemperatureController.h
+++ b/DRAMSys/simulator/src/simulation/TemperatureController.h
@@ -71,7 +71,7 @@ public:
thermalSimulation = new IceWrapper(ip, port);
printDebugMessage("Dynamic temperature simulation. Server @ " + ip + ":" + std::to_string(port));
#else
- SC_REPORT_FATAL(name(), "Temperature Simulation Disabled");
+ SC_REPORT_FATAL(name(), "DRAMSys was build without support to dynamic temperature simulation. Check the README file for further details.");
#endif
// Initial power dissipation values (got from config)
currentPowerValues = Configuration::getInstance().temperatureSim.powerInitialValues;
diff --git a/README.md b/README.md
index ba71c454..f61e192d 100644
--- a/README.md
+++ b/README.md
@@ -117,8 +117,8 @@ $ ./traceAnalyzer
Before starting make sure you have a **clean repository** without any previous
automatic generated Makefiles. One way to ensure this is by running the
-command below inside your DRAMSys repository, but keep in mind that **all
-untracked files will be lost**.
+command below inside your DRAMSys repository, but keep in mind that
+**untracked files and directories will be removed** from the repository.
``` bash
$ git clean -fdx
@@ -146,13 +146,13 @@ through the network. Therefore users interested in thermal simulation during
their DRAMSys simulations need to make sure they have a 3D-ICE server up and
running before starting.
-More information about how to obtain 3D-ICE and its installation can be
-obtained in the official website http://esl.epfl.ch/3D-ICE.
+More information about how to obtain 3D-ICE and how to intall it can be found
+in the official website http://esl.epfl.ch/3D-ICE.
Provided the user fulfilled this installation requisite, before starting
DRAMSys it is necessary to run the 3D-ICE server passing to it two arguments:
-a suitable configuration file and an Internet socket port number. And wait
-until the server is ready to receive requests.
+a suitable configuration file and an Internet socket port number. And then
+wait until the server is ready to receive requests.
``` bash
$ 3D-ICE-Server
@@ -166,6 +166,97 @@ The IP address and the port number related to the server shall be informed in
DRAMSys' configuration to subsequent use by DRAMSys to access the thermal
simulation server.
+#### Usage Example
+
+The DRAMSys' main configuration file is presented below.
+
+``` xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ../../../tests/error/test_error.stl
+
+
+
+
+```
+
+Enable the error model in fr_fcfs.xml.
+
+``` xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+```
+
+Generate the input trace file for DRAMSys.
+
+``` bash
+$ cd DRAMSys/tests/error/
+$ ./generateErrorTest.pl > test_error.stl
+```
+
+Start the 3D-ICE server providing the stack file and the port number.
+
+``` bash
+$ cd DRAMSys/simulator/resources/configs/temperature_sim
+$ 3D-ICE-Server stack.stk 11880
+```
+
+In another terminal or terminal tab start DRAMSys. Here the program's output
+is redirected to a file.
+
+``` bash
+$ cd build/simulator/
+$ ./dramSys > output
+```
+
### DRAMSys Configuration
The **dramSys** executable supports one argument which is a XML file that