URL
https://opencores.org/ocsvn/rtf65002/rtf65002/trunk
[/] [rtf65002/] [trunk/] [rtl/] [verilog/] [cache_controller.v] - Diff between revs 20 and 21
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 20 |
Rev 21 |
Line 87... |
Line 87... |
adr_o <= 34'h0;
|
adr_o <= 34'h0;
|
cstate <= IDLE;
|
cstate <= IDLE;
|
end
|
end
|
adr_o <= adr_o + 34'd4;
|
adr_o <= adr_o + 34'd4;
|
end
|
end
|
|
// What to do here
|
|
else if (err_i) begin
|
|
if (adr_o[3:2]==2'b11) begin
|
|
dmiss <= `FALSE;
|
|
isDataCacheLoad <= `FALSE;
|
|
cti_o <= 3'b000;
|
|
bl_o <= 6'd0;
|
|
cyc_o <= 1'b0;
|
|
stb_o <= 1'b0;
|
|
sel_o <= 4'h0;
|
|
adr_o <= 34'h0;
|
|
cstate <= IDLE;
|
|
// The state machine will be waiting for a dhit.
|
|
// Override the next state and send the processor to the bus error state.
|
|
state <= BUS_ERROR;
|
|
end
|
|
adr_o <= adr_o + 34'd4;
|
|
end
|
LOAD_ICACHE:
|
LOAD_ICACHE:
|
if (ack_i) begin
|
if (ack_i) begin
|
if (adr_o[3:2]==2'b11) begin
|
if (adr_o[3:2]==2'b11) begin
|
imiss <= `FALSE;
|
imiss <= `FALSE;
|
isInsnCacheLoad <= `FALSE;
|
isInsnCacheLoad <= `FALSE;
|
Line 102... |
Line 120... |
adr_o <= 34'd0;
|
adr_o <= 34'd0;
|
cstate <= IDLE;
|
cstate <= IDLE;
|
end
|
end
|
adr_o <= adr_o + 34'd4;
|
adr_o <= adr_o + 34'd4;
|
end
|
end
|
|
else if (err_i) begin
|
|
if (adr_o[3:2]==2'b11) begin
|
|
imiss <= `FALSE;
|
|
isInsnCacheLoad <= `FALSE;
|
|
cti_o <= 3'b000;
|
|
bl_o <= 6'd0;
|
|
cyc_o <= 1'b0;
|
|
stb_o <= 1'b0;
|
|
sel_o <= 4'h0;
|
|
adr_o <= 34'd0;
|
|
state <= INSN_BUS_ERROR;
|
|
cstate <= IDLE;
|
|
end
|
|
adr_o <= adr_o + 34'd4;
|
|
end
|
LOAD_IBUF1:
|
LOAD_IBUF1:
|
if (ack_i) begin
|
if (ack_i|err_i) begin
|
case(pc[1:0])
|
case(pc[1:0])
|
2'd0: ibuf <= dat_i;
|
2'd0: ibuf <= dat_i;
|
2'd1: ibuf <= dat_i[31:8];
|
2'd1: ibuf <= dat_i[31:8];
|
2'd2: ibuf <= dat_i[31:16];
|
2'd2: ibuf <= dat_i[31:16];
|
2'd3: ibuf <= dat_i[31:24];
|
2'd3: ibuf <= dat_i[31:24];
|
endcase
|
endcase
|
cstate <= LOAD_IBUF2;
|
cstate <= LOAD_IBUF2;
|
adr_o <= adr_o + 34'd4;
|
adr_o <= adr_o + 34'd4;
|
end
|
end
|
LOAD_IBUF2:
|
LOAD_IBUF2:
|
if (ack_i) begin
|
if (ack_i|err_i) begin
|
case(pc[1:0])
|
case(pc[1:0])
|
2'd0: ibuf[55:32] <= dat_i[23:0];
|
2'd0: ibuf[55:32] <= dat_i[23:0];
|
2'd1: ibuf[55:24] <= dat_i;
|
2'd1: ibuf[55:24] <= dat_i;
|
2'd2: ibuf[47:16] <= dat_i;
|
2'd2: ibuf[47:16] <= dat_i;
|
2'd3: ibuf[39:8] <= dat_i;
|
2'd3: ibuf[39:8] <= dat_i;
|
Line 142... |
Line 175... |
adr_o <= 34'd0;
|
adr_o <= 34'd0;
|
cstate <= IDLE;
|
cstate <= IDLE;
|
imiss <= `FALSE;
|
imiss <= `FALSE;
|
bufadr <= pc; // clears the miss
|
bufadr <= pc; // clears the miss
|
end
|
end
|
|
else if (err_i) begin
|
|
case(pc[1:0])
|
|
2'd0: ;
|
|
2'd1: ;
|
|
2'd2: ibuf[55:48] <= dat_i[7:0];
|
|
2'd3: ibuf[55:40] <= dat_i[15:0];
|
|
endcase
|
|
cti_o <= 3'd0;
|
|
bl_o <= 6'd0;
|
|
cyc_o <= 1'b0;
|
|
stb_o <= 1'b0;
|
|
sel_o <= 4'h0;
|
|
adr_o <= 34'd0;
|
|
cstate <= IDLE;
|
|
state <= INSN_BUS_ERROR;
|
|
imiss <= `FALSE;
|
|
bufadr <= pc; // clears the miss
|
|
end
|
|
|
endcase
|
endcase
|
|
|
No newline at end of file
|
No newline at end of file
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.