Skip to content

Commit

Permalink
examples/rv: Make it easier to use a different memory image
Browse files Browse the repository at this point in the history
  • Loading branch information
cpitclaudel committed Mar 8, 2021
1 parent ae7ea86 commit c8bdb08
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion examples/rv/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
DEFAULT_TEST ?=
include etc/Makefile.conf

.DEFAULT_GOAL := all
Expand Down
9 changes: 6 additions & 3 deletions examples/rv/etc/Makefile.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ pass:
# Makefile.platform.conf is a copy of Makefile.rv32i.conf or Makefile.rv32e.conf
-include Makefile.platform.conf

MEM_NAME ?= integ/primes
MEM_PATH ?= $(test_directory)/$(MEM_NAME)

CXXFLAGS := --std=c++17
CUTTLESIM_DRIVER := rvcore.cuttlesim.cpp
CUTTLESIM_ARGS := $(default_test).rv32
CUTTLESIM_ARGS := $(MEM_PATH).rv32
CUTTLESIM_VCD_SCOPES := TOP top rv_core

# Faster GCOV runs
Expand All @@ -18,7 +21,7 @@ CUTTLESIM_COV_FLAGS := -Og -ggdb3
# Verilator config
VERILATOR_FLAGS := +define+MEM_ADDRESS_WIDTH=$(mem_address_width) +define+BRAM_RUNTIME_INIT+SIMULATION -CFLAGS -DVL_USER_FINISH
VERILATOR_DRIVER := rvcore.verilator.cpp
VERILATOR_ARGS := +VMH=$(default_test).vmh
VERILATOR_ARGS := +VMH=$(MEM_PATH).vmh
VERILATOR_WARNINGS := -Wno-fatal
VERILATOR_TOP := top.v
# Set prefix to Vtop in all cases, to be able to switch between top and top_uart
Expand All @@ -38,5 +41,5 @@ ECP5_PACKAGE := CABGA381
ECP5_LPF := ulx3s_v20.lpf
ECP5_FREQUENCY := 25

YOSYS_OPTS := '-DMEM_FILENAME="$(default_test).vmh"' -DMEM_ADDRESS_WIDTH=$(mem_address_width)
YOSYS_OPTS := '-DMEM_FILENAME="$(MEM_PATH).vmh"' -DMEM_ADDRESS_WIDTH=$(mem_address_width)
YOSYS_LIBDIRS := .
2 changes: 1 addition & 1 deletion examples/rv/etc/Makefile.rv32e.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mem_address_width := 10
default_test := ../../tests/_build/rv32e/integ/primes
test_directory := ../../tests/_build/rv32e
2 changes: 1 addition & 1 deletion examples/rv/etc/Makefile.rv32i.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mem_address_width := 14
default_test := ../../tests/_build/rv32i/integ/primes
test_directory := ../../tests/_build/rv32i

0 comments on commit c8bdb08

Please sign in to comment.