input [1:0] dll_speed_mode
real MIN_FREQ , MAX_FREQ
always @(*)
begin
case (dll_speed_mode)
2'b00:
begin
MIN_FREQ = 100;
MAX_FREQ = 180;
end
2'b01:
begin
MIN_FREQ = 180;
MAX_FREQ = 266;
end
2'b10:
begin
MIN_FREQ = 266;
MAX_FREQ = 333;
end
2'b11:
begin
MIN_FREQ = 333;
MAX_FREQ = 400;
end
default:
begin
MIN_FREQ = 160;
MAX_FREQ = 400;
end
endcase // case (dll_speed_mode)
end
I have a question here and want to understand how case statment works
If my dll_speed_mode is 2’hx
Which case statement is excusted (is it default ?)
What will be the values of MIN_FREQ and MAX_REQ
A case statement uses case equality (===) where x’s and z’s are included matching expressions. So if dll_speed_mode is 2’hx, the default branch is selected.
Without knowing the details of the error, I am guessing that the
always @() has not been trigerred even once. Remember the always @()
will be evaluated only when dll_speed_mode goes through the first
transition. Till then the real values MIN and MAX_FREQ will be 0.
After the first transition to 2’b00, then the MIN and MAX_FREQ should be
100 and 180.