Line 43... |
Line 43... |
parameter SINGLE_CYCLE = 1'b0)
|
parameter SINGLE_CYCLE = 1'b0)
|
(
|
(
|
// Wishbone Signals
|
// Wishbone Signals
|
output [DWIDTH-1:0] wbs_dat_o, // databus output
|
output [DWIDTH-1:0] wbs_dat_o, // databus output
|
output wbs_ack_o, // bus cycle acknowledge output
|
output wbs_ack_o, // bus cycle acknowledge output
|
|
output wbs_err_o, // bus error, lost module select durning wait state
|
input wbs_clk_i, // master clock input
|
input wbs_clk_i, // master clock input
|
input wbs_rst_i, // synchronous active high reset
|
input wbs_rst_i, // synchronous active high reset
|
input arst_i, // asynchronous reset
|
input arst_i, // asynchronous reset
|
input [ 5:1] wbs_adr_i, // lower address bits
|
input [ 5:1] wbs_adr_i, // lower address bits
|
input [DWIDTH-1:0] wbs_dat_i, // databus input
|
input [DWIDTH-1:0] wbs_dat_i, // databus input
|
Line 108... |
Line 109... |
|
|
// generate wishbone signals
|
// generate wishbone signals
|
assign module_sel = wbs_cyc_i && wbs_stb_i;
|
assign module_sel = wbs_cyc_i && wbs_stb_i;
|
assign wbs_wacc = module_sel && wbs_we_i && (wbs_ack_o || SINGLE_CYCLE);
|
assign wbs_wacc = module_sel && wbs_we_i && (wbs_ack_o || SINGLE_CYCLE);
|
assign wbs_racc = module_sel && !wbs_we_i;
|
assign wbs_racc = module_sel && !wbs_we_i;
|
assign wbs_ack_o = SINGLE_CYCLE ? module_sel : bus_wait_state;
|
assign wbs_ack_o = SINGLE_CYCLE ? module_sel : (bus_wait_state && module_sel);
|
assign wbs_dat_o = SINGLE_CYCLE ? rd_data_mux : rd_data_reg;
|
assign wbs_dat_o = SINGLE_CYCLE ? rd_data_mux : rd_data_reg;
|
|
assign wbs_err_o = !SINGLE_CYCLE && !module_sel && bus_wait_state;
|
|
|
// generate acknowledge output signal, By using register all accesses takes two cycles.
|
// generate acknowledge output signal, By using register all accesses takes two cycles.
|
// Accesses in back to back clock cycles are not possable.
|
// Accesses in back to back clock cycles are not possable.
|
always @(posedge wbs_clk_i or negedge async_rst_b)
|
always @(posedge wbs_clk_i or negedge async_rst_b)
|
if (!async_rst_b)
|
if (!async_rst_b)
|