Semaphore operation – Rainbow Electronics AT75C310 User Manual
Page 123

AT75C310
123
Semaphore Operation
The DPMB supports semaphore registers to facilitate asyn-
chronous communication between two processors. Each
of the eight mailboxes has its own memory-mapped sema-
phore register. This avoids any need for complex read-
modify-write operations. Each semaphore is configured to
control message-passing in a single direction, i.e., from the
ARM to the Oak when the DPMB ARM-to-Oak flag is set
high. When this flag is low, then the direction of transfer is
Oak to ARM.
A semaphore can be configured to support interrupts or
polling in either direction. The ARM Interrupt Enable (AIE)
flag determines if interrupts are raised to the ARM when an
associated semaphore operation occurs. Similarly, the Oak
Interrupt Enable (OIE) flag determines if an interrupt is
raised to the Oak when an associated semaphore opera-
tion occurs.
There are no hardware-read restrictions to any semaphore
for either processor. This allows a semaphore to be polled
freely. However, the software is expected to maintain mes-
sage-level synchronization and not attempt to write to the
same semaphore at the same time. Because the two pro-
cessors may run asynchronously, the semaphores are re-
synchronized to the clock domains of both processors and,
hence, cycle accuracy is not maintained.
At reset, all semaphores are reset low.
Each semaphore can be set or cleared by either processor
by performing a write operation to the semaphore register.
A set operation (write high) sets the semaphore register to
high and a clear operation (write low) sets the semaphore
low. However, a semaphore operation can also raise or
clear interrupts, depending on which processor performs
the operation and which processor has been enabled as
the sender processor. The semantics of semaphore opera-
tions are presented in Table 22.
Table 22. Semaphore Operations Semantics
Operation
ARM to Oak High
ARM to Oak Low
ARM Set
Set Semaphore
Raise Oak Interrupt
Set Semaphore
Clear ARM Interrupt
ARM Clear
Clear Semaphore
Clear ARM Interrupt
Clear Semaphore
Clear ARM Interrupt
Raise Oak Interrupt
Oak Set
Set Semaphore
Clear Oak Interrupt
Set Semaphore
Raise ARM Interrupt
Oak Clear
Clear Semaphore
Clear Oak Interrupt
Raise ARM Interrupt
Clear Semaphore
Clear Oak Interrupt