Cyiv 51009
Cyiv 51009
Cyiv 51009
CYIV-51009-1.3
This chapter describes the cyclical redundancy check (CRC) error detection feature in
user mode and how to recover from soft errors.
Dedicated circuitry built into Cyclone IV devices consists of a CRC error detection
feature that can optionally check for a single-event upset (SEU) continuously and
automatically.
In critical applications used in the fields of avionics, telecommunications, system
control, medical, and military applications, it is important to be able to:
■ Confirm the accuracy of the configuration data stored in an FPGA device
■ Alert the system to an occurrence of a configuration error
Using the CRC error detection feature for Cyclone IV devices does not impact fitting
or performance.
This chapter contains the following sections:
■ “Configuration Error Detection” on page 9–1
■ “User Mode Error Detection” on page 9–2
■ “Automated SEU Detection” on page 9–3
■ “CRC_ERROR Pin” on page 9–3
■ “Error Detection Block” on page 9–4
■ “Error Detection Timing” on page 9–5
■ “Software Support” on page 9–6
■ “Recovering from CRC Errors” on page 9–9
© 2013 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos
are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as
trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance of its ISO
semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any products and 9001:2008
services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, product, or service Registered
described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relying
on any published information and before placing orders for products or services.
Feedback Subscribe
9–2 Chapter 9: SEU Mitigation in Cyclone IV Devices
User Mode Error Detection
Soft errors are changes in a configuration random-access memory (CRAM) bit state
due to an ionizing particle. Cyclone IV devices have built-in error detection circuitry
to detect data corruption by soft errors in the CRAM cells.
This error detection capability continuously computes the CRC of the configured
CRAM bits based on the contents of the device and compares it with the
pre-calculated CRC value obtained at the end of the configuration. If the CRCs match,
there is no error in the current configuration CRAM bits. The process of error
detection continues until the device is reset (by setting nCONFIG to low).
The Cyclone IV device error detection feature does not check memory blocks and I/O
buffers. These device memory blocks support parity bits that are used to check the
contents of memory blocks for any error. The I/O buffers are not verified during error
detection because the configuration data uses flip-flops as storage elements that are
more resistant to soft errors. Similar flip-flops are used to store the pre-calculated CRC
and other error detection circuitry option bits.
The error detection circuitry in Cyclone IV devices uses a 32-bit CRC IEEE 802
standard and a 32-bit polynomial as the CRC generator. Therefore, a single 32-bit CRC
calculation is performed by the device. If a soft error does not occur, the resulting
32-bit signature value is 0x00000000, that results in a 0 on the CRC_ERROR output
signal. If a soft error occurs in the device, the resulting signature value is non-zero and
the CRC_ERROR output signal is 1.
You can inject a soft error by changing the 32-bit CRC storage register in the CRC
circuitry. After verifying the induced failure, you can restore the 32-bit CRC value to
the correct CRC value with the same instruction and inserting the correct value.
1 Before updating it with a known bad value, Altera recommends reading out the
correct value.
In user mode, Cyclone IV devices support the CHANGE_EDREG JTAG instruction, that
allows you to write to the 32-bit storage register. You can use Jam™ STAPL files (.jam)
to automate the testing and verification process. You can only execute this instruction
when the device is in user mode, and it is a powerful design feature that enables you
to dynamically verify the CRC functionality in-system without having to reconfigure
the device. You can then use the CRC circuit to check for real errors induced by an
SEU.
Table 9–1 describes the CHANGE_EDREG JTAG instructions.
1 After the test completes, Altera recommends that you power cycle the device.
CRC_ERROR Pin
A specific CRC_ERROR error detection pin is required to monitor the results of the error
detection circuitry during user mode. Table 9–2 describes the CRC_ERROR pin.
f The CRC_ERROR pin information for Cyclone IV devices is reported in the Cyclone IV
Devices Pin-Outs on the Altera® website.
This section focuses on the first type—the 32-bit CRC when the device is in user
mode.
Control Signals
Error Detection
State Machine Compute & Compare
CRC
32
32
32
Table 9–5. Minimum and Maximum Error Detection Frequencies for Cyclone IV Devices
Error Detection Maximum Error Minimum Error
Valid Divisors (2n)
Frequency Detection Frequency Detection Frequency
80 MHz/2n 80 MHz 312.5 kHz 0, 1, 2, 3, 4, 5, 6, 7, 8
You can set a lower clock frequency by specifying a division factor in the Quartus II
software (for more information, refer to “Software Support”). The divisor is a power
of two (2), where n is between 0 and 8. The divisor ranges from one through 256. Refer
to Equation 9–1.
Equation 9–1.
80 MH
rror detection frequency = -------------------
n
2
CRC calculation time depends on the device and the error detection clock frequency.
Table 9–6 lists the estimated time for each CRC calculation with minimum and
maximum clock frequencies for Cyclone IV devices.
Software Support
Enabling the CRC error detection feature in the Quartus II software generates the
CRC_ERROR output to the optional dual purpose CRC_ERROR pin.
To enable the error detection feature using CRC, perform the following steps:
1. Open the Quartus II software and load a project using Cyclone IV devices.
2. On the Assignments menu, click Settings. The Settings dialog box appears.
3. In the Category list, select Device. The Device page appears.
4. Click Device and Pin Options. The Device and Pin Options dialog box appears as
shown in Figure 9–2.
5. In the Device and Pin Options dialog box, click the Error Detection CRC tab.
6. Turn on Enable error detection CRC.
7. In the Divide error check frequency by box, enter a valid divisor as documented
in Table 9–5 on page 9–5.
8. Click OK.
Figure 9–2. Enabling the Error Detection CRC Feature in the Quartus II Software
Figure 9–3 shows the error detection block diagram in FPGA devices and shows the
interface that the WYSIWYG atom enables in your design.
Clock Divider
(1 to 256 Factor)
VCC
CRC_ERROR
Pre-Computed CRC (Shown in BIDIR Mode)
(Saved in the Option Register)
Error Detection
Logic
CRC_ERROR
SRAM CRC
REGOUT
Bits Computation
SHIFTNLD
LDSRC
CLK
Logic Array
1 The user logic is affected by the soft error failure, so reading out the 32-bit CRC
signature through the regout should not be relied upon to detect a soft error. You
should rely on the CRC_ERROR output signal itself, because this CRC_ERROR output
signal cannot be affected by a soft error.
To enable the cycloneiv_crcblock WYSIWYG atom, you must name the atom for
each Cyclone IV device accordingly.
Example 9–1 shows an example of how to define the input and output ports of a
WYSIWYG atom in a Cyclone IV device.
Example 9–1. Error Detection Block Diagram
cycloneiv_crcblock<crcblock_name>
.clk(<clock source>),
.shiftnld(<shiftnld source>),
.ldsrc(<ldsrc source>),
.regout(<output destination>),
);
Table 9–7 lists the input and output ports that you must include in the atom.
Table 9–7. CRC Block Input and Output Ports
Port Input/Output Definition
Unique identifier for the CRC block, and represents any identifier name that is legal
<crcblock_name> Input for the given description language (for example, Verilog HDL, VHDL, and AHDL).
This field is required.
This signal designates the clock input of this cell. All operations of this cell are
with respect to the rising edge of the clock. Whether it is the loading of the data
.clk(<clock source> Input
into the cell or data out of the cell, it always occurs on the rising edge. This port is
required.
This signal is an input into the error detection block. If shiftnld=1, the data is
shifted from the internal shift register to the regout at each rising edge of clk. If
.shiftnld (<shiftnld shiftnld=0, the shift register parallel loads either the pre-calculated CRC value
Input
source>) or the update register contents, depending on the ldsrc port input. To do this,
the shiftnld must be driven low for at least two clock cycles. This port is
required.
This signal is an input into the error detection block. If ldsrc=0, the
pre-computed CRC register is selected for loading into the 32-bit shift register at
.ldsrc (<ldsrc the rising edge of clk when shiftnld=0. If ldsrc=1, the signature register
Input
source>) (result of the CRC calculation) is selected for loading into the shift register at the
rising edge of clk when shiftnld=0. This port is ignored when
shiftnld=1. This port is required.
This signal is the output of the cell that is synchronized to the internal oscillator of
the device (80-MHz internal oscillator) and not to the clk port. It asserts high if
the error block detects that a SRAM bit has flipped and the internal CRC
computation has shown a difference with respect to the pre-computed value. You
.crcerror (<crcerror
must connect this signal either to an output pin or a bidirectional pin. If it is
indicator Output
connected to an output pin, you can only monitor the CRC_ERROR pin (the core
output>)
cannot access this output). If the CRC_ERROR signal is used by core logic to
read error detection logic, you must connect this signal to a BIDIR pin. The
signal is fed to the core indirectly by feeding a BIDIR pin that has its output
enable port connected to VCC (see Figure 9–3 on page 9–8).
This signal is the output of the error detection shift register synchronized to the
.regout (<registered
Output clk port to be read by core logic. It shifts one bit at each cycle, so you should
output>)
clock the clk signal 31 cycles to read out the 32 bits of the shift register.