]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
few slow control updates, add Trb5sc ADC AddOn registers
authorJan Michel <michel@physik.uni-frankfurt.de>
Mon, 22 Jul 2024 07:29:49 +0000 (09:29 +0200)
committerJan Michel <michel@physik.uni-frankfurt.de>
Mon, 22 Jul 2024 07:31:07 +0000 (09:31 +0200)
web/CtsPlugins/CtsMod18.pm
web/htdocs/addons/digitizer.pl [new file with mode: 0755]
xml-db/database/Digitizer.xml [new file with mode: 0644]
xml-db/database/MediaECP5.xml

index bdbf84fa4895ef10b44c2d381641cbe9ba4efc83..53c9621e6fa48deb64c4838cc9a982f638ec5aa3 100644 (file)
@@ -47,7 +47,7 @@ sub init {
         $regs->{$key}{'_defs'}{'input'}{'enum'}{$k+$chanStart} = "kel[$k]";
         }
         
-      my $chanStart = 36;
+      $chanStart = 36;
       for(my $k=0; $k<9; $k++) {
         $regs->{$key}{'_defs'}{'input'}{'enum'}{$k*2+$chanStart} = "bkpl[$k][0]";
         $regs->{$key}{'_defs'}{'input'}{'enum'}{$k*2+1+$chanStart} = "bkpl[$k][1]";
diff --git a/web/htdocs/addons/digitizer.pl b/web/htdocs/addons/digitizer.pl
new file mode 100755 (executable)
index 0000000..fba1e14
--- /dev/null
@@ -0,0 +1,56 @@
+#!/usr/bin/perl
+if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) {
+  print "HTTP/1.0 200 OK\n";
+  print "Content-type: text/html\r\n\r\n";
+  }
+else {
+  use lib '..';
+  use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv;
+  print "Content-type: text/html\n\n";
+  }
+
+use CGI ':standard';
+use XML::LibXML;
+use POSIX;
+use CGI::Carp qw(fatalsToBrowser);
+
+use lib qw|../commands htdocs/commands|;
+use xmlpage;
+
+my $page;
+
+$page->{title} = "Digitizer AddOn";
+$page->{link}  = "../";
+
+my @setup;
+
+push(@setup,({name      => "Input & Control", 
+              cmd       => "Digitizer-0xfd86-BasicControl&Digitizer-0xfd86-InputBuffer",
+              period    => 1000,
+              address   => 1}));              
+              
+push(@setup,({name      => "BufferConfig", 
+              cmd       => "Digitizer-0xfd86-BufferConfig",
+              period    => 1000,
+              address   => 1}));
+
+push(@setup,({name      => "BlockModeConfig", 
+              cmd       => "Digitizer-0xfd86-BlockModeConfig",
+              period    => 1000,
+              address   => 1}));
+
+push(@setup,({name      => "ProcessorStatus", 
+              cmd       => "Digitizer-0xfd86-ProcessorStatus",
+              period    => 1000,
+              address   => 1}));
+
+              
+
+xmlpage::initPage(\@setup,$page);
+
+
+1;
+
+
diff --git a/xml-db/database/Digitizer.xml b/xml-db/database/Digitizer.xml
new file mode 100644 (file)
index 0000000..cd7dda1
--- /dev/null
@@ -0,0 +1,296 @@
+<?xml version="1.0"  encoding="utf-8" ?>
+<TrbNetEntity xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+              xsi:noNamespaceSchemaLocation="../schema/TrbNetEntity.xsd"
+              name="Digitizer"
+              address="9000"
+              >
+  <description>Control and Status registers related to Trb5sc ADC AddOn</description>
+
+<group name="BasicControl"
+           address="0000"  size="3"  purpose="config" mode="rw" continuous="false">  
+      <description>Configuration registers</description>
+
+      <register name="ControlReg" address="0001" >
+        <description></description>
+        <field  name="StopBuffers" start="0"   bits="1"  format="boolean"  errorflag="true"/>
+
+        <field  name="DelDirection"  start="2"   bits="1"  format="boolean"  noflag="true"/>        
+        <field  name="DelLoadN"  start="3"   bits="1"  format="boolean" />
+        <field  name="RamClear" start="4"   bits="1"  format="boolean"  errorflag="true"/>
+        <field  name="RamReset" start="5"   bits="1"  format="boolean"  errorflag="true"/>
+        <field  name="BaselineReset" start="8"   bits="1"  format="boolean"  errorflag="true"/>
+        <field  name="ReadoutReset"  start="12"   bits="1"  format="boolean"  errorflag="true"/>
+        <field  name="AlignEnB"      start="16"   bits="1"  format="boolean"  errorflag="true"/>
+        <field  name="TestpatB"      start="17"   bits="1"  format="boolean"  errorflag="true"/>
+        <field  name="ForceShiftB"   start="18"   bits="1"  format="boolean" />
+      </register> 
+      <register name="ControlStrobes" address="0000" purpose="trigger" mode="w" >
+        <description>Strobe signals</description>
+        <field  name="ResetAdcA"    start="0"   bits="1"  format="boolean"  errorflag="true"/>
+        <field  name="ShiftAlignA"  start="1"   bits="1"  format="boolean"  errorflag="true"/>
+        <field  name="DelMove"      start="3"   bits="1"  format="boolean"  errorflag="true"/>
+        <field  name="ResetAdcB"    start="8"   bits="1"  format="boolean"  errorflag="true"/>
+        <field  name="ShiftAlignB"  start="9"   bits="1"  format="boolean"  errorflag="true"/>
+        <field  name="DelMoveB"     start="11"  bits="1"  format="boolean"  errorflag="true"/>
+      </register> 
+      <register name="InputMultiplexer" address="0002" purpose="config" mode="rw" >
+        <description>Setting the input multiplexer for processors</description>
+        <field  name="MuxCh0" start="0"    bits="4"  format="unsigned"  noflag="true"/>            
+        <field  name="MuxCh1" start="4"    bits="4"  format="unsigned"  noflag="true"/>            
+        <field  name="MuxCh2" start="8"    bits="4"  format="unsigned"  noflag="true"/>            
+        <field  name="MuxCh3" start="12"   bits="4"  format="unsigned"  noflag="true"/>            
+        <field  name="MuxCh4" start="16"   bits="4"  format="unsigned"  noflag="true"/>            
+        <field  name="MuxCh5" start="20"   bits="4"  format="unsigned"  noflag="true"/>            
+        <field  name="MuxCh6" start="24"   bits="4"  format="unsigned"  noflag="true"/>            
+        <field  name="MuxCh7" start="28"   bits="4"  format="unsigned"  noflag="true"/>            
+      </register>
+</group>
+
+
+<group name="InputBuffer"
+           address="0010"  size="1"  purpose="config" mode="r" continuous="false">  
+      <description>Input Buffer Status</description>
+      <register name="DataAdcA" address="0000" repeat="5">
+        <description>Current ADC data word</description>
+        <field  name="DataAdcA" start="0"   bits="18"  format="hex"  noflag="true" />
+      </register>
+      <register name="DebugAdcA" address="0008" >
+        <description>Debug information for ADC A inputs</description>
+        <field  name="InputState" start="0"   bits="4"  format="enum" noflag="true" >
+          <description>Status of the input word align</description>
+          <enumItem value="0">Idle</enumItem>
+          <enumItem value="1">Wait fo 0011</enumItem>
+        </field>      
+        <field name="Data0" start="4" bits="4"  format="hex" noflag="true" />
+        <field name="Data1" start="8" bits="4"  format="hex" noflag="true" />
+        <field name="Data2" start="12" bits="4" format="hex" noflag="true" />
+        <field name="Data3" start="16" bits="4" format="hex" noflag="true" />
+        <field name="FCO"   start="20" bits="4" format="hex" noflag="true" />
+        <field name="CdtEmpty" start="24" bits="1" format="boolean" noflag="true" />
+        <field name="CdtWrite" start="25" bits="1" format="boolean" noflag="true" />       
+      </register>
+      <register name="DebugAdcB" address="0009" >
+        <description>Debug information for ADC B inputs</description>
+        <field name="DebugAdcB" start="0" bits="32"  format="hex" noflag="true" />
+      </register>
+      <register name="DebugAdcB2" address="000a" >
+        <description>Debug information for ADC B inputs</description>
+        <field name="DebugAdcB2" start="0" bits="32"  format="hex" noflag="true" />
+      </register>
+</group>
+
+<group name="BufferConfig"
+           address="0100"  size="16" repeat="10" purpose="config" mode="rw" continuous="false">
+      <description>Configuration of buffer handling</description>
+      <register name="BufferReg0" address="0000" >
+        <description>Processor Config</description>
+        <field  name="BufferDepth" start="0"   bits="11"  format="unsigned"  noflag="true">
+          <description>Number of samples to be stored in the buffer</description>
+        </field>
+        <field  name="SamplesAfterTrg" start="16"   bits="11"  format="unsigned"  noflag="true">
+          <description>Number of samples to take after reference time signal arrived</description>
+        </field>
+      </register>
+      
+      <register name="BufferReg1" address="0001" >
+        <description>Processor Config</description>
+        <field  name="ProcessBlocks" start="0"   bits="2"  format="unsigned" noflag="true" >
+          <description>How many blocks of different downsampling settings should be processed</description>
+        </field>
+        <field  name="Downsampling" start="4"   bits="8"  format="unsigned" scaleoffset="1" noflag="true" >
+          <description>Downsampling of ADC samples before storing in buffer. Make sure values can not exceed 20 Bit (18 with PSA)</description>
+        </field>
+        <field  name="BaselineAvg" start="16"   bits="4"  format="unsigned" noflag="true" >
+          <description>Averaging time for baseline calculation. 2**N samples are taken. Baseline is calculated from buffer output data, triggered events are suppressed.</description>
+        </field>
+      </register>      
+
+      <register name="BufferReg2" address="0002" >
+        <description>Settings of trigger signal generation</description>
+        <field  name="TriggerOffset" start="0"   bits="20"  format="signed" noflag="true" >
+          <description>Offset from the calculated baseline that must be reached to generate a trigger signal for the CTS</description>
+        </field>
+        <field name="TriggerInvert" start="24" bits="1" format="boolean" noflag="true">
+          <description>Selects positive (unset) or negative (set) signal inputs. If negative is selected, a trigger is generated if the input signal is below the baseline plus the set (negative) threshold</description>
+        </field>
+        <field name="TriggerEnable" start="28" bits="1" format="boolean" noflag="true">
+          <description>Selects positive (unset) or negative (set) signal inputs. If negative is selected, a trigger is generated if the input signal is below the baseline plus the set (negative) threshold</description>
+        </field>
+      </register>
+      
+      <register name="BufferReg3" address="0003" >
+        <description>Processor Config</description>
+        <field  name="ReadoutOffset" start="0"   bits="20"  format="signed" noflag="true" >
+          <description>Offset from the calculated baseline that must be reached to generate a readout from this channel.</description>
+        </field>
+        <field name="ReadoutInvert" start="24" bits="1" format="bitmask" noflag="true">
+          <description>Selects positive (unset) or negative (set) signal inputs. If negative is selected, a readout is generated if the input signal is below the baseline minus the set threshold</description>
+        </field>        
+      </register>
+
+      <register name="BufferReg4" address="0004">
+        <description>Sets a defined reset value of the baseline. If not active, baseline is resetted to 0 or MAX depending on polarity selection of trigger generation.
+          To fix the baseline at this value, BaselineReset</description>
+        <field  name="BaselineFixed" start="31"   bits="1"  format="bitmask" noflag="true" >
+          <description>Do not do baseline calculations, always fix to the reset value.</description>
+        </field>
+        <field  name="BaselineOn" start="30"   bits="1"  format="bitmask" noflag="true" >
+          <description>Baseline calculation is always on</description>
+        </field>
+        <field  name="BaselineSubtract" start="29"   bits="1"  format="bitmask" noflag="true" >
+          <description>Subtract baseline during processing of ADC values</description>
+        </field>        
+        <field  name="BaselineFixValue" start="0"   bits="20"  format="unsigned" noflag="true" >
+          <description>Use this value as baseline if BaselineFixed is set</description>
+        </field>  
+      </register> 
+      
+      <register name="BufferReg5" address="0005" >
+        <description>Processor Config</description>
+        <field  name="ChannelDisable" start="0"   bits="1"  format="boolean" errorflag="true" >
+          <description>Disable processing of ADC channel</description>
+        </field>
+        <field  name="ProcessingMode" start="4"   bits="2"  format="enum" noflag="true" >
+          <description>Kind of data processing - e.g. block read-out, pulse shape processing</description>
+          <enumItem value="0">Block mode</enumItem>
+          <enumItem value="1">Pulse Shape Processing</enumItem>
+        </field>
+      </register>      
+
+      <register name="BufferReg6" address="0006" >
+        <description>Processor Config</description>
+        <field  name="WordCheck" start="0"   bits="18"   format="hex" noflag="true" >
+          <description>Check incoming words for validity. Either this word or its inverse are accepted</description>
+        </field>
+        <field  name="WordCheckEnable" start="31"   bits="1"  format="boolean" />
+
+      </register>   
+</group>
+
+
+<group name="BlockModeConfig"
+           address="0200"  size="16" repeat="10" purpose="config" mode="rw" continuous="false">
+    <register name="BlockMode0" address="0000" >
+      <description>Register for block mode readout</description>
+        <field  name="BlockSum0" start="0"   bits="8"  format="unsigned" noflag="true" >
+          <description>Number of readings to sum</description>
+        </field>  
+        <field  name="BlockWords0" start="8"   bits="8"  format="unsigned" noflag="true" >
+          <description>Number of words in a block</description>
+        </field>  
+        <field  name="BlockScale0" start="16"   bits="8"  format="unsigned" noflag="true" >
+          <description>Scale factor for data (2**N)</description>
+        </field>          
+      </register>
+    <register name="BlockMode1" address="0001" >
+      <description>Register for block mode readout</description>
+        <field  name="BlockSum1" start="0"   bits="8"  format="unsigned" noflag="true" >
+          <description>Number of readings to sum</description>
+        </field>  
+        <field  name="BlockWords1" start="8"   bits="8"  format="unsigned" noflag="true" >
+          <description>Number of words in a block</description>
+        </field>  
+        <field  name="BlockScale1" start="16"   bits="8"  format="unsigned" noflag="true" >
+          <description>Scale factor for data (2**N)</description>
+        </field>          
+      </register>
+    <register name="BlockMode2" address="0002" >
+      <description>Register for block mode readout</description>
+        <field  name="BlockSum2" start="0"   bits="8"  format="unsigned" noflag="true" >
+          <description>Number of readings to sum</description>
+        </field>  
+        <field  name="BlockWords2" start="8"   bits="8"  format="unsigned" noflag="true" >
+          <description>Number of words in a block</description>
+        </field>  
+        <field  name="BlockScale2" start="16"   bits="8"  format="unsigned" noflag="true" >
+          <description>Scale factor for data (2**N)</description>
+        </field>          
+      </register>
+    <register name="BlockMode3" address="0003" >
+      <description>Register for block mode readout</description>
+        <field  name="BlockSum3" start="0"   bits="8"  format="unsigned" noflag="true" >
+          <description>Number of readings to sum</description>
+        </field>  
+        <field  name="BlockWords3" start="8"   bits="8"  format="unsigned" noflag="true" >
+          <description>Number of words in a block</description>
+        </field>  
+        <field  name="BlockScale3" start="16"   bits="8"  format="unsigned" noflag="true" >
+          <description>Scale factor for data (2**N)</description>
+        </field>          
+      </register>
+</group>
+  
+
+
+<group name="ProcessorStatus"
+           address="0400"  size="16" repeat="10" purpose="status" mode="r" continuous="false">
+      <register name="FillLevel" address="0000" >
+        <description>Buffer fill level</description>
+        <field  name="FillLevel" start="0"   bits="10"  format="unsigned" noflag="true" />
+      </register>  
+    <register name="DataHandler" address="0001" >
+        <description>Status of the state machines</description>
+        <field  name="ReadoutState" start="0"   bits="8"  format="enum" noflag="true" >
+          <description>Status of the Readout handler FSM</description>
+          <enumItem value="0">Idle</enumItem>
+          <enumItem value="1">ReleaseDirect</enumItem>
+          <enumItem value="2">WaitForEnd</enumItem>
+          <enumItem value="3">CheckStatusTrigger</enumItem>
+          <enumItem value="4">Start</enumItem>
+          <enumItem value="5">Readout</enumItem>
+          <enumItem value="6">NextBlock</enumItem>
+          <enumItem value="7">SendStatus</enumItem>
+        </field>
+        <field  name="ProcessorState" start="8"   bits="4"  format="enum" noflag="true" >
+          <description>Status of the processor FSM</description>
+          <enumItem value="0">Idle</enumItem>
+          <enumItem value="1">ReadChannel</enumItem>
+          <enumItem value="2">NextBlock</enumItem>
+          <enumItem value="4">RdoDone</enumItem>
+          <enumItem value="5">RdoWaitAfter</enumItem>
+        </field>  
+      </register>     
+      <register name="Baseline" address="0002"  >
+        <description>The current calculated baseline of the ADC value</description>
+        <field  name="Baseline" start="0"   bits="20"  format="unsigned" noflag="true" />
+      </register>    
+      <register name="InvalidWords" address="0003" >
+        <description>Number of words not matching the given pattern </description>
+        <field  name="InvalidWords" start="0"   bits="32"  format="unsigned" errorflag="true" rate="true" />
+      </register>      
+      <register name="StatusFlags" address="0004" >
+        <description>Several bits of status information</description>
+        <field  name="RamRemove" start="0"   bits="1"  format="bitmask" noflag="true" >
+          <description>Data word removed from RAM</description>
+        </field>  
+        <field  name="TrgGen" start="1"   bits="1"  format="bitmask" noflag="true" >
+          <description>Trigger signal generated</description>
+        </field>  
+        <field  name="StopWrite" start="2"   bits="1"  format="bitmask" noflag="true" >
+          <description>Stop writing for readout</description>
+        </field>  
+        <field  name="RdoFlag" start="3"   bits="1"  format="bitmask" noflag="true" >
+          <description>Data needs to be read out</description>
+        </field>  
+      </register>    
+      
+</group>
+
+<group name="PsaCoefficients"
+           address="0800"  size="64" repeat="10" purpose="config" mode="w" continuous="true">
+      <memory name="PsaCoefficient" address="0000" size="64">  
+        <description>Signed PSA coefficient</description>
+        <field name="PsaCoefficient" start="0" bits="8" format="signed"/>
+      </memory>
+</group>
+
+
+
+
+
+
+
+
+
+</TrbNetEntity>
index f403bb6b8c463cf6b079f7f8d4a3419b11ebea7b..6435f4463293e5e88df68c5f5d2933c92373db98 100644 (file)
@@ -51,7 +51,7 @@
         <field name="PcsRxReady"  start="7" bits="1" format="boolean" errorflag="true" invertflag="true"/>
         <field name="PcsTxReady"  start="8" bits="1" format="boolean" noflag="true"/>
         <field name="LsmStatus"  start="9" bits="1" format="boolean" noflag="true" invertflag="true"/>
-        <field name="TimeSinceStart"  start="16" bits="16" format="unsigned" noflag="true" invertflag="true" unit="ms" scale="0.32"/>
+        <field name="TimeSinceStart"  start="16" bits="16" format="unsigned" noflag="true" invertflag="true" unit="ms" scale="1.28"/>
       </register>      
       <register name="RxControl1" address="0005" >
         <description>RX Control Status</description>
@@ -95,7 +95,7 @@
         <field name="PcsRxReady1"  start="7" bits="1" format="boolean" errorflag="true" invertflag="true"/>
         <field name="PcsTxReady1"  start="8" bits="1" format="boolean" noflag="true"/>
         <field name="LsmStatus1"  start="9" bits="1" format="boolean" noflag="true" invertflag="true"/>
-        <field name="TimeSinceStart1"  start="16" bits="16" format="unsigned" noflag="true" invertflag="true" unit="ms" scale="0.32"/>
+        <field name="TimeSinceStart1"  start="16" bits="16" format="unsigned" noflag="true" invertflag="true" unit="ms" scale="1.28"/>
       </register>           
     </group>     
   </group>