Add threaded -O3 build mode

This commit is contained in:
wgulian3
2020-03-20 18:15:49 -04:00
parent 1c82f9a11d
commit 902aa685b1
4 changed files with 23 additions and 3 deletions

View File

@@ -21,13 +21,19 @@ 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
MAKECPP=(cd obj_dir && make -j -f VVortex.mk OPT='-DVL_DEBUG' VL_DEBUG=1 DVL_DEBUG=1)
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))' )
# -LDFLAGS '-lsystemc'
VERILATOR:
echo "#define VCD_OFF" > simulate/tb_debug.h
@@ -37,6 +43,11 @@ VERILATORnoWarnings:
echo "#define VCD_OFF" > simulate/tb_debug.h
verilator $(COMP) -cc $(SINGLE_CORE) $(INCLUDE) $(EXE) $(LIB) $(CF) $(WNO) $(DEB)
VERILATORnoWarningsRel:
echo "#define VCD_OFF" > simulate/tb_debug.h
verilator $(COMP) -cc $(SINGLE_CORE) $(INCLUDE) $(EXE) $(LIB) $(CFRel) $(WNO) --threads $(THREADS)
VERILATORMULTInoWarnings:
echo "#define VCD_OFF" > simulate/tb_debug.h
verilator $(COMP) -cc $(MULTI_CORE) $(INCLUDE) $(MULTI_EXE) $(LIB) $(CF) $(WNO) $(DEB)
@@ -58,6 +69,9 @@ debug: compdebug
w: VERILATORnoWarnings
$(MAKECPP)
wRel: VERILATORnoWarningsRel
$(MAKECPPRel)
multicore: VERILATORMULTInoWarnings
$(MAKEMULTICPP)
@@ -67,5 +81,8 @@ dmulticore: compdebugmulti
run: w
(cd obj_dir && ./VVortex)
runRel: wRel
(cd obj_dir && ./VVortex)
clean:
rm obj_dir/*