refactoring RTL simulator and Makefile
This commit is contained in:
33
rtl/Makefile
33
rtl/Makefile
@@ -1,6 +1,5 @@
|
||||
all: RUNFILE
|
||||
|
||||
|
||||
INCLUDE=-I. -Ishared_memory -Icache -IVX_cache -IVX_cache/interfaces -Iinterfaces/ -Ipipe_regs/ -Icompat/ -Isimulate
|
||||
|
||||
SINGLE_CORE=Vortex.v
|
||||
@@ -19,12 +18,9 @@ LIGHTW=-Wno-UNOPTFLAT
|
||||
# LIB=-LDFLAGS '-L/usr/local/systemc/'
|
||||
LIB=
|
||||
|
||||
CF=-CFLAGS '-std=c++11 -fms-extensions'
|
||||
|
||||
CFRel=-CFLAGS '-std=c++11 -fms-extensions -O3 -DVL_THREADED'
|
||||
|
||||
DEB=--trace --prof-cfuncs -DVL_DEBUG=1
|
||||
CF = -std=c++11 -fms-extensions
|
||||
|
||||
DEB=--trace -DVL_DEBUG=1
|
||||
|
||||
MAKECPP=(cd obj_dir && make -j -f VVortex.mk OPT='-DVL_DEBUG' VL_DEBUG=1 DVL_DEBUG=1)
|
||||
|
||||
@@ -32,33 +28,27 @@ MAKECPPRel=(cd obj_dir && make -j -f VVortex.mk)
|
||||
|
||||
MAKEMULTICPP=(cd obj_dir && make -j -f VVortex_SOC.mk OPT='-DVL_DEBUG' VL_DEBUG=1 DVL_DEBUG=1)
|
||||
|
||||
THREADS ?= $(shell python3 -c 'import multiprocessing as mp; print(max(1, mp.cpu_count() // 2))' )
|
||||
THREADS ?= $(shell python3 -c 'import multiprocessing as mp; print(max(1, mp.cpu_count() // 2))')
|
||||
|
||||
# -LDFLAGS '-lsystemc'
|
||||
VERILATOR:
|
||||
echo "#define VCD_OFF" > simulate/tb_debug.h
|
||||
verilator $(COMP) -cc $(SINGLE_CORE) $(INCLUDE) $(EXE) $(LIB) $(CF) $(LIGHTW)
|
||||
verilator $(COMP) -cc $(SINGLE_CORE) $(INCLUDE) $(EXE) $(LIB) -CFLAGS '$(CF) -DVCD_OFF' $(LIGHTW)
|
||||
|
||||
VERILATORnoWarnings:
|
||||
echo "#define VCD_OFF" > simulate/tb_debug.h
|
||||
verilator $(COMP) -cc $(SINGLE_CORE) $(INCLUDE) $(EXE) $(LIB) $(CF) $(WNO) $(DEB)
|
||||
verilator $(COMP) -cc $(SINGLE_CORE) $(INCLUDE) $(EXE) $(LIB) -CFLAGS '$(CF) -DVCD_OFF' $(WNO) $(DEB)
|
||||
|
||||
VERILATORnoWarningsRel:
|
||||
echo "#define VCD_OFF" > simulate/tb_debug.h
|
||||
verilator $(COMP) -cc $(SINGLE_CORE) $(INCLUDE) $(EXE) $(LIB) $(CFRel) $(WNO) --threads $(THREADS)
|
||||
verilator $(COMP) -cc $(SINGLE_CORE) $(INCLUDE) $(EXE) $(LIB) -CFLAGS '$(CF) -DVCD_OFF -O3 -DVL_THREADED' $(WNO) --threads $(THREADS)
|
||||
|
||||
|
||||
VERILATORMULTInoWarnings:
|
||||
echo "#define VCD_OFF" > simulate/tb_debug.h
|
||||
verilator $(COMP) -cc $(MULTI_CORE) $(INCLUDE) $(MULTI_EXE) $(LIB) $(CF) $(WNO) $(DEB)
|
||||
verilator $(COMP) -cc $(MULTI_CORE) $(INCLUDE) $(MULTI_EXE) $(LIB) -CFLAGS '$(CF) -DVCD_OFF -O3 -DVL_THREADED' $(WNO) $(DEB) --threads $(THREADS)
|
||||
|
||||
compdebug:
|
||||
echo "#define VCD_OUTPUT" > simulate/tb_debug.h
|
||||
verilator_bin_dbg $(COMP) -cc $(SINGLE_CORE) $(INCLUDE) $(EXE) $(LIB) -CFLAGS '-std=c++11 -DVL_DEBUG' $(WNO) $(DEB)
|
||||
verilator_bin_dbg $(COMP) -cc $(SINGLE_CORE) $(INCLUDE) $(EXE) $(LIB) -CFLAGS '$(CF) -DVCD_OUTPUT -DVL_DEBUG' $(WNO) $(DEB)
|
||||
|
||||
compdebugmulti:
|
||||
echo "#define VCD_OUTPUT" > simulate/tb_debug.h
|
||||
verilator_bin_dbg $(COMP) -cc $(MULTI_CORE) $(INCLUDE) $(MULTI_EXE) $(LIB) -CFLAGS '-std=c++11 -DVL_DEBUG' $(WNO) $(DEB)
|
||||
verilator_bin_dbg $(COMP) -cc $(MULTI_CORE) $(INCLUDE) $(MULTI_EXE) $(LIB) -CFLAGS '$(CF) -DVCD_OUTPUT -DVL_DEBUG' $(WNO) $(DEB)
|
||||
|
||||
RUNFILE: VERILATOR
|
||||
$(MAKECPP)
|
||||
@@ -81,8 +71,11 @@ dmulticore: compdebugmulti
|
||||
run: w
|
||||
(cd obj_dir && ./VVortex)
|
||||
|
||||
run-multicore: multicore
|
||||
(cd obj_dir && ./VVortex_SOC)
|
||||
|
||||
runRel: wRel
|
||||
(cd obj_dir && ./VVortex)
|
||||
|
||||
clean:
|
||||
rm -rf obj_dir
|
||||
rm -rf obj_dir
|
||||
Reference in New Issue
Block a user