pyGHDL.libghdl#

Python binding and low-level API for shared library libghdl.

In case of an error, a LibGHDLException is raised.

Submodules

Variables

Functions

Exceptions


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 sys.getdefaultencoding(). errors defaults to ‘strict’.

'latin-1'

Functions

pyGHDL.libghdl._get_libghdl_name()[source]#

Get the name of the libghdl library (with version and extension).

Return type:

Path

pyGHDL.libghdl._check_libghdl_libdir(libdir, basename)[source]#

Returns libghdl path in libdir, if found.

Return type:

Path

Parameters:
pyGHDL.libghdl._check_libghdl_bindir(bindir, basename)[source]#
Return type:

Path

Parameters:
pyGHDL.libghdl._get_libghdl_path()[source]#

Locate the directory where the shared library is installed.

Search order:

  1. GHDL_PREFIX - directory (prefix) of the vhdl libraries.

  2. VUNIT_GHDL_PATH - path of the ghdl binary when using VUnit.

  3. GHDL - name of, or path to the ghdl binary.

  4. Try within libghdl/ Python installation.

  5. Try when running from the build directory.

pyGHDL.libghdl._initialize()[source]#
pyGHDL.libghdl.finalize()[source]#

Free all the memory, be ready for a new initialization.

Return type:

None

pyGHDL.libghdl.initialize()[source]#

Initialize or re-initialize the shared library.

Return type:

None

pyGHDL.libghdl.set_option(opt)[source]#

Set option opt.

Parameters:

opt (str) – Option to set.

Return type:

bool

Returns:

Return True, if the option is known and handled.

pyGHDL.libghdl.analyze_init()[source]#

Initialize the analyzer. :rtype: None

Deprecated since version 1.0.0: Deprecated as it may raise an exception. Use analyze_init_status().

Return type:

None

pyGHDL.libghdl.analyze_init_status()[source]#

Initialize the analyzer.

Return type:

int

Returns:

Returns 0 in case of success.

pyGHDL.libghdl.analyze_file(fname)[source]#

Analyze a given filename fname.

Parameters:

fname (str) – File name

Return type:

TypeVar(Iir, bound= c_int)

Returns:

Internal Intermediate Representation (IIR)

pyGHDL.libghdl.disp_config()[source]#

Display the configured prefixes for libghdl.

Return type:

None


Exceptions

exception pyGHDL.libghdl.LibGHDLException(message, errors=None)[source]#

Inheritance

Inheritance diagram of LibGHDLException

Parameters: