commit-gnuradio
[Top][All Lists]
Advanced

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

[Commit-gnuradio] r8919 - usrp2/trunk/fpga/control_lib


From: matt
Subject: [Commit-gnuradio] r8919 - usrp2/trunk/fpga/control_lib
Date: Thu, 17 Jul 2008 12:30:13 -0600 (MDT)

Author: matt
Date: 2008-07-17 12:30:09 -0600 (Thu, 17 Jul 2008)
New Revision: 8919

Modified:
   usrp2/trunk/fpga/control_lib/oneshot_2clk.v
Log:
modified to work in fewer registers


Modified: usrp2/trunk/fpga/control_lib/oneshot_2clk.v
===================================================================
--- usrp2/trunk/fpga/control_lib/oneshot_2clk.v 2008-07-17 18:29:29 UTC (rev 
8918)
+++ usrp2/trunk/fpga/control_lib/oneshot_2clk.v 2008-07-17 18:30:09 UTC (rev 
8919)
@@ -10,27 +10,26 @@
   (input clk_in,
    input in,
    input clk_out,
-   output out);
+   output reg out);
 
-   reg [2:0] del_in = 0;
-   reg              sendit_in = 0, gotit_in = 0, sendit_out = 0, gotit_out = 0;
-   reg              sendit_d = 0, gotit_d = 0;
+   reg           del_in = 0;
+   reg           sendit = 0, gotit = 0;
+   reg           sendit_d = 0, gotit_d = 0;
    
-   always @(posedge clk_in) del_in <= {del_in[1:0],in};
+   always @(posedge clk_in) del_in <= in;
 
    always @(posedge clk_in)
-     if(del_in[1] & ~del_in[2])  // we have a positive edge
-       sendit_in <= 1;
-     else if(gotit_in)
-       sendit_in <= 0;
+     if(in & ~del_in)  // we have a positive edge
+       sendit <= 1;
+     else if(gotit)
+       sendit <= 0;
 
-   always @(posedge clk_out) sendit_d <= sendit_in;
-   always @(posedge clk_out) sendit_out <= sendit_d;
-   always @(posedge clk_out) gotit_out <= sendit_out;
+   always @(posedge clk_out) sendit_d <= sendit;
+   always @(posedge clk_out) out <= sendit_d;
 
-   always @(posedge clk_in) gotit_d <= gotit_out;
-   always @(posedge clk_in) gotit_in <= gotit_d;
-     
+   always @(posedge clk_in) gotit_d <= out;
+   always @(posedge clk_in) gotit <= gotit_d;
+
 endmodule // oneshot_2clk
 
   





reply via email to

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