SURF  1.0
ClkOutBufDiff.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : ClkOutBuf.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2012-12-07
5 -- Last update: 2015-04-28
6 -------------------------------------------------------------------------------
7 -- Description: Special buffer for outputting a clock on Xilinx FPGA pins.
8 -------------------------------------------------------------------------------
9 -- This file is part of 'SLAC Firmware Standard Library'.
10 -- It is subject to the license terms in the LICENSE.txt file found in the
11 -- top-level directory of this distribution and at:
12 -- https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
13 -- No part of 'SLAC Firmware Standard Library', including this file,
14 -- may be copied, modified, propagated, or distributed except according to
15 -- the terms contained in the LICENSE.txt file.
16 -------------------------------------------------------------------------------
17 
18 library IEEE;
19 use IEEE.STD_LOGIC_1164.all;
20 use work.StdRtlPkg.all;
21 
22 library UNISIM;
23 use UNISIM.VCOMPONENTS.all;
24 
25 --! @see entity
26  --! @ingroup xilinx_general
27 entity ClkOutBufDiff is
28  generic (
29  TPD_G : time := 1 ns;
30  XIL_DEVICE_G : string := "7SERIES";
31  RST_POLARITY_G : sl := '1';
32  INVERT_G : boolean := false);
33  port (
34  rstIn : in sl := not RST_POLARITY_G; -- Optional reset
35  outEnL : in sl := '0'; -- optional tristate (0 = enabled, 1 = high z output)
36  clkIn : in sl; -- Input clock
37  clkOutP : out sl; -- differential output buffer
38  clkOutN : out sl); -- differential output buffer
39 end ClkOutBufDiff;
40 
41 architecture rtl of ClkOutBufDiff is
42 
43  signal clkDdr : sl;
44  signal rst : sl;
45 
46 begin
47 
48  rst <= rstIn when(RST_POLARITY_G = '1') else not(rstIn);
49 
50  GEN_7SERIES : if (XIL_DEVICE_G = "7SERIES") generate
51  ODDR_I : ODDR
52  port map (
53  C => clkIn,
54  Q => clkDdr,
55  CE => '1',
56  D1 => toSl(not INVERT_G),
57  D2 => toSl(INVERT_G),
58  R => rst,
59  S => '0');
60  end generate;
61 
62  GEN_ULTRA_SCALE : if (XIL_DEVICE_G = "ULTRASCALE") generate
63  ODDR_I : ODDRE1
64  port map (
65  C => clkIn,
66  Q => clkDdr,
67  D1 => toSl(not INVERT_G),
68  D2 => toSl(INVERT_G),
69  SR => rst);
70  end generate;
71 
72  -- Differential output buffer
73  OBUFDS_I : OBUFTDS
74  port map (
75  I => clkDdr,
76  T => outEnL,
77  O => clkOutP,
78  OB => clkOutN);
79 
80 end rtl;
std_logic sl
Definition: StdRtlPkg.vhd:28
_library_ IEEEIEEE
Definition: StdRtlPkg.vhd:18
in outEnLsl := '0'
TPD_Gtime := 1 ns
RST_POLARITY_Gsl := '1'
in rstInsl :=not RST_POLARITY_G
INVERT_Gboolean := false
XIL_DEVICE_Gstring := "7SERIES"