From 315929daa4f81c511db3fc1041b8297e92d54683 Mon Sep 17 00:00:00 2001 From: Michael Nolan Date: Sat, 29 Feb 2020 17:26:06 -0500 Subject: [PATCH] Add default case to decoder --- src/decoder/power_decoder.py | 13 +++++++++++++ src/decoder/power_enums.py | 5 +++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/decoder/power_decoder.py b/src/decoder/power_decoder.py index 275c85a7..22e52435 100644 --- a/src/decoder/power_decoder.py +++ b/src/decoder/power_decoder.py @@ -43,6 +43,19 @@ class PowerDecoder(Elaboratable): for bit in single_bit_flags: sig = getattr(self, get_signal_name(bit)) comb += sig.eq(int(row[bit])) + with m.Default(): + comb += self.function_unit.eq(Function.NONE) + comb += self.internal_op.eq(InternalOp.OP_ILLEGAL) + comb += self.in1_sel.eq(0) + comb += self.in2_sel.eq(0) + comb += self.in3_sel.eq(0) + comb += self.out_sel.eq(0) + comb += self.ldst_len.eq(0) + comb += self.rc_sel.eq(0) + comb += self.cry_in.eq(0) + for bit in single_bit_flags: + sig = getattr(self, get_signal_name(bit)) + comb += sig.eq(0) return m def ports(self): diff --git a/src/decoder/power_enums.py b/src/decoder/power_enums.py index 6241f752..38ef0325 100644 --- a/src/decoder/power_enums.py +++ b/src/decoder/power_enums.py @@ -29,8 +29,9 @@ def get_signal_name(name): @unique class Function(Enum): - ALU = 0 - LDST = 1 + NONE = 0 + ALU = 1 + LDST = 2 @unique -- 2.30.2