70V261S/L
High-Speed 16K x 16 Dual-Port Static RAM with Interrupt
Industrial and Commercial Temperature Ranges
semaphoreisrequestedandtheprocessorwhichrequesteditnolonger second 8K section by writing, then reading a zero into Semaphore 1.
needstheresource,theentiresystemcanhangupuntilaoneiswritten Ifitsucceededingainingcontrol,itwouldlockouttheleftside.
intothatsemaphorerequestlatch.
Once the left side was finished with its task, it would write a one to
The critical case of semaphore timing is when both sides request Semaphore 0 and may then try to gain access to Semaphore 1. If
a single token by attempting to write a zero into it at the same time. The Semaphore1wasstilloccupiedbytherightside,theleftsidecouldundo
semaphore logic is specially designed to resolve this problem. If itssemaphorerequestandperformothertasksuntilitwasabletowrite,then
simultaneous requests are made, the logic guarantees that only one readazerointoSemaphore1.Iftherightprocessorperformsasimilartask
side receives the token. If one side is earlier than the other in making withSemaphore0,thisprotocolwouldallowthetwoprocessorstoswap
the request, the first side to make the request will receive the token. If 8K blocks of Dual-Port RAM with each other.
bothrequestsarriveatthesametime, theassignmentwillbearbitrarily
made to one port or the other.
The blocks do not have to be any particular size and can even be
variable, depending upon the complexity of the software using the
One caution that should be noted when using semaphores is that semaphore flags. All eight semaphores could be used to divide the
semaphores alone do not guarantee that access to a resource is Dual-Port RAM or other shared resources into eight parts. Sema-
secure. As with any powerful programming technique, if semaphores phores can even be assigned different meanings on different sides
are misused or misinterpreted, a software error can easily happen.
rather than being given a common meaning as was shown in the
Initialization of the semaphores is not automatic and must be example above.
handled via the initialization program at power-up. Since any sema-
Semaphores are a useful form of arbitration in systems like disk
phore request flag which contains a zero must be reset to a one, all interfaces where the CPU must be locked out of a section of memory
semaphores on both sides should have a one written into them at during a transfer and the I/O device cannot tolerate any wait states.
initialization from both sides to assure that they will be free when With the use of semaphores, once the two devices has determined
needed.
which memory area was “off-limits” to the CPU, both the CPU and the
I/O devices could access their assigned portions of memory continu-
ously without any wait states.
Semaphores are also useful in applications where no memory
“WAIT” state is available on one or both sides. Once a semaphore
handshake has been performed, both processors can access their
assigned RAM segments at full speed.
Anotherapplicationisintheareaofcomplexdatastructures.Inthis
case, block arbitration is very important. For this application one
processor may be responsible for building and updating a data
structure. The other processor then reads and interprets that data
structure. If the interpreting processor reads an incomplete data
structure, a major error condition may exist. Therefore, some sort of
arbitration must be used between the two different processors. The
building processor arbitrates for the block, locks it and then is able to
goinandupdatethedatastructure.Whentheupdateiscompleted,the
data structure block is released. This allows the interpreting processor
to come back and read the complete data structure, thereby guaran-
teeing a consistent data structure.
UsingSemaphores—SomeExamples
Perhaps the simplest application of semaphores is their applica-
tionasresourcemarkersfortheIDT70V261’sDual-PortRAM. Saythe
16K x 16 RAM was to be divided into two 8K x 16 blocks which were
to be dedicated at any one time to servicing either the left or right port.
Semaphore 0 could be used to indicate the side which would control
thelowersectionofmemory,andSemaphore1couldbedefinedasthe
indicator for the upper section of memory.
Totakearesource, inthisexamplethelower8KofDual-PortRAM,
the processor on the left port could write and then read a zero in to
Semaphore 0. If this task were successfully completed (a zero was
read back rather than a one), the left processor would assume control
of the lower 8K. Meanwhile the right processor was attempting to gain
controlofthe resourceaftertheleftprocessor,itwouldreadbackaone
in response to the zero it had attempted to write into Semaphore 0. At
this point, the software could choose to try and gain control of the
61.462
Jun.04.21