Skip to content
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

[FIRRTL] Verify OpenAggs, fix agg-of-properties. #5508

Merged
merged 5 commits into from
Jun 28, 2023

Conversation

dtzSiFive
Copy link
Contributor

Add verifiers for both MLIR and FIR + tests.

Fixes #5494 .

Enforce general requirement that all elements of something
implementing FieldIDTypeInterface must also support
that interface.

This is true for FIRRTLBaseType, but not necessarily
true for all FIRRTLType's.

Test using Property types which don't implement this.

Fixes llvm#5494.
Per reviewer feedback, thanks!
// We require that elements of aggregates themselves
// support notion of FieldID, reject if the type does not.
if (!isa<hw::FieldIDTypeInterface>(type))
return emitError(loc, "bundle elements must support fieldID's, "
Copy link
Contributor

@rwy7 rwy7 Jun 28, 2023

Choose a reason for hiding this comment

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

I don't think the user is going to understand fieldIDs, maybe just leave it at "type 'blah' cannot be used as a field in a bundle"?

(side thought, It would be nice if we could render the type in FIRRTL-syntax, hey)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're totally right, I'll tighten this up, thank you!

(And 100% would be great to be able to render as FIRRTL!

That could be shared with the FIRRTL exporter, maybe, too?)

Copy link
Contributor

@rwy7 rwy7 left a comment

Choose a reason for hiding this comment

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

nice

Per reviewer feedback, thank you very much!
@dtzSiFive dtzSiFive merged commit 88feab3 into llvm:main Jun 28, 2023
@dtzSiFive dtzSiFive deleted the feature/verify-open-aggs branch June 28, 2023 16:24
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.

[FIRRTL] Crash parsing agg-of-properties or non-FieldIDTypeInterface
2 participants