Contact us Start a Trial

Truncation in integer literals

Sigasi validates sized integer literals and warns when the specified size is too small to represent the value (rule 182).

module test;
    // 5 is 3'b101, so it requires 3 bits.
    // With size 2, the value is truncated to 2'b01.
    int retry_limit = 2'd5;

    // Correct: size matches the number of bits required.
    int safe_retry_limit = 3'd5;
endmodule

Rule configuration

This rule can be disabled for your project, or its severity and parameters can be modified in the project linting settings. Alternatively, it can be manually configured with the following template:

182/severity/${path}={error|warning|info|ignore}