I do have these tools installed, but I have not used them much. This may be way too basic for what you're asking, but here is what I know...

To get help on vhier:

$ vhier --help

To show all the Verilog modules in a file:

$ cat top.v module top; dff i0 (); endmodule module dff; endmodule $ $ vhier top.v --modules dff top

Adapting the EXAMPLE code from Verilog::Parser:

use warnings; use strict; package MyParser; use Verilog::Parser; our @ISA = qw(Verilog::Parser); # parse, parse_file, etc are inherited from Verilog::Parser sub new { my $class = shift; #print "Class $class\n"; my $self = $class->SUPER::new(); bless $self, $class; return $self; } sub symbol { my $self = shift; my $token = shift; $self->{symbols}{$token}++; } sub report { my $self = shift; foreach my $sym (sort keys %{$self->{symbols}}) { printf "Symbol %-30s occurs %4d times\n", $sym, $self->{symbol +s}{$sym}; } } package main; my $text = <<"EOF"; module m; reg ina, inb; endmodule EOF my $parser = MyParser->new(); $parser->parse($text); $parser->eof(); $parser->report(); __END__ Output: Symbol ina occurs 1 times Symbol inb occurs 1 times Symbol m occurs 1 times

See also: http://www.veripool.org/wiki/verilog-perl

What are you trying to do?


In reply to Re: verilog perl usage by toolic
in thread verilog perl usage by perlvoyager

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.