Previous - Up - Next

12.2   Component Module

A component module is a common Simics module containing the implementation of one or more related component collections. The sun-components module, for example, contains components for several different machine architectures from Sun Microsystems. Each architecture is represented by one component collection.

12.2.1   Component Module Files

A component module source directory may contain several <name>_components.py files, each implementing a component collection; one Makefile; and one gcommands.py file.

The Makefile looks the same for all component modules, it simply lists all components that are part of the module.

The gcommands.py is loaded when Simics starts. It is responsible for registering all component collections defined by the module using the register_components() function. A gcommands.py file may have the following contents:

from components import register_components

register_components('ppc440gp-components')
This example registers the ppc440gp-components component collection and creates the import-ppc440gp-components command that must be run by the user to make any commands related to this collection available in the frontend.


Note: If the component collection does not exist, i.e., there is no .py file with the name given to register_components(), there will be no error message. The reason for this is that a component module may be distributed without some of the collections it define. A successful registration of a collection can be verified by checking that the import- command was created.

Previous - Up - Next