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 9

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

powered by: WebSVN 2.1.0

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