lpgbtfpga_scrambler.vhd
Go to the documentation of this file.
1 -------------------------------------------------------
6 -------------------------------------------------------
7 
9 LIBRARY ieee;
10 USE ieee.std_logic_1164.all;
11 
13 USE work.lpgbtfpga_package.all;
14 
17  GENERIC (
18  INIT_SEED : in std_logic_vector(35 downto 0) := x"1fba847af"
19  );
20  PORT (
21  -- Clocks & reset
22  clk_i : in std_logic;
23  clkEn_i : in std_logic;
24 
25  reset_i : in std_logic;
26 
27  -- Data
28  data_i : in std_logic_vector(35 downto 0);
29  data_o : out std_logic_vector(35 downto 0);
30 
31  -- Control
32  bypass : in std_logic
33  );
34 END lpgbtfpga_scrambler;
35 
37 ARCHITECTURE behavioral OF lpgbtfpga_scrambler IS
38 
39  SIGNAL scrambledData : std_logic_vector(35 downto 0);
40 
41 BEGIN --========#### Architecture Body ####========--
42 
43  -- Scrambler output register
44  reg_proc: PROCESS(clk_i)
45  BEGIN
46 
47  IF rising_edge(clk_i) THEN
48  IF reset_i = '1' THEN
49  scrambledData <= INIT_SEED;
50 
51  ELSIF clkEn_i = '1' THEN
52  scrambledData(35 downto 25) <= data_i(35 downto 25) xnor
53  data_i(10 downto 0) xnor
54  scrambledData(21 downto 11) xnor
55  scrambledData(10 downto 0) xnor
56  scrambledData(35 downto 25);
57 
58 
59  scrambledData(24 downto 0) <= data_i(24 downto 0) xnor
60  scrambledData(35 downto 11) xnor
61  scrambledData(24 downto 0);
62 
63  END IF;
64 
65  END IF;
66 
67  END PROCESS;
68 
69  data_o <= scrambledData WHEN bypass = '0' ELSE
70  data_i;
71 
72 END behavioral;
73 --=================================================================================================--
74 --#################################################################################################--
75 --=================================================================================================--
_library_ ieeeieee
Include the IEEE VHDL standard LIBRARY.
lpgbtfpga_scrambler - 36bit Order 36 scrambler