Merge pull request #30 from danielmlynek/make_for_riviera

Make for riviera
This commit is contained in:
jrahmeh 2020-02-26 19:38:57 -06:00 committed by GitHub
commit 0dbee1c24c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 3 deletions

View File

@ -29,6 +29,7 @@ IRUN = irun
VCS = vcs VCS = vcs
VERILATOR = verilator VERILATOR = verilator
VLOG = qverilog VLOG = qverilog
RIVIERA = riviera
GCC_PREFIX = riscv64-unknown-elf GCC_PREFIX = riscv64-unknown-elf
BUILD_DIR = snapshots/${snapshot} BUILD_DIR = snapshots/${snapshot}
TBDIR = ${RV_ROOT}/testbench TBDIR = ${RV_ROOT}/testbench
@ -45,6 +46,7 @@ ifdef debug
IRUN_DEBUG = -access +rc IRUN_DEBUG = -access +rc
IRUN_DEBUG_RUN = -input ${RV_ROOT}/testbench/input.tcl IRUN_DEBUG_RUN = -input ${RV_ROOT}/testbench/input.tcl
VCS_DEBUG = -debug_access VCS_DEBUG = -debug_access
RIVIERA_DEBUG = +access +r
endif endif
# provide specific link file # provide specific link file
@ -71,7 +73,8 @@ all: clean verilator
clean: clean:
rm -rf *.log *.s *.hex *.dis *.tbl irun* vcs* simv* snapshots swerv* \ rm -rf *.log *.s *.hex *.dis *.tbl irun* vcs* simv* snapshots swerv* \
verilator* *.exe obj* *.o ucli.key vc_hdrs.h csrc *.csv verilator* *.exe obj* *.o ucli.key vc_hdrs.h csrc *.csv \
work dataset.asdb library.cfg
# If define files do not exist, then run swerv.config. # If define files do not exist, then run swerv.config.
${BUILD_DIR}/defines.h : ${BUILD_DIR}/defines.h :
@ -107,6 +110,17 @@ irun-build: ${TBFILES} ${BUILD_DIR}/defines.h
-elaborate -snapshot $(snapshot) -elaborate -snapshot $(snapshot)
touch irun-build touch irun-build
riviera-build: ${TBFILES} ${BUILD_DIR}/defines.h
vlib work
vlog -work work \
-l riviera_compile.log -err VCP2694 W1 \
+incdir+${RV_ROOT}/design/lib \
+incdir+${RV_ROOT}/design/include \
+incdir+${BUILD_DIR} +libext+.v $(defines) \
-f ${RV_ROOT}/testbench/flist \
${TBFILES}
touch riviera-build
verilator: program.hex verilator-build verilator: program.hex verilator-build
./obj_dir/Vtb_top ${DEBUG_PLUS} ./obj_dir/Vtb_top ${DEBUG_PLUS}
@ -121,6 +135,9 @@ vlog: program.hex ${TBFILES} ${BUILD_DIR}/defines.h
$(VLOG) -l vlog.log -sv -mfcu +incdir+${BUILD_DIR}+${RV_ROOT}/design/include+${RV_ROOT}/design/lib\ $(VLOG) -l vlog.log -sv -mfcu +incdir+${BUILD_DIR}+${RV_ROOT}/design/include+${RV_ROOT}/design/lib\
$(defines) -f ${RV_ROOT}/testbench/flist ${TBFILES} -R ${DEBUG_PLUS} $(defines) -f ${RV_ROOT}/testbench/flist ${TBFILES} -R ${DEBUG_PLUS}
riviera: program.hex riviera-build
vsim -c -lib work ${DEBUG_PLUS} ${RIVIERA_DEBUG} tb_top -do "run -all; exit" -l riviera.log
ifeq ($(shell which $(GCC_PREFIX)-gcc 2> /dev/null),) ifeq ($(shell which $(GCC_PREFIX)-gcc 2> /dev/null),)
program.hex: ${BUILD_DIR}/defines.h program.hex: ${BUILD_DIR}/defines.h
@echo " !!! No $(GCC_PREFIX)-gcc in path, using canned hex files !!" @echo " !!! No $(GCC_PREFIX)-gcc in path, using canned hex files !!"
@ -154,6 +171,6 @@ endif
help: help:
@echo Make sure the environment variable RV_ROOT is set. @echo Make sure the environment variable RV_ROOT is set.
@echo Possible targets: verilator vcs irun vlog help clean all verilator-build irun-build vcs-build program.hex @echo Possible targets: verilator vcs irun vlog riviera help clean all verilator-build irun-build vcs-build riviera-build program.hex
.PHONY: help clean verilator vcs irun vlog .PHONY: help clean verilator vcs irun vlog riviera