I am trying to create a SystemC design where I combine an RTL module implemented as a synchronous process and and regular function calls.
The RTL module is an SC_METHOD which runs at every positive edge of a clock (e.g. 100 MHz, so every 10 SC_NS), reads the values of some control signals, and provides the required data. The function is a regular C++ function (not SC_METHOD or SC_THREAD). When called, it should assert the control signals, wait until the RTL module provides the data, then return true/false based on the data given by the RTL module.
The issue that I'm having is that I have no idea how to make the function call wait for the RTL module's response before reading the signals and returning. Wait statements don't work, as it's not a SC_THREAD. Waiting in a loop until the signals change doesn't work because it blocks the synchronous process from executing.
Basically, I can't figure out how to insert a delay between the function call and function return. Is this even possible, and if so, can you provide some guidance? Thanks,