connect MSR.PR to PortInterface in LDSTCompUnit
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 11 May 2021 10:52:53 +0000 (11:52 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 11 May 2021 10:52:53 +0000 (11:52 +0100)
src/soc/experiment/compldst_multi.py

index b29947b560570a8d9c287c3d7426380313ed4198..7dfdb15ecb45a0f41449418db612c3f774cddccc 100644 (file)
@@ -95,11 +95,14 @@ from soc.fu.regspec import RegSpecAPI
 from openpower.decoder.power_enums import MicrOp, Function, LDSTMode
 from soc.fu.ldst.ldst_input_record import CompLDSTOpSubset
 from openpower.decoder.power_decoder2 import Data
+from openpower.consts import MSR
+
 
 # TODO: LDSTInputData and LDSTOutputData really should be used
 # here, to make things more like the other CompUnits.  currently,
 # also, RegSpecAPI is used explicitly here
 
+
 class LDSTCompUnitRecord(CompUnitRecord):
     def __init__(self, rwid, opsubset=CompLDSTOpSubset, name=None):
         CompUnitRecord.__init__(self, opsubset, rwid,
@@ -501,6 +504,8 @@ class LDSTCompUnit(RegSpecAPI, Elaboratable):
         sync += pi.addr.ok.eq(alu_ok & lsd_l.q)  # "do address stuff" (once)
         comb += self.exc_o.eq(pi.exc_o)  # exception occurred
         comb += addr_ok.eq(self.pi.addr_ok_o)  # no exc, address fine
+        # connect MSR.PR for priv/virt operation
+        comb += pi.msr_pr.eq(oper_r.msr[MSR.PR])
 
         # byte-reverse on LD
         revnorev = Signal(64, reset_less=True)