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.v] - 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.v
52
// Version    : 1.7
53
// Description:  Top level testbench
54
//
55
//------------------------------------------------------------------------------
56
 
57
`timescale 1ns/1ns
58
 
59
`include "board_common.v"
60
 
61
module board;
62
 
63
parameter          REF_CLK_FREQ                 = 0;      // 0 - 100 MHz, 1 - 125 MHz,  2 - 250 MHz
64
 
65
localparam         REF_CLK_HALF_CYCLE = (REF_CLK_FREQ == 0) ? 5000 :
66
                                        (REF_CLK_FREQ == 1) ? 4000 :
67
                                        (REF_CLK_FREQ == 2) ? 2000 : 0;
68
integer            i;
69
 
70
//
71
// System reset
72
//
73
 
74
reg                sys_reset_n;
75
 
76
//
77
// System clocks
78
//
79
 
80
wire                                   rp_sys_clk;
81
 
82
wire                                   ep_sys_clk_p;
83
wire                                   ep_sys_clk_n;
84
 
85
//
86
// PCI-Express Serial Interconnect
87
//
88
 
89
wire  [0:0]  ep_pci_exp_txn;
90
wire  [0:0]  ep_pci_exp_txp;
91
wire  [0:0]  rp_pci_exp_txn;
92
wire  [0:0]  rp_pci_exp_txp;
93
 
94
//
95
// PCI-Express Endpoint Instance
96
//
97
 
98
xilinx_pcie_2_0_ep_v6 # (
99
 
100
      .PL_FAST_TRAIN("TRUE")
101
 
102
)
103
EP (
104
 
105
 
106
      // SYS Inteface
107
      .sys_clk_p(ep_sys_clk_p),
108
      .sys_clk_n(ep_sys_clk_n),
109
      .sys_reset_n(sys_reset_n),
110
 
111
`ifdef ENABLE_LEDS
112
      // Misc signals 
113
      .led_0(led_0),
114
      .led_1(led_1),
115
      .led_2(led_2),
116
`endif
117
 
118
      // PCI-Express Interface
119
      .pci_exp_txn(ep_pci_exp_txn),
120
      .pci_exp_txp(ep_pci_exp_txp),
121
      .pci_exp_rxn(rp_pci_exp_txn),
122
      .pci_exp_rxp(rp_pci_exp_txp)
123
 
124
);
125
 
126
//
127
// PCI-Express Model Root Port Instance
128
//
129
 
130
xilinx_pcie_2_0_rport_v6 # (
131
 
132
      .REF_CLK_FREQ(0),
133
      .PL_FAST_TRAIN("TRUE"),
134
      .LINK_CAP_MAX_LINK_WIDTH(6'h01),
135
      .DEVICE_ID(16'h6021),
136
      .ALLOW_X8_GEN2("FALSE"),
137
      .LINK_CAP_MAX_LINK_SPEED(4'h2),
138
      .LINK_CTRL2_TARGET_LINK_SPEED(4'h2),
139
      .DEV_CAP_MAX_PAYLOAD_SUPPORTED(3'h2),
140
      .VC0_TX_LASTPACKET(29),
141
      .VC0_RX_RAM_LIMIT(13'h7FF),
142
      .VC0_CPL_INFINITE("TRUE"),
143
      .VC0_TOTAL_CREDITS_PD(308),
144
      .VC0_TOTAL_CREDITS_CD(308),
145
      .USER_CLK_FREQ(2)
146
 
147
)
148
RP (
149
 
150
      // SYS Inteface
151
      .sys_clk(rp_sys_clk),
152
      .sys_reset_n(sys_reset_n),
153
 
154
      // PCI-Express Interface
155
      .pci_exp_txn(rp_pci_exp_txn),
156
      .pci_exp_txp(rp_pci_exp_txp),
157
      .pci_exp_rxn(ep_pci_exp_txn),
158
      .pci_exp_rxp(ep_pci_exp_txp)
159
 
160
);
161
 
162
 
163
sys_clk_gen  # (
164
 
165
      .halfcycle(REF_CLK_HALF_CYCLE),
166
      .offset(0)
167
 
168
)
169
CLK_GEN_RP (
170
 
171
      .sys_clk(rp_sys_clk)
172
 
173
);
174
 
175
 
176
 
177
sys_clk_gen_ds # (
178
 
179
      .halfcycle(REF_CLK_HALF_CYCLE),
180
      .offset(0)
181
 
182
)
183
CLK_GEN_EP (
184
 
185
      .sys_clk_p(ep_sys_clk_p),
186
      .sys_clk_n(ep_sys_clk_n)
187
 
188
);
189
 
190
initial begin
191
 
192
  $display("[%t] : System Reset Asserted...", $realtime);
193
 
194
  sys_reset_n = 1'b0;
195
 
196
  for (i = 0; i < 500; i = i + 1) begin
197
 
198
    @(posedge ep_sys_clk_p);
199
 
200
  end
201
 
202
  $display("[%t] : System Reset De-asserted...", $realtime);
203
 
204
  sys_reset_n = 1'b1;
205
 
206
end
207
 
208
initial begin
209
 
210
  if ($test$plusargs ("dump_all")) begin
211
 
212
`ifdef NCV // Cadence TRN dump
213
 
214
    $recordsetup("design=board",
215
                 "compress",
216
                 "wrapsize=100M",
217
                 "version=1",
218
                 "run=1");
219
    $recordvars();
220
 
221
`elsif VCS //Synopsys VPD dump
222
 
223
    $vcdplusfile("board.vpd");
224
    $vcdpluson;
225
    $vcdplusglitchon;
226
    $vcdplusflush;
227
 
228
`else
229
 
230
    // Verilog VC dump
231
    $dumpfile("board.vcd");
232
    $dumpvars(0, board);
233
 
234
`endif
235
 
236
  end
237
 
238
end
239
 
240
 
241
endmodule // BOARD

powered by: WebSVN 2.1.0

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