projects
/
soc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
526e9d0
)
move default case out of switch, to make room for multiple switches
author
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Wed, 4 Mar 2020 16:49:01 +0000
(16:49 +0000)
committer
Luke Kenneth Casson Leighton
<lkcl@lkcl.net>
Wed, 4 Mar 2020 16:49:01 +0000
(16:49 +0000)
and a *list* of subdecoders
src/decoder/power_decoder.py
patch
|
blob
|
history
diff --git
a/src/decoder/power_decoder.py
b/src/decoder/power_decoder.py
index de85759235a84a4de41ffa9da34f82a743ca77c6..96ad6a73aa83c47b9275ad91ab0d788ff7bc6dab 100644
(file)
--- a/
src/decoder/power_decoder.py
+++ b/
src/decoder/power_decoder.py
@@
-136,6
+136,9
@@
class PowerDecoder(Elaboratable):
comb += self.op.eq(subdecoder.op)
else:
+ comb += self.op._eq(None) # default case
+ # TODO: detect if subdecoders is a *list*, and do
+ # a for-loop around the *list* of subdecoders
with m.Switch(opcode_switch):
self.handle_subdecoders(m)
for row in self.opcodes:
@@
-146,8
+149,6
@@
class PowerDecoder(Elaboratable):
continue
with m.Case(opcode):
comb += self.op._eq(row)
- with m.Default():
- comb += self.op._eq(None)
return m
def handle_subdecoders(self, m):