Ecp5 and Ecp5-5G Sysclock PLL/DLL Design and Usage Guide: November 2015 Technical Note Tn1263
Ecp5 and Ecp5-5G Sysclock PLL/DLL Design and Usage Guide: November 2015 Technical Note Tn1263
Ecp5 and Ecp5-5G Sysclock PLL/DLL Design and Usage Guide: November 2015 Technical Note Tn1263
Introduction
This usage guide describes the clock resources available in the ECP5TM and ECP5-5GTM device architecture.
Details are provided for primary clocks, edge clocks, PLLs, the internal oscillator, and clocking elements such as
clock dividers, clock multiplexers, and clock stop blocks available in the ECP5 and ECP5-5G device.
The number of PLLs, Edge clocks, and Clock dividers for each device is listed in Table 1.
It is very important to note that the user needs to validate their pinout so that correct pin placement is used. The
Lattice Diamond® tools should be used to validate the pinout while designing the printed circuit board.
© 2015 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal. All other brand
or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
www.latticesemi.com 1 TN1263_1.1
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
Edge Clocks
GPLL GPLL
Bank 2
Bank 7
12 DCC
PIO
PIO
14 Primary Sources
PIO
CLK
DIV Mid 14 14 Primary Sources 14 Mid
CLK
DIV
MUX
14 DCC Center MUX 14 DCC MUX
CLK CLK
PIO
PIO
DIV DIV
PIO
PIO
16 Fabric Fabric
16
Primary Entry Entry Primary
Bank 3
Bank 6
Edge Clocks
Edge Clocks
Quadrant BL 16 DCC
Quadrant BR
GPLL GPLL
Mid
MUX
PCSCLKDIV PCSCLKDIV
Bank 8 Bank 4
SERDES DCU0 SERDES DCU1
Note: LFE4U devices do not have PCS Clock Dividers
The Primary Clock Network provides low-skew, high fanout clock distribution to all synchronous elements in the
FPGA fabric. The Primary Clock Network is divided into four clocking quadrants: Top Left (TL), Bottom Left (BL),
Top Right (TR), and Bottom Right (BR). Each of these quadrants has 16 clocks that can be distributed to the fabric
in the quadrant. Initially, the Lattice Diamond software automatically routes each clock to all four quadrants; up to a
maximum of 16 clocks since each clock is routed to all four quadrants. The user can change how the clocks are
routed by specifying a preference in the Lattice Diamond software to locate the clock to specific quadrants.
2
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
Oscillator (OSCG)
An internal programmable rate oscillator is provided. The oscillator can be used for master configuration modes
when the FPGA sources the configuration clock, Soft Error Detect (SED), and as a user logic clock source that is
available after FPGA configuration. There is one OSCG on the ECP5 and ECP5-5G device. The oscillator clock
output is routed directly to primary clocking.
The oscillator output is not a high-accuracy clock, having a +/- 15% variation in its output frequency. It is mainly
used for circuits that do not require a high degree of clock accuracy. Examples of usage would be asynchronous
logic blocks such as a timer or reset generator, or other logic that require a constantly running clock.
3
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
PHASESEL[1: 0] Dynamic
PHASEDIR Phase
PHASESTEP Adjust
PHASELOADREG
PLLREFCS
CLKOP
SEL VCO
Refclk Divider CLKOP
CLK0
(1-128)
CLKI PLLCSOUT
CLKI2 Refclk Divider M Phase CLKOS
CLKI Detector, VCO
CLK1 Divider CLKOS
VCO, and (1-128)
Loop Filter
FBKSEL VCO CLKOS2
CLKFB Feedback Divider CLKOS2
Clock Divider (1-128)
VCO CLKOS3
Internal Feedback Divider CLKOS3
CLKOP, CLKOS, CLKOS2, CLKOS3 (1-128)
ENCLKOP
ENCLKOS
ENCLKOS2
ENCLKOS3
RST Lock LOCK
STDBY Detect
There are four PLLs on the bigger density devices LFE5-85 and LFE5-45 and two PLLs on the smaller density
LFE5-25 device. There is one PLL on each corner of the device on the bigger density devices and the smaller den-
sity devices have one PLL only on the Lower Left and Lower Right corner. Each PLL has four outputs. All four PLL
outputs can go to the Primary Clock network. Only the CLKOP and CLKOS outputs can go to the ECLK network.
4
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
PLL Features
Dedicated PLL Inputs
The PLLs have dedicated PLL input pins that are not Primary Clock input pins. Each of the Top Left and Right cor-
ner PLLs have two pairs of dedicated PLL input pins, one from the Left/Right side bank and the other from the Top
bank. Either one of these can be used as input to the PLL.
The bottom two PLLs have one pair of dedicated input pin on the Left/Right side banks.
CLKI
PLL0 0P
PLL
Dedicated External PLL Input 1
Primary Clock/Edge Clock/Fabric Inputs Primary Clock/Edge Clock/Fabric Inputs
Quadrant TL Quadrant TR
Dedicated External PLL Input 0 Quadrant BL Quadrant BR Dedicated External PLL Input 0
CLKI
CLKI
0 PLL0 0PLL
Primary Clock/Edge Clock/Fabric Inputs Primary Clock/Edge Clock/Fabric Inputs
PLL_BL PLL_BR
Quadrant TL Quadrant TR
Dedicated External PLL Input 0 Quadrant BL Quadrant BR Dedicated External PLL Input 0
CLKI
CLKI
0 PLL0 0PLL
Primary Clock/Edge Clock/Fabric Inputs Primary Clock/Edge Clock/Fabric Inputs
PLL_BL PLL_BR
5
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
Frequency Synthesis
The PLL can be used to multiply up or divide down an input clock.
Additional Features
In addition to the major features, the PLL has several other options that can be used in conjunction with the major
modes.
Primary Clocks
Primary Clock Sources
The primary clock network has multiple inputs, called primary clock sources, which can be routed directly to the pri-
mary clock routing to clock the FPGA fabric.
The primary clock sources that can get to the primary clock routing are:
All potential primary clock sources are multiplexed prior to going to the primary clock routing by a mid-mux. There
are 56 mid-mux connections and four FPGA fabric connections, 60 total, routed to a multiplexor in the center of the
chip called the centermux. From the centermux primary clocks are selected and distributed to the FPGA fabric. The
maximum number of unique clock sources is 16 bottom mid-mux sources + 12 top mid-mux sources + 14 left mid-
mux sources + 14 right mid-mux sources + 4 direct FPGA fabric entry points (from general routing) = 60. The basic
clocking structure is shown in Figure 1 and elaborated in Appendix A. Primary Clock Sources and Distribution.
The primary clock routing network is divided into four sections, called quadrants. Figure 5 is a simplified view of
Figure 1.
6
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
Mid
MUX
Quadrant TL Quadrant TR
Primary Clock Routing to Fabric Resources in Primary Clock Routing to Fabric Resources in
TL Quadrant of the FPGA
12 TR Quadrant of the FPGA
16 16
Primary Clock Primary Clock
Sources Sources
Into the Mid-Mux Fabric Fabric Into the Mid-Mux
Mid 14 Entry Entry 14 Mid
Center MUX MUX
MUX
Fabric Fabric
Entry Entry
16 16
Primary Clock Routing to Fabric Resources in Primary Clock Routing to Fabric Resources in
TL Quadrant of the FPGA TL Quadrant of the FPGA
The centermux can source up to 16 independent primary clocks per quadrant which can clock the logic located in
that quadrant. The centermux can also route each clock source to all quadrants. The Diamond software will auto-
matically route a primary clock to all four quadrants in the FPGA.
If an external input clock is being sourced to a PLL, then in most cases the input clock should use a dedicated PLL
input pin. SERDES reference clocks also have dedicated SERDES reference clock pins. The ECP5 and ECP5-5G
device allows a PLL reference clock or a SERDES reference clock to come from an external Primary Clock (PCLK)
pin and route through the Primary clock network to drive the reference clock to the SERDES or the input of a PLL.
7
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
There is one PCSCLKDIV per SERDES Channel on the bottom of the device where the SERDES blocks are
located. The clock outputs of the PCSCLKDIV (CDIV1, CDIVX) are delay and phase matched to each other and
has a run-time selectable divider value. The PCSCLKDIV clock input sources are:
Primary Clocks
4 RX Channel Clocks
RST /1,/2,/4,/5,/8 or /10
SEL[2:0]
The output PCS channel clocks route directly to the input of the PCSCLKDIV without requiring the use of a primary
clock. The CDIV1 and CDIVX outputs route directly to the primary clock routing. Its function is to do bus widening /
narrowing circuits in the FPGA fabric to reduce the fabric frequency. The PCSCLKDIV is not suitable for DDR I/O
interfaces (ECLK to SCLK domain crossing).
CLKI
RST
CDIV_1
CDIV_2
CDIV_4
CDIV_5
CDIV_8
CDIV_10
Delayed output
Asserted RST clocks start
is asynchronized toggling
De-asserted RST
is registered
8
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
An example design is shown in Figure 8. It is a flip-flop based clock domain crossing circuit between the CDIV1 and
the CDIVX = 2 clock outputs of the PCSCLKDIV. In this example an IP core is using the PCSCLKDIV to change the
operating frequency and bus width for a PCS (SERDES) application.
rxdata_0
Data FF Data Data
FF
rxiclk
SEL CLKDIVX = ‘2’ IP
PCS CLKI PCSCLK
CDIV1
Core
TX_Full_Clk
DIV
txiclk
CLKI
RST CDIV 1
PCSCLKDIV
SEL (2 :0 ) CDIVX
9
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
PCSCLKDIV Instantiation
attribute GSR : string;
attribute GSR of I1 : label is “DISABLED”;
I1: PCSCLKDIV
generic map (
GSR => “DISABLED”)
port map (
RST => RST
,CLKI => CLKI
,SEL => SEL
,CDIV1 => CDIV1
,CDIVX => CDIVX);
PCSCLKDIV Instantiation
defparam I1.GSR = “DISABLED”;
PCSCLKDIV I1 (
.RST (RST)
,.CLKI (CLKI)
,.SEL (SEL)
,.CDIV1 (CDIV1)
,.CDIVX (CDIVX));
10
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
Each DCS can select between two independent input clock sources. There are two modes of clock switching, a
glitchless mode of operation, or a non glitchless mode where the DCS operates as a regular mux. Figure 10 and
Figure 11 show the glitchless / non-glitchless modes of operation. It should be noted that the clock source used as
feedback into the GPLL should not be switched when using the DCS as it will lead to loss of lock for the GPLL.
As indicated there are two modes of clock switching. In non-glitchless mode (input MODESEL=’1’) the DCS acts
like a regular mux, allowing glitches and runt pulses on the output, depending on when the clock is switched. The
SEL and MODESEL inputs are driven by signals from the general routing fabric and are used to support the clock
switching feature in the DCS.
In glitchless mode (input MODESEL=’0’) the DCS avoids glitches or runt pulses on the output clock, regardless of
when the enable signal is toggled. In order to switch between clocks glitchlessly, both input clocks must be oscillat-
ing; otherwise the output clock will be ‘0’.
For glitchless operation, the “DCSMODE” attribute sets the behavior of the DCS output. The additional attribute val-
ues and their functions are shown in Table 5.
11
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
Figure 10. Timing Diagrams by “DCSMODE” Attribute Setting, Glitchless Operation (MODESEL=’0’)
DCSMODE = “POS”
SEL[3:0] “0001” “0010” “0001”
CLK0
CLK1
DCSOUT
DCSMODE = “NEG”
SEL[3:0] “0001” “0010” “0001”
CLK0
CLK1
DCSOUT
CLK0 CLK0
DCSOUT DCSOUT
- Switch low @CLK0 falling edge. - Switch low @CLK0 rising edge.
- The attribute name indicates which clock will toggle. Other - The attribute name indicates which clock will toggle. Other
values of SEL will cause the output to remain low. values of SEL will cause the output to remain high.
- SEL must not change during setup prior to rising clock. - SEL must not change during setup prior to rising clock.
12
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
CLK0
CLK1
DCSOUT
CLK 0
CLK 1 DCSOUT
DCSC
SEL [1 :0 ]
MODESEL
13
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
DCSMODE Attribute
Table 5 provides the behavior of the DCS output based on the setting of the DCSMODE attribute when the pin
MODESEL =’0’. The MODESEL pin is dynamic and can toggle during operation. Table 5 is only valid when MODE-
SEL =’0’.
DCSC Instantiation
attribute DCSMODE : string;
attribute DCSMODE of DCSinst0 : label is "POS";
I1: DCSC
generic map(
DCSMODE => “POS”)
port map (
CLK0 => CLK0
,CLK1 => CLK1
,SEL => SEL
,MODESEL => MODESEL
,DCSOUT => DCSOUT);
14
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
DCSC Instantiation
defparam DCSInst0.DCSMODE = “POS”;
DCSC DCSInst0 (
.CLK0 (CLK0)
,.CLK1 (CLK1)
,.SEL (SEL)
,.MODESEL (MODESEL)
,.DCSOUT (DCSOUT));
This DCC controls the clock sources from the Primary CLOCK MIDMUX before they are fed to the Primary Center
MUXs that drive the quadrant clock network. When a clock network is disabled, all the logic fed by that clock does
not toggle, hence reducing the overall power consumption of the device.
The ECP5 and ECP5-5G device clock architecture allows both DCC and DCS to function at the same. It should be
noted that the clock source used as feedback into the GPLL should always keep enable signal “high” in the DCC,
otherwise it will lead to loss of lock for the GPLL when toggling the enable signal.
CLK (input)
CE
CLK (output)
15
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
CLKI
CLKO
DCCA
CE
DCCA Instantiation
I1: DCCA
port map (
CLKI => CLKI
,CE => CE
,CLKO => CLKO);
DCCA Usage in Verilog
Component and Attribute Declaration
module DCCA(CLKI,CE,CLKO);
input CLKI;
input CE;
output CLKO;
endmodule
DCCA Instantiation
DCCA DCSInst0 (
.CLKI (CLKI)
,.CE (CE)
,.CLKO (CLKO));
16
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
• It permits a design to be fully self-clocked, as long as the quality of the OSCG element’s silicon-based oscillator
is adequate.
• If it’s unused it can be turned off for power savings.
• It has an input to dynamically control standby/normal operation.
• It has a direct connection to primary clock routing through the left mid-mux.
• It can be configured for operation at a wide range of frequencies via configuration bits.
OSCG Instantiation
I1: OSCG
port map (
OSC => OSC);
17
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
OSCG Instantiation
OSCG I1 (.OSC(OSC))
Edge Clocks
Each ECP5 and ECP5-5G device I/O bank has four ECLK resources. These clocks, which have low injection time
and skew, are used to clock I/O registers. Edge clock resources are designed for high speed I/O interfaces with
high fan-out capability. Refer to Appendix B. EDGE CLOCK Sources and Connectivity for detailed information on
the ECLK locations and connectivity.
The ECP5 and ECP5-5G device has Edge Clock (ECLK) at the Left side and right side of the device. There are two
ECLK network per bank IO. ECLK Input MUX collects all clock sources available shown in figure below. There are
two ECLK Input MUXs, one on the left side and one on the right side. Each of these MUX will generate total of four
ECLK Clock sources. Two of them drive the upper IO bank and two of them drive the lower IO bank. Two out of four
also drive the ECLK Bridge Switch Block to form an ECLK Bridge high speed clock before drive the ECLK Tree Net-
work.
To ECLKBRIDGE to go
From Routing to other side
18
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
CLKI
RST CDIVX
CLKDIVF
ALIGNWD
The ALIGNWD input is intended for use with high-speed data interfaces such as DDR or 7:1 LVDS Video.
19
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
CLKDIVF Instantiation
attribute DIV : string;
attribute DIV of I1 : label is “2.0”;
attribute GSR : string;
attribute GSR of I1 : label is “DISABLED”;
I1: CLKDIVF
generic map (DIV => “2.0”
,GSR => “DISABLED”)
port map (RST => RST
,CLKI => CLKI
,ALIGNWD => ALIGNWD
,CDIVX => CDIVX);
CLKDIVF Instantiation
defparam I1.DIV = “2.0”;
defparam I1.GSR = “DISABLED”;
CLKDIVF I1 (
.RST (RST)
,.CLKI (CLKI)
,.ALIGNWD (ALIGNWD)
,.CDIVX (CDIVX));
There are two ECLK bridge components in the ECP5 and ECP5-5G device. There are two ECLK muxes on the left
and two ECLK muxes on the right and they allow a user to bridge edge clocks to the left and right sides of the chip
with minimal skew.
In the edge clock bridge there is a non-glitchless clock select mux that allows a design to switch between two differ-
ent clock sources for each edge clock. This clock select mux is instantiated using the ECLKBRIDGECS primitive.
Not all edge clocks can drive the ECLKBRIDGECS, one of the two ECLKs on the left and right side can be bridged.
When connected to the ECLKBRIDGECS it would use up the ECLK1 of both banks on the left side and ECLK0 of
both banks on the right side of the device.
20
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
Note that an ECLKSYNCB module has to be always used after the ECLKBRIDGECS instance to be able to con-
nect to the ECLK tree.
CLK 0
CLK 1 ECSOUT
ECLKBRIDGECS
SEL
ECLKBRIDGECS Instantiation
I1: ECLKBRIDGECS
port map (
CLK0 => CLK0
,CLK1 => CLK1
,SEL => SEL
,ECSOUT => ECSOUT);
21
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
DCSC Instantiation
ECLKBRIDGECS ECSInst0 (
.CLK0 (CLK0)
,.CLK1 (CLK1)
,.SEL (SEL)
,.ECSOUT (ECSOUT));
Control signal STOP is synchronized with ECLK when asserted. When control signal STOP is asserted, the clock
output will be forced to low after the fourth falling edge of the input ECLKI. When the STOP signal is released, the
clock output starts to toggle at the fourth (4th) rising edge of the input ECLKI clock.
ECLKI
ECLKO
ECLKSYNCB
STOP
ECLK_IN
STOP
ECLK
22
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
ECLKSYNCB Instantiation
ECLKSYNCB ECLKSYNCInst0 (
.ECLKI (ECLKI)
,.STOP (STOP)
,.ECLKO (ECLKO));
Software will limit the distance of a general routing based (gated) clock to one PLC in distance to a primary clock
entry point. If the software cannot place the clock gating logic close enough to a primary clock entry point then an
error will occur:
ERROR – par: Unable to reach a primary clock entry point for general route clock <net> in the minimum required
distance of one PLC.
There are multiple entry points to the Primary clock routing throughout the ECP5 and ECP5-5G device fabric. In
this case it is recommended to add a preference for this gated clock to use primary routing.
23
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
For a very small clock domain, the user can limit the distance of a general routing based (gated) clock to one PLC
in distance to the logic it clocks. The user must group this logic (UGROUP) with a BBOX = “1, 1” (see Diamond
Help > Constraints Reference Guide > Preferences > UGROUP) as well as specify a “PROHIBIT PRIMARY” on the
generated clock. If the software cannot place the logic tree within the BBOX, then an error message will occur.
sysCLOCK PLL
The ECP5 and ECP5-5G PLL provides features such as clock injection delay removal, frequency synthesis, and
phase adjustment. Figure 23 shows a block diagram of the ECP5 and ECP5-5G PLL.
PHASESEL[1:0] Dynamic
PHASEDIR Phase
PHASESTEP Adjust
PHASELOADREG
PLLREFCS
CLKOP
SEL Refclk VCO
Divider CLKOP
CLK0
(1-128)
CLKI PLLCSOUT
CLKI2 Refclk Divider M Phase CLKOS
CLKI Detector, VCO
CLK1 Divider CLKOS
VCO, and (1-128)
Loop Filter
FBKSEL VCO CLKOS2
CLKFB Feedback Divider CLKOS2
Clock Divider (1-128)
VCO CLKOS3
Internal Feedback Divider CLKOS3
CLKOP, CLKOS, CLKOS2, CLKOS3 (1-128)
ENCLKOP
ENCLKOS
ENCLKOS2
ENCLKOS3
RST Lock LOCK
STDBY Detect
24
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
25
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
Functional Description
Refclk (CLKI) Divider
The CLKI divider is used to control the input clock frequency into the PLL block. The valid input frequency range is
specified in the device data sheet.
PLL Features
Dedicated PLL Inputs
Every PLL has a dedicated low skew input that will route directly to its reference clock input. These are the recom-
mended inputs for a PLL. It is possible to route a PLL input from the Primary clock routing, but it incurs more clock
input injection delay, which is not natively compensated for using feedback, than a dedicated PLL input. There is
one PLLs in each corner of the FPGA on bigger densities. Each of the PLL on the top left and right corners have
two pairs dedicated PLL inputs that user can choose from. Both of these inputs can route to the PLL in the top side
corner. The PLLs on the bottom corners each have one pair of dedicated PLL input pin.
26
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
Figure 25. PLL Dedicated Inputs to the PLLREFCS Component for Top Left and Right PLL
PLLREFCS
SEL
Dedicated CLK 0
External
PLL Input0 Primary Clock Inputs
PLLCSOUT PLL 0
Edge Clock Inputs
Dedicated Fabric Inputs CLK 1 CLKI
External
PLL Input 1
This adds a lot of flexibility for designs that need to switch between two external clocks.
Standby Mode
The ECP5 and ECP5-5G device PLL contains a Standby Mode that allows the PLL to be placed into a standby
state to save power when not needed in the design. Standby mode is very similar to holding the PLL in reset since
the VCO will be turned off and will need to regain lock when exiting standby. In both cases, reset and standby
mode, the PLL will retain its programming.
Users MUST hold the PLL in standby for a minimum of 1 ms in order to be sure the PLL analog circuits are fully
reset and to have a stable analog startup.
CLKFB Input
The CLKFB signal is the feedback signal to the PLL. The feedback signal is used by the Phase Frequency Detector
inside the PLL to determine if the output clock needs adjustment to maintain the correct frequency and phase. The
CLKFB signal can come from a primary clock net (feedback mode = CLKO[P/S/S2/S3]) to remove the primary
clock routing injection delay, from a dedicated external dual-purpose I/O pin (feedback mode = UserClock) to
account for board level clock alignment, or an internal PLL connection (feedback mode = INT_O[P/S/S2/S3]) for
simple feedback. The feedback clock signal will be divided by the feedback (N) divider to create an input to the
VCO of the PLL. A bypassed PLL output cannot be used as the feedback signal.
RST Input
At power-up an internal power-up reset signal from the configuration block resets the PLL. At runtime an active
high, asynchronous, user-controlled PLL reset signal can be provided as a part of the PLL module. The RST signal
can be driven by an internally generated reset function or by an I/O pin. This RST signal resets the PLL core (VCO,
phase detector, and charge pump) and the output dividers which will cause the outputs to be logic ‘0’. In bypass
mode the output will not be reset.
After the RST signal is de-asserted the PLL will start the lock-in process and will take tLOCK time, about 16 ms, to
complete PLL lock. Figure below shows the timing diagram of the RST input. The RST signal is active high. The
RST signal is optional. Trst = 1 ms reset pulse width, Trstrec = 1 ns time after a reset before the divider output
starts counting again.
27
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
Trst Trstrec
RST
CLKI
CLKOP/OS/
OS2/OS3
This allows the user to save power by stopping the corresponding output clock when not in use. The clock enable
signals are optional and will only be available if the user has selected the corresponding option in Clarity Designer.
If a clock enable signal is not requested, its corresponding output will be active at all times when the PLL is instan-
tiated unless the PLL is placed into standby mode. The user cannot access a clock enable signal in Clarity
Designer when using it for external feedback in order to avoid shutting off the feedback clock input.
STDBY Input
The STDBY signal is used to put the PLL into a low power standby mode when it is not required. The STDBY signal
is optional and will only be available if the user has selected the Standby port option in Clarity Designer. The
STDBY signal is active high. When asserted the PLL outputs are pulled to “0” and the PLL will be reset. Users
need to stay in the STDBY mode for at least 1 ms to make sure the PLL analog circuits are fully reset and to have
a stable analog startup.
PHASESEL Input
The PHASESEL[1:0] inputs are used to specify which PLL output port will be affected by the dynamic phase
adjustment ports. The settings available are shown in the Dynamic Phase Adjustment section. The PHASESEL
signal must be stable for 5 ns before the PHASESTEP or PHASELOADREG signals are pulsed. The PHASESEL
signal is optional and will be available if the user has selected the “Dynamic Phase Ports” option in Clarity
Designer.
28
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
PHASEDIR Input
The PHASEDIR input is used to specify which direction the dynamic phase shift will occur, advanced (leading) or
delayed (lagging). When PHASEDIR = 0 then the phase shift will be delayed. When PHASEDIR = 1 then the phase
shift will be advanced. The PHASEDIR signal must be stable for 5 ns before the PHASESTEP or PHASELOAD-
REG signals are pulsed. The PHASEDIR signal is optional and will be available if the user has selected the
Dynamic Phase ports option in Clarity Designer.
PHASESTEP Input
The PHASESTEP signal is used to initiate a VCO dynamic phase shift for the clock output port and in the direction
specified by the PHASESEL and PHASEDIR inputs. This phase adjustment is done by changing the phase of the
VCO in 45o increments. The VCO phase changes on the negative edge of the PHASESTEP input after four VCO
cycles. This is an active low signal and the minimum pulse width (both high and low) of PHASESTEP pulse is four
cycles of VCO running period. The PHASESTEP signal is optional and will be available if the user has selected the
Dynamic Phase ports option in Clarity Designer. The PHASESEL and PHASEDIR are required to have a setup
time of 5 ns prior to PHASESTEP falling edge.
PHASELOADREG Input
The PHASELOADREG signal is used to initiate a post-divider dynamic phase shift, relative to the unshifted output,
for the clock output port and in the direction specified by the PHASESEL and PHASEDIR inputs. A phase shift is
started on the falling edge of the PHASELOADREG signal and there is a minimum pulse width of 10 ns from asser-
tion to deassertion. The PHASESEL and PHASEDIR are required to have a setup time of 5 ns prior to PHASEL-
OADREG falling edge.The PHASELOADREG signal is optional and will be available if the user has selected the
Dynamic Phase ports option in Clarity Designer.
29
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
LOCK Output
The LOCK output provides information about the status of the PLL. After the device is powered up and the input
clock is valid, the PLL will achieve lock within 16 ms. Once lock is achieved, the PLL LOCK signal will be asserted.
The LOCK signal can be set in Clarity Designer in either the default “unsticky” frequency lock mode by checking the
“Provide PLL Lock Signal” or sticky lock mode by selecting “PLL Lock is Sticky”. In sticky lock mode, once the
LOCK signal is asserted (logic ‘1’) it will stay asserted until a PLL reset is asserted. In the default lock mode of
“unsticky” frequency lock, if during operation the input clock or feedback signals to the PLL become invalid the PLL
will lose lock and the LOCK output will de-assert (logic ‘0’). It is recommended to assert PLL RST to re-synchronize
the PLL to the reference clock when the PLL loses lock. The LOCK signal is available to the FPGA routing to imple-
ment the generation of the RST signal if requested by the designer. The LOCK signal is optional and will be avail-
able if the user has selected the Provide PLL Lock signal option in Clarity Designer.
All four output clocks, CLKOP, CLKOS, CLKOS2 & CLKOS3 have the dynamic phase adjustment feature but only
one output clock can be adjusted at a time. Table above shows the output clock selection settings available for the
PHASESEL[1:0] signal. The PHASESEL signal must be stable for 5 ns before the PHASESTEP or PHASELOAD-
REG signals are pulsed.
The selected output clock phase will either be advanced or delayed depending upon the value of the PHASEDIR
port or signal. Table 16 shows the PHASEDIR settings available. The PHASEDIR signal must be stable for 5 ns
before the PHASESTEP or PHASELOADREG signals are pulsed.
(CLKO<n>_FPHASE/(8*CLKO<n>_DIV)]*360
Where <n> is the clock output specified by PHASESEL (CLKOP/OS/OS2/OS3). Values for CLKO<n>_FPHASE
and CLKO<n>_DIV are located in the HDL source file.
The PHASESTEP signal is latched in on the falling edge and is subject to a minimum wait of four VCO cycles prior
to pulsing the signal again. One step size is the smallest phase shift that can be generated by the PLL in one pulse.
The dynamic phase adjustment results in a glitch free adjustment when delaying the output clock, but glitches may
result when advancing the output clock.
PHASEDIR
PHASESEL [1:0] “01”
Minimum 5ns Setup Time
PHASESTEP
Hold Minimum 4 VCO Hold Minimum 4 VCO
Cycles Cycles
CLKOP
Shifted Phase
CLKOS
30
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
For Example:
The above signals need to be stable for 5 ns before the falling edge of PHASESTEP and the minimum pulse width
of PHASESTEP should be four VCO clock cycles. It should also stay low for four VCO Clock Cycles.
For each toggling of PHASESTEP, you will get [1/(8*2)]*360 = 22.5 degree phase shift (delayed).
Where <n> is the clock output specified by PHASESEL (CLKOP/OS/OS2/OS3). Values for CLKO<n>_CPHASE
and CLKO<n>_DIV are located in the HDL source file. Please note that if these values are both “1”, no shift will be
made.
PHASEDIR Minimum 5 ns
Setup Time
PHASESEL [1 :0 ] “ 01”
Minimum Pulse
Minimum Time Before
PHASELOADREG Width of 10 ns Shifting Again *
CLKOP
Shifted Phase
CLKOS
31
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
CLKOP
CLKOS CLKOS
Disabled
ENCLKOS Enabled
CLKOS
Standby Mode
The PLL can also be put into standby mode. This is similar to reset in that the PLL is still powered, however the
VCO is not running and the clock outputs driven low. The PLL will enter Standby mode when the STDBY signal is
driven high and the outputs will be driven low. Users need to stay in the STDBY mode for at least 1 ms to make
sure the PLL analog circuits are fully reset and to have a stable analog startup. The PLL can be restarted when it is
needed again and the output clocks will be reactivated. It will take Tlock_time = 16 us to achieve PLL lock again. To
support this mode the “Standby Port” option is in the Clarity Designer GUI and will cause the STDBY port to be
brought out to the top level of the PLL module.
The main window when the PLL is selected is shown in Figure 30. When opening Clarity Designer inside a Dia-
mond project, the only entry required is the file name as the other entries are set to the project settings. If Clarity
Designer is opened as a stand-alone tool then it is necessary to supply the additional parameters shown on this
screen. After entering the module name of choice, clicking on Customize will open the PLL configuration window as
shown in Figure 30.
32
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
Configuration Tab
The configuration window lists all user accessible attributes with default values set. Upon completion, clicking Gen-
erate generates the source.
New to the ECP5 and ECP5-5G PLL GUI, the user enters the desired phase shift and the software will calculate
the closest achievable shift. After the desired phase is entered, clicking the Calculate button will display the closest
achievable phase shift in the “Actual Phase” text box. If an entered value is out of range it will be displayed in red
and an error message will be displayed.
33
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
34
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
Corresponding
User Parameters Description Range Default HDL Attribute
CLKOP Enable ON / OFF OFF CLKOP_ENABLE
Bypass ON / OFF OFF OUTDIVIDER_MU
XA
Output Divider (read only) — — CLKOP_DIV
Desired Frequency *1 3.125 – 400 MHz 100 MHz FREQUENCY_PIN
_CLKOP
Tolerance (%) 0.0, 0.1, 0.2, 0.5, 0.0
1.0, 2.0, 5.0, 10.0
Actual Frequency (read only) — —
CLKOS Enable ON / OFF OFF CLKOS_Enable
Bypass ON / OFF OFF OUTDIVIDER_MU
XB
Clock Divider (read only) — — CLKOS_DIV
Desired Frequency *1 3.125 – 400 MHz 100 MHz FREQUENCY_PIN
_CLKOS
Tolerance (%) 0.0, 0.1, 0.2, 0.5, 0.0
1.0, 2.0, 5.0, 10.0
Actual Frequency (read only) — —
CLKOS2 Enable ON / OFF OFF CLKOS2_Enable
Bypass ON / OFF OFF OUTDIVIDER_MU
XC
Clock Divider (read only) — — CLKOS2_DIV
Desired Frequency *1 3.125 – 400 MHz 100 MHz FREQUENCY_PIN
_CLKOS2
Tolerance (%) 0.0, 0.1, 0.2, 0.5, 0.0
1.0, 2.0, 5.0, 10.0
Actual Frequency (read only) — —
CLKOS3 Enable ON / OFF OFF CLKOS3_Enable
Bypass ON / OFF OFF OUTDIVIDER_MU
XD
Clock Divider (read only) — — CLKOS3_DIV
Desired Frequency *1 3.125 – 400 MHz 100 MHz FREQUENCY_PIN
_CLKOS3
Tolerance (%) 0.0, 0.1, 0.2, 0.5, 0.0
1.0, 2.0, 5.0, 10.0
Actual Frequency (read only) — —
1. If this clock is selected as feedback, the minimum output frequency that is achievable is 10 MHz.
35
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
36
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
Figure 33. ECP5 and ECP5-5G PLL Optional Ports Configuration Tab
37
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
For the PLL, Clarity Designer sets attributes in the HDL module that are specific to the data rate selected. Although
these attributes can be easily changed, they should only be modified by re-running the GUI so that the perfor-
mance of the PLL is maintained. After the MAP stage in the design flow, FREQUENCY preferences will be included
in the preference file to automatically constrain the clocks produced by the PLL. For a step by step guide to using
Clarity Designer, refer to the Clarity Designer User Manual.
This component is instantiated in the PLL wrapper when the “Enable Clock Select” option is checked in the Clarity
Designer GUI. It can also be directly instantiated and software will automatically assign it to an unused PLL in
bypass mode and route the output to the CLKOP port.
PLLREFCS Instantiation
PLLREFCSInst0 : PLLREFCS
PORT MAP (
CLK0 => CLK_0
,CLK1 => CLK_1
,SEL => SELECT
,PLLCSOUT => CLK_OUT);
PLLREFCS Usage in Verilog
Component and Attribute Declaration
38
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
PLLREFCS Instantiation
PLLREFCS PLLREFCSInst0 (
.CLK0 (CLK_0)
,.CLK1 (CLK_1)
,.SEL (SELECT)
,.PLLCSOUT (CLK_OUT));
Revision History
Date Version Change Summary
November 2015 1.1 Added support for ECP5-5G.
Changed document title to ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide.
Updated Oscillator (OSCG) section. Removed paragraph on
STDBY port.
Updated PLL Usage in Clarity Designer section. Replaced
Figure 30, Clarity Designer Main Window for PLL Module.
Updated Technical Support Assistance section.
March 2014 01.0 Initial Release
39
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
Figure 35. ECP5 and ECP5-5G Primary Clock Sources and Distribution, LFE5UM/LFE5UM5G-85 Devices
urm_pclkcib1
urm_pclkcib3
ulm_pclkcib1
ulm_pclkcib3
trq_pclkcib0
trq_pclkcib1
tlq_pclkcib0
tlq_pclkcib1
PCLK1_0
PCLK1_1
PCLK0_0
PCLK0_1
PLL_TL OP PLL_TR OP
PLL_TL OS PLL_TR OS
PLL_TL OS2 PLL_TR OS2
PLL_TL OS3 PLL_TR OS3
Mid Mux
Quadrant TL Quadrant TR
OSC output Primary Primary
Clocking Clocking
16
16 12
ulc_pclkcib0 urc_pclkcib0
ulq_pclkcib1 urq_pclkcib1
ulq_pclkcib0 DCC urq_pclkcib0
ulm_pclkcib2 DCC 12 DCC urm_pclkcib0
ulm_pclkcib0 urm_pclkcib2
Mid Mux
Mid Mux
PCLK6_0 D D 14 14 PCLK2_0
DCC
DCC
PCLK6_1 14 14 C C
PCLK2_1
S S
CLKDIV_L0
CLKDIV_L1 Centermux
CLKDIV_R0
CLKDIV_R1
PCLK7_0 16
PCLK3_0
PCLK7_1 DCC DCC
PCLK3_1
DCC
llq_pclkcib0 lrq_pclkcib0
llq_pclkcib1 llc_pclkcib0 lrc_pclkcib0
lrq_pclkcib1
llm_pclkcib0 16 lrm_pclkcib0
16 16
llm_pclkcib2 lrm_pclkcib2
Quadrant BL Quadrant BR
Primary Primary
Clocking Clocking
Mid Mux
PLL_BR OP
PLL_BL0 OP PLL_BR OS
DCUCLKDIV1 CX
DCUCLKDIV0 CX
DCUCLKDIV1 C1
DCUCLKDIV0 C1
DCU1 rx_clk0
DCU1 rx_clk1
DCU0 tx_clk0
DCU0 tx_clk1
DCU1 tx_clk0
DCU1 tx_clk1
lrm_pclkcib1
lrm_pclkcib3
brq_pclkcib0
brq_pclkcib1
blq_pclkcib1
blq_pclkcib0
llm_pclkcib1
llm_pclkcib3
40
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
Figure 36. ECP5 and ECP5-5G Primary Clock Sources and Distribution, LFE5UM/LFE5UM5G-45 Devices
urm_pclkcib1
ulm_pclkcib1
trq_pclkcib0
trq_pclkcib1
tlq_pclkcib0
tlq_pclkcib1
PCLK1_0
PCLK1_1
PCLK0_0
PCLK0_1
PLL_TL OP PLL_TR OP
PLL_TL OS PLL_TR OS
PLL_TL OS2 PLL_TR OS2
PLL_TL OS3 PLL_TR OS3
Mid Mux
Quadrant TL Quadrant TR
OSC output Primary Primary
Clocking Clocking
16
16 12
ulc_pclkcib0 urc_pclkcib0
ulq_pclkcib1 urq_pclkcib1
ulq_pclkcib0 DCC urq_pclkcib0
DCC 12 DCC urm_pclkcib0
ulm_pclkcib0
Mid Mux
Mid Mux
PCLK6_0 D D 14 14 PCLK2_0
DCC
DCC
PCLK6_1 14 14 C C
PCLK2_1
S S
CLKDIV_L0
CLKDIV_L1 Centermux
CLKDIV_R0
CLKDIV_R1
PCLK7_0 16
PCLK3_0
PCLK7_1 DCC DCC
PCLK3_1
DCC
llq_pclkcib0 lrq_pclkcib0
llq_pclkcib1 llc_pclkcib0 lrc_pclkcib0
lrq_pclkcib1
llm_pclkcib0 16 lrm_pclkcib0
16 16
Quadrant BL Quadrant BR
Primary Primary
Clocking Clocking
Mid Mux
PLL_BR OP
PLL_BL0 OP PLL_BR OS
DCUCLKDIV1 CX
DCUCLKDIV0 CX
DCUCLKDIV1 C1
DCUCLKDIV0 C1
DCU1 rx_clk0
DCU1 rx_clk1
DCU0 tx_clk0
DCU0 tx_clk1
DCU1 tx_clk0
DCU1 tx_clk1
lrm_pclkcib1
brq_pclkcib0
brq_pclkcib1
blq_pclkcib1
blq_pclkcib0
llm_pclkcib1
41
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
Figure 37. ECP5 and ECP5-5G Primary Clock Sources and Distribution, LFE5UM/LFE5UM5G-25 Devices
urm_pclkcib1
ulm_pclkcib1
trq_pclkcib0
trq_pclkcib1
tlq_pclkcib0
tlq_pclkcib1
PCLK1_0
PCLK1_1
PCLK0_0
PCLK0_1
Mid Mux
Quadrant TL Quadrant TR
OSC output Primary Primary
Clocking Clocking
16
16 12
ulc_pclkcib0 urc_pclkcib0
ulq_pclkcib1 urq_pclkcib1
ulq_pclkcib0 DCC urq_pclkcib0
DCC 12 DCC urm_pclkcib0
ulm_pclkcib0
Mid Mux
Mid Mux
PCLK6_0 D D 14 14 PCLK2_0
DCC
DCC
PCLK6_1 14 14 C C
PCLK2_1
S S
CLKDIV_L0
CLKDIV_L1 Centermux
CLKDIV_R0
CLKDIV_R1
PCLK7_0 16
PCLK3_0
PCLK7_1 DCC DCC
PCLK3_1
DCC
llq_pclkcib0 lrq_pclkcib0
llq_pclkcib1 llc_pclkcib0 lrc_pclkcib0
lrq_pclkcib1
llm_pclkcib0 16 lrm_pclkcib0
16 16
Quadrant BL Quadrant BR
Primary Primary
Clocking Clocking
Mid Mux
PLL_BR OP
PLL_BL0 OP PLL_BR OS
DCUCLKDIV0 CX
DCUCLKDIV0 C1
DCU0 rx_clk0
DCU0 rx_clk1
DCU0 tx_clk0
DCU0 tx_clk1
lrm_pclkcib1
brq_pclkcib0
brq_pclkcib1
blq_pclkcib1
blq_pclkcib0
llm_pclkcib1
42
ECP5 and ECP5-5G sysCLOCK
PLL/DLL Design and Usage Guide
In the .csv file where pins are listed, under the “Dual Function” section, you will see the PCLK and PLL input pins
listed as below:
43