Nios® V Processor: Lockstep Implementation User Guide

ID 833274
Date 4/17/2025
Public
Document Table of Contents

4.3. Unlocking and Locking Registers

For robustness, Altera implements a lock/unlock mechanism of some Read/Write registers and behaves as follows:

  • If the write WE(write enable) status bit of a certain register shows that write access is allowed, the content of the register is always updated in the case of write access to that register (the WE field itself is read-only).
  • If the WE status bit of a certain register shows that write access is denied, the content of the register is not updated in the case of write access.
  • In any case, when the WR key field is accessed with a write access, the WE status bit is updated accordingly.

Each write-protected register implements 2 states: locked and unlocked. The current state is readable from the WE status field. The fRSmartComp accepts write operations to any R/W fields only when the state is unlocked.

Altera recommends reverting back to a locked state after every write. Therefore, at minimum, two writes are needed to set a single value when the register's reset state is locked.

  • First, write to unlock. Second, write to update the register value, and lock simultaneously.
  • First, write to unlock. Second, write to update the register value. Third, write to lock.

If fRSmartComp denies write access to a write-protected register (WE status field == 0) or the system supervisor performs write access using an invalid unlock code for the WR key, then the fRSmartComp generates ALARM19. Some registers are also protected against transient faults using a parity mechanism, checked every clock cycle. The protection is automatic. In the case of a parity error, the fRSmartComp generates ALARM19.

Table 35.  Access Type
Access Meaning
R/W Full read and write access to field content. Note that protection with the Key may be implemented. Refer to the Most Significant Byte for details
R/WI

Read-only register.

Writes are ignored: write access is accepted but has no effect.

RAZ/W

Read at 0: always returns 0 on read access.

Writeable to give a command, but written value cannot be read here