URL
https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 43 |
Rev 48 |
Line 1... |
Line 1... |
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
use strict;
|
|
use GraphViz;
|
|
|
|
my $g = GraphViz->new();
|
# a perl getopts example
|
|
# alvin alexander, http://www.devdaily.com
|
|
|
|
use strict;
|
|
use Getopt::Std;
|
|
|
$g->add_node('London');
|
# declare the perl command line flags/options we want to allow
|
$g->add_node('Paris', label => 'City of\nlurve');
|
my %options=();
|
$g->add_node('New York');
|
getopts("hj:ln:s:", \%options);
|
|
|
$g->add_edge('London' => 'Paris');
|
# test for the existence of the options on the command line.
|
$g->add_edge('London' => 'New York', label => 'Far');
|
# in a normal program you'd do more than just print these.
|
$g->add_edge('Paris' => 'London');
|
print "-h $options{h}\n" if defined $options{h};
|
|
print "-j $options{j}\n" if defined $options{j};
|
|
print "-l $options{l}\n" if defined $options{l};
|
|
print "-n $options{n}\n" if defined $options{n};
|
|
print "-s $options{s}\n" if defined $options{s};
|
|
|
print $g->as_png;
|
# other things found on the command line
|
|
print "Other things found on the command line:\n" if $ARGV[0];
|
|
foreach (@ARGV)
|
|
{
|
|
print "$_\n";
|
|
}
|
|
|
No newline at end of file
|
No newline at end of file
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.