mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Signal renames for ras.
This commit is contained in:
parent
8e3e8591a6
commit
53c8042276
@ -33,13 +33,16 @@ module RASPredictor
|
|||||||
)
|
)
|
||||||
(input logic clk,
|
(input logic clk,
|
||||||
input logic reset,
|
input logic reset,
|
||||||
input logic pop,
|
input logic PopF,
|
||||||
output logic [`XLEN-1:0] popPC,
|
output logic [`XLEN-1:0] RASPCF,
|
||||||
input logic push,
|
input logic PushE,
|
||||||
input logic incr,
|
input logic incr,
|
||||||
input logic [`XLEN-1:0] pushPC
|
input logic [`XLEN-1:0] PCLinkE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// *** need to update so it either doesn't push until the memory stage
|
||||||
|
// or need to repair flushed push.
|
||||||
|
// *** need to repair popped and then flushed returns.
|
||||||
logic CounterEn;
|
logic CounterEn;
|
||||||
localparam Depth = $clog2(StackSize);
|
localparam Depth = $clog2(StackSize);
|
||||||
|
|
||||||
@ -47,13 +50,13 @@ module RASPredictor
|
|||||||
logic [StackSize-1:0] [`XLEN-1:0] memory;
|
logic [StackSize-1:0] [`XLEN-1:0] memory;
|
||||||
integer index;
|
integer index;
|
||||||
|
|
||||||
assign CounterEn = pop | push | incr;
|
assign CounterEn = PopF | PushE | incr;
|
||||||
|
|
||||||
assign PtrD = pop ? PtrM1 : PtrP1;
|
assign PtrD = PopF ? PtrM1 : PtrP1;
|
||||||
|
|
||||||
assign PtrM1 = PtrQ - 1'b1;
|
assign PtrM1 = PtrQ - 1'b1;
|
||||||
assign PtrP1 = PtrQ + 1'b1;
|
assign PtrP1 = PtrQ + 1'b1;
|
||||||
// may have to handle a push and an incr at the same time.
|
// may have to handle a PushE and an incr at the same time.
|
||||||
// *** what happens if jal is executing and there is a return being flushed in Decode?
|
// *** what happens if jal is executing and there is a return being flushed in Decode?
|
||||||
|
|
||||||
flopenr #(Depth) PTR(.clk(clk),
|
flopenr #(Depth) PTR(.clk(clk),
|
||||||
@ -67,12 +70,12 @@ module RASPredictor
|
|||||||
if(reset) begin
|
if(reset) begin
|
||||||
for(index=0; index<StackSize; index++)
|
for(index=0; index<StackSize; index++)
|
||||||
memory[index] <= {`XLEN{1'b0}};
|
memory[index] <= {`XLEN{1'b0}};
|
||||||
end else if(push) begin
|
end else if(PushE) begin
|
||||||
memory[PtrP1] <= #1 pushPC;
|
memory[PtrP1] <= #1 PCLinkE;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
assign popPC = memory[PtrQ];
|
assign RASPCF = memory[PtrQ];
|
||||||
|
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
@ -156,11 +156,11 @@ module bpred (
|
|||||||
// *** needs to include flushX
|
// *** needs to include flushX
|
||||||
RASPredictor RASPredictor(.clk(clk),
|
RASPredictor RASPredictor(.clk(clk),
|
||||||
.reset(reset),
|
.reset(reset),
|
||||||
.pop(PredInstrClassF[2] & ~StallF),
|
.PopF(PredInstrClassF[2] & ~StallF),
|
||||||
.popPC(RASPCF),
|
.RASPCF,
|
||||||
.push(InstrClassE[3] & ~StallE),
|
.PushE(InstrClassE[3] & ~StallE),
|
||||||
.incr(1'b0),
|
.incr(1'b0),
|
||||||
.pushPC(PCLinkE));
|
.PCLinkE);
|
||||||
|
|
||||||
assign BPPredPCF = PredInstrClassF[2] ? RASPCF : BTBPredPCF;
|
assign BPPredPCF = PredInstrClassF[2] ? RASPCF : BTBPredPCF;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user