Update icache interface

This commit is contained in:
Jarred Allen 2021-03-22 15:04:46 -04:00
parent 507d8ed120
commit 99fa8beef3
3 changed files with 22 additions and 12 deletions

View File

@ -26,18 +26,19 @@
`include "wally-config.vh"
module icache(
input logic clk, reset,
input logic StallF, StallD,
input logic FlushD,
input logic clk, reset,
input logic StallF, StallD,
input logic FlushD,
// Fetch
input logic [`XLEN-1:0] PCPF,
input logic [`XLEN-1:0] InstrInF,
output logic [`XLEN-1:0] InstrPAdrF,
output logic InstrReadF,
output logic CompressedF,
output logic ICacheStallF,
input logic [`XLEN-1:12] UpperPCPF,
input logic [11:0] LowerPCF,
input logic [`XLEN-1:0] InstrInF,
output logic [`XLEN-1:0] InstrPAdrF,
output logic InstrReadF,
output logic CompressedF,
output logic ICacheStallF,
// Decode
output logic [31:0] InstrRawD
output logic [31:0] InstrRawD
);
logic DelayF, DelaySideF, FlushDLastCycle, DelayD, DelaySideD;
@ -48,6 +49,10 @@ module icache(
logic LastReadDataValidF;
logic [`XLEN-1:0] LastReadDataF, LastReadAdrF, InDataF;
// Temporary change to bridge the new interface to old behaviors
logic [`XLEN-1:0] PCPF;
assign PCPF = {UpperPCPF, LowerPCF};
// This flop doesn't stall if StallF is high because we should output a nop
// when FlushD happens, even if the pipeline is also stalled.
flopr #(1) flushDLastCycleFlop(clk, reset, FlushD | (FlushDLastCycle & StallF), FlushDLastCycle);

View File

@ -93,7 +93,12 @@ module ifu (
// jarred 2021-03-14 Add instrution cache block to remove rd2
assign PCPF = PCF; // Temporary workaround until iTLB is live
icache ic(clk, reset, StallF, StallD, FlushD, PCPF, InstrInF, ICacheInstrPAdrF, InstrReadF, CompressedF, ICacheStallF, InstrRawD);
icache ic(
.*,
.InstrPAdrF(ICacheInstrPAdrF),
.UpperPCPF(PCPF[`XLEN-1:12]),
.LowerPCF(PCF[11:0])
);
// Prioritize the iTLB for reads if it wants one
mux2 #(`XLEN) instrPAdrMux(ICacheInstrPAdrF, ITLBInstrPAdrF, ITLBMissF, InstrPAdrF);

View File

@ -483,7 +483,7 @@ string tests32i[] = {
// initialize the branch predictor
initial begin
$readmemb(`TWO_BIT_PRELOAD, dut.hart.ifu.bpred.DirPredictor.memory.memory);
$readmemb(`TWO_BIT_PRELOAD, dut.hart.ifu.bpred.Predictor.DirPredictor.PHT.memory);
$readmemb(`BTB_PRELOAD, dut.hart.ifu.bpred.TargetPredictor.memory.memory);
end