From 28962ff438a4d2f811dcd579581c80b574ae18e1 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 19 Oct 2015 15:58:21 +0800 Subject: [PATCH] sim/core: truncate evaluated values before test in If --- migen/sim/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migen/sim/core.py b/migen/sim/core.py index 0de231f29..af3f3734f 100644 --- a/migen/sim/core.py +++ b/migen/sim/core.py @@ -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)