root / usrp2 / custom / custom_dsp_tx.v @ 7e6a0855
History | View | Annotate | Download (3.7 KB)
| 1 |
// |
|---|---|
| 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 DUC chain. |
| 21 |
//By default, this entire module is a simple pass-through. |
| 22 |
|
| 23 |
//To implement DSP logic before the DUC: |
| 24 |
//Implement custom DSP between baseband and duc input. |
| 25 |
|
| 26 |
//To implement DSP logic after the DUC: |
| 27 |
//Implement custom DSP between duc output and frontend. |
| 28 |
|
| 29 |
//To bypass the DUC with custom logic: |
| 30 |
//Implement custom DSP between baseband and frontend. |
| 31 |
|
| 32 |
module custom_dsp_tx |
| 33 |
#( |
| 34 |
//the dsp unit number: 0, 1, 2... |
| 35 |
parameter DSPNO = 0, |
| 36 |
|
| 37 |
//frontend bus width |
| 38 |
parameter WIDTH = 24 |
| 39 |
) |
| 40 |
( |
| 41 |
//control signals |
| 42 |
input clock, input reset, input enable, |
| 43 |
|
| 44 |
//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 |
|
| 50 |
//full rate outputs directly to the TX frontend |
| 51 |
output [WIDTH-1:0] frontend_i, |
| 52 |
output [WIDTH-1:0] frontend_q, |
| 53 |
|
| 54 |
//full rate outputs directly from the DUC chain |
| 55 |
input [WIDTH-1:0] duc_out_i, |
| 56 |
input [WIDTH-1:0] duc_out_q, |
| 57 |
|
| 58 |
//strobed samples {I16,Q16} to the TX DUC chain
|
| 59 |
output [31:0] duc_in_sample, |
| 60 |
input duc_in_strobe, //this is a backpressure signal |
| 61 |
|
| 62 |
//strobbed baseband samples {I16,Q16} to this module
|
| 63 |
input [31:0] bb_sample, |
| 64 |
output bb_strobe, //this is a backpressure signal |
| 65 |
|
| 66 |
//debug output (optional) |
| 67 |
output [31:0] debug |
| 68 |
); |
| 69 |
|
| 70 |
generate |
| 71 |
if (DSPNO==0) begin |
| 72 |
`ifndef TX_DSP0_MODULE |
| 73 |
assign frontend_i = duc_out_i; |
| 74 |
assign frontend_q = duc_out_q; |
| 75 |
assign duc_in_sample = bb_sample; |
| 76 |
assign bb_strobe = duc_in_strobe; |
| 77 |
`else |
| 78 |
TX_DSP0_CUSTOM_MODULE_NAME tx_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 |
.duc_out_i(duc_out_i), .duc_out_q(duc_out_q), |
| 84 |
.duc_in_sample(duc_in_sample), .duc_in_strobe(duc_in_strobe), |
| 85 |
.bb_sample(bb_sample), .bb_strobe(bb_strobe) |
| 86 |
); |
| 87 |
`endif |
| 88 |
end |
| 89 |
else begin |
| 90 |
`ifndef TX_DSP1_MODULE |
| 91 |
assign frontend_i = duc_out_i; |
| 92 |
assign frontend_q = duc_out_q; |
| 93 |
assign duc_in_sample = bb_sample; |
| 94 |
assign bb_strobe = duc_in_strobe; |
| 95 |
`else |
| 96 |
TX_DSP1_CUSTOM_MODULE_NAME tx_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 |
.duc_out_i(duc_out_i), .duc_out_q(duc_out_q), |
| 102 |
.duc_in_sample(duc_in_sample), .duc_in_strobe(duc_in_strobe), |
| 103 |
.bb_sample(bb_sample), .bb_strobe(bb_strobe) |
| 104 |
); |
| 105 |
`endif |
| 106 |
end |
| 107 |
endgenerate |
| 108 |
|
| 109 |
endmodule //custom_dsp_tx |