I have a unique case statement inside an FSM that looks something like this:
enum logic [1:0] {IDLE = 2'b01,
RUN = 2'b10} state, next_state;
always_comb begin
next_state=state;
unique case(state)
IDLE: next_state = RUN;
RUN: next_state = IDLE
endcase
end
always_ff @(posedge clk or negedge rstb) begin
if(!rstb) state <= IDLE;
else state <= next_state;
end
I am getting a "Unique case violation" warning at time 0, presumably because everything starts up as X
. I am fairly certain that the above code will always have one and only one true case, so I would like to get rid of this warning.