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

Subversion Repositories core1990_interlaken

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

Show entire file | Details | Blame | View Log

Rev 6 Rev 9
Line 1... Line 1...
--
 
-- This file is an automatically generated VHDL testbench
 
-- by MakeTestBench (version 1.702)
 
-- 
 
-- Created on     :  01 March 2018
 
--
 
-- Tested entity        :  interlaken_scrambler
 
-- Tested entity from   :  scrambler_interlaken.vhd
 
--
 
library ieee;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_1164.all;
 
 
entity testbench_scrambler is
entity testbench_scrambler is
end entity testbench_scrambler;
end entity testbench_scrambler;
 
 
architecture tb_interlaken_scrambler of testbench_scrambler is
architecture tb_interlaken_scrambler of testbench_scrambler is
  component Scrambler is
 
    port (
 
      clk : in std_logic;
 
      Scram_Rst : in std_logic;
 
      lane_number : in std_logic_vector(3 downto 0);
 
      Data_Control_In : in std_logic;
 
      Data_Control_Out: out std_logic;
 
      data_in : in std_logic_vector(63 downto 0);
 
      scram_en : in std_logic;
 
      data_out : out std_logic_vector(63 downto 0);
 
      Data_Valid_Out : out std_logic
 
    );
 
  end component Scrambler;
 
 
 
  for uut : Scrambler use entity work.Scrambler(behavior);
    signal Clk                          : std_logic := '1';      -- System clock
 
    signal Scram_Rst        : std_logic := '1';  -- Scrambler reset, use for initialization
 
 
 
    signal Data_In          : std_logic_vector (63 downto 0);-- Data input
 
    signal Data_Out         : std_logic_vector (63 downto 0);-- Data output
 
 
  signal clk : std_logic := '1';
    signal Lane_Number      : std_logic_vector (3 downto 0); -- Each lane number starts with different scrambler word  
  signal Scram_Rst : std_logic := '1';
    signal Scrambler_En     : std_logic;                     -- Input valid
  signal lane_number : std_logic_vector(3 downto 0) := "0001";
    signal Data_Control_In  : std_logic;                     -- Indicates a control word
  signal Data_Control_In : std_logic;
    signal Data_Control_Out : std_logic;                     -- Output control word indication
  signal Data_Control_Out : std_logic;
 
  signal data_in : std_logic_vector(63 downto 0);
    signal Data_Valid_In    : std_logic;                     -- Input valid
  signal scram_en : std_logic := '0';
    signal Data_Valid_Out   : std_logic;                     -- Output valid
  signal data_out : std_logic_vector(63 downto 0);
    signal Gearboxready     : std_logic;
  signal Data_Valid_Out : std_logic := '0';
 
 
 
constant CLK_PERIOD : time := 10 ns;
constant CLK_PERIOD : time := 10 ns;
 
 
begin
begin
  uut : Scrambler port map (
    uut : entity work.Scrambler
 
    port map (
    clk => clk,
    clk => clk,
    Scram_Rst => Scram_Rst,
    Scram_Rst => Scram_Rst,
    lane_number => lane_number,
    lane_number => lane_number,
    Data_Control_In => Data_Control_In,
    Data_Control_In => Data_Control_In,
    Data_Control_Out => Data_Control_Out,
    Data_Control_Out => Data_Control_Out,
Line 64... Line 46...
   end process;
   end process;
 
 
  simulation : process
  simulation : process
  begin
  begin
     wait for 1 ps;
     wait for 1 ps;
 
        Data_Valid_Out <= '0';
 
        Lane_number <= "0001";
     data_in <= (others=>'0');
     data_in <= (others=>'0');
     wait for CLK_PERIOD;
        wait for CLK_PERIOD*2;
 
 
     wait for CLK_PERIOD;
 
 
 
     Scram_Rst <= '0';
     Scram_Rst <= '0';
     scram_en <= '1';
     scram_en <= '1';
     data_in <= X"5f5e5d5c5b5a5958";
     data_in <= X"5f5e5d5c5b5a5958";
     wait for CLK_PERIOD;
     wait for CLK_PERIOD;

powered by: WebSVN 2.1.0

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