Data Sheet
June 2001
DSP16410B Digital Signal Processor
Agere Systems Inc.
Agere Systems—Proprietary
Use pursuant to Company instructions
47
4 Hardware Architecture
(continued)
4.8 Interprocessor Communication
(continued)
4.8.2 Message Buffer Data Exchange
(continued)
The receiving core can use interrupts or polling to
detect the presence of an incoming message. When
the receiving core reads
mgi
, the following steps occur:
1. After one instruction cycle of latency, the
DSP16410B sets the receiving core’s MGIBE flag.
2. After an additional instruction cycle of latency, the
DSP16410B clears the transmitting core’s MGOBF
flag.
4.8.2.1 Message Buffer Write Protocol
To ensure an older message has been processed by
the receiving core, the transmitting core must not write
a new message to
mgo
until its MGOBF flag is cleared.
The example code segment below is executed by the
transmitting core:
if mgobf goto .
// Wait for old message
// to be read.
// Write new message.
mgo=*r0++
4.8.2.2 Message Buffer Read Protocol
The receiving core can detect an incoming message by
enabling the MGIBF interrupt in the
inc1
register
(
Table 149 on page 238
). The following is an example
of a simple interrupt service routine for the receiving
core:
ISR:
*r0++=mgi
// Read new message and
// clear MGIBF.
ireturn
As an alternative to the interrupt-directed message
buffer read protocol described above, the receiving
core can poll its MGIBE flag for the arrival of a new
message. The example code segment below is exe-
cuted by the receiving core:
if mgibe goto .
// Wait for new
// message.
// Read new message.
*r0++=mgi
The DSP16410B can operate a full-duplex communica-
tion channel between CORE0 and CORE1 with each
core using its own
mgi
and
mgo
registers and its own
MGOBF and MGIBE flags.
Table 13
illustrates two
code segments for a full-duplex data exchange of N
words between CORE0 and CORE1. This segment
exchanges two words (one input, one output) between
the two cores every 17 CLK cycles.
Table 13. Full-Duplex Data Transfer Code Through Core-to-Core Message Buffer
CORE0 Message Buffer Transfer Code
c0=1-N
xfer: if mgobf goto .
mgo=*r0++
CORE1 Message Buffer Transfer Code
c0=1-N
xfer: if mgobf goto .
mgo=*r1++
//Write message to
//CORE1 and set MGOBF.
//4 cycles latency
//until CORE1’s MGIBE
//is cleared.
//Wait for CORE1
//message to arrive.
//Read CORE1 message
//and clear CORE1’s
//MGOBF.
if mgibe goto .
*r1++=mgi
if c0lt goto xfer
//Write message to
//CORE0 and set MGOBF.
//4 cycles latency
//until CORE0’s MGIBE
//is cleared.
//Wait for CORE0
//message to arrive.
//Read CORE0 message
//and clear CORE0’s
//MGOBF.
if mgibe goto .
*r0++=mgi
if c0lt goto xfer