<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
  more contributor license agreements.  See the NOTICE file distributed
  with this work for additional information regarding copyright ownership.
  Accellera licenses this file to you under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with the
  License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  implied.  See the License for the specific language governing
  permissions and limitations under the License.
-->
<xs:schema xmlns:ipxact="http://www.accellera.org/XMLSchema/IPXACT/1685-2022" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.accellera.org/XMLSchema/IPXACT/1685-2022" elementFormDefault="qualified">
	<xs:include schemaLocation="simpleTypes.xsd"/>
	<xs:include schemaLocation="autoConfigure.xsd"/>
	<xs:include schemaLocation="commonStructures.xsd"/>
	<xs:element name="defaultValue" type="ipxact:qualifiedExpression">
		<xs:annotation>
			<xs:documentation>Default value for a wire port.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:element name="clockDriver">
		<xs:annotation>
			<xs:documentation>Describes a driven clock port. </xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:complexContent>
				<xs:extension base="ipxact:clockDriverType">
					<xs:attribute name="clockName" type="xs:string">
						<xs:annotation>
							<xs:documentation>Indicates the name of the cllock. If not specified the name is assumed to be the name of the containing port. </xs:documentation>
						</xs:annotation>
					</xs:attribute>
				</xs:extension>
			</xs:complexContent>
		</xs:complexType>
	</xs:element>
	<xs:element name="singleShotDriver">
		<xs:annotation>
			<xs:documentation>Describes a driven one-shot port.</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="singleShotOffset">
					<xs:annotation>
						<xs:documentation>Time in nanoseconds until start of one-shot.</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:complexContent>
							<xs:extension base="ipxact:realExpression">
								<xs:attribute name="units" type="ipxact:delayValueUnitType" use="optional" default="ns"/>
							</xs:extension>
						</xs:complexContent>
					</xs:complexType>
				</xs:element>
				<xs:element name="singleShotValue">
					<xs:annotation>
						<xs:documentation>Value of port after first  edge of one-shot.</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:complexContent>
							<xs:extension base="ipxact:unsignedBitVectorExpression"/>
						</xs:complexContent>
					</xs:complexType>
				</xs:element>
				<xs:element name="singleShotDuration">
					<xs:annotation>
						<xs:documentation>Duration in nanoseconds of the one shot.</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:complexContent>
							<xs:extension base="ipxact:realExpression">
								<xs:attribute name="units" type="ipxact:delayValueUnitType" use="optional" default="ns"/>
							</xs:extension>
						</xs:complexContent>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="requiresDriver" default="false">
		<xs:annotation>
			<xs:documentation>Specifies if a port requires a driver. Default is false. The attribute driverType can further qualify what type of driver is required. Undefined behaviour if direction is not input or inout. Driver type any indicates that any unspecified type of driver must be connected</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:simpleContent>
				<xs:extension base="xs:boolean">
					<xs:attribute name="driverType" use="optional" default="any">
						<xs:annotation>
							<xs:documentation>Defines the type of driver that is required. The default is any type of driver. The 2 other options are a clock type driver or a singleshot type driver.</xs:documentation>
						</xs:annotation>
						<xs:simpleType>
							<xs:restriction base="xs:token">
								<xs:enumeration value="clock"/>
								<xs:enumeration value="singleShot"/>
								<xs:enumeration value="any"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:attribute>
				</xs:extension>
			</xs:simpleContent>
		</xs:complexType>
	</xs:element>
	<xs:complexType name="driverType">
		<xs:annotation>
			<xs:documentation>Wire port driver type.</xs:documentation>
		</xs:annotation>
		<xs:sequence minOccurs="0">
			<xs:element ref="ipxact:range" minOccurs="0"/>
			<xs:element name="viewRef" minOccurs="0" maxOccurs="unbounded">
				<xs:annotation>
					<xs:documentation>A reference to a view in the file for which this type applies.</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="xs:NMTOKEN">
							<xs:attributeGroup ref="ipxact:id.att"/>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
			<xs:choice>
				<xs:element ref="ipxact:defaultValue"/>
				<xs:element ref="ipxact:clockDriver"/>
				<xs:element ref="ipxact:singleShotDriver"/>
			</xs:choice>
		</xs:sequence>
		<xs:attributeGroup ref="ipxact:id.att"/>
	</xs:complexType>
	<xs:element name="drivers">
		<xs:annotation>
			<xs:documentation>Container for wire port driver elements.</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="ipxact:driver" maxOccurs="unbounded">
					<xs:annotation>
						<xs:documentation>Wire port driver element. If no range is specified, default value applies to the entire range.</xs:documentation>
					</xs:annotation>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="driver" type="ipxact:driverType">
		<xs:annotation>
			<xs:documentation>Wire port driver element.</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:complexType name="clockDriverType">
		<xs:sequence>
			<xs:element name="clockPeriod">
				<xs:annotation>
					<xs:documentation>Clock period in units defined by the units attribute. Default is nanoseconds.</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="ipxact:realExpression">
							<xs:attribute name="units" type="ipxact:delayValueUnitType" use="optional" default="ns"/>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
			<xs:element name="clockPulseOffset">
				<xs:annotation>
					<xs:documentation>Time until first pulse. Units are defined by the units attribute. Default is nanoseconds.</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="ipxact:realExpression">
							<xs:attribute name="units" type="ipxact:delayValueUnitType" use="optional" default="ns"/>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
			<xs:element name="clockPulseValue" type="ipxact:unsignedBitExpression">
				<xs:annotation>
					<xs:documentation>Value of port after first clock edge.</xs:documentation>
				</xs:annotation>
			</xs:element>
			<xs:element name="clockPulseDuration">
				<xs:annotation>
					<xs:documentation>Duration of first state in cycle. Units are defined by the units attribute. Default is nanoseconds.</xs:documentation>
				</xs:annotation>
				<xs:complexType>
					<xs:simpleContent>
						<xs:extension base="ipxact:realExpression">
							<xs:attribute name="units" type="ipxact:delayValueUnitType" use="optional" default="ns"/>
						</xs:extension>
					</xs:simpleContent>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
		<xs:attributeGroup ref="ipxact:id.att"/>
	</xs:complexType>
	<xs:element name="otherClockDriver">
		<xs:annotation>
			<xs:documentation>Describes a clock not directly associated with an input port. The clockSource attribute can be used on these clocks to indicate the actual clock source (e.g. an output port of a clock generator cell).</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:complexContent>
				<xs:extension base="ipxact:clockDriverType">
					<xs:attribute name="clockName" type="xs:Name" use="required">
						<xs:annotation>
							<xs:documentation>Indicates the name of the clock.</xs:documentation>
						</xs:annotation>
					</xs:attribute>
					<xs:attribute name="clockSource" type="xs:string" use="optional">
						<xs:annotation>
							<xs:documentation>Indicates the name of the actual clock source (e.g. an output pin of a clock generator cell).</xs:documentation>
						</xs:annotation>
					</xs:attribute>
				</xs:extension>
			</xs:complexContent>
		</xs:complexType>
	</xs:element>
</xs:schema>
