fusesocotb
fusesocotb copied to clipboard
Running single cocotb test case
Would it be possible to run a single test case from a module ?
In CoCoTb, a python module can contain multiple test cases. Debugging one such a test case seems impossible, without splitting a single file into multiple shorter ones, which will recompile and restart the simulator when in CI/CT over and over again.
The --testcase=<> option does not seems to work and is assumed icarus related.
vvp -n -M. -M cocotb-config --lib-dir -m cocotb-config --lib-name vpi icarus axis_send_packet_0 -fst +testcase=test_busy_cfg2 +vcd=1
Would it be possible to add a "cocotb_testcase" option in the flow_options ?
targets:
default:
flow: sim
flow_options:
tool : icarus
cocotb_module : tc01
cocotb_testcase : test_busy_cfg2
What seems supported:
export TESTCASE=test_busy_cfg2
poetry run fusesoc --verbose run axis_send_packet --MSG_LEN=11 --MSG_STR=hello_world --vcd
Adding a cocotb_testcase parameter is doable, but in the meantime you can do like you do already or run with TESTCASE=test_busy_cfg2 fusesoc run ... (which is what I do typically to have it all in one command)
Okay. Thanks for your answer.
Closing this now. If you still have a need for a cocotb_testcase option, feel free to file a new bug here https://github.com/olofk/edalize/issues