SPRUI30H November 2015 – May 2024 DRA745 , DRA746 , DRA750 , DRA756
The ARP32 CPU implements a shadow copy for the following registers:
The shadow registers are used to save-off the main registers during an interrupt processing. When an interrupt is taken, the main registers are copied onto the corresponding shadow register by the CPU along with saving the interrupt return address in IRP/NRP. The original registers are restored back upon a return from interrupt – as a result of a BIRP or BNRP instruction execution.
As a result of this, as long as interrupts are not allowed to be nested, interrupt handler routines in the ARP32 CPU do not need to save of any registers on the stack, this significantly reduces the interrupt processing latency.
Table 8-334 provides the list of the shadow registers in the ARP32 CPU.
| Acronym | Register Name | Description |
|---|---|---|
| SR0 | Shadow R0 | Shadow copy of R0 |
| SR1 | Shadow R1 | Shadow copy of R1 |
| SR2 | Shadow R2 | Shadow copy of R2 |
| SR3 | Shadow R3 | Shadow copy of R3 |
| SR4 | Shadow R4 | Shadow copy of R4 |
| SR5 | Shadow R5 | Shadow copy of R5 |
| SR6 | Shadow R6 | Shadow copy of R6 |
| SR7 | Shadow R7 | Shadow copy of R7 |
| SLSA0 | Shadow Loop 0 Start Address | Shadow copy of LSA0 |
| SLEA0 | Shadow Loop 0 End Address | Shadow copy of LEA0 |
| SLCNT0 | Shadow Loop 0 Iteration Count | Shadow copy of LCNT0 |
| SLSA1 | Shadow Loop 1 Start Address | Shadow copy of LSA1 |
| SLEA1 | Shadow Loop 1 End Address | Shadow copy of LEA1 |
| SLCNT1 | Shadow Loop 1 Iteration Count | Shadow copy of LCNT1 |
| SLCNT0RLD | Shadow Loop 0 Iteration Count Reload | Shadow copy of LCNT0RLD |
Shadow registers are access via the MVS instruction:
The MVS instruction is executed by the S unit. Any write to the shadow registers (via a MVS areg, sreg instruction) has two exposed delay slots - a subsequent read from the same sreg (via a MVSareg, sreg instruction) must be separated by at least two instructions. Otherwise, the old value of sreg is read.
The read result (of a MVS sreg, areg instruction) is bypassed appropriately to a subsequent instruction using the same areg – there is no delay slot or stall in this case.
The following examples illustrate the behavior:
// Update SR0 and then read back (assume SR0 = 0x100, R0 = 0x200)
MVS R0, SR0 ; Move R0 to SR0
NOP ; NOP to fill delay slot #1
MVS SR0, R7 ; Move SR0 to R7, R7 = 0x100 (old value)// Update SR0 and then read back (assume SR0 = 0x100, R0 = 0x200)
MVS R0, SR0 ; Move R0 to SR0
NOP ; NOP to fill delay slot #1
NOP ; NOP to fill delay slot #2
MVS SR0, R7 ; Move SR0 to R7, R7 = 0x200 (new value)