CY7C026
CY7C036
PRELIMINARY
14
Architecture
The CY7C026 and CY7036 consist of an array of 16K words
of 16 a nd 1 8 bit s each of dual- port RAM cel ls, I /O and addr ess
lines, and control signals (CE, OE , R/W). These control pins per-
mit independent access for reads or writes to any location in memory.
To handle simultaneous writes/reads to the same location, a BUSY
pin is pr ovided on each port. Two interrupt (INT) pins can be utilized
for port-to-por t com muni cation. Two semaph or e (SEM) control pins
are used f or allocating shared resources. With t he M/S pin, the devic-
es can function as a m ast er (BUSY pins ar e outputs) or as a slave
(BUSY pi ns are inputs). The devices also have an a utomatic pow-
er-down f eature controlled by CE. Each port is provided with its own
output enable control (OE), which a llow s d ata to be read from the
device.
Functional Description
Write Operati on
Data must be set up for a duration of tSD before the rising edge
of R/W in order to guarantee a valid write. A write operation is con-
trolled by either the R/W pin (see Write Cycle No. 1 wav eform) or the
CE pin (see Write Cycle No. 2 waveform). Required inputs for
non-contention operations are summarized in
Table 1
.
If a location is being written to by one port and the opposite
port attempts to read that location, a port-to-port flowthrough
delay must occur before the data is read on th e output; other-
wise t he data rea d is not det erminist ic. Data will be v alid on the
port t DDD aft er the data is presented on the other port.
Read Operation
When reading the device, the user must assert both the OE
and CE pins. Data will be a vailable t ACE after CE or tDOE after OE is
asser ted. If the user w ishes t o access a semaphore fla g, t hen the
SEM pin must be asserted instead of the CE pin, and OE must also
be asserted.
Interrupts
The upper two memory locations may be used for message
passing. The highest memory location (3FFF) is the mailbox
for the right port and the second-highest memory location
(3FFE) is the mail box f or the l eft port. When one port writes t o
the o ther port’ s mail box, a n interrupt is g enerated t o the owner .
The i nterrupt is reset when the o wner rea ds the conte nts of the
mailbox. The me ssage is user defined.
Each port can r ead the other por t’s mailbox without resetting
the interrupt. The active state of the busy signal (to a port)
pre v e nts the port from s etti ng the in terrupt to t he winni ng port.
Also, an active busy to a port prevents that port from reading
its own mailbox and, thus, resetting the interr upt to it.
If an application does not require message passing, do not
connect the interrupt pin to the processor’s interrupt request
input pin.
The operation of the interrupts and their interaction with Busy
are sum m arized in
Table 2.
Busy
The CY7C026 and CY7036 provide on-chip arbi tration to re-
solve simultaneous memory location access (contention). If
both por ts’ CEs are asserted and an address match occurs within
tPS of each other, the busy logic will determine which port has access.
If tPS is violated, one port will definitely gain permission to the location,
but it is not predictable which port will get that permission. BUSY will
be asserted tBLA a fter an a ddr ess m atch or tBLC after CE is taken
LOW.
Master/Slave
A M/S pin is provided in order to expand the word width by configuring
the device as either a master or a slave. The BUSY output of the
master is connected to the BUSY input of the slave. This will allow the
device to interf ace to a master device with no external components.
Wri ting to slave devices must be delayed unti l after the BUSY input
has settled (tBLC or tBLA), otherwise, the slav e chip may begin a write
cycle during a contention situation. When tied HIGH, the M/S pin al-
lows the device to be used as a master and, therefore, the BUSY line
is an output. BUSY can then be used to send the arbitration outcome
to a slav e .
Semaphore Operati on
The CY7C0 26 and CY7036 pr ovide eight semaphore latches,
which are separate from the dual-port memory locations.
Semaphores are used to reserve resources that are shared
between the two ports.The state of the semaphore indicates
that a resource is in use. For example, if the left port wants to
request a given resource, it sets a latch by wr iting a zero to a
semaphore locati on. The left port then verifies it s success in
setting the latch by reading it. After writing t o the semaphore,
SEM or O E must be deasserted for tSOP before attempti ng to read
the semaphore. The semaphore value will be available tSWRD + tDOE
after the rising edge of the semaphore write. If the left port was suc-
cessful (reads a zero), it assumes control of the shared resource,
otherwise (reads a one) it assumes the right port has contro l a nd
continues to poll the semaphore. When the right side has relin-
quished control of the semaphore (by writing a one), the left side will
succeed in gaining control of the semaphore. If the left side no longer
requires the semaphore, a one is written to cancel its request.
Semaphores are accessed by asserting SEM LOW. Th e SEM
pin functions as a chi p select for the semap hore latches (CE must
remain HIGH during S EM LOW). A0–2 represents the semaphore
addre ss. OE a nd R/W are used in the same manner as a normal
memory access. When writing or reading a semaphore, the other
address pins have no effect.
When writing to the semaphore, only I/O0 is used. If a zero is
written to the left port of an available semaphore, a one will appear at
the same semaphore address on the right port. That semaphore can
now onl y be mo dified by t he side showing zero (the left port in t his
case). If the left port now relinquishes control by writing a one to the
semaphore, the semaphore will be set to one for both sides. However,
if the right port had requested the semaphore (written a zero) while
the left port had control, the r ig ht port would immediately own the
semaphore as soon as the left port released it.
Table 3
shows sample
semaphore operations.
When reading a semaphore, all sixteen/eighteen data lines
output the semaphore value. The read value is latched in an
output register to prev ent the sem aphore from chang ing state
during a write from the other por t. If both por ts at tempt to ac-
cess th e sem aphore wit hin tSPS of each other, the semaphore will
definitely be obtained by one side or the other, but there is no guaran-
tee which side will control the semaphore.