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

Subversion Repositories core1990_interlaken

[/] [core1990_interlaken/] [trunk/] [gateware/] [simulation/] [framing_meta_tb.vhd] - Blame information for rev 7

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

Line No. Rev Author Line
1 6 N.Boukadid
library ieee;
2
use ieee.std_logic_1164.all;
3
 
4
entity testbench_meta is
5
end entity testbench_meta;
6
 
7
architecture tb_meta of testbench_meta is
8
 
9
signal clk                              : std_logic;                                -- System clock
10
signal reset                    : std_logic;                                -- Reset, use for initialization.
11
 
12
signal TX_Enable : std_logic;
13
signal HealthLane : std_logic := '0';
14
signal HealthInterface : std_logic := '0';
15
 
16
signal Data_in : std_logic_vector(63 downto 0);         -- Input data
17
signal Data_out : std_logic_vector(63 downto 0);       -- To scrambling/framing
18
signal Data_valid_in : std_logic;                                               -- Indicate data transmitted is valid
19
signal Data_valid_out : std_logic;                                              -- Indicate data transmitted is valid
20
signal Data_Control_In  : std_logic;
21
signal Data_control_out : std_logic;                   -- Control word indication
22
 
23
signal Gearboxready : std_logic;
24
 
25
signal FIFO_read : std_logic;                                           -- Request data from the FIFO
26
 
27
constant CLK_PERIOD : time := 10 ns;
28
 
29
begin
30
  uut : entity work.metaframing
31
  port map (
32
    clk => clk,
33
    reset => reset,
34
    TX_Enable => TX_Enable,
35
    HealthLane => HealthLane,
36
    HealthInterface => HealthInterface,
37
    Data_in => Data_in,
38
    Data_out => Data_out,
39
    Data_valid_in => Data_valid_in,
40
    Data_valid_out => Data_valid_out,
41
    Data_control_in => Data_control_in,
42
    Data_control_out => Data_control_out,
43
    Gearboxready => Gearboxready,
44
    FIFO_read => FIFO_read
45
  );
46
 
47
   Clk_process :process
48
     begin
49
          clk <= '1';
50
          wait for CLK_PERIOD/2;  --for half of clock period clk stays at '0'.
51
          clk <= '0';
52
          wait for CLK_PERIOD/2;  --for next half of clock period clk stays at '1'.
53
     end process;
54
 
55
    simulation : process
56
    begin
57
       wait for 1 ps;
58
 
59
       reset <= '1';
60
       data_in <= (others=>'0');
61
 
62
       wait for CLK_PERIOD;
63
 
64
       wait for CLK_PERIOD;
65
 
66
       Gearboxready <= '1';
67
       reset <= '0';
68
       TX_Enable <= '1';
69
       Data_valid_in <= '1';
70
       Data_in <= X"1f5e5d5c5b5a5958";
71
       wait for CLK_PERIOD;
72
 
73
 
74
       Data_in <= X"2f5e5d5c5b5a5958";
75
       wait for CLK_PERIOD;
76
 
77
 
78
       data_in <= X"3f5e5d5c5b5a5958";
79
       wait for CLK_PERIOD;
80
 
81
       Data_in <= X"4f21a2a3a4a5a6a7";
82
       wait for CLK_PERIOD;
83
 
84
 
85
       data_in <= X"5f5e5a5c5b60f2a0";
86
       wait for CLK_PERIOD;
87
 
88
       data_in  <= X"635e22a3a4a5a7a7";
89
       wait for CLK_PERIOD;
90
 
91
       data_in  <= X"70000FFF000000F0";
92
       wait for CLK_PERIOD*2;
93
 
94
       Data_in <= X"2f5e5d5c5b5a5958";
95
       wait for CLK_PERIOD;
96
 
97
       Gearboxready <= '0';
98
       data_in  <= X"8050505050050505";
99
       wait for CLK_PERIOD*2;
100
 
101
       Gearboxready <= '1';
102
       data_in  <= X"9486576758050505";
103
       wait for CLK_PERIOD;
104
 
105
       data_in <= X"60b35d5dc4a582a7";
106
       wait for CLK_PERIOD;
107
 
108
       data_in <= X"2f5e5d5c5b5a5958";
109
       wait for CLK_PERIOD;
110
 
111
       data_in <= X"5f5e5a5c5b60f2a0";
112
       wait for CLK_PERIOD;
113
 
114
       data_in  <= X"635e22a3a4a5a7a7";
115
       wait for CLK_PERIOD;
116
 
117
       data_in  <= X"70000FFF000000F0";
118
       wait for CLK_PERIOD*2;
119
 
120
       Data_in <= X"2f5e5d5c5b5a5958";
121
       wait for CLK_PERIOD;
122
 
123
       data_in  <= X"8050505050050505";
124
       wait for CLK_PERIOD*3;
125
 
126
       data_in  <= X"9486576758050505";
127
       wait for CLK_PERIOD;
128
 
129
       data_in <= X"60b35d5dc4a582a7";
130
       wait for CLK_PERIOD;
131
 
132
       data_in <= X"5f5e5a5c5b60f2a0";
133
        wait for CLK_PERIOD;
134
 
135
        data_in  <= X"635e22a3a4a5a7a7";
136
        wait for CLK_PERIOD;
137
 
138
        data_in  <= X"70000FFF000000F0";
139
        wait for CLK_PERIOD*2;
140
 
141
        Data_in <= X"2f5e5d5c5b5a5958";
142
        wait for CLK_PERIOD;
143
 
144
        data_in  <= X"8050505050050505";
145
 
146
       wait;
147
    end process;
148
 
149
end architecture tb_meta;
150
 

powered by: WebSVN 2.1.0

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