commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r4895 - in gnuradio/branches/developers/jcorgan/sar-fe


From: jcorgan
Subject: [Commit-gnuradio] r4895 - in gnuradio/branches/developers/jcorgan/sar-fe/gr-sar-fe/src/fpga: lib rbf/rev2 rbf/rev4 toplevel
Date: Thu, 5 Apr 2007 23:42:46 -0600 (MDT)

Author: jcorgan
Date: 2007-04-05 23:42:46 -0600 (Thu, 05 Apr 2007)
New Revision: 4895

Added:
   
gnuradio/branches/developers/jcorgan/sar-fe/gr-sar-fe/src/fpga/lib/cordic_nco.v
Modified:
   gnuradio/branches/developers/jcorgan/sar-fe/gr-sar-fe/src/fpga/lib/sar_tx.v
   
gnuradio/branches/developers/jcorgan/sar-fe/gr-sar-fe/src/fpga/rbf/rev2/usrp_sar.rbf
   
gnuradio/branches/developers/jcorgan/sar-fe/gr-sar-fe/src/fpga/rbf/rev4/usrp_sar.rbf
   
gnuradio/branches/developers/jcorgan/sar-fe/gr-sar-fe/src/fpga/toplevel/usrp_sar.qsf
Log:
Work in progress.  Implemented transmitter cordic-based NCO but have things 
running at half the rate they should be.

Added: 
gnuradio/branches/developers/jcorgan/sar-fe/gr-sar-fe/src/fpga/lib/cordic_nco.v
===================================================================
--- 
gnuradio/branches/developers/jcorgan/sar-fe/gr-sar-fe/src/fpga/lib/cordic_nco.v 
                            (rev 0)
+++ 
gnuradio/branches/developers/jcorgan/sar-fe/gr-sar-fe/src/fpga/lib/cordic_nco.v 
    2007-04-06 05:42:46 UTC (rev 4895)
@@ -0,0 +1,51 @@
+// -*- verilog -*-
+//
+//  USRP - Universal Software Radio Peripheral
+//
+//  Copyright (C) 2007 Corgan Enterprises LLC
+//
+//  This program is free software; you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation; either version 2 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 51 Franklin Street, Boston, MA  02110-1301  USA
+//
+
+module 
cordic_nco(clk_i,rst_i,ena_i,strobe_i,mag_i,freq_i,phs_i,data_i_o,data_q_o);
+   input clk_i;
+   input rst_i;
+   input ena_i;
+   input strobe_i;
+
+   input [15:0] mag_i;
+   input [31:0] freq_i;
+   input [31:0] phs_i;
+
+   output [15:0] data_i_o;
+   output [15:0] data_q_o;
+
+   reg [31:0] phase_reg;
+   wire [31:0] phase = phase_reg + phs_i;
+   
+   always @(posedge clk_i)
+     begin
+       if (rst_i | ~ena_i)
+         phase_reg <= 32'b0;
+       else if (strobe_i)
+         phase_reg <= phase_reg + freq_i;
+     end
+
+   cordic tx_cordic
+     (.clock(clk_i),.reset(rst_in),.enable(ena_i&strobe_i), 
+       .xi(mag_i),.yi(16'b0),.zi(phase[31:16]),
+       .xo(data_i_o),.yo(data_q_o),.zo());
+         
+endmodule // cordic_nco

Modified: 
gnuradio/branches/developers/jcorgan/sar-fe/gr-sar-fe/src/fpga/lib/sar_tx.v
===================================================================
--- gnuradio/branches/developers/jcorgan/sar-fe/gr-sar-fe/src/fpga/lib/sar_tx.v 
2007-04-06 05:36:21 UTC (rev 4894)
+++ gnuradio/branches/developers/jcorgan/sar-fe/gr-sar-fe/src/fpga/lib/sar_tx.v 
2007-04-06 05:42:46 UTC (rev 4895)
@@ -35,19 +35,20 @@
    output [15:0] tx_i_o;
    output [15:0] tx_q_o;
    output [15:0] debug_o;
+
+   // Full scale sine wave @ maximum frequency
+   wire [15:0]          mag   = 16'h7FFF;
+   wire [31:0]          freq  = 32'h7FFFFFFF;
+   wire [31:0]          phase = 32'b0;
+   wire [15:0]          data_i_o;
+   wire [15:0]          data_q_o;
    
-   reg [31:0]   counter;
+   cordic_nco 
nco(.clk_i(clk_i),.rst_i(rst_i),.ena_i(ena_i),.strobe_i(strobe_i),
+                 .mag_i(mag),.freq_i(freq),.phs_i(phase),
+                 .data_i_o(data_i_o),.data_q_o(data_q_o));
 
-   always @(posedge clk_i)
-     begin
-       if (rst_i | ~ena_i)
-         counter <= 16'b0;
-       else if (strobe_i)
-         counter = counter + 32'b1;
-     end
-   
-   assign tx_i_o = ena_i ? counter[15:0] : 16'b0;
-   assign tx_q_o = ena_i ? counter[31:16] : 16'b0;
+   assign tx_i_o = ena_i ? data_i_o : 16'b0;
+   assign tx_q_o = ena_i ? data_q_o : 16'b0;
    assign debug_o = 16'hAA55;
          
 endmodule // sar_tx

Modified: 
gnuradio/branches/developers/jcorgan/sar-fe/gr-sar-fe/src/fpga/rbf/rev2/usrp_sar.rbf
===================================================================
(Binary files differ)

Modified: 
gnuradio/branches/developers/jcorgan/sar-fe/gr-sar-fe/src/fpga/rbf/rev4/usrp_sar.rbf
===================================================================
(Binary files differ)

Modified: 
gnuradio/branches/developers/jcorgan/sar-fe/gr-sar-fe/src/fpga/toplevel/usrp_sar.qsf
===================================================================
--- 
gnuradio/branches/developers/jcorgan/sar-fe/gr-sar-fe/src/fpga/toplevel/usrp_sar.qsf
        2007-04-06 05:36:21 UTC (rev 4894)
+++ 
gnuradio/branches/developers/jcorgan/sar-fe/gr-sar-fe/src/fpga/toplevel/usrp_sar.qsf
        2007-04-06 05:42:46 UTC (rev 4895)
@@ -370,6 +370,9 @@
 
 set_instance_assignment -name PARTITION_HIERARCHY no_file_for_top_partition 
-to | -section_id Top
 set_global_assignment -name PARTITION_NETLIST_TYPE SOURCE -section_id Top
+set_global_assignment -name VERILOG_FILE 
../../../../usrp/fpga/sdr_lib/cordic_stage.v
+set_global_assignment -name VERILOG_FILE ../../../../usrp/fpga/sdr_lib/cordic.v
+set_global_assignment -name VERILOG_FILE ../lib/cordic_nco.v
 set_global_assignment -name VERILOG_FILE ../lib/sar_rx.v
 set_global_assignment -name VERILOG_FILE ../lib/sar_tx.v
 set_global_assignment -name VERILOG_FILE 
../../../../usrp/fpga/sdr_lib/rx_buffer.v





reply via email to

[Prev in Thread] Current Thread [Next in Thread]