From 6519d3ac03c3c3a5dbc53940da1397d4ffbe5f5b Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Tue, 6 Aug 2024 10:48:52 +0200 Subject: [PATCH] update web tools for Trb5sc CTS --- web/CtsPlugins/CtsMod1a.pm | 66 ++++++++++++++++++++++++++ xml-db/database/InputMonitorTrb3sc.xml | 6 +++ 2 files changed, 72 insertions(+) create mode 100644 web/CtsPlugins/CtsMod1a.pm diff --git a/web/CtsPlugins/CtsMod1a.pm b/web/CtsPlugins/CtsMod1a.pm new file mode 100644 index 0000000..9aa74a4 --- /dev/null +++ b/web/CtsPlugins/CtsMod1a.pm @@ -0,0 +1,66 @@ +# Module: Unified AddOn Module for TRB5sc with internal trg logic and pin-header inputs +package CtsMod1a; + +@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'}{0x1a}->read(); + + +# 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]', +# 34 => 'int_trg[0]', 35 => 'int_trg[1]' + } + } + }, { + 'accessmode' => "rw", + 'export' => 1, + 'monitor' => '1', + 'label' => "Input Multiplexer $i" + }); + + my $chanStart = 0; + for(my $k=0; $k<4; $k++) { + $regs->{$key}{'_defs'}{'input'}{'enum'}{$k+$chanStart} = "internal[$k]"; + } + + $chanStart = 4; + for(my $k=0; $k<8; $k++) { + $regs->{$key}{'_defs'}{'input'}{'enum'}{$k+$chanStart} = "hdrio[".($k+16)."]"; + } + + } + + + 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; diff --git a/xml-db/database/InputMonitorTrb3sc.xml b/xml-db/database/InputMonitorTrb3sc.xml index ce6919b..3ad4fca 100644 --- a/xml-db/database/InputMonitorTrb3sc.xml +++ b/xml-db/database/InputMonitorTrb3sc.xml @@ -162,6 +162,12 @@ output #slice Number of outputs of the trigger logic + + Number of multiplicity logic blocks + + + Number of coincidence blocks + Coincidence interval is fixed to 4 clock cycles or configurable in TriggerStretchSet -- 2.43.0