was going to set 2nd decoder up through MUX but now too complicated
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 24 Jun 2021 18:01:27 +0000 (19:01 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 24 Jun 2021 18:01:27 +0000 (19:01 +0100)
going to do "decoder conditions" instead

src/openpower/decoder/power_decoder2.py

index 5c2b259abce79e6770f60553c9abebbb91c9f8fe..79bb7412f231cd2a0b7a7d8d5c8c1ddf894a202d 100644 (file)
@@ -832,6 +832,8 @@ class PowerDecodeSubset(Elaboratable):
         ports = self.dec.ports() + self.e.ports()
         if self.svp64_en:
             ports += self.sv_rm.ports()
+            ports.append(self.is_svp64_mode)
+            ports.append(self.use_svp64_ldst_dec )
         if self.svdecldst:
             ports += self.svdecldst.ports()
         return ports
@@ -880,20 +882,21 @@ class PowerDecodeSubset(Elaboratable):
                                            regreduce_en=self.regreduce_en)
 
         # set up submodule decoders
-        m.submodules.dec = self.dec
+        m.submodules.dec = dec = self.dec
         m.submodules.dec_rc = self.dec_rc = dec_rc = DecodeRC(self.dec)
         m.submodules.dec_oe = dec_oe = DecodeOE(self.dec, op)
 
-        # use op from first decoder (self.dec.op) if not in SVP64-LDST mode
-        # (TODO)
-        comb += self.op.eq(self.dec.op)
-
         if self.svp64_en:
             # and SVP64 RM mode decoder
             m.submodules.sv_rm_dec = rm_dec = self.rm_dec
         if self.svdecldst:
             # and SVP64 decoder
             m.submodules.svdecldst = svdecldst = self.svdecldst
+            comb += svdecldst.raw_opcode_in.eq(dec.raw_opcode_in)
+            comb += svdecldst.bigendian.eq(dec.bigendian)
+
+        # copy op from decoder
+        comb += self.op.eq(self.dec.op)
 
         # copy instruction through...
         for i in [do.insn, dec_rc.insn_in, dec_oe.insn_in, ]:
@@ -1502,7 +1505,7 @@ def get_rdflags(e, cu):
 
 if __name__ == '__main__':
     pdecode = create_pdecode()
-    dec2 = PowerDecode2(pdecode)
+    dec2 = PowerDecode2(pdecode, svp64_en=True)
     vl = rtlil.convert(dec2, ports=dec2.ports() + pdecode.ports())
     with open("dec2.il", "w") as f:
         f.write(vl)