From 65a31381da5e0800bb2ec3e8685d2bc58e4866e2 Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Sun, 29 Jan 2023 00:56:11 -0600 Subject: [PATCH] Updated testbench for branch logger. --- pipelined/testbench/testbench.sv | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pipelined/testbench/testbench.sv b/pipelined/testbench/testbench.sv index 1e373de5..1c2fbb1f 100644 --- a/pipelined/testbench/testbench.sv +++ b/pipelined/testbench/testbench.sv @@ -32,8 +32,8 @@ `include "wally-config.vh" `include "tests.vh" -`define PrintHPMCounters 0 -`define BPRED_LOGGER 0 +`define PrintHPMCounters 1 +`define BPRED_LOGGER 1 module testbench; parameter DEBUG=0; @@ -484,11 +484,13 @@ logic [3:0] dummy; if (`BPRED_LOGGER) begin string direction; int file; + logic PCScrM; + flopenrc #(1) PCSrcMReg(clk, reset, FlushM, dut.core.ifu.bpred.bpred.Predictor.DirPredictor.PCSrcE, PCSrcM); initial file = $fopen("branch.log", "w"); always @(posedge clk) begin if(dut.core.ifu.InstrClassM[0] & ~dut.core.StallW & ~dut.core.FlushW & dut.core.InstrValidM) begin - direction = dut.core.ifu.bpred.bpred.Predictor.DirPredictor.PCSrcM ? "t" : "n"; + direction = PCSrcM ? "t" : "n"; $fwrite(file, "%h %s\n", dut.core.PCM, direction); end end