S
Spur
Guest
Our design includes a core that has an internal cs_n signal.
Suppose the following:
internal_cs_n <= '0' when cs_sync = '0' and addr_sync(24 downto 22) =
"100" else '1';
cs_sync and addr_sync are completely syncronous to our closk, meaning
that
they're a direct output of FFs.
I'm told that there can be a hazard on internal_cs_n which may cause
the core to work improperly.
Naturally I understand how a hazard can happen, and I know techniques
for avoiding it (redundant multiplicants of the karnaugh map), but
still I wonder.
Should we synchronize EVERYTHING ? But it will only just add to the
latency. Each synchronization is an FF, meaning that the core's cs_n
will come only a cycle later after the general FPGA's cs_sync.
Can't a synthesizer (we use Leonardo and Synplify Pro) avoid hazards
automatically, by means of adding other gates ?
I'm also not sure how to add hazard-avoiding-code manually to the
comparator. If it would be a simple boolean function I'd understand,
but I guess I must look how the synthesis implements the comparator ?
Thanks in advance
Suppose the following:
internal_cs_n <= '0' when cs_sync = '0' and addr_sync(24 downto 22) =
"100" else '1';
cs_sync and addr_sync are completely syncronous to our closk, meaning
that
they're a direct output of FFs.
I'm told that there can be a hazard on internal_cs_n which may cause
the core to work improperly.
Naturally I understand how a hazard can happen, and I know techniques
for avoiding it (redundant multiplicants of the karnaugh map), but
still I wonder.
Should we synchronize EVERYTHING ? But it will only just add to the
latency. Each synchronization is an FF, meaning that the core's cs_n
will come only a cycle later after the general FPGA's cs_sync.
Can't a synthesizer (we use Leonardo and Synplify Pro) avoid hazards
automatically, by means of adding other gates ?
I'm also not sure how to add hazard-avoiding-code manually to the
comparator. If it would be a simple boolean function I'd understand,
but I guess I must look how the synthesis implements the comparator ?
Thanks in advance