Line 1... |
Line 1... |
/* $Id: aeMB2_dwbif.v,v 1.3 2008-04-21 12:11:38 sybreon Exp $
|
/* $Id: aeMB2_dwbif.v,v 1.4 2008-04-23 14:18:52 sybreon Exp $
|
**
|
**
|
** AEMB2 EDK 6.2 COMPATIBLE CORE
|
** AEMB2 EDK 6.2 COMPATIBLE CORE
|
** Copyright (C) 2004-2008 Shawn Tan <shawn.tan@aeste.net>
|
** Copyright (C) 2004-2008 Shawn Tan <shawn.tan@aeste.net>
|
**
|
**
|
** This file is part of AEMB.
|
** This file is part of AEMB.
|
Line 83... |
Line 83... |
wire [3:0] wSEL = {opc_of[1:0], wOFF};
|
wire [3:0] wSEL = {opc_of[1:0], wOFF};
|
|
|
// ENABLE FEEDBACK
|
// ENABLE FEEDBACK
|
assign dwb_fb = (dwb_stb_o ~^ dwb_ack_i);
|
assign dwb_fb = (dwb_stb_o ~^ dwb_ack_i);
|
|
|
// Independent on pipeline
|
|
reg [31:0] dwb_lat;
|
|
|
|
always @(posedge gclk)
|
|
if (grst) begin
|
|
/*AUTORESET*/
|
|
// Beginning of autoreset for uninitialized flops
|
|
dwb_mx <= 32'h0;
|
|
// End of automatics
|
|
end else if (dwb_stb_o & dwb_ack_i) begin
|
|
// LATCH READS
|
|
dwb_mx <= #1 dwb_dat_i;
|
|
end
|
|
|
|
// DATA bus
|
// DATA bus
|
assign dwb_adr_o = mem_ex; // passthru
|
assign dwb_adr_o = mem_ex; // passthru
|
|
|
// STORE SIZER
|
// STORE SIZER
|
// TODO: Move the right words to the right place
|
// TODO: Move the right words to the right place
|
Line 141... |
Line 127... |
// dwb_mx latch the correct bytes
|
// dwb_mx latch the correct bytes
|
// depending on dwb_sel_o.
|
// depending on dwb_sel_o.
|
|
|
dwb_wre_o <= #1 opc_of[2]; // SXX
|
dwb_wre_o <= #1 opc_of[2]; // SXX
|
|
|
|
// FIXME: May clash during cache refills
|
|
dwb_mx <= #1 (dwb_ack_i) ? dwb_dat_i : dwb_lat;
|
|
|
case (wSEL)
|
case (wSEL)
|
// 32'bit
|
// 32'bit
|
4'h8: dwb_sel_o <= #1 4'hF;
|
4'h8: dwb_sel_o <= #1 4'hF;
|
// 16'bit
|
// 16'bit
|
4'h4: dwb_sel_o <= #1 4'hC;
|
4'h4: dwb_sel_o <= #1 4'hC;
|
Line 157... |
Line 146... |
// TODO: ILLEGAL
|
// TODO: ILLEGAL
|
default: dwb_sel_o <= #1 4'hX;
|
default: dwb_sel_o <= #1 4'hX;
|
endcase // case (wSEL)
|
endcase // case (wSEL)
|
end // if (dena)
|
end // if (dena)
|
|
|
// dislocate from pipeline
|
// Independent on pipeline
|
|
|
|
reg [31:0] dwb_lat;
|
|
always @(posedge gclk)
|
|
if (grst) begin
|
|
/*AUTORESET*/
|
|
// Beginning of autoreset for uninitialized flops
|
|
dwb_lat <= 32'h0;
|
|
dwb_mx <= 32'h0;
|
|
// End of automatics
|
|
end else if (dwb_stb_o & dwb_ack_i) begin
|
|
// LATCH READS
|
|
dwb_lat <= #1 dwb_dat_i;
|
|
end
|
|
|
always @(posedge gclk)
|
always @(posedge gclk)
|
if (grst) begin
|
if (grst) begin
|
/*AUTORESET*/
|
/*AUTORESET*/
|
// Beginning of autoreset for uninitialized flops
|
// Beginning of autoreset for uninitialized flops
|
dwb_cyc_o <= 1'h0;
|
dwb_cyc_o <= 1'h0;
|
dwb_stb_o <= 1'h0;
|
dwb_stb_o <= 1'h0;
|
// End of automatics
|
// End of automatics
|
end else if (dwb_ack_i ~^ dwb_stb_o) begin
|
end else if (dwb_fb) begin
|
dwb_stb_o <= #1
|
dwb_stb_o <= #1
|
(dena) ? &opc_of[5:4] : // LXX/SSS
|
(dena) ? &opc_of[5:4] : // LXX/SSS
|
(dwb_stb_o & !dwb_ack_i); // LXX/SSS
|
(dwb_stb_o & !dwb_ack_i); // LXX/SSS
|
dwb_cyc_o <= #1
|
dwb_cyc_o <= #1
|
(dena) ? &opc_of[5:4] | msr_ex[0] :
|
(dena) ? &opc_of[5:4] | msr_ex[0] :
|
Line 179... |
Line 182... |
assign dwb_tag_o = msr_ex[7]; // MSR_DCE
|
assign dwb_tag_o = msr_ex[7]; // MSR_DCE
|
|
|
endmodule // aeMB2_memif
|
endmodule // aeMB2_memif
|
|
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.3 2008/04/21 12:11:38 sybreon
|
|
// Passes arithmetic tests with single thread.
|
|
//
|
// Revision 1.2 2008/04/20 16:34:32 sybreon
|
// Revision 1.2 2008/04/20 16:34:32 sybreon
|
// Basic version with some features left out.
|
// Basic version with some features left out.
|
//
|
//
|
// Revision 1.1 2008/04/18 00:21:52 sybreon
|
// Revision 1.1 2008/04/18 00:21:52 sybreon
|
// Initial import.
|
// Initial import.
|