2.7.1 About disconnecting from a target

This section describes how to disconnect from a target.

The primary way to disconnect from a simulation is to use the Release() method of those target-side classes that are involved in the connection mechanism. After this method is called, the caller must ensure that it does not start any additional interaction with the connection. The call performs the appropriate actions on the target-side such as:

  • Informing other connected callers.
  • If the simulation is to be shut down, destroying objects that are no longer used.

Caution:

The caller must not explicitly destroy any target-side objects. This is the task of the target implementation and must be triggered through Release() calls wherever appropriate.

Using only Release() calls is acceptable for simple scenarios such as unique and direct connections between caller and target. For more sophisticated scenarios, however, a well-coordinated disconnection is required. The CADISimulationCallback class provides two callbacks that are essential for such a disconnection:

simShutdown()
the simulation signals a request for a clean shutdown.
simKilled()
the simulation signals a hard shutdown. It was not able to be kept alive until a clean shutdown could be performed. After this call is received, the caller must ensure that it does not access the CADISimulation or associated CADI objects.

Using these callbacks in combination with the Release() method in the target enables establishing well-defined procedures for disconnection from a CADI simulation.

Non-ConfidentialPDF file icon PDF version100963_0200_03_en
Copyright © 2014–2018 Arm Limited or its affiliates. All rights reserved.