The Rough Verilog Parser

If you write perl scripts to extract information from verilog files you might think that the parser that v2html uses to parse the verilog could be ripped out a used in your next script. Well it probably could - and I've tried to make it easy to do this by separating out the parser from the all the other stuff that v2html does. I called it 'The Rough Verilog Parser' and made it a perl module.

You can use it in your own scripts to do things like this:

 #!/usr/bin/perl -w
 require rvp;   # use the rough verilog parser

 # Read in all the files specified on the command line
 $vdb = &rvp::read_verilog(\@ARGV,[],{},1,[],[],'');

 # Print out all the modules found
 foreach $module (&rvp::get_modules($vdb)) { 
	print "$module\n"; 
 }

Other things that it can do are: It does all this in a comment and whitespace insensitive way, and it understands verilog, so it won't be confused by stuff like this.

Here are the links to save to get the Rough Verilog Parser:

In order to use this perl module you need to put it somewhere perl can find it. You can put it: If you send me your rvp scrips I'll add them into my regression tests, so I can make sure I don't break them when I change things. Also if you like, I can put them up here so other people can use them.

So far one person offered a script to be put here:

Previous Next

© 1999-2005 Costas Calamvokis