<?xml version="1.0" encoding="utf-8"?>
<!--
Cadence Design Systems 


(C) COPYRIGHT, Cadence Design Systems, Inc. 2013
All Rights Reserved
Licensed Materials - Property of Cadence Design Systems

No part of this file may be reproduced, stored in a retrieval system,
or transmitted in any form or by any means electronic, mechanical,
photocopying, recording, or otherwise without prior written permission
of Cadence Design Systems, Inc. 

WARRANTY:
Use all material in this file at your own risk.  Cadence Design Systems
makes no claims about any material contained in this file.
-->
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:dict="http://www.cadence.com/xsd/dictionary"
    xmlns:frml="http://www.cadence.com/xsd/functions"
    xmlns:hdr="http://www.cadence.com/xsd/header"
    xmlns:obj="http://www.cadence.com/xsd/objects"
    xmlns:wcf="http://www.cadence.com/xsd/wcf"
    targetNamespace="http://www.cadence.com/xsd/wholeFile"
    xmlns:cft="http://www.cadence.com/xsd/cft"
    xmlns:l="http://www.cadence.com/xsd/wholeFile"
    elementFormDefault="qualified"
    >

  <xs:import namespace="http://www.cadence.com/xsd/cft" schemaLocation="cft.xsd"/>
  <xs:include schemaLocation="common.xsd"/>
  <xs:import namespace="http://www.cadence.com/xsd/functions" schemaLocation="formulas.xsd"/>
  <xs:import namespace="http://www.cadence.com/xsd/dictionary" schemaLocation="dictionary.xsd"/>
  <xs:import namespace="http://www.cadence.com/xsd/header" schemaLocation="header.xsd"/>
  <xs:import namespace="http://www.cadence.com/xsd/objects" schemaLocation="objects.xsd"/>
  <xs:import namespace="http://www.cadence.com/xsd/wcf" schemaLocation="wcf.xsd"/>

  <xs:annotation>
    <xs:documentation>
      Root element must be one of the root-* elements!
      IMPORTANT: namespace http://www.cadence.com/xsd/dcf MUST be aliased to cft!!! otherwise the software will not process the file
    </xs:documentation>
  </xs:annotation>

  <xs:element name="root-Cadence-Allegro-Worksheet-Customization-File">
    <xs:annotation>
      <xs:documentation>Root element for Worksheet customization file (*.wcfx)</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence maxOccurs="1" minOccurs="1">
        <xs:element ref="l:txt-FileType"/>
        <xs:element ref="l:txt-FormatVersion"/>
        <xs:element ref="l:dir-advancedConstraints" minOccurs="0"/>
        <xs:element ref="l:dir-uiCustomization" minOccurs="0"/>
        <xs:element ref="l:xml-userPropertyDefinitions" minOccurs="0"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:element name="root-Cadence-Allegro-Technology-File" type="l:FullDBFileTp">
    <xs:annotation>
      <xs:documentation>Root element for Human-readable representation of Technology file (*.tcfx)</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="root-Cadence-Allegro-Constraint-File" type="l:FullDBFileTp">
    <xs:annotation>
      <xs:documentation>Root element for Human-readable representation of Design constraints file (*.dcfx)</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element name="root-Cadence-Allegro-Actuals-File">
    <xs:annotation>
      <xs:documentation>Root element for Human-readable representation of Design constraints file (*.dcfx)</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence maxOccurs="1" minOccurs="1">
        <xs:element ref="l:txt-FileType"/>
        <xs:element ref="l:txt-FormatVersion"/>
        <xs:element ref="l:xml-Header"/>
        <xs:element ref="l:dir-objects"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:complexType name="FullDBFileTp">
    <xs:sequence maxOccurs="1" minOccurs="1">
      <xs:element ref="l:txt-FileType"/>
      <xs:element ref="l:txt-FormatVersion"/>
      <xs:element ref="l:xml-Header"/>
      <xs:element ref="l:dir-advancedConstraints" minOccurs="0"/>
      <xs:element ref="l:dir-interfaces" minOccurs="0"/>
      <xs:element ref="l:dir-objects"/>
      <xs:element ref="l:xml-opFlags" minOccurs="0"/>
      <xs:element ref="l:dir-topology" minOccurs="0"/>
      <xs:element ref="l:dir-uiCustomization" minOccurs="0"/>
      <xs:element ref="l:xml-userPropertyDefinitions" minOccurs="0"/>
    </xs:sequence>
  </xs:complexType>

  <xs:element name="xml-userPropertyDefinitions" substitutionGroup="cft:IXml">
    <xs:complexType>
      <xs:complexContent>
        <xs:restriction base="cft:xmlFileTp">
          <xs:sequence>
            <xs:element ref="dict:root"/>
          </xs:sequence>
          <xs:attribute name="Name" use="required" type="xs:string" fixed="userPropertyDefinitions"/>
        </xs:restriction>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="xml-functions" substitutionGroup="cft:IXml">
    <xs:complexType>
      <xs:complexContent>
        <xs:restriction base="cft:xmlFileTp">
          <xs:sequence>
            <xs:element ref="frml:root"/>
          </xs:sequence>
          <xs:attribute name="Name" use="required" type="xs:string" fixed="functions"/>
        </xs:restriction>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="xml-Header" substitutionGroup="cft:IXml">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="hdr:root"/>
      </xs:sequence>
      <xs:attribute name="Name" type="xs:string" fixed="Header"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="dir-objects" substitutionGroup="cft:dir">
    <xs:complexType>
      <xs:complexContent>
        <xs:restriction base="cft:dirType">
          <xs:sequence>
            <xs:choice maxOccurs="unbounded">
              <xs:element ref="l:xml-objects"/>
            </xs:choice>
          </xs:sequence>
        </xs:restriction>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="xml-opFlags" substitutionGroup="cft:IXml">
    <xs:complexType>
      <xs:complexContent>
        <xs:restriction base="cft:xmlFileTp">
          <xs:sequence>
            <xs:element ref="obj:root"/>
          </xs:sequence>
          <xs:attribute name="Name" fixed="opFlags" type="xs:string" use="required"/>
        </xs:restriction>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="dir-advancedConstraints" substitutionGroup="cft:dir">
    <xs:complexType>
      <xs:complexContent>
        <xs:restriction base="cft:dirType">
          <xs:sequence>
            <xs:element ref="l:xml-functions"/>
            <xs:element name="dir">
              <xs:complexType>
                <xs:complexContent>
                  <xs:restriction base="cft:dirType">
                    <xs:sequence>
                      <xs:choice minOccurs="0" maxOccurs="unbounded">
                        <xs:element name="txt" type="cft:txtFileType"/>
                      </xs:choice>
                    </xs:sequence>
                    <xs:attribute name="Name" use="required" type="xs:string" fixed="skill"/>
                  </xs:restriction>
                </xs:complexContent>
              </xs:complexType>
              <xs:unique name="FunctionFileUnique">
                <xs:selector xpath="./l:txt"/>
                <xs:field xpath="@Name"/>
              </xs:unique>
              <xs:keyref name="FunctionFile2NameKeyRef" refer="l:FunctionNameKey">
                <xs:selector xpath="./l:txt"/>
                <xs:field xpath="@Name"/>
              </xs:keyref>
            </xs:element>
          </xs:sequence>
          <xs:attribute name="Name" use="required" type="xs:string" fixed="advancedConstraints"/>
        </xs:restriction>
      </xs:complexContent>
    </xs:complexType>
    <xs:key name="FunctionNameKey">
      <xs:selector xpath="./l:xml-functions/frml:root/frml:function"/>
      <xs:field xpath="@Name"/>
    </xs:key>
  </xs:element>
  <xs:element name="dir-topology">
    <xs:complexType>
      <xs:complexContent>
        <xs:restriction base="cft:dirType">
          <xs:sequence>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
              <xs:element name="txt" type="cft:txtFileType"/>
            </xs:choice>
          </xs:sequence>
          <xs:attribute name="Name" use="required" type="xs:string" fixed="topology"/>
        </xs:restriction>
      </xs:complexContent>
    </xs:complexType>
    <xs:unique name="TopologyIDFileUnique">
      <xs:selector xpath="./txt"/>
      <xs:field xpath="@Name"/>
    </xs:unique>
  </xs:element>
  <xs:element name="txt-FileType" substitutionGroup="cft:txt">
    <xs:complexType>
      <xs:simpleContent>
        <xs:restriction base="cft:txtFileType">
          <xs:enumeration value="System"/>
          <xs:enumeration value="Actual"/>
          <xs:enumeration value="Design"/>
          <xs:enumeration value="Technology"/>
          <xs:enumeration value="InterfaceDefn"/>
          <xs:enumeration value="Customization"/>
          <xs:enumeration value="Basecopy"/>
          <xs:enumeration value="Attach"/>
          <xs:enumeration value="Actuals"/>
          <xs:attribute name="Name" fixed="FileType" use="required" type="xs:string"/>
        </xs:restriction>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="txt-FormatVersion" substitutionGroup="cft:txt">
    <xs:complexType>
      <xs:simpleContent>
        <xs:restriction base="cft:txtFileType">
          <xs:pattern value="[0-9]{1,2}\.[0-9]{1,3}"/>
          <xs:attribute name="Name" fixed="FormatVersion" use="required" type="xs:string"/>
        </xs:restriction>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>
  <xs:element name="dir-uiCustomization">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="xml-uiCustomization" minOccurs="0" maxOccurs="unbounded">
          <xs:complexType>
            <xs:complexContent>
              <xs:restriction base="cft:xmlFileTp">
                <xs:sequence>
                  <xs:element ref="wcf:root"/>
                </xs:sequence>
                <xs:attribute name="Name" type="xs:string" use="required"/>
              </xs:restriction>
            </xs:complexContent>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="Name" type="xs:string" fixed="uiCustomization"/>
    </xs:complexType>
  </xs:element>


  <xs:element name="xml-objects" substitutionGroup="cft:IXml">
    <xs:complexType>
      <xs:complexContent>
        <xs:restriction base="cft:xmlFileTp">
          <xs:sequence>
            <xs:element ref="obj:root"/>
          </xs:sequence>
          <xs:attribute name="Name" type="l:ObjKindEnum" use="required"/>
        </xs:restriction>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <xs:element name="dir-interfaces" substitutionGroup="cft:dir">
    <xs:complexType>
      <xs:complexContent>
        <xs:restriction base="cft:dirType">
          <xs:sequence>
            <xs:choice maxOccurs="unbounded">
              <xs:element name="dir" type="l:SubDesignDirTp"/>
            </xs:choice>
          </xs:sequence>
          <xs:attribute name="Name" type="xs:string" use="required" fixed="interfaces"/>
        </xs:restriction>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>

  <xs:complexType name="SubDesignDirTp">
    <xs:complexContent>
      <xs:restriction base="cft:dirType">
        <xs:sequence>
          <xs:element ref="l:xml-Header"/>
          <xs:element ref="l:dir-objects"/>
        </xs:sequence>
        <xs:attribute name="Name" type="xs:string" use="required"/>
      </xs:restriction>
    </xs:complexContent>
  </xs:complexType>

</xs:schema>
