[Cryptech-Commits] [core/platform/alpha] branch gpio_led_toggle updated: Fixed bad mistake on reset signal. Minor cleanup.

git at cryptech.is git at cryptech.is
Thu Jun 21 12:48:15 UTC 2018


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

joachim at secworks.se pushed a commit to branch gpio_led_toggle
in repository core/platform/alpha.

The following commit(s) were added to refs/heads/gpio_led_toggle by this push:
     new d25b410  Fixed bad mistake on reset signal. Minor cleanup.
d25b410 is described below

commit d25b4107ef00ca8b401423013db3d84bc0c10951
Author: Joachim Strömbergson <joachim at secworks.se>
AuthorDate: Thu Jun 21 14:47:40 2018 +0200

    Fixed bad mistake on reset signal. Minor cleanup.
---
 rtl/alpha_fmc_top.v | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/rtl/alpha_fmc_top.v b/rtl/alpha_fmc_top.v
index a86a2c6..4d7fcac 100644
--- a/rtl/alpha_fmc_top.v
+++ b/rtl/alpha_fmc_top.v
@@ -210,6 +210,7 @@ module alpha_fmc_top
   reg [15 : 0] toggle_ctr_new;
 
   reg toggle_reg;
+  reg toggle_new;
   reg toggle_we;
 
   assign gpio_a = {7'b0101010, toggle_reg};
@@ -217,9 +218,9 @@ module alpha_fmc_top
 
   always @(posedge sys_clk)
     begin: sys_clk_toggle_reg_update
-      if (!reset_n)
+      if (!sys_rst_n)
         begin
-          toggle_ctr_reg <= 16'h0;
+          toggle_ctr_reg <= 32'h0;
           toggle_reg     <= 1'b0;
         end
       else
@@ -227,22 +228,22 @@ module alpha_fmc_top
           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 = 16'h0;
+          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 // alpha_fmc_top

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


More information about the Commits mailing list