Texas Instruments CC2650DK 사용자 설명서

다운로드
페이지 1570
TRNG Operation Description
The [TRNG:ALARMCNT] register, together with the [TRNG:ALARMMASK] and [TRNG:ALARMSTOP]
registers, can be used by the host to determine if the FRO/sample cycle locking is a problem.
Lock detection in functional mode is performed using the sampled outputs of the individual FROs. A 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 the [TRNG:ALARMCNT:ALARM_THR]. The alarm event is logged
by setting a bit to pinpoint the FRO in the [TRNG:ALARMMASK] register. If that bit in the
[TRNG:ALARMMASK] register was already set, the corresponding bit in the [TRNG:ALARMSTOP] register
is set and the FRO is switched off to prevent further alarm events from that FRO. If the
[TRNG:ALARMMASK] register bit was not yet set, the FRO is restarted automatically in an attempt to
break the locking. If a FRO is locked again after detune and re-enable, software should leave the FRO
deactivated.
The [TRNG:ALARMCNT:SHUTDOWN_CNT] bit field in this register keeps track of the number of FROs
switched off (actually, is a count of the number of 1 bits in the [TRNG:ALARMSTOP] register). The
[TRNG:ALARMCNT:SHUTDOWN_THR] bit field allows a configurable threshold to be set to generate the
SHUTDOWN_OVF interrupt. When [TRNG:ALARMCNT:SHUTDOWN_CNT] exceeds
[TRNG:ALARMCNT:SHUTDOWN_THR], the [TRNG:IRQFLAGSTAT:SHUTDOWN_OVF] bit is set to 1,
which can be used to generate an interrupt.
16.5 TRNG Operation Description
Before the first random number generation, the [TRNG:CTL] and [TRNG:CFG0] registers should be
written to start accumulating entropy. The entropy is a measure of the uncertainty associated with a
random value. The random numbers are accessible to the application in a 64-bit read-only register
[TRNG:OUT0], [TRNG:OUT1]. Once the register is read, the TRNG generates a new value, which is
available after [TRNG:CFG0:MIN_REFILL_CYCLES] system clock cycles and is then shifted into the
output register. Software can use two strategies for operating the TRNG:
1. Monitored mode: Software checks the [TRNG:ALARMMASK] register at regular intervals (on the
order of seconds). If a bit is set there, the [TRNG:ALARMSTOP] register should also be checked to
see if a FRO was shut down due to multiple alarm events – if none were shut down, the
[TRNG:ALARMMASK] register can be cleared to get rid of the spurious alarm events. If one or more
FROs were shut down, software can modify the delay selection of those FROs in the
[TRNG:FRODETUNE] register in an attempt to prevent further locking. For this type of operation, the
[TRNG:ALARMCNT:SHUTDOWN_THR] would normally be set to a low value (for instance, value 2)
and the SHUTDOWN_OVF interrupt can then be used to signal abnormal operation conditions and/or
breakdowns of FROs.
2. Unmonitored mode: Software sets [TRNG:ALARMCNT:SHUTDOWN_THR] to the number of FROs
that are allowed to be shut down before corrective actions must be taken, and then uses the
SHUTDOWN_OVF interrupt to initiate those corrective actions (clearing the [TRNG:ALARMMASK] and
[TRNG:ALARMSTOP] registers, toggling bits in the [TRNG:FRODETUNE] register). Software must
keep track of the time interval between these interrupts – if they happen too often this indicates
abnormal operating conditions and/or breakdown of FROs.
16.5.1 TRNG Shutdown
The TRNG can be shut down in many ways, but not all of them result in storing of entropy. The different
modes are treated here.
The best way will be to not read the last generated random number. After the MAX_REFILL time (max 2
24
cycles), defined in register [TRNG:CFG0], the TRNG will enter idle mode where all FROs are turned off.
Once the generated value is read, the TRNG will start up again and generate a new random seed, ready
after the time [TRNG:CFG0:MIN_REFILL_CYCLES]. When the TRNG is in idle mode, the module clock
can be turned off. Entropy is kept in between random number creations, so no reset (SW) of module is
needed.
Another approach to shut down the TRNG is to just stop the module clock. By shutting down the TRNG by
stopping the module clock, the entropy is also kept (that is, does not affect randomness), but the FROs
might still be running. The clock can be enabled at any time, and the generation of a random seed is
continued. There will be no need for a soft reset of the module.
1158
Random Number Generator
SWCU117A – February 2015 – Revised March 2015
Copyright © 2015, Texas Instruments Incorporated