From d07c6386b2b15cd02e26329ea4d37bfbf004c51f Mon Sep 17 00:00:00 2001 From: David Harris Date: Sun, 19 Feb 2023 20:13:50 -0800 Subject: [PATCH] Added BTB_SIZE parameter independent of BPRED_SIIZE --- config/buildroot/wally-config.vh | 1 + config/fpga/wally-config.vh | 1 + config/rv32e/wally-config.vh | 1 + config/rv32gc/wally-config.vh | 1 + config/rv32i/wally-config.vh | 1 + config/rv32imc/wally-config.vh | 1 + config/rv64fpquad/wally-config.vh | 1 + config/rv64gc/wally-config.vh | 1 + config/rv64i/wally-config.vh | 1 + src/ifu/bpred/bpred.sv | 2 +- 10 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config/buildroot/wally-config.vh b/config/buildroot/wally-config.vh index f10e11f99..656bfbe4c 100644 --- a/config/buildroot/wally-config.vh +++ b/config/buildroot/wally-config.vh @@ -132,6 +132,7 @@ `define BPRED_SUPPORTED 1 `define BPRED_TYPE "BPGSHARE" // BPLOCALPAg or BPGLOBAL or BPTWOBIT or BPGSHARE `define BPRED_SIZE 10 +`define BTB_SIZE (`BPRED_SIZE) `define HPTW_WRITES_SUPPORTED 1 diff --git a/config/fpga/wally-config.vh b/config/fpga/wally-config.vh index d0299c4e3..a4c97a86e 100644 --- a/config/fpga/wally-config.vh +++ b/config/fpga/wally-config.vh @@ -141,6 +141,7 @@ `define BPRED_SUPPORTED 1 `define BPRED_TYPE "BPSPECULATIVEGSHARE" // BPLOCALPAg or BPGLOBAL or BPTWOBIT or BPGSHARE or BPSPECULATIVEGLOBAL or BPSPECULATIVEGSHARE or BPOLDGSHARE or BPOLDGSHARE2 `define BPRED_SIZE 10 +`define BTB_SIZE (`BPRED_SIZE) `define HPTW_WRITES_SUPPORTED 1 diff --git a/config/rv32e/wally-config.vh b/config/rv32e/wally-config.vh index 8cd9ca3f4..8a0dd5f4b 100644 --- a/config/rv32e/wally-config.vh +++ b/config/rv32e/wally-config.vh @@ -136,6 +136,7 @@ `define BPRED_SUPPORTED 0 `define BPRED_TYPE "BPGSHARE" // BPLOCALPAg or BPGLOBAL or BPTWOBIT or BPGSHARE `define BPRED_SIZE 10 +`define BTB_SIZE (`BPRED_SIZE) `define HPTW_WRITES_SUPPORTED 0 diff --git a/config/rv32gc/wally-config.vh b/config/rv32gc/wally-config.vh index e45c2b093..07b4668ec 100644 --- a/config/rv32gc/wally-config.vh +++ b/config/rv32gc/wally-config.vh @@ -135,6 +135,7 @@ `define BPRED_SUPPORTED 1 `define BPRED_TYPE "BPSPECULATIVEGSHARE" // BPLOCALPAg or BPGLOBAL or BPTWOBIT or BPGSHARE `define BPRED_SIZE 10 +`define BTB_SIZE (`BPRED_SIZE) `define HPTW_WRITES_SUPPORTED 0 diff --git a/config/rv32i/wally-config.vh b/config/rv32i/wally-config.vh index d400cebe9..4ef0b60e7 100644 --- a/config/rv32i/wally-config.vh +++ b/config/rv32i/wally-config.vh @@ -136,6 +136,7 @@ `define BPRED_SUPPORTED 0 `define BPRED_TYPE "BPGSHARE" // BPLOCALPAg or BPGLOBAL or BPTWOBIT or BPGSHARE `define BPRED_SIZE 10 +`define BTB_SIZE (`BPRED_SIZE) `define HPTW_WRITES_SUPPORTED 0 diff --git a/config/rv32imc/wally-config.vh b/config/rv32imc/wally-config.vh index 52dfef069..19da7c42f 100644 --- a/config/rv32imc/wally-config.vh +++ b/config/rv32imc/wally-config.vh @@ -135,6 +135,7 @@ `define BPRED_SUPPORTED 0 `define BPRED_TYPE "BPSPECULATIVEGSHARE" // BPLOCALPAg or BPGLOBAL or BPTWOBIT or BPGSHARE `define BPRED_SIZE 10 +`define BTB_SIZE (`BPRED_SIZE) `define HPTW_WRITES_SUPPORTED 0 diff --git a/config/rv64fpquad/wally-config.vh b/config/rv64fpquad/wally-config.vh index 23a9aa05e..7f0c2a048 100644 --- a/config/rv64fpquad/wally-config.vh +++ b/config/rv64fpquad/wally-config.vh @@ -138,6 +138,7 @@ `define BPRED_SUPPORTED 1 `define BPRED_TYPE "BPGSHARE" // BPLOCALPAg or BPGLOBAL or BPTWOBIT or BPGSHARE `define BPRED_SIZE 10 +`define BTB_SIZE (`BPRED_SIZE) `define HPTW_WRITES_SUPPORTED 0 diff --git a/config/rv64gc/wally-config.vh b/config/rv64gc/wally-config.vh index 0b8a932d6..d163dc34b 100644 --- a/config/rv64gc/wally-config.vh +++ b/config/rv64gc/wally-config.vh @@ -138,6 +138,7 @@ `define BPRED_SUPPORTED 1 `define BPRED_TYPE "BPSPECULATIVEGSHARE" // BPLOCALPAg or BPGLOBAL or BPTWOBIT or BPGSHARE or BPSPECULATIVEGLOBAL or BPSPECULATIVEGSHARE or BPOLDGSHARE or BPOLDGSHARE2 `define BPRED_SIZE 10 +`define BTB_SIZE (`BPRED_SIZE) `define HPTW_WRITES_SUPPORTED 0 diff --git a/config/rv64i/wally-config.vh b/config/rv64i/wally-config.vh index 627cac8f7..24a171a75 100644 --- a/config/rv64i/wally-config.vh +++ b/config/rv64i/wally-config.vh @@ -138,6 +138,7 @@ `define BPRED_SUPPORTED 0 `define BPRED_TYPE "BPGSHARE" // BPLOCALPAg or BPGLOBAL or BPTWOBIT or BPGSHARE `define BPRED_SIZE 10 +`define BTB_SIZE (`BPRED_SIZE) `define HPTW_WRITES_SUPPORTED 0 diff --git a/src/ifu/bpred/bpred.sv b/src/ifu/bpred/bpred.sv index aacf3b69f..1903ed984 100644 --- a/src/ifu/bpred/bpred.sv +++ b/src/ifu/bpred/bpred.sv @@ -137,7 +137,7 @@ module bpred ( // Part 2 Branch target address prediction // BTB contains target address for all CFI - btb #(`BPRED_SIZE) + btb #(`BTB_SIZE) TargetPredictor(.clk, .reset, .StallF, .StallD, .StallM, .FlushD, .FlushM, .PCNextF, .PCF, .PCD, .PCE, .PredPCF,