Skip to content

Commit

Permalink
Add support for control connections (#1451)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenneuendorffer authored May 8, 2024
1 parent 6b66e0a commit d7d7ca6
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 2 deletions.
3 changes: 2 additions & 1 deletion include/aie/Dialect/AIE/IR/AIEAttrs.td
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ def EastWire: I32EnumAttrCase<"East", 6>;
def PLIOWire: I32EnumAttrCase<"PLIO", 7>;
def NOCWire: I32EnumAttrCase<"NOC", 8>;
def TraceWire: I32EnumAttrCase<"Trace", 9>;
def ControlWire: I32EnumAttrCase<"Ctrl", 10>;

def WireBundle: I32EnumAttr<"WireBundle", "Bundle of wires",
[
CoreWire, DMAWire, FIFOWire, SouthWire, WestWire, NorthWire,
EastWire, PLIOWire, NOCWire, TraceWire
EastWire, PLIOWire, NOCWire, TraceWire, ControlWire
]> {

let cppNamespace = "xilinx::AIE";
Expand Down
19 changes: 19 additions & 0 deletions lib/Dialect/AIE/IR/AIETargetModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ AIE1TargetModel::getNumDestSwitchboxConnections(int col, int row,
return 0;
return 4;
}
case WireBundle::Ctrl:
return isShimNOCTile(col, row) ? 1 : 0;
default:
return 0;
}
Expand All @@ -153,6 +155,8 @@ AIE1TargetModel::getNumDestSwitchboxConnections(int col, int row,
return 0;
return 4;
}
case WireBundle::Ctrl:
return 1;
default:
return 0;
}
Expand Down Expand Up @@ -181,6 +185,8 @@ AIE1TargetModel::getNumSourceSwitchboxConnections(int col, int row,
}
case WireBundle::Trace:
return 1;
case WireBundle::Ctrl:
return isShimNOCTile(col, row) ? 1 : 0;
default:
return 0;
}
Expand Down Expand Up @@ -209,6 +215,8 @@ AIE1TargetModel::getNumSourceSwitchboxConnections(int col, int row,
}
case WireBundle::Trace:
return 2;
case WireBundle::Ctrl:
return 1;
default:
return 0;
}
Expand Down Expand Up @@ -343,6 +351,8 @@ AIE2TargetModel::getNumDestSwitchboxConnections(int col, int row,
return 6;
case WireBundle::South:
return 4;
case WireBundle::Ctrl:
return 1;
default:
return 0;
}
Expand All @@ -365,6 +375,8 @@ AIE2TargetModel::getNumDestSwitchboxConnections(int col, int row,
return 0;
return 4;
}
case WireBundle::Ctrl:
return isShimNOCTile(col, row) ? 1 : 0;
default:
return 0;
}
Expand Down Expand Up @@ -393,6 +405,8 @@ AIE2TargetModel::getNumDestSwitchboxConnections(int col, int row,
return 0;
return 4;
}
case WireBundle::Ctrl:
return 1;
default:
return 0;
}
Expand All @@ -410,6 +424,7 @@ AIE2TargetModel::getNumSourceSwitchboxConnections(int col, int row,
case WireBundle::South:
return 6;
case WireBundle::Trace:
case WireBundle::Ctrl:
return 1;
default:
return 0;
Expand All @@ -435,6 +450,8 @@ AIE2TargetModel::getNumSourceSwitchboxConnections(int col, int row,
}
case WireBundle::Trace:
return 1;
case WireBundle::Ctrl:
return isShimNOCTile(col, row) ? 1 : 0;
default:
return 0;
}
Expand Down Expand Up @@ -467,6 +484,8 @@ AIE2TargetModel::getNumSourceSwitchboxConnections(int col, int row,
case WireBundle::Trace:
// Port 0: core trace. Port 1: memory trace.
return 2;
case WireBundle::Ctrl:
return 1;
default:
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Targets/AIETargetCDODirect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static const std::map<WireBundle, StrmSwPortType>
WIRE_BUNDLE_TO_STRM_SW_PORT_TYPE = {
{WireBundle::Core, StrmSwPortType::CORE},
{WireBundle::DMA, StrmSwPortType::DMA},
// missing control from StrmSwPortType
{WireBundle::Ctrl, StrmSwPortType::CTRL},
{WireBundle::FIFO, StrmSwPortType::FIFO},
{WireBundle::South, StrmSwPortType::SOUTH},
{WireBundle::West, StrmSwPortType::WEST},
Expand Down
4 changes: 4 additions & 0 deletions test/dialect/AIE/switchbox-vc1902.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ module {
aie.connect<North: 3, South: 3> // 4 southgoing connections
aie.connect<West: 3, East: 3> // 4 eastgoing connections
aie.connect<Trace: 0, South: 1>
aie.connect<Ctrl: 0, North: 2>
aie.connect<North: 2, Ctrl: 0>
}

%30 = aie.tile(3, 0) // Shim-NOC
Expand Down Expand Up @@ -89,6 +91,8 @@ module {
aie.connect<East: 3, West: 3> // 4 westgoing connections
aie.connect<North: 3, South: 3> // 4 southgoing connections
aie.connect<West: 3, East: 3> // 4 eastgoing connections
aie.connect<Ctrl: 0, North: 1>
aie.connect<North: 2, Ctrl: 0>
}
}
}
6 changes: 6 additions & 0 deletions test/dialect/AIE/switchbox-ve2802.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ module {
aie.connect<North: 3, South: 3> // 4 southgoing connections
aie.connect<West: 3, East: 3> // 4 eastgoing connections
aie.connect<Trace: 0, South: 1>
aie.connect<Ctrl: 0, North: 2>
aie.connect<North: 2, Ctrl: 0>
}

%30 = aie.tile(3, 0) // Shim-NOC
Expand Down Expand Up @@ -86,6 +88,8 @@ module {
aie.connect<South: 5, North: 5> // 6 northgoing connections
aie.connect<North: 3, South: 3> // 4 southgoing connections
aie.connect<Trace: 0, South: 1>
aie.connect<Ctrl: 0, North: 2>
aie.connect<North: 2, Ctrl: 0>
}

%03 = aie.tile(1, 3) // core tile
Expand All @@ -99,6 +103,8 @@ module {
aie.connect<East: 3, West: 3> // 4 westgoing connections
aie.connect<North: 3, South: 3> // 4 southgoing connections
aie.connect<West: 3, East: 3> // 4 eastgoing connections
aie.connect<Ctrl: 0, North: 2>
aie.connect<North: 2, Ctrl: 0>
}
}
}

0 comments on commit d7d7ca6

Please sign in to comment.