commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r8026 - in gnuradio/branches/features/inband-usb/usrp/


From: gnychis
Subject: [Commit-gnuradio] r8026 - in gnuradio/branches/features/inband-usb/usrp/fpga: inband_lib rbf/rev2 rbf/rev4 toplevel/usrp_inband_usb
Date: Fri, 14 Mar 2008 14:42:42 -0600 (MDT)

Author: gnychis
Date: 2008-03-14 14:42:41 -0600 (Fri, 14 Mar 2008)
New Revision: 8026

Removed:
   gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/data_packet_fifo.v
   gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/usb_fifo_reader.v
   gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/usb_fifo_writer.v
Modified:
   gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/chan_fifo_reader.v
   gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/cmd_reader.v
   gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/packet_builder.v
   gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/rx_buffer_inband.v
   gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/tx_buffer_inband.v
   gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev2/inband_1rxhb_1tx.rbf
   gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev2/inband_2rxhb_2tx.rbf
   gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev4/inband_1rxhb_1tx.rbf
   gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev4/inband_2rxhb_2tx.rbf
   
gnuradio/branches/features/inband-usb/usrp/fpga/toplevel/usrp_inband_usb/usrp_inband_usb.v
Log:
merging -r7917:8025 from gnychis/fpga for proper timestamping on incoming 
packets and having TX/RX use the same clock, rather than use the decimation and 
interpolation rate.

Modified: 
gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/chan_fifo_reader.v
===================================================================
--- 
gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/chan_fifo_reader.v   
    2008-03-14 18:29:25 UTC (rev 8025)
+++ 
gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/chan_fifo_reader.v   
    2008-03-14 20:42:41 UTC (rev 8026)
@@ -1,12 +1,12 @@
 module chan_fifo_reader 
-   (reset, tx_clock, tx_strobe, adc_time, samples_format,
+   (reset, tx_clock, tx_strobe, timestamp_clock, samples_format,
     fifodata, pkt_waiting, rdreq, skip, tx_q, tx_i,
     underrun, tx_empty, debug, rssi, threshhold, rssi_wait) ;
 
    input   wire                     reset ;
    input   wire                     tx_clock ;
    input   wire                     tx_strobe ; //signal to output tx_i and 
tx_q
-   input   wire              [31:0] adc_time ; //current time
+   input   wire              [31:0] timestamp_clock ; //current time
    input   wire               [3:0] samples_format ;// not useful at this point
    input   wire              [31:0] fifodata ; //the data input
    input   wire                     pkt_waiting ; //signal the next packet is 
ready
@@ -23,10 +23,6 @@
    output wire [14:0] debug;
    assign debug = {7'd0, rdreq, skip, reader_state, pkt_waiting, tx_strobe, 
tx_clock};
    
-   // Should not be needed if adc clock rate < tx clock rate
-   // Used only to debug
-   `define JITTER                   5
-    
    //Samples format
    // 16 bits interleaved complex samples
    `define QI16                     4'b0
@@ -146,7 +142,7 @@
                     
                    time_wait <= time_wait + 32'd1;
                    // Outdated
-                   if ((timestamp < adc_time) ||
+                   if ((timestamp < timestamp_clock) ||
                       (time_wait >= rssi_wait && rssi_wait != 0 && rssi_flag))
                      begin
                        trash <= 1;
@@ -154,8 +150,8 @@
                        skip <= 1;
                      end  
                    // Let's send it                                    
-                   else if ((timestamp <= adc_time + `JITTER 
-                             && timestamp > adc_time)
+                   else if ((timestamp <= timestamp_clock 
+                             && timestamp > timestamp_clock)
                              || timestamp == 32'hFFFFFFFF)
                      begin
                        if (rssi <= threshhold || rssi_flag == 0)

Modified: 
gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/cmd_reader.v
===================================================================
--- gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/cmd_reader.v     
2008-03-14 18:29:25 UTC (rev 8025)
+++ gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/cmd_reader.v     
2008-03-14 20:42:41 UTC (rev 8026)
@@ -1,6 +1,6 @@
 module cmd_reader
    (//System
-    input reset, input txclk, input [31:0] adc_time,
+    input reset, input txclk, input [31:0] timestamp_clock,
     //FX2 Side
     output reg skip, output reg rdreq, 
     input [31:0] fifodata, input pkt_waiting,
@@ -96,15 +96,15 @@
           WAIT : 
             begin
               // Let's send it
-              if ((value0 <= adc_time + `JITTER 
-                 && value0 > adc_time)
+              if ((value0 <= timestamp_clock + `JITTER 
+                 && value0 > timestamp_clock)
                  || value0 == 32'hFFFFFFFF)
                   state <= TEST;
               // Wait a little bit more
-              else if (value0 > adc_time + `JITTER)
+              else if (value0 > timestamp_clock + `JITTER)
                   state <= WAIT; 
               // Outdated
-              else if (value0 < adc_time)
+              else if (value0 < timestamp_clock)
                 begin
                   state <= IDLE;
                   skip <= 1;

Deleted: 
gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/data_packet_fifo.v

Modified: 
gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/packet_builder.v
===================================================================
--- gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/packet_builder.v 
2008-03-14 18:29:25 UTC (rev 8025)
+++ gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/packet_builder.v 
2008-03-14 20:42:41 UTC (rev 8026)
@@ -2,7 +2,7 @@
     // System
     input rxclk,
     input reset,
-        input [31:0] adctime,
+        input [31:0] timestamp_clock,
         input [3:0] channels,
     // ADC side
     input [15:0]chan_fifodata,
@@ -43,7 +43,7 @@
     reg [2:0] state;
     reg [8:0] read_length;
     reg [8:0] payload_len;
-    reg tstamp_complete;
+    reg timestamp_complete;
     reg [3:0] check_next;
        
     wire [31:0] true_rssi;
@@ -68,7 +68,7 @@
             WR <= 0;
             rd_select <= 0;
             chan_rdreq <= 0;
-            tstamp_complete <= 0;
+            timestamp_complete <= 0;
             check_next <= 0;
             state <= `IDLE;
           end
@@ -119,13 +119,13 @@
             end
             
             `TIMESTAMP: begin
-                fifodata <= #1 (tstamp_complete ? adctime[31:16] : 
adctime[15:0]);
-                tstamp_complete <= #1 ~tstamp_complete;
+                fifodata <= #1 (timestamp_complete ? timestamp_clock[31:16] : 
timestamp_clock[15:0]);
+                timestamp_complete <= #1 ~timestamp_complete;
                 
-                if (~tstamp_complete)
+                if (~timestamp_complete)
                     chan_rdreq <= #1 1;
                 
-                state <= #1 (tstamp_complete ? `FORWARD : `TIMESTAMP);
+                state <= #1 (timestamp_complete ? `FORWARD : `TIMESTAMP);
             end
             
             `FORWARD: begin

Modified: 
gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/rx_buffer_inband.v
===================================================================
--- 
gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/rx_buffer_inband.v   
    2008-03-14 18:29:25 UTC (rev 8025)
+++ 
gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/rx_buffer_inband.v   
    2008-03-14 20:42:41 UTC (rev 8026)
@@ -51,12 +51,12 @@
             read_count <= #1 RD ? read_count : 9'b0;
        
        // Time counter
-       reg [31:0] adctime;
+       reg [31:0] timestamp_clock;
        always @(posedge rxclk)
                if (reset)
-                       adctime <= 0;
-               else if (rxstrobe)
-                       adctime <= adctime + 1;
+                       timestamp_clock <= 0;
+               else
+                       timestamp_clock <= timestamp_clock + 1;
      
   // USB side fifo
   wire [11:0] rdusedw;
@@ -121,7 +121,7 @@
   packet_builder #(NUM_CHAN) rx_pkt_builer (
     .rxclk ( rxclk ),
     .reset ( reset ),
-    .adctime ( adctime ),
+    .timestamp_clock ( timestamp_clock ),
     .channels ( NUM_CHAN ),
     .chan_rdreq ( chan_rdreq ),
     .chan_fifodata ( chan_fifodata ),

Modified: 
gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/tx_buffer_inband.v
===================================================================
--- 
gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/tx_buffer_inband.v   
    2008-03-14 18:29:25 UTC (rev 8025)
+++ 
gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/tx_buffer_inband.v   
    2008-03-14 20:42:41 UTC (rev 8026)
@@ -36,7 +36,7 @@
    genvar i ;
     
    /* These will eventually be external register */
-   reg                  [31:0] adc_time ;
+   reg                  [31:0] timestamp_clock ;
    wire                 [7:0] txstrobe_rate [NUM_CHAN-1:0] ;
    wire                                [31:0] rssi [3:0];
    assign rssi[0] = rssi_0;
@@ -46,9 +46,9 @@
    
    always @(posedge txclk)
        if (reset)
-           adc_time <= 0;
-       else if (txstrobe)
-           adc_time <= adc_time + 1;
+           timestamp_clock <= 0;
+       else
+           timestamp_clock <= timestamp_clock + 1;
 
 
     /* Connections between tx_usb_fifo_reader and
@@ -126,7 +126,7 @@
 
        chan_fifo_reader tx_chan_reader 
        (.reset(reset), .tx_clock(txclk), .tx_strobe(txstrobe),
-        .adc_time(adc_time), .samples_format(4'b0),          
+        .timestamp_clock(timestamp_clock), .samples_format(4'b0),          
         .tx_q(tx_q[i]), .tx_i(tx_i[i]), .underrun(chan_underrun[i]),
         .skip(chan_skip[i]), .rdreq(chan_rdreq[i]),
         .fifodata(chan_fifodata[i]), .pkt_waiting(chan_pkt_waiting[i]),
@@ -143,7 +143,7 @@
     .RD(chan_rdreq[NUM_CHAN]), .RD_done(chan_skip[NUM_CHAN]));
 
    cmd_reader tx_cmd_reader
-   (.reset(reset), .txclk(txclk), .adc_time(adc_time), 
.skip(chan_skip[NUM_CHAN]),
+   (.reset(reset), .txclk(txclk), .timestamp_clock(timestamp_clock), 
.skip(chan_skip[NUM_CHAN]),
     .rdreq(chan_rdreq[NUM_CHAN]), .fifodata(chan_fifodata[NUM_CHAN]),
     .pkt_waiting(chan_pkt_waiting[NUM_CHAN]), .rx_databus(rx_databus),
     .rx_WR(rx_WR), .rx_WR_done(rx_WR_done), .rx_WR_enabled(rx_WR_enabled),

Deleted: 
gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/usb_fifo_reader.v

Deleted: 
gnuradio/branches/features/inband-usb/usrp/fpga/inband_lib/usb_fifo_writer.v

Modified: 
gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev2/inband_1rxhb_1tx.rbf
===================================================================
(Binary files differ)

Modified: 
gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev2/inband_2rxhb_2tx.rbf
===================================================================
(Binary files differ)

Modified: 
gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev4/inband_1rxhb_1tx.rbf
===================================================================
(Binary files differ)

Modified: 
gnuradio/branches/features/inband-usb/usrp/fpga/rbf/rev4/inband_2rxhb_2tx.rbf
===================================================================
(Binary files differ)

Modified: 
gnuradio/branches/features/inband-usb/usrp/fpga/toplevel/usrp_inband_usb/usrp_inband_usb.v
===================================================================
--- 
gnuradio/branches/features/inband-usb/usrp/fpga/toplevel/usrp_inband_usb/usrp_inband_usb.v
  2008-03-14 18:29:25 UTC (rev 8025)
+++ 
gnuradio/branches/features/inband-usb/usrp/fpga/toplevel/usrp_inband_usb/usrp_inband_usb.v
  2008-03-14 20:42:41 UTC (rev 8026)
@@ -456,9 +456,5 @@
    
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Misc Settings
    setting_reg #(`FR_MODE) 
sr_misc(.clock(clk64),.reset(rx_dsp_reset),.strobe(serial_strobe),.addr(serial_addr),.in(serial_data),.out(settings));
-   reg forb;
-   always @(posedge usbclk)
-     begin
-         if (strobe_db) forb <= 1;
-     end  
+
 endmodule // usrp_inband_usb





reply via email to

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