From: Luke Kenneth Casson Leighton Date: Sat, 29 Aug 2020 19:42:35 +0000 (+0100) Subject: slowly morphing towards using an XER bit-field selector in decoder X-Git-Tag: semi_working_ecp5~235 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2ca0ef2e8a2daa1c99e1a1ec52139a9d6176be4d;p=soc.git slowly morphing towards using an XER bit-field selector in decoder --- diff --git a/src/soc/decoder/decode2execute1.py b/src/soc/decoder/decode2execute1.py index 00a225ed..98ed32f6 100644 --- a/src/soc/decoder/decode2execute1.py +++ b/src/soc/decoder/decode2execute1.py @@ -79,7 +79,7 @@ class Decode2ToExecute1Type(RecordObject): self.read_spr1 = Data(SPR, name="spr1") #self.read_spr2 = Data(SPR, name="spr2") # only one needed - self.xer_in = Signal(reset_less=True) # xer might be read + self.xer_in = Signal(3, reset_less=True) # xer might be read self.xer_out = Signal(reset_less=True) # xer might be written self.read_fast1 = Data(3, name="fast1") diff --git a/src/soc/decoder/power_decoder2.py b/src/soc/decoder/power_decoder2.py index f838a742..b0142c15 100644 --- a/src/soc/decoder/power_decoder2.py +++ b/src/soc/decoder/power_decoder2.py @@ -8,6 +8,7 @@ over-riding the internal opcode when an exception is needed. from nmigen import Module, Elaboratable, Signal, Mux, Const, Cat, Repl, Record from nmigen.cli import rtlil +from soc.regfile.regfiles import XERRegs from nmutil.picker import PriorityPicker from nmutil.iocontrol import RecordObject @@ -457,6 +458,7 @@ class DecodeOE(Elaboratable): with m.Case(MicrOp.OP_MUL_H64, MicrOp.OP_MUL_H32, MicrOp.OP_EXTS, MicrOp.OP_CNTZ, MicrOp.OP_SHL, MicrOp.OP_SHR, MicrOp.OP_RLC, + MicrOp.OP_LOAD, MicrOp.OP_STORE, MicrOp.OP_RLCL, MicrOp.OP_RLCR, MicrOp.OP_EXTSWSLI): pass @@ -727,7 +729,9 @@ class PowerDecode2(Elaboratable): # decoder is designed to not need. MTSPR, MFSPR and others need # access to the XER bits. however setting e.oe is not appropriate with m.If(op.internal_op == MicrOp.OP_MFSPR): - comb += e.xer_in.eq(1) + comb += e.xer_in.eq(0b111) # SO, CA, OV + with m.If(op.internal_op == MicrOp.OP_CMP): + comb += e.xer_in.eq(1<