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][CAPI] Fix undefined reference for mlirExportFIRRTL #5790

Merged
merged 2 commits into from
Aug 14, 2023

Conversation

SpriteOvO
Copy link
Member

@SpriteOvO SpriteOvO commented Aug 7, 2023

Commit 172afc3 added a new argument FIRVersion version to the mlirExportFIRRTL function, but didn't update its declaration. It breaks the compile for this function.

This PR removed that argument to fix the problem, since FIRVersion does not have a CAPI yet, and added a simple test to prevent regression.

@SpriteOvO SpriteOvO force-pushed the fix-firrtl-capi-export branch 3 times, most recently from 7fca40a to 44935b0 Compare August 7, 2023 14:43
Copy link
Contributor

@mikeurbach mikeurbach left a comment

Choose a reason for hiding this comment

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

Thanks for pointing this out, and especially for adding a test for this behavior. I left a couple comments, but getting this working with a unit test will be great.

lib/CAPI/ExportFIRRTL/ExportFIRRTL.cpp Outdated Show resolved Hide resolved
test/CAPI/firrtl.c Outdated Show resolved Hide resolved
test/CAPI/firrtl.c Outdated Show resolved Hide resolved
test/CAPI/firrtl.c Outdated Show resolved Hide resolved
test/CAPI/firrtl.c Outdated Show resolved Hide resolved
@SpriteOvO
Copy link
Member Author

Thanks for the reviews from @seldridge @mikeurbach, changes applied.

Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for adding the "latest" static function and for dramatically reducing the test.

// CHECK-NEXT: output out : UInt<32> @[- 4:45]
// CHECK-EMPTY:
// CHECK-NEXT: connect out, and(in_1, in_2) @[- 6:5]
}
Copy link
Member

Choose a reason for hiding this comment

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

This is a massive reduction in the size of this test from the original PR. Thanks! This helps test maintainability a lot.

Comment on lines +107 to +108
static FIRVersion latestFIRVersion() { return {3, 0, 0}; }

Copy link
Member

Choose a reason for hiding this comment

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

This was missing. Thanks!

@SpriteOvO SpriteOvO merged commit 17947c6 into llvm:main Aug 14, 2023
5 checks passed
@SpriteOvO SpriteOvO deleted the fix-firrtl-capi-export branch August 14, 2023 15:27
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.

4 participants