Skip to content
EbodShojaeiPublic

About

An FPGA memory controller for RowHammer experiments on real SDRAM 🔨⚡️

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DubRAM logo

DubRAM

RowHammer experiments on real SDRAM, from Python.

An FPGA memory controller for the Terasic DE10-Standard that issues every SDRAM command itself, checks each command against the datasheet, and counts every bit that reads back wrong.

Tutorial  ·  Guide  ·  Design  ·  Results


import dubram

exp = dubram.Experiment(
    attack=dubram.attack.SingleSided(aggressor=6071, seconds=10),  # hammer one row for 10 s
    refresh=dubram.refresh.Periodic(),  # refresh stays on, as the datasheet requires
)
result = exp.run(trials=3, controls=True)  # three runs, and a control in another bank
print(result.rows)  # the rows that flipped, as a plain list

Quick start

You need a DE10-Standard, Quartus Prime Lite 25.1, and Python 3.10 or later on Linux: see Requirements.

source scripts/env.sh                    # Quartus and System Console on the PATH
scripts/build.sh --program               # Python environment, bitstream, program the FPGA
source .venv/bin/activate
python -m dubram selftest                # the link answers and the clock runs at 100 MHz
python -m dubram accept                  # the acceptance test of the programmed board
python docs/tutorial/01_first_flip.py    # the experiment above

No board yet? scripts/build.sh --no-build sets up Python alone, and python docs/tutorial/07_saved_results.py loads and plots the saved results.

Next: the tutorial, nine short lessons that start with this experiment.

How it works

The controller: host link and registers, the sources of commands, the scheduler and the PHY, and the instrumentation

  • The scheduler is the only source of SDRAM commands, and it issues one only when the timing of the memory allows it.
  • The sequencer runs the step program that the host loads: write rows, pause refresh, hammer, wait, read back.
  • The back-off counts the activations of each bank and issues refreshes when a count reaches its threshold.
  • The instrumentation only watches: it checks every command that leaves the FPGA against the datasheet, compares the read data with the pattern that was written, and counts and traces the commands.

Architecture describes the design, and the register map its interface to the host.

Repository

docs/       # tutorial/, guide/ (the Python package), design/ (the controller), img/
fpga/       # rtl/ (the controller), sim/ (testbenches), de10_standard/ (the board project)
host/       # dubram/ (the Python package), tests/ (its unit tests)
results/    # data/ (measured on a board), plots/ (drawn from the data)
scripts/    # env.sh, build.sh, reproduce.sh (runs everything that needs no board)

docs/README.md lists every page.

About

An FPGA memory controller for RowHammer experiments on real SDRAM 🔨⚡️

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages