Skip to content

Commit

Permalink
Added -g short flag for --gui. Made 'load' the default in modelsim in…
Browse files Browse the repository at this point in the history
…terface when using -g/--gui
  • Loading branch information
kraigher committed Oct 31, 2015
1 parent fc34397 commit 056a4fc
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 26 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def find_all_files(directory, endings=None):

setup(
name='vunit_hdl',
version='0.43.0',
version='0.44.0',
packages=['vunit',
'vunit.com',
'vunit.test',
Expand Down
52 changes: 32 additions & 20 deletions user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ cases.

```console
> python run.py -h
/repo/vunit (master)$ PYTHONPATH=. python examples/vhdl/user_guide/run.py -h
usage: run.py [-h] [-l] [--compile] [--elaborate] [--clean] [-o OUTPUT_PATH]
[-x XUNIT_XML] [-v] [--no-color] [--gui {load,run}]
[--log-level {info,error,warning,debug}]
[--gui {load,run}] [--new-vsim]
[-x XUNIT_XML] [--exit-0] [-v] [--no-color]
[--log-level {info,error,warning,debug}] [-p NUM_THREADS]
[--use-debug-codecs] [-g [{load,run}]] [--new-vsim]
[--coverage [COVERAGE]]
[tests [tests ...]]

VUnit command line tool.
Expand All @@ -63,25 +65,44 @@ optional arguments:
-v, --verbose Print test output immediately and not only when
failure
--no-color Do not color output
--gui {load,run} Open test case(s) in simulator gui. 'load' only loads
the test case and gives the user control. 'run' loads
and runs the test case while recursively logging all
variables and signals
--log-level {info,error,warning,debug}
-p NUM_THREADS, --num-threads NUM_THREADS
Number of tests to run in parallel. Test output is not
continuously written in verbose mode with p > 1

com:
Flags specific to the com message passing package

--use-debug-codecs Run with debug features enabled

modelsim:
ModelSim specific flags

-g [{load,run}], --gui [{load,run}]
Open test case(s) in simulator gui. 'load' only loads
the test case and gives the user control (default).
'run' loads and runs the test case while recursively
logging all variables and signals.
--new-vsim Do not re-use the same vsim process for running
different test cases (slower)
--coverage [COVERAGE]
Enable code coverage. Choose any combination of
"bcestf". When the flag is given with no argument
everthing is enabled. Remember to run --clean when
chaning this as re-compilation is not triggered.
Experimental feature not supported by VUnit main
developers.

activehdl:
Aldec Active HDL specific flags

--gui Open test case(s) in simulator gui with top level pre
-g, --gui Open test case(s) in simulator gui with top level pre
loaded

rivierapro:
Aldec Riviera Pro specific flags

--gui Open test case(s) in simulator gui with top level pre
-g, --gui Open test case(s) in simulator gui with top level pre
loaded

ghdl:
Expand All @@ -91,15 +112,6 @@ ghdl:
--gtkwave-args GTKWAVE_ARGS
Arguments to pass to gtkwave

modelsim:
ModelSim specific flags

--gui {load,run} Open test case(s) in simulator gui. 'load' only loads
the test case and gives the user control. 'run' loads
and runs the test case while recursively logging all
variables and signals
--new-vsim Do not re-use the same vsim process for running
different test cases (slower)
```

## VHDL Test Benches
Expand Down Expand Up @@ -242,7 +254,7 @@ When interfacing with pre-compiled libraries such as `unisim` from Xilinx the `a
## Running a test case in the ModelSim GUI
Sometimes the textual error messages and logs are not enough to pinpoint the error and a test case needs to be opened in the GUI for visual debugging using single stepping, breakpoints and wave form viewing. VUnit makes it easy to open a test case in the GUI by having a `--gui={load,run}` command line flag:
```console
> python run.py --gui=load my_test_case
> python run.py --gui my_test_case
```
This launches a GUI window for each test case with specific functions pre-loaded printing the following help:
```tcl
Expand All @@ -264,7 +276,7 @@ vunit_run

It is also possible to automatically run the test case in the gui while logging all signals and variables recursively using the `--gui=run` flag.
After simulation the user can manually add objects of interest to the waveform viewer without re-running since everything has been logged.
When running large designs this mode can be quite slow and it might be better to just do `--gui=load` and manually add a few signals of interest.
When running large designs this mode can be quite slow and it might be better to just do `--gui` and manually add a few signals of interest.

## GHDL - Viewing signals in GTKWave
Signals can be viewed in GTKWave when using the GHDL simulator and GTKWave executable is found in the `PATH` environment variable.
Expand Down
2 changes: 1 addition & 1 deletion vunit/activehdl_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def add_arguments(parser):
group = parser.add_argument_group("activehdl",
description="Aldec Active HDL specific flags")

group.add_argument('--gui',
group.add_argument('-g', '--gui',
action="store_true",
default=False,
help=("Open test case(s) in simulator gui with top level pre loaded"))
Expand Down
8 changes: 5 additions & 3 deletions vunit/modelsim_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ def add_arguments(parser):
"""
group = parser.add_argument_group("modelsim",
description="ModelSim specific flags")
group.add_argument('--gui', choices=["load", "run"],
group.add_argument('-g', '--gui', choices=["load", "run"],
default=None,
nargs="?",
const="load",
help=("Open test case(s) in simulator gui. "
"'load' only loads the test case and gives the user control. "
"'load' only loads the test case and gives the user control (default). "
"'run' loads and runs the test case while recursively "
"logging all variables and signals"))
"logging all variables and signals."))
group.add_argument("--new-vsim",
action="store_true",
default=False,
Expand Down
2 changes: 1 addition & 1 deletion vunit/rivierapro_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def add_arguments(parser):
group = parser.add_argument_group("rivierapro",
description="Aldec Riviera Pro specific flags")

group.add_argument('--gui',
group.add_argument('-g', '--gui',
action="store_true",
default=False,
help=("Open test case(s) in simulator gui with top level pre loaded"))
Expand Down

0 comments on commit 056a4fc

Please sign in to comment.