ibex/dv/uvm/core_ibex/vcs.tcl
Rupert Swarbrick 5773a1cd78 Explicitly pass directory for waves to VCS's UCLI TCL
This fixes a bug mentioned in issue #674, where dumped wave files were
ending up in dv/uvm/core_ibex, rather than a test-specific output
directory.

It turns out that this is because of my change in commit 08fc2a4,
which runs the simulator in the top core_ibex directory, rather than
changing directories each time. We have to do this to make the
parallel LSF flow work (which presumably has never actually been run,
otherwise we'd have noticed it was broken).

There are two ways I can think of getting this to work. Probably the
cleanest approach is to generate a script for each test, which looks
something like "cd test_dir; setup_stuff; run_simulator". This would
work (and is how I've seen it done in the past), but doesn't really
fit in with the string interpolation/YAML stuff we've got here.

Instead, this patch goes for a hackier approach, where we prefix the
simulation command with "env SIM_DIR=<out>" and then use the SIM_DIR
environment variable in the TCL scripts to figure out where to put the
wave file. This is kind of icky long-term, but should work for now.

I've also got rid of the code that appends some extra plusargs and a
log argument to the simulation command; now, the relevant variables
get substituted in and the actual command is found in
rtl_simulation.yaml.
2020-03-13 14:18:55 +00:00

46 lines
1.9 KiB
Tcl

# TCL file invoked from VCS's simv at run-time using this: -ucli -do <this file>
# Since we don't necessarily run each test in a different directory,
# we have to tell VCS where to put the waves. We do this with a
# SIM_DIR environment variable, which we prepend to the wave name. If
# SIM_DIR is not set, we just dump to the current directory.
if { [info exists ::env(SIM_DIR)] } {
set sim_dir $::env(SIM_DIR)
} else {
set sim_dir "."
}
if { [info exists ::env(VERDI_HOME)] } {
# Use FSDB for dumping data, but only if we have Verdi set up.
# Syntax: fsdbDumpfile FSDB_Name [Limit_Size]
fsdbDumpfile "${sim_dir}/waves.fsdb"
# Syntax: fsdbDumpvars [depth] [instance] [option]*
##############################################################################
# Option Description
##############################################################################
# +mda Dumps memory and MDA signals in all scopes.
# +packedmda Dumps packed signals
# +struct Dumps structs
# +skip_cell_instance=mode Enables or disables cell dumping
# +strength Enables strength dumping
# +parameter Dumps parameters
# +power Dumps power-related signals
# +trace_process Dumps VHDL processes
# +no_functions Disables dumping of functions
# +sva Dumps assertions
# +Reg_Only Dumps only reg type signals
# +IO_Only Dumps only IO port signals
# +by_file=<filename> File to specify objects to add
# +all Dumps memories, MDA signals, structs, unions,power, and packed structs
fsdbDumpvars 0 core_ibex_tb_top +all
fsdbDumpSVA 0 core_ibex_tb_top.dut
} else {
# We don't have VERDI set up, so use VCS's standard dumping format.
dump -file "${sim_dir}/waves.vpd"
dump -add { core_ibex_tb_top } -depth 0 -aggregates -scope "."
}
run
quit