aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/libghdl/vhdl/nodes_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyGHDL/libghdl/vhdl/nodes_utils.py')
-rw-r--r--pyGHDL/libghdl/vhdl/nodes_utils.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/pyGHDL/libghdl/vhdl/nodes_utils.py b/pyGHDL/libghdl/vhdl/nodes_utils.py
index 3d8a10b1e..f2b9c8bba 100644
--- a/pyGHDL/libghdl/vhdl/nodes_utils.py
+++ b/pyGHDL/libghdl/vhdl/nodes_utils.py
@@ -7,8 +7,8 @@
# |_| |___/ |___/
# =============================================================================
# Authors:
-# Tristan Gingold
-# Patrick Lehmann
+# Tristan Gingold
+# Patrick Lehmann
#
# Package module: Python binding and low-level API for shared library 'libghdl'.
#
@@ -34,10 +34,12 @@
from pydecor import export
-from pyGHDL.libghdl import libghdl, Iir
+from pyGHDL.libghdl._types import Iir
+from pyGHDL.libghdl._decorator import BindToLibGHDL
@export
+@BindToLibGHDL("vhdl__utils__strip_denoting_name")
def Strip_Denoting_Name(Name: Iir) -> Iir:
"""
If :obj:`Name` is a simple or an expanded name, return the denoted declaration.
@@ -46,10 +48,10 @@ def Strip_Denoting_Name(Name: Iir) -> Iir:
:param Name: Simple or an expanded name.
:return: Denoted declaration.
"""
- return libghdl.vhdl__utils__strip_denoting_name(Name)
@export
+@BindToLibGHDL("vhdl__utils__get_entity")
def Get_Entity(Decl: Iir) -> Iir:
"""
This is a wrapper around ``Get_Entity_Name`` to return the entity declaration
@@ -58,10 +60,10 @@ def Get_Entity(Decl: Iir) -> Iir:
:param Decl: Declaration
:return: Entity
"""
- return libghdl.vhdl__utils__get_entity(Decl)
@export
+@BindToLibGHDL("vhdl__utils__is_second_subprogram_specification")
def Is_Second_Subprogram_Specification(Spec: Iir) -> bool:
"""
Check if :obj:`Spec` is the subprogram specification of a subprogram body
@@ -71,10 +73,10 @@ def Is_Second_Subprogram_Specification(Spec: Iir) -> bool:
:param Spec: Specification
:return: ``True`` if subprogram specification and previously declared subprogram body match
"""
- return libghdl.vhdl__utils__is_second_subprogram_specification(Spec)
@export
+@BindToLibGHDL("vhdl__utils__get_entity_from_entity_aspect")
def Get_Entity_From_Entity_Aspect(Aspect: Iir) -> Iir:
"""
Extract the entity from :obj:`Aspect`.
@@ -85,10 +87,10 @@ def Get_Entity_From_Entity_Aspect(Aspect: Iir) -> Iir:
:param Aspect: Aspect
:return: Entity
"""
- return libghdl.vhdl__utils__get_entity_from_entity_aspect(Aspect)
@export
+@BindToLibGHDL("vhdl__utils__get_interface_of_formal")
def Get_Interface_Of_Formal(Formal: Iir) -> Iir:
"""
Get the interface corresponding to the formal name :obj:`Formal`. This is
@@ -97,4 +99,3 @@ def Get_Interface_Of_Formal(Formal: Iir) -> Iir:
:param Formal: The formal.
:return: The corresponding interface.
"""
- return libghdl.vhdl__utils__get_interface_of_formal(Formal)