On inorder.py, after Execute, update the PC and go back to Fetch
authorCesar Strauss <cestrauss@gmail.com>
Mon, 3 Jan 2022 13:02:34 +0000 (10:02 -0300)
committerCesar Strauss <cestrauss@gmail.com>
Mon, 3 Jan 2022 13:09:29 +0000 (10:09 -0300)
When removing SVP64 from inorder.py, this code block must have
been deleted by mistake.

"python test_issuer.py nosvp64 --inorder" now completes successfully,
without going into an infinite loop.

src/soc/simple/inorder.py

index 851d7f5f38ab19b05e31e66571cd73a1db878242..5262f6eb0a847791ab314b58b3f40df76cbc19c5 100644 (file)
@@ -331,10 +331,15 @@ class TestIssuerInternalInOrder(TestIssuerBase):
                                     self.sv_changed):
                             m.next = "ISSUE_START"
 
-                        # returning to Execute? then, first update SRCSTEP
                         with m.Else():
-                            # return to mask skip loop
-                            m.next = "DECODE_SV"
+                            # before going back to fetch, update the PC state
+                            # register with the NIA.
+                            # ok here we are not reading the branch unit.
+                            # TODO: this just blithely overwrites whatever
+                            #       pipeline updated the PC
+                            comb += self.state_w_pc.wen.eq(1 << StateRegs.PC)
+                            comb += self.state_w_pc.i_data.eq(nia)
+                            m.next = "ISSUE_START"
 
                 with m.Else():
                     comb += dbg.core_stopped_i.eq(1)