aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/python/pnodespy.py
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-10-17 18:18:41 +0200
committerTristan Gingold <tgingold@free.fr>2017-10-17 18:18:41 +0200
commit4b02db2999cfd9c174be04de1d6a1fb6ed86e956 (patch)
tree004411b0bdabb501bfc48ccbb1f9b3c8dff83664 /src/vhdl/python/pnodespy.py
parent369d2d2cdc76eff902ae578fa0429771c0118224 (diff)
downloadghdl-4b02db2999cfd9c174be04de1d6a1fb6ed86e956.tar.gz
ghdl-4b02db2999cfd9c174be04de1d6a1fb6ed86e956.tar.bz2
ghdl-4b02db2999cfd9c174be04de1d6a1fb6ed86e956.zip
iirs: reformat enum, add more enums in python interface.
Diffstat (limited to 'src/vhdl/python/pnodespy.py')
-rwxr-xr-xsrc/vhdl/python/pnodespy.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/vhdl/python/pnodespy.py b/src/vhdl/python/pnodespy.py
index 89b288995..b846c01b0 100755
--- a/src/vhdl/python/pnodespy.py
+++ b/src/vhdl/python/pnodespy.py
@@ -16,6 +16,8 @@ def print_enum(name, vals):
print
print 'class {0}:'.format(name)
for n, k in enumerate(vals):
+ if k == 'None':
+ k = 'PNone'
print ' {0} = {1}'.format(k, n)
@@ -69,14 +71,14 @@ def do_class_fields():
def read_spec_enum(type_name, prefix, class_name):
"""Read an enumeration declaration from iirs.ads"""
pat_decl = re.compile(r' type {0} is$'.format(type_name))
- pat_enum = re.compile(r' {0}_(\w+),?(-- .*)?$'.format(prefix))
- lr = pnodes.linereader(pnodes.spec_file)
+ pat_enum = re.compile(r' {0}_(\w+),?(-- .*)?$'.format(prefix))
+ lr = pnodes.linereader(pnodes.kind_file)
while not pat_decl.match(lr.get()):
pass
toks = []
while True:
line = lr.get()
- if line == ' );\n':
+ if line == ' );\n':
break
m = pat_enum.match(line)
if m:
@@ -88,6 +90,8 @@ def do_libghdl_iirs():
print 'from libghdl import libghdl'
do_class_kinds()
read_spec_enum('Iir_Mode', 'Iir', 'Iir_Mode')
+ read_spec_enum('Iir_Predefined_Functions',
+ 'Iir_Predefined', 'Iir_Predefined')
do_iirs_subprg()