Skip to content

Conversation

@mattgodbolt
Copy link
Member

No description provided.

mattgodbolt and others added 7 commits October 17, 2025 09:49
Tracks why ready uops don't dispatch each cycle, emitting
blockedFromDispatch events when blocking reasons change. This helps
visualize and understand pipeline bottlenecks beyond basic port contention.

Blocking reasons tracked:
- port_busy_older_uop: Older uop dispatched to the port instead
- port_blocked_resource: Port blocked by microarchitectural constraint
- port_removed_by_constraint: Port excluded by paired stores or 256-bit restrictions

Uses BlockingEvent NamedTuple following codebase patterns. Only emits
events when the blocking reason changes to minimize JSON size.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Extends the blocking information system to track why uops don't issue
from the IDQ (instruction decode queue) each cycle. This complements
the existing dispatch blocking tracking.

Issue blocking reasons tracked:
- issue_width_exceeded: Exceeded the CPU's issue width limit (4 on SKL)
- register_merge_required: Waiting for register merge uops to be issued
- serializing_instruction_waiting: Serializing instruction waiting for ROB to drain
- reorder_buffer_full: ROB is full, preventing issue
- reservation_station_full: RS is full, preventing issue

The blocking events are emitted to the JSON output under the
'blockedFromIssue' array for each cycle. Like dispatch blocking,
events are deduplicated to only emit when the blocking reason changes.

This information enables visualizers (like CE's planned wavefront view)
to explain why instructions are queued and unable to progress through
the pipeline, without having to reverse-engineer the blocking reasons
from dependencies and resource usage.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Extends the blocking information system to track why instructions can't
be decoded from the instruction queue (IQ) into the IDQ (instruction
decode queue) each cycle. This completes pipeline blocking coverage
alongside the existing issue and dispatch blocking tracking.

Front-end blocking reasons tracked:
- idq_full: IDQ is full, preventing further decode. This occurs when
  the backend (issue/execute) can't keep up with the front-end decode
  rate, causing the IDQ to fill up.

The blocking events are emitted to the JSON output under the
'blockedFromDecode' array for each cycle. Instructions waiting in the
IQ are reported along with the IDQ size at the time of blocking.

Test case: A long dependency chain (60 inc rax instructions) triggers
IDQ full conditions in 43% of cycles, demonstrating real front-end
bottlenecks where decode stalls because the backend is slow.

This information enables visualizers (like CE's planned wavefront view)
to explain why instructions in the predecode (P) state aren't
progressing to the queue (Q) state, completing the pipeline blocking
picture: P→Q→I→r→D→E→R.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Improve code consistency with original codebase conventions:
- Move imports to module level
- Use namedtuple with defaults instead of NamedTuple
- Remove type annotations from instance variables
- Simplify nested loops using existing getUnfusedUops()
- Extract duplicate event processing into helper function

Reduces code by 32 lines while maintaining all functionality.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Move json import to local scope in generateJSONOutput (matches existing style)
- Remove unused Tuple and Any type imports
- Remove namedtuple defaults parameter (requires Python 3.7+)
- Add explicit empty dict arguments to maintain compatibility with Python 3.6

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
The deduplication logic was only comparing the 'reason' string,
which caused loss of information when details differed between
consecutive events. This particularly affected port_busy_older_uop
events where different uops dispatch on consecutive cycles.

Now compares both reason and details, preserving all events where
either changes. This ensures dispatchedInstead information is not
lost.

Side effect: idq_full events will now record IDQ size fluctuations
instead of collapsing to first occurrence.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Blocking info collection has O(N) overhead in the scheduler dispatch
loop. This change makes it optional via command-line flag.

Changes:
- Add --trackBlocking argument to command-line parser
- Thread trackBlocking flag through FrontEnd, Renamer, Scheduler
- Guard all blockingInfo.append() calls with if self.trackBlocking
- Add 'blockingTracked' to JSON parameters for consumers

When disabled (default), no blocking info overhead during simulation.
When enabled, full blocking diagnostics are collected.

JSON consumers can check parameters.blockingTracked to distinguish
"no blocking events" from "tracking was disabled".

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
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