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

Name check that should greatly add in debugging

--HG--
branch : 0.8-dev
This commit is contained in:
Jan Decaluwe 2013-04-16 09:58:21 +02:00
parent f968ce0ba1
commit 2d1b4a12ba
2 changed files with 9 additions and 3 deletions

View File

@ -745,7 +745,13 @@ class _AnalyzeVisitor(ast.NodeVisitor, _ConversionMixin):
def visit_ListComp(self, node):
mem = node.obj = _Ram()
self.kind = _kind.DECLARATION
self.visit(node.elt)
try:
self.visit(node.elt)
except ConversionError, e:
if e.kind == _error.UnboundLocal:
pass
else:
raise
self.kind = _kind.NORMAL
mem.elObj = self.getObj(node.elt)
if not isinstance(mem.elObj, intbv) or not len(mem.elObj) > 0:
@ -854,7 +860,7 @@ class _AnalyzeVisitor(ast.NodeVisitor, _ConversionMixin):
elif n in __builtin__.__dict__:
node.obj = __builtin__.__dict__[n]
else:
pass
self.raiseError(node, _error.UnboundLocal, n)
def visit_Return(self, node):
self.raiseError(node, _error.NotSupported, "return statement")

View File

@ -324,7 +324,7 @@ class TestNotSupported(unittest.TestCase):
def testNonBoolArgOr(self):
a = Signal(bool())
b = intbv(0)[2:]
a = Signal(bool())
c = Signal(bool())
z = Signal(bool())
def g(z, a, b):
@instance