commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r10601 - in gnuradio/branches/releases/3.2: . debian g


From: jcorgan
Subject: [Commit-gnuradio] r10601 - in gnuradio/branches/releases/3.2: . debian gr-usrp/apps grc/data/platforms/python/blocks grc/freedesktop grc/scripts mblock/src/include/mblock usrp2/fpga/control_lib usrp2/fpga/sdr_lib usrp2/fpga/timing usrp2/host/apps/bitrot
Date: Sun, 15 Mar 2009 12:01:29 -0600 (MDT)

Author: jcorgan
Date: 2009-03-15 12:01:28 -0600 (Sun, 15 Mar 2009)
New Revision: 10601

Added:
   gnuradio/branches/releases/3.2/usrp2/fpga/control_lib/giantfifo.v
   gnuradio/branches/releases/3.2/usrp2/fpga/control_lib/giantfifo_tb.v
   gnuradio/branches/releases/3.2/usrp2/fpga/sdr_lib/med_hb_int.v
   gnuradio/branches/releases/3.2/usrp2/fpga/timing/time_64bit.v
Modified:
   gnuradio/branches/releases/3.2/
   gnuradio/branches/releases/3.2/debian/libgnuradio-core-dev.dirs
   gnuradio/branches/releases/3.2/debian/libgnuradio-core.dirs
   gnuradio/branches/releases/3.2/debian/libgnuradio-core.install
   gnuradio/branches/releases/3.2/debian/libgnuradio-omnithread-dev.dirs
   gnuradio/branches/releases/3.2/debian/libgnuradio-omnithread-dev.install
   gnuradio/branches/releases/3.2/debian/libgnuradio-omnithread.install
   gnuradio/branches/releases/3.2/debian/libmblock.install
   gnuradio/branches/releases/3.2/debian/libpmt-dev.install
   gnuradio/branches/releases/3.2/debian/libpmt.install
   gnuradio/branches/releases/3.2/debian/libusrp-inband.install
   gnuradio/branches/releases/3.2/debian/libusrp.dirs
   gnuradio/branches/releases/3.2/debian/libusrp.install
   gnuradio/branches/releases/3.2/debian/libusrp.postinst
   gnuradio/branches/releases/3.2/debian/libusrp.postrm
   gnuradio/branches/releases/3.2/debian/libusrp.udev
   gnuradio/branches/releases/3.2/gr-usrp/apps/
   gnuradio/branches/releases/3.2/gr-usrp/apps/usrp_rx_cfile.cc
   gnuradio/branches/releases/3.2/gr-usrp/apps/usrp_rx_cfile.h
   gnuradio/branches/releases/3.2/gr-usrp/apps/usrp_siggen.cc
   gnuradio/branches/releases/3.2/gr-usrp/apps/usrp_siggen.h
   
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/const_source_x.xml
   
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_probe.xml
   gnuradio/branches/releases/3.2/grc/freedesktop/gnuradio-usrp_probe.desktop
   gnuradio/branches/releases/3.2/grc/scripts/usrp2_probe
   gnuradio/branches/releases/3.2/grc/scripts/usrp_probe
   gnuradio/branches/releases/3.2/mblock/src/include/mblock/class_registry.h
   gnuradio/branches/releases/3.2/mblock/src/include/mblock/common.h
   gnuradio/branches/releases/3.2/mblock/src/include/mblock/exception.h
   gnuradio/branches/releases/3.2/mblock/src/include/mblock/mblock.h
   gnuradio/branches/releases/3.2/mblock/src/include/mblock/message.h
   gnuradio/branches/releases/3.2/mblock/src/include/mblock/msg_accepter.h
   gnuradio/branches/releases/3.2/mblock/src/include/mblock/msg_queue.h
   gnuradio/branches/releases/3.2/mblock/src/include/mblock/port.h
   gnuradio/branches/releases/3.2/mblock/src/include/mblock/protocol_class.h
   gnuradio/branches/releases/3.2/mblock/src/include/mblock/runtime.h
   gnuradio/branches/releases/3.2/mblock/src/include/mblock/time.h
   gnuradio/branches/releases/3.2/usrp2/fpga/control_lib/fifo_tb.v
   gnuradio/branches/releases/3.2/usrp2/host/apps/bitrot/rx_samples.cc
Log:
Applied changeset r10355:10359 from trunk to release-3.2 branch.


Property changes on: gnuradio/branches/releases/3.2
___________________________________________________________________
Added: svn:mergeinfo
   + /gnuradio/trunk:10356-10359


Property changes on: 
gnuradio/branches/releases/3.2/debian/libgnuradio-core-dev.dirs
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: gnuradio/branches/releases/3.2/debian/libgnuradio-core.dirs
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/debian/libgnuradio-core.install
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/debian/libgnuradio-omnithread-dev.dirs
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/debian/libgnuradio-omnithread-dev.install
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/debian/libgnuradio-omnithread.install
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: gnuradio/branches/releases/3.2/debian/libmblock.install
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: gnuradio/branches/releases/3.2/debian/libpmt-dev.install
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: gnuradio/branches/releases/3.2/debian/libpmt.install
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/debian/libusrp-inband.install
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: gnuradio/branches/releases/3.2/debian/libusrp.dirs
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: gnuradio/branches/releases/3.2/debian/libusrp.install
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: gnuradio/branches/releases/3.2/debian/libusrp.postinst
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: gnuradio/branches/releases/3.2/debian/libusrp.postrm
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: gnuradio/branches/releases/3.2/debian/libusrp.udev
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: gnuradio/branches/releases/3.2/gr-usrp/apps
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/gr-usrp/apps/usrp_rx_cfile.cc
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: gnuradio/branches/releases/3.2/gr-usrp/apps/usrp_rx_cfile.h
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: gnuradio/branches/releases/3.2/gr-usrp/apps/usrp_siggen.cc
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: gnuradio/branches/releases/3.2/gr-usrp/apps/usrp_siggen.h
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/const_source_x.xml
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/grc/data/platforms/python/blocks/usrp_probe.xml
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/grc/freedesktop/gnuradio-usrp_probe.desktop
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: gnuradio/branches/releases/3.2/grc/scripts/usrp2_probe
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: gnuradio/branches/releases/3.2/grc/scripts/usrp_probe
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/mblock/src/include/mblock/class_registry.h
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/mblock/src/include/mblock/common.h
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/mblock/src/include/mblock/exception.h
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/mblock/src/include/mblock/mblock.h
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/mblock/src/include/mblock/message.h
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/mblock/src/include/mblock/msg_accepter.h
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/mblock/src/include/mblock/msg_queue.h
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/mblock/src/include/mblock/port.h
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/mblock/src/include/mblock/protocol_class.h
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/mblock/src/include/mblock/runtime.h
___________________________________________________________________
Deleted: svn:mergeinfo
   - 


Property changes on: 
gnuradio/branches/releases/3.2/mblock/src/include/mblock/time.h
___________________________________________________________________
Deleted: svn:mergeinfo
   - 

Modified: gnuradio/branches/releases/3.2/usrp2/fpga/control_lib/fifo_tb.v
===================================================================
--- gnuradio/branches/releases/3.2/usrp2/fpga/control_lib/fifo_tb.v     
2009-03-14 20:53:00 UTC (rev 10600)
+++ gnuradio/branches/releases/3.2/usrp2/fpga/control_lib/fifo_tb.v     
2009-03-15 18:01:28 UTC (rev 10601)
@@ -125,6 +125,8 @@
        write <= 1;
        @(posedge clk);
        @(posedge clk);
+       @(posedge clk);
+       @(posedge clk);
        read <= 1;
        repeat (5)
          @(posedge clk);

Copied: gnuradio/branches/releases/3.2/usrp2/fpga/control_lib/giantfifo.v (from 
rev 10359, gnuradio/trunk/usrp2/fpga/control_lib/giantfifo.v)
===================================================================
--- gnuradio/branches/releases/3.2/usrp2/fpga/control_lib/giantfifo.v           
                (rev 0)
+++ gnuradio/branches/releases/3.2/usrp2/fpga/control_lib/giantfifo.v   
2009-03-15 18:01:28 UTC (rev 10601)
@@ -0,0 +1,209 @@
+
+
+
+module giantfifo
+  #(parameter WIDTH=36)
+    (input clk, input rst,
+     input [WIDTH-1:0] datain,
+     output [WIDTH-1:0] dataout,
+     input read,
+     input write,
+     input clear,
+     output full,
+     output empty,
+     output [15:0] space,
+     output [15:0] occupied,
+     
+     // External RAM
+     inout [17:0] RAM_D,
+     output reg [18:0] RAM_A,
+     output RAM_CE1n,
+     output RAM_CENn,
+     output reg RAM_CLK,
+     output reg RAM_WEn,
+     output RAM_OEn,
+     output RAM_LDn
+     );
+
+   wire [4:0] path1_occ, path2_space;
+   wire [35:0] path1_dat, path2_dat;
+   
+   shortfifo #(.WIDTH(WIDTH)) sf1
+     (.clk(clk),.rst(rst),.clear(clear),
+      .datain(datain),.write(write),.full(full),
+      .dataout(path1_dat),.read(path1_read),.empty(path1_empty),
+      .space(),.occupied(path1_occ) );
+   wire       path1_almost_empty = (path1_occ == 5'd1);
+   
+   shortfifo #(.WIDTH(WIDTH)) sf2
+     (.clk(clk),.rst(rst),.clear(clear),
+      .datain(path2_dat),.write(path2_write),.full(path2_full),
+      .dataout(dataout),.read(read),.empty(empty),
+      .space(path2_space),.occupied() );
+   wire       path2_almost_full = (path2_space == 5'd1);
+       
+   assign     RAM_CE1n = 1'b0;
+   assign     RAM_CENn = 1'b0;
+   always @(clk)
+     RAM_CLK <= #2 clk;
+   assign     RAM_LDn = 1'b0;
+
+   // State machine
+   wire       write_now, read_now, idle, phase;
+   reg               ram_full, ram_empty;
+   
+   reg [17:0] read_ptr, write_ptr;
+   reg [2:0]  zbt_state;
+
+   localparam ZBT_IDLE = 0;
+   localparam ZBT_WRITE_UPPER = 2;
+   localparam ZBT_WRITE_LOWER = 3;
+   localparam ZBT_READ_UPPER = 4;
+   localparam ZBT_READ_LOWER = 5;
+
+   wire       can_write = ~ram_full & ~path1_empty;
+   wire       can_write_chain = can_write & ~path1_almost_empty;
+
+   wire       can_read = ~ram_empty & ~path2_full;
+   wire       can_read_chain = can_read & ~path2_almost_full;
+   
+   assign     phase = zbt_state[0];
+
+   reg [17:0] ram_occupied;
+   wire       ram_almost_empty = (write_ptr == (read_ptr+1'b1));
+   wire       ram_almost_full = ((write_ptr+1'b1) == read_ptr);
+
+   always @(posedge clk)
+     if(rst | clear)
+       begin
+         zbt_state <= ZBT_IDLE;
+         write_ptr <= 0;
+         read_ptr <= 0;
+         ram_full <= 0;
+         ram_empty <= 1;
+         ram_occupied <= 0;
+       end
+     else
+       case(zbt_state)
+        ZBT_IDLE : 
+          if(can_read) 
+            zbt_state <= ZBT_READ_UPPER;
+          else if(can_write)
+            zbt_state <= ZBT_WRITE_UPPER;
+        
+        ZBT_WRITE_UPPER : 
+          begin
+             zbt_state <= ZBT_WRITE_LOWER;
+             ram_occupied <= ram_occupied + 1;
+             ram_empty <= 0;
+             if(ram_occupied == 18'd10)
+               ram_full <= 1;
+          end
+        ZBT_WRITE_LOWER : 
+          begin
+             write_ptr <= write_ptr + 1;
+             if(can_read_chain) 
+               zbt_state <= ZBT_READ_UPPER;
+             else if(can_write_chain)
+               zbt_state <= ZBT_WRITE_UPPER;
+             else
+               zbt_state <= ZBT_IDLE;
+          end
+        ZBT_READ_UPPER : 
+          begin
+             zbt_state <= ZBT_READ_LOWER;
+             ram_occupied <= ram_occupied - 1;
+             ram_full <= 0;
+             if(ram_occupied == 18'd1)
+               ram_empty <= 1;
+          end
+        ZBT_READ_LOWER :
+          begin
+             read_ptr <= read_ptr + 1;
+             if(can_read_chain) 
+               zbt_state <= ZBT_READ_UPPER;
+             else if(can_write_chain)
+               zbt_state <= ZBT_WRITE_UPPER;
+             else
+               zbt_state <= ZBT_IDLE;
+          end
+        default :
+          zbt_state <= ZBT_IDLE;
+       endcase // case(zbt_state)
+
+   // Need to generate RAM_WEn, RAM_OEn, RAM_D, RAM_A;
+   assign path1_read = (zbt_state == ZBT_WRITE_LOWER);
+   reg           path2_write, delayed_read_upper, delayed_read_lower, 
delayed_write;
+
+   always @(posedge clk)
+     if(delayed_read_upper)
+       path2_dat[35:18] <= RAM_D;
+   always @(posedge clk)
+     if(delayed_read_lower)
+       path2_dat[17:0] <= RAM_D;
+
+   always @(posedge clk)
+     if(rst)
+       begin
+         delayed_read_upper <= 0;
+         delayed_read_lower <= 0;
+         path2_write <= 0;
+       end
+     else 
+       begin
+         delayed_read_upper <= (zbt_state == ZBT_READ_LOWER);
+         delayed_read_lower <= delayed_read_upper;
+         path2_write <= delayed_read_lower;
+       end
+   
+   reg [17:0] RAM_D_pre2, RAM_D_pre1, RAM_D_out;
+   
+   always @(posedge clk)
+     RAM_D_pre2 <= phase ? path1_dat[17:0] : path1_dat[35:18];
+
+   always @(posedge clk)  RAM_D_pre1 <= RAM_D_pre2;
+   always @(posedge clk)  RAM_D_out <= RAM_D_pre1;
+   reg               wr_del_1, wr_del_2;             
+   always @(posedge clk)
+     if(rst)
+       begin
+         wr_del_1 <= 0;          
+         wr_del_2 <= 0;
+         delayed_write <= 0;
+       end
+     else
+       begin
+         delayed_write <= wr_del_2;
+         wr_del_2 <= wr_del_1;
+         wr_del_1 <= write_now;
+       end
+
+   reg delayed_read, rd_del_1, rd_del_2;
+   always @(posedge clk)
+     if(rst)
+       begin
+         rd_del_1 <= 0;          
+         rd_del_2 <= 0;
+         delayed_read <= 0;
+       end
+     else
+       begin
+         delayed_read <= rd_del_2;
+         rd_del_2 <= rd_del_1;
+         rd_del_1 <= read_now;
+       end
+         
+   assign     RAM_D = delayed_write ? RAM_D_out : 18'bzzzzzzzzzzzzzzzzzz;
+   assign     write_now = (zbt_state == ZBT_WRITE_UPPER) || (zbt_state == 
ZBT_WRITE_LOWER);
+   assign     read_now =  (zbt_state == ZBT_READ_UPPER) || (zbt_state == 
ZBT_READ_LOWER);
+   
+   always @(posedge clk)
+     RAM_A <= write_now ? {write_ptr,phase} : {read_ptr,phase};
+
+   always @(posedge clk)
+     RAM_WEn <= ~write_now;
+
+   assign     RAM_OEn = ~delayed_read;
+   assign     RAM_OEn = 0;
+   
+endmodule // giantfifo

Copied: gnuradio/branches/releases/3.2/usrp2/fpga/control_lib/giantfifo_tb.v 
(from rev 10359, gnuradio/trunk/usrp2/fpga/control_lib/giantfifo_tb.v)
===================================================================
--- gnuradio/branches/releases/3.2/usrp2/fpga/control_lib/giantfifo_tb.v        
                        (rev 0)
+++ gnuradio/branches/releases/3.2/usrp2/fpga/control_lib/giantfifo_tb.v        
2009-03-15 18:01:28 UTC (rev 10601)
@@ -0,0 +1,173 @@
+module fifo_tb();
+
+   localparam WIDTH = 36;
+   reg clk, rst;
+   wire short_full, short_empty, long_full, long_empty, giant_full, 
giant_empty;
+   wire casc_full, casc_empty, casc2_full, casc2_empty;
+   reg         read, write;
+   
+   wire [WIDTH-1:0] short_do, long_do, casc_do, casc2_do, giant_do;
+   reg [WIDTH-1:0]  di;
+
+   reg               clear = 0;
+   
+   shortfifo #(.WIDTH(WIDTH)) shortfifo
+     (.clk(clk),.rst(rst),.datain(di),.dataout(short_do),.clear(clear),
+      .read(read),.write(write),.full(short_full),.empty(short_empty));
+   
+   longfifo #(.WIDTH(WIDTH), .SIZE(4)) longfifo
+     (.clk(clk),.rst(rst),.datain(di),.dataout(long_do),.clear(clear),
+      .read(read),.write(write),.full(long_full),.empty(long_empty));
+   
+   cascadefifo #(.WIDTH(WIDTH), .SIZE(4)) cascadefifo
+     (.clk(clk),.rst(rst),.datain(di),.dataout(casc_do),.clear(clear),
+      .read(read),.write(write),.full(casc_full),.empty(casc_empty));
+   
+   cascadefifo2 #(.WIDTH(WIDTH), .SIZE(4)) cascadefifo2
+     (.clk(clk),.rst(rst),.datain(di),.dataout(casc2_do),.clear(clear),
+      .read(read),.write(write),.full(casc2_full),.empty(casc2_empty));
+
+   wire [17:0] RAM_D;
+   wire [18:0] RAM_A;
+   wire        RAM_CLK, RAM_WEn, RAM_LDn, RAM_CE1n, RAM_OEn, RAM_CENn;
+   
+   giantfifo #(.WIDTH(WIDTH)) giantfifo
+     (.clk(clk),.rst(rst),.datain(di),.dataout(giant_do),.clear(clear),
+      .read(read),.write(write),.full(giant_full),.empty(giant_empty),
+      .RAM_D(RAM_D),.RAM_A(RAM_A),.RAM_CE1n(RAM_CE1n),.RAM_CENn(RAM_CENn),
+      .RAM_CLK(RAM_CLK),.RAM_WEn(RAM_WEn),.RAM_OEn(RAM_OEn),.RAM_LDn(RAM_LDn)
+      );
+
+   wire        MODE = 1'b0;
+   cy1356 ram_model(.d(RAM_D),.clk(RAM_CLK),.a(RAM_A),
+                   .bws(2'b00),.we_b(RAM_WEn),.adv_lb(RAM_LDn),
+                   .ce1b(RAM_CE1n),.ce2(1'b1),.ce3b(1'b0),
+                   .oeb(RAM_OEn),.cenb(RAM_CENn),.mode(MODE) 
+                   );
+   
+   initial rst = 1;
+   initial #1000 rst = 0;
+   initial clk = 0;
+   always #50 clk = ~clk;
+   
+   initial di = 36'h300AE;
+   initial read = 0;
+   initial write = 0;
+
+   always @(posedge clk)
+     if(write)
+       di <= di + 1;
+   
+   always @(posedge clk)
+     begin
+       if(short_full != long_full)
+         $display("Error: FULL mismatch");
+       if(short_empty != long_empty)
+         $display("Note: EMPTY mismatch, usually not a problem (longfifo has 2 
cycle latency)");
+       if(read & (short_do != long_do))
+         $display("Error: DATA mismatch");
+     end
+   
+   initial $dumpfile("giantfifo_tb.vcd");
+   initial $dumpvars(0,fifo_tb);
+
+   initial
+     begin
+       @(negedge rst);
+       @(posedge clk);
+       repeat (10)
+         @(posedge clk);
+       write <= 1;
+       @(posedge clk);
+       write <= 0;
+       @(posedge clk);
+       @(posedge clk);
+       @(posedge clk);
+       @(posedge clk);
+       @(posedge clk);
+       @(posedge clk);
+       @(posedge clk);
+       @(posedge clk);
+       read <= 1;
+       @(posedge clk);
+       read <= 0;
+       @(posedge clk);
+       @(posedge clk);
+       @(posedge clk);
+       @(posedge clk);
+       @(posedge clk);
+
+       repeat(10)
+         begin
+            write <= 1;
+            @(posedge clk);
+            write <= 0;
+            @(posedge clk);
+            @(posedge clk);
+            @(posedge clk);
+            read <= 1;
+            @(posedge clk);
+            read <= 0;
+            @(posedge clk);
+            @(posedge clk);
+            @(posedge clk);
+            @(posedge clk);
+            @(posedge clk);
+         end // repeat (10)
+       
+       write <= 1;
+       repeat (4)
+         @(posedge clk);
+       write <= 0;
+       @(posedge clk);
+       read <= 1;
+       repeat (4)
+         @(posedge clk);
+       read <= 0;
+       @(posedge clk);
+
+
+       write <= 1;
+       repeat (4)
+         @(posedge clk);
+       write <= 0;
+       @(posedge clk);
+       repeat (4)
+         begin
+            read <= 1;
+            @(posedge clk);
+            read <= 0;
+            @(posedge clk);
+         end
+
+       write <= 1;
+       @(posedge clk);
+       @(posedge clk);
+       @(posedge clk);
+       @(posedge clk);
+       read <= 1;
+       repeat (5)
+         @(posedge clk);
+       write <= 0;
+         @(posedge clk);
+         @(posedge clk);
+       read <= 0;
+       @(posedge clk);
+
+       write <= 1;
+       repeat (16)
+         @(posedge clk);
+       write <= 0;
+       @(posedge clk);
+       
+       read <= 1;
+       repeat (16)
+         @(posedge clk);
+       read <= 0;
+       @(posedge clk);
+                
+       repeat (10)
+         @(posedge clk);
+       $finish;
+     end
+endmodule // longfifo_tb

Copied: gnuradio/branches/releases/3.2/usrp2/fpga/sdr_lib/med_hb_int.v (from 
rev 10359, gnuradio/trunk/usrp2/fpga/sdr_lib/med_hb_int.v)
===================================================================
--- gnuradio/branches/releases/3.2/usrp2/fpga/sdr_lib/med_hb_int.v              
                (rev 0)
+++ gnuradio/branches/releases/3.2/usrp2/fpga/sdr_lib/med_hb_int.v      
2009-03-15 18:01:28 UTC (rev 10601)
@@ -0,0 +1,95 @@
+// Medium halfband decimator (intended to be followed by another stage)
+// Implements impulse responses of the form [A 0 B 0 C 0 D 0.5 D 0 C 0 B 0 A]
+//
+// These taps designed by halfgen_test:
+//   2 * 131072 * halfgen_test(.8/8,4,1)
+// -597, 0, 4283, 0, -17516, 0, 79365, 131072, 79365, 0, -17516, 0, 4283, 0, 
-597
+
+
+module med_hb_int
+  #(parameter WIDTH=18)
+    (input clk,
+     input rst,
+     input bypass,
+     input stb_in,
+     input [WIDTH-1:0] data_in,
+     input [7:0] output_rate,
+     input stb_out,
+     output reg [WIDTH-1:0] data_out);
+
+   localparam coeff_a = -597;
+   localparam coeff_b = 4283;
+   localparam coeff_c = -17516;
+   localparam coeff_d = 79365;
+   
+   reg               phase;
+   reg [WIDTH-1:0] d1, d2, d3, d4, d5, d6, d7, d8;
+   
+   localparam     MWIDTH = 36;
+   wire [MWIDTH-1:0] prod;
+   
+   reg [6:0]        stbin_d;
+   
+   always @(posedge clk)
+     stbin_d <= {stbin_d[5:0],stb_in};
+   
+   always @(posedge clk)
+     if(stb_in)
+       begin
+         d1 <= data_in;
+         d2 <= d1;
+         d3 <= d2;
+         d4 <= d3;
+         d5 <= d4;
+         d6 <= d5;
+         d7 <= d6;
+         d8 <= d7;
+       end
+
+   wire [WIDTH-1:0] sum_a, sum_b, sum_c, sum_d;
+   add2_and_round_reg #(.WIDTH(WIDTH)) add_a 
(.clk(clk),.in1(d1),.in2(d8),.sum(sum_a));
+   add2_and_round_reg #(.WIDTH(WIDTH)) add_b 
(.clk(clk),.in1(d2),.in2(d7),.sum(sum_b));
+   add2_and_round_reg #(.WIDTH(WIDTH)) add_c 
(.clk(clk),.in1(d3),.in2(d6),.sum(sum_c));
+   add2_and_round_reg #(.WIDTH(WIDTH)) add_d 
(.clk(clk),.in1(d4),.in2(d5),.sum(sum_d));
+
+   MULT18X18S mult1(.C(clk), .CE(1), .R(rst), .P(prod1), .A(stbin_d[1] ? 
coeff_a : coeff_b), 
+                   .B(stbin_d[1] ? sum_a : sum_b) );
+   MULT18X18S mult2(.C(clk), .CE(1), .R(rst), .P(prod2), .A(stbin_d[1] ? 
coeff_c : coeff_d), 
+                   .B(stbin_d[1] ? sum_c : sum_d) );
+
+   wire [MWIDTH:0] accum;
+   acc #(.IWIDTH(MWIDTH),.OWIDTH(MWIDTH+1)) 
+     acc 
(.clk(clk),.clear(stbin_d[2]),.acc(|stbin_d[3:2]),.in(prod),.out(accum));
+   
+   wire [WIDTH+2:0]     accum_rnd;
+   round_reg #(.bits_in(MWIDTH+1),.bits_out(WIDTH+3))
+     final_round (.clk(clk),.in(accum),.out(accum_rnd));
+
+   wire [WIDTH-1:0]     clipped;
+   clip_reg #(.bits_in(WIDTH+3),.bits_out(WIDTH))
+     final_clip (.clk(clk),.in(accum_rnd),.out(clipped));
+
+   reg [WIDTH-1:0]      saved, saved_d3;
+   always @(posedge clk)
+     if(stbin_d[6])
+       saved <= clipped;
+
+   always @(posedge clk)
+     if(stbin_d[3])
+       saved_d3 <= d3;
+          
+   always @(posedge clk)
+     if(bypass)
+       data_out <= data_in;
+     else if(stb_in & stb_out)
+       case(output_rate)
+        1 : data_out <= d6; 
+        2 : data_out <= d4;
+        3, 4, 5, 6, 7 : data_out <= d3;
+        default : data_out <= d2;
+       endcase // case(output_rate)
+     else if(stb_out)
+       data_out <= saved;
+
+endmodule // small_hb_int
+

Copied: gnuradio/branches/releases/3.2/usrp2/fpga/timing/time_64bit.v (from rev 
10359, gnuradio/trunk/usrp2/fpga/timing/time_64bit.v)
===================================================================
--- gnuradio/branches/releases/3.2/usrp2/fpga/timing/time_64bit.v               
                (rev 0)
+++ gnuradio/branches/releases/3.2/usrp2/fpga/timing/time_64bit.v       
2009-03-15 18:01:28 UTC (rev 10601)
@@ -0,0 +1,63 @@
+
+
+module time_64bit
+  #(parameter TICKS_PER_SEC = 32'd100000000,
+    parameter BASE = 0)
+    (input clk, input rst,
+     input set_stb, input [7:0] set_addr, input [31:0] set_data,  
+     input pps,
+     output [63:0] vita_time
+     );
+
+   localparam     NEXT_TICKS = 0;
+   localparam     NEXT_SECS = 1;   
+   localparam     ROLLOVER = TICKS_PER_SEC - 1;           
+   
+   assign         vita_time = {seconds,ticks};
+   
+   wire [31:0]            next_ticks_preset;
+   wire [31:0]            next_seconds_preset;
+   wire           set_on_pps_trig;
+   reg                    set_on_next_pps;
+   
+   setting_reg #(.my_addr(BASE+NEXT_TICKS)) sr_next_ticks
+     (.clk(clk),.rst(rst),.strobe(set_stb),.addr(set_addr),
+      .in(set_data),.out(next_ticks_preset),.changed());
+   
+   setting_reg #(.my_addr(BASE+NEXT_SECS)) sr_next_secs
+     (.clk(clk),.rst(rst),.strobe(set_stb),.addr(set_addr),
+      .in(set_data),.out(next_seconds_preset),.changed(set_on_pps_trig));
+   
+   reg [31:0]     seconds;
+   reg [31:0]     ticks;
+   
+   wire           end_of_second;
+   
+   always @(posedge clk)
+     if(rst)
+       set_on_next_pps <= 0;
+     else if(set_on_pps_trig)
+       set_on_next_pps <= 1;
+     else if(pps)
+       set_on_next_pps <= 0;
+   
+   always @(posedge clk)
+     if(rst)
+       begin
+         seconds <= 32'd0;
+         ticks <= 32'd0;
+       end
+     else if(pps & set_on_next_pps)
+       begin
+         seconds <= next_seconds_preset;
+         ticks <= next_ticks_preset;
+       end
+     else if(ticks == ROLLOVER)
+       begin
+         seconds <= seconds + 1;
+         ticks <= 0;
+       end
+     else
+       ticks <= ticks + 1;
+   
+endmodule // time_64bit


Property changes on: 
gnuradio/branches/releases/3.2/usrp2/host/apps/bitrot/rx_samples.cc
___________________________________________________________________
Deleted: svn:mergeinfo
   - 





reply via email to

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