SURF  1.0
ClkOutBufSingle.vhd
Go to the documentation of this file.
1 -------------------------------------------------------------------------------
2 -- File : ClkOutBufSingle.vhd
3 -- Company : SLAC National Accelerator Laboratory
4 -- Created : 2012-12-07
5 -- Last update: 2015-09-08
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 ClkOutBufSingle 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;
37  clkOut : out sl); -- Single ended output buffer
38 end ClkOutBufSingle;
39 
40 architecture rtl of ClkOutBufSingle is
41 
42  signal clkDdr : sl;
43  signal rst : sl;
44 
45 begin
46 
47  rst <= rstIn when(RST_POLARITY_G = '1') else not(rstIn);
48 
49  GEN_7SERIES : if (XIL_DEVICE_G = "7SERIES") generate
50  ODDR_I : ODDR
51  port map (
52  C => clkIn,
53  Q => clkDdr,
54  CE => '1',
55  D1 => toSl(not INVERT_G),
56  D2 => toSl(INVERT_G),
57  R => rst,
58  S => '0');
59  end generate;
60 
61  GEN_ULTRA_SCALE : if (XIL_DEVICE_G = "ULTRASCALE") generate
62  ODDR_I : ODDRE1
63  port map (
64  C => clkIn,
65  Q => clkDdr,
66  D1 => toSl(not INVERT_G),
67  D2 => toSl(INVERT_G),
68  SR => rst);
69  end generate;
70 
71  -- Single ended output buffer
72  OBUFT_I : OBUFT
73  port map (
74  I => clkDdr,
75  T => outEnL,
76  O => clkOut);
77 
78 end rtl;
std_logic sl
Definition: StdRtlPkg.vhd:28
_library_ IEEEIEEE
_library_ UNISIMUNISIM
INVERT_Gboolean := false
XIL_DEVICE_Gstring := "7SERIES"
in rstInsl :=not RST_POLARITY_G
TPD_Gtime := 1 ns
in outEnLsl := '0'
RST_POLARITY_Gsl := '1'