Skip to content

Fix & Feat: Improve Verilator 5.040 compatibility and fix FP compilation issues#56

Open
CelestialMelody wants to merge 4 commits intomathis-s:masterfrom
CelestialMelody:main/clstilmldy
Open

Fix & Feat: Improve Verilator 5.040 compatibility and fix FP compilation issues#56
CelestialMelody wants to merge 4 commits intomathis-s:masterfrom
CelestialMelody:main/clstilmldy

Conversation

@CelestialMelody
Copy link
Copy Markdown

Overview

This PR addresses several compatibility issues encountered when building SOOMRV with newer Verilator versions (specifically v5.040) and fixes a compilation error when the Floating Point Unit (FPU) is enabled.

Key Changes

  • Verilator Version Compatibility

  • Flag Handling: Resolved the issue where -Wno-GENUNNAMED caused errors in older versions (like v5.008) while being necessary for newer versions. The build system now handles this flag more gracefully to support a wider range of Verilator versions.

  • PROCASSINIT Fix: Fixed Warning-PROCASSINIT in Verilator 5.040. This warning was triggered by variables being initialized at the time of declaration and then reassigned within sequential logic.

  • Floating Point Unit (FPU) Fixes

  • Fixed a compilation error occurring when define ENABLE_FP is set in Config.sv.

  • Corrected the undefined variable INT_FSGNJ_S by updating it to the new BM_ prefix convention (consistent with the definitions in Include.sv).

  • Build System & Documentation

  • Added detailed explanations regarding the sources of header files in model_headers.h.

  • Since generated headers can vary across Verilator versions, a note was added recommending users to execute make prepare_header if linkage issues occur.

Impact

  • Build Success: Ensures the project compiles without errors on the latest Verilator 5.040 release.
  • Feature Support: Enables the Floating Point Unit to be used without manual code fixes.
  • Developer Experience: Provides clearer instructions on handling version-specific header discrepancies.

Verification Results

  • Successfully compiled on Verilator v5.040 with all warnings treated as errors.
  • Verified that the ENABLE_FP configuration compiles correctly and links with the RISC-V ISA sim libraries.

…ers.h. The content of the header files generated after executing "make soomrv" may vary across different Verilator versions. If related issues occur, you need to execute "make prepare_header" to resolve them.
…le is assigned an initial value at the time of declaration but is reassigned in sequential logic. Verilator treats such warnings as errors by default.
…-GENUNNAMED. Older versions, such as Verilator v5.008, do not support it, but for newer versions of Verilator like v5.040, an error will occur if it is not added.
…ll occur: "Can't find definition of variable: INT_FSGNJ_S". It seems that the naming has been modified to have the BM_ prefix, and this can be found in Include.sv.
@CelestialMelody CelestialMelody changed the title [main/clstilmldy] Fix & Feat: Improve Verilator 5.040 compatibility and fix FP compilation issues Fix & Feat: Improve Verilator 5.040 compatibility and fix FP compilation issues Jan 7, 2026
Copy link
Copy Markdown
Owner

@mathis-s mathis-s Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be better fixed by ignoring the warning instead of changing the code (also applies to all others)

Copy link
Copy Markdown
Owner

@mathis-s mathis-s Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is autogenerated, there shouldn't be any comments in here, these will be overwritten when regenerating. I'd prefer as few changes here as possible

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