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.
4444* Created a (re)formatted output of VHDL.
4545
4646
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+
4782## Contributors
4883* [ Patrick Lehmann] ( https://github.com/Paebbels ) (Maintainer)
4984* [ 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.
8383 def LibraryReferences (self ) -> List[Library]:
8484
8585 @ property
86- def PackageReferences (self ) -> List[UseStatement ]:
86+ def PackageReferences (self ) -> List[UseClause ]:
8787
8888 @ property
8989 def ContextReferences (self ) -> List[Context]:
@@ -131,7 +131,7 @@ Package
131131 def LibraryReferences (self ) -> List[Library]:
132132
133133 @ property
134- def PackageReferences (self ) -> List[UseStatement ]:
134+ def PackageReferences (self ) -> List[UseClause ]:
135135
136136 @ property
137137 def ContextReferences (self ) -> List[Context]:
@@ -178,7 +178,7 @@ Architeture
178178 def LibraryReferences (self ) -> List[Library]:
179179
180180 @ property
181- def PackageReferences (self ) -> List[UseStatement ]:
181+ def PackageReferences (self ) -> List[UseClause ]:
182182
183183 @ property
184184 def ContextReferences (self ) -> List[Context]:
@@ -223,7 +223,7 @@ Package Body
223223 def LibraryReferences (self ) -> List[Library]:
224224
225225 @ property
226- def PackageReferences (self ) -> List[UseStatement ]:
226+ def PackageReferences (self ) -> List[UseClause ]:
227227
228228 @ property
229229 def ContextReferences (self ) -> List[Context]:
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ def _LatestTagName():
3737
3838# The full version, including alpha/beta/rc tags
3939version = "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.
4141try :
4242 if _IsUnderGitControl :
4343 latestTagName = _LatestTagName ()[1 :] # remove prefix "v"
You can’t perform that action at this time.
0 commit comments