readme update

This commit is contained in:
Éder F. Zulian
2017-12-13 14:54:33 +01:00
parent a34f5a30f4
commit b833b9cbe5

451
README.md
View File

@@ -297,146 +297,6 @@ $ make -j<number_jobs>
Now you can try to run DRAMSys and traceAnalyzer App inside folder simulator and traceAnalyzer, respectively
### DRAMSys Thermal Simulation
The thermal simulation is performed by a **3D-ICE** [8] server accessed
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. For more information about 3D-ICE visit the [official website](http://esl.epfl.ch/3D-ICE).
#### Installing the lastest 3D-ICE version
[Download](http://esl.epfl.ch/3d-ice/download.html) the lastest version. Make sure you got version 2.2.6 or greater:
``` bash
$ wget http://esl.epfl.ch/files/content/sites/esl/files/3dice/releases/3d-ice-latest.zip
$ tar -xvzf 3d-ice-latest.zip
```
Install [SuperLU](http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_5.2.1.tar.gz) dependencies:
``` bash
$ sudo apt-get install build-essential git bison flex libblas-dev
```
Download and install SuperLU:
``` bash
$ wget http://crd.lbl.gov/~xiaoye/SuperLU/superlu_4.3.tar.gz
$ tar xvfz superlu_4.3.tar.gz
$ cd SuperLU_4.3/
$ cp MAKE_INC/make.linux make.inc
```
Make sure the SuperLUroot variable in ./make.inc is properly set (in my case $(HOME)/repos/).
``` bash
SuperLUroot = $(HOME)/repos/SuperLU_4.3
```
Compile the library:
``` bash
$ make superlulib
```
Download and install bison-2.4.1:
``` bash
$ wget http://ftp.gnu.org/gnu/bison/bison-2.4.1.tar.gz
$ tar xvzf bison-2.4.1.tar.gz
$ cd bison-2.4.1
$ ./configure --program-suffix=-2.4.1
$ make
$ sudo make install
```
Go to the 3d-ice directory:
``` bash
$ cd 3d-ice-2.2.6
```
Open the file makefile.def and set some variables. Set the correct path to the
SuperLU library you just compiled (in my case $(HOME)/repos/):
``` bash
SLU_MAIN = $(HOME)/repos/SuperLU_$(SLU_VERSION)
```
Set the YACC variable to bison-2.4.1:
``` bash
YACC = bison-2.4.1
```
Set the systemC architecture and main folder variables:
``` bash
SYSTEMC_ARCH = [linux,linux64]
SYSTEMC_MAIN = $(HOME)/repos/systemc-$(SYSTEMC_VERSION)
```
Compile 3D-ICE with SystemC/TLM2.0 support:
``` bash
$ make clean
$ make SYSTEMC_WRAPPER=y
```
Users interested in thermal simulation can also add some extra environment
variables:
```bash
# Necessary for thermal simulation
export LIBTHREED_ICE_HOME=<path>
export LIBSUPERLU_HOME=<path>
```
#### Running DRAMSys with Thermal Simulation
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
**untracked files and directories will be removed** from the repository.
``` bash
$ git clean -fdx
```
This feature can be enabled via an environment variable.
``` bash
$ export THERMALSIM=true
$ qtcreator &
```
or
``` bash
$ mkdir build
$ cd build
$ export THERMALSIM=true
$ qmake ../DRAMSys/DRAMSys.pro
$ make
```
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 then wait until the server is ready to receive requests.
``` bash
$ 3D-ICE-Server <stack file> <port>
Preparing stk data ... done !
Preparing thermal data ... done !
Creating socket ... done !
Waiting for client ... done !
```
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.
### DRAMSys Configuration
The **DRAMSys** executable supports one argument which is a XML file that
@@ -490,7 +350,7 @@ hexadecimal.
Here is an example syntax:
```
# Comment lines initiate with #
# Comment lines begin with #
# [clock-cyle]: [write|read] [hex-address]
31: read 0x400140
33: read 0x400160
@@ -634,8 +494,40 @@ Below, the sub-configurations are listed and explained.
XML files describe the address mapping to be used in the simulation.
The file [am_wideio.xml](DRAMSys/library/resources/configs/amconfigs/am_wideio.xml) is
a good example.
Example for 1GB x64 DIMM with: 8 x 1 Gbit x8 Devices (Micron MT41J128M8) with Page Size: 1KB
[am_ddr3_8x1Gbx8_dimm_p1KB_brc.xml](DRAMSys/library/resources/configs/amconfigs/am_ddr3_8x1Gbx8_dimm_p1KB_brc.xml)
``` xml
<!--
DDR3 Example:
1GB x64 DIMM with: 8 * 1 Gb x8 Devices (e.g. Micron MT41J128M8) with Page Size: 1KB
Device Characteristics:
Rows: 16 K [13:0] -> 14 bit
Bank: 8 [2:0] -> 3 bit
Cols: 1 K [9:0] -> 10 bit
Due to the DIMM we have a Byte Offset Y
2 2 2 | 2 2 2 2 2 2 2 1 1 1 1 1 1 1 | 1 1 1
9 8 7 | 6 5 4 3 2 1 0 9 8 7 6 5 4 3 | 2 1 0 9 8 7 6 5 4 3 | 2 1 0
B B B | R R R R R R R R R R R R R R | C C C C C C C C C C | Y Y Y
-->
<addressmapping>
<channel from="128" to="128" /> <!-- only one channel -->
<bank from="27" to="29" />
<row from="13" to="26" />
<column from="3" to="12" />
<bytes from="0" to="2" />
</addressmapping>
```
Some more examples with graphical representation follow:
[am_wideio.xml](DRAMSys/library/resources/configs/amconfigs/am_wideio.xml)
``` xml
<!-- Row Bank Column -->
@@ -759,15 +651,226 @@ $ cd DRAMSys/library/resources
A description of the content each directory follows.
- **resources**
- **configs**: XML files used for configure specific details of the simulation.
- am_configs: address mapping configuration
- memconfigs: memory configuration
- memspecs: configuration related to the memory technology
- **scripts**: useful tools like address scrambler, trace analyser, database
creator, etc.
- **simulations**: global configuration
- **traces**: trace files for simulations. They contain accesses to memory
in certain known scenarios.
- **configs**: XML files that specify details of the simulation.
- amconfigs: address mapping configs.
- mcconfigs: memory controller configs.
- memspecs: memory specification files (technology dependent).
- simulator: simulator configs.
- **scripts**: useful tools.
- **simulations**: main configuration files.
- **traces**: pre-recorded trace files that may be used as stimuli in simulations.
#### Log Collector Script
Users can profit of running multiple simulations automatically with
[DRAMSylva](DRAMSys/library/resources/scripts/DRAMSylva/DRAMSylva.sh).
Every time you run the script you get a new folder with the name containing the execution time: dram.vp.system\_YYYY\_MM\_DD-HH.MM.SS.
Example on how to run the script:
``` bash
$ cd DRAMSys/library/resources/scripts/DRAMSylva
$ ./DRAMSylva.sh
```
To see the generated plots and CSV files:
``` bash
$ cd dram.vp.system_YYYY_MM_DD-HH.MM.SS/build/simulator
```
In that folder you will find plots (PDF files) and CSV files with the output data used to generate the plots. The CSV files are:
- output.csv (energy, average power, bandwidth, etc.)
- metrics.csv (DRAMSys metrics like average response latency, memory utilization and many others)
Additionally, the database files (\*.tdb) generated will be available and can be open with the traceAnalyzer tool.
The configuration file is what defines a DRAMSys simulation. There is a main configuration file that includes specific configuration files.
You can change what is being simulated by the script by editing it. There is a list of main simulation files in the top of the script:
``` bash
sim_files="
../../DRAMSys/library/resources/simulations/ddr3-example.xml
../../DRAMSys/library/resources/simulations/ddr3-example2.xml
../../DRAMSys/library/resources/simulations/wideio-example.xml
"
```
For more information check the documentation in [DRAMSylva folder](DRAMSys/library/resources/scripts/DRAMSylva).
#### DRAMsys Diagrams
- **Payload Extension information**
GenerationExtension is added in TracePlayer and DramExtension is added in Arbiter.
DramExtension indicates the decoded address (channel, bank, colums, row) and
the socket id (thread) of a payload. It is added in the Arbiter and is sent
to the Controller.
![Payload Extension information](DRAMSys/docs/images/PayloadExtension.png)
- **Transaction object with Memory Manager**
The TracePlayer allocates the memory for the transaction object by calling allocatePayload method.
The acquire method is called before passing the transaction object in TracePlayer, Arbiter and Controller.
The release method is called after each component is done with the transaction object. After the final call of release method, the free method of the memory manager is called to free the transaction object.
![Payload Memory Manager](DRAMSys/docs/images/PayloadMemoryManager.png)
- **Architecture of the backend TLM model**
The below figure shows our custom TLM protocol between the Controller and the Dram. A new transaction enters the Controller with the BEGIN_REQ phase is stored in frontendPEQ. The callback function of the frontendPEQ is called and send the payload to the Scheduler.
The Scheduler checks the address of payload and the current state to determine proper command (Active, Precharge, Read or Write). Then the ControllerCore sends the payload with the corresponding phase (BEGIN_ACT, BEGIN_PRE, BEGIN_RD or BEGIN_WR) to the Dram by calling nb_transport_fw method.
The Dram receives the transaction then send back to the Controller by calling nb_transport_bw with appropriate END phase (END_ACT, END_PRE, END_RD or END_WR).
![Architecture backend TLM](DRAMSys/docs/images/TransactionPhase.png)
### DRAMSys Thermal Simulation
The thermal simulation is performed by a **3D-ICE** [8] server accessed
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. For more information about 3D-ICE visit the [official website](http://esl.epfl.ch/3D-ICE).
#### Installing the lastest 3D-ICE version
[Download](http://esl.epfl.ch/3d-ice/download.html) the lastest version. Make sure you got version 2.2.6 or greater:
``` bash
$ wget http://esl.epfl.ch/files/content/sites/esl/files/3dice/releases/3d-ice-latest.zip
$ tar -xvzf 3d-ice-latest.zip
```
Install [SuperLU](http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_5.2.1.tar.gz) dependencies:
``` bash
$ sudo apt-get install build-essential git bison flex libblas-dev
```
Download and install SuperLU:
``` bash
$ wget http://crd.lbl.gov/~xiaoye/SuperLU/superlu_4.3.tar.gz
$ tar xvfz superlu_4.3.tar.gz
$ cd SuperLU_4.3/
$ cp MAKE_INC/make.linux make.inc
```
Make sure the SuperLUroot variable in ./make.inc is properly set (in my case $(HOME)/repos/).
``` bash
SuperLUroot = $(HOME)/repos/SuperLU_4.3
```
Compile the library:
``` bash
$ make superlulib
```
Download and install bison-2.4.1:
``` bash
$ wget http://ftp.gnu.org/gnu/bison/bison-2.4.1.tar.gz
$ tar xvzf bison-2.4.1.tar.gz
$ cd bison-2.4.1
$ ./configure --program-suffix=-2.4.1
$ make
$ sudo make install
```
Go to the 3d-ice directory:
``` bash
$ cd 3d-ice-2.2.6
```
Open the file makefile.def and set some variables. Set the correct path to the
SuperLU library you just compiled (in my case $(HOME)/repos/):
``` bash
SLU_MAIN = $(HOME)/repos/SuperLU_$(SLU_VERSION)
```
Set the YACC variable to bison-2.4.1:
``` bash
YACC = bison-2.4.1
```
Set the systemC architecture and main folder variables:
``` bash
SYSTEMC_ARCH = [linux,linux64]
SYSTEMC_MAIN = $(HOME)/repos/systemc-$(SYSTEMC_VERSION)
```
Compile 3D-ICE with SystemC/TLM2.0 support:
``` bash
$ make clean
$ make SYSTEMC_WRAPPER=y
```
Users interested in thermal simulation can also add some extra environment
variables:
```bash
# Necessary for thermal simulation
export LIBTHREED_ICE_HOME=<path>
export LIBSUPERLU_HOME=<path>
```
#### Running DRAMSys with Thermal Simulation
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
**untracked files and directories will be removed** from the repository.
``` bash
$ git clean -fdx
```
This feature can be enabled via an environment variable.
``` bash
$ export THERMALSIM=true
$ qtcreator &
```
or
``` bash
$ mkdir build
$ cd build
$ export THERMALSIM=true
$ qmake ../DRAMSys/DRAMSys.pro
$ make
```
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 then wait until the server is ready to receive requests.
``` bash
$ 3D-ICE-Server <stack file> <port>
Preparing stk data ... done !
Preparing thermal data ... done !
Creating socket ... done !
Waiting for client ... done !
```
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 with Thermal Simulation
@@ -840,50 +943,6 @@ $ cd build/simulator/
$ ./DRAMSys > output
```
#### Log Collector Script
Users can profit of running multiple simulations automatically with
[DRAMSylva](DRAMSys/library/resources/scripts/DRAMSylva/DRAMSylva.sh).
Example on how to run the script:
``` bash
$ cd DRAMSys/library/resources/scripts/DRAMSylva
$ ./DRAMSylva
```
For more information check the documentation in [DRAMSylva folder](DRAMSys/library/resources/scripts/DRAMSylva).
#### DRAMsys Diagrams
- **Payload Extension information**
GenerationExtension is added in TracePlayer and DramExtension is added in Arbiter.
DramExtension indicates the decoded address (channel, bank, colums, row) and
the socket id (thread) of a payload. It is added in the Arbiter and is sent
to the Controller.
![Payload Extension information](DRAMSys/docs/images/PayloadExtension.png)
- **Transaction object with Memory Manager**
The TracePlayer allocates the memory for the transaction object by calling allocatePayload method.
The acquire method is called before passing the transaction object in TracePlayer, Arbiter and Controller.
The release method is called after each component is done with the transaction object. After the final call of release method, the free method of the memory manager is called to free the transaction object.
![Payload Memory Manager](DRAMSys/docs/images/PayloadMemoryManager.png)
- **Architecture of the backend TLM model**
The below figure shows our custom TLM protocol between the Controller and the Dram. A new transaction enters the Controller with the BEGIN_REQ phase is stored in frontendPEQ. The callback function of the frontendPEQ is called and send the payload to the Scheduler.
The Scheduler checks the address of payload and the current state to determine proper command (Active, Precharge, Read or Write). Then the ControllerCore sends the payload with the corresponding phase (BEGIN_ACT, BEGIN_PRE, BEGIN_RD or BEGIN_WR) to the Dram by calling nb_transport_fw method.
The Dram receives the transaction then send back to the Controller by calling nb_transport_bw with appropriate END phase (END_ACT, END_PRE, END_RD or END_WR).
![Architecture backend TLM](DRAMSys/docs/images/TransactionPhase.png)
#### References
[1] TLM Modelling of 3D Stacked Wide I/O DRAM Subsystems, A Virtual Platform for Memory Controller Design Space Exploration