fusesocotb icon indicating copy to clipboard operation
fusesocotb copied to clipboard

Running single cocotb test case

Open stdefeber opened this issue 1 year ago • 2 comments

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

stdefeber avatar Jun 17 '24 12:06 stdefeber

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)

olofk avatar Jun 17 '24 18:06 olofk

Okay. Thanks for your answer.

stdefeber avatar Jun 19 '24 06:06 stdefeber

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

olofk avatar Aug 22 '24 11:08 olofk