commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r5094 - in gnuradio/branches/developers/jcorgan/snd/gr


From: jcorgan
Subject: [Commit-gnuradio] r5094 - in gnuradio/branches/developers/jcorgan/snd/gr-sounder/src: fpga/lib fpga/rbf/rev2 fpga/rbf/rev4 fpga/top python
Date: Mon, 23 Apr 2007 21:27:26 -0600 (MDT)

Author: jcorgan
Date: 2007-04-23 21:27:26 -0600 (Mon, 23 Apr 2007)
New Revision: 5094

Modified:
   
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/lfsr_constants.v
   gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder.v
   gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder_rx.v
   gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder_tx.v
   
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/rbf/rev2/usrp_sounder.rbf
   
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/rbf/rev4/usrp_sounder.rbf
   gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/config.vh
   
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/usrp_sounder.v
   
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/python/usrp_sounder.py
Log:
Work in progress, initial receiver, not tested.

Modified: 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/lfsr_constants.v
===================================================================
--- 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/lfsr_constants.v
   2007-04-24 00:31:27 UTC (rev 5093)
+++ 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/lfsr_constants.v
   2007-04-24 03:27:26 UTC (rev 5094)
@@ -24,7 +24,7 @@
    output reg  [15:0] mask_o;
    output wire [15:0] len_o;
    
-   assign len_o = 16'b1 << degree_i - 1;
+   assign len_o = (16'b1 << degree_i) - 1;
 
    always @*
      case (degree_i)

Modified: 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder.v
===================================================================
--- gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder.v  
2007-04-24 00:31:27 UTC (rev 5093)
+++ gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder.v  
2007-04-24 03:27:26 UTC (rev 5094)
@@ -23,8 +23,9 @@
 `include "../../../../usrp/firmware/include/fpga_regs_standard.v"
 
 module 
sounder(clk_i,saddr_i,sdata_i,s_strobe_i,tx_rst_i,tx_enable_i,tx_strobe_i,
-              
tx_dac_i_o,tx_dac_q_o,tx_debug_o,rx_rst_i,rx_enable_i,rx_strobe_o,
-              rx_adc_i_i,rx_adc_q_i,rx_imp_i_o,rx_imp_q_o,rx_debug_o);
+              tx_dac_i_o,tx_dac_q_o,
+              rx_rst_i,rx_enable_i,rx_strobe_i,rx_strobe_o,
+              rx_adc_i_i,rx_adc_q_i,rx_imp_i_o,rx_imp_q_o);
 
    // System interface
    input         clk_i;                // Master clock @ 64 MHz
@@ -38,17 +39,16 @@
    input         tx_strobe_i;  // Generate an transmitter output sample
    output [15:0] tx_dac_i_o;   // I channel transmitter output to DAC
    output [15:0] tx_dac_q_o;    // Q channel transmitter output to DAC
-   output [15:0] tx_debug_o;    // Transmitter subsystem debugger bus
 
    // Receive subsystem
    input        rx_rst_i;      // Independent subsystem reset
    input        rx_enable_i;   // Turn on receiver functionality
+   input         rx_strobe_i;  // Indicates receive sample ready from ADC
    output       rx_strobe_o;   // Indicates output samples ready for Rx FIFO
    input  [15:0] rx_adc_i_i;   // I channel input from ADC
    input  [15:0] rx_adc_q_i;   // Q channel input from ADC
    output [15:0] rx_imp_i_o;   // I channel impulse response to Rx FIFO
    output [15:0] rx_imp_q_o;   // Q channel impulse response to Rx FIFO
-   output [15:0] rx_debug_o;   // Receive subsystem debugger bus
 
    wire   [4:0]  degree;       // LFSR register length
    wire   [15:0] mask;         // LFSR parity mask
@@ -61,12 +61,13 @@
    
    sounder_tx transmitter
      ( 
.clk_i(clk_i),.rst_i(tx_rst_i),.ena_i(tx_enable_i),.strobe_i(tx_strobe_i),.mask_i(mask),
-       .tx_i_o(tx_dac_i_o),.tx_q_o(tx_dac_q_o),.debug_o(tx_debug_o) );
+       .tx_i_o(tx_dac_i_o),.tx_q_o(tx_dac_q_o) );
    
    sounder_rx receiver
-     ( 
.clk_i(clk_i),.rst_i(rx_rst_i),.ena_i(rx_enable_i),.strobe_i(1'b1),.rx_in_i_i(rx_adc_i_i),
-       
.rx_in_q_i(rx_adc_q_i),.rx_i_o(rx_imp_i_o),.rx_q_o(rx_imp_q_o),.rx_strobe_o(rx_strobe_o),
-       .debug_o(rx_debug_o));
+     ( .clk_i(clk_i),.rst_i(rx_rst_i),.ena_i(rx_enable_i),
+       
.rx_strobe_i(rx_strobe_i),.tx_strobe_i(tx_strobe_i),.mask_i(mask),.len_i(len),
+       
.rx_in_i_i(rx_adc_i_i),.rx_in_q_i(rx_adc_q_i),.rx_i_o(rx_imp_i_o),.rx_q_o(rx_imp_q_o),
+       .rx_strobe_o(rx_strobe_o) );
    
 endmodule // sounder
 

Modified: 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder_rx.v
===================================================================
--- 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder_rx.v   
    2007-04-24 00:31:27 UTC (rev 5093)
+++ 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder_rx.v   
    2007-04-24 03:27:26 UTC (rev 5094)
@@ -19,42 +19,63 @@
 //  Foundation, Inc., 51 Franklin Street, Boston, MA  02110-1301  USA
 //
 
-module 
sounder_rx(clk_i,rst_i,ena_i,strobe_i,rx_in_i_i,rx_in_q_i,rx_i_o,rx_q_o,rx_strobe_o,debug_o);
-   input clk_i;
-   input rst_i;
-   input ena_i;
-   input strobe_i;
+module sounder_rx(clk_i,rst_i,ena_i,rx_strobe_i,tx_strobe_i,mask_i,len_i,
+                 rx_in_i_i,rx_in_q_i,rx_i_o,rx_q_o,rx_strobe_o);
+   
+   input         clk_i;                // Master clock
+   input         rst_i;         // Subsystem reset
+   input         ena_i;                // Subsystem enable
+   input         rx_strobe_i;   // Strobe every received sample
+   input         tx_strobe_i;  // Strobe every transmitted sample
+    
+   input  [15:0] mask_i;       // PN code LFSR mask
+   input  [15:0] len_i;                // PN code LFSR sequence length
+   input  [15:0] rx_in_i_i;    // I channel on receive
+   input  [15:0] rx_in_q_i;    // Q channel on receive
 
-   input [15:0] rx_in_i_i;
-   input [15:0] rx_in_q_i;
+   output [15:0] rx_i_o;       // I channel of impulse response
+   output [15:0] rx_q_o;       // Q channel of impulse response
+   output        rx_strobe_o;   // Impulse response value ready
 
-   output [15:0] rx_i_o;
-   output [15:0] rx_q_o;
-   output rx_strobe_o;
-   output [15:0] debug_o;
+   // LFSR phase counter
+   reg [15:0] count;
+   wire cycle = (count == (len_i - 1));
 
-   // Just count up for debugging
-   reg [31:0] counter;
+   always @(posedge clk_i)
+     if (rst_i | ~ena_i)
+       count <= 16'b0;
+     else
+       if (cycle)
+        count <= 16'b0;
+       else
+        count <= count + 16'b1;
+           
+   // Retard LFSR phase once per cycle
+   wire lfsr_strobe = (tx_strobe_i & ~cycle);
 
+   // Recreate local reference of transmitted PN code
+   wire pn;
+   lfsr reference
+     ( 
.clk_i(clk_i),.rst_i(rst_i),.ena_i(ena_i),.strobe_i(lfsr_strobe),.mask_i(mask_i),.pn_o(pn)
 );
+
+
+   reg [31:0] accum;
    always @(posedge clk_i)
-     begin
-       if (rst_i | ~ena_i)
-         counter <= 32'b0;
-       else if (strobe_i & rx_strobe_o)
-         counter <= counter + 32'b1;
-     end
+     if (rst_i | ~ena_i)
+       accum <= 32'b0;
+     else
+       if (rx_strobe_i)
+        if (cycle)
+          accum <= 32'b0;
+        else
+          if (pn)
+            accum <= accum + rx_in_i_i;
+          else
+            accum <= accum - rx_in_i_i;
+   
+   assign rx_i_o = accum[31:16];
+   assign rx_q_o = accum[15:0];
+   assign rx_strobe_o = rx_strobe_i & cycle;
 
-   assign rx_i_o = ena_i ? counter[31:16] : 16'b0;
-   assign rx_q_o = ena_i ? counter[15:0] : 16'b0;
-   assign debug_o = 16'hAA55;
-   
-   // Temporarily we duplicate what master_control.v did to generate 
decim_strobe
-   // so we can do receive debugging. Later we'll drive rx_strobe_o in bursts 
to
-   // load receiver data into the rx fifo.
-   strobe_gen rx_strobe_gen
-       ( .clock(clk_i),.reset(rst_i),.enable(ena_i),.rate(8),
-      .strobe_in(strobe_i),.strobe(rx_strobe_o)
-         );
-   
 endmodule // sounder_rx
 

Modified: 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder_tx.v
===================================================================
--- 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder_tx.v   
    2007-04-24 00:31:27 UTC (rev 5093)
+++ 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/lib/sounder_tx.v   
    2007-04-24 03:27:26 UTC (rev 5094)
@@ -25,7 +25,7 @@
 `define MAX_VALUE 16'h7FFF // 2s complement
 `define MIN_VALUE 16'h8000
 
-module sounder_tx(clk_i,rst_i,ena_i,strobe_i,mask_i,tx_i_o,tx_q_o,debug_o);
+module sounder_tx(clk_i,rst_i,ena_i,strobe_i,mask_i,tx_i_o,tx_q_o);
    input         clk_i;
    input         rst_i;
    input         ena_i;
@@ -33,7 +33,6 @@
    input  [15:0] mask_i;
    output [15:0] tx_i_o;
    output [15:0] tx_q_o;
-   output [15:0] debug_o;
 
    wire          pn;
 
@@ -43,7 +42,4 @@
    assign tx_i_o = pn ? `MAX_VALUE : `MIN_VALUE; // Bipolar
    assign tx_q_o = 16'b0;
 
-   // Temporary
-   assign debug_o = 16'hAA55;
-         
 endmodule // sounder_tx

Modified: 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/rbf/rev2/usrp_sounder.rbf
===================================================================
(Binary files differ)

Modified: 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/rbf/rev4/usrp_sounder.rbf
===================================================================
(Binary files differ)

Modified: 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/config.vh
===================================================================
--- gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/config.vh  
2007-04-24 00:31:27 UTC (rev 5093)
+++ gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/config.vh  
2007-04-24 03:27:26 UTC (rev 5094)
@@ -18,7 +18,5 @@
 //  along with this program; if not, write to the Free Software
 //  Foundation, Inc., 51 Franklin Street, Boston, MA  02110-1301  USA
 //
-
 // Uncomment to enable 64 MHz Tx clock, otherwise 32 MHz
 //`define TX_RATE_MAX
-

Modified: 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/usrp_sounder.v
===================================================================
--- 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/usrp_sounder.v 
    2007-04-24 00:31:27 UTC (rev 5093)
+++ 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/fpga/top/usrp_sounder.v 
    2007-04-24 03:27:26 UTC (rev 5094)
@@ -3,7 +3,6 @@
 //  USRP - Universal Software Radio Peripheral
 //
 //  Copyright (C) 2003,2004 Matt Ettus
-//  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
@@ -20,6 +19,14 @@
 //  Foundation, Inc., 51 Franklin Street, Boston, MA  02110-1301  USA
 //
 
+// Top level module for a full setup with DUCs and DDCs
+
+// Define DEBUG_OWNS_IO_PINS if we're using the daughterboard i/o pins
+// for debugging info.  NB, This can kill the m'board and/or d'board if you
+// have anything except basic d'boards installed.
+
+// Uncomment the following to include optional circuitry
+
 `include "config.vh"
 
 module usrp_sounder
@@ -34,15 +41,14 @@
  output FX2_2,
  output FX2_3,
  
- // ADC bus
  input wire [11:0] rx_a_a,
  input wire [11:0] rx_b_a,
  input wire [11:0] rx_a_b,
  input wire [11:0] rx_b_b,
 
- // DAC bus
  output wire [13:0] tx_a,
  output wire [13:0] tx_b,
+
  output wire TXSYNC_A,
  output wire TXSYNC_B,
  
@@ -61,9 +67,9 @@
    wire [15:0] debugdata,debugctrl;
    assign MYSTERY_SIGNAL = 1'b0;
    
-   wire clk64;
+   wire clk64,clk128;
    
-   wire WR = usbctl[0]; // Not used
+   wire WR = usbctl[0];
    wire RD = usbctl[1];
    wire OE = usbctl[2];
 
@@ -71,98 +77,103 @@
    assign usbrdy[0] = 1'b0; // have_space;
    assign usbrdy[1] = have_pkt_rdy;
 
-   wire   rx_overrun;    
+   wire   tx_underrun, rx_overrun;    
    wire   clear_status = FX2_1;
    assign FX2_2 = rx_overrun;
-   assign FX2_3 = 1'b0; // tx_underrun;
+   assign FX2_3 = tx_underrun;
       
    wire [15:0] usbdata_out;
-
+   
+   wire [3:0]  dac0mux,dac1mux,dac2mux,dac3mux;
+   
+   wire        tx_realsignals;
    wire [3:0]  rx_numchan;
    wire [2:0]  tx_numchan;
-
+   
    wire [7:0]  interp_rate, decim_rate;
    wire [15:0] tx_debugbus, rx_debugbus;
    
    wire        enable_tx, enable_rx;
    wire        tx_dsp_reset, rx_dsp_reset, tx_bus_reset, rx_bus_reset;
+   wire [7:0]  settings;
    
    // Tri-state bus macro
    bustri bustri( .data(usbdata_out),.enabledt(OE),.tridata(usbdata) );
 
    assign      clk64 = master_clk;
+
+   wire [15:0] ch0tx,ch1tx,ch2tx,ch3tx; //,ch4tx,ch5tx,ch6tx,ch7tx;
+   wire [15:0] ch0rx,ch1rx,ch2rx,ch3rx,ch4rx,ch5rx,ch6rx,ch7rx;
+   
+   // TX
+   wire [15:0] i_out_0,i_out_1,q_out_0,q_out_1;
+   wire [15:0] bb_tx_i0,bb_tx_q0,bb_tx_i1,bb_tx_q1;  // 
bb_tx_i2,bb_tx_q2,bb_tx_i3,bb_tx_q3;
+   
    wire        strobe_interp, tx_sample_strobe;
-   wire        strobe_decim, rx_sample_strobe;
    wire        tx_empty;
    
    wire        serial_strobe;
    wire [6:0]  serial_addr;
    wire [31:0] serial_data;
+
+   reg [15:0] debug_counter;
+   reg [15:0] loopback_i_0,loopback_q_0;
    
    
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Transmit Side
-
+   
    wire [15:0] tx_i, tx_q;
-   wire [15:0] tx_data;
-   wire [15:0] tx_debug;
+   wire [15:0] tx_dac;
+   
+   dac_interface dac(.clk_i(clk64),.rst_i(tx_dsp_reset),.ena_i(enable_tx),
+                    .strobe_i(tx_sample_strobe),.tx_i_i(tx_i),.tx_q_i(tx_q),
+                    .tx_data_o(tx_dac),.tx_sync_o(TXSYNC_A));
 
-   wire        tx_strobe;
-`ifdef TX_RATE_MAX
-   assign      tx_strobe = 1'b1;
-`else
-   assign      tx_strobe = tx_sample_strobe; // Generated by master_control, 
every other clock
-`endif
+   assign tx_a = tx_dac[15:2];
 
-   dac_interface 
dac_interface(.clk_i(clk64),.rst_i(tx_dsp_reset),.ena_i(enable_tx),.strobe_i(tx_strobe),
-                              
.tx_i_i(tx_i),.tx_q_i(tx_q),.tx_data_o(tx_data),.tx_sync_o(TXSYNC_A));
-
-   assign tx_a = tx_data[15:2];
+   // Wedge DAC #2 at zero
+   assign TXSYNC_B = 1'b0;
    assign tx_b = 14'b0;
-   assign TXSYNC_B = 1'b0;
    
    
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Receive Side
-
-   wire [31:0] rssi_i,rssi_q;
-   wire [15:0] rx_in_i,rx_in_q;
-
-   adc_interface 
adc_interface(.clock(clk64),.reset(rx_dsp_reset),.enable(1'b1),
+   wire        rx_sample_strobe, rx_strobe;
+   wire [15:0] rx_adc0_i, rx_adc0_q;
+   wire [15:0] rx_buf_i, rx_buf_q;
+   
+   adc_interface 
adc_interface(.clock(clk64),.reset(rx_dsp_reset),.enable(enable_rx),
                               
.serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
-                              
.rx_a_a(rx_a_a),.rx_b_a(rx_b_a),.rx_a_b(rx_a_b),.rx_b_b(rx_b_b),
-                              
.rssi_0(rssi_i),.rssi_1(rssi_q),.rssi_2(),.rssi_3(),
-                              .ddc0_in_i(rx_in_i),.ddc0_in_q(rx_in_q),
+                              
.rx_a_a(rx_a_a),.rx_b_a(rx_b_a),.rx_a_b(),.rx_b_b(),
+                              .rssi_0(),.rssi_1(),.rssi_2(),.rssi_3(),
+                              .ddc0_in_i(rx_adc0_i),.ddc0_in_q(rx_adc0_q),
                               .ddc1_in_i(),.ddc1_in_q(),
                               .ddc2_in_i(),.ddc2_in_q(),
-                              
.ddc3_in_i(),.ddc3_in_q(),.rx_numchan(rx_numchan));
+                              
.ddc3_in_i(),.ddc3_in_q(),.rx_numchan(rx_numchan) );
 
-   wire [15:0] rx_i, rx_q;
-   wire        rx_strobe;
-   wire [15:0] rx_debug;
-
    rx_buffer rx_buffer
      ( .usbclk(usbclk),.bus_reset(rx_bus_reset),.reset(rx_dsp_reset),
        .reset_regs(rx_dsp_reset),
        
.usbdata(usbdata_out),.RD(RD),.have_pkt_rdy(have_pkt_rdy),.rx_overrun(rx_overrun),
        .channels(rx_numchan),
-       .ch_0(rx_i),.ch_1(rx_q),
+       .ch_0(rx_buf_i),.ch_1(rx_buf_q),
        .ch_2(),.ch_3(),
        .ch_4(),.ch_5(),
        .ch_6(),.ch_7(),
        .rxclk(clk64),.rxstrobe(rx_strobe),
        .clear_status(clear_status),
        
.serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
-       .debugbus());
+       .debugbus(rx_debugbus) );
+   
 
-
    
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-   // Application Section
+   // Top level application
 
    sounder sounder
      ( 
.clk_i(clk64),.saddr_i(serial_addr),.sdata_i(serial_data),.s_strobe_i(serial_strobe),
-       .tx_rst_i(tx_dsp_reset),.tx_enable_i(enable_tx),.tx_strobe_i(tx_strobe),
-       .tx_dac_i_o(tx_i),.tx_dac_q_o(tx_q),.tx_debug_o(tx_debug),
-       .rx_rst_i(rx_dsp_reset),.rx_enable_i(enable_rx),.rx_strobe_o(rx_strobe),
-       
.rx_adc_i_i(rx_in_i),.rx_adc_q_i(rx_in_q),.rx_imp_i_o(rx_i),.rx_imp_q_o(rx_q),.rx_debug_o(rx_debug)
+       
.tx_rst_i(tx_dsp_reset),.tx_enable_i(enable_tx),.tx_strobe_i(tx_sample_strobe),
+       .tx_dac_i_o(tx_i),.tx_dac_q_o(tx_q),
+       
.rx_rst_i(rx_dsp_reset),.rx_enable_i(enable_rx),.rx_strobe_i(rx_sample_strobe),.rx_strobe_o(rx_strobe),
+       
.rx_adc_i_i(rx_adc0_i),.rx_adc_q_i(rx_adc0_q),.rx_imp_i_o(rx_buf_i),.rx_imp_q_o(rx_buf_q)
        );
 
    
@@ -170,17 +181,17 @@
    // Control Functions
 
    wire [31:0] capabilities;
-   assign      capabilities[7]   = 1'b0;       // `TX_CAP_HB;
-   assign      capabilities[6:4] = 3'd2;       // `TX_CAP_NCHAN;
-   assign      capabilities[3]   = 1'b0;       // `RX_CAP_HB;
-   assign      capabilities[2:0] = 3'd2;       // `RX_CAP_NCHAN;
+   assign      capabilities[7]   = 0;  // `TX_CAP_HB;
+   assign      capabilities[6:4] = 2;  // `TX_CAP_NCHAN;
+   assign      capabilities[3]   = 0;  // `RX_CAP_HB;
+   assign      capabilities[2:0] = 2;  // `RX_CAP_NCHAN;
 
    serial_io serial_io
      ( .master_clk(clk64),.serial_clock(SCLK),.serial_data_in(SDI),
        .enable(SEN_FPGA),.reset(1'b0),.serial_data_out(SDO),
        
.serial_addr(serial_addr),.serial_data(serial_data),.serial_strobe(serial_strobe),
        
.readback_0({io_rx_a,io_tx_a}),.readback_1({io_rx_b,io_tx_b}),.readback_2(capabilities),.readback_3(32'hf0f0931a),
-       .readback_4(rssi_i),.readback_5(rssi_q),.readback_6(),.readback_7()
+       .readback_4(),.readback_5(),.readback_6(),.readback_7()
        );
 
    wire [15:0] reg_0,reg_1,reg_2,reg_3;
@@ -192,10 +203,11 @@
        .enable_tx(enable_tx),.enable_rx(enable_rx),
        .interp_rate(interp_rate),.decim_rate(decim_rate),
        .tx_sample_strobe(tx_sample_strobe),.strobe_interp(strobe_interp),
-       .rx_sample_strobe(rx_sample_strobe),.strobe_decim(), // Note we don't 
use the strobe_decim output from here
+       .rx_sample_strobe(rx_sample_strobe),.strobe_decim(strobe_decim),
        .tx_empty(tx_empty),
-       .debug_0(),.debug_1(),.debug_2(tx_debug),.debug_3(rx_debug),
-       .reg_0(reg_0),.reg_1(reg_1),.reg_2(reg_2),.reg_3(reg_3));
+       .debug_0(),.debug_1(),
+       .debug_2(),.debug_3(),
+       .reg_0(reg_0),.reg_1(reg_1),.reg_2(reg_2),.reg_3(reg_3) );
    
    io_pins io_pins
      (.io_0(io_tx_a),.io_1(io_rx_a),.io_2(io_tx_b),.io_3(io_rx_b),

Modified: 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/python/usrp_sounder.py
===================================================================
--- 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/python/usrp_sounder.py  
    2007-04-24 00:31:27 UTC (rev 5093)
+++ 
gnuradio/branches/developers/jcorgan/snd/gr-sounder/src/python/usrp_sounder.py  
    2007-04-24 03:27:26 UTC (rev 5094)
@@ -40,7 +40,7 @@
         self.subdev = usrp.selected_subdev(self.trans, self.subdev_spec)
         self.trans.tune(0, self.subdev, frequency)
         self.set_degree(degree);
-        
+               
     def turn_on(self):
        self.trans.start()
        
@@ -51,7 +51,7 @@
         return self.trans._write_fpga_reg(usrp.FR_USER_0, value);
 
 class sounder_rx:
-    def __init__(self, frequency, degree):
+    def __init__(self, frequency, degree, samples):
         self.fg = gr.flow_graph()
        self.rcvr = usrp.source_s(fpga_filename='usrp_sounder.rbf', 
decim_rate=8)
         self.subdev_spec = usrp.pick_rx_subdevice(self.rcvr)
@@ -59,8 +59,13 @@
         self.rcvr.tune(0, self.subdev, frequency)
         self.set_degree(degree);
        self.sink = gr.file_sink(gr.sizeof_short, "output.dat")
-        self.fg.connect(self.rcvr, self.sink)
 
+       if samples >= 0:
+           self.head = gr.head(gr.sizeof_short, 2*samples*gr.sizeof_short)
+           self.fg.connect(self.rcvr, self.head, self.sink)
+       else:
+           self.fg.connect(self.rcvr, self.sink)
+
     def receive(self):
        self.fg.run()
        
@@ -81,6 +86,9 @@
     parser.add_option("-d", "--degree", type="int", default=16,
                       help="set souding sequence degree (len=2^degree-1), 
default is %default")
 
+    parser.add_option("-n", "--samples", type="int", default=-1,
+                      help="number of samples to capture on receive, default 
is infinite")
+
     (options, args) = parser.parse_args()
 
     if len(args) != 0 or not (options.transmit | options.receive):
@@ -98,7 +106,7 @@
     try:
         if (options.receive):
            print "Enabling sounder receiver."
-           rx = sounder_rx(options.frequency, options.degree)
+           rx = sounder_rx(options.frequency, options.degree, options.samples)
            rx.receive()
        else:
            if (options.transmit):





reply via email to

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