SPRUI30H November 2015 – May 2024 DRA745 , DRA746 , DRA750 , DRA756
The control register file (CREG) contains registers that control or report status for the ARP32 CPU. Table 8-314 lists the control registers contained in the control register file.
Control registers are accessed via MVC, MVCH instructions – this is the only mechanism for moving the contents of registers between the architectural register file and the control register file. Control registers are addressable via 5 bits in the creg field of the MVC/MVCH instructions. All control registers are defined as 32 bits – MVC + MVCH pair should be used to move immediate values to any control registers.
The following instructions are available in the MVC/MVCH family:
| Acronym | Register Name | Section |
|---|---|---|
| CSR | Control Status Register | Section 8.2.4.6.1 |
| IER | Interrupt Enable Register | Section 8.2.4.6.2 |
| IFR | Interrupt Flag Register | Section 8.2.4.6.3 |
| ISR | Interrupt Set Register | Section 8.2.4.6.4 |
| ICR | Interrupt Clear Register | Section 8.2.4.6.5 |
| NRP | Nonmaskable Interrupt Return Pointer Register | Section 8.2.4.6.6 |
| IRP | Interrupt Return Pointer Register | Section 8.2.4.6.7 |
| SP | Stack Pointer Register | Section 8.2.4.6.8 |
| GDP | Global Data Pointer Register | Section 8.2.4.6.9 |
| LR | Link Register | Section 8.2.4.6.10 |
| LSA0 | Loop 0 Start Address Register | Section 8.2.4.6.11 |
| LEA0 | Loop 0 End Address Register | Section 8.2.4.6.12 |
| LCNT0 | Loop 0 Iteration Count Register | Section 8.2.4.6.13 |
| LSA1 | Loop 1 Start Address Register | Section 8.2.4.6.14 |
| LEA1 | Loop 1 End Address Register | Section 8.2.4.6.15 |
| LCNT1 | Loop 1 Iteration Count Register | Section 8.2.4.6.16 |
| LCNT0RLD | Loop 0 Iteration Count Reload Value Register | Section 8.2.4.6.17 |
| SCSR | Shadow Control Status Register | Section 8.2.4.6.18 |
| NMISCSR | NMI Shadow Control Status Register | Section 8.2.4.6.19 |
| CPUID | CPU ID Register | Section 8.2.4.6.20 |
| DPC | Decode Program Counter | Section 8.2.4.6.21 |
| TSCH | Time-Stamp Counter (high 32 bits) Register | Section 8.2.4.6.22 |
| TSCL | Time-Stamp Counter (low 32 bits) Register | Section 8.2.4.6.22 |
Direct modification of the CREG entries is limited to a few special case instructions. For example, some forms of the ADD and SUB instructions directly modify the stack pointer (SP) to improve code execution performance.
A read of a control register (by MVCcreg, areg) can be immediately followed by any other instruction using the same areg without causing a stall – the read data is forwarded to the next instruction in the pipeline. The following example illustrates the behavior:
// Read from IRP and push it stack
MVC IRP, R0 ; Read IRP and place it is R0
STRF R0, R0 ; No stall, content of IRP is pushed to stackA write to a control register is also bypassed to another instruction immediately following it and using the same creg. The following example illustrates the behavior:
// Update SP before a register push
MVC 5000, SP ; Update SP to 5000
STRF R0, R0 ; No stall, R0 is pushed @5000However, a write to a control register (by MVCareg, creg) has one exposed effective delay slot for an immediately following read from the same control register (by MVCcreg, areg). The following examples illustrate the behavior:
// Write to LCNT0 and read it back
MVC 2000, LCNT0 ; Update LCNT0 again
NOP ; without this NOP the next MVC will read UNPREDICTABLE value
MVC LCNT0, R0 ; R0=2000