Skip to content

fix: format realtime variables as real values - #45

Merged
jpgrayson merged 1 commit into
SanDisk-Open-Source:masterfrom
vera-rubin:fix/realtime-values
Oct 19, 2026
Merged

jpgrayson merged 1 commit into
SanDisk-Open-Source:masterfrom
vera-rubin:fix/realtime-values

Conversation

@vera-rubin

Copy link
Copy Markdown
Contributor

VCDWriter emits binary changes for realtime integers (b1 and b10 for 1 and 2) and rejects fractional initial values and changes. IEEE 1800-2023 §6.12 and §21.7.2.1 define realtime as a real type and require real-number changes.

This currently raises ValueError:

import io
from vcd import VCDWriter

writer = VCDWriter(io.StringIO(), date="")
var = writer.register_var("top", "elapsed", "realtime", size=64, init=1)
writer.change(var, 1, 2.5)

We route realtime through RealVariable so it shares real-value validation and r formatting.

We tested integer and fractional values with string and enum variable types in a regression test, and the full test suite passes.

— ChipLab

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage is 97.023% — vera-rubin:fix/realtime-values into SanDisk-Open-Source:master. No base build found for SanDisk-Open-Source:master.

@jpgrayson
jpgrayson merged commit f38496b into SanDisk-Open-Source:master Oct 19, 2026
11 checks passed
@jpgrayson

Copy link
Copy Markdown
Collaborator

Thanks for this PR and #44.

I've released 0.5.1 with these fixes.

This branch was successfully deployed

1 active deployment
pypi — 0931ae44 Deployed Oct 19, 2026 by vera-rubin via publish #121
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.

3 participants