57
57
@export
58
58
@unique
59
59
class Direction (Enum ):
60
- """A ``Direction`` is an enumeration and represents a direction in a range (``to`` or ``downto``)."""
60
+ """An enumeration representing a direction in a range (``to`` or ``downto``)."""
61
61
62
62
To = 0 #: Ascending direction
63
63
DownTo = 1 #: Descending direction
@@ -66,7 +66,7 @@ def __str__(self):
66
66
"""
67
67
Formats the direction to ``to`` or ``downto``.
68
68
69
- :return : Formatted direction.
69
+ :returns : Formatted direction.
70
70
"""
71
71
return ("to" , "downto" )[cast (int , self .value )] # TODO: check performance
72
72
@@ -92,13 +92,13 @@ def __str__(self):
92
92
"""
93
93
Formats the direction.
94
94
95
- :return : Formatted direction.
95
+ :returns : Formatted direction.
96
96
"""
97
97
return ("" , "in" , "out" , "inout" , "buffer" , "linkage" )[cast (int , self .value )] # TODO: check performance
98
98
99
99
100
100
@export
101
- class ModelEntity (metaclass = ExtendedType , useSlots = True ):
101
+ class ModelEntity (metaclass = ExtendedType , slots = True ):
102
102
"""
103
103
``ModelEntity`` is the base-class for all classes in the VHDL language model, except for mixin classes (see multiple
104
104
inheritance) and enumerations.
@@ -111,7 +111,6 @@ class ModelEntity(metaclass=ExtendedType, useSlots=True):
111
111
112
112
def __init__ (self ):
113
113
"""Initializes a VHDL model entity."""
114
-
115
114
self ._parent = None
116
115
117
116
@property
@@ -132,7 +131,7 @@ def GetAncestor(self, type: Type) -> 'ModelEntity':
132
131
133
132
134
133
@export
135
- class NamedEntityMixin :
134
+ class NamedEntityMixin ( metaclass = ExtendedType , mixin = True ) :
136
135
"""
137
136
A ``NamedEntityMixin`` is a mixin class for all VHDL entities that have identifiers.
138
137
@@ -172,7 +171,7 @@ def NormalizedIdentifier(self) -> str:
172
171
173
172
174
173
@export
175
- class MultipleNamedEntityMixin :
174
+ class MultipleNamedEntityMixin ( metaclass = ExtendedType , mixin = True ) :
176
175
"""
177
176
A ``MultipleNamedEntityMixin`` is a mixin class for all VHDL entities that declare multiple instances at once by
178
177
defining multiple identifiers.
@@ -213,7 +212,7 @@ def NormalizedIdentifiers(self) -> Tuple[str]:
213
212
214
213
215
214
@export
216
- class LabeledEntityMixin :
215
+ class LabeledEntityMixin ( metaclass = ExtendedType , mixin = True ) :
217
216
"""
218
217
A ``LabeledEntityMixin`` is a mixin class for all VHDL entities that can have labels.
219
218
@@ -252,7 +251,7 @@ def NormalizedLabel(self) -> Nullable[str]:
252
251
253
252
254
253
@export
255
- class DocumentedEntityMixin :
254
+ class DocumentedEntityMixin ( metaclass = ExtendedType , mixin = True ) :
256
255
"""
257
256
A ``DocumentedEntityMixin`` is a mixin class for all VHDL entities that can have an associated documentation.
258
257
@@ -281,7 +280,7 @@ def Documentation(self) -> Nullable[str]:
281
280
282
281
283
282
@export
284
- class ConditionalMixin :
283
+ class ConditionalMixin ( metaclass = ExtendedType , mixin = True ) :
285
284
"""A ``BaseConditional`` is a mixin-class for all statements with a condition."""
286
285
287
286
_condition : ExpressionUnion
@@ -297,38 +296,38 @@ def Condition(self) -> ExpressionUnion:
297
296
298
297
299
298
@export
300
- class BranchMixin :
299
+ class BranchMixin ( metaclass = ExtendedType , mixin = True ) :
301
300
"""A ``BaseBranch`` is a mixin-class for all statements with branches."""
302
301
303
302
def __init__ (self ):
304
303
pass
305
304
306
305
307
306
@export
308
- class ConditionalBranchMixin (BranchMixin , ConditionalMixin ):
307
+ class ConditionalBranchMixin (BranchMixin , ConditionalMixin , mixin = True ):
309
308
"""A ``BaseBranch`` is a mixin-class for all branch statements with a condition."""
310
309
def __init__ (self , condition : ExpressionUnion ):
311
310
super ().__init__ ()
312
311
ConditionalMixin .__init__ (self , condition )
313
312
314
313
315
314
@export
316
- class IfBranchMixin (ConditionalBranchMixin ):
315
+ class IfBranchMixin (ConditionalBranchMixin , mixin = True ):
317
316
"""A ``BaseIfBranch`` is a mixin-class for all if-branches."""
318
317
319
318
320
319
@export
321
- class ElsifBranchMixin (ConditionalBranchMixin ):
320
+ class ElsifBranchMixin (ConditionalBranchMixin , mixin = True ):
322
321
"""A ``BaseElsifBranch`` is a mixin-class for all elsif-branches."""
323
322
324
323
325
324
@export
326
- class ElseBranchMixin (BranchMixin ):
325
+ class ElseBranchMixin (BranchMixin , mixin = True ):
327
326
"""A ``BaseElseBranch`` is a mixin-class for all else-branches."""
328
327
329
328
330
329
@export
331
- class ReportStatementMixin :
330
+ class ReportStatementMixin ( metaclass = ExtendedType , mixin = True ) :
332
331
"""A ``MixinReportStatement`` is a mixin-class for all report and assert statements."""
333
332
334
333
_message : Nullable [ExpressionUnion ]
@@ -353,15 +352,15 @@ def Severity(self) -> Nullable[ExpressionUnion]:
353
352
354
353
355
354
@export
356
- class AssertStatementMixin (ReportStatementMixin , ConditionalMixin ):
355
+ class AssertStatementMixin (ReportStatementMixin , ConditionalMixin , mixin = True ):
357
356
"""A ``MixinAssertStatement`` is a mixin-class for all assert statements."""
358
357
359
358
def __init__ (self , condition : ExpressionUnion , message : ExpressionUnion = None , severity : ExpressionUnion = None ):
360
359
super ().__init__ (message , severity )
361
360
ConditionalMixin .__init__ (self , condition )
362
361
363
362
364
- class BlockStatementMixin :
363
+ class BlockStatementMixin ( metaclass = ExtendedType , mixin = True ) :
365
364
"""A ``BlockStatement`` is a mixin-class for all block statements."""
366
365
367
366
def __init__ (self ):
0 commit comments