From 3b8b42a6bb6091f7e9fa1e8b82ffe9a283bfec55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Stro=CC=88mbergson?= Date: Thu, 21 Jun 2018 14:56:26 +0200 Subject: Simplified the toggle logic by using default assignments. --- src/rtl/toggle.v | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/rtl') diff --git a/src/rtl/toggle.v b/src/rtl/toggle.v index 31c4518..7a018ad 100644 --- a/src/rtl/toggle.v +++ b/src/rtl/toggle.v @@ -74,16 +74,15 @@ module toggle always @* begin : sys_clk_toggle - toggle_new = ~toggle_reg; - toggle_we = 1'b0; + toggle_ctr_new = toggle_ctr_reg + 1'b1; + 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 - toggle_ctr_new = toggle_ctr_reg + 1'b1; end endmodule // toggle -- cgit v1.2.3