Nios® V Processor Reference Manual

ID 683632
Date 10/15/2025
Public
Document Table of Contents

3.3.9.4. Single-bit & Double-bit ECC Error Injection

The Nios® V processor supports ECC error injection to introduce errors into memory protected by ECC intentionally. This is crucial to test the processor's ability to detect and correct those errors during reliability testing or fault tolerance verification in safety-critical applications.

The processor implements ECC error injection using a custom processor CSR – ECC Error Injection CSR. To inject an ECC error, write a unique encoding into the ECC Error Injection CSR. To prevent the hardware from continuing to inject the ECC error, write a zero to the Injection Enable bit field to turn off the ECC error injection globally.
Table 64.  ECC Error Injection Register Fields
Bit Field
31 30 29 28 27 ... 4 3 2 1 0
Injection Enable Active ECC Error Injection
Table 65.  Enumeration for ECC Error Injection
Target Memory ECC Type Active ECC Error Injection bit field (Decimal value)
General Purpose Register (GPR) Correctable 0
Uncorrectable 1
Example to inject an Uncorrectable GPR ECC error:
  1. Write a decimal value of 1 into the Active ECC Error Injection field.
  2. Start the injection by asserting Injection Enable as “1”.
  3. Observe that the cpu_ecc_status is 2’b11 and cpu_ecc_source is 4’b1.
  4. Since this is an uncorrectable double-bit ECC error,
    1. The processor stalls if Single-bit & Double-bit ECC Error Exception Code is absent.
    2. The processor services it as an exception and jumps to the trap handler address (defined in mtvec register) if Single-bit & Double-bit ECC Error Exception Code is present.

Altera provides an error injection API for you to inject an ECC error into the processor. Refer to Nios® V Processor Software Developers Handbook – ECC Handling chapter for more information.