Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
ff919d9
Placer now takes into account max channels per tile
abisca Apr 24, 2025
4a68cfa
Restore example modified by mistake
abisca Apr 24, 2025
655b843
Update python/iron/placers.py
AndraBisca Apr 24, 2025
a731c22
Update python/iron/placers.py
AndraBisca Apr 24, 2025
d5d1d2a
Get max channels per tile from target model
abisca Apr 24, 2025
ef87766
Merge branch 'update-placer' of https://github.com/Xilinx/mlir-aie in…
abisca Apr 24, 2025
219c27b
Enable functions to retrieve number of DMA connections
abisca Apr 25, 2025
3ec0f8d
Add test. Ensure there is a difference between input and output chann…
abisca Apr 25, 2025
f56af92
Update include/aie-c/TargetModel.h
AndraBisca Apr 25, 2025
6dd3857
Update include/aie-c/TargetModel.h
AndraBisca Apr 25, 2025
344be2a
Update lib/CAPI/TargetModel.cpp
AndraBisca Apr 25, 2025
a769306
Use proper test function
abisca Apr 25, 2025
4f81476
Merge branch 'update-placer' of https://github.com/Xilinx/mlir-aie in…
abisca Apr 25, 2025
c472821
Error message. Python format.
abisca Apr 25, 2025
4153c43
Python format
abisca Apr 25, 2025
2c5b71d
Update test
abisca Apr 25, 2025
daa09a3
Update lib/CAPI/TargetModel.cpp
AndraBisca Apr 25, 2025
2129124
Update python/AIEMLIRModule.cpp
AndraBisca Apr 25, 2025
67bae0d
Update python/AIEMLIRModule.cpp
AndraBisca Apr 25, 2025
a71c875
Python format
abisca Apr 25, 2025
0d5ecce
Merge branch 'update-placer' of https://github.com/Xilinx/mlir-aie in…
abisca Apr 25, 2025
878d28f
Update tests
abisca Apr 28, 2025
0c27140
Update test/python/dma_channels_per_tile.py
AndraBisca Apr 29, 2025
963a9bb
Update test/python/dma_channels_per_tile.py
AndraBisca Apr 29, 2025
c2e1807
Update test/python/dma_channels_per_tile.py
AndraBisca Apr 29, 2025
cb287f3
Update test/python/dma_channels_per_tile.py
AndraBisca Apr 29, 2025
8ce60c1
Sequential placer now iterates only once over each endpoint.
abisca Apr 30, 2025
19ba0df
Merge branch 'update-placer' of https://github.com/Xilinx/mlir-aie in…
abisca Apr 30, 2025
8e1bbc3
Comment and cleanup code
abisca May 1, 2025
dca862b
Formatting
abisca May 1, 2025
e6e5a24
Improve doc
abisca May 1, 2025
060cf3a
Account for channels used by Workers.
abisca May 5, 2025
40e0b45
Update python/iron/placers.py
AndraBisca May 5, 2025
06bebdb
Format
abisca May 5, 2025
096fda9
Merge branch 'update-placer' of https://github.com/Xilinx/mlir-aie in…
abisca May 5, 2025
7017e22
Merge branch 'main' into update-placer
AndraBisca May 5, 2025
087853e
Update adding value to dict
abisca May 5, 2025
6ebc42e
Merge branch 'update-placer' of https://github.com/Xilinx/mlir-aie in…
abisca May 5, 2025
2dc02e6
Use shim mux connections for shim tiles
abisca May 5, 2025
d344cfd
Update lib/CAPI/TargetModel.cpp
AndraBisca May 5, 2025
b381501
Update lib/CAPI/TargetModel.cpp
AndraBisca May 5, 2025
33f3df8
Update python/AIEMLIRModule.cpp
AndraBisca May 5, 2025
787fe3e
Update python/AIEMLIRModule.cpp
AndraBisca May 5, 2025
479d967
Update python/AIEMLIRModule.cpp
AndraBisca May 5, 2025
ca9097f
Update python/AIEMLIRModule.cpp
AndraBisca May 5, 2025
b49f323
Try to fix dict error
abisca May 5, 2025
719c01b
Merge branch 'update-placer' of https://github.com/Xilinx/mlir-aie in…
abisca May 5, 2025
fc38754
Add test for custom placement
abisca May 6, 2025
9986f7c
Use dict like a dict
jgmelber May 6, 2025
22d2b43
Fix dict initialization
jgmelber May 6, 2025
b478a1f
Use empty dict not list
jgmelber May 6, 2025
ed941ce
Merge branch 'update-placer' of https://github.com/Xilinx/mlir-aie in…
abisca May 7, 2025
8b25add
Use dict with default empty list. Add doc.
abisca May 7, 2025
94eec9f
Merge branch 'main' into update-placer
AndraBisca May 7, 2025
7cc5b4f
Remove defaultdict
abisca May 7, 2025
d812339
Merge branch 'update-placer' of https://github.com/Xilinx/mlir-aie in…
abisca May 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions include/aie-c/TargetModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ aieTargetModelGetMemTileSize(AieTargetModel targetModel);
MLIR_CAPI_EXPORTED uint32_t
aieTargetModelGetNumBanks(AieTargetModel targetModel, int col, int row);

MLIR_CAPI_EXPORTED uint32_t aieTargetModelGetNumDestSwitchboxConnections(
AieTargetModel targetModel, int col, int row, uint32_t bundle);

MLIR_CAPI_EXPORTED uint32_t aieTargetModelGetNumSourceSwitchboxConnections(
AieTargetModel targetModel, int col, int row, uint32_t bundle);

MLIR_CAPI_EXPORTED uint32_t aieTargetModelGetNumDestShimMuxConnections(
AieTargetModel targetModel, int col, int row, uint32_t bundle);

MLIR_CAPI_EXPORTED uint32_t aieTargetModelGetNumSourceShimMuxConnections(
AieTargetModel targetModel, int col, int row, uint32_t bundle);

/// Returns true if this is an NPU target model.
MLIR_CAPI_EXPORTED bool aieTargetModelIsNPU(AieTargetModel targetModel);

Expand Down
32 changes: 32 additions & 0 deletions lib/CAPI/TargetModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,38 @@ uint32_t aieTargetModelGetNumBanks(AieTargetModel targetModel, int col,
return unwrap(targetModel).getNumBanks(col, row);
}

uint32_t aieTargetModelGetNumDestSwitchboxConnections(
AieTargetModel targetModel, int col, int row, uint32_t bundle) {
xilinx::AIE::WireBundle wireBundle =
static_cast<xilinx::AIE::WireBundle>(bundle);
return unwrap(targetModel)
.getNumDestSwitchboxConnections(col, row, wireBundle);
}

uint32_t aieTargetModelGetNumSourceSwitchboxConnections(
AieTargetModel targetModel, int col, int row, uint32_t bundle) {
xilinx::AIE::WireBundle wireBundle =
static_cast<xilinx::AIE::WireBundle>(bundle);
return unwrap(targetModel)
.getNumSourceSwitchboxConnections(col, row, wireBundle);
}

uint32_t aieTargetModelGetNumDestShimMuxConnections(AieTargetModel targetModel,
int col, int row,
uint32_t bundle) {
xilinx::AIE::WireBundle wireBundle =
static_cast<xilinx::AIE::WireBundle>(bundle);
return unwrap(targetModel).getNumDestShimMuxConnections(col, row, wireBundle);
}

uint32_t aieTargetModelGetNumSourceShimMuxConnections(
AieTargetModel targetModel, int col, int row, uint32_t bundle) {
xilinx::AIE::WireBundle wireBundle =
static_cast<xilinx::AIE::WireBundle>(bundle);
return unwrap(targetModel)
.getNumSourceShimMuxConnections(col, row, wireBundle);
}

bool aieTargetModelIsNPU(AieTargetModel targetModel) {
return unwrap(targetModel).hasProperty(xilinx::AIE::AIETargetModel::IsNPU);
}
Expand Down
24 changes: 20 additions & 4 deletions python/AIEMLIRModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,26 @@ NB_MODULE(_aie, m) {
[](PyAieTargetModel &self) {
return aieTargetModelGetMemTileSize(self.get());
})
// .def("get_num_dest_switchbox_connections", int col, int row)
// .def("get_num_source_switchbox_connections", int col, int row)
// .def("get_num_dest_shim_mux_connections", int col, int row)
// .def("get_num_source_shim_mux_connections", int col, int row)
.def("get_num_dest_switchbox_connections",
[](PyAieTargetModel &self, int col, int row, uint32_t bundle) {
return aieTargetModelGetNumDestSwitchboxConnections(
self.get(), col, row, bundle);
})
.def("get_num_source_switchbox_connections",
[](PyAieTargetModel &self, int col, int row, uint32_t bundle) {
return aieTargetModelGetNumSourceSwitchboxConnections(
self.get(), col, row, bundle);
})
.def("get_num_dest_shim_mux_connections",
[](PyAieTargetModel &self, int col, int row, uint32_t bundle) {
return aieTargetModelGetNumDestShimMuxConnections(self.get(), col,
row, bundle);
})
.def("get_num_source_shim_mux_connections",
[](PyAieTargetModel &self, int col, int row, uint32_t bundle) {
return aieTargetModelGetNumSourceShimMuxConnections(
self.get(), col, row, bundle);
})
// .def("is_legal_memtile_connection")
.def("is_npu",
[](PyAieTargetModel &self) {
Expand Down
2 changes: 1 addition & 1 deletion python/iron/dataflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .objectfifo import ObjectFifo, ObjectFifoHandle
from .objectfifo import ObjectFifo, ObjectFifoHandle, ObjectFifoLink, ObjectFifoEndpoint
80 changes: 80 additions & 0 deletions python/iron/device/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from abc import abstractmethod
from ... import ir # type: ignore
from ...dialects._aie_enum_gen import WireBundle # type: ignore
from ...dialects.aie import AIEDevice, tile, TileOp, get_target_model # type: ignore
from ..resolvable import Resolvable
from .tile import Tile
Expand Down Expand Up @@ -116,6 +117,42 @@ def get_compute_tiles(self) -> list[Tile]:
# TODO: should this be shaped?
...

@abstractmethod
def get_num_source_switchbox_connections(self, t: Tile) -> int:
"""Returns number of DMA source ports in the switchbox for the given tile on the device.

Returns:
int: Number of DMA source ports.
"""
...

@abstractmethod
def get_num_dest_switchbox_connections(self, t: Tile) -> int:
"""Returns number of DMA dest ports in the switchbox for the given tile on the device.

Returns:
int: Number of DMA dest ports.
"""
...

@abstractmethod
def get_num_source_shim_mux_connections(self, t: Tile) -> int:
"""Returns number of DMA source ports in the shim mux for the given tile on the device.

Returns:
int: Number of DMA source ports.
"""
...

@abstractmethod
def get_num_dest_shim_mux_connections(self, t: Tile) -> int:
"""Returns number of DMA dest ports in the shim mux for the given tile on the device.

Returns:
int: Number of DMA dest ports.
"""
...

def resolve_tile(
self,
tile: Tile,
Expand Down Expand Up @@ -164,6 +201,49 @@ def get_compute_tiles(self) -> list[Tile]:
compute_tiles.append(Tile(col, row))
return compute_tiles

def get_num_source_switchbox_connections(self, t: Tile) -> int:
col = t.col
row = t.row
bundle = WireBundle.DMA
return get_target_model(self._device).get_num_source_switchbox_connections(
col, row, bundle
)

def get_num_dest_switchbox_connections(self, t: Tile) -> int:
col = t.col
row = t.row
bundle = WireBundle.DMA
return get_target_model(self._device).get_num_dest_switchbox_connections(
col, row, bundle
)

def get_num_source_shim_mux_connections(self, t: Tile) -> int:
col = t.col
row = t.row
bundle = WireBundle.DMA
return get_target_model(self._device).get_num_source_shim_mux_connections(
col, row, bundle
)

def get_num_dest_shim_mux_connections(self, t: Tile) -> int:
col = t.col
row = t.row
bundle = WireBundle.DMA
return get_target_model(self._device).get_num_dest_shim_mux_connections(
col, row, bundle
)

def get_num_connections(self, tile: Tile, output: bool) -> int:
if tile.row == 0:
if output:
return self.get_num_source_shim_mux_connections(tile)
else:
return self.get_num_dest_shim_mux_connections(tile)
if output:
return self.get_num_source_switchbox_connections(tile)
else:
return self.get_num_dest_switchbox_connections(tile)


def create_class(class_name, device):

Expand Down
Loading
Loading