diff --git a/bin/wsim b/bin/wsim index 309f88be7..88b0dd6c8 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.fcovimp or args.fcovrvvi or args.lockstep): +if (args.gui or args.ccov or args.fcov or args.fcovimp 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.fcovimp) and args.sim == "questa"): +if((args.lockstep or args.lockstepverbose or args.fcov or args.fcovimp) 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.fcovimp): @@ -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 0462ab748..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 1691b2b47..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 "" @@ -201,7 +200,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/*