From 9e98c834f1639fc7a683cc7df754836d6e2c8673 Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Fri, 30 Aug 2024 12:32:41 -0700 Subject: [PATCH 1/2] Add lockstepverbose flag --- bin/wsim | 9 ++++++--- config/rv32gc/imperas.ic | 6 ------ config/rv64gc/imperas.ic | 6 ------ sim/imperas-verbose.ic | 4 ++++ sim/questa/wally.do | 3 +-- 5 files changed, 11 insertions(+), 17 deletions(-) create mode 100644 sim/imperas-verbose.ic diff --git a/bin/wsim b/bin/wsim index 3018c5caf..e0427194c 100755 --- a/bin/wsim +++ b/bin/wsim @@ -35,6 +35,7 @@ parser.add_argument("--params", "-p", help="Optional top-level parameter overrid parser.add_argument("--vcd", "-v", help="Generate testbench.vcd", action="store_true") parser.add_argument("--lockstep", "-l", help="Run ImperasDV lock, step, and compare.", action="store_true") parser.add_argument("--locksteplog", "-b", help="Retired instruction number to be begin logging.", default=0) +parser.add_argument("--lockstepverbose", "-lv", help="Run ImperasDV lock, step, and compare with tracing enabled", action="store_true") parser.add_argument("--covlog", "-d", help="Log coverage after n instructions.", default=0) parser.add_argument("--rvvi", "-r", help="Simulate rvvi hardware interface and ethernet.", action="store_true") args = parser.parse_args() @@ -68,7 +69,7 @@ if(args.testsuite.endswith('.elf') and args.elf == ""): # No --elf argument; che # Validate arguments -if (args.gui or args.ccov or args.fcov or args.fcov2 or args.fcovrvvi or args.lockstep): +if (args.gui or args.ccov or args.fcov or args.fcov2 or args.fcovrvvi or args.lockstep or args.lockstepverbose): if args.sim not in ["questa", "vcs"]: print("Option only supported for Questa and VCS") exit(1) @@ -85,13 +86,13 @@ if (args.tb == "testbench_fp"): # if lockstep is enabled, then we need to pass the Imperas lockstep arguments if(int(args.locksteplog) >= 1): EnableLog = 1 else: EnableLog = 0 -if((args.lockstep or args.fcov or args.fcov2) and args.sim == "questa"): +if((args.lockstep or args.lockstepverbose or args.fcov or args.fcov2) and args.sim == "questa"): prefix = "IMPERAS_TOOLS=" + WALLY + "/config/"+args.config+"/imperas.ic" prefix = "MTI_VCO_MODE=64 " + prefix else: prefix = "" -if (args.lockstep): +if (args.lockstep or args.lockstepverbose): if(args.locksteplog != 0): ImperasPlusArgs = " +IDV_TRACE2LOG=" + str(EnableLog) + " +IDV_TRACE2LOG_AFTER=" + str(args.locksteplog) else: ImperasPlusArgs = "" if(args.fcov): @@ -109,6 +110,8 @@ if (args.lockstep): else: CovEnableStr = "" suffix = "--lockstep" + if(args.lockstepverbose): + prefix += ":" + WALLY + "/sim/imperas-verbose.ic" else: ImperasPlusArgs = "" suffix = "" diff --git a/config/rv32gc/imperas.ic b/config/rv32gc/imperas.ic index c9b8292f2..fe4a3dbed 100644 --- a/config/rv32gc/imperas.ic +++ b/config/rv32gc/imperas.ic @@ -109,11 +109,5 @@ #-override refRoot/cpu/cv/cover=basic #-override refRoot/cpu/cv/extensions=RV32I -# Add Imperas simulator application instruction tracing -# uncomment these to provide tracing ---verbose --trace --tracechange --traceshowicount --tracemode -tracemem ASX --monitornetschange # --traceafter 300000000 ---override cpu/debugflags=6 --override cpu/verbose=1 ---override cpu/show_c_prefix=T - # Store simulator output to logfile --output imperas.log diff --git a/config/rv64gc/imperas.ic b/config/rv64gc/imperas.ic index fa9b56dfc..2ee487094 100644 --- a/config/rv64gc/imperas.ic +++ b/config/rv64gc/imperas.ic @@ -107,11 +107,5 @@ #-override refRoot/cpu/cv/cover=basic #-override refRoot/cpu/cv/extensions=RV32I -# Add Imperas simulator application instruction tracing -# uncomment these to provide tracing -#--verbose --trace --tracechange --traceshowicount --tracemode -tracemem ASX --monitornetschange # --traceafter 300000000 -#--override cpu/debugflags=6 --override cpu/verbose=1 -#--override cpu/show_c_prefix=T - # Store simulator output to logfile --output imperas.log diff --git a/sim/imperas-verbose.ic b/sim/imperas-verbose.ic new file mode 100644 index 000000000..fca9e072c --- /dev/null +++ b/sim/imperas-verbose.ic @@ -0,0 +1,4 @@ +# Add Imperas simulator application instruction tracing +--verbose --trace --tracechange --traceshowicount --tracemode -tracemem ASX --monitornetschange # --traceafter 300000000 +--override cpu/debugflags=6 --override cpu/verbose=1 +--override cpu/show_c_prefix=T diff --git a/sim/questa/wally.do b/sim/questa/wally.do index 503fc710b..b29b74700 100644 --- a/sim/questa/wally.do +++ b/sim/questa/wally.do @@ -163,7 +163,6 @@ if {[lcheck lst "--lockstep"] || $FunctCoverage == 1} { ${IMPERAS_HOME}/ImpPublic/source/host/rvvi/*.sv \ ${IMPERAS_HOME}/ImpProprietary/source/host/idv/*.sv" set SVLib "-sv_lib ${IMPERAS_HOME}/lib/Linux64/ImperasLib/imperas.com/verification/riscv/1.0/model" - #set OtherFlags $::env(OTHERFLAGS) # not working 7/15/24 dh; this should be the way to pass things like --verbose (Issue 871) } # Set PlusArgs passed using the --args flag @@ -208,7 +207,7 @@ vlog -lint +nowarnRDGN -work ${WKDIR} {*}${INC_DIRS} {*}${FCvlog} {*}${FCdefineC # remove +acc flag for faster sim during regressions if there is no need to access internal signals vopt $accFlag wkdir/${CFG}_${TESTSUITE}.${TESTBENCH} -work ${WKDIR} {*}${ExpandedParamArgs} -o testbenchopt ${CoverageVoptArg} -vsim -lib ${WKDIR} testbenchopt +TEST=${TESTSUITE} {*}${PlusArgs} -fatal 7 {*}${SVLib} ${OtherFlags} {*}${FCvopt} -suppress 3829 ${CoverageVsimArg} +vsim -lib ${WKDIR} testbenchopt +TEST=${TESTSUITE} {*}${PlusArgs} -fatal 7 {*}${SVLib} {*}${FCvopt} -suppress 3829 ${CoverageVsimArg} # power add generates the logging necessary for saif generation. # power add -r /dut/core/* From ad6ab2fb0c6a94d1d73b5fa2d2b12beefac436be Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Tue, 10 Sep 2024 16:12:10 -0700 Subject: [PATCH 2/2] Wally.do cleanup --- sim/questa/wally.do | 1 - 1 file changed, 1 deletion(-) diff --git a/sim/questa/wally.do b/sim/questa/wally.do index 60c0027ba..621fa1fbf 100644 --- a/sim/questa/wally.do +++ b/sim/questa/wally.do @@ -73,7 +73,6 @@ set FCdefineCOVER_EXTS {} set lockstep 0 set lockstepvlog "" set SVLib "" -set OtherFlags "" set GUI 0 set accFlag ""