From 828bb12caab4300f2c9c92ff473b5607aac1dc55 Mon Sep 17 00:00:00 2001 From: Hades DAQ Date: Mon, 27 Mar 2017 16:27:36 +0200 Subject: [PATCH] new status, mt --- tools/determine_noiseband_dirich.pl | 4 +- tools/flash_settings.pl | 2 +- users/gsi_ee_trb84/TdcEventBuilder.xml | 14 ++--- users/gsi_ee_trb84/check_ping.pl | 8 +-- users/gsi_ee_trb84/db/addresses_dirich.db | 1 + users/gsi_ee_trb84/db/addresses_trb3.db | 30 +++++++++++ users/gsi_ee_trb84/db/register_configgbe.db | 28 ++++++---- .../gsi_ee_trb84/db/register_configgbe_ip.db | 54 +++++++++---------- users/gsi_ee_trb84/first.C | 36 +++++++------ users/gsi_ee_trb84/second.C | 2 +- users/gsi_ee_trb84/startup.sh | 15 +++--- users/gsi_ee_trb84/trbreset_loop.pl | 5 +- 12 files changed, 122 insertions(+), 77 deletions(-) diff --git a/tools/determine_noiseband_dirich.pl b/tools/determine_noiseband_dirich.pl index cbbbbef..b3aa9f7 100755 --- a/tools/determine_noiseband_dirich.pl +++ b/tools/determine_noiseband_dirich.pl @@ -5,11 +5,11 @@ use HADES::TrbNet; use Time::HiRes qw(usleep); use Data::Dumper; -my $dirich = 0x1204; +my $dirich = 0x1207; my $throffset = 0xa000; my $monitor = 0xdfc0; -my $last_channel = 5; +my $last_channel = 8; my $default_threshold = 0x3000; diff --git a/tools/flash_settings.pl b/tools/flash_settings.pl index adcbb44..7b55466 100755 --- a/tools/flash_settings.pl +++ b/tools/flash_settings.pl @@ -117,7 +117,7 @@ my $registers_to_read = 0; my $register_counter_on_page = 0; $page = chr(0) x 256; # initialize empty page; -my @addresses = sort { $a <=> $b } keys $sc_data; +my @addresses = sort { $a <=> $b } keys %{$sc_data}; for my $addr (@addresses) { insert_at(\$page,6*$register_counter_on_page, my_uint($addr, 2) ); diff --git a/users/gsi_ee_trb84/TdcEventBuilder.xml b/users/gsi_ee_trb84/TdcEventBuilder.xml index e1bd0fb..d80f118 100644 --- a/users/gsi_ee_trb84/TdcEventBuilder.xml +++ b/users/gsi_ee_trb84/TdcEventBuilder.xml @@ -96,13 +96,13 @@ When starting analysis from the go4 gui, one should specify stream server with p - - - - - - + + + + + + @@ -112,7 +112,7 @@ When starting analysis from the go4 gui, one should specify stream server with p - + diff --git a/users/gsi_ee_trb84/check_ping.pl b/users/gsi_ee_trb84/check_ping.pl index ff146b6..589783a 100755 --- a/users/gsi_ee_trb84/check_ping.pl +++ b/users/gsi_ee_trb84/check_ping.pl @@ -20,9 +20,9 @@ my $result = GetOptions ( my $map = { 0 => { trb => 84, addr => "0xc001", sys => "CTS"}, - 1 => { trb => 61, addr => "0x8000", sys => "TOF"}, - 2 => { trb => 113, addr => "0x8001", sys => "TOF"}, - 3 => { trb => 158, addr => "0x8002", sys => "TOF"}, + 1 => { trb => 61, addr => "0x8610", sys => "TOF"}, + 2 => { trb => 113, addr => "0x8113", sys => "TOF"}, + 3 => { trb => 158, addr => "0x8158", sys => "TOF"}, }; my $MAX_PROCESSES=50; @@ -100,7 +100,7 @@ while ( (($first_iteration == 1) || keys %$rh_unsuccessful) && if ($reboot && ($number_of_reboots_done < $maximal_reboot_counter) && keys %$rh_unsuccessful) { #print Dumper $rh_unsuccessful; print "have to reboot FPGAs, first make a reset and reassign the addresses.\n"; - my $cmd = "trbcmd reset; sleep 2; merge_serial_address.pl ~/trbsoft/daqtools/base/serials_trb3.db ~/trbsoft/userscript/db/addresses_trb3.db"; + my $cmd = 'trbcmd reset; sleep 2; ~/trbsoft/daqtools/merge_serial_address.pl $DAQ_TOOLS_PATH/base/serials_trb3.db $USER_DIR/db/addresses_trb3.db'; qx($cmd); sleep 3; # test trbnet: diff --git a/users/gsi_ee_trb84/db/addresses_dirich.db b/users/gsi_ee_trb84/db/addresses_dirich.db index 6613a19..48ba6d0 100644 --- a/users/gsi_ee_trb84/db/addresses_dirich.db +++ b/users/gsi_ee_trb84/db/addresses_dirich.db @@ -11,4 +11,5 @@ 0x1206 0006 1 0x1207 0007 1 0x1208 0008 1 +0x1209 0009 1 diff --git a/users/gsi_ee_trb84/db/addresses_trb3.db b/users/gsi_ee_trb84/db/addresses_trb3.db index a480b5f..31eaea0 100644 --- a/users/gsi_ee_trb84/db/addresses_trb3.db +++ b/users/gsi_ee_trb84/db/addresses_trb3.db @@ -32,3 +32,33 @@ 0x1583 158 3 0x8158 158 5 + +#slave +0x1700 170 0 +0x1701 170 1 +0x1702 170 2 +0x1703 170 3 +0x8170 170 5 + +#slave +0x1620 162 0 +0x1621 162 1 +0x1622 162 2 +0x1623 162 3 +0xc001 162 5 + + +#slave +0x1680 168 0 +0x1681 168 1 +0x1682 168 2 +0x1683 168 3 +0x8168 168 5 + + + + + + + + diff --git a/users/gsi_ee_trb84/db/register_configgbe.db b/users/gsi_ee_trb84/db/register_configgbe.db index ff87483..a35bfd3 100644 --- a/users/gsi_ee_trb84/db/register_configgbe.db +++ b/users/gsi_ee_trb84/db/register_configgbe.db @@ -1,15 +1,25 @@ !Register table # Type # C0 # C1 # C2 # C3 # C4 # C5 # C6 # C7 # C8 # C9 # C10 ########################################################################################################### - 0 0x8300 0x8301 0x8302 0x8303 0x8304 0x8305 0x8306 0x8307 0x8308 0x830b 0x830d - + 0 0x8300 0x8305 0x8307 0x8308 0x830b + 1 0x8301 0x8302 0x8304 0x8309 0x830c 0x830e 0x830f 0x8310 !Value table # Enable -# SubEvtId SubEvtDec QueDec PackSize FrameSize UseGbE UseTrbNet MultiQueue Trig. Num. MinEvtSize Readout Bit -# Hub # Type # C0 # C1 # C2 # C3 # C4 # C5 # C6 # C7 # C8 # C9 # C10 # -################################################################################################################################################################# - 0xc001 0 0xc001 0x00020001 0x00030062 0xEA60 0x578 1 0 1 0xffffff 0x7 0x1 - 0x8610 0 0x8000 0x00020001 0x00030062 0xEA60 0x578 1 0 1 0xffffff 0x7 0x1 - 0x8113 0 0x8001 0x00020001 0x00030062 0xEA60 0x578 1 0 1 0xffffff 0x7 0x1 - 0x8158 0 0x8002 0x00020001 0x00030062 0xEA60 0x578 1 0 1 0xffffff 0x7 0x1 +# SubEvtId UseGbE MultiQueue Trig. Num. InclTrgType +# Hub # Type # C0 # C1 # C2 # C3 # C4 +################################################################################## + 0xc001 0 0xc001 1 0 0xffffff 1 + 0x8610 0 0x8000 1 0 0xffffff 1 + 0x8113 0 0x8001 1 0 0xffffff 1 + 0x8158 0 0x8002 1 0 0xffffff 1 + + + + + +#These values to not need to be written - for completeness only +# SubEvtDec QueDec FrameSize RX enable SubEvtSize Evt/Queue QueueClose MaxQueueSize +# Hub # Type # C0 # C1 # C2 # C3 # C4 # C5 # C6 # C7 # +########################################################################################################################## +# 0xff7f 1 0x00020001 0x00030062 0x578 1 59800 200 32000 60000 diff --git a/users/gsi_ee_trb84/db/register_configgbe_ip.db b/users/gsi_ee_trb84/db/register_configgbe_ip.db index 93d22ed..df1a7a1 100644 --- a/users/gsi_ee_trb84/db/register_configgbe_ip.db +++ b/users/gsi_ee_trb84/db/register_configgbe_ip.db @@ -3,37 +3,33 @@ # EB 0: kp1pc105 eth1 00:1B:21:43:97:EA 192.168.0.2 ports 50000 - 50099 !Register table -# Type # C0 # C1 # C2 # C3 # C4 # C5 # C6 # C7 # C8 # -########################################################################################### +# Type # C0 # C1 # C2 # C3 # C4 # +####################################################### #new memory locations - 0 0x8100 0x8101 0x8102 0x8103 0x8104 0x8105 0x8106 0x8107 0x8108 - 1 0x8110 0x8111 0x8112 0x8113 0x8114 0x8115 0x8116 0x8117 0x8118 - 2 0x8120 0x8121 0x8122 0x8123 0x8124 0x8125 0x8126 0x8127 0x8128 - 3 0x8130 0x8131 0x8132 0x8133 0x8134 0x8135 0x8136 0x8137 0x8138 - 4 0x8140 0x8141 0x8142 0x8143 0x8144 0x8145 0x8146 0x8147 0x8148 - 5 0x8150 0x8151 0x8152 0x8153 0x8154 0x8155 0x8156 0x8157 0x8158 - 6 0x8160 0x8161 0x8162 0x8163 0x8164 0x8165 0x8166 0x8167 0x8168 - 7 0x8170 0x8171 0x8172 0x8173 0x8174 0x8175 0x8176 0x8177 0x8178 - 8 0x8180 0x8181 0x8182 0x8183 0x8184 0x8185 0x8186 0x8187 0x8188 - 9 0x8190 0x8191 0x8192 0x8193 0x8194 0x8195 0x8196 0x8197 0x8198 - 10 0x81A0 0x81A1 0x81A2 0x81A3 0x81A4 0x81A5 0x81A6 0x81A7 0x81A8 - 11 0x81B0 0x81B1 0x81B2 0x81B3 0x81B4 0x81B5 0x81B6 0x81B7 0x81B8 - 12 0x81C0 0x81C1 0x81C2 0x81C3 0x81C4 0x81C5 0x81C6 0x81C7 0x81C8 - 13 0x81D0 0x81D1 0x81D2 0x81D3 0x81D4 0x81D5 0x81D6 0x81D7 0x81D8 - 14 0x81E0 0x81E1 0x81E2 0x81E3 0x81E4 0x81E5 0x81E6 0x81E7 0x81E8 - 15 0x81F0 0x81F1 0x81F2 0x81F3 0x81F4 0x81F5 0x81F6 0x81F7 0x81F8 + 0 0x8100 0x8101 0x8102 0x8103 0x8107 + 1 0x8110 0x8111 0x8112 0x8113 0x8117 + 2 0x8120 0x8121 0x8122 0x8123 0x8127 + 3 0x8130 0x8131 0x8132 0x8133 0x8137 + 4 0x8140 0x8141 0x8142 0x8143 0x8147 + 5 0x8150 0x8151 0x8152 0x8153 0x8157 + 6 0x8160 0x8161 0x8162 0x8163 0x8167 + 7 0x8170 0x8171 0x8172 0x8173 0x8177 + 8 0x8180 0x8181 0x8182 0x8183 0x8187 + 9 0x8190 0x8191 0x8192 0x8193 0x8197 + 10 0x81A0 0x81A1 0x81A2 0x81A3 0x81A7 + 11 0x81B0 0x81B1 0x81B2 0x81B3 0x81B7 + 12 0x81C0 0x81C1 0x81C2 0x81C3 0x81C7 + 13 0x81D0 0x81D1 0x81D2 0x81D3 0x81D7 + 14 0x81E0 0x81E1 0x81E2 0x81E3 0x81E7 + 15 0x81F0 0x81F1 0x81F2 0x81F3 0x81F7 !Value table -# Dest MAC Dest MAC Dest IP Dest Port Src MAC Src MAC Src IP Src Port Packet Size -# Hub # Type # C0 # C1 # C2 # C3 # C4 # C5 # C6 # C7 # C8 # -######################################################################################################################################## - -# kp1pc105 -#0xc001 0 0x214397EA 0x001b 0xc0a80002 0xc3a4 0xDEADc000 0x001B 0xc0a80154 0xc350 0x0578 -#0x8000 0 0x214397EA 0x001b 0xc0a80002 0xc38d 0xDEADc000 0x001c 0xc0a80155 0xc350 0x0578 +# Dest MAC Dest MAC Dest IP Dest Port Src Port +# Hub # Type # C0 # C1 # C2 # C3 # C7 # +######################################################################## #14:dd:a9:d3:f4:b8 # hadesp39 - 0xc001 0 0xa9d3f4b8 0x14dd 0xc0a800b1 0xc3a4 0xDEADc000 0x001B 0xc0a80154 0xc350 0x0578 - 0x8610 0 0xa9d3f4b8 0x14dd 0xc0a800b1 0xc38d 0xDEADc001 0x001d 0xc0a80155 0xc350 0x0578 - 0x8113 0 0xa9d3f4b8 0x14dd 0xc0a800b1 0xc3c1 0xDEADc002 0x001d 0xc0a80156 0xc350 0x0578 - 0x8158 0 0xa9d3f4b8 0x14dd 0xc0a800b1 0xc3ee 0xDEADc003 0x001d 0xc0a80157 0xc350 0x0578 + 0xc001 0 0xa9d3f4b8 0x14dd 0xc0a800b1 50084 0xc350 + 0x8610 0 0xa9d3f4b8 0x14dd 0xc0a800b1 50061 0xc350 + 0x8113 0 0xa9d3f4b8 0x14dd 0xc0a800b1 50113 0xc350 + 0x8158 0 0xa9d3f4b8 0x14dd 0xc0a800b1 50158 0xc350 diff --git a/users/gsi_ee_trb84/first.C b/users/gsi_ee_trb84/first.C index d805e1d..dc9ff9e 100644 --- a/users/gsi_ee_trb84/first.C +++ b/users/gsi_ee_trb84/first.C @@ -10,16 +10,16 @@ void first() base::ProcMgr::instance()->SetHistFilling(4); // configure bubbles - hadaq::TdcProcessor::SetBubbleMode(3, 18); + //hadaq::TdcProcessor::SetBubbleMode(3, 18); - // this limits used for liner calibrations when nothing else is available - hadaq::TdcMessage::SetFineLimits(31, 491); + // this limits used for linear calibrations when nothing else is available + hadaq::TdcMessage::SetFineLimits(81, 464); // default channel numbers and edges mask - hadaq::TrbProcessor::SetDefaults(5, 1); + hadaq::TrbProcessor::SetDefaults(32, 1); // [min..max] range for TDC ids - hadaq::TrbProcessor::SetTDCRange(0x1200, 0x12FF); + hadaq::TrbProcessor::SetTDCRange(0x1200, 0x15FF); // [min..max] range for HUB ids hadaq::TrbProcessor::SetHUBRange(0x8000, 0x8fff); @@ -31,10 +31,10 @@ void first() const char* calname = getenv("CALNAME"); if ((calname==0) || (*calname==0)) calname = "test_"; const char* calmode = getenv("CALMODE"); - int cnt = (calmode && *calmode) ? atoi(calmode) : 10000; - cnt=100000; + int cnt = (calmode && *calmode) ? atoi(calmode) : 100000; + //cnt=100000; const char* caltrig = getenv("CALTRIG"); - unsigned trig = (caltrig && *caltrig) ? atoi(caltrig) : 0x1; + unsigned trig = (caltrig && *caltrig) ? atoi(caltrig) : 0x0; const char* uset = getenv("USETEMP"); unsigned use_temp = 0; // 0x80000000; if ((uset!=0) && (*uset!=0) && (strcmp(uset,"1")==0)) use_temp = 0x80000000; @@ -54,18 +54,19 @@ void first() // 0x3FFF - all kinds of trigger types will be used for calibration (excluding 0xE and 0xF) // 0x80000000 in mask enables usage of temperature correction hld->ConfigureCalibration(calname, cnt, (1 << trig) | use_temp); + //hld->ConfigureCalibration(calname, 100000, 1); // only accept trigger type 0x1 when storing file // new hadaq::HldFilter(0x1); // create ROOT file store - base::ProcMgr::instance()->CreateStore("td.root"); + //base::ProcMgr::instance()->CreateStore("td.root"); // 0 - disable store // 1 - std::vector - includes original TDC message // 2 - std::vector - compact form, without channel 0, stamp as float (relative to ch0) // 3 - std::vector - compact form, with channel 0, absolute time stamp as double - base::ProcMgr::instance()->SetStoreKind(2); + base::ProcMgr::instance()->SetStoreKind(0); // when configured as output in DABC, one specifies: @@ -95,14 +96,19 @@ extern "C" void after_create(hadaq::HldProcessor* hld) printf("Configure %s!\n", tdc->GetName()); - // tdc->SetUseLastHit(true); + tdc->SetUseLastHit(false); - // tdc->SetStoreEnabled(); - for (unsigned nch=2;nchNumChannels();nch++) - tdc->SetRefChannel(nch, nch-2, 0xffff, 20000, -10., 10.); + //tdc->SetStoreEnabled(); + for (unsigned nch=1; nchNumChannels(); nch++) { + tdc->SetRefChannel(nch, nch-1, 0xffff, 10000, -90., 90.); + } - tdc->SetRefChannel(1, tdc->NumChannels() -1 , 0xffff, 20000, -10., 10.); + //tdc->SetRefChannel(1, tdc->NumChannels() -1 , 0xffff, 20000, -10., 10.); + // tdc->SetRefChannel(6, 2 , 0xffff, 20000, -10., 10.); + //tdc->SetRefChannel(4, 2 , 0xffff, 20000, -10., 10.); + //tdc->SetRefChannel(7, 6 , 0xffff, 20000, -10., 10.); + } } diff --git a/users/gsi_ee_trb84/second.C b/users/gsi_ee_trb84/second.C index 71fdcc5..bde233b 100644 --- a/users/gsi_ee_trb84/second.C +++ b/users/gsi_ee_trb84/second.C @@ -114,5 +114,5 @@ void second() { //new SecondProc("A", "TDC_1133"); //new SecondProc("A", "TDC_1580"); - new SecondProc("A", "TDC_1207"); + new SecondProc("A", "TDC_1209"); } diff --git a/users/gsi_ee_trb84/startup.sh b/users/gsi_ee_trb84/startup.sh index ef5c93a..9f3a281 100755 --- a/users/gsi_ee_trb84/startup.sh +++ b/users/gsi_ee_trb84/startup.sh @@ -20,7 +20,7 @@ then ~/trbsoft/trbnettools/bin/trbnetd -i 84 fi -./check_ping.pl --reboot +#./check_ping.pl --reboot echo "reset" @@ -83,20 +83,17 @@ echo "TDC settings end" trbcmd w 0xfffe 0xc5 0x50ff #Dirich-Concentrator: enable reference time from RJ45 -trbcmd loadbit 0x8300 0xd580 0x6 0x6 +######trbcmd loadbit 0x8300 0xd580 0x6 0x6 echo "pulser" # pulser #0 to 10 kHz -trbcmd w 0xc001 0xa150 0x0000270f +trbcmd w 0xc001 0xa154 0x0000270f #trbcmd w 0xc001 0xa150 0x0022270f echo "trigger type" # set trigger type to 0x1 -trbcmd setbit 0xc001 0xa155 0x10 +trbcmd setbit 0xc001 0xa159 0x10 -echo "pulser enable" -# pulser enable -#trbcmd setbit 0xc001 0xa101 0x1 #trbcmd clearbit 0x1130 0xc801 0x80000000 # disable window #trbcmd w 0x1130 0xc802 0xffff0000 # enable upper 16 channels for padiwa @@ -114,3 +111,7 @@ trbcmd clearbit 0x1133 0xc801 0x80000000 # disable window trbcmd w 0x1133 0xc802 0x00000c03 # enable pulser #trbcmd setbit 0xc001 0xa101 0x8 # enable external trigger in of CTS + +echo "pulser enable" +# pulser enable +#trbcmd setbit 0xc001 0xa101 0x1 diff --git a/users/gsi_ee_trb84/trbreset_loop.pl b/users/gsi_ee_trb84/trbreset_loop.pl index 82b7efe..8edff9e 100755 --- a/users/gsi_ee_trb84/trbreset_loop.pl +++ b/users/gsi_ee_trb84/trbreset_loop.pl @@ -4,7 +4,7 @@ use strict; use warnings; ### Change THIS! -my $required_endpoints = 20; +my $required_endpoints = 23; @@ -14,7 +14,8 @@ my $number = 0; #js while (($number != 65) || ($counter > $max_counter)) { -while (($number < $required_endpoints) || ($counter > $max_counter)) { +#while (($number < $required_endpoints) || ($counter > $max_counter)) { +while (($number < $required_endpoints) ) { my $c; my $res; $counter++; -- 2.43.0