High Performance by Design
call nlp$createlock(lockid) call nlp$deletelock(lockid) call nlp$lock(lockid) call nlp$unlock(lockid)
A lock is created by the function nlp$createlock. When the lock is no longer necessary, the lock can be deleted by the function nlp$deletelock.
Lock is for soft cores to enter critical section. A critical section is accessed by the lock holder. Before entering a critical section, soft core needs to call the function nlp$lock, and becomes the lock holder after returning from the call. If the lock is held by other soft core, a call to nlp$lock blocks the caller until the lock holder releases the lock. Only one soft core can hold the lock at a time. The function nlp$unlock releases the lock. For example,
call nlp$lock(lockid) !! critical section that is accessed !! by one soft core at a time call nlp$unlock(lockid)