|
| | __init__ (self, type[np.ndarray] obj_type, *int|None depth=2, str|None name=None, StreamDims|None dims_to_stream=None, StreamDims|None dims_from_stream_per_cons=None, bool plio=False, PadDims|None pad_dimensions=None, bool disable_synchronization=False, int|None repeat_count=None, Tile|None delegate_tile=None, bool via_DMA=False, list[np.ndarray]|None init_values=None, type[np.ndarray]|None consumer_obj_type=None, tuple[int, int]|None aie_stream=None) |
| |
| int|None | depth (self) |
| |
| StreamDims|None | dims_from_stream_per_cons (self) |
| |
| StreamDims|None | dims_to_stream (self) |
| |
| ObjectFifoCreateOp | op (self) |
| |
| Sequence[int] | shape (self) |
| |
| NpuDType | dtype (self) |
| |
| type[np.ndarray] | obj_type (self) |
| |
| | set_iter_count (self, int iter_count) |
| |
| str | __str__ (self) |
| |
| ObjectFifoHandle | prod (self, int|None depth=None) |
| |
| ObjectFifoHandle | cons (self, int|None depth=None, StreamDims|None dims_from_stream=None) |
| |
| list[Tile] | tiles (self, bool cons_only=False) |
| |
| None | resolve (self, ir.Location|None loc=None, ir.InsertionPoint|None ip=None) |
| |
An ObjectFifo is a method of representing synchronized, explicit dataflow between
IRON program components such as Workers and the Runtime.
Internally, it is a circular buffer with a given depth and type of buffer. The
users of an ObjectFifo are explicitly either a Producer or a Consumer, and each
user has a Placeable endpoint.
| iron.dataflow.objectfifo.ObjectFifo.__init__ |
( |
|
self, |
|
|
type[np.ndarray] |
obj_type, |
|
|
*int | None |
depth = 2, |
|
|
str | None |
name = None, |
|
|
StreamDims | None |
dims_to_stream = None, |
|
|
StreamDims | None |
dims_from_stream_per_cons = None, |
|
|
bool |
plio = False, |
|
|
PadDims | None |
pad_dimensions = None, |
|
|
bool |
disable_synchronization = False, |
|
|
int | None |
repeat_count = None, |
|
|
Tile | None |
delegate_tile = None, |
|
|
bool |
via_DMA = False, |
|
|
list[np.ndarray] | None |
init_values = None, |
|
|
type[np.ndarray] | None |
consumer_obj_type = None, |
|
|
tuple[int, int] | None |
aie_stream = None |
|
) |
| |
Construct an ObjectFifo.
Args:
obj_type (type[np.ndarray]): The type of each buffer in the ObjectFifo
depth (int | None, optional): The default depth of the ObjectFifo endpoints. Defaults to 2.
name (str | None, optional): The name of the ObjectFifo. If None is given, a unique name will be generated. Defaults to None.
dims_to_stream (StreamDims | None, optional): Data layout transformations applied when data is pushed onto the AXI stream, described as pairs of (size, stride) from highest to lowest dimension. Defaults to None.
dims_from_stream_per_cons (StreamDims | None, optional): List of data layout transformations applied by each consumer when data is read from the AXI stream, described as pairs of (size, stride) from highest to lowest dimension. Defaults to None.
plio (bool, optional): Whether the ObjectFifo uses PLIO connections. Defaults to False.
disable_synchronization (bool, optional): When True, disables lock-based synchronization on the ObjectFifo. Defaults to False.
repeat_count (int | None, optional): If set, causes the MemTile DMA to replay the buffer descriptor this many times without a new DMA transfer from L3. Distinct from ``iter_count`` (BD-chain iteration count). Defaults to None.
delegate_tile (Tile | None, optional): Shared-memory delegate tile. When set, the ObjectFifo's underlying buffer pool is allocated on this tile's memory module instead of the default placement. Lowers to ``aie.objectfifo.allocate``. *Only valid when both producer and consumer have shared-memory access to the delegate tile* (e.g. self-loop fifos where prod == cons, or fifos between adjacent tiles spilling to a neighboring MemTile). The delegate is the storage location, not a producer- or consumer-side concept; the underlying op verifier rejects this if either endpoint cannot share memory with the delegate. Defaults to None.
init_values (list[np.ndarray] | None, optional): Per-buffer static initial values for the producer endpoint. One ndarray per producer-side buffer; the producer tile must be able to hold static data at design startup (e.g. a MemTile). Lowers to the ``initValues`` attribute on the underlying ``aie.objectfifo`` op. Defaults to None.
consumer_obj_type (type[np.ndarray] | None, optional): Consumer element type for asymmetric transfer granularity. When set, the producer sends obj_type-sized transfers and the consumer receives consumer_obj_type-sized transfers. Producer element count must be an integer multiple of consumer element count. Defaults to None.
aie_stream (tuple[int, int] | None, optional): Mark the fifo as a direct AIE-stream connection by stamping the ``aie_stream`` / ``aie_stream_port`` attributes ``(end, port)`` on the underlying ``aie.objectfifo`` op. Use with kernels that emit on the wire via ``put_ms()`` instead of going through an L1 buffer. Defaults to None.
Raises:
ValueError: If ``depth`` is provided and is less than 1.