OpenCores
URL https://opencores.org/ocsvn/or1200_soc/or1200_soc/trunk

Subversion Repositories or1200_soc

[/] [or1200_soc/] [trunk/] [sw/] [perl/] [bin2mif.pl] - Rev 23

Go to most recent revision | Compare with Previous | Blame | View Log

#!/usr/bin/perl
# 
 
use Getopt::Std;
 
getopt( 'fwd' );
 
open( BIN_FILE, $opt_f ) or die "Can't open $opt_f!!!\n";
 
 
if( $opt_w  ) {
  print "WIDTH=$opt_w;\n";
}
else  {
  print "WIDTH=32;\n";
}
 
if( $opt_d  ) {
  print("DEPTH=$opt_d;\n");
}
else  {
  print("DEPTH=2048;\n");
}
 
print("CONTENT BEGIN\n");
 
$x = 0;
while ( read( BIN_FILE, $buf, 4 ) ) {
  $out = unpack( "H8", $buf);
#   print "$out\n";
  printf("\t%08x", $x);
  print " : $out;\n";
  $x++;
}
 
print("END;\n");
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.