Imported Upstream version 3.2.2
[debian/gnuradio] / gr-gpio / src / fpga / lib / rx_chain_dig.v
1 // -*- verilog -*-
2 //
3 //  USRP - Universal Software Radio Peripheral
4 //
5 //  Copyright (C) 2008 Corgan Enterprises LLC
6 //
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.
11 //
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.
16 //
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
20 //
21
22 // Following defines conditionally include RX path circuitry
23
24 `include "../top/config.vh"     // resolved relative to project root
25
26 module rx_chain_dig
27   (input clock,
28    input reset,
29    input enable,
30    input wire [15:0] i_in_ana,
31    input wire [15:0] q_in_ana,
32    input wire i_in_dig,
33    input wire q_in_dig,
34    output wire [15:0] i_out,
35    output wire [15:0] q_out
36    );
37
38    //assign upper 15 bits of output to analog input,
39    // discards lsb of analog input and replace with digital input bit (which comes from gpio)
40    assign i_out = (enable)?{i_in_ana[15:1],i_in_dig}:i_in_ana;
41    assign q_out = (enable)?{q_in_ana[15:1],q_in_dig}:q_in_ana;
42
43 endmodule // rx_chain_dig