AI Engine Intrinsics User Guide
(AIE) r2p23
|
A lock is defined by an identifier (currently ranging from 0 to 15 for a memory module) and its current state among four possible states. The state is defined by two bits, the MSB indicating whether the lock is currently acquired or not, and the LSB the current value of the lock which is simply 0 or 1. Locks can be released and acquired with different values to allow synchronization between multiple AI Engines and with the DMAs.
Functions | |
void | acquire (unsigned id, unsigned val) |
Acquire a lock with a specific value. | |
void | acquire (unsigned id) |
Acquire a lock without checking its value. | |
void | release (unsigned id, unsigned val) |
Release a lock and set it to a specific value. | |
void | release (unsigned id) |
Release a lock without changing its value. | |
void acquire | ( | unsigned | id, |
unsigned | val | ||
) |
Acquire a lock with a specific value.
This intrinsic tries to acquires the lock with the identifier id and with its value set to val. It will block the program until it acquires successfully.
void acquire | ( | unsigned | id | ) |
Acquire a lock without checking its value.
This intrinsic tries to acquires the lock with the identifier id, without checking its value. It will block the program until it acquires successfully.
void release | ( | unsigned | id, |
unsigned | val | ||
) |
Release a lock and set it to a specific value.
This intrinsic tries to release the lock with the identifier id and set it to val. This intrinsic is non-blocking.
void release | ( | unsigned | id | ) |
Release a lock without changing its value.
This intrinsic tries to release the lock with the identifier id, without modifying its value. This intrinsic is non-blocking.