]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
corrected loadregisterdb
authorJan Michel <j.michel@gsi.de>
Thu, 22 Aug 2013 15:23:14 +0000 (17:23 +0200)
committerJan Michel <j.michel@gsi.de>
Thu, 22 Aug 2013 15:23:14 +0000 (17:23 +0200)
tools/loadregisterdb.pl

index 0ae844f097dcf28981ebf70d5cbbecd884afd01a..ba5657baa16a1eacd6507a24f1a03fdff9a3970e 100755 (executable)
@@ -22,14 +22,14 @@ while (my $a = <FILE>) {
       }
     }
 #0x2000       1     0x38     0x38     0x38     0x38     0x38     0x38
-  if(my ($addr,$set,$str) = $a =~ /^\s*0x(\w\w\w\w)\s+(\d)+((\s+0x\w+)+)/) {
+  if(my ($addr,$set,$str) = $a =~ /^\s*0x(\w\w\w\w)\s+(\d+)((\s+0?x?\w+)+)/) {
 #       print "$addr : $set : $str\n";
     my @vals = split(/\s+/,$str);
     shift(@vals) if($vals[0] eq '');
     my $i = 0;
     #print Dumper \@vals;
     foreach my $t (@vals) {
-      if($t =~ /0x(\w+)/) {
+      if($t =~ /0?x?(\w+)/) {
         $cmd .= "trbcmd w 0x$addr 0x$reglist->{$set}->{$i++} $t\n";
        #print "cmd: $cmd\n";
         }
@@ -37,27 +37,6 @@ while (my $a = <FILE>) {
     }
   }
 
-# print Dumper $reglist;
-
-#     if($2==1) {
-# #       printf("%4x\t%1d\t%2x %2x %2x %2x\n",hex($1),$2,hex($3),hex($4),hex($5),hex($6));
-# #       $cmd .= sprintf("trbcmd w 0x%04x 0xa049 0x%02x\n",hex($1),hex($3));
-# #       $cmd .= sprintf("trbcmd w 0x%04x 0xa04b 0x%02x\n",hex($1),hex($4));
-# #       $cmd .= sprintf("trbcmd w 0x%04x 0xa04d 0x%02x\n",hex($1),hex($5));
-# #       $cmd .= sprintf("trbcmd w 0x%04x 0xa04f 0x%02x\n",hex($1),hex($6));
-#       }
-#     if($2==2) {
-# #       printf("%4x\t%1d\t%2x %2x %2x %2x %2x %2x\n",hex($1),$2,hex($3),hex($4),hex($5),hex($6),hex($8),hex($10));
-#       $cmd .= sprintf("trbcmd w 0x%04x 0xa0cd 0x%02x\n",hex($1),hex($3));
-#       $cmd .= sprintf("trbcmd w 0x%04x 0xa0cf 0x%02x\n",hex($1),hex($4));
-#       $cmd .= sprintf("trbcmd w 0x%04x 0xa0d1 0x%02x\n",hex($1),hex($5));
-#       $cmd .= sprintf("trbcmd w 0x%04x 0xa0d3 0x%02x\n",hex($1),hex($6));
-#       $cmd .= sprintf("trbcmd w 0x%04x 0xa0d5 0x%02x\n",hex($1),hex($8));
-#       $cmd .= sprintf("trbcmd w 0x%04x 0xa0d7 0x%02x\n",hex($1),hex($10));
-#       }
-
-  
-#$cmd .= "trbcmd w 0xfffd 0x20 0x200\n";
 # print $cmd;
 system($cmd);
 # print "Done.\n\n";