entropy_health_test
Run OpenTitan Repetition, Adaptive Proportion, and Markov health tests with a unified status byte.
enable_i selects which tests run; window_wrap_pulse_i closes each window. The block exposes raw repetition/APT/Markov counts and apt_fail_hi_o/apt_fail_lo_o pulses.
status_o bits:
- [0] Repetition failure
- [3] APT high/low
- [4] Markov above threshold
- [5] Markov below threshold
- [1,2,6,7] reserved
count_err_o sets when a health-test counter's duplicate copies disagree (prim_count fault detection), independent of threshold trips; callers must route it to the alert path because a glitched counter can stop reporting real failures.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
DATA_WIDTH | int unsigned | 32 | Number of parallel entropy bit streams tested, one counter set per bit. |
Ports
| Name | Direction | Type | Description |
|---|---|---|---|
clk_i | input | logic | System clock. |
rst_ni | input | logic | Active-low reset. |
entropy_i | input | logic [DATA_WIDTH-1:0] | Entropy word; each bit is tested as its own stream. |
entropy_valid_i | input | logic | Qualifies entropy_i for one sample. |
enable_i | input | logic [2:0] | Per-test enables: bit 0 repetition, bit 1 APT, bit 2 Markov; a clear bit holds that test's counters cleared. |
repetition_limit_i | input | logic [7:0] | Repetition-count failure threshold: a bit repeating this many consecutive samples fails. |
proportion_limit_1bit_i | input | logic [15:0] | APT high threshold; fails when the largest per-bit ones count in a window exceeds it. |
proportion_limit_lo_i | input | logic [15:0] | APT low threshold; fails when the smallest per-bit ones count in a window falls below it. |
markov_prob_01_threshold_i | input | logic [15:0] | Markov high threshold; fails when the largest per-bit 01/10 pair count exceeds it. |
markov_prob_10_threshold_i | input | logic [15:0] | Markov low threshold; fails when the smallest per-bit 01/10 pair count falls below it. |
window_wrap_pulse_i | input | logic | End-of-window strobe that evaluates and restarts the APT and Markov counts. |
ctr_repetition_o | output | logic [15:0] | Longest current run of identical samples across all bit streams. |
apt_pattern_count_1bit_o | output | logic [15:0] | Largest per-bit ones count in the current APT window. |
apt_pattern_count_2bit_o | output | logic [15:0] | Smallest per-bit ones count in the current APT window. |
count_01_o | output | logic [15:0] | Largest per-bit Markov 01/10 pair count in the current window. |
count_10_o | output | logic [15:0] | Smallest per-bit Markov 01/10 pair count in the current window. |
apt_fail_hi_o | output | logic | Single-cycle pulse at a window end where the APT high threshold is exceeded. |
apt_fail_lo_o | output | logic | Single-cycle pulse at a window end where the APT low threshold is undershot. |
status_o | output | logic [7:0] | Health-test failure pulses, encoded as listed above. |
count_err_o | output | logic | Redundant-counter disagreement in any of the three tests. |