root / usrp2 / vrt / vita_rx_chain.v @ 7e6a0855
History | View | Annotate | Download (4.07 KB)
| 1 |
// |
|---|---|
| 2 |
// Copyright 2011-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 |
|
| 19 |
module vita_rx_chain |
| 20 |
#(parameter BASE=0, |
| 21 |
parameter UNIT=0, |
| 22 |
parameter FIFOSIZE=10, |
| 23 |
parameter PROT_ENG_FLAGS=1, |
| 24 |
parameter DSP_NUMBER=0) |
| 25 |
(input clk, input reset, |
| 26 |
input set_stb, input [7:0] set_addr, input [31:0] set_data, |
| 27 |
input set_stb_user, input [7:0] set_addr_user, input [31:0] set_data_user, |
| 28 |
input [63:0] vita_time, |
| 29 |
input [31:0] sample, input strobe, |
| 30 |
output [35:0] rx_data_o, output rx_src_rdy_o, input rx_dst_rdy_i, |
| 31 |
output overrun, output run, |
| 32 |
output [31:0] debug ); |
| 33 |
|
| 34 |
wire [100:0] sample_data; |
| 35 |
wire sample_dst_rdy, sample_src_rdy; |
| 36 |
wire [31:0] vrc_debug, vrf_debug; |
| 37 |
|
| 38 |
wire [35:0] rx_data_int; |
| 39 |
wire rx_src_rdy_int, rx_dst_rdy_int; |
| 40 |
|
| 41 |
wire clear; |
| 42 |
|
| 43 |
setting_reg #(.my_addr(BASE+3)) sr |
| 44 |
(.clk(clk),.rst(reset),.strobe(set_stb),.addr(set_addr), |
| 45 |
.in(set_data),.out(),.changed(clear)); |
| 46 |
|
| 47 |
vita_rx_control #(.BASE(BASE), .WIDTH(32)) vita_rx_control |
| 48 |
(.clk(clk), .reset(reset), .clear(clear), |
| 49 |
.set_stb(set_stb),.set_addr(set_addr),.set_data(set_data), |
| 50 |
.vita_time(vita_time), .overrun(overrun), |
| 51 |
.sample(sample), .run(run), .strobe(strobe), |
| 52 |
.sample_fifo_o(sample_data), .sample_fifo_dst_rdy_i(sample_dst_rdy), .sample_fifo_src_rdy_o(sample_src_rdy), |
| 53 |
.debug_rx(vrc_debug)); |
| 54 |
|
| 55 |
vita_rx_framer #(.BASE(BASE), .MAXCHAN(1)) vita_rx_framer |
| 56 |
(.clk(clk), .reset(reset), .clear(clear), |
| 57 |
.set_stb(set_stb),.set_addr(set_addr),.set_data(set_data), |
| 58 |
.sample_fifo_i(sample_data), .sample_fifo_dst_rdy_o(sample_dst_rdy), .sample_fifo_src_rdy_i(sample_src_rdy), |
| 59 |
.data_o(rx_data_int), .src_rdy_o(rx_src_rdy_int), .dst_rdy_i(rx_dst_rdy_int), |
| 60 |
.debug_rx(vrf_debug) ); |
| 61 |
|
| 62 |
wire [FIFOSIZE-1:0] access_adr, access_len; |
| 63 |
wire access_we, access_stb, access_ok, access_done, access_skip_read; |
| 64 |
wire [35:0] dsp_to_buf, buf_to_dsp; |
| 65 |
wire [35:0] rx_data_int2; |
| 66 |
wire rx_src_rdy_int2, rx_dst_rdy_int2; |
| 67 |
|
| 68 |
double_buffer #(.BUF_SIZE(FIFOSIZE)) db |
| 69 |
(.clk(clk),.reset(reset),.clear(clear), |
| 70 |
.access_we(access_we), .access_stb(access_stb), .access_ok(access_ok), .access_done(access_done), |
| 71 |
.access_skip_read(access_skip_read), .access_adr(access_adr), .access_len(access_len), |
| 72 |
.access_dat_i(dsp_to_buf), .access_dat_o(buf_to_dsp), |
| 73 |
|
| 74 |
.data_i(rx_data_int), .src_rdy_i(rx_src_rdy_int), .dst_rdy_o(rx_dst_rdy_int), |
| 75 |
.data_o(rx_data_int2), .src_rdy_o(rx_src_rdy_int2), .dst_rdy_i(rx_dst_rdy_int2)); |
| 76 |
|
| 77 |
custom_engine_rx #(.DSPNO(DSP_NUMBER), .MAIN_SETTINGS_BASE(BASE+9), .BUF_SIZE(FIFOSIZE)) dspengine_rx |
| 78 |
(.clock(clk),.reset(reset),.clear(clear), |
| 79 |
.set_stb_main(set_stb), .set_addr_main(set_addr), .set_data_main(set_data), |
| 80 |
.set_stb_user(set_stb_user), .set_addr_user(set_addr_user), .set_data_user(set_data_user), |
| 81 |
.access_we(access_we), .access_stb(access_stb), .access_ok(access_ok), .access_done(access_done), |
| 82 |
.access_skip_read(access_skip_read), .access_adr(access_adr), .access_len(access_len), |
| 83 |
.access_dat_i(buf_to_dsp), .access_dat_o(dsp_to_buf)); |
| 84 |
|
| 85 |
add_routing_header #(.PORT_SEL(UNIT), |
| 86 |
.PROT_ENG_FLAGS(PROT_ENG_FLAGS)) dsp_routing_header |
| 87 |
(.clk(clk), .reset(reset), .clear(clear), |
| 88 |
.data_i(rx_data_int2), .src_rdy_i(rx_src_rdy_int2), .dst_rdy_o(rx_dst_rdy_int2), |
| 89 |
.data_o(rx_data_o), .src_rdy_o(rx_src_rdy_o), .dst_rdy_i(rx_dst_rdy_i) ); |
| 90 |
|
| 91 |
assign debug = vrc_debug; // | vrf_debug; |
| 92 |
|
| 93 |
endmodule // vita_rx_chain |