From fe723af1af8a5a86976992337f870cd8ce998a8a Mon Sep 17 00:00:00 2001 From: Ross Thompson Date: Wed, 21 Dec 2022 08:35:43 -0600 Subject: [PATCH] Comments about PC+2/4. --- pipelined/src/ifu/ifu.sv | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pipelined/src/ifu/ifu.sv b/pipelined/src/ifu/ifu.sv index e1747311f..f48c0c88f 100644 --- a/pipelined/src/ifu/ifu.sv +++ b/pipelined/src/ifu/ifu.sv @@ -301,10 +301,16 @@ module ifu ( // *** consider gating PCPlusUpperF to provide the reset. /* -----\/----- EXCLUDED -----\/----- assign PCPlus2or4F[0] = '0; - assign PCPlus2or4F[1] = CompressedF ^ PCF[1]; - assign PCPlus2or4F[`XLEN-1:2] = CompressedF & ~PCF[1] ? PCF[`XLEN-1:2] : PCPlusUpperF; + assign PCPlus2or4F[1] = ~reset & (CompressedF ^ PCF[1]); + assign PCPlus2or4F[`XLEN-1:2] = reset ? '0 : CompressedF & ~PCF[1] ? PCF[`XLEN-1:2] : PCPlusUpperF; -----/\----- EXCLUDED -----/\----- */ - +/* -----\/----- EXCLUDED -----\/----- + assign PCPlus2or4F[1:0] = reset ? 2'b00 : CompressedF ? PCF[1] ? 2'b00 : 2'b10 : PCF[1:0]; + -----/\----- EXCLUDED -----/\----- */ + + // *** There is actually a bug in the regression test. We fetched an address which returns data with + // an X. This version of the code does not die because if CompressedF is an X it just defaults to the last + // option. The above code would work, but propagates the x. always_comb if(reset) PCPlus2or4F = '0; else if (CompressedF) // add 2