From eb30c83009e3a01162ea1de537884e0b8bf6a154 Mon Sep 17 00:00:00 2001 From: Tobias Platen Date: Tue, 26 Jan 2021 20:27:40 +0100 Subject: [PATCH] [Bug 580] redirect MMU SPRs to the MMU --- src/soc/decoder/power_decoder2.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/soc/decoder/power_decoder2.py b/src/soc/decoder/power_decoder2.py index 32cd7332..1633d191 100644 --- a/src/soc/decoder/power_decoder2.py +++ b/src/soc/decoder/power_decoder2.py @@ -725,7 +725,25 @@ class PowerDecodeSubset(Elaboratable): # set up instruction, pick fn unit # no op: defaults to OP_ILLEGAL comb += self.do_copy("insn_type", self.op_get("internal_op")) - comb += self.do_copy("fn_unit", self.op_get("function_unit")) + + #function unit for decoded instruction + fn = self.op_get("function_unit") + spr = Signal(10, reset_less=True) + comb += spr.eq(decode_spr_num(self.dec.SPR)) # from XFX + + # for first test only forward SPR 18 to mmu + with m.If(self.dec.op.internal_op == MicrOp.OP_MTSPR): + with m.If((spr == 18) | (spr == 19)): + comb += self.do_copy("fn_unit",Function.MMU) + with m.Else(): + comb += self.do_copy("fn_unit",fn) + with m.If(self.dec.op.internal_op == MicrOp.OP_MFSPR): + with m.If((spr == 18) | (spr == 19)): + comb += self.do_copy("fn_unit",Function.MMU) + with m.Else(): + comb += self.do_copy("fn_unit",fn) + with m.Else(): + comb += self.do_copy("fn_unit",fn) # immediates if self.needs_field("zero_a", "in1_sel"): -- 2.30.2