OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [rel_29/] [or1200/] [rtl/] [verilog/] [or1200_immu_top.v] - Diff between revs 1200 and 1267

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 1200 Rev 1267
Line 42... Line 42...
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
// CVS Revision History
// CVS Revision History
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.12.4.2  2003/12/09 11:46:48  simons
 
// Mbist nameing changed, Artisan ram instance signal names fixed, some synthesis waning fixed.
 
//
 
// Revision 1.12.4.1  2003/07/08 15:36:37  lampret
 
// Added embedded memory QMEM.
 
//
// Revision 1.12  2003/06/06 02:54:47  lampret
// 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.
// 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.
Line 123... Line 129...
`ifdef OR1200_BIST
`ifdef OR1200_BIST
        // RAM BIST
        // RAM BIST
        mbist_si_i, mbist_so_o, mbist_ctrl_i,
        mbist_si_i, mbist_so_o, mbist_ctrl_i,
`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 167... Line 173...
`ifdef OR1200_BIST
`ifdef OR1200_BIST
//
//
// RAM BIST
// RAM BIST
//
//
input                   mbist_si_i;
input                   mbist_si_i;
input [`OR1200_MBIST_CTRL_WIDTH - 1:0] mbist_ctrl_i;       // bist chain shift control
input [`OR1200_MBIST_CTRL_WIDTH - 1:0] mbist_ctrl_i;
output                  mbist_so_o;
output                  mbist_so_o;
`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 253... Line 259...
 
 
//
//
// 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 mbist_so_o = mbist_si_i;
assign mbist_so_o = mbist_si_i;
`endif
`endif
`else
`else
 
 
Line 300... Line 306...
// 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 332... Line 338...
 
 
//
//
// 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;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.