IP2022 Data Sheet
www.ubicom.com
77
residue register which do not participate in the
programmed LFSR operation, be sure that the
corresponding bits in the RESCMP register are initialized
to the same values as these non-participating bits.
Each LFSR unit has three configuration registers
(LFSRCFG1, LFSRCFG2, and LFSRCFG3) for various
control and status bits. The HL_TRIGGER bit in the
LFSRCFG3 register controls whether operation of the
LFSR unit is triggered by a write to the high byte or the low
byte of the DATAIN register (i.e. DATAINH or DATAINL).
The operation then proceeds for some number of cycles
programmed in the SHIFT_COUNT3:0 field of the
LFSRCFG1 register. Completion of the operation is
indicated when the DONE bit in the LFSRCFG1 register is
set. (Alternatively, software can wait an appropriate
number of cycles before reading the result.)
An autoloading option is available for each LFSR unit to
load the DATAIN register automatically when the SxRBUF
register of the corresponding SERDES unit is loaded.
LFSR0 and LFSR2 are paired with SERDES1, and
LFSR1 and LFSR3 are paired with SERDES2.
Three registers in data memory are used to access the
LFSR register banks, as shown in Table 5-15.
The LFSRA register is loaded to point to a specific LFSR
unit and a register pair within the unit. The LFSRA register
has the format shown in Figure 5-24
Figure 5-24 LFSRA Register
Only 0, 1, 2, and 3 are valid as the UNIT. The valid
encodings for the index are shown in Table 5-16.
The LFSR registers do not support consecutive read-
modify-write operations. For example, the following
instruction sequence loads unpredictable values:
clrb lfsrh,7
clrb lfsrh,4
5.9.1
LFSRCFG1 Register
Figure 5-25 LFSRCFG1 Register
SET_RESset to initialize the residue register to all
ones (write-only, reads as zero).
DONEclear while the LFSR is busy, set when the
operation is completed.
CMP_RESset if last LFSR operation result
matched contents of RESCMP register.
SHIFT_COUNT3:0specifies number of bits to shift,
load with N for an operation of N+1 shifts.
Table 5-15 LFSR Registers in Data Memory
Address
Name
Description
0x23
LFSRH
High data byte
0x27
LFSRL
Low data byte
0x2B
LFSRA
Address register
7
4
3
0
UNIT3:0
INDEX3:0
Table 5-16 LFSRA Register INDEX Encoding
INDEX
High Byte (LFSRH)
Low Byte (LFSRL)
0x0
DATAINH
DATAINL
0x1
DATAOUTH
DATAOUTL
0x2
FB2
FB1
0x3
LFSRCFG2
RES4
0x4
RES3
RES2
0x5
RES1
RES0
0x6
FB4
FB3
0x7
LFSRCFG3
DOUT
0x8
LFSRCFG1
POLY4
0x9
POLY3
POLY2
0xA
POLY1
POLY0
0xB
RESCMP3
RESCMP2
0xC
RESCMP1
RESCMP0
7
6
5
4
3
0
Rsvd SET_RES DONE CMP_RES SHIFT_COUNT3:0