Repository navigation
fix(sv): report %t in the smallest time precision of the design - #1825
Conversation
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: 5bc3b03cc9
ℹ️ 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".
|
Queued — the merge queue status continues in this comment ↓. |
5bc3b03 to
d4c98a3
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d4c98a3868
ℹ️ 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".
d4c98a3 to
a2dcd97
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a2dcd974c1
ℹ️ 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".
%t printed its value in the time unit of the calling scope. Without $timeformat, IEEE 1800-2023 20.4.3 (Table 20-3) reports it in the smallest time precision of the design, in which the simulation counts its time. The analyzer now scales each value a %t of a display, file output or severity task converts by its scope's ticks per time unit, as it does for $time; a scope whose unit is the global precision is unchanged. `#1.5` under `timescale 1ns/1ps then $display("%0t", $realtime) prints 1500, as Icarus and Verilator do, instead of 2. A string literal converts as its packed bytes and keeps any literal form; a signed value keeps its sign. A string variable has no time to report and is rejected instead of printing its storage handle. Fixes #1821 Change-Id: Ied354a869434803679f082169c0fdca8028a653f
Change-Id: Ia98f17bfaa1c302d8af5cbe9a143c2c42990face
a2dcd97 to
f2c286d
Compare
Merge Queue Status
This pull request spent 1 hour 16 minutes 14 seconds in the queue, including 51 minutes 57 seconds running CI. Required conditions to merge
|
Part of #1123. Fixes #1821.
IEEE 1800-2023 20.4.3, Table 20-3: without
$timeformat,%treports time in the smallest time precision of all the design's time scales, with no fractional digits and a minimum field width of 20. Celox printed the value in the time unit of the calling scope instead.`timescale 1ns/1ps, after#1.5$display("%0t", $realtime)21500$display("%t", $time)22000$display("%0t", n)withint n = 777000%0tin a1us/1usmodule, global precision 1 ps, of222000000Change
$timeand$realtimethe calling scope's ticks per time unit, where a tick is one unit of the global precision.%tvalues now get the same factor.$display/$write(andb/o/hforms),$fdisplay/$fwrite,$error/$warning/$info/$fatalor Veryl$assertcall, it reads the template's conversions. Each value a%tconverts becomesvalue * 64'd<ticks>.$realtimeis multiplied as a real and printed with precision 0.$displayin a package subroutine uses the package's unit; checked against Verilator.Behaviour change: a design without any time scale uses Celox's documented 1 ns / 1 ps defaults, so
%tnow reports picoseconds there (%tof 7 prints 7000). Icarus prints 7 there only because its own default is 1 s / 1 s. The existing casetime_format_consumes_its_expression_argumenttherefore now states`timescale 1ns/1ns, so all three simulators keep agreeing on it.$timeformatitself remains unsupported (rejected by name), so there are no overrides to cover.Perf
Optimized SIR (
TraceOptions::post_optimized_sir, hashed Debug text) is byte-identical between base 07999a2 and this branch for 658 of the 660 SV suite cases, timed and untimed. The two that differ are the new cases.Tests
time_format_defaults_to_the_smallest_precision(timed,$time,$realtime, anint, the default width)time_format_scales_each_scope_to_the_smallest_precision(1 ns / 1 ps and 1 us / 1 us modules)system_functions.jsonreports gain only the two records.--test systemverilog: 4286 passed. The analyzer, frontend-sv and test-suite tests andretained_reportspass; sv-tests matchesexpected.tsv.