Download Coherent Accelerator Processor Interface User`s Manual

Transcript
User’s Manual
Coherent Accelerator Processor Interface
Advance
5.1.2 Reservation
The operations read_cl_res and write_c manipulate the reservation. There is one reservation for the accelerator. This reservation can be active on an address or inactive. Read_cl_res reads an address and acquires
the reservation, after which the reservation is active on the address of the read. While the reservation is
active, the PSL snoops for writes performed to the address. Reservations cannot be held indefinitely. The
PSL will automatically clear the reservation on lines after a certain amount of time to allow the system to
make progress. If the PSL detects a write to the address by another processor, it deactivates the reservation.
Write_c inspects the state of the reservation during execution. If the reservation is active on the write_c line
address, write_c will write data to the line, deactivate the reservation, and return DONE. If the reservation is
active on a different address, write_c deactivates the reservation and returns NRES. If the reservation is not
active, write_c returns NRES.
Note: While it is not an error to submit multiple read_cl_res and write_c commands to different line
addresses, the order they execute in is not defined and therefore, the state of the reservation is unpredictable.
5.1.3 Locks
Cache lines can be locked, and while they are locked no other read or write access is permitted by any other
processor in the system. This capability allows an accelerator to implement complex atomic operations on
shared memory.
Lock requests are made with either the read_cl_lck or the lock command. If the PSL grants the lock, it
responds with DONE. If the PSL declines the lock request, it responds with NLock. The PSL can decline a
lock request based on configuration, available resources, and cache state. After the lock is in effect, it
remains in effect until a subsequent write_unlock or unlock request.
Locks cannot be held indefinitely. The PSL automatically unlocks lines after a certain amount of time to allow
the system to make forward progress. Write_unlock or unlock returns NLock if they are attempted when an
address is not locked.
An accelerator holding a lock is required to release its lock and wait for the write_unlock or unlock command
to complete before it can proceed with commands to other addresses. While a lock is active, commands to
other addresses can be terminated with the response NLock. Note that command ordering within the PSL can
cause a command issued before the read_cl_lck to be executed after the lock is obtained causing that
command to be terminated with response NLock. If this is a problem, the AFU should wait until all previous
commands have completed before starting a lock sequence.
PSL Accelerator Interface
Page 68 of 101
Version 1.2
29 January 2015