diff options
Diffstat (limited to 'gr-radar-mono/src/fpga/lib/radar_tx.v')
-rw-r--r-- | gr-radar-mono/src/fpga/lib/radar_tx.v | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/gr-radar-mono/src/fpga/lib/radar_tx.v b/gr-radar-mono/src/fpga/lib/radar_tx.v index ffb16fa70..c20dd0c1a 100644 --- a/gr-radar-mono/src/fpga/lib/radar_tx.v +++ b/gr-radar-mono/src/fpga/lib/radar_tx.v @@ -19,7 +19,10 @@ // Foundation, Inc., 51 Franklin Street, Boston, MA 02110-1301 USA // -module radar_tx(clk_i,rst_i,ena_i,strobe_i,ampl_i,freq_i,tx_i_o,tx_q_o); +module radar_tx(clk_i,rst_i,ena_i,strobe_i, + ampl_i,fstart_i,fincr_i, + tx_i_o,tx_q_o); + // System control input clk_i; input rst_i; @@ -28,19 +31,29 @@ module radar_tx(clk_i,rst_i,ena_i,strobe_i,ampl_i,freq_i,tx_i_o,tx_q_o); // Configuration input [15:0] ampl_i; - input [31:0] freq_i; + input [31:0] fstart_i; + input [31:0] fincr_i; - // Output + // Chirp output output [13:0] tx_i_o; output [13:0] tx_q_o; + wire [15:0] cordic_i, cordic_q; - wire [15:0] cordic_i, cordic_q; + // Chirp generator + reg [31:0] freq; + always @(posedge clk_i) + if (rst_i | ~ena_i) + freq <= fstart_i; + else + if (strobe_i) + freq <= freq + fincr_i; + cordic_nco nco(.clk_i(clk_i),.rst_i(rst_i),.ena_i(ena_i),.strobe_i(strobe_i), - .ampl_i(ampl_i),.freq_i(freq_i),.phs_i(0), + .ampl_i(ampl_i),.freq_i(freq),.phs_i(0), .data_i_o(cordic_i),.data_q_o(cordic_q)); - assign tx_i_o = cordic_i[13:0]; - assign tx_q_o = cordic_q[13:0]; + assign tx_i_o = cordic_i[13:0]; + assign tx_q_o = cordic_q[13:0]; endmodule // radar_tx |