[Cryptech-Commits] [user/js/toggle] branch master updated: Minor cleanup.

git at cryptech.is git at cryptech.is
Tue Jun 19 14:10:21 UTC 2018


This is an automated email from the git hooks/post-receive script.

joachim at secworks.se pushed a commit to branch master
in repository user/js/toggle.

The following commit(s) were added to refs/heads/master by this push:
     new 35c2a01  Minor cleanup.
35c2a01 is described below

commit 35c2a01ff8831dabcd06c00999a3f66e494ced22
Author: Joachim Strömbergson <joachim at secworks.se>
AuthorDate: Tue Jun 19 16:10:42 2018 +0200

    Minor cleanup.
---
 src/rtl/toggle.v | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/rtl/toggle.v b/src/rtl/toggle.v
index 548b85e..31c4518 100644
--- a/src/rtl/toggle.v
+++ b/src/rtl/toggle.v
@@ -51,6 +51,7 @@ module toggle
   reg [7 : 0] toggle_ctr_new;
 
   reg toggle_reg;
+  reg toggle_new;
   reg toggle_we;
 
   assign gpio_b = {7'b1010101, toggle_reg};
@@ -67,22 +68,22 @@ module toggle
           toggle_ctr_reg <= toggle_ctr_new;
 
           if (toggle_we)
-            toggle_reg <= ~toggle_reg;
+            toggle_reg <= toggle_new;
         end
     end
 
   always @*
     begin : sys_clk_toggle
+      toggle_new = ~toggle_reg;
+      toggle_we  = 1'b0;
+
       if (toggle_ctr_reg == TOGGLE_DELAY_CYCLES)
         begin
           toggle_ctr_new = 32'h0;
           toggle_we      = 1'b1;
         end
       else
-        begin
-          toggle_ctr_new = toggle_ctr_reg + 1'b1;
-          toggle_we      = 1'b0;
-        end
+        toggle_ctr_new = toggle_ctr_reg + 1'b1;
     end
 
 endmodule // toggle

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Commits mailing list