From: Tobias Platen Date: Sun, 28 Feb 2021 11:14:31 +0000 (+0100) Subject: fix Bug 603 - use SPR names/numbers from sprs.csv X-Git-Tag: convert-csv-opcode-to-binary~147 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2730d379d0fd4ba7005f649ff2b5511cebb04294;p=soc.git fix Bug 603 - use SPR names/numbers from sprs.csv --- diff --git a/src/soc/decoder/power_decoder2.py b/src/soc/decoder/power_decoder2.py index 06622843..7550afbd 100644 --- a/src/soc/decoder/power_decoder2.py +++ b/src/soc/decoder/power_decoder2.py @@ -934,18 +934,12 @@ class PowerDecodeSubset(Elaboratable): spr = Signal(10, reset_less=True) comb += spr.eq(decode_spr_num(self.dec.SPR)) # from XFX - # XXX BUG - don't use hardcoded magic constants. - # also use ".value" otherwise the test fails. bit of a pain - # https://bugs.libre-soc.org/show_bug.cgi?id=603 - - SPR_PID = 48 # TODO read docs for POWER9 # Microwatt doesn't implement the partition table - # instead has PRTBL register (SPR) to point to process table - SPR_PRTBL = 720 # see common.vhdl in microwatt, not in POWER9 + # instead has PRTBL(SVSRR0) register (SPR) to point to process table with m.If(((self.dec.op.internal_op == MicrOp.OP_MTSPR) | (self.dec.op.internal_op == MicrOp.OP_MFSPR)) & - ((spr == SPR.DSISR) | (spr == SPR.DAR) - | (spr==SPR_PRTBL) | (spr==SPR_PID))): + ((spr == SPR.DSISR.value) | (spr == SPR.DAR.value) | + (spr==SPR.SVSRR0.value) | (spr==SPR.PIDR.value))): comb += self.do_copy("fn_unit", Function.MMU) with m.Else(): comb += self.do_copy("fn_unit",fn)