| name | gf-fix | ||||
|---|---|---|---|---|---|
| description | Fix lint | ||||
| argument-hint | <file> | ||||
| allowed-tools |
|
Automatically fix lint errors in a SystemVerilog file using iterative lint-fix cycles.
-
Initial lint: Run Verilator on the specified file:
verilator --lint-only -Wall <file> 2>&1
-
Parse errors: Extract all errors and warnings from output
-
Fix loop (max 5 iterations):
- Read the file content
- For each error, apply the appropriate fix:
UNUSED: Remove unused signals or add/* verilator lint_off UNUSED */UNDRIVEN: Initialize the signal or connect it properlyWIDTH: Adjust bit widths to matchCASEINCOMPLETE: Add missing case items or defaultBLKSEQ: Change=to<=in always_ff blocks
- Use Edit tool to apply fixes
- Re-run lint to verify
-
Report results:
- Show before/after error counts
- List all fixes applied
- Note any remaining issues that need manual review
-
Safety: Always show diffs before applying changes. Never auto-approve destructive changes.