sim/core: truncate evaluated values before test in If

This commit is contained in:
Sebastien Bourdeauducq 2015-10-19 15:58:21 +08:00
parent ec80f0fa7e
commit 28962ff438
1 changed files with 1 additions and 1 deletions

View File

@ -181,7 +181,7 @@ class Evaluator:
if isinstance(s, _Assign):
self.assign(s.l, self.eval(s.r))
elif isinstance(s, If):
if self.eval(s.cond):
if self.eval(s.cond) & (2**len(s.cond) - 1):
self.execute(s.t)
else:
self.execute(s.f)