Data
D
Q
X
0
D
Q
X
2
D
Q
X
1
D
Q
X
3
D
Q
X
4
D
Q
X
63
f
(x) = x
64
+ x
4
+ x
3
+ x + 1
Module Operation
629
SPNU563A – March 2018
Copyright © 2018, Texas Instruments Incorporated
Cyclic Redundancy Check (CRC) Controller Module
18.2.3 PSA Signature Register
The 64-bit PSA Signature Register is based on the primitive polynomial (as in the following equation) to
produce the maximum length LFSR (Linear Feedback Shift Register), as shown in
(25)
Figure 18-2. Linear Feedback Shift Register (LFSR)
The serial implementation of LFSF has a limitation that, it requires ‘n’ clock cycles to calculate the CRC
values for an ‘n’ bit data stream. The idea is to produce the same CRC value operating on a multi-bit data
stream, as would occur if the CRC were computed one bit at a time over the whole data stream. The
algorithm involves looping to simulate the shifting, and concatenating strings to build the equations after ‘n’
shift.
The parallel CRC calculation based on the polynomial can be illustrated in the following HDL code:
for i in 63 to 0 loop
NEXT_CRC_VAL(0) := CRC_VAL(63) xor DATA(i);
for j in 1 to 63 loop
case j is
when 1|3|4 =>
NEXT_CRC_VAL(j) :=
CRC_VAL(j - 1) xor CRC_VAL(63) xor DATA(i);
when others =>
NEXT_CRC_VAL(j) := CRC_VAL(j - 1);
end case;
end loop;
CRC_VAL := NEXT_CRC_VAL;
end loop;
NOTE:
1) The inner loop is to calculate the next value of each shift register bit after one cycle
2) The outer loop is to simulate 64 cycles of shifting. The equation for each shift register bit
is thus built before it is compressed into the shift register.
3) MSB of the DATA is shifted in first
There is one PSA Signature Register per CRC channel. PSA Signature Register can be both read and
written. When it is written, it can either compress the data or just capture the data depending on the state
of CHx_MODE bits. If CHx_MODE=Data Capture, a seed value can be planted in the PSA Signature
Register without compression. Other modes other than Data Capture will result with the data compressed
by PSA Signature Register when it is written. Each channel can be planted with different seed value
before compression starts. When PSA Signature Register is read, it gives the calculated signature.
CRC Controller should be used in conjunction with the on chip DMA controller to produce optimal system
performance. The incoming data pattern to PSA Signature Register is typically initiated by the DMA
master. When DMA is properly setup, it would read data from the pre-determined memory system and
write them to the memory mapped PSA Signature Register. Each time PSA Signature Register is written a
signature is generated. CPU itself can also perform data transfer by reading from the memory system and
perform write operation to PSA Signature Register if CPU has enough throughput to handle data patterns
transfer.