Skip to content

[SV] Add elaboration and run-time error/warning/info operations to SV dialect#9601

Merged
uenoku merged 3 commits intollvm:mainfrom
uenoku:dev/hidetou/sv-message
Feb 4, 2026
Merged

[SV] Add elaboration and run-time error/warning/info operations to SV dialect#9601
uenoku merged 3 commits intollvm:mainfrom
uenoku:dev/hidetou/sv-message

Conversation

@uenoku
Copy link
Member

@uenoku uenoku commented Feb 3, 2026

This commit refactors the SV dialect's severity message operations to distinguish between run-time (procedural) and elaboration-time (non-procedural) variants, aligning with IEEE 1800-2023 sections 20.10 and 20.11.

Severity message operations are now split into two variants: procedural ops with .procedural suffix (sv.fatal.procedural, sv.error.procedural, sv.warning.procedural, sv.info.procedural) that must be used within procedural regions like initial or always blocks, and non-procedural ops without suffix (sv.fatal, sv.error, sv.warning, sv.info) that execute during elaboration outside procedural regions for the consistency with the rest of SV dialect.

… dialect

This adds ErrorOp, WarningOp, and InfoOp for elaboration-time (non-procedural) messages, and ErrorProceduralOp, WarningProceduralOp, and InfoProceduralOp for run-time (procedural) messages.

This commit replaces existing usage of run-time message operations to renamed "*.procedural"
for the consistency with the rest of SV dialect.
Copy link
Member

@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for tracking down this! I didn't know about these ops until today. This is making me feel way more confident for things like eventual parameterization.

let summary = "`$" # severityLower # "` severity message task (run-time)";
let description = [{
This system task indicates a run-time }] # severityLower # [{. It must be
used within a procedural region (e.g., `initial`, `always` blocks).
Copy link
Member

Choose a reason for hiding this comment

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

Nit, can you include an 1800-2024 section citation for this and the other op?

sv.info
}
}

Copy link
Member

Choose a reason for hiding this comment

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

Nice test!

@uenoku uenoku force-pushed the dev/hidetou/sv-message branch from 86410ff to df60996 Compare February 4, 2026 00:58
@uenoku uenoku merged commit 81e180a into llvm:main Feb 4, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants