Repository navigation
feat(testbench)!: support basic Veryl string values - #1371
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
|
Queued — the merge queue status continues in this comment ↓. |
Contributor
Merge Queue Status
This pull request spent 52 minutes 5 seconds in the queue, including 36 minutes 37 seconds running CI. Required conditions to merge
|
38 of 66 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stage 2 of 2; based on #1370. Merge the test PR first, then retarget this PR to
master.Veryl testbench
stringassignments currently truncate to the nominal one-bit width, so even assigning"short"and comparing it with the same literal fails. Store strings as dynamically sized byte values owned by each simulator, with dedicated bytecode loads/stores and lexicographic comparisons. Enable the Celox cases introduced by the prerequisite test PR #1370.Support covers constant scalar string
letinitializers, changing lengths, empty strings, independent copies, conditional expressions, indexed string-array elements, function arguments/returns, assertion/display arguments, and component method arguments. Checkpoints capture and restore string values and account for their payload size. Layout-independent state files cannot encode this state yet and return an explicit error instead of silently dropping it.The reproduction in veryl-lang/veryl#3555 now prints all five expected lines (
let/var/const,%s, and direct display); regression assertions check the rendered bytes. This is a bounded Veryl testbench subset, not full SystemVerilog string support. String concatenation/replication, character indexing/slicing, unary or mixed numeric/string operations, and nonconstant/array stringletinitializers are rejected explicitly. Negative regressions also check thatlen()andsubstr()are rejected by the current frontend. SV string methods, conversions and NUL rules are not claimed as supported.Add portable array/function cases, clock/message/checkpoint regressions, a dynamic component filename regression, and a NAPI test. The SV-frontend harness exclusion remains unchanged; Verilator and Icarus execute the shared Veryl cases through the native-testbench emitter.
Validation:
cargo test --locked -p celox --test testbench_string: 36 passed, including native, native parallel, Cranelift, Cranelift parallel, Wasm, interpreter, and clock/message/checkpoint regressions.native_testbench,component_method,checkpoint,concurrent_initial, andinitial_readmem: 277 passed, 1 pre-existing ignored benchmark.celox-testbenchandcelox-frontend-verylunit tests: 100 passed.--filter tb_string::: all 5 cases pass on each (2 fresh, 3 reused).-D warnings, TypeScript typecheck, Biome, workspace check, andpnpm run build:napi.pnpm --filter @celox-sim/celox exec vitest run src/e2e.test.ts -t "E2E: native testbench": 10 passed; 98 unrelated tests filtered out.Public API compatibility:
TestbenchValue,ExprOpcode, andStateErrorgain variants. Downstream exhaustive matches need updating, so this PR uses a breaking-change title.No retained verification baselines changed.