Commit 1798f3b0 authored by Martin Jeřábek's avatar Martin Jeřábek

testfw: option to force dumping all signals to waves

* per-test config option 'dump_all_signals'
* command line argument --dumpall
parent 9b8deb98
Pipeline #6821 passed with stage
in 46 seconds
......@@ -80,10 +80,12 @@ def create():
@click.option('--strict', 'strict', flag_value=1,
help='Return non-zero if an unconfigured test was found.')
@click.option('--no-strict', 'strict', flag_value=0)
@click.option('--dumpall', is_flag=True, flag_value=True, default=False,
help='In GUI mode, dump all signals, not only these included in layout file.')
@click.option('--create-ghws/--no-create-ghws', default=False,
help='Only elaborate and create basic GHW files necessary for converting TCL layout files to GTKW files for gtkwave..')
@click.pass_obj
def test(obj, *, config, strict, create_ghws, vunit_args):
def test(obj, *, config, strict, create_ghws, dumpall, vunit_args):
"""Run the tests. Configuration is passed in YAML config file.
You mas pass arguments directly to VUnit by appending them at the command end.
......@@ -143,7 +145,9 @@ def test(obj, *, config, strict, create_ghws, vunit_args):
tests = []
for cfg_key, factory in tests_classes:
if cfg_key in config:
tests.append(factory(ui, lib, config[cfg_key], build, base, create_ghws=create_ghws))
tests.append(factory(ui, lib, config[cfg_key], build, base,
create_ghws=create_ghws,
force_unrestricted_dump_signals=dumpall))
(func_cov_dir / "html").mkdir(parents=True, exist_ok=True)
(func_cov_dir / "coverage_data").mkdir(parents=True, exist_ok=True)
......
......@@ -60,13 +60,15 @@ class OptionsDict(dict):
class TestsBase:
def __init__(self, ui, lib, config, build, base, create_ghws: bool):
def __init__(self, ui, lib, config, build, base, create_ghws: bool,
force_unrestricted_dump_signals: bool):
self.ui = ui
self.lib = lib
self.config = config
self.build = build
self.base = base
self.create_ghws = create_ghws
self.force_unrestricted_dump_signals = force_unrestricted_dump_signals
@property
def jinja_env(self):
......@@ -137,12 +139,16 @@ class TestsBase:
"--create-ghws.".format(tclfname))
gtkw = None
else:
log.info('Converting wave file {} to gtkw ...'.format(tclfname))
log.debug('Converting wave file {} to gtkw ...'.format(tclfname))
used_signals = tcl2gtkw(str(tcl), tcl_init_files, str(gtkw), ghw_file)
with wave_opt_file.open('wt') as f:
f.write('$ version 1.1\n')
f.writelines('\n'.join(used_signals))
sim_options['ghdl.sim_flags'] += ['--read-wave-opt='+str(wave_opt_file)]
if not cfg['dump_all_signals'] and not self.force_unrestricted_dump_signals:
log.info('Only signals included in the layout file '
'will be dumped. To see them all, run with '
'--dumpall.')
sim_options['ghdl.sim_flags'] += ['--read-wave-opt='+str(wave_opt_file)]
if gtkw:
try:
tb.set_sim_option("ghdl.gtkwave_flags", [])
......
......@@ -5,6 +5,8 @@ _default: &default
psl_coverage: false
# seed: 0 # optional; use to reconstruct results from randomized runs
# randomize: false
# In GUI mode, dump all signals, not only these included in layout file.
dump_all_signals: true
feature:
default:
<<: *default
......
......@@ -4,6 +4,8 @@ _default: &default
error_tolerance: 0
# seed: 0 # optional; use to reconstruct results from randomized runs
# randomize: false
# In GUI mode, dump all signals, not only these included in layout file.
dump_all_signals: true
unit:
default:
<<: *default
......@@ -109,6 +111,7 @@ sanity:
timeout: 2 sec
gauss_iter: 40
wave: sanity/sanity_env_setup.tcl
dump_all_signals: false
tests:
"1Mb/10Mb 20 m Star":
topology: star
......
......@@ -3,6 +3,8 @@ _default: &default
psl_coverage: true
error_tolerance: 0
randomize: true
# In GUI mode, dump all signals, not only these included in layout file.
dump_all_signals: true
unit:
default:
<<: *default
......@@ -109,6 +111,7 @@ sanity:
timeout: 2 sec
gauss_iter: 40
wave: sanity/sanity_env_setup.tcl
dump_all_signals: false
tests:
"1Mb/10Mb 20 m Star":
topology: star
......
......@@ -3,6 +3,8 @@ _default: &default
error_tolerance: 0
# seed: 0 # optional; use to reconstruct results from randomized runs
# randomize: false
# In GUI mode, dump all signals, not only these included in layout file.
dump_all_signals: true
reference:
default:
<<: *default
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment