From b2ddc0a7c5d1063d0456211b13688e32ecd55f06 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 9 Jun 2020 11:50:51 +0100 Subject: [PATCH] map LDST len directly, rather than go through a switch statement --- src/soc/decoder/power_decoder2.py | 11 +---------- src/soc/decoder/power_enums.py | 4 ++-- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/soc/decoder/power_decoder2.py b/src/soc/decoder/power_decoder2.py index 7cb353b7..9ff553fa 100644 --- a/src/soc/decoder/power_decoder2.py +++ b/src/soc/decoder/power_decoder2.py @@ -589,16 +589,6 @@ class PowerDecode2(Elaboratable): comb += dec_cr_out.sel_in.eq(op.cr_out) comb += dec_cr_out.rc_in.eq(dec_rc.rc_out.data) - # decode LD/ST length - with m.Switch(op.ldst_len): - with m.Case(LdstLen.is1B): - comb += e.data_len.eq(1) - with m.Case(LdstLen.is2B): - comb += e.data_len.eq(2) - with m.Case(LdstLen.is4B): - comb += e.data_len.eq(4) - with m.Case(LdstLen.is8B): - comb += e.data_len.eq(8) comb += e.nia.eq(0) # XXX TODO (or remove? not sure yet) fu = op.function_unit @@ -638,6 +628,7 @@ class PowerDecode2(Elaboratable): comb += e.write_cr_whole.eq(dec_cr_out.whole_reg) # decoded/selected instruction flags + comb += e.data_len.eq(op.ldst_len) comb += e.invert_a.eq(op.inv_a) comb += e.invert_out.eq(op.inv_out) comb += e.input_carry.eq(op.cry_in) # carry comes in diff --git a/src/soc/decoder/power_enums.py b/src/soc/decoder/power_enums.py index cdf5c591..9170359f 100644 --- a/src/soc/decoder/power_enums.py +++ b/src/soc/decoder/power_enums.py @@ -212,8 +212,8 @@ class LdstLen(Enum): NONE = 0 is1B = 1 is2B = 2 - is4B = 3 - is8B = 4 + is4B = 4 + is8B = 8 @unique -- 2.30.2