Skip to content

Conversation

@Scheremo
Copy link
Contributor

@Scheremo Scheremo commented Sep 20, 2025

This commit fixes missing support for expression evaluation in severity system tasks as well as is the $display and $write tasks.

According to IEEE 1800-2023 Section 21.2.1 "The display and write tasks", it is legal to pass fully formatted expressions as the arguments of severity, display, and write tasks. In the previous implementation, it was assumed that the first argument would always be a StringLiteral in need of formatting; this commit adds a case distinction in the handling of these statements that ensures we first check whether we need to treat the arguments as a format string instance, or we are being handed a fully formatted string.

EDIT: @tobiasgrosser pointed out to me that this patch also fixes a few chipsalliance tests; I added those tests into builtins.sv. Thanks Tobias!

@Scheremo Scheremo marked this pull request as ready for review September 20, 2025 19:54
@Scheremo Scheremo force-pushed the pr-severity-rvalue branch 2 times, most recently from 9d3c4af to d576470 Compare September 20, 2025 20:13
This commit fixes missing support for expression evaluation in severity system tasks
as well as is the `$display` and `$write` tasks.

According to IEEE 1800-2023 Section 21.2.1 "The display and write tasks", it is legal
to pass fully formatted expressions as the arguments of severity, display, and write tasks.
In the previous implementation, it was assumed that the first argument would always be
a StringLiteral in need of formatting; this commit adds a case distinction in the handling
of these statements that ensures we first check whether we need to treat the arguments
as a format string instance, or we are being handed a fully formatted string.
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! Thanks for finding and fixing this!

@fabianschuiki fabianschuiki merged commit ffd1d5e into llvm:main Sep 20, 2025
7 checks passed
@Scheremo Scheremo deleted the pr-severity-rvalue branch October 21, 2025 07:49
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