]> git.gag.com Git - debian/gnuradio/blob - gr-radar-mono/src/fpga/lib/radar.v
127e9cee3a9877545aff5d5ff3337701b17bc87e
[debian/gnuradio] / gr-radar-mono / src / fpga / lib / radar.v
1 // -*- verilog -*-
2 //
3 //  USRP - Universal Software Radio Peripheral
4 //
5 //  Copyright (C) 2007 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 `include "../lib/radar_config.vh"
23
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);
28
29    // System interface
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
34    
35    // Transmit subsystem
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    
41    // Receive subsystem
42    input  [15:0] rx_adc_i_i;    // I channel input from ADC
43    input  [15:0] rx_adc_q_i;    // Q channel input from ADC
44    output        rx_strobe_o;   // Indicates output samples ready for Rx FIFO
45    output [15:0] rx_ech_i_o;    // I channel processed echos to Rx FIFO
46    output [15:0] rx_ech_q_o;    // Q channel processed echos to Rx FIFO
47
48    // Application control
49    wire          reset;         // Master application reset
50    wire          tx_side;       // Transmitter slot
51    wire          debug_enabled; // Enable debugging mode;        
52    wire          tx_enable;     // Transmitter enable
53    wire          rx_enable;     // Receiver enable
54    wire          tx_ctrl;       // Transmitter on control
55    wire          rx_ctrl;       // Receiver on control
56          
57    // Configuration
58    wire [15:0]   ampl;          // Pulse amplitude
59    wire [31:0]   fstart;        // Chirp start frequency
60    wire [31:0]   fincr;         // Chirp per strobe frequency increment
61
62    radar_control controller
63      (.clk_i(clk_i),.saddr_i(saddr_i),.sdata_i(sdata_i),.s_strobe_i(s_strobe_i),
64       .reset_o(reset),.tx_side_o(tx_side_o),.dbg_o(debug_enabled),
65       .tx_strobe_o(tx_strobe_o),.tx_ctrl_o(tx_ctrl),.rx_ctrl_o(rx_ctrl),
66       .ampl_o(ampl),.fstart_o(fstart),.fincr_o(fincr));
67
68    radar_tx transmitter
69      ( .clk_i(clk_i),.rst_i(reset),.ena_i(tx_ctrl),.strobe_i(tx_strobe_o),
70        .ampl_i(ampl),.fstart_i(fstart),.fincr_i(fincr),
71        .tx_i_o(tx_dac_i_o),.tx_q_o(tx_dac_q_o) );
72    
73    radar_rx receiver
74      ( .clk_i(clk_i),.rst_i(reset),.ena_i(rx_ctrl),.dbg_i(debug_enabled),
75        .rx_in_i_i(rx_adc_i_i),.rx_in_q_i(rx_adc_q_i),
76        .rx_strobe_o(rx_strobe_o),.rx_i_o(rx_ech_i_o),.rx_q_o(rx_ech_q_o) );
77    
78 endmodule // radar