Repository navigation
fix(sim)!: preserve global precision in VCD and VPI - #1471
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: 78c3310e70
ℹ️ 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".
| if matches!(property, VPI_TIME_UNIT | VPI_TIME_PRECISION) { | ||
| return -12; | ||
| return with_runtime(|runtime| runtime.time_precision().exponent()) | ||
| .unwrap_or_else(|| celox_design::TimePrecision::default().exponent()); |
There was a problem hiding this comment.
Keep per-module scales for non-null VPI queries
When reference identifies a module whose declared scale differs from the design-wide minimum, this early return ignores the handle and reports the global precision for both properties. The VPI definitions define these as the module time unit and module time precision for an object handle; only a null-handle query returns the simulation-wide unit. For example, a 1us / 100ns module in a design with global precision 1fs now reports -15 for both instead of -6 and -7, causing VPI clients to apply the wrong scale to module-local timing. Preserve each reflected scope's unit and precision and use the global value only for null references.
Useful? React with 👍 / 👎.
VCD headers labeled every timestamp as 1ns and VPI reported 1ps regardless of the design. Carry the analyzer's global precision through symbolic modules and assembly into the runtime design, and retain it in native images. Use it for VCD headers and null-handle VPI queries, including restarted waveforms and NAPI compiled-code cache hits. Retain local module units and precisions in reflected scopes so module and signal VPI queries report their own scales (IEEE 1800-2023 37.10 and 38.6), including after native-image reload. Default Veryl and scale-free frontend ticks to 1ps, matching SV's default. Update Playground VCD downloads and document the waveform compatibility change. Bump the native image container to version 14 for the added metadata. Validation: - Precision regressions on native, Cranelift, Wasm, interpreter, tiered, and native/Cranelift parallel configurations; mixed-language designs, package precision, image roundtrips, and VCD restarts. - Existing VCD and time-query regressions, Celox and affected frontend/runtime unit tests, VPI tests, Rust doctests, and the portable compiler configuration. - Live cocotb attached-image integration. - Rebuilt NAPI; simulator, simulation, checkpoint, e2e and timing-addon JS tests; cached-waveform precision regression. - Playground waveform export test and TypeScript checks; formatting, Clippy, and Biome. BREAKING CHANGE: Default VCD headers now use 1ps instead of 1ns. Recompile native images for container version 14. SimModule and ElaboratedDesign struct literals must provide the added timing metadata fields; ReflectionScope literals must provide time_scale. Fixes #1463 Change-Id: Ia5ff9cd5337ce608ea2f6fdd56fda0711d1a21bb
78c3310 to
02ef771
Compare
Revision history
|
Merge Queue Status
This pull request spent 54 minutes 15 seconds in the queue, including 47 minutes 41 seconds running CI. Required conditions to merge
|
VCD headers labeled every timestamp as 1ns and VPI reported 1ps regardless
of the design. Carry the analyzer's global precision through symbolic modules
and assembly into the runtime design, and retain it in native images. Use it
for VCD headers and null-handle VPI queries, including restarted waveforms and
NAPI compiled-code cache hits. Retain local module units and precisions in
reflected scopes so module and signal VPI queries report their own scales
(IEEE 1800-2023 37.10 and 38.6), including after native-image reload.
Default Veryl and scale-free frontend ticks to 1ps, matching SV's default.
Update Playground VCD downloads and document the waveform compatibility
change. Bump the native image container to version 14 for the added metadata.
Validation:
BREAKING CHANGE: Default VCD headers now use 1ps instead of 1ns. Recompile
native images for container version 14. SimModule and ElaboratedDesign struct
literals must provide the added timing metadata fields; ReflectionScope literals
must provide time_scale.
Fixes #1463