New Rule: Implicit case default
This pull request is a simple case implementation for implicit case default. It keeps track of implicitly defined variables in a vector and references it when it encounters it under the case statement. Passes if there is a default case defined.
Relevant Issues
- closes dalance/svlint#268
Thanks @ShreChinno and @ronitnallagatla
Since it's trivial to construct cases where this rule will pass where it shouldn't, I think there should be some very clear warnings in the explanation. My concern is that users might use this instead of the stricter versions, and not realise that it doesn't provide the same strength of guarantees.
This will pass, but shouldn't:
always_comb begin
if (foo) begin // Initialisation is conditional.
a = 1;
end
case (bar)
5: a = 5;
6: a = 6;
// no default
endcase
end
The always_comb should ensure a compile-time error because a infers state, but the point of the stricter rules is that you don't need to wait until compilation.
The additional exlanation seems to be good. I'll merge this PR.