Line 4... |
Line 4... |
entity testbench_interlaken_receiver is
|
entity testbench_interlaken_receiver is
|
end entity testbench_interlaken_receiver;
|
end entity testbench_interlaken_receiver;
|
|
|
architecture tb_interlaken_receiver of testbench_interlaken_receiver is
|
architecture tb_interlaken_receiver of testbench_interlaken_receiver is
|
|
|
signal write_clk : std_logic;
|
signal fifo_read_clk : std_logic;
|
signal clk : std_logic;
|
signal clk : std_logic;
|
signal reset : std_logic;
|
signal reset : std_logic;
|
|
|
signal RX_Data_In : std_logic_vector(66 downto 0);
|
signal RX_Data_In : std_logic_vector(66 downto 0);
|
signal RX_Data_Out : std_logic_vector (63 downto 0); -- later 66 downto 0
|
signal RX_Data_Out : std_logic_vector (63 downto 0); -- Data ready to transmit
|
|
|
|
signal RX_Valid_Out : std_logic;
|
|
|
signal RX_Enable : std_logic; -- Enable the TX
|
|
signal RX_SOP : std_logic; -- Start of Packet
|
signal RX_SOP : std_logic; -- Start of Packet
|
signal RX_ValidBytes : std_logic_vector(2 downto 0); -- Valid bytes packet contains
|
signal RX_EOP_Valid : std_logic_vector(2 downto 0); -- Valid bytes packet contains
|
signal RX_EOP : std_logic; -- End of Packet
|
signal RX_EOP : std_logic; -- End of Packet
|
signal RX_FlowControl : std_logic_vector(15 downto 0); -- Flow control data (yet unutilized)
|
signal RX_FlowControl : std_logic_vector(15 downto 0); -- Flow control data (yet unutilized)
|
|
signal RX_prog_full : std_logic_vector(15 downto 0); -- Indication FIFO of this channel is full
|
signal RX_Channel : std_logic_vector(7 downto 0); -- Select transmit channel (yet unutilized)
|
signal RX_Channel : std_logic_vector(7 downto 0); -- Select transmit channel (yet unutilized)
|
|
signal RX_Datavalid : std_logic;
|
|
|
|
signal CRC24_Error : std_logic;
|
|
signal CRC32_Error : std_logic;
|
|
signal Decoder_lock : std_logic;
|
|
signal Descrambler_lock : std_logic;
|
|
|
|
signal Data_Descrambler : std_logic_vector(63 downto 0);
|
|
signal Data_Decoder : std_logic_vector(63 downto 0);
|
|
|
|
signal RX_FIFO_Full : std_logic;
|
|
signal RX_FIFO_Read : std_logic;
|
|
|
signal RX_Link_Up : std_logic;
|
signal RX_Link_Up : std_logic;
|
|
signal Bitslip : std_logic;
|
|
|
constant CLK_PERIOD : time := 10 ns;
|
constant CLK_PERIOD : time := 10 ns;
|
|
|
begin
|
begin
|
uut : entity work.interlaken_receiver
|
uut : entity work.interlaken_receiver
|
Line 55... |
Line 70... |
simulation : process
|
simulation : process
|
begin
|
begin
|
wait for 1 ps;
|
wait for 1 ps;
|
RX_Data_In <= (others=>'0');
|
RX_Data_In <= (others=>'0');
|
reset <= '1';
|
reset <= '1';
|
|
wait for CLK_PERIOD*2;
|
|
|
|
|
wait for CLK_PERIOD;
|
|
|
|
wait for CLK_PERIOD;
|
|
--FIFO_meta <= '1';
|
|
reset <= '0';
|
reset <= '0';
|
reset <= '0';
|
reset <= '0';
|
RX_Data_in <= "101" & X"1f5e5d5c5b5a5958";
|
RX_Data_in <= "101" & X"1f5e5d5c5b5a5958";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
|
|
RX_Data_In <= "101" & X"2f5e5d5c5b5a5958";
|
RX_Data_In <= "101" & X"2f5e5d5c5b5a5958";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
|
|
RX_Data_In <= "101" & X"3f5e5d5c5b5a5958";
|
RX_Data_In <= "101" & X"3f5e5d5c5b5a5958";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
|
|
RX_Data_In <= "101" & X"4f21a2a3a4a5a6a7";
|
RX_Data_In <= "101" & X"4f21a2a3a4a5a6a7";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
|
|
RX_Data_In <= "101" & X"5f5e5a5c5b60f2a0";
|
RX_Data_In <= "101" & X"5f5e5a5c5b60f2a0";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
RX_Data_In <= "001" & X"635e22a3a4a5a7a7";
|
RX_Data_In <= "001" & X"635e22a3a4a5a7a7";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
Line 90... |
Line 97... |
RX_Data_In <= "101" & X"70000FFF000000F0";
|
RX_Data_In <= "101" & X"70000FFF000000F0";
|
wait for CLK_PERIOD*2;
|
wait for CLK_PERIOD*2;
|
|
|
|
|
RX_Data_In <= "101" & X"2f5e5d5c5b5a5958";
|
RX_Data_In <= "101" & X"2f5e5d5c5b5a5958";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD*2;
|
|
|
wait for CLK_PERIOD;
|
|
|
|
|
|
RX_Data_In <= "110" & X"8050505050050505";
|
RX_Data_In <= "110" & X"8050505050050505";
|
wait for CLK_PERIOD*3;
|
wait for CLK_PERIOD*3;
|
|
|
RX_Data_In <= "101" & X"9486576758050505";
|
RX_Data_In <= "101" & X"9486576758050505";
|
Line 169... |
Line 173... |
|
|
|
|
RX_Data_In <= "101" & X"4f21a2a3a4a5a6a7";
|
RX_Data_In <= "101" & X"4f21a2a3a4a5a6a7";
|
wait for CLK_PERIOD*20;
|
wait for CLK_PERIOD*20;
|
|
|
|
|
RX_Data_In <= "101" & X"5f5e5a5c5b60f2a0";
|
RX_Data_In <= "101" & X"5f5e5a5c5b60f2a0";
|
wait for CLK_PERIOD*10;
|
wait for CLK_PERIOD*10;
|
|
|
RX_Data_In <= "001" & X"635e22a3a4a5a7a7";
|
RX_Data_In <= "001" & X"635e22a3a4a5a7a7";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
Line 188... |
Line 191... |
wait for CLK_PERIOD*6;
|
wait for CLK_PERIOD*6;
|
|
|
RX_Data_In <= "001" & X"8050505050050505";
|
RX_Data_In <= "001" & X"8050505050050505";
|
wait for CLK_PERIOD*9;
|
wait for CLK_PERIOD*9;
|
|
|
|
|
RX_Data_In <= "101" & X"2f5e5d5c5b5a5958";
|
RX_Data_In <= "101" & X"2f5e5d5c5b5a5958";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
RX_Data_In <= "110" & X"8050505050050505";
|
RX_Data_In <= "110" & X"8050505050050505";
|
wait for CLK_PERIOD*3;
|
wait for CLK_PERIOD*3;
|
Line 219... |
Line 221... |
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
RX_Data_In <= "001" & X"70000FFF000000F0";
|
RX_Data_In <= "001" & X"70000FFF000000F0";
|
wait for CLK_PERIOD*23;
|
wait for CLK_PERIOD*23;
|
|
|
|
|
|
|
RX_Data_In <= "010" & X"78f6_78f6_78f6_78f6";--4 -> lock
|
RX_Data_In <= "010" & X"78f6_78f6_78f6_78f6";--4 -> lock
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
RX_Data_In <= "001" & X"5f5e5a5c5b60f2a0";
|
RX_Data_In <= "001" & X"5f5e5a5c5b60f2a0";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
Line 271... |
Line 271... |
RX_Data_In <= "001" & X"9486576758050505";
|
RX_Data_In <= "001" & X"9486576758050505";
|
wait for CLK_PERIOD*19;
|
wait for CLK_PERIOD*19;
|
|
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
|
|
RX_Data_In <= "001" & X"8050505050050505";
|
RX_Data_In <= "001" & X"8050505050050505";
|
wait for CLK_PERIOD*3;
|
wait for CLK_PERIOD*3;
|
|
|
RX_Data_In <= "001" & X"9486576758050505";
|
RX_Data_In <= "001" & X"9486576758050505";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
|
|
RX_Data_In <= "001" & X"60b35d5dc4a582a7";
|
RX_Data_In <= "001" & X"60b35d5dc4a582a7";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
|
|
RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
|
RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
|
wait for CLK_PERIOD*12;
|
wait for CLK_PERIOD*12;
|
|
|
RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
|
RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
Line 296... |
Line 293... |
|
|
|
|
RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
|
RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
|
|
RX_Data_In <= "001" & X"3f5e5d5c5b5a5958";
|
RX_Data_In <= "001" & X"3f5e5d5c5b5a5958";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
|
|
RX_Data_In <= "001" & X"4f21a2a3a4a5a6a7";
|
RX_Data_In <= "001" & X"4f21a2a3a4a5a6a7";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
|
|
RX_Data_In <= "001" & X"5f5e5a5c5b60f2a0";
|
RX_Data_In <= "001" & X"5f5e5a5c5b60f2a0";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
RX_Data_In <= "001" & X"635e22a3a4a5a7a7";
|
RX_Data_In <= "001" & X"635e22a3a4a5a7a7";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
Line 320... |
Line 314... |
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
RX_Data_In <= "001" & X"70000FFF000000F0";
|
RX_Data_In <= "001" & X"70000FFF000000F0";
|
wait for CLK_PERIOD*2;
|
wait for CLK_PERIOD*2;
|
|
|
|
|
RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
|
RX_Data_In <= "001" & X"2f5e5d5c5b5a5958";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
RX_Data_In <= "001" & X"8050505050050505";
|
RX_Data_In <= "001" & X"8050505050050505";
|
wait for CLK_PERIOD*3;
|
wait for CLK_PERIOD*3;
|
Line 339... |
Line 332... |
wait for CLK_PERIOD*3;
|
wait for CLK_PERIOD*3;
|
|
|
RX_Data_In <= "001" & X"9486576758050505";
|
RX_Data_In <= "001" & X"9486576758050505";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
|
|
RX_Data_In <= "001" & X"60b35d5dc4a582a7";
|
RX_Data_In <= "001" & X"60b35d5dc4a582a7";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
|
|
RX_Data_In <= "101" & X"60b35d5dc4a582a7";
|
RX_Data_In <= "101" & X"60b35d5dc4a582a7";
|
wait for CLK_PERIOD*60;
|
wait for CLK_PERIOD*60;
|
|
|
RX_Data_In <= "110" & X"8050505050050505";
|
RX_Data_In <= "110" & X"8050505050050505";
|
wait for CLK_PERIOD*3;
|
wait for CLK_PERIOD*3;
|
|
|
RX_Data_In <= "101" & X"9486576758050505";
|
RX_Data_In <= "101" & X"9486576758050505";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
|
|
RX_Data_In <= "101" & X"60b35d5dc4a582a7";
|
RX_Data_In <= "101" & X"60b35d5dc4a582a7";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
|
|
|
|
RX_Data_In <= "101" & X"2f5e5d5c5b5a5958";
|
RX_Data_In <= "101" & X"2f5e5d5c5b5a5958";
|
wait for CLK_PERIOD*12;
|
wait for CLK_PERIOD*12;
|
|
|
RX_Data_In <= "111" & X"2c8e5d5c5b5a5958";
|
RX_Data_In <= "111" & X"2c8e5d5c5b5a5958";
|
wait for CLK_PERIOD;
|
wait for CLK_PERIOD;
|
Line 371... |
Line 360... |
|
|
RX_Data_In <= "111" & X"2c8e5d5c5b5a5958";
|
RX_Data_In <= "111" & X"2c8e5d5c5b5a5958";
|
wait for CLK_PERIOD*18;
|
wait for CLK_PERIOD*18;
|
|
|
RX_Data_In <= "101" & X"1f5e5d5c5b5a5958";
|
RX_Data_In <= "101" & X"1f5e5d5c5b5a5958";
|
wait for CLK_PERIOD;
|
|
wait;
|
|
--FIFO_meta <= '0';
|
|
wait for CLK_PERIOD*4;
|
|
--FIFO_meta <= '1';
|
|
wait;
|
wait;
|
|
|
end process;
|
end process;
|
|
|
end architecture tb_interlaken_receiver;
|
end architecture tb_interlaken_receiver;
|
|
|
|
|