
COPROCESSOR INTERFACE
S3FB42F
7-2
As shown in the coprocessor interface diagram above, the coprocessor interface signals of CalmRISC are:
SYSCP[11:0], nCOPID, nCLDID, nCLDWR, and EC[2:0]. The data are exchanged through data buses, DI[7:0] and
DO[7:0]. A command is issued from CalmRISC to a coprocessor through SYSCP[11:0] in COP instructions. The
status of a coprocessor can be sent back to CalmRISC through EC[2:0] and these flags can be checked in the
condition codes of branch instructions. The coprocessor instructions are listed in the following table
Table 7-1. Coprocessor instructions
Mnemonic
Op 1
Op 2
Description
COP
#imm:12
–
Coprocessor operation
CLD
GPR
imm:8
Data transfer from coprocessor into GPR
CLD
imm:8
GPR
Data transfer of GPR to coprocessor
JP(or JR)
CALL
LNK
EC2–EC0
label
Conditional branch with coprocessor status flags
The coprocessor of CalmRISC does not have its own program memory (i.e., it is a passive coprocessor) as shown in
Figure 7 -1. In fact, the coprocessor instructions are fetched and decoded by CalmRISC, and CalmRISC issues the
command to the coprocessor through the interface signals. For example, if “COP #imm:12” instruction is fetched,
then the 12-bit immediate value (imm:12) is loaded on SYSCP[11:0] signal with nCOPID active in ID/MEM stage, to
request the coprocessor to perform the designated operation. The interpretation of the 12-bit immediate value is
totally up to the coprocessor. By arranging the 12-bit immediate field, the instruction set of the coprocessor is
determined. In other words, CalmRISC only provides a set of generic coprocessor instructions, and its installation to
a specific coprocessor instruction set can differ from one coprocessor to another. CLD Write instructions (“CLD
imm:8, GPR”) put the content of a GPR register of CalmRISC on the data bus (DO[7:0] ) and issue the
address(imm:8) of the coprocessor internal register on SYSCP[7:0] with nCLDID active and CLDWR active. CLD
Read instructions (“CLD GPR, imm:8” in Table 7-1) work similarly, except that the content of the coprocessor
internal register addressed by the 8-bit immediate value is read into a GPR register through DI[7:0] with nCLDID
active and CLDWR deactivated.
The timing diagram given below is a coprocessor instruction pipeline and shows when the coprocessor performs the
required operations. Suppose I2 is a coprocessor instruction. First, it is fetched and decoded by CalmRISC (at t = T(i-
1)). Once it is identified as a coprocessor instruction, CalmRISC indicates to the coprocessor the appropriate
command through the coprocessor interface signals (at t = T(i)). Then the coprocessor performs the designated
tasks at t = T(i) and t = T(i+1). Hence IF from CalmRISC and then ID/MEM and EX from the coprocessor constitute
the pipeline for I2. Similarly, if I3 is a coprocessor instruction, the coprocessor’s ID/MEM and EX stages replace the
corresponding stages of CalmRISC.