Skip to content

RegisterSystem20XMLSchema

Adam edited this page Apr 10, 2012 · 1 revision

%INCLUDE{"RegisterSystem20Contents"}%

The (proposed) schema or the register system is found below. Before accepting this schema, the registers and constants associated with the current reference router design (with all requisite modules) should be expressed using this schema. The current state of this conversion can be found on the XML examples page.

Open issues

  • Currently no support for multiple instances of a module in a project. Need to provide ability to express associations between instances.
  • Need to be able to classify registers as hardware, software or counter.

XML schema

Last updated: %INCLUDE{"#time_r_" PARAM1="$percntINCLUDE{\"REVISIONTIMESTAMP\"}$percnt"}%

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.NetFPGA.org/NF2_register_system" xmlns:tns="http://www.NetFPGA.org/NF2_register_system" elementFormDefault="qualified">



    <complexType name="Constant">
      <sequence>
        <element name="name" type="string" maxOccurs="1"
<pre>          minOccurs="1">
        </element>
        <element name="description" type="string" maxOccurs="1"
          minOccurs="0">
        </element>
        <element name="width" type="tns:Expression" maxOccurs="1"
          minOccurs="0">
        </element>
        <element name="value" type="tns:Expression" maxOccurs="1"
          minOccurs="1">
        </element>
      </sequence>
    </complextype>
</pre>

    <complexType name="SimpleType">
      <complexContent>
        <extension base="tns:Type">
          <sequence>
            <element name="width" type="tns:Expression" maxOccurs="1"
<pre>              minOccurs="1">
            </element>
            <element name="bitmask" type="tns:BitmaskType"
              maxOccurs="unbounded" minOccurs="0">
            </element>
          </sequence>
</pre>

        </extension>
      </complexcontent>
    </complextype>





    <complexType name="BitmaskType">
      <complexContent>
        <extension base="tns:Type">
           <choice maxOccurs="1" minOccurs="1">
             <element name="pos" type="int" maxOccurs="1"
<pre>               minOccurs="1">
             </element>
             <sequence>
               <element name="pos_lo" type="int"
                 maxOccurs="1" minOccurs="1">
               </element>
               <element name="pos_hi" type="int"
                 maxOccurs="1" minOccurs="1">
               </element>
             </sequence>
           </choice>
        </extension>
      </complexcontent>
    </complextype>
</pre>


    <complexType name="CompoundType">
      <complexContent>
        <extension base="tns:Type">
          <sequence>
            <element name="field" type="tns:Field" maxOccurs="unbounded" minOccurs="1"></element>
          </sequence>

        </extension>
      </complexcontent>
    </complextype>

    <complexType name="Field">
      <sequence>
        <element name="name" type="string" maxOccurs="1"
<pre>          minOccurs="1">
        </element>
            <element name="description" type="string" maxOccurs="1" minOccurs="0"></element>
            <choice maxOccurs="1" minOccurs="1">
          <element name="type" type="string" maxOccurs="1"
            minOccurs="1">
          </element>
          <element name="width" type="tns:IntOrConstant"
            maxOccurs="1" minOccurs="1">
          </element>
        </choice>
      </sequence>
    </complextype>
</pre>

    <complexType name="Type">
      <sequence>
        <element name="name" type="string" maxOccurs="1"
<pre>          minOccurs="1">
        </element>
        <element name="description" type="string" maxOccurs="1" minOccurs="0"></element>
      </sequence>
    </complextype>
</pre>




    <complexType name="TableType">
      <complexContent>
        <extension base="tns:Type">
          <sequence>
            <element name="depth" type="int" maxOccurs="1" minOccurs="1"></element>
            <choice maxOccurs="1" minOccurs="1">
                        <element name="entry_type" type="string" maxOccurs="1" minOccurs="1"></element>
                        <element name="width" type="tns:IntOrConstant" maxOccurs="1" minOccurs="1"></element>
            </choice>
          </sequence>
          <attribute name="table_type">
            <simpleType>
              <restriction base="string">
                <enumeration value="indirect"></enumeration>
              </restriction>
            </simpletype>
          </attribute>
        </extension>
      </complexcontent>
    </complextype>





    <complexType name="Register">
      <sequence>
        <element name="name" type="string" maxOccurs="1"
<pre>          minOccurs="1">
        </element>
        <element name="description" type="string" maxOccurs="1"
          minOccurs="0">
        </element>
        <choice maxOccurs="1" minOccurs="0">
          <element name="type" type="string" maxOccurs="1"
            minOccurs="1">
          </element>
                <element name="width" type="tns:IntOrConstant" maxOccurs="1" minOccurs="1"></element>
            </choice>
      </sequence>
</pre>

    </complextype>

    <complexType name="RegisterList">
      <sequence>
        <element name="register" type="tns:Register"
<pre>          maxOccurs="unbounded" minOccurs="0">
        </element>
        <element name="register_group" type="tns:RegisterGroup"
          maxOccurs="unbounded" minOccurs="0">
        </element>
      </sequence>
    </complextype>
</pre>

    <complexType name="Module">
      <sequence>
        <element name="name" type="string" maxOccurs="1"
<pre>          minOccurs="1">
        </element>
        <element name="abbrev" type="string" maxOccurs="1"
          minOccurs="1">
        </element>
        <element name="location" maxOccurs="1" minOccurs="1">
          <simpleType>
            <restriction base="string">
              <enumeration value="core"></enumeration>
              <enumeration value="udp"></enumeration>
            </restriction>
          </simpletype>
        </element>
        <element name="description" type="string" maxOccurs="1"
          minOccurs="0">
        </element>
        <element name="blocksize" type="string" maxOccurs="1"
          minOccurs="0">
        </element>
        <choice>
          <element name="preferred_base" type="tns:Address"
            maxOccurs="1" minOccurs="0">
          </element>
          <element name="force_base" type="tns:Address"
            maxOccurs="1" minOccurs="0">
          </element>
        </choice>
        <element name="registers" type="tns:RegisterList" maxOccurs="1" minOccurs="0"></element>
        <element name="constants" type="tns:ConstantList" maxOccurs="1" minOccurs="0"></element>
        <element name="types" type="tns:TypeList" maxOccurs="1" minOccurs="0"></element>
        <element name="use_modules" type="string" maxOccurs="1" minOccurs="0"></element>
      </sequence>
    </complextype>
</pre>

    <complexType name="RegisterGroup">
      <sequence>
<pre>      	<element name="name" type="string" maxOccurs="1"
      		minOccurs="1">
      	</element>
      	<element name="instances" type="tns:Expression"
      		maxOccurs="1" minOccurs="1">
      	</element>
            <element name="group_size" type="tns:Expression" maxOccurs="1" minOccurs="0"></element>
            <element name="register" type="tns:Register"
      		maxOccurs="unbounded" minOccurs="0">
      	</element>
      </sequence>
    </complextype>
</pre>


    <complexType name="Project">
      <sequence>
        <element name="name" type="string" maxOccurs="1"
<pre>          minOccurs="1">
        </element>
        <element name="description" type="string" maxOccurs="1"
          minOccurs="0">
        </element>
</pre>

        <element name="constants" type="tns:ConstantList" maxOccurs="1" minOccurs="0"></element>
        <element name="types" type="tns:TypeList" maxOccurs="1" minOccurs="0"></element>
            <element name="use_modules" type="string" maxOccurs="1" minOccurs="0">
        </element>
            <element name="local_modules" type="tns:ModuleList" maxOccurs="1" minOccurs="0"></element>
            <element name="memalloc" type="tns:MemoryAllocation" maxOccurs="1" minOccurs="1">
        </element>
        </sequence>
    </complextype>

    <attribute name="path" type="string"></attribute>




    <simpleType name="Address">
      <restriction base="tns:hex"></restriction>
    </simpletype>

    <complexType name="ConstantList">
      <sequence>
        <element name="constant" type="tns:Constant" maxOccurs="unbounded" minOccurs="0"></element>
      </sequence>
    </complextype>

    <complexType name="TypeList">
      <sequence>
        <element name="type" type="tns:Type" maxOccurs="unbounded" minOccurs="0"></element>
      </sequence>
    </complextype>

    <element name="module" type="tns:Module"></element>

    <element name="project" type="tns:Project"></element>

    <complexType name="Global">
      <sequence>
            <element name="constants" type="tns:ConstantList"></element>
            <element name="types" type="tns:TypeList"></element>
      </sequence>
    </complextype>


    <element name="global" type="tns:Global"></element>

    <simpleType name="IntOrConstant">
      <union memberTypes="string int"></union></simpletype>


    <simpleType name="hex">
      <restriction base="string">
        <pattern value="0[xX][0-9a-fA-F]+"></pattern>
      </restriction>
    </simpletype>

    <simpleType name="intOrHex">
      <union memberTypes="int tns:hex"></union></simpletype>

    <simpleType name="Expression">
      <restriction base="string"></restriction>
    </simpletype>

    <simpleType name="MemoryLayout">
      <restriction base="string">
        <enumeration value="reference"></enumeration>
        <enumeration value="freeform"></enumeration>
        <enumeration value="cpci"></enumeration>
      </restriction>
    </simpletype>

    <complexType name="MemoryAllocation">
<pre>    	<sequence>
    		<element name="group" type="tns:MemoryAllocationGroup"
    			maxOccurs="unbounded" minOccurs="0">
    		</element>
    	</sequence>
    	<attribute name="layout" type="tns:MemoryLayout" use="required"></attribute>
    </complextype>
</pre>

    <complexType name="MemoryAllocationGroup">
<pre>    	<sequence>
    		<element name="instance" type="tns:ModuleInstance"
    			maxOccurs="unbounded" minOccurs="0">
    		</element>
    	</sequence>
    	<attribute name="name" type="string" use="required"></attribute>
    </complextype>
</pre>

    <complexType name="ModuleInstance">
      <attribute name="name" type="string" use="required"></attribute>
      <attribute name="count" type="string" use="optional"></attribute>
      <attribute name="base" type="tns:Address" use="optional"></attribute>
    </complextype>

    <complexType name="ModuleList">
      <sequence>
        <element name="module" type="tns:Module"
<pre>          maxOccurs="unbounded" minOccurs="0">
        </element>
      </sequence>
    </complextype>
</pre>
</schema>
Clone this wiki locally