18 print "\n not enough arguments";
19 print "\n Syntax: ./program_SDRAM input output\n";
22 open(INFILE1
, "<$ARGV[0]") || die("\ninput open fail\n");
23 open(INFILE2
, "<$ARGV[1]") || die("\ninput open fail\n");
24 open(OUTFILE
, ">$ARGV[2]") || die("\nOutput file open fail\n");
27 while ($line = <INFILE1
>){
31 printf OUTFILE
("33333333");
35 @array=split(/ +/,$line);
37 while(@array[$j]!~/\w/)
46 printf OUTFILE
("%08x%08x",hex($addr),hex($regval));
51 printf OUTFILE
("\n");
59 while($i lt 8 && $i gt 0){
60 printf OUTFILE
"00"x8
;
64 printf OUTFILE
("\n");
67 while($aline=<INFILE2
>){
70 next if(($aline=~/^S0/) || ($aline=~/^S7/));
71 ($lineid, $length, $address, @bytes) = unpack"A2A2A8"."A2"x300
, $aline;
72 $length = hex($length);
73 $address = hex($address);
79 $addstr = sprintf("%x", $address);
80 $addstr = "0"x
(8-length($addstr)).$addstr;
81 print OUTFILE
$addstr;
84 $currentaddr=$address;
89 $addstr = sprintf("%x", $currentaddr);
90 $addstr = "0"x
(8-length($addstr)).$addstr;
91 print OUTFILE
$addstr;
97 $bytes[$i]=~tr/ABCDEF/abcdef/;
98 print OUTFILE
"$bytes[$i]";
114 for($i=0;$i<(64-$count);$i++){
123 print OUTFILE
"11"x4
;
125 $chsum=$chsum & 0xffffffff;
126 $chsum = sprintf("%X", $chsum);
127 $chsum = "0"x
(8-length($chsum)).$chsum;
128 $chsum =~tr/ABCDEF/abcdef/;
129 print OUTFILE
$chsum;
130 print OUTFILE
"00"x60
;
134 print OUTFILE
"99"x4
;
135 print OUTFILE
$loadaddr;
136 print OUTFILE
"00"x60
;
149 if(length($holder)==8){
150 $holder = hex($holder);
This page took 0.05377 seconds and 5 git commands to generate.