wire fetch_failed from I-Cache to PowerDecoder2
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 9 Dec 2021 15:45:09 +0000 (15:45 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 9 Dec 2021 15:45:09 +0000 (15:45 +0000)
informs PowerDecoder2 that an instruction fetch failed in MMU mode

src/soc/simple/issuer.py

index 055c4c0065cfd478456c7fddba6994667b96cb0d..6aa790191c38a96d01d608a817d09417c50b6bdb 100644 (file)
@@ -693,6 +693,13 @@ class TestIssuerInternal(Elaboratable):
         # note if an exception happened.  in a pipelined or OoO design
         # this needs to be accompanied by "shadowing" (or stalling)
         exc_happened = self.core.o.exc_happened
+        # also note instruction fetch failed
+        if hasattr(core, "icache"):
+            fetch_failed = core.icache.i_out.fetch_failed
+        else:
+            fetch_failed = Const(0, 1)
+        # set to zero initially
+        sync += pdecode2.instr_fault.eq(0)
 
         with m.FSM(name="issue_fsm"):
 
@@ -848,6 +855,9 @@ class TestIssuerInternal(Elaboratable):
                 # allowing it to be set again during the next execution
                 sync += pdecode2.ldst_exc.eq(0)
 
+                # update (highest priority) instruction fault
+                sync += pdecode2.instr_fault.eq(fetch_failed)
+
                 m.next = "INSN_EXECUTE"  # move to "execute"
 
             # handshake with execution FSM, move to "wait" once acknowledged