Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / docs / mmi / SAM-modules.html
<html>
<head>
<title>SPARC Architectural Model: Device Modules</title>
</head>
<body bgcolor="#FFFFFF" LANG="en-US">
<h1> SAM Device Modules</h1>
<p>
This document describes some of the SAM device modules that are available under the SAM source workspace and are included in official SAM package releases.
<p>
<h2>Programming Model</h2>
All modules reside in the SAM workspace under <b>modules</b>.
Each module is in a separate subdirectory. <b>modules/Makefile</b> builds all modules.
<p>
Common code is placed in <b>modules/common</b>.
This code is compiled into each module separately.
This allows for preprocessor macros to be expanded uniquely in each module.
<p>
Create a new module by copying 'sample' (for PCI devices) or 'example' (for any other type) to a new subdirectory.
Do <i>not</i> copy the SCCS subdirectory.
<br>Edit the Makefile to change the module name and list of files.
Make sure the SCCS Id keywords are correct. For example, replace the comment
lines as shown below:
<p>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt>@(#)sample_mod.cc 1.4 04/08/05</tt>
<p>
<br>with
<p>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt>@(#)SAM-modules.html 1.1 05/07/26</tt>
<p>The modules/Makefile will compile any subdirectory with a Makefile in it.
<h2>Modules</h2>
<h5>common</h5>
This is code that is included in all modules. It is not compiled separately.
It provides the following:
<table border=0>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><b>arg.cc</b></td>
<td>&nbsp;&nbsp;utilities for parsing the sysconf command line arguments</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><b>module.cc</b></td>
<td>&nbsp;&nbsp;the base class for all modules</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><b>pci_dev.cc</b></td>
<td>&nbsp;&nbsp;the base class for all PCI devices</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><b>include/*.h</b></td>
<td>&nbsp;&nbsp;header files for common code</td>
</tr>
</table>
<h5>sample</h5>
This is a sample PCI device.
Use it as a template for new PCI devices.
It also has some functionality.
It can be configured to map PCI memory <br>spaces.
It can also run a periodic timer which shows the simulator MIPs rate.
<h5>example</h5>
This is a simple module which can be used as a template for non-device modules.
<br>(Use "sample" for PCI devices.)
<h5>examplec</h5>
This is the same as "example", but it demonstrates how to wrap C code.
<h5>ll</h5>
This is the local loopback filesystem driver.
<h5>parrot</h5>
This is a loopback pseudo device invented by the ASIC system verification
team as a target for testing PCI Express.
It can be a useful example to study because it uses every PCI function there is.
<h5>pci_bus</h5>
This is the PCI Bus model.
It sits between the host bridge (for example, schizo) and PCI devices
(for example, sample).
<h5>pcie_bus</h5>
This is the PCI Express Bus model.
It is the same code as "pci_bus", except that <font size=-1><tt>#ifdef PCI_EXPRESS</tt></font> is true.
<h5>sbbc</h5>
This is a Serengeti controller device.
It is the interface between service processor, console, and Sparc.
<h5>schizo</h5>
This is the Serengeti PCI host bridge.
It supports two independent PCI busses, denoted as leaf A and leaf B.
<br>(Note that each leaf starts with PCI bus 0.
It is a mistake, as in the old Blaze schizo, to think of leaf B as bus 1.)
<h5>serial</h5>
This is the serial device model.
<h5><a href="sgc.html">sgc</a></h5>
This is the Serengeti Console model.
It provides services required for OBP.
<h2>Sample Configuration File</h2>
<pre>
sysconf -p $HOME/blaze/blaze-conf/modules/64opt
sysconf sgc sgc0
#
sysconf schizo schizo24
#
sysconf pci_bus schizo24A bridge=schizo24
#
sysconf pci_bus schizo24B bridge=schizo24
sysconf sample sample24B1 bus=schizo24B dev=1 fun=0 mem32_base=0x08000000 mem32_size=0x2000 -d1
sysconf sbbc sbbc24B bus=schizo24B dev=4 fun=0
#
sysconf schizo schizo25
#
sysconf pci_bus schizo25A bridge=schizo25
sysconf sample sample25A bus=schizo25A dev=1 mem32_base=0x00100000 mem32_size=0x2000 cycle=50000000 -d2
#
sysconf pci_bus schizo25B bridge=schizo25
sysconf sample sample25B2 bus=schizo25B dev=2 fun=0 mem32_base=0x08000000 mem32_size=0x2000 -d1
#
sysconf schizo schizo30
#
sysconf pci_bus schizo30A bridge=schizo30
#
sysconf pci_bus schizo30B bridge=schizo30
sysconf sample sample30B1 bus=schizo30B dev=1 fun=0 mem32_base=0x08000000 mem32_size=0x2000
sysconf sbbc sbbc30B bus=schizo30B dev=4 fun=0
#
##sysconf schizo schizo31
###
##sysconf pci_bus schizo31A bridge=schizo31
###
##sysconf pci_bus schizo31B bridge=schizo31
##sysconf sample sample31B2 bus=schizo31B dev=2 fun=0 mem32_base=0x08000000 mem32_size=0x2000
</pre>
<p>
<hr>
</body>
</html>