Skip to content

Commit

Permalink
sim/core: truncate evaluated values before test in If
Browse files Browse the repository at this point in the history
sbourdeauducq committed Oct 19, 2015
1 parent ec80f0f commit 28962ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion migen/sim/core.py
Original file line number Diff line number Diff line change
@@ -181,7 +181,7 @@ def execute(self, statements):
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)

0 comments on commit 28962ff

Please sign in to comment.