Skip to content

Resolve race condition in RohdConnector during interactive debug and SV timeout #15

@mkorbel1

Description

@mkorbel1

There is a block of code in rohd_connector.py which is designed to detect whether there was a timeout waiting for the SystemVerilog simulator to complete a tick:

            if not ready_to_read and self.mid_tick:
                # not necessarily an error, since maybe SV simulator called $finish
                print('Timeout waiting for tick to complete in Simulator!', flush=True)
                self.shutdown()
                break

This code is only necessary because sometimes simulators appear to not properly indicate to cocotb that the simulation has ended, so a graceful shutdown cannot be achieved (cocotb/cocotb#3121).

The race condition appears if ROHD is being interactively debugged and fails to send the entirety of a tick's information (i.e. not ready_to_read) even though a tick is ongoing (i.e. self.mid_tick).

For most users, unless actively debugging ROHD Cosim itself, this will not be often hit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions