5.21.7 Simulation instantiation and discovery event sources

The Simulation instantiation and discovery API supports the following event sources.

Event source IRIS_SIMULATION_SHUTDOWN_ENTER

This global event is generated when the simulation is about to enter its shutdown procedure. This is the earliest point at which instances can know that the simulation is about to exit. This event source has no fields.

If the event receiver activated this event source with syncEc=True, the shutdown procedure is not entered until the ec_FOO() function returns. This enables clients to perform last-minute operations, for example reading the final state of registers.

Note:

The global instance might impose a global timeout for progressing with the shutdown sequence, to handle stalled or blocked clients. The shutdown sequence should only be paused for a few milliseconds, and as a guideline, not for more than 1000ms.

Instances must not unregister themselves from the instance registry using instanceRegistry_unregisterInstance() in response to this event, because other instances might want to continue to communicate with them during the shutdown phase.

If this event was requested with syncEc=True, the requesting instance should not make any Iris calls after returning from ec_FOO(). This is possible in a race-free way. If this event was requested with syncEc=False, the requesting instance should not make any Iris calls after this event was received. This is inherently racy. Any Iris calls made while or after this event was received with syncEc=False might return E_unknown_instance_id.

For in-process instances, the C++ IrisInterface pointers of the instance and of the global instance stay valid and can be used even when returning from this event.

Event source IRIS_SIMULATION_SHUTDOWN_LEAVE

This global event is generated when the simulation shutdown procedure is complete. After receiving this event, instances cannot communicate with each other. This event source has no fields.

This event is issued only after all instances that requested IRIS_SIMULATION_SHUTDOWN_ENTER with syncEc=True have returned from their ec_FOO() callback.

Instances can consider themselves to have been unregistered from the instance registry when they receive this event, so they should not call instanceRegistry_unregisterInstance() after receiving it. They are guaranteed not to receive any more Iris calls or responses after receiving it.

This event can be used by instances to destroy themselves. The C++ IrisInterface pointers must no longer be used after returning from IrisInterface::irisHandleMessage(). This is always possible race-free.

Non-ConfidentialPDF file icon PDF version101196_0100_03_en
Copyright © 2018, 2019 Arm Limited or its affiliates. All rights reserved.