[ImportVerilog] Convert arity-based system task to named-based matching#9923
Open
fabianschuiki wants to merge 1 commit intomainfrom
Open
[ImportVerilog] Convert arity-based system task to named-based matching#9923fabianschuiki wants to merge 1 commit intomainfrom
fabianschuiki wants to merge 1 commit intomainfrom
Conversation
uenoku
reviewed
Mar 12, 2026
|
|
||
| // Real math functions (all take 1 real argument) | ||
| if (name == "$ln") | ||
| return convertRealMathBI<moore::LnBIOp>(*this, loc, name, args); |
Member
There was a problem hiding this comment.
I sense a potential circt-tablegen opportunity ... 😏
There was a problem hiding this comment.
SystemSubroutine has a knownNameId member that is an enum that you can switch on or put in a hash table, rather than a big linear scan of string compares.
Instead of first checking the number of arguments of a system task or function, and only then checking the name, create one big name-based dispatch before going into details about the number of arguments. This allows us to produce better error messages about the actual system tasks that aren't supported yet, instead of failing on things like `EmptyArgument` expression conversions. It also allows us to better handle system tasks that can have a variable number of arguments. Sorry for the churn everyone!
83d4185 to
da7c031
Compare
uenoku
approved these changes
Mar 12, 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.
Instead of first checking the number of arguments of a system task or function, and only then checking the name, create one big name-based dispatch before going into details about the number of arguments. This allows us to produce better error messages about the actual system tasks that aren't supported yet, instead of failing on things like
EmptyArgumentexpression conversions. It also allows us to better handle system tasks that can have a variable number of arguments.Sorry for the churn everyone!