Oups. Turns out dc_shell does not like string parameters.

Switched gshare to use an integer parameter to select between gshare and global.
This commit is contained in:
Ross Thompson 2023-02-22 09:11:46 -06:00
parent a774cce05d
commit 5ecbc830cf
3 changed files with 8 additions and 8 deletions

View File

@ -106,7 +106,7 @@ module bpred (
.PCSrcE);
end else if (`BPRED_TYPE == "BP_GLOBAL") begin:Predictor
gshare #(`BPRED_SIZE, "global") DirPredictor(.clk, .reset, .StallF, .StallD, .StallE, .StallM, .StallW, .FlushD, .FlushE, .FlushM, .FlushW,
gshare #(`BPRED_SIZE, 0) DirPredictor(.clk, .reset, .StallF, .StallD, .StallE, .StallM, .StallW, .FlushD, .FlushE, .FlushM, .FlushW,
.PCNextF, .PCF, .PCD, .PCE, .PCM, .DirPredictionF, .DirPredictionWrongE,
.BranchInstrF(PredInstrClassF[0]), .BranchInstrD(InstrClassD[0]), .BranchInstrE(InstrClassE[0]), .BranchInstrM(InstrClassM[0]),
.PCSrcE);
@ -117,7 +117,7 @@ module bpred (
.BranchInstrE(InstrClassE[0]), .BranchInstrM(InstrClassM[0]), .PCSrcE);
end else if (`BPRED_TYPE == "BP_GLOBAL_BASIC") begin:Predictor
gsharebasic #(`BPRED_SIZE, "global") DirPredictor(.clk, .reset, .StallF, .StallD, .StallE, .StallM, .StallW, .FlushD, .FlushE, .FlushM, .FlushW,
gsharebasic #(`BPRED_SIZE, 0) DirPredictor(.clk, .reset, .StallF, .StallD, .StallE, .StallM, .StallW, .FlushD, .FlushE, .FlushM, .FlushW,
.PCNextF, .PCM, .DirPredictionF, .DirPredictionWrongE,
.BranchInstrE(InstrClassE[0]), .BranchInstrM(InstrClassM[0]), .PCSrcE);

View File

@ -30,7 +30,7 @@
`include "wally-config.vh"
module gshare #(parameter k = 10,
parameter string TYPE = "gshare") (
parameter integer TYPE = 1) (
input logic clk,
input logic reset,
input logic StallF, StallD, StallE, StallM, StallW,
@ -54,13 +54,13 @@ module gshare #(parameter k = 10,
logic [k-1:0] GHRNextM, GHRNextF;
logic PCSrcM;
if(TYPE == "gshare") begin
if(TYPE == 1) begin
assign IndexNextF = GHRNextF ^ {PCNextF[k+1] ^ PCNextF[1], PCNextF[k:2]};
assign IndexF = GHRF ^ {PCF[k+1] ^ PCF[1], PCF[k:2]};
assign IndexD = GHRD ^ {PCD[k+1] ^ PCD[1], PCD[k:2]};
assign IndexE = GHRE ^ {PCE[k+1] ^ PCE[1], PCE[k:2]};
assign IndexM = GHRM ^ {PCM[k+1] ^ PCM[1], PCM[k:2]};
end else if(TYPE == "global") begin
end else if(TYPE == 0) begin
assign IndexNextF = GHRNextF;
assign IndexF = GHRF;
assign IndexD = GHRD;

View File

@ -30,7 +30,7 @@
`include "wally-config.vh"
module gsharebasic #(parameter k = 10,
parameter string TYPE = "global") (
parameter TYPE = 1) (
input logic clk,
input logic reset,
input logic StallF, StallD, StallE, StallM, StallW,
@ -50,10 +50,10 @@ module gsharebasic #(parameter k = 10,
logic [k-1:0] GHRNext;
logic PCSrcM;
if(TYPE == "gshare") begin
if(TYPE == 1) begin
assign IndexNextF = GHR ^ {PCNextF[k+1] ^ PCNextF[1], PCNextF[k:2]};
assign IndexE = GHRM ^ {PCM[k+1] ^ PCM[1], PCM[k:2]};
end else if(TYPE == "global") begin
end else if(TYPE == 0) begin
assign IndexNextF = GHRNext;
assign IndexE = GHRE;
end