10-10-2020 05:20 AM
If I have an expression such as !(a & b & c), then its output should be 1 as long as any of the three inputs is zero even if the other inputs are changing. Yet I cannot convince myself that this would be the case if this expression is implemented using a LUT. To get the 1 output the LUT has to select an element from its table that contains 1. But if the other two inputs are changing, there seems no guarantee that the LUT will select any element at all, and the output would presumably be zero by default. Or perhaps it's 1 by default, and some other expression would break.
This situation arises for me in the context of startup with a PLL producing output for one clock domain, and DDR3 memory running in a different clock domain doing its calibration. Just ANDing various signals together and synchronizing them looks to me as if it could still fail. Yet I'm loath to waste resources on synchronizing them separately, and then ANDing them if I'm just mistaken about this hazard.
Any thoughts on this? A reference to relevant documentation would be great. I've looked, but not found.
10-10-2020 07:10 AM - edited 10-10-2020 07:11 AM
What's you level of experience, I'm guessing new to logic design, possibly at college. If I'm wrong apologies.
A LUT does no selection,
Its simply a "PROM" look up table, with a number of inputs and one output,
so if you have 4 inputs, then the Look Up Table contains 16 entrees, one for each of the possible inputs, and once programmed by your code, outputs the 1 or 0 your design has.
The "answer" to this sort of problem, which I'm guessing you have not done is to do a quick simulation.
As you progress in logic design, you will spend most of your time in simulation, so now is the time to learn the basics.
Re the wider question,
in all logic, if the inputs to a function change, the outputs change,
if the inputs are not synchronous to each other, and the output is not sampled synchronously, then you will see glitches.
this is called crossing clock domains.
Its up to your system design to mitigate the cross clock domain problems,
there are very many ways to do this
10-10-2020 08:46 AM - edited 10-10-2020 08:47 AM
The Xilinx literature is unclear here. At no point does the documentation state that the LUT is glitch free - if you are switching from one combination of inputs that produces an output (say 0) to another combination that produces the same output, there is no guarantee that there isn't a transient glitch to a 1 as the inputs are switching.
That being said, it is also not stated that they are not glitch free - at least in more restricted situations. For example if you have an input combination that produces a 0, you switch to a different input situation that also produces 0 that is one Hamming distance away (i.e. only one input bit is changing) is there a chance that the signal will glitch to a 1? I don't know - it certainly isn't stated in any documentation.
Maybe @lowearthorbit might be able to provide some insight (I think he has talked about this in the past).
10-11-2020 07:15 AM
10-11-2020 04:06 PM
After further considering the likely implementations of a LUT, I'm rather suspecting that they're not glitch free even in the simple case of one input changing where the eventual output won't change. This means that a simple case such as selecting from a pair of asynchronous inputs won't work
muxab = (asel & a) | (bsel & b)
even if the synthesizer is forced to use three LUTs for this.
Xlinix could usefully comment on this, with particular reference to whether the same issue applies to a MUXF7 or similar.
10-12-2020 02:39 AM
10-12-2020 04:45 AM
What kind of NAND gate generates anything but one on its output when at least one input is zero, regardless of what the other inputs are, including while they are changing from one state to the other?