Repository navigation
feat(sv): support %p for integral, string, handle and container values - #2423
Conversation
|
This pull request is part of a Mergify stack:
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31f876b6e4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
31f876b to
94b58d2
Compare
0ed3f7e to
91edc39
Compare
Revision history
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 94b58d297b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
94b58d2 to
cd0b4ea
Compare
91edc39 to
b2997d3
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd0b4ea06e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b2997d3 to
8f07632
Compare
cd0b4ea to
e080ef5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e080ef5658
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
8f07632 to
ce4dbef
Compare
e080ef5 to
484d94b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 484d94b906
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 484d94b906
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ce4dbef to
5edf99e
Compare
484d94b to
f04ebef
Compare
Implement the assignment pattern format (IEEE 1800-2023 21.2.1.6) for
`$display`, `$write`, the file output and severity tasks, `$sformatf`,
`$sformat` and `$swrite`. The analyzer rewrites each `%p` of a literal format
into a conversion the formatter already has: an integral value prints as
`%0d`, a real as an unformatted real, a string or string literal as its text
in quotes, a class handle as `null` or `@` and its handle, and a queue,
dynamic array or associative array as `%s` of a new heap operation that
renders `'{e0, e1}` or `'{k0:e0}` with decimal integral elements (X/Z digits
per 21.2.1.3), quoted strings and handles. The pattern is evaluated once on
every backend and needs no scheduled process. `%p` of enums, packed
structures, unpacked arrays and containers of enums or aggregates is rejected
instead of printing a plain integral value. A `%p` of a format read at run
time prints a string in quotes and any other value as `%0d`.
The shared pattern_format cases compare `$display` with `$sformatf`; xezim
0.11.3 agrees on queues, dynamic arrays, strings and integers. Verilator
5.052 prints integral elements in hexadecimal and string literals as values,
Icarus 13.0 lacks `%p` of containers, and xezim prints null elements as 0;
these are retained with standalone observations.
Change-Id: I71740968a3ed2d3674385e21b7d58766b7329f35
f04ebef to
8760a15
Compare
5edf99e to
0e81942
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8760a1560c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| !ty.members.is_empty() || !ty.unpacked_ranges.is_empty(), | ||
| ); | ||
| } | ||
| Ok(Pattern::Integral) |
There was a problem hiding this comment.
Check enum result types before the integral fallback
For typedef enum { A, B } e_t, both $display("%p", A) and $sformatf("%p", e_t'(1)) bypass the enum checks and are rewritten to %0d: enum constants have no variable shape, and casts are not inspected here. Enum-valued methods such as v.next() also reach this fallback. These expressions silently produce numeric output instead of the explicit unsupported-enum diagnostic provided for enum variables. Use the existing enums::domain expression-type resolver, which already recognizes constants, casts and enum methods, before selecting the integral conversion.
Useful? React with 👍 / 👎.
Implement the assignment pattern format (IEEE 1800-2023 21.2.1.6) for
$display,$write, the file output and severity tasks,$sformatf,$sformatand$swrite. The analyzer rewrites each%pof a literal formatinto a conversion the formatter already has: an integral value prints as
%0d, a real as an unformatted real, a string or string literal as its textin quotes, a class handle as
nullor@and its handle, and a queue,dynamic array or associative array as
%sof a new heap operation thatrenders
'{e0, e1}or'{k0:e0}with decimal integral elements (X/Z digitsper 21.2.1.3), quoted strings and handles. The pattern is evaluated once on
every backend and needs no scheduled process.
%pof enums, packedstructures, unpacked arrays and containers of enums or aggregates is rejected
instead of printing a plain integral value. A
%pof a format read at runtime prints a string in quotes and any other value as
%0d.The shared pattern_format cases compare
$displaywith$sformatf; xezim0.11.3 agrees on queues, dynamic arrays, strings and integers. Verilator
5.052 prints integral elements in hexadecimal and string literals as values,
Icarus 13.0 lacks
%pof containers, and xezim prints null elements as 0;these are retained with standalone observations.
Depends-On: #2403