AMC13
Firmwares for the different applications of the AMC13 uTCA board made at Boston University
 All Classes Variables
s6link_lpm_loop_fsm.vhd
1 --////////////////////////////////////////////////////////////////////////////////
2 --// ____ ____
3 --// / /\/ /
4 --// /___/ \ / Vendor: Xilinx
5 --// \ \ \/ Version : 2.5
6 --// \ \ Application : 7 Series FPGAs Transceivers Wizard
7 --// / / Filename :s6link_lpm_loop_fsm.vhd
8 --// /___/ /\
9 --// \ \ / \
10 --// \___\/\___\
11 --//
12 --//
13 -- Description : This module performs TX reset and initialization.
14 --
15 --
16 --
17 -- Module S6Link_lpm_loop_fsm
18 -- Generated by Xilinx 7 Series FPGAs Transceivers Wizard
19 --
20 --
21 -- (c) Copyright 2010-2012 Xilinx, Inc. All rights reserved.
22 --
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
26 -- laws.
27 --
28 -- DISCLAIMER
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.
49 --
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.
63 --
64 -- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
65 -- PART OF THIS FILE AT ALL TIMES.
66 
67 
68 --*****************************************************************************
69 
70 library IEEE;
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;
75 
76 entity drp_wr_fsm_lpm is
77 port
78 (
79 lock0,lock1,lock2,lock3,clk,reset,ready : in std_logic;
80 di0 : in std_logic_vector(15 downto 0);
81 holds : out std_logic_vector(1 downto 0);
82 DI : out std_logic_vector(15 downto 0);
83 store_di0 : out std_logic_vector(15 downto 0);
84 Address : out std_logic_vector(8 downto 0);
85 state : out std_logic_vector(4 downto 0);
86 kill0 ,kill1 ,kill2 ,kill3 : out std_logic;
87 rd_drp : out std_logic;
88 wr_drp : out std_logic
89 );
90 end drp_wr_fsm_lpm;
91 
92 architecture drp_wr_fsm_bevh of drp_wr_fsm_lpm is
93 
94 
95 signal holds_reg : std_logic_vector(1 downto 0) := (others => '0');
96 signal store_di0_reg : std_logic_vector(15 downto 0) := (others => '0');
97 signal Address_reg : std_logic_vector(8 downto 0) := (others => '0');
98 signal state_reg : std_logic_vector(4 downto 0) := (others => '0');
99 signal rd_drp_reg : std_logic := '0';
100 signal kill0_reg,kill1_reg,kill2_reg,kill3_reg : std_logic := '0';
101 signal done0,done1,done2,done3 : std_logic := '0';
102 
103 constant load_addr_kl : std_logic_vector(4 downto 0) := "00001";
104 constant rd_drp_kl : std_logic_vector(4 downto 0) := "00010";
105 constant wait_drprdy_kl : std_logic_vector(4 downto 0) := "00011";
106 constant mod_drp_kl : std_logic_vector(4 downto 0) := "00100";
107 constant load_drp_kl : std_logic_vector(4 downto 0) := "00101";
108 constant pulse_wr_kl : std_logic_vector(4 downto 0) := "00110";
109 constant wait_drp_dy_kl : std_logic_vector(4 downto 0) := "00111";
110 constant load_addr_kh : std_logic_vector(4 downto 0) := "01000";
111 constant rd_drp_kh : std_logic_vector(4 downto 0) := "01001";
112 constant wait_drprdy_kh : std_logic_vector(4 downto 0) := "01010";
113 constant mod_drp_kh : std_logic_vector(4 downto 0) := "01011";
114 constant load_drp_kh : std_logic_vector(4 downto 0) := "01100";
115 constant pulse_wr_kh : std_logic_vector(4 downto 0) := "01101";
116 constant wait_drp_dy_kh : std_logic_vector(4 downto 0) := "01110";
117 constant endstate : std_logic_vector(4 downto 0) := "01111";
118 constant resetstate : std_logic_vector(4 downto 0) := "10000";
119 
120 begin
121 
122 holds <= holds_reg;
123 store_di0 <= store_di0_reg;
124 Address <= Address_reg;
125 state <= state_reg;
126 rd_drp <= rd_drp_reg;
127 kill0 <= kill0_reg;
128 kill1 <= kill1_reg;
129 kill2 <= kill2_reg;
130 kill3 <= kill3_reg;
131 
132 process(clk)
133 begin
134 if rising_edge(clk) then
135  if(reset='1') then
136  state_reg <= resetstate;
137  holds_reg <= (others => '0');
138  DI <= (others => '0');
139  Address_reg <= (others => '0');
140  wr_drp <= '0';
141  rd_drp_reg <= '0';
142  store_di0_reg <= (others => '0');
143  done0 <= '0';
144  done1 <= '0';
145  done2 <= '0';
146  done3 <= '0';
147  kill0_reg <= '0';
148  kill1_reg <= '0';
149  kill2_reg <= '0';
150  kill3_reg <= '0';
151  else
152  if((lock0='1' and lock1='0' and lock2='0' and lock3='0' ) and kill0_reg='0') then
153  case state_reg is
154  when resetstate =>
155  state_reg <= load_addr_kl;
156  done0 <= '0';
157  holds_reg <= "00";
158 
159  ---- KL LOOP ----
160  when load_addr_kl =>
161  Address_reg <= "000101011";
162  state_reg <= rd_drp_kl;
163 
164  when rd_drp_kl => -- Start Read Sequence Wait for DRPRDY
165  rd_drp_reg <= '1';
166  state_reg <= wait_drprdy_kl;
167 
168  when wait_drprdy_kl => -- Wait for DRPRDY
169  if(ready='1') then
170  store_di0_reg <= di0;
171  state_reg <= mod_drp_kl;
172  end if;
173 
174  when mod_drp_kl =>
175  rd_drp_reg <= '0';
176  store_di0_reg(11 downto 8) <= "0100";
177  state_reg <=load_drp_kl;
178 
179  when load_drp_kl =>
180  state_reg <= pulse_wr_kl;
181  DI <= store_di0_reg;
182 
183  when pulse_wr_kl =>
184  wr_drp <= '1';
185  state_reg <= wait_drp_dy_kl;
186 
187  when wait_drp_dy_kl =>
188  wr_drp <= '0';
189  if(ready='1') then
190  state_reg <= load_addr_kh;
191  end if;
192  ------ KH LOOP ------
193 
194  when load_addr_kh =>
195  Address_reg <= "000101010";
196  state_reg <= rd_drp_kh;
197  store_di0_reg <= (others => '0');
198  DI <=(others => '0');
199 
200  when rd_drp_kh => -- Start Read Sequence Wait for DRPRDY
201  rd_drp_reg <= '1';
202  state_reg <= wait_drprdy_kh;
203 
204  when wait_drprdy_kh => -- Wait for DRPRDY
205  if(ready='1') then
206  rd_drp_reg <= '0';
207  store_di0_reg <= di0;
208  state_reg <= mod_drp_kh;
209  end if;
210 
211  when mod_drp_kh =>
212  rd_drp_reg <= '0';
213  store_di0_reg(11 downto 8) <= "0100";
214  state_reg <= load_drp_kh;
215 
216  when load_drp_kh =>
217  state_reg <= pulse_wr_kh;
218  DI <= store_di0_reg;
219 
220  when pulse_wr_kh =>
221  wr_drp <= '1';
222  state_reg <= wait_drp_dy_kh;
223 
224  when wait_drp_dy_kh =>
225  if(ready='1') then
226  wr_drp <= '0';
227  done0 <= '1';
228  state_reg <= endstate;
229  end if;
230 
231  when endstate =>
232  DI <= (others => '0');
233  Address_reg <= (others => '0');
234  wr_drp <= '0';
235  rd_drp_reg <= '0';
236  kill0_reg <= done0;
237  store_di0_reg <= (others => '0');
238  state_reg <= resetstate;
239 
240  when others => state_reg <= "XXXXX";
241 
242  end case;
243  elsif((lock1='1' and lock2='0' and lock3='0') and kill1_reg='0') then
244  case state_reg is
245 
246  when resetstate =>
247  state_reg <= load_addr_kl;
248  store_di0_reg <= (others => '0');
249  DI <= (others => '0');
250  done1 <= '0';
251  ---- KL LOOP ----
252 
253  when load_addr_kl =>
254  Address_reg <= "000101011";
255  store_di0_reg <= (others => '0');
256  state_reg <= rd_drp_kl;
257 
258  when rd_drp_kl => -- Start Read Sequence Wait for DRPRDY
259  rd_drp_reg <= '1';
260  state_reg <= wait_drprdy_kl;
261 
262  when wait_drprdy_kl => -- Wait for DRPRDY
263  if(ready='1') then
264  rd_drp_reg <= '0';
265  store_di0_reg <= di0;
266  state_reg <= mod_drp_kl;
267  end if;
268 
269  when mod_drp_kl =>
270  rd_drp_reg <= '0';
271  store_di0_reg(11 downto 8) <= "0011";
272  state_reg <= load_drp_kl;
273 
274  when load_drp_kl =>
275  state_reg <= pulse_wr_kl;
276  DI <= store_di0_reg;
277 
278  when pulse_wr_kl =>
279  wr_drp <= '1';
280  state_reg <= wait_drp_dy_kl;
281 
282  when wait_drp_dy_kl =>
283  if(ready='1') then
284  wr_drp <= '0';
285  state_reg <= load_addr_kh;
286  end if;
287  ------ KH LOOP ------
288 
289  when load_addr_kh =>
290  Address_reg <= "000101010";
291  store_di0_reg <= (others => '0');
292  DI <= (others => '0');
293  state_reg <= rd_drp_kh;
294 
295  when rd_drp_kh => -- Start Read Sequence Wait for DRPRDY
296  rd_drp_reg <= '1';
297  state_reg <= wait_drprdy_kh;
298 
299  when wait_drprdy_kh => -- Wait for DRPRDY
300  if(ready='1') then
301  rd_drp_reg <= '0';
302  store_di0_reg <= di0;
303  state_reg <= mod_drp_kh;
304  end if;
305 
306  when mod_drp_kh =>
307  rd_drp_reg <= '0';
308  store_di0_reg(11 downto 8)<= "0011";
309  state_reg <= load_drp_kh;
310 
311  when load_drp_kh =>
312  state_reg <= pulse_wr_kh;
313  DI <= store_di0_reg;
314 
315  when pulse_wr_kh =>
316  wr_drp <= '1';
317  state_reg <= wait_drp_dy_kh;
318 
319  when wait_drp_dy_kh =>
320  if(ready='1') then
321  wr_drp <= '0';
322  done1 <= '1';
323  state_reg <= endstate;
324  end if;
325 
326  when endstate =>
327  DI <= (others => '0');
328  Address_reg <= (others => '0');
329  wr_drp <= '0';
330  rd_drp_reg <= '0';
331  kill1_reg <= done1;
332  store_di0_reg <= (others => '0');
333  state_reg <= resetstate;
334 
335  when others => state_reg <= "XXXXX";
336 
337  end case;
338  elsif(lock2='1' and lock3='0' and kill2_reg='0') then
339  case state_reg is
340 
341  when resetstate =>
342  state_reg <= load_addr_kl;
343  done2 <= '0';
344  ---- KL LOOP ----
345 
346  when load_addr_kl =>
347  Address_reg <= "000101011";
348  store_di0_reg <= (others => '0');
349  DI <= (others => '0');
350  state_reg <= rd_drp_kl;
351 
352  when rd_drp_kl => -- Start Read Sequence Wait for DRPRDY
353  rd_drp_reg <= '1';
354  state_reg <= wait_drprdy_kl;
355 
356  when wait_drprdy_kl => -- Wait for DRPRDY
357  if(ready='1') then
358  rd_drp_reg <= '0';
359  store_di0_reg <= di0;
360  state_reg <= mod_drp_kl;
361  end if;
362 
363  when mod_drp_kl =>
364  rd_drp_reg <= '0';
365  store_di0_reg(11 downto 8) <= "0010";
366  state_reg <= load_drp_kl;
367 
368  when load_drp_kl =>
369  state_reg <= pulse_wr_kl;
370  DI <= store_di0_reg;
371 
372  when pulse_wr_kl =>
373  wr_drp <= '1';
374  state_reg <= wait_drp_dy_kl;
375 
376  when wait_drp_dy_kl =>
377  if(ready='1') then
378  wr_drp <= '0';
379  state_reg <= load_addr_kh;
380  end if;
381  ------ KH LOOP ------
382 
383  when load_addr_kh =>
384  Address_reg <= "000101010";
385  store_di0_reg <= (others => '0');
386  DI <= (others => '0');
387  state_reg <= rd_drp_kh;
388 
389  when rd_drp_kh => -- Start Read Sequence Wait for DRPRDY
390  rd_drp_reg <= '1';
391  state_reg <= wait_drprdy_kh;
392 
393  when wait_drprdy_kh => -- Wait for DRPRDY
394  if(ready='1') then
395  rd_drp_reg <= '0';
396  store_di0_reg <= di0;
397  state_reg <= mod_drp_kh;
398  end if;
399 
400  when mod_drp_kh =>
401  rd_drp_reg <= '0';
402  store_di0_reg(11 downto 8) <= "0010";
403  state_reg <=load_drp_kh;
404 
405  when load_drp_kh =>
406  state_reg <=pulse_wr_kh;
407  DI <= store_di0_reg;
408 
409  when pulse_wr_kh =>
410  wr_drp <= '1';
411  state_reg <= wait_drp_dy_kh;
412 
413  when wait_drp_dy_kh =>
414  if(ready='1') then
415  wr_drp <= '0';
416  done2<= '1';
417  state_reg <= endstate;
418  end if;
419 
420  when endstate =>
421  DI <= (others => '0');
422  Address_reg <= (others => '0');
423  wr_drp <= '0';
424  rd_drp_reg <= '0';
425  store_di0_reg <= (others => '0');
426  kill2_reg <= done2;
427  state_reg <= resetstate;
428 
429  when others => state_reg <= "XXXXX";
430 
431  end case;
432 
433  elsif(lock3='1' and kill3_reg='0') then
434 
435  case state_reg is
436 
437  when resetstate =>
438  state_reg <= load_addr_kl;
439  done3 <= '0';
440  ---- KL LOOP ----
441 
442  when load_addr_kl =>
443  Address_reg <= "000101011";
444  store_di0_reg <= (others => '0');
445  DI <= (others => '0');
446  state_reg <= rd_drp_kl;
447 
448  when rd_drp_kl => -- Start Read Sequence Wait for DRPRDY
449  rd_drp_reg <= '1';
450  state_reg <= wait_drprdy_kl;
451 
452  when wait_drprdy_kl => -- Wait for DRPRDY
453  if(ready='1') then
454  rd_drp_reg <= '0';
455  store_di0_reg <= di0;
456  state_reg <= mod_drp_kl;
457  end if;
458 
459  when mod_drp_kl =>
460  rd_drp_reg <= '0';
461  store_di0_reg(11 downto 8) <= "0000";
462  state_reg <= load_drp_kl;
463 
464  when load_drp_kl =>
465  state_reg <= pulse_wr_kl;
466  DI <= store_di0_reg;
467 
468  when pulse_wr_kl =>
469  wr_drp <= '1';
470  state_reg <= wait_drp_dy_kl;
471 
472  when wait_drp_dy_kl =>
473  if(ready='1') then
474  wr_drp <= '0';
475  state_reg <= load_addr_kh;
476  end if;
477  ------ KH LOOP ------
478 
479  when load_addr_kh =>
480  Address_reg <= "000101010";
481  store_di0_reg <= (others => '0');
482  DI <= (others => '0');
483  state_reg <= rd_drp_kh;
484 
485  when rd_drp_kh => -- Start Read Sequence Wait for DRPRDY
486  rd_drp_reg <= '1';
487  state_reg <= wait_drprdy_kh;
488 
489  when wait_drprdy_kh => -- Wait for DRPRDY
490  if(ready='1') then
491  rd_drp_reg <= '0';
492  store_di0_reg <= di0;
493  state_reg <= mod_drp_kh;
494  end if;
495 
496  when mod_drp_kh =>
497  rd_drp_reg <= '0';
498  store_di0_reg(11 downto 8) <= "0000";
499  state_reg <= load_drp_kh;
500 
501  when load_drp_kh =>
502  state_reg <= pulse_wr_kh;
503  DI <= store_di0_reg;
504 
505  when pulse_wr_kh =>
506  wr_drp <= '1';
507  state_reg <= wait_drp_dy_kh;
508 
509  when wait_drp_dy_kh =>
510  if(ready='1') then
511  wr_drp <= '0';
512  done3 <= '1';
513  state_reg <= endstate;
514  end if;
515 
516  when endstate =>
517  holds_reg <= "11";
518  DI <= (others => '0');
519  Address_reg <= (others => '0');
520  wr_drp <= '0';
521  rd_drp_reg <= '0';
522  store_di0_reg <= (others => '0');
523  kill3_reg <= done3;
524  state_reg <= resetstate;
525 
526  when others => state_reg <= "XXXXX";
527 
528  end case;
529  end if;
530  end if;
531 end if;
532 end process;
533 
534 end drp_wr_fsm_bevh;
535 
536 
537 library IEEE;
538 use IEEE.STD_LOGIC_1164.ALL;
539 use IEEE.STD_LOGIC_UNSIGNED.ALL;
540 use IEEE.STD_LOGIC_ARITH.ALL;
541 
543 port(
544  lock0,lock1,lock2,lock3,start : out std_logic;
545  count_lock_out : in std_logic_vector(31 downto 0);
546  usr_clk : in integer range 0 to 4095;
547  dclk,reset : in std_logic
548 );
549 end lock_detect_lpm;
550 
551 architecture lock_detect_bevh of lock_detect_lpm is
552 
553 signal lock0_reg,lock1_reg,lock2_reg,lock3_reg,start_reg : std_logic := '0';
554 
555 begin
556 
557 start <= start_reg;
558 lock0 <= lock0_reg;
559 lock1 <= lock1_reg;
560 lock2 <= lock2_reg;
561 lock3 <= lock3_reg;
562 
563 process(dclk)
564 begin
565  if rising_edge(dclk) then
566  if(reset='1') then
567  lock0_reg <= '0';
568  lock1_reg <= '0';
569  lock2_reg <= '0';
570  lock3_reg <= '0';
571  start_reg <= '0';
572  else
573  start_reg <= '1';
574  if(count_lock_out=X"00000005") then
575  lock0_reg <= '1';
576  elsif(UNSIGNED(count_lock_out)=(1500*usr_clk)) then
577  lock1_reg <= '1';
578  elsif(UNSIGNED(count_lock_out)=(3000*usr_clk)) then
579  lock2_reg <= '1';
580  elsif(UNSIGNED(count_lock_out)=(4500*usr_clk)) then
581  lock3_reg <= '1';
582  start_reg <= '0';
583  end if;
584  end if;
585  end if;
586 end process;
587 
588 end lock_detect_bevh;
589 
590 
591 library IEEE;
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;
596 
597 entity counter_lpm is
598 port
599 (
600 reset,start,stop : in std_logic;
601 dclk : in std_logic;
602 count_lock_out : out std_logic_vector(31 downto 0)
603 );
604 end counter_lpm;
605 
606 architecture counter_lpm_bevh of counter_lpm is
607 
608 signal count_lock_out_reg : std_logic_vector(31 downto 0) := (others=>'0');
609 
610 begin
611 
612 count_lock_out <= count_lock_out_reg;
613 
614 process(dclk)
615 begin
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';
621  else
622  count_lock_out_reg <= (others=>'0');
623  end if;
624  end if;
625 end process;
626 
627 end counter_lpm_bevh;
628 
629 --------/LPM MODE KL KH SPEEDUP------/
630 library IEEE;
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;
635 
637 generic (
638  usr_clk: integer range 0 to 4095 := 3
639  );
640 Port(
641 DCLK : in std_logic;
642 reset : in std_logic;
643 DRDY : in std_logic;
644 DO : in std_logic_vector(15 downto 0);
645 holds : out std_logic_vector(1 downto 0);
646 DI : out std_logic_vector(15 downto 0);
647 DADDR : out std_logic_vector(8 downto 0);
648 DWE,DEN,kill3 : out std_logic;
649 state : out std_logic_vector(4 downto 0);
650 count_lock_out : out std_logic_vector(31 downto 0);
651 store_di0 : out std_logic_vector(15 downto 0);
652 start,enable,kill0,kill1,kill2,lock0,lock1,lock2,lock3 : out std_logic
653 );
654 end S6Link_lpm_loop_fsm;
655 
656 architecture lpm_loop_fsm_bevh of S6Link_lpm_loop_fsm is
657 
658 component drp_wr_fsm_lpm
659 port
660 (
661 lock0,lock1,lock2,lock3,clk,reset,ready : in std_logic;
662 di0 : in std_logic_vector(15 downto 0);
663 holds : out std_logic_vector(1 downto 0);
664 DI : out std_logic_vector(15 downto 0);
665 store_di0 : out std_logic_vector(15 downto 0);
666 Address : out std_logic_vector(8 downto 0);
667 state : out std_logic_vector(4 downto 0);
668 kill0 ,kill1 ,kill2 ,kill3 : out std_logic;
669 rd_drp : out std_logic;
670 wr_drp : out std_logic
671 );
672 end component;
673 
674 component lock_detect_lpm
675 port(
676  lock0,lock1,lock2,lock3,start : out std_logic;
677  count_lock_out : in std_logic_vector(31 downto 0);
678  usr_clk : in integer range 0 to 4095;
679  dclk,reset : in std_logic
680 );
681 end component;
682 
683 component counter_lpm
684 port
685 (
686 reset,start,stop : in std_logic;
687 dclk : in std_logic;
688 count_lock_out : out std_logic_vector(31 downto 0)
689 );
690 end component;
691 
692 signal rd_drp : std_logic;
693 signal wr_drp : std_logic;
694 signal done : std_logic := '0';
695 signal lock0_reg,lock1_reg,lock2_reg,lock3_reg,start_reg : std_logic := '0';
696 signal holds_reg : std_logic_vector(1 downto 0);
697 signal DADDR_reg : std_logic_vector(8 downto 0);
698 signal kill3_reg,kill2_reg : std_logic;
699 signal count_lock_out_reg : std_logic_vector(31 downto 0);
700 signal enable_reg,kill0_reg,kill1_reg : std_logic;
701 
702 begin
703 
704 DWE <= wr_drp;
705 DEN <= rd_drp or wr_drp;
706 start <= start_reg;
707 lock0 <= lock0_reg;
708 lock1 <= lock1_reg;
709 lock2 <= lock2_reg;
710 lock3 <= lock3_reg;
711 holds <= holds_reg;
712 DADDR <= DADDR_reg;
713 kill0 <= kill0_reg;
714 kill1 <= kill1_reg;
715 kill2 <= kill2_reg;
716 kill3 <= kill3_reg;
717 count_lock_out <= count_lock_out_reg;
718 enable <= enable_reg;
719 
720 I1 : drp_wr_fsm_lpm
721 port map
722 (
723  lock0 => lock0_reg,
724  lock1 => lock1_reg,
725  lock2 => lock2_reg,
726  lock3 => lock3_reg,
727  clk => DCLK,
728  reset => reset,
729  ready => DRDY,
730  holds => holds_reg,
731  kill0 => kill0_reg,
732  store_di0 => store_di0,
733  kill1 => kill1_reg,
734  kill2 => kill2_reg,
735  kill3 => kill3_reg,
736  state => state,
737  DI => DI,
738  di0 => DO,
739  Address => DADDR_reg,
740  rd_drp => rd_drp,
741  wr_drp => wr_drp
742 );
743 
744 
745 I2 : lock_detect_lpm
746 port map
747 (
748  start => start_reg,
749  count_lock_out => count_lock_out_reg,
750  usr_clk => usr_clk,
751  dclk => DCLK,
752  reset => reset,
753  lock0 => lock0_reg,
754  lock1 => lock1_reg,
755  lock2 => lock2_reg,
756  lock3 => lock3_reg
757 );
758 
759 I3 : counter_lpm
760 port map(
761  dclk => DCLK,
762  reset => reset,
763  count_lock_out => count_lock_out_reg,
764  start => start_reg,
765  stop => done
766 );
767 
768 end lpm_loop_fsm_bevh;
769