Nios® V Processor: Lockstep Implementation

ID 833274
Date 10/07/2024
Public
Document Table of Contents

2.2.3.1. Self-Checking Comparator

This safety mechanism flags if the two CPUs behave differently by comparing their outputs every clock cycle. It is like the traditional comparator used in a standard DCLS. The comparator also includes time diversity features; the two CPUs work two clock cycles apart (the Agent CPU is two clock cycles behind the Host CPU). In addition, the comparator is duplicated to ensure the detection of faults that may be affecting the comparator itself.
Figure 8. Self-Checking Comparator
The fRSmartComp consists of the following comparators:
  1. Main comparator—combinatorial comparator comparing all the CPU outputs at each clock cycle.
  2. Second comparator—combinatorial comparator comparing all the CPU outputs at each clock cycle as redundancy.
  3. Self-diagnostic comparator-time-multiplexed comparator, activated after a detection mismatch between the Main and Second comparators. Requires a maximum of 64 clock cycles since the comparator mismatch.
Table 5.  Mismatch Events and Outcome
No Mismatch Event Outcome
Main Second Self-diagnostics
1 - - N/A No mismatch detected.
2 N/A

Detects mismatch in the Main and Second comparator. Thus, both comparators agree.

  • Activates ALARM0 or ALARM1 (based on DISABLED state).
3 - -

Detects mismatch in either the Main or Second comparator. Thus, both comparators disagree and initiate a Self-diagnostic comparator.

No mismatch was detected by the Self-diagnostic comparator. The fault is from fRSmartComp.

  • Activates ALARM0 or ALARM1 (based on DISABLED state).
  • Activates ALARM2.
  • Activates ALARM3.
- -
4 -

Detects mismatch in either the Main or Second comparator. Thus, both comparators disagree and initiate a Self-diagnostic comparator.

Detects mismatch in Self-diagnostic comparator. The fault is from fRSmartComp and CPU.

  • Activates ALARM0 or ALARM1 (based on DISABLED state).
  • Activates ALARM2.
  • Activates ALARM4
-

As shown in the above table, the comparators generate five different alarms to allow maximum usage flexibility. After initiating a comparator self-detection, if the fRSmartComp is not in a DISABLED state, the System Supervisor waits until the end of the self-diagnostic comparison is completed by polling ALARM3 and ALARM4, as either is generated.

The system supervisor can use the configurable severity feature (refer to the topic Configuring Alarm Severity) to implement several failure control strategies. For example, ALARM3 can be classified as a WARNING, while ALARM4 can be classified as an ERROR.

Figure 9. Timing Diagram (Mismatch Event 3)

The fRSmartComp comparators utilize the concept of "comparator slice." Each comparator slice consists of a group of Nios® V processor outputs to be compared, with each Nios® V processor output being associated with a single comparator slice.

The comparator functionality allows Fault Injection to be performed on a selected programmable comparator slice, refer to the topic Injecting Fault. Whenever fRSmartComp detects a comparator mismatch, it provides the ID of the slices that produced it.