Repository navigation
feat(sv)!: support $stop and $exit - #1402
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. |
|
Queued — the merge queue status continues in this comment ↓. |
191620d to
f72c621
Compare
Merge Queue Status
This pull request spent 28 minutes 20 seconds in the queue, with no time running CI. ReasonThe pull request conflicts with the base branch The pull request was held in the queue, conflicting with at least one of 2 pull requests ahead of it. The conflict became a base branch one after #1391 merged. Automatic conflict resolution can merge a conflict like this one instead of stopping on it, but only in a queue using the HintYou should update or rebase your pull request. If you want to requeue this pull request, you can post a Requeued — the merge queue status continues in this comment ↓. |
f72c621 to
ec85136
Compare
$stop in a process kernel suspends the simulation (IEEE 1800-2023 20.2): the process returns with the new Stop status, the scheduler settles combinational logic, saves the round in progress and returns with is_stopped() set. The next step continues that round after the $stop, so edges made before it still trigger their domains. Checkpoints and state files are refused while suspended. Outside a kernel, $stop is reported as RuntimeEvent::Stop, as $finish is reported as Finish. Batch hosts end the run at it. $exit is ignored: Celox has no program blocks, and 24.7 ignores a call from outside one. BREAKING CHANGE: RuntimeEvent, RuntimeEventKind, ProcessStatus, Halt and CheckpointError gain a Stop/Stopped variant. Change-Id: Ia7467b814439b7542423436ce48b87e1a2d0597f
ec85136 to
aa048d5
Compare
Merge Queue Status
This pull request spent 40 minutes 37 seconds in the queue, including 39 minutes 6 seconds running CI. Required conditions to merge
|
Summary
$stop(IEEE 1800-2023 20.2) suspends the simulation.initialblock), the process returns with a newProcessStatus::Stop(status code 9), keeping its place first among the ready processes.Simulation::step/run_untilthen return with the newis_stopped()set.$stop(also inside loops and functions). The processes waiting in that round run next. Edges made before the stop still trigger their domains, and the end of the time step (NBA region,finish_timed_step, VCD) happens once.run_until_boundedreturnsfalseat a stop.checkpoint()andsave_state()fail with the newCheckpointError::Stopped, because a checkpoint cannot hold a half-finished time step. Restoring a checkpoint discards a suspended round.alwaysprocesses,$stopis reported as the newRuntimeEvent::Stop, as$finishis reported asFinish.$stop, asvvp -ndoes and asvpi_control(vpiStop)already did: the VPI host, the Veryl testbench and the sv-tests runner.$exit(24.7) ends the initial procedures of the program block that calls it. Celox has no program blocks, and 24.7 ignores a call from anywhere else, so it is a no-op. The spec's optional warning is not issued, because SV has no warning plumbing yet.Simulation.isStopped().Compatibility
Breaking change:
RuntimeEvent,RuntimeEventKind,ProcessStatus,celox_runtime::timing::HaltandCheckpointErroreach gain aStop/Stoppedvariant, so exhaustive matches downstream need a new arm.Testing
stepandrun_until, inside a runtime loop and a function, with a second process that waits;Stopevents fromalways_ff/always_comb;$exitignored, and$exit(1)rejected.chapter-20/20.2--stop.svand20.2--exit.svnow pass. The whole suite matches the updatedexpected.tsv.cargo test -p celox --features systemverilog --no-fail-fastandcargo test -p celox-runtime -p celox-design -p celox-frontend-core -p celox-frontend-sv -p celox-vpi -p celox-napi: 11577 passed, 0 failed.cargo clippy --workspace --all-targets,cargo check -p celox-napi, and the TypeScript typecheck.$stophas no shared suite case: Icarus (vvp -n) and Verilator both end the run at it, so its suspension cannot be compared there.