-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate the routing for control flows and data flows #1082
base: main
Are you sure you want to change the base?
Conversation
CTRL
and non-CTRL
@@ -236,7 +236,8 @@ def AIE_PacketRuleOp: AIE_Op<"rule"> { | |||
let arguments = ( | |||
ins I8Attr:$mask, | |||
I8Attr:$value, | |||
Index:$amsel | |||
Index:$amsel, | |||
OptionalAttr<DenseI32ArrayAttr>:$packet_ids |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When lowering packet_flow
to packet_rule
, the IDs can be used to calculate the mask and value. However, the reverse operation (calculating the IDs from the mask and value) is not feasible, as we will probably get a superset of actual IDs. This can cause issues during the second run of the router.
@@ -108,22 +139,17 @@ PacketRulesOp getOrCreatePacketRules(OpBuilder &builder, SwitchboxOp &swboxOp, | |||
return packetRules; | |||
} | |||
|
|||
struct ConvertFlowsToInterconnect : OpConversionPattern<FlowOp> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't use OpConversionPattern
, as it is also conditional based on whether it is control flow or not.
// CHECK: aie.rule(31, 10, %3) | ||
// CHECK: aie.rule(27, 11, %3) | ||
// CHECK: aie.rule(24, 8, %2) | ||
// CHECK: aie.rule(31, 13, %[[VAL_70]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -132,6 +117,23 @@ struct PhysPortAndID { | |||
TUPLE_LIKE_STRUCT_RELATIONAL_OPS(PhysPortAndID) | |||
}; | |||
|
|||
struct RouterImpl; | |||
struct Router { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The struct Router
has been moved after the definition of PhysPort
to accommodate the newly introduced addFixedPacketConnection
function.
The routing results for control flows should remain unchanged, no matter whether (or how many data flows) are present. Therefore, the routing pass is now run twice, with the first time to route control flows only, and the second to route data flows. To achieve this,
Note:
mlir-aie
handled the problem by still running the routing pass only once, and sorting flows before invoking Dijkstra's algorithm (https://github.com/Xilinx/mlir-aie/blob/a60888210c76266cc932d5a0cc922fceef0322f0/lib/Dialect/AIE/Transforms/AIEPathFinder.cpp#L349). However, since Dijkstra is an iterative, congestion-aware algorithm, sorting alone does not fully prevent congestion from data flows affecting control flow routing.