SIM_break_message — stop the simulation
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
void
SIM_break_message(const char *msg);
import simics
simics.SIM_break_message(...)
Display the reason why Simics will stop simulation.
This is similar to SIM_break_simulation, with the difference that it doesn’t actually break the simulation. It can be used by code that wants to display a break message and stop the simulation by some other means.
Cell Context
SIM_break_simulation — stop the simulation
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
void
SIM_break_simulation(const char *msg);
import simics
simics.SIM_break_simulation(...)
Ask Simics to stop the simulation as soon as possible, displaying the supplied message.
Simics will normally stop before the next instruction is executed. If this function is called when an instruction has started executing, and the instruction can be aborted, it will rewind to before the instruction. This might leave the simulation in a state where some repeatable part of the instruction is already executed.
Cell Context
SIM_continue — run the simulation
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
pc_step_t
SIM_continue(int64 steps);
import simics
simics.SIM_continue(...)
Run the simulation. In typical usage with steps being 0, the simulation will run forward until it is stopped, either by a breakpoint, internal event, or through the user interface.
With a non-zero steps, Simics will make sure that at least one processor runs steps steps and then stop the simulation. As with steps being 0, the function can also return early if other break criteria are met.
In order to properly control when simulation stops in time, it is advisable to use step or cycle breakpoints on one or more objects.
The function returns non-zero if the simulation was started, and 0 otherwise.
SimExc_General Thrown if the simulation could not be started. Check the exception message for more information.
Global Context
SIM_current_clock — return current clock
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
conf_object_t *
SIM_current_clock();
import simics
simics.SIM_current_clock(...)
Returns the clock (an object implementing the cycle interface) that is driving the simulation in the current cell and current thread. In Global Context, NULL is returned.
Please note that typically model code would use SIM_object_clock to obtain the clock used for posting events. Another alternative for models is to get the initiator of a memory transaction from the memory transaction itself with the functions like SIM_transaction_initiator and SIM_get_mem_op_initiator and use that for event posting.
The currently running clock returned by this function can be used, for example, to post events right after the current instruction finishes. But, as it is pointed out above, there are other alternatives for getting a clock for posting events. The use of this function is generally discouraged.
Cell Context
SIM_object_clock, SIM_transaction_initiator, SIM_get_mem_op_initiator
SIM_simics_is_running — check if simulation is running
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
bool
SIM_simics_is_running();
import simics
simics.SIM_simics_is_running(...)
Returns true if the simulation is running, e.g. if it has been started using SIM_continue, or false otherwise. It also returns true when the simulation is reversing.
Cell Context