3 // USRP - Universal Software Radio Peripheral
5 // Copyright (C) 2003 Matt Ettus
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA
22 // Following defines conditionally include RX path circuitry
24 `include "usrp_std.vh"
29 input wire [7:0] decim_rate,
31 input decimator_strobe,
32 output wire hb_strobe,
33 input [6:0] serial_addr, input [31:0] serial_data, input serial_strobe,
34 input wire [15:0] i_in,
35 input wire [15:0] q_in,
36 output wire [15:0] i_out,
37 output wire [15:0] q_out,
38 output wire [15:0] debugdata,output wire [15:0] debugctrl
41 parameter FREQADDR = 0;
42 parameter PHASEADDR = 0;
45 wire [15:0] bb_i, bb_q;
46 wire [15:0] hb_in_i, hb_in_q;
48 assign debugdata = hb_in_i;
51 phase_acc #(FREQADDR,PHASEADDR,32) rx_phase_acc
52 (.clk(clock),.reset(reset),.enable(enable),
53 .serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
54 .strobe(sample_strobe),.phase(phase) );
57 ( .clock(clock),.reset(reset),.enable(enable),
58 .xi(i_in),.yi(q_in),.zi(phase[31:16]),
59 .xo(bb_i),.yo(bb_q),.zo() );
63 assign sample_strobe = 1;
64 `endif // !`ifdef RX_NCO_ON
67 cic_decim cic_decim_i_0
68 ( .clock(clock),.reset(reset),.enable(enable),
69 .rate(decim_rate),.strobe_in(sample_strobe),.strobe_out(decimator_strobe),
70 .signal_in(bb_i),.signal_out(hb_in_i) );
72 assign hb_in_i = bb_i;
73 assign decimator_strobe = sample_strobe;
77 halfband_decim hbd_i_0
78 ( .clock(clock),.reset(reset),.enable(enable),
79 .strobe_in(decimator_strobe),.strobe_out(hb_strobe),
80 .data_in(hb_in_i),.data_out(i_out),.debugctrl(debugctrl) );
82 assign i_out = hb_in_i;
83 assign hb_strobe = decimator_strobe;
87 cic_decim cic_decim_q_0
88 ( .clock(clock),.reset(reset),.enable(enable),
89 .rate(decim_rate),.strobe_in(sample_strobe),.strobe_out(decimator_strobe),
90 .signal_in(bb_q),.signal_out(hb_in_q) );
92 assign hb_in_q = bb_q;
96 halfband_decim hbd_q_0
97 ( .clock(clock),.reset(reset),.enable(enable),
98 .strobe_in(decimator_strobe),.strobe_out(),
99 .data_in(hb_in_q),.data_out(q_out) );
101 assign q_out = hb_in_q;
105 endmodule // rx_chain