Skip to content

Commit abf8c09

Browse files
authored
v0.15.0
2 parents f02762d + 01cc6f1 commit abf8c09

File tree

3 files changed

+59
-15
lines changed

3 files changed

+59
-15
lines changed

.github/workflows/Pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ jobs:
8787

8888
steps:
8989
- name: ⏬ Checkout repository
90-
uses: actions/checkout@v2
90+
uses: actions/checkout@v3
9191

9292
- name: ⚙ Setup GHDL
9393
uses: ghdl/setup-ghdl-ci@master
9494

9595
- name: 🐍 Setup Python
96-
uses: actions/setup-python@v2
96+
uses: actions/setup-python@v4
9797
with:
9898
python-version: ${{ fromJson(needs.Params.outputs.params).python_version }}
9999

pyVHDLModel/SyntaxModel.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ def __init__(self, symbolName: Name):
194194
@property
195195
def Library(self) -> 'Library':
196196
return self._library
197+
197198
@Library.setter
198199
def Library(self, value: 'Library') -> None:
199200
self._reference = value
@@ -207,6 +208,7 @@ def __init__(self, entityName: Name):
207208
@property
208209
def Entity(self) -> 'Entity':
209210
return self._reference
211+
210212
@Entity.setter
211213
def Entity(self, value: 'Entity') -> None:
212214
self._reference = value
@@ -220,6 +222,7 @@ def __init__(self, symbolName: Name):
220222
@property
221223
def Architecture(self) -> 'Architecture':
222224
return self._reference
225+
223226
@Architecture.setter
224227
def Architecture(self, value: 'Architecture') -> None:
225228
self._reference = value
@@ -233,6 +236,7 @@ def __init__(self, symbolName: Name):
233236
@property
234237
def Component(self) -> 'Component':
235238
return self._reference
239+
236240
@Component.setter
237241
def Component(self, value: 'Component') -> None:
238242
self._reference = value
@@ -246,6 +250,7 @@ def __init__(self, symbolName: Name):
246250
@property
247251
def Configuration(self) -> 'Configuration':
248252
return self._reference
253+
249254
@Configuration.setter
250255
def Configuration(self, value: 'Configuration') -> None:
251256
self._reference = value
@@ -259,6 +264,7 @@ def __init__(self, symbolName: Name):
259264
@property
260265
def Context(self) -> 'Context':
261266
return self._reference
267+
262268
@Context.setter
263269
def Context(self, value: 'Context') -> None:
264270
self._reference = value
@@ -272,6 +278,7 @@ def __init__(self, symbolName: Name, possibleReferences: PossibleReference):
272278
@property
273279
def Subtype(self) -> 'Subtype':
274280
return self._reference
281+
275282
@Subtype.setter
276283
def Subtype(self, value: 'Subtype') -> None:
277284
self._reference = value
@@ -323,6 +330,7 @@ def __init__(self, objectName: Name):
323330
@property
324331
def ObjectOrFunction(self) -> Union['Constant', 'Signal', 'Variable', 'Function', 'EnumerationLiteral']:
325332
return self._reference
333+
326334
@ObjectOrFunction.setter
327335
def ObjectOrFunction(self, value: Union['Constant', 'Signal', 'Variable', 'Function', 'EnumerationLiteral']):
328336
self._reference = value
@@ -336,6 +344,7 @@ def __init__(self, objectName: Name):
336344
@property
337345
def ObjectOrFunction(self) -> Union['Constant', 'Signal', 'Variable', 'Function']:
338346
return self._reference
347+
339348
@ObjectOrFunction.setter
340349
def ObjectOrFunction(self, value: Union['Constant', 'Signal', 'Variable', 'Function']):
341350
self._reference = value
@@ -349,11 +358,26 @@ def __init__(self, symbolName: Name):
349358
@property
350359
def Constant(self) -> 'Constant':
351360
return self._reference
361+
352362
@Constant.setter
353363
def Constant(self, value: 'Constant') -> None:
354364
self._reference = value
355365

356366

367+
@export
368+
class VariableSymbol(ObjectSymbol):
369+
def __init__(self, symbolName: Name):
370+
super().__init__(symbolName, PossibleReference.Constant)
371+
372+
@property
373+
def Variable(self) -> 'Variable':
374+
return self._reference
375+
376+
@Variable.setter
377+
def Variable(self, value: 'Variable') -> None:
378+
self._reference = value
379+
380+
357381
@export
358382
class SignalSymbol(ObjectSymbol):
359383
def __init__(self, symbolName: Name):
@@ -362,6 +386,7 @@ def __init__(self, symbolName: Name):
362386
@property
363387
def Signal(self) -> 'Signal':
364388
return self._reference
389+
365390
@Signal.setter
366391
def Signal(self, value: 'Signal') -> None:
367392
self._reference = value

pyVHDLModel/__init__.py

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
__email__ = "[email protected]"
4040
__copyright__ = "2016-2022, Patrick Lehmann"
4141
__license__ = "Apache License, Version 2.0"
42-
__version__ = "0.14.4"
42+
__version__ = "0.15.0"
4343

4444

4545
from enum import IntEnum, unique, Enum
@@ -81,8 +81,8 @@
8181
]
8282

8383
ContextUnion = Union[
84-
'LibraryClause'
85-
'UseClause'
84+
'LibraryClause',
85+
'UseClause',
8686
'ContextReference'
8787
]
8888

@@ -91,7 +91,7 @@
9191
@unique
9292
class VHDLVersion(Enum):
9393
"""
94-
An enumeration for all possible version numbers for VHDL.
94+
An enumeration for all possible version numbers for VHDL and VHDL-AMS.
9595
9696
A version can be given as integer or string and is represented as a unified
9797
enumeration value.
@@ -102,31 +102,42 @@ class VHDLVersion(Enum):
102102
Any = -1
103103
VHDL87 = 87
104104
VHDL93 = 93
105+
# AMS93 = 93
106+
AMS99 = 99
105107
VHDL2002 = 2002
106108
VHDL2008 = 2008
109+
AMS2017 = 2017
107110
VHDL2019 = 2019
108111

109112
__VERSION_MAPPINGS__: Dict[Union[int, str], Enum] = {
110113
87: VHDL87,
111114
93: VHDL93,
115+
99: AMS99,
112116
2: VHDL2002,
113117
8: VHDL2008,
118+
17: AMS2017,
114119
19: VHDL2019,
115120
1987: VHDL87,
116121
1993: VHDL93,
122+
1999: AMS99,
117123
2002: VHDL2002,
118124
2008: VHDL2008,
125+
2017: AMS2017,
119126
2019: VHDL2019,
120127
"Any": Any,
121128
"87": VHDL87,
122129
"93": VHDL93,
130+
"99": AMS99,
123131
"02": VHDL2002,
124132
"08": VHDL2008,
133+
"17": AMS2017,
125134
"19": VHDL2019,
126135
"1987": VHDL87,
127136
"1993": VHDL93,
137+
"1999": AMS99,
128138
"2002": VHDL2002,
129139
"2008": VHDL2008,
140+
"2017": AMS2017,
130141
"2019": VHDL2019
131142
}
132143

@@ -182,6 +193,12 @@ def __eq__(self, other: Any) -> bool:
182193
else:
183194
raise TypeError("Second operand is not of type 'VHDLVersion'.")
184195

196+
def IsVHDL(self) -> bool:
197+
return self in (self.VHDL87, self.VHDL93, self.VHDL2002, self.VHDL2008, self.VHDL2019)
198+
199+
def IsAMS(self) -> bool:
200+
return self in (self.AMS99, self.AMS2017)
201+
185202
def __str__(self) -> str:
186203
return "VHDL'" + str(self.value)[-2:]
187204

@@ -396,22 +413,23 @@ def Label(self) -> str:
396413
"""Returns a model entity's label."""
397414
return self._label
398415

416+
399417
@export
400418
class MixinDesignUnitWithContext:
401-
_contextItems: Nullable[List['ContextUnion']]
402-
_libraryReferences: Nullable[List['LibraryClause']]
403-
_packageReferences: Nullable[List['UseClause']]
404-
_contextReferences: Nullable[List['ContextReference']]
419+
_contextItems: List['ContextUnion']
420+
_libraryReferences: List['LibraryClause']
421+
_packageReferences: List['UseClause']
422+
_contextReferences: List['ContextReference']
405423

406424
def __init__(self, contextItems: Iterable['ContextUnion'] = None):
407425
from pyVHDLModel.SyntaxModel import LibraryClause, UseClause, ContextReference
408426

409-
if contextItems is not None:
410-
self._contextItems = []
411-
self._libraryReferences = []
412-
self._packageReferences = []
413-
self._contextReferences = []
427+
self._contextItems = []
428+
self._libraryReferences = []
429+
self._packageReferences = []
430+
self._contextReferences = []
414431

432+
if contextItems is not None:
415433
for item in contextItems:
416434
self._contextItems.append(item)
417435
if isinstance(item, UseClause):
@@ -458,6 +476,7 @@ class PrimaryUnit(DesignUnit):
458476
@property
459477
def Library(self) -> 'Library':
460478
return self._parent
479+
461480
@Library.setter
462481
def Library(self, library: 'Library') -> None:
463482
self._parent = library

0 commit comments

Comments
 (0)