Does syntheis tools (especially yosys) choose the most efficient encoding for muxes if I set the default choice to x? e.g. wire [1:0] q = (cond_a) ? 2'b00 : (cond_b) ? 2'b01 : 2'bxx; VHDL has an explicit don't care ('-'). Haven't thought of how verilog handles that
Yes, yosys does (attempt) to do that. But most other tools simply interpret X as 0 in synthesis.
-
-
Cool. That sounds to me like the sane way to do it :) But it also seems to be a safer choice to rewrite to casez as
@maxslug also proposed -
Yes. And Yosys will do the right thing in both cases.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.