From 5ab88a5daa120f511e5d4d2645562c8707ff0046 Mon Sep 17 00:00:00 2001 From: Rose Thompson Date: Tue, 6 Feb 2024 22:07:06 -0600 Subject: [PATCH] Updated to simplify configOptions. --- sim/regression-wally | 6 ++-- sim/wally-batch.do | 68 ++++++++++++++++++------------------------ testbench/testbench.sv | 2 +- 3 files changed, 33 insertions(+), 43 deletions(-) diff --git a/sim/regression-wally b/sim/regression-wally index ebdac0a1e..48406b8ae 100755 --- a/sim/regression-wally +++ b/sim/regression-wally @@ -72,7 +72,7 @@ def getBuildrootTC(boot): BRcmd="vsim > {} -c < {} -c < {} -c <= 4 and test[2] == "configOptions"): configOptions = test[3] - cmdPrefix = "vsim > {} -c < {} -c < {} -c <= 3} { if {$3 eq "-coverage" || ($argc >= 7 && $7 eq "-coverage")} { set coverage 1 + } elseif {$3 eq "configOptions"} { + set Arguments [lrange $argv 2 2] + set ArgumentsTrim [string range $Arguments 1 end-1] + set tokens [regexp -all -inline {\S+} $ArgumentsTrim] + set params [lrange $tokens 5 end] + set configOptions $params + puts $params } + } # compile source files @@ -51,47 +64,24 @@ if {$argc >= 3} { # default to config/rv64ic, but allow this to be overridden at the command line. For example: # do wally-pipelined-batch.do ../config/rv32imc rv32imc -if {$2 eq "configOptions"} { - # set arguments " " - # for {set i 5} {$i <= $argc} {incr i} { - # append arguments "\$$i " - # } - # puts $arguments - # set options eval $arguments - # **** fix this so we can pass any number of +defines or top level params. - # only allows 1 right now - - vlog -lint -work wkdir/work_${1}_${3}_${4} +incdir+../config/$1 +incdir+../config/deriv/$1 +incdir+../config/shared ../src/cvw.sv ../testbench/testbench.sv ../testbench/common/*.sv ../src/*/*.sv ../src/*/*/*.sv -suppress 2583 -suppress 7063,2596,13286 - # start and run simulation - # remove +acc flag for faster sim during regressions if there is no need to access internal signals - vopt wkdir/work_${1}_${3}_${4}.testbench -work wkdir/work_${1}_${3}_${4} -G TEST=$3 ${4} -o testbenchopt - vsim -lib wkdir/work_${1}_${3}_${4} testbenchopt -fatal 7 -suppress 3829 - # Adding coverage increases runtime from 2:00 to 4:29. Can't run it all the time - #vopt work_$2.testbench -work work_$2 -o workopt_$2 +cover=sbectf - #vsim -coverage -lib work_$2 workopt_$2 - # power add generates the logging necessary for said generation. - # power add -r /dut/core/* - run -all - # power off -r /dut/core/* +vlog -lint -work wkdir/work_${1}_${2} +incdir+../config/$1 +incdir+../config/deriv/$1 +incdir+../config/shared ../src/cvw.sv ../testbench/testbench.sv ../testbench/common/*.sv ../src/*/*.sv ../src/*/*/*.sv -suppress 2583 -suppress 7063,2596,13286 +# start and run simulation +# remove +acc flag for faster sim during regressions if there is no need to access internal signals +if {$coverage} { + # vopt wkdir/work_${1}_${2}.testbench -work wkdir/work_${1}_${2} -G TEST=$2 -o testbenchopt +cover=sbectf + vopt wkdir/work_${1}_${2}.testbench -work wkdir/work_${1}_${2} -G TEST=$2 -o testbenchopt +cover=sbecf + vsim -lib wkdir/work_${1}_${2} testbenchopt -fatal 7 -suppress 3829 -coverage } else { - vlog -lint -work wkdir/work_${1}_${2} +incdir+../config/$1 +incdir+../config/deriv/$1 +incdir+../config/shared ../src/cvw.sv ../testbench/testbench.sv ../testbench/common/*.sv ../src/*/*.sv ../src/*/*/*.sv -suppress 2583 -suppress 7063,2596,13286 - # start and run simulation - # remove +acc flag for faster sim during regressions if there is no need to access internal signals - if {$coverage} { -# vopt wkdir/work_${1}_${2}.testbench -work wkdir/work_${1}_${2} -G TEST=$2 -o testbenchopt +cover=sbectf - vopt wkdir/work_${1}_${2}.testbench -work wkdir/work_${1}_${2} -G TEST=$2 -o testbenchopt +cover=sbecf - vsim -lib wkdir/work_${1}_${2} testbenchopt -fatal 7 -suppress 3829 -coverage - } else { - vopt wkdir/work_${1}_${2}.testbench -work wkdir/work_${1}_${2} -G TEST=$2 -o testbenchopt - vsim -lib wkdir/work_${1}_${2} testbenchopt -fatal 7 -suppress 3829 - } + vopt wkdir/work_${1}_${2}.testbench -work wkdir/work_${1}_${2} -G TEST=$2 ${configOptions} -o testbenchopt + vsim -lib wkdir/work_${1}_${2} testbenchopt -fatal 7 -suppress 3829 +} # vsim -lib wkdir/work_${1}_${2} testbenchopt -fatal 7 -suppress 3829 - # power add generates the logging necessary for said generation. - # power add -r /dut/core/* - run -all - # power off -r /dut/core/* -} +# power add generates the logging necessary for said generation. +# power add -r /dut/core/* +run -all +# power off -r /dut/core/* + if {$coverage} { echo "Saving coverage to ${1}_${2}.ucdb" diff --git a/testbench/testbench.sv b/testbench/testbench.sv index 8b323b928..d6cbe4e47 100644 --- a/testbench/testbench.sv +++ b/testbench/testbench.sv @@ -544,7 +544,7 @@ module testbench; logic [P.XLEN-1:0] Minstret; assign Minstret = testbench.dut.core.priv.priv.csr.counters.counters.HPMCOUNTER_REGW[2]; always @(negedge clk) begin - if((Minstret != 0) && (Minstret % 'd100000 == 0)) $display("Reached %d instructions, %d", Minstret, INSTR_LIMIT); + if((Minstret != 0) && (Minstret % 'd100000 == 0)) $display("Reached %d", Minstret); if((Minstret == INSTR_LIMIT) & (INSTR_LIMIT!=0)) begin $stop; $stop; end end end