From 987efe46ee74ac85e0e64aaa97657dc52f0c8241 Mon Sep 17 00:00:00 2001 From: Vladimir Rozic Date: Tue, 25 Jul 2023 14:38:39 +0100 Subject: [PATCH] [doc] Update LFSR coeffs descriprion. Signed-off-by: Vladimir Rozic --- hw/ip/prim/doc/prim_lfsr.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/hw/ip/prim/doc/prim_lfsr.md b/hw/ip/prim/doc/prim_lfsr.md index a9a01787241c2..0531fdde5b8f6 100644 --- a/hw/ip/prim/doc/prim_lfsr.md +++ b/hw/ip/prim/doc/prim_lfsr.md @@ -10,8 +10,7 @@ with the shift register, whereas the latter combines several shift register taps and reduces them with an XNOR tree. For more information, refer to [this page](https://en.wikipedia.org/wiki/Linear-feedback_shift_register). Both LFSR flavors have maximal period (`2^LfsrDw - 1`). The recommendation is to use -the Galois type and fall back to the Fibonacci type depending on the polynomial -width availability in the lookup table (see below). +the Galois type. ## Parameters @@ -70,18 +69,15 @@ LFSR with the `DefaultSeed` in the next cycle. The LFSR coefficients are taken from an internal set of lookup tables with precomputed coefficients. Alternatively, a custom polynomial can be provided -using the `Custom` parameter. The lookup tables contain polynomials for both -LFSR forms and range from 4bit to 64bit for the Galois form and 3bit to 168bit -for the Fibonacci form. The polynomial coefficients have been obtained from -[this page](https://users.ece.cmu.edu/~koopman/lfsr/) and +using the `Custom` parameter. The lookup table contains polynomials for both +LFSR forms and range from 3bit to 168bit. +The polynomial coefficients have been obtained from [Xilinx application note 52](https://www.xilinx.com/support/documentation/application_notes/xapp052.pdf). The script `./script/get-lfsr-coeffs.py` can be used to download, parse and dump these coefficients in SV format as follows: ``` $ script/get-lfsr-coeffs.py -o ``` -The default is to get the Galois coefficients. If the Fibonacci coefficients -are needed, add the `--fib` switch to the above command. The implementation of the state transition function of both polynomials have been formally verified. Further, all polynomials up to 34bit in length have been