1 |
11 |
N.Boukadid |
library ieee;
|
2 |
|
|
use ieee.std_logic_1164.all;
|
3 |
|
|
library unisim;
|
4 |
|
|
use unisim.vcomponents.all;
|
5 |
|
|
|
6 |
|
|
entity Core199_verification is
|
7 |
|
|
-- port(
|
8 |
|
|
-- System_Clock_In_P : in std_logic;
|
9 |
|
|
-- System_Clock_In_N : in std_logic;
|
10 |
|
|
|
11 |
|
|
-- GTREFCLK_IN_P : in std_logic;
|
12 |
|
|
-- GTREFCLK_IN_N : in std_logic;
|
13 |
|
|
|
14 |
|
|
-- USER_CLK_IN_P : in std_logic;
|
15 |
|
|
-- USER_CLK_IN_N : in std_logic;
|
16 |
|
|
|
17 |
|
|
-- USER_SMA_CLK_OUT_P : out std_logic;
|
18 |
|
|
-- USER_SMA_CLK_OUT_N : out std_logic;
|
19 |
|
|
|
20 |
|
|
-- TX_Out_P : out std_logic;
|
21 |
|
|
-- TX_Out_N : out std_logic;
|
22 |
|
|
-- RX_In_P : in std_logic;
|
23 |
|
|
-- RX_In_N : in std_logic;
|
24 |
|
|
|
25 |
|
|
-- Lock_Out : out std_logic;
|
26 |
|
|
-- Valid_out : out std_logic
|
27 |
|
|
-- );
|
28 |
|
|
end entity Core199_verification;
|
29 |
|
|
|
30 |
|
|
architecture Test of Core199_verification is
|
31 |
|
|
|
32 |
|
|
COMPONENT interlaken_0
|
33 |
|
|
PORT (
|
34 |
|
|
gt_ref_clk0_p : IN STD_LOGIC;
|
35 |
|
|
gt_ref_clk0_n : IN STD_LOGIC;
|
36 |
|
|
gt_refclk_out : OUT STD_LOGIC;
|
37 |
|
|
init_clk : IN STD_LOGIC;
|
38 |
|
|
sys_reset : IN STD_LOGIC;
|
39 |
|
|
gt_txusrclk2 : OUT STD_LOGIC;
|
40 |
|
|
gt_rxusrclk2 : OUT STD_LOGIC;
|
41 |
|
|
gt_txresetdone_int : OUT STD_LOGIC;
|
42 |
|
|
gt_rxresetdone_int : OUT STD_LOGIC;
|
43 |
|
|
gt_tx_reset_done_inv : OUT STD_LOGIC;
|
44 |
|
|
gt_rx_reset_done_inv : OUT STD_LOGIC;
|
45 |
|
|
gt0_rxp_in : IN STD_LOGIC;
|
46 |
|
|
gt0_rxn_in : IN STD_LOGIC;
|
47 |
|
|
gt0_txn_out : OUT STD_LOGIC;
|
48 |
|
|
gt0_txp_out : OUT STD_LOGIC;
|
49 |
|
|
rx_ovfout : OUT STD_LOGIC;
|
50 |
|
|
rx_dataout0 : OUT STD_LOGIC_VECTOR(127 DOWNTO 0);
|
51 |
|
|
rx_chanout0 : OUT STD_LOGIC_VECTOR(10 DOWNTO 0);
|
52 |
|
|
rx_enaout0 : OUT STD_LOGIC;
|
53 |
|
|
rx_sopout0 : OUT STD_LOGIC;
|
54 |
|
|
rx_eopout0 : OUT STD_LOGIC;
|
55 |
|
|
rx_errout0 : OUT STD_LOGIC;
|
56 |
|
|
rx_mtyout0 : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
|
57 |
|
|
rx_dataout1 : OUT STD_LOGIC_VECTOR(127 DOWNTO 0);
|
58 |
|
|
rx_chanout1 : OUT STD_LOGIC_VECTOR(10 DOWNTO 0);
|
59 |
|
|
rx_enaout1 : OUT STD_LOGIC;
|
60 |
|
|
rx_sopout1 : OUT STD_LOGIC;
|
61 |
|
|
rx_eopout1 : OUT STD_LOGIC;
|
62 |
|
|
rx_errout1 : OUT STD_LOGIC;
|
63 |
|
|
rx_mtyout1 : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
|
64 |
|
|
rx_dataout2 : OUT STD_LOGIC_VECTOR(127 DOWNTO 0);
|
65 |
|
|
rx_chanout2 : OUT STD_LOGIC_VECTOR(10 DOWNTO 0);
|
66 |
|
|
rx_enaout2 : OUT STD_LOGIC;
|
67 |
|
|
rx_sopout2 : OUT STD_LOGIC;
|
68 |
|
|
rx_eopout2 : OUT STD_LOGIC;
|
69 |
|
|
rx_errout2 : OUT STD_LOGIC;
|
70 |
|
|
rx_mtyout2 : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
|
71 |
|
|
rx_dataout3 : OUT STD_LOGIC_VECTOR(127 DOWNTO 0);
|
72 |
|
|
rx_chanout3 : OUT STD_LOGIC_VECTOR(10 DOWNTO 0);
|
73 |
|
|
rx_enaout3 : OUT STD_LOGIC;
|
74 |
|
|
rx_sopout3 : OUT STD_LOGIC;
|
75 |
|
|
rx_eopout3 : OUT STD_LOGIC;
|
76 |
|
|
rx_errout3 : OUT STD_LOGIC;
|
77 |
|
|
rx_mtyout3 : OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
|
78 |
|
|
tx_rdyout : OUT STD_LOGIC;
|
79 |
|
|
tx_ovfout : OUT STD_LOGIC;
|
80 |
|
|
tx_datain0 : IN STD_LOGIC_VECTOR(127 DOWNTO 0);
|
81 |
|
|
tx_chanin0 : IN STD_LOGIC_VECTOR(10 DOWNTO 0);
|
82 |
|
|
tx_enain0 : IN STD_LOGIC;
|
83 |
|
|
tx_sopin0 : IN STD_LOGIC;
|
84 |
|
|
tx_eopin0 : IN STD_LOGIC;
|
85 |
|
|
tx_errin0 : IN STD_LOGIC;
|
86 |
|
|
tx_mtyin0 : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
|
87 |
|
|
tx_bctlin0 : IN STD_LOGIC;
|
88 |
|
|
tx_datain1 : IN STD_LOGIC_VECTOR(127 DOWNTO 0);
|
89 |
|
|
tx_chanin1 : IN STD_LOGIC_VECTOR(10 DOWNTO 0);
|
90 |
|
|
tx_enain1 : IN STD_LOGIC;
|
91 |
|
|
tx_sopin1 : IN STD_LOGIC;
|
92 |
|
|
tx_eopin1 : IN STD_LOGIC;
|
93 |
|
|
tx_errin1 : IN STD_LOGIC;
|
94 |
|
|
tx_mtyin1 : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
|
95 |
|
|
tx_bctlin1 : IN STD_LOGIC;
|
96 |
|
|
tx_datain2 : IN STD_LOGIC_VECTOR(127 DOWNTO 0);
|
97 |
|
|
tx_chanin2 : IN STD_LOGIC_VECTOR(10 DOWNTO 0);
|
98 |
|
|
tx_enain2 : IN STD_LOGIC;
|
99 |
|
|
tx_sopin2 : IN STD_LOGIC;
|
100 |
|
|
tx_eopin2 : IN STD_LOGIC;
|
101 |
|
|
tx_errin2 : IN STD_LOGIC;
|
102 |
|
|
tx_mtyin2 : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
|
103 |
|
|
tx_bctlin2 : IN STD_LOGIC;
|
104 |
|
|
tx_datain3 : IN STD_LOGIC_VECTOR(127 DOWNTO 0);
|
105 |
|
|
tx_chanin3 : IN STD_LOGIC_VECTOR(10 DOWNTO 0);
|
106 |
|
|
tx_enain3 : IN STD_LOGIC;
|
107 |
|
|
tx_sopin3 : IN STD_LOGIC;
|
108 |
|
|
tx_eopin3 : IN STD_LOGIC;
|
109 |
|
|
tx_errin3 : IN STD_LOGIC;
|
110 |
|
|
core_tx_reset : IN STD_LOGIC;
|
111 |
|
|
core_rx_reset : IN STD_LOGIC;
|
112 |
|
|
tx_mtyin3 : IN STD_LOGIC_VECTOR(3 DOWNTO 0);
|
113 |
|
|
tx_bctlin3 : IN STD_LOGIC;
|
114 |
|
|
drp_clk : IN STD_LOGIC;
|
115 |
|
|
core_drp_reset : IN STD_LOGIC;
|
116 |
|
|
lockedn : IN STD_LOGIC;
|
117 |
|
|
drp_en : IN STD_LOGIC;
|
118 |
|
|
drp_we : IN STD_LOGIC;
|
119 |
|
|
drp_addr : IN STD_LOGIC_VECTOR(9 DOWNTO 0);
|
120 |
|
|
drp_di : IN STD_LOGIC_VECTOR(15 DOWNTO 0);
|
121 |
|
|
drp_do : OUT STD_LOGIC_VECTOR(15 DOWNTO 0);
|
122 |
|
|
usr_tx_reset : OUT STD_LOGIC;
|
123 |
|
|
usr_rx_reset : OUT STD_LOGIC;
|
124 |
|
|
drp_rdy : OUT STD_LOGIC;
|
125 |
|
|
core_clk : IN STD_LOGIC;
|
126 |
|
|
lbus_clk : IN STD_LOGIC;
|
127 |
|
|
ctl_tx_enable : IN STD_LOGIC;
|
128 |
|
|
gt_loopback_in : IN STD_LOGIC_VECTOR(2 DOWNTO 0);
|
129 |
|
|
gtwiz_reset_tx_datapath : IN STD_LOGIC;
|
130 |
|
|
gtwiz_reset_rx_datapath : IN STD_LOGIC;
|
131 |
|
|
ctl_tx_diagword_lanestat : IN STD_LOGIC_VECTOR(11 DOWNTO 0);
|
132 |
|
|
ctl_tx_diagword_intfstat : IN STD_LOGIC;
|
133 |
|
|
ctl_tx_mubits : IN STD_LOGIC_VECTOR(7 DOWNTO 0);
|
134 |
|
|
stat_tx_underflow_err : OUT STD_LOGIC;
|
135 |
|
|
stat_tx_burst_err : OUT STD_LOGIC;
|
136 |
|
|
stat_tx_overflow_err : OUT STD_LOGIC;
|
137 |
|
|
ctl_rx_force_resync : IN STD_LOGIC;
|
138 |
|
|
stat_rx_diagword_lanestat : OUT STD_LOGIC_VECTOR(11 DOWNTO 0);
|
139 |
|
|
stat_rx_diagword_intfstat : OUT STD_LOGIC_VECTOR(11 DOWNTO 0);
|
140 |
|
|
stat_rx_crc32_valid : OUT STD_LOGIC_VECTOR(11 DOWNTO 0);
|
141 |
|
|
stat_rx_crc32_err : OUT STD_LOGIC_VECTOR(11 DOWNTO 0);
|
142 |
|
|
stat_rx_mubits : OUT STD_LOGIC_VECTOR(7 DOWNTO 0);
|
143 |
|
|
stat_rx_mubits_updated : OUT STD_LOGIC;
|
144 |
|
|
stat_rx_word_sync : OUT STD_LOGIC_VECTOR(11 DOWNTO 0);
|
145 |
|
|
stat_rx_synced : OUT STD_LOGIC_VECTOR(11 DOWNTO 0);
|
146 |
|
|
stat_rx_synced_err : OUT STD_LOGIC_VECTOR(11 DOWNTO 0);
|
147 |
|
|
stat_rx_framing_err : OUT STD_LOGIC_VECTOR(11 DOWNTO 0);
|
148 |
|
|
stat_rx_bad_type_err : OUT STD_LOGIC_VECTOR(11 DOWNTO 0);
|
149 |
|
|
stat_rx_mf_err : OUT STD_LOGIC_VECTOR(11 DOWNTO 0);
|
150 |
|
|
stat_rx_descram_err : OUT STD_LOGIC_VECTOR(11 DOWNTO 0);
|
151 |
|
|
stat_rx_mf_len_err : OUT STD_LOGIC_VECTOR(11 DOWNTO 0);
|
152 |
|
|
stat_rx_mf_repeat_err : OUT STD_LOGIC_VECTOR(11 DOWNTO 0);
|
153 |
|
|
stat_rx_aligned : OUT STD_LOGIC;
|
154 |
|
|
stat_rx_misaligned : OUT STD_LOGIC;
|
155 |
|
|
stat_rx_aligned_err : OUT STD_LOGIC;
|
156 |
|
|
stat_rx_crc24_err : OUT STD_LOGIC;
|
157 |
|
|
stat_rx_msop_err : OUT STD_LOGIC;
|
158 |
|
|
stat_rx_meop_err : OUT STD_LOGIC;
|
159 |
|
|
stat_rx_overflow_err : OUT STD_LOGIC;
|
160 |
|
|
stat_rx_burstmax_err : OUT STD_LOGIC;
|
161 |
|
|
stat_rx_burst_err : OUT STD_LOGIC;
|
162 |
|
|
gtpowergood_out : OUT STD_LOGIC_VECTOR(0 DOWNTO 0)
|
163 |
|
|
);
|
164 |
|
|
END COMPONENT;
|
165 |
|
|
|
166 |
|
|
-------------------------- Generate System Clock ---------------------------
|
167 |
|
|
component clk_40MHz
|
168 |
|
|
port (
|
169 |
|
|
--Clock in- and output signals
|
170 |
|
|
clk_in1_p : in std_logic;
|
171 |
|
|
clk_in1_n : in std_logic;
|
172 |
|
|
clk_out1 : out std_logic;
|
173 |
|
|
clk_out2 : out std_logic;
|
174 |
|
|
|
175 |
|
|
-- Status and control signals
|
176 |
|
|
reset : in std_logic;
|
177 |
|
|
locked : out std_logic
|
178 |
|
|
);
|
179 |
|
|
end component;
|
180 |
|
|
|
181 |
|
|
signal TX_Data : std_logic_vector(63 downto 0); -- Data transmitted
|
182 |
|
|
signal RX_Data : std_logic_vector(63 downto 0); -- Data received
|
183 |
|
|
|
184 |
|
|
signal TX_SOP : std_logic;
|
185 |
|
|
signal TX_EOP : std_logic;
|
186 |
|
|
signal TX_EOP_Valid : std_logic_vector(2 downto 0);
|
187 |
|
|
signal TX_FlowControl : std_logic_vector(15 downto 0);
|
188 |
|
|
signal TX_Channel : std_logic_vector(7 downto 0);
|
189 |
|
|
|
190 |
|
|
signal RX_SOP : std_logic; -- Start of Packet
|
191 |
|
|
signal RX_EOP : std_logic; -- End of Packet
|
192 |
|
|
signal RX_EOP_Valid : std_logic_vector(2 downto 0); -- Valid bytes packet contains
|
193 |
|
|
signal RX_FlowControl : std_logic_vector(15 downto 0); -- Flow control data (yet unutilized)
|
194 |
|
|
signal RX_Channel : std_logic_vector(7 downto 0); -- Select transmit channel (yet unutilized)
|
195 |
|
|
|
196 |
|
|
signal RX_FIFO_Valid : std_logic;
|
197 |
|
|
|
198 |
|
|
signal TX_FIFO_Full : std_logic;
|
199 |
|
|
signal TX_FIFO_progfull : std_logic;
|
200 |
|
|
signal TX_FIFO_Write : std_logic;
|
201 |
|
|
signal RX_FIFO_Read : std_logic;
|
202 |
|
|
signal RX_FIFO_Full : std_logic;
|
203 |
|
|
signal RX_FIFO_Empty : std_logic;
|
204 |
|
|
|
205 |
|
|
signal Decoder_lock : std_logic;
|
206 |
|
|
signal Descrambler_lock : std_logic;
|
207 |
|
|
signal CRC24_Error : std_logic;
|
208 |
|
|
signal CRC32_Error : std_logic;
|
209 |
|
|
|
210 |
|
|
-- signal pipeline_length : std_logic_vector(6 downto 0);
|
211 |
|
|
-- signal TX_Info_Pipelined : std_logic_vector(4 downto 0);
|
212 |
|
|
-- signal TX_Data_Pipelined : std_logic_vector(63 downto 0);
|
213 |
|
|
-- signal RX_Info : std_logic_vector(4 downto 0);
|
214 |
|
|
-- signal System_Clock : std_logic;
|
215 |
|
|
|
216 |
|
|
-- signal valid_probe, RX_Valid : std_logic_vector(0 downto 0);
|
217 |
|
|
constant packet_length : std_logic_vector(6 downto 0) := "0001000";
|
218 |
|
|
signal RX_in: std_logic_vector(63 downto 0); --Debug
|
219 |
|
|
signal TX_out: std_logic_vector(63 downto 0); --Debug
|
220 |
|
|
signal Data_Descrambler : std_logic_vector(66 downto 0);
|
221 |
|
|
signal Data_Decoder : std_logic_vector(66 downto 0);
|
222 |
|
|
|
223 |
|
|
|
224 |
|
|
-- signal USER_CLK, USER_SMA_CLK: std_logic;
|
225 |
|
|
|
226 |
|
|
signal clk40: std_logic;
|
227 |
|
|
signal clk150: std_logic;
|
228 |
|
|
signal reset: std_logic;
|
229 |
|
|
signal locked: std_logic;
|
230 |
|
|
|
231 |
|
|
signal System_Clock_In_P : std_logic;
|
232 |
|
|
signal System_Clock_In_N : std_logic;
|
233 |
|
|
constant System_Clock_In_period : time := 5 ns;
|
234 |
|
|
|
235 |
|
|
signal IL150G_RXP_IN : std_logic;
|
236 |
|
|
signal IL150G_RXN_IN : std_logic;
|
237 |
|
|
signal IL150G_TXN_OUT : std_logic;
|
238 |
|
|
signal IL150G_TXP_OUT : std_logic;
|
239 |
|
|
|
240 |
|
|
signal C1990_RXN_IN : std_logic;
|
241 |
|
|
signal C1990_RXP_IN : std_logic;
|
242 |
|
|
signal C1990_TXN_OUT : std_logic;
|
243 |
|
|
signal C1990_TXP_OUT : std_logic;
|
244 |
|
|
|
245 |
|
|
|
246 |
|
|
|
247 |
|
|
|
248 |
|
|
signal GTREFCLK_IN_P: std_logic;
|
249 |
|
|
signal GTREFCLK_IN_N: std_logic;
|
250 |
|
|
constant GTREFCLK_IN_period : time := 6.4 ns;
|
251 |
|
|
signal clk300: std_logic;
|
252 |
|
|
constant clk300_period: time := 3.333 ns;
|
253 |
|
|
|
254 |
|
|
signal tx_rdyout: std_logic;
|
255 |
|
|
signal data0: std_logic_vector(127 downto 0);
|
256 |
|
|
signal chan0: std_logic_vector(10 downto 0);
|
257 |
|
|
signal ena0: std_logic;
|
258 |
|
|
signal sop0: std_logic;
|
259 |
|
|
signal eop0: std_logic;
|
260 |
|
|
signal err0: std_logic;
|
261 |
|
|
signal mty0: std_logic_vector(3 downto 0);
|
262 |
|
|
|
263 |
|
|
signal data1: std_logic_vector(127 downto 0);
|
264 |
|
|
signal chan1: std_logic_vector(10 downto 0);
|
265 |
|
|
signal ena1: std_logic;
|
266 |
|
|
signal sop1: std_logic;
|
267 |
|
|
signal eop1: std_logic;
|
268 |
|
|
signal err1: std_logic;
|
269 |
|
|
signal mty1: std_logic_vector(3 downto 0);
|
270 |
|
|
|
271 |
|
|
signal data2: std_logic_vector(127 downto 0);
|
272 |
|
|
signal chan2: std_logic_vector(10 downto 0);
|
273 |
|
|
signal ena2: std_logic;
|
274 |
|
|
signal sop2: std_logic;
|
275 |
|
|
signal eop2: std_logic;
|
276 |
|
|
signal err2: std_logic;
|
277 |
|
|
signal mty2: std_logic_vector(3 downto 0);
|
278 |
|
|
|
279 |
|
|
signal data3: std_logic_vector(127 downto 0);
|
280 |
|
|
signal chan3: std_logic_vector(10 downto 0);
|
281 |
|
|
signal ena3: std_logic;
|
282 |
|
|
signal sop3: std_logic;
|
283 |
|
|
signal eop3: std_logic;
|
284 |
|
|
signal err3: std_logic;
|
285 |
|
|
signal mty3: std_logic_vector(3 downto 0);
|
286 |
|
|
|
287 |
|
|
|
288 |
|
|
constant LOOPBACK: boolean := false;
|
289 |
|
|
|
290 |
|
|
|
291 |
|
|
|
292 |
|
|
|
293 |
|
|
begin
|
294 |
|
|
|
295 |
|
|
|
296 |
|
|
sysclk_proc: process
|
297 |
|
|
begin
|
298 |
|
|
System_Clock_In_P <= '0';
|
299 |
|
|
System_Clock_In_N <= '1';
|
300 |
|
|
wait for System_Clock_In_period / 2;
|
301 |
|
|
System_Clock_In_P <= '1';
|
302 |
|
|
System_Clock_In_N <= '0';
|
303 |
|
|
wait for System_Clock_In_period / 2;
|
304 |
|
|
end process;
|
305 |
|
|
|
306 |
|
|
|
307 |
|
|
dbusclk_proc: process
|
308 |
|
|
begin
|
309 |
|
|
clk300 <= '0';
|
310 |
|
|
wait for clk300_period / 2;
|
311 |
|
|
clk300 <= '1';
|
312 |
|
|
wait for clk300_period / 2;
|
313 |
|
|
end process;
|
314 |
|
|
|
315 |
|
|
|
316 |
|
|
refclk_proc: process
|
317 |
|
|
begin
|
318 |
|
|
GTREFCLK_IN_P <= '0';
|
319 |
|
|
GTREFCLK_IN_N <= '1';
|
320 |
|
|
wait for GTREFCLK_IN_period / 2;
|
321 |
|
|
GTREFCLK_IN_P <= '1';
|
322 |
|
|
GTREFCLK_IN_N <= '0';
|
323 |
|
|
wait for GTREFCLK_IN_period / 2;
|
324 |
|
|
end process;
|
325 |
|
|
|
326 |
|
|
System_Clock : clk_40MHz
|
327 |
|
|
port map (
|
328 |
|
|
clk_in1_p => System_Clock_In_P,
|
329 |
|
|
clk_in1_n => System_Clock_In_N,
|
330 |
|
|
clk_out1 => clk40,
|
331 |
|
|
clk_out2 => clk150,
|
332 |
|
|
|
333 |
|
|
reset => '0',
|
334 |
|
|
locked => locked
|
335 |
|
|
);
|
336 |
|
|
|
337 |
|
|
reset <= not locked;
|
338 |
|
|
|
339 |
|
|
------- The Interlaken Interface -------
|
340 |
|
|
interface : entity work.interlaken_interface
|
341 |
|
|
generic map(
|
342 |
|
|
BurstMax => 256, --(Bytes)
|
343 |
|
|
BurstShort => 64, --(Bytes)
|
344 |
|
|
PacketLength => 2028 --(Packets)
|
345 |
|
|
)
|
346 |
|
|
port map (
|
347 |
|
|
clk40 => clk40,
|
348 |
|
|
clk150 => clk150,
|
349 |
|
|
reset => reset,
|
350 |
|
|
GTREFCLK_IN_P => GTREFCLK_IN_P,
|
351 |
|
|
GTREFCLK_IN_N => GTREFCLK_IN_N,
|
352 |
|
|
|
353 |
|
|
|
354 |
|
|
TX_Data => TX_Data,
|
355 |
|
|
RX_Data => RX_Data,
|
356 |
|
|
|
357 |
|
|
RX_In_N => C1990_RXN_IN,
|
358 |
|
|
RX_In_P => C1990_RXP_IN,
|
359 |
|
|
TX_Out_N => C1990_TXN_OUT,
|
360 |
|
|
TX_Out_P => C1990_TXP_OUT,
|
361 |
|
|
|
362 |
|
|
TX_FIFO_Write => TX_FIFO_Write,
|
363 |
|
|
TX_SOP => TX_SOP,
|
364 |
|
|
TX_EOP => TX_EOP,
|
365 |
|
|
TX_EOP_Valid => TX_EOP_Valid,
|
366 |
|
|
TX_FlowControl => TX_FlowControl,
|
367 |
|
|
TX_Channel => TX_Channel,
|
368 |
|
|
|
369 |
|
|
RX_FIFO_Read => RX_FIFO_Read,
|
370 |
|
|
RX_FIFO_Empty => RX_FIFO_Empty,
|
371 |
|
|
RX_SOP => RX_SOP,
|
372 |
|
|
RX_EOP => RX_EOP,
|
373 |
|
|
RX_EOP_Valid => RX_EOP_Valid,
|
374 |
|
|
RX_FlowControl => RX_FlowControl,
|
375 |
|
|
RX_Channel => RX_Channel,
|
376 |
|
|
|
377 |
|
|
TX_FIFO_progfull => TX_FIFO_progfull,
|
378 |
|
|
|
379 |
|
|
RX_FIFO_Valid => RX_FIFO_Valid,
|
380 |
|
|
TX_FIFO_Full => TX_FIFO_Full,
|
381 |
|
|
RX_FIFO_Full => RX_FIFO_Full,
|
382 |
|
|
|
383 |
|
|
RX_in => RX_in,
|
384 |
|
|
TX_out => TX_out,
|
385 |
|
|
Data_Descrambler => Data_Descrambler,
|
386 |
|
|
Data_Decoder => Data_Decoder,
|
387 |
|
|
|
388 |
|
|
Decoder_lock => Decoder_lock,
|
389 |
|
|
Descrambler_lock => Descrambler_lock,
|
390 |
|
|
CRC24_Error => CRC24_Error,
|
391 |
|
|
CRC32_Error => CRC32_Error
|
392 |
|
|
);
|
393 |
|
|
|
394 |
|
|
---- Generates input data and interface signals ----
|
395 |
|
|
generate_data : entity work.data_generator
|
396 |
|
|
port map (
|
397 |
|
|
clk => clk150,
|
398 |
|
|
Packet_length => packet_length,
|
399 |
|
|
--link_up => Link_up,
|
400 |
|
|
TX_FIFO_Full => TX_FIFO_progfull,
|
401 |
|
|
|
402 |
|
|
write_enable => TX_FIFO_Write,
|
403 |
|
|
data_out => TX_Data,
|
404 |
|
|
sop => TX_SOP,
|
405 |
|
|
eop => TX_EOP,
|
406 |
|
|
eop_valid=> TX_EOP_Valid,
|
407 |
|
|
channel => TX_Channel
|
408 |
|
|
);
|
409 |
|
|
|
410 |
|
|
|
411 |
|
|
g_loopback: if LOOPBACK = true generate
|
412 |
|
|
--! Core1990 loopback
|
413 |
|
|
C1990_RXN_IN <= C1990_TXN_OUT;
|
414 |
|
|
C1990_RXP_IN <= C1990_TXP_OUT;
|
415 |
|
|
|
416 |
|
|
--! Xilinx Interlaken loopback
|
417 |
|
|
IL150G_RXN_IN <= IL150G_TXN_OUT;
|
418 |
|
|
IL150G_RXP_IN <= IL150G_TXP_OUT;
|
419 |
|
|
end generate;
|
420 |
|
|
|
421 |
|
|
g_connection: if LOOPBACK = false generate
|
422 |
|
|
|
423 |
|
|
--! Core 1990 -> Interlaken connection
|
424 |
|
|
IL150G_RXN_IN <= C1990_TXN_OUT;
|
425 |
|
|
IL150G_RXP_IN <= C1990_TXP_OUT;
|
426 |
|
|
|
427 |
|
|
--! Interlaken -> Core1990 connection
|
428 |
|
|
C1990_RXN_IN <= IL150G_TXN_OUT;
|
429 |
|
|
C1990_RXP_IN <= IL150G_TXP_OUT;
|
430 |
|
|
end generate;
|
431 |
|
|
|
432 |
|
|
|
433 |
|
|
RX_FIFO_Read <= not RX_FIFO_Empty;
|
434 |
|
|
|
435 |
|
|
|
436 |
|
|
-- RX_Channel <= TX_Channel;
|
437 |
|
|
|
438 |
|
|
|
439 |
|
|
|
440 |
|
|
|
441 |
|
|
interlaken_instance : interlaken_0
|
442 |
|
|
PORT MAP (
|
443 |
|
|
gt_ref_clk0_p => GTREFCLK_IN_P,
|
444 |
|
|
gt_ref_clk0_n => GTREFCLK_IN_N,
|
445 |
|
|
gt_refclk_out => open,
|
446 |
|
|
init_clk => clk40,
|
447 |
|
|
sys_reset => reset,
|
448 |
|
|
gt_txusrclk2 => open,
|
449 |
|
|
gt_rxusrclk2 => open,
|
450 |
|
|
gt_txresetdone_int => open,
|
451 |
|
|
gt_rxresetdone_int => open,
|
452 |
|
|
gt_tx_reset_done_inv => open,
|
453 |
|
|
gt_rx_reset_done_inv => open,
|
454 |
|
|
gt0_rxp_in => IL150G_RXP_IN,
|
455 |
|
|
gt0_rxn_in => IL150G_RXN_IN,
|
456 |
|
|
gt0_txn_out => IL150G_TXN_OUT,
|
457 |
|
|
gt0_txp_out => IL150G_TXP_OUT,
|
458 |
|
|
rx_ovfout => open,
|
459 |
|
|
rx_dataout0 => open,--data0,
|
460 |
|
|
rx_chanout0 => open,--chan0,
|
461 |
|
|
rx_enaout0 => open,--ena0,
|
462 |
|
|
rx_sopout0 => open,--sop0,
|
463 |
|
|
rx_eopout0 => open,--eop0,
|
464 |
|
|
rx_errout0 => open,--err0,
|
465 |
|
|
rx_mtyout0 => open,--mty0,
|
466 |
|
|
rx_dataout1 => open,--data1,
|
467 |
|
|
rx_chanout1 => open,--chan1,
|
468 |
|
|
rx_enaout1 => open,--ena1,
|
469 |
|
|
rx_sopout1 => open,--sop1,
|
470 |
|
|
rx_eopout1 => open,--eop1,
|
471 |
|
|
rx_errout1 => open,--err1,
|
472 |
|
|
rx_mtyout1 => open,--mty1,
|
473 |
|
|
rx_dataout2 => open,--data2,
|
474 |
|
|
rx_chanout2 => open,--chan2,
|
475 |
|
|
rx_enaout2 => open, --ena2,
|
476 |
|
|
rx_sopout2 => open, --sop2,
|
477 |
|
|
rx_eopout2 => open, --eop2,
|
478 |
|
|
rx_errout2 => open, --err2,
|
479 |
|
|
rx_mtyout2 => open, --mty2,
|
480 |
|
|
rx_dataout3 => open, -- data3,
|
481 |
|
|
rx_chanout3 => open, -- chan3,
|
482 |
|
|
rx_enaout3 => open, --ena3,
|
483 |
|
|
rx_sopout3 => open, --sop3,
|
484 |
|
|
rx_eopout3 => open, --eop3,
|
485 |
|
|
rx_errout3 => open, --err3,
|
486 |
|
|
rx_mtyout3 => open, --mty3,
|
487 |
|
|
tx_rdyout => tx_rdyout,
|
488 |
|
|
tx_ovfout => open,
|
489 |
|
|
tx_datain0 => data0,
|
490 |
|
|
tx_chanin0 => chan0,
|
491 |
|
|
tx_enain0 => ena0,
|
492 |
|
|
tx_sopin0 => sop0,
|
493 |
|
|
tx_eopin0 => eop0,
|
494 |
|
|
tx_errin0 => err0,
|
495 |
|
|
tx_mtyin0 => mty0,
|
496 |
|
|
tx_bctlin0 => '0',
|
497 |
|
|
tx_datain1 => data1,
|
498 |
|
|
tx_chanin1 => chan1,
|
499 |
|
|
tx_enain1 => ena1,
|
500 |
|
|
tx_sopin1 => sop1,
|
501 |
|
|
tx_eopin1 => eop1,
|
502 |
|
|
tx_errin1 => err1,
|
503 |
|
|
tx_mtyin1 => mty1,
|
504 |
|
|
tx_bctlin1 => '0',
|
505 |
|
|
tx_datain2 => data2,
|
506 |
|
|
tx_chanin2 => chan2,
|
507 |
|
|
tx_enain2 => ena2,
|
508 |
|
|
tx_sopin2 => sop2,
|
509 |
|
|
tx_eopin2 => eop2,
|
510 |
|
|
tx_errin2 => err2,
|
511 |
|
|
tx_mtyin2 => mty2,
|
512 |
|
|
tx_bctlin2 => '0',
|
513 |
|
|
tx_datain3 => data3,
|
514 |
|
|
tx_chanin3 => chan3,
|
515 |
|
|
tx_enain3 => ena3,
|
516 |
|
|
tx_sopin3 => sop3,
|
517 |
|
|
tx_eopin3 => eop3,
|
518 |
|
|
tx_errin3 => err3,
|
519 |
|
|
core_tx_reset => reset,
|
520 |
|
|
core_rx_reset => reset,
|
521 |
|
|
tx_mtyin3 => mty3,
|
522 |
|
|
tx_bctlin3 => '0',
|
523 |
|
|
drp_clk => clk40,
|
524 |
|
|
core_drp_reset => reset,
|
525 |
|
|
lockedn => reset,
|
526 |
|
|
drp_en => '0',
|
527 |
|
|
drp_we => '0',
|
528 |
|
|
drp_addr => (others => '0'),
|
529 |
|
|
drp_di => (others => '0'),
|
530 |
|
|
drp_do => open,
|
531 |
|
|
usr_tx_reset => open,
|
532 |
|
|
usr_rx_reset => open,
|
533 |
|
|
drp_rdy => open,
|
534 |
|
|
core_clk => clk300,
|
535 |
|
|
lbus_clk => clk300,
|
536 |
|
|
ctl_tx_enable => '1',
|
537 |
|
|
gt_loopback_in => "000",
|
538 |
|
|
gtwiz_reset_tx_datapath => reset,
|
539 |
|
|
gtwiz_reset_rx_datapath => reset,
|
540 |
|
|
ctl_tx_diagword_lanestat => "111111111111",
|
541 |
|
|
ctl_tx_diagword_intfstat => '1',
|
542 |
|
|
ctl_tx_mubits => "00000000",
|
543 |
|
|
stat_tx_underflow_err => open,
|
544 |
|
|
stat_tx_burst_err => open,
|
545 |
|
|
stat_tx_overflow_err => open,
|
546 |
|
|
ctl_rx_force_resync => '0',
|
547 |
|
|
stat_rx_diagword_lanestat => open,
|
548 |
|
|
stat_rx_diagword_intfstat => open,
|
549 |
|
|
stat_rx_crc32_valid => open,
|
550 |
|
|
stat_rx_crc32_err => open,
|
551 |
|
|
stat_rx_mubits => open,
|
552 |
|
|
stat_rx_mubits_updated => open,
|
553 |
|
|
stat_rx_word_sync => open,
|
554 |
|
|
stat_rx_synced => open,
|
555 |
|
|
stat_rx_synced_err => open,
|
556 |
|
|
stat_rx_framing_err => open,
|
557 |
|
|
stat_rx_bad_type_err => open,
|
558 |
|
|
stat_rx_mf_err => open,
|
559 |
|
|
stat_rx_descram_err => open,
|
560 |
|
|
stat_rx_mf_len_err => open,
|
561 |
|
|
stat_rx_mf_repeat_err => open,
|
562 |
|
|
stat_rx_aligned => open,
|
563 |
|
|
stat_rx_misaligned => open,
|
564 |
|
|
stat_rx_aligned_err => open,
|
565 |
|
|
stat_rx_crc24_err => open,
|
566 |
|
|
stat_rx_msop_err => open,
|
567 |
|
|
stat_rx_meop_err => open,
|
568 |
|
|
stat_rx_overflow_err => open,
|
569 |
|
|
stat_rx_burstmax_err => open,
|
570 |
|
|
stat_rx_burst_err => open,
|
571 |
|
|
gtpowergood_out => open
|
572 |
|
|
);
|
573 |
|
|
|
574 |
|
|
lbus_sim: process
|
575 |
|
|
begin
|
576 |
|
|
data0 <= (others => '0');
|
577 |
|
|
data1 <= x"1111_1111_1111_1111_1010_0101_1010_0101";
|
578 |
|
|
data2 <= x"2222_2222_2222_2222_0202_0202_0202_0202";
|
579 |
|
|
data3 <= x"3333_3333_3333_3333_3030_0303_0303_0303";
|
580 |
|
|
|
581 |
|
|
chan0 <= (others => '0');
|
582 |
|
|
ena0 <= '0';
|
583 |
|
|
sop0 <= '0';
|
584 |
|
|
eop0 <= '0';
|
585 |
|
|
err0 <= '0';
|
586 |
|
|
mty0 <= (others => '0');
|
587 |
|
|
|
588 |
|
|
chan1 <= (others => '0');
|
589 |
|
|
ena1 <= '0';
|
590 |
|
|
sop1 <= '0';
|
591 |
|
|
eop1 <= '0';
|
592 |
|
|
err1 <= '0';
|
593 |
|
|
mty1 <= (others => '0');
|
594 |
|
|
|
595 |
|
|
chan2 <= (others => '0');
|
596 |
|
|
ena2 <= '0';
|
597 |
|
|
sop2 <= '0';
|
598 |
|
|
eop2 <= '0';
|
599 |
|
|
err2 <= '0';
|
600 |
|
|
mty2 <= (others => '0');
|
601 |
|
|
|
602 |
|
|
chan3 <= (others => '0');
|
603 |
|
|
ena3 <= '0';
|
604 |
|
|
sop3 <= '0';
|
605 |
|
|
eop3 <= '0';
|
606 |
|
|
err3 <= '0';
|
607 |
|
|
mty3 <= (others => '0');
|
608 |
|
|
|
609 |
|
|
|
610 |
|
|
wait for clk300_period * 30000; --wait for initialization time
|
611 |
|
|
for i in 0 to 1000 loop
|
612 |
|
|
if tx_rdyout = '0' then
|
613 |
|
|
ena0 <= '0';
|
614 |
|
|
ena1 <= '0';
|
615 |
|
|
ena2 <= '0';
|
616 |
|
|
ena3 <= '0';
|
617 |
|
|
|
618 |
|
|
while tx_rdyout = '0' loop
|
619 |
|
|
wait for clk300_period;
|
620 |
|
|
end loop;
|
621 |
|
|
ena0 <= '1';
|
622 |
|
|
ena1 <= '1';
|
623 |
|
|
ena2 <= '1';
|
624 |
|
|
ena3 <= '1';
|
625 |
|
|
end if;
|
626 |
|
|
sop0 <= '1';
|
627 |
|
|
data0 <= x"0000_1111_2222_3333_4444_5555_6666_7777";
|
628 |
|
|
ena0 <= '1';
|
629 |
|
|
ena1 <= '1';
|
630 |
|
|
ena2 <= '1';
|
631 |
|
|
ena3 <= '1';
|
632 |
|
|
wait for clk300_period;
|
633 |
|
|
|
634 |
|
|
if tx_rdyout = '0' then
|
635 |
|
|
ena0 <= '0';
|
636 |
|
|
ena1 <= '0';
|
637 |
|
|
ena2 <= '0';
|
638 |
|
|
ena3 <= '0';
|
639 |
|
|
while tx_rdyout = '0' loop
|
640 |
|
|
wait for clk300_period;
|
641 |
|
|
end loop;
|
642 |
|
|
ena0 <= '1';
|
643 |
|
|
ena1 <= '1';
|
644 |
|
|
ena2 <= '1';
|
645 |
|
|
ena3 <= '1';
|
646 |
|
|
end if;
|
647 |
|
|
sop0 <= '0';
|
648 |
|
|
data0 <= x"8888_9999_AAAA_BBBB_CCCC_DDDD_EEEE_FFFF";
|
649 |
|
|
wait for clk300_period;
|
650 |
|
|
|
651 |
|
|
if tx_rdyout = '0' then
|
652 |
|
|
ena0 <= '0';
|
653 |
|
|
ena1 <= '0';
|
654 |
|
|
ena2 <= '0';
|
655 |
|
|
ena3 <= '0';
|
656 |
|
|
while tx_rdyout = '0' loop
|
657 |
|
|
wait for clk300_period;
|
658 |
|
|
end loop;
|
659 |
|
|
ena0 <= '1';
|
660 |
|
|
ena1 <= '1';
|
661 |
|
|
ena2 <= '1';
|
662 |
|
|
ena3 <= '1';
|
663 |
|
|
end if;
|
664 |
|
|
eop3 <= '1';
|
665 |
|
|
data0 <= x"0123_4567_89AB_CDEF_DEAD_BEEF_DEAD_FACE";
|
666 |
|
|
wait for clk300_period;
|
667 |
|
|
eop3 <= '0';
|
668 |
|
|
ena0 <= '0';
|
669 |
|
|
ena1 <= '0';
|
670 |
|
|
ena2 <= '0';
|
671 |
|
|
ena3 <= '0';
|
672 |
|
|
data0 <= (others => '0');
|
673 |
|
|
wait for clk300_period;
|
674 |
|
|
end loop;
|
675 |
|
|
wait;
|
676 |
|
|
|
677 |
|
|
end process;
|
678 |
|
|
|
679 |
|
|
|
680 |
|
|
end architecture Test;
|