<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    @Title: Data keys for the test execution 
    @Description:
      Basic XML Schema for XML files with coverage information.
    @Props:
    @Keywords: XML Schema
    @Copyright: (C) 1989-2015 Lauterbach GmbH, licensed for use with TRACE32(R) only
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    $Id: t32coverage.xsd 12049 2018-02-07 08:05:45Z csax $ -->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">


    <!-- Definition of simple elements -->
    <xs:simpleType name="leaf_srcpath">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

    <xs:simpleType name="leaf_bytesok">
        <xs:restriction base="xs:integer"/>
    </xs:simpleType>

    <xs:simpleType name="leaf_bytes">
        <xs:restriction base="xs:integer"/>
    </xs:simpleType>

    <xs:simpleType name="leaf_never">
        <xs:restriction base="xs:integer"/>
    </xs:simpleType>

    <xs:simpleType name="leaf_onlyexec">
        <xs:restriction base="xs:integer"/>
    </xs:simpleType>

    <xs:simpleType name="leaf_notexec">
        <xs:restriction base="xs:integer"/>
    </xs:simpleType>

    <xs:simpleType name="leaf_nottaken">
        <xs:restriction base="xs:integer"/>
    </xs:simpleType>

    <xs:simpleType name="leaf_taken">
        <xs:restriction base="xs:integer"/>
    </xs:simpleType>

    <xs:simpleType name="leaf_ok">
        <xs:restriction base="xs:integer"/>
    </xs:simpleType>

    <xs:simpleType name="leaf_conds">
        <xs:restriction base="xs:string">
        <xs:pattern value="-|[0-9]+\.[0-9]+%"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="leaf_branches">
        <xs:restriction base="xs:string">
        <xs:pattern value="-|[0-9]+\.[0-9]+%"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="leaf_exec">
        <xs:restriction base="xs:string">
        <xs:pattern value="-|[0-9]+\.[0-9]+%"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="leaf_cov">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

    <xs:simpleType name="leaf_tree">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

    <xs:simpleType name="leaf_addr">
        <xs:restriction base="xs:string">
        <xs:pattern value="none|([A-Z]+(:[0-9A-F]+)*:(0x)*[0-9A-F]+)"/>
        </xs:restriction>
    </xs:simpleType>
    
    <xs:simpleType name="leaf_src">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>     
    
     <xs:simpleType name="leaf_line">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

    <xs:simpleType name="leaf_code">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

    <xs:simpleType name="leaf_label">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

     <xs:simpleType name="leaf_mnemonic">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

    <xs:simpleType name="leaf_comment">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>     
           
    <xs:simpleType name="leaf_hll">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>
    
    <xs:simpleType name="leaf_asm">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>
    
    

    <!-- Definition of attributes -->
    <xs:simpleType name="attr_t32pv">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

    <xs:simpleType name="attr_t32ver">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

    <xs:simpleType name="attr_ts">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>

    <xs:simpleType name="attr_file">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>
    
    <xs:simpleType name="attr_module">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>
    
    <xs:simpleType name="attr_cpu">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>    
    
    
    <!--
        Structure of coverage overviews       
    -->
    <xs:complexType name="node_line">
        <xs:sequence>
            <xs:element name="addrFrom" type="leaf_addr"/>
            <xs:element name="addrTo" type="leaf_addr"/>
            <xs:element name="tree" type="leaf_tree"/>
            <xs:element name="srcpath" type="leaf_srcpath"/>
            <xs:element name="cov" type="leaf_cov"/>
            <xs:element name="exec" type="leaf_exec"/>
            <xs:choice>
                <xs:element name="branches" type="leaf_branches" minOccurs="0"/>
                <xs:element name="conds" type="leaf_conds" minOccurs="0"/>
            </xs:choice>        
            <xs:element name="ok" type="leaf_ok"/>  
            <xs:choice>
                <xs:element name="taken" type="leaf_taken"/>
                <xs:element name="onlyexec" type="leaf_onlyexec"/>
            </xs:choice>
            <xs:choice>
                <xs:element name="nottaken" type="leaf_nottaken"/>
                <xs:element name="notexec" type="leaf_notexec"/>
            </xs:choice>
            <xs:element name="never" type="leaf_never" minOccurs="0"/>  
            <xs:element name="bytes" type="leaf_bytes"/>
            <xs:element name="bytesok" type="leaf_bytesok"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="node_function">
        <xs:sequence>
            <xs:element name="addrFrom" type="leaf_addr"/>
            <xs:element name="addrTo" type="leaf_addr"/>
            <xs:element name="tree" type="leaf_tree"/>
            <xs:element name="cov" type="leaf_cov"/>
            <xs:element name="exec" type="leaf_exec"/>
            <xs:choice>
                <xs:element name="branches" type="leaf_branches" minOccurs="0"/>
                <xs:element name="conds" type="leaf_conds" minOccurs="0"/>
            </xs:choice>
            <xs:element name="ok" type="leaf_ok"/>  
            <xs:choice>
                <xs:element name="taken" type="leaf_taken"/>
                <xs:element name="onlyexec" type="leaf_onlyexec"/>
            </xs:choice>
            <xs:choice>
                <xs:element name="nottaken" type="leaf_nottaken"/>
                <xs:element name="notexec" type="leaf_notexec"/>
            </xs:choice>
            <xs:element name="never" type="leaf_never" minOccurs="0"/>  
            <xs:element name="bytes" type="leaf_bytes"/>
            <xs:element name="bytesok" type="leaf_bytesok"/>
            <xs:element name="line" type="node_line" minOccurs="0" maxOccurs="unbounded"/>  
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="node_module">
        <xs:sequence>
            <xs:element name="addrFrom" type="leaf_addr"/>
            <xs:element name="addrTo" type="leaf_addr" minOccurs="0"/>
            <xs:element name="tree" type="leaf_tree"/>
            <xs:element name="cov" type="leaf_cov" minOccurs="0"/>
            <xs:element name="exec" type="leaf_exec" minOccurs="0"/>
            <xs:choice>
                <xs:element name="branches" type="leaf_branches" minOccurs="0"/>
                <xs:element name="conds" type="leaf_conds" minOccurs="0"/>
            </xs:choice>        
            <xs:element name="ok" type="leaf_ok" minOccurs="0"/>
            <xs:choice>
                <xs:element name="taken" type="leaf_taken" minOccurs="0"/>
                <xs:element name="onlyexec" type="leaf_onlyexec" minOccurs="0"/>
            </xs:choice>
            <xs:choice>
                <xs:element name="nottaken" type="leaf_nottaken" minOccurs="0"/>
                <xs:element name="notexec" type="leaf_notexec" minOccurs="0"/>
            </xs:choice>
            <xs:element name="never" type="leaf_never" minOccurs="0"/>
            <xs:element name="bytes" type="leaf_bytes" minOccurs="0"/>
            <xs:element name="bytesok" type="leaf_bytesok" minOccurs="0"/>
            <xs:element name="function" type="node_function" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="node_total">
        <xs:sequence>
            <xs:element name="cov" type="leaf_cov" minOccurs="1" maxOccurs="1"/>
            <xs:element name="exec" type="leaf_exec" minOccurs="1" maxOccurs="1"/>
            <xs:choice>
                <xs:element name="branches" type="leaf_branches" minOccurs="0"/>
                <xs:element name="conds" type="leaf_conds" minOccurs="0"/>
            </xs:choice>
            <xs:element name="ok" type="leaf_ok" minOccurs="0" maxOccurs="1"/>
            <xs:choice>
                <xs:element name="taken" type="leaf_taken" minOccurs="0" maxOccurs="1"/>
                <xs:element name="onlyexec" type="leaf_onlyexec" minOccurs="0" maxOccurs="1"/>
            </xs:choice>
            <xs:choice>
                <xs:element name="nottaken" type="leaf_nottaken" minOccurs="0" maxOccurs="1"/>
                <xs:element name="notexec" type="leaf_notexec" minOccurs="0" maxOccurs="1"/>
            </xs:choice>
            <xs:element name="never" type="leaf_never" minOccurs="0"/>
            <xs:element name="bytes" type="leaf_bytes" minOccurs="0" maxOccurs="1"/>
            <xs:element name="bytesok" type="leaf_bytesok" minOccurs="0" maxOccurs="1"/>
        </xs:sequence>        
    </xs:complexType>

    <xs:complexType name="node_COVerage.EXPORT.ListLine">
        <xs:sequence>
            <xs:element name="module" type="node_module" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="total" type="node_total" minOccurs="1" maxOccurs="1"/>
        </xs:sequence>
        <xs:attribute name="ts" type="attr_ts" use="required"/>
        <xs:attribute name="t32ver" type="attr_t32pv" use="required"/>
        <xs:attribute name="t32pv" type="attr_t32pv" use="required"/>   
    </xs:complexType>

    <xs:complexType name="node_COVerage.EXPORT.ListFunc">
        <xs:sequence>
            <xs:element name="module" type="node_module" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="total" type="node_total" minOccurs="1" maxOccurs="1"/>
        </xs:sequence>
        <xs:attribute name="ts" type="attr_ts" use="required"/>
        <xs:attribute name="t32ver" type="attr_t32pv" use="required"/>
        <xs:attribute name="t32pv" type="attr_t32pv" use="required"/>   
    </xs:complexType>

    <xs:complexType name="node_COVerage.EXPORT.ListModule">
        <xs:sequence>
            <xs:element name="module" type="node_module" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="total" type="node_total" minOccurs="1" maxOccurs="1"/>
        </xs:sequence>
        <xs:attribute name="ts" type="attr_ts" use="required"/>
        <xs:attribute name="t32ver" type="attr_t32pv" use="required"/>
        <xs:attribute name="t32pv" type="attr_t32pv" use="required"/>   
    </xs:complexType>

    <xs:complexType name="node_coverage">
        <xs:choice maxOccurs="unbounded">
            <xs:element name="COVerage.EXPORT.ListLine" type="node_COVerage.EXPORT.ListLine" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="COVerage.EXPORT.ListFunc" type="node_COVerage.EXPORT.ListFunc" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="COVerage.EXPORT.ListModule" type="node_COVerage.EXPORT.ListModule" minOccurs="0" maxOccurs="unbounded"/>
        </xs:choice>
    </xs:complexType>
    

    <!--
        Structure of coverage for HLL and ASM listings       
    -->   
    <xs:complexType name="node_hll">
        <xs:sequence>
            <xs:element name="cov" type="leaf_cov" minOccurs="0"/>
            <xs:element name="line" type="leaf_line" minOccurs="0"/>
            <xs:element name="src" type="leaf_src"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="node_asm">
        <xs:sequence>
            <xs:element name="cov" type="leaf_cov" minOccurs="0"/>
            <xs:element name="addr" type="leaf_addr"/>
            <xs:element name="code" type="leaf_code"/>
            <xs:element name="label" type="leaf_label" minOccurs="0"/>
            <xs:element name="mnemonic" type="leaf_mnemonic"/>
            <xs:element name="comment" type="leaf_comment" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
       
    <xs:complexType name="node_mixed">
        <xs:sequence>
            <xs:element name="hll" type="node_hll" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="asm" type="node_asm" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>   
        <xs:attribute name="module" type="attr_module"/>
    </xs:complexType>    
    
    <xs:complexType name="node_List.EXPORT">
        <xs:sequence>
            <xs:element name="mixed" type="node_mixed" minOccurs="1" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="ts" type="attr_ts" use="required"/>
        <xs:attribute name="t32ver" type="attr_t32pv" use="required"/>
        <xs:attribute name="t32pv" type="attr_t32pv" use="required"/>
        <xs:attribute name="cpu" type="attr_cpu" use="required"/> 
    </xs:complexType>

    <xs:complexType name="node_listing">
        <xs:sequence>
            <xs:element name="List.EXPORT" type="node_List.EXPORT" minOccurs="1" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    

    <!--
        Structure of global root node         
    -->
    <xs:group name="node_sections">
        <xs:choice>
             <xs:element name="coverage" type="node_coverage" minOccurs="0" maxOccurs="unbounded"/>
             <xs:element name="listing" type="node_listing" minOccurs="0" maxOccurs="unbounded"/>
        </xs:choice>
    </xs:group>

    <xs:complexType name="node_TRACE32">
        <xs:group ref="node_sections" minOccurs="1" maxOccurs="unbounded"/>
        <xs:attribute name="file" type="attr_file" use="required"/> 
    </xs:complexType>

    <xs:element name="TRACE32" type="node_TRACE32"/>

</xs:schema> 