Hi Andy,
On 03/05/2013 17:13, Andy wrote:
> First things first. A "feedback mux generated" message almost always
> indicates an issue with asynchronous resets.
I believe that 'almost' in your statement is referred to the variability
of the various synthesis tools' implementation.
>
> In your code, if any of those reset conditions trigger, the elsif
> rising_edge(clk) section does not execute (nor do the other reset
> sections execute). Therefore the synthesis tool has to add a feedback
> mux for those registers not reset by all reset conditions. The
> feedback mux is controlled by the reset conditions (oops, they're
> asynchronous!) so that the register does not update on rising clock
> edges while any of the reset conditions is true.
meaning that if a signal is not set for *all* sets and resets, the
synthesis needs to 'remember' the state of the not-assigned signal to
maintain its state. Sorry if I needed to reformulate it, but I guess is
part of my 'learning process'!
>
> If you really want to have non-reset and reset registers in the same
> process, then you should use an "if rising_edge(clk)" section first,
> with a matching end if, and then a separate if statement (NOT elsif!)
> afterwards for EACH reset input condition.
>
got your point.
> Note that using multiple, partial asynchronous resets can cause
> strange problems, if circuitry that is not reset is using outputs
> from other asynchronously reset circuitry, since those outputs can be
> reset at any time relative to the clock. For this reason,
> asynchronous resets should generally only be used for general
> initialization, and not for functional logic purposes. Consider other
> ways to accomplish what the multiple asynchronous resets are trying
> to do.
This is the direction towards which I'm willing to go. The code (as I
sarcastically described) has been put together with patches after
patches up to a point where 'it works', but I've been asked to review
the code and pin point any suspicious part which might cause problems.
The fun part of it is the total absence of specs and a very primitive
verification plan in place... but that's another issue.
>
> As for the sensitivity list issues, generating an event is not the
> same as triggering a process. A process has to be sensitive to the
> signal in order for an event on that signal to cause the process to
> re-execute.
Meaning that every signal the process depends on (i.e. resets/sets and
clock) should be in the sensitivity list. Correct?
>
> Synthesis tools started out ignoring sensitivity lists, and have
> continued to do so to this day, much to my chagrin. At least they
> warn you when they find a sensitivity list problem that would cause a
> mismatch between the code's simulated behavior and that of the
> resulting hardware.
>
That is unfortunate and allows proliferating bad habits as well. I often
see designers rushing to the synthesis phase (or even the FPGA
programming) without paying too much of attention to pre-synth simulations.