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

Subversion Repositories pcie_sg_dma

[/] [pcie_sg_dma/] [branches/] [Virtex6/] [ML605_ISE13.3/] [ipcore_dir_ISE13.3/] [v6_pcie_v1_7_x1/] [source/] [pcie_reset_delay_v6.vhd] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 barabba
-------------------------------------------------------------------------------
2
--
3
-- (c) Copyright 2009-2011 Xilinx, Inc. All rights reserved.
4
--
5
-- This file contains confidential and proprietary information
6
-- of Xilinx, Inc. and is protected under U.S. and
7
-- international copyright and other intellectual property
8
-- laws.
9
--
10
-- DISCLAIMER
11
-- This disclaimer is not a license and does not grant any
12
-- rights to the materials distributed herewith. Except as
13
-- otherwise provided in a valid license issued to you by
14
-- Xilinx, and to the maximum extent permitted by applicable
15
-- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
16
-- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
17
-- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
18
-- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
19
-- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
20
-- (2) Xilinx shall not be liable (whether in contract or tort,
21
-- including negligence, or under any other theory of
22
-- liability) for any loss or damage of any kind or nature
23
-- related to, arising under or in connection with these
24
-- materials, including for any direct, or any indirect,
25
-- special, incidental, or consequential loss or damage
26
-- (including loss of data, profits, goodwill, or any type of
27
-- loss or damage suffered as a result of any action brought
28
-- by a third party) even if such damage or loss was
29
-- reasonably foreseeable or Xilinx had been advised of the
30
-- possibility of the same.
31
--
32
-- CRITICAL APPLICATIONS
33
-- Xilinx products are not designed or intended to be fail-
34
-- safe, or for use in any application requiring fail-safe
35
-- performance, such as life-support or safety devices or
36
-- systems, Class III medical devices, nuclear facilities,
37
-- applications related to the deployment of airbags, or any
38
-- other applications that could lead to death, personal
39
-- injury, or severe property or environmental damage
40
-- (individually and collectively, "Critical
41
-- Applications"). Customer assumes the sole risk and
42
-- liability of any use of Xilinx products in Critical
43
-- Applications, subject only to applicable laws and
44
-- regulations governing limitations on product liability.
45
--
46
-- THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
47
-- PART OF THIS FILE AT ALL TIMES.
48
--
49
-------------------------------------------------------------------------------
50
-- Project    : Virtex-6 Integrated Block for PCI Express
51
-- File       : pcie_reset_delay_v6.vhd
52
-- Version    : 1.7
53
-- Description: sys_reset_n delay (20ms) for Virtex6 PCIe Block
54
--
55
--
56
--
57
--------------------------------------------------------------------------------
58
 
59
library ieee;
60
   use ieee.std_logic_1164.all;
61
   use ieee.std_logic_unsigned.all;
62
 
63
entity pcie_reset_delay_v6 is
64
   generic (
65
 
66
      PL_FAST_TRAIN                                : boolean := FALSE;
67
      REF_CLK_FREQ                                 : integer := 0                -- 0 - 100 MHz, 1 - 125 MHz, 2 - 250 MHz
68
   );
69
   port (
70
      ref_clk                                      : in std_logic;
71
      sys_reset_n                                  : in std_logic;
72
      delayed_sys_reset_n                          : out std_logic
73
   );
74
end pcie_reset_delay_v6;
75
 
76
architecture v6_pcie of pcie_reset_delay_v6 is
77
 
78
   constant TCQ                                    : integer := 1;
79
 
80
  function t_bit(
81
    constant PL_FAST_TRAIN    : boolean;
82
    constant REF_CLK_FREQ     : integer)
83
    return integer is
84
     variable tbit_out : integer := 2;
85
  begin  -- t_bit
86
 
87
    if (PL_FAST_TRAIN) then
88
      tbit_out := 2;
89
    else
90
     if (REF_CLK_FREQ = 0) then
91
      tbit_out := 20;
92
     elsif (REF_CLK_FREQ = 1) then
93
      tbit_out := 20;
94
     else
95
      tbit_out := 21;
96
     end if;
97
    end if;
98
    return tbit_out;
99
  end t_bit;
100
 
101
   constant TBIT                                   : integer := t_bit(PL_FAST_TRAIN, REF_CLK_FREQ);
102
 
103
   signal reg_count_7_0                            : std_logic_vector(7 downto 0);
104
   signal reg_count_15_8                           : std_logic_vector(7 downto 0);
105
   signal reg_count_23_16                          : std_logic_vector(7 downto 0);
106
   signal concat_count                             : std_logic_vector(23 downto 0);
107
 
108
   -- X-HDL generated signals
109
 
110
   signal v6pcie1 : std_logic_vector(7 downto 0);
111
   signal v6pcie2 : std_logic_vector(7 downto 0);
112
 
113
   -- Declare intermediate signals for referenced outputs
114
   signal delayed_sys_reset_n_v6pcie0                  : std_logic;
115
 
116
begin
117
   -- Drive referenced outputs
118
   delayed_sys_reset_n <= delayed_sys_reset_n_v6pcie0;
119
 
120
   concat_count <= (reg_count_23_16 & reg_count_15_8 & reg_count_7_0);
121
 
122
 
123
   v6pcie1 <= reg_count_15_8 + "00000001" when (reg_count_7_0 = "11111111") else
124
              reg_count_15_8;
125
 
126
   v6pcie2 <= reg_count_23_16 + "00000001" when ((reg_count_15_8 = "11111111") and (reg_count_7_0 = "11111111")) else
127
              reg_count_23_16;
128
 
129
   process (ref_clk, sys_reset_n)
130
   begin
131
     if ((not(sys_reset_n)) = '1') then
132
 
133
        reg_count_7_0 <= "00000000" after (TCQ)*1 ps;
134
        reg_count_15_8 <= "00000000" after (TCQ)*1 ps;
135
        reg_count_23_16 <= "00000000" after (TCQ)*1 ps;
136
 
137
     elsif (ref_clk'event and ref_clk = '1') then
138
 
139
       if (delayed_sys_reset_n_v6pcie0 /= '1') then
140
 
141
         reg_count_7_0 <= reg_count_7_0 + "00000001" after (TCQ)*1 ps;
142
         reg_count_15_8 <= v6pcie1 after (TCQ)*1 ps;
143
         reg_count_23_16 <= v6pcie2 after (TCQ)*1 ps;
144
 
145
       end if;
146
 
147
     end if;
148
   end process;
149
 
150
 
151
   delayed_sys_reset_n_v6pcie0 <= concat_count(TBIT);
152
 
153
end v6_pcie;
154
 
155
 

powered by: WebSVN 2.1.0

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