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] Lower moore.net to llhd.sig #7652

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

fabianschuiki
Copy link
Contributor

Lower moore.net operations to the corresponding llhd.sig, similar to how moore.variable is lowered. This currently only makes sense for "wire" nets, since it's not yet clear how all the other net types map to LLHD.

Lower `moore.net` operations to the corresponding `llhd.sig`, similar to
how `moore.variable` is lowered. This currently only makes sense for
"wire" nets, since it's not yet clear how all the other net types map to
LLHD.
Copy link
Member

@maerhart maerhart left a comment

Choose a reason for hiding this comment

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

Nice! 🎉

return rewriter.notifyMatchFailure(loc, "invalid net type");

// TODO: Once the core dialects support four-valued integers, this code
// will additionally need to generate an all-X value for four-valued nets.
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't it be initialized to all Z once we support four-valued types? I think the standard mentions that as the default value in case there are no drivers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is a good point! I'm also starting to wonder how we'll deal with multiple concurrent drivers on a net. That doesn't easily map to llhd.sig at the moment. It's more like you'd have a list of multiple llhd.sig, one for each driver, and you'd then have a conflict resolution step that merges all the drivers into a final net value. We might need a slightly different lowering in the future 🤔

@fabianschuiki fabianschuiki merged commit 8c577d5 into main Oct 2, 2024
4 checks passed
@fabianschuiki fabianschuiki deleted the fschuiki/moore-net-to-core branch October 2, 2024 17:13
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.

2 participants