Select Shim Tile Used for Trace Packet Extraction#3120
Open
Victor-Jung wants to merge 1 commit into
Open
Conversation
…tract trace packets.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an IR/Python-level knob (egress_shim_col, defaulting to 0) to control which shim column is used as the egress destination for trace packet extraction, avoiding unrouteable designs when column 0 shim resources are congested.
Changes:
- Extend
aie.trace.host_configwith a newegress_shim_colattribute (MLIR assembly + verifier). - Update
-aie-insert-trace-flowsto routerouting=singletraces to the selected shim column and validate it. - Plumb the new option through the Python helper and update the basic event trace example.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| python/dialects/aie.py | Adds egress_shim_col parameter to trace_host_config and forwards it to the op. |
| programming_examples/basic/event_trace/aie_trace.mlir | Demonstrates selecting a non-default shim column for trace egress. |
| lib/Dialect/AIE/Transforms/AIEInsertTraceFlows.cpp | Uses egress_shim_col to select the target shim column and validates the choice. |
| lib/Dialect/AIE/IR/AIETraceOps.cpp | Prints/parses egress_shim_col and verifies it is non-negative. |
| include/aie/Dialect/AIE/IR/AIETraceOps.td | Documents and defines the new egress_shim_col default-valued attribute. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+327
to
+334
| // All traces route to a single shim, controlled by the egress_shim_col parameter (default is 0). | ||
| int targetCol = egressShimColFromIR; | ||
| if (targetCol >= targetModel.columns() || | ||
| !targetModel.isShimNOCTile(targetCol, 0)) { | ||
| device.emitError() << "egress_shim_col " << targetCol | ||
| << " is not a valid shim NOC tile (device has " | ||
| << targetModel.columns() << " columns)"; | ||
| return signalPassFailure(); |
Comment on lines
+841
to
+844
| // Validate Shim col id | ||
| if (getEgressShimCol() < 0) { | ||
| return emitOpError("egress_shim_col must be >= 0"); | ||
| } |
| // Configure trace output buffer (8192 bytes, default arg_idx=4) | ||
| aie.trace.host_config buffer_size = 8192 | ||
| // Configure trace output buffer (8192 bytes, default arg_idx=4). | ||
| // Select which shim should be used by the egress trace transfer (default is the shim tile from column 0). |
fifield
reviewed
May 28, 2026
Collaborator
fifield
left a comment
There was a problem hiding this comment.
How does this relate to and interact with the lateral trace routing feature?
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.
@jgmelber
Trace packet flows currently land on the shim at column 0 (hard-coded target of the
routing = singlestrategy inAIEInsertTraceFlows). On a busy column whose shim channels are already taken by compute flows, this causes the design to be unrootable.This PR adds a small IR-level knob to select which column to use (default is 0).
MLIR:
Python: