File tree Expand file tree Collapse file tree 5 files changed +270
-53
lines changed Expand file tree Collapse file tree 5 files changed +270
-53
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,41 @@ frontends.
44
44
* Created a (re)formatted output of VHDL.
45
45
46
46
47
+ ## Examples
48
+ ### List all Entities with Generics and Ports
49
+
50
+ The following tiny example is based on GHDL's [ ` pyGHDL.dom ` ] ( https://github.com/ghdl/ghdl/tree/master/pyGHDL/dom ) package implementing
51
+ pyVHDLModel.
52
+
53
+ ``` python
54
+ from pathlib import Path
55
+ from pyGHDL.dom.NonStandard import Design, Document
56
+
57
+ sourceFile = Path(" example.vhdl" )
58
+
59
+ design = Design()
60
+ library = Design.GetLibrary(" lib" )
61
+ document = Document(sourceFile)
62
+ design.AddDocument(document, library)
63
+
64
+ for entity in document.Entities:
65
+ print (" {} " .format(entity.Name))
66
+ print (" generics:" )
67
+ for generic in entity.Generics:
68
+ print (" - {} : {!s } {} " .format(
69
+ generic.Name, generic.Mode, generic.SubTypeIndication)
70
+ )
71
+ print (" ports:" )
72
+ for port in entity.Ports:
73
+ print (" - {} : {!s } {} " .format(
74
+ port.Name, port.Mode, port.SubTypeIndication)
75
+ )
76
+ ```
77
+
78
+
79
+
80
+
81
+
47
82
## Contributors
48
83
* [ Patrick Lehmann] ( https://github.com/Paebbels ) (Maintainer)
49
84
* [ Unai Martinez-Corral] ( https://github.com/umarcor )
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ types). An entity's list of statements is called body items.
83
83
def LibraryReferences (self ) -> List[Library]:
84
84
85
85
@ property
86
- def PackageReferences (self ) -> List[UseStatement ]:
86
+ def PackageReferences (self ) -> List[UseClause ]:
87
87
88
88
@ property
89
89
def ContextReferences (self ) -> List[Context]:
@@ -131,7 +131,7 @@ Package
131
131
def LibraryReferences (self ) -> List[Library]:
132
132
133
133
@ property
134
- def PackageReferences (self ) -> List[UseStatement ]:
134
+ def PackageReferences (self ) -> List[UseClause ]:
135
135
136
136
@ property
137
137
def ContextReferences (self ) -> List[Context]:
@@ -178,7 +178,7 @@ Architeture
178
178
def LibraryReferences (self ) -> List[Library]:
179
179
180
180
@ property
181
- def PackageReferences (self ) -> List[UseStatement ]:
181
+ def PackageReferences (self ) -> List[UseClause ]:
182
182
183
183
@ property
184
184
def ContextReferences (self ) -> List[Context]:
@@ -223,7 +223,7 @@ Package Body
223
223
def LibraryReferences (self ) -> List[Library]:
224
224
225
225
@ property
226
- def PackageReferences (self ) -> List[UseStatement ]:
226
+ def PackageReferences (self ) -> List[UseClause ]:
227
227
228
228
@ property
229
229
def ContextReferences (self ) -> List[Context]:
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ def _LatestTagName():
37
37
38
38
# The full version, including alpha/beta/rc tags
39
39
version = "0.9" # The short X.Y version.
40
- release = "0.10.3 " # The full version, including alpha/beta/rc tags.
40
+ release = "0.10.4 " # The full version, including alpha/beta/rc tags.
41
41
try :
42
42
if _IsUnderGitControl :
43
43
latestTagName = _LatestTagName ()[1 :] # remove prefix "v"
You can’t perform that action at this time.
0 commit comments