mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Install tlb into ifu
This commit is contained in:
parent
2e409f2299
commit
1df7151fb6
@ -52,6 +52,12 @@ module ifu (
|
|||||||
output logic IllegalIEUInstrFaultD,
|
output logic IllegalIEUInstrFaultD,
|
||||||
output logic InstrMisalignedFaultM,
|
output logic InstrMisalignedFaultM,
|
||||||
output logic [`XLEN-1:0] InstrMisalignedAdrM,
|
output logic [`XLEN-1:0] InstrMisalignedAdrM,
|
||||||
|
// TLB Management
|
||||||
|
//input logic [`XLEN-1:0] PageTableEntryF,
|
||||||
|
//input logic ITLBWriteF, ITLBFlushF,
|
||||||
|
// *** satp value will come from CSRs
|
||||||
|
// input logic [`XLEN-1:0] SATP,
|
||||||
|
output logic ITLBMissF, ITLBHitF,
|
||||||
// bogus
|
// bogus
|
||||||
input logic [15:0] rd2
|
input logic [15:0] rd2
|
||||||
);
|
);
|
||||||
@ -65,8 +71,18 @@ module ifu (
|
|||||||
logic [31:0] InstrF, InstrRawD, InstrE, InstrW;
|
logic [31:0] InstrF, InstrRawD, InstrE, InstrW;
|
||||||
logic [31:0] nop = 32'h00000013; // instruction for NOP
|
logic [31:0] nop = 32'h00000013; // instruction for NOP
|
||||||
|
|
||||||
|
// *** temporary hack until we can figure out how to get actual satp value
|
||||||
|
// from priv unit -- Thomas F
|
||||||
|
logic [`XLEN-1:0] SATP = '0;
|
||||||
|
// *** temporary hack until walker is hooked up -- Thomas F
|
||||||
|
logic [`XLEN-1:0] PageTableEntryF = '0;
|
||||||
|
logic ITLBFlushF = '0;
|
||||||
|
logic ITLBWriteF = '0;
|
||||||
|
tlb #(3) itlb(clk, reset, SATP, PCF, PageTableEntryF, ITLBWriteF, ITLBFlushF,
|
||||||
|
InstrPAdrF, ITLBMissF, ITLBHitF);
|
||||||
|
|
||||||
// *** put memory interface on here, InstrF becomes output
|
// *** put memory interface on here, InstrF becomes output
|
||||||
assign InstrPAdrF = PCF; // *** no MMU
|
//assign InstrPAdrF = PCF; // *** no MMU
|
||||||
//assign InstrReadF = ~StallD; // *** & ICacheMissF; add later
|
//assign InstrReadF = ~StallD; // *** & ICacheMissF; add later
|
||||||
assign InstrReadF = 1; // *** & ICacheMissF; add later
|
assign InstrReadF = 1; // *** & ICacheMissF; add later
|
||||||
|
|
||||||
|
@ -49,10 +49,11 @@
|
|||||||
/* *** TODO:
|
/* *** TODO:
|
||||||
* - add LRU algorithm (select the write index based on which entry was used
|
* - add LRU algorithm (select the write index based on which entry was used
|
||||||
* least recently)
|
* least recently)
|
||||||
|
* - refactor modules into multiple files
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// The TLB will have 2**ENTRY_BITS total entries
|
// The TLB will have 2**ENTRY_BITS total entries
|
||||||
module tlb_toy #(parameter ENTRY_BITS = 3) (
|
module tlb #(parameter ENTRY_BITS = 3) (
|
||||||
input clk, reset,
|
input clk, reset,
|
||||||
|
|
||||||
// Current value of satp CSR (from privileged unit)
|
// Current value of satp CSR (from privileged unit)
|
||||||
@ -223,7 +224,7 @@ endmodule
|
|||||||
|
|
||||||
module tlb_rand #(parameter ENTRY_BITS = 3) (
|
module tlb_rand #(parameter ENTRY_BITS = 3) (
|
||||||
input clk, reset,
|
input clk, reset,
|
||||||
output [ENTRY_BITS:0] WriteIndex
|
output [ENTRY_BITS-1:0] WriteIndex
|
||||||
);
|
);
|
||||||
|
|
||||||
logic [31:0] data;
|
logic [31:0] data;
|
||||||
|
@ -87,6 +87,9 @@ module wallypipelinedhart (
|
|||||||
logic FloatRegWriteW;
|
logic FloatRegWriteW;
|
||||||
logic SquashSCW;
|
logic SquashSCW;
|
||||||
|
|
||||||
|
// memory management unit signals
|
||||||
|
logic ITLBMissF, ITLBHitF;
|
||||||
|
|
||||||
// bus interface to dmem
|
// bus interface to dmem
|
||||||
logic MemReadM, MemWriteM;
|
logic MemReadM, MemWriteM;
|
||||||
logic [2:0] Funct3M;
|
logic [2:0] Funct3M;
|
||||||
|
Loading…
Reference in New Issue
Block a user