3 // USRP - Universal Software Radio Peripheral
5 // Copyright (C) 2007 Corgan Enterprises LLC
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 `include "../lib/radar_config.vh"
24 module radar(clk_i,saddr_i,sdata_i,s_strobe_i,
25 tx_side_o,tx_strobe_o,tx_dac_i_o,tx_dac_q_o,
26 rx_adc_i_i,rx_adc_q_i,
27 rx_strobe_o,rx_ech_i_o,rx_ech_q_o,io_tx_ena_o);
30 input clk_i; // Master clock @ 64 MHz
31 input [6:0] saddr_i; // Configuration bus address
32 input [31:0] sdata_i; // Configuration bus data
33 input s_strobe_i; // Configuration bus write
36 output tx_side_o; // Transmitter slot
37 output tx_strobe_o; // Generate an transmitter output sample
38 output [13:0] tx_dac_i_o; // I channel transmitter output to DAC
39 output [13:0] tx_dac_q_o; // Q channel transmitter output to DAC
40 output io_tx_ena_o; // Transmit/Receive switching
43 input [15:0] rx_adc_i_i; // I channel input from ADC
44 input [15:0] rx_adc_q_i; // Q channel input from ADC
45 output rx_strobe_o; // Indicates output samples ready for Rx FIFO
46 output [15:0] rx_ech_i_o; // I channel processed echos to Rx FIFO
47 output [15:0] rx_ech_q_o; // Q channel processed echos to Rx FIFO
49 // Application control
50 wire reset; // Master application reset
51 wire tx_side; // Transmitter slot
52 wire debug_enabled; // Enable debugging mode;
53 wire tx_enable; // Transmitter enable
54 wire rx_enable; // Receiver enable
55 wire tx_ctrl; // Transmitter on control
56 wire rx_ctrl; // Receiver on control
57 wire [15:0] pulse_num; // Count of pulses since tx_enabled
60 wire [15:0] ampl; // Pulse amplitude
61 wire [31:0] fstart; // Chirp start frequency
62 wire [31:0] fincr; // Chirp per strobe frequency increment
64 radar_control controller
65 (.clk_i(clk_i),.saddr_i(saddr_i),.sdata_i(sdata_i),.s_strobe_i(s_strobe_i),
66 .reset_o(reset),.tx_side_o(tx_side_o),.dbg_o(debug_enabled),
67 .tx_strobe_o(tx_strobe_o),.tx_ctrl_o(tx_ctrl),.rx_ctrl_o(rx_ctrl),
68 .ampl_o(ampl),.fstart_o(fstart),.fincr_o(fincr),.pulse_num_o(pulse_num),
69 .io_tx_ena_o(io_tx_ena_o));
72 ( .clk_i(clk_i),.rst_i(reset),.ena_i(tx_ctrl),.strobe_i(tx_strobe_o),
73 .ampl_i(ampl),.fstart_i(fstart),.fincr_i(fincr),
74 .tx_i_o(tx_dac_i_o),.tx_q_o(tx_dac_q_o) );
77 ( .clk_i(clk_i),.rst_i(reset),.ena_i(rx_ctrl),.dbg_i(debug_enabled),
78 .pulse_num_i(pulse_num),.rx_in_i_i(rx_adc_i_i),.rx_in_q_i(rx_adc_q_i),
79 .rx_strobe_o(rx_strobe_o),.rx_i_o(rx_ech_i_o),.rx_q_o(rx_ech_q_o) );