]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
add new Cts module for design with lupo receiver
authorJan Michel <michel@physik.uni-frankfurt.de>
Thu, 13 Nov 2025 08:40:40 +0000 (09:40 +0100)
committerJan Michel <michel@physik.uni-frankfurt.de>
Thu, 13 Nov 2025 08:40:40 +0000 (09:40 +0100)
web/CtsPlugins/CtsMod19.pm [new file with mode: 0644]

diff --git a/web/CtsPlugins/CtsMod19.pm b/web/CtsPlugins/CtsMod19.pm
new file mode 100644 (file)
index 0000000..3f730e8
--- /dev/null
@@ -0,0 +1,67 @@
+# Module: Unified AddOn Module for TRB3sc with KEL connectors and RJ-adapter plus LUPO receiver
+package CtsMod19;
+
+@ISA = (CtsBaseModule);
+
+use warnings;
+use strict;
+use TrbRegister;
+use Data::Dumper;
+
+sub moduleName {"Trigger Input Multiplexer"}
+
+sub init {
+   my $self    = $_[0];
+   my $address = $_[1];
+   
+   my $trb  = $self->{'_cts'}{'_trb'};
+   
+   my $regs = $self->{'_registers'};
+   my $prop = $self->{'_properties'};
+   
+   my $cprop = $self->{'_cts'}{'_properties'};
+   my $header = $self->{'_cts'}{'_enum'}{0x19}->read();
+
+   print "Trigger Modules 0x12 and 0x19 cannot be instantiated in the same design\n" if exists $self->{'_cts'}{'_enum'}{0x12};
+   
+# registers
+   for(my $i = 0; $i < $header->{'len'}; $i++) {
+      my $key = "trg_input_mux$i";
+      
+      $regs->{$key} = new TrbRegister($address + 1 + $i, $trb, {
+         'input'  => {'lower' =>  0, 'len' => 7, 'type' => 'enum', 'enum' => 
+            {
+              0 => 'trig_rj[3]', 1 => 'trig_rj[4]', 
+              2  => 'a[0]', 3   => 'a[1]',
+              4  => 'b[0]', 5  => 'b[1]',
+              6  => 'c[0]', 7  => 'c[1]',
+              8  => 'd[0]', 9  => 'd[1]',
+              10 => 'g[0]', 11 => 'g[1]',
+              12 => 'h[0]', 13 => 'h[1]',
+              14 => 'i[0]', 15 => 'i[1]',
+              16 => 'j[0]', 17 => 'j[1]',
+              18 => 'x[2]', 19 => 'x[3]',
+              
+              20 => 'int_trg[0]', 21 => 'int_trg[1]'
+            }
+         }
+      }, {
+         'accessmode' => "rw",
+         'export'     => 1,
+         'monitor' => '1',
+         'label' => "Input Multiplexer $i"
+      });
+      
+   }
+   
+
+   for(my $i = 0; $i < $header->{'itc_len'}; $i++) {
+      $self->{'_cts'}->getProperties->{'itc_assignments'}[$i + $header->{'itc_base'}] = "Trigger Multiplexer $i";
+   }
+
+# properties
+   $prop->{"trg_inp_mux_count"} = $header->{'len'};
+   $prop->{"trg_inp_mux_itc_base"} = $header->{'itc_base'};
+}
+
+1;