From 0628003f5a480e7e79dd5288c13c63b1b2783a89 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2026 14:40:12 +0000 Subject: [PATCH 1/2] test(xezim): update xezim digest to bbbc57c --- flake.lock | 8 ++++---- flake.nix | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 7ff4b0c07e7..5bb3d979704 100644 --- a/flake.lock +++ b/flake.lock @@ -68,17 +68,17 @@ "xezim": { "flake": false, "locked": { - "lastModified": 1793160411, - "narHash": "sha256-bDcUa26tHiq0Q2Z7kOOQpSLDtnqgHhYia07KL4q8nHs=", + "lastModified": 1793192344, + "narHash": "sha256-MM6g4LbdEjYdItX1Gy6xuWM7V6WffoMkwcQheBkO3V0=", "owner": "aionhw", "repo": "xezim", - "rev": "d491f9480123895e064ee4b37173a9d0f5d7383b", + "rev": "bbbc57cd542cc022b9eb5673df5d95d558c86c32", "type": "github" }, "original": { "owner": "aionhw", "repo": "xezim", - "rev": "d491f9480123895e064ee4b37173a9d0f5d7383b", + "rev": "bbbc57cd542cc022b9eb5673df5d95d558c86c32", "type": "github" } } diff --git a/flake.nix b/flake.nix index 1ea755e177e..6cba661ecc9 100644 --- a/flake.nix +++ b/flake.nix @@ -15,7 +15,7 @@ # The xezim reference simulator for the shared test suite, pinned by # revision so that Renovate proposes updates. xezim = { - url = "github:aionhw/xezim/d491f9480123895e064ee4b37173a9d0f5d7383b"; + url = "github:aionhw/xezim/bbbc57cd542cc022b9eb5673df5d95d558c86c32"; flake = false; }; }; From aa919e2786c29fbd3ce441337a89a4b42df797b4 Mon Sep 17 00:00:00 2001 From: tignear Date: Thu, 29 Oct 2026 00:14:54 +0900 Subject: [PATCH 2/2] perf(vpi): skip unused value format metadata Suppressed reads and callback deliveries still resolved signal values and metadata. Return without that work for vpiSuppressVal, retaining the owning thread check before accessing caller storage. Only narrow integer output needs signedness for sign extension; skip that lookup for scalar, string, vector and wider integer formats. Validation: signed integer/Z regression, all 68 VPI unit/API tests, all 10 ignored cocotb integration tests, all-target clippy with warnings denied, and workspace formatting. Change-Id: I78c2f11a5a286f8d1b38ef7ed5b6aa85aab930d7 --- crates/celox-vpi/src/lib.rs | 43 +++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/crates/celox-vpi/src/lib.rs b/crates/celox-vpi/src/lib.rs index 58899198424..e436f821580 100644 --- a/crates/celox-vpi/src/lib.rs +++ b/crates/celox-vpi/src/lib.rs @@ -1537,6 +1537,11 @@ unsafe fn write_snapshot_value( if value.is_null() || reference.is_null() { return; } + // Safety: checked non-null above; the callback owns its value record. + let value = unsafe { &mut *value }; + if value.format == VPI_SUPPRESS_VAL { + return; + } // Safety: the caller has selected this host and keeps the callback's // object handle live through dispatch. let handle = unsafe { &mut *reference }; @@ -1545,16 +1550,16 @@ unsafe fn write_snapshot_value( }; let metadata = borrow_cell(&host.runtime, |runtime| { let runtime = runtime.as_ref()?.state(); - runtime - .reflection() - .signal(id.root) - .and_then(|signal| Some((id.width(runtime)?, signal.signed))) + let width = id.width(runtime)?; + let signed = value.format == VPI_INT_VAL + && width > 0 + && width < 32 + && runtime.reflection().signal(id.root)?.signed; + Some((width, signed)) }); let Some((width, signed)) = metadata else { return; }; - // Safety: checked non-null above; the caller owns writable value storage. - let value = unsafe { &mut *value }; encode_snapshot_value(handle, value, snapshot, width, signed); } @@ -1574,12 +1579,16 @@ pub unsafe extern "C" fn vpi_get_value(reference: VpiHandle, value: *mut VpiValu let Some(host) = selected_host() else { return; }; + // Safety: selection above rejects foreign-thread calls before accessing + // caller storage, which is non-null and writable on the owning thread. + let value = unsafe { &mut *value }; + if value.format == VPI_SUPPRESS_VAL { + return; + } // Safety: the caller supplies a live handle; selection above rejects // foreign-thread/unbound calls before dereferencing it. let handle = unsafe { &mut *reference }; if let HandleKind::Constant(integer) = handle.kind { - // Safety: checked non-null above; caller owns the `VpiValue` allocation. - let value = unsafe { &mut *value }; if value.format == VPI_INT_VAL { value.value.integer = integer; } @@ -1591,14 +1600,16 @@ pub unsafe extern "C" fn vpi_get_value(reference: VpiHandle, value: *mut VpiValu let Some((snapshot, width)) = value_snapshot_at(&host, id) else { return; }; - let signed = borrow_cell(&host.runtime, |runtime| { - runtime - .as_ref() - .and_then(|runtime| runtime.state().reflection().signal(id.root)) - .is_some_and(|signal| signal.signed) - }); - // Safety: checked non-null above; caller owns the `VpiValue` allocation. - encode_snapshot_value(handle, unsafe { &mut *value }, &snapshot, width, signed); + let signed = value.format == VPI_INT_VAL + && width > 0 + && width < 32 + && borrow_cell(&host.runtime, |runtime| { + runtime + .as_ref() + .and_then(|runtime| runtime.state().reflection().signal(id.root)) + .is_some_and(|signal| signal.signed) + }); + encode_snapshot_value(handle, value, &snapshot, width, signed); } fn decode_digit(digit: u8, radix_bits: u32) -> Option<(u8, u8)> {