diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 78e7f271d7f..8032c17e87a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.11.0" + ".": "0.12.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f28dcfdcfb..ae871d4c7a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,407 @@ # Changelog +## 0.12.0 (2026-10-27) + +## What's Changed +* chore(deps): update dependency lefthook to v2.2.0 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1282 +* chore(deps): update dependency @playwright/test to v1.64.0 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1284 +* fix(release): publish SV analyzer before the test suite by @tignear in https://github.com/celox-sim/celox/pull/1287 +* chore(deps): update rust toolchain to e9d12b9 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1288 +* ci: migrate merge automation to Mergify by @tignear in https://github.com/celox-sim/celox/pull/1290 +* chore(deps): update dependency lefthook to v2.2.1 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1292 +* chore(deps): update dependency vite to v8.3.4 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1296 +* ci: restore focused PR checks and parallel merge validation by @tignear in https://github.com/celox-sim/celox/pull/1300 +* ci: pin the published Mergify CLI setup action by @tignear in https://github.com/celox-sim/celox/pull/1305 +* fix(deps): update rust crate syn to v3.0.9 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1299 +* chore(deps): update rust crate sha2 to v0.11.1 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1310 +* ci: batch queued PRs and defer lydite gates to the queue by @tignear in https://github.com/celox-sim/celox/pull/1308 +* ci: ignore obsolete merge queue title checks by @tignear in https://github.com/celox-sim/celox/pull/1319 +* ci: move full CodeQL analysis to weekly and manual runs by @tignear in https://github.com/celox-sim/celox/pull/1311 +* chore(deps): update rust toolchain to 87ffb7f by @renovate[bot] in https://github.com/celox-sim/celox/pull/1302 +* ci: separate merge queues by category and independent scope by @tignear in https://github.com/celox-sim/celox/pull/1318 +* ci: preserve shared Rust caches and avoid unnecessary product builds by @tignear in https://github.com/celox-sim/celox/pull/1324 +* chore(deps): update pnpm to v12.11.0 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1332 +* feat(sv): implement $urandom by @tignear in https://github.com/celox-sim/celox/pull/1294 +* chore(deps): update rust to v1.99.1 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1303 +* chore(deps): update rust toolchain to ec07af4 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1335 +* ci: run Veryl proof gates only weekly or manually by @tignear in https://github.com/celox-sim/celox/pull/1337 +* fix(backend): zero logical shifts by counts at or above the width by @tignear in https://github.com/celox-sim/celox/pull/1340 +* chore(claude): remove the overlayfs worktree hooks by @tignear in https://github.com/celox-sim/celox/pull/1341 +* chore(deps): update mbx to 1.24.0 and automate updates by @tignear in https://github.com/celox-sim/celox/pull/1346 +* fix(vite-plugin): retry transient ticket read failures by @tignear in https://github.com/celox-sim/celox/pull/1348 +* fix(native): mask rounded partial-chunk loads by @tignear in https://github.com/celox-sim/celox/pull/1351 +* chore(lydite): drop unreferenced audit evidence and translate docs to English by @tignear in https://github.com/celox-sim/celox/pull/1291 +* test(suite): add timed script operations and the timing oracle by @tignear in https://github.com/celox-sim/celox/pull/1354 +* chore(deps): update pnpm to v12.11.1 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1358 +* chore(deps): update pnpm to v12.11.2 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1363 +* fix(lydite): sync Veryl conformance lockfile with syn pin by @tignear in https://github.com/celox-sim/celox/pull/1366 +* fix(native): preserve loaded slices across state writes by @tignear in https://github.com/celox-sim/celox/pull/1367 +* fix(sim): fire derived clock domains at their real edges by @tignear in https://github.com/celox-sim/celox/pull/1364 +* test(testbench): cover Veryl string variable semantics by @tignear in https://github.com/celox-sim/celox/pull/1370 +* ci(lydite): select tests by dependencies and weekly cadence by @tignear in https://github.com/celox-sim/celox/pull/1362 +* fix(sim): keep clock copies sensed at the opposite edge apart by @tignear in https://github.com/celox-sim/celox/pull/1373 +* test(runtime): isolate parallel trace capture from concurrent tests by @tignear in https://github.com/celox-sim/celox/pull/1375 +* feat(testbench)!: support basic Veryl string values by @tignear in https://github.com/celox-sim/celox/pull/1371 +* ci: check dependencies with cargo-deny by @tignear in https://github.com/celox-sim/celox/pull/1380 +* refactor(sv): identify system tasks and functions by type by @tignear in https://github.com/celox-sim/celox/pull/1381 +* ci: move non-required PR checks to required lint or schedules by @tignear in https://github.com/celox-sim/celox/pull/1382 +* fix(deps): update rust crate wasm-encoder to 0.262 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1383 +* feat(sv): support both edges of one clock or reset by @tignear in https://github.com/celox-sim/celox/pull/1384 +* feat(runtime)!: wake processes on events in front of the batch step by @tignear in https://github.com/celox-sim/celox/pull/1361 +* ci: select PR checks from the merge base, not the base tip by @tignear in https://github.com/celox-sim/celox/pull/1393 +* feat(sv): know every system task and function IEEE 1800-2023 names by @tignear in https://github.com/celox-sim/celox/pull/1392 +* docs: remove ADRs moved to Claude Docs by @tignear in https://github.com/celox-sim/celox/pull/1397 +* ci(lydite): retire the stale workflow path and skip release PRs by @tignear in https://github.com/celox-sim/celox/pull/1403 +* ci: support Mergify stacked pull requests by @tignear in https://github.com/celox-sim/celox/pull/1406 +* fix(veryl): reject string and float values Celox cannot represent by @tignear in https://github.com/celox-sim/celox/pull/1405 +* feat(sv): support $random and $urandom_range by @tignear in https://github.com/celox-sim/celox/pull/1396 +* refactor(runtime)!: split the simulation scheduler into modules by @tignear in https://github.com/celox-sim/celox/pull/1408 +* chore(deps): update rust toolchain to a110337 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1416 +* chore(deps): update rust crate codspeed-criterion-compat to v5.0.3 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1421 +* chore(deps): update mbx to 1.24.1 by @celox-bot[bot] in https://github.com/celox-sim/celox/pull/1420 +* chore(deps): update cachix/install-nix-action digest to 448cde7 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1424 +* refactor(runtime)!: derive the schedule model once per program by @tignear in https://github.com/celox-sim/celox/pull/1417 +* ci(lydite): scope Cargo.lock edits by the lockfile dependency graph by @tignear in https://github.com/celox-sim/celox/pull/1427 +* chore(deps): update pnpm to v12.12.0 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1428 +* feat(sim): add explicit clock edges to the simulator by @tignear in https://github.com/celox-sim/celox/pull/1391 +* refactor(runtime)!: mark periodic clock events on the queue by @tignear in https://github.com/celox-sim/celox/pull/1431 +* ci: keep conflicting pull requests out of the merge queue by @tignear in https://github.com/celox-sim/celox/pull/1447 +* fix(sv): preserve typedef variable declaration initializers by @tignear in https://github.com/celox-sim/celox/pull/1443 +* fix(sv): preserve generate-local array element widths in size queries by @tignear in https://github.com/celox-sim/celox/pull/1450 +* fix(sv)!: bind type parameters without rewriting source by @tignear in https://github.com/celox-sim/celox/pull/1451 +* feat(sim): expose four-state reads in timed simulations by @tignear in https://github.com/celox-sim/celox/pull/1454 +* feat(sim): build timed simulations on explicit backends by @tignear in https://github.com/celox-sim/celox/pull/1455 +* feat(sv)!: support $stop and $exit by @tignear in https://github.com/celox-sim/celox/pull/1402 +* feat(sv): support generate-block imports of types and subroutines that differ from the module's by @tignear in https://github.com/celox-sim/celox/pull/1440 +* fix(sv)!: name Veryl declarations by their emitted SV names by @tignear in https://github.com/celox-sim/celox/pull/1469 +* fix(sim)!: preserve global precision in VCD and VPI by @tignear in https://github.com/celox-sim/celox/pull/1471 +* feat(sv)!: run delays, event and level waits in initial processes by @tignear in https://github.com/celox-sim/celox/pull/1459 +* refactor(sv)!: bind assignment patterns without rewriting source by @tignear in https://github.com/celox-sim/celox/pull/1467 +* fix(sim): judge four-state edges of internally driven clocks by IEEE 1800 Table 9-2 by @tignear in https://github.com/celox-sim/celox/pull/1414 +* ci: scope pull request Rust builds and checks by @tignear in https://github.com/celox-sim/celox/pull/1478 +* feat(sv)!: run always blocks with timing controls as processes by @tignear in https://github.com/celox-sim/celox/pull/1475 +* chore(deps): update rust toolchain to 42076d1 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1487 +* fix(sv)!: keep Veryl module identity across mixed hierarchy links by @tignear in https://github.com/celox-sim/celox/pull/1488 +* fix(sim)!: commit blocking flip-flop stores in the active region by @tignear in https://github.com/celox-sim/celox/pull/1480 +* fix(js): return normally when bounded simulations stop by @tignear in https://github.com/celox-sim/celox/pull/1490 +* refactor(sv)!: lower interfaces from original syntax by @tignear in https://github.com/celox-sim/celox/pull/1468 +* fix(sv): preserve interface bindings during declaration analysis by @tignear in https://github.com/celox-sim/celox/pull/1474 +* fix(sv): check native module indices and visit Veryl bodies once by @tignear in https://github.com/celox-sim/celox/pull/1500 +* feat(sv): run nonblocking assignments in processes by @tignear in https://github.com/celox-sim/celox/pull/1501 +* chore(deps): update pnpm to v12.12.1 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1504 +* feat(sv)!: support $time and $stime by @tignear in https://github.com/celox-sim/celox/pull/1462 +* fix(runtime): settle host writes before resuming from $stop by @tignear in https://github.com/celox-sim/celox/pull/1506 +* ci(lydite): skip unrelated sv-tests corpus changes by @tignear in https://github.com/celox-sim/celox/pull/1513 +* test(sv-tests): track two-state and four-state results separately by @tignear in https://github.com/celox-sim/celox/pull/1509 +* fix(sv): allow arbitrary bounds in multidimensional packed arrays by @tignear in https://github.com/celox-sim/celox/pull/1510 +* fix(sv): resolve implicit named interface port connections by @tignear in https://github.com/celox-sim/celox/pull/1511 +* fix(sv-tests): use the upstream runner for conformance verdicts by @tignear in https://github.com/celox-sim/celox/pull/1516 +* feat(sv)!: report SystemVerilog compilation warnings by @tignear in https://github.com/celox-sim/celox/pull/1432 +* fix(sv-tests): run parsing-only conformance cases by @tignear in https://github.com/celox-sim/celox/pull/1521 +* chore(deps): update rust toolchain to v1.99.1 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1527 +* docs(sv): separate the getting-started guide from the language reference by @tignear in https://github.com/celox-sim/celox/pull/1522 +* chore(deps): update rust toolchain to 550547c by @renovate[bot] in https://github.com/celox-sim/celox/pull/1539 +* fix(sv): handle Veryl-emitted interface declarations and calls by @tignear in https://github.com/celox-sim/celox/pull/1525 +* fix(sv): preserve parameter overrides with explicit analysis state by @tignear in https://github.com/celox-sim/celox/pull/1526 +* refactor(native): own emission state in the assembler by @tignear in https://github.com/celox-sim/celox/pull/1530 +* refactor(veryl)!: pass lowering state and dependency collectors explicitly by @tignear in https://github.com/celox-sim/celox/pull/1531 +* refactor(vpi)!: own runtime state in an explicit VPI session by @tignear in https://github.com/celox-sim/celox/pull/1532 +* ci: narrow Rust builds and shared-case tests per pull request by @tignear in https://github.com/celox-sim/celox/pull/1542 +* ci: freeze release PR updates while queued by @tignear in https://github.com/celox-sim/celox/pull/1551 +* chore(deps): update vitest monorepo to v5.0.4 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1545 +* feat(sv-syntax): add the native SystemVerilog syntax layer by @tignear in https://github.com/celox-sim/celox/pull/1555 +* refactor(sv)!: replace sv-parser with native syntax consumers by @tignear in https://github.com/celox-sim/celox/pull/1556 +* refactor(sv): organize syntax binding modules by responsibility by @tignear in https://github.com/celox-sim/celox/pull/1560 +* chore(deps): update compatible Python and cocotb versions by @celox-bot[bot] in https://github.com/celox-sim/celox/pull/1554 +* fix(lydite): execute derived clock events in proof conformance by @tignear in https://github.com/celox-sim/celox/pull/1559 +* chore(lint): prohibit thread-local state outside unit tests by @tignear in https://github.com/celox-sim/celox/pull/1533 +* feat(cli): run SystemVerilog and Veryl native testbenches by @tignear in https://github.com/celox-sim/celox/pull/1564 +* feat(vpi): run SystemVerilog designs with cocotb by @tignear in https://github.com/celox-sim/celox/pull/1441 +* feat(vpi): compile multiple SystemVerilog sources for cocotb by @tignear in https://github.com/celox-sim/celox/pull/1442 +* perf(sir): optimize resumable process kernels by @tignear in https://github.com/celox-sim/celox/pull/1565 +* fix(vpi): notify clock edges before flip-flop updates by @tignear in https://github.com/celox-sim/celox/pull/1570 +* perf(cli): default HDL testbench runs to O2 by @tignear in https://github.com/celox-sim/celox/pull/1580 +* chore(deps): update rust crate libc to v0.2.191 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1583 +* chore(deps): update pnpm to v12.13.0 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1594 +* chore(deps): update rust toolchain to 5424e1e by @renovate[bot] in https://github.com/celox-sim/celox/pull/1593 +* ci(mergify): resolve URL-form stack dependencies by @tignear in https://github.com/celox-sim/celox/pull/1604 +* fix(veryl): preserve one-bit struct and union member selects by @tignear in https://github.com/celox-sim/celox/pull/1597 +* chore(deps): update mbx to 1.25.0 by @celox-bot[bot] in https://github.com/celox-sim/celox/pull/1601 +* feat(sv): support task calls with timing controls by @tignear in https://github.com/celox-sim/celox/pull/1592 +* feat(cli)!: roll up native testbench and simulator configuration by @tignear in https://github.com/celox-sim/celox/pull/1605 +* fix(macros): write array elements through generated IO setters by @tignear in https://github.com/celox-sim/celox/pull/1613 +* test(sv): cover bits queries in module parameter overrides by @tignear in https://github.com/celox-sim/celox/pull/1620 +* fix(bench): enable parallel execution in the Heliodor tiered runner by @tignear in https://github.com/celox-sim/celox/pull/1625 +* fix(runtime): recheck abort after parallel dependency waits by @tignear in https://github.com/celox-sim/celox/pull/1623 +* fix(sv): resolve constant functions in unpacked array dimensions by @tignear in https://github.com/celox-sim/celox/pull/1612 +* feat(sv)!: add distribution and plusarg system functions by @tignear in https://github.com/celox-sim/celox/pull/1608 +* chore(deps): update dependency lefthook to v2.2.2 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1599 +* feat(sv)!: support runtime file output and memory dumps by @tignear in https://github.com/celox-sim/celox/pull/1609 +* feat(sv)!: add source-driven VCD controls by @tignear in https://github.com/celox-sim/celox/pull/1610 +* fix(deps): update rust crate wasmtime to v50 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1636 +* fix(native): ignore padding in wide reduction AND by @tignear in https://github.com/celox-sim/celox/pull/1638 +* fix(vite): resolve cached Veryl imports inside and outside the root by @tignear in https://github.com/celox-sim/celox/pull/1596 +* feat(cli)!: unify benchmark execution under celox run by @tignear in https://github.com/celox-sim/celox/pull/1633 +* fix(sv): resolve Taxi elaboration and cocotb visibility failures by @tignear in https://github.com/celox-sim/celox/pull/1645 +* feat(sv): support time literals in delay controls by @tignear in https://github.com/celox-sim/celox/pull/1639 +* chore(deps): update dependency typedoc-plugin-markdown to v4.14.0 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1651 +* fix(sv): validate module and interface names without interface ports by @tignear in https://github.com/celox-sim/celox/pull/1621 +* fix(sv): distribute interface array port connections by @tignear in https://github.com/celox-sim/celox/pull/1622 +* fix(wasm): preserve WASM loading with emnapi 2 beta by @renovate[bot] in https://github.com/celox-sim/celox/pull/1536 +* feat(sv): support unconstrained scope randomization by @tignear in https://github.com/celox-sim/celox/pull/1640 +* ci(sv): run upstream popcount testbench in daily checks by @tignear in https://github.com/celox-sim/celox/pull/1641 +* feat(cli): configure SV parameter literals and simulation state modes by @tignear in https://github.com/celox-sim/celox/pull/1646 +* fix(sir-opt): preserve memory and type semantics when hoisting loads by @tignear in https://github.com/celox-sim/celox/pull/1665 +* fix(sv): preserve Taxi aggregates and sparse FF memories by @tignear in https://github.com/celox-sim/celox/pull/1659 +* fix(vpi): expose unpacked arrays through lazy element handles by @tignear in https://github.com/celox-sim/celox/pull/1660 +* fix(cli): reject empty cocotb test selections by @tignear in https://github.com/celox-sim/celox/pull/1661 +* perf(vpi): avoid metadata cloning during value access by @tignear in https://github.com/celox-sim/celox/pull/1668 +* perf(sv): reuse constants when expression contexts match by @tignear in https://github.com/celox-sim/celox/pull/1669 +* feat(simulator): support scalar floating-point arithmetic and formatting by @tignear in https://github.com/celox-sim/celox/pull/1666 +* feat(cli): configure SV simulation timescales by @tignear in https://github.com/celox-sim/celox/pull/1672 +* fix(sv): fill unbased parameter overrides to their declared width by @tignear in https://github.com/celox-sim/celox/pull/1677 +* fix(sv): defer indexed part-select base binding until types are available by @tignear in https://github.com/celox-sim/celox/pull/1678 +* feat(sim)!: support blocking latches and configurable inference diagnostics by @tignear in https://github.com/celox-sim/celox/pull/1627 +* feat(bindings): apply common latch diagnostics across simulator entry points by @tignear in https://github.com/celox-sim/celox/pull/1628 +* chore(deps): update rust toolchain to 83dd732 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1693 +* chore(deps): update mbx to 1.26.0 by @celox-bot[bot] in https://github.com/celox-sim/celox/pull/1691 +* fix(sv): preserve inherited constants in parameter alias evaluation by @tignear in https://github.com/celox-sim/celox/pull/1682 +* chore(deps): update dependency @playwright/test to v1.64.1 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1698 +* feat(sv)!: support binary input and file positioning by @tignear in https://github.com/celox-sim/celox/pull/1662 +* feat(sv)!: support integral formatted input by @tignear in https://github.com/celox-sim/celox/pull/1663 +* feat(sv)!: add Annex N integer distribution functions by @tignear in https://github.com/celox-sim/celox/pull/1664 +* feat(sv): lower expression events and @* in processes by @tignear in https://github.com/celox-sim/celox/pull/1681 +* perf(backend): lower scalar floating-point operations to native instructions by @tignear in https://github.com/celox-sim/celox/pull/1704 +* docs(sv): document timing controls in processes by @tignear in https://github.com/celox-sim/celox/pull/1716 +* feat(testbench)!: keep strings in a heap referenced from state memory by @tignear in https://github.com/celox-sim/celox/pull/1679 +* fix(sv): scale and round real-valued delays by @tignear in https://github.com/celox-sim/celox/pull/1723 +* perf(sv)!: stage nonblocking updates of a target with one writer by @tignear in https://github.com/celox-sim/celox/pull/1684 +* fix(sv): preserve signedness of power expressions by @tignear in https://github.com/celox-sim/celox/pull/1718 +* feat(sv)!: support string variables and their operations by @tignear in https://github.com/celox-sim/celox/pull/1688 +* chore(deps): update napi-rs and emnapi compatibility to v2.0.0-beta.2 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1725 +* fix(sv): lower always @(list) like always @* when it lists every read by @tignear in https://github.com/celox-sim/celox/pull/1722 +* chore(deps): update rust toolchain to 5f267b7 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1740 +* fix(deps): update wasmtime to v49.0.4 by @tignear in https://github.com/celox-sim/celox/pull/1741 +* fix(sv): forward named unpacked array parameters by @tignear in https://github.com/celox-sim/celox/pull/1744 +* test(sv): timed scheduler boundary cases and scheduler bench by @tignear in https://github.com/celox-sim/celox/pull/1717 +* feat(sv)!: implement $realtime by @tignear in https://github.com/celox-sim/celox/pull/1734 +* chore(deps): update rust crate codspeed-criterion-compat to v6 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1703 +* feat(sv)!: implement real math system functions by @tignear in https://github.com/celox-sim/celox/pull/1735 +* feat(sv): support real formatted input by @tignear in https://github.com/celox-sim/celox/pull/1736 +* fix(sim)!: reject designs with processes in untimed Simulator builds by @tignear in https://github.com/celox-sim/celox/pull/1720 +* fix(sv): lower loop-indexed packed word part-selects by @tignear in https://github.com/celox-sim/celox/pull/1752 +* feat(sv)!: support classes with properties, methods and constructors by @tignear in https://github.com/celox-sim/celox/pull/1689 +* chore(deps): update vitest monorepo to v5.0.5 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1760 +* chore(deps): update pnpm to v12.14.0 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1761 +* ci: skip closed PR title checks and repair script validation by @tignear in https://github.com/celox-sim/celox/pull/1753 +* fix(sv): preserve guarded division types through casts by @tignear in https://github.com/celox-sim/celox/pull/1766 +* feat(sv)!: retain static function locals and results between calls by @tignear in https://github.com/celox-sim/celox/pull/1737 +* refactor(runtime)!: run timed slots from SimulationState with a differential scheduler harness by @tignear in https://github.com/celox-sim/celox/pull/1756 +* fix(sv): count intermediate writes of combinational and flip-flop units by @tignear in https://github.com/celox-sim/celox/pull/1726 +* feat(sv): support static class members, super and base constructors by @tignear in https://github.com/celox-sim/celox/pull/1696 +* feat(sv): support virtual methods, abstract classes and interface class implementation by @tignear in https://github.com/celox-sim/celox/pull/1724 +* feat(sv)!: support interface class handles and $cast of class handles by @tignear in https://github.com/celox-sim/celox/pull/1758 +* fix(sv): resolve input port patterns after specialization by @tignear in https://github.com/celox-sim/celox/pull/1772 +* fix(sv): run waiters of blocking edge writes before the NBA region by @tignear in https://github.com/celox-sim/celox/pull/1783 +* feat(sim)!: make a tick one clock period and run every clock generator by @tignear in https://github.com/celox-sim/celox/pull/1776 +* feat(sv)!: support opt-in interface-array size queries by @tignear in https://github.com/celox-sim/celox/pull/1791 +* fix(sv): write the bits inside a part-select partly outside its vector by @tignear in https://github.com/celox-sim/celox/pull/1782 +* feat(runtime)!: compiled time-slot loop for delay-only kernels by @tignear in https://github.com/celox-sim/celox/pull/1777 +* feat(sv): run plain always blocks without the flip-flop shape as processes by @tignear in https://github.com/celox-sim/celox/pull/1729 +* perf(runtime)!: compare counted wait baselines in place by @tignear in https://github.com/celox-sim/celox/pull/1803 +* perf(sim): keep the inactive edge of a tick cheap when nothing can fire on it by @tignear in https://github.com/celox-sim/celox/pull/1789 +* fix(sv): bind interface-array slices to module ports by @tignear in https://github.com/celox-sim/celox/pull/1807 +* fix(sim)!: wake processes on value changes that are undone in the same time slot by @tignear in https://github.com/celox-sim/celox/pull/1764 +* chore(deps): update rust toolchain to b0829a2 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1814 +* feat(sv): run nonblocking assignments in processes to array elements and run-time positions by @tignear in https://github.com/celox-sim/celox/pull/1773 +* fix(sv): name event declarations and disable fork, and reject timing in functions as illegal by @tignear in https://github.com/celox-sim/celox/pull/1818 +* feat(sv)!: support unconstrained class randomization by @tignear in https://github.com/celox-sim/celox/pull/1767 +* feat(sv)!: support inherited randomization and rand_mode by @tignear in https://github.com/celox-sim/celox/pull/1787 +* feat(runtime)!: fuse clock-waiting kernels into compiled slots by @tignear in https://github.com/celox-sim/celox/pull/1801 +* feat(runtime)!: host periodic clocks in the compiled loop by @tignear in https://github.com/celox-sim/celox/pull/1805 +* perf(runtime)!: skip compiled settles whose inputs did not change by @tignear in https://github.com/celox-sim/celox/pull/1811 +* perf(runtime)!: compiled slots for designs without process kernels by @tignear in https://github.com/celox-sim/celox/pull/1815 +* fix(deps): update cranelift crates to 0.137.0 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1833 +* fix(sv): accept real-valued module parameter overrides by @tignear in https://github.com/celox-sim/celox/pull/1839 +* perf(sv): skip scope discovery for literal query operands by @tignear in https://github.com/celox-sim/celox/pull/1843 +* feat(sv): run always @* calls of timed tasks as processes and accept package delays by @tignear in https://github.com/celox-sim/celox/pull/1816 +* fix(sv): report %t in the smallest time precision of the design by @tignear in https://github.com/celox-sim/celox/pull/1825 +* feat(sv): support soft packed unions by @tignear in https://github.com/celox-sim/celox/pull/1837 +* fix(sv): lex a colon before a comment as a colon by @tignear in https://github.com/celox-sim/celox/pull/1851 +* refactor(runtime): generate the edges of derived clock domains as SIR by @tignear in https://github.com/celox-sim/celox/pull/1844 +* fix(sv): join based-literal digits supplied by a macro by @tignear in https://github.com/celox-sim/celox/pull/1852 +* fix(sv): bind unpacked array values in module parameter arguments by @tignear in https://github.com/celox-sim/celox/pull/1857 +* chore(deps): update rust toolchain to 5b9f119 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1868 +* perf(sv): publish only written elements of nonblocking array writes by @tignear in https://github.com/celox-sim/celox/pull/1869 +* test(vtest): accelerate shared cases and report CI timings by @tignear in https://github.com/celox-sim/celox/pull/1867 +* fix(sir-opt): keep the And width in the bit-extract peephole by @tignear in https://github.com/celox-sim/celox/pull/1887 +* perf(runtime)!: run the derived clock edges of ticks in generated units by @tignear in https://github.com/celox-sim/celox/pull/1888 +* fix(sv): keep other processes' writes made before an edge's NBA region by @tignear in https://github.com/celox-sim/celox/pull/1884 +* feat(sv): support class enum randomization by @tignear in https://github.com/celox-sim/celox/pull/1838 +* feat(sv)!: support scope enum randomization by @tignear in https://github.com/celox-sim/celox/pull/1847 +* ci: move compilation scaling checks to CodSpeed by @tignear in https://github.com/celox-sim/celox/pull/1907 +* chore(deps): update github/codeql-action digest to 9b32540 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1911 +* perf(sv): skip the always_comb alternative nothing can watch by @tignear in https://github.com/celox-sim/celox/pull/1859 +* feat(sv): support tagged packed unions by @tignear in https://github.com/celox-sim/celox/pull/1883 +* fix(sim): judge derived clocks after several nonblocking updates by @tignear in https://github.com/celox-sim/celox/pull/1901 +* ci: reuse cocotb builds and warm CI dependency caches by @tignear in https://github.com/celox-sim/celox/pull/1916 +* fix(native): preserve array boundaries and store ordering in merged optimization by @tignear in https://github.com/celox-sim/celox/pull/1913 +* ci: remove Lydite bridge from routine validation by @tignear in https://github.com/celox-sim/celox/pull/1924 +* perf(runtime): defer settles in compiled slots until their results are read by @tignear in https://github.com/celox-sim/celox/pull/1923 +* chore(deps): update rust crate memmap2 to v0.9.12 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1925 +* feat(runtime)!: run program kernels in the reactive region set by @tignear in https://github.com/celox-sim/celox/pull/1896 +* ci: measure compilation benchmarks on CodSpeed walltime runners by @tignear in https://github.com/celox-sim/celox/pull/1930 +* feat(sim)!: show the regions of a time slot to a slot observer by @tignear in https://github.com/celox-sim/celox/pull/1934 +* feat(sv): simulate program blocks by @tignear in https://github.com/celox-sim/celox/pull/1897 +* feat(sim)!: report severity, location and assertion of severity tasks by @tignear in https://github.com/celox-sim/celox/pull/1875 +* test: add xezim as an external reference simulator by @tignear in https://github.com/celox-sim/celox/pull/1918 +* fix(sv): forward packed pattern parameters as integral values by @tignear in https://github.com/celox-sim/celox/pull/1914 +* fix(sv): accept undriven nets with high impedance defaults by @tignear in https://github.com/celox-sim/celox/pull/1915 +* feat(sv): support hierarchical references by @tignear in https://github.com/celox-sim/celox/pull/1893 +* feat(sv): declare implicit nets for continuous assignment targets by @tignear in https://github.com/celox-sim/celox/pull/1952 +* perf(sv): analyze each scope in time proportional to its own size by @tignear in https://github.com/celox-sim/celox/pull/1957 +* feat(sv)!: support bounded class randc randomization by @tignear in https://github.com/celox-sim/celox/pull/1959 +* feat(sim): fail runs on reports and drain runtime events in TypeScript by @tignear in https://github.com/celox-sim/celox/pull/1876 +* test(sim): check coincident ticks of a commit-raised gate against Icarus by @tignear in https://github.com/celox-sim/celox/pull/1936 +* feat(sim): build a timed Simulation from a native image by @tignear in https://github.com/celox-sim/celox/pull/1926 +* fix(sv): keep the bit ranges a child reads from its input ports by @tignear in https://github.com/celox-sim/celox/pull/1960 +* feat(runtime): run slots of designs with derived clocks in the compiled scheduler by @tignear in https://github.com/celox-sim/celox/pull/1967 +* fix(sv)!: defer the actions of deferred assertions in processes by @tignear in https://github.com/celox-sim/celox/pull/1877 +* chore(deps): update napi-rs and emnapi compatibility by @renovate[bot] in https://github.com/celox-sim/celox/pull/1966 +* chore(deps): update rust toolchain to fad80eb by @renovate[bot] in https://github.com/celox-sim/celox/pull/1974 +* chore(deps): update updatecli/updatecli-action action to v3.10.0 by @renovate[bot] in https://github.com/celox-sim/celox/pull/1978 +* feat(sv): support non-ANSI module port declarations by @tignear in https://github.com/celox-sim/celox/pull/1954 +* fix(native): retain FF publication from other lane tasks by @tignear in https://github.com/celox-sim/celox/pull/1976 +* fix(sir-opt): preserve live operands of shared bit-extract shifts by @tignear in https://github.com/celox-sim/celox/pull/1981 +* feat(sv): accept loop temporaries shared by plain edge always blocks by @tignear in https://github.com/celox-sim/celox/pull/1950 +* chore(deps): update mbx to 1.27.0 by @celox-bot[bot] in https://github.com/celox-sim/celox/pull/1985 +* feat(sv)!: defer assertions of combinational processes, module items and covers by @tignear in https://github.com/celox-sim/celox/pull/1878 +* fix(sv): return typed defaults for invalid unpacked array reads by @tignear in https://github.com/celox-sim/celox/pull/1977 +* perf(sv): find multi-store candidates through condensed block components by @tignear in https://github.com/celox-sim/celox/pull/1990 +* feat(cli): default celox run to the tiered backend by @tignear in https://github.com/celox-sim/celox/pull/2002 +* perf(native): reuse clobber walks across reload queries of one byte range by @tignear in https://github.com/celox-sim/celox/pull/1997 +* perf(sir-opt): share one state SSA analysis among sink recipe stability checks by @tignear in https://github.com/celox-sim/celox/pull/2003 +* feat(sv): support inout ports with a single tristate driver by @tignear in https://github.com/celox-sim/celox/pull/1951 +* build!: make optional simulator backends opt-in by @tignear in https://github.com/celox-sim/celox/pull/1989 +* perf(native): deduplicate compile tasks by unit classes instead of deep comparison by @tignear in https://github.com/celox-sim/celox/pull/1995 +* perf(sv): instrument each unit once for all probes by @tignear in https://github.com/celox-sim/celox/pull/2000 +* perf(sv)!: run initial loops without a static trip count as a process by @tignear in https://github.com/celox-sim/celox/pull/2014 +* feat(cli): save state files at chosen cycles or times of a SystemVerilog run by @tignear in https://github.com/celox-sim/celox/pull/2030 +* perf(sv): publish only the written elements of an array another process writes by @tignear in https://github.com/celox-sim/celox/pull/2024 +* perf(runtime): share the interpreter's combinational program across clocks by @tignear in https://github.com/celox-sim/celox/pull/2009 +* fix(native): bound the memory of memoized reload clobber walks by @tignear in https://github.com/celox-sim/celox/pull/2037 +* perf(runtime): snapshot only a group's own trigger addresses in the interpreter by @tignear in https://github.com/celox-sim/celox/pull/2018 +* perf(runtime): share the combinational program between the ticks of many clocks by @tignear in https://github.com/celox-sim/celox/pull/2034 +* perf(sv): find the drivers of a module in one walk of its processes by @tignear in https://github.com/celox-sim/celox/pull/2043 +* perf(native): find a stack slot for a spill home from per-row occupancy bits by @tignear in https://github.com/celox-sim/celox/pull/2046 +* perf(sv): elaborate generate scopes once per module specialization by @tignear in https://github.com/celox-sim/celox/pull/2051 +* perf(native): share anticipated sets and index frozen next-use rows finely by @tignear in https://github.com/celox-sim/celox/pull/2054 +* perf(runtime): handle element-strided unpacked arrays per element by @tignear in https://github.com/celox-sim/celox/pull/2048 +* perf(sv): follow transparent copies to sensitivity probes through an index by @tignear in https://github.com/celox-sim/celox/pull/2057 +* fix(sv-tests): execute preprocessing cases instead of skipping them by @tignear in https://github.com/celox-sim/celox/pull/2059 +* fix(native): version reload snapshots per byte range instead of walking clobbers by @tignear in https://github.com/celox-sim/celox/pull/2058 +* perf(sv): fold constants without big-integer parsing or needless copies by @tignear in https://github.com/celox-sim/celox/pull/2066 +* fix(sv): reject pragmas without a name by @tignear in https://github.com/celox-sim/celox/pull/2061 +* fix(sv-tests): match the dashboard main-test corpus by @tignear in https://github.com/celox-sim/celox/pull/2067 +* feat(cli): pass plusargs to SystemVerilog runs by @tignear in https://github.com/celox-sim/celox/pull/2077 +* fix(sv)!: enforce class member access visibility by @tignear in https://github.com/celox-sim/celox/pull/2074 +* fix(sv)!: settle two-state sensitivity-list processes at time zero, like Verilator by @tignear in https://github.com/celox-sim/celox/pull/2078 +* fix(sv): validate enum initializer declarations by @tignear in https://github.com/celox-sim/celox/pull/2075 +* fix(sv)!: read heap strings in formatted scans by @tignear in https://github.com/celox-sim/celox/pull/2076 +* chore(deps): update cachix/install-nix-action digest to 75c75c3 by @renovate[bot] in https://github.com/celox-sim/celox/pull/2091 +* feat(sv)!: support parameterized classes by @tignear in https://github.com/celox-sim/celox/pull/1796 +* fix(sv): bind derived classes in their own declaration scopes by @tignear in https://github.com/celox-sim/celox/pull/2093 +* feat(sv)!: support shallow copies of class objects by @tignear in https://github.com/celox-sim/celox/pull/1810 +* feat(sv): support classes declared in packages and the compilation unit by @tignear in https://github.com/celox-sim/celox/pull/1850 +* feat(sv): let processes of several instances write a package variable by @tignear in https://github.com/celox-sim/celox/pull/1872 +* revert: find stack slots by a scan of the slots again by @tignear in https://github.com/celox-sim/celox/pull/2085 +* perf(sv): run a combinational process unit once per schedule by @tignear in https://github.com/celox-sim/celox/pull/2082 +* fix(frontend): give clocks wired through vector bits the domain of their source by @tignear in https://github.com/celox-sim/celox/pull/2073 +* fix(sv): preserve wide constant-function return values by @tignear in https://github.com/celox-sim/celox/pull/2101 +* perf(sv): simulate sensitivity lists that cover their reads like always @* by @tignear in https://github.com/celox-sim/celox/pull/2087 +* fix(sv): keep task arguments read before a suspending call by @tignear in https://github.com/celox-sim/celox/pull/2089 +* fix(sv): defer interface-dependent declarations before binding array ports by @tignear in https://github.com/celox-sim/celox/pull/2107 +* feat(runtime)!: opt-in partitioned combinational settle by @tignear in https://github.com/celox-sim/celox/pull/2106 +* feat(sv)!: execute final procedures at simulation termination by @tignear in https://github.com/celox-sim/celox/pull/2088 +* feat(vpi): run SV processes in cocotb images by @tignear in https://github.com/celox-sim/celox/pull/1938 +* perf(runtime): mark settle partitions only when their inputs change by @tignear in https://github.com/celox-sim/celox/pull/2113 +* feat(sv)!: execute fork branches as dynamic process activations by @tignear in https://github.com/celox-sim/celox/pull/2112 +* feat(sv)!: support wait fork and disable fork process control by @tignear in https://github.com/celox-sim/celox/pull/2116 +* chore(deps): update rust toolchain to 0d05759 by @renovate[bot] in https://github.com/celox-sim/celox/pull/2122 +* perf(runtime): run every partition of a busy settle without comparing by @tignear in https://github.com/celox-sim/celox/pull/2124 +* fix(sv): coalesce repeated direct net aliases by @tignear in https://github.com/celox-sim/celox/pull/2127 +* feat(runtime)!: separate core snapshots from host effect state by @tignear in https://github.com/celox-sim/celox/pull/2121 +* feat(sv): support $sampled in processes by @tignear in https://github.com/celox-sim/celox/pull/1879 +* feat(sv): support $past and the value change functions in clocked processes by @tignear in https://github.com/celox-sim/celox/pull/1880 +* fix(sv)!: give reports the time they are issued at by @tignear in https://github.com/celox-sim/celox/pull/1881 +* feat(sv): extend sampled values and inferred history clocks by @tignear in https://github.com/celox-sim/celox/pull/1882 +* fix(sv): parse array method with expressions by @tignear in https://github.com/celox-sim/celox/pull/2141 +* fix(sv): resolve upward references to interface members by @tignear in https://github.com/celox-sim/celox/pull/2143 +* feat(runtime)!: store dynamic containers in the simulator heap by @tignear in https://github.com/celox-sim/celox/pull/2148 +* feat(cli)!: checkpoint SystemVerilog runs on SIGUSR1 by @tignear in https://github.com/celox-sim/celox/pull/2134 +* feat(sv)!: support dynamic arrays queues and associative arrays by @tignear in https://github.com/celox-sim/celox/pull/2149 +* feat(sv): allow detached forks in functions and final procedures by @tignear in https://github.com/celox-sim/celox/pull/2146 +* fix(frontend): refine bit dependencies through chained copies by @tignear in https://github.com/celox-sim/celox/pull/2158 +* fix(sv): evaluate wide constant function values by @tignear in https://github.com/celox-sim/celox/pull/2161 +* feat(runtime)!: persist dynamic fork activations in portable state files by @tignear in https://github.com/celox-sim/celox/pull/2152 +* feat(sv)!: evaluate compound events on fork-shared automatic locals by @tignear in https://github.com/celox-sim/celox/pull/2153 +* feat(aplite): extract an independently versioned finite solver by @tignear in https://github.com/celox-sim/celox/pull/2167 +* feat(aplite): add reproducible seeded scalar model search by @tignear in https://github.com/celox-sim/celox/pull/2168 +* test(aplite): keep exhaustive sampling as a small-domain oracle by @tignear in https://github.com/celox-sim/celox/pull/2170 +* feat(aplite): reuse compiled queries with temporary assumptions by @tignear in https://github.com/celox-sim/celox/pull/2175 +* perf(sv): avoid redundant scope discovery and constant evaluation by @tignear in https://github.com/celox-sim/celox/pull/2171 +* chore(deps): update actions/setup-node action to v7 by @renovate[bot] in https://github.com/celox-sim/celox/pull/2181 +* chore(deps): update dependency typedoc-plugin-markdown to v4.14.1 by @renovate[bot] in https://github.com/celox-sim/celox/pull/2182 +* fix(sv): allow bare zero-argument container methods by @tignear in https://github.com/celox-sim/celox/pull/2178 +* feat(aplite): query bounded projected XOR cells by @tignear in https://github.com/celox-sim/celox/pull/2177 +* perf(aplite): reduce affine XOR rows before bit blasting by @tignear in https://github.com/celox-sim/celox/pull/2183 +* feat(aplite): generate approximate projected sample batches by @tignear in https://github.com/celox-sim/celox/pull/2184 +* ci(mergify): add an emergency merge request label by @tignear in https://github.com/celox-sim/celox/pull/2211 +* feat(sv-syntax)!: retain named constraint expressions by @tignear in https://github.com/celox-sim/celox/pull/2193 +* test(sv-tests): classify failures and summarize diagnostics by @tignear in https://github.com/celox-sim/celox/pull/2196 +* fix(sv): preserve disjoint single-bit array driver windows by @tignear in https://github.com/celox-sim/celox/pull/2188 +* fix(sv): bound recursive specialization along instance paths by @tignear in https://github.com/celox-sim/celox/pull/2189 +* perf(vpi): compile process-capable images without retrying by @tignear in https://github.com/celox-sim/celox/pull/2190 +* chore(deps): update zstd-sys to fix the wasm allocator advisory by @tignear in https://github.com/celox-sim/celox/pull/2200 +* ci(mergify): add queue priority without interrupting checks by @tignear in https://github.com/celox-sim/celox/pull/2214 +* feat(sv)!: solve scalar class constraints during randomize by @tignear in https://github.com/celox-sim/celox/pull/2194 +* feat(sv)!: support unindexed interface array value parameters by @tignear in https://github.com/celox-sim/celox/pull/2204 +* perf(x86): validate wide values at mutation boundaries by @tignear in https://github.com/celox-sim/celox/pull/2205 +* ci: coalesce outdated pull request title checks by @tignear in https://github.com/celox-sim/celox/pull/2217 +* feat(sv): support logical implication expressions by @tignear in https://github.com/celox-sim/celox/pull/2201 +* ci(aplite): avoid product builds for release metadata updates by @tignear in https://github.com/celox-sim/celox/pull/2208 +* fix(test-suite): avoid rebuilding for absent Cargo configuration by @tignear in https://github.com/celox-sim/celox/pull/2218 +* test(xezim): update xezim digest to 44f5c88 by @renovate[bot] in https://github.com/celox-sim/celox/pull/2195 +* test(xezim): update xezim digest to 8082de3 by @renovate[bot] in https://github.com/celox-sim/celox/pull/2227 +* feat(sv): isolate deferred assertions in fork processes by @tignear in https://github.com/celox-sim/celox/pull/2154 +* ci: let required title checks finish independently by @tignear in https://github.com/celox-sim/celox/pull/2246 +* feat(sv): support logical equivalence expressions by @tignear in https://github.com/celox-sim/celox/pull/2207 +* feat(sv)!: support integral array reduction methods by @tignear in https://github.com/celox-sim/celox/pull/2174 +* perf(sir-opt): verify coupled rewrites once per batch by @tignear in https://github.com/celox-sim/celox/pull/2229 +* perf(sv): avoid copying published discovery prefixes by @tignear in https://github.com/celox-sim/celox/pull/2230 +* test(xezim): update xezim digest to 8082de3 by @renovate[bot] in https://github.com/celox-sim/celox/pull/2243 +* feat(sv): support scalar set membership constraints by @tignear in https://github.com/celox-sim/celox/pull/2238 +* feat(sv): solve conditional class constraints bidirectionally by @tignear in https://github.com/celox-sim/celox/pull/2239 +* chore(deps): update rust toolchain to c7e9d51 by @renovate[bot] in https://github.com/celox-sim/celox/pull/2253 +* feat(sv): support per-call inline class constraints by @tignear in https://github.com/celox-sim/celox/pull/2240 +* feat(heap): accept per-call scalar constraint inputs by @tignear in https://github.com/celox-sim/celox/pull/2250 +* feat(sv): bind caller scalar inputs in inline constraints by @tignear in https://github.com/celox-sim/celox/pull/2251 +* ci: protect Rust test caches from release target churn by @tignear in https://github.com/celox-sim/celox/pull/2262 +* refactor(native): support state-aware outlined kernel calls by @tignear in https://github.com/celox-sim/celox/pull/2231 +* perf(native): share large comb kernels and bound compilation memory by @tignear in https://github.com/celox-sim/celox/pull/2232 +* fix(vpi): expose interface parameters and lexical generate scopes by @tignear in https://github.com/celox-sim/celox/pull/2233 +* perf(settle): bound estimated partitions and preserve sparse updates by @tignear in https://github.com/celox-sim/celox/pull/2234 +* ci: qualify release-branch candidates outside the master queue by @tignear in https://github.com/celox-sim/celox/pull/2265 +* chore(deps): update mbx to 1.28.0 by @celox-bot[bot] in https://github.com/celox-sim/celox/pull/2264 +* fix(sv): preserve X/Z in two-state exact comparisons by @tignear in https://github.com/celox-sim/celox/pull/2244 +* feat(sv)!: support dynamic array and queue ordering by @tignear in https://github.com/celox-sim/celox/pull/2272 +* fix(sv): preserve fixed selector bits in case coverage by @tignear in https://github.com/celox-sim/celox/pull/2275 +* perf(sv): evaluate stateless constant functions once by @tignear in https://github.com/celox-sim/celox/pull/2235 +* chore(master): release aplite 0.1.0 by @celox-bot[bot] in https://github.com/celox-sim/celox/pull/2180 + + +**Full Changelog**: https://github.com/celox-sim/celox/compare/v0.11.0...v0.12.0 + ## 0.11.0 (2026-10-14) ## What's Changed diff --git a/Cargo.lock b/Cargo.lock index 6891ab9925b..c62c47dfe3b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -398,7 +398,7 @@ dependencies = [ [[package]] name = "celox" -version = "0.11.0" +version = "0.12.0" dependencies = [ "bit-set", "celox-analysis", @@ -458,14 +458,14 @@ dependencies = [ [[package]] name = "celox-analysis" -version = "0.11.0" +version = "0.12.0" dependencies = [ "fxhash", ] [[package]] name = "celox-backend-arm64" -version = "0.11.0" +version = "0.12.0" dependencies = [ "celox-analysis", "celox-backend-common", @@ -482,14 +482,14 @@ dependencies = [ [[package]] name = "celox-backend-common" -version = "0.11.0" +version = "0.12.0" dependencies = [ "fxhash", ] [[package]] name = "celox-backend-cranelift" -version = "0.11.0" +version = "0.12.0" dependencies = [ "celox-backend-common", "celox-design", @@ -508,7 +508,7 @@ dependencies = [ [[package]] name = "celox-backend-wasm" -version = "0.11.0" +version = "0.12.0" dependencies = [ "celox-backend-cranelift", "celox-design", @@ -522,7 +522,7 @@ dependencies = [ [[package]] name = "celox-backend-x86" -version = "0.11.0" +version = "0.12.0" dependencies = [ "celox-analysis", "celox-backend-common", @@ -541,7 +541,7 @@ dependencies = [ [[package]] name = "celox-bench" -version = "0.11.0" +version = "0.12.0" dependencies = [ "celox", "celox-design", @@ -564,7 +564,7 @@ dependencies = [ [[package]] name = "celox-bench-sv" -version = "0.11.0" +version = "0.12.0" dependencies = [ "veryl-analyzer", "veryl-emitter", @@ -575,7 +575,7 @@ dependencies = [ [[package]] name = "celox-design" -version = "0.11.0" +version = "0.12.0" dependencies = [ "fxhash", "num-bigint", @@ -584,7 +584,7 @@ dependencies = [ [[package]] name = "celox-example-my-frontend-napi" -version = "0.11.0" +version = "0.12.0" dependencies = [ "celox-frontend-sdk", "celox-napi", @@ -595,7 +595,7 @@ dependencies = [ [[package]] name = "celox-frontend-core" -version = "0.11.0" +version = "0.12.0" dependencies = [ "celox-design", "celox-frontend-sdk", @@ -611,7 +611,7 @@ dependencies = [ [[package]] name = "celox-frontend-sdk" -version = "0.11.0" +version = "0.12.0" dependencies = [ "fxhash", "num-bigint", @@ -622,7 +622,7 @@ dependencies = [ [[package]] name = "celox-frontend-sv" -version = "0.11.0" +version = "0.12.0" dependencies = [ "celox-design", "celox-frontend-core", @@ -640,7 +640,7 @@ dependencies = [ [[package]] name = "celox-frontend-veryl" -version = "0.11.0" +version = "0.12.0" dependencies = [ "bit-set", "celox-design", @@ -662,7 +662,7 @@ dependencies = [ [[package]] name = "celox-heap" -version = "0.11.0" +version = "0.12.0" dependencies = [ "aplite", "fxhash", @@ -672,7 +672,7 @@ dependencies = [ [[package]] name = "celox-macros" -version = "0.11.0" +version = "0.12.0" dependencies = [ "fxhash", "insta", @@ -688,7 +688,7 @@ dependencies = [ [[package]] name = "celox-napi" -version = "0.11.0" +version = "0.12.0" dependencies = [ "celox", "celox-design", @@ -711,7 +711,7 @@ dependencies = [ [[package]] name = "celox-runtime" -version = "0.11.0" +version = "0.12.0" dependencies = [ "bit-set", "celox-design", @@ -730,7 +730,7 @@ dependencies = [ [[package]] name = "celox-sir" -version = "0.11.0" +version = "0.12.0" dependencies = [ "celox-analysis", "celox-design", @@ -742,7 +742,7 @@ dependencies = [ [[package]] name = "celox-sir-opt" -version = "0.11.0" +version = "0.12.0" dependencies = [ "bit-set", "celox-analysis", @@ -759,7 +759,7 @@ dependencies = [ [[package]] name = "celox-slt" -version = "0.11.0" +version = "0.12.0" dependencies = [ "celox-analysis", "celox-design", @@ -775,7 +775,7 @@ dependencies = [ [[package]] name = "celox-state-layout" -version = "0.11.0" +version = "0.12.0" dependencies = [ "celox-design", "fxhash", @@ -784,7 +784,7 @@ dependencies = [ [[package]] name = "celox-sv-analyzer" -version = "0.11.0" +version = "0.12.0" dependencies = [ "celox-design", "celox-heap", @@ -797,14 +797,14 @@ dependencies = [ [[package]] name = "celox-sv-syntax" -version = "0.11.0" +version = "0.12.0" dependencies = [ "fxhash", ] [[package]] name = "celox-test-suite" -version = "0.11.0" +version = "0.12.0" dependencies = [ "celox-sv-analyzer", "celox-sv-syntax", @@ -823,7 +823,7 @@ dependencies = [ [[package]] name = "celox-testbench" -version = "0.11.0" +version = "0.12.0" dependencies = [ "celox-design", "celox-heap", @@ -834,7 +834,7 @@ dependencies = [ [[package]] name = "celox-ts-gen" -version = "0.11.0" +version = "0.12.0" dependencies = [ "fxhash", "insta", @@ -847,7 +847,7 @@ dependencies = [ [[package]] name = "celox-vpi" -version = "0.11.0" +version = "0.12.0" dependencies = [ "blake3", "celox", @@ -871,7 +871,7 @@ dependencies = [ [[package]] name = "celox-wasm" -version = "0.11.0" +version = "0.12.0" dependencies = [ "celox", "console_error_panic_hook", @@ -2749,7 +2749,7 @@ checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" [[package]] name = "lydite" -version = "0.11.0" +version = "0.12.0" dependencies = [ "lydite-ir", "lydite-solver", @@ -2760,7 +2760,7 @@ dependencies = [ [[package]] name = "lydite-celox" -version = "0.11.0" +version = "0.12.0" dependencies = [ "celox", "celox-design", @@ -2781,7 +2781,7 @@ dependencies = [ [[package]] name = "lydite-ir" -version = "0.11.0" +version = "0.12.0" dependencies = [ "aplite", "serde_json", @@ -2789,7 +2789,7 @@ dependencies = [ [[package]] name = "lydite-solver" -version = "0.11.0" +version = "0.12.0" dependencies = [ "aplite", "lydite-ir", @@ -2798,7 +2798,7 @@ dependencies = [ [[package]] name = "lydite-syntax" -version = "0.11.0" +version = "0.12.0" dependencies = [ "lydite-ir", "parol", @@ -2810,7 +2810,7 @@ dependencies = [ [[package]] name = "lydite-verify" -version = "0.11.0" +version = "0.12.0" dependencies = [ "lydite-ir", "lydite-solver", diff --git a/Cargo.toml b/Cargo.toml index 49e7d97722b..3acd3d16c6b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ resolver = "2" [workspace.package] # Keep the publishable Rust crates in lockstep with VERSION and the npm packages. # Release Please updates this annotated line as part of the shared release PR. -version = "0.11.0" # x-release-please-version +version = "0.12.0" # x-release-please-version authors = ["tignear"] repository = "https://github.com/celox-sim/celox" keywords = ["hdl", "simulator", "veryl"] @@ -59,31 +59,31 @@ rust-version = "1.99.1" [workspace.dependencies] # Aplite has an independent release version. aplite = { version = "0.1.0", path = "crates/aplite" } -celox = { version = "=0.11.0", path = "crates/celox", default-features = false } # x-release-please-version -celox-analysis = { version = "=0.11.0", path = "crates/celox-analysis" } # x-release-please-version -celox-backend-arm64 = { version = "=0.11.0", path = "crates/celox-backend-arm64" } # x-release-please-version -celox-backend-common = { version = "=0.11.0", path = "crates/celox-backend-common" } # x-release-please-version -celox-backend-cranelift = { version = "=0.11.0", path = "crates/celox-backend-cranelift" } # x-release-please-version -celox-backend-wasm = { version = "=0.11.0", path = "crates/celox-backend-wasm" } # x-release-please-version -celox-backend-x86 = { version = "=0.11.0", path = "crates/celox-backend-x86" } # x-release-please-version -celox-design = { version = "=0.11.0", path = "crates/celox-design" } # x-release-please-version -celox-frontend-core = { version = "=0.11.0", path = "crates/celox-frontend-core" } # x-release-please-version -celox-frontend-sdk = { version = "=0.11.0", path = "crates/celox-frontend-sdk" } # x-release-please-version -celox-frontend-sv = { version = "=0.11.0", path = "crates/celox-frontend-sv" } # x-release-please-version -celox-frontend-veryl = { version = "=0.11.0", path = "crates/celox-frontend-veryl" } # x-release-please-version -celox-heap = { version = "=0.11.0", path = "crates/celox-heap" } # x-release-please-version -celox-macros = { version = "=0.11.0", path = "crates/celox-macros" } # x-release-please-version -celox-napi = { version = "=0.11.0", path = "crates/celox-napi" } # x-release-please-version -celox-runtime = { version = "=0.11.0", path = "crates/celox-runtime" } # x-release-please-version -celox-sir = { version = "=0.11.0", path = "crates/celox-sir" } # x-release-please-version -celox-sir-opt = { version = "=0.11.0", path = "crates/celox-sir-opt", default-features = false } # x-release-please-version -celox-slt = { version = "=0.11.0", path = "crates/celox-slt" } # x-release-please-version -celox-state-layout = { version = "=0.11.0", path = "crates/celox-state-layout" } # x-release-please-version -celox-sv-syntax = { version = "=0.11.0", path = "crates/celox-sv-syntax" } # x-release-please-version -celox-sv-analyzer = { version = "=0.11.0", path = "crates/celox-sv-analyzer" } # x-release-please-version -celox-test-suite = { version = "=0.11.0", path = "crates/celox-test-suite" } # x-release-please-version -celox-testbench = { version = "=0.11.0", path = "crates/celox-testbench" } # x-release-please-version -celox-ts-gen = { version = "=0.11.0", path = "crates/celox-ts-gen" } # x-release-please-version +celox = { version = "=0.12.0", path = "crates/celox", default-features = false } # x-release-please-version +celox-analysis = { version = "=0.12.0", path = "crates/celox-analysis" } # x-release-please-version +celox-backend-arm64 = { version = "=0.12.0", path = "crates/celox-backend-arm64" } # x-release-please-version +celox-backend-common = { version = "=0.12.0", path = "crates/celox-backend-common" } # x-release-please-version +celox-backend-cranelift = { version = "=0.12.0", path = "crates/celox-backend-cranelift" } # x-release-please-version +celox-backend-wasm = { version = "=0.12.0", path = "crates/celox-backend-wasm" } # x-release-please-version +celox-backend-x86 = { version = "=0.12.0", path = "crates/celox-backend-x86" } # x-release-please-version +celox-design = { version = "=0.12.0", path = "crates/celox-design" } # x-release-please-version +celox-frontend-core = { version = "=0.12.0", path = "crates/celox-frontend-core" } # x-release-please-version +celox-frontend-sdk = { version = "=0.12.0", path = "crates/celox-frontend-sdk" } # x-release-please-version +celox-frontend-sv = { version = "=0.12.0", path = "crates/celox-frontend-sv" } # x-release-please-version +celox-frontend-veryl = { version = "=0.12.0", path = "crates/celox-frontend-veryl" } # x-release-please-version +celox-heap = { version = "=0.12.0", path = "crates/celox-heap" } # x-release-please-version +celox-macros = { version = "=0.12.0", path = "crates/celox-macros" } # x-release-please-version +celox-napi = { version = "=0.12.0", path = "crates/celox-napi" } # x-release-please-version +celox-runtime = { version = "=0.12.0", path = "crates/celox-runtime" } # x-release-please-version +celox-sir = { version = "=0.12.0", path = "crates/celox-sir" } # x-release-please-version +celox-sir-opt = { version = "=0.12.0", path = "crates/celox-sir-opt", default-features = false } # x-release-please-version +celox-slt = { version = "=0.12.0", path = "crates/celox-slt" } # x-release-please-version +celox-state-layout = { version = "=0.12.0", path = "crates/celox-state-layout" } # x-release-please-version +celox-sv-syntax = { version = "=0.12.0", path = "crates/celox-sv-syntax" } # x-release-please-version +celox-sv-analyzer = { version = "=0.12.0", path = "crates/celox-sv-analyzer" } # x-release-please-version +celox-test-suite = { version = "=0.12.0", path = "crates/celox-test-suite" } # x-release-please-version +celox-testbench = { version = "=0.12.0", path = "crates/celox-testbench" } # x-release-please-version +celox-ts-gen = { version = "=0.12.0", path = "crates/celox-ts-gen" } # x-release-please-version # lydite is developed in this repository but not published to crates.io. lydite-ir = { path = "crates/lydite-ir" } diff --git a/VERSION b/VERSION index d9df1bbc0c7..ac454c6a1fc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.11.0 +0.12.0 diff --git a/conformance/sv-tests/expected.tsv b/conformance/sv-tests/expected.tsv index e2c957158af..7f39b6c3c91 100644 --- a/conformance/sv-tests/expected.tsv +++ b/conformance/sv-tests/expected.tsv @@ -2841,22 +2841,22 @@ generated/uvm_classes_1/uvm_sequencer_class_1.sv 2state fail generated/uvm_classes_1/uvm_sequencer_class_1.sv 4state fail generated/uvm_classes_1/uvm_test_class_1.sv 2state fail generated/uvm_classes_1/uvm_test_class_1.sv 4state fail -generated/uvm_classes_2/uvm_agent_class_2.sv 2state fail -generated/uvm_classes_2/uvm_agent_class_2.sv 4state fail -generated/uvm_classes_2/uvm_component_class_2.sv 2state fail -generated/uvm_classes_2/uvm_component_class_2.sv 4state fail -generated/uvm_classes_2/uvm_driver_class_2.sv 2state fail -generated/uvm_classes_2/uvm_driver_class_2.sv 4state fail -generated/uvm_classes_2/uvm_env_class_2.sv 2state fail -generated/uvm_classes_2/uvm_env_class_2.sv 4state fail -generated/uvm_classes_2/uvm_monitor_class_2.sv 2state fail -generated/uvm_classes_2/uvm_monitor_class_2.sv 4state fail -generated/uvm_classes_2/uvm_scoreboard_class_2.sv 2state fail -generated/uvm_classes_2/uvm_scoreboard_class_2.sv 4state fail -generated/uvm_classes_2/uvm_sequencer_class_2.sv 2state fail -generated/uvm_classes_2/uvm_sequencer_class_2.sv 4state fail -generated/uvm_classes_2/uvm_test_class_2.sv 2state fail -generated/uvm_classes_2/uvm_test_class_2.sv 4state fail +generated/uvm_classes_2/uvm_agent_class_2.sv 2state pass +generated/uvm_classes_2/uvm_agent_class_2.sv 4state pass +generated/uvm_classes_2/uvm_component_class_2.sv 2state pass +generated/uvm_classes_2/uvm_component_class_2.sv 4state pass +generated/uvm_classes_2/uvm_driver_class_2.sv 2state pass +generated/uvm_classes_2/uvm_driver_class_2.sv 4state pass +generated/uvm_classes_2/uvm_env_class_2.sv 2state pass +generated/uvm_classes_2/uvm_env_class_2.sv 4state pass +generated/uvm_classes_2/uvm_monitor_class_2.sv 2state pass +generated/uvm_classes_2/uvm_monitor_class_2.sv 4state pass +generated/uvm_classes_2/uvm_scoreboard_class_2.sv 2state pass +generated/uvm_classes_2/uvm_scoreboard_class_2.sv 4state pass +generated/uvm_classes_2/uvm_sequencer_class_2.sv 2state pass +generated/uvm_classes_2/uvm_sequencer_class_2.sv 4state pass +generated/uvm_classes_2/uvm_test_class_2.sv 2state pass +generated/uvm_classes_2/uvm_test_class_2.sv 4state pass generated/uvm_classes_3/uvm_agent_class_3.sv 2state fail generated/uvm_classes_3/uvm_agent_class_3.sv 4state fail generated/uvm_classes_3/uvm_component_class_3.sv 2state fail diff --git a/crates/celox-frontend-sv/src/lowering/ff/objects.rs b/crates/celox-frontend-sv/src/lowering/ff/objects.rs index d7d455b940c..96a7134c5d9 100644 --- a/crates/celox-frontend-sv/src/lowering/ff/objects.rs +++ b/crates/celox-frontend-sv/src/lowering/ff/objects.rs @@ -52,6 +52,24 @@ impl Ff<'_, '_> { self.heap_call(ops::OBJECT_RANDOMIZE_INPUTS, &[object, program, inputs]) } } + ObjectOp::ConstraintModeGet(index) => { + let object = self.handle(&args[0])?; + self.heap_call( + ops::encode(ops::OBJECT_CONSTRAINT_MODE_GET, u64::from(*index)), + &[object], + ) + } + ObjectOp::ConstraintModeSet(index) => { + let object = self.handle(&args[0])?; + let enabled = self.integer_of_width(&args[1], 1, false)?; + self.heap_call( + ops::encode( + ops::OBJECT_CONSTRAINT_MODE_SET, + u64::from(index.unwrap_or(u32::MAX)), + ), + &[object, enabled], + ) + } ObjectOp::Container { .. } => unreachable!("handled by container_call"), ObjectOp::New { class, @@ -161,6 +179,8 @@ impl Ff<'_, '_> { HandleProperty::Object => celox_design::ValueKind::ObjRef, }), ObjectOp::Randomize(_) + | ObjectOp::ConstraintModeGet(_) + | ObjectOp::ConstraintModeSet(_) | ObjectOp::Store(_) | ObjectOp::ClassOf | ObjectOp::Random diff --git a/crates/celox-heap/src/objects.rs b/crates/celox-heap/src/objects.rs index 4a55a8f4f2f..f42213cff1e 100644 --- a/crates/celox-heap/src/objects.rs +++ b/crates/celox-heap/src/objects.rs @@ -16,6 +16,8 @@ pub(crate) struct Object { class: u32, random_state: u64, random_modes: RandomModes, + constraint_default: bool, + constraint_modes: fxhash::FxHashMap, saved_random_modes: Vec, /// Remaining domain indices for each randc property, keyed by byte offset. random_cycles: fxhash::FxHashMap>, @@ -90,6 +92,8 @@ impl Heap { class, random_state: 0, random_modes: RandomModes::default(), + constraint_default: true, + constraint_modes: Default::default(), saved_random_modes: Vec::new(), random_cycles: Default::default(), bytes: vec![0; size].into(), @@ -100,6 +104,28 @@ impl Heap { handle } + /// Persistent per-object constraint modes (IEEE 1800-2023 18.9). + pub fn constraint_mode(&mut self, handle: Handle, index: u32) -> bool { + self.object_mut(handle).is_some_and(|object| { + object + .constraint_modes + .get(&index) + .copied() + .unwrap_or(object.constraint_default) + }) + } + + pub fn set_constraint_mode(&mut self, handle: Handle, index: Option, enabled: bool) { + if let Some(object) = self.object_mut(handle) { + if let Some(index) = index { + object.constraint_modes.insert(index, enabled); + } else { + object.constraint_modes.clear(); + object.constraint_default = enabled; + } + } + } + /// Seed an object's independent random stream (IEEE 1800-2023 18.13.3). pub fn seed_object(&mut self, handle: Handle, seed: u32) { if let Some(object) = self.object_mut(handle) { @@ -319,6 +345,32 @@ mod tests { assert_eq!(heap.class_of(NULL), 0); } + #[test] + fn constraint_modes_are_object_state_and_do_not_follow_random_mode_scopes() { + let mut heap = Heap::new(); + let handle = heap.new_object(1, 4); + assert!(heap.constraint_mode(handle, 0)); + let original = heap.clone(); + heap.set_constraint_mode(handle, None, false); + heap.set_constraint_mode(handle, Some(1), true); + assert!(!heap.same_contents(&original)); + heap.push_random_modes(handle); + heap.set_constraint_mode(handle, Some(0), true); + heap.pop_random_modes(handle); + assert!(heap.constraint_mode(handle, 0)); + assert!(heap.constraint_mode(handle, 1)); + assert!(!heap.constraint_mode(handle, 2)); + let bytes = serde_json::to_vec(&heap.objects[&handle]).unwrap(); + let restored: Object = serde_json::from_slice(&bytes).unwrap(); + assert_eq!(restored, heap.objects[&handle]); + let copy = heap.copy_object(handle); + heap.set_constraint_mode(copy, None, true); + assert!(heap.constraint_mode(copy, 2)); + assert!(!heap.constraint_mode(handle, 2)); + assert!(!heap.constraint_mode(NULL, 0)); + assert_eq!(heap.take_fault(), Some(Fault::NullDereference)); + } + #[test] fn copies_are_shallow() { let mut heap = Heap::new(); diff --git a/crates/celox-heap/src/ops.rs b/crates/celox-heap/src/ops.rs index a4694a4fcf2..333b3cc25cb 100644 --- a/crates/celox-heap/src/ops.rs +++ b/crates/celox-heap/src/ops.rs @@ -88,6 +88,9 @@ pub const OBJECT_RANDOMIZE: u64 = 64; /// Program b for object a; c is an input buffer (check-only byte followed by /// big-endian u64 values). The buffer is consumed, including on failure. pub const OBJECT_RANDOMIZE_INPUTS: u64 = 65; +/// Constraint index is encoded in the parameter; set-all uses u32::MAX. +pub const OBJECT_CONSTRAINT_MODE_GET: u64 = 66; +pub const OBJECT_CONSTRAINT_MODE_SET: u64 = 67; /// The opcode word of `op` with parameter `parameter`. pub const fn encode(op: u64, parameter: u64) -> u64 { @@ -248,6 +251,17 @@ impl Heap { 0 } OBJECT_CHECK => u64::from(self.check_object(a as Handle, parameter as u32)), + OBJECT_CONSTRAINT_MODE_GET => { + self.constraint_mode(a as Handle, parameter as u32) as u64 + } + OBJECT_CONSTRAINT_MODE_SET => { + self.set_constraint_mode( + a as Handle, + (parameter != u64::from(u32::MAX)).then_some(parameter as u32), + b & 1 != 0, + ); + 0 + } OBJECT_MODE_GET => { u64::from(self.random_mode(a as Handle, parameter as u32, parameter >> 32 != 0)) } diff --git a/crates/celox-heap/src/randomization.rs b/crates/celox-heap/src/randomization.rs index f0e2ade8091..57a3f0d27d7 100644 --- a/crates/celox-heap/src/randomization.rs +++ b/crates/celox-heap/src/randomization.rs @@ -14,6 +14,11 @@ pub struct Field { #[derive(Clone, Debug, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)] pub enum Expr { + /// Top-level named block predicate; inline predicates remain unconditional. + Enabled { + index: u32, + value: Box, + }, Literal(u32, u64), Field(usize), /// Read-only scalar supplied by this call, never a solver variable. @@ -57,6 +62,7 @@ fn boolean(value: Term) -> Term { impl Expr { fn term(&self, fields: &[Term], inputs: &[u64]) -> Result { Ok(match self { + Self::Enabled { .. } => return Err("nested constraint mode predicate".into()), Self::Literal(width, value) => bv(*width, *value), Self::Input { index, width } => { if !(1..=64).contains(width) { @@ -221,6 +227,14 @@ impl Heap { terms.push(term); } for constraint in &program.constraints { + let constraint = if let Expr::Enabled { index, value } = constraint { + if !self.constraint_mode(handle, *index) { + continue; + } + value.as_ref() + } else { + constraint + }; formula = and(formula, truth(constraint.term(&terms, inputs)?)); } let seed = if projection.is_empty() { diff --git a/crates/celox-napi/package.json b/crates/celox-napi/package.json index fc11fd058ac..4510ee22a59 100644 --- a/crates/celox-napi/package.json +++ b/crates/celox-napi/package.json @@ -1,6 +1,6 @@ { "name": "@celox-sim/celox-napi", - "version": "0.11.0", + "version": "0.12.0", "description": "Celox simulator NAPI bindings", "main": "index.js", "types": "index.d.ts", diff --git a/crates/celox-sv-analyzer/src/ast/classes.rs b/crates/celox-sv-analyzer/src/ast/classes.rs index 44f89baec5f..49f03400b4c 100644 --- a/crates/celox-sv-analyzer/src/ast/classes.rs +++ b/crates/celox-sv-analyzer/src/ast/classes.rs @@ -778,7 +778,10 @@ pub(super) fn class( for method in &declaration.methods { let subroutine = native.subroutine(method.subroutine); let method_name = instances::normalize_identifier(&subroutine.name.spelling); - if matches!(method_name.as_str(), "randomize" | "srandom" | "rand_mode") { + if matches!( + method_name.as_str(), + "randomize" | "srandom" | "rand_mode" | "constraint_mode" + ) { return Err(unsupported( "overriding built-in class randomization methods", )); @@ -868,7 +871,7 @@ pub(super) fn class( .unwrap_or_default(); for block in &declaration.constraints { let block_name = block.name.spelling.clone(); - constraints.retain(|(name, _)| *name != block_name); + let expressions = block .expressions .as_ref() @@ -879,7 +882,12 @@ pub(super) fn class( .map(|&id| constraints::bind(id, tree, &properties, env)) .collect() }); - constraints.push((block_name, expressions)); + // Constraint indices survive overrides, including calls via base handles. + if let Some((_, inherited)) = constraints.iter_mut().find(|(name, _)| *name == block_name) { + *inherited = expressions; + } else { + constraints.push((block_name, expressions)); + } } let class = Rc::new(Class { name: name.to_owned(), diff --git a/crates/celox-sv-analyzer/src/ast/classes/constraints.rs b/crates/celox-sv-analyzer/src/ast/classes/constraints.rs index 9ecf0d40229..debb7a66df3 100644 --- a/crates/celox-sv-analyzer/src/ast/classes/constraints.rs +++ b/crates/celox-sv-analyzer/src/ast/classes/constraints.rs @@ -350,12 +350,17 @@ impl Class { }); } let mut constraints = Vec::new(); - for (_, block) in &self.constraints { + for (index, (_, block)) in self.constraints.iter().enumerate() { constraints.extend( block .as_ref() .map_err(|reason| unsupported(format!("constraints: {reason}")))? - .clone(), + .iter() + .cloned() + .map(|value| ConstraintExpr::Enabled { + index: index as u32, + value: Box::new(value), + }), ); } Ok(Program { diff --git a/crates/celox-sv-analyzer/src/ast/expression_binding.rs b/crates/celox-sv-analyzer/src/ast/expression_binding.rs index f080a738c02..26416384f7c 100644 --- a/crates/celox-sv-analyzer/src/ast/expression_binding.rs +++ b/crates/celox-sv-analyzer/src/ast/expression_binding.rs @@ -17,8 +17,9 @@ pub(super) use lvalues::{net_lvalue, variable_lvalue}; pub(super) use objects::{ Cast as ObjectCast, Receiver as ObjectReceiver, cast as object_cast, check_access as check_member_access, check_assignment as check_handle_assignment, - constructor as object_constructor, method as object_method, property as object_property, - rand_mode_call as object_rand_mode_call, receiver as object_receiver, this as object_this, + constraint_mode_call as object_constraint_mode_call, constructor as object_constructor, + method as object_method, property as object_property, rand_mode_call as object_rand_mode_call, + receiver as object_receiver, this as object_this, }; pub(super) use strings::{ call as string_call, method as string_method, native_string, to_string as string_operand, diff --git a/crates/celox-sv-analyzer/src/ast/expression_binding/direct.rs b/crates/celox-sv-analyzer/src/ast/expression_binding/direct.rs index 736a4859252..05536104d71 100644 --- a/crates/celox-sv-analyzer/src/ast/expression_binding/direct.rs +++ b/crates/celox-sv-analyzer/src/ast/expression_binding/direct.rs @@ -304,6 +304,12 @@ pub(in crate::ast) fn bind_value( values.push(value); continue; } + if let Some(call) = + objects::constraint_mode_call(tree, id, native, dimensions, false)? + { + values.push(call); + continue; + } if let Some(call) = objects::rand_mode_call(tree, id, native, dimensions, false)? { values.push(call); continue; diff --git a/crates/celox-sv-analyzer/src/ast/expression_binding/objects.rs b/crates/celox-sv-analyzer/src/ast/expression_binding/objects.rs index 714fae46d06..a3d1c036622 100644 --- a/crates/celox-sv-analyzer/src/ast/expression_binding/objects.rs +++ b/crates/celox-sv-analyzer/src/ast/expression_binding/objects.rs @@ -829,6 +829,123 @@ pub(super) fn random_selection( ))) } +/// Constraint block modes are independent of member rand_mode and inline constraints (18.9). +pub(in crate::ast) fn constraint_mode_call( + tree: &AnalysisContext<'_>, + id: ExprId, + native: &Declarations, + dimensions: &PackedDimensions, + allow_set: bool, +) -> Converted> { + let (callee, args) = match &native.expression(ungroup(id, native)).kind { + ExprKind::Call { + expression, + arguments, + } => (*expression, arguments.as_slice()), + _ => (id, &[][..]), + }; + let (owner, block, handle) = match &native.expression(ungroup(callee, native)).kind { + ExprKind::Member { + expression, + separator, + name, + } if separator == "." && name.spelling == "constraint_mode" => { + if let Some(owner) = native_class(tree, *expression, native, dimensions) { + ( + owner, + None, + receiver(tree, Some(*expression), native, dimensions)?, + ) + } else { + match &native.expression(ungroup(*expression, native)).kind { + ExprKind::Member { + expression: object, + separator, + name, + } if separator == "." => { + let Some(owner) = native_class(tree, *object, native, dimensions) else { + return Ok(None); + }; + ( + owner, + Some(name.spelling.clone()), + receiver(tree, Some(*object), native, dimensions)?, + ) + } + ExprKind::Name(name) + if scope_class(dimensions).is_some() + && dimensions.get(THIS).is_some() + && dimensions.get(&name.spelling).is_none() => + { + ( + scope_class(dimensions).unwrap(), + Some(name.spelling.clone()), + this(), + ) + } + _ => return Ok(None), + } + } + } + ExprKind::Name(name) + if name.spelling == "constraint_mode" + && dimensions.get("constraint_mode").is_none() => + { + let Some(owner) = scope_class(dimensions) else { + return Ok(None); + }; + if dimensions.get(THIS).is_none() { + return Err(unsupported("constraint_mode requires an object receiver")); + } + (owner, None, this()) + } + _ => return Ok(None), + }; + let class = class(tree, dimensions, &owner)?; + if class.constraints.iter().any(|(_, block)| { + block + .as_ref() + .is_err_and(|reason| reason == "unsupported constraint block form") + }) { + return Err(unsupported( + "constraint_mode for external or static constraint blocks", + )); + } + let index = block + .map(|name| { + class + .constraints + .iter() + .position(|(block, _)| *block == name) + .map(|index| index as u32) + .ok_or_else(|| unsupported(format!("unknown constraint block {name}"))) + }) + .transpose()?; + if args.is_empty() { + let index = index + .ok_or_else(|| unsupported("constraint_mode getter requires one named constraint"))?; + return Ok(Some(classes::object_call( + ObjectOp::ConstraintModeGet(index), + vec![handle], + ))); + } + if !allow_set { + return Err(unsupported( + "constraint_mode setter is void and cannot be used as a value", + )); + } + if args.len() != 1 || args[0].name.is_some() || args[0].value.is_none() { + return Err(unsupported( + "constraint_mode setter requires one on_off argument", + )); + } + let enabled = bind_value(args[0].value.unwrap(), native, tree, dimensions, None)?; + Ok(Some(classes::object_call( + ObjectOp::ConstraintModeSet(index), + vec![handle, enabled], + ))) +} + /// Bind rand_mode's void setter and integer getter separately (18.8). /// A getter requires one random property; only the setter accepts an object. pub(in crate::ast) fn rand_mode_call( diff --git a/crates/celox-sv-analyzer/src/ast/procedural.rs b/crates/celox-sv-analyzer/src/ast/procedural.rs index 7dd29c43dee..35249e4e24e 100644 --- a/crates/celox-sv-analyzer/src/ast/procedural.rs +++ b/crates/celox-sv-analyzer/src/ast/procedural.rs @@ -762,9 +762,12 @@ impl<'s, 't, 'a> BodyBuilder<'s, 't, 'a> { root: celox_sv_syntax::ExprId, ) -> Result, AnalyzerError> { let native = self.tree.declarations(); - if let Some(mut call) = - expression_binding::object_rand_mode_call(self.tree, root, native, &self.dims, true)? - { + if let Some(mut call) = expression_binding::object_constraint_mode_call( + self.tree, root, native, &self.dims, true, + )? + .or(expression_binding::object_rand_mode_call( + self.tree, root, native, &self.dims, true, + )?) { self.rename_expr(&mut call); return Ok(Some(match call { Expr::Call { diff --git a/crates/celox-sv-analyzer/src/system_functions.rs b/crates/celox-sv-analyzer/src/system_functions.rs index e5234516742..eb24e3258ec 100644 --- a/crates/celox-sv-analyzer/src/system_functions.rs +++ b/crates/celox-sv-analyzer/src/system_functions.rs @@ -961,6 +961,8 @@ pub enum ObjectOp { Check(u32), /// Query or set the random mode of a property at its byte offset. ModeGet(u32, bool), + ConstraintModeGet(u32), + ConstraintModeSet(Option), ModeSet(u32), ModePush, ModePop, @@ -992,12 +994,13 @@ impl ObjectOp { Self::Randomize(_) | Self::Seed | Self::Check(_) + | Self::ConstraintModeSet(_) | Self::ModeSet(_) | Self::ModePush | Self::ModePop | Self::ModeSelect(..) | Self::ModeSelected(_) => (32, false), - Self::ModeGet(..) => (32, true), + Self::ModeGet(..) | Self::ConstraintModeGet(_) => (32, true), Self::Load(field) => (field.width as usize, field.signed), Self::New { .. } | Self::ClassOf | Self::Store(_) | Self::Copy => (32, false), } @@ -1018,6 +1021,8 @@ impl fmt::Display for ObjectOp { Self::Seed => "object random seed", Self::Check(_) => "object receiver check", Self::ModeGet(..) => "random mode query", + Self::ConstraintModeGet(_) => "constraint mode query", + Self::ConstraintModeSet(_) => "constraint mode update", Self::ModeSet(_) => "random mode update", Self::ModePush => "save random modes", Self::ModePop => "restore random modes", diff --git a/crates/celox-sv-analyzer/src/tests.rs b/crates/celox-sv-analyzer/src/tests.rs index 641dbb8670d..7c5873c72d4 100644 --- a/crates/celox-sv-analyzer/src/tests.rs +++ b/crates/celox-sv-analyzer/src/tests.rs @@ -7413,3 +7413,48 @@ fn class_inline_randomize_static_names_do_not_capture_caller_locals() { } } } + +#[test] +fn constraint_mode_rejects_invalid_calls() { + for (statement, expected) in [ + ("c.constraint_mode();", "getter requires"), + ("c.missing.constraint_mode(0);", "unknown constraint"), + ("c.x.constraint_mode();", "unknown constraint"), + ("result = c.rule.constraint_mode(1);", "setter is void"), + ("c.rule.constraint_mode(1, 0);", "one on_off"), + ] { + let source = format!( + "module Top; class C; rand bit [3:0] x; constraint rule {{ x == 1; }} endclass C c; int result; initial begin c = new; {statement} end endmodule" + ); + let error = analyze_source(&source, Path::new("constraint_mode.sv")) + .unwrap_err() + .to_string(); + assert!(error.contains(expected), "{statement}: {error}"); + } +} + +#[test] +fn constraint_mode_cannot_be_overridden() { + let source = "module Top; class C; function void constraint_mode(bit flag); endfunction endclass C c; initial c = new; endmodule"; + let error = analyze_source(source, Path::new("constraint_mode_override.sv")) + .unwrap_err() + .to_string(); + assert!(error.contains("overriding"), "{error}"); +} + +#[test] +fn constraint_mode_outside_classes_remains_an_ordinary_function() { + let source = "module Top(output int value); function int constraint_mode(); return 42; endfunction initial value = constraint_mode(); endmodule"; + analyze_source(source, Path::new("constraint_mode_function.sv")).unwrap(); +} + +#[test] +fn constraint_mode_names_do_not_intercept_struct_members() { + for source in [ + "module Top(output int value); struct packed { int constraint_mode; } s; initial value = s.constraint_mode; endmodule", + "module Top(output int value); struct packed { struct packed { int constraint_mode; } child; } s; initial value = s.child.constraint_mode; endmodule", + "module Top(output int value); class C; function int f(); struct packed { int constraint_mode; } s; s.constraint_mode=37; return s.constraint_mode; endfunction endclass C c; initial begin c=new; value=c.f(); end endmodule", + ] { + analyze_source(source, Path::new("constraint_mode_struct.sv")).unwrap(); + } +} diff --git a/crates/celox-sv-syntax/src/parser/classes.rs b/crates/celox-sv-syntax/src/parser/classes.rs index 637f457812e..f2650d03c26 100644 --- a/crates/celox-sv-syntax/src/parser/classes.rs +++ b/crates/celox-sv-syntax/src/parser/classes.rs @@ -22,8 +22,25 @@ impl Parser<'_> { .get(cursor + 1) .map(|index| self.tokens[*index].text.as_str()) .unwrap_or(""); - if token.text == "virtual" && matches!(next, "function" | "task" | "class") { - return false; + if token.text == "virtual" { + // Method qualifiers may follow `virtual` (Syntax 8-1). Look + // through them without consuming a virtual interface's type. + let mut method = cursor + 1; + while self.indices.get(method).is_some_and(|index| { + matches!( + self.tokens[*index].text.as_str(), + "protected" | "local" | "static" + ) + }) { + method += 1; + } + if next == "class" + || self.indices.get(method).is_some_and(|index| { + matches!(self.tokens[*index].text.as_str(), "function" | "task") + }) + { + return false; + } } super::expressions::builtin(&token.text) || matches!( @@ -48,7 +65,7 @@ impl Parser<'_> { pub(super) fn class_property(&mut self) -> Result<()> { let mut qualifiers = ClassQualifiers::default(); - while self.class_qualifier(&mut qualifiers) {} + while self.class_property_qualifier(&mut qualifiers) {} let qualified_const = self.peek() == "const" && matches!(self.nth(1), "protected" | "local" | "static"); let mut special_const = false; @@ -56,7 +73,7 @@ impl Parser<'_> { self.at += 1; while matches!(self.peek(), "static" | "protected" | "local") { special_const |= matches!(self.peek(), "protected" | "local"); - self.class_qualifier(&mut qualifiers); + self.class_property_qualifier(&mut qualifiers); } } let declaration = self.local_declaration()?; @@ -82,13 +99,10 @@ impl Parser<'_> { Ok(()) } - /// Consume one property or method qualifier, recording it. - fn class_qualifier(&mut self, qualifiers: &mut ClassQualifiers) -> bool { + /// Consume one property qualifier; `virtual` belongs to the interface type. + fn class_property_qualifier(&mut self, qualifiers: &mut ClassQualifiers) -> bool { let flag = match self.peek() { "static" => &mut qualifiers.is_static, - "virtual" => &mut qualifiers.is_virtual, - "pure" => &mut qualifiers.is_pure, - "extern" => &mut qualifiers.is_extern, "local" => &mut qualifiers.local, "protected" => &mut qualifiers.protected, "rand" => &mut qualifiers.rand, diff --git a/crates/celox-sv-syntax/src/parser/tests.rs b/crates/celox-sv-syntax/src/parser/tests.rs index 2d264fea687..52ce03c18a8 100644 --- a/crates/celox-sv-syntax/src/parser/tests.rs +++ b/crates/celox-sv-syntax/src/parser/tests.rs @@ -3083,3 +3083,42 @@ fn inline_constraints_retain_ownership_and_bound_nested_calls() { .contains("inline constraint nesting limit") ); } + +#[test] +fn virtual_method_visibility_order_preserves_class_members() { + for qualifiers in [ + "virtual protected", + "protected virtual", + "virtual local", + "local virtual", + ] { + let body = format!( + "class C; {qualifiers} function int f(); return 1; endfunction {qualifiers} task t(); endtask virtual interface bus vif; int after; endclass" + ); + for source in [ + format!("{body} module M; endmodule"), + format!("module M; {body} endmodule"), + format!("package P; {body} endpackage module M; endmodule"), + ] { + let syntax = parse(&source); + let class = &syntax.classes[0]; + assert_eq!(class.methods.len(), 2, "{source}"); + for method in &class.methods { + assert!(method.qualifiers.is_virtual); + assert_eq!( + method.qualifiers.protected, + qualifiers.contains("protected") + ); + assert_eq!(method.qualifiers.local, qualifiers.contains("local")); + } + assert_eq!(class.properties.len(), 2, "{source}"); + assert!(!class.properties[0].qualifiers.is_virtual); + assert!(matches!( + syntax + .data_type(class.properties[0].declaration.data_type) + .kind, + DataTypeKind::VirtualInterface { .. } + )); + } + } +} diff --git a/crates/celox-test-suite/LIMITATIONS.md b/crates/celox-test-suite/LIMITATIONS.md index 4057357db90..bd95060fcb5 100644 --- a/crates/celox-test-suite/LIMITATIONS.md +++ b/crates/celox-test-suite/LIMITATIONS.md @@ -881,3 +881,13 @@ Their actual compile diagnostics are retained in [the Verilator operators report](verification/sv/verilator/operators.json); they remain executed cases rather than exclusions. Reproduce with `verify-sv-verilator --filter two_state_case_equality --jobs 1`. + +### Constraint modes + +The `class::constraint_mode_*` cases keep the assertions required by IEEE +1800-2023 18.9 and 18.5.2. Icarus 13.0 rejects constraint declarations. +Verilator 5.052 passes the pre-hook mode case, but treats integer `2` as enabled +instead of converting the setter argument to `bit` zero, and does not apply +base-handle mode changes to an overridden constraint. See +[the retained observations](verification/repros/sv_constraint_modes.json). +Celox runs these assertions on all registered backends. diff --git a/crates/celox-test-suite/src/sv/cases/class.vtest b/crates/celox-test-suite/src/sv/cases/class.vtest index 185ea735a99..15333f44d7c 100644 --- a/crates/celox-test-suite/src/sv/cases/class.vtest +++ b/crates/celox-test-suite/src/sv/cases/class.vtest @@ -2339,3 +2339,143 @@ module Top(output bit done); endmodule "#) (top Top) (run_until 0) (assert_eq done 1)) + +(case constraint_mode_basic + (source "constraint_mode_basic.sv" #" +module Top(output bit done); + class C; + rand bit [3:0] x; + constraint low { x == 2; } + constraint high { x == 9; } + function void enable_low(); constraint_mode(0); low.constraint_mode(1); endfunction + endclass + C c, alias_c, other; + initial begin + c = new; other = new; alias_c = c; + if (c.low.constraint_mode() != 1 || c.high.constraint_mode() != 1) $fatal(1, "initial modes"); + c.x = 7; + if (c.randomize() || c.x != 7) $fatal(1, "initial contradiction"); + alias_c.high.constraint_mode(0); + if ((c.high.constraint_mode() != 0) || (other.high.constraint_mode() == 0)) $fatal(1, "alias isolation"); + if (!c.randomize() || c.x != 2) $fatal(1, "disabled block"); + c.constraint_mode(0); + if (!(c.randomize() with { x == 5; }) || c.x != 5) $fatal(1, "inline remains active"); + c.high.constraint_mode(1); + if (c.randomize(null)) $fatal(1, "check only fails"); + if (!c.randomize() || c.x != 9 || !c.randomize(null)) $fatal(1, "check only succeeds"); + c.enable_low(); + if (!c.randomize() || c.x != 2) $fatal(1, "implicit receiver"); + c.low.constraint_mode(2); + if (c.low.constraint_mode() != 0) $fatal(1, "bit conversion"); + done = 1; + end +endmodule +"#) + (top Top) (run_until 0) (assert_eq done 1)) + +(case constraint_mode_inheritance + (source "constraint_mode_inheritance.sv" #" +package pkg; + class Base; + rand bit [3:0] x, y; + constraint first { x == 1; } + constraint second { y == 3; } + function void disable_first(); first.constraint_mode(0); endfunction + endclass +endpackage +module Top(output bit done); + class Derived extends pkg::Base; + constraint first { x == 7; } + constraint third { y == 5; } + endclass + Derived d; + pkg::Base b; + initial begin + d = new; b = d; + b.constraint_mode(0); + if ((d.first.constraint_mode() != 0) || (d.second.constraint_mode() != 0) || (d.third.constraint_mode() != 0)) $fatal(1, "dynamic all"); + b.first.constraint_mode(1); + d.third.constraint_mode(1); + if ((d.first.constraint_mode() == 0) || (d.second.constraint_mode() != 0) || (d.third.constraint_mode() == 0)) $fatal(1, "override modes"); + // Package-base randomize dispatch is tracked separately in #1892. + if (!d.randomize()) $fatal(1, "override solve"); + if (d.x != 7 || d.y != 5) $fatal(1, "override values x=%d y=%d", d.x, d.y); + b.disable_first(); + if ((d.first.constraint_mode() != 0) || (d.third.constraint_mode() == 0)) $fatal(1, "inherited method"); + if (!(d.randomize() with { x == 2; }) || d.x != 2 || d.y != 5) $fatal(1, "disabled override"); + b.constraint_mode(1); + if ((d.first.constraint_mode() == 0) || (d.second.constraint_mode() == 0) || (d.third.constraint_mode() == 0)) $fatal(1, "all enabled"); + done = 1; + end +endmodule +"#) + (top Top) (run_until 0) (assert_eq done 1)) + +(case constraint_mode_hooks + (source "constraint_mode_hooks.sv" #" +module Top(output bit done); + class C; + rand bit [3:0] x; + bit disable_c; + constraint c { x == 2; } + function void pre_randomize(); c.constraint_mode(!disable_c); endfunction + endclass + C p; + initial begin + p = new; p.disable_c = 1; + if (!(p.randomize(x) with { x == 7; }) || p.x != 7) $fatal(1, "pre-hook disable"); + if (p.c.constraint_mode() != 0) $fatal(1, "mode survives selected randomize"); + p.disable_c = 0; + if (p.randomize(x) with { x == 7; }) $fatal(1, "pre-hook enable"); + if ((p.c.constraint_mode() == 0) || p.x != 7) $fatal(1, "failed solve mode"); + if (!p.randomize() || p.x != 2) $fatal(1, "subsequent solve"); + done = 1; + end +endmodule +"#) + (top Top) (run_until 0) (assert_eq done 1)) + +(case constraint_mode_base_dispatch + (source "constraint_mode_base_dispatch.sv" #" +module Top(output bit done); + class Base; + rand bit [3:0] x, y; + constraint a { x == 1; } + constraint b { y == 3; } + endclass + class Derived extends Base; + constraint a { x == 7; } + constraint c { y == 5; } + endclass + Base b; + Derived d; + initial begin + d = new; b = d; + b.b.constraint_mode(0); + if (!b.randomize() || d.x != 7 || d.y != 5) $fatal(1, "dynamic override"); + b.a.constraint_mode(0); + if (!(b.randomize() with { x == 2; }) || d.x != 2 || d.y != 5) $fatal(1, "inline dynamic modes"); + done = 1; + end +endmodule +"#) + (top Top) (run_until 0) (assert_eq done 1)) + +(case constraint_mode_ordinary_struct_members + (source "constraint_mode_struct.sv" #" + module Top(input int data, output int direct_value, nested_value); + struct packed { int constraint_mode; } direct_data; + struct packed { struct packed { int constraint_mode; } child; } nested_data; + always_comb begin + direct_data.constraint_mode = data; + nested_data.child.constraint_mode = data + 1; + direct_value = direct_data.constraint_mode; + nested_value = nested_data.child.constraint_mode; + end + endmodule + "#) + (top Top) + (for value (list 0 37 255) + (modify (set data value)) + (assert_eq direct_value value) + (assert_eq nested_value (+ value 1)))) diff --git a/crates/celox-test-suite/verification/repros/sv_constraint_modes.json b/crates/celox-test-suite/verification/repros/sv_constraint_modes.json new file mode 100644 index 00000000000..ef9e4f6cc36 --- /dev/null +++ b/crates/celox-test-suite/verification/repros/sv_constraint_modes.json @@ -0,0 +1,53 @@ +{ + "specification": "IEEE 1800-2023 18.9, 18.5.2", + "observations": [ + { + "tool": "icarus", + "case": "class::constraint_mode_base_dispatch", + "status": "compile_error", + "log": "Icarus build exit status: 8; see /build.log\n/source_0.sv:5: sorry: Constraint declarations not supported.\n/source_0.sv:6: sorry: Constraint declarations not supported.\n/source_0.sv:9: sorry: Constraint declarations not supported.\n/source_0.sv:10: sorry: Constraint declarations not supported.\n/source_0.sv:19: syntax error\n/source_0.sv:19: error: Operand of unary ! is not a primary expression.\n/source_0.sv:19: error: Malformed statement\n/source_0.sv:19: error: Malformed conditional expression.\n" + }, + { + "tool": "icarus", + "case": "class::constraint_mode_basic", + "status": "compile_error", + "log": "Icarus build exit status: 6; see /build.log\n/source_0.sv:5: sorry: Constraint declarations not supported.\n/source_0.sv:6: sorry: Constraint declarations not supported.\n/source_0.sv:19: syntax error\n/source_0.sv:19: error: Operand of unary ! is not a primary expression.\n/source_0.sv:19: error: Malformed statement\n/source_0.sv:19: error: Malformed conditional expression.\n" + }, + { + "tool": "icarus", + "case": "class::constraint_mode_hooks", + "status": "compile_error", + "log": "Icarus build exit status: 7; see /build.log\n/source_0.sv:6: sorry: Constraint declarations not supported.\n/source_0.sv:12: syntax error\n/source_0.sv:12: error: Operand of unary ! is not a primary expression.\n/source_0.sv:12: error: Malformed statement\n/source_0.sv:12: error: Malformed conditional expression.\n/source_0.sv:15: syntax error\n/source_0.sv:15: error: Malformed conditional expression.\n" + }, + { + "tool": "icarus", + "case": "class::constraint_mode_inheritance", + "status": "compile_error", + "log": "Icarus build exit status: 8; see /build.log\n/source_0.sv:5: sorry: Constraint declarations not supported.\n/source_0.sv:6: sorry: Constraint declarations not supported.\n/source_0.sv:12: sorry: Constraint declarations not supported.\n/source_0.sv:13: sorry: Constraint declarations not supported.\n/source_0.sv:29: syntax error\n/source_0.sv:29: error: Operand of unary ! is not a primary expression.\n/source_0.sv:29: error: Malformed statement\n/source_0.sv:29: error: Malformed conditional expression.\n" + }, + { + "tool": "verilator", + "case": "class::constraint_mode_base_dispatch", + "status": "runtime_error", + "log": "native testbench failed: exit status: 1; see runtime.log and protocol.log\n" + }, + { + "tool": "verilator", + "case": "class::constraint_mode_basic", + "status": "runtime_error", + "log": "native testbench failed: exit status: 1; see runtime.log and protocol.log\n" + }, + { + "tool": "verilator", + "case": "class::constraint_mode_hooks", + "status": "passed", + "log": "" + }, + { + "tool": "verilator", + "case": "class::constraint_mode_inheritance", + "status": "runtime_error", + "log": "native testbench failed: exit status: 1; see runtime.log and protocol.log\n" + } + ] +} diff --git a/crates/celox-test-suite/verification/sv/icarus/class.json b/crates/celox-test-suite/verification/sv/icarus/class.json index 05ab75a150e..662bbf60606 100644 --- a/crates/celox-test-suite/verification/sv/icarus/class.json +++ b/crates/celox-test-suite/verification/sv/icarus/class.json @@ -576,6 +576,94 @@ "tag_reasons": {}, "tags": [] }, + { + "category": "Types", + "detail": "Icarus rejects constraint declarations and inline randomize with blocks before elaboration. IEEE 1800-2023 18.5 and 18.7 define these constructs. Celox retains all assertions.", + "expectation": "Simulation", + "known_issue": { + "id": "sv_icarus_constraint_modes", + "category": "simulator_compile_limitation", + "phase": "compile", + "observed_version": "Icarus Verilog version 13.0 (devel)", + "reason": "Icarus rejects constraint declarations and inline randomize with blocks before elaboration. IEEE 1800-2023 18.5 and 18.7 define these constructs. Celox retains all assertions.", + "upstream": [], + "evidence": [ + "verification/repros/sv_constraint_modes.json" + ] + }, + "name": "class::constraint_mode_base_dispatch", + "phase": "skip", + "status": "ignored", + "stronger_than_sv": false, + "tag_reasons": {}, + "tags": [] + }, + { + "category": "Types", + "detail": "Icarus rejects constraint declarations and inline randomize with blocks before elaboration. IEEE 1800-2023 18.5 and 18.7 define these constructs. Celox retains all assertions.", + "expectation": "Simulation", + "known_issue": { + "id": "sv_icarus_constraint_modes", + "category": "simulator_compile_limitation", + "phase": "compile", + "observed_version": "Icarus Verilog version 13.0 (devel)", + "reason": "Icarus rejects constraint declarations and inline randomize with blocks before elaboration. IEEE 1800-2023 18.5 and 18.7 define these constructs. Celox retains all assertions.", + "upstream": [], + "evidence": [ + "verification/repros/sv_constraint_modes.json" + ] + }, + "name": "class::constraint_mode_basic", + "phase": "skip", + "status": "ignored", + "stronger_than_sv": false, + "tag_reasons": {}, + "tags": [] + }, + { + "category": "Types", + "detail": "Icarus rejects constraint declarations and inline randomize with blocks before elaboration. IEEE 1800-2023 18.5 and 18.7 define these constructs. Celox retains all assertions.", + "expectation": "Simulation", + "known_issue": { + "id": "sv_icarus_constraint_modes", + "category": "simulator_compile_limitation", + "phase": "compile", + "observed_version": "Icarus Verilog version 13.0 (devel)", + "reason": "Icarus rejects constraint declarations and inline randomize with blocks before elaboration. IEEE 1800-2023 18.5 and 18.7 define these constructs. Celox retains all assertions.", + "upstream": [], + "evidence": [ + "verification/repros/sv_constraint_modes.json" + ] + }, + "name": "class::constraint_mode_hooks", + "phase": "skip", + "status": "ignored", + "stronger_than_sv": false, + "tag_reasons": {}, + "tags": [] + }, + { + "category": "Types", + "detail": "Icarus rejects constraint declarations and inline randomize with blocks before elaboration. IEEE 1800-2023 18.5 and 18.7 define these constructs. Celox retains all assertions.", + "expectation": "Simulation", + "known_issue": { + "id": "sv_icarus_constraint_modes", + "category": "simulator_compile_limitation", + "phase": "compile", + "observed_version": "Icarus Verilog version 13.0 (devel)", + "reason": "Icarus rejects constraint declarations and inline randomize with blocks before elaboration. IEEE 1800-2023 18.5 and 18.7 define these constructs. Celox retains all assertions.", + "upstream": [], + "evidence": [ + "verification/repros/sv_constraint_modes.json" + ] + }, + "name": "class::constraint_mode_inheritance", + "phase": "skip", + "status": "ignored", + "stronger_than_sv": false, + "tag_reasons": {}, + "tags": [] + }, { "category": "Types", "detail": "", diff --git a/crates/celox-test-suite/verification/sv/limitations.json b/crates/celox-test-suite/verification/sv/limitations.json index 3134fa38015..7de2f2a253b 100644 --- a/crates/celox-test-suite/verification/sv/limitations.json +++ b/crates/celox-test-suite/verification/sv/limitations.json @@ -2682,5 +2682,57 @@ "class::constrained_randomize_inline_input_hooks" ] } + }, + { + "id": "sv_verilator_constraint_mode_bit_argument", + "category": "simulator_disagreement", + "phase": "execute", + "observed_version": "Verilator 5.052 2026-09-05 rev v5.052", + "reason": "IEEE 1800-2023 18.9 declares constraint_mode(bit on_off). Passing integer 2 converts to bit zero and disables the block. Verilator keeps it enabled; the regression preserves the mode query assertion.", + "upstream": [], + "evidence": [ + "verification/repros/sv_constraint_modes.json" + ], + "cases": { + "verilator": [ + "class::constraint_mode_basic" + ] + } + }, + { + "id": "sv_verilator_constraint_mode_override", + "category": "simulator_disagreement", + "phase": "execute", + "observed_version": "Verilator 5.052 2026-09-05 rev v5.052", + "reason": "IEEE 1800-2023 18.5.2 replaces an inherited constraint with the derived block of the same name, and 18.9 permits mode control of a block in the class hierarchy. Verilator changes a separate base-block mode through a base handle: the derived mode query remains disabled after enabling the base name, or the overridden predicate remains active after disabling it. The regressions retain both getter and solve assertions.", + "upstream": [], + "evidence": [ + "verification/repros/sv_constraint_modes.json" + ], + "cases": { + "verilator": [ + "class::constraint_mode_inheritance", + "class::constraint_mode_base_dispatch" + ] + } + }, + { + "id": "sv_icarus_constraint_modes", + "category": "simulator_compile_limitation", + "phase": "compile", + "observed_version": "Icarus Verilog version 13.0 (devel)", + "reason": "Icarus rejects constraint declarations and inline randomize with blocks before elaboration. IEEE 1800-2023 18.5 and 18.7 define these constructs. Celox retains all assertions.", + "upstream": [], + "evidence": [ + "verification/repros/sv_constraint_modes.json" + ], + "cases": { + "icarus": [ + "class::constraint_mode_base_dispatch", + "class::constraint_mode_basic", + "class::constraint_mode_hooks", + "class::constraint_mode_inheritance" + ] + } } ] diff --git a/crates/celox-test-suite/verification/sv/verilator/class.json b/crates/celox-test-suite/verification/sv/verilator/class.json index 2cf1b0997f6..c574f51eb23 100644 --- a/crates/celox-test-suite/verification/sv/verilator/class.json +++ b/crates/celox-test-suite/verification/sv/verilator/class.json @@ -194,6 +194,72 @@ "tag_reasons": {}, "tags": [] }, + { + "category": "Types", + "detail": "IEEE 1800-2023 18.5.2 replaces an inherited constraint with the derived block of the same name, and 18.9 permits mode control of a block in the class hierarchy. Verilator changes a separate base-block mode through a base handle: the derived mode query remains disabled after enabling the base name, or the overridden predicate remains active after disabling it. The regressions retain both getter and solve assertions.", + "expectation": "Simulation", + "known_issue": { + "id": "sv_verilator_constraint_mode_override", + "category": "simulator_disagreement", + "phase": "execute", + "observed_version": "Verilator 5.052 2026-09-05 rev v5.052", + "reason": "IEEE 1800-2023 18.5.2 replaces an inherited constraint with the derived block of the same name, and 18.9 permits mode control of a block in the class hierarchy. Verilator changes a separate base-block mode through a base handle: the derived mode query remains disabled after enabling the base name, or the overridden predicate remains active after disabling it. The regressions retain both getter and solve assertions.", + "upstream": [], + "evidence": [ + "verification/repros/sv_constraint_modes.json" + ] + }, + "name": "class::constraint_mode_base_dispatch", + "phase": "skip", + "status": "ignored", + "stronger_than_sv": false, + "tag_reasons": {}, + "tags": [] + }, + { + "category": "Types", + "detail": "IEEE 1800-2023 18.9 declares constraint_mode(bit on_off). Passing integer 2 converts to bit zero and disables the block. Verilator keeps it enabled; the regression preserves the mode query assertion.", + "expectation": "Simulation", + "known_issue": { + "id": "sv_verilator_constraint_mode_bit_argument", + "category": "simulator_disagreement", + "phase": "execute", + "observed_version": "Verilator 5.052 2026-09-05 rev v5.052", + "reason": "IEEE 1800-2023 18.9 declares constraint_mode(bit on_off). Passing integer 2 converts to bit zero and disables the block. Verilator keeps it enabled; the regression preserves the mode query assertion.", + "upstream": [], + "evidence": [ + "verification/repros/sv_constraint_modes.json" + ] + }, + "name": "class::constraint_mode_basic", + "phase": "skip", + "status": "ignored", + "stronger_than_sv": false, + "tag_reasons": {}, + "tags": [] + }, + { + "category": "Types", + "detail": "IEEE 1800-2023 18.5.2 replaces an inherited constraint with the derived block of the same name, and 18.9 permits mode control of a block in the class hierarchy. Verilator changes a separate base-block mode through a base handle: the derived mode query remains disabled after enabling the base name, or the overridden predicate remains active after disabling it. The regressions retain both getter and solve assertions.", + "expectation": "Simulation", + "known_issue": { + "id": "sv_verilator_constraint_mode_override", + "category": "simulator_disagreement", + "phase": "execute", + "observed_version": "Verilator 5.052 2026-09-05 rev v5.052", + "reason": "IEEE 1800-2023 18.5.2 replaces an inherited constraint with the derived block of the same name, and 18.9 permits mode control of a block in the class hierarchy. Verilator changes a separate base-block mode through a base handle: the derived mode query remains disabled after enabling the base name, or the overridden predicate remains active after disabling it. The regressions retain both getter and solve assertions.", + "upstream": [], + "evidence": [ + "verification/repros/sv_constraint_modes.json" + ] + }, + "name": "class::constraint_mode_inheritance", + "phase": "skip", + "status": "ignored", + "stronger_than_sv": false, + "tag_reasons": {}, + "tags": [] + }, { "category": "Types", "detail": "", diff --git a/crates/celox/tests/frontends/systemverilog/class.rs b/crates/celox/tests/frontends/systemverilog/class.rs index 96ff7dad702..532dbdbab09 100644 --- a/crates/celox/tests/frontends/systemverilog/class.rs +++ b/crates/celox/tests/frontends/systemverilog/class.rs @@ -3,6 +3,9 @@ use super::*; sv_backends! { + fn constraint_mode_ordinary_struct_members(sim) { + @case "class::constraint_mode_ordinary_struct_members"; + } fn class_objects_properties_and_methods(sim) { @case "class::objects_properties_and_methods"; } } @@ -964,3 +967,53 @@ sv_backends! { sv_backends! { fn constrained_randomize_inline_input_hooks(sim) { @case "class::constrained_randomize_inline_input_hooks"; } } + +sv_backends! { + fn constraint_mode_basic(sim) { @case "class::constraint_mode_basic"; } + fn constraint_mode_inheritance(sim) { @case "class::constraint_mode_inheritance"; } + fn constraint_mode_hooks(sim) { @case "class::constraint_mode_hooks"; } +} + +sv_backends! { + fn constraint_mode_checkpoint(sim) { + @setup { let source = r#" + module Top(input bit enable, output int mode, output bit [3:0] value); + timeunit 1ps / 1ps; + class C; + rand bit [3:0] x; + constraint c { x == 2; } + endclass + C p; + initial begin + p = new; + p.constraint_mode(0); + #10 if (enable) p.c.constraint_mode(1); + #10; + mode = p.c.constraint_mode(); + if (mode) begin + if (!p.randomize()) $fatal(1, "enabled solve"); + end else begin + if (!(p.randomize() with { x == 7; })) $fatal(1, "restored solve"); + end + value = p.x; + end + endmodule + "#; } + @build celox::Simulation::from_sv_sources(vec![(source, Path::new("constraint_mode_checkpoint.sv"))], "Top").four_state(true); + sim.run_until(5).unwrap(); + let saved = sim.checkpoint().unwrap(); + let enable = sim.signal("enable"); + sim.modify(|io| io.set(enable, 1u8)).unwrap(); + sim.run_until(25).unwrap(); + assert_eq!(sim.get(sim.signal("mode")), 1u8.into()); + assert_eq!(sim.get(sim.signal("value")), 2u8.into()); + sim.restore(&saved).unwrap(); + sim.run_until(25).unwrap(); + assert_eq!(sim.get(sim.signal("mode")), 0u8.into()); + assert_eq!(sim.get(sim.signal("value")), 7u8.into()); + } +} + +sv_backends! { + fn constraint_mode_base_dispatch(sim) { @case "class::constraint_mode_base_dispatch"; } +} diff --git a/docs/guide/systemverilog-reference.md b/docs/guide/systemverilog-reference.md index d13b74f2436..8efcd2f127b 100644 --- a/docs/guide/systemverilog-reference.md +++ b/docs/guide/systemverilog-reference.md @@ -222,6 +222,17 @@ properties and skips the post-hook (18.6.3). Resource exhaustion is a runtime er This initial seeded-search policy does not guarantee a uniform distribution; distribution improvements are tracked in [#2187](https://github.com/celox-sim/celox/issues/2187). +`object.block.constraint_mode()` returns the named block's mode as a signed +`int`; `object.block.constraint_mode(bit)` changes it. The void setter +`object.constraint_mode(bit)` changes every constraint of the dynamic object, +including inherited and overridden blocks. All constraints start enabled. +Aliases share modes; other objects do not. A pre-hook's mode updates affect the +current solve and remain installed after success or failure. These modes are +independent of `rand_mode`, explicit member selection and inline `with` +predicates, which remain active. Checkpoints preserve modes (18.9, 18.5.2). +Static/external constraint blocks remain unsupported. Regenerate serialized +heap/checkpoint images from earlier builds after this heap-layout change. + Set membership (`inside`) supports scalar two-state values and inclusive bounded ranges, including expressions of other properties. Reversed ranges are empty; negation excludes the set. All operands share the membership-wide width and @@ -234,7 +245,7 @@ nested blocks. Both sides participate in solving: a required result can constrai the condition. These constructs do not choose a branch before solving. Constrained enums and `randc`, foreach/soft constraints, -`dist`, `solve before`, constraint modes, external/static blocks and typed +`dist`, `solve before`, external/static blocks and typed parameters in constraints remain unsupported. Larger unconstrained `randc` domains, static random properties and random array/object/string properties also remain unsupported. Unsupported dynamic subclasses are rejected before draws. diff --git a/docs/ja/guide/systemverilog-reference.md b/docs/ja/guide/systemverilog-reference.md index 4020fcca030..d6968d5875f 100644 --- a/docs/ja/guide/systemverilog-reference.md +++ b/docs/ja/guide/systemverilog-reference.md @@ -143,8 +143,17 @@ seedを使って解を探索し、成功時だけ対象プロパティをまと 値を保持して`0`を返し、postフックを呼びません(18.6.3)。探索予算切れは実行時エラーです。 この初期実装は一様分布を保証しません。分布の改善は[#2187](https://github.com/celox-sim/celox/issues/2187)で追跡します。 -制約付きenum・`randc`、`inside`、条件付き・foreach・soft制約、`dist`、`solve before`、 -制約モード、外部・static制約ブロック、制約中の型付きパラメーター、inline `with` は未対応です。 +`object.block.constraint_mode()` は制約ブロックの有効状態を `int` で返し、 +`object.block.constraint_mode(bit)` は指定ブロックを切り替えます。 +`object.constraint_mode(bit)` は動的なオブジェクトの全制約を切り替えます。 +初期状態はすべて有効で、継承・同名制約の上書き・別名ハンドルに対応します。 +`pre_randomize()` 内の変更はその回の solve に適用され、成功・失敗後も残ります。 +`rand_mode`、メンバー選択、inline 制約とは独立し、チェックポイントで復元されます +(IEEE 1800-2023 18.9、18.5.2)。ヒープ形式が変わるため、以前のビルドで保存した +シリアライズ済みヒープ・チェックポイントは再生成してください。 + +制約付きenum・`randc`、foreach・soft制約、`dist`、`solve before`、 +外部・static制約ブロック、制約中の型付きパラメーターは未対応です。 上記の上限を超える制約なし`randc`、staticな乱数プロパティ、配列・オブジェクト・文字列の 乱数化も未対応です。未対応の子クラスは乱数生成前に拒否します。 `null` を通した呼び出しは実行時エラーです。 diff --git a/packages/celox/package.json b/packages/celox/package.json index 58cee5e097a..88a7425921d 100644 --- a/packages/celox/package.json +++ b/packages/celox/package.json @@ -1,6 +1,6 @@ { "name": "@celox-sim/celox", - "version": "0.11.0", + "version": "0.12.0", "description": "TypeScript runtime for Celox HDL simulation", "type": "module", "main": "./dist/index.js", diff --git a/packages/vite-plugin/package.json b/packages/vite-plugin/package.json index 2b5895e8842..1e389bdeb7a 100644 --- a/packages/vite-plugin/package.json +++ b/packages/vite-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@celox-sim/vite-plugin", - "version": "0.11.0", + "version": "0.12.0", "description": "Vite plugin for importing .veryl files as typed ModuleDefinition objects", "type": "module", "main": "./dist/index.js",