The aim of this project is to provide a platform for testing the DRAM "Row Hammer" vulnerability.
The setup consists of FPGA gateware and application side software. The following diagram illustrates the general system architecture.
The DRAM is connected to LiteDRAM which provides swappable PHYs and a DRAM controller implementation.
In the default bulk transfer mode the LiteDRAM controller is connected to PHY and ensures correct DRAM traffic. Bulk transfers can be controlled using dedicated Control & Status Registers (CSRs) and use LiteDRAM DMA to ensure fast operation.
Payload Executor allow executing a user-provided sequence of commands. It temporarily disconnects the DRAM controller from PHY, executes the instructions stored in the SRAM memory translating them into DFI commands and finally reconnects the DRAM controller.
The application side consists of a set of Python scripts communicating with the FPGA using the LiteX EtherBone bridge.
Make sure you have Python 3 installed with the venv
module, and the dependencies required to build
verilator and xc3sprog.
To install the dependencies on Ubuntu 18.04 LTS run:
apt install build-essential cmake flex bison libftdi-dev libjson-c-dev uml-utilities python3 python3-venv
Then run:
make deps
This will download and build all the dependencies and setup a Python virtual environment under ./venv
directory with all the required packages installed.
Virtual environment allows you to use Python without installing the packages system-wide.
To enter the environment you have to run source venv/bin/activate
in each new shell.
You can also use the provided make env
target which will start a new Bash shell with the virtualenv already sourced.
You can install packages inside the virtual environment by entering the environment and then using pip
.
Some options to the scripts may require additional Python dependencies. To install them run
pip install -r requirements-dev.txt
inside the virtual environment.
To build the bitstream you will also need to have Vivado installed and the vivado
command available in your PATH
.
To configure Vivado in the current shell you need to source /PATH/TO/Vivado/VERSION/settings64.sh
.
This can be put in your .bashrc
or other shell init script.
To make the process automatic without hard-coding these things in shell init script,
tools like direnv can be used. A sample .envrc
file would then look like this:
source venv/bin/activate
source /PATH/TO/Vivado/VERSION/settings64.sh
All other commands assume that you run Python from the virtual environment with vivado
in your PATH
.
The gareware documentation for the master
branch is hosted on Github Pages her