Skip to content

Conversation

fifield
Copy link
Collaborator

@fifield fifield commented Sep 10, 2025

This adds support for multiple destinations to the mlir-aie python binding for packetflow op.

example from the unit test:

    t0 = tile(col=1, row=3)
    t1 = tile(col=2, row=4)
    packetflow(
        pkt_id=0x10,
        source=t0,
        source_port=WireBundle.DMA,
        source_channel=0,
        dests=[
            {"dest": t0, "port": WireBundle.DMA, "channel": 1},
            {"dest": t1, "port": WireBundle.DMA, "channel": 1},
        ],
        keep_pkt_header=True,
    )

produces,

  %tile_1_3 = aie.tile(1, 3)
  %tile_2_4 = aie.tile(2, 4)
  aie.packet_flow(16) {
    aie.packet_source<%tile_1_3, DMA : 0>
    aie.packet_dest<%tile_1_3, DMA : 1>
    aie.packet_dest<%tile_2_4, DMA : 1>
  } {keep_pkt_header = true}

The change is to replace the destination arguments with a list of dicts with one dict per destination:
replace,
packetflow(..., dest=tile, dest_port=port, dest_channel=channel, ...)
with,
packetflow(..., dests=[{dest=..., port=..., channel=...}, ...], ...)

@fifield

This comment was marked as resolved.

@fifield fifield force-pushed the py_packet_flow_broadcast branch from d72b330 to 644c823 Compare September 15, 2025 20:13
@fifield fifield requested a review from jgmelber September 15, 2025 20:16
@fifield fifield added this pull request to the merge queue Sep 16, 2025
Merged via the queue into main with commit 1f58379 Sep 16, 2025
53 checks passed
@fifield fifield deleted the py_packet_flow_broadcast branch September 16, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant