X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=vhdl-pingen.pl;h=fb365d35a42c591a896f71b06bcb61f937240fa2;hb=e92a900a2490410e534c084b3142eb868179f1af;hp=e49654607fd19f2399e9cf7371319cddf0113cac;hpb=ebd12cffaac86995e8586bf84af077e105d91374;p=x300-pci diff --git a/vhdl-pingen.pl b/vhdl-pingen.pl index e496546..fb365d3 100755 --- a/vhdl-pingen.pl +++ b/vhdl-pingen.pl @@ -8,7 +8,15 @@ use Data::Dump qw(dump); my $sections = 4; -my $pin2io = retrieve('/dev/shm/pin2io.storable'); +my $file = shift @ARGV; +die "Usage: $0 *.pin2io.storable\n" unless $file; + +my $name = $file; +$name =~ s/^.*\///; +$name =~ s/\..+$//; +$name = 'epm' . $name if $name =~ m/^\d+/; + +my $pin2io = retrieve($file); warn "# $= ",dump($pin2io); my @pin2io = @{ $$pin2io }; warn "# @= ",dump( @pin2io ); @@ -41,16 +49,16 @@ print qq{ library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; -entity epm3128 is +entity $name is port( }, join("\n", @ports), qq { ); -end epm3128; +end $name; -architecture rtl of epm3128 is +architecture rtl of $name is signal }, join(", ", map { "s$_" } sort keys %{ $stat->{sections} }), qq{ : std_logic; @@ -73,7 +81,7 @@ end rtl; };#/vhdl -open(my $qsf, '>', 't.qsf'); +open(my $qsf, '>', $name.'.qsf'); foreach (@location_assignment) { print $qsf "set_location_assignment PIN_$_ -to IO$_\n"; }