-
Notifications
You must be signed in to change notification settings - Fork 383
[MooreToCore] Add support for $fatal #8936
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
Conversation
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.
Great start with first PR - wohoo!
If it's not too much effort would be great to support the different variants of severity warning/error so we don't need to revisit this next time round - but they seem to be able to share similar lowering with minor changes for each/
| ConversionPatternRewriter &rewriter) { | ||
|
|
||
| if (op.getSeverity() == Severity::Fatal) { | ||
| auto prefix = rewriter.create<sim::FormatLitOp>(op.getLoc(), "Error: "); |
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.
Nit: would make sense to have "Fatal: " as there is an Error level
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.
Hi Samuel, adapted the prefix to Fatal: for fatal severity.
| rewriter.replaceOpWithNewOp<sim::PrintFormattedProcOp>(op, message); | ||
| return success(); | ||
| } | ||
| return failure(); |
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.
Would it be possible to add support to handle error and warning in the same way - just with modified prefixes?
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.
Add a switch-case statement to match for Warning and Error. Extended the test as well.
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.
Nice!
| // CHECK-LABEL: @SeverityToPrint | ||
| func.func @SeverityToPrint() { | ||
| // CHECK: [[MSG:%.*]] = sim.fmt.lit "Error condition met!\n" | ||
| // CHECK-NEXT: [[PFX:%.*]] = sim.fmt.lit "Error: " |
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.
Nit: will need to extend tests for other cases if added?
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.
Test has been extended.
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.
LGTM - thanks for the corrections - will merge pending any additional comments from @fabianschuiki?
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.
Very neat! Thanks for implementing this @Scheremo 🥳. Want us to merge this for you?
Yes please! Thanks again for all your help @fabianschuiki @cowardsa, and my pair programming partner @JosseVanDelm |
This PR implements support for
$fatalsystem tasks in system verilog as discussed in issue #8934.Thanks for generous support by @JosseVanDelm @towoe @cowardsa