15 Modeling with C 16.1 Modeling with Python (pyobj)
Model Builder User's Guide  /  II Device Modeling  / 

16 Modeling with Python

This section describes modeling devices with Python. There are currently three ways of modelling with Python:

  1. Use the pyobj module (ConfObject class), which is documented in the Modeling with Python (pyobj) section.
  2. Use the confclass class, which is documented in the Modeling with Python (confclass) section.
  3. Using the Simics API directly from Python. This method is not recommended, but just mentioned as a possibility. An example is available in the empty-device-python module.

In the choice between pyobj and confclass:

This is a short high-level functionality comparison between pyobj and confclass:

Aspect/Propertypyobjconfclass
Documentationgoodfair, but lacks api-documentation
Attributessupportedsupported
Portssupportedsupported
Class attributessupportednot supported
Eventssupportednot supported
Inheritancesupportedsupported
Info and Status commandsautomatically addednot automatically added, but can be added with decorators (see 16.2.8)

Information on how to port a pyobj class to confclass, see section 16.3.

15 Modeling with C 16.1 Modeling with Python (pyobj)