mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Resolved merge conflict
This commit is contained in:
commit
5b3fac6d8e
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,6 +12,7 @@
|
||||
*.map
|
||||
*.elf*
|
||||
*.list
|
||||
*.memfile
|
||||
|
||||
# General directories to ignore
|
||||
.vscode/
|
||||
|
32
README.md
32
README.md
@ -227,26 +227,28 @@ This utility will take up approximately 100 GB on your hard drive. You can also
|
||||
|
||||
wsim runs one of multiple simulators, Questa, VCS, or Verilator using a specific configuration and either a suite of tests or a specific elf file.
|
||||
The general syntax is
|
||||
`wsim <config> <suite or elf file or directory> [--options]`
|
||||
`wsim <config> <suite or elf file> [--options]`
|
||||
|
||||
Parameters and options:
|
||||
|
||||
```
|
||||
-h, --help show this help message and exit
|
||||
--elf ELF, -e ELF ELF File name; use if name does not end in .elf
|
||||
--sim {questa,verilator,vcs}, -s {questa,verilator,vcs} Simulator
|
||||
--tb {testbench,testbench_fp}, -t {testbench,testbench_fp} Testbench
|
||||
--gui, -g Simulate with GUI
|
||||
--coverage, -c Code & Functional Coverage
|
||||
--fcov, -f Code & Functional Coverage
|
||||
--ccov, -c Code Coverage
|
||||
--fcov, -f Functional Coverage with cvw-arch-verif, implies lockstep
|
||||
--args ARGS, -a ARGS Optional arguments passed to simulator via $value$plusargs
|
||||
--params PARAMS, -p PARAMS Optional top-level parameter overrides of the form param=value
|
||||
--define DEFINE, -d DEFINE Optional define macros passed to simulator
|
||||
--vcd, -v Generate testbench.vcd
|
||||
--lockstep, -l Run ImperasDV lock, step, and compare.
|
||||
--locksteplog LOCKSTEPLOG, -b LOCKSTEPLOG Retired instruction number to be begin logging.
|
||||
--covlog COVLOG, -d COVLOG Log coverage after n instructions.
|
||||
--elfext ELFEXT, -e ELFEXT When searching for elf files only includes ones which end in this extension
|
||||
--lockstepverbose, -lv Run ImperasDV lock, step, and compare with tracing enabled
|
||||
--rvvi, -r Simulate rvvi hardware interface and ethernet.
|
||||
```
|
||||
|
||||
Run basic test with questa
|
||||
Run basic test with Questa
|
||||
|
||||
```bash
|
||||
wsim rv64gc arch64i
|
||||
@ -258,26 +260,26 @@ Run Questa with gui
|
||||
wsim rv64gc wally64priv --gui
|
||||
```
|
||||
|
||||
Run lockstep against ImperasDV with a single elf file in the gui. Lockstep requires single elf.
|
||||
Run basic test with Verilator
|
||||
|
||||
```bash
|
||||
wsim rv64gc ../../tests/riscof/work/riscv-arch-test/rv64i_m/I/src/add-01.S/ref/ref.elf --lockstep --gui
|
||||
wsim rv32i arch32i --sim verilator
|
||||
```
|
||||
|
||||
Run lockstep against ImperasDV with a single elf file. Compute coverage.
|
||||
Run lockstep against ImperasDV with a single elf file in the gui. Lockstep requires single elf.
|
||||
|
||||
```bash
|
||||
wsim rv64gc ../../tests/riscof/work/riscv-arch-test/rv64i_m/I/src/add-01.S/ref/ref.elf --lockstep --coverage
|
||||
wsim rv64gc $WALLY/tests/riscof/work/riscv-arch-test/rv64i_m/I/src/add-01.S/ref/ref.elf --lockstep --gui
|
||||
```
|
||||
|
||||
Run lockstep against ImperasDV with directory file.
|
||||
Run lockstep against ImperasDV with a single elf file. Collect functional coverage.
|
||||
|
||||
```bash
|
||||
wsim rv64gc ../../tests/riscof/work/riscv-arch-test/rv64i_m/I/src/ --lockstep
|
||||
wsim rv64gc $WALLY/addins/cvw-arch-verif/tests/rv64/Zicsr/WALLY-COV-ALL.elf --fcov
|
||||
```
|
||||
|
||||
Run lockstep against ImperasDV with directory file and specify specific extension.
|
||||
Run Linux boot simulation in lock step between Wally and ImperasDV
|
||||
|
||||
```bash
|
||||
wsim rv64gc ../../tests/riscof/work/riscv-arch-test/rv64i_m/I/src/ --lockstep --elfext ref.elf
|
||||
wsim buildroot buildroot --args +INSTR_LIMIT=600000000 --lockstep
|
||||
```
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit b37edba7f625cc3bc2b161d03bc1cd90df0fa2e3
|
||||
Subproject commit 95f849e42ef81562376fdc8fc4b91824fe7b5a36
|
@ -76,10 +76,28 @@ if [[ "$ID" == rhel || "$ID_LIKE" == *rhel* ]]; then
|
||||
elif [[ "$ID" == ubuntu || "$ID_LIKE" == *ubuntu* ]]; then
|
||||
export FAMILY=ubuntu
|
||||
if [ "$ID" != ubuntu ]; then
|
||||
printf "${WARNING_COLOR}%s%s\n${ENDC}" "For Ubuntu family distros, the Wally installation script has only been tested on standard Ubuntu. Your distro " \
|
||||
printf "${WARNING_COLOR}%s%s\n${ENDC}" "For Ubuntu family distros, the Wally installation script is only tested on standard Ubuntu. Your distro " \
|
||||
"is $PRETTY_NAME. The regular Ubuntu install will be attempted, but there may be issues."
|
||||
# Ubuntu derivates may use different version numbers. Attempt to derive version from Ubuntu codename
|
||||
case "$UBUNTU_CODENAME" in
|
||||
noble)
|
||||
export UBUNTU_VERSION=24
|
||||
;;
|
||||
jammy)
|
||||
export UBUNTU_VERSION=22
|
||||
;;
|
||||
focal)
|
||||
export UBUNTU_VERSION=20
|
||||
;;
|
||||
*)
|
||||
printf "${FAIL_COLOR}%s\n${ENDC}" "Unable to determine which base Ubuntu version you are using."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
echo "Detected Ubuntu derivative baesd on Ubuntu $UBUNTU_VERSION.04."
|
||||
else
|
||||
export UBUNTU_VERSION="${VERSION_ID:0:2}"
|
||||
fi
|
||||
export UBUNTU_VERSION="${VERSION_ID:0:2}"
|
||||
if (( UBUNTU_VERSION < 20 )); then
|
||||
printf "${FAIL_COLOR}%s\n${ENDC}" "The Wally installation script has only been tested with Ubuntu versions 20.04 LTS, 22.04 LTS, and 24.04 LTS. You have version $VERSION."
|
||||
exit 1
|
||||
|
167
bin/wsim
167
bin/wsim
@ -13,6 +13,7 @@
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Global variable
|
||||
WALLY = os.environ.get('WALLY')
|
||||
@ -29,152 +30,150 @@ def parseArgs():
|
||||
parser.add_argument("--fcov", "-f", help="Functional Coverage with cvw-arch-verif, implies lockstep", action="store_true")
|
||||
parser.add_argument("--args", "-a", help="Optional arguments passed to simulator via $value$plusargs", default="")
|
||||
parser.add_argument("--params", "-p", help="Optional top-level parameter overrides of the form param=value", default="")
|
||||
parser.add_argument("--define", "-d", help="Optional define macros passed to simulator", default="")
|
||||
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")
|
||||
return parser.parse_args()
|
||||
|
||||
def validateArgs(args):
|
||||
if not args.testsuite and not args.elf:
|
||||
print("Error: Missing test suite or ELF file")
|
||||
exit(1)
|
||||
if args.lockstep and not args.testsuite.endswith('.elf') and args.testsuite != "buildroot" :
|
||||
print(f"Invalid Options. Cannot run a testsuite, {args.testsuite} with lockstep. Must run a single elf or buildroot.")
|
||||
exit(1)
|
||||
elif (args.gui or args.ccov or args.fcov or args.lockstep or args.lockstepverbose) and args.sim not in ["questa", "vcs"]:
|
||||
sys.exit(1)
|
||||
if any([args.lockstep, args.lockstepverbose, args.fcov]) and not (args.testsuite.endswith('.elf') or args.elf) and args.testsuite != "buildroot":
|
||||
print(f"Invalid Options. Cannot run a testsuite, {args.testsuite} with lockstep or fcov. Must run a single elf or buildroot.")
|
||||
sys.exit(1)
|
||||
elif any([args.gui, args.ccov, args.fcov, args.lockstep, args.lockstepverbose]) and args.sim not in ["questa", "vcs"]:
|
||||
print("Option only supported for Questa and VCS")
|
||||
exit(1)
|
||||
sys.exit(1)
|
||||
elif (args.tb == "testbench_fp" and args.sim != "questa"):
|
||||
print("Error: testbench_fp presently only supported by Questa, not VCS or Verilator, because of a touchy testbench")
|
||||
exit(1)
|
||||
sys.exit(1)
|
||||
|
||||
def elfFileCheck(args):
|
||||
ElfFile = ""
|
||||
if os.path.isfile(args.elf):
|
||||
ElfFile = f"+ElfFile={os.path.abspath(args.elf)}"
|
||||
elif args.elf != "":
|
||||
elif args.elf:
|
||||
print(f"ELF file not found: {args.elf}")
|
||||
exit(1)
|
||||
sys.exit(1)
|
||||
elif args.testsuite.endswith('.elf'): # No --elf argument; check if testsuite has a .elf extension and use that instead
|
||||
if os.path.isfile(args.testsuite):
|
||||
ElfFile = f"+ElfFile={os.path.abspath(args.testsuite)}"
|
||||
# extract the elf name from the path to be the test suite
|
||||
fields = args.testsuite.rsplit('/', 3)
|
||||
# if the name is just ref.elf in a deep path (riscv-arch-test/wally-riscv-arch-test), then use the directory name as the test suite to make it unique; otherwise work directory will have duplicates.
|
||||
if (len(fields) > 3):
|
||||
if (fields[2] == "ref"):
|
||||
if len(fields) > 3:
|
||||
if fields[2] == "ref":
|
||||
args.testsuite = f"{fields[1]}_{fields[3]}"
|
||||
else:
|
||||
args.testsuite = f"{fields[2]}_{fields[3]}"
|
||||
elif ('/' in args.testsuite):
|
||||
elif '/' in args.testsuite:
|
||||
args.testsuite=args.testsuite.rsplit('/', 1)[1] # strip off path if present
|
||||
else:
|
||||
print(f"ELF file not found: {args.testsuite}")
|
||||
exit(1)
|
||||
sys.exit(1)
|
||||
return ElfFile
|
||||
|
||||
def prepSim(args, ElfFile):
|
||||
flags = ""
|
||||
prefix = ""
|
||||
paramsList = []
|
||||
argsList = []
|
||||
flagsList = []
|
||||
defineList = []
|
||||
if args.vcd:
|
||||
args.args += " -DMAKEVCD=1"
|
||||
paramsList.append("MAKE_VCD=1")
|
||||
if args.rvvi:
|
||||
args.params += " RVVI_SYNTH_SUPPORTED=1 "
|
||||
paramsList.append("RVVI_SYNTH_SUPPORTED=1")
|
||||
if args.tb == "testbench_fp":
|
||||
args.params += f' TEST="{args.testsuite}" '
|
||||
if ElfFile != "":
|
||||
args.args += f" {ElfFile}"
|
||||
paramsList.append(f'TEST="{args.testsuite}"')
|
||||
if ElfFile:
|
||||
argsList.append(f"{ElfFile}")
|
||||
if args.gui and args.tb == "testbench":
|
||||
paramsList.append("DEBUG=1")
|
||||
if args.ccov:
|
||||
flags += " --ccov"
|
||||
flagsList.append("--ccov")
|
||||
if args.fcov:
|
||||
flags += " --fcov"
|
||||
prefix, suffix = lockstepSetup(args)
|
||||
flags += suffix
|
||||
flagsList.append("--fcov")
|
||||
defineList.extend(["+define+INCLUDE_TRACE2COV", "+define+IDV_INCLUDE_TRACE2COV", "+define+COVER_BASE_RV32I"]) # COVER_BASE_RV32I is just needed to keep riscvISACOV happy, but does not affect tests
|
||||
argsList.extend(["+TRACE2COV_ENABLE=1", "+IDV_TRACE2COV=1"])
|
||||
if args.gui:
|
||||
flagsList.append("--gui")
|
||||
if args.lockstep or args.lockstepverbose:
|
||||
flagsList.append("--lockstep")
|
||||
if args.lockstep or args.lockstepverbose or args.fcov:
|
||||
prefix = lockstepSetup(args)
|
||||
defineList.append("+define+USE_IMPERAS_DV")
|
||||
# Combine into a single string
|
||||
args.args += " ".join(argsList)
|
||||
args.params += " ".join(paramsList)
|
||||
args.define += " ".join(defineList)
|
||||
flags = " ".join(flagsList)
|
||||
return flags, prefix
|
||||
|
||||
def lockstepSetup(args):
|
||||
prefix = ""
|
||||
suffix = ""
|
||||
ImperasPlusArgs = ""
|
||||
imperasicVerbosePath = os.path.join(WALLY, "sim", "imperas-verbose.ic")
|
||||
imperasicPath = os.path.join(WALLY, "config", args.config, "imperas.ic")
|
||||
if not os.path.isfile(imperasicPath): # If config is a derivative, look for imperas.ic in derivative configs
|
||||
imperasicPath = os.path.join(WALLY, "config", "deriv", args.config, "imperas.ic")
|
||||
if not os.path.isfile(imperasicPath):
|
||||
print("Error: imperas.ic not found")
|
||||
sys.exit(1)
|
||||
prefix = f"IMPERAS_TOOLS={imperasicPath}{f':{imperasicVerbosePath}' if args.lockstepverbose else ''}"
|
||||
return prefix
|
||||
|
||||
if(int(args.locksteplog) >= 1): EnableLog = 1
|
||||
else: EnableLog = 0
|
||||
if (args.lockstep or args.lockstepverbose or args.fcov):
|
||||
imperasicPath = os.path.join(WALLY, "config", args.config, "imperas.ic")
|
||||
if not os.path.isfile(imperasicPath): # If config is a derivative, look for imperas.ic in derivative configs
|
||||
imperasicPath = os.path.join(WALLY, "config", "deriv", args.config, "imperas.ic")
|
||||
if not os.path.isfile(imperasicPath):
|
||||
print("Error: imperas.ic not found")
|
||||
exit(1)
|
||||
prefix += f"IMPERAS_TOOLS={imperasicPath}"
|
||||
|
||||
if (args.lockstep or args.lockstepverbose):
|
||||
if(args.locksteplog != 0): ImperasPlusArgs = f" +IDV_TRACE2LOG={EnableLog} +IDV_TRACE2LOG_AFTER={args.locksteplog}"
|
||||
if(args.fcov):
|
||||
CovEnableStr = "1" if int(args.covlog) > 0 else "0"
|
||||
if(args.covlog >= 1): EnableLog = 1
|
||||
else: EnableLog = 0
|
||||
ImperasPlusArgs = f" +IDV_TRACE2COV={EnableLog} +TRACE2LOG_AFTER={args.covlog} +TRACE2COV_ENABLE={CovEnableStr}"
|
||||
else:
|
||||
suffix = "--lockstep"
|
||||
if(args.lockstepverbose):
|
||||
prefix += f":{WALLY}/sim/imperas-verbose.ic"
|
||||
args.args += ImperasPlusArgs
|
||||
return prefix, suffix
|
||||
|
||||
def createDirs(args):
|
||||
def createDirs(sim):
|
||||
for d in ["logs", "wkdir", "cov", "ucdb", "fcov", "fcov_ucdb"]:
|
||||
os.makedirs(os.path.join(WALLY, "sim", args.sim, d), exist_ok=True)
|
||||
os.makedirs(os.path.join(WALLY, "sim", sim, d), exist_ok=True)
|
||||
|
||||
def runSim(args, flags, prefix):
|
||||
if (args.sim == "questa"):
|
||||
if args.sim == "questa":
|
||||
runQuesta(args, flags, prefix)
|
||||
elif (args.sim == "verilator"):
|
||||
runVerilator(args, flags, prefix)
|
||||
elif (args.sim == "vcs"):
|
||||
elif args.sim == "verilator":
|
||||
runVerilator(args)
|
||||
elif args.sim == "vcs":
|
||||
runVCS(args, flags, prefix)
|
||||
|
||||
def runQuesta(args, flags, prefix):
|
||||
# Force Questa to use 64-bit mode, sometimes it defaults to 32-bit even on 64-bit machines
|
||||
prefix = "MTI_VCO_MODE=64 " + prefix
|
||||
if (args.gui) and (args.tb == "testbench"):
|
||||
args.params += "DEBUG=1"
|
||||
if (args.args != ""):
|
||||
args.args = f' --args \\"{args.args}\\"'
|
||||
if (args.params != ""):
|
||||
args.params = f' --params \\"{args.params}\\"'
|
||||
if args.args:
|
||||
args.args = fr'--args \"{args.args}\"'
|
||||
if args.params:
|
||||
args.params = fr'--params \"{args.params}\"'
|
||||
if args.define:
|
||||
args.define = fr'--define \"{args.define}\"'
|
||||
# Questa cannot accept more than 9 arguments. fcov implies lockstep
|
||||
cmd = f"do wally.do {args.config} {args.testsuite} {args.tb} {args.args} {args.params} {flags}"
|
||||
if (args.gui): # launch Questa with GUI; add +acc to keep variables accessible
|
||||
cmd = f'cd $WALLY/sim/questa; {prefix} vsim -do "{cmd} +acc"'
|
||||
else: # launch Questa in batch mode
|
||||
cmd = f'cd $WALLY/sim/questa; {prefix} vsim -c -do "{cmd}"'
|
||||
cmd = f"do wally.do {args.config} {args.testsuite} {args.tb} {args.args} {args.params} {args.define} {flags}"
|
||||
cmd = f'cd $WALLY/sim/questa; {prefix} vsim {"-c" if not args.gui else ""} -do "{cmd}"'
|
||||
print(f"Running Questa with command: {cmd}")
|
||||
os.system(cmd)
|
||||
|
||||
def runVerilator(args, flags, prefix):
|
||||
def runVerilator(args):
|
||||
print(f"Running Verilator on {args.config} {args.testsuite}")
|
||||
os.system(f'make -C {WALLY}/sim/verilator WALLYCONF={args.config} TEST={args.testsuite} TESTBENCH={args.tb} PLUS_ARGS="{args.args}" PARAM_ARGS="{args.params}"')
|
||||
os.system(f'make -C {WALLY}/sim/verilator WALLYCONF={args.config} TEST={args.testsuite} TESTBENCH={args.tb} PLUS_ARGS="{args.args}" PARAM_ARGS="{args.params}" DEFINE_ARGS="{args.define}"')
|
||||
|
||||
def runVCS(args, flags, prefix):
|
||||
print(f"Running VCS on {args.config} {args.testsuite}")
|
||||
# if (args.gui):
|
||||
# flags += " --gui"
|
||||
if (args.args != ""):
|
||||
args.args = f' --args "{args.args}" '
|
||||
if (args.params != ""):
|
||||
args.params = f' --params "{args.params}" '
|
||||
cmd = f"cd $WALLY/sim/vcs; {prefix} ./run_vcs {args.config} {args.testsuite} --tb {args.tb} {args.args} {args.params} {flags}"
|
||||
if args.args:
|
||||
args.args = f'--args "{args.args}"'
|
||||
if args.params:
|
||||
args.params = f'--params "{args.params}"'
|
||||
if args.define:
|
||||
args.define = f'--define "{args.define}"'
|
||||
cmd = f"cd $WALLY/sim/vcs; {prefix} ./run_vcs {args.config} {args.testsuite} --tb {args.tb} {args.args} {args.params} {args.define} {flags}"
|
||||
print(cmd)
|
||||
os.system(cmd)
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = parseArgs()
|
||||
def main(args):
|
||||
validateArgs(args)
|
||||
print(f"Config={args.config} tests={args.testsuite} sim={args.sim} gui={args.gui} args='{args.args}' params='{args.params}'")
|
||||
print(f"Config={args.config} tests={args.testsuite} sim={args.sim} gui={args.gui} args='{args.args}' params='{args.params}' define='{args.define}'")
|
||||
ElfFile = elfFileCheck(args)
|
||||
flags, prefix = prepSim(args, ElfFile)
|
||||
createDirs(args)
|
||||
exit(runSim(args, flags, prefix))
|
||||
createDirs(args.sim)
|
||||
sys.exit(runSim(args, flags, prefix))
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = parseArgs()
|
||||
main(args)
|
||||
|
@ -3,12 +3,12 @@
|
||||
#
|
||||
# Modification by Oklahoma State University & Harvey Mudd College
|
||||
# Use with Testbench
|
||||
# James Stine, 2008; David Harris 2021
|
||||
# James Stine, 2008; David Harris 2021; Jordan Carlin 2024
|
||||
# Go Cowboys!!!!!!
|
||||
#
|
||||
# Takes 1:10 to run RV64IC tests using gui
|
||||
|
||||
# Usage: do wally.do <config> <testcases> <testbench> [--ccov] [--fcov] [+acc] [--args "any number of +value"] [--params "any number of VAR=VAL parameter overrides"]
|
||||
# Usage: do wally.do <config> <testcases> <testbench> [--ccov] [--fcov] [--gui] [--args "any number of +value"] [--params "any number of VAR=VAL parameter overrides"]
|
||||
# Example: do wally.do rv64gc arch64i testbench
|
||||
|
||||
# Use this wally.do file to run this example.
|
||||
@ -40,7 +40,6 @@ set TESTSUITE ${2}
|
||||
set TESTBENCH ${3}
|
||||
set WKDIR wkdir/${CFG}_${TESTSUITE}
|
||||
set WALLY $::env(WALLY)
|
||||
set IMPERAS_HOME $::env(IMPERAS_HOME)
|
||||
set CONFIG ${WALLY}/config
|
||||
set SRC ${WALLY}/src
|
||||
set TB ${WALLY}/testbench
|
||||
@ -55,6 +54,7 @@ vlib ${WKDIR}
|
||||
set PlusArgs ""
|
||||
set ParamArgs ""
|
||||
set ExpandedParamArgs {}
|
||||
set DefineArgs ""
|
||||
|
||||
set ccov 0
|
||||
set CoverageVoptArg ""
|
||||
@ -62,8 +62,6 @@ set CoverageVsimArg ""
|
||||
|
||||
set FunctCoverage 0
|
||||
set FCvlog ""
|
||||
set FCvopt ""
|
||||
set FCdefineCOVER_EXTS {}
|
||||
|
||||
set lockstep 0
|
||||
set lockstepvlog ""
|
||||
@ -91,7 +89,7 @@ echo "number of args = $argc"
|
||||
echo "lst = $lst"
|
||||
|
||||
# if +acc found set flag and remove from list
|
||||
if {[lcheck lst "+acc"]} {
|
||||
if {[lcheck lst "--gui"]} {
|
||||
set GUI 1
|
||||
set accFlag "+acc"
|
||||
}
|
||||
@ -106,21 +104,17 @@ if {[lcheck lst "--ccov"]} {
|
||||
# if --fcov found set flag and remove from list
|
||||
if {[lcheck lst "--fcov"]} {
|
||||
set FunctCoverage 1
|
||||
# COVER_BASE_RV32I is just needed to keep riscvISACOV happy, but no longer affects tests
|
||||
set FCvlog "+define+INCLUDE_TRACE2COV \
|
||||
+define+IDV_INCLUDE_TRACE2COV \
|
||||
+define+COVER_BASE_RV32I \
|
||||
+incdir+$env(WALLY)/addins/cvw-arch-verif/riscvISACOV/source \
|
||||
"
|
||||
set FCvopt "+TRACE2COV_ENABLE=1 +IDV_TRACE2COV=1"
|
||||
|
||||
set FCvlog "+incdir+$env(WALLY)/addins/cvw-arch-verif/riscvISACOV/source \
|
||||
+incdir+${FCRVVI}/unpriv \
|
||||
+incdir+${FCRVVI}/priv +incdir+${FCRVVI}/rv64_priv +incdir+${FCRVVI}/rv32_priv \
|
||||
+incdir+${FCRVVI}/common +incdir+${FCRVVI}"
|
||||
}
|
||||
|
||||
# if --lockstep or --fcov found set flag and remove from list
|
||||
if {[lcheck lst "--lockstep"] || $FunctCoverage == 1} {
|
||||
set IMPERAS_HOME $::env(IMPERAS_HOME)
|
||||
set lockstep 1
|
||||
set lockstepvlog "+define+USE_IMPERAS_DV \
|
||||
+incdir+${IMPERAS_HOME}/ImpPublic/include/host \
|
||||
set lockstepvlog "+incdir+${IMPERAS_HOME}/ImpPublic/include/host \
|
||||
+incdir+${IMPERAS_HOME}/ImpProprietary/include/host \
|
||||
${IMPERAS_HOME}/ImpPublic/source/host/rvvi/*.sv \
|
||||
${IMPERAS_HOME}/ImpProprietary/source/host/idv/*.sv"
|
||||
@ -145,6 +139,13 @@ if {$ParamArgsIndex >= 0} {
|
||||
set lst [lreplace $lst $ParamArgsIndex [expr {$ParamArgsIndex + 1}]]
|
||||
}
|
||||
|
||||
# Set +define macros passed using the --define flag
|
||||
set DefineArgsIndex [lsearch -exact $lst "--define"]
|
||||
if {$DefineArgsIndex >= 0} {
|
||||
set DefineArgs [lindex $lst [expr {$DefineArgsIndex + 1}]]
|
||||
set lst [lreplace $lst $DefineArgsIndex [expr {$DefineArgsIndex + 1}]]
|
||||
}
|
||||
|
||||
# Debug print statements
|
||||
if {$DEBUG > 0} {
|
||||
echo "GUI = $GUI"
|
||||
@ -153,22 +154,23 @@ if {$DEBUG > 0} {
|
||||
echo "FunctCoverage = $FunctCoverage"
|
||||
echo "remaining list = $lst"
|
||||
echo "Extra +args = $PlusArgs"
|
||||
echo "Extra -args = $ExpandedParamArgs"
|
||||
echo "Extra params = $ExpandedParamArgs"
|
||||
echo "Extra defines = $DefineArgs"
|
||||
}
|
||||
|
||||
# compile source files
|
||||
# suppress spurious warnngs about
|
||||
# "Extra checking for conflicts with always_comb done at vopt time"
|
||||
# because vsim will run vopt
|
||||
set INC_DIRS "+incdir+${CONFIG}/${CFG} +incdir+${CONFIG}/deriv/${CFG} +incdir+${CONFIG}/shared +incdir+${FCRVVI} +incdir+${FCRVVI}/unpriv +incdir+${FCRVVI}/rv64_priv +incdir+${FCRVVI}/priv +incdir+${FCRVVI}/rv32_priv +incdir+${FCRVVI}/common +incdir+${FCRVVI}"
|
||||
set INC_DIRS "+incdir+${CONFIG}/${CFG} +incdir+${CONFIG}/deriv/${CFG} +incdir+${CONFIG}/shared"
|
||||
set SOURCES "${SRC}/cvw.sv ${TB}/${TESTBENCH}.sv ${TB}/common/*.sv ${SRC}/*/*.sv ${SRC}/*/*/*.sv ${WALLY}/addins/verilog-ethernet/*/*.sv ${WALLY}/addins/verilog-ethernet/*/*/*/*.sv"
|
||||
vlog -permissive -lint -work ${WKDIR} {*}${INC_DIRS} {*}${FCvlog} {*}${FCdefineCOVER_EXTS} {*}${lockstepvlog} {*}${SOURCES} -suppress 2282,2583,7053,7063,2596,13286
|
||||
vlog -permissive -lint -work ${WKDIR} {*}${INC_DIRS} {*}${DefineArgs} {*}${FCvlog} {*}${lockstepvlog} {*}${SOURCES} -suppress 2282,2583,7053,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 $accFlag wkdir/${CFG}_${TESTSUITE}.${TESTBENCH} -work ${WKDIR} {*}${ExpandedParamArgs} -o testbenchopt ${CoverageVoptArg}
|
||||
|
||||
vsim -lib ${WKDIR} testbenchopt +TEST=${TESTSUITE} {*}${PlusArgs} -fatal 7 {*}${SVLib} {*}${FCvopt} -suppress 3829 ${CoverageVsimArg}
|
||||
vsim -lib ${WKDIR} testbenchopt +TEST=${TESTSUITE} {*}${PlusArgs} -fatal 7 {*}${SVLib} -suppress 3829 ${CoverageVsimArg}
|
||||
|
||||
# power add generates the logging necessary for saif generation.
|
||||
# power add -r /dut/core/*
|
||||
|
165
sim/vcs/run_vcs
165
sim/vcs/run_vcs
@ -2,97 +2,118 @@
|
||||
|
||||
# run_vcs
|
||||
# David_Harris@hmc.edu 2 July 2024
|
||||
# Modified Jordan Carlin jcarlin@hmc.edu Dec 9 2024
|
||||
# Run VCS on a given file, passing appropriate flags
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
||||
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
# Global variables
|
||||
WALLY = os.environ.get('WALLY')
|
||||
simdir = f"{WALLY}/sim/vcs"
|
||||
cfgdir = f"{WALLY}/config"
|
||||
srcdir = f"{WALLY}/src"
|
||||
tbdir = f"{WALLY}/testbench"
|
||||
logdir = f"{simdir}/logs"
|
||||
|
||||
# run a Linux command and return the result as a string in a form that VCS can use
|
||||
def runfindcmd(cmd):
|
||||
# print("Executing: " + str(cmd) )
|
||||
res = subprocess.check_output(cmd, shell=True)
|
||||
def runFindCommand(cmd):
|
||||
res = subprocess.check_output(cmd, shell=True, )
|
||||
res = str(res)
|
||||
res = res.replace("\\n", " ") # replace newline with space
|
||||
res = res.replace("\'", "") # strip off quotation marks
|
||||
res = res[1:] # strip off leading b from byte string
|
||||
return res
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("config", help="Configuration file")
|
||||
parser.add_argument("testsuite", help="Test suite (or none, when running a single ELF file) ")
|
||||
parser.add_argument("--tb", "-t", help="Testbench", choices=["testbench", "testbench_fp"], default="testbench")
|
||||
parser.add_argument("--coverage", "-c", help="Code & Functional Coverage", action="store_true")
|
||||
parser.add_argument("--fcov", "-f", help="Code & Functional Coverage", action="store_true")
|
||||
parser.add_argument("--args", "-a", help="Optional arguments passed to simulator via $value$plusargs", default="")
|
||||
parser.add_argument("--params", "-p", help="Optional top-level parameter overrides of the form param=value", default="")
|
||||
parser.add_argument("--lockstep", "-l", help="Run ImperasDV lock, step, and compare.", action="store_true")
|
||||
# GUI not yet implemented
|
||||
#parser.add_argument("--gui", "-g", help="Simulate with GUI", action="store_true")
|
||||
args = parser.parse_args()
|
||||
print("run_vcs Config=" + args.config + " tests=" + args.testsuite + " lockstep=" + str(args.lockstep) + " args='" + args.args + "' params='" + args.params + "'")
|
||||
def parseArgs():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("config", help="Configuration file")
|
||||
parser.add_argument("testsuite", help="Test suite (or none, when running a single ELF file) ")
|
||||
parser.add_argument("--tb", "-t", help="Testbench", choices=["testbench", "testbench_fp"], default="testbench")
|
||||
parser.add_argument("--ccov", "-c", help="Code Coverage", action="store_true")
|
||||
parser.add_argument("--fcov", "-f", help="Functional Coverage", action="store_true")
|
||||
parser.add_argument("--args", "-a", help="Optional arguments passed to simulator via $value$plusargs", default="")
|
||||
parser.add_argument("--params", "-p", help="Optional top-level parameter overrides of the form param=value", default="")
|
||||
parser.add_argument("--define", "-d", help="Optional define macros passed to simulator", default="")
|
||||
parser.add_argument("--lockstep", "-l", help="Run ImperasDV lock, step, and compare.", action="store_true")
|
||||
#parser.add_argument("--gui", "-g", help="Simulate with GUI", action="store_true") # GUI not yet implemented
|
||||
return parser.parse_args()
|
||||
|
||||
cfgdir = "$WALLY/config"
|
||||
srcdir = "$WALLY/src"
|
||||
tbdir = "$WALLY/testbench"
|
||||
wkdir = "$WALLY/sim/vcs/wkdir/" + args.config + "_" + args.testsuite
|
||||
covdir = "$WALLY/sim/vcs/cov/" + args.config + "_" + args.testsuite
|
||||
logdir = "$WALLY/sim/vcs/logs"
|
||||
def createDirs(args):
|
||||
wkdir = f"{simdir}/wkdir/{args.config}_{args.testsuite}"
|
||||
covdir = f"{simdir}/cov/{args.config}_{args.testsuite}"
|
||||
os.makedirs(wkdir, exist_ok=True)
|
||||
os.makedirs(covdir, exist_ok=True)
|
||||
os.makedirs(logdir, exist_ok=True)
|
||||
return wkdir, covdir
|
||||
|
||||
os.system("mkdir -p " + wkdir)
|
||||
os.system("mkdir -p " + covdir)
|
||||
os.system("mkdir -p " + logdir)
|
||||
def generateFileList():
|
||||
rtlsrc_cmd = f'find {srcdir} -name "*.sv" ! -path "{srcdir}/generic/mem/rom1p1r_128x64.sv" ! -path "{srcdir}/generic/mem/ram2p1r1wbe_128x64.sv" ! -path "{srcdir}/generic/mem/rom1p1r_128x32.sv" ! -path "{srcdir}/generic/mem/ram2p1r1wbe_2048x64.sv"'
|
||||
rtlsrc_files = runFindCommand(rtlsrc_cmd)
|
||||
tbcommon_cmd = f'find {tbdir}/common -name "*.sv"'
|
||||
tbcommon_files = runFindCommand(tbcommon_cmd)
|
||||
tb_file = f'{tbdir}/{args.tb}.sv'
|
||||
return f"{tb_file} {rtlsrc_files} {tbcommon_files}"
|
||||
|
||||
# Find RTL source files
|
||||
rtlsrc_cmd = "find " + srcdir + ' -name "*.sv" ! -path "' + srcdir + '/generic/mem/rom1p1r_128x64.sv" ! -path "' + srcdir + '/generic/mem/ram2p1r1wbe_128x64.sv" ! -path "' + srcdir + '/generic/mem/rom1p1r_128x32.sv" ! -path "' + srcdir + '/generic/mem/ram2p1r1wbe_2048x64.sv"'
|
||||
rtlsrc_files = runfindcmd(rtlsrc_cmd)
|
||||
tbcommon_cmd = 'find ' + tbdir+'/common -name "*.sv" ! -path "' + tbdir+'/common/wallyTracer.sv"'
|
||||
tbcommon_files = runfindcmd(tbcommon_cmd)
|
||||
tb_file = tbdir + "/" + args.tb + ".sv"
|
||||
RTL_FILES = tb_file + ' ' + str(rtlsrc_files) + ' ' + str(tbcommon_files)
|
||||
def processArgs(wkdir, args):
|
||||
compileOptions = []
|
||||
simvOptions = []
|
||||
if args.lockstep:
|
||||
compileOptions.extend(["+incdir+$IMPERAS_HOME/ImpPublic/include/host",
|
||||
"+incdir+$IMPERAS_HOME/ImpProprietary/include/host",
|
||||
"$IMPERAS_HOME/ImpPublic/source/host/rvvi/*.sv",
|
||||
"$IMPERAS_HOME/ImpProprietary/source/host/idv/*.sv"])
|
||||
simvOptions.append("-sv_lib $IMPERAS_HOME/lib/Linux64/ImperasLib/imperas.com/verification/riscv/1.0/model")
|
||||
if args.ccov:
|
||||
compileOptions.extend(["-cm line+cond+branch+fsm+tgl", f"-cm_log {wkdir}/coverage.log", f"-cm_dir {wkdir}/coverage"])
|
||||
if args.params:
|
||||
compileOptions.append(setupParamOverrides(wkdir, args))
|
||||
if args.define:
|
||||
compileOptions.append(args.define)
|
||||
# if args.gui:
|
||||
# compileOptions.append("-debug_access+all+reverse -kdb +vcs+vcdpluson")
|
||||
compileOptions = " ".join(compileOptions)
|
||||
simvOptions = " ".join(simvOptions)
|
||||
return compileOptions, simvOptions
|
||||
|
||||
# Include directories
|
||||
INCLUDE_PATH="+incdir+" + cfgdir + "/" + args.config + " +incdir+" + cfgdir + "/deriv/" + args.config + " +incdir+" + cfgdir + "/shared +incdir+$WALLY/tests +incdir+" + tbdir + " +incdir+" + srcdir
|
||||
def setupParamOverrides(wkdir, args):
|
||||
paramOverrideFile = os.path.join(wkdir, "param_overrides.txt")
|
||||
with open(paramOverrideFile, "w") as f:
|
||||
for param in args.params.split():
|
||||
[param, value] = param.split("=")
|
||||
if fr"\'" in value: # for bit values
|
||||
value = value.replace(fr"\'", "'")
|
||||
else: # for strings
|
||||
value = f'"{value}"'
|
||||
f.write(f"assign {value} {args.tb}/{param}\n")
|
||||
return f" -parameters {wkdir}/param_overrides.txt "
|
||||
|
||||
# lockstep mode
|
||||
if (args.lockstep):
|
||||
LOCKSTEP_OPTIONS = " +define+USE_IMPERAS_DV +incdir+$IMPERAS_HOME/ImpPublic/include/host +incdir+$IMPERAS_HOME/ImpProprietary/include/host $IMPERAS_HOME/ImpPublic/source/host/rvvi/*.sv $IMPERAS_HOME/ImpProprietary/source/host/idv/*.sv " + tbdir + "/common/wallyTracer.sv"
|
||||
LOCKSTEP_SIMV = "-sv_lib $IMPERAS_HOME/lib/Linux64/ImperasLib/imperas.com/verification/riscv/1.0/model"
|
||||
else:
|
||||
LOCKSTEP_OPTIONS = ""
|
||||
LOCKSTEP_SIMV = ""
|
||||
def setupCommands(wkdir, rtlFiles, compileOptions, simvOptions, args):
|
||||
includePath=f"+incdir+{cfgdir}/{args.config} +incdir+{cfgdir}/deriv/{args.config} +incdir+{cfgdir}/shared +incdir+$WALLY/tests +incdir+{tbdir} +incdir+{srcdir}"
|
||||
vcsStandardFlags = "+lint=all,noGCWM,noUI,noSVA-UA,noIDTS,noNS,noULCO,noCAWM-L,noWMIA-L,noSV-PIU,noSTASKW_CO,noSTASKW_CO1,noSTASKW_RMCOF -suppress +warn -sverilog +vc -Mupdate -line -full64 -lca -ntb_opts sensitive_dyn"
|
||||
vcsCMD = f"vcs {vcsStandardFlags} -top {args.tb} {compileOptions} -Mdir={wkdir} {includePath} {srcdir}/cvw.sv {rtlFiles} -o {wkdir}/sim_out -work {wkdir} -Mlib={wkdir} -l {logdir}/{args.config}_{args.testsuite}.log"
|
||||
simvCMD = f"{wkdir}/sim_out +TEST={args.testsuite} {args.args} -no_save {simvOptions}"
|
||||
return vcsCMD, simvCMD
|
||||
|
||||
# coverage mode
|
||||
if (args.coverage):
|
||||
COV_OPTIONS = "-cm line+cond+branch+fsm+tgl -cm_log " + wkdir + "/coverage.log -cm_dir " + wkdir + "/coverage"
|
||||
else:
|
||||
COV_OPTIONS = ""
|
||||
def runVCS(wkdir, vcsCMD, simvCMD):
|
||||
print(f"Executing: {vcsCMD}")
|
||||
subprocess.run(vcsCMD, shell=True)
|
||||
subprocess.run(simvCMD, shell=True)
|
||||
if (args.ccov):
|
||||
COV_RUN = f"urg -dir {wkdir}/coverage.vdb -format text -report IndividualCovReport/{args.config}_{args.testsuite}"
|
||||
subprocess.run(COV_RUN, shell=True)
|
||||
|
||||
# Write parameter overrides to a file
|
||||
f = open(os.path.expandvars(wkdir) + "/param_overrides.txt", "w")
|
||||
for param in args.params.split():
|
||||
[param, value] = param.split("=")
|
||||
if "\\'" in value: # for bit values
|
||||
value = value.replace("\\'", "'")
|
||||
else: # for strings
|
||||
value = "\"" + value + "\""
|
||||
# print("param=" + param + " value=" + value)
|
||||
f.write("assign " + value + " " + args.tb + "/" + param + "\n")
|
||||
f.close()
|
||||
PARAM_OVERRIDES=" -parameters " + wkdir + "/param_overrides.txt "
|
||||
def main(args):
|
||||
print(f"run_vcs Config={args.config} tests={args.testsuite} lockstep={args.lockstep} args='{args.args}' params='{args.params}' define='{args.define}'")
|
||||
wkdir, covdir = createDirs(args)
|
||||
rtlFiles = generateFileList()
|
||||
compileOptions, simvOptions = processArgs(wkdir, args)
|
||||
vcsCMD, simvCMD = setupCommands(wkdir, rtlFiles, compileOptions, simvOptions, args)
|
||||
runVCS(wkdir, vcsCMD, simvCMD)
|
||||
|
||||
# Simulation commands
|
||||
OUTPUT="sim_out"
|
||||
VCS_CMD="vcs +lint=all,noGCWM,noUI,noSVA-UA,noIDTS,noNS,noULCO,noCAWM-L,noWMIA-L,noSV-PIU,noSTASKW_CO,noSTASKW_CO1,noSTASKW_RMCOF -suppress +warn -sverilog +vc -Mupdate -line -full64 -lca -ntb_opts sensitive_dyn " + "-top " + args.tb + PARAM_OVERRIDES + INCLUDE_PATH # Disabled Debug flags; add them back for a GUI mode -debug_access+all+reverse -kdb +vcs+vcdpluson
|
||||
VCS = VCS_CMD + " -Mdir=" + wkdir + " " + srcdir + "/cvw.sv " + LOCKSTEP_OPTIONS + " " + COV_OPTIONS + " " + RTL_FILES + " -o " + wkdir + "/" + OUTPUT + " -work " + wkdir + " -Mlib=" + wkdir + " -l " + logdir + "/" + args.config + "_" + args.testsuite + ".log"
|
||||
SIMV_CMD= wkdir + "/" + OUTPUT + " +TEST=" + args.testsuite + " " + args.args + " -no_save " + LOCKSTEP_SIMV
|
||||
|
||||
# Run simulation
|
||||
print("Executing: " + str(VCS) )
|
||||
subprocess.run(VCS, shell=True)
|
||||
subprocess.run(SIMV_CMD, shell=True)
|
||||
if (args.coverage):
|
||||
COV_RUN = "urg -dir " + wkdir + "/coverage.vdb -format text -report IndividualCovReport/" + args.config + "_" + args.testsuite
|
||||
subprocess.run(COV_RUN, shell=True)
|
||||
if __name__ == "__main__":
|
||||
args = parseArgs()
|
||||
sys.exit(main(args))
|
||||
|
@ -13,16 +13,15 @@ VERILATOR_DIR=${WALLY}/sim/verilator
|
||||
SOURCE=${WALLY}/config/shared/*.vh ${WALLY}/config/${WALLYCONF} ${WALLY}/config/deriv/${WALLYCONF} ${WALLY}/src/cvw.sv ${WALLY}/testbench/*.sv ${WALLY}/testbench/common/*.sv ${WALLY}/src/*/*.sv ${WALLY}/src/*/*/*.sv
|
||||
PLUS_ARGS=
|
||||
PARAM_ARGS=
|
||||
DEFINE_ARGS=
|
||||
EXPANDED_PARAM_ARGS:=$(patsubst %,-G%,$(PARAM_ARGS))
|
||||
|
||||
WALLYCONF?=rv64gc
|
||||
TEST?=arch64i
|
||||
TESTBENCH?=testbench
|
||||
TESTBENCH?=testbench
|
||||
|
||||
# constants
|
||||
# assume WALLY variable is correctly configured in the shell environment
|
||||
WORKING_DIR=${WALLY}/sim/verilator
|
||||
TARGET=$(WORKING_DIR)/target
|
||||
# INCLUDE_PATH are pathes that Verilator should search for files it needs
|
||||
INCLUDE_PATH="-I${WALLY}/config/shared" "-I${WALLY}/config/$(WALLYCONF)" "-I${WALLY}/config/deriv/$(WALLYCONF)"
|
||||
# SOURCES are source files
|
||||
@ -30,6 +29,8 @@ SOURCES=${WALLY}/src/cvw.sv ${WALLY}/testbench/${TESTBENCH}.sv ${WALLY}/testbenc
|
||||
# DEPENDENCIES are configuration files and source files, which leads to recompilation of executables
|
||||
DEPENDENCIES=${WALLY}/config/shared/*.vh $(SOURCES)
|
||||
|
||||
WORKDIR = $(VERILATOR_DIR)/wkdir/$(WALLYCONF)_$(TEST)
|
||||
|
||||
# regular testbench requires a wrapper defining getenvval
|
||||
ifeq ($(TESTBENCH), testbench)
|
||||
WRAPPER=${WALLY}/sim/verilator/wrapper.c
|
||||
@ -41,9 +42,9 @@ endif
|
||||
|
||||
default: run
|
||||
|
||||
run: wkdir/$(WALLYCONF)_$(TEST)/V${TESTBENCH}
|
||||
run: $(WORKDIR)/V${TESTBENCH}
|
||||
mkdir -p $(VERILATOR_DIR)/logs
|
||||
wkdir/$(WALLYCONF)_$(TEST)/V${TESTBENCH} ${ARGTEST} $(PLUS_ARGS)
|
||||
$(WORKDIR)/V${TESTBENCH} ${ARGTEST} $(PLUS_ARGS)
|
||||
|
||||
profile: obj_dir_profiling/V${TESTBENCH}_$(WALLYCONF)
|
||||
$(VERILATOR_DIR)/obj_dir_profiling/V${TESTBENCH}_$(WALLYCONF) ${ARGTEST}
|
||||
@ -54,15 +55,16 @@ profile: obj_dir_profiling/V${TESTBENCH}_$(WALLYCONF)
|
||||
mv gmon_$(WALLYCONF)* $(VERILATOR_DIR)/logs_profiling
|
||||
echo "Please check $(VERILATOR_DIR)/logs_profiling/gmon_$(WALLYCONF)* for logs and output files."
|
||||
|
||||
wkdir/$(WALLYCONF)_$(TEST)/V${TESTBENCH}: $(DEPENDENCIES)
|
||||
mkdir -p wkdir/$(WALLYCONF)_$(TEST)
|
||||
$(WORKDIR)/V${TESTBENCH}: $(DEPENDENCIES)
|
||||
mkdir -p $(WORKDIR)
|
||||
verilator \
|
||||
--Mdir wkdir/$(WALLYCONF)_$(TEST) -o V${TESTBENCH} \
|
||||
--Mdir $(WORKDIR) -o V${TESTBENCH} \
|
||||
--binary --trace \
|
||||
$(OPT) $(PARAMS) $(NONPROF) \
|
||||
--top-module ${TESTBENCH} --relative-includes \
|
||||
$(INCLUDE_PATH) \
|
||||
${WRAPPER} \
|
||||
${DEFINE_ARGS} \
|
||||
${EXPANDED_PARAM_ARGS} \
|
||||
$(SOURCES)
|
||||
|
||||
@ -75,6 +77,7 @@ obj_dir_profiling/V${TESTBENCH}_$(WALLYCONF): $(DEPENDENCIES)
|
||||
--top-module ${TESTBENCH} --relative-includes \
|
||||
$(INCLUDE_PATH) \
|
||||
${WRAPPER} \
|
||||
${DEFINE_ARGS} \
|
||||
${EXPANDED_PARAM_ARGS} \
|
||||
$(SOURCES)
|
||||
|
||||
|
@ -44,6 +44,7 @@ module testbench;
|
||||
parameter I_CACHE_ADDR_LOGGER=0;
|
||||
parameter D_CACHE_ADDR_LOGGER=0;
|
||||
parameter RVVI_SYNTH_SUPPORTED=0;
|
||||
parameter MAKE_VCD=0;
|
||||
|
||||
`ifdef USE_IMPERAS_DV
|
||||
import idvPkg::*;
|
||||
@ -230,10 +231,10 @@ module testbench;
|
||||
end
|
||||
$finish;
|
||||
end
|
||||
`ifdef MAKEVCD
|
||||
$dumpfile("testbench.vcd");
|
||||
$dumpvars;
|
||||
`endif
|
||||
if (MAKE_VCD) begin
|
||||
$dumpfile("testbench.vcd");
|
||||
$dumpvars;
|
||||
end
|
||||
end // initial begin
|
||||
|
||||
// Model the testbench as an fsm.
|
||||
|
Loading…
Reference in New Issue
Block a user