Corersdec HB
Corersdec HB
Handbook
CoreRSDEC v3.9
Microsemi makes no warranty, representation, or guarantee regarding the information contained herein or the suitability of
its products and services for any particular purpose, nor does Microsemi assume any liability whatsoever arising out of the
application or use of any product or circuit. The products sold hereunder and any other products sold by Microsemi have
been subject to limited testing and should not be used in conjunction with mission-critical equipment or applications. Any
performance specifications are believed to be reliable but are not verified, and Buyer must conduct and complete all
performance and other testing of the products, alone and together with, or installed in, any end-products. Buyer shall not
Microsemi Headquarters
rely on any data and performance specifications or parameters provided by Microsemi. It is the Buyer’s responsibility to
One Enterprise, Aliso Viejo, independently determine suitability of any products and to test and verify the same. The information provided by Microsemi
CA 92656 USA hereunder is provided “as is, where is” and with all faults, and the entire risk associated with such information is entirely
Within the USA: +1 (800) 713-4113 with the Buyer. Microsemi does not grant, explicitly or implicitly, to any party any patent rights, licenses, or any other IP
Outside the USA: +1 (949) 380-6100 rights, whether with regard to such information itself or anything described by such information. Information provided in this
Sales: +1 (949) 380-6136 document is proprietary to Microsemi, and Microsemi reserves the right to make any changes to the information in this
Fax: +1 (949) 215-4996 document or to any products and services at any time without notice.
Email: [email protected]
www.microsemi.com
About Microsemi
©2021 Microsemi, a wholly owned Microsemi, a wholly owned subsidiary of Microchip Technology Inc. (Nasdaq: MCHP), offers a comprehensive portfolio of
subsidiary of Microchip Technology Inc. All semiconductor and system solutions for aerospace & defense, communications, data center and industrial markets.
rights reserved. Microsemi and the Products include high-performance and radiation-hardened analog mixed-signal integrated circuits, FPGAs, SoCs and
Microsemi logo are registered trademarks of ASICs; power management products; timing and synchronization devices and precise time solutions, setting the world's
Microsemi Corporation. All other trademarks standard for time; voice processing devices; RF solutions; discrete components; enterprise storage and communication
and service marks are the property of their solutions, security technologies and scalable anti-tamper products; Ethernet solutions; Power-over-Ethernet ICs and
midspans; as well as custom design capabilities and services. Learn more at www.microsemi.com.
respective owners.
1 Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Revision 8.0 .......................................................................1
1.2 Revision 7.0 .......................................................................1
1.3 Revision 6.0 .......................................................................1
1.4 Revision 5.0 .......................................................................1
1.5 Revision 4.0 .......................................................................1
1.6 Revision 3.0 .......................................................................1
1.7 Revision 2.0 .......................................................................1
1.8 Revision 1.0 .......................................................................1
2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.3 Core Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.4 Supported Families . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.5 Device Utilization and Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.1 Theory of Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.1.1 Properties of Reed-Solomon Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.1.2 Galois Field Math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.1.3 Shortened Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1.4 Erasures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3.1.5 CoreRSDEC Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.1.6 CoreRSDEC Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.1.7 Decoder Processing Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4 Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.1 Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.2 Configuration Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
5 Timing Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.1 I/O Signal Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.1.1 NGRST, RST Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.1.2 CLK, CLKEN Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.1.3 START Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.1.4 RFS Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
5.1.5 RFD Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.1.6 RDY Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.1.7 RECDIN Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.1.8 DATOUT Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.1.9 CODOUT Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.1.10 CODERDY Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.1.11 RDYPULSE Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5.1.12 FLAGFAIL Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.1.13 FLAGNOERR Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.1.14 ERRCOUNT Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.1.15 ERAMARK Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.1.16 TAGIN, TAGOUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
7 Testbench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
7.1 User Test-bench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
7.2 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
8 System Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1 Revision History
The revision history describes the changes that were implemented in the document. The changes are
listed by revision, starting with the most current publication.
2 Introduction
2.1 Overview
CoreRSDEC is a register transfer level (RTL) generator that produces a Microsemi® fabric
programmable gate array (FPGA)-optimized Reed-Solomon (RS) decoder core based on user-defined
parameters.
RS code is a class of error-correcting codes used to detect and correct errors that might be introduced
into digital data when it is transmitted or stored. Error-correcting codes incorporate redundancy in data.
With this redundancy, only a subset of all possible transmissions contains valid messages. This means
the valid codes are separated from each other, so errors are not likely to corrupt one valid code into
another. The encoded data can then be transmitted or stored. When recovering data, a decoder first
determines if a received message is a valid one. This step is called error detection. Once any error is
detected, the decoder finds a valid message “closest” to the received one. Provided the number of
corrupted words (symbols) does not exceed a specified range, the message found is the one that was
transmitted. Thus, the decoder conducts error correction.
The number of errors the code can correct depends on the amount of redundancy added. In other words,
if more errors are expected to occur, more redundant symbols need to be added. The number of
redundant symbols directly impacts the complexity of the Reed-Solomon codec (encoder and especially
decoder).
The RS encoder and decoder do not necessarily have to be coupled. Both encoder and decoder operate
over an RS code that is entirely defined by a user through the core configuration parameters. Once the
same RS code parameters are defined, the encoder/decoder can communicate to a different
decoder/encoder at logical level. A physical level converters and minimal handshaking logic are required
to be provided if necessary. The RS encoders and decoders work with each other with no extra logic or
converters necessary.
The CoreRSDEC is configured through the Configurator GUI. Only the desired parameter values need to
be set. For a detailed description of the configuration parameters, refer to the Configuration Parameters,
page 14.
An example of a digital communication system utilizing the RS codec is shown in Figure 1. Data gets
encoded then modulated and transmitted through a communication channel that could introduce one or
more errors. At the receiver end, a demodulated message gets decoded with erroneous symbols
corrected. The recovered data goes to its destination.
Figure 1 • An Example of a Digital Communication System
Data RS
Source Encoder Modulator
Noisy
Channel or
Other
Medium
Data RS
Destination Decoder Demodulator
2.2 Features
CoreRSDEC is a highly configurable core and has the following features:
• Parameterizable CoreRSDEC generator
• Symbol widths from 3 to 8 bits
• Supports shortened code in conventional mode decoding
• Supports CCSDS-16 and CCSDS-8 decoding
• CCSDS mode supports data decoding presented in dual basis
Logic Elements
FPGA Family and RAM Device Clock Rate
Device Config Comb Seq Total Utilization% Blocks SpeedGrade (MHz)
Fusion® AFS600 1 4,721 1,201 5,922 42.84 1 -2 54.9
2 4,760 1,229 5,989 43.32 1 -2 56.8
3 7,582 2,075 9,657 69.86 1 -2 51.7
®
IGLOO AGL600V5 1 4,720 1,203 5,923 42.85 1 STD 35.1
2 4,788 1,228 6,016 43.52 1 STD 35.3
3 7,628 2,073 9,701 70.18 1 STD 31.5
®
ProASIC 3 A3P600 1 4,728 1,202 5,930 42.90 1 -2 54.9
2 4,760 1,229 5,989 43.32 1 -2 56.8
3 7,582 2,075 9,657 69.86 1 -2 51.7
®
ProASICPLUS 1 7,027 1,268 8,295 14.7 2 STD 31.9
APA1000
2 7,412 1,295 8,437 15 2 STD 31
3 11,830 2,157 13,987 24.8 2 STD 30
®
Axcelerator AX1000 1 4,092 1,268 5,360 29.54 1 -2 63.1
2 4,116 1,347 5,463 30.11 1 -2 65.7
3 7,128 2,225 9,353 51.55 1 -2 59.5
™
RTAX -S RTAX1000 1 4,027 1,305 5,332 29.39 1 -1 71.5
2 4,090 1,333 5,423 29.89 1 -1 66.5
3 7,126 2,215 9,341 51.48 1 -1 67.5
®
SmartFusion 2 1 3,218 1,157 4,365 8.99 1 -1 115.8
M2SO50T
2 3,230 1,184 4,414 9.07 1 -1 121.8
3 5,334 2,022 7,356 15.11 1 -1 116
®
IGLOO 2 M2GL005 1 3,275 1,198 4,473 36.90 1 -1 124.0
2 3,499 1,207 4,706 38.82 1 -1 116.6
3 5,486 2,039 7,525 62.08 1 -1 116.7
™
RTG4 RT4G150 1 5,751 2,232 7,893 3.85 1 -1 93.6
2 3,623 1,364 4,987 1.64 1 -1 90.5
3 5,896 2,267 8,163 2.68 1 -1 85.2
PolarFire 1 5,217 2,072 7,289 2.43 1 STD 119.6
MPF300T_ES
2 3,422 1,230 4,652 1.55 1 STD 122.6
3 5,316 2,083 7,399 2.47 1 STD 114.7
Note: FPGA resources and performance data for the PolarFire SoC family is similar to PolarFire family.
Note: Data in this table is gathered using typical synthesis and layout settings. Throughput is computed as
follows: Throughput= (Code_rate*Symbol_width) × Clock Rate (Performance) = (K/N)*Symbol_width ×
Clock Rate (Performance)
CoreRSDEC configuration parameters are set as listed in Table 2: Conventional, CCSDS-8, and
CCSDS-16 respectively.
Parameters Configuration
Name Description 1 2(CCSDS-8) 3(CCSDS-16)
m Symbol width, bits. 8 8 8
n Codeword length, symbols. 255 255 255
t Number of correctable symbols. 16 8 16
B0 First root of the Primitive polynomial. 112 120 112
prim_poly Primitive polynomial. 391 391 391
Enable erasure Erasure enabled. No No No
No Error Flag Error Flag enabled. No No No
Enable Tag Tag enabled. No No No
3 Functional Description
An RS (255, 223) code with 8-bit symbols utilized by many standards, should be considered. Each
codeword contains 223 data bytes and 32 parity bytes, a total of 255-byte codeword. The code is capable
of correcting up to 16 corrupted symbols.
Parameters of the code are as following:
• n = 255
• k = 223
• m=8
• t = (255 - 223) / 2 = 16
A corrupted symbol can have one or more (up to m) erroneous bits. In the above example, the RS code
can correct up to 16 symbol errors while every erroneous symbol has one to eight corrupted bits. This
property makes RS codes a powerful tool for protecting data impacted by burst errors.
The CoreRSDEC fails and assert FLAGFAIL flag when it detects more number of errors in the input
codeword than its correction capability. In some cases, the CoreRSDEC may not assert the FLAGFAIL
flag even the number of errors in input codeword exceeds its correction capability.
Depending on the size m, there might be one or more valid primitive polynomials. Different polynomials
generate different GFs and thus different RS codes. Usually, particular standards-for example, 802.11-
define the primitive polynomial to be used in an RS encoder/decoder. The Microsemi RS cores support
any user-defined polynomial valid with any symbol size m. Polynomials are entered as decimal numbers.
The bits of this number's binary image correspond to the polynomial coefficients.
For example:
1 * x8 + 0 * x7 + 0 * x6 + 0 * x5 + 1 * x4 + 1 * x3 + 1 * x2 + 0 * x + 1 => 100011101 = 285
Configurator provides a drop-down menu that lists all valid primitive polynomials. In case the user does
not select a specific polynomial, the core uses a default primitive polynomial. Default polynomials are
listed in Table 3.
Another important polynomial an RS codec directly utilizes is a generator polynomial. This is derived
from the primitive polynomial based on the first root of the generator polynomial. Again, particular
standards often define the first root value to be used in the RS codec. Most common first root values are:
0 or 1, but CoreRSDEC supports any value in the range from 0 to n - 1.
3.1.4 Erasures
Normally, the CoreRSDEC detects and corrects errors based solely on the n - k redundant parity
symbols. Additional data is not needed to perform data detection/correction.
Erasure is an instance when CoreRSDEC knows an incoming symbol is likely to be an error. This
knowledge comes from outside rather than from decoding the RS code and detecting the error inside
CoreRSDEC. For example, a receiver can have a threshold detector that decides whether an input signal
level carries a bit value of 0 or 1. It is reasonable to set the thresholds in such way that there are
thresholds where the receiver is certain it receives 0 or 1, and an uncertainty threshold between the first
two where the receiver refuses to make a decision. Such a receiver produces a three-value bit: 0, 1, or X
(uncertain). Erasure is an instance when an uncertain symbol gets into CoreRSDEC.
Erasure locations (which symbols are uncertain) are known to the decoder beforehand.
CoreRSDEC can work with a mixture of errors and erasures. If the number of erasures in a codeword is
e and the number of errors in the same codeword is r, the following relation holds for the codeword that
includes 2t parity symbols (Morelos-Zaragoza, References, page 22): 2t > 2r + e.
Erasure mode can either be enabled or disabled when configuring the core. Enabling Erasure mode
substantially increases the FPGA resource utilization.
For example: in case of mixture of error and erasure in conventional mode of decoding.
if tt=8 then 16 > 2 * r + e. Specific case is 16 > 2 * 7 + 1 in that case 7 errors and 1 erasure mixture can
be correctable.
Berlekamp-
Chien Search,
Syndrome Massey
recdIn Forney
Calculator Key Equation
Algorithm
Solver
Error
Codeword i – 2
If the dual basis code comes from a communications channel/encoder, a dual basis needs to be applied
to conventional converter. Then the decoder will always face conventional code only.
CoreRSDEC provides the dual basis output for the Dual basis input which is referred CCSDS mode.
CoreRSDEC provides the conventional basis output for the conventional basis input, which is referred as
conventional mode.
Time
time it is idle. The decoder processing cycle that determines the minimum interval between two
consecutive START signals equals n clock cycles. This means the codewords can come without gaps
between.
Figure 6 • Codeword Length Determines Minimum Inter-Start Interval
Start Start
Syndrome
Berlekamp Idle
Chien-Massey
Figure 6 shows a different situation where the Berlekamp computation takes longer than the codeword
length. Such a situation occurs when the correction capacity t is relatively large and the codeword length
n is relatively small. In Figure 6, the Berlekamp computation determines the decoder processing cycle
while the Syndrome calculator and Chien-Massey block are idle during a fraction of the cycle. The
CoreRSDEC is not ready to accept another codeword in n clock cycles, even though the Syndrome
calculation is over, because the Berlekamp block is still busy processing the data of the previous
codeword.
Figure 7 • Berlekamp Stage Determines Minimum Inter-Start Interval
Start Start
9t + 8
Syndrome Idle
Berlekamp
Chien-Massey Idle
If parameters are selected so that 9t + 8 > n, the decoder is in the situation depicted in Figure 7. There
needs to be a gap between incoming codewords of at least n - 9t - 8 clock cycles. Otherwise, the decoder
is in the situation of Figure 7, where there is no need for the gap.
Figure 7 shows the Berlekamp processing time depending on the selected parameter t.
For example, at t = 3, the Berlekamp computation takes 35 clock cycles. The decoder can accept any
codewords longer than 35 symbols with no gaps in between. Once a crossing point of the selected
parameter values of t and n, falls in the white area of the Figure 7, a gap is not needed between the
incoming codewords.
160
140
120
Codeword Length, n
100
80
152
60
125 134 143
116
40 89 98 107
71 80
53 62
20 35 44
17 26
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
The same Figure 8 can be used to determine approximate decoder latency. If the above crossing point
falls in the white area, the latency is 2n, otherwise the latency is 18t + 16.
Note: When both ERA and CCSDS-16 parameters are enabled (that is, ERA = 1 and CCSDS = 2), then the
favourable decoder latency lies in the range between: 680 to 780 (2.6n to 3n) clock cycles.
4 Interface
4.1 Ports
The port signals for CoreRSDEC are described in Table 4 and as shown in Figure 9.
Figure 9 • CoreRSDEC I/O Signals
recdIn datOut
codOut
start rfs
eraMark rfd
rdy
clk
clkEn codeRdy
rst rdyPulse
nGrst
flagFail
flagNoErr
errCount
tagIn tagOut
5 Timing Diagrams
codeword
rfd
rfs
As shown in Figure 10, the START can be asserted early to repeat the RFS signal. Figure 10 also shows
an example of a gap between the incoming codewords. The gap is caused by the START signal being
issued later than RFS turned active.
rdy
datOut k–1 0
Room for
Parity
Symbols of a
Codeword
clk
rdy
rdyPulse
rdy
errCount,
Valid Flag i Valid Flag i + 1
flagNoErr, flagFail
Figure 14 • Precise Timing for the Flags
clk
rdy
6 Tool Flow
6.1 License
CoreRSDEC is licensed and requires a RTL license to be used and instantiated. Complete source code
is provided for the core. User need a Libero Gold and Platinum license to work with this core.
6.2 SmartDesign
CoreRSDEC is available for download in the Libero IP catalog through the web repository. Once it is
listed in the catalog, the core can be instantiated using the SmartDesign flow. To know how to create
SmartDesign project using the IP cores, refer to Libero SoC documents page and use the latest
SmartDesign user guide. An example instantiated view is shown in Figure 15.
After configuring and generating the core instance, basic functionality can be simulated using the
testbench supplied with the core. The testbench parameters automatically adjust to the core
configuration. The core can be instantiated as a component of a larger design. Figure 15 shows an
example of a larger design that instantiates two instances of CoreRSDEC. Every instance is configured
separately.
Note: CoreRSDEC is compatible with both Libero integrated design environment (IDE) and Libero System-on-
Chip (SoC). Unless specified otherwise this document uses the common name Libero to identify Libero
IDE and Libero SoC.
Figure 15 • SmartDesign CoreRSDEC Instance View
Note: For RTG4, asynchronous reset ports NGRST must be either tied to a single top-level reset net or tied
high so that only synchronous resets RST are used.
7 Testbench
A unified testbench is used to verify and test CoreRSDEC. It is called a user testbench.
recdIn datOut
Test Vector
eraMark codOut
Generator
tagIn rdy
Compare
codeRdy
start
clk rdyPulse
Signal Generator
clkEn
rst flagFail
nGrst flagNoErr
errCount
tagOut
rfs
rfd
Golden Codeword
Generator
7.2 References
• Rorabaugh, C. Britton. Error Coding Cookbook. McGraw-Hill, 1995.
• Sweeney, Peter. Error Control Coding. John Wiley & Sons, 2002.
• Morelos-Zaragoza, Robert H. The Art of Error Correcting Coding. John Wiley & Sons, 2002.
• Lin, Shu and Daniel J. Costello. Error Control Coding. Prentice Hall, 2004.
8 System Integration