]> jspc29.x-matter.uni-frankfurt.de Git - jtag_mvd.git/commitdiff
some more changes to ui.pl
authorJan Michel <j.michel@gsi.de>
Fri, 12 Jul 2013 14:17:16 +0000 (16:17 +0200)
committerJan Michel <j.michel@gsi.de>
Fri, 12 Jul 2013 14:17:16 +0000 (16:17 +0200)
soft/toolbox/jtag_atomic/ui.pl
soft/toolbox/jtag_atomic/ui_generators.pl

index f43b9ec5cfcdf961b036014dcf7a0eaa0394e0f3..5352d45dc71f890801e56b02d57f6d06ecbc8580 100755 (executable)
@@ -53,8 +53,6 @@ required:
    [-q|--quiet  ]             : suppress informative output
     
 board operations (no chain parameter given):
-    prog_fpga :             program FPGA on trb
-    start_trbnetd:          start trbnet daemon on trb
     waitbeforestart_6us:    set wait before start time to 6 us
     waitbeforestart_1ms:    set wait before start time to 1 ms
     waitbeforestart_1s:     set wait before start time to 1 s
@@ -178,30 +176,14 @@ my %allboards = $boardsSettings->get_all_settings;
 foreach my $board (keys %allboards) {
   my %settings=%{$allboards{$board}};
   my $chainsini = $settings{'chainsini'};
-  my $trbhostname = $settings{'FPGAboard_hostname'};
-  my $addonortrb = $settings{'FPGAboard_addonortrb'};
-  my $staplfilename = $settings{'FPGAboard_staplfilename'};
   my $fpga_addr = any2dec($settings{'FPGAtrbnetAddr'});
-  my $conf_period_addr = any2dec($settings{'CONFperiod_trbnetAddr'});
-  my $conf_offspillcounter_addr = any2dec($settings{'CONFoffspillcounter_trbnetAddr'});
   my $conf_waitstart_addr = any2dec($settings{'CONFwaitstart_trbnetAddr'});
-  my $conf_triginitseq_addr = any2dec($settings{'CONFtriginitseq_trbnetAddr'});
-  my $conf_trigmapsreset_addr = any2dec($settings{'CONFtrigmapsreset_trbnetAddr'});
-  my $conf_trigrunjtag_addr = any2dec($settings{'CONFtrigrunjtag_trbnetAddr'});
-  my $conf_trigwriteonce_addr = any2dec($settings{'CONFtrigwriteonce_trbnetAddr'});
-  my $conf_trigmapsstart_addr = any2dec($settings{'CONFtrigmapsstart_trbnetAddr'});
 
 
   if(defined($opt_board) and not defined($opt_chain)) {
     # assume board command
     my $subr;
-    if(("h_".$opt_operation) eq 'h_prog_fpga') {
-      $subr = generate_h_prog_fpga($board, $trbhostname, $addonortrb, $staplfilename)
-    }
-    elsif(("h_".$opt_operation) eq 'h_start_trbnetd'){
-      $subr =  generate_h_start_trbnetd($board, $trbhostname);
-    }
-    elsif(("h_".$opt_operation) eq   'h_waitbeforestart_6us' ) {
+    if(("h_".$opt_operation) eq   'h_waitbeforestart_6us' ) {
       $subr =  generate_h_waitbeforestart_6us($board, $fpga_addr, $conf_waitstart_addr);
     }
     elsif(("h_".$opt_operation) eq   'h_waitbeforestart_1ms' ) {
@@ -211,18 +193,23 @@ foreach my $board (keys %allboards) {
       $subr =  generate_h_waitbeforestart_1s($board, $fpga_addr, $conf_waitstart_addr);
     }
     elsif(("h_".$opt_operation) eq 'h_trigger_init_sequence' ) {
+      my $conf_triginitseq_addr = any2dec($settings{'CONFtriginitseq_trbnetAddr'});
       $subr =  generate_h_trig($board, $fpga_addr, $conf_triginitseq_addr);
     }
     elsif(("h_".$opt_operation) eq   'h_maps_reset' ) {
+      my $conf_trigmapsreset_addr = any2dec($settings{'CONFtrigmapsreset_trbnetAddr'});
       $subr =  generate_h_trig($board, $fpga_addr, $conf_trigmapsreset_addr);
     }
     elsif(("h_".$opt_operation) eq   'h_run_jtag' ) {
+      my $conf_trigrunjtag_addr = any2dec($settings{'CONFtrigrunjtag_trbnetAddr'});
       $subr =  generate_h_trig($board, $fpga_addr, $conf_trigrunjtag_addr);
     }
     elsif(("h_".$opt_operation) eq   'h_write_once' ) {
+      my $conf_trigwriteonce_addr = any2dec($settings{'CONFtrigwriteonce_trbnetAddr'});
       $subr =  generate_h_trig($board, $fpga_addr, $conf_trigwriteonce_addr);
     }
     elsif(("h_".$opt_operation) eq   'h_maps_start' ) {
+      my $conf_trigmapsstart_addr = any2dec($settings{'CONFtrigmapsstart_trbnetAddr'});
       $subr =  generate_h_trig($board, $fpga_addr, $conf_trigmapsstart_addr);
     }
     unless ($subr==1) {
@@ -240,25 +227,11 @@ $chainsini = $ENV{'JTAGCONFIGPATH'}."/".$chainsini if exists($ENV{'JTAGCONFIGPAT
     my $chain = $opt_chain;
     my %chain_settings=%{$allchains{$chain}};
     my $chain_fpga_addr = any2dec($chain_settings{'FPGAtrbnetAddr'});
-    my $ram_addr  = any2dec($chain_settings{'RAMtrbnetAddr'});
     my $cmd_reg_addr = any2dec($chain_settings{'CMDreg_trbnetAddr'});
-    my $ram_base_addr  = any2dec($chain_settings{'RAMbase_trbnetAddr'});
     my $data_reg_addr = any2dec($chain_settings{'DATAreg_trbnetAddr'});
-    my $conf_signals_addr = any2dec($chain_settings{'CONFsignals_trbnetAddr'});
-    my $conf_resetafterfirstwrite_addr = any2dec($chain_settings{'CONFresetafterfirstwrite_trbnetAddr'});
-    my $conf_resetbeforeinit_addr = any2dec($chain_settings{'CONFresetbeforeinit_trbnetAddr'});
-    my $conf_chain_triginitseq_addr = any2dec($chain_settings{'CONFtriginitseq_trbnetAddr'});
-    my $conf_chain_trigmapsreset_addr = any2dec($chain_settings{'CONFtrigmapsreset_trbnetAddr'});
-    my $conf_chain_trigrunjtag_addr = any2dec($chain_settings{'CONFtrigrunjtag_trbnetAddr'});
-    my $conf_chain_trigwriteonce_addr = any2dec($chain_settings{'CONFtrigwriteonce_trbnetAddr'});
-    my $conf_chain_trigmapsstart_addr = any2dec($chain_settings{'CONFtrigmapsstart_trbnetAddr'});  
-    my $debug_chain_ram1baddr_addr = any2dec($chain_settings{'DEBUGram1baddr'});  
-    my $debug_chain_ram1bdata_addr = any2dec($chain_settings{'DEBUGram1bdata'});  
-    my $debug_chain_ram1caddr_addr = any2dec($chain_settings{'DEBUGram1caddr'});  
-    my $debug_chain_ram1cdata_addr = any2dec($chain_settings{'DEBUGram1cdata'});  
-    my $chainnr = $chain_settings{'chainnr'};
     my $subr;
     if(("h_".$opt_operation) eq  'h_man_maps_reset') {
+      my $conf_signals_addr = any2dec($chain_settings{'CONFsignals_trbnetAddr'});
       $subr = generate_h_man_maps_reset($chain, $chain_fpga_addr, $conf_signals_addr);
     } 
     elsif(("h_".$opt_operation) eq 'h_delay0' ) {
@@ -286,46 +259,66 @@ $chainsini = $ENV{'JTAGCONFIGPATH'}."/".$chainsini if exists($ENV{'JTAGCONFIGPAT
       $subr =  generate_h_set_timing_100khz($chain, $chain_fpga_addr,$cmd_reg_addr, $data_reg_addr);
     }
     elsif(("h_".$opt_operation) eq 'h_set_inout' ) {
+      my $conf_signals_addr = any2dec($chain_settings{'CONFsignals_trbnetAddr'});
       $subr =  generate_h_set_inout($chain, $chain_fpga_addr, $conf_signals_addr);
     }
     elsif(("h_".$opt_operation) eq 'h_maps_reset_before_on' ) {
+      my $chainnr = $chain_settings{'chainnr'};
+      my $conf_resetbeforeinit_addr = any2dec($chain_settings{'CONFresetbeforeinit_trbnetAddr'});
       $subr =  generate_h_maps_reset(1,$chain, $chainnr, $chain_fpga_addr, $conf_resetbeforeinit_addr);
     }
     elsif(("h_".$opt_operation) eq 'h_maps_reset_before_off' ) {
+      my $chainnr = $chain_settings{'chainnr'};
+      my $conf_resetbeforeinit_addr = any2dec($chain_settings{'CONFresetbeforeinit_trbnetAddr'});
       $subr =  generate_h_maps_reset(0,$chain, $chainnr, $chain_fpga_addr, $conf_resetbeforeinit_addr);
     } 
     elsif(("h_".$opt_operation) eq 'h_maps_reset_after_on' ) {
+      my $chainnr = $chain_settings{'chainnr'};
+      my $conf_resetafterfirstwrite_addr = any2dec($chain_settings{'CONFresetafterfirstwrite_trbnetAddr'});
       $subr =  generate_h_maps_reset(1,$chain, $chainnr, $chain_fpga_addr, $conf_resetafterfirstwrite_addr);
     }
     elsif(("h_".$opt_operation) eq 'h_maps_reset_after_off' ) {
+      my $chainnr = $chain_settings{'chainnr'};
+      my $conf_resetafterfirstwrite_addr = any2dec($chain_settings{'CONFresetafterfirstwrite_trbnetAddr'});
       $subr =  generate_h_maps_reset(0,$chain, $chainnr, $chain_fpga_addr, $conf_resetafterfirstwrite_addr);
     } 
     elsif(("h_".$opt_operation) eq 'h_maps_clk_on' ) {
+      my $conf_signals_addr = any2dec($chain_settings{'CONFsignals_trbnetAddr'});
       $subr =  generate_h_maps_clk_signal(1,$chain, $chain_fpga_addr, $conf_signals_addr);
     }
     elsif(("h_".$opt_operation) eq 'h_maps_clk_off' ) {
+      my $conf_signals_addr = any2dec($chain_settings{'CONFsignals_trbnetAddr'});
       $subr =  generate_h_maps_clk_signal(0,$chain, $chain_fpga_addr, $conf_signals_addr);
     }
     elsif(("h_".$opt_operation) eq 'h_trig_init_seq' ) {
+      my $conf_chain_triginitseq_addr = any2dec($chain_settings{'CONFtriginitseq_trbnetAddr'});
       $subr =  generate_h_chain_trig($chain, $chainnr, $chain_fpga_addr, $conf_chain_triginitseq_addr);
     }
     elsif(("h_".$opt_operation) eq  'h_maps_reset' ) {
-        $subr =  generate_h_chain_trig($chain, $chainnr, $chain_fpga_addr, $conf_chain_trigmapsreset_addr);
+      my $conf_chain_trigmapsreset_addr = any2dec($chain_settings{'CONFtrigmapsreset_trbnetAddr'});
+      $subr =  generate_h_chain_trig($chain, $chainnr, $chain_fpga_addr, $conf_chain_trigmapsreset_addr);
     }
     elsif(("h_".$opt_operation) eq  'h_run_jtag' ) {
-        $subr =  generate_h_chain_trig($chain, $chainnr, $chain_fpga_addr, $conf_chain_trigrunjtag_addr);
+      my $conf_chain_trigrunjtag_addr = any2dec($chain_settings{'CONFtrigrunjtag_trbnetAddr'});
+      $subr =  generate_h_chain_trig($chain, $chainnr, $chain_fpga_addr, $conf_chain_trigrunjtag_addr);
     }
     elsif(("h_".$opt_operation) eq  'h_write_once' ) {
-        $subr =  generate_h_chain_trig($chain, $chainnr, $chain_fpga_addr, $conf_chain_trigwriteonce_addr);
+      my $conf_chain_trigwriteonce_addr = any2dec($chain_settings{'CONFtrigwriteonce_trbnetAddr'});
+      $subr =  generate_h_chain_trig($chain, $chainnr, $chain_fpga_addr, $conf_chain_trigwriteonce_addr);
     }
     elsif(("h_".$opt_operation) eq  'h_maps_start' ) {
-        $subr =  generate_h_chain_trig($chain, $chainnr, $chain_fpga_addr, $conf_chain_trigmapsstart_addr);
+      my $conf_chain_trigmapsstart_addr = any2dec($chain_settings{'CONFtrigmapsstart_trbnetAddr'});  
+      $subr =  generate_h_chain_trig($chain, $chainnr, $chain_fpga_addr, $conf_chain_trigmapsstart_addr);
     }
     elsif(("h_".$opt_operation) eq  'h_read_ram1b_word' ) {
-        $subr =  generate_h_read_ram1b_word($chain, $chain_fpga_addr, $debug_chain_ram1baddr_addr, $debug_chain_ram1bdata_addr, $opt_addr);
+      my $debug_chain_ram1baddr_addr = any2dec($chain_settings{'DEBUGram1baddr'});  
+      my $debug_chain_ram1bdata_addr = any2dec($chain_settings{'DEBUGram1bdata'});  
+      $subr =  generate_h_read_ram1b_word($chain, $chain_fpga_addr, $debug_chain_ram1baddr_addr, $debug_chain_ram1bdata_addr, $opt_addr);
     }    
     elsif(("h_".$opt_operation) eq  'h_read_ram1c_word' ) {
-        $subr =  generate_h_read_ram1c_word($chain, $chain_fpga_addr, $debug_chain_ram1caddr_addr, $debug_chain_ram1cdata_addr, $opt_addr);
+      my $debug_chain_ram1caddr_addr = any2dec($chain_settings{'DEBUGram1caddr'});  
+      my $debug_chain_ram1cdata_addr = any2dec($chain_settings{'DEBUGram1cdata'});  
+      $subr =  generate_h_read_ram1c_word($chain, $chain_fpga_addr, $debug_chain_ram1caddr_addr, $debug_chain_ram1cdata_addr, $opt_addr);
     }    
     elsif(("h_".$opt_operation) eq  'h_copy_ram1b1c' ) {
         $subr =  generate_h_copy_ram1b1c($chain, $chain_fpga_addr, $cmd_reg_addr, $data_reg_addr);
index 4ac6d002e0022d22a0f3bb8af7deb99ac6966a3e..1e7876b4c3b79125e1106113098a87cee34210b0 100644 (file)
@@ -1,10 +1,8 @@
 #Send a command that writes data
 sub send_write_command {
   my ($fpga, $dreg, $creg, $val, $cmd) = @_;
-  print "Sending commands";
   trb_register_write($fpga, $dreg, $val) or die trb_strerror();
   trb_register_write($fpga, $creg, $cmd) or die trb_strerror();
-  print "done";
   }
   
 sub any2dec { # converts numeric expressions 0x, 0b or decimal to decimal
@@ -265,38 +263,6 @@ sub generate_h_set_inout {
   }
 }
 
-sub generate_h_prog_fpga {
-  my($board, $trbhostname, $addonortrb, $staplfilename) =  @_;
-  return sub {
-    init_msg("Prog FPGA $board.");
-    if(!defined($trbhostname)||!defined($addonortrb)||!defined($staplfilename)){
-      report('report_general', "Settings missing. Doing nothing.\n");
-      return;
-    }
-    execute_shell_command("command_client.pl -e $trbhostname -c  \"jam_trbv2_ao --$addonortrb -aRUN_XILINX_PROC /home/hadaq/bneumann/$staplfilename\"", 
-    "------------- Connection accepted -------------
-> return value of command: 0
-> stdout: 
-Successful File Execution.
-------------- END OF OUTPUT ------------
-");
-  }
-}
-
-sub generate_h_start_trbnetd {
-  my($board, $trbhostname) =  @_;
-  return sub {
-    init_msg("Start trbnetd $board.");
-    if(!defined($trbhostname)){
-      report('report_general',"Settings missing. Doing nothing.\n");
-      return;
-    }
-    execute_shell_command("command_client.pl -e $trbhostname -c  \"trbnetd\"","------------- Connection accepted -------------
-> return value of command: 0
-------------- END OF OUTPUT ------------
-");
-  }
-}
 
 sub generate_h_set_standard {
   my %boards_handlers = %{$_[0]};