Repository navigation
perf(runtime)!: compare counted wait baselines in place - #1803
Merged
Merged
Conversation
A wait term on a counted signal kept the signal's value at the last check as a pair of BigUints: every check read the signal into new BigUints and compared them. Like an uncounted plain signal, it now keeps the signal's plane image (Baseline::RawCounter) and compares it with the state in place. Counter remains for signals without a plane image and for baselines loaded from a state file, which become RawCounter at their first check; a RawCounter saves as the same Counter record. BREAKING CHANGE: celox_runtime::timing::Baseline has a new variant, RawCounter. Change-Id: Icaf42a4570d829af240927beaeafcb3642cf245b
Change-Id: I1a6d04d2baedc95cd44502fe1d7c769680f54ec2
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. |
Contributor
|
Queued — the merge queue status continues in this comment ↓. |
Contributor
Merge Queue Status
This pull request spent 1 hour 31 minutes 18 seconds in the queue, including 1 hour 11 minutes 20 seconds running CI. Required conditions to merge
|
40 of 71 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.
Part of #1123. Follow-up to #1726: the
Baseline::Countercheck cost.Problem
A wait term on a counted signal (one whose intermediate writes are counted, #1726) kept the signal's value at its last check as a
(BigUint, BigUint)pair. Everycheck_waitscall read the signal into two new BigUints, compared them withoccursand replaced the baseline, which meant allocations and frees on every check. That is why (c), a watchedalways_combpulse, cost as much as thealways @*path (cs).Change
Baseline::RawCounter { seen, raw }keeps the counted signal's plane image, the same representation an uncounted plain signal already uses (Baseline::Raw). A check compares it with the state in place, viaadvance,planes_equalandplanes_occur, so it allocates nothing.Baseline::Counterstill covers signals without a plane image (array-layout signals) and baselines loaded from a state file. LikeValue→Raw, a loadedCounterbecomesRawCounterat its first check.RawCountersaves as the sameBaselineRecord::Counter, byte for byte whatCountersaved, so the file format is unchanged. A new test round-trips a counted wait through a state file, in 2-state and 4-state, at two points. It checks the waiters wake as in an uninterrupted run and that a loaded file re-saves identically.check_waitstests the commonRawterm before the general match. Without that, the extra variant cost the uncounted path about 5 Ir per check, (b1) +0.06%.Breaking:
celox_runtime::timing::Baselinegains a variant, henceperf(runtime)!.Performance
Runtime Ir measured with callgrind (200k-cycle minus 20k-cycle runs, taskset), base origin/master 3766461 vs this branch:
(c) and (cs) drop by about 4,740 Ir per cycle. Both are now well below where (cs) was before. Compile time is unchanged (no SIR change).
Validation
cargo test -p celox --features systemverilog --lib --test systemverilog --test state_file --test processes: 4442 passed, 0 failed.cargo test -p celox-runtime: 76 passed.CELOX_SCHEDULER=differentialontiming::(refactor(runtime)!: run timed slots from SimulationState with a differential scheduler harness #1756): 576 passed, 0 failed.cargo fmt --checkand clippy-D warnings(celox, celox-runtime, all targets) are clean.