aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/libghdl/_types.py
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-06-18 06:44:00 +0200
committerUnai Martinez-Corral <38422348+umarcor@users.noreply.github.com>2021-06-18 17:34:47 +0100
commit05755b53e1d723ff4d2c9de79c61badd42491b13 (patch)
tree71e4181ebf333ded767bb1481b19a176bf61c566 /pyGHDL/libghdl/_types.py
parentd8917e7cb2579b4e26c41610692fcc9a169350c0 (diff)
downloadghdl-05755b53e1d723ff4d2c9de79c61badd42491b13.tar.gz
ghdl-05755b53e1d723ff4d2c9de79c61badd42491b13.tar.bz2
ghdl-05755b53e1d723ff4d2c9de79c61badd42491b13.zip
pyGHDL: automatically add type annotations for nodes.py
Add missing types in _types.py, adjust lsp
Diffstat (limited to 'pyGHDL/libghdl/_types.py')
-rw-r--r--pyGHDL/libghdl/_types.py42
1 files changed, 38 insertions, 4 deletions
diff --git a/pyGHDL/libghdl/_types.py b/pyGHDL/libghdl/_types.py
index 21be42c64..936060f57 100644
--- a/pyGHDL/libghdl/_types.py
+++ b/pyGHDL/libghdl/_types.py
@@ -30,7 +30,9 @@
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ============================================================================
-from ctypes import c_int32
+from enum import IntEnum, unique
+from pydecor import export
+from ctypes import c_int32, c_uint32, c_int64, c_double, c_bool
from typing import TypeVar
__all__ = [
@@ -42,15 +44,47 @@ __all__ = [
"IirKind",
]
+
+@export
+@unique
+class TriStateType(IntEnum):
+ Unknown = 0
+ TFalse = 1
+ TTrue = 2
+
+
+@export
+@unique
+class DirectionType(IntEnum):
+ To = 0
+ Downto = 1
+
+
+# This is an Ada standard type, which can be 1 byte.
+Boolean = TypeVar("Boolean", bound=c_bool)
+
+Int32 = TypeVar("Int32", bound=c_int32)
+Int64 = TypeVar("Int64", bound=c_int64)
+Fp64 = TypeVar("Fp64", bound=c_double)
+
ErrorIndex = TypeVar("ErrorIndex", bound=int)
MessageIdWarnings = TypeVar("MessageIdWarnings", bound=int)
NameId = TypeVar("NameId", bound=int)
-SourceFileEntry = TypeVar("SourceFileEntry", bound=int)
-Location_Type = TypeVar("Location_Type", bound=c_int32)
+String8Id = TypeVar("String8Id", bound=c_uint32)
+FileChecksumId = TypeVar("FileChecksumId", bound=c_uint32)
+TimeStampId = TypeVar("TimeStampId", bound=c_uint32)
+
+SourceFileEntry = TypeVar("SourceFileEntry", bound=c_uint32)
+SourcePtr = TypeVar("SourcePtr", bound=c_int32)
+Location_Type = TypeVar("Location_Type", bound=c_uint32)
+LocationType = Location_Type
Iir = TypeVar("Iir", bound=int)
-IirKind = TypeVar("IirKind", bound=int)
+IirKind = TypeVar("IirKind", bound=c_int32)
+
+PSLNode = TypeVar("PSLNode", bound=c_int32)
+PSLNFA = TypeVar("PSLNFA", bound=c_int32)
Iir_Design_File = TypeVar("Iir_Design_File", bound=int)
Iir_Design_Unit = TypeVar("Iir_Design_Unit", bound=int)