Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / docs / mmi / intro.html
CommitLineData
920dae64
AT
1<html>
2
3<head>
4 <title>SPARC Architectural Model: Device and Utility API</title>
5</head>
6
7<body bgcolor="#FFFFFF" LANG="en-US">
8
9<h2>Introduction</h2>
10This document describes the MMI (Module Model Interface) device-model API
11for the SPARC Architectural Model (SAM). A SAM device model is built as a
12shared library (loadable module) which is dynamically loaded into SAM during
13initialization.
14<p>
15The <tt>sysconf</tt> directives in the input configuration file specify the device module, instance name and its associated properties.
16<p>
17API function and type names are prefixed with <tt>mmi_</tt>.
18<p>
19<h4>Attaching Modules</h4>
20
21<li> A device-model is typically contained within a shared object (.so file). A shared object typically has only one visible module that plugs into SAM.
22Internally within the device model, there can be a hierarchy of components (for example, Niagara ethernet module).</li><br>
23
24 <li>An <i>instance</i> is what actually represents a device in SAM. There are generally multiple instances of a given device module.</li><br>
25
26 <li> <a href="sysconf.html">The <tt><b>sysconf</b></tt> directive</a>
27 <p><ul>
28 <tt>sysconf</tt> directives are specified in the simulation configuration file. Each sysconf line specifies
29the module to be loaded if necessary, and the name of the device node to be instantiated. To properly instantiate the device node,
30SAM calls the instance creator function registered from within the module.
31</ul> </li>
32</ul>
33
34<h4> The <tt>mmi_instance_t</tt> handle</h4>
35
36Each instance can be referred to using an opaque <tt>mmi_instance_t</tt> handle. This includes code referring to its own instance (eg to register certain callback functions) as well as other instances (eg to get an exported interface)
37
38<h4>Threading Model </h4>
39
40SAM can be run in multi-threaded mode. It is recommended that module developers for SAM
41assume that simulated SPARCv9 CPUs may be bound to separate host threads, running on different
42processors on the host machine running the simulation.
43<p>
44A strand, however, is never simulated by more than one simulation thread, and
45when a strand performs a callback to the module it may be assumed that strand
46execution is stopped at the point of callback.
47
48<h4>Module to Module Interaction </h4>
49
50Modules may be loaded in any order (as specified in the sysconf file). In some cases, modules may be unloaded at any time.
51The SAM sysconf mechanism does not allow for device modules to be unloaded but the older <tt>ldm</tt> UI command does allow this.
52<p>
53Each module is notified when another module changes status
54(<a href="mmi_register_config_cb.html">mmi_register_config_cb</a>).
55<p>
56Modules may call each other by getting pointers to their interfaces
57(<a href=" mmi_get_interface.html">mmi_get_interface</a>).
58When a module is unloaded, other modules should receive the corresponding config change notification
59and remove their interface pointers to the unloaded module.
60
61<p>
62<hr>
63</body>
64
65</html>