1
0
mirror of https://github.com/myhdl/myhdl.git synced 2024-12-14 07:44:38 +08:00

see issue #29: ListOfSIgnals in VHDL sensitivity list

--HG--
branch : 0.9-dev
This commit is contained in:
Josy Boelen 2015-02-18 10:04:03 +01:00
parent b9fcfe69db
commit f521550b35

View File

@ -1590,8 +1590,18 @@ class _ConvertAlwaysCombVisitor(_ConvertVisitor):
self.funcBuf = funcBuf
def visit_FunctionDef(self, node):
# a local function works nicely too
def compressSensitivityList(senslist):
''' reduce spelled out list items like [*name*(0), *name*(1), ..., *name*(n)] to just *name*'''
r = []
for item in senslist:
name = item._name.split('(',1)[0]
if not name in r:
r.append( name ) # note that the list now contains names and not Signals, but we are interested in the strings anyway ...
return r
self.writeDoc(node)
senslist = self.tree.senslist
senslist = compressSensitivityList(self.tree.senslist)
self.write("%s: process (" % self.tree.name)
for e in senslist[:-1]:
self.write(e)