Given this, "... The Optimizer can optimize both combinational and sequential designs for speed, area, and power ... "
Is it possible that the Optimizer realizes that it can be faster to execute the second "IF" statement first?
If the second "IF" statement is TRUE then there is no reason to even execute the first "IF" statement.
Then if, and only if, the second "IF" statement is FALSE then execute the first "IF" Statement.
If the Optimizer can do this then the Synthesized Hardware for both of these specific "If / Else" and "If / If" examples could be identical.
Code:
always_comb begin
out = 0;
if (in == b) <== Optimized to execute 2nd and only if the "IF" statement below is FALSE?
out = z;
if (in == a) <== Optimized to execute 1st ?
out = y;
end