diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-10-28 06:21:50 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-10-28 06:21:50 +0200 |
commit | b0fc6a361bd803f82590fcc30671d53de1c22123 (patch) | |
tree | 90280183e2d26ef8ff04ab8e16cfc60fdfe692d5 | |
parent | d28da43713deff35f66f8a4db821a63c348770b4 (diff) | |
download | ghdl-b0fc6a361bd803f82590fcc30671d53de1c22123.tar.gz ghdl-b0fc6a361bd803f82590fcc30671d53de1c22123.tar.bz2 ghdl-b0fc6a361bd803f82590fcc30671d53de1c22123.zip |
python: add features.
-rw-r--r-- | src/vhdl/python/libghdl/thin.py | 3 | ||||
-rw-r--r-- | src/vhdl/python/libghdl/thinutils.py | 12 |
2 files changed, 13 insertions, 2 deletions
diff --git a/src/vhdl/python/libghdl/thin.py b/src/vhdl/python/libghdl/thin.py index 68409531e..0a0178aa3 100644 --- a/src/vhdl/python/libghdl/thin.py +++ b/src/vhdl/python/libghdl/thin.py @@ -74,6 +74,9 @@ def Get_Identifier(s): # Ieee class Ieee: + Std_Logic_1164_Pkg = c_int.in_dll( + libghdl, "ieee__std_logic_1164__std_logic_1164_pkg") + # Get value Std_Logic_Type = c_int.in_dll( libghdl, "ieee__std_logic_1164__std_logic_type") diff --git a/src/vhdl/python/libghdl/thinutils.py b/src/vhdl/python/libghdl/thinutils.py index 4f43bfdb7..df69aef02 100644 --- a/src/vhdl/python/libghdl/thinutils.py +++ b/src/vhdl/python/libghdl/thinutils.py @@ -136,10 +136,17 @@ def declarations_iter(n): elif k1 == iirs.Iir_Kind.Signal_Attribute_Declaration: # Not a declaration pass + elif k1 in [iirs.Iir_Kind.Type_Declaration, + iirs.Iir_Kind.Anonymous_Type_Declaration]: + yield n1 + # Handle nested declarations: record elements, physical units, + # enumeration literals... + typ = iirs.Get_Type_Definition(n1) + for n2 in declarations_iter(n1): + yield n2 else: yield n1 - # There can be nested declarations (subprograms, - # record elements) + # There can be nested declarations (subprograms) for n2 in declarations_iter(n1): yield n2 if nodes_meta.Has_Concurrent_Statement_Chain(k): @@ -172,6 +179,7 @@ def declarations_iter(n): yield n2 if k in [iirs.Iir_Kind.Entity_Declaration, iirs.Iir_Kind.Architecture_Body, + iirs.Iir_Kind.Package_Declaration, iirs.Iir_Kind.Package_Body, iirs.Iir_Kind.Process_Statement, iirs.Iir_Kind.Sensitized_Process_Statement, |