NAME

v2html - Verilog to HTML converter


SYNOPSIS

v2html [options] file1 [file2] ...

v2html is a perl 5 script that converts a bunch of verilog files to html, linking various things to their definitions. At the moment it handles:

modules

tasks

functions

includes

defines

parameters

inputs,outputs,inouts

signals: wire, reg etc.

mail addresses in comments

http URLS (http:....) in comments

It also generates a page containing all the modules it found arranged hierarchically and separate index pages for all of the files, modules, signals, tasks and functions.

Once you have the html files they can be installed on a web-server, or simply viewed using ``Open File...'' in your web browser.

Details on navigating around the converted files, and many examples can be found at http://www.abrizio.com/v2html/v2html.html .

Note that as of version 5.0 v2html uses cascading style sheets to colour the display. This means that pages viewed with old browsers that do not support cascading style sheets (for instance Netscape 3) will not be coloured.


DESCRIPTION

In addition to the switches detailed below v2html also accepts and ignores most VCS/verilog options and all other options starting with a plus. This means that you should be able to run it with the same command file you use for running simulations.

Switches:

-q
Be quiet - so don't print all those informative messages about what it is doing.

-f command_lines_options_file
Specify a file to get more command line options from. For instance you could put a list of all your files in src_files and then use -f src_file. You can also put in just about anything that you can put on the command line. Comments can be included using # or // at the start of the line. Wildcards are not allowed in the file names. Use single or double quotes to quote arguments that have spaces in them for example:

          # v2html -f file - turn on gzip compression
          -z -ze .gz
          -zc 'gzip  -f'
           
You can have as many -f options as you want and you can probably put
-f options in the file too.

+define+NAME[=VALUE]
Pre-define a value. This is just the same as putting:

        'define NAME [VALUE]

at the top of each of your input files. The rather strange syntax is the same as verilog's. This option is useful for controlling which ifdefs appear true to v2html.

+incdir+DIR
Specify a directory to search for include files (just like verilog).

-y DIR
Specify a directory to search for modules (just like verilog). Note that v2html doesn't do any fancy search orders like verilog - it just searches the directories in the order that you specify them on the command line.

+libext+EXT
Specify an extension use when searching for modules (just like verilog). You can specify multiple extensions using +libext+EXT1+EXT2+EXT2 or by specifying multiple +libext+EXT options.

-v LIBFILE
Specify a library file to use (just like verilog).

-css cascading_style_sheet
The appearance of all the different elements of the html page can be altered using a cascading style sheet. By default v2html uses a file called v2html.css in the same directory as the html files. You can customize the appearance of the html files by editing this file (v2html will create one if it does not exist, but will not overwrite an existing one).

If you have many different html directories which you want to use the one central cascading style sheet then you can use the -css option to specify one. For example:

        -css http://www.barking.com/joes_style.css

-m mail_addr
A mail address of the site maintainer. This is placed in a field at the bottom of each file like this:

 This page:
         Maintained by:         Joe_Bloggs@barking.com
         Created:               Thu Nov 6 08:53:37 1997
         From:                  test2.v

-i
Incremental mode. At the moment this isn't very incremental! v2html checks the dates on all of the files that it read last time it ran and all of the output files it generated. If any of the input files are newer than the output files, or if the command line options have changed it deletes all of the files it made last time and rebuilds everything. The delete is done to stop old files accumulating in the output directory.

v2html keeps track of all the information it needs to do this in a file called .v2html_incr .

Note that if a new file is added to one of the library directories but isn't specified on the command line v2html will not know that it has to pull it in and so will not do a rebuild.

-o output_dir
Set the output directory for the html files. The default is the current directory.

-h hier_file
Set the name of the file that the hierarchy is written to. The default is hierarchy.html. This is also used as a base for the index file names. These file names are formed put appending -f, -m, -s, -t and -fn to the part of the hierarchy file name before the first dot (so hier.htm will put the files index in hier-f.htm).

-ht top_module
Set the name of a top module you want in the hierarchy. You can specify multiple -ht options to specify multiple top modules.

If you don't specify any -ht options then v2html will inspect the hierarchy and find all the top modules in the verilog files and print these out. The 'top modules' are modules that are not instantiated but instantiate other modules that v2html has found the definition of.

-hc hierarchy_comment
Specifies some text to put at the top of the hierarchy. For instance:

   v2html -hc "This is our ASIC" *.v

-htf
Turns on printing of tasks and functions in the hierarchy. By default they are not printed.

-lines max_lines_per_file
In order to speed up viewing v2html splits large verilog files across multiple html pages. This option lets you specify how many lines you want on a page. The default is 1000.

-nnm
No ``No modules''. By default the hierarchy contains three sections, the hierarchies of the top modules, a list of files containing no modules and a list of unconnected modules (modules that are not instantiated but also do not qualify as top modules). The -nnm makes v2html skip printing the list of files containing no modules. See -nu.

-nu
No unconnected. See -nnm. Makes v2html skip writing the list of unconnected modules in the hierarchy file.

-nh
No hierarchy. Don't print out the hierarchy.

-nindex
No indexes. Don't print out the indexes.

-ni
By default v2html 'greys out' any code that is ifdefed out. The -ni turns this greying out off. Note that v2html always ignores code that is ifdefed out when it is parsing.

-z
Compress the html files generated (and make sure the links point to the compressed versions). This can be useful if you convert machine generated code, like ASIC RAM macros which are huge before they are converted and even bigger afterwards.

-zc compresser
The executable to use to compress the html files if -z is used. The Default is 'compress -f'. For instance to use gzip use -zc 'gzip -f' (the -f stops gzip prompting you about overwriting files).

-ze compressed_extension
The extension that your compress executable uses. The default is '.Z'. If you were using gzip then you'd want -ze .gz

-F [frame_file.html]
Frame mode. Using -F turns on the generation of framed output where a top level frame file is generated that creates three frames in your browser, the top one for the hierarchy the middle one for the code and the bottom one for any definitions to appear in.

The default name for the frame file is frame.html. This default can be overridden by specifying a file name after the -F option.

-g global_inc_file.v
Specify a global include file (without the path). This is the same as putting:

 'include "global_inc_file.v"

at the top of all of your verilog files. This option is provided for designs that rely on reading in the global include file before any others in verilog or synopsys (rather than including it).

The global_inc_file.v file must appear in the list of input files.

-s
Link to the source. This causes the file name in From field of the page footer to become a link to the unconverted verilog file:

 This page:
         Maintained by:         Joe_Bloggs@barking.com
         Created:               Thu Nov 6 08:53:37 1997
         From:                  /asic/verilog/test2.v

For this to work your web server must have access to the source code. Also, you must either run v2html in the output directory or use absolute path names for the verilog files.

For example, if the source is in /home/asic/verilog and the html files want to end up in /home/www/verilog then there are two ways to run it to get -s to work:

  1) In the output directory with verilog files specified by relative paths:
        cd /home/www/verilog
        v2html -s ../../asic/verilog/*.v

 2) In any directory with verilog files specified by absolute paths:
        cd /anywhere
        v2html -s -o /home/www/verilog   /home/asic/verilog/*.v

-c /cgi_script /path_to_html_files
Activate CGI features which allow the user to hide and show regions of the hierarchy in a similar way to the old file manager on windows 3.1. This method only works if you put the files on a web server (you can't just use ``Open File...'' to view it - see -js for a method where you don't need a web server).

To use this you must have installed the v2html CGI script on your web-server. The /cgi_script is the name of the CGI script (with path). The /path_to_v_files is the directory you are putting your html files.

These paths are the paths your web server sees (not the full paths on the system) so is the same path that appears after http://server when accessing the files.

Here's an example:

  cp v2html-cgi /opt/CERNhttpd/cgi-bin/ 
  chmod 755 /opt/CERNhttpd/cgi-bin/v2html-cgi

  cd /home/web/v2html/example/ex1
  v2html -c /cgi-bin/v2html-cgi /v2html/example/ex1 ../verilog/*.v

Note that v2html can't check the parameters to -c while converting the files. You'll have to do it yourself by viewing the hierarchy in your web browser and clicking on [Hide All] at the top of the hierarchy. Make sure you view the file using the web server (use http://server/v2html/example/ex1/hierarchy.html rather than file:/home/web/v2html/example/ex1/hierarchy.html).

If you get a message like this when you click on [Hide All]:

  Bad script request -- neither '/opt/CERNhttpd/cgi-bin/v2html-cg' 
        nor '/opt/CERNhttpd/cgi-bin/v2html-cg.pp' is executable

Then either there is either a problem with the installation of the cgi script or you have incorrectly specified the first parameter to -c.

If you get a message like this:

  v2html error.

then you have probably got the second parameter to -c wrong.

-k key_string
Specify the key to use for to stop people looking at hierarchy files that are protected by web-server security. The default is to use a random key, but this means that you can't have bookmarks of the hierarchy in various states (because the bookmark will contain the key, and the key will change each time you run v2html). To get round this problem you can use -k and always have the same key string. The key can be any string of digits and letters.

-js
Activate javascript features that allow the user to hide and collapse regions of the hierarchy. This is an alternative to the CGI script described above.

The -js option makes v2html produce javascript program in hierarchy.html that runs inside your web browser to do the showing and hiding of chunks of the hierarchy.

Javascript has several advantages over CGI:

you don't need to install the CGI script.

you don't need to specify the paths to everything for v2html.

you don't need a web server (you can just open the files with netscape and it works).

it is faster if you are far from the server.

But a few disadvantages:

It might crash your browser sometimes (actually I can only get it to crash these days by clicking on a folder while it is still drawing the page).

you use Internet Explorer the display will jump to the top of the page each time you hide or expand something.

-tab value
Expand tabs to the specified value.

-ncookies
The Javascript version of the hierarchy uses cookies to remember the state you left the hierarchy in, so when you next visit the hierarchy page it will be in the same state. If you hate cookies then use the -ncookies option to turn them off.

-nqs
Turn off quick search feature (only works in Netscape Navigator 4). Quick search lets you jump to the next or previous occurance of a link by simply by clicking on it. The mouse buttons are bound as follows:

 Middle       (or Left+Control) = search forwards
 Middle+Shift (or Left+Shift)   = search backwards

-debug
Turn on lots of debugging information.

AUTHOR

Costas Calamvokis <v2html@iname.com>.

EXAMPLES

Here is an example where v2html is run in the directory containing the verilog files (note the -o option):

  cd /users/jb/verilog_files/
  v2html -F my_frame.html -h my_hier.html -ht chip_top -htf -nu
    -o /users/www/project/verilog -m Joe_Blogs@barking.com -s  
    -c /cgi-bin/v2html-cgi /project/verilog *.v

As the verilog files don't have absolute paths and we aren't running in the destination directory can't use -s (link to source) as the links v2html will create wouldn't allow the web server to find the files.

Here is an example where v2html is run in the directory where we want the html files (no -o option):

  cd  /users/www/project/verilog
  v2html -F my_frame.html -h my_hier.html -ht chip_top -nu -htf
    -m Joe_Blogs@barking.com -s  
    -c /cgi-bin/v2html-cgi /project/verilog ../../../jb/verilog_files/*.v

Here we can use the -s option because we are running the the destination directory, so the links v2html creates to the source will work (providing the web server is allowed to server files from /users/jb/verilog_files).

DIAGNOSTICS

By default v2html tells you a lot about what it is doing (this is because it is slow and if it didn't you'd think it had crashed!). These messages can get in the way of the warnings v2html produces, so if you have a problem first try -q (quiet) to see if there are any warnings you missed in the deluge of messages.

Most of the Error messages concern failures to open files, I guess these will be caused by bad permissions, or you pointing v2html at files or directories that don't exist.

The errors that say things like:

  Error: confused at line 1034

mean that you have written some verilog that I wasn't expecting - send it to me and I'll see what I can do.

Most of the warnings concern things that v2html will ignore because it found more than one of them. The most common is a duplicate module being found because an old copy of one of the files is lurking in your source directory. The easiest way around this is to use the -f option something like this:

  ls /path/*.v | grep -v old_module_file.v > src_files
  v2html -f src_files 

Generally v2html will ignore duplicate things (so for example modules won't appear in the hierarchy), but sometimes it will just pick one of them, so watch those warnings.