From 57922f660b838274cd14012237a77aaabb85aadc Mon Sep 17 00:00:00 2001 From: Hadaq in Frankfurt Date: Tue, 19 Mar 2013 09:46:24 +0100 Subject: [PATCH] removed hardcoded addresses and paths, changed to one chain on TRB3 --- soft/toolbox/Hmon.pm | 2 +- soft/toolbox/jtag_atomic/chains.ini | 79 +------------------ .../jtag_atomic/copy_on_datachanged.pl | 1 - soft/toolbox/jtag_atomic/files/.gitignore | 1 + .../jtag_atomic/jtagmonitor_lastcounters.ini | 50 ++++-------- .../jtag_atomic/jtagmonitor_usechainsini4.pl | 51 ++++++------ soft/toolbox/jtag_atomic/the_gui.pl | 1 - soft/toolbox/jtag_atomic/ui.pl | 2 +- soft/toolbox/jtag_atomic/ui_writeram.pl | 2 +- soft/toolbox/prototype_setup.db | 18 ++--- soft/toolbox/sensors/sensor1.ini | 3 +- soft/toolbox/sensors/sensor2.ini | 4 +- soft/toolbox/sensors/sensor3.ini | 4 +- 13 files changed, 64 insertions(+), 154 deletions(-) create mode 100644 soft/toolbox/jtag_atomic/files/.gitignore diff --git a/soft/toolbox/Hmon.pm b/soft/toolbox/Hmon.pm index b169231..9f3aabb 100644 --- a/soft/toolbox/Hmon.pm +++ b/soft/toolbox/Hmon.pm @@ -4,7 +4,7 @@ use Data::Dumper; use warnings; use strict; -use constant HMONDIR => "/local.1/daq/mvdmon/"; +use constant HMONDIR => "./"; our %hublist; our $r_hublist = \%hublist; diff --git a/soft/toolbox/jtag_atomic/chains.ini b/soft/toolbox/jtag_atomic/chains.ini index 072ee22..837a05f 100644 --- a/soft/toolbox/jtag_atomic/chains.ini +++ b/soft/toolbox/jtag_atomic/chains.ini @@ -1,7 +1,7 @@ ;WARNING this file is generated automatically. don't edit manually. [chain1] -FPGAtrbnetAddr=0xf013 +FPGAtrbnetAddr=0xf308 RAMtrbnetAddr=0xa000 CMDreg_trbnetAddr=0xa120 RAMbase_trbnetAddr=0xa121 @@ -44,80 +44,3 @@ JNR1_sensor3=sensor3.ini JNR2_sensor2=sensor2.ini JNR3_sensor1=sensor1.ini ;END GENERATE_CHAINORDER chain1 - -[chain2] -FPGAtrbnetAddr=0xf013 -RAMtrbnetAddr=0xa000 -CMDreg_trbnetAddr=0xa320 -RAMbase_trbnetAddr=0xa321 -DATAreg_trbnetAddr=0xa322 -STATUS2RAM3BBASEADDRREGtrbnetAddr=0xa363 -STATUS2RAM3BtrbnetAddr=0xa370 -CONFsignals_trbnetAddr=0xb021 -CONFresetafterfirstwrite_trbnetAddr=0xb011 -CONFresetbeforeinit_trbnetAddr=0xb010 -CONFtrigmapsstart_trbnetAddr=0xb00e -CONFtrigmapsreset_trbnetAddr=0xb00d -CONFtrigrunjtag_trbnetAddr=0xb00f -CONFtrigwriteonce_trbnetAddr=0xb014 -CONFtriginitseq_trbnetAddr=0xb00c -chainnr=1 -DEBUGram1baddr=0xa347 -DEBUGram1bdata=0xa348 -DEBUGram1caddr=0xa349 -DEBUGram1cdata=0xa34a -DEBUGram1crun=0xa34b -; guiBM_NP_defaults1/guiBM_NP_defaults2 is a comma separated list of the following strings representing buttons in the gui: -;'h_man_maps_reset', 'h_delay0', 'h_delay1', 'h_delay2', 'h_delay3', 'h_prog_ram', 'h_set_timing_10mhz', 'h_set_timing_1mhz', 'h_set_timing_100khz', -; 'h_set_inout', 'h_maps_reset_before_on', 'h_maps_reset_after_on', 'h_maps_reset_before_off', 'h_maps_reset_after_off', -;'h_maps_clk_on', 'h_maps_clk_off', 'h_trig_init_seq', 'h_maps_reset', 'h_run_jtag', 'h_write_once', 'h_maps_start' -; gui_defaults1: executed in this order, before board defaults -; gui_defaults2: executed in this order, after board defaults -guiBM_NP_defaults1=h_delay1,h_prog_ram,h_set_timing_10mhz,h_set_inout,h_maps_reset_before_off,h_maps_reset_after_on -guiBM_NP_defaults2="" - - -;BEGIN GENERATE_CHAINORDER chain2 -JNR0_sensor8=sensor8.ini -JNR1_sensor7=sensor7.ini -JNR2_sensor6=sensor6.ini -JNR3_sensor5=sensor5.ini -;END GENERATE_CHAINORDER chain2 - -[chain3] -FPGAtrbnetAddr=0xf013 -RAMtrbnetAddr=0xa400 -CMDreg_trbnetAddr=0xa520 -RAMbase_trbnetAddr=0xa521 -DATAreg_trbnetAddr=0xa522 -STATUS2RAM3BBASEADDRREGtrbnetAddr=0xe163 -STATUS2RAM3BtrbnetAddr=0xa570 -CONFsignals_trbnetAddr=0xb022 -CONFresetafterfirstwrite_trbnetAddr=0xb011 -CONFresetbeforeinit_trbnetAddr=0xb010 -CONFtrigmapsstart_trbnetAddr=0xb00e -CONFtrigmapsreset_trbnetAddr=0xb00d -CONFtrigrunjtag_trbnetAddr=0xb00f -CONFtrigwriteonce_trbnetAddr=0xb014 -CONFtriginitseq_trbnetAddr=0xb00c -chainnr=2 -DEBUGram1baddr=0xa547 -DEBUGram1bdata=0xa548 -DEBUGram1caddr=0xa549 -DEBUGram1cdata=0xa54a -DEBUGram1crun=0xa54b -; guiBM_NP_defaults1/guiBM_NP_defaults2 is a comma separated list of the following strings representing buttons in the gui: -;'h_man_maps_reset', 'h_delay0', 'h_delay1', 'h_delay2', 'h_delay3', 'h_prog_ram', 'h_set_timing_10mhz', 'h_set_timing_1mhz', 'h_set_timing_100khz', -; 'h_set_inout', 'h_maps_reset_before_on', 'h_maps_reset_after_on', 'h_maps_reset_before_off', 'h_maps_reset_after_off', -;'h_maps_clk_on', 'h_maps_clk_off', 'h_trig_init_seq', 'h_maps_reset', 'h_run_jtag', 'h_write_once', 'h_maps_start' -; gui_defaults1: executed in this order, before board defaults -; gui_defaults2: executed in this order, after board defaults -guiBM_NP_defaults1=h_delay1,h_prog_ram,h_set_timing_10mhz,h_set_inout,h_maps_reset_before_off,h_maps_reset_after_on -guiBM_NP_defaults2="" - - -;BEGIN GENERATE_CHAINORDER chain3 -JNR0_sensor12=sensor12.ini -JNR1_sensor10=sensor10.ini -JNR2_sensor9=sensor9.ini -;END GENERATE_CHAINORDER chain3 diff --git a/soft/toolbox/jtag_atomic/copy_on_datachanged.pl b/soft/toolbox/jtag_atomic/copy_on_datachanged.pl index b1b530e..b2a8c9c 100755 --- a/soft/toolbox/jtag_atomic/copy_on_datachanged.pl +++ b/soft/toolbox/jtag_atomic/copy_on_datachanged.pl @@ -38,7 +38,6 @@ required: " } -$ENV{DAQOPSERVER}='trb124'; sub int_to_32bit_hex($) { my ($in) = @_; diff --git a/soft/toolbox/jtag_atomic/files/.gitignore b/soft/toolbox/jtag_atomic/files/.gitignore new file mode 100644 index 0000000..72e8ffc --- /dev/null +++ b/soft/toolbox/jtag_atomic/files/.gitignore @@ -0,0 +1 @@ +* diff --git a/soft/toolbox/jtag_atomic/jtagmonitor_lastcounters.ini b/soft/toolbox/jtag_atomic/jtagmonitor_lastcounters.ini index 4aee137..2b7fc73 100644 --- a/soft/toolbox/jtag_atomic/jtagmonitor_lastcounters.ini +++ b/soft/toolbox/jtag_atomic/jtagmonitor_lastcounters.ini @@ -1,35 +1,17 @@ [chain1] -JNR3_sensor1_rerrors= -JNR3_sensor1_werrors= -JNR3_sensor1_run= -JNR3_sensor1_datach= -JNR2_sensor2_rerrors= -JNR2_sensor2_werrors= -JNR2_sensor2_run= -JNR2_sensor2_datach= -JNR1_sensor3_rerrors= -JNR1_sensor3_werrors= -JNR1_sensor3_run= -JNR1_sensor3_datach= -JNR0_sensor4_rerrors= -JNR0_sensor4_werrors= -JNR0_sensor4_run= -JNR0_sensor4_datach= -[chain2] -JNR3_sensor5_rerrors= -JNR3_sensor5_werrors= -JNR3_sensor5_run= -JNR3_sensor5_datach= -JNR2_sensor6_rerrors= -JNR2_sensor6_werrors= -JNR2_sensor6_run= -JNR2_sensor6_datach= -JNR1_sensor7_rerrors= -JNR1_sensor7_werrors= -JNR1_sensor7_run= -JNR1_sensor7_datach= -JNR0_sensor8_rerrors= -JNR0_sensor8_werrors= -JNR0_sensor8_run= -JNR0_sensor8_datach= -[chain3] +JNR3_sensor1_rerrors=1 +JNR3_sensor1_werrors=1 +JNR3_sensor1_run=6 +JNR3_sensor1_datach=1 +JNR2_sensor2_rerrors=1 +JNR2_sensor2_werrors=1 +JNR2_sensor2_run=6 +JNR2_sensor2_datach=1 +JNR1_sensor3_rerrors=1 +JNR1_sensor3_werrors=1 +JNR1_sensor3_run=6 +JNR1_sensor3_datach=1 +JNR0_sensor4_rerrors=1 +JNR0_sensor4_werrors=1 +JNR0_sensor4_run=6 +JNR0_sensor4_datach=1 diff --git a/soft/toolbox/jtag_atomic/jtagmonitor_usechainsini4.pl b/soft/toolbox/jtag_atomic/jtagmonitor_usechainsini4.pl index 7965e0b..3da19d5 100755 --- a/soft/toolbox/jtag_atomic/jtagmonitor_usechainsini4.pl +++ b/soft/toolbox/jtag_atomic/jtagmonitor_usechainsini4.pl @@ -6,18 +6,19 @@ use Time::HiRes qw( gettimeofday usleep time ); use FileHandle; use Data::Dumper; use POSIX qw/floor ceil/; +use lib qw(libs); use Config::Abstract::Ini; use Sys::Syslog; my %laststore; my $totalsum = 0; use HADES::TrbNet; -use lib qw(/daq/toolbox); +use lib qw(../); use Hmon; use QA; use HPlot; openlog("atomic,jtagmonitor_usechainsini4.pl", "perror", "local1"); syslog("INFO", "starting monitor"); -$ENV{DAQOPSERVER}='trb124'; +#$ENV{DAQOPSERVER}='trb124'; sub int_to_32bit_hex($) { my ($in) = @_; @@ -41,7 +42,7 @@ sub colored_table { } -$ENV{DAQOPSERVER}='trb124'; +#$ENV{DAQOPSERVER}='trb124'; trb_init_ports() or die trb_strerror(); my $chainsfile= './chains.ini'; @@ -60,11 +61,12 @@ while (1){ sleep(1); foreach my $chain (keys %allchains) { my %settings=%{$allchains{$chain}}; - my $fpga_addr = $settings{'FPGAtrbnetAddr'}; - my $cmd_reg_addr = $settings{'CMDreg_trbnetAddr'}; - my $status2_ram3b_baseaddr_reg_addr = $settings{'STATUS2RAM3BBASEADDRREGtrbnetAddr'}; - my $status2_ram3b_addr = $settings{'STATUS2RAM3BtrbnetAddr'}; - system("trbcmd w $fpga_addr $cmd_reg_addr 0x00000063"); # command: M26C_CMD_COPY_TO_STATUS2 + my $fpga_addr = hex(substr($settings{'FPGAtrbnetAddr'},2)); + my $cmd_reg_addr = hex(substr($settings{'CMDreg_trbnetAddr'},2)); + my $status2_ram3b_baseaddr_reg_addr = hex(substr($settings{'STATUS2RAM3BBASEADDRREGtrbnetAddr'},2)); + my $status2_ram3b_addr = hex(substr($settings{'STATUS2RAM3BtrbnetAddr'},2)); + trb_register_write($fpga_addr,$cmd_reg_addr,0x00000063); +# system("trbcmd w $fpga_addr $cmd_reg_addr 0x00000063"); # command: M26C_CMD_COPY_TO_STATUS2 } sleep(1); # my $str = Hmon::MakeDate(0,0,""); @@ -76,10 +78,10 @@ while (1){ my $run_counter_changed = 0; foreach my $chain (sort(keys %allchains)) { my %settings=%{$allchains{$chain}}; - my $fpga_addr = $settings{'FPGAtrbnetAddr'}; - my $cmd_reg_addr = $settings{'CMDreg_trbnetAddr'}; - my $status2_ram3b_baseaddr_reg_addr = $settings{'STATUS2RAM3BBASEADDRREGtrbnetAddr'}; - my $status2_ram3b_addr = $settings{'STATUS2RAM3BtrbnetAddr'}; + my $fpga_addr = hex(substr($settings{'FPGAtrbnetAddr'},2)); + my $cmd_reg_addr = hex(substr($settings{'CMDreg_trbnetAddr'},2)); + my $status2_ram3b_baseaddr_reg_addr = hex(substr($settings{'STATUS2RAM3BBASEADDRREGtrbnetAddr'},2)); + my $status2_ram3b_addr = hex(substr($settings{'STATUS2RAM3BtrbnetAddr'},2)); my @sensors; my @vert_list1; my @vert_list2; @@ -96,20 +98,23 @@ while (1){ if ($setting_name =~ /sensor[0-9]+/) { push(@sensors, $setting_name); my $i = (scalar @sensors)-1; - my $rambasepointer=int_to_32bit_hex(($i)*4); - print "trbcmd w $fpga_addr $status2_ram3b_baseaddr_reg_addr 0x$rambasepointer\n"; # ADDR_STATUS2_RAM3B_BASEADDR // FIRST COL - system("trbcmd w $fpga_addr $status2_ram3b_baseaddr_reg_addr 0x$rambasepointer"); # ADDR_STATUS2_RAM3B_BASEADDR // FIRST COL + my $rambasepointer=(($i)*4); #int_to_32bit_hex(($i)*4); + print "trbcmd w $fpga_addr $status2_ram3b_baseaddr_reg_addr $rambasepointer\n"; # ADDR_STATUS2_RAM3B_BASEADDR // FIRST COL + trb_register_write($fpga_addr,$status2_ram3b_baseaddr_reg_addr, $rambasepointer); +# system("trbcmd w $fpga_addr $status2_ram3b_baseaddr_reg_addr 0x$rambasepointer"); # ADDR_STATUS2_RAM3B_BASEADDR // FIRST COL print "reading $fpga_addr $status2_ram3b_addr.\n"; - my $rerrors1 = trb_register_read(hex($fpga_addr), hex($status2_ram3b_addr)); - print "reading $fpga_addr " .(hex($status2_ram3b_addr)+2) ."\n"; - my $werrors1 = trb_register_read(hex($fpga_addr), hex($status2_ram3b_addr)+2); + my $rerrors1 = trb_register_read(($fpga_addr), ($status2_ram3b_addr)); + print Dumper $rerrors1; + print "reading $fpga_addr " .(($status2_ram3b_addr)+2) ."\n"; + my $werrors1 = trb_register_read(($fpga_addr), ($status2_ram3b_addr)+2); - $rambasepointer=int_to_32bit_hex(($i)*4+2); - print "trbcmd w $fpga_addr $status2_ram3b_baseaddr_reg_addr 0x$rambasepointer\n"; # ADDR_STATUS2_RAM3B_BASEADDR // FIRST COL - system("trbcmd w $fpga_addr $status2_ram3b_baseaddr_reg_addr 0x$rambasepointer"); # ADDR_STATUS2_RAM3B_BASEADDR // SECOND COL - my $run = trb_register_read(hex($fpga_addr), hex($status2_ram3b_addr)); - my $dat = trb_register_read(hex($fpga_addr), hex($status2_ram3b_addr)+2); + $rambasepointer=(($i)*4+2);#int_to_32bit_(($i)*4+2); + print "trbcmd w $fpga_addr $status2_ram3b_baseaddr_reg_addr $rambasepointer\n"; # ADDR_STATUS2_RAM3B_BASEADDR // FIRST COL + trb_register_write($fpga_addr,$status2_ram3b_baseaddr_reg_addr, $rambasepointer); +# system("trbcmd w $fpga_addr $status2_ram3b_baseaddr_reg_addr 0x$rambasepointer"); # ADDR_STATUS2_RAM3B_BASEADDR // SECOND COL + my $run = trb_register_read(($fpga_addr), ($status2_ram3b_addr)); + my $dat = trb_register_read(($fpga_addr), ($status2_ram3b_addr)+2); my $k=0, $v=0; diff --git a/soft/toolbox/jtag_atomic/the_gui.pl b/soft/toolbox/jtag_atomic/the_gui.pl index b602b82..1026a58 100755 --- a/soft/toolbox/jtag_atomic/the_gui.pl +++ b/soft/toolbox/jtag_atomic/the_gui.pl @@ -7,7 +7,6 @@ use POSIX qw(strftime); use FileHandle; require "./ui_generators.pl"; -$ENV{DAQOPSERVER}='trb124'; if(not( -e "/tmp/jtag_initmem")) { system("mkdir /tmp/jtag_initmem"); } diff --git a/soft/toolbox/jtag_atomic/ui.pl b/soft/toolbox/jtag_atomic/ui.pl index b692f33..9f8ac91 100755 --- a/soft/toolbox/jtag_atomic/ui.pl +++ b/soft/toolbox/jtag_atomic/ui.pl @@ -10,7 +10,7 @@ use Sys::Syslog; require "./ui_generators.pl"; -$ENV{DAQOPSERVER}='trb124'; +#$ENV{DAQOPSERVER}='trb124'; my $opt_help; my $opt_chain; diff --git a/soft/toolbox/jtag_atomic/ui_writeram.pl b/soft/toolbox/jtag_atomic/ui_writeram.pl index a71c7e1..9336a96 100755 --- a/soft/toolbox/jtag_atomic/ui_writeram.pl +++ b/soft/toolbox/jtag_atomic/ui_writeram.pl @@ -254,7 +254,7 @@ foreach my $chain (keys %allchains) { @drs_length = (); my $sensorfile = $settings{$setting_name}; if(not defined($opt_quiet)) { print "loading sensor file: $sensorfile\n"; } - my $sensorSettingsO = new Config::Abstract::Ini("/daq/toolbox/sensors/".$sensorfile); + my $sensorSettingsO = new Config::Abstract::Ini("../sensors/".$sensorfile); my %sensorSettings = $sensorSettingsO->get_all_settings; my $this_irlen = $sensorSettingsO->get_entry_setting('General', 'IRLEN', '5'); my $bypassreg = $sensorSettingsO->get_entry_setting('General', 'BYPASSREG', '1F'); diff --git a/soft/toolbox/prototype_setup.db b/soft/toolbox/prototype_setup.db index c75155a..13f7dd3 100644 --- a/soft/toolbox/prototype_setup.db +++ b/soft/toolbox/prototype_setup.db @@ -97,15 +97,15 @@ sensor2 chain1 2 1.2 sensor3 chain1 1 1.4 sensor4 chain1 0 1.5 -sensor5 chain2 3 1.7 -sensor6 chain2 2 1.8 -sensor7 chain2 1 4.1 -sensor8 chain2 0 4.2 - -sensor9 chain3 2 4.3 -sensor10 chain3 1 4.4 -sensor11 chain3 F 4.5 -sensor12 chain3 0 4.6 +#sensor5 chain2 3 1.7 +#sensor6 chain2 2 1.8 +#sensor7 chain2 1 4.1 +#sensor8 chain2 0 4.2 + +#sensor9 chain3 2 4.3 +#sensor10 chain3 1 4.4 +#sensor11 chain3 F 4.5 +#sensor12 chain3 0 4.6 ==================================================== diff --git a/soft/toolbox/sensors/sensor1.ini b/soft/toolbox/sensors/sensor1.ini index 312402e..480804b 100644 --- a/soft/toolbox/sensors/sensor1.ini +++ b/soft/toolbox/sensors/sensor1.ini @@ -2,7 +2,8 @@ IRLEN=5 BYPASSREG=1F [Data] -00=0F,152,006432202064C1B08BAB32648020280A0A0A0A64 +; Format: Laufende Nummer=HEXADECIMAL INSTRUCTION REGISTER,REGISTER LENGTH IN BITS,HEXADECIMAL DATA REGISTER LIKE ARABIC NUMBERS(PADDED WITH LEADING ZEROS TO MULTIPLE OF 32 BIT) +00=0F,152,00643220206481B08BAB32648020280A0A0A0A64 ;00=0F,152,006432202064FFFFFFFF32768020280A0A0A0A64 ;00=0F,152,0064322020649ECD74C532768020280A0A0A0A5F Bertrams LAST ;00=0F,152,006432202064B8E3ADD032768020280A0A0A0A64 diff --git a/soft/toolbox/sensors/sensor2.ini b/soft/toolbox/sensors/sensor2.ini index 65583d1..b75eeb4 100644 --- a/soft/toolbox/sensors/sensor2.ini +++ b/soft/toolbox/sensors/sensor2.ini @@ -2,7 +2,7 @@ IRLEN=5 BYPASSREG=1F [Data] -00=0F,152,006432202064A9D2DEA232648020280A0A0A0A64 +00=0F,152,006432202064FFFFFFFF32648020280A0A0A0A64 ;00=0F,152,006432202064AFDAE2A932648020280A0A0A0A64 ;00=0F,152,006432202064FFFFFFFF32768020280A0A0A0A64 ;00=0F,152,0064322020649ECD74C532768020280A0A0A0A5F Bertrams LAST @@ -44,4 +44,4 @@ BYPASSREG=1F ;00=0F,152,006432202064B8E183D532768020280A0A0A0A5F FPC13_R recalib manually by BN -;00=0F,152,006432202064AED883D132768020280A0A0A0A64 Boris recalib CVD sensor (both on 1 FEB) \ No newline at end of file +;00=0F,152,006432202064AED883D132768020280A0A0A0A64 Boris recalib CVD sensor (both on 1 FEB) diff --git a/soft/toolbox/sensors/sensor3.ini b/soft/toolbox/sensors/sensor3.ini index fbd601b..5ec76a9 100644 --- a/soft/toolbox/sensors/sensor3.ini +++ b/soft/toolbox/sensors/sensor3.ini @@ -2,7 +2,7 @@ IRLEN=5 BYPASSREG=1F [Data] -00=0F,152,006432202064A9C1D3C432648020280A0A0A0A64 +00=0F,152,006432202064FFFFFFFF32648020280A0A0A0A64 ;00=0F,152,006432202064FFFFFFFF32768020280A0A0A0A64 ;00=0F,152,0064322020649ECD74C532768020280A0A0A0A5F Bertrams LAST ;00=0F,152,006432202064B8E3ADD032768020280A0A0A0A64 @@ -42,4 +42,4 @@ BYPASSREG=1F ;00=0F,152,006432202064B8E183D532768020280A0A0A0A5F FPC13_R recalib manually by BN -;00=0F,152,006432202064AED883D132768020280A0A0A0A64 Boris recalib CVD sensor (both on 1 FEB) \ No newline at end of file +;00=0F,152,006432202064AED883D132768020280A0A0A0A64 Boris recalib CVD sensor (both on 1 FEB) -- 2.43.0