Line 42... |
Line 42... |
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
//
|
//
|
// CVS Revision History
|
// CVS Revision History
|
//
|
//
|
// $Log: not supported by cvs2svn $
|
// $Log: not supported by cvs2svn $
|
|
// Revision 1.2 2002/01/18 07:56:00 lampret
|
|
// No more low/high priority interrupts (PICPR removed). Added tick timer exception. Added exception prefix (SR[EPH]). Fixed single-step bug whenreading NPC.
|
|
//
|
// Revision 1.1 2002/01/03 08:16:15 lampret
|
// Revision 1.1 2002/01/03 08:16:15 lampret
|
// New prefixes for RTL files, prefixed module names. Updated cache controllers and MMUs.
|
// New prefixes for RTL files, prefixed module names. Updated cache controllers and MMUs.
|
//
|
//
|
// Revision 1.9 2001/11/30 18:59:47 simons
|
// Revision 1.9 2001/11/30 18:59:47 simons
|
// *** empty log message ***
|
// *** empty log message ***
|
Line 79... |
Line 82... |
// Internal i/f
|
// Internal i/f
|
addrbase, addrofs, lsu_op, lsu_datain, lsu_dataout, lsu_stall, lsu_unstall,
|
addrbase, addrofs, lsu_op, lsu_datain, lsu_dataout, lsu_stall, lsu_unstall,
|
du_stall, flushpipe, except_align, except_dtlbmiss, except_dmmufault, except_dbuserr,
|
du_stall, flushpipe, except_align, except_dtlbmiss, except_dmmufault, except_dbuserr,
|
|
|
// External i/f to DC
|
// External i/f to DC
|
dcpu_adr_o, dcpu_cyc_o, dcpu_stb_o, dcpu_we_o, dcpu_sel_o, dcpu_tag_o, dcpu_dat_o,
|
dcpu_adr_o, dcpu_cycstb_o, dcpu_we_o, dcpu_sel_o, dcpu_tag_o, dcpu_dat_o,
|
dcpu_dat_i, dcpu_ack_i, dcpu_rty_i, dcpu_err_i, dcpu_tag_i
|
dcpu_dat_i, dcpu_ack_i, dcpu_rty_i, dcpu_err_i, dcpu_tag_i
|
);
|
);
|
|
|
parameter dw = `OR1200_OPERAND_WIDTH;
|
parameter dw = `OR1200_OPERAND_WIDTH;
|
parameter aw = `OR1200_REGFILE_ADDR_WIDTH;
|
parameter aw = `OR1200_REGFILE_ADDR_WIDTH;
|
Line 117... |
Line 120... |
|
|
//
|
//
|
// External i/f to DC
|
// External i/f to DC
|
//
|
//
|
output [31:0] dcpu_adr_o;
|
output [31:0] dcpu_adr_o;
|
output dcpu_cyc_o;
|
output dcpu_cycstb_o;
|
output dcpu_stb_o;
|
|
output dcpu_we_o;
|
output dcpu_we_o;
|
output [3:0] dcpu_sel_o;
|
output [3:0] dcpu_sel_o;
|
output [3:0] dcpu_tag_o;
|
output [3:0] dcpu_tag_o;
|
output [31:0] dcpu_dat_o;
|
output [31:0] dcpu_dat_o;
|
input [31:0] dcpu_dat_i;
|
input [31:0] dcpu_dat_i;
|
Line 137... |
Line 139... |
reg [3:0] dcpu_sel_o;
|
reg [3:0] dcpu_sel_o;
|
|
|
//
|
//
|
// Internal I/F assignments
|
// Internal I/F assignments
|
//
|
//
|
assign lsu_stall = dcpu_rty_i & dcpu_cyc_o;
|
assign lsu_stall = dcpu_rty_i & dcpu_cycstb_o;
|
assign lsu_unstall = dcpu_ack_i;
|
assign lsu_unstall = dcpu_ack_i;
|
assign except_align = ((lsu_op == `OR1200_LSUOP_SH) | (lsu_op == `OR1200_LSUOP_LHZ) | (lsu_op == `OR1200_LSUOP_LHS)) & dcpu_adr_o[0]
|
assign except_align = ((lsu_op == `OR1200_LSUOP_SH) | (lsu_op == `OR1200_LSUOP_LHZ) | (lsu_op == `OR1200_LSUOP_LHS)) & dcpu_adr_o[0]
|
| ((lsu_op == `OR1200_LSUOP_SW) | (lsu_op == `OR1200_LSUOP_LWZ) | (lsu_op == `OR1200_LSUOP_LWS)) & |dcpu_adr_o[1:0];
|
| ((lsu_op == `OR1200_LSUOP_SW) | (lsu_op == `OR1200_LSUOP_LWZ) | (lsu_op == `OR1200_LSUOP_LWS)) & |dcpu_adr_o[1:0];
|
assign except_dtlbmiss = dcpu_err_i & (dcpu_tag_i == `OR1200_DTAG_TE);
|
assign except_dtlbmiss = dcpu_err_i & (dcpu_tag_i == `OR1200_DTAG_TE);
|
assign except_dmmufault = dcpu_err_i & (dcpu_tag_i == `OR1200_DTAG_PE);
|
assign except_dmmufault = dcpu_err_i & (dcpu_tag_i == `OR1200_DTAG_PE);
|
Line 149... |
Line 151... |
|
|
//
|
//
|
// External I/F assignments
|
// External I/F assignments
|
//
|
//
|
assign dcpu_adr_o = addrbase + addrofs;
|
assign dcpu_adr_o = addrbase + addrofs;
|
assign dcpu_cyc_o = du_stall | lsu_unstall ? 1'b0 : |lsu_op;
|
assign dcpu_cycstb_o = du_stall | lsu_unstall ? 1'b0 : |lsu_op;
|
assign dcpu_stb_o = dcpu_cyc_o;
|
|
assign dcpu_we_o = lsu_op[3];
|
assign dcpu_we_o = lsu_op[3];
|
assign dcpu_tag_o = dcpu_cyc_o ? `OR1200_DTAG_ND : `OR1200_DTAG_IDLE;
|
assign dcpu_tag_o = dcpu_cycstb_o ? `OR1200_DTAG_ND : `OR1200_DTAG_IDLE;
|
always @(lsu_op or dcpu_adr_o)
|
always @(lsu_op or dcpu_adr_o)
|
casex({lsu_op, dcpu_adr_o[1:0]})
|
casex({lsu_op, dcpu_adr_o[1:0]})
|
{`OR1200_LSUOP_SB, 2'b00} : dcpu_sel_o = 4'b1000;
|
{`OR1200_LSUOP_SB, 2'b00} : dcpu_sel_o = 4'b1000;
|
{`OR1200_LSUOP_SB, 2'b01} : dcpu_sel_o = 4'b0100;
|
{`OR1200_LSUOP_SB, 2'b01} : dcpu_sel_o = 4'b0100;
|
{`OR1200_LSUOP_SB, 2'b10} : dcpu_sel_o = 4'b0010;
|
{`OR1200_LSUOP_SB, 2'b10} : dcpu_sel_o = 4'b0010;
|