Skip to content

Fix prefix_macros.sh to handle .svh headers, pic_map_auto.h, and RV_BUILD_AHB_LITE macro#449

Open
MainakSil wants to merge 1 commit into
chipsalliance:mainfrom
MainakSil:main
Open

Fix prefix_macros.sh to handle .svh headers, pic_map_auto.h, and RV_BUILD_AHB_LITE macro#449
MainakSil wants to merge 1 commit into
chipsalliance:mainfrom
MainakSil:main

Conversation

@MainakSil

Copy link
Copy Markdown

Summary

This PR fixes several missing cases in tools/prefix_macros.sh that can lead to naming conflicts when multiple VeeR instances are used in the same design.

Changes

1. Support for additional file types

  • Extended file matching to include:

    • .svh
    • .h
  • Ensures all relevant SystemVerilog header files are processed.

2. Fix for pic_map_auto.h

  • Converts pic_map_auto.hpic_map_auto.svh
  • Ensures it is correctly prefixed via the existing renaming flow
  • Updates all corresponding include references
  • Avoids double prefixing by performing conversion before final file renaming

3. Handle .svh include files

  • Ensures instance-specific headers (e.g. el2_dec_csr_equ_*.svh) are uniquely prefixed
  • Updates corresponding `include statements in RTL sources

4. Explicit handling of RV_BUILD_AHB_LITE

  • Adds prefixing for this macro to avoid conflicts across multiple instances
  • Updates both definition and usage sites (e.g. `ifdef conditions)

Motivation

The current script misses certain headers and macros, which can cause:

  • Name collisions across multiple VeeR instances
  • Incorrect or conflicting include resolutions during compilation

This PR ensures consistent and complete prefixing across all relevant design artifacts.

Notes

  • All transformations are applied before the final file renaming step to preserve the intended script flow
  • Changes are minimal and scoped to the prefixing logic only

Testing

  • Verified script execution on design sources with .sv, .vh, .svh, and .h files
  • Confirmed correct prefixing of headers, macros, and module names
  • Ensured no duplicate prefixing occurs for pic_map_auto

@linux-foundation-easycla

linux-foundation-easycla Bot commented Apr 14, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@MainakSil

Copy link
Copy Markdown
Author

Requesting reviewers to provide the approving review.

Copilot AI review requested due to automatic review settings May 12, 2026 09:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review is ineligible. To be eligible to request a review, you need a paid Copilot license, or your organization must enable Copilot code review.

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