H
hvo
Guest
Hello,
I know this topic is beaten to death but I am a bit unlcear some things.
I've recently encountered metastability issues that caused my FPGA to d
unpredictable things. Someone suggested that I synchronize my inputs t
the clock domain and that seemed to solve the issue. Googling this topi
showed that a two stage Flip Flop is sufficient to increase MTBF fo
metastability. My question is do I need to do this for all input signals?
How would one do this with a design containing 30 to 40 input signals?
Which types of inputs can I get away with not using two stage FF?
So in the sample code below, both INA or INB can change state while the cl
is transitioning and this could lead to metastability. Synchronizing IN
and INB would help, but what about INC and IND?
Would the experts just synchronize everything and forget about it?
-----------------------------------------------------------------------------------------
-- Sample code with asynchronous inputs
-----------------------------------------------------------------------------------------
entity blackbox is
port (
Clk : in std_logic;
RST : in std_logic;
INA : in std_logic;
INB : in std_logic;
INC : in std_logic;
IND : in std_logic;
Out : out std_logic
);
end blackbox;
architecture Behavioral of blackboxis
begin
BB: process(Clk, RST) is
begin
if(RST = '1') then
Out <= '0';
elsif(Clk'event and Clk = '1') then
if(INA = '1' and INB = '1') then
Out <= INC;
else
Out <= IND;
end if;
end if;
end process BB;
-----------------------------------------------------------------------------------------
Any feedback is much appreciated.
Thanks
HV.
---------------------------------------
Posted through http://www.FPGARelated.com
I know this topic is beaten to death but I am a bit unlcear some things.
I've recently encountered metastability issues that caused my FPGA to d
unpredictable things. Someone suggested that I synchronize my inputs t
the clock domain and that seemed to solve the issue. Googling this topi
showed that a two stage Flip Flop is sufficient to increase MTBF fo
metastability. My question is do I need to do this for all input signals?
How would one do this with a design containing 30 to 40 input signals?
Which types of inputs can I get away with not using two stage FF?
So in the sample code below, both INA or INB can change state while the cl
is transitioning and this could lead to metastability. Synchronizing IN
and INB would help, but what about INC and IND?
Would the experts just synchronize everything and forget about it?
-----------------------------------------------------------------------------------------
-- Sample code with asynchronous inputs
-----------------------------------------------------------------------------------------
entity blackbox is
port (
Clk : in std_logic;
RST : in std_logic;
INA : in std_logic;
INB : in std_logic;
INC : in std_logic;
IND : in std_logic;
Out : out std_logic
);
end blackbox;
architecture Behavioral of blackboxis
begin
BB: process(Clk, RST) is
begin
if(RST = '1') then
Out <= '0';
elsif(Clk'event and Clk = '1') then
if(INA = '1' and INB = '1') then
Out <= INC;
else
Out <= IND;
end if;
end if;
end process BB;
-----------------------------------------------------------------------------------------
Any feedback is much appreciated.
Thanks
HV.
---------------------------------------
Posted through http://www.FPGARelated.com