
The LFSR taps are produced via a length => mask table which is selected by n_taps;
valid indicates that there is an LFSR as confibured..
Each clock cycle produces a new LFSR value.
hold prevents the LFSR from generating a new cycle
and every step cycle produces a new value while holding.
There is no included test (yet). The design was tested using hand-generated top-level test modules (lfsr and logic) and both embedced $display invocations and GTK signal evaluation.
This circuit can be run (input)
by setting length and n_taps for the desired configuration
and by using hold and step as desired
to control LFSR value generation.
LFSR state is driven by the clock (internal)
and exposed (output and bidirectional output)
by observing valid to see if there is an LFSR for the specified configuration
and value provides the low-order 15b of the LFSR;
invalid LFSR configurations produce no output.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | length_0 | value_00 | value_08 |
| 1 | length_1 | value_01 | value_09 |
| 2 | length_2 | value_02 | value_10 |
| 3 | length_3 | value_03 | value_11 |
| 4 | length_4 | value_04 | value_12 |
| 5 | n_taps | value_05 | value_13 |
| 6 | step | value_06 | value_14 |
| 7 | hold | value_07 | valid |