1.2 Connecting to and running a model

This example shows how to connect to a model, load an application onto it, and run the model.

An existing model can be connected to by creating a new NetworkModel, passing the IP address or hostname and port number.

The model is comprised of multiple targets which represent the components in the system. A Target object can be obtained by calling Model.get_target(name) on an instantiated model, passing it the name of the target. A convenience method Model.get_cpus() is also provided, which returns a list of Target objects for all targets for which componentType == 'Core', or that have the executesSoftware flag set.

This example assumes that the model has started an Iris server locally, listening to port 7100:

import iris.debug
model = iris.debug.NetworkModel("localhost",7100)
cpu = model.get_cpus()[0]
cpu.load_application("/path/to/application.axf")
model.run()

The code creates two variables:

model
A Model object which represents the entire simulated system. It is composed of various targets including cores and memories. The model object can be used to access these targets and to start, stop, and step the model.
cpu
A Target object, in this case the first CPU in the model. It can be used to read and write the memory and registers of the core and to set and clear breakpoints.

For documentation of the operations that can be performed on models and targets, see 3.2 Model and 3.3 Target.

Note:

For example scripts that demonstrate how to use iris.debug, see $PVLIB_HOME/Iris/Python/examples/.
Non-ConfidentialPDF file icon PDF version101421_0100_01_en
Copyright © 2018, 2019 Arm Limited or its affiliates. All rights reserved.