2.5.3. Controlling simulation from behaviors

Note

See also Special-purpose behaviors.

Any LISA+ behavior can use the following function calls to detect and control the simulation environment:

simRun()

Start the simulation. This might be used from, for example, the gui_callback() function.

simHalt()

Stop the simulation. This might be used if, for example, an error is detected.

Note

The simulation does not stop immediately. The actual shutdown might be as much as 200 cycles after the call to simHalt().

simShutdown()

Stop the simulation and exit.

simIsRunning()

Returns true if the simulation is currently running. This might be used from, for example, the gui_callback() function.

cadiRefresh()

Notifies attached debuggers to refresh their state. The parameter is an int that combines one or more of the CADI_REFRESH_REASON_X flags (see the CADITypes.h file for details). For example:

behavior myBehavior()
{
  // do something that changes model state when in stop mode
  // ...
  cadiRefresh(eslapi::CADI_REFRESH_REASON_REGISTERS
             | eslapi::CADI_REFRESH_REASON_OTHER);
}

Caution

Do not call this function from behaviors that can be triggered as a response for refresh such as, for example, a register read. If called from the behavior, an endless loop results.

This function only has effect if the simulation is stopped.

Copyright © 2007-2009 ARM Limited. All rights reserved.ARM DUI 0372G
Non-Confidential