BugHunter Pro and the VeriLogger Simulators

2.9 Source Code Libraries

2.9 Source Code Libraries

Previous topic Next topic  

2.9 Source Code Libraries

Previous topic Next topic  

Verilog supports two methods for using libraries of HDL source code that is common between multiple designs: source code libraries and compiled code libraries. This section discusses the older, slower method using source code libraries, and the next section discusses how to create and use the faster compiled libraries.

When a Verilog simulator compiles the files listed in the compiler command line options and in the User Source Files List, it parses the files and gets a list of module names that are instantiated in the files. After the compiler finishes storing these files into the current 'destination library' (see 2.10 Compiled Libraries for more information about the working library), the elaborator looks for the definitions of these modules, starting it's search in the destination library. If the definition is not found there, then the simulator next looks in the source code libraries (specified using the library search directories) to find a source code file with the same name as the module being searched for.

If a matching file is found, then it will compile the file and display the matched file in the project window under the Source Code Library Files folder. This folder will appear under the Simulated Models folder, but it only appears if matching files are found. This folder is a good place to look if you need to find out which source code library models are actually being instantiated in a given design.

Set Source Code Library Paths:

Press the Project Simulation Properties button or choose the Project > Project Simulation Properties menu to open the dialog.

 

Pick the Verilog language tab, then add the paths to your source code libraries to the Library Directories field.

You may also need to add new file extensions to the Library Extensions field. Only library source code files with a file extension matching the extensions listing in this field will be matched against during library searches.

For example, in the image shown below, the compiler will search the two source code library directories lib\verilog\ and lib\, and it will only match against source code filenamess in these directories that end in either .v or .vo.

After the the simulation is built, you can check the Source Code LIbrary Files folder in the Project window to see which if any source code library files are being used by the simulation. In the example shown, a file called tb_clock_typ.v was found in the source code library lib\verilog and compiled to provide the module definition for a module named tb_clock_typ.