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

Subversion Repositories core1990_interlaken

[/] [core1990_interlaken/] [trunk/] [gateware/] [simulation/] [decoder_tb.vhd] - Blame information for rev 6

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_decoder is
5
end entity testbench_decoder;
6
 
7
architecture tb_decoder of testbench_decoder is
8
 
9
    signal Clk             : std_logic;                     -- Clock input
10
    signal Reset                    : std_logic;                                         -- Reset decoder
11
    signal Data_In         :  std_logic_vector(66 downto 0); -- Data input
12
    signal Decoder_En      :  std_logic;                     -- Enables the decoder
13
    signal Data_Valid_In   :  std_logic;
14
    signal Data_Valid_Out  :  std_logic;
15
    signal Data_Out        :  std_logic_vector(63 downto 0);-- Decoded 64-bit output
16
    signal Data_Control    :  std_logic;                    --  Indicates whether the word is data or control
17
 
18
    signal Sync_Locked  :  std_logic;
19
    signal Sync_Error   :  std_logic;
20
    signal Bitslip      :  std_logic;
21
 
22
    constant CLK_PERIOD : time := 10 ns;
23
 
24
begin
25
  uut : entity work.decoder
26
  port map (
27
    clk => clk,
28
    reset => reset,
29
    Decoder_En => Decoder_En,
30
 
31
    Data_in => Data_in,
32
    Data_out => Data_out,
33
    Data_Valid_In => Data_Valid_In,
34
    Data_Valid_Out => Data_Valid_Out,
35
    Data_control => Data_control,
36
 
37
    Sync_Locked => Sync_locked,
38
    Sync_error => Sync_error,
39
    Bitslip => Bitslip
40
 
41
  );
42
 
43
   Clk_process :process
44
     begin
45
          clk <= '1';
46
          wait for CLK_PERIOD/2;  --for half of clock period clk stays at '0'.
47
          clk <= '0';
48
          wait for CLK_PERIOD/2;  --for next half of clock period clk stays at '1'.
49
     end process;
50
 
51
    simulation : process
52
    begin
53
        wait for 1 ps;
54
        decoder_en <= '1';
55
        reset <= '1';
56
        data_in <= (others=>'0');
57
 
58
        wait for CLK_PERIOD;
59
 
60
        wait for CLK_PERIOD;
61
 
62
        reset <= '0';
63
        Data_in <= "101" & X"1f5e5d5c5b5a5958";
64
        wait for CLK_PERIOD;
65
 
66
 
67
        Data_in <= "101" & X"2f5e5d5c5b5a5958";
68
        wait for CLK_PERIOD;
69
 
70
 
71
        data_in <= "101" & X"3f5e5d5c5b5a5958";
72
        wait for CLK_PERIOD;
73
 
74
 
75
        Data_in <= "101" & X"4f21a2a3a4a5a6a7";
76
        wait for CLK_PERIOD;
77
 
78
 
79
        data_in <= "101" & X"5f5e5a5c5b60f2a0";
80
        wait for CLK_PERIOD;
81
 
82
        data_in  <= "001" & X"635e22a3a4a5a7a7";
83
        wait for CLK_PERIOD;
84
 
85
        data_in  <= "101" & X"70000FFF000000F0";
86
        wait for CLK_PERIOD*2;
87
 
88
 
89
        Data_in <= "101" & X"2f5e5d5c5b5a5958";
90
        wait for CLK_PERIOD;
91
 
92
        wait for CLK_PERIOD;
93
 
94
 
95
        data_in  <= "110" & X"8050505050050505";
96
        wait for CLK_PERIOD*3;
97
 
98
        data_in  <= "101" & X"9486576758050505";
99
        wait for CLK_PERIOD;
100
 
101
 
102
        data_in <= "101" & X"60b35d5dc4a582a7";
103
        wait for CLK_PERIOD;
104
 
105
 
106
        data_in <= "101" & X"2f5e5d5c5b5a5958";
107
        wait for CLK_PERIOD*12;
108
 
109
        data_in <= "111" & X"2f5e5d5c5b5a5958";
110
        wait for CLK_PERIOD;
111
 
112
        Data_in <= "101" & X"1f5e5d5c5b5a5958";
113
        wait for CLK_PERIOD;
114
 
115
 
116
        Data_in <= "101" & X"2f5e5d5c5b5a5958";
117
        wait for CLK_PERIOD;
118
 
119
 
120
        data_in <= "101" & X"3f5e5d5c5b5a5958";
121
        wait for CLK_PERIOD;
122
 
123
 
124
        Data_in <= "101" & X"4f21a2a3a4a5a6a7";
125
        wait for CLK_PERIOD;
126
 
127
 
128
        data_in <= "101" & X"5f5e5a5c5b60f2a0";
129
        wait for CLK_PERIOD;
130
 
131
        data_in  <= "001" & X"635e22a3a4a5a7a7";
132
        wait for CLK_PERIOD;
133
 
134
        data_in <= "101" & X"5f5e5a5c5b60f2a0";
135
        wait for CLK_PERIOD;
136
 
137
        data_in  <= "001" & X"635e22a3a4a5a7a7";
138
        wait for CLK_PERIOD;
139
 
140
        data_in  <= "101" & X"70000FFF000000F0";
141
        wait for CLK_PERIOD*2;
142
 
143
 
144
        Data_in <= "101" & X"2f5e5d5c5b5a5958";
145
        wait for CLK_PERIOD;
146
 
147
        data_in  <= "110" & X"8050505050050505";
148
        wait for CLK_PERIOD*3;
149
 
150
        data_in  <= "101" & X"9486576758050505";
151
        wait for CLK_PERIOD;
152
 
153
        data_in <= "101" & X"60b35d5dc4a582a7";
154
        wait for CLK_PERIOD*60;
155
 
156
        data_in  <= "110" & X"8050505050050505";
157
        wait for CLK_PERIOD*3;
158
 
159
        data_in  <= "101" & X"9486576758050505";
160
        wait for CLK_PERIOD;
161
 
162
 
163
        data_in <= "101" & X"60b35d5dc4a582a7";
164
        wait for CLK_PERIOD;
165
 
166
 
167
        data_in <= "101" & X"2f5e5d5c5b5a5958";
168
        wait for CLK_PERIOD*12;
169
 
170
        data_in <= "111" & X"2c8e5d5c5b5a5958";
171
        wait for CLK_PERIOD;
172
 
173
        Data_in <= "101" & X"1f5e5d5c5b5a5958";
174
        wait for CLK_PERIOD*26;
175
 
176
        data_in <= "111" & X"2c8e5d5c5b5a5958";
177
        wait for CLK_PERIOD*18;
178
 
179
        data_in <= "101" & X"1f5e5d5c5b5a5958";
180
        wait for CLK_PERIOD;
181
        wait;
182
    end process;
183
 
184
end architecture tb_decoder;
185
 

powered by: WebSVN 2.1.0

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