1 |
2 |
peteralieb |
//------------------------------------------------------------------------------
|
2 |
|
|
// Title : CDC Sync Block
|
3 |
|
|
// Project : Virtex-4 Embedded Tri-Mode Ethernet MAC Wrapper
|
4 |
|
|
// File : sync_block.v
|
5 |
|
|
// Version : 4.8
|
6 |
|
|
//-----------------------------------------------------------------------------
|
7 |
|
|
//
|
8 |
|
|
// (c) Copyright 2004-2010 Xilinx, Inc. All rights reserved.
|
9 |
|
|
//
|
10 |
|
|
// This file contains confidential and proprietary information
|
11 |
|
|
// of Xilinx, Inc. and is protected under U.S. and
|
12 |
|
|
// international copyright and other intellectual property
|
13 |
|
|
// laws.
|
14 |
|
|
//
|
15 |
|
|
// DISCLAIMER
|
16 |
|
|
// This disclaimer is not a license and does not grant any
|
17 |
|
|
// rights to the materials distributed herewith. Except as
|
18 |
|
|
// otherwise provided in a valid license issued to you by
|
19 |
|
|
// Xilinx, and to the maximum extent permitted by applicable
|
20 |
|
|
// law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
|
21 |
|
|
// WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
|
22 |
|
|
// AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
|
23 |
|
|
// BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
|
24 |
|
|
// INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
|
25 |
|
|
// (2) Xilinx shall not be liable (whether in contract or tort,
|
26 |
|
|
// including negligence, or under any other theory of
|
27 |
|
|
// liability) for any loss or damage of any kind or nature
|
28 |
|
|
// related to, arising under or in connection with these
|
29 |
|
|
// materials, including for any direct, or any indirect,
|
30 |
|
|
// special, incidental, or consequential loss or damage
|
31 |
|
|
// (including loss of data, profits, goodwill, or any type of
|
32 |
|
|
// loss or damage suffered as a result of any action brought
|
33 |
|
|
// by a third party) even if such damage or loss was
|
34 |
|
|
// reasonably foreseeable or Xilinx had been advised of the
|
35 |
|
|
// possibility of the same.
|
36 |
|
|
//
|
37 |
|
|
// CRITICAL APPLICATIONS
|
38 |
|
|
// Xilinx products are not designed or intended to be fail-
|
39 |
|
|
// safe, or for use in any application requiring fail-safe
|
40 |
|
|
// performance, such as life-support or safety devices or
|
41 |
|
|
// systems, Class III medical devices, nuclear facilities,
|
42 |
|
|
// applications related to the deployment of airbags, or any
|
43 |
|
|
// other applications that could lead to death, personal
|
44 |
|
|
// injury, or severe property or environmental damage
|
45 |
|
|
// (individually and collectively, "Critical
|
46 |
|
|
// Applications"). Customer assumes the sole risk and
|
47 |
|
|
// liability of any use of Xilinx products in Critical
|
48 |
|
|
// Applications, subject only to applicable laws and
|
49 |
|
|
// regulations governing limitations on product liability.
|
50 |
|
|
//
|
51 |
|
|
// THIS COPYRIGHT NOTICE AND DISCLAIMER MUST BE RETAINED AS
|
52 |
|
|
// PART OF THIS FILE AT ALL TIMES.
|
53 |
|
|
//
|
54 |
|
|
//------------------------------------------------------------------------------
|
55 |
|
|
// Description: Used on signals crossing from one clock domain to
|
56 |
|
|
// another, this is a flip-flop pair, with both flops
|
57 |
|
|
// placed together with RLOCs into the same slice. Thus
|
58 |
|
|
// the routing delay between the two is minimum to safe-
|
59 |
|
|
// guard against metastability issues.
|
60 |
|
|
//------------------------------------------------------------------------------
|
61 |
|
|
|
62 |
|
|
`timescale 1ps / 1ps
|
63 |
|
|
|
64 |
|
|
module sync_block #(
|
65 |
|
|
parameter INITIALISE = 2'b00
|
66 |
|
|
)
|
67 |
|
|
(
|
68 |
|
|
input clk, // clock to be sync'ed to
|
69 |
|
|
input data_in, // Data to be 'synced'
|
70 |
|
|
output data_out // synced data
|
71 |
|
|
);
|
72 |
|
|
|
73 |
|
|
// Internal Signals
|
74 |
|
|
wire data_sync1;
|
75 |
|
|
wire data_sync2;
|
76 |
|
|
|
77 |
|
|
|
78 |
|
|
(* ASYNC_REG = "TRUE", RLOC = "X0Y0" *)
|
79 |
|
|
FD #(
|
80 |
|
|
.INIT (INITIALISE[0])
|
81 |
|
|
) data_sync (
|
82 |
|
|
.C (clk),
|
83 |
|
|
.D (data_in),
|
84 |
|
|
.Q (data_sync1)
|
85 |
|
|
);
|
86 |
|
|
|
87 |
|
|
|
88 |
|
|
(* RLOC = "X0Y0" *)
|
89 |
|
|
FD #(
|
90 |
|
|
.INIT (INITIALISE[1])
|
91 |
|
|
) data_sync_reg (
|
92 |
|
|
.C (clk),
|
93 |
|
|
.D (data_sync1),
|
94 |
|
|
.Q (data_sync2)
|
95 |
|
|
);
|
96 |
|
|
|
97 |
|
|
|
98 |
|
|
assign data_out = data_sync2;
|
99 |
|
|
|
100 |
|
|
|
101 |
|
|
endmodule
|
102 |
|
|
|
103 |
|
|
|