Skip to content
Discussion options

You must be logged in to vote

You should be able to accomplish this with cocotb.external and cocotb.function decorators.

result = await cocotb.external(shared_software(sequential_axi_master))

where any functions called in shared_software that need to "yield" time to the simulator are decorated with cocotb.function:

@cocotb.function
async def write(address, data):
    ...

A caveat with this approach:
cocotb.external runs the function in a separate thread each time it is called. If you need to run lots of external functions there will be overhead from the thread creation and management.

Replies: 3 comments 10 replies

Comment options

You must be logged in to vote
9 replies
@ktbarrett
Comment options

@marlonjames
Comment options

Answer selected by mvsoliveira
@ktbarrett
Comment options

@themperek
Comment options

@ktbarrett
Comment options

@timothyscherer
Comment options

Comment options

You must be logged in to vote
1 reply
@lucasmossrfteq
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
category:hardware-in-the-loop relating to real-life hardware (HIL)
7 participants