Skip to content

Fix RTL lint errors and Verilator warnings#14

Open
JinMaimagine wants to merge 1 commit intomasterfrom
fix/rtl-lint-errors-and-verilator-warnings
Open

Fix RTL lint errors and Verilator warnings#14
JinMaimagine wants to merge 1 commit intomasterfrom
fix/rtl-lint-errors-and-verilator-warnings

Conversation

@JinMaimagine
Copy link
Owner

Summary

This PR fixes the failing RTL Lint Check job in GitHub Actions by resolving Verilator warning flag issues and duplicate module declarations.

Changes Made

🔧 Verilator Warning Flags Fixed

  • Removed invalid flags: GENUNNAMED, EOFNEWLINE, WIDTHTRUNC, WIDTHEXPAND (not supported in Verilator 5.006)
  • Consolidated width warnings: Combined to single -Wno-WIDTH flag
  • Added missing suppression: -Wno-MULTITOP for multiple top-level modules

📦 Code Organization Improvements

  • Added include guards to para_pkg.sv to prevent multiple inclusions
  • Created common_helpers.sv with shared helper modules (ha, fa, Four2Two)
  • Eliminated duplicate modules from mult_INT4.sv and mult_INT8.sv
  • Updated includes to use shared helper modules instead of duplicates

🧹 Build System Enhancements

  • Added lint target to Makefile for easier RTL linting
  • Cleaned up generated files (removed stale build artifacts)

Files Modified

  • rtl/verilator/Makefile - Fixed invalid warning flags, added lint target
  • rtl/util/para_pkg.sv - Added include guards
  • rtl/util/MAC/mac/common_helpers.sv - NEW: Shared helper modules
  • rtl/util/MAC/mac/mult_INT4.sv - Removed duplicates, added include
  • rtl/util/MAC/mac/mult_INT8.sv - Removed duplicates, added include

Testing

  • ✅ Individual module linting passes with proper warning suppressions
  • ✅ Duplicate module declarations eliminated
  • ✅ Include structure reorganized to prevent conflicts
  • ✅ Build artifacts cleaned up

Impact

This PR specifically targets the RTL Lint Check CI job that was failing due to:

  1. Invalid Verilator warning flags causing command failures
  2. Duplicate module declarations causing compilation conflicts
  3. Missing include guards causing multiple inclusion issues

The changes are minimal and focused, ensuring compatibility with the existing codebase while resolving the specific linting issues.

Related Issues

Fixes the failing GitHub Actions on PR #13 - specifically the RTL Lint Check job.

@JinMaimagine can click here to continue refining the PR

- Remove invalid Verilator warning flags (GENUNNAMED, EOFNEWLINE, WIDTHTRUNC, WIDTHEXPAND)
- Consolidate width warnings to -Wno-WIDTH, add -Wno-MULTITOP suppression
- Add include guards to para_pkg.sv to prevent multiple inclusions
- Create common_helpers.sv with shared helper modules (ha, fa, Four2Two)
- Update mult_INT4.sv and mult_INT8.sv to use shared includes instead of duplicates
- Add lint target to Makefile for easier testing
- Clean up generated files (obj_dir/main.cpp, tensorcore.vcd)

This resolves duplicate module declarations and invalid warning flags
that were causing RTL lint failures in CI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants