Line 42... |
Line 42... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.7 2002/10/17 20:04:40 lampret
|
|
// Added BIST scan. Special VS RAMs need to be used to implement BIST.
|
|
//
|
// Revision 1.6 2002/03/29 15:16:55 lampret
|
// Revision 1.6 2002/03/29 15:16:55 lampret
|
// Some of the warnings fixed.
|
// Some of the warnings fixed.
|
//
|
//
|
// Revision 1.5 2002/02/11 04:33:17 lampret
|
// Revision 1.5 2002/02/11 04:33:17 lampret
|
// Speed optimizations (removed duplicate _cyc_ and _stb_). Fixed D/IMMU cache-inhibit attr.
|
// Speed optimizations (removed duplicate _cyc_ and _stb_). Fixed D/IMMU cache-inhibit attr.
|
Line 101... |
Line 104... |
icbiu_dat_o, icbiu_adr_o, icbiu_cyc_o, icbiu_stb_o, icbiu_we_o, icbiu_sel_o, icbiu_cab_o,
|
icbiu_dat_o, icbiu_adr_o, icbiu_cyc_o, icbiu_stb_o, icbiu_we_o, icbiu_sel_o, icbiu_cab_o,
|
icbiu_dat_i, icbiu_ack_i, icbiu_err_i,
|
icbiu_dat_i, icbiu_ack_i, icbiu_err_i,
|
|
|
// Internal i/f
|
// Internal i/f
|
ic_en,
|
ic_en,
|
icimmu_adr_i, icimmu_cycstb_i, icimmu_ci_i,
|
icqmem_adr_i, icqmem_cycstb_i, icqmem_ci_i,
|
icpu_sel_i, icpu_tag_i,
|
icqmem_sel_i, icqmem_tag_i,
|
icpu_dat_o, icpu_ack_o, icimmu_rty_o, icimmu_err_o, icimmu_tag_o,
|
icqmem_dat_o, icqmem_ack_o, icqmem_rty_o, icqmem_err_o, icqmem_tag_o,
|
|
|
`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
|
Line 144... |
Line 147... |
|
|
//
|
//
|
// Internal I/F
|
// Internal I/F
|
//
|
//
|
input ic_en;
|
input ic_en;
|
input [31:0] icimmu_adr_i;
|
input [31:0] icqmem_adr_i;
|
input icimmu_cycstb_i;
|
input icqmem_cycstb_i;
|
input icimmu_ci_i;
|
input icqmem_ci_i;
|
input [3:0] icpu_sel_i;
|
input [3:0] icqmem_sel_i;
|
input [3:0] icpu_tag_i;
|
input [3:0] icqmem_tag_i;
|
output [dw-1:0] icpu_dat_o;
|
output [dw-1:0] icqmem_dat_o;
|
output icpu_ack_o;
|
output icqmem_ack_o;
|
output icimmu_rty_o;
|
output icqmem_rty_o;
|
output icimmu_err_o;
|
output icqmem_err_o;
|
output [3:0] icimmu_tag_o;
|
output [3:0] icqmem_tag_o;
|
|
|
`ifdef OR1200_BIST
|
`ifdef OR1200_BIST
|
//
|
//
|
// RAM BIST
|
// RAM BIST
|
//
|
//
|
Line 225... |
Line 228... |
assign icbiu_dat_o = 32'h00000000;
|
assign icbiu_dat_o = 32'h00000000;
|
|
|
//
|
//
|
// Bypases of the IC when IC is disabled
|
// Bypases of the IC when IC is disabled
|
//
|
//
|
assign icbiu_cyc_o = (ic_en) ? icfsm_biu_read : icimmu_cycstb_i;
|
assign icbiu_cyc_o = (ic_en) ? icfsm_biu_read : icqmem_cycstb_i;
|
assign icbiu_stb_o = (ic_en) ? icfsm_biu_read : icimmu_cycstb_i;
|
assign icbiu_stb_o = (ic_en) ? icfsm_biu_read : icqmem_cycstb_i;
|
assign icbiu_we_o = 1'b0;
|
assign icbiu_we_o = 1'b0;
|
assign icbiu_sel_o = (ic_en & icfsm_biu_read) ? 4'b1111 : icpu_sel_i;
|
assign icbiu_sel_o = (ic_en & icfsm_biu_read) ? 4'b1111 : icqmem_sel_i;
|
assign icbiu_cab_o = (ic_en) ? icfsm_burst : 1'b0;
|
assign icbiu_cab_o = (ic_en) ? icfsm_burst : 1'b0;
|
assign icimmu_rty_o = ~icpu_ack_o & ~icimmu_err_o;
|
assign icqmem_rty_o = ~icqmem_ack_o & ~icqmem_err_o;
|
assign icimmu_tag_o = icimmu_err_o ? `OR1200_ITAG_BE : icpu_tag_i;
|
assign icqmem_tag_o = icqmem_err_o ? `OR1200_ITAG_BE : icqmem_tag_i;
|
|
|
//
|
//
|
// CPU normal and error termination
|
// CPU normal and error termination
|
//
|
//
|
assign icpu_ack_o = ic_en ? (icfsm_first_hit_ack | icfsm_first_miss_ack) : icbiu_ack_i;
|
assign icqmem_ack_o = ic_en ? (icfsm_first_hit_ack | icfsm_first_miss_ack) : icbiu_ack_i;
|
assign icimmu_err_o = ic_en ? icfsm_first_miss_err : icbiu_err_i;
|
assign icqmem_err_o = ic_en ? icfsm_first_miss_err : icbiu_err_i;
|
|
|
//
|
//
|
// Select between claddr generated by IC FSM and addr[3:2] generated by LSU
|
// Select between claddr generated by IC FSM and addr[3:2] generated by LSU
|
//
|
//
|
assign ic_addr = (icfsm_biu_read) ? saved_addr : icimmu_adr_i;
|
assign ic_addr = (icfsm_biu_read) ? saved_addr : icqmem_adr_i;
|
|
|
//
|
//
|
// Select between input data generated by LSU or by BIU
|
// Select between input data generated by LSU or by BIU
|
//
|
//
|
assign to_icram = icbiu_dat_i;
|
assign to_icram = icbiu_dat_i;
|
|
|
//
|
//
|
// Select between data generated by ICRAM or passed by BIU
|
// Select between data generated by ICRAM or passed by BIU
|
//
|
//
|
assign icpu_dat_o = icfsm_first_miss_ack | !ic_en ? icbiu_dat_i : from_icram;
|
assign icqmem_dat_o = icfsm_first_miss_ack | !ic_en ? icbiu_dat_i : from_icram;
|
|
|
//
|
//
|
// Tag comparison
|
// Tag comparison
|
//
|
//
|
always @(tag or saved_addr or tag_v) begin
|
always @(tag or saved_addr or tag_v) begin
|
Line 271... |
Line 274... |
//
|
//
|
or1200_ic_fsm or1200_ic_fsm(
|
or1200_ic_fsm or1200_ic_fsm(
|
.clk(clk),
|
.clk(clk),
|
.rst(rst),
|
.rst(rst),
|
.ic_en(ic_en),
|
.ic_en(ic_en),
|
.icimmu_cycstb_i(icimmu_cycstb_i),
|
.icqmem_cycstb_i(icqmem_cycstb_i),
|
.icimmu_ci_i(icimmu_ci_i),
|
.icqmem_ci_i(icqmem_ci_i),
|
.tagcomp_miss(tagcomp_miss),
|
.tagcomp_miss(tagcomp_miss),
|
.biudata_valid(icbiu_ack_i),
|
.biudata_valid(icbiu_ack_i),
|
.biudata_error(icbiu_err_i),
|
.biudata_error(icbiu_err_i),
|
.start_addr(icimmu_adr_i),
|
.start_addr(icqmem_adr_i),
|
.saved_addr(saved_addr),
|
.saved_addr(saved_addr),
|
.icram_we(icram_we),
|
.icram_we(icram_we),
|
.biu_read(icfsm_biu_read),
|
.biu_read(icfsm_biu_read),
|
.first_hit_ack(icfsm_first_hit_ack),
|
.first_hit_ack(icfsm_first_hit_ack),
|
.first_miss_ack(icfsm_first_miss_ack),
|
.first_miss_ack(icfsm_first_miss_ack),
|