use correct X-Form L field in OP_MTMSRD
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 22 Dec 2021 03:53:13 +0000 (03:53 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 22 Dec 2021 03:53:13 +0000 (03:53 +0000)
src/soc/fu/trap/main_stage.py

index 4ed4e6ad6bc60232cc784b2be93195312860f5a9..116be81a79f38eb82b66eab540f0eb803f6f650e 100644 (file)
@@ -233,7 +233,8 @@ class TrapMainStage(PipeModBase):
             # MTMSR/D.  v3.0B p TODO - move to MSR
 
             with m.Case(MicrOp.OP_MTMSRD, MicrOp.OP_MTMSR):
-                L = self.fields.FormX.L[0:-1] # X-Form field L
+                # L => bit 16 in LSB0, bit 15 in MSB0 order
+                L = self.fields.FormX.L1[0:1] # X-Form field L1
                 # start with copy of msr
                 comb += msr_o.eq(msr_i)
                 with m.If(L):