projects
/
nmigen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2f7e523
)
back.pysim: fix scope screwup.
author
whitequark
<whitequark@whitequark.org>
Wed, 26 Jun 2019 05:22:09 +0000
(
05:22
+0000)
committer
whitequark
<whitequark@whitequark.org>
Wed, 26 Jun 2019 05:22:09 +0000
(
05:22
+0000)
nmigen/back/pysim.py
patch
|
blob
|
history
diff --git
a/nmigen/back/pysim.py
b/nmigen/back/pysim.py
index c07677f998ed8ab84fed32659b47983f5791780a..42f99542b29d6be764127417a46b6427bc11ca84 100644
(file)
--- 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)