From ee491651861ed89c44ced180189656b8a80fbee0 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sun, 6 Sep 2020 12:50:47 +0100 Subject: [PATCH] move DEC and TB from StateRegs to FastRegs for several reasons first: SPR pipeline already has fast1 read/write second: a new DecodeStateIn/Out object would be needed instead just add FastRegs.DEC/TB to DecodeA/Out third: there is probably a third somewhere --- src/soc/decoder/power_decoder2.py | 14 ++++++++++++-- src/soc/decoder/power_regspec_map.py | 2 +- src/soc/fu/spr/main_stage.py | 14 +++----------- src/soc/fu/spr/pipe_data.py | 2 -- src/soc/regfile/regfiles.py | 22 ++++++++++------------ 5 files changed, 26 insertions(+), 28 deletions(-) diff --git a/src/soc/decoder/power_decoder2.py b/src/soc/decoder/power_decoder2.py index 83238391..66cc8d97 100644 --- a/src/soc/decoder/power_decoder2.py +++ b/src/soc/decoder/power_decoder2.py @@ -149,7 +149,12 @@ class DecodeA(Elaboratable): with m.Case(SPR.XER.value): comb += self.fast_out.data.eq(FastRegs.XER) comb += self.fast_out.ok.eq(1) - pass # do nothing + with m.Case(SPR.DEC.value): + comb += self.fast_out.data.eq(FastRegs.DEC) + comb += self.fast_out.ok.eq(1) + with m.Case(SPR.TB.value): + comb += self.fast_out.data.eq(FastRegs.TB) + comb += self.fast_out.ok.eq(1) # : map to internal SPR numbers # XXX TODO: dec and tb not to go through mapping. with m.Default(): @@ -332,7 +337,12 @@ class DecodeOut(Elaboratable): with m.Case(SPR.XER.value): comb += self.fast_out.data.eq(FastRegs.XER) comb += self.fast_out.ok.eq(1) - pass # do nothing + with m.Case(SPR.TB.value): + comb += self.fast_out.data.eq(FastRegs.TB) + comb += self.fast_out.ok.eq(1) + with m.Case(SPR.DEC.value): + comb += self.fast_out.data.eq(FastRegs.DEC) + comb += self.fast_out.ok.eq(1) # : map to internal SPR numbers # XXX TODO: dec and tb not to go through mapping. with m.Default(): diff --git a/src/soc/decoder/power_regspec_map.py b/src/soc/decoder/power_regspec_map.py index 65caf014..6c1e76e7 100644 --- a/src/soc/decoder/power_regspec_map.py +++ b/src/soc/decoder/power_regspec_map.py @@ -91,7 +91,7 @@ def regspec_decode_read(e, regfile, name): if regfile == 'STATE': # STATE register numbering is *unary* encoded PC = 1<