From 85a47100afe454a69a6a3beb979db842883ec60e Mon Sep 17 00:00:00 2001 From: "Hadaq@CountingHouse" Date: Tue, 29 Oct 2013 14:30:14 +0100 Subject: [PATCH] added tof start wall --- README.txt | 10 +- start/addresses_start.db | 5 + start/configure_startveto.script | 8 + start/serials_start.db | 8 + start/set_thresholds.pl | 242 ++++++++++++++++++++++ start/set_thresholds2.pl | 334 +++++++++++++++++++++++++++++++ start/set_thresholds_aim.txt | 19 ++ start/startup.script | 6 + start/trb.db | 3 + tof/addresses_tof.db | 10 + tof/configure_tof.script | 4 + tof/registers_tof.db | 21 ++ tof/serials_tof.db | 13 ++ tof/startup.script | 7 + tof/trb.db | 7 + wall/addresses_wall.db | 6 + wall/configure_wall.script | 2 + wall/serials_wall.db | 7 + wall/startup.script | 6 + wall/trb.db | 3 + 20 files changed, 716 insertions(+), 5 deletions(-) create mode 100644 start/addresses_start.db create mode 100644 start/configure_startveto.script create mode 100644 start/serials_start.db create mode 100644 start/set_thresholds.pl create mode 100644 start/set_thresholds2.pl create mode 100644 start/set_thresholds_aim.txt create mode 100644 start/startup.script create mode 100644 start/trb.db create mode 100644 tof/addresses_tof.db create mode 100644 tof/configure_tof.script create mode 100644 tof/registers_tof.db create mode 100644 tof/serials_tof.db create mode 100644 tof/startup.script create mode 100644 tof/trb.db create mode 100644 wall/addresses_wall.db create mode 100644 wall/configure_wall.script create mode 100644 wall/serials_wall.db create mode 100644 wall/startup.script create mode 100644 wall/trb.db diff --git a/README.txt b/README.txt index be2002f..ce5c9e1 100644 --- a/README.txt +++ b/README.txt @@ -10,11 +10,6 @@ cts evtbuild hub main - - - -Directories to check: - mdc monitor oracle @@ -24,3 +19,8 @@ shower start tof wall + + + +Directories to check: + diff --git a/start/addresses_start.db b/start/addresses_start.db new file mode 100644 index 0000000..12e43b3 --- /dev/null +++ b/start/addresses_start.db @@ -0,0 +1,5 @@ +#Address # S/N # FPGA # Design # TRB # +################################################### +0x4000 082 1 17 082 +0x4010 107 1 21 107 +0x4001 076 1 21 076 \ No newline at end of file diff --git a/start/configure_startveto.script b/start/configure_startveto.script new file mode 100644 index 0000000..6f6beb7 --- /dev/null +++ b/start/configure_startveto.script @@ -0,0 +1,8 @@ + +exec_cmd spi_trbv2_3 /home/hadaq/start_and_veto/thresholds_test_apr12_${TRBNUM} + +exec_cmd cd /home/hadaq/scripts/; ./trbv2_TDCs_configure.sh ${TRBNUM} + +exec_cmd rw_trbv2 --trb w 0 c2 007E0100; rw_trbv2 --trb w 0 c0 0a000000; rw_trbv2 --trb w 0 c3 00000100# C0(31-24 ) delay trigger *25 ns; C2(23-16) delay token * 25ns; C2(31-24) version number + + diff --git a/start/serials_start.db b/start/serials_start.db new file mode 100644 index 0000000..471bec9 --- /dev/null +++ b/start/serials_start.db @@ -0,0 +1,8 @@ +#Serial numbers of start/veto trbs and their unique ids + +# s/n # unique id +########################### + 082 0xe2000001fc5dbd28 + 107 0x59000001c1711828 + 076 0x36000001fc5df528 + diff --git a/start/set_thresholds.pl b/start/set_thresholds.pl new file mode 100644 index 0000000..609004d --- /dev/null +++ b/start/set_thresholds.pl @@ -0,0 +1,242 @@ +#!/usr/bin/perl + + +# a tool to correct automatically thresholds on start and veto fee boards +# aiming to the output signal rates, that are provided in set_thresholds_aim.txt# file + + +use Data::Dumper; +use IO::Socket; + +my $main_file = $ARGV[0]; +my $error = $ARGV[1]; + +my %scalers = (); +my %values = (); +my %aim = (); + +sub get_start_scalers { + my $data = qx(trbcmd rm 0x0003 0xa008 0x8 0); + + return split('\n', $data); +} + +sub get_veto_scalers { + my $data = qx(trbcmd rm 0x0003 0xa010 0x8 0); + + return split('\n', $data); +} + + + +sub get_scalers { + + my @d = get_start_scalers(); + my $ctr = 1; + shift @d; # skip the board address and leave only the data + foreach my $t (@d) { # fill the start scalers data into table + my @tt = split(/\s+/, $t); + $scalers{"start"}->{$ctr} = $tt[1]; + $ctr++; + } + + $ctr = 1; + @d = get_veto_scalers(); + shift @d; + foreach my $t (@d) { + my @tt = split(/\s+/, $t); + $scalers{"veto"}->{$ctr} = $tt[1]; + $ctr++; + } +} + +sub get_aim { + open(FILE, "set_thresholds_aim.txt"); + my @data = ; + my $ctr = 0; + foreach my $t (@data) { + next if (index($t, "#") != -1); + + if ($ctr < 8) { + $aim{"start"}->{$ctr + 1} = $t; + } + else { + $aim{"veto"}->{$ctr - 7} = $t; + } + $ctr++; + } +} + +sub get_init_values { + open(MAIN_FILE, $main_file); + + my @data = ; + + my $found_start = 0; + my $found_veto = 0; + foreach my $t (@data) { + if(index($t, "Diamond 1, DAC 2") != -1) { + $found_start = 1; + } + elsif ($found_start > 0 && $found_start < 9) { + my @tt = split(/\s+/, $t); + $values{"start"}->{4} = $tt[4] if($found_start == 1); + $values{"start"}->{3} = $tt[4] if($found_start == 2); + $values{"start"}->{2} = $tt[4] if($found_start == 3); + $values{"start"}->{1} = $tt[4] if($found_start == 4); + $values{"start"}->{5} = $tt[4] if($found_start == 5); + $values{"start"}->{6} = $tt[4] if($found_start == 6); + $values{"start"}->{7} = $tt[4] if($found_start == 7); + $values{"start"}->{8} = $tt[4] if($found_start == 8); + $found_start++; + } + elsif (index($t, "Veto, DAC 2") != -1) { + $found_veto = 1; + } + elsif ($found_veto > 0 && $found_veto < 9) { + my @tt = split(/\s+/, $t); + $values{"veto"}->{4} = $tt[4] if($found_veto == 1); + $values{"veto"}->{3} = $tt[4] if($found_veto == 2); + $values{"veto"}->{2} = $tt[4] if($found_veto == 3); + $values{"veto"}->{1} = $tt[4] if($found_veto == 4); + $values{"veto"}->{5} = $tt[4] if($found_veto == 5); + $values{"veto"}->{6} = $tt[4] if($found_veto == 6); + $values{"veto"}->{7} = $tt[4] if($found_veto == 7); + $values{"veto"}->{8} = $tt[4] if($found_veto == 8); + $found_veto++; + } + } +} + +sub correct_file { + + open(MAIN_FILE, $main_file); + + open(FILE, ">/var/diskless/etrax_fs/start_and_veto/thresholds.tmp"); + + my @data = ; + + my $found_start = 0; + my $found_veto = 0; + foreach my $t (@data) { + if(index($t, "Diamond 1, DAC 2") != -1) { # find the part with start thr values + $found_start = 1; + print FILE $t; + } + elsif ($found_start > 0 && $found_start < 9) { + print FILE "0 0 0 3 ".$values{"start"}->{4}." # ch. 4\n" if ($found_start == 1); + print FILE "0 0 1 3 ".$values{"start"}->{3}." # ch. 3\n" if ($found_start == 2); + print FILE "0 0 2 3 ".$values{"start"}->{2}." # ch. 2\n" if ($found_start == 3); + print FILE "0 0 3 3 ".$values{"start"}->{1}." # ch. 1\n" if ($found_start == 4); + print FILE "0 0 4 3 ".$values{"start"}->{5}." # ch. 5\n" if ($found_start == 5); + print FILE "0 0 5 3 ".$values{"start"}->{6}." # ch. 6\n" if ($found_start == 6); + print FILE "0 0 6 3 ".$values{"start"}->{7}." # ch. 7\n" if ($found_start == 7); + print FILE "0 0 7 3 ".$values{"start"}->{8}." # ch. 8\n" if ($found_start == 8); + $found_start++; + + } + elsif (index($t, "Veto, DAC 2") != -1) { #find the part with veto values + $found_veto = 1; + print FILE $t; + } + elsif ($found_veto > 0 && $found_veto < 9) { + print FILE "3 0 0 3 ".$values{"veto"}->{4}." # ch. 4\n" if ($found_veto == 1); + print FILE "3 0 1 3 ".$values{"veto"}->{3}." # ch. 3\n" if ($found_veto == 2); + print FILE "3 0 2 3 ".$values{"veto"}->{2}." # ch. 2\n" if ($found_veto == 3); + print FILE "3 0 3 3 ".$values{"veto"}->{1}." # ch. 1\n" if ($found_veto == 4); + print FILE "3 0 4 3 ".$values{"veto"}->{5}." # ch. 5\n" if ($found_veto == 5); + print FILE "3 0 5 3 ".$values{"veto"}->{6}." # ch. 6\n" if ($found_veto == 6); + print FILE "3 0 6 3 ".$values{"veto"}->{7}." # ch. 7\n" if ($found_veto == 7); + print FILE "3 0 7 3 ".$values{"veto"}->{8}." # ch. 8\n" if ($found_veto == 8); + $found_veto++; + } + else { + print FILE $t; + } + } + + close(MAIN_FILE); + close(FILE); +} + +sub calculate { + + my $detector = $_[0]; + + my $changed = 0; + + foreach my $s (keys %{$scalers{$detector}}) { + my $v = hex($scalers{$detector}->{$s}); + if ($v > $aim{$detector}->{$s} + $error) { + $values{$detector}->{$s} = "0x".sprintf("%04X", (hex ($values{$detector}->{$s}) + 80)); + + $changed = 1; + } + elsif ($v < $aim{$detector}->{$s} - $error || $v == 0) { + $values{$detector}->{$s} = "0x".sprintf("%04X", (hex ($values{$detector}->{$s}) - 80)); + + $changed = 1; + } + } + + return $changed; +} + + +sub perform_correction { + + #1. load init thresholds + get_init_values(); + + #2. load the main threshold file + load_thresholds($main_file); + + sleep 5; + + while(1) { + #3. check the scalers + get_scalers(); + + #4. make corrections to thresholds + if ((calculate("start") + calculate("veto")) == 0) { + last; # break in case there was no more corrections + } + else { # in other case load thresholds and check again + correct_file(); + load_thresholds("/home/hadaq/start_and_veto/thresholds.tmp"); + } + + print Dumper \%values; + + sleep 5; + } +} + +sub load_thresholds { + + my $file_to_load = $_[0]; + + my $socket = IO::Socket::INET->new(PeerAddr => "etraxp082", + PeerPort => 4712, + Proto => "tcp", + Type => SOCK_STREAM) + or print "ERROR connecting to command server\n"; + + $socket->autoflush(1); + print $socket "iamfromhadesdaq\n"; + my $a = <$socket>; + print $a; + print $socket "/home/hadaq/bin/spi_trbv2_3 ".$file_to_load."\n"; + $a = <$socket>; + print $a; + close($socket); +} + + +if ($#ARGV != 1) { + print " Usage: perl set_thresholds.pl main_file_with_thresholds error\n"; + exit; +} + +perform_correction(); + diff --git a/start/set_thresholds2.pl b/start/set_thresholds2.pl new file mode 100644 index 0000000..3f50454 --- /dev/null +++ b/start/set_thresholds2.pl @@ -0,0 +1,334 @@ +#!/usr/bin/perl + + +use Data::Dumper; +use IO::Socket; + +my $main_file = $ARGV[0]; +my $error = $ARGV[1]; + +my %scalers = (); +my %values = (); +my %results = (); +my %aim = (); + +sub get_start_scalers { + my $data = qx(trbcmd rm 0x0003 0xa008 0x8 0); + + return split('\n', $data); +} + +sub get_veto_scalers { + my $data = qx(trbcmd rm 0x0003 0xa010 0x8 0); + + return split('\n', $data); +} + +#gets the scalers values from CTS +sub get_scalers { + + my @d = get_start_scalers(); + my $ctr = 1; + shift @d; # skip the board address and leave only the data + foreach my $t (@d) { # fill the start scalers data into table + my @tt = split(/\s+/, $t); + $scalers{"start"}->{$ctr} = $tt[1]; + $ctr++; + } + + $ctr = 1; + @d = get_veto_scalers(); + shift @d; + foreach my $t (@d) { + my @tt = split(/\s+/, $t); + $scalers{"veto"}->{$ctr} = $tt[1]; + $ctr++; + } +} + +#not used anymore +sub get_aim { + open(FILE, "set_thresholds_aim.txt"); + my @data = ; + my $ctr = 0; + foreach my $t (@data) { + next if (index($t, "#") != -1); + + if ($ctr < 8) { + $aim{"start"}->{$ctr + 1} = $t; + } + else { + $aim{"veto"}->{$ctr - 7} = $t; + } + $ctr++; + } +} + +#read the thresholds from the main file +sub get_init_values { + open(MAIN_FILE, $main_file); + + my @data = ; + + my $found_start = 0; + my $found_veto = 0; + foreach my $t (@data) { + if(index($t, "Diamond 1, DAC 2") != -1) { + $found_start = 1; + } + elsif ($found_start > 0 && $found_start < 9) { + my @tt = split(/\s+/, $t); + $values{"start"}->{4} = $tt[4] if($found_start == 1); + $values{"start"}->{3} = $tt[4] if($found_start == 2); + $values{"start"}->{2} = $tt[4] if($found_start == 3); + $values{"start"}->{1} = $tt[4] if($found_start == 4); + $values{"start"}->{5} = $tt[4] if($found_start == 5); + $values{"start"}->{6} = $tt[4] if($found_start == 6); + $values{"start"}->{7} = $tt[4] if($found_start == 7); + $values{"start"}->{8} = $tt[4] if($found_start == 8); + $found_start++; + } + elsif (index($t, "Veto, DAC 2") != -1) { + $found_veto = 1; + } + elsif ($found_veto > 0 && $found_veto < 9) { + my @tt = split(/\s+/, $t); + $values{"veto"}->{4} = $tt[4] if($found_veto == 1); + $values{"veto"}->{3} = $tt[4] if($found_veto == 2); + $values{"veto"}->{2} = $tt[4] if($found_veto == 3); + $values{"veto"}->{1} = $tt[4] if($found_veto == 4); + $values{"veto"}->{5} = $tt[4] if($found_veto == 5); + $values{"veto"}->{6} = $tt[4] if($found_veto == 6); + $values{"veto"}->{7} = $tt[4] if($found_veto == 7); + $values{"veto"}->{8} = $tt[4] if($found_veto == 8); + $found_veto++; + } + elsif (index($t, "First - Gl. Thres.") != -1 && $found_start == 9) { + my @tt = split(/\s+/, $t); + $values{"start_global"} = $tt[4]; + } + elsif (index($t, "Second - Gl. Thres.") != -1 && $found_veto == 9) { + my @tt = split(/\s+/, $t); + $values{"veto_global"} = $tt[4]; + } + } +} + +#generates a new temp file with calculated thresholds +sub correct_file { + + open(MAIN_FILE, $main_file); + + open(FILE, ">/var/diskless/etrax_fs/start_and_veto/thresholds.tmp"); + + my @data = ; + + my $found_start = 0; + my $found_veto = 0; + foreach my $t (@data) { + if(index($t, "Diamond 1, DAC 2") != -1) { # find the part with start thr values + $found_start = 1; + print FILE $t; + } + elsif ($found_start > 0 && $found_start < 9) { + print FILE "0 0 0 3 ".$values{"start"}->{4}." # ch. 4\n" if ($found_start == 1); + print FILE "0 0 1 3 ".$values{"start"}->{3}." # ch. 3\n" if ($found_start == 2); + print FILE "0 0 2 3 ".$values{"start"}->{2}." # ch. 2\n" if ($found_start == 3); + print FILE "0 0 3 3 ".$values{"start"}->{1}." # ch. 1\n" if ($found_start == 4); + print FILE "0 0 4 3 ".$values{"start"}->{5}." # ch. 5\n" if ($found_start == 5); + print FILE "0 0 5 3 ".$values{"start"}->{6}." # ch. 6\n" if ($found_start == 6); + print FILE "0 0 6 3 ".$values{"start"}->{7}." # ch. 7\n" if ($found_start == 7); + print FILE "0 0 7 3 ".$values{"start"}->{8}." # ch. 8\n" if ($found_start == 8); + $found_start++; + + } + elsif (index($t, "Veto, DAC 2") != -1) { #find the part with veto values + $found_veto = 1; + print FILE $t; + } + elsif ($found_veto > 0 && $found_veto < 9) { + print FILE "3 0 0 3 ".$values{"veto"}->{4}." # ch. 4\n" if ($found_veto == 1); + print FILE "3 0 1 3 ".$values{"veto"}->{3}." # ch. 3\n" if ($found_veto == 2); + print FILE "3 0 2 3 ".$values{"veto"}->{2}." # ch. 2\n" if ($found_veto == 3); + print FILE "3 0 3 3 ".$values{"veto"}->{1}." # ch. 1\n" if ($found_veto == 4); + print FILE "3 0 4 3 ".$values{"veto"}->{5}." # ch. 5\n" if ($found_veto == 5); + print FILE "3 0 5 3 ".$values{"veto"}->{6}." # ch. 6\n" if ($found_veto == 6); + print FILE "3 0 6 3 ".$values{"veto"}->{7}." # ch. 7\n" if ($found_veto == 7); + print FILE "3 0 7 3 ".$values{"veto"}->{8}." # ch. 8\n" if ($found_veto == 8); + $found_veto++; + } + elsif (index($t, "First - Gl. Thres.") != -1 && $found_start == 9) { + print FILE "0 1 0 3 ".$values{"start_global"}." # First - Gl. Thres.\n"; + } + elsif (index($t, "Second - Gl. Thres.") != -1 && $found_veto == 9) { + print FILE "3 1 0 3 ".$values{"veto_global"}." # Second - Gl. Thres.\n"; + } + else { + print FILE $t; + } + } + + close(MAIN_FILE); + close(FILE); +} + +# not used anymore +sub calculate { + + my $detector = $_[0]; + + my $changed = 0; + + foreach my $s (keys %{$scalers{$detector}}) { + my $v = hex($scalers{$detector}->{$s}); + if ($v > $aim{$detector}->{$s} + $error) { + $values{$detector}->{$s} = "0x".sprintf("%04X", (hex ($values{$detector}->{$s}) + 80)); + + $changed = 1; + } + elsif ($v < $aim{$detector}->{$s} - $error || $v == 0) { + $values{$detector}->{$s} = "0x".sprintf("%04X", (hex ($values{$detector}->{$s}) - 80)); + + $changed = 1; + } + } + + return $changed; +} + +#not used anymore +sub perform_correction { + + #1. load init thresholds + get_init_values(); + + #2. load the main threshold file + load_thresholds($main_file); + + sleep 5; + + while(1) { + #3. check the scalers + get_scalers(); + + #4. make corrections to thresholds + if ((calculate("start") + calculate("veto")) == 0) { + last; # break in case there was no more corrections + } + else { # in other case load thresholds and check again + correct_file(); + load_thresholds("/home/hadaq/start_and_veto/thresholds.tmp"); + } + + print Dumper \%values; + + sleep 5; + } +} + +sub find_thresholds { + + my $detector = $_[0]; + + get_init_values(); + + load_thresholds($main_file); + + sleep 5; + + my $phase = 0; + # 0-augment thresholds until some channel starts to produce noise + # 1-augment until all channels produce noise + # 2-augment until a channels stops to produc noise + + while(1) { + + get_scalers(); + + my $ctr = 0; + foreach my $t (keys %{$scalers{$detector}}) { + if ($phase == 0) { + if (hex($t) != 0) { # noisy channel found + $phase = 1; + last; + } + } + elsif ($phase == 1) { + if (hex($t) != 0) { + $ctr++; + } + } + elsif ($phase == 2) { + if (hex($t) == 0) { # channel went silent + $phase = 3; + } + } + } + + if ($phase == 1) { + if ($ctr == 8) { # all channels produce noise + $phase = 2; + $ctr = 0; + } + else { # otherwise wait until they do + $ctr = 0; + } + } + elsif ($phase == 3) { + print "Finished\n"; + last; + } + + + # augment thresholds and load them into fee + if ($detector == "start") { + $values{"start_global"} = "0x".sprintf("%04X", (hex($values{"start_global"}) + 64)); + } + else { + $values{"veto_global"} = "0x".sprintf("%04X", (hex($values{"veto_global"}) + 64)) if ($detector == "veto"); + } + + correct_file(); + + load_thresholds("/var/diskless/etrax_fs/start_and_veto/thresholds.tmp"); + + print "Global thresholds set to: \n"; + print " START: ".$values{"start_global"}."\n"; + print " VETO: ".$values{"veto_global"}."\n\n"; + + sleep 5; + } +} + +#function that load a given threshold file into fee +sub load_thresholds { + + my $file_to_load = $_[0]; + + my $socket = IO::Socket::INET->new(PeerAddr => "etraxp082", + PeerPort => 4712, + Proto => "tcp", + Type => SOCK_STREAM) + or print "ERROR connecting to command server\n"; + + $socket->autoflush(1); + print $socket "iamfromhadesdaq\n"; + my $a = <$socket>; + print $a; + print $socket "/home/hadaq/bin/spi_trbv2_3 ".$file_to_load."\n"; + $a = <$socket>; + print $a; + close($socket); +} + + +if ($#ARGV != 1) { + print " Usage: perl set_thresholds.pl main_file_with_thresholds error\n"; + exit; +} + +#perform_correction(); + + +find_thresholds("start"); + diff --git a/start/set_thresholds_aim.txt b/start/set_thresholds_aim.txt new file mode 100644 index 0000000..5516d91 --- /dev/null +++ b/start/set_thresholds_aim.txt @@ -0,0 +1,19 @@ +#text file describing wanted trigger rate on each channel +#start ch0-7 +1 +2 +3 +4 +5 +6 +7 +8 +#veto ch 0-7 +11 +12 +13 +14 +15 +16 +17 +18 diff --git a/start/startup.script b/start/startup.script new file mode 100644 index 0000000..f2a3b2e --- /dev/null +++ b/start/startup.script @@ -0,0 +1,6 @@ + +#Set all addresses +!ifndef RESTART + set_addresses serials_start.db addresses_start.db #addresses for Start/Veto TRB +!endif + diff --git a/start/trb.db b/start/trb.db new file mode 100644 index 0000000..0dc8a9f --- /dev/null +++ b/start/trb.db @@ -0,0 +1,3 @@ +start etraxp082 +start etraxp076 +veto etraxp107 diff --git a/tof/addresses_tof.db b/tof/addresses_tof.db new file mode 100644 index 0000000..2e750e2 --- /dev/null +++ b/tof/addresses_tof.db @@ -0,0 +1,10 @@ +#Address # S/N # FPGA # Design # TRB # +################################################### +0x4C00 079 1 6 079 +0x4C10 064 1 6 064 +0x4C20 086 1 6 086 +0x4C30 062 1 6 062 +0x4C40 081 1 6 081 +0x4C50 084 1 6 084 +0x4C31 072 1 6 072 + diff --git a/tof/configure_tof.script b/tof/configure_tof.script new file mode 100644 index 0000000..fd9c1fc --- /dev/null +++ b/tof/configure_tof.script @@ -0,0 +1,4 @@ + +exec_cmd spi_trbv2 /home/hadaq/tof/thresholds_trb${TRBNUM} ;cd /home/hadaq/scripts/; ./trbv2_TDCs_configure.sh ${TRBNUM} ;rw_trbv2 --trb w 0 c2 00400000; rw_trbv2 --trb w 0 c0 04000000; rw_trbv2 --trb w 0 c3 00000100 + + diff --git a/tof/registers_tof.db b/tof/registers_tof.db new file mode 100644 index 0000000..193217c --- /dev/null +++ b/tof/registers_tof.db @@ -0,0 +1,21 @@ +# I'm using the 0x prefix to make replacing settings automatically easier + + +!Register table +# Type # C0 # C1 # C2 # C3 # C4 # C5 # C6 # C7 # +################################################################################# + 1 0xA0C0 0xA0C1 0xA0C2 0xA0C3 0xA0C4 0xA0C5 0xA0C6 0xA0C7 + + +!Value table +#Plane 1 +#OEP # Type # C0 # C1 # C2 # C3 # C4 # C5 # C6 # C7 # +########################################################################################## +#0x4C00 1 0x00 0x00 0x500000 0x100 0x00 0x400 0x00 0x00 +#0x4C10 1 0x00 0x00 0x500000 0x100 0x00 0x400 0x00 0x00 +#0x4C20 1 0x00 0x00 0x500000 0x100 0x00 0x400 0x00 0x00 +#0x4C30 1 0x00 0x00 0x500000 0x100 0x00 0x400 0x00 0x00 +#0x4C40 1 0x00 0x00 0x500000 0x100 0x00 0x400 0x00 0x00 +#0x4C50 1 0x00 0x00 0x500000 0x100 0x00 0x400 0x00 0x00 +#0x4C01 1 0x00 0x00 0x500000 0x100 0x00 0x400 0x00 0x00 +#0x4C02 1 0x00 0x00 0x500000 0x100 0x00 0x400 0x00 0x00 \ No newline at end of file diff --git a/tof/serials_tof.db b/tof/serials_tof.db new file mode 100644 index 0000000..90859f9 --- /dev/null +++ b/tof/serials_tof.db @@ -0,0 +1,13 @@ +#Serial numbers of tof trbs and their unique ids + +# s/n # unique id +########################### +064 0x910000012419cd28 +062 0xdf000001c17f1728 +081 0x5a000001fc5de428 +084 0xbe00000123ec4c28 +072 0x71000001c17b8728 +079 0x58000001fc5ba128 +086 0x34000001fc5bb028 + +#060 not icluded now \ No newline at end of file diff --git a/tof/startup.script b/tof/startup.script new file mode 100644 index 0000000..90fac5c --- /dev/null +++ b/tof/startup.script @@ -0,0 +1,7 @@ + +#Set all addresses +!ifndef RESTART + set_addresses serials_tof.db addresses_tof.db #addresses for TOF TRB +!endif + + diff --git a/tof/trb.db b/tof/trb.db new file mode 100644 index 0000000..d9e8c6a --- /dev/null +++ b/tof/trb.db @@ -0,0 +1,7 @@ +tof etraxp079 +tof etraxp064 +tof etraxp086 +tof etraxp062 +tof etraxp081 +tof etraxp084 +tof etraxp072 \ No newline at end of file diff --git a/wall/addresses_wall.db b/wall/addresses_wall.db new file mode 100644 index 0000000..1865b3d --- /dev/null +++ b/wall/addresses_wall.db @@ -0,0 +1,6 @@ +#Address # S/N # FPGA # Design # TRB # +################################################### +0x4400 060 1 16 060 +0x4410 090 1 16 090 +0x4420 108 1 16 108 + diff --git a/wall/configure_wall.script b/wall/configure_wall.script new file mode 100644 index 0000000..219db29 --- /dev/null +++ b/wall/configure_wall.script @@ -0,0 +1,2 @@ + exec_cmd spi_trbv2 /home/hadaq/fwall/thresholds_trb${TRBNUM} ; cd /home/hadaq/scripts/; ./trbv2_TDCs_configure.sh ${TRBNUM};rw_portB w 0;rw_trbv2 --trb w 0 c2 00400000; rw_trbv2 --trb w 0 c0 04000000; rw_trbv2 --trb w 0 c3 00000100 + diff --git a/wall/serials_wall.db b/wall/serials_wall.db new file mode 100644 index 0000000..22df42a --- /dev/null +++ b/wall/serials_wall.db @@ -0,0 +1,7 @@ +# s/n # unique id +########################### + 060 0x7E00000123F4FB28 + 070 0xF9000001C17F0B28 + 090 0x28000001FC4BCB28 + 108 0xc9000001c1712428 + 111 0x50000001c170c828 diff --git a/wall/startup.script b/wall/startup.script new file mode 100644 index 0000000..ddc4b3a --- /dev/null +++ b/wall/startup.script @@ -0,0 +1,6 @@ + +#Set all addresses +!ifndef RESTART + set_addresses serials_wall.db addresses_wall.db #addresses for Wall TRB +!endif + diff --git a/wall/trb.db b/wall/trb.db new file mode 100644 index 0000000..570c33b --- /dev/null +++ b/wall/trb.db @@ -0,0 +1,3 @@ +wall etraxp060 +wall etraxp108 +wall etraxp090 -- 2.43.0