RTL files (rtl/) are linted with slang -Weverything for maximum strictness — this catches
IEEE 1800 §9.2.2.4 violations (e.g., always_ff + initial on same signal) that only VCS
enforces at compile time. TB files (sim/) use --allow-dup-initial-drivers for flexibility.
Report all violations with file, line, rule, and severity.
See references/verilator-warnings.md for detailed Verilator warning categories and waiver format.
- Run supplementary convention checks via Bash CLI:
- Use
{plugin_root}/skills/rtl-lint-check/scripts/check_conventions.sh {files} ({plugin_root} = plugin root resolved from .rat/state/spawn-context.json) for automated convention checking
- Or manually grep for:
reg/wire declarations, port suffixes _i/_o, clk_i/rst_ni, missing u_/gen_ prefixes, declarations after logic blocks (forward reference risk)
- Merge all results; report violations grouped by file then by severity
- Return PASS (zero violations) or FAIL (violation count + list)
- Use
templates/lint-report.md as the report format template
- If waiver file
.verilator.vlt exists, apply waivers before final verdict (see templates/verilator-waiver.vlt for waiver format)
Verilator waiver file (.verilator.vlt) for intentional suppressions:
`verilator_config
lint_off -rule UNUSED -file "rtl/reserved/reserved.sv" -lines 10-15
lint_off -rule WIDTH -file "rtl/datapath/datapath.sv" -match "Operator *"
Generate waiver template: verilator --lint-only -Wall --waiver-output verilator.vlt rtl/*/*.sv
See references/verilator-warnings.md for complete warning reference.
1---2name: rtl-lint-check3description: Lint RTL with Verilator, Verible, and slang; report-only quick check for 'run lint', pre-commit, or phase-gate verification (no fixing).4---56<Purpose>7Run three complementary lint tools on target RTL files via Bash CLI:8- **Verilator** (synthesizability + semantic): catches LATCH, BLKANDNBLK, WIDTH, MULTIDRIVEN9- **Verible** (style/syntax): catches formatting, naming, structure issues10- **slang** (semantic/IEEE 1800 compliance): catches type errors, port mismatches, `always_ff` multi-driver violations1112RTL files (`rtl/`) are linted with slang `-Weverything` for maximum strictness — this catches13IEEE 1800 §9.2.2.4 violations (e.g., `always_ff` + `initial` on same signal) that only VCS14enforces at compile time. TB files (`sim/`) use `--allow-dup-initial-drivers` for flexibility.1516Report all violations with file, line, rule, and severity.17See `references/verilator-warnings.md` for detailed Verilator warning categories and waiver format.18</Purpose>1920<Use_When>21- Verifying lint status of any RTL file before commit or phase gate22- Quick sanity check during development23- Generating lint report for review24</Use_When>2526<Do_Not_Use_When>27- Lint fixing is also needed (use rtl-p4-implement or rtl-p4s-refactor which include fix cycles)28- Full verification suite needed (use rtl-p5s-func-verify or rtl-p4s-unit-test)29</Do_Not_Use_When>3031<Why_This_Exists>32Three complementary lint tools catch different issue classes:33- **Verilator** is the most widely-used open-source linter; it catches synthesizability issues (latches, blocking/non-blocking mix, width mismatches) that style linters miss entirely.34- **Verible** catches style and formatting issues; **slang** catches IEEE 1800 semantic issues.35Running all three gives comprehensive coverage: synthesizability + style + semantics.36</Why_This_Exists>3738<Coding_Convention_Requirements>39Lint checks MUST enforce the project coding conventions (CLAUDE.md):40- Port prefix: `i_` (input), `o_` (output), `io_` (bidirectional) — NOT suffix `_i`, `_o`41- Clock: `clk` (single domain) or `{domain}_clk` (multiple domains, e.g., `sys_clk`) — NOT `clk_i`42- Reset: `rst_n` (single domain) or `{domain}_rst_n` (multiple domains, e.g., `sys_rst_n`) — NOT `rst_ni`43- `logic` only — `reg`/`wire` usage flagged as violation44- Declaration order (IEEE 1800 §12.5): all `logic`/`typedef`/`localparam` must appear before `assign`/`always` blocks — forward references flagged as violation45- Instance prefix: `u_` — missing prefix flagged46- Generate prefix: `gen_` — missing prefix flagged47Note: Verible and slang may not catch all convention violations natively.48lint-checker MUST perform a supplementary grep-based check for naming conventions.49</Coding_Convention_Requirements>5051<Execution_Policy>52- lint-checker runs all three tools in parallel on the target file(s) via Bash CLI53- Prefer replayable wrapper: `lint/scripts/run_lint.sh` (creates `lint/lint/replay/run_lint_*_latest.sh`)54- Additionally checks naming conventions not caught by standard tools55- Results merged and de-duplicated56- Zero-error gate: skill reports PASS or FAIL with full violation list57</Execution_Policy>5859<Steps>601. Identify target files (single file, directory, or glob)612. Run **Verilator** via Bash CLI (synthesizability lint):62 ```bash63 verilator --lint-only -Wall -Wpedantic -sv {files}64 ```65 - Critical warnings (MUST fix): BLKANDNBLK, LATCH, CASEINCOMPLETE, MULTIDRIVEN66 - Major warnings: WIDTH, UNDRIVEN, SYNCASYNCNET, UNSIGNED, CMPCONST67 - See `references/verilator-warnings.md` for full category list683. Run **Verible** via Bash CLI (style lint):69 ```bash70 verible-verilog-lint --rules_config .verible_lint.cfg {files}71 ```724. Run **slang** via Bash CLI (semantic lint):73 ```bash74 # RTL (maximum strictness — catches VCS ICPD errors):75 slang -Weverything {rtl_files}76 # TB (relaxed — allows initial + always_ff on same signal):77 slang --allow-dup-initial-drivers {tb_files}78 ```79 The `run_lint.sh` wrapper auto-detects RTL vs TB based on file paths.804.5. If commercial lint signoff is requested, run SpyGlass lint:81 ```bash82 lint/scripts/run_lint.sh --tool spyglass --top {top} -f rtl/filelist_top.f --outdir lint/lint83 ```84855. Run supplementary convention checks via Bash CLI:86 - Use `{plugin_root}/skills/rtl-lint-check/scripts/check_conventions.sh {files}` (`{plugin_root}` = plugin root resolved from `.rat/state/spawn-context.json`) for automated convention checking87 - Or manually grep for: `reg`/`wire` declarations, port suffixes `_i`/`_o`, `clk_i`/`rst_ni`, missing `u_`/`gen_` prefixes, declarations after logic blocks (forward reference risk)886. Merge all results; report violations grouped by file then by severity897. Return PASS (zero violations) or FAIL (violation count + list)90 - Use `templates/lint-report.md` as the report format template91 - If waiver file `.verilator.vlt` exists, apply waivers before final verdict (see `templates/verilator-waiver.vlt` for waiver format)92</Steps>9394<Tool_Usage>95```96Task(subagent_type="rtl-agent-team:lint-checker",97 prompt="Run Verilator, Verible, and slang lint on rtl/ via Bash CLI. Verilator: --lint-only -Wall -Wpedantic -sv. Verible: --rules_config .verible_lint.cfg. slang: -Weverything for RTL and --allow-dup-initial-drivers for TB. Also check naming conventions: i_/o_ port prefixes, {domain}_clk/{domain}_rst_n, logic not reg/wire, u_ instance prefix. Report all violations grouped by file and severity (Critical/Major/Minor). Return PASS or FAIL summary.")98```99</Tool_Usage>100101<Examples>102<Good>103lint-checker runs all three tools via Bash CLI, finds 3 Verible style violations, 1 slang unused-variable warning,104and 2 convention violations (port `data_i` should be `i_data`, `clk` should be `sys_clk` in multi-domain context);105returns FAIL with exact line numbers and rule names.106</Good>107<Bad>108Running only one lint tool and claiming "lint clean" — misses semantic issues caught only by slang.109Not checking naming conventions — allows `clk_i`, `data_o` to pass lint despite project rules.110</Bad>111</Examples>112113<Escalation_And_Stop_Conditions>114- Verible not installed → halt and run `/rtl-agent-team:rat-setup` (official binary releases: https://github.com/chipsalliance/verible/releases)115- slang not installed → halt and run `/rtl-agent-team:rat-setup` (official binary/source instructions: https://sv-lang.com/user-manual.html#getting-the-binary)116- Lint rules config file missing → use default rules, note this in report117- Convention violations found → report alongside tool violations, same severity118</Escalation_And_Stop_Conditions>119120<Final_Checklist>121- [ ] All three lint tools ran: Verilator, Verible, and slang via Bash CLI122- [ ] Verilator critical warnings (LATCH, BLKANDNBLK) treated as hard errors123- [ ] Naming convention checks ran (port prefix, clock, reset, logic, instance prefix)124- [ ] Results merged, de-duplicated, and reported by severity125- [ ] PASS/FAIL clearly stated126- [ ] Violation list includes file:line:rule:tool for each issue127</Final_Checklist>128129<Advanced>130Project lint config: .verible_lint.cfg in repo root. Override rules only with user approval.131slang --lint-only treats warnings as errors in CI mode.132Convention check script: `{plugin_root}/skills/rtl-lint-check/scripts/check_conventions.sh` — ready for CI integration.133See `examples/lint-output-example.txt` for sample merged lint output across all tools.134135Verilator waiver file (`.verilator.vlt`) for intentional suppressions:136```137`verilator_config138lint_off -rule UNUSED -file "rtl/reserved/reserved.sv" -lines 10-15139lint_off -rule WIDTH -file "rtl/datapath/datapath.sv" -match "Operator *"140```141Generate waiver template: `verilator --lint-only -Wall --waiver-output verilator.vlt rtl/*/*.sv`142See `references/verilator-warnings.md` for complete warning reference.143</Advanced>