aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/libghdl/__init__.py
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2021-06-17 13:49:20 +0200
committerUnai Martinez-Corral <38422348+umarcor@users.noreply.github.com>2021-06-17 22:53:27 +0100
commitf65fff4d5e3a33e83c633eb20fd367e349f3dc92 (patch)
tree66e3fb6afc69738b28bcaaf908a09c13143615e7 /pyGHDL/libghdl/__init__.py
parent56f8ca47465a7cc052e80c0ed4bab6fc55eeacba (diff)
downloadghdl-f65fff4d5e3a33e83c633eb20fd367e349f3dc92.tar.gz
ghdl-f65fff4d5e3a33e83c633eb20fd367e349f3dc92.tar.bz2
ghdl-f65fff4d5e3a33e83c633eb20fd367e349f3dc92.zip
Using a decorator to bind libghdl to Python.
Diffstat (limited to 'pyGHDL/libghdl/__init__.py')
-rw-r--r--pyGHDL/libghdl/__init__.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/pyGHDL/libghdl/__init__.py b/pyGHDL/libghdl/__init__.py
index 0e89a6439..1d1701aaa 100644
--- a/pyGHDL/libghdl/__init__.py
+++ b/pyGHDL/libghdl/__init__.py
@@ -6,9 +6,9 @@
# | .__/ \__, |\____|_| |_|____/|_____(_)_|_|_.__/ \__, |_| |_|\__,_|_|
# |_| |___/ |___/
# =============================================================================
-# Authors:
-# Tristan Gingold
-# Patrick Lehmann
+# Authors:
+# Tristan Gingold
+# Patrick Lehmann
#
# Package package: Python binding and low-level API for shared library 'libghdl'.
#
@@ -40,7 +40,9 @@ from shutil import which
from pydecor import export
+from pyGHDL import GHDLBaseException
from pyGHDL.libghdl._types import Iir
+#from pyGHDL.libghdl._decorator import BindToLibGHDL
from pyGHDL.libghdl.version import __version__
@@ -150,18 +152,21 @@ libghdl = _initialize()
@export
+# @BindToLibGHDL("options__finalize")
def finalize() -> None:
"""Free all the memory, be ready for a new initialization."""
libghdl.options__finalize()
@export
+#@BindToLibGHDL("options__initialize")
def initialize() -> None:
"""Initialize or re-initialize the shared library."""
libghdl.options__initialize()
@export
+# @BindToLibGHDL("libghdl__set_option")
def set_option(Opt: str) -> bool:
"""
Set option :obj:`opt`.
@@ -174,6 +179,7 @@ def set_option(Opt: str) -> bool:
@export
+#@BindToLibGHDL("libghdl__analyze_init")
def analyze_init() -> None:
"""
Initialize the analyzer.
@@ -185,6 +191,7 @@ def analyze_init() -> None:
@export
+#@BindToLibGHDL("libghdl__analyze_init_status")
def analyze_init_status() -> int:
"""
Initialize the analyzer.
@@ -195,6 +202,7 @@ def analyze_init_status() -> int:
@export
+# @BindToLibGHDL("libghdl__analyze_file")
def analyze_file(fname: str) -> Iir:
"""
Analyze a given filename :obj:`fname`.
@@ -207,6 +215,12 @@ def analyze_file(fname: str) -> Iir:
@export
+#@BindToLibGHDL("ghdllocal__disp_config_prefixes")
def disp_config() -> None:
"""Display the configured prefixes for libghdl."""
libghdl.ghdllocal__disp_config_prefixes()
+
+
+@export
+class LibGHDLException(GHDLBaseException):
+ pass