OpenCores
URL https://opencores.org/ocsvn/core1990_interlaken/core1990_interlaken/trunk

Subversion Repositories core1990_interlaken

[/] [core1990_interlaken/] [trunk/] [gateware/] [simulation/] [interlaken_transmitter_tb.vhd] - Diff between revs 6 and 9

Only display areas with differences | Details | Blame | View Log

Rev 6 Rev 9
library ieee;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_1164.all;
 
 
entity testbench_interlaken_transmitter is
entity testbench_interlaken_transmitter is
end entity testbench_interlaken_transmitter;
end entity testbench_interlaken_transmitter;
 
 
architecture tb_interlaken_transmitter of testbench_interlaken_transmitter is
architecture tb_interlaken_transmitter of testbench_interlaken_transmitter is
 
 
        signal write_clk   : std_logic;
        signal write_clk   : std_logic;
        signal clk   : std_logic;
        signal clk   : std_logic;
        signal reset : std_logic;
        signal reset : std_logic;
 
 
        signal TX_Data_In       : std_logic_vector(63 downto 0);
        signal TX_Data_In       : std_logic_vector(63 downto 0);
        signal TX_Data_Out : std_logic_vector (66 downto 0); -- later 66 downto 0
        signal TX_Data_Out : std_logic_vector (66 downto 0); -- later 66 downto 0
 
 
        signal TX_Enable        : std_logic;                         -- Enable the TX
 
        signal TX_SOP           : std_logic;                         -- Start of Packet
        signal TX_SOP           : std_logic;                         -- Start of Packet
        signal TX_ValidBytes    : std_logic_vector(2 downto 0);      -- Valid bytes packet contains
        signal TX_EOP_Valid     : std_logic_vector(2 downto 0);      -- Valid bytes packet contains
        signal TX_EOP           : std_logic;                         -- End of Packet
        signal TX_EOP           : std_logic;                         -- End of Packet
        signal TX_FlowControl   : std_logic_vector(15 downto 0);     -- Flow control data (yet unutilized)
 
        signal TX_Channel       : std_logic_vector(7 downto 0);      -- Select transmit channel (yet unutilized)
        signal TX_Channel       : std_logic_vector(7 downto 0);      -- Select transmit channel (yet unutilized)
 
        signal TX_Gearboxready  : std_logic;
 
        signal TX_Startseq      : std_logic;
 
 
        signal TX_Link_Up       : std_logic;
        signal TX_FlowControl   : std_logic_vector(15 downto 0);
 
        signal RX_prog_full     : std_logic_vector(15 downto 0);
 
 
        signal TX_Valid_Out     : std_logic;
        signal FIFO_Write_Data : std_logic;
        signal TX_Control_Out   : std_logic;
    signal FIFO_prog_full  : std_logic;
 
    signal FIFO_Full       : std_logic;
 
 
 
    signal Link_up         : std_logic;
 
    signal TX_valid_out    : std_logic;
 
 
constant CLK_PERIOD : time := 10 ns;
    constant CLK_PERIOD : time := 10 ns;
 
 
begin
begin
  uut : entity work.interlaken_transmitter
    uut : entity work.interlaken_transmitter
  port map (
    port map (
    write_clk => write_clk,
        write_clk   => write_clk,
    clk => clk,
        clk         => clk,
    reset => reset,
    reset => reset,
 
 
    TX_Data_In => TX_Data_In,
    TX_Data_In => TX_Data_In,
    TX_Data_Out => TX_Data_Out,
    TX_Data_Out => TX_Data_Out,
    TX_Enable => TX_Enable,
 
    TX_SOP => TX_SOP,
    TX_SOP => TX_SOP,
        TX_ValidBytes => TX_ValidBytes,
        TX_EOP_Valid=> TX_ValidBytes,
        TX_EOP => TX_EOP,
        TX_EOP => TX_EOP,
        TX_FlowControl => TX_FlowControl,
 
        TX_Channel => TX_Channel,
        TX_Channel => TX_Channel,
 
        TX_Gearboxready => TX_Gearboxready,
 
        TX_Startseq => TX_Startseq,
 
 
 
        TX_FlowControl => TX_FlowControl,
 
        RX_prog_full   => RX_prog_full,
 
 
 
        FIFO_Write_Data => FIFO_Write_Data,
 
        FIFO_prog_full  => FIFO_prog_full,
 
        FIFO_Full       => FIFO_Full,
 
 
        TX_Link_Up => TX_Link_Up,
        Link_up         => Link_up,
        TX_Valid_Out => TX_Valid_Out,
        TX_valid_out    => TX_valid_out
        TX_Control_Out => TX_Control_Out
 
  );
  );
 
 
   Clk_process :process
    Clk_process :process
     begin
    begin
          write_clk <= '1';
        write_clk <= '1';
          clk <= '1';
        clk <= '1';
          wait for CLK_PERIOD/2;  --for half of clock period clk stays at '0'.
        wait for CLK_PERIOD/2;  --for half of clock period clk stays at '0'.
          clk <= '0';
        clk <= '0';
          write_clk <= '0';
        write_clk <= '0';
          wait for CLK_PERIOD/2;  --for next half of clock period clk stays at '1'.
        wait for CLK_PERIOD/2;  --for next half of clock period clk stays at '1'.
     end process;
    end process;
 
 
    simulation : process
    simulation : process
    begin
    begin
        wait for 1 ps;
        wait for 1 ps;
        TX_Enable <= '0';
        TX_Enable <= '0';
        TX_EOP <= '0';
        TX_EOP <= '0';
        TX_SOP <= '0';
        TX_SOP <= '0';
        TX_Channel <= X"01";
        TX_Channel <= X"01";
        TX_ValidBytes <= "111";
        TX_ValidBytes <= "111";
        TX_data_in <= (others=>'0');
        TX_data_in <= (others=>'0');
        reset <= '1';
        reset <= '1';
        TX_FlowControl <= (others => '0');
        TX_FlowControl <= (others => '0');
 
 
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
 
 
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
        --FIFO_meta <= '1';
        --FIFO_meta <= '1';
        reset <= '0';
        reset <= '0';
        TX_Enable <= '1';
        TX_Enable <= '1';
        TX_Data_in <= X"1f5e5d5c5b5a5958";
        TX_Data_in <= X"1f5e5d5c5b5a5958";
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
 
 
 
 
        wait for CLK_PERIOD*10;
        wait for CLK_PERIOD*10;
        TX_SOP <= '1';
        TX_SOP <= '1';
        TX_EOP <= '1';
        TX_EOP <= '1';
        TX_Data_in <= X"2f5e5d5c5b5a5958";
        TX_Data_in <= X"2f5e5d5c5b5a5958";
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
 
 
        TX_EOP <= '0';
        TX_EOP <= '0';
        TX_data_in <= X"3f5e5d5c5b5a5958";
        TX_data_in <= X"3f5e5d5c5b5a5958";
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
 
 
 
 
               TX_SOP <= '0';
               TX_SOP <= '0';
               TX_EOP <= '0';
               TX_EOP <= '0';
        TX_EOP <= '0';
        TX_EOP <= '0';
        --reset <= '1';
        --reset <= '1';
        TX_Data_in <= X"4f21a2a3a4a5a6a7";
        TX_Data_in <= X"4f21a2a3a4a5a6a7";
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
        TX_FlowControl(0) <= '1';
        TX_FlowControl(0) <= '1';
        TX_SOP <= '1';
        TX_SOP <= '1';
        TX_data_in <= X"5f5e5a5c5b60f2a0";
        TX_data_in <= X"5f5e5a5c5b60f2a0";
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
 
 
        TX_SOP <= '0';
        TX_SOP <= '0';
        TX_EOP <= '1';
        TX_EOP <= '1';
        TX_data_in  <= X"635e22a3a4a5a7a7";
        TX_data_in  <= X"635e22a3a4a5a7a7";
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
 
 
        TX_EOP <= '0';
        TX_EOP <= '0';
        --TX_SOP <= '1';
        --TX_SOP <= '1';
        TX_data_in  <= X"70000FFF000000F0";
        TX_data_in  <= X"70000FFF000000F0";
        wait for CLK_PERIOD*2;
        wait for CLK_PERIOD*2;
 
 
        TX_SOP <= '1';
        TX_SOP <= '1';
        TX_Data_in <= X"2f5e5d5c5b5a5958";
        TX_Data_in <= X"2f5e5d5c5b5a5958";
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
 
 
        TX_SOP <= '0';
        TX_SOP <= '0';
        TX_EOP <= '1';
        TX_EOP <= '1';
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
 
 
        TX_EOP <= '0';
        TX_EOP <= '0';
        --TX_SOP <= '0';
 
        TX_data_in  <= X"8050505050050505";
        TX_data_in  <= X"8050505050050505";
        --wait for CLK_PERIOD*3;                          
 
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
 
 
        TX_data_in  <= X"9486576758050505";
        TX_data_in  <= X"9486576758050505";
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
 
 
        TX_EOP <= '1';
        TX_EOP <= '1';
        TX_data_in <= X"60b35d5dc4a582a7";
        TX_data_in <= X"60b35d5dc4a582a7";
        wait for CLK_PERIOD; --Test influencing pause state position
        wait for CLK_PERIOD; --Test influencing pause state position
 
 
        TX_EOP <= '0';
        TX_EOP <= '0';
        wait for CLK_period*16;
        wait for CLK_period*16;
 
 
        TX_SOP <= '1';
        TX_SOP <= '1';
        TX_Data_in <= X"4f21a2a3a4a5a6a7";
        TX_Data_in <= X"4f21a2a3a4a5a6a7";
        --wait for CLK_PERIOD;
        --wait for CLK_PERIOD;
 
 
        TX_data_in <= X"995e5a5c5b60f2a0";
        TX_data_in <= X"995e5a5c5b60f2a0";
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
 
 
        TX_data_in  <= X"635e22a3a4a5a7a7";
        TX_data_in  <= X"635e22a3a4a5a7a7";
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
 
 
        TX_data_in  <= X"70000FFF000000F0";
        TX_data_in  <= X"70000FFF000000F0";
        wait for CLK_PERIOD*2;
        wait for CLK_PERIOD*2;
 
 
        TX_Data_in <= X"2f5e5d5c5b5a5958";
        TX_Data_in <= X"2f5e5d5c5b5a5958";
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
 
 
        TX_Data_in <= X"4f21a2a3a4a5a6a7";
        TX_Data_in <= X"4f21a2a3a4a5a6a7";
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
 
 
        TX_data_in <= X"5f5e5a5c5b60f2a0";
        TX_data_in <= X"5f5e5a5c5b60f2a0";
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
 
 
        TX_data_in  <= X"635e22a3a4a5a7a7";
        TX_data_in  <= X"635e22a3a4a5a7a7";
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
 
 
        TX_data_in  <= X"70000FFF000000F0";
        TX_data_in  <= X"70000FFF000000F0";
        wait for CLK_PERIOD*2;
        wait for CLK_PERIOD*2;
 
 
 
 
        TX_data_in <= X"2f5e5d5c5b5a5958";
        TX_data_in <= X"2f5e5d5c5b5a5958";
        wait for CLK_PERIOD*12;
        wait for CLK_PERIOD*12;
 
 
        TX_Data_in <= X"4f5e5d5c5b5a5958";
        TX_Data_in <= X"4f5e5d5c5b5a5958";
        wait for CLK_PERIOD;
        wait for CLK_PERIOD;
 
 
        TX_SOP <= '0';
        TX_SOP <= '0';
        TX_EOP <= '1';
        TX_EOP <= '1';
        wait for CLK_PERIOD;
 
 
 
        --FIFO_meta <= '0';
 
        wait for CLK_PERIOD*4;
 
        --FIFO_meta <= '1';
 
        wait;
        wait;
    end process;
    end process;
 
 
end architecture tb_interlaken_transmitter;
end architecture tb_interlaken_transmitter;
 
 
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.