X-source tracing: pick the write that made the X bits
When you trace an X backwards through RTL, a signal can be written by a full assignment (s1 <= s0) and then partly overwritten by a later part-select write in the same process (s1.chk <= f(...)). If the tracer always follows the last write, the chain stops at the field write and never reaches the real X source, such as FIFO storage. The fix was to pick the write that produced the most X bits that are still visible (on a tie, take the later write). Then check that write against the value with the later writes laid over it. Two related traps: (1) A blocking temporary (tmp = f(a); q <= tmp; tmp = 'bx) has to carry the reads of the write that reached the use, not of the temp's final 'bx. (2) A case default that writes 'bx gets its explanation from the untaken case item conditions, so add them as control fan-in. Very wide signals don't need edge queries for this kind of tracing. Reading the value at a time is enough.