File: _types.py

package info (click to toggle)
ghdl 5.0.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 86,000 kB
  • sloc: ada: 309,826; vhdl: 209,727; ansic: 31,072; python: 19,213; sh: 14,214; cpp: 2,345; makefile: 1,542; pascal: 585; asm: 45; exp: 40; fortran: 33
file content (93 lines) | stat: -rw-r--r-- 3,275 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# =============================================================================
#               ____ _   _ ____  _       _ _ _           _         _ _
#  _ __  _   _ / ___| | | |  _ \| |     | (_) |__   __ _| |__   __| | |
# | '_ \| | | | |  _| |_| | | | | |     | | | '_ \ / _` | '_ \ / _` | |
# | |_) | |_| | |_| |  _  | |_| | |___ _| | | |_) | (_| | | | | (_| | |
# | .__/ \__, |\____|_| |_|____/|_____(_)_|_|_.__/ \__, |_| |_|\__,_|_|
# |_|    |___/                                     |___/
# =============================================================================
#  Authors:
#    Patrick Lehmann
#
# Package module:   Python binding and low-level API for shared library 'libghdl'.
#
# License:
# ============================================================================
#  Copyright (C) 2019-2021 Tristan Gingold
#
#  This program is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <gnu.org/licenses>.
#
# SPDX-License-Identifier: GPL-2.0-or-later
# ============================================================================
from enum import IntEnum, unique
from ctypes import c_int32, c_uint32, c_int64, c_double, c_bool
from typing import TypeVar

from pyTooling.Decorators import export

__all__ = [
    "ErrorIndex",
    "MessageIdWarnings",
    "NameId",
    "SourceFileEntry",
    "Iir",
    "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=c_int32)
MessageIdWarnings = TypeVar("MessageIdWarnings", bound=c_int32)
NameId = TypeVar("NameId", 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)
LocationType = TypeVar("LocationType", bound=c_uint32)

Iir = TypeVar("Iir", bound=c_int32)
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=c_int32)
Iir_Design_Unit = TypeVar("Iir_Design_Unit", bound=c_int32)
Iir_Library_Declaration = TypeVar("Iir_Library_Declaration", bound=c_int32)
Iir_Package_Declaration = TypeVar("Iir_Package_Declaration", bound=c_int32)
Iir_Enumeration_Type_Definition = TypeVar("Iir_Enumeration_Type_Definition", bound=c_int32)