From cf1e1acdf0c79d13c478935e195c4c33c4c132a3 Mon Sep 17 00:00:00 2001 From: Andrey Miroshnikov Date: Tue, 22 Aug 2023 09:10:24 +0000 Subject: [PATCH] inorder.py: Reverse pipeline processing order. --- src/openpower/cyclemodel/inorder.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/openpower/cyclemodel/inorder.py b/src/openpower/cyclemodel/inorder.py index da5cbbe0..701f98d3 100644 --- a/src/openpower/cyclemodel/inorder.py +++ b/src/openpower/cyclemodel/inorder.py @@ -293,13 +293,15 @@ class CPU: possible.add(r.pop()) return possible + # Inverting the stage order ensures that instructions already in the + # pipeline get processed first. def process_instructions(self, insn_trace): #print("Start of CPU cycle, clk=%d" % self.curr_clk) stall = self.stall - stall = self.fetch.process_instructions(stall, insn_trace) - stall = self.decode.process_instructions(stall) - stall = self.issue.process_instructions(stall) stall = self.exe.process_instructions(stall) + stall = self.issue.process_instructions(stall) + stall = self.decode.process_instructions(stall) + stall = self.fetch.process_instructions(stall, insn_trace) self.stall = stall self.print_cur_state() if not stall: -- 2.30.2