Files
DRAMSys/README.md
2015-05-20 13:02:11 +02:00

220 lines
5.9 KiB
Markdown

de.uni-kl.ems.dram.vp.system
============================
Generic DRAM controller simulator and debug tools related to it.
## Basic Setup
In a terminal window execute the commands that follow.
Go to your home directory.
```
$ cd
```
Create a directory for your projects.
```
$ mkdir projects
```
Clone the repository.
```
$ git clone --recursive https://<user>@git.rhrk.uni-kl.de/EIT-Wehn/dram.vp.system.git
```
The *--recursive* flag tells git to initialize all submodules within the
repository. **DRAMPower** and **tinyxml** are examples third party
repositories that were embedded within the source tree as submodules.
It is possible that you will work with a **fork** of the official codebase. A
fork is a copy of a repository. In that case, after pushing changes into your
copy you should create a **pull request** in order to your supervisor check
and possibly bring your changes to the official codebase.
```
$ git clone --recursive https://<user>@git.rhrk.uni-kl.de/<user>/dram.vp.system.git
```
After cloning go to the project directory.
```
$ cd dram.vp.system
```
### With QTCreator
Execute the *QTCreator*.
```
$ qtcreator &
```
Use the menu bar and open the DRAMSys project.
**File -> Open Project -> dram.vp.sys/dram/dramSys/dramSys.pro**
When you open the project for the first time a configuration window pops-up.
Then click in **Configure Project** and after that **Build** the project.
Repeat the procedure above and build the trace analyser project.
**File -> Open Project -> dram.vp.sys/analyser/analyser/traceAnalizer.pro**
### Without QTCreator
In case you prefer a command line interface to the QTCreator GUI you can also
use **qmake** to generate a Makefile and then compile the project.
```
$ cd dram
$ mkdir build
$ cd build
$ qmake ../dramSys/dramSys.pro
$ make
```
### DRAMSys Configuration
The **dramSys** executable supports one argument which is a XML file that
contains configurable aspects of the desired simulation. If no argument is
passed through the command line a default configuration file will be loaded.
The XML code below shows a typic configuration:
```
<simulation>
<simconfig>
<Debug value="1" />
<DatabaseRecording value="1" />
<PowerAnalysis value="1" />
</simconfig>
<memspecs>
<memspec src="../resources/configs/memspecs/WideIO.xml"></memspec>
</memspecs>
<addressmappings>
<addressmapping src="../resources/configs/amconfigs/am_wideio.xml"></addressmapping>
Multiple address mappings
</addressmappings>
<memconfigs>
<memconfig src="../resources/configs/memconfigs/fifo.xml"/>
Multiple mem. configs
</memconfigs>
<tracesetups>
<tracesetup id="fifo">
<device clkMhz="200">voco2.stl</device>
</tracesetup>
</tracesetups>
</simulation>
```
Some configuration fields reference other XML files which contain more
specialized chunks of the configuration like memory specification, address
mapping and memory configurations.
The XML configuration files are parsed by the program and the configuration
details extracted are assigned to the correspondent attributes of the internal
configuration structure.
#### Configuration File Sections
The main configuration file is divided into self-contained sections, each of
these sections is a set of logically related configuration aspects for the
simulation.
Below are listed the configuration sections and configuration fields.
- **Simulator configuration**
- *Debug* (boolean)
- "1": Enables debug output on console
- "0": Disables debug output
- *DatabaseRecording* (boolean)
- "1": Enables trace file recording for the trace analyser tool
- "0": Disables trace file recording
- *PowerAnalysis* (boolean)
- "1": Enables live power analysis with the DRAMPower tool
- "0": Disables power analysis
- **Memory specification**
A file with memory specifications. Usually, this information comes from
datasheet and does not change.
- **Address Mapping**
XML files describe the address mapping to be used in the simulation.
"dram/resources/configs/amconfigs/am_wideio.xml"
```
<addressmapping>
<channel from="27" to="28"/>
<row from="14" to="26"/>
<column from="7" to="13"/>
<bank from="4" to="6" />
<bytes from="0" to="3" />
</addressmapping>
```
![WideIO Address Mapping Sample](docs/images/am_wideio.svg)
"dram/resources/configs/amconfigs/am_ddr4.xml"
```
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!-- highest bank parallelism - high hits -->
<dramconfig>
<addressmap length="32">
<row from="19" to="31"/>
<column from="9" to="18"/>
<bank from="5" to="8" />
</addressmap>
</dramconfig>
```
![DDR4 Address Mapping Sample](docs/images/am_ddr4.svg)
- **Memory Configuration**
<memconfig src="../resources/configs/memconfigs/fifo.xml"/>
Multiple mem. configs --> repeat for all...
- **Trace setups**
<tracesetup id="fifo">
<device clkMhz="200">voco2.stl</device>
Some attributes are self-explanatory while others require some previous
knowhow of memory technologies or some knowledge of the simulator source code.
## DRAMSys Resources
Some resources of the simulator are available in the **resources** directory
its sub-directories.
```
$ cd /projects/dram.vp.system/dram/resources
```
A short 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
- simconfigs: simulator configuration
- **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.