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(): ...@@ -80,10 +80,12 @@ def create():
@click.option('--strict', 'strict', flag_value=1, @click.option('--strict', 'strict', flag_value=1,
help='Return non-zero if an unconfigured test was found.') help='Return non-zero if an unconfigured test was found.')
@click.option('--no-strict', 'strict', flag_value=0) @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, @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..') help='Only elaborate and create basic GHW files necessary for converting TCL layout files to GTKW files for gtkwave..')
@click.pass_obj @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. """Run the tests. Configuration is passed in YAML config file.
You mas pass arguments directly to VUnit by appending them at the command end. 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): ...@@ -143,7 +145,9 @@ def test(obj, *, config, strict, create_ghws, vunit_args):
tests = [] tests = []
for cfg_key, factory in tests_classes: for cfg_key, factory in tests_classes:
if cfg_key in config: 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 / "html").mkdir(parents=True, exist_ok=True)
(func_cov_dir / "coverage_data").mkdir(parents=True, exist_ok=True) (func_cov_dir / "coverage_data").mkdir(parents=True, exist_ok=True)
......
...@@ -60,13 +60,15 @@ class OptionsDict(dict): ...@@ -60,13 +60,15 @@ class OptionsDict(dict):
class TestsBase: 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.ui = ui
self.lib = lib self.lib = lib
self.config = config self.config = config
self.build = build self.build = build
self.base = base self.base = base
self.create_ghws = create_ghws self.create_ghws = create_ghws
self.force_unrestricted_dump_signals = force_unrestricted_dump_signals
@property @property
def jinja_env(self): def jinja_env(self):
...@@ -137,12 +139,16 @@ class TestsBase: ...@@ -137,12 +139,16 @@ class TestsBase:
"--create-ghws.".format(tclfname)) "--create-ghws.".format(tclfname))
gtkw = None gtkw = None
else: 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) used_signals = tcl2gtkw(str(tcl), tcl_init_files, str(gtkw), ghw_file)
with wave_opt_file.open('wt') as f: with wave_opt_file.open('wt') as f:
f.write('$ version 1.1\n') f.write('$ version 1.1\n')
f.writelines('\n'.join(used_signals)) 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: if gtkw:
try: try:
tb.set_sim_option("ghdl.gtkwave_flags", []) tb.set_sim_option("ghdl.gtkwave_flags", [])
......
...@@ -5,6 +5,8 @@ _default: &default ...@@ -5,6 +5,8 @@ _default: &default
psl_coverage: false psl_coverage: false
# seed: 0 # optional; use to reconstruct results from randomized runs # seed: 0 # optional; use to reconstruct results from randomized runs
# randomize: false # randomize: false
# In GUI mode, dump all signals, not only these included in layout file.
dump_all_signals: true
feature: feature:
default: default:
<<: *default <<: *default
......
...@@ -4,6 +4,8 @@ _default: &default ...@@ -4,6 +4,8 @@ _default: &default
error_tolerance: 0 error_tolerance: 0
# seed: 0 # optional; use to reconstruct results from randomized runs # seed: 0 # optional; use to reconstruct results from randomized runs
# randomize: false # randomize: false
# In GUI mode, dump all signals, not only these included in layout file.
dump_all_signals: true
unit: unit:
default: default:
<<: *default <<: *default
...@@ -109,6 +111,7 @@ sanity: ...@@ -109,6 +111,7 @@ sanity:
timeout: 2 sec timeout: 2 sec
gauss_iter: 40 gauss_iter: 40
wave: sanity/sanity_env_setup.tcl wave: sanity/sanity_env_setup.tcl
dump_all_signals: false
tests: tests:
"1Mb/10Mb 20 m Star": "1Mb/10Mb 20 m Star":
topology: star topology: star
......
...@@ -3,6 +3,8 @@ _default: &default ...@@ -3,6 +3,8 @@ _default: &default
psl_coverage: true psl_coverage: true
error_tolerance: 0 error_tolerance: 0
randomize: true randomize: true
# In GUI mode, dump all signals, not only these included in layout file.
dump_all_signals: true
unit: unit:
default: default:
<<: *default <<: *default
...@@ -109,6 +111,7 @@ sanity: ...@@ -109,6 +111,7 @@ sanity:
timeout: 2 sec timeout: 2 sec
gauss_iter: 40 gauss_iter: 40
wave: sanity/sanity_env_setup.tcl wave: sanity/sanity_env_setup.tcl
dump_all_signals: false
tests: tests:
"1Mb/10Mb 20 m Star": "1Mb/10Mb 20 m Star":
topology: star topology: star
......
...@@ -3,6 +3,8 @@ _default: &default ...@@ -3,6 +3,8 @@ _default: &default
error_tolerance: 0 error_tolerance: 0
# seed: 0 # optional; use to reconstruct results from randomized runs # seed: 0 # optional; use to reconstruct results from randomized runs
# randomize: false # randomize: false
# In GUI mode, dump all signals, not only these included in layout file.
dump_all_signals: true
reference: reference:
default: default:
<<: *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