From: whitequark Date: Wed, 26 Jun 2019 05:22:09 +0000 (+0000) Subject: back.pysim: fix scope screwup. X-Git-Tag: locally_working~145 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6f4e3156d81ada756435651f40ae4f74bb59072b;p=nmigen.git back.pysim: fix scope screwup. --- diff --git a/nmigen/back/pysim.py b/nmigen/back/pysim.py index c07677f..42f9954 100644 --- a/nmigen/back/pysim.py +++ b/nmigen/back/pysim.py @@ -329,7 +329,9 @@ class _StatementCompiler(StatementVisitor): mask = "1" * len(value) mask = int(mask, 2) value = int(value, 2) - check = lambda test: test & mask == value + def make_check(mask, value): + return lambda test: test & mask == value + check = make_check(mask, value) cases.append((check, self.on_statements(stmts))) def run(state): test_value = test(state)