Skip to content

refactor(sv): removed the deduplication step for filelist#83

Merged
Makiras merged 1 commit into
masterfrom
remove-filelist-deduplication
Apr 23, 2026
Merged

refactor(sv): removed the deduplication step for filelist#83
Makiras merged 1 commit into
masterfrom
remove-filelist-deduplication

Conversation

@FrankOu2001
Copy link
Copy Markdown
Contributor

This pull request simplifies the handling of source files and filelists in the SystemVerilog parser by removing logic that deduplicated source files and tracked them with a set. Instead, all specified source files are now appended directly to the driver arguments. Additionally, a new unit test is added to ensure that filelist dependencies are correctly used even when no explicit module name is provided.

Refactoring and simplification:

  • Removed the use of std::unordered_set and related deduplication logic for source files in src/parser/sv.cpp, simplifying the process of appending source files and filelists to driver arguments. (src/parser/sv.cpp) [1] [2] [3] [4]
  • Updated function signatures and internal logic to reflect the removal of deduplication, passing only the required arguments. (src/parser/sv.cpp) [1] [2] [3]

Testing improvements:

  • Added a new unit test test_filelist_dependencies_are_used_without_explicit_module_name to verify that filelist dependencies are correctly handled when no explicit module name is specified. (test/test_parser_sv_unit.cpp) [1] [2]

Minor logic update:

  • Adjusted the argument passed to prepare_driver to more accurately reflect filelist usage. (src/parser/sv.cpp)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the SystemVerilog parser’s driver-argument construction by removing the previous source-file de-duplication logic and updates driver preparation so filelists are used even when no explicit module name is provided. It also adds a unit test to validate that filelist-provided dependencies (e.g., macro defines) are respected for default-top inference.

Changes:

  • Removed std::unordered_set-based source de-duplication in src/parser/sv.cpp and now append source args directly.
  • Updated prepare_driver usage so filelists are included based on opts.filelists presence (not based on explicit module requests).
  • Added a unit test ensuring filelist dependencies are applied when inferring the default top module.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/parser/sv.cpp Simplifies argv building and adjusts filelist inclusion logic when preparing the slang driver.
test/test_parser_sv_unit.cpp Adds a regression test for filelist dependency handling without an explicit module name.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/parser/sv.cpp
Comment thread src/parser/sv.cpp
Comment thread src/parser/sv.cpp
@Makiras Makiras merged commit bece7af into master Apr 23, 2026
16 checks passed
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.

3 participants