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/] [simulation/] [functional/] [board.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       : board.vhd
52
-- Version    : 1.7
53
--
54
-- Description:  Top level testbench
55
--
56
--
57
------------------------------------------------------------------------------
58
 
59
library ieee;
60
use ieee.std_logic_1164.all;
61
use ieee.std_logic_textio.all;
62
use ieee.numeric_std.all;
63
 
64
library std;
65
use std.textio.all;
66
 
67
entity board is
68
generic (
69
   REF_CLK_FREQ   : integer    := 0  -- 0 - 100 MHz, 1 - 125 MHz, 2 - 250 MHz
70
);
71
end board;
72
 
73
architecture rtl of board is
74
 
75
component xilinx_pcie_2_0_ep_v6 is
76
generic (
77
  PL_FAST_TRAIN   : boolean := TRUE
78
) ;
79
port  (
80
 
81
  sys_clk_p         : in std_logic;
82
  sys_clk_n         : in std_logic;
83
  sys_reset_n       : in std_logic;
84
 
85
  pci_exp_rxn       : in std_logic_vector(0 downto 0);
86
  pci_exp_rxp       : in std_logic_vector(0 downto 0);
87
  pci_exp_txn       : out std_logic_vector(0 downto 0);
88
  pci_exp_txp       : out std_logic_vector(0 downto 0)
89
 
90
);
91
 
92
end component;
93
 
94
component xilinx_pcie_2_0_rport_v6 is
95
generic (
96
          REF_CLK_FREQ   : integer;          -- 0 - 100 MHz, 1 - 125 MHz,  2 - 250 MHz
97
          ALLOW_X8_GEN2  : boolean;
98
          PL_FAST_TRAIN  : boolean;
99
          LINK_CAP_MAX_LINK_SPEED : bit_vector;
100
          DEVICE_ID : bit_vector;
101
          LINK_CAP_MAX_LINK_WIDTH  : bit_vector;
102
          LINK_CAP_MAX_LINK_WIDTH_int  : integer;
103
          LINK_CTRL2_TARGET_LINK_SPEED  : bit_vector;
104
          LTSSM_MAX_LINK_WIDTH  : bit_vector;
105
          DEV_CAP_MAX_PAYLOAD_SUPPORTED : integer;
106
          USER_CLK_FREQ : integer;
107
          VC0_TX_LASTPACKET : integer;
108
          VC0_RX_RAM_LIMIT : bit_vector;
109
          VC0_TOTAL_CREDITS_PD : integer;
110
          VC0_TOTAL_CREDITS_CD : integer
111
);
112
port  (
113
 
114
  sys_clk : in std_logic;
115
  sys_reset_n : in std_logic;
116
 
117
  pci_exp_rxn : in std_logic_vector((LINK_CAP_MAX_LINK_WIDTH_int - 1) downto 0);
118
  pci_exp_rxp : in std_logic_vector((LINK_CAP_MAX_LINK_WIDTH_int - 1) downto 0);
119
  pci_exp_txn : out std_logic_vector((LINK_CAP_MAX_LINK_WIDTH_int - 1) downto 0);
120
  pci_exp_txp : out std_logic_vector((LINK_CAP_MAX_LINK_WIDTH_int - 1) downto 0)
121
 
122
);
123
end component;
124
 
125
component sys_clk_gen
126
generic (
127
  CLK_FREQ: integer
128
);
129
port (
130
 
131
  sys_clk : out std_logic
132
 
133
);
134
end component;
135
 
136
 
137
component sys_clk_gen_ds
138
generic (
139
  CLK_FREQ: integer
140
);
141
port (
142
 
143
  sys_clk_p : out std_logic;
144
  sys_clk_n : out std_logic
145
 
146
);
147
end component;
148
 
149
signal cor_sys_reset_n : std_logic := '1';
150
signal ep_sys_clk_p : std_logic;
151
signal ep_sys_clk_n : std_logic;
152
signal rp_sys_clk : std_logic;
153
 
154
signal cor_pci_exp_txn : std_logic_vector(0 downto 0);
155
signal cor_pci_exp_txp : std_logic_vector(0 downto 0);
156
signal cor_pci_exp_rxn : std_logic_vector(0 downto 0);
157
signal cor_pci_exp_rxp : std_logic_vector(0 downto 0);
158
 
159
shared variable i          : INTEGER;
160
 
161
--************************************************************
162
--     Proc : writeNowToScreen
163
--     Inputs : Text String
164
--     Outputs : None
165
--     Description : Displays current simulation time and text string to
166
--          standard output.
167
--   *************************************************************
168
 
169
procedure writeNowToScreen (
170
 
171
  text_string                 : in string
172
 
173
) is
174
 
175
  variable L      : line;
176
 
177
begin
178
 
179
  write (L, String'("[ "));
180
  write (L, now);
181
  write (L, String'(" ] : "));
182
  write (L, text_string);
183
  writeline (output, L);
184
 
185
end writeNowToScreen;
186
 
187
 
188
 
189
begin
190
 
191
EP_INST : xilinx_pcie_2_0_ep_v6 generic map (
192
 
193
  PL_FAST_TRAIN => TRUE
194
 
195
)
196
port  map (
197
 
198
  sys_clk_p => ep_sys_clk_p,
199
  sys_clk_n => ep_sys_clk_n,
200
 
201
        --PCI-Express Interface
202
  pci_exp_rxn => cor_pci_exp_rxn,
203
  pci_exp_rxp => cor_pci_exp_rxp,
204
  pci_exp_txn => cor_pci_exp_txn,
205
  pci_exp_txp => cor_pci_exp_txp,
206
 
207
  sys_reset_n => cor_sys_reset_n
208
 
209
);
210
 
211
 
212
RP : xilinx_pcie_2_0_rport_v6
213
generic map (
214
      REF_CLK_FREQ => REF_CLK_FREQ,
215
      ALLOW_X8_GEN2 => FALSE,
216
      PL_FAST_TRAIN => TRUE,
217
      LINK_CAP_MAX_LINK_SPEED => X"2",
218
      DEVICE_ID => X"6021",
219
      LINK_CAP_MAX_LINK_WIDTH => X"01",
220
      LINK_CAP_MAX_LINK_WIDTH_int => 1,
221
      LINK_CTRL2_TARGET_LINK_SPEED => X"2",
222
      LTSSM_MAX_LINK_WIDTH => X"01",
223
      DEV_CAP_MAX_PAYLOAD_SUPPORTED => 2,
224
      VC0_TX_LASTPACKET => 29,
225
      VC0_RX_RAM_LIMIT => X"7FF",
226
      VC0_TOTAL_CREDITS_PD => (308),
227
      VC0_TOTAL_CREDITS_CD => (308),
228
      USER_CLK_FREQ => 2
229
)
230
port map (
231
 
232
  sys_clk => rp_sys_clk,
233
  sys_reset_n => cor_sys_reset_n,
234
 
235
  pci_exp_txn => cor_pci_exp_rxn,
236
  pci_exp_txp => cor_pci_exp_rxp,
237
  pci_exp_rxn => cor_pci_exp_txn,
238
  pci_exp_rxp => cor_pci_exp_txp
239
);
240
 
241
CLK_GEN_RP : sys_clk_gen
242
generic map (CLK_FREQ => 100)
243
port map (
244
  sys_clk => rp_sys_clk
245
);
246
 
247
 
248
CLK_GEN_EP : sys_clk_gen_ds
249
generic map (CLK_FREQ => 100)
250
port map (
251
 
252
  sys_clk_p => ep_sys_clk_p,
253
  sys_clk_n => ep_sys_clk_n
254
 
255
);
256
 
257
BOARD_INIT : process
258
begin
259
 
260
  writeNowToScreen(String'("System Reset Asserted..."));
261
 
262
  cor_sys_reset_n <= '0';
263
 
264
  for i in 0 to (500 - 1) loop
265
 
266
    wait until (ep_sys_clk_p'event and ep_sys_clk_p = '1');
267
 
268
  end loop;
269
 
270
  writeNowToScreen(String'("System Reset De-asserted..."));
271
 
272
  cor_sys_reset_n <= '1';
273
 
274
  wait;
275
 
276
end process BOARD_INIT;
277
 
278
 
279
end; -- board

powered by: WebSVN 2.1.0

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