This tool aids in system-level hardware simulations, particularly for large chip designs (RTL models) that require co-simulation with modern off-chip DRAMs (e.g., LPDDR, DDR, HBM). It utilizes DRAMSys5.0 for the simulation of DRAM + CTRL models, setting up a co-simulation environment between RTL and DRAMSys5.0 effectively.
- This tool leverages
benderfor dependency management and automatic generation of compilation scripts. - Note: We currently do not offer an open-source simulation setup. Instead, we have utilized
Questasimfor simulation. - For building DRAMSys, cmake version >= 3.28.1 is required.
To download, patch, and build the DRAMSys dynamic linkable libraries, run
make -j dramsysAfter building, two key libraries will be available in dramsys_lib/DRAMSys/build/lib:
libsystemc.solibDRAMSys_Simulator.so
From the root folder of this repository, use the command make all or make gui to run an RTL testbench that attempts to access DDR4-DIMM data.
Steps:
-
Include the following three SystemVerilog files from the
srcdirectory into your project. For example, you can add them to yourBender.ymlsource list:src/sim_dram.svsrc/axi_dram_sim.svsrc/dram_sim_engine.sv
-
Instantiate only one
dram_sim_enginein your design and set the parameter for your design'sclk period in ns. It is recommended to place it in your top-level design. -
Utilize the
axi_dram_simmodule as a standard SystemVerilog module with an AXI4 interface by:- Passing basic AXI interface parameters.
- Specifying the DRAM model to simulate with the
DRAMTypeparameter (defaults toDDR4). - Providing the base address of the DRAM model in your design.
-
For simulation in Modelsim, link Modelsim to the built libraries (
libsystemc.soandlibDRAMSys_Simulator.so) and specify the location of configuration files by passing the following arguments to your command:-sv_lib <library folder path>/libsystemc -sv_lib <library folder path>/libDRAMSys_Simulator +DRAMSYS_RES=<path to dramsys_lib/resources>
-
💡 Now, you are ready to enjoy your DRAM simulation!
All hardware sources and tool scripts are licensed under the Solderpad Hardware License 0.51 (see LICENSE). DRAMSys5.0 is employed for DRAM simulations; please adhere to their license as well.