use warnings;
use strict;
-use constant HMONDIR => "/local.1/daq/mvdmon/";
+use constant HMONDIR => "./";
our %hublist;
our $r_hublist = \%hublist;
;WARNING this file is generated automatically. don't edit manually.
[chain1]
-FPGAtrbnetAddr=0xf013
+FPGAtrbnetAddr=0xf308
RAMtrbnetAddr=0xa000
CMDreg_trbnetAddr=0xa120
RAMbase_trbnetAddr=0xa121
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
"
}
-$ENV{DAQOPSERVER}='trb124';
sub int_to_32bit_hex($) {
my ($in) = @_;
[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
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) = @_;
}
-$ENV{DAQOPSERVER}='trb124';
+#$ENV{DAQOPSERVER}='trb124';
trb_init_ports() or die trb_strerror();
my $chainsfile= './chains.ini';
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,"");
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;
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;
use FileHandle;
require "./ui_generators.pl";
-$ENV{DAQOPSERVER}='trb124';
if(not( -e "/tmp/jtag_initmem")) {
system("mkdir /tmp/jtag_initmem");
}
require "./ui_generators.pl";
-$ENV{DAQOPSERVER}='trb124';
+#$ENV{DAQOPSERVER}='trb124';
my $opt_help;
my $opt_chain;
@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');
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
====================================================
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
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
;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)
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
;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)