<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2006 sp2 U (http://www.altova.com) by Michael Brouhard (Mentor Graphics) -->
<!--
// Description : busDefinition.xsd
// Author : SPIRIT Schema Working Group
// Version:     $Revision: 319 $
// Date:        $Date: 2006-02-22 19:19:05 +0200 (Wed, 22 Feb 2006) $
// Tag:         $Name$
//
// Copyright (c) 2005 SPIRIT.  All rights reserved.
// www.spiritconsortium.com
//
// THIS WORK FORMS PART OF A SPIRIT CONSORTIUM SPECIFICATION.
// THIS WORK CONTAINS TRADE SECRETS AND PROPRIETARY INFORMATION
// WHICH IS THE EXCLUSIVE PROPERTY OF INDIVIDUAL MEMBERS OF THE
// SPIRIT CONSORTIUM. USE OF THESE MATERIALS ARE GOVERNED BY
// THE LEGAL TERMS AND CONDITIONS OUTLINED IN THE SPIRIT
// SPECIFICATION DISCLAIMER AVAILABLE FROM
// www.spiritconsortium.org
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:spirit="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.4" targetNamespace="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.4" elementFormDefault="qualified" attributeFormDefault="qualified">
	<xs:include schemaLocation="identifier.xsd"/>
	<xs:include schemaLocation="component.xsd"/>
	<xs:include schemaLocation="port.xsd"/>
	<xs:include schemaLocation="commonStructures.xsd"/>
	<xs:complexType name="nameMapType">
		<xs:sequence>
			<xs:element name="componentRef" type="spirit:libraryRefType">
				<xs:annotation>
					<xs:documentation>References a component to be found in an external library.  The name attribute gives the name of the component and the version attribute speicifies which version of the component to use.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="componentElementName" type="xs:NMTOKEN"/>
		</xs:sequence>
	</xs:complexType>
	<xs:element name="macroComponent">
		<xs:annotation>
			<xs:documentation>define a component to group multiple related components</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:group ref="spirit:versionedIdentifier"/>
				<xs:element name="relatedObjects">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="componentRef" type="spirit:libraryRefType" maxOccurs="unbounded">
								<xs:annotation>
									<xs:documentation>References a component to be found in an external library.  The name attribute gives the name of the component and the version attribute speicifies which version of the component to use.</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="macroComponentRef" type="spirit:libraryRefType" minOccurs="0" maxOccurs="unbounded">
								<xs:annotation>
									<xs:documentation>References a macroComponent to be found in an external library.  The name attribute gives the name of the macroComponent and the version attribute speicifies which version of the macroComponent to use.</xs:documentation>
								</xs:annotation>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="constraints" minOccurs="0">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="busInterfaces" minOccurs="0">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="macroComponentBusInterface" minOccurs="0" maxOccurs="unbounded">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="nameMap" type="spirit:nameMapType" maxOccurs="unbounded"/>
													<xs:element name="busInterface">
														<xs:complexType>
															<xs:sequence>
																<xs:element name="name" type="xs:NMTOKEN">
																	<xs:annotation>
																		<xs:documentation>Uniquely names this bus interface.</xs:documentation>
																	</xs:annotation>
																</xs:element>
																<xs:element name="compatibleBus" type="spirit:libraryRefType" maxOccurs="unbounded">
																	<xs:annotation>
																		<xs:documentation>The bus type of this interface.  Refers to a bus description using vendor, library and name attributes.</xs:documentation>
																	</xs:annotation>
																</xs:element>
																<xs:choice>
																	<xs:element name="master" minOccurs="0">
																		<xs:annotation>
																			<xs:documentation>If this element is present, the bus interface can serve as a master.  This element encapsulates additional information related to its role as master.</xs:documentation>
																		</xs:annotation>
																		<xs:complexType>
																			<xs:sequence>
																				<xs:element name="addressSpaceRef" minOccurs="0">
																					<xs:annotation>
																						<xs:documentation>If this master connects to an addressable bus, this element references the address space  it maps to.  It has an addressSpaceRef attribute which is an addrSpaceID key ref.</xs:documentation>
																					</xs:annotation>
																					<xs:complexType>
																						<xs:complexContent>
																							<xs:extension base="spirit:addrSpaceRefType">
																								<xs:sequence>
																									<xs:annotation>
																										<xs:documentation>If master's mapping to the physical address space is not zero based, baseAddress and bitOffset elements may be used to indicate the offsets.</xs:documentation>
																									</xs:annotation>
																									<xs:element ref="spirit:baseAddress" minOccurs="0"/>
																									<xs:element ref="spirit:bitOffset" minOccurs="0"/>
																								</xs:sequence>
																							</xs:extension>
																						</xs:complexContent>
																					</xs:complexType>
																				</xs:element>
																			</xs:sequence>
																		</xs:complexType>
																	</xs:element>
																	<xs:element name="slave" minOccurs="0">
																		<xs:annotation>
																			<xs:documentation>If this element is present, the bus interface can serve as a slave.</xs:documentation>
																		</xs:annotation>
																		<xs:complexType>
																			<xs:sequence>
																				<xs:element ref="spirit:memoryMapRef" minOccurs="0"/>
																				<xs:element name="bridge" minOccurs="0" maxOccurs="unbounded">
																					<xs:annotation>
																						<xs:documentation>If this element is present, it indicates that the bus interface provides a bridge to another master bus interface on the same component.  It has a masterRef attribute which contains the name of the other bus interface.  It also has an opaque attribute to indicate that the bus bridge is opaque.

Any slave interface can bridge to multiple master interfaces, and multiple slave interfaces can bridge to the same master interface.</xs:documentation>
																					</xs:annotation>
																					<xs:complexType>
																						<xs:attribute name="masterRef" type="xs:Name" use="required">
																							<xs:annotation>
																								<xs:documentation>The name of the master bus interface to which this interface bridges.</xs:documentation>
																							</xs:annotation>
																						</xs:attribute>
																						<xs:attribute name="opaque" type="xs:boolean">
																							<xs:annotation>
																								<xs:documentation>If true (default) then this bridge is opaque; the whole of the address range is mappeed by the bridge and there are no gaps.</xs:documentation>
																							</xs:annotation>
																						</xs:attribute>
																					</xs:complexType>
																				</xs:element>
																				<xs:element name="fileSetRefGroup" minOccurs="0" maxOccurs="unbounded">
																					<xs:annotation>
																						<xs:documentation>This reference is used to point the filesets that are associated with this slave port.

Depending on the slave port function, there may be completely different software drivers associated with the different ports. </xs:documentation>
																					</xs:annotation>
																					<xs:complexType>
																						<xs:sequence>
																							<xs:element name="group" type="xs:Name" minOccurs="0"/>
																							<xs:element ref="spirit:fileSetRef" minOccurs="0" maxOccurs="unbounded"/>
																						</xs:sequence>
																					</xs:complexType>
																				</xs:element>
																			</xs:sequence>
																		</xs:complexType>
																	</xs:element>
																	<xs:element name="system" minOccurs="0">
																		<xs:annotation>
																			<xs:documentation>If this element is present, the bus interface is a system interface, neither master nor slave, with a specific function on the bus.</xs:documentation>
																		</xs:annotation>
																		<xs:complexType>
																			<xs:sequence>
																				<xs:element ref="spirit:group"/>
																			</xs:sequence>
																		</xs:complexType>
																	</xs:element>
																	<xs:element name="mirroredSlave" minOccurs="0">
																		<xs:annotation>
																			<xs:documentation>If this element is present, the bus interface represents a mirrored slave interface. All directional constraints on signals are reversed relative to the specification in the bus definition.</xs:documentation>
																		</xs:annotation>
																		<xs:complexType>
																			<xs:sequence minOccurs="0">
																				<xs:element name="baseAddresses" minOccurs="0">
																					<xs:annotation>
																						<xs:documentation>Represents a set of remap base addresses.</xs:documentation>
																					</xs:annotation>
																					<xs:complexType>
																						<xs:sequence>
																							<xs:element name="remapAddress" maxOccurs="unbounded">
																								<xs:annotation>
																									<xs:documentation>Base of an address block. The state attribute indicates the name of the remap state for which this address is valid.</xs:documentation>
																								</xs:annotation>
																								<xs:complexType>
																									<xs:simpleContent>
																										<xs:extension base="spirit:spiritNumberType">
																											<xs:attributeGroup ref="spirit:long.att"/>
																											<xs:attribute ref="spirit:prompt" default="Base Address:"/>
																											<xs:attribute name="state" type="xs:string">
																												<xs:annotation>
																													<xs:documentation>Name of the state in which this remapped address range is valid</xs:documentation>
																												</xs:annotation>
																											</xs:attribute>
																										</xs:extension>
																									</xs:simpleContent>
																								</xs:complexType>
																							</xs:element>
																							<xs:element name="range">
																								<xs:annotation>
																									<xs:documentation>The address range of mirrored slave. </xs:documentation>
																								</xs:annotation>
																								<xs:complexType>
																									<xs:simpleContent>
																										<xs:extension base="spirit:spiritNumberType">
																											<xs:attributeGroup ref="spirit:long.prompt.att"/>
																										</xs:extension>
																									</xs:simpleContent>
																								</xs:complexType>
																							</xs:element>
																						</xs:sequence>
																					</xs:complexType>
																				</xs:element>
																			</xs:sequence>
																		</xs:complexType>
																	</xs:element>
																	<xs:element name="mirroredMaster" minOccurs="0">
																		<xs:annotation>
																			<xs:documentation>If this element is present, the bus interface represents a mirrored master interface. All directional constraints on signals are reversed relative to the specification in the bus definition.</xs:documentation>
																		</xs:annotation>
																		<xs:complexType/>
																	</xs:element>
																	<xs:element name="mirroredSystem" minOccurs="0">
																		<xs:annotation>
																			<xs:documentation>If this element is present, the bus interface represents a mirrored system interface. All directional constraints on signals are reversed relative to the specification in the bus definition.</xs:documentation>
																		</xs:annotation>
																		<xs:complexType>
																			<xs:sequence>
																				<xs:element ref="spirit:group"/>
																			</xs:sequence>
																		</xs:complexType>
																	</xs:element>
																	<xs:element name="monitor" minOccurs="0">
																		<xs:annotation>
																			<xs:documentation>Indicates that this is a (passive) monitor interface. All of the signals in the interface must be inputs. The type of interface to be monitored is specified with the required interfaceType attribute. The spirit:group element must be specified if monitoring a system interface.</xs:documentation>
																		</xs:annotation>
																		<xs:complexType>
																			<xs:sequence>
																				<xs:element ref="spirit:group" minOccurs="0"/>
																			</xs:sequence>
																			<xs:attribute name="interfaceType" use="required">
																				<xs:simpleType>
																					<xs:restriction base="xs:token">
																						<xs:enumeration value="master"/>
																						<xs:enumeration value="slave"/>
																						<xs:enumeration value="system"/>
																						<xs:enumeration value="mirroredMaster"/>
																						<xs:enumeration value="mirroredSlave"/>
																						<xs:enumeration value="mirroredSystem"/>
																					</xs:restriction>
																				</xs:simpleType>
																			</xs:attribute>
																		</xs:complexType>
																	</xs:element>
																</xs:choice>
																<xs:element name="connection" default="explicit" minOccurs="0">
																	<xs:annotation>
																		<xs:documentation>Directs how a bus interface is connected when the component is added to a design already containing a bus owner.

Default behavior is "explicit".</xs:documentation>
																	</xs:annotation>
																	<xs:simpleType>
																		<xs:restriction base="xs:token">
																			<xs:enumeration value="required">
																				<xs:annotation>
																					<xs:documentation>A bus instance is automatically chosen and the connection is made.  Component addition fails if a suitable bus is not available.</xs:documentation>
																				</xs:annotation>
																			</xs:enumeration>
																			<xs:enumeration value="explicit">
																				<xs:annotation>
																					<xs:documentation>Connection of this bus interface is not made until the user explicitly requests connection.</xs:documentation>
																				</xs:annotation>
																			</xs:enumeration>
																		</xs:restriction>
																	</xs:simpleType>
																</xs:element>
																<xs:element name="index" minOccurs="0">
																	<xs:annotation>
																		<xs:documentation>Master or slave index of this bus interface's connection on a bus.  Only used on indexed buses.</xs:documentation>
																	</xs:annotation>
																	<xs:complexType>
																		<xs:simpleContent>
																			<xs:extension base="xs:nonNegativeInteger">
																				<xs:attributeGroup ref="spirit:long.att"/>
																				<xs:attribute ref="spirit:prompt" default="Connection Index:"/>
																			</xs:extension>
																		</xs:simpleContent>
																	</xs:complexType>
																</xs:element>
																<xs:element name="busInterfaceParameters" minOccurs="0">
																	<xs:annotation>
																		<xs:documentation>Container element for parameters associated with a bus interface.</xs:documentation>
																	</xs:annotation>
																	<xs:complexType>
																		<xs:sequence>
																			<xs:element name="busInterfaceParameter" maxOccurs="unbounded">
																				<xs:annotation>
																					<xs:documentation>Name/value pair defining a parameter on this bus interface. The name must match the name of a busDefParameter on the associated bus definition. Also, the interface type of this bus interface must be allowed as specified in the busDefParameter.</xs:documentation>
																				</xs:annotation>
																				<xs:complexType>
																					<xs:simpleContent>
																						<xs:extension base="xs:string">
																							<xs:attribute name="name" type="xs:string" use="required"/>
																							<xs:attributeGroup ref="spirit:parameterConfiguration"/>
																						</xs:extension>
																					</xs:simpleContent>
																				</xs:complexType>
																			</xs:element>
																		</xs:sequence>
																	</xs:complexType>
																</xs:element>
																<xs:element ref="spirit:vendorExtensions" minOccurs="0"/>
															</xs:sequence>
														</xs:complexType>
													</xs:element>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="ports" minOccurs="0">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="macroComponentPort" minOccurs="0" maxOccurs="unbounded">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="nameMap" type="spirit:nameMapType" maxOccurs="unbounded"/>
													<xs:element name="port">
														<xs:complexType>
															<xs:complexContent>
																<xs:extension base="spirit:portType"/>
															</xs:complexContent>
														</xs:complexType>
													</xs:element>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="memoryMaps" minOccurs="0">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="macroComponentMemoryMap" minOccurs="0" maxOccurs="unbounded">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="nameMap" type="spirit:nameMapType" maxOccurs="unbounded"/>
													<xs:element name="memoryMap">
														<xs:complexType>
															<xs:complexContent>
																<xs:extension base="spirit:memoryMapType"/>
															</xs:complexContent>
														</xs:complexType>
													</xs:element>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="parameters" minOccurs="0">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="macroComponentParameter" minOccurs="0" maxOccurs="unbounded">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="nameMap" type="spirit:nameMapType" maxOccurs="unbounded"/>
													<xs:element name="parameter" type="spirit:nameValuePairType"/>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
							<xs:element name="generators" minOccurs="0">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="macroComponentGnerator" minOccurs="0" maxOccurs="unbounded">
											<xs:complexType>
												<xs:sequence>
													<xs:element name="nameMap" type="spirit:nameMapType" maxOccurs="unbounded"/>
													<xs:element name="generator" type="spirit:instanceGeneratorType"/>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
								</xs:complexType>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element ref="spirit:configurators" minOccurs="0"/>
  			<xs:element name="description" type="xs:string" minOccurs="0">
	  			<xs:annotation>
		  			<xs:documentation>String for describing this macro component to users</xs:documentation>
			  	</xs:annotation>
			  </xs:element>			
				<xs:element ref="spirit:vendorExtensions" minOccurs="0"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>
