(Translated by https://www.hiragana.jp/)
[MooreToCore] Separate conversion pattern for moore.output by maerhart · Pull Request #7573 · llvm/circt · GitHub
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] Separate conversion pattern for moore.output #7573

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

maerhart
Copy link
Member

@maerhart maerhart commented Sep 3, 2024

Don't convert the output op in the module pattern because the operands will be of the wrong type since the body has not been converted yet, so it need to apply the hw output pattern afterwards anyway. Instead of relying on that pattern we should have a separate one for moore.output to hw.output that is applied once the rest of the body was converted. The HW output pattern is unnecessary because in the IR before conversion, no hw.output operation should be present (at least none that has a moore typed operand), thus its presence is only the consequence of a bad conversion process (if a target operation is inserted of which the operands are still of the source type, conversion casts should be inserted).

Don't convert the output op in the module pattern because the operands will be of the wrong type since the body has not been converted yet, so it need to apply the hw output pattern afterwards anyway. Instead of relying on that pattern we should have a separate one for moore.output to hw.output that is applied once the rest of the body was converted. The HW output pattern is unnecessary because in the IR before conversion, no hw.output operation should be present (at least none that has a moore typed operand), thus its presence is only the consequence of a bad conversion process (if a target operation is inserted of which the operands are still of the source type, conversion casts should be inserted).
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.

LGTM!

@maerhart maerhart merged commit c102ea8 into main Sep 3, 2024
4 checks passed
@maerhart maerhart deleted the maerhart-mooretocore-outputop-improvement branch September 3, 2024 17:12
@hailongSun2000
Copy link
Member

hailongSun2000 commented Sep 4, 2024

Sounds Great 🥳!

@cepheus69
Copy link

It is a leftover problem since we start to support materialize value with different type. The original Moore module operation limits its implementation way (module without port definition and need net or variable op to denote port, and there is no output op). So it is great to see this remaining problem solved!

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.

4 participants