++ed by:

1 PAUSE user
5 non-PAUSE users.

Wilson Snyder


Verilog::Netlist - Verilog Netlist


  use Verilog::Netlist;

    # Setup options so files can be found
    use Verilog::Getopt;
    my $opt = new Verilog::Getopt;
    $opt->parameter( "+incdir+verilog",

    # Prepare netlist
    my $nl = new Verilog::Netlist (options => $opt,);
    foreach my $file ('testnetlist.sp') {
        $nl->read_file (filename=>$file);
    # Read in any sub-modules

    foreach my $mod ($nl->modules_sorted) {
        if ($mod->is_top) {
            show_hier ($mod, "  ", "");

    sub show_hier {
        my $mod = shift;
        my $indent = shift;
        my $hier = shift;
        $hier .= $mod->name;
        printf ("%-38s %s\n", $indent."Module ".$mod->name,$hier);
        foreach my $cell ($mod->cells_sorted) {
            show_hier ($cell->submod, $indent."  ", $hier.".");


Verilog::Netlist contains interconnect information about a whole design database.

The database is composed of files, which contain the text read from each file.

A file may contain modules, which are individual blocks that can be instantiated (designs, in Synopsys terminology.)

Modules have ports, which are the interconnection between nets in that module and the outside world. Modules also have nets, (aka signals), which interconnect the logic inside that module.

Modules can also instantiate other modules. The instantiation of a module is a Cell. Cells have pins that interconnect the referenced module's pin to a net in the module doing the instantiation.

Each of these types, files, modules, ports, nets, cells and pins have a class. For example Verilog::Netlist::Cell has the list of Verilog::Netlist::Pin (s) that interconnect that cell.



Prints an error in a standard way, and increments $Errors.


Error checks the entire netlist structure.


Resolves references between the different modules. If link_read=>1 is passed when netlist->new is called (it is by default), undefined modules will be searched for using the Verilog::Getopt package, passed by a reference in the creation of the netlist.


Creates a new netlist structure. Pass optional parameters by name. The parameter "options" may contain a reference to a Verilog::Getopt module, to be used for locating files.


Prints debugging information for the entire netlist structure.


Prints a warning in a standard way, and increments $Warnings.



Returns Verilog::Netlist::Module matching given name.


Returns list of all Verilog::Netlist::Module.


Creates a new Verilog::Netlist::Module.



Returns Verilog::Netlist::File matching given name.

$netlist->read_file( filename=>$name)

Reads the given Verilog file, and returns a Verilog::Netlist::File reference.


Returns list of all files.

Generally called as $netlist->read_file. Pass a hash of parameters. Reads the filename=> parameter, parsing all instantiations, ports, and signals, and creating Verilog::Netlist::Module structures.


Writes a dependency file for make, listing all input and output files.


Verilog::Netlist::Cell, Verilog::Netlist::File, Verilog::Netlist::Module, Verilog::Netlist::Net, Verilog::Netlist::Pin, Verilog::Netlist::Port, Verilog::Netlist::Subclass


The latest version is available from CPAN and from http://veripool.com/.


Wilson Snyder <wsnyder@wsnyder.org>