entropy_generator
Generate one entropy lane from a noise source, decorrelator, health tests, and auto-tune.
Combines a TOTAL_LENGTH/TAPPED_LENGTH ring oscillator sampled on sample_clk_i with decorrelation and Repetition/APT/Markov tests.
Controls:
- auto_tune_enable_i lets health failures retune detune through the tune FSM; detune_ro_i forces detune.
- bypass_decorrelator_i and entropy_byte_mask_i configure the decorrelator; sample_clk_div_i sets its downsample.
- test_enable_i and the limit/threshold inputs program the three health tests; window_wrap_pulse_i closes each window.
count_err_o is this lane's health-test counter-disagreement error.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
TOTAL_LENGTH | int unsigned | 17 | Full ring-oscillator stage count. |
TAPPED_LENGTH | int unsigned | 13 | Stage count of the shorter feedback tap, used while detune is low. |
CLKDIV_WIDTH | int unsigned | 24 | Downsample divider counter width. |
Ports
| Name | Direction | Type | Description |
|---|---|---|---|
clk_i | input | logic | System clock. |
rst_ni | input | logic | Active-low asynchronous reset. |
sample_clk_i | input | logic | Ring-oscillator sample clock. |
enable_i | input | logic | Enables the noise ring oscillator and the decorrelator. |
auto_tune_enable_i | input | logic | High lets the tune FSM drive the ring detune in place of detune_ro_i. |
detune_ro_i | input | logic | Manual ring detune while auto-tune is off: high selects the full TOTAL_LENGTH feedback path, low the shorter tap. |
sample_clk_div_i | input | logic [CLKDIV_WIDTH-1:0] | Decorrelator downsample period minus one, in clk_i cycles. |
bypass_decorrelator_i | input | logic | High removes the decorrelator XOR feedback. |
entropy_byte_mask_i | input | logic [7:0] | AND mask on each decorrelator output byte. |
test_enable_i | input | logic [2:0] | Health-test enables: bit 0 repetition, bit 1 APT, bit 2 Markov. |
repetition_limit_i | input | logic [7:0] | Repetition-count failure threshold. |
proportion_limit_1bit_i | input | logic [15:0] | APT high threshold on the per-bit ones count per window. |
proportion_limit_lo_i | input | logic [15:0] | APT low threshold on the per-bit ones count per window. |
markov_prob_01_threshold_i | input | logic [15:0] | Markov high threshold on the per-bit 01/10 pair count per window. |
markov_prob_10_threshold_i | input | logic [15:0] | Markov low threshold on the per-bit 01/10 pair count per window. |
window_wrap_pulse_i | input | logic | Shared end-of-window strobe that evaluates and restarts the APT and Markov tests. |
noise_bit_monitor_o | output | logic | Synchronized noise-source bit, for debug observation. |
test_status_o | output | logic [7:0] | Health-test status byte, encoded as entropy_health_test status_o. |
entropy_byte_o | output | logic [7:0] | Masked decorrelator output byte. |
entropy_byte_valid_o | output | logic | Single-cycle strobe marking a new entropy_byte_o. |
count_err_o | output | logic | Redundant-counter fault in this lane's health tests. |