op_hla_tick()
Note: Requires High-Level Architecture functionality
Abstract
Performs a “tick” operation, allowing RTI processing without advancing simulation time.
Syntax
op_hla_tick ()
| Argument | Type | Description |
|---|---|---|
| no arguments |
Return Type
No return value.
Example
[Inside an event that wants to wait until some RTI events are received]
// state or global variable updated by esys forced interrupts
synch_flag = 0;
strcpy (synch_name, “wait”);
rti_amb->registerFederationSynchronizationPoint (sync_name, OPC_NIL);
// Flag set to 1 in Synch_Point_Registration esys event
while (synch_flag == 0) op_hla_tick ();
// Flag set to 2 in Synch_Point_Announce esys event
while (synch_flag == 1) op_hla_tick ();
rti_amb->synchronizationPointAchieved (synch_name);
// Flag set to 3 in Federation_Synchronized esys event
while (synch_flag == 2) op_hla_tick ();
[HLA esys process model (which will handle the forced Riverbed Modeler interrupts created when the RTI events are received)]
Hla_Cosim_Info * info_ptr;
int interface = op_intrpt_esys_interface ();
if (op_esys_interface_value_get (interface, (char *)&info_ptr, 0)
== OPC_ESYS_SUCCESS)
{
switch (info_ptr->type_get ())
{
case Hla_Cosim_Info::Synch_Point_Registration:
{
Hla_Cosim_Info_Sync_Point_Registration * reg_ptr =
(Hla_Cosim_Info_Sync_Point_Registration *)info_ptr;
if (strcmp (reg_ptr->label(), synch_name) == 0)
synch_flag = 1;
break;
}
// Same approach for Synch_Point_Announce
// Same approach for Federation_Synchronized
}
}
Details
The “tick” operation provides an RTI with CPU time in which to do its event management. A call to op_hla_tick() gives the RTI the processing time it needs to handle incoming RTI events (potentially triggering forced Riverbed Modeler interrupts as the events are processed), but keeps the simulation in the current Riverbed Modeler event.
Purpose
Provides a way to give processing time to the RTI without advancing simulation time. This function can be used by process models that need to block time advance in the Riverbed Modeler RTI while waiting for some input event, such as discovering an RTI object created by another federate or waiting on an HLA synchronization point.
Errors
- None.
Reference
- None.