Add coverage dump options (#71)

This commit is contained in:
taoliug 2019-06-07 13:58:06 -07:00 committed by GitHub
parent 05d00737b2
commit 52bc23cc39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 4 deletions

View file

@ -15,11 +15,24 @@ WAVES := 1
WAVE_CMP_OPTS := -debug_access+all -ucli -do vcs.tcl
# Enable coverage dump
COV := 0
# Coverage dump options
COV_CMP_OPTS := -cm line+tgl+assert+fsm+branch \
-cm_tgl portsonly \
-cm_tgl structarr \
-cm_report noinitial \
-cm_seqnoconst \
-cm_glitch 0 \
-cm_dir ${OUT}/rtl_sim/test.vdb \
-cm_hier cover.cfg
ifeq (${WAVES}, 0)
WAVE_CMP_OPTS=
endif
ifeq (${COV}, 0)
COV_CMP_OPTS=
endif
SHELL=/bin/bash
export PRJ_DIR:= $(realpath ${DV_DIR}/../../..)
@ -55,13 +68,17 @@ compile:
+define+BOOT_ADDR=32\'h8000_0000 \
+define+TRACE_EXECUTION \
-debug_access+pp \
${WAVE_CMP_OPTS} \
${WAVE_CMP_OPTS} ${COV_CMP_OPTS}\
-lca -kdb
# Run ibex RTL simulation with random instructions
rtl_sim:
./sim ${SIM_OPTS} -dir ${OUT} -waves ${WAVES}
./sim ${SIM_OPTS} -dir ${OUT} -waves ${WAVES} -cov ${COV}
# Compare the regression result between ISS and RTL sim
post_compare:
./compare ${OUT}
# Load verdi to review coverage
cov:
cd ${OUT}/rtl_sim; verdi -cov -covdir test.vdb &

1
dv/uvm/cover.cfg Normal file
View file

@ -0,0 +1 @@
+tree core_ibex_tb_top.dut

View file

@ -18,6 +18,10 @@ SEED=""
WAVES=0
WAVES_OPTS=""
# Coveragedump options
COV=0
COV_OPTS=""
# Process command line options
while [[ $# -gt 0 ]]
do
@ -35,6 +39,10 @@ case $key in
WAVES="$2"
shift
;;
-cov)
COV="$2"
shift
;;
-seed)
SEED="$2"
RAND_SEED=0
@ -69,10 +77,17 @@ while read asm_test; do
SEED=$RANDOM
fi
if [[ $WAVES == 1 ]]; then
WAVES_OPTS="-ucli -do $RUN_DIR/../vcs.tcl"
WAVES_OPTS="-ucli -do vcs.tcl"
fi
if [[ $COV == 1 ]]; then
COV_OPTS="-cm line+tgl+assert+fsm+branch \
-cm_dir ${RUN_DIR}/rtl_sim/test.vdb \
-cm_log /dev/null \
-assert nopostproc \
-cm_name test_${SEED}"
fi
CMD="$OUT/vcs_simv +UVM_TESTNAME=core_ibex_base_test \
${WAVES_OPTS} +ntb_random_seed=${SEED} \
${WAVES_OPTS} +ntb_random_seed=${SEED} +vcs+lic+wait ${COV_OPTS}\
+bin=$BINFILE -l sim.log"
echo "Running simulation for : $CMD"
$CMD