refactor(sv): removed the deduplication step for filelist#83
Merged
Conversation
…ted the related processing to slang.
Contributor
There was a problem hiding this comment.
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 insrc/parser/sv.cppand now append source args directly. - Updated
prepare_driverusage so filelists are included based onopts.filelistspresence (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.
Makiras
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
std::unordered_setand related deduplication logic for source files insrc/parser/sv.cpp, simplifying the process of appending source files and filelists to driver arguments. (src/parser/sv.cpp) [1] [2] [3] [4]src/parser/sv.cpp) [1] [2] [3]Testing improvements:
test_filelist_dependencies_are_used_without_explicit_module_nameto 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:
prepare_driverto more accurately reflect filelist usage. (src/parser/sv.cpp)