From: Sebastien Bourdeauducq Date: Mon, 19 Oct 2015 07:58:21 +0000 (+0800) Subject: sim/core: truncate evaluated values before test in If X-Git-Tag: 24jan2021_ls180~2099^2~3^2~19 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=28962ff438a4d2f811dcd579581c80b574ae18e1;p=litex.git sim/core: truncate evaluated values before test in If --- diff --git a/migen/sim/core.py b/migen/sim/core.py index 0de231f2..af3f3734 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)