51
51
52
52
@export
53
53
class ConcurrentStatement (Statement ):
54
- """A ``ConcurrentStatement`` is a base-class for all concurrent statements."""
54
+ """A base-class for all concurrent statements."""
55
55
56
56
57
57
@export
58
58
class ConcurrentStatementsMixin :
59
+ """
60
+ A mixin-class for all language constructs supporting concurrent statements.
61
+
62
+ .. seealso::
63
+
64
+ .. todo:: concurrent declaration region
65
+ """
66
+
59
67
_statements : List [ConcurrentStatement ]
60
68
61
69
_instantiations : Dict [str , 'Instantiation' ] # TODO: add another instantiation class level for entity/configuration/component inst.
@@ -105,6 +113,10 @@ def IndexStatements(self):
105
113
106
114
@export
107
115
class Instantiation (ConcurrentStatement ):
116
+ """
117
+ A base-class for all (component) instantiations.
118
+ """
119
+
108
120
_genericAssociations : List [AssociationItem ]
109
121
_portAssociations : List [AssociationItem ]
110
122
@@ -136,6 +148,16 @@ def PortAssociations(self) -> List[AssociationItem]:
136
148
137
149
@export
138
150
class ComponentInstantiation (Instantiation ):
151
+ """
152
+ Represents a component instantiation by referring to a component name.
153
+
154
+ .. admonition:: Example
155
+
156
+ .. code-block:: VHDL
157
+
158
+ inst : component Counter;
159
+ """
160
+
139
161
_component : ComponentInstantiationSymbol
140
162
141
163
def __init__ (self , label : str , componentSymbol : ComponentInstantiationSymbol , genericAssociations : Iterable [AssociationItem ] = None , portAssociations : Iterable [AssociationItem ] = None ):
@@ -151,6 +173,16 @@ def Component(self) -> ComponentInstantiationSymbol:
151
173
152
174
@export
153
175
class EntityInstantiation (Instantiation ):
176
+ """
177
+ Represents an entity instantiation by referring to an entity name with optional architecture name.
178
+
179
+ .. admonition:: Example
180
+
181
+ .. code-block:: VHDL
182
+
183
+ inst : entity work. Counter;
184
+ """
185
+
154
186
_entity : EntityInstantiationSymbol
155
187
_architecture : ArchitectureSymbol
156
188
@@ -175,6 +207,16 @@ def Architecture(self) -> ArchitectureSymbol:
175
207
176
208
@export
177
209
class ConfigurationInstantiation (Instantiation ):
210
+ """
211
+ Represents a configuration instantiation by referring to a configuration name.
212
+
213
+ .. admonition:: Example
214
+
215
+ .. code-block:: VHDL
216
+
217
+ inst : configuration Counter;
218
+ """
219
+
178
220
_configuration : ConfigurationInstantiationSymbol
179
221
180
222
def __init__ (self , label : str , configurationSymbol : ConfigurationInstantiationSymbol , genericAssociations : Iterable [AssociationItem ] = None , portAssociations : Iterable [AssociationItem ] = None ):
@@ -190,6 +232,20 @@ def Configuration(self) -> ConfigurationInstantiationSymbol:
190
232
191
233
@export
192
234
class ProcessStatement (ConcurrentStatement , SequentialDeclarations , SequentialStatements , DocumentedEntityMixin ):
235
+ """
236
+ Represents a process statement with sensitivity list, sequential declaration region and sequential statements.
237
+
238
+ .. admonition:: Example
239
+
240
+ .. code-block:: VHDL
241
+
242
+ proc: process(Clock)
243
+ -- sequential declarations
244
+ begin
245
+ -- sequential statements
246
+ end process;
247
+ """
248
+
193
249
_sensitivityList : List ['Name' ] # TODO: implement a SignalSymbol
194
250
195
251
def __init__ (
@@ -258,7 +314,15 @@ def PortItems(self) -> List[PortInterfaceItem]:
258
314
259
315
@export
260
316
class GenerateBranch (ModelEntity , ConcurrentDeclarationRegionMixin , ConcurrentStatementsMixin ):
261
- """A ``GenerateBranch`` is a base-class for all branches in a generate statements."""
317
+ """
318
+ A base-class for all branches in a generate statements.
319
+
320
+ .. seealso::
321
+
322
+ * :class:`If-generate branch <pyVHDLModel.Concurrent.IfGenerateBranch>`
323
+ * :class:`Elsif-generate branch <pyVHDLModel.Concurrent.ElsifGenerateBranch>`
324
+ * :class:`Else-generate branch <pyVHDLModel.Concurrent.ElseGenerateBranch>`
325
+ """
262
326
263
327
_alternativeLabel : Nullable [str ]
264
328
_normalizedAlternativeLabel : Nullable [str ]
@@ -286,28 +350,90 @@ def NormalizedAlternativeLabel(self) -> Nullable[str]:
286
350
287
351
@export
288
352
class IfGenerateBranch (GenerateBranch , IfBranchMixin ):
353
+ """
354
+ Represents if-generate branch in a generate statement with a concurrent declaration region and concurrent statements.
355
+
356
+ .. admonition:: Example
357
+
358
+ .. code-block:: VHDL
359
+
360
+ gen: if condition generate
361
+ -- concurrent declarations
362
+ begin
363
+ -- concurrent statements
364
+ elsif condition generate
365
+ -- ...
366
+ else generate
367
+ -- ...
368
+ end generate;
369
+ """
370
+
289
371
def __init__ (self , condition : ExpressionUnion , declaredItems : Iterable = None , statements : Iterable [ConcurrentStatement ] = None , alternativeLabel : str = None ):
290
372
super ().__init__ (declaredItems , statements , alternativeLabel )
291
373
IfBranchMixin .__init__ (self , condition )
292
374
293
375
294
376
@export
295
377
class ElsifGenerateBranch (GenerateBranch , ElsifBranchMixin ):
378
+ """
379
+ Represents elsif-generate branch in a generate statement with a concurrent declaration region and concurrent statements.
380
+
381
+ .. admonition:: Example
382
+
383
+ .. code-block:: VHDL
384
+
385
+ gen: if condition generate
386
+ -- ...
387
+ elsif condition generate
388
+ -- concurrent declarations
389
+ begin
390
+ -- concurrent statements
391
+ else generate
392
+ -- ...
393
+ end generate;
394
+ """
395
+
296
396
def __init__ (self , condition : ExpressionUnion , declaredItems : Iterable = None , statements : Iterable [ConcurrentStatement ] = None , alternativeLabel : str = None ):
297
397
super ().__init__ (declaredItems , statements , alternativeLabel )
298
398
ElsifBranchMixin .__init__ (self , condition )
299
399
300
400
301
401
@export
302
402
class ElseGenerateBranch (GenerateBranch , ElseBranchMixin ):
403
+ """
404
+ Represents else-generate branch in a generate statement with a concurrent declaration region and concurrent statements.
405
+
406
+ .. admonition:: Example
407
+
408
+ .. code-block:: VHDL
409
+
410
+ gen: if condition generate
411
+ -- ...
412
+ elsif condition generate
413
+ -- ...
414
+ else generate
415
+ -- concurrent declarations
416
+ begin
417
+ -- concurrent statements
418
+ end generate;
419
+ """
420
+
303
421
def __init__ (self , declaredItems : Iterable = None , statements : Iterable [ConcurrentStatement ] = None , alternativeLabel : str = None ):
304
422
super ().__init__ (declaredItems , statements , alternativeLabel )
305
423
ElseBranchMixin .__init__ (self )
306
424
307
425
308
426
@export
309
427
class GenerateStatement (ConcurrentStatement ):
310
- """A ``GenerateStatement`` is a base-class for all generate statements."""
428
+ """
429
+ A base-class for all generate statements.
430
+
431
+ .. seealso::
432
+
433
+ * :class:`If...generate statement <pyVHDLModel.Concurrent.IfGenerateStatement>`
434
+ * :class:`Case...generate statement <pyVHDLModel.Concurrent.CaseGenerateStatement>`
435
+ * :class:`For...generate statement <pyVHDLModel.Concurrent.ForGenerateStatement>`
436
+ """
311
437
312
438
_namespace : Namespace
313
439
@@ -327,6 +453,22 @@ def IndexStatement(self) -> None:
327
453
328
454
@export
329
455
class IfGenerateStatement (GenerateStatement ):
456
+ """
457
+ Represents an if...generate statement.
458
+
459
+ .. admonition:: Example
460
+
461
+ .. code-block:: VHDL
462
+
463
+ gen: if condition generate
464
+ -- ...
465
+ elsif condition generate
466
+ -- ...
467
+ else generate
468
+ -- ...
469
+ end generate;
470
+ """
471
+
330
472
_ifBranch : IfGenerateBranch
331
473
_elsifBranches : List [ElsifGenerateBranch ]
332
474
_elseBranch : Nullable [ElseGenerateBranch ]
@@ -378,7 +520,7 @@ def IndexStatement(self) -> None:
378
520
379
521
@export
380
522
class ConcurrentChoice (BaseChoice ):
381
- """A ``ConcurrentChoice`` is a base-class for all concurrent choices (in case...generate statements)."""
523
+ """A base-class for all concurrent choices (in case...generate statements)."""
382
524
383
525
384
526
@export
@@ -421,6 +563,23 @@ def __str__(self) -> str:
421
563
422
564
@export
423
565
class CaseGenerateStatement (GenerateStatement ):
566
+ """
567
+ Represents a case...generate statement.
568
+
569
+ .. admonition:: Example
570
+
571
+ .. code-block:: VHDL
572
+
573
+ gen: case selector generate
574
+ case choice1 =>
575
+ -- ...
576
+ case choice2 =>
577
+ -- ...
578
+ case others =>
579
+ -- ...
580
+ end generate;
581
+ """
582
+
424
583
_expression : ExpressionUnion
425
584
_cases : List [GenerateCase ]
426
585
@@ -456,6 +615,18 @@ def IndexStatement(self):
456
615
457
616
@export
458
617
class ForGenerateStatement (GenerateStatement , ConcurrentDeclarationRegionMixin , ConcurrentStatementsMixin ):
618
+ """
619
+ Represents a for...generate statement.
620
+
621
+ .. admonition:: Example
622
+
623
+ .. code-block:: VHDL
624
+
625
+ gen: for i in 0 to 3 generate
626
+ -- ...
627
+ end generate;
628
+ """
629
+
459
630
_loopIndex : str
460
631
_range : Range
461
632
0 commit comments