projects
/
litex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
60ae9dc
)
sim: fix case break
author
Sebastien Bourdeauducq
<sb@m-labs.hk>
Tue, 20 Oct 2015 09:18:33 +0000
(17:18 +0800)
committer
Sebastien Bourdeauducq
<sb@m-labs.hk>
Tue, 20 Oct 2015 09:18:33 +0000
(17:18 +0800)
migen/sim/core.py
patch
|
blob
|
history
diff --git
a/migen/sim/core.py
b/migen/sim/core.py
index fc750833c0c848830e3a893cc2d5ed743167c652..f89cd02c32cd978b6b6bdee6c4bf1484d9a3af97 100644
(file)
--- a/
migen/sim/core.py
+++ b/
migen/sim/core.py
@@
-196,11
+196,13
@@
class Evaluator:
elif isinstance(s, Case):
nbits, signed = value_bits_sign(s.test)
test = _truncate(self.eval(s.test), nbits, signed)
+ found = False
for k, v in s.cases.items():
if isinstance(k, Constant) and k.value == test:
self.execute(v)
- return
- if "default" in s.cases:
+ found = True
+ break
+ if not found and "default" in s.cases:
self.execute(s.cases["default"])
elif isinstance(s, collections.Iterable):
self.execute(s)