extend CR registers in Decode2ToExecute1Type to 7 bit
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 30 Jan 2021 13:17:45 +0000 (13:17 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sat, 30 Jan 2021 13:17:45 +0000 (13:17 +0000)
src/soc/decoder/decode2execute1.py
src/soc/decoder/power_decoder2.py

index 75b66d3635c724ce91e13198ab9c447fb5e42e46..a6ac6262367c445d55ad7df6f64c72d0efb575d9 100644 (file)
@@ -109,10 +109,10 @@ class Decode2ToExecute1Type(RecordObject):
         self.write_fast1 = Data(3, name="fasto1")
         self.write_fast2 = Data(3, name="fasto2")
 
-        self.read_cr1 = Data(3, name="cr_in1")
-        self.read_cr2 = Data(3, name="cr_in2")
-        self.read_cr3 = Data(3, name="cr_in2")
-        self.write_cr = Data(3, name="cr_out")
+        self.read_cr1 = Data(7, name="cr_in1")
+        self.read_cr2 = Data(7, name="cr_in2")
+        self.read_cr3 = Data(7, name="cr_in2")
+        self.write_cr = Data(7, name="cr_out")
 
         # decode operand data
         print ("decode2execute init", name, opkls, do)
index c3ef17f6b033c65bb825dcc31a685b921c7a468d..abad12910f70b5f30a88fd807e30257a9e3c86e8 100644 (file)
@@ -100,7 +100,7 @@ class SVP64ExtraSpec(Elaboratable):
         # back in the LDSTRM-* and RM-* files generated by sv_analysis.py
         # we marked every op with an Etype: EXTRA2 or EXTRA3, and also said
         # which of the 4 (or 3 for EXTRA3) sub-fields of bits 10:18 contain
-        # the register-extension information.  extract those how
+        # the register-extension information.  extract those now
         with m.Switch(self.etype):
             # 2-bit index selection mode
             with m.Case(SVEtype.EXTRA2):
@@ -729,6 +729,9 @@ class DecodeCRIn(Elaboratable):
 
         comb = m.d.comb
         op = self.dec.op
+        m.submodules.svdec = svdec = SVP64CRExtra()
+        m.submodules.svdec_b = svdec_b = SVP64CRExtra()
+        m.submodules.svdec_o = svdec_o = SVP64CRExtra()
 
         comb += self.cr_bitfield.ok.eq(0)
         comb += self.cr_bitfield_b.ok.eq(0)
@@ -1133,10 +1136,13 @@ class PowerDecode2(PowerDecodeSubset):
         comb += e.write_fast2.eq(dec_o2.fast_out)
 
         # condition registers (CR)
-        comb += e.read_cr1.eq(self.dec_cr_in.cr_bitfield)
-        comb += e.read_cr2.eq(self.dec_cr_in.cr_bitfield_b)
-        comb += e.read_cr3.eq(self.dec_cr_in.cr_bitfield_o)
-        comb += e.write_cr.eq(self.dec_cr_out.cr_bitfield)
+        for to_reg, fromreg in (
+            (e.read_cr1, self.dec_cr_in.cr_bitfield),
+            (e.read_cr2, self.dec_cr_in.cr_bitfield_b),
+            (e.read_cr3, self.dec_cr_in.cr_bitfield_o),
+            (e.write_cr, self.dec_cr_out.cr_bitfield)):
+            comb += to_reg.data.eq(fromreg.data)
+            comb += to_reg.ok.eq(fromreg.ok)
 
         # sigh this is exactly the sort of thing for which the
         # decoder is designed to not need.  MTSPR, MFSPR and others need