Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/ci-napi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,15 @@ jobs:

- uses: Swatinem/rust-cache@v2
with:
# Keep compiled dependencies, but start a separate publication cache.
prefix-key: celox-napi-release-v1
shared-key: napi-${{ matrix.target }}
# Reinstall Cargo tools instead of restoring executable binaries.
# Release target matrices previously consumed most of the repository
# quota and evicted the shared Rust Tests cache. Share downloads only;
# never retain target/ artifacts for each release target and lane.
prefix-key: celox-napi-downloads-v1
shared-key: napi-downloads
cache-targets: false
cache-bin: false
# Tag/ad-hoc branch runs may restore, but only release lanes populate it.
save-if: ${{ (github.event_name == 'repository_dispatch' && github.ref == 'refs/heads/master') || (github.event_name == 'workflow_dispatch' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')) }}
# All lanes can restore the default-branch cache. Avoid develop copies.
save-if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}

- name: Install ziglang (musl targets)
if: matrix.zigbuild
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/rust-cache.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Warm Rust dependency cache

# PR merge-ref caches cannot be reused by other PRs. Populate the default
# branch cache once per toolchain/dependency key, without running tests twice.
# branch cache on dependency changes and periodically repair eviction. Cache hits
# skip compilation, and warming never executes the test suite.
on:
push:
branches: [master]
Expand All @@ -14,6 +15,9 @@ on:
- ".github/workflows/rust-cache.yml"
- ".github/workflows/ci.yml"
- "scripts/run-vtest.mjs"
# Eviction does not change Cargo files, so push path filters cannot repair it.
schedule:
- cron: "17 * * * *"
workflow_dispatch:

permissions:
Expand Down
4 changes: 2 additions & 2 deletions conformance/sv-tests/expected.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -649,8 +649,8 @@ chapter-18/18.7--in-line-constraints--randomize_5.sv 2state fail
chapter-18/18.7--in-line-constraints--randomize_5.sv 4state fail
chapter-18/18.7--in-line-constraints--randomize_6.sv 2state fail
chapter-18/18.7--in-line-constraints--randomize_6.sv 4state fail
chapter-18/18.7.1--local-scope-resolution_0.sv 2state fail
chapter-18/18.7.1--local-scope-resolution_0.sv 4state fail
chapter-18/18.7.1--local-scope-resolution_0.sv 2state pass
chapter-18/18.7.1--local-scope-resolution_0.sv 4state pass
chapter-18/18.7.1--local-scope-resolution_1.sv 2state fail
chapter-18/18.7.1--local-scope-resolution_1.sv 4state fail
chapter-18/18.8--disabling-random-variables-with-rand_mode_0.sv 2state fail
Expand Down
12 changes: 12 additions & 0 deletions crates/celox-frontend-sv/src/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ use celox_sv_analyzer as sv;
use fxhash::{FxHashMap as HashMap, FxHashSet as HashSet};
use num_bigint::BigUint;

mod case_equality;
mod comb;
mod comb_retention;
mod ff;
Expand Down Expand Up @@ -5015,6 +5016,17 @@ fn expr_for_state_mode(expr: &sv::ir::Expr, four_state: bool) -> sv::ir::Expr {
op: *op,
expr: Box::new(expr_for_state_mode(expr, four_state)),
},
sv::ir::Expr::Binary { left, op, right }
if !four_state && matches!(op, sv::ir::BinaryOp::EqCase | sv::ir::BinaryOp::NeCase) =>
{
// Storage remains two-state; exact comparison operands retain
// literal X/Z until value and mask are compared (11.4.5).
sv::ir::Expr::Binary {
left: Box::new(expr_for_state_mode(left, true)),
op: *op,
right: Box::new(expr_for_state_mode(right, true)),
}
}
sv::ir::Expr::Binary { left, op, right } => sv::ir::Expr::Binary {
left: Box::new(expr_for_state_mode(left, four_state)),
op: *op,
Expand Down
Loading
Loading