mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Cleanup.
This commit is contained in:
parent
d030d323fd
commit
5c52827f51
@ -51,7 +51,7 @@ module btb #(parameter Depth = 10 ) (
|
|||||||
|
|
||||||
logic [Depth-1:0] PCNextFIndex, PCFIndex, PCDIndex, PCEIndex, PCMIndex, PCWIndex;
|
logic [Depth-1:0] PCNextFIndex, PCFIndex, PCDIndex, PCEIndex, PCMIndex, PCWIndex;
|
||||||
logic [`XLEN-1:0] ResetPC;
|
logic [`XLEN-1:0] ResetPC;
|
||||||
logic MatchF, MatchD, MatchE, MatchM, MatchW, MatchNextX, MatchX;
|
logic MatchF, MatchD, MatchE, MatchM, MatchW, MatchX;
|
||||||
logic [`XLEN+3:0] ForwardBTBPrediction, ForwardBTBPredictionF;
|
logic [`XLEN+3:0] ForwardBTBPrediction, ForwardBTBPredictionF;
|
||||||
logic [`XLEN+3:0] TableBTBPredictionF;
|
logic [`XLEN+3:0] TableBTBPredictionF;
|
||||||
logic UpdateEn;
|
logic UpdateEn;
|
||||||
@ -80,20 +80,13 @@ module btb #(parameter Depth = 10 ) (
|
|||||||
assign MatchW = PCFIndex == PCWIndex;
|
assign MatchW = PCFIndex == PCWIndex;
|
||||||
assign MatchX = MatchD | MatchE | MatchM | MatchW;
|
assign MatchX = MatchD | MatchE | MatchM | MatchW;
|
||||||
|
|
||||||
// flopenr #(1) MatchReg(clk, reset, ~StallF, MatchNextX, MatchXF);
|
|
||||||
|
|
||||||
assign ForwardBTBPredictionF = MatchD ? {InstrClassD, BTAD} :
|
assign ForwardBTBPredictionF = MatchD ? {InstrClassD, BTAD} :
|
||||||
MatchE ? {InstrClassE, IEUAdrE} :
|
MatchE ? {InstrClassE, IEUAdrE} :
|
||||||
MatchM ? {InstrClassM, IEUAdrM} :
|
MatchM ? {InstrClassM, IEUAdrM} :
|
||||||
{InstrClassW, IEUAdrW} ;
|
{InstrClassW, IEUAdrW} ;
|
||||||
|
|
||||||
/* -----\/----- EXCLUDED -----\/-----
|
|
||||||
flopenr #(`XLEN+4) ForwardBTBPredicitonReg(clk, reset, ~StallF, ForwardBTBPrediction, ForwardBTBPredictionF);
|
|
||||||
-----/\----- EXCLUDED -----/\----- */
|
|
||||||
|
|
||||||
assign {BTBPredInstrClassF, BTAF} = MatchX ? ForwardBTBPredictionF : {TableBTBPredictionF};
|
assign {BTBPredInstrClassF, BTAF} = MatchX ? ForwardBTBPredictionF : {TableBTBPredictionF};
|
||||||
|
|
||||||
|
|
||||||
assign UpdateEn = |InstrClassM | PredictionInstrClassWrongM;
|
assign UpdateEn = |InstrClassM | PredictionInstrClassWrongM;
|
||||||
|
|
||||||
// An optimization may be using a PC relative address.
|
// An optimization may be using a PC relative address.
|
||||||
|
@ -43,9 +43,9 @@ module gshare #(parameter k = 10,
|
|||||||
);
|
);
|
||||||
|
|
||||||
logic MatchF, MatchD, MatchE, MatchM, MatchW;
|
logic MatchF, MatchD, MatchE, MatchM, MatchW;
|
||||||
logic MatchX, MatchXF;
|
logic MatchX;
|
||||||
|
|
||||||
logic [1:0] TableDirPredictionF, DirPredictionD, DirPredictionE, ForwardNewDirPredictionF, ForwardDirPredictionF;
|
logic [1:0] TableDirPredictionF, DirPredictionD, DirPredictionE, ForwardNewDirPredictionF;
|
||||||
logic [1:0] NewDirPredictionE, NewDirPredictionM, NewDirPredictionW;
|
logic [1:0] NewDirPredictionE, NewDirPredictionM, NewDirPredictionW;
|
||||||
|
|
||||||
logic [k-1:0] IndexNextF, IndexF, IndexD, IndexE, IndexM, IndexW;
|
logic [k-1:0] IndexNextF, IndexF, IndexD, IndexE, IndexM, IndexW;
|
||||||
@ -70,22 +70,17 @@ module gshare #(parameter k = 10,
|
|||||||
|
|
||||||
flopenrc #(k) IndexWReg(clk, reset, FlushW, ~StallW, IndexM, IndexW);
|
flopenrc #(k) IndexWReg(clk, reset, FlushW, ~StallW, IndexM, IndexW);
|
||||||
|
|
||||||
//assign MatchF = BPBranchF & ~FlushD & (IndexNextF == IndexF);
|
|
||||||
assign MatchD = BranchD & ~FlushE & (IndexF == IndexD);
|
assign MatchD = BranchD & ~FlushE & (IndexF == IndexD);
|
||||||
assign MatchE = BranchE & ~FlushM & (IndexF == IndexE);
|
assign MatchE = BranchE & ~FlushM & (IndexF == IndexE);
|
||||||
assign MatchM = BranchM & ~FlushW & (IndexF == IndexM);
|
assign MatchM = BranchM & ~FlushW & (IndexF == IndexM);
|
||||||
assign MatchW = BranchW & ~FlushW & (IndexF == IndexW);
|
assign MatchW = BranchW & ~FlushW & (IndexF == IndexW);
|
||||||
assign MatchX = MatchD | MatchE | MatchM | MatchW;
|
assign MatchX = MatchD | MatchE | MatchM | MatchW;
|
||||||
|
|
||||||
// flopenr #(1) MatchReg(clk, reset, ~StallF, MatchNextX, MatchXF);
|
|
||||||
|
|
||||||
assign ForwardNewDirPredictionF = MatchD ? {2{DirPredictionD[1]}} :
|
assign ForwardNewDirPredictionF = MatchD ? {2{DirPredictionD[1]}} :
|
||||||
MatchE ? {NewDirPredictionE} :
|
MatchE ? {NewDirPredictionE} :
|
||||||
MatchM ? {NewDirPredictionM} :
|
MatchM ? {NewDirPredictionM} :
|
||||||
NewDirPredictionW ;
|
NewDirPredictionW ;
|
||||||
|
|
||||||
//flopenr #(2) ForwardDirPredicitonReg(clk, reset, ~StallF, ForwardNewDirPrediction, ForwardDirPredictionF);
|
|
||||||
|
|
||||||
assign DirPredictionF = MatchX ? ForwardNewDirPredictionF : TableDirPredictionF;
|
assign DirPredictionF = MatchX ? ForwardNewDirPredictionF : TableDirPredictionF;
|
||||||
|
|
||||||
ram2p1r1wbe #(2**k, 2) PHT(.clk(clk),
|
ram2p1r1wbe #(2**k, 2) PHT(.clk(clk),
|
||||||
|
Loading…
Reference in New Issue
Block a user