adding OP_MTMSR test
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 6 Jul 2020 13:11:47 +0000 (14:11 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 6 Jul 2020 13:12:16 +0000 (14:12 +0100)
src/soc/fu/trap/main_stage.py

index 8c68e7fc9051b49c92eea986a3a24b59fdfc16d9..0ddb2823f13243ba8a54aa501b2c641514092980 100644 (file)
@@ -164,11 +164,14 @@ class TrapMainStage(PipeModBase):
                         comb += srr1_o.data[PI.ILLEG].eq(1)
 
             # move to MSR
-            with m.Case(InternalOp.OP_MTMSRD):
+            with m.Case(InternalOp.OP_MTMSRD, InternalOp.OP_MTMSR):
                 L = self.fields.FormX.L[0:-1] # X-Form field L
+                # start with copy of msr
+                comb += msr_o.eq(msr_i)
                 with m.If(L):
                     # just update RI..EE
-                    comb += msr_o.data[MSR.RI:MSR.EE].eq(a_i[MSR.RI:MSR.EE])
+                    comb += msr_o.data[MSR.RI].eq(a_i[MSR.RI])
+                    comb += msr_o.data[MSR.EE].eq(a_i[MSR.EE])
                 with m.Else():
                     # Architecture says to leave out bits 3 (HV), 51 (ME)
                     # and 63 (LE) (IBM bit numbering)