#!/usr/bin/perl #last change 28.03.2007 by Jorge Mercado #e.g. commandline : perl tready.pl ---[debug]- # [] means optional # <> means necessary #modus= 0 is without EXTENDED SETUP #modus = 1 is with EXTENDED SETUP # you have four debug modes debug as argument 4 in the commandline # 1 to show the comparsion of bits in detail # 2 to show what numbers are collected from the logfile # 3 to show all test for the fist found hexnumbers # 5 ( first remove outcommentation) to exclude NIscsn test # 6 shows a mapping problem # 7 to look for value variable shift and that the right arrays is in use # 9 tell you what mcm( slave ... aliceid) regex has found #10 to check the function of mapping ni_matrix of ken oyama #11 what is found defect #12 last and first hexnumber of the defects(early in the script) #13 which mcms are meant to be printed #14 last and first hexnumber of the defects(later in the script) #15 slave and slavenumber #16 to check the shiftvariable from 0-7 to 2-9 bit|dataline|line #17 #18 which mcm with errors is removed ? #19 change hoho_2 #20 #21 #22 #shittiest_shit is slave_number #shittier and shittiest are extracted hexnumbers #shit is port number #the same array as kens in scsn_ids.c # $ni_matrix [ROW(MCM)][COLUMN PORT)] # $ni_matrix[ROW] =>[COLUMN] @ni_matrix = ( # 0 1 2 3 COLUMN(PORT) [ 1 , 0 , 2 , 3 ], # 0 ROW(MCM) 0 = CM0 = MCM2 these are MCM id sending data in the same board [ 5 , 4 , 6 , 7 ], # 1= CM1 = MCM6 [ 9 , 8 , 10 , 11 ], # 2= CM2 = MCM10 [ 13 , 12 , 14 , 15 ], # 3= CM3 = MCM14 [ 6 , 10 , 2 , 14 ], # 4= BM [ 2 , 0 , 6 , 4 ], # 5= HM A side only for HM, it is ROB position [ 3 , 1 , 7 , 5 ], # 6= HM B side ); $blow=0; $any=0; $total= 0; $debug=0; #--- $line_0_to_9_check_variable = $clock = 0 ; #--- $finisher=0; #the variable modus controll two different arrays #$the variable shift yields a necessarry shift for diffrent arrays $troubleshooter= 0 ; chomp($case=$ARGV[1]); chomp($modus=$ARGV[2]); chomp($debug=$ARGV[3]); print "$case \n" if $debug == 7; if( $modus == 0 ){ @BB=qw(0 16 11 15 14 13 12 9 10 8 4 0 1 2 3 7 6 5); # 2B @AB=qw(0 16 11 15 14 13 12 9 10 8 4 0 1 2 3 7 6 5); # 1B @DB=qw(0 16 11 15 14 13 12 9 10 8 4 0 1 2 3 7 6 5); # 4B @AA=qw(0 11 15 14 13 12 9 10 8 4 0 1 2 3 7 6 5 16); # 1A @DA=qw(0 11 15 14 13 12 9 10 8 4 0 1 2 3 7 6 5 16); # 4A @CA=qw(0 11 15 14 13 12 9 10 8 4 0 1 2 3 7 6 5 17 16); # 3A @CB=qw(0 17 16 11 15 14 13 12 9 10 8 4 0 1 2 3 7 6 5); # 3B $shift= 0; } if($modus == 1){ if( $case == AA|BB|DA|DB|AB ){ # 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 @BB=qw(0 EX1 16 11 15 14 13 12 9 10 8 4 0 1 2 3 7 6 5); # 2B 0 @AB=qw(0 EX1 16 11 15 14 13 12 9 10 8 4 0 1 2 3 7 6 5); # 1B 0 @DB=qw(0 EX1 16 11 15 14 13 12 9 10 8 4 0 1 2 3 7 6 5); # 4B 0 @AA=qw(0 EX1 11 15 14 13 12 9 10 8 4 0 1 2 3 7 6 5 16); # 1A 0 @DA=qw(0 EX1 11 15 14 13 12 9 10 8 4 0 1 2 3 7 6 5 16); # 4A 0 $shift = 1; } if($case == CA|CB){ @CA=qw(0 EX1 EX2 EX3 11 15 14 13 12 9 10 8 4 0 1 2 3 7 6 5 17 16); # 3A 0 0 0 @CB=qw(0 EX1 EX2 EX3 17 16 11 15 14 13 12 9 10 8 4 0 1 2 3 7 6 5); # 3B 0 0 0 $shift = 3; } } print " shift $shift \n" if $debug == 7; #target path to the logfiles open(diese,"/home/robocop/robTester/AliTRDrobLogFiles/".$ARGV[4]."/trapTests/hammingOn/trapTests_01.log")||die" can not open logfile".$ARGV[4]; #target path to the trapIntErrors3 #open(diese,"/home/trap/robTester/AliTRDrobLogFiles/".$ARGV[0]."/trapTests/hammingOff/trapIntErrors3")||die" can not open trapIntErrors3"; #home directory for logifiles # stored in ~/kes/ #open(diese,"/home//trap/kes/".$ARGV[0]."/trapTests/hammingOff/trapTests_01.log")||die" can not open logfile ".$ARGV[0]; open(trapIntErrors3,">/home/robocop/robTester/AliTRDrobLogFiles/".$ARGV[4]."/trapIntErrors3")||die "can not create new logfile"; $check = 0; do{ $check++; for($help=0; $help<1; $help++){ print "this is the array $case with field $help ".$$case[$help]."\n " if $debug == 7 ; } print "\n" if $debug == 7; } until $check == 2 ; print $ARGV[0]."\n" if $debug == 2; $board=$ARGV[0]; $tmp_t=0; while($board=~/(.)/g){ #to extract the number of the board without leading zeros $flow++; # if( ($flow > 8 ) && ($1 != 0) ) { if( (($flow == 9 ) && ($1 != 0)) || (($flow == 10 ) && (($1 != 0))|| ($nine !=0) )|| (($flow == 11 ) && (($1 != 0)) || ($ten !=0) ) || $flow == 12 ) { $nine=$1 if $flow == 9 ; $ten=$1 if $flow == 10 ; print" boardnumber $1\n"if $debug == 3 ; @boardnumber[0].= $1; } } # A or B side ? while($ARGV[1]=~/(.)/g){ $blow++; if(($blow>1)){ print"robside $1\n"if $debug == 3 ; $rob_side = $1; # OB } } print"this boardnumber ".$boardnumber[0]." \n" if $debug == 2|3 ; #search for eacg datapack per test while () { if(/^Slave\s*(\d+).* = (\d+)/){ print "slave $1 slavenumber $2 \n" if $debug == 15; $mcmid[$1]=$2; } if (/^(\w*).*(test results|readout tree)$/) { $sec = $1; } elsif ($sec) { $section{$sec} .= $_; } } for ($i=0; $i<19+$shift; $i++) { $$smcmerr[$i]=0; } #print out variable $print_out = 0; GAME:foreach $s (sort keys %section) { print "Section $s\n" if $debug == 2; print "Section $s ".$section{$s}." \n" if $debug == 4; print " $s \n " if $debug == 13; for ( $i=1 ; $i < 19+$shift ; $i++ ){ if($section{$s}=~/\b$i\b/) { $$smcmerr[$i]= 1 ; print "slave $i is alicenumber ".$$smcmerr[$i]." that means error in slave $i \n" if $debug == 13; } #set all hcm and bm for errors below to zero foreach $e ('DDD', 'DMM', 'IMM','EBF','LUT','FLA','FLD','FPA','FGA','FGM','FDD','FTA','FTL','FTS','FGC','FP0','FP1','FP2','FP3','FP4','FP5','FP6','FP7'){ #--- if( ($s eq $e) && ( $$case[$i] == 16 )|| ( $$case[$i] == 17 ) || ( $$case[$i] == 18 ) ){ #--- print " error removed for slave $i and alicenumber ".$$case[$i]." \n " if $debug == 18; $$smcmerr[$i]=0; } } } #set see additional slaves to zero because they are only part of the setup # if($modus == 1){ # if($case eq CA|CB){ # if($mcmid[$i]== 1){ # $mcmerr[$i] = 0; # } # } # if($case eq AA|BB|DA|DB|AB){ # if($mcmid[$i]== 1|2|3){ # $mcmerr[$i] = 0; # } # } # } #------------------------------------------------------------------------------ #initial value $READ[0]=0; @$s4[0]=0xdead; @$s3[0]=0xdead; @$s5[0]=200; #Jump is to STOP the run, if it is repeating itself (some kind of iterator) JUMP:for( $r=0 ; $r<10000; $r++){ if($section{$s}=~/0x9\s(0x[0-9a-f]{1,})\s(0x[0-9a-f]{1,})\s(\d*).+(0x[0-9a-f]{1,})\s?$/gm){ # if($section{$s}=~ /0x9\s(0x\w)\s(0x\w)\s(\d*)\s/){ print " JUMP $s $1 $2 $3 \n " if $debug == 11; if( (hex(@$s3[0]) == hex($2)) && ( hex(@$s4[0]) == hex($1)) &&(hex(@$s5[0]) == hex($3))) { $last = $r; last JUMP; } if( $r == 0 ){ @$s3[0]=$2; @$s4[0]=$1; @$s5[0]=$3; $first=$r; } push(@$s,$2); } } # undef @hex; print "$s \n" if $debug == 12; print " first $r ".$$s[0]." \n " if $debug == 12; print " last $last ".$$s[$last-2]." \n" if $debug == 12; print "\n".$section{NIscsn}."\n" if $debug == 2; #-------------------- #if($debug==5){ # print"\t\t *** debug 5*** \n"; print " first setting of line_0_to_9_check_variable $line_0_to_9_check_variable \n " if $debug == 16 && $countertesta == 0; if($s =~/NIscsn/ ){ $running_number=0; @port[0] = 0; @number_false[0] = 0; @mcm_number[0] = 0; #looking for errors print $section{NIscsn}."\n " if $debug == 20 ; TEST:for($countertesta=0;$countertesta<2000;$countertesta++){ #--- #trail # if($section{NIscsn} =~ /0x[a9]{1}\s(0x[0-9a-f]{2,4})\s(0x[0-9a-f]{1,8})\s(\d{1,3}).*(0|0x[0-9a-f]{8})\s?$/gm) { #original # if($section{NIscsn} =~ /0x9\s(0x[0-9a-f]{4})\s(0x[0-9a-f]{8})\s(\d{2}).*(0x[0-9a-f]{8})\s?$/gm) { #works with problems # if( ( $section{NIscsn} =~ /0x9\s(0x[0-9a-f]{4})\s(0x[0-9a-f]{8})\s(\d{1,2}).*(0x[0-9a-f]{8})\s?$/gm ) || ( $section{NIscsn} =~ /0xa\s(0x[0-9a-f]{3})\s(0x[0-9a-f]{1,8})\s(\d{3}).*(0)\s?$/mo ) ) { # works as it should be #--- if($section{NIscsn} =~ /0x[a9]{1}\s(0x[0-9a-f]{4}|0xd42)\s(0x[0-9a-f]{1,8})\s(\d{1,3}).*(0|0x[0-9a-f]{8})\s?$/gm) { # ckecking for the right run in terms of bit shifting 0-7 -> 2-9 print " $1 $2 $3 $4 \n " if $debug == 17; $count_arg1 = 0; $count_arg2 = 0; $test1 = $2; $test2 = $4; while ( $test1=~/(.)/g ){$count_arg1++ ;} while ( $test2=~/(.)/g ){$count_arg2++ ;} $count_arg1 -= 2; $count_arg2 -= 2; print "\n variable 1 $2 has $arg $count_arg1 sign \n variable 2 $4 has $arg $count_arg2 sign " if $debug == 22; if( $1 =~ /(0xd42)/){ print" *** i got $1 ***\n" if $debug == 17|16 ; $line_0_to_9_check_variable -= 2 ; next TEST; } if( ($count_arg1 != 8) || ($count_arg2 != 8) ){ print "---> kicked!!!" if $debug == 22 ;next TEST;} #--- # } print " $1 $2 $3 $4 \n" if $debug == 2 ; #last it if it is repeating if( (hex($port[0]) == hex($1) ) && ( hex($number_false[0]) == hex($2) ) && ( $mcm_number[0] == $3) && ($number_right == $4) ){ $finisher++; print " finisher $finisher \n"; $running_number=$countertesta; $run_two=$countertesta; last TEST if $finisher == 2; } if($countertesta == 0){ @port[0]=$1; @number_false[0]=$2; @mcm_number[0]= $3; @number_right[0]=$4; } # do not forget to change these names IMPORTANT # the $shift by $3 secures conversion of slave to alice number due to two different arrays so i do not have to change it in the whole script $port=$1; $shittier=$2; $shittiest_shit=$3 ; $shittiest=$4; print "shittiest_shit obtained by regex $shittiest_shit array ".$$case[$shittiest_shit]." \n" if $debug==9; # push(@port,$1); # push(@number_false,$2); # push(@mcm_number,$3); # push(@number_right,$4); #start bitwise #----------------------------------------------------------------------------- #dumbo iterate over all found NIscsn errors per mcm stored in @false_number # this loop iterate over each pair of hexnumber i.e. (1,2)(3,4)(5,6)(7,8) $preserve_two=$2; $preserve_four=$4; #----------------------------------------------------------------------------#the four parts below does not work logic but works cut the first two digits away of preserve`s $autocut=$autocuter=0; SHORT:while($preserve_two=~/(.)/g){ $autocut++; last SHORT if $autocut=1;} BOARD:while($preserve_two=~/(.)/g){ $autocuter++; last BOARD if $autocuter=1;} $autocut=$autocuter=0; THORT:while($preserve_four=~/(.)/g){ $autocut++; last THORT if $autocut=1;} COARD:while($preserve_four=~/(.)/g){ $autocuter++; last COARD if $autocuter=1;} #------ STAR:for($gogo=0; $gogo<4;$gogo++){ $iterate=-2; print " gogo $gogo \n" if $debug == 1; $cutter=0; #cut the variable into digits CUTTER_FOR_TEST:while($preserve_two=~/(.)/g){ print"$1 " if $debug == 1; $distress=hex($1); $cutter++; if($distress < 8){ $bin_f=hex2bin($1); } else{ $bin_f=dec2bin( hex($1)); } print "$bin_f " if $debug == 1; #chop bin------------ CUTTER_FOR_BIN_1:while($bin_f=~/(.)/g){ print "$1 " if $debug == 1; push(@bin_store_false_3,$1); } #chop bin------------ print"*" if $debug == 1; if($cutter == 4+$iterate){ last CUTTER_FOR_TEST; } } $cutter_2=0; print" END \n" if $debug == 1; CUTTER_FOR_TEST_2:while($preserve_four=~/(.)/g){ print"$1 " if $debug == 1; $distress_2=hex($1); $cutter_2++; if($distress_2 < 8){ $bin_r=hex2bin($1); } else{ $bin_r=dec2bin( hex($1) ); } print"$bin_r " if $debug == 1; #chop bin------------ $unimp_two=0; CUTTER_FOR_BIN_2:while($bin_r=~/(.)/g){ print "$1 " if $debug == 1; push(@bin_store_right_3,$1); } #chop bin------------ print"*" if $debug == 1; if($cutter_2 == 4+$iterate){ last CUTTER_FOR_TEST_2; } } print" END at $gogo \n" if $debug == 1; #------------------------------------------------------------------------- if($gogo== 0){ #--- for($null=0;$null<9;$null++){ #--- @bit_bag[$null]=0; } } #--- for($hoho_2=0+ $line_0_to_9_check_variable ; $hoho_2 < 8 + $line_0_to_9_check_variable ; $hoho_2++){ #--- # print " hoho_2 $hoho_2 variable $line_0_to_9_check_variable \n" if $debug == 19 ; $king_louie_3 = shift(@bin_store_false_3); $bagira_3 = shift(@bin_store_right_3); print "louie $king_louie_3 bagira $bagira_3 " if $debug == 1; # invert bit pattern mapping because in the loop we start with 0 but zero means bit 7 and 1 means 6 and so on ... #--- $change=$hoho_2+(7 - 2*$hoho_2); #--- #XOR compare if( (!$king_louie_3 != !$bagira_3 )){ #*******************defining of each bin*********************************** @bit_bag[$hoho_2]=1; #--- print " variable $line_0_to_9_check_variable change $change hoho_2 $hoho_2 \n" if $debug == 19; #--- @ni_error[$hoho_2]=_D.$change; @clean_ni_error[$hoho_2]=$hoho_2; print "1" if $debug == 1; } else { print $bit_bag[$hoho_2]."" if $debug == 1; } print"\n" if $debug == 1; } undef @bin_store_false_3; undef @bin_store_right_3; print "\n" if $debug == 1; } #end gogo #---------------------------------------------------------------------------- #bitwise end $x_times_per_error=0; #--- for($wowo_2=0+$line_0_to_9_check_variable ; $wowo_2 < 8+$line_0_to_9_check_variable;$wowo_2++){ #--- # invert bit pattern from D7-0 -> D0-7 #--- $change=$wowo_2+(7 - 2*$wowo_2); #--- # print " wowo_2 $wowo_2 \n"; if(@bit_bag[$wowo_2] > 0){ $x_times_per_error++; $tmp_three .= 1; $tmp =_D.$change; $tmp_two = $wowo_2; print " $tmp $tmp_two \n" if $countertesta == 0 && $debug == 16; push(@human_readable, $tmp ); push(@maschine_readable,$tmp_two); } #additional line because of new circumstances if(@bit_bag[$wowo_2] == 0){ $tmp_three .= 0; } } #--- if( $line_0_to_9_check_variable == 2){ $tmp_three .= 0; $tmp_three .= 0; } #--- } #end main if statement else{ last TEST ; } # $new_three is the full coded error in decimal after Kai Schweda fashion print " *** $tmp_three *** \n " if $countertesta == 0 && $debug == 3 || $debug == 1; $new_three=bin2dec($tmp_three); print " *** new three $new_three *** \n " if $countertesta == 0 && $debug == 3 || $debug == 1; #--- $tmp_three=""; #--- $shit=$port; print "shit or port $shit ".hex($shit)." \n" if $countertesta == 0 && $debug == 2 ; if((hex($shit) > hex(efff))&&(hex($shit) < hex(f040))){ print" i checked as follows with port ".hex($shit)." for ".hex($shit)." > ".hex(efff)." ".hex($shit)." < ".hex(f040)." \n" if $countertesta == 0|1|2|3 && $debug == 2 ; $transform_shit = NI_P0; $only_port = 0; } elsif((hex($shit) > hex(f03f))&&(hex($shit) < hex(f080))){ print" i checked as follows with port ".hex($shit)." for ".hex($shit)." > ".hex(f03f)." ".hex($shit)." < ".hex(f080)." \n" if $countertesta == 0|1|2|3 && $debug == 2 ; $transform_shit = NI_P1; $only_port = 1; } elsif((hex($shit) > hex(f07f))&&(hex($shit) < hex(f0c0))){ print" i checked as follows with port ".hex($shit)." for ".hex($shit)." > ".hex(f07f)." ".hex($shit)." < ".hex(f0c0)." \n" if $countertesta == 0|1|2|3 && $debug == 2 ; $transform_shit = NI_P2; $only_port = 2; } elsif((hex($shit) > hex(f0bf))&&(hex($shit) < hex(f100))){ print" i checked as follows with port ".hex($shit)." for ".hex($shit)." > ".hex(f0bf)." ".hex($shit)." < ".hex(f100)." \n" if $countertesta == 0|1|2|3 && $debug == 2 ; $transform_shit = NI_P3; $only_port = 3; } elsif( hex($shit) == '' ){ print "empty variable \n "; } else{ print " fatal error entcountered in port conversion script line 565 \n" } print"because of this choice is \n" if $countertesta == 0|1|2|3 && $debug == 2 ; print "transform_shit $transform_shit \n" if $countertesta == 0|1|2|3 && $debug == 2 ; print "only_port $only_port \n" if $countertesta == 0|1|2|3 && $debug == 2 ; # do not indent the lines below it does not work !? #--------------------- print " what the hell ... \n ". $port." ". $only_port."\n ". $shittier." ". $shittiest."\n ". $shittiest_shit."\n " if $countertesta == 0 && $debug == 3 ; @testa=@maschine_readable if $countertesta == 0 && $debug == 3 ; @test=@human_readable if $countertesta == 0 && $debug == 3 ; print " x_times_per_error $x_times_per_error \n " if $countertesta == 0 && $debug == 3 ; # my interpretation of Ken Oyamas code to convert receiving mcm to sending mcm # M_MCM PORT # $new_port = $ni_matrix [$ ][$only_port]; print "alice mcm number used for ni_matrix *".$$case[$shittiest_shit]."* with portnumber *$only_port* case *$case* \n" if $debug == 10 ; if ( $$case[$shittiest_shit] == 2 ){ $new_port= $ni_matrix [0][$only_port] ; print "i used ni_matrix [0][$only_port] \n " if $countertesta == 0 && $debug == 3;} # ALI_CM0 = 2 elsif( $$case[$shittiest_shit] == 6 ){ $new_port= $ni_matrix [1][$only_port] ; print "i used ni_matrix [1][$only_port] \n " if $countertesta == 0 && $debug == 3;} # ALI_CM1 = 6 elsif( $$case[$shittiest_shit] == 10 ){ $new_port= $ni_matrix [2][$only_port] ; print "i used ni_matrix [2][$only_port] \n " if $countertesta == 0 && $debug == 3;} # ALI_CM2 = 10 elsif( $$case[$shittiest_shit] == 14 ){ $new_port= $ni_matrix [3][$only_port] ; print "i used ni_matrix [3][$only_port] \n " if $countertesta == 0 && $debug == 3;} # ALI_CM3 = 14 elsif( $$case[$shittiest_shit] == 16 ){ $new_port = $ni_matrix [4][$only_port] ; print "i used ni_matrix [4][$only_port] \n " if $countertesta == 0 && $debug == 3;} # ALI_BM = 16 # $case = r_rob= 4= 4A=DA elsif( ($$case[$shittiest_shit] == 17) &&( $case eq CA ) ){ $new_port = $ni_matrix[5][$only_port]; print "i used ni_matrix [5][$only_port] \n " if $countertesta == 0 && $debug == 3;} # ALI_HM # 5=4B=DB elsif( ($$case[$shittiest_shit] == 17) &&( $case eq CB ) ){ $new_port = $ni_matrix[6][$only_port]; print "i used ni_matrix [6][$only_port] \n " if $countertesta == 0 && $debug == 3; } # ALI_HM # else(true){ print " fatal error in ni_matrix-distribution \n";} else{ print " fatal error in ni_matrix-distribution \n";} # ALI_CM0 = 2 # ALI_CM1 = 6 # ALI_CM2 = 10 # ALI_CM3 = 14 # ALI_BM = 16 # ALI_HM = 17 #-------------------- #conconated print preparation in for the logfile # print"please insert the mcmid of the chip $$case[$shittiest_shit] (alice_number):" ; $dodo=-1; # chomp($dodo=()); $only_port_number_and_new_three=$new_port."|".$new_three; print " test constant numbers 3+$shift, 17+$shift, 16+$shift, 17 yields ". $$case[3+$shift]." ".$$case[17+$shift]." ".$$case[16+$shift]." ". $$case[17]."\n test with variable ". $mcmid[$shittiest_shit]." ". $$case[$shittiest_shit]." \n " if $debug == 6; # print " shittiest_shit $shittiest_shit after \n\n " if $debug == 0; # shittiest_shit is slave_number # shittier and shittiest are extracted hexnumbers # shit is port number $any++; $db_print[$any]="NI ". $mcmid[$shittiest_shit]." ". $$case[$shittiest_shit]." $dodo -1 -1 ". $shittier." ". $shittiest." ". $shit." ". " gatedb:err_rob_ni=". @boardnumber[0]."|". $only_port_number_and_new_three; print $db_print[$any]."\n " if $countertesta == 0 && $debug == 3; print $db_print[$any]."\n " if $debug == 21; #--------------- #conconated print out for Jorge, Jorges port is not in Kens convention for( $what=0 ; $what < $x_times_per_error ; $what++){ # $total++; $shit_bin =shift(@human_readable); # bin number # $only_bit =shift(@maschine_readable); # bit without D $error_code=$transform_shit.$shit_bin; # $only_port_number_and_only_bit=$only_port."|".$only_bit ; # $only_port_number_and_only_bit=$only_port."|".$new_three; # print"please insert the mcmid of the chip $$case[$shittiest_shit] (alice_number):" ; # $dodo=-1; # chomp($dodo=()); ## gatedb:err_rob_ni=-- # $printer_test[$total]="NI++ ". # $mcmid[$shittiest_shit]." ". # $$case[$shittiest_shit]." $dodo -1 -1 ". # $shittier." ". # $shittiest." ". # $shit." ". # " gatedb:err_rob_ni=". # @boardnumber[0]."|". # $only_port_number_and_only_bit." ". # $error_code; @db_print[$any] .= " ".$error_code ; print $db_print[$any]."\n " if $debug == 21; } #end loop what $tmp_two=0; $tmp=0; $new_three=0; for($hihi ; $hihi < $x_times_per_error; $hihi++){ $bibo =shift(@test); $biba=shift(@testa); print " $bibo $biba \n" if $countertesta==0 && $debug == 3 ; } #end countertesta } #end if NIscsn } #} #end debug 5 #----------- #reset for next run @$s3[0]=0; @$s4[0]=0; @$s5[0]=0; #start print for logfile for all fubar mcm # print "running variable " if $debug == 13; print " $s \n " if $debug == 14 ; # print "** $s ** \n " if $debug == 13 ; print " $s \n" if $debug == 15; for ( $i=0 ; $i < 19+$shift ; $i++ ){ # print " second trial mcm $i is ".$mcmerr[$i]." \n" if $debug == 13; if( $$smcmerr[$i] != 0 ){ print " first hex ".$$s[$first]." last hex ".$$s[$last-2]." \n" if $debug == 13; print" second slave $i slavenumber ".$mcmid[$i]." alicenumber ".$$case[$i]."\n " if $debug == 15; # #if anyone does not enter a number that no missing column appears $u=-1; # print"please insert the mcmid of the chip $$case[$i] (alice_number):" ; #for testing disable chomp # chomp($u=); # what is what # ERROR=$s # MCM_ID=$mcmid # ALICE_NUMBER=$$chase[$i-1] # MCM_ON_BOARD_NUMBER(by hand)=$u # hex_number_one=$$s[($last)] # print command for the logfile print " first $first last $last \n " if $debug == 14 ; print " first hex ".$$s[$first]." last hex ".$$s[$last-2]." \n" if $debug == 14; if($section{$s} eq $section{NIscsn}){ next GAME; } print trapIntErrors3 "$s ".$mcmid[$i]." ".$$case[$i]." $u ".$$s[$first]." ".$$s[$last-2]."\n"; #Tom`s DB-Code # gatedb:err_rob_ni=123|13|4 # print trapIntErrors3" $s ".$mcmid[$i]." ".$$case[$i]." $u ".$$s[$first]." ".$$s[($last-1)]." ".$print_ni[$i]." \n"; #here some while statement running until every niscsn error is down # reset relevant variables for the next run } $$smcmerr[$i]=0; } undef @$s; $$s[$first]=$$s[$last]= $first=$last=" "; $stop_one=$stop_two= $stop_three=0xdead; } #end foreach $s #alternative prints #for ( $final=0 ; $final < $total+1 ; $final++){ # print trapIntErrors3 $printer_test[$final]."\n"; #} #good print the one meant to print the niscsn stufe into the logfile for($master= 0; $master< $any+1; $master++){ print trapIntErrors3 $db_print[$master]."\n"; } #------------------------------------------------------------------------ #alternative print #for ( $final=0 ; $final < $total ; $final++){ # # print trapIntErrors3 $printer_test[$final]."\n"; #} #converter from decimal to binary sub dec2bin { my $str = unpack("B32", pack("N", shift)); $str =~ s/^0+(?=\d)//; # otherwise you'll get leading zeros return $str; } #converter from binary to decima sub bin2dec { return unpack("N", pack("B32", substr("0" x 32 . shift, -32))); } #to fill up to 4 digits because perl does not do this so you would compare diffrent length of variable shit by perl with hex() so i invent this clumsy method #translate hex to bin -> !!!!!!!!!!! NOT FOR LETTERS!!!!!!!!! #which is done automatically by perl function hex() sub hex2bin { my $zero=0; my $one=1; if($_[0] == 0 ){ return $zero.$zero.$zero.$zero } if($_[0] == 1 ){ return $zero.$zero.$zero.$one } if($_[0] == 2 ){ return $zero.$zero.$one.$zero # return 0010; } if($_[0] == 3){ return $zero.$zero.$one.$one # return(0011); } if($_[0] == 4){ return $zero.$one.$zero.$zero # return(0100); } if($_[0] == 5){ return $zero.$one.$zero.$one # return(0101); } if($_[0] == 6){ return $zero.$one.$one.$zero # return(0110); } if($_[0] == 7){ return $zero.$one.$one.$one # return(0111); } if($_[0] == 8){ return $one.$zero.$zero.$zero # return(1000); } if($_[0] == 9){ return $one.$zero.$zero.$one # return(1001); } else{ return x; } } close(trapIntErrors3); close(diese); print"content trapIntErrors3 \n" if $debug == 2 ; print `cat ~/kes/trapIntErrors3` if $debug == 2 ; #test for extraction of elements of Ken`s matrix #OYAMA:while(){ # print"please enter the row \n "; # chomp($row=); # print"please enter the column \n "; # chomp($column=); # print"your favourite ni_matrix elements is "; # print $ni_matrix[$row][$column]."\n "; # last OYAMA if $row > 7 || $row < 0 || $column > 4 || $column < 0 ; #}