Skip to content

[circt-sim] Add missing EventScheduler::peekCurrentRegion and stepDeltaUpTo#71

Merged
thomasnormal merged 1 commit intomainfrom
fix-event-queue-missing-methods
Mar 3, 2026
Merged

[circt-sim] Add missing EventScheduler::peekCurrentRegion and stepDeltaUpTo#71
thomasnormal merged 1 commit intomainfrom
fix-event-queue-missing-methods

Conversation

@thomasnormal
Copy link
Owner

Summary

ProcessScheduler.cpp (introduced in 827f1855f) calls peekCurrentRegion() and stepDeltaUpTo() on EventScheduler, but these methods were never declared in EventQueue.h or implemented in EventQueue.cpp, causing build failures.

This PR adds the missing declarations and implementations:

  • TimeWheel::peekCurrentRegion(): Returns the next non-empty SchedulingRegion in the current delta without advancing the cursor. Returns NumRegions if no events remain in the current delta.
  • TimeWheel::processDeltaUpTo(limitRegion): Processes all regions in the current delta up to and including limitRegion; advances the region cursor past the limit and cleans up empty queues. Returns the number of events processed.
  • EventScheduler::peekCurrentRegion(): Thin wrapper delegating to TimeWheel.
  • EventScheduler::stepDeltaUpTo(limitRegion): Thin wrapper; updates event and delta-cycle stats.

Test plan

  • Build compiles without errors (these were the only missing symbols)
  • check-circt-tools-circt-sim lit tests pass
  • sv-tests pass (no regressions)

🤖 Generated with Claude Code

…taUpTo

ProcessScheduler.cpp (added in 827f185) calls peekCurrentRegion() and
stepDeltaUpTo() on EventScheduler, but these methods were never declared in
EventQueue.h or implemented in EventQueue.cpp, causing build failures.

Add:
- TimeWheel::peekCurrentRegion(): returns the next non-empty SchedulingRegion
  in the current delta without advancing the cursor (returns NumRegions if
  no events remain).
- TimeWheel::processDeltaUpTo(limitRegion): processes all regions in the
  current delta up to and including limitRegion; advances the region cursor
  and cleans up empty queues.
- EventScheduler::peekCurrentRegion(): thin wrapper around TimeWheel.
- EventScheduler::stepDeltaUpTo(limitRegion): thin wrapper; updates stats.
@thomasnormal thomasnormal merged commit 785f6cd into main Mar 3, 2026
3 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants