mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-07 04:05:19 +00:00
Update icache interface
This commit is contained in:
parent
507d8ed120
commit
99fa8beef3
@ -26,18 +26,19 @@
|
|||||||
`include "wally-config.vh"
|
`include "wally-config.vh"
|
||||||
|
|
||||||
module icache(
|
module icache(
|
||||||
input logic clk, reset,
|
input logic clk, reset,
|
||||||
input logic StallF, StallD,
|
input logic StallF, StallD,
|
||||||
input logic FlushD,
|
input logic FlushD,
|
||||||
// Fetch
|
// Fetch
|
||||||
input logic [`XLEN-1:0] PCPF,
|
input logic [`XLEN-1:12] UpperPCPF,
|
||||||
input logic [`XLEN-1:0] InstrInF,
|
input logic [11:0] LowerPCF,
|
||||||
output logic [`XLEN-1:0] InstrPAdrF,
|
input logic [`XLEN-1:0] InstrInF,
|
||||||
output logic InstrReadF,
|
output logic [`XLEN-1:0] InstrPAdrF,
|
||||||
output logic CompressedF,
|
output logic InstrReadF,
|
||||||
output logic ICacheStallF,
|
output logic CompressedF,
|
||||||
|
output logic ICacheStallF,
|
||||||
// Decode
|
// Decode
|
||||||
output logic [31:0] InstrRawD
|
output logic [31:0] InstrRawD
|
||||||
);
|
);
|
||||||
|
|
||||||
logic DelayF, DelaySideF, FlushDLastCycle, DelayD, DelaySideD;
|
logic DelayF, DelaySideF, FlushDLastCycle, DelayD, DelaySideD;
|
||||||
@ -48,6 +49,10 @@ module icache(
|
|||||||
logic LastReadDataValidF;
|
logic LastReadDataValidF;
|
||||||
logic [`XLEN-1:0] LastReadDataF, LastReadAdrF, InDataF;
|
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
|
// 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.
|
// when FlushD happens, even if the pipeline is also stalled.
|
||||||
flopr #(1) flushDLastCycleFlop(clk, reset, FlushD | (FlushDLastCycle & StallF), FlushDLastCycle);
|
flopr #(1) flushDLastCycleFlop(clk, reset, FlushD | (FlushDLastCycle & StallF), FlushDLastCycle);
|
||||||
|
@ -93,7 +93,12 @@ module ifu (
|
|||||||
|
|
||||||
// jarred 2021-03-14 Add instrution cache block to remove rd2
|
// jarred 2021-03-14 Add instrution cache block to remove rd2
|
||||||
assign PCPF = PCF; // Temporary workaround until iTLB is live
|
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
|
// Prioritize the iTLB for reads if it wants one
|
||||||
mux2 #(`XLEN) instrPAdrMux(ICacheInstrPAdrF, ITLBInstrPAdrF, ITLBMissF, InstrPAdrF);
|
mux2 #(`XLEN) instrPAdrMux(ICacheInstrPAdrF, ITLBInstrPAdrF, ITLBMissF, InstrPAdrF);
|
||||||
|
|
||||||
|
@ -483,7 +483,7 @@ string tests32i[] = {
|
|||||||
|
|
||||||
// initialize the branch predictor
|
// initialize the branch predictor
|
||||||
initial begin
|
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);
|
$readmemb(`BTB_PRELOAD, dut.hart.ifu.bpred.TargetPredictor.memory.memory);
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user