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

Subversion Repositories core1990_interlaken

[/] [core1990_interlaken/] [trunk/] [gateware/] [simulation/] [scrambler_tb.vhd] - Blame information for rev 8

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 6 N.Boukadid
--
2
-- This file is an automatically generated VHDL testbench
3
-- by MakeTestBench (version 1.702)
4
-- 
5
-- Created on     :  01 March 2018
6
--
7
-- Tested entity        :  interlaken_scrambler
8
-- Tested entity from   :  scrambler_interlaken.vhd
9
--
10
library ieee;
11
use ieee.std_logic_1164.all;
12
 
13
entity testbench_scrambler is
14
end entity testbench_scrambler;
15
 
16
architecture tb_interlaken_scrambler of testbench_scrambler is
17
  component Scrambler is
18
    port (
19
      clk : in std_logic;
20
      Scram_Rst : in std_logic;
21
      lane_number : in std_logic_vector(3 downto 0);
22
      Data_Control_In : in std_logic;
23
      Data_Control_Out: out std_logic;
24
      data_in : in std_logic_vector(63 downto 0);
25
      scram_en : in std_logic;
26
      data_out : out std_logic_vector(63 downto 0);
27
      Data_Valid_Out : out std_logic
28
    );
29
  end component Scrambler;
30
 
31
  for uut : Scrambler use entity work.Scrambler(behavior);
32
 
33
  signal clk : std_logic := '1';
34
  signal Scram_Rst : std_logic := '1';
35
  signal lane_number : std_logic_vector(3 downto 0) := "0001";
36
  signal Data_Control_In : std_logic;
37
  signal Data_Control_Out : std_logic;
38
  signal data_in : std_logic_vector(63 downto 0);
39
  signal scram_en : std_logic := '0';
40
  signal data_out : std_logic_vector(63 downto 0);
41
  signal Data_Valid_Out : std_logic := '0';
42
 
43
constant CLK_PERIOD : time := 10 ns;
44
 
45
begin
46
  uut : Scrambler port map (
47
    clk => clk,
48
    Scram_Rst => Scram_Rst,
49
    lane_number => lane_number,
50
    Data_Control_In => Data_Control_In,
51
    Data_Control_Out => Data_Control_Out,
52
    data_in => data_in,
53
    scram_en => scram_en,
54
    data_out => data_out,
55
    Data_Valid_Out => Data_Valid_Out
56
  );
57
 
58
   Clk_process :process
59
   begin
60
        clk <= '1';
61
        wait for CLK_PERIOD/2;  --for half of clock period clk stays at '0'.
62
        clk <= '0';
63
        wait for CLK_PERIOD/2;  --for next half of clock period clk stays at '1'.
64
   end process;
65
 
66
  simulation : process
67
  begin
68
     wait for 1 ps;
69
     data_in <= (others=>'0');
70
     wait for CLK_PERIOD;
71
 
72
     wait for CLK_PERIOD;
73
 
74
     Scram_Rst <= '0';
75
     scram_en <= '1';
76
     data_in <= X"5f5e5d5c5b5a5958";
77
     wait for CLK_PERIOD;
78
 
79
     Data_Control_In <= '1';
80
     Data_In <= X"78f678f678f678f6";
81
     wait for CLK_PERIOD;
82
 
83
     Data_Control_In <= '0';
84
     data_in <= X"2f5e5d5c5b5a5958";
85
     wait for CLK_PERIOD;
86
 
87
     data_in <= X"9f5e5d5c5b5a5958";
88
     wait for CLK_PERIOD*2;
89
 
90
     data_in <= X"bf21a2a3a4a5a6a7";
91
     Scram_Rst <= '1';
92
     wait for CLK_PERIOD;
93
 
94
     Scram_Rst <='0';
95
     wait for CLK_PERIOD;
96
 
97
     data_in <= X"2f5e5a5c5b60f2a0";
98
     wait for CLK_PERIOD;
99
 
100
     data_in  <= X"635e22a3a4a5a7a7";
101
     wait for CLK_PERIOD;
102
 
103
     data_in <= X"60b35d5dc4a582a7";
104
     wait for CLK_PERIOD;
105
 
106
     data_in <= X"2f5e5d5c5b5a5958";
107
     wait for CLK_PERIOD;
108
 
109
     Data_Control_In <= '1';
110
     Data_In <= X"78f678f678f678f6";
111
     wait for CLK_PERIOD;
112
 
113
     Data_Control_In <= '0';
114
     wait for CLK_PERIOD;
115
 
116
     wait for CLK_PERIOD;
117
 
118
     wait;
119
  end process;
120
 
121
end architecture tb_interlaken_scrambler;
122
 

powered by: WebSVN 2.1.0

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