Re: When is it to generate transparent latch or usual combinationallogic?
Weng,
You've told the synthesizer that state2_ns (the combinatorial signal,
not the register) has to remember its previous value under certain
circumstances, so it generates a latch to remember the value.
Your choices to avoid the latch include a) avoiding combinatorial
processes, b) including a default assignment (perhaps from the output
of the associated register) in combinatorial processes, or c) making
sure every possible execution path through the process results in all
driven signals being assigned a value (and not just to themselves).
I always choose (a). If you just have to use a combinatorial process,
then (b) is much easier to read/write/verify/review than is(c).
Andy
|