diff options
Diffstat (limited to 'pyGHDL/libghdl/__init__.py')
-rw-r--r-- | pyGHDL/libghdl/__init__.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pyGHDL/libghdl/__init__.py b/pyGHDL/libghdl/__init__.py index da39a4475..431008df3 100644 --- a/pyGHDL/libghdl/__init__.py +++ b/pyGHDL/libghdl/__init__.py @@ -76,7 +76,9 @@ _libghdl_path = _get_libghdl_path() libghdl = ctypes.CDLL(_libghdl_path) # Initialize it. +# First Ada elaboration (must be the first call) libghdl.libghdl_init() +# Then 'normal' initialization (set hooks) libghdl.libghdl__set_hooks_for_analysis() # Set the prefix in order to locate the vhdl libraries. @@ -84,6 +86,15 @@ libghdl.libghdl__set_exec_prefix( *_to_char_p(dirname(dirname(_libghdl_path)).encode("utf-8")) ) +def finalize(): + "Free all the memory, be ready for a new initialization" + libghdl.options__finalize() + + +def initialize(): + "Initialize or re-initialize the library" + libghdl.options__initialize() + def set_option(opt): "Set option OPT. Return true iff the option is known and handled" |