CY7C027/028
CY7C037/038
Document #: 38-06042 Rev. *A Page 15 of 19
Architecture
The CY7C027/028 and CY7C037/038 consist of an array of
32K and 64K words of 16 and 18 bits each of dual-port RAM
cells, I/O and a ddress lines , and co ntrol sign als (C E, OE, R/W).
These control pins permit independent access for reads or writes to
any location in memory. To handle simultaneous writes/reads to the
same location, a BUSY pin is pro vided on ea ch port. Two interrupt
(INT) pins can be utilized for port-to-port communication. T wo sema-
phore (S EM) cont ro l pi ns are us ed f or a llo cati ng share d r esour ces.
With the M/S pin, the devices can function as a master (BUSY pins
are outputs) or as a slave (BUSY pins are inputs). The devices also
have an automatic power-down feature controlled by CE. Each port
is provided with its own output enable control (OE), which allows data
to be read from the device.
Functional Description
Wr ite Ope ration
Data must be set up for a duration of tSD before the rising edge
of R/W in or der to guar antee a valid w rite. A write operat ion is con-
trolled by either the R/W pin (see Write Cycle No. 1 waveform) 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 m ust occ ur be fore the data is read o n the ou tpu t; oth er-
wise the data read is not deterministic. Data will be val id on the
port tDDD after 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 available tACE after CE or tDOE after OE is
asserted. If the user wishes t o access a semaphore flag, then th e
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 (7FFF for the
CY7C027 /37, FFFF for the CY7C028/38) is the mailbox for the
right port and the second-highest memory location (7FFE for
the CY7C027/37, FFFE for the CY7C028/38) is the mailbox for
the left port. When one port writes to the other port’s mailbox,
an interrupt is generated to the owner. The interrupt is reset
when the owner reads the contents of the mailbox. The mes-
sage is user defined.
Each port can read the other port’s mailbox without resetting
the interrupt. The active state of the busy signal (to a port)
prevent s t he port fro m se tting t he int errupt t o the winn ing po rt.
Also, an active busy to a port prevents that port from reading
its own mailbox and, thus, resetting the interrupt 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
is summarized in Table 2.
Busy
The CY7 C027/028 an d CY7C037/038 p rovide on-ch ip arbitra-
tion to resolv e simultan eous memory loc ation access (conten-
tion). If bo th ports ’ 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, bu t it is not predictable whic h port w ill get that pe rmission.
BUSY will be a sse rted t BLA after an address match or tBLC after CE
is taken LOW .
Master/Slave
A M/S pin is provided in order to expand the word width by configur-
ing t he dev ice as either a mast er or a slave. T he BUSY output of the
master is connected to the BUSY input of the slave. This will allow the
device to interface to a master device with no external components.
Writing to slave devices must be delayed until after the BUSY input
has settled (tBLC or tBLA), otherwise, the slave 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 slave.
Semaphore Operation
The CY7C027/028 and CY7C037/038 provide eight sema-
phore lat ches, which are separate from the dual-port memory
locatio ns. Semaphores are used to res erve resource s that are
shared between the two ports.The state of the semaphore in-
dicates that a resource is in use. For example, if the left port
wants to request a given resource, it sets a latch by writing a
zero to a semaphore location. The left port then verifies its
success in setting the latch by reading it. After writing to the
semaphore, SEM or OE must be deasserted for tSOP before at-
tempting to read the semaphore. The semaphore value will be avail-
able tSWRD + tDOE after the rising edge of the semaphore write. If the
left port was successful (reads a zero), it assumes control of the
shared re source, otherwise ( reads a one) it assumes t he righ t port
has control and continues to poll the semaphore. When the right side
has relinquished 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 re quir es the semap hor e, a o ne i s w ritte n t o can cel its re-
quest.
Semaphores are accessed by asserting SEM LOW. The SEM
pin funct ions as a chip select f or the semaphor e latc hes (CE must
remain H IGH durin g SEM LOW). A0–2 represents the semaphore
addres s. OE and R/W are used in t he same manner as a norma l
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 only be modi fied by the side showing zer o (the le ft port in th is
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. Howev-
er, if the right port had requested the semaphore (written a zero) while
the left port had control, the right port would immediately own the
semaphore as soon as the left port released it. Table 3 shows sam-
ple 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 p rev ent the s em aph ore f rom cha ngi ng st a te
during a write from the other port. If both ports attempt to ac-
cess t he sema phore wi thin 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.