You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add C ObjectFIFO API for kernel-managed lock synchronization
Enable precompiled C kernels to directly manage ObjectFIFO
synchronization by receiving lock IDs and buffer references from MLIR,
rather than relying on the compiler to insert acquire/release ops.
New MLIR ops:
- aie.objectfifo.lock: returns (acq_lock, rel_lock) for a port
- aie.objectfifo.buffer: returns a buffer memref at a given index
Stateful transform lowering resolves these ops to concrete lock/buffer
SSA values, handling AIE1 single-lock and AIE2/AIE2P dual-lock
semantics.
C API header (aie_runtime_lib/AIE2{,P}/aie_objectfifo.h):
objectfifo_port_t struct with inline acquire/release functions using
compiler-provided lock intrinsics. Use acq_value=-1 for
AcquireGreaterEqual semantics matching the DMA protocol.
Python API: get_lock()/get_buffer() on object_fifo and ObjectFifoHandle.
Bug fixes discovered during hardware bring-up:
- python/dialects/aie.py: get_lock() passed incorrect extra args to
ObjectFifoGetLockOp auto-generated constructor
- AIELocalizeLocks: used getParentOp() == coreOp which failed for lock
uses nested inside scf.for; fixed to use isProperAncestor()
Includes:
- CMake install rules for aie_objectfifo.h into install tree
- LIT tests for lock localization with external function calls
- E2E NPU tests (lock_pass_to_c, objectfifo_lock_c_api)
- Programming example: passthrough_kernel_c_objfifo
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 commit comments