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 "config.vh" // resolved relative to project root
30
input wire [7:0] decim_rate,
32
input decimator_strobe,
33
output wire hb_strobe,
34
input [6:0] serial_addr, input [31:0] serial_data, input serial_strobe,
35
input wire [15:0] i_in,
36
input wire [15:0] q_in,
37
output wire [15:0] i_out,
38
output wire [15:0] q_out,
39
output wire [15:0] debugdata,output wire [15:0] debugctrl
42
parameter FREQADDR = 0;
43
parameter PHASEADDR = 0;
46
wire [15:0] bb_i, bb_q;
47
wire [15:0] hb_in_i, hb_in_q;
49
assign debugdata = hb_in_i;
52
phase_acc #(FREQADDR,PHASEADDR,32) rx_phase_acc
53
(.clk(clock),.reset(reset),.enable(enable),
54
.serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
55
.strobe(sample_strobe),.phase(phase) );
58
( .clock(clock),.reset(reset),.enable(enable),
59
.xi(i_in),.yi(q_in),.zi(phase[31:16]),
60
.xo(bb_i),.yo(bb_q),.zo() );
64
assign sample_strobe = 1;
65
`endif // !`ifdef RX_NCO_ON
68
integrator integ_decim_i_0
69
( .clock(clock),.reset(reset),.enable(enable),
70
.rate(decim_rate),.strobe_in(sample_strobe),.strobe_out(decimator_strobe),
71
.signal_in(bb_i),.signal_out(i_out) );
73
assign hb_strobe = decimator_strobe;
76
cic_decim cic_decim_i_0
77
( .clock(clock),.reset(reset),.enable(enable),
78
.rate(decim_rate),.strobe_in(sample_strobe),.strobe_out(decimator_strobe),
79
.signal_in(bb_i),.signal_out(hb_in_i) );
81
assign hb_in_i = bb_i;
82
assign decimator_strobe = sample_strobe;
86
halfband_decim hbd_i_0
87
( .clock(clock),.reset(reset),.enable(enable),
88
.strobe_in(decimator_strobe),.strobe_out(hb_strobe),
89
.data_in(hb_in_i),.data_out(i_out),.debugctrl(debugctrl) );
91
assign i_out = hb_in_i;
92
assign hb_strobe = decimator_strobe;
97
integrator integ_decim_q_0
98
( .clock(clock),.reset(reset),.enable(enable),
99
.rate(decim_rate),.strobe_in(sample_strobe),.strobe_out(decimator_strobe),
100
.signal_in(bb_q),.signal_out(q_out) );
103
cic_decim cic_decim_q_0
104
( .clock(clock),.reset(reset),.enable(enable),
105
.rate(decim_rate),.strobe_in(sample_strobe),.strobe_out(decimator_strobe),
106
.signal_in(bb_q),.signal_out(hb_in_q) );
108
assign hb_in_q = bb_q;
112
halfband_decim hbd_q_0
113
( .clock(clock),.reset(reset),.enable(enable),
114
.strobe_in(decimator_strobe),.strobe_out(),
115
.data_in(hb_in_q),.data_out(q_out) );
117
assign q_out = hb_in_q;
119
`endif // RX_INTEG_ON
121
endmodule // rx_chain