Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
9 years ago

How to generate Global RESET signal in Verilog?

Hi,

I want to generate a active LOW global reset signal once FPGA device power up.

I write my code like this:

reg [9:0] reset_sync_n = 1'b0; //initialize the reset signal

always @ (posedge CLK_50M) //Sync the reset signal to clock

begin

reset_sync_n <= 1'b1;

end

//reset_sync_n will be using as synchronous reset signal in others flip-flops logic like below:

always @ (posedge ref_clk)

begin

if (rst)

x <= 0;

else

x<= y;

end

My questions are:

1. Can the reset_sync_n initialized like the above? Will a active LOW reset signal be generated once FPGA device power up?

2. What is the right way to generate the RESET signal?

3. Asynchronous reset is better or synchronous reset is better? Which one is the better coding practice?

This is the doubts that always bother me. Please help me! Thank you!^^

11 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    In the top level, design a reset synchronizer which generates a synchronous reset signal. Connect that synchronized reset signal to your modules. A reset synchronizer should reset asynchronously, and set synchronously.

    --- Quote End ---

    There is no best way how to design the reset logic, however I also think that the above statement is a good practice.

    Thanks,

    Victor