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

Subversion Repositories ecpu_alu

[/] [ecpu_alu/] [trunk/] [alu/] [scripts/] [conv_fsm.pl] - Blame information for rev 5

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 leonous
#!/usr/bin/perl -w
2
 
3
use strict;
4
my $fsm = pop @ARGV;
5
 
6
if (defined $fsm)
7
{
8
  my $contents = `cat $fsm`;
9
 
10
  my ($others) = $contents =~ /(\w+.+?\=\>)/;
11
 
12
  while ($others !~ /others.+\=\>/ and defined $others)
13
  {
14
    $contents =~ s/\=\>(.*\n(?:.*?\n)*?)(.+=\>)/\:\n\t\t\t\t\t\tbegin\n$1\n\t\t\t      end\n$2/;
15
    ($others) = $contents =~ /(\w+.+?\=\>)/;
16
  }
17
 
18
  $contents =~ s/others.+\=\>\n((?:.+\n)*.+)end.*?case/default :\n\t\t\t\t\t\tbegin\n$1\tend\n\t\t\t\t\t\tendcase/;
19
 
20
  $contents   =~ s/\'(\d)\'/1\'b$1/g;
21
  print $contents;
22
}
23
else
24
{
25
  print "Please supply a VHDL fsm to parse\n";
26
}
27
 
28
 

powered by: WebSVN 2.1.0

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