Readme updates, separate gem5 readme.
This commit is contained in:
681
DRAMSys/gem5/README.md
Normal file
681
DRAMSys/gem5/README.md
Normal file
@@ -0,0 +1,681 @@
|
|||||||
|
## DRAMSys with gem5
|
||||||
|
|
||||||
|
Install gem5 by following the instructions on the [gem5 wiki](http://gem5.org/Documentation#Getting_Started).
|
||||||
|
Optionally, use the scripts from [gem5.TnT] to install gem5, build it, get some benchmark programs and learn more about gem5.
|
||||||
|
|
||||||
|
In order to understand the SystemC coupling with gem5 it is recommended to
|
||||||
|
read the documentation in the gem5 repository *util/tlm/README* and [12].
|
||||||
|
|
||||||
|
The main steps for building gem5 and libgem5 follow:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scons build/ARM/gem5.opt
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scons --with-cxx-config --without-python --without-tcmalloc build/ARM/libgem5_opt.so
|
||||||
|
```
|
||||||
|
|
||||||
|
For MacOS:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
scons --with-cxx-config --without-python --without-tcmalloc build/ARM/libgem5_opt.dylib
|
||||||
|
```
|
||||||
|
|
||||||
|
In order to use gem5 with DRAMSys set the **GEM5** environment variable to the
|
||||||
|
path to gem5, for example in the *QtCreator under Projects > Build
|
||||||
|
& Run > Build Environment*:
|
||||||
|
|
||||||
|
```
|
||||||
|
GEM5=/path/to/gem5/
|
||||||
|
```
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```
|
||||||
|
GEM5=$HOME/gem5_tnt/gem5
|
||||||
|
```
|
||||||
|
|
||||||
|
Optionally, export environment variables in your **~/.bashrc** file or
|
||||||
|
equivalent and open a new terminal:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# In this example gem5 is located at $HOME/gem5_tnt/gem5.
|
||||||
|
export GEM5=$HOME/gem5_tnt/gem5
|
||||||
|
|
||||||
|
# Add the folder containing libgem5_opt.so to the list where libraries should
|
||||||
|
# be searched for.
|
||||||
|
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GEM5}/build/ARM
|
||||||
|
```
|
||||||
|
|
||||||
|
The project file [DRAMSys.pro](DRAMSys/DRAMSys.pro) checks whether the
|
||||||
|
environment variable **GEM5** is defined or not and configures automatically
|
||||||
|
the corresponding build target **gem5** for QtCreator.
|
||||||
|
|
||||||
|
In order to run gem5 with DRAMSys it is mandatory to run gem5 first without
|
||||||
|
DRAMSys and generate a configuration file **config.ini** which will be the
|
||||||
|
value of the second parameter passed to DRAMSys_gem5.
|
||||||
|
|
||||||
|
### DRAMSys with gem5 traffic generator
|
||||||
|
|
||||||
|
In the following we will run a simple example with a gem5 traffic generator:
|
||||||
|
|
||||||
|
```
|
||||||
|
Base System Architecture:
|
||||||
|
+-------------+ +------+ ^
|
||||||
|
| System Port | | TGEN | |
|
||||||
|
+-------+-----+ +--+---+ |
|
||||||
|
| | | gem5 World
|
||||||
|
| +----+ |
|
||||||
|
| | |
|
||||||
|
+-------v------v-------+ |
|
||||||
|
| Membus | v
|
||||||
|
+---------------+------+ External Port (see sc_slave_port.*)
|
||||||
|
| ^
|
||||||
|
+----v----+ | TLM World
|
||||||
|
| DRAMSys | | (see sc_target.*)
|
||||||
|
+---------+ v
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
As mentioned before we first need to create a config.ini
|
||||||
|
that represents the gem5 configuration. We do so by starting gem5 with the
|
||||||
|
desired python configuration script.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd gem5/utils/tlm/
|
||||||
|
../../build/ARM/gem5.opt conf/tlm_slave.py
|
||||||
|
```
|
||||||
|
|
||||||
|
**Ignore the message below.**
|
||||||
|
```
|
||||||
|
"fatal: Can't find port handler type 'tlm_slave'"
|
||||||
|
```
|
||||||
|
|
||||||
|
The configuration file config.ini will be stored in the **m5out** directory.
|
||||||
|
Copy this configuration file to the building directory of DRAMSys where the
|
||||||
|
executable **DRAMSys_gem5** is located:
|
||||||
|
|
||||||
|
```
|
||||||
|
dram.sys/build-DRAMSys-Desktop_Qt_5_7_0_clang_64bit-Debug/gem5
|
||||||
|
```
|
||||||
|
|
||||||
|
Also the traffic generatior configuration file (conf/tgen.cfg) must be stored
|
||||||
|
in a conf directory of this building directory.
|
||||||
|
|
||||||
|
Then the simulation can be started with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-example.json config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
Let the simulation run for some seconds and then stop it with **CTRL-C**.
|
||||||
|
Observe the output of the simulation in the trace analyzer. The trace database
|
||||||
|
can be found inside the gem5 directory in the building directory.
|
||||||
|
|
||||||
|
### Gem5 SE mode and DRAMSys
|
||||||
|
|
||||||
|
All essential files for some functional examples are provided.
|
||||||
|
|
||||||
|
Execute a hello world application:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/configs/hello.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
A **Hello world!** message should be printed to the standard output.
|
||||||
|
|
||||||
|
Execute applications:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/Oscar/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/Bubblesort/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
Wait some minutes for the application to finish.
|
||||||
|
|
||||||
|
The hello application binary was copied from gem5 repository.
|
||||||
|
|
||||||
|
Other applications were obtained with [gem5.TnT].
|
||||||
|
|
||||||
|
Command template for generating **.ini** configuration files follows:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
build/ARM/gem5.opt configs/example/se.py \
|
||||||
|
-c <application> --mem-size=512MB --mem-channels=1 \
|
||||||
|
--caches --l2cache --mem-type=SimpleMemory \
|
||||||
|
--cpu-type=TimingSimpleCPU --num-cpu=1 \
|
||||||
|
--tlm-memory=transactor
|
||||||
|
```
|
||||||
|
|
||||||
|
An overview of the architcture being simulated is presented below:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**Note**: this is a gem5 generated file, therefore DRAMSys is omitted. DRAMSys is
|
||||||
|
direct connected as external tlm slave.
|
||||||
|
|
||||||
|
**Note**: workaround in se.py required:
|
||||||
|
|
||||||
|
```python
|
||||||
|
...
|
||||||
|
if options.tlm_memory:
|
||||||
|
system.physmem = SimpleMemory()
|
||||||
|
MemConfig.config_mem(options, system)
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
A convenience script to execute several applications automatically
|
||||||
|
[**run.sh**](DRAMSys/gem5/gem5_se/run.sh) is provided . Take a look and learn
|
||||||
|
from it.
|
||||||
|
|
||||||
|
### [PARSEC] FS Mode
|
||||||
|
|
||||||
|
Full system simulation files for ARM available in [DRAMSys/gem5/gem5_fs/parsec_arm_minor_2c_8GB](DRAMSys/gem5/gem5_fs/parsec_arm_minor_2c_8GB).
|
||||||
|
|
||||||
|
Choose the benchmark in [parsec_arm_minor_2c_8GB.rcS](DRAMSys/gem5/gem5_fs/parsec_arm_minor_2c_8GB/parsec_arm_minor_2c_8GB.rcS).
|
||||||
|
|
||||||
|
Edit the paths in [config.ini](DRAMSys/gem5/gem5_fs/parsec_arm_minor_2c_8GB/config.ini).
|
||||||
|
|
||||||
|
All files required to build DRAMSys_gem5 and execute the simulation (gem5
|
||||||
|
library, benchmarks, disk image, etc.) can be obtained with [gem5.TnT].
|
||||||
|
|
||||||
|
Start a simulation. Example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dram.sys/build/gem5$ ./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/rgrsim-gem5-fs.json ../../DRAMSys/gem5/gem5_fs/parsec_arm_minor_2c_8GB/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
Optionally, open another terminal or tab and connect to gem5.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ telnet localhost 3456
|
||||||
|
```
|
||||||
|
|
||||||
|
Note: the port may vary, gem5 prints it during initialization. Example:
|
||||||
|
|
||||||
|
```
|
||||||
|
system.terminal: Listening for connections on port 3456
|
||||||
|
```
|
||||||
|
|
||||||
|
### [PARSEC] SE Mode
|
||||||
|
|
||||||
|
|
||||||
|
Binaries and gem5 SE configuration files for ARM available in [DRAMSys/gem5/gem5_se/parsec-arm](DRAMSys/gem5/gem5_se/parsec-arm).
|
||||||
|
|
||||||
|
Use [gem5.TnT] to download parsec. Example:
|
||||||
|
|
||||||
|
Go to your **gem5.TnT** folder. Then go to **arch/arm** folder. Execute the
|
||||||
|
script *build-parsec-serial.sh*.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
gem5.TnT/arch/arm$ ./build-parsec-serial.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Extract inputs files. Example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd $HOME/gem5_tnt/benchmarks/parsec-3.0/pkgs/kernels/canneal/inputs
|
||||||
|
tar -xf input_simdev.tar
|
||||||
|
tar -xf input_test.tar
|
||||||
|
tar -xf input_simmedium.tar
|
||||||
|
tar -xf input_simsmall.tar
|
||||||
|
tar -xf input_native.tar
|
||||||
|
tar -xf input_simlarge.tar
|
||||||
|
|
||||||
|
cd $HOME/gem5_tnt/benchmarks/parsec-3.0/pkgs/apps/fluidanimate/inputs
|
||||||
|
tar -xf input_simdev.tar
|
||||||
|
tar -xf input_test.tar
|
||||||
|
tar -xf input_native.tar
|
||||||
|
tar -xf input_simlarge.tar
|
||||||
|
tar -xf input_simmedium.tar
|
||||||
|
tar -xf input_simsmall.tar
|
||||||
|
|
||||||
|
cd $HOME/gem5_tnt/benchmarks/parsec-3.0/pkgs/apps/blackscholes/inputs
|
||||||
|
tar -xf input_simdev.tar
|
||||||
|
tar -xf input_test.tar
|
||||||
|
tar -xf input_native.tar
|
||||||
|
tar -xf input_simlarge.tar
|
||||||
|
tar -xf input_simmedium.tar
|
||||||
|
tar -xf input_simsmall.tar
|
||||||
|
```
|
||||||
|
|
||||||
|
Open [DRAMSys/gem5/gem5_se/parsec-arm/config.ini](DRAMSys/gem5/gem5_se/parsec-arm/config.ini)
|
||||||
|
|
||||||
|
Edit **cmd=**.
|
||||||
|
|
||||||
|
Edit **executable=**.
|
||||||
|
|
||||||
|
Examples (**Replace USER. Use the correct path in your computer.**):
|
||||||
|
|
||||||
|
```
|
||||||
|
-- canneal --
|
||||||
|
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/canneal/canneal 1 5 100 /home/USER/gem5_tnt/benchmarks/parsec-3.0/pkgs/kernels/canneal/inputs/10.nets 1
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/canneal/canneal 1 100 300 /home/USER/gem5_tnt/benchmarks/parsec-3.0/pkgs/kernels/canneal/inputs/100.nets 2
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/canneal/canneal 1 10000 2000 /home/USER/gem5_tnt/benchmarks/parsec-3.0/pkgs/kernels/canneal/inputs/100000.nets 32
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/canneal/canneal 1 15000 2000 /home/USER/gem5_tnt/benchmarks/parsec-3.0/pkgs/kernels/canneal/inputs/200000.nets 64
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/canneal/canneal 1 15000 2000 /home/USER/gem5_tnt/benchmarks/parsec-3.0/pkgs/kernels/canneal/inputs/400000.nets 128
|
||||||
|
|
||||||
|
executable=../../DRAMSys/gem5/gem5_se/parsec-arm/canneal/canneal
|
||||||
|
|
||||||
|
-- streamcluster --
|
||||||
|
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/streamcluster/streamcluster 2 5 1 10 10 5 none output.txt 1
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/streamcluster/streamcluster 3 10 3 16 16 10 none output.txt 1
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/streamcluster/streamcluster 10 20 32 4096 4096 1000 none output.txt 1
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/streamcluster/streamcluster 10 20 64 8192 8192 1000 none output.txt 1
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/streamcluster/streamcluster 10 20 128 16384 16384 1000 none output.txt 1
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/streamcluster/streamcluster 10 20 128 1000000 200000 5000 none output.txt 1
|
||||||
|
|
||||||
|
executable=../../DRAMSys/gem5/gem5_se/parsec-arm/streamcluster/streamcluster
|
||||||
|
|
||||||
|
-- swaptions --
|
||||||
|
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/swaptions/swaptions -ns 1 -sm 5 -nt 1
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/swaptions/swaptions -ns 3 -sm 50 -nt 1
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/swaptions/swaptions -ns 16 -sm 5000 -nt 1
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/swaptions/swaptions -ns 32 -sm 10000 -nt 1
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/swaptions/swaptions -ns 64 -sm 20000 -nt 1
|
||||||
|
|
||||||
|
executable=../../DRAMSys/gem5/gem5_se/parsec-arm/swaptions/swaptions
|
||||||
|
|
||||||
|
-- fluidanimate --
|
||||||
|
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/fluidanimate/fluidanimate 1 1 /home/USER/gem5_tnt/benchmarks/parsec-3.0/pkgs/apps/fluidanimate/inputs/in_5K.fluid out.fluid
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/fluidanimate/fluidanimate 1 3 /home/USER/gem5_tnt/benchmarks/parsec-3.0/pkgs/apps/fluidanimate/inputs/in_15K.fluid out.fluid
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/fluidanimate/fluidanimate 1 5 /home/USER/gem5_tnt/benchmarks/parsec-3.0/pkgs/apps/fluidanimate/inputs/in_35K.fluid out.fluid
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/fluidanimate/fluidanimate 1 5 /home/USER/gem5_tnt/benchmarks/parsec-3.0/pkgs/apps/fluidanimate/inputs/in_100K.fluid out.fluid
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/fluidanimate/fluidanimate 1 5 /home/USER/gem5_tnt/benchmarks/parsec-3.0/pkgs/apps/fluidanimate/inputs/in_300K.fluid out.fluid
|
||||||
|
|
||||||
|
executable=../../DRAMSys/gem5/gem5_se/parsec-arm/fluidanimate/fluidanimate
|
||||||
|
|
||||||
|
-- blackscholes --
|
||||||
|
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/blackscholes/blackscholes 1 /home/USER/gem5_tnt/benchmarks/parsec-3.0/pkgs/apps/blackscholes/inputs/in_4.txt prices.txt
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/blackscholes/blackscholes 1 /home/USER/gem5_tnt/benchmarks/parsec-3.0/pkgs/apps/blackscholes/inputs/in_16.txt prices.txt
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/blackscholes/blackscholes 1 /home/USER/gem5_tnt/benchmarks/parsec-3.0/pkgs/apps/blackscholes/inputs/in_4K.txt prices.txt
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/blackscholes/blackscholes 1 /home/USER/gem5_tnt/benchmarks/parsec-3.0/pkgs/apps/blackscholes/inputs/in_16K.txt prices.txt
|
||||||
|
cmd=../../DRAMSys/gem5/gem5_se/parsec-arm/blackscholes/blackscholes 1 /home/USER/gem5_tnt/benchmarks/parsec-3.0/pkgs/apps/blackscholes/inputs/in_64K.txt prices.txt
|
||||||
|
|
||||||
|
executable=../../DRAMSys/gem5/gem5_se/parsec-arm/blackscholes/blackscholes
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Start a simulation. Example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dram.sys/build/gem5$ ./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/rgrsim-gem5-se.json ../../DRAMSys/gem5/gem5_se/parsec-arm/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
### Boot Linux with gem5 and DRAMSys
|
||||||
|
|
||||||
|
The procedure is very similar to the traffic generator example above.
|
||||||
|
|
||||||
|
First we have to generate the config.ini file by starting gem5 with the following configuration:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
build/ARM/gem5.opt configs/example/fs.py \
|
||||||
|
--tlm-memory=transactor --cpu-type=TimingSimpleCPU --num-cpu=1 \
|
||||||
|
--mem-type=SimpleMemory --mem-size=512MB --mem-channels=1 --caches \
|
||||||
|
--l2cache --machine-type=VExpress_EMM \
|
||||||
|
--dtb-filename=vexpress.aarch32.ll_20131205.0-gem5.1cpu.dtb \
|
||||||
|
--kernel=vmlinux.aarch32.ll_20131205.0-gem5 \
|
||||||
|
--disk-image=linux-aarch32-ael.img
|
||||||
|
```
|
||||||
|
|
||||||
|
The config.ini should be copied again to the DRAMSys_gem5 build folder.
|
||||||
|
|
||||||
|
The simconfig should be changed in order to support storage and address offsets:
|
||||||
|
|
||||||
|
``` json
|
||||||
|
{
|
||||||
|
"simconfig": {
|
||||||
|
"CheckTLM2Protocol": false,
|
||||||
|
"DatabaseRecording": true,
|
||||||
|
"Debug": false,
|
||||||
|
"ECCControllerMode": "Disabled",
|
||||||
|
"EnableWindowing": false,
|
||||||
|
"ErrorCSVFile": "",
|
||||||
|
"ErrorChipSeed": 42,
|
||||||
|
"NumberOfDevicesOnDIMM": 8,
|
||||||
|
"NumberOfMemChannels": 1,
|
||||||
|
"PowerAnalysis": false,
|
||||||
|
"SimulationName": "ddr3",
|
||||||
|
"SimulationProgressBar": true,
|
||||||
|
"ThermalSimulation": false,
|
||||||
|
"WindowSize": 1000,
|
||||||
|
|
||||||
|
"StoreMode": "Store",
|
||||||
|
"AddressOffset": 2147483648,
|
||||||
|
"UseMalloc": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Then start DRAMSys_gem5 with the following command:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-example.json config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
For further sophisticated address mappings or scenarios checkout the file DRAMSys/gem5/main.cpp
|
||||||
|
|
||||||
|
#### Boot Linux with gem5 and DRAMSys Example
|
||||||
|
|
||||||
|
**All essential files for a functional example are provided.**
|
||||||
|
|
||||||
|
Unzip the disk image:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
tar -xaf DRAMSys/gem5/boot_linux/linux-aarch32-ael.img.tar.gz -C DRAMSys/gem5/boot_linux/
|
||||||
|
```
|
||||||
|
|
||||||
|
Execute the example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-boot-linux.json ../../DRAMSys/gem5/configs/boot_linux.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
Open a new terminal and connect to gem5:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
telnet localhost 3456
|
||||||
|
```
|
||||||
|
|
||||||
|
Wait some minutes for the Linux boot process to complete then login. Username is
|
||||||
|
**root** no password required.
|
||||||
|
|
||||||
|
|
||||||
|
### DRAMSys with gem5 Elastic Traces
|
||||||
|
|
||||||
|
For understanding elastic traces and their generation, study the [gem5
|
||||||
|
wiki](http://gem5.org/TraceCPU) and the paper [13].
|
||||||
|
Some predefined configs are stored [here](DRAMSys/gem5/configs) and the related
|
||||||
|
python files are stored [here](DRAMSys/gem5/examples).
|
||||||
|
|
||||||
|
This is an example for running an elastic trace:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-example.json ../../DRAMSys/gem5/configs/singleElasticTraceReplay.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
An overview of the architcture being simulated is presented below:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Note that the address offset is usually zero for elastic traces.
|
||||||
|
|
||||||
|
Another example with L2 cache:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-example.json ../../DRAMSys/gem5/configs/singleElasticTraceReplayWithL2.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
If two elastic traces should be used run the simulation with the following example:
|
||||||
|
|
||||||
|
```
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-example.json ../../DRAMSys/gem5/configs/dualElasticTraceReplay.ini 2
|
||||||
|
```
|
||||||
|
|
||||||
|
An overview of the architcture being simulated is presented below:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
For more spophisticated setups, even with l2 caches the proper ini file should be created.
|
||||||
|
If you need help please contact Matthias Jung.
|
||||||
|
|
||||||
|
### DRAMSys + GEM5 Log Collector Scripts
|
||||||
|
|
||||||
|
Users can profit of running multiple **DRAMSys + gem5** simulations
|
||||||
|
automatically with [gem5ilva.sh] for **gem5 syscall emulation (SE) mode** and
|
||||||
|
[gem5ilva_fs.sh] for **gem5 full system (FS) mode**.
|
||||||
|
|
||||||
|
Normally you will have to push your changes before running the scripts. This
|
||||||
|
approach makes it easier to track back what exactly was tested by the scripts.
|
||||||
|
|
||||||
|
The scripts provide variables that tell **git** where to get the source
|
||||||
|
code from (repository URL), user name to be used (your git account),
|
||||||
|
**branch** to checkout (your working branch), etc. They are:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Git info.
|
||||||
|
git_user="$USER"
|
||||||
|
git_branch="master"
|
||||||
|
git_url="git.eit.uni-kl.de:ems/astdm/dram.sys.git"
|
||||||
|
git_url_https="git.eit.uni-kl.de/ems/astdm/dram.sys.git"
|
||||||
|
```
|
||||||
|
|
||||||
|
The default values of the variables presented above assume that your git
|
||||||
|
account uses the same name as your user name in your PC. If that is not the
|
||||||
|
case, replace the value of the **git_user** variable with your git account
|
||||||
|
name. Similarly, replace the value of the variable **git_branch** with your
|
||||||
|
working branch name. There (in your working branch) you can push your changes
|
||||||
|
and/or new files before executing the scripts.
|
||||||
|
|
||||||
|
Open the script in QtCreator or another text editor of your choice and set the
|
||||||
|
variables with values that fit your needs.
|
||||||
|
|
||||||
|
Nevertheless, for some cases, you may want to have gem5 essential files out of
|
||||||
|
the main repository (usually because they are too big to be added to the
|
||||||
|
repository).
|
||||||
|
|
||||||
|
For those cases uncomment and properly set the variable
|
||||||
|
**external_inifile_path** in [gem5ilva_fs.sh].
|
||||||
|
|
||||||
|
This allows you to use a gem5 **config.ini** file external to the repository.
|
||||||
|
Note, however, that in this case it is up to you to keep track of your
|
||||||
|
simulation setup.
|
||||||
|
|
||||||
|
**Hint:**
|
||||||
|
[gem5.TnT] provides convenience scripts
|
||||||
|
to create gem5 disk images with benchmarking programs embedded.
|
||||||
|
|
||||||
|
|
||||||
|
### Coverage Check
|
||||||
|
|
||||||
|
Coverage check is enabled by default and can be disabled with an environment
|
||||||
|
variable.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export COVERAGE=true
|
||||||
|
```
|
||||||
|
|
||||||
|
### DRAMSys + GEM5 x86
|
||||||
|
|
||||||
|
Make sure you have built **gem5/build/X86/libgem5_opt.so**. If you build with
|
||||||
|
[gem5.TnT] you can check if the library exists as follows.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ ls $HOME/gem5_tnt/gem5/build/X86/libgem5_opt.so
|
||||||
|
```
|
||||||
|
|
||||||
|
Change your ~/.bashrc.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# In this example gem5 is located at $HOME/gem5_tnt/gem5.
|
||||||
|
export GEM5=$HOME/gem5_tnt/gem5
|
||||||
|
|
||||||
|
# Add the folder containing libgem5_opt.so to the list where libraries should
|
||||||
|
# be searched for.
|
||||||
|
#export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GEM5}/build/ARM
|
||||||
|
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${GEM5}/build/X86
|
||||||
|
```
|
||||||
|
|
||||||
|
After that close QtCreator and all terminals.
|
||||||
|
|
||||||
|
Open a new terminal.
|
||||||
|
|
||||||
|
Change the architecture in [DRAMSys/gem5/gem5.pro](DRAMSys/gem5/gem5.pro).
|
||||||
|
|
||||||
|
```
|
||||||
|
gem5_arch = 'X86'
|
||||||
|
```
|
||||||
|
|
||||||
|
Delete the file **DRAMSys/DRAMSys.pro.user** from the repository.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ rm DRAMSys/DRAMSys.pro.user
|
||||||
|
```
|
||||||
|
|
||||||
|
Open a new QtCreator.
|
||||||
|
|
||||||
|
Build DRAMSys as usual.
|
||||||
|
|
||||||
|
After building, go the the folder where *DRAMSys_gem5* is located.
|
||||||
|
|
||||||
|
Test with a hello world application for X86.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/hello-x86/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
A **Hello world!** message should be printed to the standard output.
|
||||||
|
|
||||||
|
### [MiBench]
|
||||||
|
|
||||||
|
Applications for x86 and configuration files available in [DRAMSys/gem5/gem5_se/MiBench](DRAMSys/gem5/gem5_se/MiBench).
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
**Automotive Applications**
|
||||||
|
|
||||||
|
**Basicmath**
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/automotive/basicmath/small/config.ini 1
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/automotive/basicmath/large/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
**Bitcount**
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/automotive/bitcount/small/config.ini 1
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/automotive/bitcount/large/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
**Qsort**
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/automotive/qsort/small/config.ini 1
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/automotive/qsort/large/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
**Susan**
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/automotive/susan/small/corners/config.ini 1
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/automotive/susan/large/corners/config.ini 1
|
||||||
|
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/automotive/susan/small/edges/config.ini 1
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/automotive/susan/large/edges/config.ini 1
|
||||||
|
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/automotive/susan/small/smoothing/config.ini 1
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/automotive/susan/large/smoothing/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
**Network Applications**
|
||||||
|
|
||||||
|
**Dijkstra**
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/network/dijkstra/small/config.ini 1
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/network/dijkstra/large/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
**Patricia**
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/network/patricia/small/config.ini 1
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/network/patricia/large/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
**Security Applications**
|
||||||
|
|
||||||
|
**Blowfish Encode**
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/security/blowfish/encode/small/config.ini 1
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/security/blowfish/encode/large/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
**Blowfish Decode**
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/security/blowfish/decode/small/config.ini 1
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/security/blowfish/decode/large/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
**SHA**
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/security/sha/small/config.ini 1
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/security/sha/large/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
**Telecom Applications**
|
||||||
|
|
||||||
|
**CRC32**
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/telecomm/crc32/small/config.ini 1
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/telecomm/crc32/large/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
**FFT**
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/telecomm/fft/small/config.ini 1
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/telecomm/fft/large/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
**FFT-INV**
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/telecomm/fft-inv/small/config.ini 1
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/telecomm/fft-inv/large/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
**GSM Encode**
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/telecomm/gsm/encode/small/config.ini 1
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/telecomm/gsm/encode/large/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
**GSM Decode**
|
||||||
|
```bash
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/telecomm/gsm/decode/small/config.ini 1
|
||||||
|
./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/ddr3-gem5-se.json ../../DRAMSys/gem5/gem5_se/MiBench/telecomm/gsm/decode/large/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
Check the folder [DRAMSys/gem5/gem5_se/MiBench](DRAMSys/gem5/gem5_se/MiBench) for all applications and configuration files.
|
||||||
|
|
||||||
|
### More AARCH64 Apps
|
||||||
|
|
||||||
|
Full system simulation files for ARM available in [DRAMSys/gem5/gem5_fs/arm64](DRAMSys/gem5/gem5_fs/arm64).
|
||||||
|
|
||||||
|
You can edit [arm64.rcS](DRAMSys/gem5/gem5_fs/arm64/arm64.rcS) to start an application and call *m5 exit* when it finishes.
|
||||||
|
|
||||||
|
Edit the paths in [config.ini](DRAMSys/gem5/gem5_fs/arm64/config.ini).
|
||||||
|
|
||||||
|
All files required to build DRAMSys_gem5 and execute the simulation (gem5
|
||||||
|
library, benchmarks, disk image, etc.) can be obtained with [gem5.TnT].
|
||||||
|
|
||||||
|
Start a simulation. Example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
dram.sys/build/gem5$ ./DRAMSys_gem5 ../../DRAMSys/library/resources/simulations/rgrsim-gem5-fs.json ../../DRAMSys/gem5/gem5_fs/arm64/config.ini 1
|
||||||
|
```
|
||||||
|
|
||||||
|
Optionally, open another terminal or tab and connect to gem5.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ telnet localhost 3456
|
||||||
|
```
|
||||||
|
|
||||||
|
Note: the port may vary, gem5 prints it during initialization. Example:
|
||||||
|
|
||||||
|
```
|
||||||
|
system.terminal: Listening for connections on port 3456
|
||||||
|
```
|
||||||
|
|
||||||
|
[gem5.TnT]: https://github.com/tukl-msd/gem5.TnT
|
||||||
|
[gem5ilva.sh]: DRAMSys/library/resources/scripts/DRAMSylva/gem5ilva.sh
|
||||||
|
[gem5ilva_fs.sh]: DRAMSys/library/resources/scripts/DRAMSylva/gem5ilva_fs.sh
|
||||||
|
[Elwetritsch]: https://elwe.rhrk.uni-kl.de/
|
||||||
|
[DRAMSylva.sh]: DRAMSys/library/resources/scripts/DRAMSylva/DRAMSylva.sh
|
||||||
|
[DRAMSylva folder]: DRAMSys/library/resources/scripts/DRAMSylva
|
||||||
|
[configs_json]: DRAMSys/library/resources/scripts/DRAMSylva/configs_json
|
||||||
|
[MiBench]: http://vhosts.eecs.umich.edu/mibench/
|
||||||
|
[PARSEC]: http://parsec.cs.princeton.edu/
|
||||||
@@ -288,8 +288,8 @@ add_library(DRAMSysLibrary
|
|||||||
resources/traces/chstone-adpcm_32.stl
|
resources/traces/chstone-adpcm_32.stl
|
||||||
)
|
)
|
||||||
|
|
||||||
if(DEFINED ENV{LIBTHREED_ICE_HOME} AND DEFINED ENV{LIBSUPERLU_HOME})
|
if(DEFINED ENV{LIBTHREED_ICE_HOME})
|
||||||
message("-- 3D-ICE and SuperLU available")
|
message("-- Thermal simulation available")
|
||||||
add_definitions(-DTHERMALSIM)
|
add_definitions(-DTHERMALSIM)
|
||||||
target_include_directories(DRAMSysLibrary
|
target_include_directories(DRAMSysLibrary
|
||||||
PRIVATE $ENV{LIBTHREED_ICE_HOME}/include/
|
PRIVATE $ENV{LIBTHREED_ICE_HOME}/include/
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ tlm_sync_enum Controller::nb_transport_fw(tlm_generic_payload &trans,
|
|||||||
timeToAcquire = sc_time_stamp() + notificationDelay;
|
timeToAcquire = sc_time_stamp() + notificationDelay;
|
||||||
beginReqEvent.notify(notificationDelay);
|
beginReqEvent.notify(notificationDelay);
|
||||||
}
|
}
|
||||||
else if (phase = END_RESP)
|
else if (phase == END_RESP)
|
||||||
{
|
{
|
||||||
timeToRelease = sc_time_stamp() + notificationDelay;
|
timeToRelease = sc_time_stamp() + notificationDelay;
|
||||||
endRespEvent.notify(notificationDelay);
|
endRespEvent.notify(notificationDelay);
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ public:
|
|||||||
virtual void insertPayload(tlm::tlm_generic_payload *, sc_time) = 0;
|
virtual void insertPayload(tlm::tlm_generic_payload *, sc_time) = 0;
|
||||||
virtual tlm::tlm_generic_payload *nextPayload() = 0;
|
virtual tlm::tlm_generic_payload *nextPayload() = 0;
|
||||||
virtual sc_time getTriggerTime() const = 0;
|
virtual sc_time getTriggerTime() const = 0;
|
||||||
|
virtual ~RespQueueIF() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // RESPQUEUEIF_H
|
#endif // RESPQUEUEIF_H
|
||||||
|
|||||||
Reference in New Issue
Block a user