aboutsummaryrefslogtreecommitdiff
path: root/rtl
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2018-06-21 14:47:40 +0200
committerJoachim StroĢˆmbergson <joachim@secworks.se>2018-06-21 14:47:40 +0200
commitd25b4107ef00ca8b401423013db3d84bc0c10951 (patch)
treed56f54465794f57fb9d7abbf85390ca55f5a8490 /rtl
parentec86c8dc71b3e0bb66315e5ce510d70ba9e3201d (diff)
Fixed bad mistake on reset signal. Minor cleanup.
Diffstat (limited to 'rtl')
-rw-r--r--rtl/alpha_fmc_top.v17
1 files 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