Line 42... |
Line 42... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.1.1.1 2002/03/21 16:55:45 lampret
|
|
// First import of the "new" XESS XSV environment.
|
|
//
|
|
//
|
|
// Revision 1.5 2002/02/11 04:33:17 lampret
|
|
// Speed optimizations (removed duplicate _cyc_ and _stb_). Fixed D/IMMU cache-inhibit attr.
|
|
//
|
// Revision 1.4 2002/02/01 19:56:54 lampret
|
// Revision 1.4 2002/02/01 19:56:54 lampret
|
// Fixed combinational loops.
|
// Fixed combinational loops.
|
//
|
//
|
// Revision 1.3 2002/01/28 01:16:00 lampret
|
// Revision 1.3 2002/01/28 01:16:00 lampret
|
// Changed 'void' nop-ops instead of insn[0] to use insn[16]. Debug unit stalls the tick timer. Prepared new flag generation for add and and insns. Blocked DC/IC while they are turned off. Fixed I/D MMU SPRs layout except WAYs. TODO: smart IC invalidate, l.j 2 and TLB ways.
|
// Changed 'void' nop-ops instead of insn[0] to use insn[16]. Debug unit stalls the tick timer. Prepared new flag generation for add and and insns. Blocked DC/IC while they are turned off. Fixed I/D MMU SPRs layout except WAYs. TODO: smart IC invalidate, l.j 2 and TLB ways.
|
Line 183... |
Line 190... |
hitmiss_eval <= #1 1'b1;
|
hitmiss_eval <= #1 1'b1;
|
load <= #1 1'b1;
|
load <= #1 1'b1;
|
cache_inhibit <= #1 1'b0;
|
cache_inhibit <= #1 1'b0;
|
end
|
end
|
else begin // idle
|
else begin // idle
|
state <= #1 `OR1200_ICFSM_IDLE;
|
|
hitmiss_eval <= #1 1'b0;
|
hitmiss_eval <= #1 1'b0;
|
load <= #1 1'b0;
|
load <= #1 1'b0;
|
cache_inhibit <= #1 1'b0;
|
cache_inhibit <= #1 1'b0;
|
end
|
end
|
`OR1200_ICFSM_CFETCH: begin // fetch
|
`OR1200_ICFSM_CFETCH: begin // fetch
|
if (icimmu_cycstb_i & icimmu_ci_i)
|
if (icimmu_cycstb_i & icimmu_ci_i)
|
cache_inhibit <= #1 1'b1;
|
cache_inhibit <= #1 1'b1;
|
if (hitmiss_eval)
|
if (hitmiss_eval)
|
saved_addr_r[31:13] <= #1 start_addr[31:13];
|
saved_addr_r[31:13] <= #1 start_addr[31:13];
|
if (!ic_en)
|
if ((!ic_en) ||
|
state <= #1 `OR1200_ICFSM_IDLE;
|
(hitmiss_eval & !icimmu_cycstb_i) || // fetch aborted (usually caused by IMMU)
|
else if (hitmiss_eval & !icimmu_cycstb_i) begin // fetch aborted (usually caused by IMMU)
|
(biudata_error) || // fetch terminated with an error
|
state <= #1 `OR1200_ICFSM_IDLE;
|
(cache_inhibit & biudata_valid)) begin // fetch from cache-inhibited page
|
hitmiss_eval <= #1 1'b0;
|
|
load <= #1 1'b0;
|
|
cache_inhibit <= #1 1'b0;
|
|
end
|
|
else if (biudata_error) begin // fetch terminated with an error
|
|
state <= #1 `OR1200_ICFSM_IDLE;
|
|
hitmiss_eval <= #1 1'b0;
|
|
load <= #1 1'b0;
|
|
cache_inhibit <= #1 1'b0;
|
|
end
|
|
else if (cache_inhibit & biudata_valid) begin // fetch from cache-inhibited page
|
|
state <= #1 `OR1200_ICFSM_IDLE;
|
state <= #1 `OR1200_ICFSM_IDLE;
|
hitmiss_eval <= #1 1'b0;
|
hitmiss_eval <= #1 1'b0;
|
load <= #1 1'b0;
|
load <= #1 1'b0;
|
cache_inhibit <= #1 1'b0;
|
cache_inhibit <= #1 1'b0;
|
end
|
end
|
Line 221... |
Line 216... |
hitmiss_eval <= #1 1'b0;
|
hitmiss_eval <= #1 1'b0;
|
cnt <= #1 `OR1200_ICLS-2;
|
cnt <= #1 `OR1200_ICLS-2;
|
cache_inhibit <= #1 1'b0;
|
cache_inhibit <= #1 1'b0;
|
end
|
end
|
else if (!tagcomp_miss & !icimmu_ci_i) begin // fetch hit, finish immediately
|
else if (!tagcomp_miss & !icimmu_ci_i) begin // fetch hit, finish immediately
|
state <= #1 `OR1200_ICFSM_CFETCH;
|
|
saved_addr_r <= #1 start_addr;
|
saved_addr_r <= #1 start_addr;
|
hitmiss_eval <= #1 1'b1;
|
|
load <= #1 1'b1;
|
|
cache_inhibit <= #1 1'b0;
|
cache_inhibit <= #1 1'b0;
|
end
|
end
|
else if (!icimmu_cycstb_i) begin // fetch aborted (usually caused by exception)
|
else if (!icimmu_cycstb_i) begin // fetch aborted (usually caused by exception)
|
state <= #1 `OR1200_ICFSM_IDLE;
|
state <= #1 `OR1200_ICFSM_IDLE;
|
hitmiss_eval <= #1 1'b0;
|
hitmiss_eval <= #1 1'b0;
|
Line 237... |
Line 229... |
end
|
end
|
else // fetch in-progress
|
else // fetch in-progress
|
hitmiss_eval <= #1 1'b0;
|
hitmiss_eval <= #1 1'b0;
|
end
|
end
|
`OR1200_ICFSM_LREFILL3 : begin
|
`OR1200_ICFSM_LREFILL3 : begin
|
if (!ic_en)
|
if (biudata_valid && (|cnt)) begin // refill ack, more fetchs to come
|
state <= #1 `OR1200_ICFSM_IDLE;
|
|
else if (biudata_valid && (|cnt)) begin // refill ack, more fetchs to come
|
|
cnt <= #1 cnt - 'd1;
|
cnt <= #1 cnt - 'd1;
|
saved_addr_r[3:2] <= #1 saved_addr_r[3:2] + 'd1;
|
saved_addr_r[3:2] <= #1 saved_addr_r[3:2] + 'd1;
|
end
|
end
|
else if (biudata_valid) begin // last fetch of line refill
|
else if (biudata_valid) begin // last fetch of line refill
|
state <= #1 `OR1200_ICFSM_IDLE;
|
state <= #1 `OR1200_ICFSM_IDLE;
|