When should we use lib(-v -y) in verdi
How to use Find Scope in Synopsys Verdi following this question. Why do we launch lib/foo.v and lib/bar.v as lib but not as module. Any benefits of using lib? What's the difference of lib and module in verdi?
When should we use lib(-v -y) in verdi
How to use Find Scope in Synopsys Verdi following this question. Why do we launch lib/foo.v and lib/bar.v as lib but not as module. Any benefits of using lib? What's the difference of lib and module in verdi?
-y specifies a directory where verdi looks for missing module definitions. This happens when you do not specify all files on the command line, for example:
top.v:
module top;
child child();
endmodule
There is a module 'lib/child.v' which contains definition of child.
You can either use verdi top.v lib/child.v
or verdi top.v -y lib
. The latter is very convenient when you have many module definitions in different directories and you do not need to specify the full list, let compiler figuring it on its own. However, it also a source of confusion in particular in big designs.
However, it seems that verdi does not have a set of default extensions for the library files to search, so you need to provide one: verdi top.v -y lib +libext+.v
. This means that it will look in directory lib for files named as <missing-module>.v, i.e. chid.v.
-v actually allows verdi to look for missing modules in a file, where the file contains multiple definitions of modules.
top.v:
module top;
child child();
cell1 cell1();
cell2 cell2();
endmodule
cells.v contains definitions of multiple cells, including cell1 and cell2. So, using verdi -v cells.v top.v -y lib +libext+.v
will also provide definitions of the cell modules. The advantage of -v is that it will only choose module definition which are needed in compilation. If you omit '-v' you might end up with a lot of top-level unneeded modules.
Just a note: verilog distinguishes between design modules and cells, so does verdi. By default it treats all module definitions found with above methods as 'cells'. To use them as design modules you need to use -ssy and -ssv respectively.