CNSTLint β SystemVerilog Constraint LinterΒΆ
CNSTLint is an open-source linter for SystemVerilog constraint blocks, developed by AsFigo Technologies as part of the BYOL (Build Your Own Linter) framework.
It enforces best practices for rand/constraint constructs β covering
operator precedence, soft constraint placement, distribution operators, and
array reduction safety β helping verification teams catch constraint bugs
before simulation.
python bin/cnstlint.py -t <your_file.sv>
Rule Reference
- Lint Rules
- AF_CNST_NO_SOFT_FOREACH
- FUNC_CNST_DIST_COL_EQ
- FUNC_CNST_DIST_COL_SL
- FUNC_CNST_MISSING_CAST
- FUNC_CNST_WRONG_OPER_PRE
- CNST_ADDITIVE_OVERFLOW_IN_BOUND_VLT
- CNST_DIST_NO_SOLVE_BEFORE_VLT
- CNST_DIST_ON_ENUM_TYPE_VLT
- CNST_FOREACH_UNGUARDED_PREV_IDX_VLT
- CNST_NAME_CONVENTION
- CNST_NO_ENUM_IN_WITH_CLAUSE_VLT
- CNST_NO_LOCATOR_IN_CONSTRAINT_VLT
- CNST_NO_STRUCT_SUM_WITH_VLT
- CNST_RAND_CLASS_HANDLE_ARRAY_VLT
- CNST_RAND_MODE_LEFTOVER_VLT
- CNST_RAND_TWO_STATE_ONLY
- CNST_RANDC_DYNAMIC_EXCLUSION_VLT
- CNST_SUM_WITH_NARROW_NO_CAST_VLT
- CNST_UNIQUE_LARGE_ARRAY_VLT
- CNST_UNIQUE_MDA_ROW_SLICE_VLT