You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(runtime): waking processes compares every waiter's watched signals on every round #2079
rtlmeter C906 simulates at about 35 cycles/s on the native backend (four-state, hello: ~3,300 cycles in ~95 s after "Init Program"). xezim needs 2.5 s for the whole run. A profile of the simulation phase (perf, native, master + #2058 + #2073) shows the JIT code is not the cost:
55.7% SimulationState::check_waits (crates/celox-runtime/src/simulation/wait.rs), called from continue_round → run_time / end_time
of which 33.7% is self time in advance (planes_equal / copy_planes on the watched signal's planes) and 19.5% is self time in check_waits
check_waits visits every waiting process and every term of its event control on every round. For each Baseline::Raw term it compares the signal's whole state planes with the last seen image. The cost per round is therefore O(waiters × bytes of their watched signals), whether anything changed or not. A suspect is event controls whose terms are whole unpacked memories (for example the implicit sensitivity of an always @* that reads mem[addr]). C906's 2^19-entry SRAM banks would then be compared byte by byte every round.
Expected
Waking waiters costs O(changed signals), not O(waiters × watched bytes):
terms on large or array signals use write counters or dirty marks (Baseline::Counter / RawCounter already exist) instead of full plane comparison;
check_waits only visits waiters whose signals were written since the last check (an index from signal to waiters).
First confirm which terms dominate on C906. The fix must not slow down designs with few waiters (b2 callgrind gate).
Activity
perf(sv): simulate sensitivity lists that cover their reads like alwa…