-
Notifications
You must be signed in to change notification settings - Fork 298
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
[ImportVerilog][Moore] Support union type #7084
Conversation
e7df501
to
d40f528
Compare
@fabianschuiki @hailongSun2000 just like the name of class StructLikeType, I strongly recommand renaming struct StructMember in MooreTypes.h with struct StructLikeMember which is more proper for both struct and union types. |
Yeah, exactly! |
Refer to 10_clang format patches display.txt, clang let me add a return symbol. |
StructLikeMember{bar, logicType}}); | ||
auto s3 = UnpackedStructType::get( | ||
&context, | ||
{StructLikeMember{foo, bitType}, StructLikeMember{bar, bitDynArrayType}}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a few checks with UnionType
here and ensure that .getBitSize()
returns the correct numbers for unions? I think in contrast to structs you would want to return the size of the largest member in the union. That's worth quickly checking here 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for missing this part, code has been uploaded.
BTW, I found some keyword-tagged unsupported cases and submitted an issue with slang developer. These cases will need we do some type checking in pass importVerilog.
MikePopoloski/slang#1012
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding all the tests, and reporting issues upstream with Slang! This looks great 🥳
Translate union type only from slang to moore.
Add moore.union_create and morre.union_extract OPs.
More tests and Mem2Reg pass will be imporved.