All about a Verilog V200x parser project hosted at SourceForge:

Wednesday, December 30, 2009

Latest version includes (Synopsys) Liberty File parser

I (finally) uploaded an update here.

The most interesting new feature is support for Liberty Files (aka., .lib files).
Upon download, note a slight rearrangement of the directory structure:

slf/ --- files related to parsing of Synopsys Liberty Files
ssi/ --- files related to Simple Serialization Interface
v2k/ --- files related to Verilog parser

There is also an additional option --gen_xref which can be used to generate a module cross reference.

> v2k/bin/analyze

Usage: analyze --flatten? (--tcl out.tcl)? (--rb out.rb)? (--outf out.f)?
--only_used? --exit_on_err? (--verbose n)? --abs_paths?
(--redefn n)? (-E -C?)?
topModule vlogOpts+

--flatten : stop after flattening .f files.
: Useful with "--outf" to capture flat .f
: for subsequent processing.
--tcl out.tcl : dump details in tcl format to "out.tcl".
--rb out.rb : dump details in ruby format to "out.rb".
--outf out.f : dump details into flat Verilog .f file "out.f"
using only +incdir+, +define+ and file.v.
--only_used : only dump files which contained a module
: definition required for linking "topModule".
--exit_on_err : exit status != 0 if any parse errors.
And, no "out.tcl" generated if errors.
--verbose n : Verbose messages during linking. "n" is:
2 (most verbose) 1 (default); 0 (off).
--abs_paths : Make/display all file/directory names absolute.
Useful for debugging (the where of) include files.
--gen_xref : Generate "topModule.refs.txt".
Contains a cross-reference of module references.
-E : dump pre-processed files to "file.v.E".
Useful for debugging preprocessing issues.
-C : do not discard comments when "-E" is specified.

vlogOpts is one of:
-f args.f
-v library.v
-y library_directory
+no_defn+mod1(+modn)* : specify "mod1" as undefined
(a priori) so no link error.
+slf+f1.lib(+fi.lib)* : specify Synopsys Liberty File "f1.lib".

NOTE: a .f file can contain entries of the form "${VAR}/foo.v"
to specify that the value of the environment variable "VAR"
be used (i.e., replace ${VAR} with ENV['VAR'], in ruby parlance)
during .f file processing. This is useful to root file/directory
locations using an environment variable, rather than hardcoding
in .f files themselves.

The +slf+ option can be used to pass .lib files to resolve any (typically instantiated) library (leaf) or macro cells.

If any of the +slf+ file(s) are actually required to link the design, their filename(s) will be output into the out.tcl file specified using the --tcl option. The tcl list variable slf_used will be used.