1 -------------------------------------------------------
6 -------------------------------------------------------
10 USE ieee.std_logic_1164.
all;
23 msg : in ((K*SYMB_BITWIDTH)-1 downto 0);
24 parity : out (((N-K)*SYMB_BITWIDTH)-1 downto 0)
31 -- Dependant parameters
33 constant POL_BW : := SYMB_BITWIDTH*P;
34 constant STG_BW : := SYMB_BITWIDTH*(P+1);
36 TYPE reg_arr IS ARRAY( RANGE <>) OF ((STG_BW-1) downto 0);
37 SIGNAL stageOut : reg_arr((K-1) downto 0);
38 SIGNAL multOut : reg_arr((K-1) downto 0);
41 BEGIN --========#### Architecture Body ####========--
43 -- ---------------- The Parallel LFSR HDL description ---------------- --
45 -- In the first layer, the rightmost node is an addition to zero, so
46 -- we route it directly to the stage output
47 stageOut(0)(((SYMB_BITWIDTH+POL_BW)-1) downto POL_BW) <= msg((SYMB_BITWIDTH-1) downto 0);
49 -- Since in the first layer there are no adders, the stageOut is
50 -- connected to the multiplier output. Hence, the multOut is set to zero.
51 multOut(0)(((SYMB_BITWIDTH*P)-1) downto 0) <= (OTHERS => '0');
53 -- The rightmost multOut is never USEd (we only add the input codeword
54 -- with the previous node), so it is set to zero. On the other hand,
55 -- the leftmost node only performs multiplication, so multOut is
56 -- routed to stageOut.
57 multOut(0)(((SYMB_BITWIDTH+POL_BW)-1) downto POL_BW) <= (OTHERS => '0');
59 multAndStage_gen: FOR i IN 1 TO (K-1) GENERATE
60 multOut(i)(((SYMB_BITWIDTH+POL_BW)-1) downto POL_BW) <= (OTHERS => '0');
61 stageOut(i)((SYMB_BITWIDTH-1) downto 0) <= multOut(i)((SYMB_BITWIDTH-1) downto 0);
64 -- Generates the instances of the GF(2^m) of the LFSR parallel network
65 -- The first line is a particular CASE...
67 -- The GF multiplications units in the first stage
68 stageOut(0)(2) <= msg(1);
69 stageOut(0)(1) <= msg(0) xor msg(2);
70 stageOut(0)(0) <= msg(2);
71 stageOut(0)(3) <= msg(2) xor msg(0);
72 stageOut(0)(4) <= msg(1) xor msg(0) xor msg(2);
73 stageOut(0)(5) <= msg(2) xor msg(1);
75 -- The remaining stages..
76 GF_gen: FOR i IN 1 TO (K-1) GENERATE
79 stageOut(i)((POL_BW+SYMB_BITWIDTH-1) downto POL_BW) <= msg(((1+i)*SYMB_BITWIDTH)-1 downto i*SYMB_BITWIDTH) xor stageOut(i-1)((SYMB_BITWIDTH*(P-1)+SYMB_BITWIDTH)-1 downto SYMB_BITWIDTH*(P-1));
81 -- The GF multiplication units
82 multOut(i)(2) <= stageOut(i)(POL_BW+1);
83 multOut(i)(1) <= stageOut(i)(POL_BW) xor stageOut(i)(POL_BW+2);
84 multOut(i)(0) <= stageOut(i)(POL_BW+2);
86 multOut(i)(3) <= stageOut(i)(POL_BW+2) xor stageOut(i)(POL_BW+0);
87 multOut(i)(4) <= stageOut(i)(POL_BW+1) xor stageOut(i)(POL_BW+0) xor stageOut(i)(POL_BW+2);
88 multOut(i)(5) <= stageOut(i)(POL_BW+2) xor stageOut(i)(POL_BW+1);
90 GF_internal_gen: FOR j IN 1 TO (P-1) GENERATE
92 stageOut(i)(((j+1)*SYMB_BITWIDTH)-1 downto SYMB_BITWIDTH*j) <= multOut(i)(((j+1)*SYMB_BITWIDTH)-1 downto SYMB_BITWIDTH*j) xor stageOut(i-1)((j*SYMB_BITWIDTH)-1 downto SYMB_BITWIDTH*(j-1));
99 Parity_gen: FOR l IN 0 TO (P-1) GENERATE
100 parity(((l+1)*SYMB_BITWIDTH)-1 downto l*SYMB_BITWIDTH) <= stageOut(K-1)((STG_BW-(l+1)*SYMB_BITWIDTH)-1 downto STG_BW-(l+2)*SYMB_BITWIDTH);
104 --=================================================================================================--
105 --#################################################################################################--
106 --=================================================================================================--
in msgstd_logic_vector%(%(K%*%SYMB_BITWIDTH)%-%1%%%downto%%%0%)
Message to be encoded.
rs_encoder_N7K5 - N7K5 Reed-Solomon encoder
_library_ ieeeieee
Include the IEEE VHDL standard LIBRARY.
out paritystd_logic_vector%(%((N%-%K)%*%SYMB_BITWIDTH)%-%1%%%downto%%%0%)
FEC output.