Line 42... |
Line 42... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.12 2003/06/06 02:54:47 lampret
|
|
// When OR1200_NO_IMMU and OR1200_NO_IC are not both defined or undefined at the same time, results in a IC bug. Fixed.
|
|
//
|
// Revision 1.11 2002/10/17 20:04:40 lampret
|
// Revision 1.11 2002/10/17 20:04:40 lampret
|
// Added BIST scan. Special VS RAMs need to be used to implement BIST.
|
// Added BIST scan. Special VS RAMs need to be used to implement BIST.
|
//
|
//
|
// Revision 1.10 2002/09/16 03:08:56 lampret
|
// Revision 1.10 2002/09/16 03:08:56 lampret
|
// Disabled cache inhibit atttribute.
|
// Disabled cache inhibit atttribute.
|
Line 120... |
Line 123... |
`ifdef OR1200_BIST
|
`ifdef OR1200_BIST
|
// RAM BIST
|
// RAM BIST
|
scanb_rst, scanb_si, scanb_so, scanb_en, scanb_clk,
|
scanb_rst, scanb_si, scanb_so, scanb_en, scanb_clk,
|
`endif
|
`endif
|
|
|
// IC i/f
|
// QMEM i/f
|
icimmu_rty_i, icimmu_err_i, icimmu_tag_i, icimmu_adr_o, icimmu_cycstb_o, icimmu_ci_o
|
qmemimmu_rty_i, qmemimmu_err_i, qmemimmu_tag_i, qmemimmu_adr_o, qmemimmu_cycstb_o, qmemimmu_ci_o
|
);
|
);
|
|
|
parameter dw = `OR1200_OPERAND_WIDTH;
|
parameter dw = `OR1200_OPERAND_WIDTH;
|
parameter aw = `OR1200_OPERAND_WIDTH;
|
parameter aw = `OR1200_OPERAND_WIDTH;
|
|
|
Line 173... |
Line 176... |
`endif
|
`endif
|
|
|
//
|
//
|
// IC I/F
|
// IC I/F
|
//
|
//
|
input icimmu_rty_i;
|
input qmemimmu_rty_i;
|
input icimmu_err_i;
|
input qmemimmu_err_i;
|
input [3:0] icimmu_tag_i;
|
input [3:0] qmemimmu_tag_i;
|
output [aw-1:0] icimmu_adr_o;
|
output [aw-1:0] qmemimmu_adr_o;
|
output icimmu_cycstb_o;
|
output qmemimmu_cycstb_o;
|
output icimmu_ci_o;
|
output qmemimmu_ci_o;
|
|
|
//
|
//
|
// Internal wires and regs
|
// Internal wires and regs
|
//
|
//
|
wire itlb_spr_access;
|
wire itlb_spr_access;
|
Line 252... |
Line 255... |
|
|
//
|
//
|
// Put all outputs in inactive state
|
// Put all outputs in inactive state
|
//
|
//
|
assign spr_dat_o = 32'h00000000;
|
assign spr_dat_o = 32'h00000000;
|
assign icimmu_adr_o = icpu_adr_i;
|
assign qmemimmu_adr_o = icpu_adr_i;
|
assign icpu_tag_o = icimmu_tag_i;
|
assign icpu_tag_o = qmemimmu_tag_i;
|
assign icimmu_cycstb_o = icpu_cycstb_i & ~page_cross;
|
assign qmemimmu_cycstb_o = icpu_cycstb_i & ~page_cross;
|
assign icpu_rty_o = icimmu_rty_i;
|
assign icpu_rty_o = qmemimmu_rty_i;
|
assign icpu_err_o = icimmu_err_i;
|
assign icpu_err_o = qmemimmu_err_i;
|
assign icimmu_ci_o = `OR1200_IMMU_CI;
|
assign qmemimmu_ci_o = `OR1200_IMMU_CI;
|
`ifdef OR1200_BIST
|
`ifdef OR1200_BIST
|
assign scanb_so = scanb_si;
|
assign scanb_so = scanb_si;
|
`endif
|
`endif
|
`else
|
`else
|
|
|
Line 299... |
Line 302... |
// Tags:
|
// Tags:
|
//
|
//
|
// OR1200_DTAG_TE - TLB miss Exception
|
// OR1200_DTAG_TE - TLB miss Exception
|
// OR1200_DTAG_PE - Page fault Exception
|
// OR1200_DTAG_PE - Page fault Exception
|
//
|
//
|
assign icpu_tag_o = miss ? `OR1200_DTAG_TE : fault ? `OR1200_DTAG_PE : icimmu_tag_i;
|
assign icpu_tag_o = miss ? `OR1200_DTAG_TE : fault ? `OR1200_DTAG_PE : qmemimmu_tag_i;
|
|
|
//
|
//
|
// icpu_rty_o
|
// icpu_rty_o
|
//
|
//
|
// assign icpu_rty_o = !icpu_err_o & icimmu_rty_i;
|
// assign icpu_rty_o = !icpu_err_o & qmemimmu_rty_i;
|
assign icpu_rty_o = icimmu_rty_i | itlb_spr_access & immu_en;
|
assign icpu_rty_o = qmemimmu_rty_i | itlb_spr_access & immu_en;
|
|
|
//
|
//
|
// icpu_err_o
|
// icpu_err_o
|
//
|
//
|
assign icpu_err_o = miss | fault | icimmu_err_i;
|
assign icpu_err_o = miss | fault | qmemimmu_err_i;
|
|
|
//
|
//
|
// Assert itlb_en_r after one clock cycle and when there is no
|
// Assert itlb_en_r after one clock cycle and when there is no
|
// ITLB SPR access
|
// ITLB SPR access
|
//
|
//
|
Line 331... |
Line 334... |
|
|
//
|
//
|
// Cut transfer if something goes wrong with translation. If IC is disabled,
|
// Cut transfer if something goes wrong with translation. If IC is disabled,
|
// use delayed signals.
|
// use delayed signals.
|
//
|
//
|
// assign icimmu_cycstb_o = (!ic_en & immu_en) ? ~(miss | fault) & icpu_cycstb_i & ~page_cross : (miss | fault) ? 1'b0 : icpu_cycstb_i & ~page_cross; // DL
|
// assign qmemimmu_cycstb_o = (!ic_en & immu_en) ? ~(miss | fault) & icpu_cycstb_i & ~page_cross : (miss | fault) ? 1'b0 : icpu_cycstb_i & ~page_cross; // DL
|
assign icimmu_cycstb_o = immu_en ? ~(miss | fault) & icpu_cycstb_i & ~page_cross & itlb_done : icpu_cycstb_i & ~page_cross;
|
assign qmemimmu_cycstb_o = immu_en ? ~(miss | fault) & icpu_cycstb_i & ~page_cross & itlb_done : icpu_cycstb_i & ~page_cross;
|
|
|
//
|
//
|
// Cache Inhibit
|
// Cache Inhibit
|
//
|
//
|
// Cache inhibit is not really needed for instruction memory subsystem.
|
// Cache inhibit is not really needed for instruction memory subsystem.
|
// If we would do it, we would do it like this.
|
// If we would do it, we would do it like this.
|
// assign icimmu_ci_o = immu_en ? itlb_done & itlb_ci : `OR1200_IMMU_CI;
|
// assign qmemimmu_ci_o = immu_en ? itlb_done & itlb_ci : `OR1200_IMMU_CI;
|
// However this causes a async combinational loop so we stick to
|
// However this causes a async combinational loop so we stick to
|
// no cache inhibit.
|
// no cache inhibit.
|
assign icimmu_ci_o = `OR1200_IMMU_CI;
|
assign qmemimmu_ci_o = `OR1200_IMMU_CI;
|
|
|
|
|
//
|
//
|
// Physical address is either translated virtual address or
|
// Physical address is either translated virtual address or
|
// simply equal when IMMU is disabled
|
// simply equal when IMMU is disabled
|
//
|
//
|
assign icimmu_adr_o = itlb_done ? {itlb_ppn, icpu_adr_i[`OR1200_IMMU_PS-1:0]} : {icpu_vpn_r, icpu_adr_i[`OR1200_IMMU_PS-1:0]}; // DL: immu_en
|
assign qmemimmu_adr_o = itlb_done ? {itlb_ppn, icpu_adr_i[`OR1200_IMMU_PS-1:0]} : {icpu_vpn_r, icpu_adr_i[`OR1200_IMMU_PS-1:0]}; // DL: immu_en
|
|
|
//
|
//
|
// Output to SPRS unit
|
// Output to SPRS unit
|
//
|
//
|
assign spr_dat_o = spr_cs ? itlb_dat_o : 32'h00000000;
|
assign spr_dat_o = spr_cs ? itlb_dat_o : 32'h00000000;
|