E
Eli Bendersky
Hello all,
Following some discussion in these groups and reading a couple of
articles (especially the first one turning up when you google for
"asynchronous synchronous reset design techniques", it seems that the
best and the safest way to use resets in FPGA designs is to use a
special synchronizer circuit that assures that the reset of the FFs is
asserted asynchronously, but is deasserted synchronously.
The circuit is something like (kindly borrowed from the aforementioned
article):
~~~~~~~~
entity reset_synchronizer is
port
(
clk, async_reset_n: in std_logic;
sync_reset_n: out std_logic;
);
end reset_synchronizer;
architecture rtl of reset_synchronizer is
signal rff1: std_logic;
begin
process (clk, async_reset_n)
begin
if async_reset_n = '0' then
rff1 <= '0';
sync_reset_n <= '0';
elsif rising_edge(clk) then
rff1 <= '1';
sync_reset_n <= rff1;
end if
end process;
end rtl;
~~~~~~~~
When the asynchronous reset line enters this module, the synchronous
output can then be used as the _asynchronous_ reset of all FFs in the
design, as follows:
process (clk, sync_reset_n)
begin
if sync_reset_n = '0' then
ff <= '0';
elsif rising_edge(clk) then
ff ....
end if;
end process;
This seems to bring the best of all worlds - all the FFs in the design
enter reset asynchronously, without being dependent on the clock, and
exit reset synchronously. The synthesis tools can analyze the path
delays for sync_reset_n and report the times and skews.
Moreover, from a talk I had with Altera support engineers - they claim
this is the recommended way to code resets in designs, and that
Altera's tools will know to route sync_reset_n via fast global
interconnects to minimize time delay and skews. And in any case,
there's a report to see for each compilation.
What does this technique lack to be the perfect solution for resets in
FPGA designs ? It seems that it evades all the common disadvantages of
conventional sync and async resets.
Thanks in advance
Eli
Following some discussion in these groups and reading a couple of
articles (especially the first one turning up when you google for
"asynchronous synchronous reset design techniques", it seems that the
best and the safest way to use resets in FPGA designs is to use a
special synchronizer circuit that assures that the reset of the FFs is
asserted asynchronously, but is deasserted synchronously.
The circuit is something like (kindly borrowed from the aforementioned
article):
~~~~~~~~
entity reset_synchronizer is
port
(
clk, async_reset_n: in std_logic;
sync_reset_n: out std_logic;
);
end reset_synchronizer;
architecture rtl of reset_synchronizer is
signal rff1: std_logic;
begin
process (clk, async_reset_n)
begin
if async_reset_n = '0' then
rff1 <= '0';
sync_reset_n <= '0';
elsif rising_edge(clk) then
rff1 <= '1';
sync_reset_n <= rff1;
end if
end process;
end rtl;
~~~~~~~~
When the asynchronous reset line enters this module, the synchronous
output can then be used as the _asynchronous_ reset of all FFs in the
design, as follows:
process (clk, sync_reset_n)
begin
if sync_reset_n = '0' then
ff <= '0';
elsif rising_edge(clk) then
ff ....
end if;
end process;
This seems to bring the best of all worlds - all the FFs in the design
enter reset asynchronously, without being dependent on the clock, and
exit reset synchronously. The synthesis tools can analyze the path
delays for sync_reset_n and report the times and skews.
Moreover, from a talk I had with Altera support engineers - they claim
this is the recommended way to code resets in designs, and that
Altera's tools will know to route sync_reset_n via fast global
interconnects to minimize time delay and skews. And in any case,
there's a report to see for each compilation.
What does this technique lack to be the perfect solution for resets in
FPGA designs ? It seems that it evades all the common disadvantages of
conventional sync and async resets.
Thanks in advance
Eli