From 322b55ed89390939318cf4dc0f750f808214bdd0 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 4 Mar 2020 16:49:01 +0000 Subject: [PATCH] move default case out of switch, to make room for multiple switches and a *list* of subdecoders --- src/decoder/power_decoder.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/decoder/power_decoder.py b/src/decoder/power_decoder.py index de857592..96ad6a73 100644 --- 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): -- 2.30.2