Skip to content

Commit

Permalink
Routing refactor v2 (#1643)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yu-Zhewen committed Aug 7, 2024
1 parent b3f51f8 commit b8a4890
Show file tree
Hide file tree
Showing 56 changed files with 1,490 additions and 10,900 deletions.
16 changes: 14 additions & 2 deletions docs/AIERouting.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Here is an example of how users can route the circuit-switched `test/create-flow

```
cd ${path-to-mlir-aie}/tools/aie-routing-command-line
aie-opt --aie-create-pathfinder-flows='keep-flow-op=true' ../../test/create-flows/broadcast.mlir \
aie-opt --aie-create-pathfinder-flows --aie-find-flows ../../test/create-flows/broadcast.mlir \
| aie-translate --aie-flows-to-json > example.json
python3 visualize.py -j example.json
```
Expand Down Expand Up @@ -172,7 +172,19 @@ Similarly, to visualize a packet-switched example,

```
cd ${path-to-mlir-aie}/tools/aie-routing-command-line
aie-opt --aie-create-pathfinder-flows='keep-flow-op=true' ../../test/create-packet-flows/test_create_packet_flows6.mlir \
aie-opt --aie-create-pathfinder-flows --aie-find-flows ../../test/create-packet-flows/test_create_packet_flows6.mlir \
| aie-translate --aie-flows-to-json > example.json
python3 visualize.py -j example.json
```


## Benckmarking Routing

A python script is provided to measure the wall-clock time and the length of paths routed. Simply run

```
python3 utils/router_performance.py test/create-flows/
python3 utils/router_performance.py test/create-packet-flows/
```

and the generated `routing_performance_results.csv` files can be found under the corresponding folders.
11 changes: 0 additions & 11 deletions include/aie/Dialect/AIE/Transforms/AIEPasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,10 @@ struct AIEPathfinderPass : AIERoutePathfinderFlowsBase<AIEPathfinderPass> {

typedef std::pair<mlir::Operation *, Port> PhysPort;

typedef struct {
SwitchboxOp sw;
Port sourcePort;
Port destPort;
} SwConnection;

bool findPathToDest(SwitchSettings settings, TileID currTile,
WireBundle currDestBundle, int currDestChannel,
TileID finalTile, WireBundle finalDestBundle,
int finalDestChannel);

SwitchboxOp getSwitchbox(DeviceOp &d, int col, int row);

mlir::Operation *getOrCreateTile(mlir::OpBuilder &builder, int col, int row);
SwitchboxOp getOrCreateSwitchbox(mlir::OpBuilder &builder, TileOp tile);
};

} // namespace xilinx::AIE
Expand Down
5 changes: 1 addition & 4 deletions include/aie/Dialect/AIE/Transforms/AIEPasses.td
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,7 @@ def AIERoutePathfinderFlows : Pass<"aie-create-pathfinder-flows", "DeviceOp"> {
Option<"clRouteCircuit", "route-circuit", "bool", /*default=*/"true",
"Flag to enable aie.flow lowering.">,
Option<"clRoutePacket", "route-packet", "bool", /*default=*/"true",
"Flag to enable aie.packetflow lowering.">,
Option<"clKeepFlowOp", "keep-flow-op", "bool", /*default=*/"false",
"Flag to not erase aie.flow/packetflow after its lowering,"
"used for routing visualization.">,
"Flag to enable aie.packetflow lowering.">,
];
}

Expand Down
Loading

0 comments on commit b8a4890

Please sign in to comment.