]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
Add an imcomplete but valid Padiwa SpiEntity
authorAndreas Neiser <neiser@kph.uni-mainz.de>
Tue, 20 May 2014 09:36:46 +0000 (11:36 +0200)
committerAndreas Neiser <neiser@kph.uni-mainz.de>
Wed, 21 May 2014 13:30:09 +0000 (15:30 +0200)
xml-db/database/Padiwa.xml [new file with mode: 0644]
xml-db/schema/SpiEntity.xsd [new file with mode: 0644]

diff --git a/xml-db/database/Padiwa.xml b/xml-db/database/Padiwa.xml
new file mode 100644 (file)
index 0000000..661190a
--- /dev/null
@@ -0,0 +1,343 @@
+<?xml version="1.0"  encoding="utf-8" ?>
+<SpiEntity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+              xsi:noNamespaceSchemaLocation="../schema/SpiEntity.xsd"
+              name="Padiwa"
+              address="0000"
+              >
+  <description>Padiwa discriminator front-end</description>
+
+  
+
+
+  <!-- Note that the 16bit address attribute is interpreted as
+       follows:
+       15-12: not used
+       11-04: Padiwa Select   
+       03-00: Channel/Register
+  -->
+
+  <group name="Status" purpose="status" address="0100" mode="r">
+    <memory name="UniqueID" address="0000" size="4" bits="16">
+      <description>Read the unique identifier of the onboard temperature sensor</description> 
+      <field name="UniqueID" start="0" bits="64" format="hex" />
+    </memory>
+    <register name="Temperature" address="0004">
+      <description>Board Temperature</description>
+      <field name="Temperature" start="0" bits="16" format="float" unit="°C" scale=".0625"/>
+    </register>
+  </group>
+       
+  <group name="Control" purpose="config" address="0200" mode="rw">
+    <register name="InputEnable" address="0000">
+      <description>Input Enable, one bit per input. 0: enable (default), 1: disable</description>
+      <field name="InputEnable" start="0" bits="16" format="bitmask" />
+    </register>
+    <register name="InputStatus" address="0001" mode="r" purpose="status">
+      <description>Input Status, one bit per input, represents the current status of the pin</description>
+      <field name="InputStatus" start="0" bits="16" format="bitmask" />
+    </register>
+    <register name="LED" address="0002">
+      <description>Manage the onboard LEDs indicating channel activity</description>
+      <field name="LEDStatus" start="0" bits="4" format="bitmask">
+        <description>Bit 0-3: LED in alphabetical order. Read: LED status. Write: Override LED status.</description>
+      </field>
+      <field name="LEDDisableOverride" start="4" bits="1" format="boolean">
+        <description>Disable the LED override. LEDs are off by default due to influence on PMTs</description>
+      </field>
+    </register>
+  </group>
+  
+  
+  <!--<group name="BasicStatus" purpose="status" address="0080"  mode="r" continuous="false">
+    <group name="PortStatus"
+           address="0000"  size="4"  purpose="config">
+      <description>Current status of each port of the hub on each channel.</description>
+      <register name="PortStatusChannels"
+                address="0000"  repeat="4" purpose="status" >
+        <description>Current status of each port of the hub on each channel.</description>
+        <field  name="PortStatusChannels"
+             start="0"   bits="17"   purpose="status"  format="bitmask"  noflag="true">
+        </field>
+      </register>
+    </group>
+
+    <register name="ActivePorts" address="0004"  purpose="status" >
+      <description>Current status of each physical port of the hub. '1': active, '0': not connected</description>
+      <field  name="ActivePorts"
+            start="0"   bits="13"  purpose="status"  format="bitmask">
+      </field>
+    </register>    
+
+    <register name="UplinkPorts" address="0005"  purpose="status" >
+      <description>Ports that are currently configured as uplinks</description>
+      <field  name="UplinkPorts"
+            start="0"   bits="13"  purpose="status"  format="bitmask">
+      </field>
+    </register>    
+    <register name="DownlinkPorts" address="0006"  purpose="status" >
+      <description>Ports that are currently configured as downlinks</description>
+      <field  name="DownlinkPorts"
+            start="0"   bits="13"  purpose="status"  format="bitmask">
+      </field>
+    </register>    
+    
+    <register name="IpuState" address="0007" purpose="status">
+      <description>Current status of the event data handling logic</description>
+      <field name="State" start="0" bits="4" format="enum">
+        <description>Status of the central Ipu handling state machine</description>
+        <enumItem value="0">Idle</enumItem>
+        <enumItem value="1">Waiting for reply</enumItem>
+        <enumItem value="2">Waiting for HDR</enumItem>
+        <enumItem value="3">Checking Information</enumItem>
+        <enumItem value="4">Calculating length</enumItem>
+        <enumItem value="5">Wait for DHDR</enumItem>
+        <enumItem value="6">Checking DHDR</enumItem>
+        <enumItem value="7">Sending data</enumItem>
+        <enumItem value="8">Switching endpoint</enumItem>
+        <enumItem value="9">Sending padding</enumItem>
+        <enumItem value="A">Sending TRM</enumItem>
+        <enumItem value="B">Wait for init</enumItem>
+        <enumItem value="F">default</enumItem>
+      </field>
+      <field name="PacketCounter" start="10" bits="3" format="hex" >
+        <description>Current status of the internal packet counter</description>
+      </field>
+      <field name="DhdrMemoryPointer" start="13" bits="3" format="hex" >
+        <description>Read pointer to DHDR memory</description>
+      </field>
+         
+    </register>       
+    <group name="TimeoutChannels"
+           address="0008"  size="4"  purpose="status">
+      <description>Timeout registers. If a bit is set, there was a timeout on the corresponding port.</description>
+      <register name="Timeouts" address="0000" repeat="4" purpose="status">
+        <description>Timeout registers. If a bit is set, there was a timeout on the corresponding port.</description>
+        <field name="CurrentTimeout" start="0" bits="13" errorflag="true" format="bitmask">
+          <description>Timeout registers. If a bit is set, there was a timeout on the corresponding port during the last transfer.</description>
+        </field>
+        <field name="TimeoutExtra" start="16" bits="13" errorflag="true" format="bitmask">
+          <description>For old hubs: Counts the number of timeouts seen. For MDC and TRB3 Hubs: Ports currently disable due to a timeout.</description>
+        </field>
+      </register>
+    </group>
+    <group name="AckWaitingChannels"
+           address="000C"  size="4"  purpose="status">
+      <description>Bits set, when the corresponding port is waiting for an acknowledge on the corresponding channel.</description>
+      <register name="AckWaiting" address="0000" repeat="4" purpose="status">
+        <description>One bit for each port, is set if the corresponding port is currently waiting for an acknowledge</description>
+        <field name="AckWaiting" start="0" bits="13" format="bitmask"  invertflag="true">
+        </field>
+      </register>
+    </group>    
+    
+    <register name="LinkErrorStatus" address="0010" purpose="status">
+      <description>One bit for each port, is set if the corresponding port is currently waiting for an acknowledge</description>
+      <field name="LinkErrorStatus" start="0" bits="13" invertflag="true" format="bitmask">
+      </field>
+    </register>
+
+    <register name="LogicStatus1" address="0018"  purpose="status">
+      <description>Status of the hub logic. 16 Bit per channel</description>
+      <field name="LogicStatusChan0" start="0" bits="16"  format="hex">
+        <description>Status of the hub logic on channel 0</description>
+      </field>
+      <field name="LogicStatusChan1" start="16" bits="16"  format="hex">
+        <description>Status of the hub logic on channel 1</description>
+      </field>
+    </register>
+    <register name="LogicStatus2" address="0019"  purpose="status">
+      <description>Status of the hub logic. 16 Bit per channel</description>
+      <field name="LogicStatusChan3" start="16" bits="16"  format="hex">
+        <description>Status of the hub logic on channel 3</description>
+      </field>
+    </register>
+    
+    <register name="IpuMismatch" address="001f"  purpose="status">
+      <description>Mismatch of trigger number, information or code on the data channel. One bit for each port.</description>
+      <field name="IpuMismatch" start="0" bits="16"  format="bitmask" errorflag="true" >
+      </field>
+    </register>
+
+    <group name="ErrorBitsChannels"
+           address="0020"  size="4"  purpose="status">
+      <description>Errorbits for all channels, after combination of individual ports</description>
+      <register name="ErrorBits" address="0000" repeat="4" purpose="status">
+        <description>Errorbits on the corresponding channel, after combination of individual ports</description>
+        <field name="ErrorBits" start="0" bits="32" format="hex">
+        </field>
+      </register>
+    </group>    
+
+    <register name="SlowControlError" address="0024"  purpose="status">
+      <description>An error occurred on the slow control channel. One bit for each port, set when either bit 1,3 or 6 was set in the last slow-control access. Cleared after being read</description>
+      <field name="SlowControlError" start="0" bits="13"  format="bitmask" errorflag="true" >
+      </field>
+    </register>    
+
+    <register name="NetTrace" address="0025" purpose="status">
+      <description>This register is used for the nettrace operation. A bit is set if the board connected to the corresponding port answered with a don't understand errorbit. </description>
+      <field name="NetTrace" start="0" bits="32" invertflag="true"  format="bitmask" >
+      </field>
+    </register>    
+
+    <register name="PacketTimeout" address="0026"  purpose="status">
+      <description>A TrbNet was started, but not all five words were received within the given time limit. One bit for each port.</description>
+      <field name="PacketTimeout" start="0" bits="13"  format="bitmask" errorflag="true">
+      </field>
+    </register>    
+</group>
+
+
+  <group name="Status" purpose="status" address="4000"  size="112" mode="r" continuous="false">
+    <description>Details status information</description>
+    <register name="IpuPacketCount"
+              address="0000"  repeat="16" purpose="status" >
+      <description>Packet counter on the IPU channel for each individual port</description>
+      <field  name="IpuPacketCount"
+            start="0"   bits="32"   purpose="status"  format="integer">
+      </field>
+    </register>
+    <register name="SlowControlCount"
+              address="0010"  repeat="16" purpose="status" >
+      <description>Packet counter on the slow control channel for each individual port</description>
+      <field  name="SlowControlCount"
+            start="0"   bits="32"   purpose="status"  format="integer">
+      </field>
+    </register>
+    <register name="ErrorBitsPorts"
+              address="0020"  repeat="16" purpose="status" >
+      <description>Some part of errorbits on Lvl1 and data channel for each port</description>
+      <field  name="Lvl1ErrorHigh" start="8"   bits="8"   purpose="status"  format="bitmask">
+        <description>Lower 8 Bit of errorbits on Lvl1 channel</description>
+      </field>
+      <field  name="Lvl1ErrorLow" start="0"   bits="8"   purpose="status"  format="bitmask">
+        <description>Lower 8 Bit of errorbits on Lvl1 channel</description>
+      </field>
+      <field  name="DataErrorHigh" start="24"   bits="8"   purpose="status"  format="bitmask">
+        <description>Lower 8 Bit of errorbits on Lvl1 channel</description>
+      </field>
+      <field  name="DataErrorLow" start="16"   bits="8"   purpose="status"  format="bitmask">
+        <description>Lower 8 Bit of errorbits on Lvl1 channel</description>
+      </field>
+    </register>
+    <register name="InclusiveBusy"
+              address="0030"  repeat="16" purpose="status" >
+      <description>Total busy time on Lvl1 channel for each individual port</description>
+      <field  name="InclusiveBusy"
+            start="0"   bits="32"   purpose="status"  format="integer" scale="10" unit="ns">
+      </field>
+    </register>   
+    <register name="ExclusiveBusy"
+              address="0040"  repeat="16" purpose="status" >
+      <description>Busy time on Lvl1 channel for each individual port, counts only if only this one port is busy and others are idle</description>
+      <field  name="ExclusiveBusy"
+            start="0"   bits="32"   purpose="status"  format="integer" scale="10" unit="ns" >
+      </field>
+    </register>   
+    
+    <register name="GlobalTime"
+              address="0050" purpose="status" >
+      <description>Global time, counting in microseconds</description>
+      <field  name="GlobalTime"
+            start="0"   bits="32"   purpose="status"  format="integer"  unit="us" >
+      </field>
+    </register>      
+
+    <register name="LsmStatus"
+              address="0060" purpose="status" repeat="16">
+      <description>Status of link state machines</description>
+      <field  name="MedError" start="0"   bits="3"   purpose="status" invertflag="true" format="enum" >
+        <description>General status of the link</description>
+        <enumItem value="0">OK</enumItem>
+        <enumItem value="7">Inactive</enumItem>
+      </field>
+      <field  name="LinkStateMachine" start="4"   bits="4"   purpose="status"  format="hex"  >
+        <description>Status of the link state machine</description>
+      </field>      
+      <field  name="RetransmitReceived" start="16"   bits="8"   purpose="status" invertflag="true" format="integer"  >
+        <description>Number of retransmit requests received</description>
+      </field>      
+      <field  name="RetransmitSent" start="24"   bits="8"   purpose="status" invertflag="true" format="integer"  >
+        <description>Number of retransmit requests sent</description>
+      </field>      
+    </register>     
+    
+  </group>
+
+
+
+  <group name="Control" purpose="config" address="00c0" size="8" mode="rw" continuous="false">
+    <description>Control registers of the hub</description>
+     <register name="PortSwitch"
+              address="0000"  repeat="4" purpose="config" >
+      <description>Switches for each port used to disable an individual port on the respective channel</description>
+      <field  name="PortSwitch"
+            start="0"   bits="32"   purpose="config"  format="bitmask" >
+      </field>
+    </register>    
+
+     <register name="Timeout"
+              address="0005"  purpose="config" >
+      <description>Configures the timeout setting of the hub</description>
+      <field  name="TimeLimit0" start="0"   bits="4"   purpose="config"  format="enum" >
+        <description>Sets the time limit on the LVL1 channel</description>
+        <enumItem value="0">Off</enumItem>
+        <enumItem value="1">64ms</enumItem>
+        <enumItem value="2">128ms</enumItem>
+        <enumItem value="3">256ms</enumItem>
+        <enumItem value="4">1s</enumItem>
+        <enumItem value="5">2s</enumItem>
+        <enumItem value="6">4s</enumItem>
+        <enumItem value="7">8s</enumItem>
+        <enumItem value="f">Off</enumItem>
+      </field>
+      <field  name="TimeLimit1" start="4"   bits="4"   purpose="config"  format="enum" >
+        <description>Sets the time limit on the data channel</description>
+        <enumItem value="0">Off</enumItem>
+        <enumItem value="1">64ms</enumItem>
+        <enumItem value="2">128ms</enumItem>
+        <enumItem value="3">256ms</enumItem>
+        <enumItem value="4">1s</enumItem>
+        <enumItem value="5">2s</enumItem>
+        <enumItem value="6">4s</enumItem>
+        <enumItem value="7">8s</enumItem>
+        <enumItem value="f">Off</enumItem>
+      </field>
+      <field  name="TimeLimit3" start="12"   bits="4"   purpose="config"  format="enum" >
+        <description>Sets the time limit on the slow control channel</description>
+        <enumItem value="0">Off</enumItem>
+        <enumItem value="1">64ms</enumItem>
+        <enumItem value="2">128ms</enumItem>
+        <enumItem value="3">256ms</enumItem>
+        <enumItem value="4">1s</enumItem>
+        <enumItem value="5">2s</enumItem>
+        <enumItem value="6">4s</enumItem>
+        <enumItem value="7">8s</enumItem>
+        <enumItem value="f">Off</enumItem>
+      </field>
+      <field  name="TimeLimitAdjust"
+            start="16"   bits="4"   purpose="config"  format="integer" unit="ms" scale="-2" >
+        <description>Adjusts the exact time limit in steps of 2 ms.</description>
+      </field>      
+    </register>           
+    
+     <register name="PortReset"
+              address="0006"  purpose="config" >
+      <description>Sends a network reset on the selected port. One bit for each port. Has to be cleared by the user to make port operational again.</description>
+      <field  name="PortReset"
+            start="0"   bits="32"   purpose="config"  format="bitmask" >
+      </field>
+    </register>       
+    
+     <register name="LinkLookup"
+              address="0007"  purpose="config" >
+      <description>Makes the LED on the corresponding port flash. One bit for each port. Not implemented in all hubs.</description>
+      <field  name="LinkLookup"
+            start="0"   bits="32"   purpose="config"  format="bitmask" >
+      </field>
+    </register>       
+    
+  </group>-->
+  
+
+</SpiEntity>
diff --git a/xml-db/schema/SpiEntity.xsd b/xml-db/schema/SpiEntity.xsd
new file mode 100644 (file)
index 0000000..6ad3df7
--- /dev/null
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+  <!-- many definitions are used by TrbNetSetup.xsd as well, so
+       they are collected in a common scheme -->
+  <xs:include schemaLocation="TrbNetCommon.xsd"/>
+
+  <!-- the next two extensions introduce required attributes and also
+       requires the description and fields *inside* registers -->
+  <xs:redefine schemaLocation="TrbNetCommon.xsd">
+    <xs:complexType name="basicTrbData">
+      <xs:complexContent>
+        <xs:extension base="basicTrbData">
+          <xs:sequence>
+            <!-- every TrbData must be described -->
+            <xs:choice>
+              <xs:element ref="description"/>
+            </xs:choice>
+            <!-- but a data without any fields does not make sense for this
+                 database, so the default minOccurs=1 is used -->
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="field" />
+            </xs:choice>
+          </xs:sequence>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:redefine>
+
+  <!-- this is exactly the same as a TrbNetEntity for now, but maybe we want to
+       define it differently later on... -->
+  <xs:element name="SpiEntity">
+    <xs:complexType>
+      <xs:sequence>
+        <!-- we expect description to give a summary of this whole
+             entity, thus this field is required at the beginning -->
+        <xs:choice>
+          <xs:element   ref="description"/>
+        </xs:choice>
+        <!-- may also contain groups -->
+        <xs:choice maxOccurs="unbounded">
+          <xs:element   ref="group"    />
+          <xs:element   ref="register" />
+          <xs:element   ref="memory"   />
+          <xs:element   ref="fifo"     />
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute ref="name" use="required" />
+      <xs:attribute ref="address" />
+    </xs:complexType>
+
+    <!-- although requiring "entity global" unique names usually leads
+         to redundant naming schemes, but addressing things gets less
+         confusing -->
+    <xs:unique name="UniqueFieldNames">
+      <xs:selector xpath=".//field" />
+      <xs:field xpath="@name" />
+    </xs:unique>
+    <xs:unique name="UniqueTrbDataNames">
+      <xs:selector xpath=".//group | .//register | .//memory | .//fifo" />
+      <xs:field xpath="@name" />
+    </xs:unique>
+
+    <!-- consistency of addresses (and start, size of fields) is
+         checked more precisely programmatically -->
+    <xs:unique name="UniqueTrbDataAddressesInTop">
+      <xs:selector xpath="register | memory | fifo" />
+      <xs:field xpath="@address" />
+    </xs:unique>
+  </xs:element>
+
+
+
+</xs:schema>