commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r8524 - in usrp2/trunk/fpga: control_lib sdr_lib


From: matt
Subject: [Commit-gnuradio] r8524 - in usrp2/trunk/fpga: control_lib sdr_lib
Date: Wed, 28 May 2008 18:32:13 -0600 (MDT)

Author: matt
Date: 2008-05-28 18:32:12 -0600 (Wed, 28 May 2008)
New Revision: 8524

Added:
   usrp2/trunk/fpga/sdr_lib/cic_strober.v
Removed:
   usrp2/trunk/fpga/control_lib/strobe_gen.v
Log:
more sane setup for dooing strobes for cic filters


Deleted: usrp2/trunk/fpga/control_lib/strobe_gen.v

Added: usrp2/trunk/fpga/sdr_lib/cic_strober.v
===================================================================
--- usrp2/trunk/fpga/sdr_lib/cic_strober.v                              (rev 0)
+++ usrp2/trunk/fpga/sdr_lib/cic_strober.v      2008-05-29 00:32:12 UTC (rev 
8524)
@@ -0,0 +1,44 @@
+//
+//  USRP2 - Universal Software Radio Peripheral Mk II
+//
+//  Copyright (C) 2008 Matt Ettus
+//
+//  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 cic_strober
+  ( input clock,
+    input reset,
+    input enable,
+    input [7:0] rate, // Rate should EQUAL to your desired divide ratio, no 
more -1 BS
+    input strobe_fast,
+    output wire strobe_slow );
+   
+   reg [7:0] counter;
+   wire      now = (counter==1);
+   assign    strobe_slow = now && enable && strobe_fast;
+   
+   always @(posedge clock)
+     if(reset)
+       counter <= 8'd0; 
+     else if (~enable)
+       counter <= rate;
+     else if(strobe_fast)
+       if(now)
+        counter <= rate;
+       else 
+        counter <= counter - 1;
+   
+endmodule // cic_strober





reply via email to

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