w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
s6_cmt_sfs_unisim.vhd
Go to the documentation of this file.
1-- $Id: s6_cmt_sfs_unisim.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: s6_cmt_sfs - syn
7-- Description: Spartan-6 CMT for simple frequency synthesis
8-- Direct instantiation of Xilinx UNISIM primitives
9--
10-- Dependencies: -
11-- Test bench: -
12-- Target Devices: generic Spartan-6
13-- Tool versions: xst 14.5-14.7; ghdl 0.29-0.31
14--
15-- Revision History:
16-- Date Rev Version Comment
17-- 2013-10-05 537 1.0 Initial version (derived from s7_cmt_sfs)
18------------------------------------------------------------------------------
19
20library ieee;
21use ieee.std_logic_1164.all;
22
23library unisim;
24use unisim.vcomponents.ALL;
25
26use work.slvtypes.all;
27
28entity s6_cmt_sfs is -- Spartan-6 CMT for simple freq. synth.
29 generic (
30 VCO_DIVIDE : positive := 1; -- vco clock divide
31 VCO_MULTIPLY : positive := 1; -- vco clock multiply
32 OUT_DIVIDE : positive := 1; -- output divide
33 CLKIN_PERIOD : real := 10.0; -- CLKIN period (def is 10.0 ns)
34 CLKIN_JITTER : real := 0.01; -- CLKIN jitter (def is 10 ps)
35 STARTUP_WAIT : boolean := false; -- hold FPGA startup till LOCKED
36 GEN_TYPE : string := "PLL"); -- PLL or DCM
37 port (
38 CLKIN : in slbit; -- clock input
39 CLKFX : out slbit; -- clock output (synthesized freq.)
40 LOCKED : out slbit -- pll/dcm locked
41 );
42end s6_cmt_sfs;
43
44
45architecture syn of s6_cmt_sfs is
46
47begin
48
49 assert GEN_TYPE = "PLL" or GEN_TYPE = "DCM"
50 report "assert(GEN_TYPE='PLL' or GEN_TYPE='DCM')"
51 severity failure;
52
53 NOGEN: if VCO_DIVIDE=1 and VCO_MULTIPLY=1 and OUT_DIVIDE=1 generate
54 CLKFX <= CLKIN;
55 LOCKED <= '1';
56 end generate NOGEN;
57
58 USEPLL: if GEN_TYPE = "PLL" and
59 not(VCO_DIVIDE=1 and VCO_MULTIPLY=1 and OUT_DIVIDE=1) generate
60
61 signal CLKFBOUT : slbit;
62 signal CLKOUT0 : slbit;
68
69 begin
70
71 PLL : pll_base
72 generic map (
73 BANDWIDTH => "OPTIMIZED",
74 CLK_FEEDBACK => "CLKFBOUT",
75 COMPENSATION => "INTERNAL",
76 DIVCLK_DIVIDE => VCO_DIVIDE,
77 CLKFBOUT_MULT => VCO_MULTIPLY,
78 CLKFBOUT_PHASE => 0.000,
79 CLKOUT0_DIVIDE => OUT_DIVIDE,
80 CLKOUT0_PHASE => 0.000,
81 CLKOUT0_DUTY_CYCLE => 0.500,
82 CLKIN_PERIOD => CLKIN_PERIOD,
83 REF_JITTER => CLKIN_JITTER)
84 port map (
85 CLKFBOUT => CLKFBOUT,
86 CLKOUT0 => CLKOUT0,
87 CLKOUT1 => CLKOUT1_UNUSED,
88 CLKOUT2 => CLKOUT2_UNUSED,
89 CLKOUT3 => CLKOUT3_UNUSED,
90 CLKOUT4 => CLKOUT4_UNUSED,
91 CLKOUT5 => CLKOUT5_UNUSED,
92 CLKFBIN => CLKFBOUT,
93 CLKIN => CLKIN,
94 LOCKED => LOCKED,
95 RST => '0'
96 );
97
98 BUFG_CLKOUT : bufg
99 port map (
100 I => CLKOUT0,
101 O => CLKFX
102 );
103
104 end generate USEPLL;
105
106 USEDCM: if GEN_TYPE = "DCM" and
107 not(VCO_DIVIDE=1 and VCO_MULTIPLY=1 and OUT_DIVIDE=1) generate
108
109 signal CLKOUT0 : slbit;
110
111 begin
112
113 DCM : dcm_sp
114 generic map (
115 CLK_FEEDBACK => "NONE",
116 CLKFX_DIVIDE => VCO_DIVIDE,
117 CLKFX_MULTIPLY => VCO_MULTIPLY,
118 CLKIN_DIVIDE_BY_2 => false,
119 CLKIN_PERIOD => CLKIN_PERIOD,
120 CLKOUT_PHASE_SHIFT => "NONE",
121 DESKEW_ADJUST => "SYSTEM_SYNCHRONOUS",
122 DSS_MODE => "NONE",
123 STARTUP_WAIT => STARTUP_WAIT)
124 port map (
125 CLKIN => CLKIN,
126 CLKFX => CLKOUT0,
127 LOCKED => LOCKED
128 );
129
130 BUFG_CLKOUT : bufg
131 port map (
132 I => CLKOUT0,
133 O => CLKFX
134 );
135
136 end generate USEDCM;
137
138end syn;
VCO_DIVIDE positive := 1
GEN_TYPE string := "PLL"
CLKIN_PERIOD real := 10.0
OUT_DIVIDE positive := 1
in CLKIN slbit
CLKIN_JITTER real := 0.01
STARTUP_WAIT boolean := false
VCO_MULTIPLY positive := 1
out LOCKED slbit
out CLKFX slbit
std_logic slbit
Definition: slvtypes.vhd:30