@@ -2057,42 +2057,48 @@ def AIE_ObjectFifoCreateOp: AIE_Op<"objectfifo", [HasParent<"DeviceOp">, Symbol]
20572057 When `repeat_count == 1`, this simplifies to `iter_count * elemNumber`.
20582058 }];
20592059
2060- let arguments = (
2061- ins SymbolNameAttr:$sym_name,
2062- Index:$producerTile,
2063- Variadic<Index>:$consumerTiles,
2064- AIE_ObjectFifo_Depth:$elemNumber,
2065- TypeAttrOf<AIE_ObjectFifoType>:$elemType,
2066- // Optional consumer element type for asymmetric transfer granularity.
2067- // Producer sends elemType-sized transfers, consumer receives
2068- // consumerElemType-sized transfers. Producer element size must be
2069- // an integer multiple of consumer element size.
2070- OptionalAttr<TypeAttrOf<AIE_ObjectFifoType>>:$consumerElemType,
2071- BDDimLayoutArrayAttr:$dimensionsToStream,
2072- BDDimLayoutArrayArrayAttr:$dimensionsFromStreamPerConsumer,
2073- DefaultValuedAttr<BoolAttr, "false">:$via_DMA,
2074- DefaultValuedAttr<BoolAttr, "false">:$plio,
2075- // disable_synchronization==true will skip lock generation for
2076- // objectfifo synchronous accesses
2077- DefaultValuedAttr<BoolAttr, "false">:$disable_synchronization,
2078- // repeat_count==1 means "do it once"
2079- OptionalAttr<ConfinedAttr<AIEI32Attr, [IntMinValue<1>]>>:$repeat_count,
2080- // aie_stream==0 means enable aie stream port on producer tile
2081- // aie_stream==1 means enable aie stream port on consumer tile
2082- // aie_stream==2 means enable aie stream ports on producer and consumer tiles
2083- OptionalAttr<ConfinedAttr<AIEI32Attr, [IntMinValue<0>, IntMaxValue<2>]>>:$aie_stream,
2084- OptionalAttr<ConfinedAttr<AIEI32Attr, [IntMinValue<0>, IntMaxValue<1>]>>:$aie_stream_port,
2085- // Pin the DMA channel for an endpoint instead of first-free assignment.
2086- // prod_dma_channel pins the producer endpoint's channel; cons_dma_channels
2087- // holds one entry per consumer (-1 = auto-assign that consumer).
2088- OptionalAttr<ConfinedAttr<AIEI32Attr, [IntMinValue<0>]>>:$prod_dma_channel,
2089- OptionalAttr<DenseI32ArrayAttr>:$cons_dma_channels,
2090- InitValuesArrayAttr:$initValues,
2091- OptionalAttr<BDPadLayoutArrayAttr>:$padDimensions,
2092- // Lowered onto the memtile MM2S channel; see aie.dma_start's pad_value.
2093- DefaultValuedOptionalAttr<AIEI32Attr, "0">:$padValue,
2094- OptionalAttr<AIEI32Attr>:$iter_count
2095- );
2060+ let arguments = (ins SymbolNameAttr:$sym_name, Index:$producerTile,
2061+ Variadic<Index>:$consumerTiles, AIE_ObjectFifo_Depth:$elemNumber,
2062+ TypeAttrOf<AIE_ObjectFifoType>:$elemType,
2063+ // Optional consumer element type for asymmetric transfer granularity.
2064+ // Producer sends elemType-sized transfers, consumer receives
2065+ // consumerElemType-sized transfers. Producer element size must be
2066+ // an integer multiple of consumer element size.
2067+ OptionalAttr<TypeAttrOf<AIE_ObjectFifoType>>:$consumerElemType,
2068+ BDDimLayoutArrayAttr:$dimensionsToStream,
2069+ BDDimLayoutArrayArrayAttr:$dimensionsFromStreamPerConsumer,
2070+ DefaultValuedAttr<BoolAttr, "false">:$via_DMA,
2071+ DefaultValuedAttr<BoolAttr, "false">:$plio,
2072+ // disable_synchronization==true will skip lock generation for
2073+ // objectfifo synchronous accesses
2074+ DefaultValuedAttr<BoolAttr, "false">:$disable_synchronization,
2075+ // repeat_count==1 means "do it once"
2076+ OptionalAttr<ConfinedAttr<AIEI32Attr, [IntMinValue<1>]>>:$repeat_count,
2077+ // aie_stream==0 means enable aie stream port on producer tile
2078+ // aie_stream==1 means enable aie stream port on consumer tile
2079+ // aie_stream==2 means enable aie stream ports on producer and consumer
2080+ // tiles
2081+ OptionalAttr<ConfinedAttr<AIEI32Attr, [IntMinValue<0>,
2082+ IntMaxValue<2>]>>:$aie_stream,
2083+ OptionalAttr<ConfinedAttr<AIEI32Attr, [IntMinValue<0>,
2084+ IntMaxValue<1>]>>:$aie_stream_port,
2085+ // Pin the DMA channel for an endpoint instead of first-free assignment.
2086+ // prod_dma_channel pins the producer endpoint's channel;
2087+ // cons_dma_channels holds one entry per consumer (-1 = auto-assign that
2088+ // consumer).
2089+ OptionalAttr<ConfinedAttr<
2090+ AIEI32Attr, [IntMinValue<0>]>>:$prod_dma_channel,
2091+ OptionalAttr<DenseI32ArrayAttr>:$cons_dma_channels,
2092+ InitValuesArrayAttr:$initValues,
2093+ OptionalAttr<BDPadLayoutArrayAttr>:$padDimensions,
2094+ // Lowered onto the memtile MM2S channel; see aie.dma_start's pad_value.
2095+ DefaultValuedOptionalAttr<AIEI32Attr, "0">:$padValue,
2096+ OptionalAttr<AIEI32Attr>:$iter_count,
2097+ // Route this fifo's stream connections as packet flows rather than
2098+ // reserving a circuit for each. packet_id pins the header; without it
2099+ // one is assigned that no other flow uses.
2100+ UnitAttr:$packet,
2101+ OptionalAttr<ConfinedAttr<AIEI8Attr, [IntMinValue<0>]>>:$packet_id);
20962102
20972103 let assemblyFormat = [{
20982104 $sym_name
@@ -2430,14 +2436,22 @@ def AIE_ObjectFifoFlowOp : AIE_Op<"objectfifo.flow", [HasParent<"DeviceOp">]> {
24302436 `--aie-objectfifo-allocate` assigns a channel to each endpoint, emits the
24312437 corresponding `aie.flow`, and consumes this op.
24322438
2439+ `packet` routes the connection as an `aie.packet_flow` instead, sharing the
2440+ stream with every other packet flow rather than reserving a circuit for it.
2441+ `packet_id` pins the header the source stamps; without it allocation picks
2442+ an id no other flow is using. Circuit- and packet-switched flows coexist in
2443+ one device.
2444+
24332445 Example:
24342446 ```
24352447 aie.objectfifo.flow from @src to [@dst0, @dst1]
2448+ aie.objectfifo.flow from @src to [@dst] {packet, packet_id = 3 : i8}
24362449 ```
24372450 }];
24382451
24392452 let arguments = (ins FlatSymbolRefAttr:$source,
2440- FlatSymbolRefArrayAttr:$destinations);
2453+ FlatSymbolRefArrayAttr:$destinations, UnitAttr:$packet,
2454+ OptionalAttr<ConfinedAttr<AIEI8Attr, [IntMinValue<0>]>>:$packet_id);
24412455
24422456 let assemblyFormat = [{
24432457 `from` $source `to` $destinations attr-dict
0 commit comments