1 --////////////////////////////////////////////////////////////////////////////////
4 --// /___/ \ / Vendor: Xilinx
5 --// \ \ \/ Version : 2.
5
6 --// \ \ Application : 7 Series FPGAs Transceivers Wizard
7 --// / / Filename :s6link_lpm_loop_fsm.vhd
13 -- Description : This module performs TX reset and initialization.
17 -- Module S6Link_lpm_loop_fsm
18 -- Generated by Xilinx 7 Series FPGAs Transceivers Wizard
21 -- (c) Copyright 2010-2012 Xilinx, Inc. All rights reserved.
23 -- This file contains confidential and proprietary information
24 -- of Xilinx, Inc. and is protected under U.S. and
25 -- international copyright and other intellectual property
29 -- This disclaimer is not a license and does not grant any
30 -- rights to the materials distributed herewith. Except as
31 -- otherwise provided in a valid license issued to you by
32 -- Xilinx, and to the maximum extent permitted by applicable
33 -- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS"
AND
34 -- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
35 -- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
36 -- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
37 -- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
38 -- (2) Xilinx shall
not be liable (whether
in contract
or tort,
39 -- including negligence, or under any other theory of
40 -- liability) for any loss or damage of any kind or nature
41 -- related to, arising under or in connection with these
42 -- materials, including for any direct, or any indirect,
43 -- special, incidental, or consequential loss or damage
44 -- (including loss of data, profits, goodwill, or any type of
45 -- loss or damage suffered as a result of any action brought
46 -- by a third party) even if such damage or loss was
47 -- reasonably foreseeable or Xilinx had been advised of the
48 -- possibility of the same.
50 -- CRITICAL APPLICATIONS
51 -- Xilinx products are not designed or intended to be fail-
52 -- safe, or for use in any application requiring fail-safe
53 -- performance, such as life-support or safety devices or
54 -- systems, Class III medical devices, nuclear facilities,
55 -- applications related to the deployment of airbags, or any
56 -- other applications that could lead to death, personal
57 -- injury, or severe property or environmental damage
58 -- (individually and collectively, "Critical
59 -- Applications"). Customer assumes the sole risk and
60 -- liability of any use of Xilinx products in Critical
61 -- Applications, subject only to applicable laws and
62 -- regulations governing limitations on product liability.
64 -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
65 -- PART OF THIS FILE AT ALL TIMES.
68 --*****************************************************************************
71 use IEEE.STD_LOGIC_1164.
ALL;
72 use IEEE.STD_LOGIC_UNSIGNED.
ALL;
73 use IEEE.STD_LOGIC_ARITH.
ALL;
74 use IEEE.NUMERIC_STD.
ALL;
79 lock0,lock1,lock2,lock3,clk,reset,ready :
in ;
80 di0 : in (15 downto 0);
81 holds : out (1 downto 0);
82 DI : out (15 downto 0);
83 store_di0 : out (15 downto 0);
84 Address : out (8 downto 0);
85 state : out (4 downto 0);
86 kill0 ,kill1 ,kill2 ,kill3 : out ;
95 signal holds_reg : (1 downto 0) := (others => '0');
96 signal store_di0_reg : (15 downto 0) := (others => '0');
97 signal Address_reg : (8 downto 0) := (others => '0');
98 signal state_reg : (4 downto 0) := (others => '0');
99 signal rd_drp_reg : := '0';
100 signal kill0_reg,kill1_reg,kill2_reg,kill3_reg : := '0';
101 signal done0,done1,done2,done3 : := '0';
103 constant load_addr_kl : (4 downto 0) := "00001";
104 constant rd_drp_kl : (4 downto 0) := "00010";
105 constant wait_drprdy_kl : (4 downto 0) := "00011";
106 constant mod_drp_kl : (4 downto 0) := "00100";
107 constant load_drp_kl : (4 downto 0) := "00101";
108 constant pulse_wr_kl : (4 downto 0) := "00110";
109 constant wait_drp_dy_kl : (4 downto 0) := "00111";
110 constant load_addr_kh : (4 downto 0) := "01000";
111 constant rd_drp_kh : (4 downto 0) := "01001";
112 constant wait_drprdy_kh : (4 downto 0) := "01010";
113 constant mod_drp_kh : (4 downto 0) := "01011";
114 constant load_drp_kh : (4 downto 0) := "01100";
115 constant pulse_wr_kh : (4 downto 0) := "01101";
116 constant wait_drp_dy_kh : (4 downto 0) := "01110";
117 constant endstate : (4 downto 0) := "01111";
118 constant resetstate : (4 downto 0) := "10000";
123 store_di0 <= store_di0_reg;
124 Address <= Address_reg;
126 rd_drp <= rd_drp_reg;
134 if rising_edge(clk) then
136 state_reg <= resetstate;
137 holds_reg <= (others => '0');
138 DI <= (others => '0');
139 Address_reg <= (others => '0');
142 store_di0_reg <= (others => '0');
152 if((lock0='1' and lock1='0' and lock2='0' and lock3='0' ) and kill0_reg='0') then
155 state_reg <= load_addr_kl;
161 Address_reg <= "000101011";
162 state_reg <= rd_drp_kl;
164 when rd_drp_kl => -- Start Read Sequence Wait for DRPRDY
166 state_reg <= wait_drprdy_kl;
168 when wait_drprdy_kl => -- Wait for DRPRDY
170 store_di0_reg <= di0;
171 state_reg <= mod_drp_kl;
176 store_di0_reg(11 downto 8) <= "0100";
177 state_reg <=load_drp_kl;
180 state_reg <= pulse_wr_kl;
185 state_reg <= wait_drp_dy_kl;
187 when wait_drp_dy_kl =>
190 state_reg <= load_addr_kh;
192 ------ KH LOOP ------
195 Address_reg <= "000101010";
196 state_reg <= rd_drp_kh;
197 store_di0_reg <= (others => '0');
198 DI <=(others => '0');
200 when rd_drp_kh => -- Start Read Sequence Wait for DRPRDY
202 state_reg <= wait_drprdy_kh;
204 when wait_drprdy_kh => -- Wait for DRPRDY
207 store_di0_reg <= di0;
208 state_reg <= mod_drp_kh;
213 store_di0_reg(11 downto 8) <= "0100";
214 state_reg <= load_drp_kh;
217 state_reg <= pulse_wr_kh;
222 state_reg <= wait_drp_dy_kh;
224 when wait_drp_dy_kh =>
228 state_reg <= endstate;
232 DI <= (others => '0');
233 Address_reg <= (others => '0');
237 store_di0_reg <= (others => '0');
238 state_reg <= resetstate;
240 when others => state_reg <= "XXXXX";
243 elsif((lock1='1' and lock2='0' and lock3='0') and kill1_reg='0') then
247 state_reg <= load_addr_kl;
248 store_di0_reg <= (others => '0');
249 DI <= (others => '0');
254 Address_reg <= "000101011";
255 store_di0_reg <= (others => '0');
256 state_reg <= rd_drp_kl;
258 when rd_drp_kl => -- Start Read Sequence Wait for DRPRDY
260 state_reg <= wait_drprdy_kl;
262 when wait_drprdy_kl => -- Wait for DRPRDY
265 store_di0_reg <= di0;
266 state_reg <= mod_drp_kl;
271 store_di0_reg(11 downto 8) <= "0011";
272 state_reg <= load_drp_kl;
275 state_reg <= pulse_wr_kl;
280 state_reg <= wait_drp_dy_kl;
282 when wait_drp_dy_kl =>
285 state_reg <= load_addr_kh;
287 ------ KH LOOP ------
290 Address_reg <= "000101010";
291 store_di0_reg <= (others => '0');
292 DI <= (others => '0');
293 state_reg <= rd_drp_kh;
295 when rd_drp_kh => -- Start Read Sequence Wait for DRPRDY
297 state_reg <= wait_drprdy_kh;
299 when wait_drprdy_kh => -- Wait for DRPRDY
302 store_di0_reg <= di0;
303 state_reg <= mod_drp_kh;
308 store_di0_reg(11 downto 8)<= "0011";
309 state_reg <= load_drp_kh;
312 state_reg <= pulse_wr_kh;
317 state_reg <= wait_drp_dy_kh;
319 when wait_drp_dy_kh =>
323 state_reg <= endstate;
327 DI <= (others => '0');
328 Address_reg <= (others => '0');
332 store_di0_reg <= (others => '0');
333 state_reg <= resetstate;
335 when others => state_reg <= "XXXXX";
338 elsif(lock2='1' and lock3='0' and kill2_reg='0') then
342 state_reg <= load_addr_kl;
347 Address_reg <= "000101011";
348 store_di0_reg <= (others => '0');
349 DI <= (others => '0');
350 state_reg <= rd_drp_kl;
352 when rd_drp_kl => -- Start Read Sequence Wait for DRPRDY
354 state_reg <= wait_drprdy_kl;
356 when wait_drprdy_kl => -- Wait for DRPRDY
359 store_di0_reg <= di0;
360 state_reg <= mod_drp_kl;
365 store_di0_reg(11 downto 8) <= "0010";
366 state_reg <= load_drp_kl;
369 state_reg <= pulse_wr_kl;
374 state_reg <= wait_drp_dy_kl;
376 when wait_drp_dy_kl =>
379 state_reg <= load_addr_kh;
381 ------ KH LOOP ------
384 Address_reg <= "000101010";
385 store_di0_reg <= (others => '0');
386 DI <= (others => '0');
387 state_reg <= rd_drp_kh;
389 when rd_drp_kh => -- Start Read Sequence Wait for DRPRDY
391 state_reg <= wait_drprdy_kh;
393 when wait_drprdy_kh => -- Wait for DRPRDY
396 store_di0_reg <= di0;
397 state_reg <= mod_drp_kh;
402 store_di0_reg(11 downto 8) <= "0010";
403 state_reg <=load_drp_kh;
406 state_reg <=pulse_wr_kh;
411 state_reg <= wait_drp_dy_kh;
413 when wait_drp_dy_kh =>
417 state_reg <= endstate;
421 DI <= (others => '0');
422 Address_reg <= (others => '0');
425 store_di0_reg <= (others => '0');
427 state_reg <= resetstate;
429 when others => state_reg <= "XXXXX";
433 elsif(lock3='1' and kill3_reg='0') then
438 state_reg <= load_addr_kl;
443 Address_reg <= "000101011";
444 store_di0_reg <= (others => '0');
445 DI <= (others => '0');
446 state_reg <= rd_drp_kl;
448 when rd_drp_kl => -- Start Read Sequence Wait for DRPRDY
450 state_reg <= wait_drprdy_kl;
452 when wait_drprdy_kl => -- Wait for DRPRDY
455 store_di0_reg <= di0;
456 state_reg <= mod_drp_kl;
461 store_di0_reg(11 downto 8) <= "0000";
462 state_reg <= load_drp_kl;
465 state_reg <= pulse_wr_kl;
470 state_reg <= wait_drp_dy_kl;
472 when wait_drp_dy_kl =>
475 state_reg <= load_addr_kh;
477 ------ KH LOOP ------
480 Address_reg <= "000101010";
481 store_di0_reg <= (others => '0');
482 DI <= (others => '0');
483 state_reg <= rd_drp_kh;
485 when rd_drp_kh => -- Start Read Sequence Wait for DRPRDY
487 state_reg <= wait_drprdy_kh;
489 when wait_drprdy_kh => -- Wait for DRPRDY
492 store_di0_reg <= di0;
493 state_reg <= mod_drp_kh;
498 store_di0_reg(11 downto 8) <= "0000";
499 state_reg <= load_drp_kh;
502 state_reg <= pulse_wr_kh;
507 state_reg <= wait_drp_dy_kh;
509 when wait_drp_dy_kh =>
513 state_reg <= endstate;
518 DI <= (others => '0');
519 Address_reg <= (others => '0');
522 store_di0_reg <= (others => '0');
524 state_reg <= resetstate;
526 when others => state_reg <= "XXXXX";
538 use IEEE.STD_LOGIC_1164.
ALL;
539 use IEEE.STD_LOGIC_UNSIGNED.
ALL;
540 use IEEE.STD_LOGIC_ARITH.
ALL;
544 lock0,lock1,lock2,lock3,start :
out ;
545 count_lock_out : in (31 downto 0);
546 usr_clk : in range 0 to 4095;
553 signal lock0_reg,lock1_reg,lock2_reg,lock3_reg,start_reg : := '0';
565 if rising_edge(dclk) then
574 if(count_lock_out=X"00000005") then
576 elsif((count_lock_out)=(1500*usr_clk)) then
578 elsif((count_lock_out)=(3000*usr_clk)) then
580 elsif((count_lock_out)=(4500*usr_clk)) then
588 end lock_detect_bevh;
592 use IEEE.STD_LOGIC_1164.
ALL;
593 use IEEE.STD_LOGIC_UNSIGNED.
ALL;
594 use IEEE.STD_LOGIC_ARITH.
ALL;
595 use IEEE.NUMERIC_STD.
ALL;
600 reset,start,stop : in ;
602 count_lock_out : out (31 downto 0)
608 signal count_lock_out_reg : (31 downto 0) := (others=>'0');
612 count_lock_out <= count_lock_out_reg;
616 if rising_edge(dclk) then
617 if(reset='1' or stop='1') then
618 count_lock_out_reg <= (others=>'0');
619 elsif(start='1') then
620 count_lock_out_reg <= count_lock_out_reg + '1';
622 count_lock_out_reg <= (others=>'0');
627 end counter_lpm_bevh;
629 --------/LPM MODE KL KH SPEEDUP------/
631 use IEEE.STD_LOGIC_1164.
ALL;
632 use IEEE.STD_LOGIC_UNSIGNED.
ALL;
633 use IEEE.STD_LOGIC_ARITH.
ALL;
634 use IEEE.NUMERIC_STD.
ALL;
638 usr_clk: range 0 to 4095 := 3
644 DO : in (15 downto 0);
645 holds : out (1 downto 0);
646 DI : out (15 downto 0);
647 DADDR : out (8 downto 0);
648 DWE,DEN,kill3 : out ;
649 state : out (4 downto 0);
650 count_lock_out : out (31 downto 0);
651 store_di0 : out (15 downto 0);
652 start,enable,kill0,kill1,kill2,lock0,lock1,lock2,lock3 : out
654 end S6Link_lpm_loop_fsm;
661 lock0,lock1,lock2,lock3,clk,reset,ready :
in ;
662 di0 :
in (
15 downto 0);
663 holds :
out (
1 downto 0);
664 DI :
out (
15 downto 0);
665 store_di0 :
out (
15 downto 0);
666 Address :
out (
8 downto 0);
667 state :
out (
4 downto 0);
668 kill0 ,kill1 ,kill2 ,kill3 :
out ;
676 lock0,lock1,lock2,lock3,start :
out ;
677 count_lock_out :
in (
31 downto 0);
678 usr_clk :
in range 0 to 4095;
686 reset,start,stop :
in ;
688 count_lock_out :
out (
31 downto 0)
694 signal done : := '0';
695 signal lock0_reg,lock1_reg,lock2_reg,lock3_reg,start_reg : := '0';
696 signal holds_reg : (1 downto 0);
697 signal DADDR_reg : (8 downto 0);
698 signal kill3_reg,kill2_reg : ;
699 signal count_lock_out_reg : (31 downto 0);
700 signal enable_reg,kill0_reg,kill1_reg : ;
705 DEN <= rd_drp or wr_drp;
717 count_lock_out <= count_lock_out_reg;
718 enable <= enable_reg;
732 store_di0 => store_di0,
739 Address => DADDR_reg,
749 count_lock_out => count_lock_out_reg,
763 count_lock_out => count_lock_out_reg,
768 end lpm_loop_fsm_bevh;