pyGHDL.libghdl
Python binding and low-level API for shared library libghdl.
In case of an error, a LibGHDLException is raised.
Submodules
- pyGHDL.libghdl._decorator
- pyGHDL.libghdl._types
- pyGHDL.libghdl.errorout
- pyGHDL.libghdl.errorout_console
- pyGHDL.libghdl.errorout_memory
- pyGHDL.libghdl.file_comments
- pyGHDL.libghdl.files_map
- pyGHDL.libghdl.files_map_editor
- pyGHDL.libghdl.flags
- pyGHDL.libghdl.libraries
- pyGHDL.libghdl.name_table
- pyGHDL.libghdl.std_names
- pyGHDL.libghdl.str_table
- pyGHDL.libghdl.utils
- pyGHDL.libghdl.vhdl
Variables
Functions
_get_libghdl_name(): Get the filename of the libghdl shared library file (incl. version and file extension)._get_libghdl_path(): Locate the directory where the shared library is installed._initialize(): Undocumented.finalize(): Free all the memory, be ready for a new initialization.initialize(): Initialize or re-initialize the shared library.set_option(): Set optionopt.analyze_init(): Initialize the analyzer.analyze_init_status(): Initialize the analyzer.analyze_file(): Analyze a given filenamefname.disp_config(): Display the configured prefixes for libghdl.
Exceptions
LibGHDLException: The exception is raised whenlibghdlcannot be loaded or reports an error.
Variables
- pyGHDL.libghdl.ENCODING
str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.
'latin-1'
Functions
- pyGHDL.libghdl._get_libghdl_name()[source]
Get the filename of the libghdl shared library file (incl. version and file extension).
- Return type:
- Returns:
Filename of the shared library file.
- pyGHDL.libghdl._get_libghdl_path()[source]
Locate the directory where the shared library is installed.
Search order:
Check environment variable
GHDL_PREFIX- directory (prefix) of the vhdl libraries.Check environment variable
VUNIT_GHDL_PATH- path of theghdlbinary when using VUnit.Check environment variable
GHDL- name of, or path to theghdlbinary.Try within
pyGHDL/libPython package installation path.Try searching the
ghdlbinary viawhich.Try
../../libwhen running from the build directory.
- Return type:
- pyGHDL.libghdl.finalize()[source]
Free all the memory, be ready for a new initialization.
- Return type:
- pyGHDL.libghdl.analyze_init()[source]
Initialize the analyzer.
Deprecated since version 1.0.0: Deprecated as it may raise an exception. Use
analyze_init_status().- Return type:
- pyGHDL.libghdl.analyze_init_status()[source]
Initialize the analyzer.
- Return type:
- Returns:
Returns 0 in case of success.
Exceptions
- exception pyGHDL.libghdl.LibGHDLException(message, errors=None)[source]
The exception is raised when
libghdlcannot be loaded or reports an error.Errors collected from libghdl’s error buffer are attached as
InternalErrors, because they describe a failure inside the shared library rather than in the Python binding.Inheritance