forked from Github_Repos/cvw
The icache ptw interlock is actually correct now. There needed to be a 1 cycle delay.
This commit is contained in:
parent
9ec624702d
commit
002c32d2ad
@ -351,7 +351,7 @@ add wave -noupdate -group uart -expand -group outputs /testbench/dut/uncore/genb
|
|||||||
add wave -noupdate -expand -group dtlb /testbench/dut/hart/lsu/dmmu/TLBMiss
|
add wave -noupdate -expand -group dtlb /testbench/dut/hart/lsu/dmmu/TLBMiss
|
||||||
add wave -noupdate -expand -group itlb /testbench/dut/hart/ifu/ITLBMissF
|
add wave -noupdate -expand -group itlb /testbench/dut/hart/ifu/ITLBMissF
|
||||||
TreeUpdate [SetDefaultTree]
|
TreeUpdate [SetDefaultTree]
|
||||||
WaveRestoreCursors {{Cursor 5} {11172515 ns} 0} {{Cursor 8} {2967 ns} 0}
|
WaveRestoreCursors {{Cursor 5} {11172515 ns} 0} {{Cursor 8} {3207 ns} 0}
|
||||||
quietly wave cursor active 2
|
quietly wave cursor active 2
|
||||||
configure wave -namecolwidth 250
|
configure wave -namecolwidth 250
|
||||||
configure wave -valuecolwidth 189
|
configure wave -valuecolwidth 189
|
||||||
@ -367,4 +367,4 @@ configure wave -griddelta 40
|
|||||||
configure wave -timeline 0
|
configure wave -timeline 0
|
||||||
configure wave -timelineunits ns
|
configure wave -timelineunits ns
|
||||||
update
|
update
|
||||||
WaveRestoreZoom {2729 ns} {3045 ns}
|
WaveRestoreZoom {2930 ns} {3454 ns}
|
||||||
|
7
wally-pipelined/src/cache/ICacheCntrl.sv
vendored
7
wally-pipelined/src/cache/ICacheCntrl.sv
vendored
@ -112,6 +112,8 @@ module ICacheCntrl #(parameter BLOCKLEN = 256) (
|
|||||||
|
|
||||||
localparam STATE_INVALIDATE = 18; // *** not sure if invalidate or evict? invalidate by cache block or address?
|
localparam STATE_INVALIDATE = 18; // *** not sure if invalidate or evict? invalidate by cache block or address?
|
||||||
localparam STATE_TLB_MISS = 19;
|
localparam STATE_TLB_MISS = 19;
|
||||||
|
localparam STATE_TLB_MISS_DONE = 20;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
localparam AHBByteLength = `XLEN / 8;
|
localparam AHBByteLength = `XLEN / 8;
|
||||||
@ -371,11 +373,14 @@ module ICacheCntrl #(parameter BLOCKLEN = 256) (
|
|||||||
end
|
end
|
||||||
STATE_TLB_MISS: begin
|
STATE_TLB_MISS: begin
|
||||||
if (ITLBWriteF) begin
|
if (ITLBWriteF) begin
|
||||||
NextState = STATE_READY;
|
NextState = STATE_TLB_MISS_DONE;
|
||||||
end else begin
|
end else begin
|
||||||
NextState = STATE_TLB_MISS;
|
NextState = STATE_TLB_MISS;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
STATE_TLB_MISS_DONE : begin
|
||||||
|
NextState = STATE_READY;
|
||||||
|
end
|
||||||
default: begin
|
default: begin
|
||||||
PCMux = 2'b01;
|
PCMux = 2'b01;
|
||||||
NextState = STATE_READY;
|
NextState = STATE_READY;
|
||||||
|
@ -96,6 +96,24 @@ module pagetablewalker (
|
|||||||
// Outputs of walker
|
// Outputs of walker
|
||||||
logic [`XLEN-1:0] PageTableEntry;
|
logic [`XLEN-1:0] PageTableEntry;
|
||||||
logic [1:0] PageType;
|
logic [1:0] PageType;
|
||||||
|
logic StartWalk;
|
||||||
|
logic EndWalk;
|
||||||
|
|
||||||
|
typedef enum {LEVEL0_WDV,
|
||||||
|
LEVEL0,
|
||||||
|
LEVEL1_WDV,
|
||||||
|
LEVEL1,
|
||||||
|
LEVEL2_WDV,
|
||||||
|
LEVEL2,
|
||||||
|
LEVEL3_WDV,
|
||||||
|
LEVEL3,
|
||||||
|
LEAF,
|
||||||
|
IDLE,
|
||||||
|
FAULT} statetype;
|
||||||
|
|
||||||
|
statetype WalkerState, NextWalkerState;
|
||||||
|
|
||||||
|
logic PRegEn;
|
||||||
|
|
||||||
assign SvMode = SATP_REGW[`XLEN-1:`XLEN-`SVMODE_BITS];
|
assign SvMode = SATP_REGW[`XLEN-1:`XLEN-`SVMODE_BITS];
|
||||||
|
|
||||||
@ -108,23 +126,30 @@ module pagetablewalker (
|
|||||||
flopenr #(`XLEN)
|
flopenr #(`XLEN)
|
||||||
TranslationVAdrReg(.clk(clk),
|
TranslationVAdrReg(.clk(clk),
|
||||||
.reset(reset),
|
.reset(reset),
|
||||||
.en(1'b1), // *** use enable later to save power
|
.en(StartWalk), // *** use enable later to save power
|
||||||
.d(TranslationVAdr),
|
.d(TranslationVAdr),
|
||||||
.q(TranslationVAdrQ));
|
.q(TranslationVAdrQ));
|
||||||
|
|
||||||
flopr #(1)
|
flopenrc #(1)
|
||||||
DTLBMissMReg(.clk(clk),
|
DTLBMissMReg(.clk(clk),
|
||||||
.reset(reset),
|
.reset(reset),
|
||||||
|
.en(StartWalk | EndWalk),
|
||||||
|
.clear(EndWalk),
|
||||||
.d(DTLBMissM),
|
.d(DTLBMissM),
|
||||||
.q(DTLBMissMQ));
|
.q(DTLBMissMQ));
|
||||||
|
|
||||||
flopr #(1)
|
flopenrc #(1)
|
||||||
ITLBMissMReg(.clk(clk),
|
ITLBMissMReg(.clk(clk),
|
||||||
.reset(reset),
|
.reset(reset),
|
||||||
|
.en(StartWalk | EndWalk),
|
||||||
|
.clear(EndWalk),
|
||||||
.d(ITLBMissF),
|
.d(ITLBMissF),
|
||||||
.q(ITLBMissFQ));
|
.q(ITLBMissFQ));
|
||||||
|
|
||||||
|
|
||||||
|
assign StartWalk = WalkerState == IDLE && (DTLBMissM | ITLBMissF);
|
||||||
|
assign EndWalk = WalkerState == LEAF;
|
||||||
|
|
||||||
assign MMUTranslate = DTLBMissMQ | ITLBMissFQ;
|
assign MMUTranslate = DTLBMissMQ | ITLBMissFQ;
|
||||||
//assign MMUTranslate = DTLBMissM | ITLBMissF;
|
//assign MMUTranslate = DTLBMissM | ITLBMissF;
|
||||||
|
|
||||||
@ -143,21 +168,6 @@ module pagetablewalker (
|
|||||||
assign PageTypeF = PageType;
|
assign PageTypeF = PageType;
|
||||||
assign PageTypeM = PageType;
|
assign PageTypeM = PageType;
|
||||||
|
|
||||||
typedef enum {LEVEL0_WDV,
|
|
||||||
LEVEL0,
|
|
||||||
LEVEL1_WDV,
|
|
||||||
LEVEL1,
|
|
||||||
LEVEL2_WDV,
|
|
||||||
LEVEL2,
|
|
||||||
LEVEL3_WDV,
|
|
||||||
LEVEL3,
|
|
||||||
LEAF,
|
|
||||||
IDLE,
|
|
||||||
FAULT} statetype;
|
|
||||||
|
|
||||||
statetype WalkerState, NextWalkerState;
|
|
||||||
|
|
||||||
logic PRegEn;
|
|
||||||
|
|
||||||
generate
|
generate
|
||||||
if (`XLEN == 32) begin
|
if (`XLEN == 32) begin
|
||||||
|
Loading…
Reference in New Issue
Block a user