Visible to Intel only — GUID: xlg1740968901197
Ixiasoft
Visible to Intel only — GUID: xlg1740968901197
Ixiasoft
4.3.2. Shadow Register
Note that there is a total of 32 Nios® V general-purpose registers, but the shadow register set comprised of the upper 16 registers only. Consequently, the shadow register set is not a complete alternate set of GPR. This implementation is intentionally for the following reasons:
- The RISC-V ABI assigns zero to x0 and pointer registers to x2 – x4. These registers must be in sync across all register sets.
- Reduce memory block utilization.
Besides GPRs, the Nios® V/g processor support 32 floating-point registers, when floating-point unit is enabled. Unlike GPRs, the processor implements the shadow register as a complete alternate set of floating-point registers.
Enabling shadow register is backward compatible with ISRs that are built with shadow register disabled. To take advantage of the shadow registers, the ISRs can be enhanced by stop saving and restoring the upper 16 register state and floating-point registers.
RISC-V ISAa | Register Set | Saving and Restoring Registers during Context Switching | ||
---|---|---|---|---|
Shadow Register Set | Without Shadow Register | With Shadow Register | ||
RV32I | x0 – x15 | Not present | Required | Required |
x16 – x31 | x16 – x31 | Required | Not required (Replaced by register switching) | |
“F” Extension | f0 – f31 | f0 – f31 | Required | Not required (Replaced by register switching) |