Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
# Chi Zhang <chizhang@iis.ee.ethz.ch>

BENDER ?= bender
QUESTA ?= questa
CMAKE ?= cmake



VLOG_ARGS = -svinputport=compat -override_timescale 1ns/1ps -suppress 2583 -suppress 13314
library ?= work
top_level ?= axi_to_dram_tb
Expand All @@ -24,17 +29,17 @@ questa_args += -sv_lib $(dramsys_lib_path)/libsystemc
questa_args += -sv_lib $(dramsys_lib_path)/libDRAMSys_Simulator

all: compile
cd vsim && questa vsim -c $(library).$(top_level) -t 1ps -voptargs=+acc $(questa_args) -do start.tcl
cd vsim && $(QUESTA) vsim -c $(library).$(top_level) -t 1ps -voptargs=+acc $(questa_args) -do start.tcl

gui: compile
cd vsim && questa vsim $(library).$(top_level) -t 1ps -voptargs=+acc $(questa_args) -do start.tcl
cd vsim && $(QUESTA) vsim $(library).$(top_level) -t 1ps -voptargs=+acc $(questa_args) -do start.tcl

compile: vsim/compile.tcl
compile: vsim/compile.tcl dramsys
echo "exit" >> vsim/compile.tcl
cd vsim && questa vsim -c -do compile.tcl
cd vsim && $(QUESTA) vsim -c -do compile.tcl

vsim/compile.tcl: Bender.yml Makefile $(shell find src -type f) $(shell find test -type f)
$(BENDER) script vsim -t test -t rtl --vlog-arg="$(VLOG_ARGS)" > $@

clean:
clean: dramsys-clean
cd vsim && rm -rf work/ vsim* transcript modelsim.ini compile.tcl .nfs* DRAM*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This tool aids in system-level hardware simulations, particularly for large chip

- This tool leverages [`bender`](https://github.com/pulp-platform/bender) for dependency management and automatic generation of compilation scripts.
- Note: We currently do not offer an open-source simulation setup. Instead, we have utilized `Questasim` for simulation.
- For building DRAMSys, cmake version >= 3.28.1 is required.
- For building DRAMSys, cmake version >= 3.28.1 and GCC version >= 11.2.0 is required.

### 🔨 Build DRAMSys Dynamic Linkable Library

Expand Down
8 changes: 8 additions & 0 deletions dram_rtl_sim.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ DRAM_RTL_SIM_ROOT ?= $(shell $(BENDER) path axi_dram_sim)
DRAMSYS_ROOT ?= $(DRAM_RTL_SIM_ROOT)/dramsys_lib/DRAMSys
DRAMSYS_BUILD_DIR ?= $(DRAMSYS_ROOT)/build

CC ?= gcc
CXX ?= g++

dramsys: $(DRAMSYS_BUILD_DIR)/lib/libsystemc.so

# Clone and patch DRAMSys
Expand All @@ -24,3 +27,8 @@ $(DRAMSYS_BUILD_DIR)/lib/libsystemc.so: $(DRAMSYS_ROOT)/.patched
mkdir -p $(DRAMSYS_BUILD_DIR)
cd $(DRAMSYS_BUILD_DIR) && $(CMAKE) -DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_C_FLAGS=-fPIC -D DRAMSYS_WITH_DRAMPOWER=ON $(DRAMSYS_ROOT)
$(MAKE) -C $(DRAMSYS_BUILD_DIR)

.PHONY: dramsys-clean

dramsys-clean:
rm -rf $(DRAMSYS_BUILD_DIR)/
5 changes: 5 additions & 0 deletions iis-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export CC=gcc-11.2.0
export CXX=g++-11.2.0
export CMAKE=cmake-3.28.3
export QUESTA=questa-2022.3
export BENDER=bender