Repository navigation
perf(runtime): share the interpreter's combinational program across clocks - #2009
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. |
Merge Queue Status
This pull request spent 1 hour 14 minutes 13 seconds in the queue, including 1 hour 47 seconds running CI. ReasonThe merge conditions cannot be satisfied due to failing checks
Failing checks:
HintYou may have to fix your CI before adding the pull request to the queue again. Waiting for
All conditions
Requeued — the merge queue status continues in this comment ↓. |
…locks Closes #2004 Change-Id: I25c5836030d05db672adcb2159c9aa2fdb9e7890
1ea32b4 to
dfc09d0
Compare
Merge Queue Status
This pull request spent 42 minutes 9 seconds in the queue, including 34 minutes 2 seconds running CI. Required conditions to merge
|
Closes #2004.
Summary
InterpBackend::newbuilt a separate combined program for every eval/apply clock without a fused schedule, consisting of a freshprepare_units(&eval_comb)plus a second copy of the clock's FF units. It also clonedcomb_trigger_addrsinto each clock's trigger list. Memory and build time were O(clocks × comb size), and the tiered and interpreter backends ran out of memory on C906.Now:
eval_combis prepared once (eval_comb_units, which already existed). A combined tick of a clock without a fused schedule runseval_comb_unitsand then the clock'seval_apply_unitsas one group, with one trigger snapshot at group entry as before.run_unitstakes an iterator of units for this. Only clocks with a fused schedule keep their own prepared list (fused_comb_apply_units).eval_comb()and the combined tick does not change results:Registersare generation-stamped on every execution, so no state carries over between runs.TriggerAddrsiterates the union of the shared combinational list and the clock's list in sorted order, each address once. The snapshots are the same sorted, deduplicated list as before.I also read the rest of
InterpBackend::newand the per-tick paths:eval_comb,eval_apply_ff_at,eval_comb_apply_ff_at,eval_only_ff_at,apply_ff_atandrun_process. The eval/apply, eval-only, apply and process units are each prepared once, and the per-tick paths reuse the snapshot buffer, so no other per-clock copy was left. One remaining duplication is not in the interpreter: events with identical fused SIR (clock and reset aliases,apply_fused_optimization_hints) each get their owneval_comb_apply_ffsentry in the SIR program, so each one is prepared separately.Tests
combined_ticks_of_several_clocks_match_the_compiled_backend: a three-clock design with combinational logic between the domains. It runs a fixed sequence of deferred-comb ticks (the combined comb+FF path) on the interpreter and on Cranelift and compares all outputs after every step.trigger_addrs_iterate_the_union_in_order: the merged trigger list equals the sorted, deduplicated concatenation for overlapping, disjoint and empty lists.celoxtest suite with--features systemverilog(theall_backends!interpreter variants included); see below.Per the decision for complexity-order fixes, no benchmarks were run.
Local run:
cargo nextest run -p celox --features systemverilogunder the memory cap gave 14635 passed, 0 failed, 313 skipped. Clippy (--lib --tests --features systemverilog) and fmt are clean.