From 5a4be623523ac21b6467aa26bee2773bc328e61e Mon Sep 17 00:00:00 2001 From: "rajshekar.k" Date: Fri, 5 Nov 2021 20:30:22 +0530 Subject: [PATCH] added instruction serial number in outoforder pipeline --- src/simulator/generic/Instruction.java | 1 + src/simulator/pipeline/outoforder/FetchLogic.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/simulator/generic/Instruction.java b/src/simulator/generic/Instruction.java index aa08f98..a93dfea 100755 --- a/src/simulator/generic/Instruction.java +++ b/src/simulator/generic/Instruction.java @@ -530,6 +530,7 @@ public class Instruction implements Serializable { return ( + String.format("%-20s", "s.no = " + serialNo) + String.format("%-20s", "IP = " + Long.toHexString(ciscProgramCounter)) + String.format("%-20s", "Op = " + type) + String.format("%-60s", "srcOp1 = " + sourceOperand1) + diff --git a/src/simulator/pipeline/outoforder/FetchLogic.java b/src/simulator/pipeline/outoforder/FetchLogic.java index a1d8eb6..24b754e 100755 --- a/src/simulator/pipeline/outoforder/FetchLogic.java +++ b/src/simulator/pipeline/outoforder/FetchLogic.java @@ -29,6 +29,8 @@ public class FetchLogic extends SimulationElement { int fetchWidth; OperationType[] instructionsToBeDropped; boolean sleep; + + long serialNo; public FetchLogic(Core core, OutOrderExecutionEngine execEngine) { @@ -44,6 +46,8 @@ public class FetchLogic extends SimulationElement { OperationType.interrupt, OperationType.sync }; + + serialNo = 0; } public void performFetch() @@ -182,6 +186,7 @@ public class FetchLogic extends SimulationElement { if(!iCacheBuffer.isFull() && execEngine.getCoreMemorySystem().getiCache().isBusy(newInstruction.getCISCProgramCounter())==false) { iCacheBuffer.addToBuffer(inputToPipeline[inputPipeToReadNext].pollFirst()); + newInstruction.setSerialNo(serialNo++); if(SimulationConfig.detachMemSysInsn == false && newInstruction.getOperationType() != OperationType.inValid) { // The first micro-operation of an instruction has a valid CISC IP. All the subsequent