Skip to content
Draft
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
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@
[submodule "toolchains/riscv-tools/riscv-tools-feedstock"]
path = toolchains/riscv-tools/riscv-tools-feedstock
url = https://github.com/ucb-bar/riscv-tools-feedstock.git
[submodule "tools/DRAMSim2"]
path = tools/DRAMSim2
url = https://github.com/firesim/DRAMSim2.git
[submodule "tools/axe"]
path = tools/axe
url = https://github.com/CTSRD-CHERI/axe.git
Expand Down Expand Up @@ -163,3 +160,6 @@
[submodule "generators/radiance"]
path = generators/radiance
url = https://github.com/ucb-bar/radiance.git
[submodule "tools/DRAMSim3"]
path = tools/DRAMSim3
url = git@github.com:umd-memsys/DRAMsim3.git
13 changes: 8 additions & 5 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -463,14 +463,17 @@ ifneq ($(filter run% %.run %.out %.vpd %.vcd %.fsdb,$(MAKECMDGOALS)),)
-include $(build_dir)/$(long_name).d
endif



#######################################
# Rules for building DRAMSim2 library
# Rules for building DRAMSim3 library
#######################################
dramsim_dir = $(base_dir)/tools/DRAMSim2
dramsim_lib = $(dramsim_dir)/libdramsim.a
dramsim3_dir = $(base_dir)/tools/DRAMSim3
dramsim3_lib = $(dramsim3_dir)/libdramsim3.a

$(dramsim_lib):
$(MAKE) -C $(dramsim_dir) $(notdir $@)
$(dramsim3_lib): $(wildcard $(dramsim3_dir)/src/*.cc) $(wildcard $(dramsim3_dir)/src/*.h)
$(MAKE) -C $(dramsim3_dir) all
$(AR) rcs $@ $(dramsim3_dir)/src/*.o

################################################
# Helper to run SBT
Expand Down
7 changes: 4 additions & 3 deletions sims/common-sim-flags.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#----------------------------------------------------------------------------------------
SIM_OPT_CXXFLAGS := -O3
LRISCV=-lriscv
NUMA_PATH := $(shell dirname $$(ldconfig -p | grep libnuma.so | head -n1 | awk '{print $$NF}'))

export USE_CHISEL6=1

Expand All @@ -11,19 +12,19 @@ SIM_CXXFLAGS = \
$(SIM_OPT_CXXFLAGS) \
-std=c++17 \
-I$(RISCV)/include \
-I$(dramsim_dir) \
-I$(dramsim3_dir)/src \
-I$(GEN_COLLATERAL_DIR) \
$(EXTRA_SIM_CXXFLAGS)

SIM_LDFLAGS = \
$(LDFLAGS) \
-L$(NUMA_PATH) \
-L$(RISCV)/lib \
-Wl,-rpath,$(RISCV)/lib \
-L$(sim_dir) \
-L$(dramsim_dir) \
$(LRISCV) \
-lfesvr \
-ldramsim \
$(dramsim3_dir)/libdramsim3.a \
$(EXTRA_SIM_LDFLAGS)

CLOCK_PERIOD ?= 1.0
Expand Down
4 changes: 2 additions & 2 deletions sims/vcs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ model_dir_debug = $(build_dir)/$(long_name).debug
#########################################################################################


$(sim): $(sim_common_files) $(dramsim_lib) $(EXTRA_SIM_REQS)
$(sim): $(sim_common_files) $(dramsim3_lib) $(EXTRA_SIM_REQS)
$(call require_cmd,vcs)
$(require_riscv)
rm -rf $(model_dir)
$(VCS) $(VCS_OPTS) $(EXTRA_SIM_SOURCES) -o $@ -Mdir=$(model_dir)

$(sim_debug): $(sim_common_files) $(dramsim_lib) $(EXTRA_SIM_REQS)
$(sim_debug): $(sim_common_files) $(dramsim3_lib) $(EXTRA_SIM_REQS)
$(call require_cmd,vcs)
$(require_riscv)
rm -rf $(model_dir_debug)
Expand Down
4 changes: 2 additions & 2 deletions sims/verilator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,11 @@ $(model_mk_debug): $(sim_common_files) $(EXTRA_SIM_REQS)
#########################################################################################
# invoke make to make verilator sim rules
#########################################################################################
$(sim): $(model_mk) $(dramsim_lib)
$(sim): $(model_mk) $(dramsim3_lib)
$(require_riscv)
$(MAKE) VM_PARALLEL_BUILDS=1 -C $(model_dir) -f V$(TB).mk

$(sim_debug): $(model_mk_debug) $(dramsim_lib)
$(sim_debug): $(model_mk_debug) $(dramsim3_lib)
$(require_riscv)
$(MAKE) VM_PARALLEL_BUILDS=1 -C $(model_dir_debug) -f V$(TB).mk

Expand Down
1 change: 0 additions & 1 deletion tools/DRAMSim2
Submodule DRAMSim2 deleted from 44322e
1 change: 1 addition & 0 deletions tools/DRAMSim3
Submodule DRAMSim3 added at 298175
2 changes: 1 addition & 1 deletion variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ PERMISSIVE_OFF=+permissive-off
BINARY ?=
BINARIES ?=
BINARY_ARGS ?=
override SIM_FLAGS += +dramsim +dramsim_ini_dir=$(TESTCHIP_DIR)/src/main/resources/dramsim2_ini +max-cycles=$(TIMEOUT_CYCLES)
override SIM_FLAGS += +dramsim +dramsim_ini=$(dramsim3_dir)/configs/DDR4_8Gb_x8_3200.ini +dramsim_out=$(output_dir) +max-cycles=$(TIMEOUT_CYCLES)
VERBOSE_FLAGS ?= +verbose
# get_out_name is a function, 1st argument is the binary
get_out_name = $(subst $() $(),_,$(notdir $(basename $(1))))
Expand Down