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

Python Runner starts tests directly (not waiting for GUI) #3850

Open
AmutioAlex opened this issue Apr 19, 2024 · 1 comment
Open

Python Runner starts tests directly (not waiting for GUI) #3850

AmutioAlex opened this issue Apr 19, 2024 · 1 comment
Labels
category:codebase:project-automation (makefiles and Python runner) relating to project automation code type:feature new or enhanced functionality

Comments

@AmutioAlex
Copy link

AmutioAlex commented Apr 19, 2024

I have been using cocotb for a while and decided to switch to the Python runner approach instead of using a Makefile.

The problem that I found is that, when I use Xcelium as a simulator and open the GUI, the test starts right away and does not wait to be started from the GUI. This is the current code that I run directly, not using pytest:

runner = get_runner("xcelium")
runner.build(verilog_sources    = [...],
             hdl_toplevel       = ...,
             always             = True)
runner.test(hdl_toplevel_lang   = "verilog",
            hdl_toplevel        = ...,
            test_module         = ...,
            gui                 = True)

Note that the GUI is opened, thus the gui flag works correctly. The problem is that before the GUI loads, the test has already started. It is not being triggered by the user.

I took a look at the source code of runner.py for the version that I am using (cocotb 1.8.1) and I am guessing that the main culprit here are lines 1002 and 1003, which always include the following options to the xrun command: -input @run and -input @exit.

I first thought that this was being fixed already for the next release, but the problem persists on the runner.py file of the master branch. Lines 1352 to 1360 state that in every case the test is run right away.

I think it would be wise for the runner to behave like the Makefile in this sense: if the GUI is started then the user has to trigger it.

Further information of my setup in case it is needed:

  • cocotb 1.8.1
  • Red Hat Enterprise 7.9 64-bit
  • Xcelium 21.09.s003
  • Python 3.10.1
@AmutioAlex AmutioAlex changed the title Python Runner starts tests directly (no waiting for GUI) Python Runner starts tests directly (not waiting for GUI) Apr 19, 2024
@ktbarrett ktbarrett added type:feature new or enhanced functionality category:codebase:project-automation (makefiles and Python runner) relating to project automation code labels Apr 19, 2024
@ktbarrett
Copy link
Member

Sounds appropriate to me, feel free to provide a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:codebase:project-automation (makefiles and Python runner) relating to project automation code type:feature new or enhanced functionality
Projects
None yet
Development

No branches or pull requests

2 participants