1 module tx_buffer_inband
3 input bus_reset, // Used here for the 257-Hack to fix the FX2 bug
4 input reset, // standard DSP-side reset
7 output wire have_space,
8 output reg tx_underrun,
9 input wire [3:0] channels,
15 output reg [15:0] tx_i_2,
16 output reg [15:0] tx_q_2,
17 output reg [15:0] tx_i_3,
18 output reg [15:0] tx_q_3,
23 output [11:0] debugbus
26 wire [15:0] tx_data_bus;
44 reg [31:0] time_counter;
45 reg [7:0] txstrobe_rate_0;
46 reg [7:0] txstrobe_rate_1;
50 wire [15:0] tupf_fifodata;
51 wire tupf_pkt_waiting;
56 usb_packet_fifo2 tx_usb_packet_fifo
60 .write_data (usbdata),
62 .read_data (tupf_fifodata),
63 .pkt_waiting (tupf_pkt_waiting),
64 .read_enable (tupf_rdreq),
65 .skip_packet (tupf_skip),
66 .have_space (tupf_have_space),
70 usb_fifo_reader tx_usb_packet_reader (
73 .tx_data_bus(tx_data_bus),
74 .WR_chan_0(WR_chan_0),
75 .WR_chan_1(WR_chan_1),
77 .chan_0_done(chan_0_done),
78 .chan_1_done(chan_1_done),
82 .pkt_waiting(tupf_pkt_waiting),
83 .fifodata(tupf_fifodata)
88 wire [15:0] tdpf_fifodata_0;
89 wire tdpf_pkt_waiting_0;
92 wire tdpf_have_space_0;
95 data_packet_fifo tx_data_packet_fifo_0
98 .ram_data_in(tx_data_bus),
99 .write_enable(WR_chan_0),
100 .ram_data_out(tdpf_fifodata_0),
101 .pkt_waiting(tdpf_pkt_waiting_0),
102 .read_enable(tdpf_rdreq_0),
103 .pkt_complete(chan_0_done),
104 .skip_packet(tdpf_skip_0),
105 .have_space(tdpf_have_space_0)
108 strobe_gen strobe_gen_0
112 .rate(txstrobe_rate_0),
113 .strobe_in(txstrobe),
114 .strobe(txstrobe_chan_0)
117 chan_fifo_reader tx_chan_0_reader (
120 .tx_strobe(txstrobe),
121 //.tx_strobe(txstrobe_chan_0),
122 .adc_clock(time_counter),
123 .samples_format(4'b0),
129 .rdreq(tdpf_rdreq_0),
130 .fifodata(tdpf_fifodata_0),
131 .pkt_waiting(tdpf_pkt_waiting_0)
136 wire [15:0] tdpf_fifodata_1;
137 wire tdpf_pkt_waiting_1;
140 wire tdpf_have_space_1;
141 wire txstrobe_chan_1;
143 data_packet_fifo tx_data_packet_fifo_1
146 .ram_data_in(tx_data_bus),
147 .write_enable(WR_chan_1),
148 .ram_data_out(tdpf_fifodata_1),
149 .pkt_waiting(tdpf_pkt_waiting_1),
150 .read_enable(tdpf_rdreq_1),
151 .pkt_complete(chan_1_done),
152 .skip_packet(tdpf_skip_1),
153 .have_space(tdpf_have_space_1)
156 strobe_gen strobe_gen_1
160 .rate(txstrobe_rate_1),
161 .strobe_in(txstrobe),
162 .strobe(txstrobe_chan_1)
165 chan_fifo_reader tx_chan_1_reader (
168 .tx_strobe(txstrobe),
169 //.tx_strobe(txstrobe_chan_1),
170 .adc_clock(time_counter),
171 .samples_format(4'b0),
177 .rdreq(tdpf_rdreq_1),
178 .fifodata(tdpf_fifodata_1),
179 .pkt_waiting(tdpf_pkt_waiting_1)
182 endmodule // tx_buffer