]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
Support for Triggers from peripheral FPGAs
authorManuel Penschuck <manuel.penschuck@stud.uni-frankfurt.de>
Thu, 28 Nov 2013 20:51:04 +0000 (21:51 +0100)
committerManuel Penschuck <manuel.penschuck@stud.uni-frankfurt.de>
Thu, 28 Nov 2013 20:51:04 +0000 (21:51 +0100)
web/CtsPlugins/CtsMod13.pm [new file with mode: 0755]
web/htdocs/scripts/cts.js

diff --git a/web/CtsPlugins/CtsMod13.pm b/web/CtsPlugins/CtsMod13.pm
new file mode 100755 (executable)
index 0000000..e595a21
--- /dev/null
@@ -0,0 +1,41 @@
+# Module: Periph FPGA Trigger Inputs
+package CtsMod13;
+
+@ISA = (CtsBaseModule);
+
+use warnings;
+use strict;
+use TrbRegister;
+
+sub moduleName {"AddOn Input Multiplexer"}
+
+sub init {
+   my $self    = $_[0];
+   my $address = $_[1];
+   
+   my $trb  = $self->{'_cts'}{'_trb'};
+   
+   my $regs = $self->{'_registers'};
+   my $prop = $self->{'_properties'};
+
+   my $header = $self->{'_cts'}{'_enum'}{0x13}->read();
+   
+# registers
+   my $key = "trg_periph_config";
+   $regs->{$key} = new TrbRegister($address + 1, $trb, {
+      'mask'  => {'lower' =>  0, 'len' => 4, 'type' => 'mask'}
+   }, {
+      'accessmode' => "rw",
+      'export'     => 1,
+      'monitor' => '1',
+      'label' => "Periph. Trigger"
+   });
+
+   $self->{'_cts'}->getProperties->{'itc_assignments'}[$header->{'itc_base'}] = "Periph. FPGA Inputs";
+
+# properties
+   $prop->{"trg_periph_count"} = $header->{'len'};
+   $prop->{"trg_periph_itc_base"} = $header->{'itc_base'};
+}
+
+1;
\ No newline at end of file
index 84e423e0a830ba199cba2e1035aa9143b9115889..f8b38b50528ac765d0e3b43a6c0378a23cf06ffc 100644 (file)
@@ -448,23 +448,21 @@ var CTS = new Class({
          $('addon-board-tab')
          .adopt(
             new Element('tr', {'class': i%2?'':'alt', 'flashgroup': 'itc-' + (i + parseInt(this.defs.properties.trg_input_itc_base))})
-            .adopt(
+            .adopt([
                new Element('td', {'class': 'num', 'text': i}),
                
                new Element('td', {'class': 'source'})
                .adopt(
-                  new Element('select', {'class': 'text autocommit autoupdate', 'slice': areg + '.input'})
-                  .adopt(
-                     Object.values(en).map(function (r) {
-                        return new Element('option', {'value': r, 'text': r})
-                     })
-                   )
+                  new Element('select', {'class': 'text autocommit autoupdate', 'slice': areg + '.input'}).adopt(
+                    Object.values(en).map(function (r) {
+                       return new Element('option', {'value': r, 'text': r})
+                    })
+                  )
                ),
                
                new Element('td', {'class': 'rate autorate', 'slice': 'trg_input_edge_cnt' + i + '.value', 'text': 'n/a', 'id': 'inp-rate' + i}),
                
-               new Element('td', {'class': 'invert'})
-               .adopt(
+               new Element('td', {'class': 'invert'}).adopt(
                   new Element('input', {'type': 'checkbox', 'class': 'autocommit autoupdate', 'slice': reg + '.invert'})
                ),
 
@@ -489,7 +487,7 @@ var CTS = new Class({
                      new Element('option', {'value': 'to_high', 'text': '-> 1'}),
                   ])
                )
-            )
+            ])
          );
       }
    },
@@ -507,37 +505,44 @@ var CTS = new Class({
          $('itc-tab') // + (i / 8).toInt())
          .adopt(
             new Element('tr', {'class': i%2?'':'alt', 'flashgroup': 'itc-' + i})
-            .adopt(
-               new Element('td', {'text': i, 'class': 'channel'})
-            ).adopt(
+           .adopt([
+               new Element('td', {'text': i, 'class': 'channel'}),
                new Element('td', {'class': 'enable'})
                .adopt(
                   new Element('input', {'type': 'checkbox', 'id': 'itc-enable'+i, 'class': 'autocommit autoupdate', 'slice': 'trg_channel_mask.mask[' + i + ']'})
-               )
-            ).adopt(
-               new Element('td', {'class': 'edge'})
+               ),
+
+              new Element('td', {'class': 'edge'})
                .adopt(
                   edgeType = new Element('select', {'type': 'checkbox', 'class': 'autocommit autoupdate', 'slice': 'trg_channel_mask.edge[' + i + ']'})
-                  .adopt(
-                     new Element('option', {'value': '0', 'text': 'H. Level'})
-                   ).adopt(
+                  .adopt([
+                     new Element('option', {'value': '0', 'text': 'H. Level'}),
                      new Element('option', {'value': '1', 'text': 'R. Edge'})
-                   )
-               )
-            ).adopt(
-               new Element('td', {'class': 'assign', 'text': this.defs.properties.itc_assignments[i]})
-            ).adopt (
+                   ])
+               ),
+           
+               itc = new Element('td', {'class': 'assign', 'text': this.defs.properties.itc_assignments[i]}),
                new Element('td', {'class': 'type'})
                .adopt(
                      ddType = new Element('select', {'class': 'autocommit autoupdate autoupdate-value', 'slice': '_trg_trigger_types' + (i < 8 ? '0' : '1') + '.type' + i})
-               )
-            ).adopt (
-               assertedRate = new Element('td', {'class': 'rate autorate', 'slice': 'trg_channel_asserted_cnt' + i + '.value', 'text': 'n/a', 'id': 'itc-asserted-rate' + i})
-            ).adopt (
+               ),
+           
+               assertedRate = new Element('td', {'class': 'rate autorate', 'slice': 'trg_channel_asserted_cnt' + i + '.value', 'text': 'n/a', 'id': 'itc-asserted-rate' + i}),
                edgeRate = new Element('td', {'class': 'rate autorate', 'slice': 'trg_channel_edge_cnt' + i + '.value', 'text': 'n/a', 'id': 'itc-edge-rate' + i})
-            )
+            ])
          );
          
+        if (this.defs.properties['trg_periph_itc_base'] == i) {
+           itc.set('html', '').adopt([
+              new Element('span', {'html': 'Trigger from FPGA:&nbsp;&nbsp;'}),
+              new Element('sub', {'text': '4'})
+           ]);
+           for(var j=3; j>=0; j--)
+              itc.adopt(new Element('input', {'type': 'checkbox', 'class': 'autocommit autoupdate', 'slice': 'trg_periph_config.mask[' + j + ']'}));
+
+           itc.adopt(new Element('sub', {'text': '1'}));
+        }
+        
          for(var j=0; j < 16; j++)
             ddType.adopt(new Element('option', {'value': j, 'text': this.defs.registers['_trg_trigger_types' + (i < 8 ? '0' : '1')]._defs['type' + i].enum[j]}));
          
@@ -571,19 +576,17 @@ var CTS = new Class({
          var coin, inhibit;
          $('coin-tab').adopt(
             new Element('tr', {'class': i%2?'':'alt', 'flashgroup':  'itc-' +  (i + parseInt(this.defs.properties.trg_coin_itc_base))})
-            .adopt(
-               new Element('td', {'class': 'num', 'text': i})
-            ).adopt(
+            .adopt([
+               new Element('td', {'class': 'num', 'text': i}),
                new Element('td', {'class': 'window'})
-               .adopt(
-                  new Element('input', {'class': 'autoupdate autocommit', 'slice': reg + '.window', 'format': 'countToTime', 'interpret': 'timeToCount'})
-               ).adopt(
+               .adopt([
+                  new Element('input', {'class': 'autoupdate autocommit', 'slice': reg + '.window', 'format': 'countToTime', 'interpret': 'timeToCount'}),
                   new Element('span', {'text': ' ns'})
-            )).adopt(
-               coin = new Element('td', {'class': 'coin'})
-            ).adopt(
+              ]),
+               coin = new Element('td', {'class': 'coin'}),
                inhibit = new Element('td', {'class': 'inhibt'})
-         ));
+           ]) 
+        );
          
          for(var j=this.defs.properties.trg_input_count-1; j >= 0; j--) {
             coin.adopt(   new Element('input', {'type': 'checkbox', 'class': 'autoupdate autocommit', 'slice': reg+'.coin_mask['+j+']'}));