From 95c653e7df0f72493442bcb832b15db289a63419 Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Fri, 15 Sep 2023 14:05:26 -0500 Subject: [PATCH] Fixes the bpred-sim.py to support command line parameterization of the branch predictor while using the new parameterization. This is definitely a hack, but I don't see a better way. --- config/rv32gc/config.vh | 8 +- sim/bpred-sim.py | 48 +-- sim/wave.do | 712 ++++++++++++++++++++-------------------- 3 files changed, 391 insertions(+), 377 deletions(-) diff --git a/config/rv32gc/config.vh b/config/rv32gc/config.vh index 07f005f43..46d3ed22a 100644 --- a/config/rv32gc/config.vh +++ b/config/rv32gc/config.vh @@ -141,8 +141,14 @@ localparam PLIC_UART_ID = 32'd10; localparam PLIC_SDC_ID = 32'd9; localparam BPRED_SUPPORTED = 1; +// this is an annoying hack for the branch predictor parameterization override. +`ifdef BPRED_OVERRIDE +localparam BPRED_TYPE = `BPRED_TYPE; +localparam BPRED_SIZE = `BPRED_SIZE; +`else localparam BPRED_TYPE = `BP_GSHARE; // BP_GSHARE_BASIC, BP_GLOBAL, BP_GLOBAL_BASIC, BP_TWOBIT -localparam BPRED_SIZE = 32'd16; +localparam BPRED_SIZE = 32'd10; +`endif localparam BPRED_NUM_LHR = 32'd6; localparam BTB_SIZE = 32'd10; diff --git a/sim/bpred-sim.py b/sim/bpred-sim.py index 4f1757cb8..4ec9324a3 100755 --- a/sim/bpred-sim.py +++ b/sim/bpred-sim.py @@ -46,33 +46,33 @@ configs = [ ) ] -# bpdSize = [6, 8, 10, 12, 14, 16] -# bpdType = ['twobit', 'gshare', 'global', 'gshare_basic', 'global_basic', 'local_basic'] -# for CurrBPType in bpdType: -# for CurrBPSize in bpdSize: -# name = CurrBPType+str(CurrBPSize) -# configOptions = "+define+INSTR_CLASS_PRED=0 +define+BPRED_TYPE=\"BP_" + CurrBPType.upper() + "\" +define+BPRED_SIZE=" + str(CurrBPSize) -# tc = TestCase( -# name=name, -# variant="rv32gc", -# cmd="vsim > {} -c < {} -c < {} -c < {} -c <