look at the following code:
always @(*) begin o = 2'bxx; if (a) o = 2'd0; else if (b) o = 2'd1; else if (c) o = 2'd2; else if (d) o = 2'd3; end
o = 2'bxx;
if (a) o = 2'd0;
else if (b) o = 2'd1;
else if (c) o = 2'd2;
else if (d) o = 2'd3;
signal o is DC (don't care) if none of the inputs (a,b,c,d) is asserted. I used the 2'bxx value because (1) it's easier to debug when X is propagating and (2) don't care might help the synthesizer, because it can assign any value it wants in this case.
But using HAL, I get an error *SYNTXZ - which warns me about this X assignment.
My question is: Doesn't X assignment 'help' the synthesizer?
If it is - why is the warning? or how can I avoid this warning?
if not - is there a way to tell the synthesizer about Don't-Cares in a combinational logic?