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

Table 1. Parameters
NameTypeDefaultDescription
DATA_WIDTHint unsigned32Number of parallel entropy bit streams tested, one counter set per bit.

Ports

Table 2. Ports
NameDirectionTypeDescription
clk_iinputlogicSystem clock.
rst_niinputlogicActive-low reset.
entropy_iinputlogic [DATA_WIDTH-1:0]Entropy word; each bit is tested as its own stream.
entropy_valid_iinputlogicQualifies entropy_i for one sample.
enable_iinputlogic [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_iinputlogic [7:0]Repetition-count failure threshold: a bit repeating this many consecutive samples fails.
proportion_limit_1bit_iinputlogic [15:0]APT high threshold; fails when the largest per-bit ones count in a window exceeds it.
proportion_limit_lo_iinputlogic [15:0]APT low threshold; fails when the smallest per-bit ones count in a window falls below it.
markov_prob_01_threshold_iinputlogic [15:0]Markov high threshold; fails when the largest per-bit 01/10 pair count exceeds it.
markov_prob_10_threshold_iinputlogic [15:0]Markov low threshold; fails when the smallest per-bit 01/10 pair count falls below it.
window_wrap_pulse_iinputlogicEnd-of-window strobe that evaluates and restarts the APT and Markov counts.
ctr_repetition_ooutputlogic [15:0]Longest current run of identical samples across all bit streams.
apt_pattern_count_1bit_ooutputlogic [15:0]Largest per-bit ones count in the current APT window.
apt_pattern_count_2bit_ooutputlogic [15:0]Smallest per-bit ones count in the current APT window.
count_01_ooutputlogic [15:0]Largest per-bit Markov 01/10 pair count in the current window.
count_10_ooutputlogic [15:0]Smallest per-bit Markov 01/10 pair count in the current window.
apt_fail_hi_ooutputlogicSingle-cycle pulse at a window end where the APT high threshold is exceeded.
apt_fail_lo_ooutputlogicSingle-cycle pulse at a window end where the APT low threshold is undershot.
status_ooutputlogic [7:0]Health-test failure pulses, encoded as listed above.
count_err_ooutputlogicRedundant-counter disagreement in any of the three tests.