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

[MooreToCore] Fix variable op lowering of aggregate types #7481

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

maerhart
Copy link
Member

@maerhart maerhart commented Aug 8, 2024

No description provided.

Copy link
Contributor

@fabianschuiki fabianschuiki left a comment

Choose a reason for hiding this comment

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

Very nice!

Comment on lines 164 to 167
// TODO: Unsupport x/z, so the initial value is 0.
if (!init && cast<RefType>(op.getResult().getType()).getDomain() ==
Domain::FourValued)
return failure();
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering whether we should remove this check and generally lower everything to an i1 for now by mapping X and Z bits to 0. Verilator does a similar thing. Later, once we have proper support for four-valued types in HW/Comb/Seq, we could come back and adjust the lowering again.

Copy link

@cepheus69 cepheus69 Aug 9, 2024

Choose a reason for hiding this comment

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

I support choosing x / z pessimistic strategy. Once we support multi-valued types in the core IR. A new option could be added to control whether to enable the optimistic strategy - spread x / z value and preserve its value to calculate.

Copy link
Member Author

Choose a reason for hiding this comment

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

Adding a pass option to let the user decide whether x/z should be converted to 0 sounds like a reasonable approach to me. I'll leave it for a follow-up PR.

@maerhart maerhart merged commit 84d73b9 into main Aug 9, 2024
4 checks passed
@maerhart maerhart deleted the maerhart-moore-fix-variable-lowering branch August 9, 2024 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants