SWCU194 March 2023 CC1314R10 , CC1354P10 , CC1354R10 , CC2674P10 , CC2674R10
Table 14-5 lists the memory-mapped registers for the TRNG registers. All register offset addresses not listed in Table 14-5 should be considered as reserved locations and the register contents should not be modified.
| Offset | Acronym | Register Name | Section |
|---|---|---|---|
| 0h | OUT0 | Random Number Lower Word Readout Value | Section 14.7.1 |
| 4h | OUT1 | Random Number Upper Word Readout Value | Section 14.7.2 |
| 8h | IRQFLAGSTAT | Interrupt Status | Section 14.7.3 |
| Ch | IRQFLAGMASK | Interrupt Mask | Section 14.7.4 |
| 10h | IRQFLAGCLR | Interrupt Flag Clear | Section 14.7.5 |
| 14h | CTL | Control | Section 14.7.6 |
| 18h | CFG0 | Configuration 0 | Section 14.7.7 |
| 1Ch | ALARMCNT | Alarm Control | Section 14.7.8 |
| 20h | FROEN | FRO Enable | Section 14.7.9 |
| 24h | FRODETUNE | FRO De-tune Bit | Section 14.7.10 |
| 28h | ALARMMASK | Alarm Event | Section 14.7.11 |
| 2Ch | ALARMSTOP | Alarm Shutdown | Section 14.7.12 |
| 30h | LFSR0 | LFSR Readout Value | Section 14.7.13 |
| 34h | LFSR1 | LFSR Readout Value | Section 14.7.14 |
| 38h | LFSR2 | LFSR Readout Value | Section 14.7.15 |
| 78h | HWOPT | TRNG Engine Options Information | Section 14.7.16 |
| 7Ch | HWVER0 | HW Version 0 | Section 14.7.17 |
| 1FD8h | IRQSTATMASK | Interrupt Status After Masking | Section 14.7.18 |
| 1FE0h | HWVER1 | HW Version 1 | Section 14.7.19 |
| 1FECh | IRQSET | Interrupt Set | Section 14.7.20 |
| 1FF0h | SWRESET | SW Reset Control | Section 14.7.21 |
| 1FF8h | IRQSTAT | Interrupt Status | Section 14.7.22 |
Complex bit access types are encoded to fit into small table cells. Table 14-6 shows the codes that are used for access types in this section.
| Access Type | Code | Description |
|---|---|---|
| Read Type | ||
| R | R | Read |
| Write Type | ||
| W | W | Write |
| Reset or Default Value | ||
| -n | Value after reset or the default value | |
OUT0 is shown in Table 14-7.
Return to the Summary Table.
Random Number Lower Word Readout Value
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-0 | VALUE_31_0 | R | 0h | LSW of 64- bit random value. New value ready when IRQFLAGSTAT.RDY = 1. |
OUT1 is shown in Table 14-8.
Return to the Summary Table.
Random Number Upper Word Readout Value
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-0 | VALUE_63_32 | R | 0h | MSW of 64-bit random value. New value ready when IRQFLAGSTAT.RDY = 1. |
IRQFLAGSTAT is shown in Table 14-9.
Return to the Summary Table.
Interrupt Status
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31 | NEED_CLOCK | R | 0h | 1: Indicates that the TRNG is busy generating entropy or is in one of its test modes - clocks may not be turned off and the power supply voltage must be kept stable. 0: TRNG is idle and can be shut down |
| 30-2 | RESERVED | R | 0h | Reserved |
| 1 | SHUTDOWN_OVF | R | 0h | 1: The number of FROs shut down (i.e. the number of '1' bits in the ALARMSTOP register) has exceeded the threshold set by ALARMCNT.SHUTDOWN_THR Writing '1' to IRQFLAGCLR.SHUTDOWN_OVF clears this bit to '0' again. |
| 0 | RDY | R | 0h | 1: Data are available in OUT0 and OUT1. Acknowledging this state by writing '1' to IRQFLAGCLR.RDY clears this bit to '0'. If a new number is already available in the internal register of the TRNG, the number is directly clocked into the result register. In this case the status bit is asserted again, after one clock cycle. |
IRQFLAGMASK is shown in Table 14-10.
Return to the Summary Table.
Interrupt Mask
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-2 | RESERVED | R | 0h | Reserved |
| 1 | SHUTDOWN_OVF | R/W | 0h | 1: Allow IRQFLAGSTAT.SHUTDOWN_OVF to activate the interrupt from this module. |
| 0 | RDY | R/W | 0h | 1: Allow IRQFLAGSTAT.RDY to activate the interrupt from this module. |
IRQFLAGCLR is shown in Table 14-11.
Return to the Summary Table.
Interrupt Flag Clear
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-2 | RESERVED | R | 0h | Reserved |
| 1 | SHUTDOWN_OVF | W | 0h | 1: Clear IRQFLAGSTAT.SHUTDOWN_OVF. |
| 0 | RDY | W | 0h | 1: Clear IRQFLAGSTAT.RDY. |
CTL is shown in Table 14-12.
Return to the Summary Table.
Control
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-16 | STARTUP_CYCLES | R/W | 0h | This field determines the number of samples (between 28 and 224) taken to gather entropy from the FROs during startup. If the written value of this field is zero, the number of samples is 224, otherwise the number of samples equals the written value times 28. 0x0000: 224 samples 0x0001: 1*28 samples 0x0002: 2*28 samples 0x0003: 3*28 samples ... 0x8000: 32768*28 samples 0xC000: 49152*28 samples ... 0xFFFF: 65535*28 samples This field can only be modified while TRNG_EN is 0. If 1 an update will be ignored. |
| 15-11 | RESERVED | R | 0h | Reserved |
| 10 | TRNG_EN | R/W | 0h | 0: Forces all TRNG logic back into the idle state immediately. 1: Starts TRNG, gathering entropy from the FROs for the number of samples determined by STARTUP_CYCLES. |
| 9-3 | RESERVED | R | 0h | Reserved |
| 2 | NO_LFSR_FB | R/W | 0h | 1: Remove XNOR feedback from the main LFSR, converting it into a normal shift register for the XOR-ed outputs of the FROs (shifting data in on the LSB side). A '1' also forces the LFSR to sample continuously. This bit can only be set to '1' when TEST_MODE is also set to '1' and should not be used for other than test purposes |
| 1 | TEST_MODE | R/W | 0h | 1: Enables access to the TESTCNT and LFSR0/LFSR1/LFSR2 registers (the latter are automatically cleared before enabling access) and keeps IRQFLAGSTAT.NEED_CLOCK at '1'. This bit shall not be used unless you need to change the LFSR seed prior to creating a new random value. All other testing is done external to register control. |
| 0 | RESERVED | R | 0h | Reserved |
CFG0 is shown in Table 14-13.
Return to the Summary Table.
Configuration 0
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-16 | MAX_REFILL_CYCLES | R/W | 0h | This field determines the maximum number of samples (between 28 and 224) taken to re-generate entropy from the FROs after reading out a 64 bits random number. If the written value of this field is zero, the number of samples is 224, otherwise the number of samples equals the written value times 28. 0x0000: 224 samples 0x0001: 1*28 samples 0x0002: 2*28 samples 0x0003: 3*28 samples ... 0x8000: 32768*28 samples 0xC000: 49152*28 samples ... 0xFFFF: 65535*28 samples This field can only be modified while CTL.TRNG_EN is 0. |
| 15-12 | RESERVED | R | 0h | Reserved |
| 11-8 | SMPL_DIV | R/W | 0h | This field directly controls the number of clock cycles between samples taken from the FROs. Default value 0 indicates that samples are taken every clock cycle, maximum value 0xF takes one sample every 16 clock cycles. This field must be set to a value such that the slowest FRO (even under worst-case conditions) has a cycle time less than twice the sample period. This field can only be modified while CTL.TRNG_EN is '0'. |
| 7-0 | MIN_REFILL_CYCLES | R/W | 0h | This field determines the minimum number of samples (between 26 and 214) taken to re-generate entropy from the FROs after reading out a 64 bits random number. If the value of this field is zero, the number of samples is fixed to the value determined by the MAX_REFILL_CYCLES field, otherwise the minimum number of samples equals the written value times 64 (which can be up to 214). To ensure same entropy in all generated random numbers the value 0 should be used. Then MAX_REFILL_CYCLES controls the minimum refill interval. The number of samples defined here cannot be higher than the number defined by the 'max_refill_cycles' field (i.e. that field takes precedence). No random value will be created if min refill > max refill. This field can only be modified while CTL.TRNG_EN = 0. 0x00: Minimum samples = MAX_REFILL_CYCLES (all numbers have same entropy) 0x01: 1*26 samples 0x02: 2*26 samples ... 0xFF: 255*26 samples |
ALARMCNT is shown in Table 14-14.
Return to the Summary Table.
Alarm Control
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-30 | RESERVED | R | 0h | Reserved |
| 29-24 | SHUTDOWN_CNT | R/W | 0h | Read-only, indicates the number of '1' bits in ALARMSTOP register. The maximum value equals the number of FROs. |
| 23-21 | RESERVED | R | 0h | Reserved |
| 20-16 | SHUTDOWN_THR | R/W | 0h | Threshold setting for generating IRQFLAGSTAT.SHUTDOWN_OVF interrupt. The interrupt is triggered when SHUTDOWN_CNT value exceeds this bit field. |
| 15-8 | RESERVED | R | 0h | Reserved |
| 7-0 | ALARM_THR | R/W | FFh | Alarm detection threshold for the repeating pattern detectors on each FRO. An FRO 'alarm event' is declared when a repeating pattern (of up to four samples length) is detected continuously for the number of samples defined by this field's value. Reset value 0xFF should keep the number of 'alarm events' to a manageable level. |
FROEN is shown in Table 14-15.
Return to the Summary Table.
FRO Enable
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-24 | RESERVED | R | 0h | Reserved |
| 23-0 | FRO_MASK | R/W | 00FFFFFFh | Enable bits for the individual FROs. A '1' in bit [n] enables FRO 'n'. Default state is all '1's to enable all FROs after power-up. Note that they are not actually started up before the CTL.TRNG_EN bit is set to '1'. Bits are automatically forced to '0' here (and cannot be written to '1') while the corresponding bit in ALARMSTOP.FRO_FLAGS has value '1'. |
FRODETUNE is shown in Table 14-16.
Return to the Summary Table.
FRO De-tune Bit
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-24 | RESERVED | R | 0h | Reserved |
| 23-0 | FRO_MASK | R/W | 0h | De-tune bits for the individual FROs. A '1' in bit [n] lets FRO 'n' run approximately 5% faster. The value of one of these bits may only be changed while the corresponding FRO is turned off (by temporarily writing a '0' in the corresponding bit of the FROEN.FRO_MASK register). |
ALARMMASK is shown in Table 14-17.
Return to the Summary Table.
Alarm Event
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-24 | RESERVED | R | 0h | Reserved |
| 23-0 | FRO_MASK | R/W | 0h | Logging bits for the 'alarm events' of individual FROs. A '1' in bit [n] indicates FRO 'n' experienced an 'alarm event'. |
ALARMSTOP is shown in Table 14-18.
Return to the Summary Table.
Alarm Shutdown
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-24 | RESERVED | R | 0h | Reserved |
| 23-0 | FRO_FLAGS | R/W | 0h | Logging bits for the 'alarm events' of individual FROs. A '1' in bit [n] indicates FRO 'n' experienced more than one 'alarm event' in quick succession and has been turned off. A '1' in this field forces the corresponding bit in FROEN.FRO_MASK to '0'. |
LFSR0 is shown in Table 14-19.
Return to the Summary Table.
LFSR Readout Value
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-0 | LFSR_31_0 | R/W | 0h | Bits [31:0] of the main entropy accumulation LFSR. Register can only be accessed when CTL.TEST_MODE = 1. Register contents will be cleared to zero before access is enabled. |
LFSR1 is shown in Table 14-20.
Return to the Summary Table.
LFSR Readout Value
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-0 | LFSR_63_32 | R/W | 0h | Bits [63:32] of the main entropy accumulation LFSR. Register can only be accessed when CTL.TEST_MODE = 1. Register contents will be cleared to zero before access is enabled. |
LFSR2 is shown in Table 14-21.
Return to the Summary Table.
LFSR Readout Value
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-17 | RESERVED | R | 0h | Reserved |
| 16-0 | LFSR_80_64 | R/W | 0h | Bits [80:64] of the main entropy accumulation LFSR. Register can only be accessed when CTL.TEST_MODE = 1. Register contents will be cleared to zero before access is enabled. |
HWOPT is shown in Table 14-22.
Return to the Summary Table.
TRNG Engine Options Information
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-12 | RESERVED | R | 0h | Reserved |
| 11-6 | NR_OF_FROS | R | 18h | Number of FROs implemented in this TRNG, value 24 (decimal). |
| 5-0 | RESERVED | R | 0h | Reserved |
HWVER0 is shown in Table 14-23.
Return to the Summary Table.
HW Version 0
EIP Number And Core Revision
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-28 | RESERVED | R | 0h | Reserved |
| 27-24 | HW_MAJOR_VER | R | 2h | 4 bits binary encoding of the major hardware revision number. |
| 23-20 | HW_MINOR_VER | R | 0h | 4 bits binary encoding of the minor hardware revision number. |
| 19-16 | HW_PATCH_LVL | R | 0h | 4 bits binary encoding of the hardware patch level, initial release will carry value zero. |
| 15-8 | EIP_NUM_COMPL | R | B4h | Bit-by-bit logic complement of bits [7:0]. This TRNG gives 0xB4. |
| 7-0 | EIP_NUM | R | 4Bh | 8 bits binary encoding of the module number. This TRNG gives 0x4B. |
IRQSTATMASK is shown in Table 14-24.
Return to the Summary Table.
Interrupt Status After Masking
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-2 | RESERVED | R | 0h | Reserved |
| 1 | SHUTDOWN_OVF | R | 0h | Shutdown Overflow (result of IRQFLAGSTAT.SHUTDOWN_OVF AND'ed with IRQFLAGMASK.SHUTDOWN_OVF) |
| 0 | RDY | R | 0h | New random value available (result of IRQFLAGSTAT.RDY AND'ed with IRQFLAGMASK.RDY) |
HWVER1 is shown in Table 14-25.
Return to the Summary Table.
HW Version 1
TRNG Revision Number
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-8 | RESERVED | R | 0h | Reserved |
| 7-0 | REV | R | 20h | The revision number of this module is Rev 2.0. |
IRQSET is shown in Table 14-26.
Return to the Summary Table.
Interrupt Set
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-0 | RESERVED | R | 0h | Reserved |
SWRESET is shown in Table 14-27.
Return to the Summary Table.
SW Reset Control
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-1 | RESERVED | R | 0h | Reserved |
| 0 | RESET | R/W | 0h | Write '1' to soft reset , reset will be low for 4-5 clock cycles. Poll to 0 for reset to be completed. |
IRQSTAT is shown in Table 14-28.
Return to the Summary Table.
Interrupt Status
| Bit | Field | Type | Reset | Description |
|---|---|---|---|---|
| 31-1 | RESERVED | R | 0h | Reserved |
| 0 | STAT | R | 0h | TRNG Interrupt status. OR'ed version of IRQFLAGSTAT.SHUTDOWN_OVF and IRQFLAGSTAT.RDY |