|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
本帖最后由 song96169 于 2010-3-11 20:55 编辑
欢迎讨论!
下面的 信号
wbm16_cyc_o,
wbm16_stb_o,
wbm16_ack_i,处理是否正确?
/**
*/
module par16_bridge(
wb_clk_i,
wb_rst_i,
// MCU Bus Signals
mcu_adr_pad,
mcu_dat_pad,
mcu_xrd_pad,
mcu_xwe_pad,
mcu_xrw_pad,
mcu_xcs_pad,
// Wishbone Master Signals
wbm16_adr_o,
wbm16_dat_o,
wbm16_dat_i,
wbm16_cyc_o,
wbm16_stb_o,
wbm16_we_o,
wbm16_ack_i,
wbm16_sel_o
);
input wb_clk_i, wb_rst_i;
input [15:0] mcu_adr_pad;
inout [15:0] mcu_dat_pad;
input mcu_xrd_pad, mcu_xwe_pad;
input mcu_xrw_pad, mcu_xcs_pad;
output [15:0] wbm16_adr_o;
output [3:0] wbm16_sel_o;
input [15:0] wbm16_dat_i;
output [15:0] wbm16_dat_o;
output wbm16_cyc_o, wbm16_stb_o, wbm16_we_o;
input wbm16_ack_i;
reg [15:0] datlatch;
reg wb16_ack_o, wbm16_cyc_o, wbm16_stb_o;
/**********************************************************************************/
assign wbm16_adr_o = mcu_adr_pad;
assign wbm16_sel_o = 4'b1111;
assign wbm16_we_o = !mcu_xrw_pad;
assign wbm16_cyc_o = !mcu_xcs_pad;
assign wbm16_stb_o = !mcu_xcs_pad;
always @(posedge wb_clk_i) begin
if (!mcu_xcs_pad && !mcu_xrd_pad) begin
wbm16_dat_o <= mcu_dat_pad;
epwbm_stb_o <= 1'b1;
end
if (!mcu_xcs_pad && !mcu_xwe_pad)
mcu_dat_pad <= wbm16_dat_i;
else
mcu_dat_pad <= 16'hzzzz;
if (!mcu_xcs_pad && wbm16_ack_i)
epwbm_stb_o <= 1'b0;
end
end
/**********************************************************************************/
/**********************************************************************************/
endmodule |
|