my $registerValBinStr = zeros($registerSize);
- my $stringSize = ceil($registerSize/32)*8; # this fulfills Bertram's requirement to write the hex string in multiples of 8 nibbles = 32 bit words
+ my $targetStringSize = ceil($registerSize/32)*8; # this fulfills Bertram's requirement to write the hex string in multiples of 8 nibbles = 32 bit words
my @specFields = $specRegister->findnodes("./field");
}
- my $registerValHexString = binStr2hexStr($registerValBinStr);
- padZeros(\$registerValHexString,8);
+ my $registerValHexString = binStr2hexStr($registerValBinStr); # strips leading zeros
+ # pad missing zeros so full length of the value string is restored
+ $registerValHexString=zeros($targetStringSize - length($registerValHexString)).$registerValHexString;
+ # now we should have a nice and long Bertram compatible hex value string again!
+
# print the interesting part of the ini file, the register values in Bertram Format!
print OUTPUT ";$registerName\n";