Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cocotb testbench runner #222

Draft
wants to merge 127 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
eade15f
First commit. Adding the cocotb test runner script to the project.
jacob720 Sep 20, 2024
1609d9b
Applied different approach to assignments and checks, creating dictio…
jacob720 Sep 20, 2024
9fea16f
Initialising carry_end to 0.
jacob720 Sep 20, 2024
93dcdd1
Script to run tests for all modules listed in a text file.
jacob720 Sep 24, 2024
7f64c07
Creates directories for each module containing waveforms.
jacob720 Sep 24, 2024
b28bc95
Ensuring signals of type 'read' are not initialised.
jacob720 Sep 27, 2024
fcad115
Can run multiple tests using 'all' in place of module name.
jacob720 Oct 7, 2024
a0b5d21
Removing 'loud' flag.
jacob720 Oct 7, 2024
3fb1648
Records time taken for tests.
jacob720 Oct 7, 2024
2ec4582
Run each module simulation in a different folder
jacob720 Oct 7, 2024
0cd2b34
Minor code style improvement
jacob720 Oct 7, 2024
03b7068
Ignore simulation build folder
jacob720 Oct 7, 2024
df7ae50
When running all tests, only run the ones that contains test_config
jacob720 Oct 7, 2024
9b8d626
Adding test_config files for modules to be tested.
jacob720 Oct 8, 2024
54f0f41
Get HDL modules needed for a module from its test_config file.
jacob720 Oct 8, 2024
057d3a8
Deal with signals of type 'time' by taking into account _H and _L sig…
jacob720 Oct 8, 2024
d74aa52
Codestyle improvements.
jacob720 Oct 8, 2024
d48e580
Removing script to run all tests. This is now done in cocotb_timing_t…
jacob720 Oct 8, 2024
345f213
Changing name of signals_dict to signals_info.
jacob720 Oct 8, 2024
c1e6d4a
'Dealing with case where test name is given but there are no tests wi…
jacob720 Oct 8, 2024
c01ef45
Deal with case where an incorrect module name is given.
jacob720 Oct 9, 2024
8a4a24a
Allows directories as well as files in test_config.
jacob720 Oct 9, 2024
80e14c0
Get additional build args from a module's test_config.
jacob720 Oct 10, 2024
37096ad
Test config files for seq and pcomp modules
jacob720 Oct 10, 2024
4fa2415
Deal with 'table short' data type
jacob720 Oct 10, 2024
f372e1f
Function to work out what IP is needed for each module. Use command '…
jacob720 Oct 10, 2024
2fdba52
Remove shared variable from synthesisable code
glennchid Oct 9, 2024
c406907
Removing unisim dependancy from posenc (it's unused)
jacob720 Oct 10, 2024
b71fb4b
Test config files for posenc, qdec & srgate
jacob720 Oct 10, 2024
b644330
Dealing with tests with a '/' in the name
jacob720 Oct 10, 2024
fd71cad
Using Michael's FIFO module to avoid pulse_queue IP.
jacob720 Oct 15, 2024
7354287
Debugging
jacob720 Oct 15, 2024
3a1f1aa
Test config files for pcap and pgen.
jacob720 Oct 16, 2024
93069ee
Allow for modules where the top level vhdl file doesn't match the dir…
jacob720 Oct 16, 2024
a53caac
Functions to check IP and timing INI for a module.
jacob720 Oct 16, 2024
e901677
See commit 0aa91f22
jacob720 Oct 16, 2024
bc79a1c
bugfix
jacob720 Oct 16, 2024
4e08029
DMA driver to simulate dma capability within pgen module.
jacob720 Oct 17, 2024
85c4d37
Supporting 'table' data type for signals.
jacob720 Oct 17, 2024
770d480
Changing pgen module to use Michael's fifo rather than IP.
jacob720 Oct 17, 2024
8ff4f46
Removing unisim dependancy from bitmux - it doesn't need it
jacob720 Oct 23, 2024
a0bd325
Changing from std_ulogic to std_logic
jacob720 Oct 23, 2024
22ece7d
Changing to std_logic from std_ulogic and removing function to avoid …
jacob720 Oct 23, 2024
035372a
Changing test config files to reflect changes in support.vhd. top_def…
jacob720 Oct 23, 2024
f677346
Adding output buffer for fifo to replicate behaviour of IP fifo
jacob720 Oct 23, 2024
1a2fb60
Changing timing INI to reflect behaviour with python DMA driver and n…
jacob720 Oct 23, 2024
130fc96
Improving pgen test files
jacob720 Oct 23, 2024
81a36c9
DMA monitor for pcap data output
jacob720 Oct 23, 2024
598a4e3
More information needed in test config for pcap, such as top level en…
jacob720 Oct 23, 2024
951b607
Some output signals contain '_out' but don't end in '_out'
jacob720 Oct 23, 2024
31d8534
Allowing the cocotb runner to work with the DMA monitor.
jacob720 Oct 23, 2024
0b84788
Allowing cocotb runner to deal with bus signals
jacob720 Oct 23, 2024
1a07a2b
Removing skip list
jacob720 Oct 23, 2024
5369ca9
Initialising signals in pcap module
jacob720 Oct 24, 2024
685f2cc
Don't check data condition for pcap_dat_o if pcap_dat_valid_o is low
jacob720 Oct 24, 2024
20faabf
Working dma_monitor
jacob720 Oct 25, 2024
99e4cdb
Only check signals of type 'data_valid' if ini file has an explicit c…
jacob720 Oct 25, 2024
c44c4a1
Allow negative numbers to be assigned to a part of a bus. Assumes 2s …
jacob720 Oct 25, 2024
8b7da67
Bugfix
jacob720 Oct 25, 2024
a0fc523
Adding signals to pcap's test config file so they are initialised. Pr…
jacob720 Oct 25, 2024
6a98e63
Adding bit bus info to pcap test config file
jacob720 Oct 28, 2024
d53322e
Reformatting
jacob720 Oct 28, 2024
cba75f5
Using 'clean' option. Getting xml_path directly from sim object.
jacob720 Oct 28, 2024
dd09952
Adding docstrings and reformatting.
jacob720 Oct 28, 2024
295f3ee
Formatting
jacob720 Oct 28, 2024
3587687
Reverting pgen table file name to 1000.txt
jacob720 Oct 28, 2024
600b7ef
Clean up
jacob720 Oct 29, 2024
6c7abcd
Including fmc lback autogen hdl files so pcap_std_dev is not disabled.
jacob720 Oct 29, 2024
9feaf6a
Allowing different simulator to be chosen
jacob720 Oct 31, 2024
63eaf5d
Adding options for NVC simulator, and ordering HDL files before build…
jacob720 Oct 31, 2024
88c7c86
Fixing ordering of HDL files
jacob720 Oct 31, 2024
7e2660e
Remove simulator-specific options from test config files
jacob720 Nov 1, 2024
39f5f37
Adjustments to get nvc simulator working. Need to investigate wavedro…
jacob720 Nov 1, 2024
d7d241a
Formatting changes
jacob720 Nov 1, 2024
9c65820
Trying to pass CI tests
jacob720 Nov 6, 2024
1ee925b
bugfix
jacob720 Nov 6, 2024
ae39b8e
Fix of issue caused by latest version of cocotb
jacob720 Nov 7, 2024
fb8f9c1
Removing wavedrom functionality
jacob720 Nov 7, 2024
1d7fb8c
Updates for latest cocotb version
jacob720 Nov 7, 2024
1782370
Adding option of 'elab_args' for elaboration stage. Needs latest coco…
jacob720 Nov 7, 2024
1770f5e
Report coverage data if nvc simulator is used.
jacob720 Nov 7, 2024
e100662
Vivado tests and CI
jacob720 Nov 11, 2024
bd01196
Updating pulse and pgen block INI as they no longer need IP
jacob720 Nov 13, 2024
193c623
Renaming PGEN_1000.txt to 1000.txt
jacob720 Nov 13, 2024
c215603
Changes needed from changing 1000.txt filename (from PGEN_1000.txt)
jacob720 Nov 13, 2024
966625e
Codestyle changes
jacob720 Nov 13, 2024
7ab4cdd
New argument 'skip' to skip some modules being tested
jacob720 Nov 14, 2024
1227885
Changing so that all modules use PandABox-fmc_lback-sfp_lback build
jacob720 Nov 15, 2024
5ebe80e
Adding cocotb tests to CI workflow
jacob720 Nov 18, 2024
728129d
Only build autogen for cocotb CI
jacob720 Nov 19, 2024
c84b19a
Using panda-coco container in CI
jacob720 Nov 19, 2024
eb05d9f
Using the latest panda-cocotb container
jacob720 Nov 19, 2024
86254fc
Spelling correction
jacob720 Nov 20, 2024
41f68a0
Simplifying cocotb CI run
jacob720 Nov 20, 2024
5780ce4
Removing deprecated module 'imp' in favour of 'importlib'
jacob720 Nov 20, 2024
73e62a4
Removing deprecated module 'imp' in favour of 'importlib'
jacob720 Nov 20, 2024
be6bc9a
Updating pcap simulation so it works with python 3.9+
jacob720 Nov 20, 2024
7ad31ad
cocotb CI improvement
jacob720 Nov 20, 2024
35b47e2
Using latest container
jacob720 Nov 21, 2024
42542df
No longer assumes autogen build directory. Adding cocotb tests to mak…
jacob720 Nov 22, 2024
27cd1b2
Setting default simulator to NVC, testing all modules by default in m…
jacob720 Nov 25, 2024
4367055
Using latest container in CI
jacob720 Nov 25, 2024
9c2a463
Check module timing ini rather than test config file, to check whethe…
jacob720 Nov 25, 2024
113dace
Continue test to end on failiure, and collect value data.
jacob720 Nov 26, 2024
3a076db
Give option to collect values
jacob720 Nov 26, 2024
86575ff
Adding collect arg
jacob720 Nov 26, 2024
9580b75
Changing some prints to logging
jacob720 Nov 26, 2024
d577726
Improving values collection
jacob720 Nov 26, 2024
2f5d658
Putting test called by cocotb in seperate file
jacob720 Nov 26, 2024
c8adc0f
Write errors to file if there are any
jacob720 Nov 27, 2024
efa2c88
Cleanup sim build directory by creating subfolders for each test.
jacob720 Nov 27, 2024
0746266
Print errors at the end of test run using new logging level 'TIMING_E…
jacob720 Nov 27, 2024
f9f0720
Using latest container in CI
jacob720 Nov 27, 2024
9beb25a
Allow multiple test names to be passed, seperated by ,,
jacob720 Nov 28, 2024
d245cef
Using -c when running cocotb tests in Makefile
jacob720 Nov 28, 2024
6ac0fc9
Adding cocotb docs
jacob720 Nov 28, 2024
6a26869
Allowing for multiple timing.ini files per module (such as with seq)
jacob720 Nov 29, 2024
cecabf2
auto format cocotb scripts
jsouter Dec 3, 2024
87b2c7c
add some typing to cocotb runner
jsouter Dec 3, 2024
c2b7707
separate log_timing_error from Logger class
jsouter Dec 3, 2024
c766f7b
Attempt to fix ip, info and ini commands in cocotb test runner
jsouter Dec 3, 2024
aa4634a
Add cobertura coverage to codecov for cocotb
jsouter Dec 6, 2024
bb61bc3
Move cocotb_tests to _cocotb_test.yml
jsouter Jan 16, 2025
9b4f4b8
Run cocotb workflows on ubuntu-latest
jsouter Jan 30, 2025
80ce3c8
use sed to make coverage paths relative
jsouter Jan 30, 2025
0a56b0e
rollback cocotb workflow to test coverage reports
jsouter Jan 30, 2025
a64778e
Uncomment other workflows and use coco-rb container
jsouter Feb 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adding option of 'elab_args' for elaboration stage. Needs latest coco…
…tb from github.com/jacob720/cocotb
  • Loading branch information
jacob720 authored and jsouter committed Jan 16, 2025
commit 1782370ed64465a0abe15b22d4249ac0b3c09395
8 changes: 8 additions & 0 deletions common/python/cocotb_timing_test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,13 @@ def get_test_args(simulator, build_args, test_name):
return ['--ieee-warnings=off', f'--wave={test_name}.vcd']


def get_elab_args(simulator):
if simulator == 'nvc':
return ['--cover']
else:
return []


def get_plusargs(simulator, test_name):
test_name = test_name.replace(' ', '_').replace('/', '_')
vcd_filename = f'{test_name}.vcd'
Expand Down Expand Up @@ -668,6 +675,7 @@ def test_module(module, test_name=None, simulator='ghdl'):
build_dir=build_dir,
test_args=get_test_args(simulator, build_args,
test_name),
elab_args=get_elab_args(simulator),
plusargs=get_plusargs(simulator, test_name),
extra_env={'module': module,
'test_name': test_name,
Expand Down