Repository navigation
feat(runtime)!: run program kernels in the reactive region set - #1896
Conversation
|
This pull request is part of a Mergify stack:
|
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dee80f04c8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| inactive, | ||
| nba_queue, | ||
| domain_counters, | ||
| ..ProcessState::default() |
There was a problem hiding this comment.
Preserve reactive queues in state files
When a simulation is saved at $stop with program work pending, the new reactive, re_inactive, and re_nba_queue fields are silently lost: name_processes() still serializes only the original queues, and this reconstruction replaces the new queues with empty defaults. For example, the stopped program itself is now queued in reactive, so loading the saved state can permanently prevent it from resuming; pending program nonblocking assignments are likewise discarded. Extend the state-file process record and its save/load conversion to round-trip all three queues.
Useful? React with 👍 / 👎.
| if round.reactive { | ||
| // The Reactive region is empty: the Re-Inactive region's | ||
| // processes resume, and once both are empty the Re-NBA region | ||
| // publishes the program's nonblocking assignments. Design | ||
| // processes and domains wait for the active region set (IEEE | ||
| // 1800-2023 4.5, 24.3.1). |
There was a problem hiding this comment.
Defer design combinational evaluation until the reactive set drains
When a program changes an input used by design combinational logic and then suspends with #0, the unconditional settle_pass() above this branch calls settle_marked() → executor.eval_comb() before the program resumes in Re-Inactive. This executes design Active-region work inside the reactive region set, despite deferring design process kernels and sequential domains until afterward. For example, with an initially zero input a and design assignment assign b = a, a program executing a = 1; #0; sample = b; #1; observes the newly computed b prematurely. Defer design combinational evaluation, as well as other design activity, until control returns to the active region set.
Useful? React with 👍 / 👎.
|
Queued — the merge queue status continues in this comment ↓. |
A kernel of a program instance names the status slot of the instance's first kernel (ProcessSlots::program). Such kernels start, wake and resume in the Reactive region, a #0 resumes them in the Re-Inactive region, and their nonblocking updates take effect in the Re-NBA region (IEEE 1800-2023 4.4.2.6-4.4.2.8, 24.3.1). The reactive region set runs once the active region set is empty and returns to the active region set for the design activity it creates (4.5). ProcessStatus::Exit ends every kernel of the calling program instance (24.7), and the implicit $finish fires once every program kernel has ended (24.3). Program kernels run on the reference scheduler. Designs without programs schedule as before. BREAKING CHANGE: ProcessSlots gains `program`, ProcessStatus gains `Exit`, ProcessState and ScheduleKey gain the reactive, re-inactive and Re-NBA queues, and the native image container format is now 35. Change-Id: I6c899de1f0d5e8ca722733a53655ee80e3c988b8
dee80f0 to
883befe
Compare
Revision history
|
Merge Queue Status
This pull request spent 2 hours 42 minutes 8 seconds in the queue, including 1 hour 49 minutes 17 seconds running CI. Required conditions to merge
|
A kernel of a program instance names the status slot of the instance's
first kernel (ProcessSlots::program). Such kernels start, wake and resume
in the Reactive region, a #0 resumes them in the Re-Inactive region, and
their nonblocking updates take effect in the Re-NBA region (IEEE
1800-2023 4.4.2.6-4.4.2.8, 24.3.1). The reactive region set runs once the
active region set is empty and returns to the active region set for the
design activity it creates (4.5).
ProcessStatus::Exit ends every kernel of the calling program instance
(24.7), and the implicit $finish fires once every program kernel has
ended (24.3). Program kernels run on the reference scheduler.
Designs without programs schedule as before.
BREAKING CHANGE: ProcessSlots gains
program, ProcessStatus gainsExit, ProcessState and ScheduleKey gain the reactive, re-inactive andRe-NBA queues, and the native image container format is now 35.
Part of #1862.
Validation (rebased on c430061)
celox/systemverilog,celox-test-suite/verilator,celox-test-suite/icarus), nextest over celox, celox-runtime, celox-design, celox-frontend-core, celox-frontend-sv, celox-sv-analyzer, celox-sv-syntax and celox-test-suite passes 15241 tests. Thenested_write_perf deep_per_bit_*tests were excluded; this change does not touch them.CELOX_SCHEDULER=differentialpasses 4594 tests.cargo check --workspace --all-targets --features celox/systemverilogis clean, and the celox-runtime tests pass.cargo clippy --workspace --all-targetswith CI's features and--no-depsis clean, and so iscargo fmt --check.Performance (designs without programs)
Callgrind Ir, heliodor-dev, taskset 8-11, base master c430061:
SimulationState::step_untilinclusiveEvery workload is equal or lower, but not instruction-identical.