]>
Commit | Line | Data |
---|---|---|
1 | module wb_fifo (clk_i, nrst_i, wb_adr_i, wb_dat_o, wb_dat_i, wb_sel_i, wb_we_i, \r | |
2 | wb_stb_i, wb_cyc_i, wb_ack_o, wb_err_o, wb_int_o, fifo_data_i, fifo_data_o, fifo_we_o, fifo_re_o);\r | |
3 | \r | |
4 | input clk_i;\r | |
5 | input nrst_i;\r | |
6 | input [24:1] wb_adr_i;\r | |
7 | output [15:0] wb_dat_o;\r | |
8 | input [15:0] wb_dat_i;\r | |
9 | input [1:0] wb_sel_i;\r | |
10 | input wb_we_i;\r | |
11 | input wb_stb_i;\r | |
12 | input wb_cyc_i;\r | |
13 | output wb_ack_o;\r | |
14 | output wb_err_o;\r | |
15 | output wb_int_o;\r | |
16 | input [7:0] fifo_data_i;\r | |
17 | output [7:0] fifo_data_o;\r | |
18 | output fifo_we_o;\r | |
19 | output fifo_re_o;\r | |
20 | \r | |
21 | reg [15:0] data_reg;\r | |
22 | \r | |
23 | always @(posedge clk_i or negedge nrst_i)\r | |
24 | begin\r | |
25 | if (nrst_i == 0)\r | |
26 | data_reg <= 16'h0000;\r | |
27 | else \r | |
28 | if (wb_stb_i && wb_we_i)\r | |
29 | data_reg <= wb_dat_i;\r | |
30 | end\r | |
31 | \r | |
32 | assign fifo_we_o = 1'b1;\r | |
33 | assign fifo_data_o = data_reg;\r | |
34 | \r | |
35 | assign wb_ack_o = wb_stb_i;\r | |
36 | assign wb_err_o = 1'b0;\r | |
37 | assign wb_int_o = 1'b0;\r | |
38 | assign wb_dat_o = data_reg;\r | |
39 | \r | |
40 | endmodule\r |