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

Subversion Repositories core1990_interlaken

[/] [core1990_interlaken/] [trunk/] [gateware/] [simulation/] [interlaken_transmitter_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_interlaken_transmitter is
5
end entity testbench_interlaken_transmitter;
6
 
7
architecture tb_interlaken_transmitter of testbench_interlaken_transmitter is
8
 
9
        signal write_clk   : std_logic;
10
        signal clk   : std_logic;
11
        signal reset : std_logic;
12
 
13
        signal TX_Data_In       : std_logic_vector(63 downto 0);
14
        signal TX_Data_Out : std_logic_vector (66 downto 0); -- later 66 downto 0
15
 
16
        signal TX_SOP           : std_logic;                         -- Start of Packet
17 9 N.Boukadid
        signal TX_EOP_Valid     : std_logic_vector(2 downto 0);      -- Valid bytes packet contains
18 6 N.Boukadid
        signal TX_EOP           : std_logic;                         -- End of Packet
19
        signal TX_Channel       : std_logic_vector(7 downto 0);      -- Select transmit channel (yet unutilized)
20 9 N.Boukadid
        signal TX_Gearboxready  : std_logic;
21
        signal TX_Startseq      : std_logic;
22 6 N.Boukadid
 
23 9 N.Boukadid
        signal TX_FlowControl   : std_logic_vector(15 downto 0);
24
        signal RX_prog_full     : std_logic_vector(15 downto 0);
25 6 N.Boukadid
 
26 9 N.Boukadid
        signal FIFO_Write_Data : std_logic;
27
    signal FIFO_prog_full  : std_logic;
28
    signal FIFO_Full       : std_logic;
29
 
30
    signal Link_up         : std_logic;
31
    signal TX_valid_out    : std_logic;
32
 
33
    constant CLK_PERIOD : time := 10 ns;
34 6 N.Boukadid
 
35
begin
36 9 N.Boukadid
    uut : entity work.interlaken_transmitter
37
    port map (
38
        write_clk   => write_clk,
39
        clk         => clk,
40
        reset       => reset,
41
 
42
        TX_Data_In  => TX_Data_In,
43
        TX_Data_Out => TX_Data_Out,
44
 
45
        TX_SOP      => TX_SOP,
46
        TX_EOP_Valid=> TX_ValidBytes,
47
        TX_EOP      => TX_EOP,
48
        TX_Channel  => TX_Channel,
49
        TX_Gearboxready => TX_Gearboxready,
50
        TX_Startseq => TX_Startseq,
51
 
52
        TX_FlowControl => TX_FlowControl,
53
        RX_prog_full   => RX_prog_full,
54
 
55
        FIFO_Write_Data => FIFO_Write_Data,
56
        FIFO_prog_full  => FIFO_prog_full,
57
        FIFO_Full       => FIFO_Full,
58
 
59
        Link_up         => Link_up,
60
        TX_valid_out    => TX_valid_out
61
    );
62 6 N.Boukadid
 
63 9 N.Boukadid
    Clk_process :process
64
    begin
65
        write_clk <= '1';
66
        clk <= '1';
67
        wait for CLK_PERIOD/2;  --for half of clock period clk stays at '0'.
68
        clk <= '0';
69
        write_clk <= '0';
70
        wait for CLK_PERIOD/2;  --for next half of clock period clk stays at '1'.
71
    end process;
72 6 N.Boukadid
 
73
    simulation : process
74
    begin
75
        wait for 1 ps;
76
        TX_Enable <= '0';
77
        TX_EOP <= '0';
78
        TX_SOP <= '0';
79
        TX_Channel <= X"01";
80
        TX_ValidBytes <= "111";
81
        TX_data_in <= (others=>'0');
82
        reset <= '1';
83
        TX_FlowControl <= (others => '0');
84
 
85
        wait for CLK_PERIOD;
86
 
87
        wait for CLK_PERIOD;
88
        --FIFO_meta <= '1';
89
        reset <= '0';
90
        TX_Enable <= '1';
91
        TX_Data_in <= X"1f5e5d5c5b5a5958";
92
        wait for CLK_PERIOD;
93
 
94
 
95
        wait for CLK_PERIOD*10;
96
        TX_SOP <= '1';
97
        TX_EOP <= '1';
98
        TX_Data_in <= X"2f5e5d5c5b5a5958";
99
        wait for CLK_PERIOD;
100
 
101
        TX_EOP <= '0';
102
        TX_data_in <= X"3f5e5d5c5b5a5958";
103
        wait for CLK_PERIOD;
104
 
105
 
106
               TX_SOP <= '0';
107
               TX_EOP <= '0';
108
        TX_EOP <= '0';
109
        --reset <= '1';
110
        TX_Data_in <= X"4f21a2a3a4a5a6a7";
111
        wait for CLK_PERIOD;
112
        TX_FlowControl(0) <= '1';
113
        TX_SOP <= '1';
114
        TX_data_in <= X"5f5e5a5c5b60f2a0";
115
        wait for CLK_PERIOD;
116
 
117
        TX_SOP <= '0';
118
        TX_EOP <= '1';
119
        TX_data_in  <= X"635e22a3a4a5a7a7";
120
        wait for CLK_PERIOD;
121
 
122
        TX_EOP <= '0';
123
        --TX_SOP <= '1';
124
        TX_data_in  <= X"70000FFF000000F0";
125
        wait for CLK_PERIOD*2;
126
 
127
        TX_SOP <= '1';
128
        TX_Data_in <= X"2f5e5d5c5b5a5958";
129
        wait for CLK_PERIOD;
130
 
131
        TX_SOP <= '0';
132
        TX_EOP <= '1';
133
        wait for CLK_PERIOD;
134
 
135
        TX_EOP <= '0';
136 9 N.Boukadid
        TX_data_in  <= X"8050505050050505";
137 6 N.Boukadid
        wait for CLK_PERIOD;
138 9 N.Boukadid
 
139 6 N.Boukadid
        TX_data_in  <= X"9486576758050505";
140
        wait for CLK_PERIOD;
141
 
142
        TX_EOP <= '1';
143
        TX_data_in <= X"60b35d5dc4a582a7";
144
        wait for CLK_PERIOD; --Test influencing pause state position
145
 
146
        TX_EOP <= '0';
147
        wait for CLK_period*16;
148
 
149
        TX_SOP <= '1';
150
        TX_Data_in <= X"4f21a2a3a4a5a6a7";
151
        --wait for CLK_PERIOD;
152
 
153
        TX_data_in <= X"995e5a5c5b60f2a0";
154
        wait for CLK_PERIOD;
155
 
156
        TX_data_in  <= X"635e22a3a4a5a7a7";
157
        wait for CLK_PERIOD;
158
 
159
        TX_data_in  <= X"70000FFF000000F0";
160
        wait for CLK_PERIOD*2;
161
 
162
        TX_Data_in <= X"2f5e5d5c5b5a5958";
163
        wait for CLK_PERIOD;
164
 
165
        TX_Data_in <= X"4f21a2a3a4a5a6a7";
166
        wait for CLK_PERIOD;
167
 
168
        TX_data_in <= X"5f5e5a5c5b60f2a0";
169
        wait for CLK_PERIOD;
170
 
171
        TX_data_in  <= X"635e22a3a4a5a7a7";
172
        wait for CLK_PERIOD;
173
 
174
        TX_data_in  <= X"70000FFF000000F0";
175
        wait for CLK_PERIOD*2;
176
 
177
 
178
        TX_data_in <= X"2f5e5d5c5b5a5958";
179
        wait for CLK_PERIOD*12;
180
 
181
        TX_Data_in <= X"4f5e5d5c5b5a5958";
182
        wait for CLK_PERIOD;
183
 
184
        TX_SOP <= '0';
185
        TX_EOP <= '1';
186
 
187
        wait;
188
    end process;
189
 
190
end architecture tb_interlaken_transmitter;
191
 
192
 

powered by: WebSVN 2.1.0

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