Class AsyncSimLoop
Defined in File sim_loop.h
Inheritance Relationships
Base Type
public AbstractSimLoop(Class AbstractSimLoop)
Class Documentation
-
class AsyncSimLoop : public AbstractSimLoop
Asynchronous simulation loop It is designed when simulation need to interact with code running in another thread. Examples: debugger, GUI, sockets.
The simulation library in itself is not thread-safe. The synchronization is done by using the methods start_transaction and end_transaction which must surround any call to any interface to the simulated device. The effect is to block the simulation loop between cycles so that the state stays consistent throughout the simulated MCU.
Public Functions
-
void set_fast_mode(bool fast)
Set the simulation running mode: false=real-time, true=fast.
-
void run()
Runs the simulation loop indefinitely. It returns when the loop is killed using loop_kill() or the device has stopped definitively. The simulation will start in the Stopped state so loop_continue() must be called.
-
bool start_transaction()
Start a transaction, which designates any interaction with any interface of the simulated device. This will pause the simulation between cycles, to ensure the consistency of the device model data.
-
void end_transaction()
End a transaction and let the simulation resume.
-
void loop_continue()
Resumes the loop when it’s in the Stopped state. The loop is initialised in the Stopped state so this must be called at the start of a simulation. Must be surrounded by start_transaction() / end_transaction()
-
void loop_pause()
Stop the simulation. Must be surrounded by start_transaction() / end_transaction()
-
void loop_step()
Instruct the device model to execute one instruction and stop. Must be surrounded by start_transaction() / end_transaction()
-
void loop_kill()
Stop definitively the simulation. run() will exit. Must be surrounded by start_transaction() / end_transaction()
-
void set_fast_mode(bool fast)