Skip to content

Commit 02bc066

Browse files
committed
fixup tests
1 parent e6d1f8e commit 02bc066

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/Targets/AIETargetNPU.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,11 @@ LogicalResult xilinx::AIE::AIETranslateControlPacketsToUI32Vec(
293293
int row = packetOp.getRowFromAddr();
294294
auto destTile = TileOp::getOrCreate(builder, deviceOp, col, row);
295295
auto info = destTile->getAttrOfType<AIE::PacketInfoAttr>("controller_id");
296-
if (!info)
297-
return destTile->emitError("Expected controller_id attribute");
298-
uint32_t hdr = (info.getPktType() & 0x7) << 12 | (info.getPktId() & 0xff);
296+
uint32_t hdr = 0;
297+
if (info)
298+
hdr = (info.getPktType() & 0x7) << 12 | (info.getPktId() & 0xff);
299+
else
300+
destTile->emitWarning("Expected controller_id attribute");
299301
words[0] = hdr | (0x1 & parity(hdr)) << 31;
300302

301303
// control packet header

test/dialect/AIEX/ctrl_pkt_to_dma.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
// CHECK-LABEL: aie.device(npu1_1col) {
1616
// CHECK: aiex.runtime_sequence(%[[ARG0:.*]]: memref<?xi32>) {
17-
// CHECK: aiex.npu.dma_memcpy_nd(%[[ARG0]][0, 0, 0, 0][1, 1, 1, 2][0, 0, 0, 1], packet = <pkt_type = 0, pkt_id = 15>) {id = 0 : i64, issue_token = true, metadata = @ctrlpkt_col0_mm2s_chan0} : memref<?xi32>
17+
// CHECK: aiex.npu.dma_memcpy_nd(%[[ARG0]][0, 0, 0, 0][1, 1, 1, 3][0, 0, 0, 1]) {id = 0 : i64, issue_token = true, metadata = @ctrlpkt_col0_mm2s_chan0} : memref<?xi32>
1818
// CHECK: aiex.npu.sync {channel = 0 : i32, column = 0 : i32, column_num = 1 : i32, direction = 1 : i32, row = 0 : i32, row_num = 1 : i32}
1919

2020
aie.device(npu1_1col) {
@@ -30,7 +30,7 @@ aie.device(npu1_1col) {
3030

3131
// CHECK-LABEL: aie.device(npu1_1col) {
3232
// CHECK: aiex.runtime_sequence(%[[ARG0:.*]]: memref<?xi32>) {
33-
// CHECK: aiex.npu.dma_memcpy_nd(%[[ARG0]][0, 0, 0, 0][1, 1, 1, 2][0, 0, 0, 1], packet = <pkt_type = 0, pkt_id = 27>) {id = 0 : i64, issue_token = true, metadata = @ctrlpkt_col0_mm2s_chan0} : memref<?xi32>
33+
// CHECK: aiex.npu.dma_memcpy_nd(%[[ARG0]][0, 0, 0, 0][1, 1, 1, 3][0, 0, 0, 1]) {id = 0 : i64, issue_token = true, metadata = @ctrlpkt_col0_mm2s_chan0} : memref<?xi32>
3434
// CHECK: aiex.npu.sync {channel = 0 : i32, column = 0 : i32, column_num = 1 : i32, direction = 1 : i32, row = 0 : i32, row_num = 1 : i32}
3535

3636
aie.device(npu1_1col) {

0 commit comments

Comments
 (0)