How ifdefs are handled

Because v2html parses your verilog it has to handle ifdefs too, otherwise it would get confused by stuff like this:

       begin
       i = i + 1;
`ifdef SOMETHING
       end
`else
       end
`endif

The way it handles ifdefs is to keep track of what is defined at the moment by looking at the `defines in your file (and in any included files that it has access to) and ignore the code that is ifdefed out.

It also 'greys out' any code that is ifdefed out when it comes to producing the html. You can turn off the greying out with the -ni command line option, but v2html will still ignore the code while it is parsing.

You can also specify defines on the command line in the verilog syntax, either:

     v2html +define+NAME1 +define+NAME2 ...

or

     v2html +define+NAME=VALUE ...

Here is an example of code with loads of ifdefs in.

Previous Next

© 1999-2009 Costas Calamvokis