I have a directory and file structure like this:
vunit_multi/
alfa/
run.py
...
bravo/
run.py
...
The VUnit run.py can run separately.
Is there any nice way to combine these multiple separate VUnit runs into a single run with a combined status report?
Let's say your alfa and bravo run scripts looks something like this
Now arrange your script to this
The if statement at the bottom means that the last three lines are executed if the file is called as a script (so you can still use it to test alfa) but not if the file is imported as a module into another script.
Now put a new run script like this in the top-level directory (
vunit_multi)create_test_suiteswill find all run scripts and then iterate over those scripts. Each script file will be imported as a module to get access to thecreate_test_suitefunction. The function is called with theprjcreated in this top-level script to add the libraries and files specified for the module.Now if you run the top-level script it will see all module testbenches.
Note: There are newer modules than
impthat you can use butimpalso works in older Python versions.