projects
/
litex.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d3fd50
)
sim: support Case
author
Sebastien Bourdeauducq
<sb@m-labs.hk>
Thu, 17 Sep 2015 09:25:06 +0000
(17:25 +0800)
committer
Sebastien Bourdeauducq
<sb@m-labs.hk>
Thu, 17 Sep 2015 09:25:06 +0000
(17:25 +0800)
migen/sim.py
patch
|
blob
|
history
diff --git
a/migen/sim.py
b/migen/sim.py
index c6ddea55bc2a496cb8d30eefa4fbb893b541e96a..ed40963dd3730bcc6c7179bad7da49a4bb8a6fc4 100644
(file)
--- a/
migen/sim.py
+++ b/
migen/sim.py
@@
-130,8
+130,15
@@
class Evaluator:
self.execute(s.t)
else:
self.execute(s.f)
+ elif isinstance(s, Case):
+ test = self.eval(s.test)
+ for k, v in s.cases.items():
+ if isinstance(k, Constant) and k.value == test:
+ self.execute(v)
+ return
+ if "default" in s.cases:
+ self.execute(s.cases["default"])
else:
- # TODO: Case
raise NotImplementedError