Ug Altclock

Embed Size (px)

Citation preview

  • 8/12/2019 Ug Altclock

    1/26

    101 Innovation Drive

    San Jose, CA 95134

    www.altera.com

    UG-MF9604-3.1

    User Guide

    Clock Control Block (ALTCLKCTRL) Megafunction

    Document last updated for Altera Complete Design Suite version:

    Document publication date:

    13.0

    February 2014

    Feedback Subscribe

    http://www.altera.com/mailto:[email protected]?subject=Feedback%20on%20UG-MF9604-3.1%20(Clock%20Control%20Block%20(ALTCLKCTRL)%20Megafunction%20User%20Guide)https://www.altera.com/servlets/subscriptions/alert?id=UG-MF9604mailto:[email protected]?subject=Feedback%20on%20UG-MF9604-3.1%20(Clock%20Control%20Block%20(ALTCLKCTRL)%20Megafunction%20User%20Guide)https://www.altera.com/servlets/subscriptions/alert?id=UG-MF9604mailto:[email protected]?subject=Feedback%20on%20UG-MF9604-3.1%20(Clock%20Control%20Block%20(ALTCLKCTRL)%20Megafunction%20User%20Guide)http://www.altera.com/
  • 8/12/2019 Ug Altclock

    2/26

    2014 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logosare trademarks of Altera Corporation and registered in the U.S. Patent and Tradema rk Office and in other countries. All o ther words and logos identified astrademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html.Altera warrants performance of itssemiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any products andservices at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, product, or servicedescribed herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relyingon any published information and before placing orders for products or services.

    February 2014 Altera Corporation Clock Control Block (ALTCLKCTRL) Megafunction

    User Guide

    ISO9001:2008Registered

    http://www.altera.com/common/legal.htmlhttp://www.altera.com/common/legal.htmlhttp://www.altera.com/common/legal.htmlhttp://-/?-http://-/?-http://-/?-http://www.altera.com/support/devices/reliability/certifications/rel-certifications.htmlhttp://www.altera.com/support/devices/reliability/certifications/rel-certifications.htmlhttp://www.altera.com/support/devices/reliability/certifications/rel-certifications.htmlhttp://-/?-http://-/?-http://-/?-http://www.altera.com/support/devices/reliability/certifications/rel-certifications.htmlhttp://www.altera.com/support/devices/reliability/certifications/rel-certifications.htmlhttp://www.altera.com/common/legal.html
  • 8/12/2019 Ug Altclock

    3/26

    February 2014 Altera Corporation Clock Control Block (ALTCLKCTRL) Megafunction

    User Guide

    Contents

    Chapter 1. About this Megafunction

    Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11Device Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    Chapter 2. Parameter SettingsMegaWizard Parameter Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21Command Line Interface Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

    Chapter 3. Functional DescriptionClock Control Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

    Global Clock Control Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32Regional Clock Control Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33External PLL Output Clock Control Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33Clock Enable Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

    Single Register Clock Enable Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34Double Register Clock Enable Circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

    Clock Enable Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35Connectivity Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

    General Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35ALTCLKCTRL Megafunction Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    Input Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37Output Ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

    Prototypes and Component Declarations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38Verilog HDL Prototype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38VHDL Component Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38VHDL LIBRARY-USE Declaration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

    Additional InformationDocument Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Info1How to Contact Altera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Info2Typographic Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Info3

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Ug Altclock

    4/26

    iv Contents

    Clock Control Block (ALTCLKCTRL) Megafunction February 2014 Altera Corporation

    User Guide

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Ug Altclock

    5/26

    February 2014 Altera Corporation Clock Control Block (ALTCLKCTRL) Megafunction

    User Guide

    1. About this Megafunction

    The clock control block (ALTCLKCTRL) megafunction is a clock control function

    provided by the Quartus

    II MegaWizard

    Plug-In Manager to easily configure theclock control block in supported devices.

    The common applications of using this megafunction are as follows:

    Dynamic clock source selectionWhen using the clock control block, you canselect the dynamic clock source that drives the global clock network. However,only certain combinations of signal sources are supported, as described in GlobalClock Control Block on page 32. You cannot select clock sources dynamically todrive the regional clock networks and the dedicated external clock-out path.

    Dynamic power-down of a clock networkThe dynamic clock enable or disablefeature allows internal logic to power-down the clock network. When a clocknetwork is powered-down, all the logic fed by that clock network is not toggling,

    thus the overall power consumption of the device is reduced.

    FeaturesThe ALTCLKCTRL megafunction provides the following additional features:

    Supports specification of operation mode of the clock control block

    Supports specification of the number of input clock sources

    Provides an active high clock enable control input

    Device SupportThe ALTCLKCTRL megafunction is available for the following devices:

    ArriaII GX

    Arria II GZ

    Arria V

    Arria V GZ

    Arria 10

    CycloneIII

    Cyclone III LS

    Cyclone IV E

    Cyclone IV GX

    Cyclone V

    StratixIII

    Stratix IV

    Stratix V

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Ug Altclock

    6/26

    12 Chapter 1: About this Megafunction

    Device Support

    Clock Control Block (ALTCLKCTRL) Megafunction February 2014 Altera Corporation

    User Guide

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Ug Altclock

    7/26

    February 2014 Altera Corporation Clock Control Block (ALTCLKCTRL) Megafunction

    User Guide

    2. Parameter Settings

    This section describes the parameter settings for the ALTCLKCTRL megafunction.You

    can parameterize the megafunction using the MegaWizard Plug-In Manager or thecommand-line interface (CLI). Altera recommends that you configure themegafunctions using the MegaWizard Plug-In Manager.

    f This user guide assumes that you are familiar with megafunctions and how to createthem. If you are unfamiliar with Alteramegafunctions, refer to the Introduction to

    Megafunctions User Guide.

    MegaWizard Parameter SettingsTable 21provides descriptions of the options available on the individual pages of theALTCLKCTRL MegaWizard Plug-In Manager.

    Table 21. ALTCLKCTRL MegaWizard Plug-In Manager Page Options and Description (Part 1 of 4)

    MegaWizardPlug-in

    ManagerPage

    Configuration Setting Description

    1 Which action do you want to perform?

    You can select from the following options: Create a newcustom megafunction variation, Edit an existing custommegafunction variation, or Copy an existing custommegafunction variation.

    2a

    Select a megafunction from the list below Select ALTCLKCTRLfrom the I/O category.

    Which device family will you be using? Specify the device family that you want to use.

    Which type of output file do you want to create?You can choose AHDL(.tdf), VHDL(.vhd), or Verilog HDL(.v) as the output file type.

    What name do you want for the output file? Specify the name of the output file.

    Return to this page for another create operationTurn on this option if you want to return to this page tocreate multiple megafunctions.

    3 Currently selected device family Specifies the device family you chose on page 2a.

    Match project/defaultTurn on this option to ensure that the device selectedmatches the device family that is chosen in the previouspage.

    http://-/?-http://-/?-http://-/?-http://www.altera.com/literature/ug/ug_intro_to_megafunctions.pdfhttp://www.altera.com/literature/ug/ug_intro_to_megafunctions.pdfhttp://-/?-http://-/?-http://-/?-http://www.altera.com/literature/ug/ug_intro_to_megafunctions.pdfhttp://www.altera.com/literature/ug/ug_intro_to_megafunctions.pdf
  • 8/12/2019 Ug Altclock

    8/26

    22 Chapter 2: Parameter Settings

    MegaWizard Parameter Settings

    Clock Control Block (ALTCLKCTRL) Megafunction February 2014 Altera Corporation

    User Guide

    How do you want to use the ALTCLKCTRL?

    Specify the ALTCLKCTRL buffering mode. You can select

    from the following modes:Auto (1)Allows the Compiler to pick the best clockbuffer to use.

    For global clockAllows a clock signal to reach all partsof the chip with the same amount of skew; you can selectinput port clkselectto switch between the four clockinputs.

    For dual regional clockhalf chip (1), (6)Allows aclock signal to reach half of the chip by using tworegional clocks to drive two quadrants; only one clockinput is accepted.

    For regional clock quarter chip (1), (6)Allows a clock

    signal to reach a quadrant of the chip; only one clockinput is accepted.

    For regional clockThis mode is available for Arria 10devices only. Allows a clock to reach a region coveringsix interface tiles vertically (two at the edge of thedevice), and the entire chip horizontally.

    For external path (6)Represents the clock path fromthe outputs of the PLL to the dedicated clock output pins;only one clock output is accepted.

    For periphery clock (1)Allows a clock signal to reach aquadrant or an octant of the chip depending on thedevice; only one clock input is accepted. For tile-based

    architectures like Arria 10 devices, a periphery clock willreach a region aligned with the source interface tile, andhalf the chip horizontally.

    How many clock inputs would you like? (2)Specify the number of input clock sources for the clockcontrol block. You can specify up to four clock inputs.

    Create ena port to enable or disable the clocknetwork driven by this buffer (1), (3)

    Turn on this option if you want to create an active highclock enable signal to enable or disable the clocknetwork.

    Table 21. ALTCLKCTRL MegaWizard Plug-In Manager Page Options and Description (Part 2 of 4)

    MegaWizardPlug-in

    ManagerPage

    Configuration Setting Description

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Ug Altclock

    9/26

    Chapter 2: Parameter Settings 23

    MegaWizard Parameter Settings

    February 2014 Altera Corporation Clock Control Block (ALTCLKCTRL) Megafunction

    User Guide

    How do you want to register the 'ena' port?

    Turn on this option to choose the register mode for cthe

    enaport. The available register modes are:Falling edge of input clockthe clkout pin is theoutput of the first falling edge driven register.

    Double register with input clockthe clkout pinisthe output of the second falling edge driven register.

    Not registeredthe clkout pin is set to one of theclkininput (after the multiplexer).

    This option is available after you turn on the Create enaport to enable or disable the clock network driven bythis bufferoption.

    This option is available in Stratix III, Stratix IV, and StratixV devices only.

    3 Ensure glitch-free switchover implementation

    Turn on this option to implement a glitch-free switchoverwhen you use multiple clock inputs.

    You must ensure the clock that is currently selected isrunning before switching to another source. If theselected clock is not running, the glitch-free switchoverimplementation will not be able to switch to the newclock source.

    By default, the clkselectport is set to 00. A clock mustbe applied to inclk0xfor the values on the clkselectports to be read.

    4 Generate netlist

    Turn on this option if you want to generate a netlist for

    your third-party EDA synthesis tool to estimate the timingand resource usage of the megafunction. If you turn onthis option, a netlist file (_syn.v) is generated. This file isa representation of the customized logic used in theQuartus II software and provides connectivity of thearchitectural elements in the megafunction but may notrepresent true functionality.

    Table 21. ALTCLKCTRL MegaWizard Plug-In Manager Page Options and Description (Part 3 of 4)

    MegaWizardPlug-in

    ManagerPage

    Configuration Setting Description

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Ug Altclock

    10/26

    24 Chapter 2: Parameter Settings

    MegaWizard Parameter Settings

    Clock Control Block (ALTCLKCTRL) Megafunction February 2014 Altera Corporation

    User Guide

    6 Summary Page

    Specify the types of files to be generated. Only the files

    marked with red check marks are optional.Choose from the following types of files:

    Variation file (4)

    AHDL Include file (.inc)

    VHDL component declaration file(.cmp)

    Quartus II symbol file (.bsf)

    Instantiation template file (_inst.v)

    Verilog HDL black box file (_bb.v)

    Synthesis area and timing estimation netlist(_syn.v) (5)

    For more information about the wizard-generated files,refer to Quartus II Help or to theRecommended HDLCoding Styleschapter in volume 1 of the Quartus IIHandbook.

    Notes to Table 21:

    (1) This option is not supported in Cyclone III devices.

    (2) You can change the number of clock inputs only if you choose the Autoor For global clockoptions.

    (3) Not supported if you choose the For periphery clockoption.

    (4) The Variation file contains wrapper code in the language you specified on page 2a and is automatically generated.

    (5) The synthesis area and timing estimation netlist file (_syn.v) is automatically generated if the Generate netlistoption on page 4 is turned on.

    (6) This mode is not supported in Arria 10 devices.

    Table 21. ALTCLKCTRL MegaWizard Plug-In Manager Page Options and Description (Part 4 of 4)

    MegaWizardPlug-in

    ManagerPage

    Configuration Setting Description

    http://-/?-http://-/?-http://www.altera.com/literature/hb/qts/qts_qii51007.pdfhttp://www.altera.com/literature/hb/qts/qts_qii51007.pdfhttp://-/?-http://-/?-http://-/?-http://www.altera.com/literature/hb/qts/qts_qii51007.pdfhttp://www.altera.com/literature/hb/qts/qts_qii51007.pdf
  • 8/12/2019 Ug Altclock

    11/26

  • 8/12/2019 Ug Altclock

    12/26

    26 Chapter 2: Parameter Settings

    Command Line Interface Parameters

    Clock Control Block (ALTCLKCTRL) Megafunction February 2014 Altera Corporation

    User Guide

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Ug Altclock

    13/26

    February 2014 Altera Corporation Clock Control Block (ALTCLKCTRL) Megafunction

    User Guide

    3. Functional Description

    This chapter describes the functional description and the design examples of the

    ALTCLKCTRL megafunction. This section also includes the prototype, componentdeclarations, and the ports descriptions of the ALTCLKCTRL megafunction. You canuse the ports to customize the ALTCLKCTRL megafunction according to yourapplication.

    Clock Control BlockA clock control block is a dynamic clock buffer that allows you to enable and disablethe clock network and dynamically switch between multiple sources to drive theclock network. Table 31shows the clock control block and the devices that support it.

    The following table describes the clock control block.

    Table 31. Clock Buffers that Drive the Clock Control Block

    Clock ControlBlock

    Arria 10 Arria V Arria II GX Stratix V Stratix IV Stratix III Cyclone V Cyclone IV Cyclone

    Global ClockNetwork

    v v v v v v v v vDual RegionalClock Network

    v v v v v v Regional ClockNetwork

    v v v v v v v DedicatedExternal ClockOut Path

    v v v v v v v v v

    For PeripheryClock v v v v v v v

    Table 32. Clock Control Block

    Clock Control Block Description

    Global Clock NetworkAllows a clock signal (or other global signals) toreach all parts of the chip with a similar amountof skew.

    Regional Clock Network

    Allows a signal to reach one quadrant of the chip(though half of the chip can be reached by

    driving two quadrants).For Arria 10 devices, the regional clock networkdrives a sliding window of SCLK regionscorresponding to six interface tiles high.

    External Clock-Out Path

    Represents the clock path from the outputs ofthe phase-locked loop (PLL) to the dedicatedPLL_OUT pins. The ALTCLKCTRL megafunctionalso provides glitch-free implementation formultiple clock input signals.

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Ug Altclock

    14/26

    32 Chapter 3: Functional Description

    Clock Control Block

    Clock Control Block (ALTCLKCTRL) Megafunction February 2014 Altera Corporation

    User Guide

    1 You must ensure the clock that is currently selected is running before switching toanother source. If the selected clock is not running, the glitch-free switchoverimplementation will not be able to switch to the new clock source.

    Global Clock Control Block

    When a clock control block is configured to drive a global clock network, you canselect the clock source statically or you can control the selection dynamically by usinginternal logic to drive multiplexer selector inputs. When selecting the clock sourcestatically, you can set the clock source to any of the inputs. For example, you can usethe dedicated CLKpin, internal logic, and PLL outputs.

    When selecting the clock source dynamically, you can select two PLL outputs (such asc0or c1), a combination of clock pins, or PLL outputs.

    Figure 31shows a clock control block and the possible sources that can drive theglobal clock network.

    f For more information about global clock control block or network in a specific device,refer to the respective device handbook.

    Figure 31. Global Clock Control Block

    Notes to Figure 31:

    (1) You can dynamically control these clock select signals through internal logic only when the device is operating in usermode.

    (2) You can only set these clock select signals through a configuration file and cannot be dynamically controlled duringuser-mode operation.

    2

    22

    GCLK

    Internal Logic

    Internal Logic

    CLKn Pin

    CLKp Pin

    PLL Counter Outputs

    CLKSELECT [1..0]

    (1)

    Enable/

    Disable

    Static Clock Select(2)

    This multiplexer

    supports user-controlleddynamic switching.

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Ug Altclock

    15/26

    Chapter 3: Functional Description 33

    Clock Control Block

    February 2014 Altera Corporation Clock Control Block (ALTCLKCTRL) Megafunction

    User Guide

    Regional Clock Control Block

    When the clock control block is configured to drive a regional clock network, you canonly control the clock source selection statically. You can set any inputs to the clockselect multiplexer as the clock source.

    Figure 32shows a clock control block configured to drive a regional clock network.

    The unused global and regional clock networks are powered down automatically inthe configuration file generated by the Quartus II software. The dynamic clock enablefeature allows the internal logic to control the power for the GCLK and RCLKnetworks. You can enable or disable the clock network with the ALTCLKCTRLmegafunction.

    f For more information about regional clock control block or network in a specificdevice, refer to the respective device handbook.

    External PLL Output Clock Control Block

    When the clock control block is configured to drive the dedicated external clock out,you can only control the clock source selection statically. You can only set the PLLoutputs as the clock source.

    Figure 32. Regional Clock Control Block

    Notes to Figure 32:

    (1) You can only control these clock select signals through a configuration file and cannot be dynamically controlledduring user-mode operation.

    (2) Only the CLKnpins on the top and bottom of the device feed to the regional clock control blocks.

    RCLK

    Internal Logic

    Enable/Disable

    2PLL Counter Outputs Internal Logic

    Static Clock Select

    (1)

    CLKpPin CLKnPin

    (2)

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Ug Altclock

    16/26

    34 Chapter 3: Functional Description

    Clock Control Block

    Clock Control Block (ALTCLKCTRL) Megafunction February 2014 Altera Corporation

    User Guide

    Figure 33shows a clock control block configured to drive a dedicated external clockout.

    f For more information about external PLL output clock control block or network in aspecific device, refer to the respective device handbook.

    Clock Enable Signals

    Single Register Clock Enable Circuit

    In Cyclone III and Cyclone IV devices, the clock enable signals are supported at theclock network level. This allows you to enable or disable the GCLK and RCLKnetworks, or the PLL_OUTpins, which is useful for applications that require low poweror sleep mode.

    Figure 34shows how the enaclock enable signal is implemented.

    Figure 33. External PLL Output Clock Control Block (1)

    Notes to Figure 33:

    (1) The clock control block feeds to a multiplexer within the PLL_OUTpins I/O element (IOE). The PLL_OUTpin is a dual-purpose pin. Therefore, this multiplexer selects either an internal signal or the output of the clock control block.

    (2) You can only set these clock select signals through the configuration file and cannot be dynamically controlled duringuser-mode operation.

    6

    Internal Logic

    Enable/Disable

    Internal Logic

    Static ClockSelect (1)

    Static ClockSelect (1)

    PLL_Out Pin

    PLL Counter Outputs

    (c[0..5])

    Figure 34. Clock Enable Implementation in Cyclone III and Cyclone IV Devices

    D Qclkena

    clk

    clkena out

    clk_out

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Ug Altclock

    17/26

    Chapter 3: Functional Description 35

    Connectivity Restrictions

    February 2014 Altera Corporation Clock Control Block (ALTCLKCTRL) Megafunction

    User Guide

    1 Single register is applicable for Cyclone III and Cyclone IV devices only.

    f For more information about clock enable signals in a specific device, refer to therespective device handbook.

    Double Register Clock Enable Circuit

    The double register clock enable circuit in Arria V, Arria 10, Cyclone V, Stratix III andStratix IV devices helps with asynchronous enable/disable of the clock network, andavoid metastability issues. If the enable signal can toggle at any time, its possible thatif the enable toggles at the same instant as the falling clock edge, the register can getstuck in a state between 0and 1for some time, before resolving. Having tworegisters on the path acts as a synchronization chain and reduces the probability ofgetting stuck in this state.

    Figure 35shows the double register clock enable circuit.

    f For more information about metastability issues, refer toManaging Metastability withthe Quartus II Softwarechapter of the Quartus II Handbook.

    Clock Enable Timing

    Figure 36shows a functional timing waveform example for clock-output enable.

    Clock enable is synchronous with the falling edge of the input clock.

    Connectivity RestrictionsThe following section describes the restrictions associated with the signal sources thatcan drive the inclk[]input.

    General Restrictions

    The inclk[]ports that you use must be consistent with the clkselect[]ports thatyou use.

    Figure 35. Double Register Clock Enable Circuit

    Figure 36. Clock Enable Timing

    inclk

    ena

    outclk

    http://-/?-http://-/?-http://-/?-http://www.altera.com/literature/hb/qts/qts_qii51018.pdfhttp://www.altera.com/literature/hb/qts/qts_qii51018.pdfhttp://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://www.altera.com/literature/hb/qts/qts_qii51018.pdfhttp://www.altera.com/literature/hb/qts/qts_qii51018.pdf
  • 8/12/2019 Ug Altclock

    18/26

    36 Chapter 3: Functional Description

    Connectivity Restrictions

    Clock Control Block (ALTCLKCTRL) Megafunction February 2014 Altera Corporation

    User Guide

    When you are using multiple input sources, the inclk[]ports can only be drivenby the dedicated clock input pins and the PLL clock outputs. Dedicated clockinput pins must feed only inclk[0]and inclk[1], while the PLL clock outputsmust feed only inclk[2]and inclk[3].

    If the clock control block feeds any inclk[]port of another clock control block,both must be able to be reduced to a single clock control block of equivalent

    functionality.

    When you are using the glitch free switchover feature, the clock you are switchingfrom must be active. If it is not active, the switchover circuit will not be able totransition from the clock you originally selected.

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Ug Altclock

    19/26

    Chapter 3: Functional Description 37

    ALTCLKCTRL Megafunction Ports

    February 2014 Altera Corporation Clock Control Block (ALTCLKCTRL) Megafunction

    User Guide

    ALTCLKCTRL Megafunction PortsTable 33and Table 34lists the input and output ports for the ALTCLKCTRLmegafunction.

    Input Ports

    Output Ports

    Table 33. ALTCLKCTRL Megafunction Input Ports

    Port Name Required Description Comments

    clkselect[] No

    Input that dynamically selectsthe clock source to drive theclock network that is driven bythe clock buffer.

    Input port[1 DOWNTO 0]wide.

    If omitted, the default is GND.

    If this signal is connected, only the global clocknetwork can be driven by this clock control block.

    ena No Clock enable of the clock buffer

    If omitted, the default value is VCC.

    This option cannot be used for periphery clocknetwork path in Stratix III and Stratix IV devices.

    inclk[] Yes Clock input of the clock buffer

    Input port [3 DOWNTO 0]wide.

    You can specify up to four clock inputs, inclk[3:0].

    Clock pins, clock outputs from the PLL, and coresignals can drive the inclk[]port.

    Multiple clock inputs are only supported for the globaland auto-selected clock networks.

    Binary Value Signal Selection

    00 inclk[0]

    01 inclk[1]

    10 inclk[2]

    11 inclk[3]

    Table 34. ALTCLKCTRL Megafunction Output Ports

    Port Name Required Description Comments

    outclk Yes Output of the clock buffer.

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Ug Altclock

    20/26

    38 Chapter 3: Functional Description

    Prototypes and Component Declarations

    Clock Control Block (ALTCLKCTRL) Megafunction February 2014 Altera Corporation

    User Guide

    Prototypes and Component DeclarationsThis section describes the prototypes and component declarations of theALTCLKCTRL megafunction.

    Verilog HDL Prototype

    You can locate the following Verilog HDL prototype in the Verilog Design File ( .v)altera_mf.vin the \eda\synthesisdirectory.

    module altclkctrl

    #( parameter clock_type = "AUTO",

    parameter intended_device_family = "unused",

    parameter ena_register_mode = "falling edge",

    parameter implement_in_les = "OFF",

    parameter number_of_clocks = 4,

    parameter use_glitch_free_switch_over_implementation = "OFF",

    parameter width_clkselect = 2,

    parameter lpm_type = "altclkctrl",

    parameter lpm_hint = "unused")

    ( input wire [width_clkselect-1:0] clkselect,

    input wire ena,

    input wire [number_of_clocks-1:0] inclk,

    output wire outclk)/* synthesis syn_black_box=1 */;

    endmodule //altclkctrl

    VHDL Component Declaration

    The following VHDL component declaration is located in the VHDL Design File(.vhd) altera_mf_components.vhdin the \libraries\vhdl\altera_mfdirectory.

    component altclkctrl

    generic (

    clock_type:string := "AUTO";

    intended_device_family:string := "unused";

    ena_register_mode:string := "falling edge";

    implement_in_les:string := "OFF";

    number_of_clocks:natural := 4;

    use_glitch_free_switch_over_implementation:string := "OFF";

    width_clkselect:natural := 2;

    lpm_hint:string := "UNUSED";

    lpm_type:string := "altclkctrl"

    );

    port(

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Ug Altclock

    21/26

  • 8/12/2019 Ug Altclock

    22/26

    310 Chapter 3: Functional Description

    Prototypes and Component Declarations

    Clock Control Block (ALTCLKCTRL) Megafunction February 2014 Altera Corporation

    User Guide

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Ug Altclock

    23/26

    February 2014 Altera Corporation Clock Control Block (ALTCLKCTRL) Megafunction

    User Guide

    Additional Information

    This chapter provides additional information about the document and Altera.

    Document Revision HistoryThe following table lists the revision history for this document.

    Date Version Changes

    February 2014 3.1

    Updated theALTCLKCTRL Megafunction Parameters on page 25to add theinformation for the How do you want to register the 'ena' port?and How do you want touse the ALTCLKCTRL?parameter settings.

    Updated Table 31 on page 31to include Arria 10 and Stratix V devices information.Also added a row for Large Periphery Clocks.

    Added Double Register Clock Enable Circuit on page 35. Removed Stratix II Devices Restrictions, Design Example: Global Clock Buffer, and

    Functional Simulation in the ModelSim-Altera Software because beginning fromQuartus II software version 13.1, Stratix II devices are no longer supported.

    February 2012 3.0 Updated information for switchover usage.

    Added a note about assigning clock type through assignment editor.

    September 2010 2.5 Updated ports and parameters

    http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-http://-/?-
  • 8/12/2019 Ug Altclock

    24/26

    Info2 Additional Information

    How to Contact Altera

    Clock Control Block (ALTCLKCTRL) Megafunction February 2014 Altera Corporation

    User Guide

    How to Contact Altera

    To locate the most up-to-date information about Altera products, refer to thefollowing table.

    December 2008 2.4

    Updated the following sections:

    Device Family Support section

    Introduction section

    General Description section

    Design Example: Global Clock Buffer section

    Functional Simulation in the ModelSim-Altera Software section

    This chapter describes the prototype, component declaration, ports, and parametersof the ALTCLKCTRL megafunction. These ports and parameters are available tocustomize the ALTCLKCTRL megafunction according to your application. section

    How to Contact Altera section

    Removed the following sections:

    Resource Utilization & Performance section

    Software and System Requirements section

    Inferring Megafunctions from HDL Code section

    Instantiating Megafunctions in HDL Code or Schematic Designs section

    Identifying a Megafunction after Compilation section

    SignalTap II Embedded Logic Analyzer section

    Removed all screenshots in the MegaWizard Plug-In Manager Page Descriptionssection

    Reorganized the MegaWizard Plug-In Manager Page Descriptions section into tableformat.

    Renamed About this User Guide section to Additional Information and moved thesection to the end of the user guide.

    May 2007 2.3

    Updated for Quartus II software version 7.1, including:

    Added information on Cyclone III and Arria GX device support

    Added Referenced Documents section

    March 2007 2.2 Added Cyclone III device to list of supported devices.

    December 2006 2.1 Updated device family support to include Stratix III devices.

    October 2006 2.0

    Updated for Quartus II version 6.0, including

    Screen shots

    ModelSim section in Chapter 2

    September 2004 1.0 Initial release

    Date Version Changes

    Contact (1) Contact Method Address

    Technical support Website www.altera.com/support

    Technical trainingWebsite www.altera.com/training

    Email [email protected]

    http://-/?-http://-/?-http://www.altera.com/supporthttp://www.altera.com/trainingmailto:[email protected]://-/?-http://-/?-http://-/?-mailto:[email protected]://www.altera.com/traininghttp://www.altera.com/support
  • 8/12/2019 Ug Altclock

    25/26

    Additional Information Info3

    Typographic Conventions

    February 2014 Altera Corporation Clock Control Block (ALTCLKCTRL) Megafunction

    User Guide

    Typographic ConventionsThe following table shows the typographic conventions this document uses.

    Product literature Website www.altera.com/literature

    Nontechnical support (general) Email [email protected]

    (software licensing) Email [email protected]

    Note to Table:

    (1) You can also contact your local Altera sales office or sales representative.

    Contact (1) Contact Method Address

    Visual Cue Meaning

    Bold Type with Initial Capital

    Letters

    Indicate command names, dialog box titles, dialog box options, and other GUIlabels. For example, Save Asdialog box. For GUI elements, capitalization matchesthe GUI.

    bold typeIndicates directory names, project names, disk drive names, file names, file nameextensions, software utility names, and GUI labels. For example,\qdesignsdirectory, D:drive, and chiptrip.gdffile.

    Italic Type with Initial Capital Letters Indicate document titles. For example, Stratix IV Design Guidelines.

    italic type

    Indicates variables. For example, n+ 1.

    Variable names are enclosed in angle brackets (< >). For example, and.poffile.

    Initial Capital LettersIndicate keyboard keys and menu names. For example, the Delete key and theOptions menu.

    Subheading TitleQuotation marks indicate references to sections in a document and titles ofQuartus II Help topics. For example, Typographic Conventions.

    Courier type

    Indicates signal, port, register, bit, block, and primitive names. For example, data1,

    tdi, and input. The suffix ndenotes an active-low signal. For example, resetn.

    Indicates command line commands and anything that must be typed exactly as itappears. For example, c:\qdesigns\tutorial\chiptrip.gdf.

    Also indicates sections of an actual file, such as a Report File, references to parts offiles (for example, the AHDL keyword SUBDESIGN), and logic function names (forexample, TRI).

    r An angled arrow instructs you to press the Enter key.1., 2., 3., anda., b., c., and so on

    Numbered steps indicate a list of items when the sequence of the items is important,such as the steps listed in a procedure.

    Bullets indicate a list of items when the sequence of the items is not important.

    1 The hand points to information that requires special attention.h The question mark directs you to a software help system with related information.f The feet direct you to another document or website with related information.m The multimedia icon directs you to a related multimedia presentation.c A caution calls attention to a condition or possible situation that can damage or

    destroy the product or your work.

    http://-/?-http://-/?-http://-/?-http://www.altera.com/literature/mailto:[email protected]:[email protected]://-/?-http://-/?-http://-/?-mailto:[email protected]:[email protected]://www.altera.com/literature/
  • 8/12/2019 Ug Altclock

    26/26