Added new counting for branching instructions

This commit is contained in:
Franz Fuchs
2021-06-11 17:09:21 +01:00
parent dce934500d
commit a60bed404a

View File

@@ -294,15 +294,27 @@ module mkAluExePipeline#(AluExeInput inIfc)(AluExePipeline);
let orig_inst = inIfc.rob_getOrig_Inst (x.tag);
`ifdef PERFORMANCE_MONITORING
let res = inIfc.checkTarget(ppc);
if(!res) begin
let ppc_addr = getAddr(ppc);
let pc_addr = getAddr(pc);
if(x.dInst.iType == Br || x.dInst.iType == Jr || x.dInst.iType == CJALR) begin
let res = inIfc.checkTarget(ppc);
if((ppc != pc + 2) || (ppc != pc + 4)) begin
$display("Not a previous target: pc = ", fshow(pc), ", ppc = ", fshow(ppc));
let ppc_addr = getAddr(ppc);
let pc_addr = getAddr(pc);
let res = inIfc.checkTarget(ppc);
$display("doRegReadAlu: pc = ", fshow(pc), ", ppc = ", fshow(ppc));
EventsTransExe events = unpack(0);
events.evt_WILD_JUMP = 1;
events_reg <= events;
if((x.dInst.iType == CJALR || x.dInst.iType == Jr) && !res) begin
$display("Not a previous target: ppc = ", fshow(ppc));
events.evt_WILD_JUMP = 1;
events_reg <= events;
end
else if(x.dInst.iType == Br) begin
Bit#(12) imm = truncate(fromMaybe(12'h000, x.dInst.imm) << 1);
let val = getAddr(pc) + signExtend(imm);
if(val != ppc_addr) begin
events.evt_WILD_JUMP = 1;
events_reg <= events;
end
end
end
end
`endif