Skip to content

Commit 6578475

Browse files
committed
Added EntityInstantiationSymbol, ComponentInstantiationSymbol and ConfigurationInstantiationSymbol.
1 parent ad6ff9a commit 6578475

File tree

1 file changed

+32
-19
lines changed

1 file changed

+32
-19
lines changed

pyVHDLModel/SyntaxModel.py

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
from pyVHDLModel import ModelEntity, NamedEntityMixin, MultipleNamedEntityMixin, LabeledEntityMixin, DocumentedEntityMixin, PossibleReference
4848
from pyVHDLModel import Name, Symbol, NewSymbol, LibraryClause, UseClause, ContextReference, DesignUnit
4949
from pyVHDLModel import PrimaryUnit, SecondaryUnit
50-
from pyVHDLModel import ExpressionUnion, ConstraintUnion, ContextUnion, SubtypeOrSymbol, DesignUnitWithContextMixin, PackageOrSymbol
50+
from pyVHDLModel import ExpressionUnion, ConstraintUnion, ContextUnion, SubtypeOrSymbol, DesignUnitWithContextMixin
5151
from pyVHDLModel.PSLModel import VerificationUnit, VerificationProperty, VerificationMode
5252

5353
try:
@@ -290,44 +290,57 @@ def Package(self, value: 'Package') -> None:
290290

291291

292292
@export
293-
class ComponentSymbol(Symbol):
294-
def __init__(self, symbolName: Name):
295-
super().__init__(symbolName, PossibleReference.Component)
293+
class EntityInstantiationSymbol(SelectedName, NewSymbol):
294+
"""An entity reference in a direct entity instantiation."""
295+
296+
def __init__(self, identifier: str, prefix: LibraryReferenceSymbol):
297+
super().__init__(identifier, prefix)
298+
NewSymbol.__init__(self, PossibleReference.Entity)
296299

297300
@property
298-
def Component(self) -> 'Component':
301+
def Prefix(self) -> LibraryReferenceSymbol:
302+
return cast(LibraryReferenceSymbol, self._prefix)
303+
304+
@property
305+
def Entity(self) -> 'Entity':
299306
return self._reference
300307

301-
@Component.setter
302-
def Component(self, value: 'Component') -> None:
308+
@Entity.setter
309+
def Entity(self, value: 'Entity') -> None:
303310
self._reference = value
304311

305312

306313
@export
307-
class ConfigurationSymbol(Symbol):
308-
def __init__(self, symbolName: Name):
309-
super().__init__(symbolName, PossibleReference.Configuration)
314+
class ComponentInstantiationSymbol(SimpleName, NewSymbol):
315+
"""A component reference in a component instantiation."""
316+
317+
def __init__(self, identifier: str):
318+
super().__init__(identifier)
319+
NewSymbol.__init__(self, PossibleReference.Component)
310320

311321
@property
312-
def Configuration(self) -> 'Configuration':
322+
def Component(self) -> 'Component':
313323
return self._reference
314324

315-
@Configuration.setter
316-
def Configuration(self, value: 'Configuration') -> None:
325+
@Component.setter
326+
def Component(self, value: 'Component') -> None:
317327
self._reference = value
318328

319329

320330
@export
321-
class ContextSymbol(Symbol):
322-
def __init__(self, symbolName: Name):
323-
super().__init__(symbolName, PossibleReference.Context)
331+
class ConfigurationInstantiationSymbol(SimpleName, NewSymbol):
332+
"""A configuration reference in a configuration instantiation."""
333+
334+
def __init__(self, identifier: str):
335+
super().__init__(identifier)
336+
NewSymbol.__init__(self, PossibleReference.Configuration)
324337

325338
@property
326-
def Context(self) -> 'Context':
339+
def Configuration(self) -> 'Configuration':
327340
return self._reference
328341

329-
@Context.setter
330-
def Context(self, value: 'Context') -> None:
342+
@Configuration.setter
343+
def Configuration(self, value: 'Configuration') -> None:
331344
self._reference = value
332345

333346

0 commit comments

Comments
 (0)