VHDL Libraries

Library Directory

OSVVMOpen Source VHDL Verification Methodology creates libraries in a library directory: <LibraryDirectory>/VHDL_LIBS/<ToolName>-<Version>/. The tool and version part keeps the libraries of different simulators and versions apart.

By default, <LibraryDirectory> is the simulation directory. SetLibraryDirectory selects another one; a relative path is resolved against the simulation directory. GetLibraryDirectory returns it.

SetLibraryDirectory ../libs
puts [GetLibraryDirectory]
  • libs
    • VHDL_LIBS
      • NVC-1.23.0
        • one entry per library
      • QuestaSim-2024.3
        • one entry per library

Active Library

library makes a library the active library, the one analyze and simulate use. If it doesn’t exist, it’s created in the library directory. An optional second argument names another directory for it.

Library names are case insensitive, as in VHDLVHSIC Hardware Description Language. ListLibraries prints the libraries OSVVM knows.

library osvvm_TbAxi4
analyze TbAxi4.vhd

ListLibraries

Using Existing Libraries

Libraries analyzed before, by another build or in another directory, can be used without analyzing them again:

Without a path, they use the library directory of SetLibraryDirectory.

# Use the OSVVM libraries built in another simulation directory
LinkLibraryDirectory ../sim_shared

library  ExampleLib
RunTest  TbExample.vhd

Removing Libraries

RemoveLibrary osvvm_TbAxi4
RemoveLibraryDirectory
RemoveAllLibraries