DRAMSylva refactored

DRAMSylva (or parts of it) will be possibly used in auto tests.
This commit is contained in:
Éder F. Zulian
2018-07-19 13:32:55 +02:00
parent d0c889da06
commit 82d4c164f0

107
README.md
View File

@@ -968,18 +968,19 @@ A description of the content each directory follows.
- **traces**: pre-recorded trace files that may be used as stimuli in simulations.
#### Log Collector Script
### 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.
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
$ bash DRAMSylva.sh
```
To see the generated plots and CSV files:
@@ -988,74 +989,109 @@ To see the generated plots and CSV files:
$ nautilus dram.vp.system_YYYY_MM_DD-HH.MM.SS/build/simulator
```
In that folder you will find plots as PDF files and CSV files with the output data used to generate the plots. The CSV files are:
In that folder you will find plots as 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.)
- **out.csv** (energy, average power, bandwidth, etc.)
- **metrics.csv** (DRAMSys metrics like average response latency, memory utilization and many others)
- **metrics.csv** (DRAMSys metrics like average response latency, memory
utilization and many others)
The generated CSV files can be open in a spreadsheet program for further manipulation.
Use the command below to find all generated CSV files:
Additionally, the database files (\*.tdb) generated will be available and can be open with the traceAnalyzer tool.
``` bash
$ ls -l dram.vp.system_YYYY_MM_DD-HH.MM.SS/build/simulator/*.csv
```
A DRAMSys simulation is defined by the main configuration file passed to the simulator. The main configuration file includes other files which contain specifc configs.
You can change what is going to be simulated by the script by editing it. There is a list of main configuration files on the top of the script:
The generated CSV files can be open in a spreadsheet program for further
manipulation.
Set the variable **create_comparison_plots** to **yes** in order to get plots
for quick comparison from the CSV files generated.
``` bash
create_comparison_plots="yes"
```
Additionally, the database files (\*.tdb) generated will be available and can
be open with the traceAnalyzer tool for debugging, plot generation, etc.
Set the variable **create_analyzer_plots** to **yes** in order to get plots
generated from the trace databases (the same plots generated by the trace
analyzer tool). **Note**: enabling this option may incur extra time for
database manipulation and plot generation. Depending on the size and amount of
database files it may take long to finish.
``` bash
create_analyzer_plots="yes"
```
A DRAMSys simulation is defined by the main configuration file passed to the
simulator. The main configuration file includes other files which contain
specifc configs.
You can change what is going to be simulated by the script by editing it.
There is a list of main configuration files on the top of the script:
``` bash
sim_files="
../../DRAMSys/library/resources/simulations/ddr3-example.xml
../../DRAMSys/library/resources/simulations/ddr3-single-device.xml
../../DRAMSys/library/resources/simulations/wideio-example.xml
ddr3-example.xml
ddr3-single-device.xml
wideio-example.xml
"
```
Set the variable **use_trace_list** to **yes** in order to use all traces
from the trace list for all simulation files. Each pair generates a new
simulation. Otherwise it runs a simulation per simulation file. The trace
specified inside the simulation file is used.
Simulation files are expected to be available (already commited and pushed to
be available after cloning) in the [simulation folder](DRAMSys/library/resources/simulations).
Set the variable **use_trace_list** to **yes** in order to use all traces in
the **trace list** with all simulation files. Each pair generates a new simulation
with the original trace specified in the simulation file replaced by a trace
from the list. Otherwise it runs a simulation per simulation file using the
trace specified in the simulation file. Files are expected to be available
(already commited and pushed to be available after cloning) in the
[traces folder](DRAMSys/library/resources/configs/traces).
``` bash
use_trace_list="yes"
```
When you choose **yes** then **traces have to be explicitly added to the traces
list**. A new simulation is defined by a combination of two elements, one from
the simulation files list and the other from the traces list. Thus the number
of simulations executed is the number of simulation files multiplied by the
number of traces.
```bash
traces="
trace_list="
chstone-bf_32.stl
chstone-jpeg_32.stl
chstone-adpcm_32.stl
mediabench-unepic_32.stl
"
```
The script runs one instance of DRAMSys for each of the files in the list.
**The multiple instances run in parallel**.
Set the variable **use_DRAMSyrup_to_generate_config_files** to **yes** in
order to get all the essential simuation files auto generated from a
description in JSON format specified by the variable **json_file**. Several
examples of JSON configuration files are provided in
[**configs_json**](DRAMSys/library/resources/scripts/DRAMSylva/configs_json).
**Note: this overrides sim_files**.
Set the variable **use_json_cfg** to **yes** in order to override sim_files
with new simulation files generated from a JSON description. Otherwise the
simulation files are the ones specified by sim_files. Files are expected to be
available (already commited and pushed to be available after cloning) in the
[configs_json](DRAMSys/library/resources/scripts/DRAMSylva/configs_json).
``` bash
use_DRAMSyrup_to_generate_config_files="yes"
use_json_cfg="yes"
```
All the essential simuation files are auto generated accordingly to the JSON
description provided in **json_cfg**.
Several examples of JSON configuration files are provided in
[configs_json](DRAMSys/library/resources/scripts/DRAMSylva/configs_json).
+ Insert the desired simulation data in a JSON file following any of the
examples provided, e.g.,
[**configs.json**](DRAMSys/library/resources/scripts/DRAMSylva/configs_json/configs.json).
Multiple arrays are allowed and encouraged. Each array corresponds to a full
simulation setup.
+ Assign your JSON file to the variable **json_file** in DRAMSylva.sh.
+ Assign your JSON file to the variable **json_cfg** in DRAMSylva.sh.
``` bash
json_file="configs.json"
json_cfg="configsrbc1x.json"
```
+ Commit and push your changes.
@@ -1064,10 +1100,9 @@ json_file="configs.json"
inside the output folder, so it will be possible to keep a perfect track of
all simulations.
For more information check the documentation in [DRAMSylva](DRAMSys/library/resources/scripts/DRAMSylva).
For more information check the documentation in [DRAMSylva folder](DRAMSys/library/resources/scripts/DRAMSylva).
#### Trace Generator Script
### Trace Generator Script
The [trace_gen](DRAMSys/library/resources/scripts/trace_gen.py) script for
generating input traces for simple tests is provided.