CY7C024/0241
CY7C025/0251
15
Architecture
The CY7C024/0241 a nd CY7C0 25/0251 consi st o f an ar r ay of
4K words of 16/18 bits each and 8K words of 16/18 bits each
of dual-port RAM c ells, I/O and address lines, and contr ol signals (CE
, OE, R/W). These control pins permit independent access
for reads or writes to any location in memory . T o handle simultaneous
writes/reads to the sam e locat ion, a BUSY
pin is provided on each
port. Two interrupt (INT
) pins can be utilized for port-to-port commu-
nication. Two semaphore (SEM
) control pins are used for allocating
shared resources. With the M/S
pin, the CY7C024/0241 and
CY7C025/0251 can function as a master (BUSY
pins are outputs) or
as a slave (BUSY
pins are inputs). The CY7C024/0241 and
CY7C025/0251 have an automatic power-down feature controlled by
CE
. Each port i s provided with its own output enable control (OE),
which allows data to be read from the device.
Functional Description
Write Operation
Data must be set up for a duration of t
SD
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 wavef orm) 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 occur befor e the data is read on the output; othe rwise the data read is not deterministic. Data will be valid on the
port t
DDD
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 t
ACE
aft e r C E or t
DOE
after OE is
asserted. If the user of the CY7C024/0241 or CY7C025/0251 wishes
to access a semaphore flag, then the SE M
pin must be asser ted
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 (FFF for the
CY7C024/0241, 1FFF for the CY7C025/0251) is the mailbox
for the right port and the second-highest memory location
(FFE for the CY7C024/0241, 1FFE for the CY7C025/0251) 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 rese t when the own er reads the content s of th e mailbox. The message 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)
prevents the port from set ting the i nterrupt to the winning port.
Also, an active BUSY
to a port prev ents that port from readin g
its own mailbox and thus resett ing the interrupt to it.
If your 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 summarize d in
Table 2.
Busy
The CY7C024/0241 and CY7 C025/ 0251 pro vide o n-ch ip arbitration to resolve simultaneous memory lo cation access (con-
tention). If both ports’ CE
s are asser ted and an address m atch
occurs within t
PS
of each other, the busy logic will determine which
port has access. If t
PS
is violated, one port will definitely gain permis-
sion to the location, but which one is not predictable. BUSY
will be
asserted t
BLA
after an address match or t
BLC
afte r 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 interface to a master device with no external components.
Writing to slave devices must be delayed until after the BUSY
input
has settled (t
BLC
or t
BLA
). Otherwise, the slave chip ma y 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 CY7C024/0241 and CY7C025/0251 provide eight semaphore latches , which are separa te from the dual-port memory
locations . Semaphor es a re used t o reserve resour ces that are
shared between the tw o 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 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 deasser ted for t
SOP
before attempting to read the semaphore. The semaphore value will be available t
SWRD
+ t
DOE
after the rising edge of the semaphore write. If the
left port was successful (reads a zero), it assumes control of the
shared resource, otherwise ( reads a one) it assumes the right po rt
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 requires the semap hore, a one is wri tten to cancel its request.
Semaphores are accessed by asserting SEM
LOW. The SEM
pin functions as a chip select for the semaphore latches (CE must
remain HIGH during SEM
LOW). A
0–2
represents the semaphore
address. OE
and R/W are used in the sam e manner a s a n ormal
memory access. When w riting or reading a semap hore, the other
address pins have no effect.
When writing to the semaphore, only I/O
0
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 mo dified by the side showing zer o (the l eft port in this
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 por t had control, the right port would im mediately 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 prevent the semaphore from chang ing state
during a write from the other port. If both ports attempt to access the semap hore with in t
SPS
of each other , the semaphore will
definitely be obtained by one side or the other, but there is no guarantee which side will control the semaphore.