Skip to content

[FIRRTL] FIRParser: parse tagExtract operations #8728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

youngar
Copy link
Member

@youngar youngar commented Jul 17, 2025

Depends on #8724

@youngar youngar added the FIRRTL Involving the `firrtl` dialect label Jul 17, 2025
@youngar youngar force-pushed the firrtl-enum-tagextract-parsing branch 2 times, most recently from 2bacd94 to 1e1a6ce Compare July 17, 2025 23:06
Comment on lines 3979 to 3983
// Check argument is an enum-type value.
if (!type_isa<FEnumType>(input.getType()))
return emitError(startTok.getLoc(),
"expected enum-type expression in 'tagExtract', got ")
<< input.getType();
Copy link
Member Author

@youngar youngar Jul 17, 2025

Choose a reason for hiding this comment

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

Its not clear to me if we should be checking this here or relying on the op verifiers. I think I will remove this check for now.

@youngar youngar force-pushed the firrtl-enum-tagextract-parsing branch from 1e1a6ce to 970dbec Compare July 17, 2025 23:08
Comment on lines 2129 to 2130
if (isLeadingStmt)
return emitError("unexpected tagExtract() as start of statement");
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think I need this but its a little unclear. Without it you get a flow checking error.

Comment on lines +2127 to +2128
if (requireFeature(missingSpecFIRVersion, "tagExtract"))
return failure();
Copy link
Member Author

Choose a reason for hiding this comment

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

It would be nice to parse this as a prim op and save some typing, but then you can't check for the spec version.

@youngar youngar force-pushed the firrtl-enum-tagextract-parsing branch from 970dbec to d874be1 Compare July 17, 2025 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FIRRTL Involving the `firrtl` dialect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant