root / usrp2 / custom / custom_dsp_rx.v @ 7e6a0855
History | View | Annotate | Download (3.68 KB)
| 1 | 4f94819a | Josh Blum | // |
|---|---|---|---|
| 2 | // Copyright 2012 Ettus Research LLC |
||
| 3 | // |
||
| 4 | // This program is free software: you can redistribute it and/or modify |
||
| 5 | // it under the terms of the GNU General Public License as published by |
||
| 6 | // the Free Software Foundation, either version 3 of the License, or |
||
| 7 | // (at your option) any later version. |
||
| 8 | // |
||
| 9 | // This program is distributed in the hope that it will be useful, |
||
| 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
| 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||
| 12 | // GNU General Public License for more details. |
||
| 13 | // |
||
| 14 | // You should have received a copy of the GNU General Public License |
||
| 15 | // along with this program. If not, see <http://www.gnu.org/licenses/>. |
||
| 16 | // |
||
| 17 | |||
| 18 | //CUSTOMIZE ME! |
||
| 19 | |||
| 20 | //The following module effects the IO of the DDC chain. |
||
| 21 | //By default, this entire module is a simple pass-through. |
||
| 22 | |||
| 23 | //To implement DSP logic before the DDC: |
||
| 24 | //Implement custom DSP between frontend and ddc input. |
||
| 25 | |||
| 26 | //To implement DSP logic after the DDC: |
||
| 27 | //Implement custom DSP between ddc output and baseband. |
||
| 28 | |||
| 29 | //To bypass the DDC with custom logic: |
||
| 30 | //Implement custom DSP between frontend and baseband. |
||
| 31 | |||
| 32 | module custom_dsp_rx |
||
| 33 | #( |
||
| 34 | 7e6a0855 | Josh Blum | //the dsp unit number: 0, 1, 2... |
| 35 | 4f94819a | Josh Blum | parameter DSPNO = 0, |
| 36 | 7e6a0855 | Josh Blum | |
| 37 | //frontend bus width |
||
| 38 | parameter WIDTH = 24 |
||
| 39 | 4f94819a | Josh Blum | ) |
| 40 | ( |
||
| 41 | //control signals |
||
| 42 | input clock, input reset, input enable, |
||
| 43 | |||
| 44 | 7e6a0855 | Josh Blum | //main settings bus for built-in modules |
| 45 | input set_stb_main, input [7:0] set_addr_main, input [31:0] set_data_main, |
||
| 46 | |||
| 47 | //user settings bus, controlled through user setting regs API |
||
| 48 | input set_stb_user, input [7:0] set_addr_user, input [31:0] set_data_user, |
||
| 49 | 4f94819a | Josh Blum | |
| 50 | //full rate inputs directly from the RX frontend |
||
| 51 | 7e6a0855 | Josh Blum | input [WIDTH-1:0] frontend_i, |
| 52 | input [WIDTH-1:0] frontend_q, |
||
| 53 | 4f94819a | Josh Blum | |
| 54 | //full rate outputs directly to the DDC chain |
||
| 55 | 7e6a0855 | Josh Blum | output [WIDTH-1:0] ddc_in_i, |
| 56 | output [WIDTH-1:0] ddc_in_q, |
||
| 57 | 4f94819a | Josh Blum | |
| 58 | //strobed samples {I16,Q16} from the RX DDC chain
|
||
| 59 | input [31:0] ddc_out_sample, |
||
| 60 | input ddc_out_strobe, //high on valid sample |
||
| 61 | |||
| 62 | //strobbed baseband samples {I16,Q16} from this module
|
||
| 63 | output [31:0] bb_sample, |
||
| 64 | output bb_strobe, //high on valid sample |
||
| 65 | |||
| 66 | //debug output (optional) |
||
| 67 | output [31:0] debug |
||
| 68 | ); |
||
| 69 | |||
| 70 | generate |
||
| 71 | if (DSPNO==0) begin |
||
| 72 | `ifndef RX_DSP0_MODULE |
||
| 73 | assign ddc_in_i = frontend_i; |
||
| 74 | assign ddc_in_q = frontend_q; |
||
| 75 | assign bb_sample = ddc_out_sample; |
||
| 76 | assign bb_strobe = ddc_out_strobe; |
||
| 77 | `else |
||
| 78 | RX_DSP0_CUSTOM_MODULE_NAME rx_dsp0_custom |
||
| 79 | ( |
||
| 80 | .clock(clock), .reset(reset), .enable(enable), |
||
| 81 | .set_stb(set_stb), .set_addr(set_addr), .set_data(set_data), |
||
| 82 | .frontend_i(frontend_i), .frontend_q(frontend_q), |
||
| 83 | .ddc_in_i(ddc_in_i), .ddc_in_q(ddc_in_q), |
||
| 84 | .ddc_out_sample(ddc_out_sample), .ddc_out_strobe(ddc_out_strobe), |
||
| 85 | .bb_sample(bb_sample), .bb_strobe(bb_strobe) |
||
| 86 | ); |
||
| 87 | `endif |
||
| 88 | end |
||
| 89 | 7e6a0855 | Josh Blum | else begin |
| 90 | 4f94819a | Josh Blum | `ifndef RX_DSP1_MODULE |
| 91 | assign ddc_in_i = frontend_i; |
||
| 92 | assign ddc_in_q = frontend_q; |
||
| 93 | assign bb_sample = ddc_out_sample; |
||
| 94 | assign bb_strobe = ddc_out_strobe; |
||
| 95 | `else |
||
| 96 | RX_DSP1_CUSTOM_MODULE_NAME rx_dsp1_custom |
||
| 97 | ( |
||
| 98 | .clock(clock), .reset(reset), .enable(enable), |
||
| 99 | .set_stb(set_stb), .set_addr(set_addr), .set_data(set_data), |
||
| 100 | .frontend_i(frontend_i), .frontend_q(frontend_q), |
||
| 101 | .ddc_in_i(ddc_in_i), .ddc_in_q(ddc_in_q), |
||
| 102 | .ddc_out_sample(ddc_out_sample), .ddc_out_strobe(ddc_out_strobe), |
||
| 103 | .bb_sample(bb_sample), .bb_strobe(bb_strobe) |
||
| 104 | ); |
||
| 105 | `endif |
||
| 106 | end |
||
| 107 | endgenerate |
||
| 108 | |||
| 109 | endmodule //custom_dsp_rx |