From 39bc4e1ef227c3e33349c6c735af26ff4b58a955 Mon Sep 17 00:00:00 2001 From: Denys Fokin Date: Tue, 10 Dec 2019 11:29:46 +0200 Subject: [PATCH] Do not generate usb_rst upon power-on reset --- usb_utils.v | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usb_utils.v b/usb_utils.v index 62bbc52..d9db699 100644 --- a/usb_utils.v +++ b/usb_utils.v @@ -144,18 +144,20 @@ module usb_reset_detect( input se0, output usb_rst); +localparam cntr_rst_val = 19'd480000; + reg[18:0] cntr; assign usb_rst = cntr == 1'b0; always @(posedge clk or negedge rst_n) begin if (!rst_n) begin - cntr <= 1'b0; + cntr <= cntr_rst_val; end else begin if (se0) begin if (!usb_rst) cntr <= cntr - 1'b1; end else begin - cntr <= 19'd480000; + cntr <= cntr_rst_val; end end end