From: Jan Michel Date: Thu, 22 Aug 2013 15:23:14 +0000 (+0200) Subject: corrected loadregisterdb X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=6d4a4f4d2ea13a473e528a733a8d75d09497da5a;p=daqtools.git corrected loadregisterdb --- diff --git a/tools/loadregisterdb.pl b/tools/loadregisterdb.pl index 0ae844f..ba5657b 100755 --- a/tools/loadregisterdb.pl +++ b/tools/loadregisterdb.pl @@ -22,14 +22,14 @@ while (my $a = ) { } } #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 = ) { } } -# 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";