From: Manuel Penschuck Date: Thu, 28 Nov 2013 20:51:04 +0000 (+0100) Subject: Support for Triggers from peripheral FPGAs X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=e9e9601014b272447d042afa94475d39a6273c8a;p=daqtools.git Support for Triggers from peripheral FPGAs --- diff --git a/web/CtsPlugins/CtsMod13.pm b/web/CtsPlugins/CtsMod13.pm new file mode 100755 index 0000000..e595a21 --- /dev/null +++ b/web/CtsPlugins/CtsMod13.pm @@ -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 diff --git a/web/htdocs/scripts/cts.js b/web/htdocs/scripts/cts.js index 84e423e..f8b38b5 100644 --- a/web/htdocs/scripts/cts.js +++ b/web/htdocs/scripts/cts.js @@ -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:  '}), + 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+']'}));