![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
101 innovation drive san jose, ca 95134 www.altera.com cyclone iv device handbook, volume 1 cyiv-5v1-1.5
copyright ? 2010 altera corporation. all rights reserved. altera, the programmable solutions company, the stylized altera logo, specific device designations, and all other words and logos that are identified as trademarks and/or service marks are, unless noted otherwise, the trademarks and service marks of altera corporation in the u.s. and other countries. rsds and ppds are registered trademarks of national semiconductor. all other product or service names are the proper ty of their respective holders. altera products are protected under numerous u.s. and foreign patents and pending applications, maskwork rights, and copyrights. altera warrant s performance of its semiconductor products to current specifications in accordance with altera's standard warranty, but reserves the right to make changes to any products and services at any time without notice. altera as- sumes no responsibility or liability arising out of the application or use of any information, product, or service described he rein except as expressly agreed to in writing by altera corporation. altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services . ? december 2010 altera corporation cyclone iv device handbook, volume 1 contents chapter revision dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix additional information about this handbook . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . info-xi how to contact altera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . info-xi typographic conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . info-xi section i. device core revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i-1 chapter 1. cyclone iv fpga device family overview cyclone iv device family features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 device resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3 package matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-5 cyclone iv device family speed grades . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7 cyclone iv device family architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8 fpga core fabric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8 i/o features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9 clock management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9 external memory interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9 configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-10 high-speed transceivers (cyclone iv gx devices only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-11 hard ip for pci express (cyclone iv gx devices only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-11 reference and ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-12 document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-13 chapter 2. logic elements and logic array blocks in cyclone iv devices logic elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-1 le features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2 le operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 normal mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-3 arithmetic mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4 logic array blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4 topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-4 lab interconnects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5 lab control signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6 document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-7 chapter 3. memory blocks in cyclone iv devices overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-1 control signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 parity bit support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 byte enable support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3 packed mode support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 address clock enable support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4 mixed-width support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 asynchronous clear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6 iv contents cyclone iv device handbook, volume 1 ? december 2010 altera corporation memory modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7 single-port mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-7 simple dual-port mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9 true dual-port mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10 shift register mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12 rom mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13 fifo buffer mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13 clocking modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14 independent clock mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14 input or output clock mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-14 read or write clock mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15 single-clock mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15 design considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15 read-during-write operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-15 same-port read-during-write mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-16 mixed-port read-during-write mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17 conflict resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-17 power-up conditions and memory initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18 power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18 document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-18 chapter 4. embedded multipliers in cyclone iv devices embedded multiplier block overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-1 architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 input registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 multiplier stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-3 output registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 operational modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4 18-bit multipliers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5 9-bit multipliers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-5 document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-7 chapter 5. clock networks and plls in cyclone iv devices clock networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-1 gclk network . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-2 clock control block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-9 gclk network clock source generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-11 gclk network power down . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-15 clkena signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-15 plls in cyclone iv devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-16 cyclone iv pll hardware overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-19 external clock outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-21 clock feedback modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-22 source-synchronous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-22 no compensation mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-23 normal mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-24 zero delay buffer mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-25 deterministic latency compensation mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-25 hardware features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-26 clock multiplication and division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-26 post-scale counter cascading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-27 programmable duty cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-27 pll control signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-28 contents v ? december 2010 altera corporation cyclone iv device handbook, volume 1 clock switchover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-28 automatic clock switchover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-28 manual override . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-30 manual clock switchover . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-31 guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-31 programmable bandwidth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-32 phase shift implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-32 pll cascading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-34 pll reconfiguration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-35 pll reconfiguration hardware implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-35 post-scale counters (c0 to c4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-37 scan chain description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-38 charge pump and loop filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-39 bypassing a pll counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-40 dynamic phase shifting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-41 spread-spectrum clocking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-43 pll specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-43 document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-43 section ii. i/o interfaces revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii-1 chapter 6. i/o features in cyclone iv devices cyclone iv i/o elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 i/o element features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 programmable current strength . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 slew rate control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 open-drain output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 bus hold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4 programmable pull-up resistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4 programmable delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4 pci-clamp diode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-6 oct support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-7 on-chip series termination with calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-9 on-chip series termination without calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-11 i/o standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-12 termination scheme for i/o standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-13 voltage-referenced i/o standard termination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-14 differential i/o standard termination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-15 i/o banks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-16 high-speed differential interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22 external memory interfacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22 pad placement and dc guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22 pad placement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-22 dc guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-23 clock pins functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-23 high-speed i/o interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-23 high-speed i/o standards support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-27 high speed serial interface (hssi) input reference clock support . . . . . . . . . . . . . . . . . . . . . . . . . 6-27 lvds i/o standard support in cyclone iv devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6- 28 designing with lvds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-28 blvds i/o standard support in cyclone iv devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-2 9 designing with blvds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-30 vi contents cyclone iv device handbook, volume 1 ? december 2010 altera corporation rsds, mini-lvds, and ppds i/o standard support in cyclone iv devices . . . . . . . . . . . . . . . . . . 6-31 designing with rsds, mini-lvds, and ppds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-3 1 lvpecl i/o support in cyclone iv devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-33 differential sstl i/o standard support in cyclone iv devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-34 differential hstl i/o standard support in cyclone iv devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-35 true output buffer feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-35 programmable pre-emphasis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-35 high-speed i/o timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-36 design guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-38 differential pad placement guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-38 board design considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-38 software overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-39 document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-40 chapter 7. external memory interfaces in cyclone iv devices cyclone iv devices memory interfaces pin support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2 data and data clock/strobe pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-2 optional parity, dm, and error correction coding pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-1 0 address and control/command pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11 memory clock pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-11 cyclone iv devices memory interfaces features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12 ddr input registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-12 ddr output registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-13 oct with calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14 pll . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-14 document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-15 section iii. system integration revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii-1 chapter 8. configuration and remote system upgrades in cyclone iv devices configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-1 configuration features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2 configuration data decompression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2 configuration requirement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3 power-on reset (por) circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4 configuration file size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4 configuration and jtag pin i/o requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8- 5 configuration process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6 power up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6 configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6 configuration error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7 initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7 user mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7 configuration scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-8 as configuration (serial configuration devices) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-10 single-device as configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-10 multi-device as configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-12 configuring multiple cyclone iv devices with the same design . . . . . . . . . . . . . . . . . . . . . . . . . 8-14 guidelines for connecting a serial configuration device to cyclone iv devices for an as interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-17 programming serial configuration devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-18 contents vii ? december 2010 altera corporation cyclone iv device handbook, volume 1 ap configuration (supported flash memories) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-20 ap configuration supported flash memories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8- 21 single-device ap configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-22 multi-device ap configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-24 byte-wide multi-device ap configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-25 word-wide multi-device ap configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8- 25 guidelines for connecting parallel flash to cyclone iv e devices for an ap interface . . . . . . . 8-27 configuring with multiple bus masters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-27 estimating ap configuration time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-29 programming parallel flash memories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-30 ps configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-31 ps configuration using an external host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-32 ps configuration timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-35 ps configuration using a download cable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-36 fpp configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-39 fpp configuration using an external host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-39 fpp configuration timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-43 jtag configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-44 configuring cyclone iv devices with jam stapl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-51 configuring cyclone iv devices with the jrunner software driver . . . . . . . . . . . . . . . . . . . . . . 8-52 combining jtag and as configuration schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-52 programming serial configuration devices in-system with the jtag interface . . . . . . . . . . . . 8-54 jtag instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-56 device configuration pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-61 remote system upgrade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-68 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-68 enabling remote update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-69 configuration image types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-69 remote system upgrade mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-70 remote update mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-70 dedicated remote system upgrade circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-73 remote system upgrade registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-74 remote system upgrade state machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-77 user watchdog timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-78 quartus ii software support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-79 document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-80 chapter 9. seu mitigation in cyclone iv devices configuration error detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-1 user mode error detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-2 automated seu detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3 crc_error pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-3 error detection block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4 error detection registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-4 error detection timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-5 software support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-7 accessing error detection block through user logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-8 recovering from crc errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-10 document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-10 chapter 10. jtag boundary-scan testing for cyclone iv devices ieee std. 1149.6 boundary-scan register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2 bst operation control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3 viii contents cyclone iv device handbook, volume 1 ? december 2010 altera corporation extest_pulse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-5 extest_train . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-5 i/o voltage support in a jtag chain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-5 boundary-scan description language support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6 document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-7 chapter 11. power requirements for cyclone iv devices external power supply requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-1 hot-socketing specifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2 devices driven before power-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2 i/o pins remain tri-stated during power-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-2 hot-socketing feature implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3 power-on reset circuitry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-3 document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-4 ? december 2010 altera corporation cyclone iv device handbook, volume 1 chapter revision dates the chapters in this book, cyclone iv device handbook, volume 1 , were revised on the following dates. where chapters or groups of chapters are available separately, part numbers are listed. chapter 1 cyclone iv fpga device family overview revised: december 2010 part number: cyiv-51001-1.4 chapter 2 logic elements and logic array blocks in cyclone iv devices revised: november 2009 part number: cyiv-51002-1.0 chapter 3 memory blocks in cyclone iv devices revised: november 2009 part number: cyiv-51003-1.0 chapter 4 embedded multipliers in cyclone iv devices revised: february 2010 part number: cyiv-51004-1.1 chapter 5 clock networks and plls in cyclone iv devices revised: december 2010 part number: cyiv-51005-2.2 chapter 6 i/o features in cyclone iv devices revised: december 2010 part number: cyiv-51006-2.1 chapter 7 external memory interfaces in cyclone iv devices revised: december 2010 part number: cyiv-51007-2.2 chapter 8 configuration and remote system upgrades in cyclone iv devices revised: december 2010 part number: cyiv-51008-1.3 chapter 9 seu mitigation in cyclone iv devices revised: february 2010 part number: cyiv-51009-1.1 chapter 10 jtag boundary-scan testing for cyclone iv devices revised: february 2010 part number: cyiv-51010-1.1 chapter 11 power requirements for cyclone iv devices revised: july 2010 part number: cyiv-51011-1.2 x chapter revision dates cyclone iv device handbook, volume 1 ? december 2010 altera corporation ? december 2010 altera corporation cyclone iv device handbook, volume 1 additional information about this handbook this handbook provides comprehensive information about the altera ? cyclone ? iv family of devices. how to contact altera for the most up-to-date information about altera products, see the following table. typographic conventions the following table shows the typographic conventions that this document uses. contact (note 1) contact method address technical support website www.altera.com/support technical training website www.altera.com/training email custrain@altera.com non-technical support (general) email nacomp@altera.com (software licensing) email authorization@altera.com note: (1) you can also contact your local altera sales office or sales representative. visual cue meaning bold type with initial capital letters indicates command names, dialog box titles, dialog box options, and other gui labels. for example, save as dialog box. for gui elements, capitalization matches the gui. bold type indicates directory names, project names, disk drive names, file names, file name extensions, dialog box options, software utility names, and other gui labels. for example, \qdesigns directory, d: drive, and chiptrip.gdf . italic type with initial capital letters indicates document titles. for example, an 519: cyclone iv design guidelines. italic type indicates variables. for example, n + 1. variable names are enclosed in angle brackets (< >). for example, info?xii additional information cyclone iv device handbook, volume 1 ? december 2010 altera corporation courier type indicates signal, port, register, bit, block, and primitive names. for example, data1 , tdi , and input . active-low signals are denoted by suffix n . for example, resetn . indicates command line commands and anything that must be typed exactly as it appears. for example, c:\qdesigns\tutorial\chiptrip.gdf . also indicates sections of an actual file, such as a report file, references to parts of files (for example, the ahdl keyword subdesign ), and logic function names (for example, tri ). 1., 2., 3., and a., 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 th at requires special attention. c a caution calls attention to a condition or possible situation that can damage or destroy the product or your work. w a warning calls attention to a condition or possible situation that can cause you injury. r the angled arrow instructs you to press enter . f the feet direct you to more information about a particular topic. visual cue meaning ? december 2010 altera corporation cyclone iv device handbook, volume 1 section i. device core this section provides a complete overview of all features relating to the cyclone ? iv device family, which is the most architecturally advanced, high-performance, low-power fpga in the market place. this section includes the following chapters: chapter 1, cyclone iv fpga device family overview chapter 2, logic elements and logic array blocks in cyclone iv devices chapter 3, memory blocks in cyclone iv devices chapter 4, embedded multipliers in cyclone iv devices chapter 5, clock networks and plls in cyclone iv devices revision history refer to each chapter for its own specific revision history. for information about when each chapter was updated, refer to the chapter revision dates section, which appears in the complete handbook. ? december 2010 altera corporation cyclone iv device handbook, volume 1 1. cyclone iv fpga device family overview altera?s new cyclone ? iv fpga device family extends the cyclone fpga series leadership in providing the market?s lowest-cost, lowest-power fpgas, now with a transceiver variant. cyclone iv devices are targeted to high-volume, cost-sensitive applications, enabling system designers to meet increasing bandwidth requirements while lowering costs. built on an optimized low-power process, the cyclone iv device family offers the following two variants: cyclone iv e?lowest power, high functionality with the lowest cost cyclone iv gx?lowest power and lowest cost fpgas with 3.125 gbps transceivers 1 cyclone iv e devices are offered in core voltage of 1.0 v and 1.2 v. f for more information, refer to the power requirements for cyclone iv devices chapter. providing power and cost savings without sacrificing performance, along with a low-cost integrated transceiver option, cyclone iv devices are ideal for low-cost, small-form-factor applications in the wireless, wireline, broadcast, industrial, consumer, and communications industries. cyclone iv device family features the cyclone iv device family offers the following features: low-cost, low-power fpga fabric: 6k to 150k logic elements up to 6.3 mb of embedded memory up to 360 18 18 multipliers for dsp processing intensive applications protocol bridging applications for under 1.5 w total power cyiv-51001-1.4 1?2 chapter 1: cyclone iv fpga device family overview cyclone iv device family features cyclone iv device handbook, volume 1 ? december 2010 altera corporation cyclone iv gx devices offer up to eight high-speed transceivers that provide: data rates up to 3.125 gbps 8b/10b encoder/decoder 8-bit or 10-bit physical media attachment (pma) to physical coding sublayer (pcs) interface byte serializer/deserializer (serdes) word aligner rate matching fifo tx bit slipper for common public radio interface (cpri) electrical idle dynamic channel reconfiguration allowing you to change data rates and protocols on-the-fly static equalization and pre-emphasis for superior signal integrity 150 mw per channel power consumption flexible clocking structure to support multiple protocols in a single transceiver block cyclone iv gx devices offer dedicated hard ip for pci express (pipe) (pcie) gen 1: 1, 2, and 4 lane configurations end-point and root-port configurations up to 256-byte payload one virtual channel 2 kb retry buffer 4 kb receiver (rx) buffer cyclone iv gx devices offer a wide range of protocol support: pcie (pipe) gen 1 1, 2, and 4 (2.5 gbps) gigabit ethernet (1.25 gbps) cpri (up to 3.072 gbps) xaui (3.125 gbps) triple rate serial digital interface (sdi) (up to 2.97 gbps) serial rapidio (3.125 gbps) basic mode (up to 3.125 gbps) v-by-one (up to 3.0 gbps) displayport (2.7 gbps) serial advanced technology attachment (sata) (up to 3.0 gbps) obsai (up to 3.072 gbps) chapter 1: cyclone iv fpga device family overview 1?3 device resources ? december 2010 altera corporation cyclone iv device handbook, volume 1 up to 532 user i/os lvds interfaces up to 840 mbps transmitter (tx), 875 mbps rx support for ddr2 sdram interfaces up to 200 mhz support for qdrii sram and ddr sdram up to 167 mhz up to eight phase-locked loops (plls) per device offered in commercial and industrial temperature grades device resources ta b l e 1 ?1 lists cyclone iv e device resources. table 1?1. resources for the cyclone iv e device family resources ep4ce6 ep4ce10 ep4ce15 ep4ce22 ep4ce30 ep4ce40 ep4ce55 ep4ce75 ep4ce115 logic elements (les) 6,272 10,320 15,408 22,320 28,848 39,600 55,856 75,408 114,480 embedded memory (kbits) 270 414 504 594 594 1,134 2,340 2,745 3,888 embedded 18 18 multipliers 15 23 56 66 66 116 154 200 266 general-purpose plls22444444 4 global clock networks 10 10 20 20 20 20 20 20 20 user i/o banks 88888888 8 maximum user i/o (1) 179 179 343 153 532 532 374 426 528 note to table 1?1 : (1) the user i/os count from pin-out files includes all general purpose i/o, dedicated clock pins, and dual purpose configuratio n pins. transceiver pins and dedicated configuration pins are not included in the pin count. 1?4 chapter 1: cyclone iv fpga device family overview device resources cyclone iv device handbook, volume 1 ? december 2010 altera corporation ta b l e 1 ?2 lists cyclone iv gx device resources. table 1?2. resources for the cyclone iv gx device family resources ep4cgx15 ep4cgx22 ep4cgx30 (1) ep4cgx30 (2) ep4cgx50 (3) ep4cgx75 (3) ep4cgx110 (3) ep4cgx150 (3) logic elements (les) 14,400 21,280 29,440 29,440 49,888 73,920 109,424 149,760 embedded memory (kbits) 540 756 1,080 1,080 2,502 4,158 5,490 6,480 embedded 18 18 multipliers 0 40 80 80 140 198 280 360 general purpose plls 1 2 2 4 (4) 4 (4) 4 (4) 4 (4) 4 (4) multipurpose plls 2 (5) 2 (5) 2 (5) 2 (5) 4 (5) 4 (5) 4 (5) 4 (5) global clock networks 20 20 20 30 30 30 30 30 high-speed transceivers (6) 24448888 transceiver maximum data rate (gbps) 2.5 2.5 2.5 3.125 3.125 3.125 3.125 3.125 pcie (pipe) hard ip blocks 1 1 1 1 1 1 1 1 user i/o banks 9 (7) 9 (7) 9 (7) 11 (8) 11 (8) 11 (8) 11 (8) 11 (8) maximum user i/o (9) 72 150 150 290 310 310 475 475 notes to table 1?2 : (1) applicable for the f169 and f324 packages. (2) applicable for the f484 package. (3) only two multipurpose plls for f484 package. (4) two of the general purpose plls are able to support transceiver clocking. for more information, refer to the clock networks and plls in cyclone iv devices chapter. (5) you can use the multipurpose plls for general purpose clocking when they are not used to clock the transceivers. for more in formation, refer to the clock networks and plls in cyclone iv devices chapter. (6) if pcie ? 1, you can use the remaining transceivers in a quad for other protocols at the same or different data rates. (7) including one configuration i/o bank and two dedicated clock input i/o banks for hssi reference clock input. (8) including one configuration i/o bank and four dedicated clock input i/o banks for hssi reference clock input. (9) the user i/os count from pin-out files includes all general purpose i/o, dedicated clock pins, and dual purpose configuratio n pins. transceiver pins and dedicated configuration pins are not included in the pin count. chapter 1: cyclone iv fpga device family overview 1?5 package matrix ? december 2010 altera corporation cyclone iv device handbook, volume 1 package matrix table 1?3 lists cyclone iv e device package offerings. table 1?3. package offerings for the cyclone iv e device family (note 1) package e144 m164 u256 f256 u484 f484 f780 size (mm) 22 22 8 8 14 14 17 17 19 19 23 23 29 29 pitch (mm) 0.5 0.5 0.8 1.0 0.8 1.0 1.0 device user i/o lvds (2) user i/o lvds (2) user i/o lvds (2) user i/o lvds (2) user i/o lvds (2) user i/o lvds (2) user i/o lvds (2) ep4ce6 91 21 ?? 179 66 179 66 ?????? ep4ce10 91 21 ?? 179 66 179 66 ?????? ep4ce15 81 18 89 21 165 53 165 53 ?? 343 137 ?? ep4ce22 79 17 ?? 153 52 153 52 ?? ???? ep4ce30 ?????????? 328 124 532 224 ep4ce40 ???????? 328 124 328 124 532 224 ep4ce55 ???????? 324 132 324 132 374 160 ep4ce75 ???????? 292 110 292 110 426 178 ep4ce115 ?????????? 280 103 528 230 notes to table 1?3 : (1) the e144 package has an exposed pad at the bottom of the package. this exposed pad is a ground pad that must be connected to the ground plane of your pcb. use this exposed pad for electrical connectivity and not for thermal purposes. (2) this includes both dedicated and emulated lvds pairs. for more information, refer to the i/o features in cyclone iv devices chapter. 1?6 chapter 1: cyclone iv fpga device family overview package matrix cyclone iv device handbook, volume 1 ? december 2010 altera corporation table 1?4 lists cyclone iv gx device package offerings, including i/o and transceiver counts. table 1?4. package offerings for the cyclone iv gx device family package n148 f169 f324 f484 f672 f896 size (mm) 11 11 14 14 19 19 23 23 27 27 31 31 pitch (mm) 0.5 1.0 1.0 1.0 1.0 1.0 device user i/o lvds (1) xcvrs user i/o lvds (1) xcvrs user i/o lvds (1) xcvrs user i/o lvds (1) xcvrs user i/o lvds (1) xcvrs user i/o lvds (1) xcvrs ep4cgx15 72 25 2 72 25 2 ? ? ? ? ? ? ? ? ? ? ? ? ep4cgx22 ? ? ? 72 25 2 150 64 4 ? ? ? ? ? ? ? ? ? ep4cgx30 ? ? ? 72 25 2 150 64 4 290 130 4 ? ? ? ? ? ? ep4cgx50 ? ? ? ? ? ? ? ? ? 290 130 4 310 140 8 ? ? ? ep4cgx75 ? ? ? ? ? ? ? ? ? 290 130 4 310 140 8 ? ? ? ep4cgx110 ? ? ? ? ? ? ? ? ? 270 120 4 393 181 8 475 220 8 ep4cgx150 ? ? ? ? ? ? ? ? ? 270 120 4 393 181 8 475 220 8 note to table 1?4 : (1) this includes both dedicated and emulated lvds pairs. for more information, refer to the i/o features in cyclone iv devices chapter. chapter 1: cyclone iv fpga device family overview 1?7 cyclone iv device family speed grades ? december 2010 altera corporation cyclone iv device handbook, volume 1 cyclone iv device family speed grades ta b l e 1 ?5 lists the cyclone iv gx devices speed grades. ta b l e 1 ?6 lists the cyclone iv e devices speed grades. table 1?5. speed grades for the cyclone iv gx device family device n148 f169 f324 f484 f672 f896 ep4cgx15 c7, c8, i7 c6, c7, c8, i7 ? ? ? ? ep4cgx22 ? c6, c7, c8, i7 c6, c7, c8, i7 ? ? ? ep4cgx30 ? c6, c7, c8, i7 c6, c7, c8, i7 c6, c7, c8, i7 ? ? ep4cgx50 ? ? ? c6, c7, c8, i7 c6, c7, c8, i7 ? ep4cgx75 ? ? ? c6, c7, c8, i7 c6, c7, c8, i7 ? ep4cgx110 ? ? ? c7, c8, i7 c7, c8, i7 c7, c8, i7 ep4cgx150 ? ? ? c7, c8, i7 c7, c8, i7 c7, c8, i7 table 1?6. speed grades for the cyclone iv e device family (note 1) , (2) device e144 m164 u256 f256 u484 f484 f780 ep4ce6 c8l, c9l, i8l c6, c7, c8, i7, a7 ?i7n c8l, c9l, i8l c6, c7, c8, i7, a7 ??? ep4ce10 c8l, c9l, i8l c6, c7, c8, i7, a7 ?i7n c8l, c9l, i8l c6, c7, c8, i7, a7 ??? ep4ce15 c8l, c9l, i8l c6, c7, c8, i7 i7n i7n c8l, c9l, i8l c6, c7, c8, i7, a7 ? c8l, c9l, i8l c6, c7, c8, i7, a7 ? ep4ce22 c8l, c9l, i8l c6, c7, c8, i7, a7 ?i7n c8l, c9l, i8l c6, c7, c8, i7, a7 ??? ep4ce30????? c8l, c9l, i8l c6, c7, c8, i7, a7 c8l, c9l, i8l c6, c7, c8, i7 ep4ce40 ? ? ? ? i7n c8l, c9l, i8l c6, c7, c8, i7, a7 c8l, c9l, i8l c6, c7, c8, i7 ep4ce55 ? ? ? ? i7n c8l, c9l, i8l c6, c7, c8, i7 c8l, c9l, i8l c6, c7, c8, i7 ep4ce75 ? ? ? ? i7n c8l, c9l, i8l c6, c7, c8, i7 c8l, c9l, i8l c6, c7, c8, i7 ep4ce115????? c8l, c9l, i8l c7, c8, i7 c8l, c9l, i8l c7, c8, i7 notes to table 1?6 : (1) c8l, c9l, and i8l speed grades are applicable for the 1.0-v core voltage. (2) c6, c7, c8, i7, and a7 speed grades are applicable for the 1.2-v core voltage. 1?8 chapter 1: cyclone iv fpga device family overview cyclone iv device family architecture cyclone iv device handbook, volume 1 ? december 2010 altera corporation cyclone iv device family architecture this section describes cyclone iv device architecture and contains the following topics: ?fpga core fabric? ?i/o features? ?clock management? ?external memory interfaces? ?configuration? ?high-speed transceivers (cyclone iv gx devices only)? ?hard ip for pci express (cyclone iv gx devices only)? fpga core fabric cyclone iv devices leverage the same core fabric as the very successful cyclone series devices. the fabric consists of les, made of 4-input look up tables (luts), memory blocks, and multipliers. each cyclone iv device m9k memory block provides 9 kbits of embedded sram memory. you can configure the m9k blocks as single port, simple dual port, or true dual port ram, as well as fifo buffers or rom. they can also be configured to implement any of the data widths in ta b l e 1? 7 . the multiplier architecture in cyclone iv devices is the same as in the existing cyclone series devices. the embedded multiplier blocks can implement an 18 18 or two 9 9 multipliers in a single block. altera offers a complete suite of dsp ip including finite impulse response (fir), fast fourier transform (fft), and numerically controlled oscillator (nco) functions for use with the multiplier blocks. the quartus ? ii design software?s dsp builder tool integrates mathworks simulink and matlab design environments for a streamlined dsp design flow. f for more information, refer to the logic elements and logic array blocks in cyclone iv devices , memory blocks in cyclone iv devices , and embedded multipliers in cyclone iv devices chapters. table 1?7. m9k block data widths for cyclone iv device family mode data width configurations single port or simple dual port 1, 2, 4, 8/9, 16/18, and 32/36 true dual port 1, 2, 4, 8/9, and 16/18 chapter 1: cyclone iv fpga device family overview 1?9 cyclone iv device family architecture ? december 2010 altera corporation cyclone iv device handbook, volume 1 i/o features cyclone iv device i/o supports programmable bus hold, programmable pull-up resistors, programmable delay, programmable drive strength, programmable slew-rate control to optimize signal integrity, and hot socketing. cyclone iv devices support calibrated on-chip series termination (rs oct) or driver impedance matching (rs) for single-ended i/o standards. in cyclone iv gx devices, the high-speed transceiver i/os are located on the left side of the device. the top, bottom, and right sides can implement general-purpose user i/os. ta b l e 1 ?8 lists the i/o standards that cyclone iv devices support. the lvds serdes is implemented in the core of the device using logic elements. f for more information, refer to the i/o features in cyclone iv devices chapter. clock management cyclone iv devices include up to 30 global clock (gclk) networks and up to eight plls with five outputs per pll to provide robust clock management and synthesis. you can dynamically reconfigure cyclone iv device plls in user mode to change the clock frequency or phase. cyclone iv gx devices support two types of plls: multipurpose plls and general- purpose plls: use multipurpose plls for clocking the transceiver blocks. you can also use them for general-purpose clocking when they are not used for transceiver clocking. use general purpose plls for general-purpose applications in the fabric and periphery, such as external memory interfaces. some of the general purpose plls can support transceiver clocking. f for more information, refer to the clock networks and plls in cyclone iv devices chapter. external memory interfaces cyclone iv devices support sdr, ddr, ddr2 sdram, and qdrii sram interfaces on the top, bottom, and right sides of the device. cyclone iv e devices also support these interfaces on the left side of the device. interfaces may span two or more sides of the device to allow more flexible board design. the altera ? ddr sdram memory interface solution consists of a phy interface and a memory controller. altera supplies the phy ip and you can use it in conjunction with your own custom memory controller or an altera-provided memory controller. cyclone iv devices support the use of error correction coding (ecc) bits on ddr and ddr2 sdram interfaces. table 1?8. i/o standards support for the cyclone iv device family type i/o standard single-ended i/o lvttl, lvcmos, sstl, hstl, pci, and pci-x differential i/o sstl, hstl, lvpecl, blvds, lvds, mini-lvds, rsds, and ppds 1?10 chapter 1: cyclone iv fpga device family overview cyclone iv device family architecture cyclone iv device handbook, volume 1 ? december 2010 altera corporation f for more information, refer to the external memory interfaces in cyclone iv devices chapter. configuration cyclone iv devices use sram cells to store configuration data. configuration data is downloaded to the cyclone iv device each time the device powers up. low-cost configuration options include the altera epcs family serial flash devices and commodity parallel flash configuration options. these options provide the flexibility for general-purpose applications and the ability to meet specific configuration and wake-up time requirements of the applications. ta b l e 1 ?9 lists which configuration schemes are supported by cyclone iv devices. ieee 1149.6 (ac jtag) is supported on all transceiver i/o pins. all other pins support ieee 1149.1 (jtag) for boundary scan testing. f for more information, refer to the jtag boundary-scan testing for cyclone iv devices chapter. for cyclone iv gx devices to meet the pcie 100 ms wake-up time requirement, you must use passive serial (ps) configuration mode for the ep4cgx15/22/30 devices and use fast passive parallel (fpp) configuration mode for the ep4cgx30f484 and ep4cgx50/75/110/150 devices. f for more information, refer to the configuration and remote system upgrades in cyclone iv devices chapter. the cyclical redundancy check (crc) error detection feature during user mode is supported in all cyclone iv gx devices. for cyclone iv e devices, this feature is only supported for the devices with the core voltage of 1.2 v. f for more information about crc error detection, refer to the seu mitigation in cyclone iv devices chapter. table 1?9. configuration schemes for cyclone iv device family devices supported configuration scheme cyclone iv gx as, ps, jtag, and fpp (1) cyclone iv e as, ap, ps, fpp, and jtag note to table 1?9 : (1) the fpp configuration scheme is only supported by the ep4cgx30f484 and ep4cgx50/75/110/150 devices. chapter 1: cyclone iv fpga device family overview 1?11 cyclone iv device family architecture ? december 2010 altera corporation cyclone iv device handbook, volume 1 high-speed transceivers (cyclone iv gx devices only) cyclone iv gx devices contain up to eight full duplex high-speed transceivers that can operate independently. these blocks support multiple industry-standard communication protocols, as well as basic mode, which you can use to implement your own proprietary protocols. each transceiver channel has its own pre-emphasis and equalization circuitry, which you can set at compile time to optimize signal integrity and reduce bit error rates. transceiver blocks also support dynamic reconfiguration, allowing you to change data rates and protocols on-the-fly. figure 1?1 shows the structure of the cyclone iv gx transceiver. f for more information, refer to the cyclone iv transceivers architecture chapter. hard ip for pci express (cyclone iv gx devices only) cyclone iv gx devices incorporate a single hard ip block for 1, 2, or 4 pcie (pipe) in each device. this hard ip block is a complete pcie (pipe) protocol solution that implements the phy-mac layer, data link layer, and transaction layer functionality. the hard ip for the pcie (pipe) block supports root-port and end-point configurations. this pre-verified hard ip block reduces risk, design time, timing closure, and verification. you can configure the block with the quartus ii software?s pci express compiler, which guides you through the process step by step. f for more information, refer to the pci express compiler user guide . figure 1?1. transceiver channel for the cyclone iv gx device rx phase compensation fifo tx phase compensation fifo byte ordering byte deserializer byte serializer 8b10b decoder 8b10b encoder rate match fifo receive r channel pcs receive r channel pma word aligner rx_datain deserializer cdr t r ansmi tt e r channel pcs t r ansceive r channel pma tx_dataout serializer pci exp r ess ha r d ip fpga fab r ic pipe in t e r face 1?12 chapter 1: cyclone iv fpga device family overview reference and ordering information cyclone iv device handbook, volume 1 ? december 2010 altera corporation reference and ordering information figure 1?2 shows the ordering codes for cyclone iv gx devices. figure 1?2. packaging ordering information for the cyclone iv gx device ep4cgx family signature device density ep4cgx 15, 22, 30, 50, 75 110, 150 b: 2 c: 4 d: 8 n: quad flat pack no lead (qfn) f: fineline bga (fbga) transceiver count package type optional suffix speed grade indicates specific device shipment method es: engineering sample n: lead-free devices 6, 7, or 8 with 6 being the fastest c: commercial temperature (t j = 0 c to 85 c) i: industrial temperature (t j = -40 c to 100 c) 11 = 148 pins 14 = 169 pins 19 = 324 pins 23 = 484 pins 27 = 672 pins 31 = 896 pins operating temperature package 30 cf 19 c 7n chapter 1: cyclone iv fpga device family overview 1?13 document revision history ? december 2010 altera corporation cyclone iv device handbook, volume 1 figure 1?3 shows the ordering codes for cyclone iv e devices. document revision history ta b l e 1 ?1 0 lists the revision history for this chapter. figure 1?3. packaging ordering information for the cyclone iv e device ep4ce family signature device density ep4ce 6, 10, 15, 22, 30, 40, 55, 75, 115 f: fineline bga (fbga) e: enhanced thin quad flat pack u: ultra fineline bga (ubga) m: micro fineline bga (mbga) package type optional suffix speed grade indicates specific device shipment method n: lead-free devices es: engineering sample l: low-voltage devices 6, 7, 8 or 9 with 6 being the fastest c: commercial temperature (t j = 0 c to 85 c) i: industrial temperature (t j = -40 c to 100 c) a: automotive temperature (t j = -40 c to 125 c) 8 = 164 pins 17 = 256 pins 22 = 144 pins 23 = 484 pins 29 = 780 pins operating temperature package 40 f 29 c 8 n table 1?10. document revision history date version changes made december 2010 1.4 updated for the quartus ii software version 10.1 release. added cyclone iv e new device package information. updated table 1?1 , table 1?2 , table 1?3 , table 1?5 , and table 1?6 . updated figure 1?3 . minor text edits. july 2010 1.3 updated table 1?2 to include f484 package information. march 2010 1.2 updated table 1?3 and table 1?6. updated figure 1?3. minor text edits. february 2010 1.1 added cyclone iv e devices in table 1?1, table 1?3, and table 1?6 for the quartus ii software version 9.1 sp1 release. added the ?cyclone iv device family speed grades? and ?configuration? sections. added figure 1?3 to include cyclone iv e device packaging ordering information. updated table 1?2, table 1?4, and table 1?5 for cyclone iv gx devices. minor text edits. november 2009 1.0 initial release. 1?14 chapter 1: cyclone iv fpga device family overview document revision history cyclone iv device handbook, volume 1 ? december 2010 altera corporation ? november 2009 altera corporation cyclone iv device handbook, volume 1 2. logic elements and logic array blocks in cyclone iv devices this chapter contains feature definitions for logic elements (les) and logic array blocks (labs). details are provided on how les work, how labs contain groups of les, and how labs interface with the other blocks in cyclone ? iv devices. logic elements logic elements (les) are the smallest units of logic in the cyclone iv device architecture. les are compact and provide advanced features with efficient logic usage. each le has the following features: a four-input look-up table (lut), which can implement any function of four variables a programmable register a carry chain connection a register chain connection the ability to drive the following interconnects: local row column register chain direct link register packing support register feedback support cyiv-51002-1.0 2?2 chapter 2: logic elements and logic array blocks in cyclone iv devices logic elements cyclone iv device handbook, volume 1 ? november 2009 altera corporation figure 2?1 shows the les for cyclone iv devices. le features you can configure the programmable register of each le for d, t, jk, or sr flipflop operation. each register has data, clock, clock enable, and clear inputs. signals that use the global clock network, general-purpose i/o pins, or any internal logic can drive the clock and clear control signals of the register. either general-purpose i/o pins or the internal logic can drive the clock enable. for combinational functions, the lut output bypasses the register and drives directly to the le outputs. each le has three outputs that drive the local, row, and column routing resources. the lut or register output independently drives these three outputs. two le outputs drive the column or row and direct link routing connections, while one le drives the local interconnect resources. this allows the lut to drive one output while the register drives another output. this feature, called register packing, improves device utilization because the device can use the register and the lut for unrelated functions. the lab-wide synchronous load control signal is not available when using register packing. for more information about the synchronous load control signal, refer to ?lab control signals? on page 2?6 . the register feedback mode allows the register output to feed back into the lut of the same le to ensure that the register is packed with its own fan-out lut, providing another mechanism for improved fitting. the le can also drive out registered and unregistered versions of the lut output. figure 2?1. cyclone iv device les ro w , col u mn, and direct link ro u ting data 1 data 2 data 3 data 4 la b clr1 la b clr2 chip- w ide reset (dev_clrn) la b clk1 la b clk2 la b clkena1 la b clkena2 le carry-in lab- w ide synchrono u s load lab- w ide synchrono u s clear ro w , col u mn, and direct link ro u ting local ro u ting register chain o u tp u t register bypass programmable register register chain ro u ting from pre v io u s le le carry-o u t register feedback synchrono u s load and clear logic carry chain look-up ta b le (lut) asynchrono u s clear logic clock & clock ena b le select d q e n a clr n chapter 2: logic elements and logic array blocks in cyclone iv devices 2?3 le operating modes ? november 2009 altera corporation cyclone iv device handbook, volume 1 in addition to the three general routing outputs, les in an lab have register chain outputs, which allows registers in the same lab to cascade together. the register chain output allows the luts to be used for combinational functions and the registers to be used for an unrelated shift register implementation. these resources speed up connections between labs while saving local interconnect resources. le operating modes cyclone iv les operate in the following modes: normal mode arithmetic mode the quartus ? ii software automatically chooses the appropriate mode for common functions, such as counters, adders, subtractors, and arithmetic functions, in conjunction with parameterized functions such as the library of parameterized modules (lpm) functions. you can also create special-purpose functions that specify which le operating mode to use for optimal performance, if required. normal mode normal mode is suitable for general logic applications and combinational functions. in normal mode, four data inputs from the lab local interconnect are inputs to a four-input lut ( figure 2?2 ). the quartus ii compiler automatically selects the carry-in ( cin ) or the data3 signal as one of the inputs to the lut. les in normal mode support packed registers and register feedback. figure 2?2 shows les in normal mode. figure 2?2. cyclone iv device les in normal mode data1 four-input lut data2 data3 cin (from cout of previous le) data4 clock (lab wide) ena (lab wide) aclr (lab wide) clrn d q ena sclear (lab wide) sload (lab wide) register chain connection register chain output row, column, and direct link routing row, column, and direct link routing local routing register bypass packed register input register feedback 2?4 chapter 2: logic elements and logic array blocks in cyclone iv devices logic array blocks cyclone iv device handbook, volume 1 ? november 2009 altera corporation arithmetic mode arithmetic mode is ideal for implementing adders, counters, accumulators, and comparators. an le in arithmetic mode implements a 2-bit full adder and basic carry chain ( figure 2?3 ). les in arithmetic mode can drive out registered and unregistered versions of the lut output. register feedback and register packing are supported when les are used in arithmetic mode. figure 2?3 shows les in arithmetic mode. the quartus ii compiler automatically creates carry chain logic during design processing. you can also manually create the carry chain logic during design entry. parameterized functions, such as lpm functions, automatically take advantage of carry chains for the appropriate functions. the quartus ii compiler creates carry chains longer than 16 les by automatically linking labs in the same column. for enhanced fitting, a long carry chain runs vertically, which allows fast horizontal connections to m9k memory blocks or embedded multipliers through direct link interconnects. for example, if a design has a long carry chain in an lab column next to a column of m9k memory blocks, any le output can feed an adjacent m9k memory block through the direct link interconnect. if the carry chains run horizontally, any lab which is not next to the column of m9k memory blocks uses other row or column interconnects to drive a m9k memory block. a carry chain continues as far as a full column. logic array blocks logic array blocks (labs) contain groups of les. topology each lab consists of the following features: 16 les figure 2?3. cyclone iv device les in arithmetic mode clock (lab wide) ena (lab wide) aclr (lab wide) clrn d q ena sclear (lab wide) sload (lab wide) register chain output row, column, and direct link routing row, column, and direct link routing local routing register feedback three-input lut three-input lut cin (from cout of previous le) data2 data1 cout register bypass data4 data3 register chain connection packed register input chapter 2: logic elements and logic array blocks in cyclone iv devices 2?5 logic array blocks ? november 2009 altera corporation cyclone iv device handbook, volume 1 lab control signals le carry chains register chains local interconnect the local interconnect transfers signals between les in the same lab. register chain connections transfer the output of one le register to the adjacent le register in an lab. the quartus ii compiler places associated logic in an lab or adjacent labs, allowing the use of local and register chain connections for performance and area efficiency. figure 2?4 shows the lab structure for cyclone iv devices. lab interconnects the lab local interconnect is driven by column and row interconnects and le outputs in the same lab. neighboring labs, phase-locked loops (plls), m9k ram blocks, and embedded multipliers from the left and right can also drive the local interconnect of a lab through the direct link connection. the direct link connection feature minimizes the use of row and column interconnects, providing higher performance and flexibility. each le can drive up to 48 les through fast local and direct link interconnects. figure 2?4. cyclone iv device lab structure direct link interconnect from adjacent b lock direct link interconnect to adjacent b lock row interconnect column interconnect local interconnect lab direct link interconnect from adjacent b lock direct link interconnect to adjacent b lock 2?6 chapter 2: logic elements and logic array blocks in cyclone iv devices lab control signals cyclone iv device handbook, volume 1 ? november 2009 altera corporation figure 2?5 shows the direct link connection. lab control signals each lab contains dedicated logic for driving control signals to its les. the control signals include: two cl ocks two cl ock en abl es two asy nch ronous clears one synchronous clear one synchronous load you can use up to eight control signals at a time. register packing and synchronous load cannot be used simultaneously. each lab can have up to four non-global control signals. you can use additional lab control signals as long as they are global signals. synchronous clear and load signals are useful for implementing counters and other functions. the synchronous clear and synchronous load signals are lab-wide signals that affect all registers in the lab. each lab can use two clocks and two clock enable signals. the clock and clock enable signals of each lab are linked. for example, any le in a particular lab using the labclk1 signal also uses the labclkena1 . if the lab uses both the rising and falling edges of a clock, it also uses both lab-wide clock signals. deasserting the clock enable signal turns off the lab-wide clock. the lab row clocks [5..0] and lab local interconnect generate the lab-wide control signals. the multitrack interconnect inherent low skew allows clock and control signal distribution in addition to data distribution. figure 2?5. cyclone iv device direct link connection lab direct link interconnect to right direct link interconnect from right lab, m9k memory b lock, em b edded m u ltiplier, pll, or ioe o u tp u t direct link interconnect from left lab, m9k memory b lock, em b edded m u ltiplier, pll, or ioe o u tp u t local interconnect direct link interconnect to left chapter 2: logic elements and logic array blocks in cyclone iv devices 2?7 document revision history ? november 2009 altera corporation cyclone iv device handbook, volume 1 figure 2?6 shows the lab control signal generation circuit. lab-wide signals control the logic for the clear signal of the register. the le directly supports an asynchronous clear function. each lab supports up to two asynchronous clear signals ( labclr1 and labclr2 ). a lab-wide asynchronous load signal to control the logic for the preset signal of the register is not available. the register preset is achieved with a not gate push-back technique. cyclone iv devices only support either a preset or asynchronous clear signal . in addition to the clear port, cyclone iv devices provide a chip-wide reset pin ( dev_clrn ) that resets all registers in the device. an option set before compilation in the quartus ii software controls this pin. this chip-wide reset overrides all other control signals. document revision history ta b l e 2 ?1 shows the revision history for this chapter. figure 2?6. cyclone iv device lab-wide control signals labclkena1 labclk2 labclk1 labclkena2 labclr1 dedicated lab row clocks local interconnect local interconnect local interconnect local interconnect syncload synclr labclr2 6 table 2?1. document revision history date version changes made november 2009 1.0 initial release. 2?8 chapter 2: logic elements and logic array blocks in cyclone iv devices document revision history cyclone iv device handbook, volume 1 ? november 2009 altera corporation ? november 2009 altera corporation cyclone iv device handbook, volume 1 3. memory blocks in cyclone iv devices cyclone ? iv devices feature embedded memory structures to address the on-chip memory needs of altera ? cyclone iv device designs. the embedded memory structure consists of columns of m9k memory blocks that you can configure to provide various memory functions, such as ram, shift registers, rom, and fifo buffers. this chapter contains the following sections: ?memory modes? on page 3?7 ?clocking modes? on page 3?14 ?design considerations? on page 3?15 overview m9k blocks support the following features: 8,192 memory bits per block (9,216 bits per block including parity) independent read-enable ( rden ) and write-enable ( wren ) signals for each port packed mode in which the m9k memory block is split into two 4.5 k single-port rams variable port configurations single-port and simple dual-port modes support for all port widths true dual-port (one read and one write, two reads, or two writes) operation byte enables for data input masking during writes two clock-enable control signals for each port (port a and port b) initialization file to pre-load memory content in ram and rom modes cyiv-51003-1.0 3?2 chapter 3: memory blocks in cyclone iv devices overview cyclone iv device handbook, volume 1 ? november 2009 altera corporation ta b l e 3 ?1 lists the features supported by the m9k memory. f for information about the number of m9k memory blocks for cyclone iv devices, refer to the cyclone iv device family overview chapter in volume 1 of the cyclone iv device handbook . table 3?1. summary of m9k memory features feature m9k blocks configurations (depth width) 8192 1 4096 2 2048 4 1024 8 1024 9 512 16 512 18 256 32 256 36 parity bits v byte enable v packed mode v address clock enable v single-port mode v simple dual-port mode v true dual-port mode v embedded shift register mode (1) v rom mode v fifo buffer (1) v simple dual-port mixed width support v true dual-port mixed width support (2) v memory initialization file ( .mif ) v mixed-clock mode v power-up condition outputs cleared register asynchronous clears read address registers and output registers only latch asynchronous clears output latches only write or read operation triggering write and read: rising clock edges same-port read-during-write outputs set to old data or new data mixed-port read-during-write outputs set to old data or don?t care notes to table 3?1 : (1) fifo buffers and embedded shift registers that require external logic elements (les) for implementing control logic. (2) width modes of 32 and 36 are not available. chapter 3: memory blocks in cyclone iv devices 3?3 overview ? november 2009 altera corporation cyclone iv device handbook, volume 1 control signals the clock-enable control signal controls the clock entering the input and output registers and the entire m9k memory block. this signal disables the clock so that the m9k memory block does not see any clock edges and does not perform any operations. the rden and wren control signals control the read and write operations for each port of m9k memory blocks. you can disable the rden or wren signals independently to save power whenever the operation is not required. parity bit support parity checking for error detection is possible with the parity bit along with internal logic resources. cyclone iv devices m9k memory blocks support a parity bit for each storage byte. you can use this bit as either a parity bit or as an additional data bit. no parity function is actually performed on this bit. byte enable support cyclone iv devices m9k memory blocks support byte enables that mask the input data so that only specific bytes of data are written. the unwritten bytes retain the previous written value. the wren signals, along with the byte-enable ( byteena ) signals, control the write operations of the ram block. the default value of the byteena signals is high (enabled), in which case writing is controlled only by the wren signals. there is no clear port to the byteena registers. m9k blocks support byte enables when the write port has a data width of 16, 18, 32, or 36 bits. byte enables operate in one-hot manner, with the lsb of the byteena signal corresponding to the least significant byte of the data bus. for example, if byteena = 01 and you are using a ram block in 18 mode, data[8..0] is enabled and data[17..9] is disabled. similarly, if byteena = 11 , both data[8..0] and data[17..9] are enabled. byte enables are active high. ta b l e 3 ?2 lists the byte selection. table 3?2. byteena for cyclone iv devices m9k blocks (note 1) byteena[3..0] affected bytes datain 16 datain 18 datain 32 datain 36 [0] = 1 [7..0] [8..0] [7..0] [8..0] [1] = 1 [15..8] [17..9] [15..8] [17..9] [2] = 1 ? ? [23..16] [26..18] [3] = 1 ? ? [31..24] [35..27] note to table 3?2 : (1) any combination of byte enables is possible. 3?4 chapter 3: memory blocks in cyclone iv devices overview cyclone iv device handbook, volume 1 ? november 2009 altera corporation figure 3?1 shows how the wren and byteena signals control the ram operations. when a byteena bit is deasserted during a write cycle, the old data in the memory appears in the corresponding data-byte output. when a byteena bit is asserted during a write cycle, the corresponding data-byte output depends on the setting chosen in the quartus ? ii software. the setting can either be the newly written data or the old data at that location. packed mode support cyclone iv devices m9k memory blocks support packed mode. you can implement two single-port memory blocks in a single block under the following conditions: each of the two independent block sizes is less than or equal to half of the m9k block size. the maximum data width for each independent block is 18 bits wide. each of the single-port memory blocks is configured in single-clock mode. for more information about packed mode support, refer to ?single-port mode? on page 3?7 and ?single-clock mode? on page 3?15 . address clock enable support cyclone iv devices m9k memory blocks support an active-low address clock enable, which holds the previous address value for as long as the addressstall signal is high ( addressstall = '1' ). when you configure m9k memory blocks in dual-port mode, each port has its own independent address clock enable. figure 3?2 shows an address clock enable block diagram. the address register output feeds back to its input using a multiplexer. the multiplexer output is selected by the address clock enable ( addressstall ) signal. figure 3?1. cyclone iv devices byteena functional waveform (note 1) note to figure 3?1 : (1) for this functional waveform, new data mode is selected. inclock wren address data q (asynch) an xxxx a0 a1 a2 a0 a1 a2 doutn abff ffcd abcd abff ffcd abcd byteena xx 10 01 11 xxxx xx abcd abcd ffff ffff ffff abff ffcd contents at a0 contents at a1 contents at a2 rden chapter 3: memory blocks in cyclone iv devices 3?5 overview ? november 2009 altera corporation cyclone iv device handbook, volume 1 the address clock enable is typically used to improve the effectiveness of cache memory applications during a cache-miss. the default value for the address clock enable signals is low. figure 3?3 and figure 3?4 show the address clock enable waveform during read and write cycles, respectively. figure 3?2. cyclone iv devices address clock enable block diagram figure 3?3. cyclone iv devices address clock enable during read cycle waveform address[0] address[ n ] addressstall clock address[0] register address[ n ] register address[ n ] address[0] inclock rden rdaddress q (synch) a0 a1 a2 a3 a4 a5 a6 q (asynch) an a0 a4 a5 latched address (inside memory) dout0 dout1 dout1 dout4 dout1 dout4 dout5 addressstall a1 doutn-1 dout1 doutn doutn dout1 dout0 dout1 3?6 chapter 3: memory blocks in cyclone iv devices overview cyclone iv device handbook, volume 1 ? november 2009 altera corporation mixed-width support m9k memory blocks support mixed data widths. when using simple dual-port, true dual-port, or fifo modes, mixed width support allows you to read and write different data widths to an m9k memory block. for more information about the different widths supported per memory mode, refer to ?memory modes? on page 3?7 . asynchronous clear cyclone iv devices support asynchronous clears for read address registers, output registers, and output latches only. input registers other than read address registers are not supported. when applied to output registers, the asynchronous clear signal clears the output registers and the effects are immediately seen. if your ram does not use output registers, you can still clear the ram outputs using the output latch asynchronous clear feature. 1 asserting asynchronous clear to the read address register during a read operation may corrupt the memory content. figure 3?5 shows the functional waveform for the asynchronous clear feature. figure 3?4. cyclone iv devices address clock enable during write cycle waveform inclock wren wraddress a0 a1 a2 a3 a4 a5 a6 an a0 a4 a5 latched address (inside memory) addressstall a1 data 00 01 02 03 04 05 06 contents at a0 contents at a1 contents at a2 contents at a3 contents at a4 contents at a5 xx 04 xx 00 03 01 xx 02 xx xx xx 05 figure 3?5. output latch asynchronous clear waveform aclr aclr at latch clk q a1 a0 a1 a2 chapter 3: memory blocks in cyclone iv devices 3?7 memory modes ? november 2009 altera corporation cyclone iv device handbook, volume 1 1 you can selectively enable asynchronous clears per logical memory using the quartus ii ram megawizard ? plug-in manager. f for more information, refer to the ram megafunction user guide . there are three ways to reset registers in the m9k blocks: power up the device use the aclr signal for output register only assert the device-wide reset signal using the dev_clrn option memory modes cyclone iv devices m9k memory blocks allow you to implement fully-synchronous sram memory in multiple modes of operation. cyclone iv devices m9k memory blocks do not support asynchronous (unregistered) memory inputs. m9k memory blocks support the following modes: single-port simple dual-port true dual-port shift-register rom fifo 1 violating the setup or hold time on the m9k memory block input registers may corrupt memory contents. this applies to both read and write operations. single-port mode single-port mode supports non-simultaneous read and write operations from a single address. figure 3?6 shows the single-port memory configuration for cyclone iv devices m9k memory blocks. figure 3?6. single-port memory (note 1) , (2) notes to figure 3?6 : (1) you can implement two single-port memory blocks in a single m9k block. (2) for more information, refer to ?packed mode support? on page 3?4 . data[ ] address[ ] wren byteena[] addressstall inclock inclocken rden aclr outclock q[] outclocken 3?8 chapter 3: memory blocks in cyclone iv devices memory modes cyclone iv device handbook, volume 1 ? november 2009 altera corporation during a write operation, the behavior of the ram outputs is configurable. if you activate rden during a write operation, the ram outputs show either the new data being written or the old data at that address. if you perform a write operation with rden deactivated, the ram outputs retain the values they held during the most recent active rden signal. to choose the desired behavior, set the read-during-write option to either new data or old data in the ram megawizard plug-in manager in the quartus ii software. for more information about read-during-write mode, refer to ?read-during-write operations? on page 3?15 . the port width configurations for m9k blocks in single-port mode are as follow: 8192 1 4096 2 2048 4 1024 8 1024 9 512 16 512 18 256 32 256 36 figure 3?7 shows a timing waveform for read and write operations in single-port mode with unregistered outputs. registering the outputs of the ram simply delays the q output by one clock cycle. figure 3?7. cyclone iv devices single-port mode timing waveform clk_a w ren_a address_a data_a rden_a q _a (old data) a0 a1 ab c d ef a0(old data) a1(old data) ab d e q _a (ne w data) ad bc e f chapter 3: memory blocks in cyclone iv devices 3?9 memory modes ? november 2009 altera corporation cyclone iv device handbook, volume 1 simple dual-port mode simple dual-port mode supports simultaneous read and write operations to different locations. figure 3?8 shows the simple dual-port memory configuration. cyclone iv devices m9k memory blocks support mixed-width configurations, allowing different read and write port widths. table 3?3 lists mixed-width configurations. in simple dual-port mode, m9k memory blocks support separate wren and rden signals. you can save power by keeping the rden signal low (inactive) when not reading. read-during-write operations to the same address can either output ?don?t care? data at that location or output ?old data?. to choose the desired behavior, set the read-during-write option to either don?t care or old data in the ram megawizard plug-in manager in the quartus ii software. for more information about this behavior, refer to ?read-during-write operations? on page 3?15 . figure 3?8. cyclone iv devices simple dual-port memory (note 1) note to figure 3?8 : (1) simple dual-port ram supports input or output clock mode in addition to the read or write clock mode shown. data[ ] wraddress[ ] wren byteena[] wr_addressstall wrclock wrclocken aclr rdaddress[ ] rden q[ ] rd_addressstall rdclock rdclocken table 3?3. cyclone iv devices m9k block mixed-width configurations (simple dual-port mode) read port write port 8192 1 4096 2 2048 41024 8 512 16 256 32 1024 9 512 18 256 36 8192 1 vvvvvv ??? 4096 2 vvvvvv ??? 2048 4 vvvvvv ??? 1024 8 vvvvvv ??? 512 16 vvvvvv ??? 256 32 vvvvvv ??? 1024 9 ? ? ? ? ? ? vvv 51218?????? vvv 25636?????? vvv 3?10 chapter 3: memory blocks in cyclone iv devices memory modes cyclone iv device handbook, volume 1 ? november 2009 altera corporation figure 3?9 shows the timing waveform for read and write operations in simple dual-port mode with unregistered outputs. registering the outputs of the ram simply delays the q output by one clock cycle. true dual-port mode true dual-port mode supports any combination of two-port operations: two reads, two writes, or one read and one write, at two different clock frequencies. figure 3?10 shows cyclone iv devices true dual-port memory configuration. 1 the widest bit configuration of the m9k blocks in true dual-port mode is 512 16-bit (18-bit with parity). figure 3?9. cyclone iv devices simple dual-port timing waveform wrclock wren wraddress rdclock an-1 an a0 a1 a2 a3 a4 a5 a6 q (asynch) rden rdaddress bn b0 b1 b2 b3 doutn-1 doutn dout0 din-1 din din4 din5 din6 data figure 3?10. cyclone iv devices true dual-port memory (note 1) note to figure 3?10 : (1) true dual-port memory supports input or output clock mode in addition to the independent clock mode shown. data_a[ ] address_a[ ] wren_a byteena_a[] addressstall_a clock_a clocken_a rden_a aclr_a q_a[] data_b[ ] address_b[] wren_b byteena_b[] addressstall_b clock_b clocken_b rden_b aclr_b q_b[] chapter 3: memory blocks in cyclone iv devices 3?11 memory modes ? november 2009 altera corporation cyclone iv device handbook, volume 1 ta b l e 3 ?4 lists the possible m9k block mixed-port width configurations. in true dual-port mode, m9k memory blocks support separate wren and rden signals. you can save power by keeping the rden signal low (inactive) when not reading. read-during-write operations to the same address can either output ?new data? at that location or ?old data?. to choose the desired behavior, set the read-during-write option to either new data or old data in the ram megawizard plug-in manager in the quartus ii software. for more information about this behavior, refer to ?read-during-write operations? on page 3?15 . in true dual-port mode, you can access any memory location at any time from either port a or port b. however, when accessing the same memory location from both ports, you must avoid possible write conflicts. when you attempt to write to the same address location from both ports at the same time, a write conflict happens. this results in unknown data being stored to that address location. there is no conflict resolution circuitry built into the cyclone iv devices m9k memory blocks. you must handle address conflicts external to the ram block. figure 3?11 shows true dual-port timing waveforms for the write operation at port a and read operation at port b. registering the outputs of the ram simply delays the q outputs by one clock cycle. table 3?4. cyclone iv devices m9k block mixed-widt h configurations (true dual-port mode) read port write port 8192 1 4096 2 2048 4 1024 8512 16 1024 9 512 18 8192 1 vvvvv ?? 4096 2 vvvvv ?? 2048 4 vvvvv ?? 1024 8 vvvvv ?? 512 16 vvvvv ?? 1024 9????? vv 512 18????? vv 3?12 chapter 3: memory blocks in cyclone iv devices memory modes cyclone iv device handbook, volume 1 ? november 2009 altera corporation shift register mode cyclone iv devices m9k memory blocks can implement shift registers for digital signal processing (dsp) applications, such as finite impulse response (fir) filters, pseudo-random number generators, multi-channel filtering, and auto-correlation and cross-correlation functions. these and other dsp applications require local data storage, traditionally implemented with standard flipflops that quickly exhaust many logic cells for large shift registers. a more efficient alternative is to use embedded memory as a shift register block, which saves logic cell and routing resources. the size of a ( w mn ) shift register is determined by the input data width ( w ), the length of the taps ( m) , and the number of taps ( n ), and must be less than or equal to the maximum number of memory bits, which is 9,216 bits. in addition, the size of ( wn ) must be less than or equal to the maximum width of the block, which is 36 bits. if you need a larger shift register, you can cascade the m9k memory blocks. figure 3?11. cyclone iv devices true dual-port timing waveform clk_a wren_a address_a clk_b an-1 an a0 a1 a2 a3 a4 a5 a6 q_b (asynch) wren_b address_b bn b0 b1 b2 b3 doutn-1 doutn dout0 q_a (asynch) din-1 din din4 din5 din6 data_a din-1 din dout0 dout1 dout2 dout3 din4 din5 dout2 dout1 rden_a rden_b chapter 3: memory blocks in cyclone iv devices 3?13 memory modes ? november 2009 altera corporation cyclone iv device handbook, volume 1 figure 3?12 shows the cyclone iv devices m9k memory block in shift register mode. rom mode cyclone iv devices m9k memory blocks support rom mode. a .mif initializes the rom contents of these blocks. the address lines of the rom are registered. the outputs can be registered or unregistered. the rom read operation is identical to the read operation in the single-port ram configuration. fifo buffer mode cyclone iv devices m9k memory blocks support single-clock or dual-clock fifo buffers. dual clock fifo buffers are useful when transferring data from one clock domain to another clock domain. cyclone iv devices m9k memory blocks do not support simultaneous read and write from an empty fifo buffer. f for more information about fifo buffers, refer to the single- and dual-clock fifo megafunction user guide . figure 3?12. cyclone iv devices shift register mode configuration w w m n shift register m-bit shift register m-bit shift register m-bit shift register m-bit shift register w w w w w w w n number of tap s 3?14 chapter 3: memory blocks in cyclone iv devices clocking modes cyclone iv device handbook, volume 1 ? november 2009 altera corporation clocking modes cyclone iv devices m9k memory blocks support the following clocking modes: independent input or output read or write single-clock when using read or write clock mode, if you perform a simultaneous read or write to the same address location, the output read data is unknown. if you require the output data to be a known value, use either single-clock mode or i/o clock mode and choose the appropriate read-during-write behavior in the megawizard plug-in manager. 1 violating the setup or hold time on the memory block input registers might corrupt the memory contents. this applies to both read and write operations. 1 asynchronous clears are available on read address registers, output registers, and output latches only. ta b l e 3 ?5 lists the clocking mode versus memory mode support matrix. independent clock mode cyclone iv devices m9k memory blocks can implement independent clock mode for true dual-port memories. in this mode, a separate clock is available for each port (port a and port b). clock a controls all registers on the port a side, while clock b controls all registers on the port b side. each port also supports independent clock enables for port a and b registers. input or output clock mode cyclone iv devices m9k memory blocks can implement input or output clock mode for fifo, single-port, true, and simple dual-port memories. in this mode, an input clock controls all input registers to the memory block including data, address, byteena , wren , and rden registers. an output clock controls the data-output registers. each memory block port also supports independent clock enables for input and output registers. table 3?5. cyclone iv devices memory clock modes clocking mode true dual-port mode simple dual-port mode single-port mode rom mode fifo mode independent v ?? v ? input or output vvvv ? read or write ? v ?? v single-clock vvvvv chapter 3: memory blocks in cyclone iv devices 3?15 design considerations ? november 2009 altera corporation cyclone iv device handbook, volume 1 read or write clock mode cyclone iv devices m9k memory blocks can implement read or write clock mode for fifo and simple dual-port memories. in this mode, a write clock controls the data inputs, write address, and wren registers. similarly, a read clock controls the data outputs, read address, and rden registers. m9k memory blocks support independent clock enables for both the read and write clocks. when using read or write mode, if you perform a simultaneous read or write to the same address location, the output read data is unknown. if you require the output data to be a known value, use either single-clock mode, input clock mode, or output clock mode and choose the appropriate read-during-write behavior in the megawizard plug-in manager. single-clock mode cyclone iv devices m9k memory blocks can implement single-clock mode for fifo, rom, true dual-port, simple dual-port, and single-port memories. in this mode, you can control all registers of the m9k memory block with a single clock together with clock enable. design considerations this section describes designing with m9k memory blocks. read-during-write operations ?same-port read-during-write mode? on page 3?16 and ?mixed-port read-during- write mode? on page 3?17 describe the functionality of the various ram configurations when reading from an address during a write operation at that same address. there are two read-during-write data flows: same-port and mixed-port. figure 3?13 shows the difference between these flows. figure 3?13. cyclone iv devices read-during-write data flow port a data in port b data in port a data o u t port b data o u t mixed-port data flo w same-port data flo w w rite_a read_a read_ b w rite_ b 3?16 chapter 3: memory blocks in cyclone iv devices design considerations cyclone iv device handbook, volume 1 ? november 2009 altera corporation same-port read-during-write mode this mode applies to a single-port ram or the same port of a true dual-port ram. in the same port read-during-write mode, there are two output choices: new data mode (or flow-through) and old data mode. in new data mode, new data is available on the rising edge of the same clock cycle on which it was written. in old data mode, the ram outputs reflect the old data at that address before the write operation proceeds. when using new data mode together with byteena , you can control the output of the ram. when byteena is high, the data written into the memory passes to the output (flow-through). when byteena is low, the masked-off data is not written into the memory and the old data in the memory appears on the outputs. therefore, the output can be a combination of new and old data determined by byteena . figure 3?14 and figure 3?15 show sample functional waveforms of same port read-during-write behavior with both new data and old data modes, respectively. figure 3?14. same port read-during write: new data mode figure 3?15. same port read-during-write: old data mode clk_a w ren_a address_a data_a rden_a q _a (asynch) a0 a1 ab c d ef ab c d e f clk_a w ren_a address_a data_a rden_a q _a (asynch) a0 a1 ab c d ef a0(old data) a1(old data) ab d e chapter 3: memory blocks in cyclone iv devices 3?17 design considerations ? november 2009 altera corporation cyclone iv device handbook, volume 1 mixed-port read-during-write mode this mode applies to a ram in simple or true dual-port mode, which has one port reading and the other port writing to the same address location with the same clock. in this mode, you also have two output choices: old data mode or don't care mode. in old data mode, a read-during-write operation to different ports causes the ram outputs to reflect the old data at that address location. in don't care mode, the same operation results in a ?don't care? or unknown value on the ram outputs. f for more information about how to implement the desired behavior, refer to the ram megafunction user guide . figure 3?16 shows a sample functional waveform of mixed port read-during-write behavior for old data mode. in don't care mode, the old data is replaced with ?don't care?. 1 for mixed-port read-during-write operation with dual clocks, the relationship between the clocks determines the output behavior of the memory. if you use the same clock for the two clocks, the output is the old data from the address location. however, if you use different clocks, the output is unknown during the mixed-port read-during-write operation. this unknown value may be the old or new data at the address location, depending on whether the read happens before or after the write. conflict resolution when you are using m9k memory blocks in true dual-port mode, it is possible to attempt two write operations to the same memory location (address). because there is no conflict resolution circuitry built into m9k memory blocks, this results in unknown data being written to that location. therefore, you must implement conflict-resolution logic external to the m9k memory block. figure 3?16. mixed port read-during-write: old data mode a b a (old data) b (old data) clk_a& b w ren_a address_a q _ b (asynch) rden_ b a b address_ b data_a ab c d ef a b de 3?18 chapter 3: memory blocks in cyclone iv devices document revision history cyclone iv device handbook, volume 1 ? november 2009 altera corporation power-up conditions and memory initialization the m9k memory block outputs of cyclone iv devices power up to zero (cleared) regardless of whether the output registers are used or bypassed. all m9k memory blocks support initialization using a .mif . you can create .mif s in the quartus ii software and specify their use using the ram megawizard plug-in manager when instantiating memory in your design. even if memory is pre-initialized (for example, using a .mif ), it still powers up with its outputs cleared. only the subsequent read after power up outputs the pre-initialized values. f for more information about .mif s, refer to the ram megafunction user guide and the quartus ii handbook . power management the m9k memory block clock enables of cyclone iv devices allow you to control clocking of each m9k memory block to reduce ac power consumption. use the rden signal to ensure that read operations only occur when necessary. if your design does not require read-during-write, reduce power consumption by deasserting the rden signal during write operations or any period when there are no memory operations. the quartus ii software automatically powers down any unused m9k memory blocks to save static power. document revision history ta b l e 3 ?6 shows the revision history for this chapter. table 3?6. document revision history date version changes made november 2009 1.0 initial release. ? february 2010 altera corporation cyclone iv device handbook, volume 1 4. embedded multipliers in cyclone iv devices cyclone ? iv devices include a combination of on-chip resources and external interfaces that help increase performance, reduce system cost, and lower the power consumption of digital signal processing (dsp) systems. cyclone iv devices, either alone or as dsp device co-processors, are used to improve price-to-performance ratios of dsp systems. particular focus is placed on optimizing cyclone iv devices for applications that benefit from an abundance of parallel processing resources, which include video and image processing, intermediate frequency (if) modems used in wireless communications systems, and multi-channel communications and video systems. this chapter contains the following sections: ?embedded multiplier block overview? on page 4?1 ?architecture? on page 4?3 ?operational modes? on page 4?4 embedded multiplier block overview figure 4?1 shows one of the embedded multiplier columns with the surrounding logic array blocks (labs). the embedded multiplier is configured as either one 18 18 multiplier or two 9 9 multipliers. for multiplications greater than 18 18, the quartus ? ii software cascades multiple embedded multiplier blocks together. there are no restrictions on the data width of the multiplier, but the greater the data width, the slower the multiplication process. figure 4?1. embedded multipliers arranged in columns with adjacent labs embedded multiplier embedded m u ltiplie r col u m n 1 lab row cyiv-51004-1.1 4?2 chapter 4: embedded multipliers in cyclone iv devices embedded multiplier block overview cyclone iv device handbook, volume 1 ? february 2010 altera corporation ta b l e 4 ?1 lists the number of embedded multipliers and the multiplier modes that can be implemented in each cyclone iv device. in addition to the embedded multipliers in cyclone iv devices, you can implement soft multipliers by using the m9k memory blocks as look-up tables (luts). the luts contain partial results from the multiplication of input data with coefficients that implement variable depth and width high-performance soft multipliers for low-cost, high-volume dsp applications. the availability of soft multipliers increases the number of available multipliers in the device. f for more information about m9k memory blocks, refer to the memory blocks in cyclone iv devices chapter. f for more information about soft multipliers, refer to an 306: implementing multipliers in fpga devices . table 4?1. number of embedded multipliers in cyclone iv devices device family device embedded multipliers 9 9 multipliers (1) 18 18 multipliers (1) cyclone iv gx ep4cgx15 0 0 0 ep4cgx22 40 80 40 ep4cgx30 80 160 80 ep4cgx50 140 280 140 ep4cgx75 198 396 198 ep4cgx110 280 560 280 ep4cgx150 360 720 360 cyclone iv e ep4ce6 15 30 15 ep4ce10 23 46 23 ep4ce15 56 112 56 ep4ce22 66 132 66 ep4ce30 66 132 66 ep4ce40 116 232 116 ep4ce55 154 308 154 ep4ce75 200 400 200 ep4ce115 266 532 266 note to table 4?1 : (1) these columns show the number of 9 9 or 18 18 multipliers for each device. chapter 4: embedded multipliers in cyclone iv devices 4?3 architecture ? february 2010 altera corporation cyclone iv device handbook, volume 1 architecture each embedded multiplier consists of the following elements: multiplier stage input and output registers input and output interfaces figure 4?2 shows the multiplier block architecture. input registers you can send each multiplier input signal into an input register or directly into the multiplier in 9- or 18-bit sections, depending on the operational mode of the multiplier. you can send each multiplier input signal through a register independently of other input signals. for example, you can send the multiplier data a signal through a register and send the data b signal directly to the multiplier. the following control signals are available for each input register in the embedded multiplier: clock clock enable asynchronous clear all input and output registers in a single embedded multiplier are fed by the same clock, clock enable, and asynchronous clear signals. multiplier stage the multiplier stage of an embedded multiplier block supports 9 9 or 18 18 multipliers, as well as other multipliers between these configurations. depending on the data width or operational mode of the multiplier, a single embedded multiplier can perform one or two multiplications in parallel. for multiplier information, refer to ?operational modes? on page 4?4 . figure 4?2. multiplier block architecture clr n dq e n a data a data b aclr clock ena signa sign b clr n dq e n a clr n dq e n a data o u t em b edded m u ltiplier block output register input register 4?4 chapter 4: embedded multipliers in cyclone iv devices operational modes cyclone iv device handbook, volume 1 ? february 2010 altera corporation each multiplier operand is a unique signed or unsigned number. the signa and signb signals control an input of a multiplier and determine if the value is signed or unsigned. if the signa signal is high, the data a operand is a signed number. if the signa signal is low, the data a operand is an unsigned number. ta b l e 4 ?2 lists the sign of the multiplication results for the various operand sign representations. the results of the multiplication are signed if any one of the operands is a signed value . each embedded multiplier block has only one signa and one signb signal to control the sign representation of the input data to the block. if the embedded multiplier block has two 9 9 multipliers, the data a input of both multipliers share the same signa signal, and the data b input of both multipliers share the same signb signal. you can dynamically change the signa and signb signals to modify the sign representation of the input operands at run time. you can send the signa and signb signals through a dedicated input register. the multiplier offers full precision, regardless of the sign representation. 1 when the signa and signb signals are unused, the quartus ii software sets the multiplier to perform unsigned multiplication by default. output registers you can register the embedded multiplier output with output registers in either 18- or 36-bit sections, depending on the operational mode of the multiplier. the following control signals are available for each output register in the embedded multiplier: clock clock enable asynchronous clear all input and output registers in a single embedded multiplier are fed by the same clock, clock enable, and asynchronous clear signals. operational modes you can use an embedded multiplier block in one of two operational modes, depending on the application needs: one 18 18 multiplier up to two 9 9 independent multipliers table 4?2. multiplier sign representation data a data b result signa value logic level signb value logic level unsigned low unsigned low unsigned unsigned low signed high signed signed high unsigned low signed signed high signed high signed chapter 4: embedded multipliers in cyclone iv devices 4?5 operational modes ? february 2010 altera corporation cyclone iv device handbook, volume 1 1 you can also use embedded multipliers of cyclone iv devices to implement multiplier adder and multiplier accumulator functions, in which the multiplier portion of the function is implemented with embedded multipliers, and the adder or accumulator function is implemented in logic elements (les). 18-bit multipliers you can configure each embedded multiplier to support a single 18 18 multiplier for input widths of 10 to 18 bits. figure 4?3 shows the embedded multiplier configured to support an 18-bit multiplier. all 18-bit multiplier inputs and results are independently sent through registers. the multiplier inputs can accept signed integers, unsigned integers, or a combination of both. also, you can dynamically change the signa and signb signals and send these signals through dedicated input registers. 9-bit multipliers you can configure each embedded multiplier to support two 9 9 independent multipliers for input widths of up to 9 bits. figure 4?3. 18-bit multiplier mode clr n dq e n a data a [17..0] data b [17..0] aclr clock ena signa sign b clr n dq e n a clr n dq e n a data o u t [35..0] 1 8 1 8 m u ltiplier em b edded m u ltiplier 4?6 chapter 4: embedded multipliers in cyclone iv devices operational modes cyclone iv device handbook, volume 1 ? february 2010 altera corporation figure 4?4 shows the embedded multiplier configured to support two 9-bit multipliers. all 9-bit multiplier inputs and results are independently sent through registers. the multiplier inputs can accept signed integers, unsigned integers, or a combination of both. two 9 9 multipliers in the same embedded multiplier block share the same signa and signb signal. therefore, all the data a inputs feeding the same embedded multiplier must have the same sign representation. similarly, all the data b inputs feeding the same embedded multiplier must have the same sign representation. figure 4?4. 9-bit multiplier mode clr n dq e n a data a 0 [ 8 ..0] data b 0 [ 8 ..0] aclr clock ena signa sign b clr n dq e n a clr n dq e n a data o u t 0 [17..0] 9 9 m u ltiplier em b edded m u ltiplier clr n dq e n a data a 1 [ 8 ..0] data b 1 [ 8 ..0] clr n dq e n a clr n dq e n a data o u t 1 [17..0] 9 9 m u ltiplier chapter 4: embedded multipliers in cyclone iv devices 4?7 document revision history ? february 2010 altera corporation cyclone iv device handbook, volume 1 document revision history ta b l e 4 ?3 lists the revision history for this chapter. table 4?3. document revision history date version changes made february 2010 1.1 added cyclone iv e devices in ta b le 4 ?1 for the quartus ii software version 9.1 sp1 release. november 2009 1.0 initial release. 4?8 chapter 4: embedded multipliers in cyclone iv devices document revision history cyclone iv device handbook, volume 1 ? february 2010 altera corporation ? december 2010 altera corporation cyclone iv device handbook, volume 1 5. clock networks and plls in cyclone iv devices this chapter describes the hierarchical clock networks and phase-locked loops (plls) with advanced features in the cyclone ? iv device family. it includes details about the ability to reconfigure the pll counter clock frequency and phase shift in real time, allowing you to sweep pll output frequencies and dynamically adjust the output clock phase shift. 1 the quartus ? ii software enables the plls and their features without external devices. this chapter contains the following sections: ?clock networks? on page 5?1 ?plls in cyclone iv devices? on page 5?16 ?cyclone iv pll hardware overview? on page 5?19 ?clock feedback modes? on page 5?22 ?hardware features? on page 5?26 ?programmable bandwidth? on page 5?32 ?phase shift implementation? on page 5?32 ?pll cascading? on page 5?34 ?pll reconfiguration? on page 5?35 ?spread-spectrum clocking? on page 5?43 ?pll specifications? on page 5?43 clock networks the cyclone iv gx device provides up to 12 dedicated clock pins ( clk[15..4] ) that can drive the global clocks (gclks). cyclone iv gx devices support four dedicated clock pins on each side of the device except the left side. these clock pins can drive up to 30 gclks. the cyclone iv e device provides up to 15 dedicated clock pins ( clk[15..1] ) that can drive up to 20 gclks. cyclone iv e devices support three dedicated clock pins on the left side and four dedicated clock pins on the top, right, and bottom sides of the device except ep4ce6 and ep4ce10 devices. ep4ce6 and ep4ce10 devices only support three dedicated clock pins on the left side and four dedicated clock pins on the right side of the device. f for more information about the number of gclk networks in each device density, refer to the cyclone iv fpga device family overview chapter. cyiv-51005-2.2 5?2 chapter 5: clock networks and plls in cyclone iv devices clock networks cyclone iv device handbook, volume 1 ? december 2010 altera corporation gclk network gclks drive throughout the entire device, feeding all device quadrants. all resources in the device (i/o elements, logic array blocks (labs), dedicated multiplier blocks, and m9k memory blocks) can use gclks as clock sources. use these clock network resources for control signals, such as clock enables and clears fed by an external pin. internal logic can also drive gclks for internally generated gclks and asynchronous clears, clock enables, or other control signals with high fan-out. ta b l e 5 ?1 , table 5?2 on page 5?4 , and table 5?3 on page 5?7 list the connectivity of the clock sources to the gclk networks. table 5?1. gclk network connections for ep 4cgx15, ep4cgx22, and ep4cgx30 (note 1) , (2) (part 1 of 2) gclk network clock sources gclk networks 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 clk4/diffclk_2n ????? v ? v ? v ?????????? clk5/diffclk_2p ?????? vv ???????????? clk6/diffclk_3n ?????? v ? vv ?????????? clk7/diffclk_3p ????? v ?? v ??????????? clk8/diffclk_5n ?????????? v ? v ? v ????? clk9/diffclk_5p ??????????? vv ??????? clk10/diffclk_4n /refclk1n ??????????? v ? vv ????? clk11/diffclk_4p /refclk1p ?????????? v ?? v ?????? clk12/diffclk_7p /refclk0p ??????????????? v ? v ? v clk13/diffclk_7n /refclk0n ???????????????? vv ?? clk14/diffclk_6p ???????????????? v ? vv clk15/diffclk_6n ??????????????? v ?? v ? pll_1_c0 v ?? v ??????????? v ?? v ? pll_1_c1 ? v ?? v ??????????? v ?? v pll_1_c2 v ? v ???????????? v ? v ?? pll_1_c3 ? v ? v ???????????? v ? v ? pll_1_c4 ?? v ? v ???????????? v ? v pll_2_c0 v ?? v ?????? v ?? v ?????? pll_2_c1 ? v ?? v ?????? v ?? v ????? pll_2_c2 v ? v ??????? v ? v ??????? pll_2_c3 ? v ? v ??????? v ? v ?????? pll_2_c4 ?? v ? v ??????? v ? v ????? pll_3_c0 ????? v ?? v ?????? v ?? v ? pll_3_c1 ?????? v ?? v ?????? v ?? v pll_3_c2 ????? v ? v ??????? v ? v ?? pll_3_c3 ?????? v ? v ??????? v ? v ? chapter 5: clock networks and plls in cyclone iv devices 5?3 clock networks ? december 2010 altera corporation cyclone iv device handbook, volume 1 pll_3_c4 ??????? v ? v ??????? v ? v pll_4_c0 (3) ????? v ?? v ? v ?? v ?????? pll_4_c1 (3) ?????? v ?? v ? v ?? v ????? pll_4_c2 (3) ????? v ? v ?? v ? v ??????? pll_4_c3 (3) ?????? v ? v ?? v ? v ?????? pll_4_c4 (3) ??????? v ? v ?? v ? v ????? dpclk2 ???????????????? v ??? dpclk3 (4) ?????????????????? v ? dpclk4 (4) ????????????????? v ?? dpclk5 ??????????????????? v dpclk6 (4) ???????? v ??????????? dpclk7 ?????? v ????????????? dpclk8 ????????? v ?????????? dpclk9 (4) ??????? v ???????????? dpclk10 ?????????????? v ????? dpclk11 (4) ???????????? v ??????? dpclk12 (4) ????????????? v ?????? dpclk13 ??????????? v ???????? notes to table 5?1 : (1) ep4cgx30 information in this table refers to all ep4cgx30 packages except f484 package. (2) pll_1 and pll_2 are multipurpose plls while pll_3 and pll_4 are general purpose plls. (3) pll_4 is only available in ep4cgx22 and ep4cgx30 devices in f324 package. (4) this pin applies to ep4cgx22 and ep4cgx30 devices. table 5?1. gclk network connections for ep 4cgx15, ep4cgx22, and ep4cgx30 (note 1) , (2) (part 2 of 2) gclk network clock sources gclk networks 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 5?4 chapter 5: clock networks and plls in cyclone iv devices clock networks cyclone iv device handbook, volume 1 ? december 2010 altera corporation table 5?2. gclk network connections for ep4cgx30, ep4cgx 50, ep4cgx75, ep4cgx110, and ep4cgx150 devices (note 1) , (2) (part 1 of 3) gclk network clock sources gclk networks 01234567891011121314151617181920212223242526272829 clkio4/diffclk_2n ???????????? v ? v ? v ????????????? clkio5 /diffclk_2p ????????????? vv ?? v ???????????? clkio6/diffclk_3n ????????????? v ? vv ????????????? clkio7/diffclk_3p ???????????? v ?? v ? v ???????????? clkio8/diffclk_5n ?????????????????? v ? v ? v ??????? clkio9/diffclk_5p ??????????????????? vv ?? v ?????? clkio10/diffclk_4n/ refclk3n ??????????????????? v ? vv ?????? clkio11/diffclk_4p/ refclk3p ?????????????????? v ?? v ? v ?????? clkio12/diffclk_7p/ refclk2p ???????????????????????? v ? v ? v ? clkio13/diffclk_7n/ refclk2n ????????????????????????? vv ?? v clkio14/diffclk_6p ????????????????????????? v ? vv ? clkio15/diffclk_6n ???????????????????????? v ?? v ? v pll_1_c0 v ?? v ? v ?????????????????? v ?? v ? v pll_1_c1 ? v ?? v ???????????????????? v ?? v ? pll_1_c2 v ? v ????????????????????? v ? v ??? pll_1_c3 ? v ? v ????????????????????? v ? v ?? pll_1_c4 ?? v ? vv ???????????????????? v ? vv pll_2_c0 ?????? v ?? v ? v ?????? v ?? v ? v ?????? pll_2_c1 ??????? v ?? v ???????? v ?? v ??????? pll_2_c2 ?????? v ? v ????????? v ? v ????????? pll_2_c3 ??????? v ? v ????????? v ? v ???????? pll_2_c4 ???????? v ? vv ???????? v ? vv ?????? pll_3_c0 ???????????? v ?? v ? v ?????? v ?? v ? v chapter 5: clock networks and plls in cyclone iv devices 5?5 clock networks ? december 2010 altera corporation cyclone iv device handbook, volume 1 pll_3_c1 ????????????? v ?? v ???????? v ?? v ? pll_3_c2 ???????????? v ? v ????????? v ? v ??? pll_3_c3 ????????????? v ? v ????????? v ? v ?? pll_3_c4 ?????????????? v ? vv ???????? v ? vv pll_4_c0 ???????????? v ?? v ? vv ?? v ? v ?????? pll_4_c1 ????????????? v ?? v ?? v ?? v ??????? pll_4_c2 ???????????? v ? v ??? v ? v ????????? pll_4_c3 ????????????? v ? v ??? v ? v ???????? pll_4_c4 ?????????????? v ? vv ?? v ? vv ?????? pll_5_c0 v ? v ??????????????????????????? pll_5_c1 ?????????????????????????????? pll_5_c2 ?????????????????????????????? pll_5_c3 ? v ? v ?????????????????????????? pll_5_c4 ?? v ? vv ???????????????????????? pll_6_c0 v ?? v ? v ???????????????????????? pll_6_c1 ?????????????????????????????? pll_6_c2 ?????????????????????????????? pll_6_c3 ?????????????????????????????? pll_6_c4 ? v ?? v ????????????????????????? pll_7_c0 (3) ?????? v ?? v ? v ?????????????????? pll_7_c1 (3) ?????????????????????????????? pll_7_c2 (3) ?????????????????????????????? pll_7_c3 (3) ?????????????????????????????? pll_7_c4 (3) ??????? v ?? v ??????????????????? pll_8_c0 (3) ?????? v ? v ????????????????????? table 5?2. gclk network connections for ep 4cgx30, ep4cgx50, ep4cgx75, ep 4cgx110, and ep4cgx150 devices (note 1) , (2) (part 2 of 3) gclk network clock sources gclk networks 01234567891011121314151617181920212223242526272829 5?6 chapter 5: clock networks and plls in cyclone iv devices clock networks cyclone iv device handbook, volume 1 ? december 2010 altera corporation pll_8_c1 (3) ?????????????????????????????? pll_8_c2 (3) ?????????????????????????????? pll_8_c3 (3) ??????? v ? v ???????????????????? pll_8_c4 (3) ???????? v ? vv ?????????????????? dpclk0 ????????????????????????? v ???? dpclk1 ??????????????????????????? v ?? dpclk2 ????????????????????????????? v dpclk3 ???????????????????????? v ????? dpclk4 ?????????????????????????? v ??? dpclk5 ???????????????????????????? v ? dpclk6 ????????????????? v ???????????? dpclk7 ??????????????? v ?????????????? dpclk8 ????????????? v ???????????????? dpclk9 ???????????????? v ????????????? dpclk10 ?????????????? v ??????????????? dpclk11 ???????????? v ????????????????? dpclk12 ?????????????????????? v ??????? dpclk13 ???????????????????? v ????????? dpclk14 ?????????????????? v ??????????? dpclk15 ??????????????????????? v ?????? dpclk16 ????????????????????? v ???????? dpclk17 ??????????????????? v ?????????? notes to table 5?2 : (1) ep4cgx30 information in this table refers to only ep4cgx30 device in f484 package. (2) pll_1 , pll_2 , pll_3 , and pll_4 are general purpose plls while pll_5 , pll_6 , pll_7 , and pll_8 are multipurpose plls. (3) pll_7 and pll_8 are not available in ep4cxgx30, ep4cgx50, ep4cgx75, ep4cgx110, and ep4cgx150 devices in f484 package. table 5?2. gclk network connections for ep4cgx30, ep4cgx 50, ep4cgx75, ep4cgx110, and ep4cgx150 devices (note 1) , (2) (part 3 of 3) gclk network clock sources gclk networks 01234567891011121314151617181920212223242526272829 chapter 5: clock networks and plls in cyclone iv devices 5?7 clock networks ? december 2010 altera corporation cyclone iv device handbook, volume 1 table 5?3. gclk network connections for cyclone iv e devices (note 1) (part 1 of 2) gclk network clock sources gclk networks 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 clk1 ? vv ????????????????? clk2 / diffclk_1p ? v ? vv ??????????????? clk3 / diffclk_1n v ?? v ???????????????? clk4 / diffclk_2p ????? v ? v ? v ?????????? clk5 / diffclk_2n ?????? vv ???????????? clk6 / diffclk_3p ?????? v ? vv ?????????? clk7 / diffclk_3n ????? v ?? v ??????????? clk8 / diffclk_5n (2) ?????????? v ? v ? v ????? clk9 / diffclk_5p (2) ??????????? vv ??????? clk10 / diffclk_4n (2) ??????????? v ? vv ????? clk11 / diffclk_4p (2) ?????????? v ?? v ?????? clk12 / diffclk_7n (2) ??????????????? v ? v ? v clk13 / diffclk_7p (2) ???????????????? vv ?? clk14 / diffclk_6n (2) ???????????????? v ? vv clk15 / diffclk_6p (2) ??????????????? v ?? v ? pll_1_c0 (3) v ?? v ???????????????? pll_1_c1 (3) ? v ?? v ??????????????? pll_1_c2 (3) v ? v ????????????????? pll_1_c3 (3) ? v ? v ???????????????? pll_1_c4 (3) ?? v ? v ??????????????? pll_2_c0 (3) ????? v ?? v ??????????? pll_2_c1 (3) ?????? v ?? v ?????????? pll_2_c2 (3) ????? v ? v ???????????? pll_2_c3 (3) ?????? v ? v ??????????? pll_2_c4 (3) ??????? v ? v ?????????? pll_3_c0 ?????????? v ?? v ?????? pll_3_c1 ??????????? v ?? v ????? pll_3_c2 ?????????? v ? v ??????? pll_3_c3 ??????????? v ? v ?????? pll_3_c4 ???????????? v ? v ????? pll_4_c0 ??????????????? v ?? v ? pll_4_c1 ???????????????? v ?? v 5?8 chapter 5: clock networks and plls in cyclone iv devices clock networks cyclone iv device handbook, volume 1 ? december 2010 altera corporation pll_4_c2 ??????????????? v ? v ?? pll_4_c3 ???????????????? v ? v ? pll_4_c4 ????????????????? v ? v dpclk0 v ??????????????????? dpclk1 ? v ?????????????????? dpclk7 (4) cdpclk0 , or cdpclk7 (2) , (5) ?? v ????????????????? dpclk2 (4) cdpclk1 , or cdpclk2 (2) , (5) ??? vv ??????????????? dpclk5 (4) dpclk7 (2) ????? v ?????????????? dpclk4 (4) dpclk6 (2) ?????? v ????????????? dpclk6 (4) cdpclk5 , or cdpclk6 (2) , (5) ??????? v ???????????? dpclk3 (4) cdpclk4 , or cdpclk3 (2) , (5) ???????? vv ?????????? dpclk8 ?????????? v ????????? dpclk11 ??????????? v ???????? dpclk9 ???????????? v ??????? dpclk10 ????????????? vv ????? dpclk5 ??????????????? v ???? dpclk2 ???????????????? v ??? dpclk4 ????????????????? v ?? dpclk3 ?????????????????? vv notes to table 5?3 : (1) ep4ce6 and ep4ce10 devices only have gclk networks 0 to 9. (2) these pins apply to all cyclone iv e devices except ep4ce6 and ep4ce10 devices. (3) ep4ce6 and ep4ce10 devices only have pll_1 and pll_2 . (4) this pin applies only to ep4ce6 and ep4ce10 devices. (5) only one of the two cdpclk pins can feed the clock control block. you can use the other pin as a regular i/o pin. table 5?3. gclk network connections for cyclone iv e devices (note 1) (part 2 of 2) gclk network clock sources gclk networks 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 chapter 5: clock networks and plls in cyclone iv devices 5?9 clock networks ? december 2010 altera corporation cyclone iv device handbook, volume 1 if you do not use dedicated clock pins to feed the gclks, you can use them as general-purpose input pins to feed the logic array. however, when using them as general-purpose input pins, they do not have support for an i/o register and must use le-based registers in place of an i/o register. f for more information about how to connect the clock and pll pins, refer to the cyclone iv device family pin connection guidelines . clock control block the clock control block drives the gclks. clock control blocks are located on each side of the device, close to the dedicated clock input pins. gclks are optimized for minimum clock skew and delay. ta b l e 5 ?4 lists the sources that can feed the clock control block, which in turn feeds the gclks. in cyclone iv devices, dedicated clock input pins, pll counter outputs, dual-purpose clock i/o inputs, and internal logic can all feed the clock control block for each gclk. the output from the clock control block in turn feeds the corresponding gclk. the gclk can drive the pll input if the clock control block inputs are outputs of another pll or dedicated clock input pins. there are five or six clock control blocks on each side of the device periphery?depending on device density; providing up to 30 clock control blocks in each cyclone iv gx device. the maximum number of clock control blocks per cyclone iv e device is 20. for the clock control block locations, refer to figure 5?2 on page 5?11 , figure 5?3 on page 5?12 , and figure 5?4 on page 5?13 . 1 the clock control blocks on the left side of the cyclone iv gx device do not support any clock inputs. the control block has two functions: dynamic gclk clock source selection (not applicable for dpclk , cdpclk , and internal logic input) gclk network power down (dynamic enable and disable) table 5?4. clock control block inputs input description dedicated clock inputs dedicated clock input pins can drive clocks or global signals, such as synchronous and asynchronous clears, presets, or clock enables onto given gclks. dual - purpose clock ( dpclk and cdpclk) i/o input dpclk and cdpclk i/o pins are bidirectional dual function pins that are used for high fan - out control signals, such as protocol signals, trdy and irdy signals for pci, via the gclk. clock control blocks that have inputs driven by dual - purpose clock i/o pins are not able to drive pll inputs. pll outputs pll counter outputs can drive the gclk. internal logic you can drive the gclk through logic array routing to enable internal logic elements (les) to drive a high fan - out, low - skew signal path. clock control blocks that have inputs driven by internal logic are not able to drive pll inputs. 5?10 chapter 5: clock networks and plls in cyclone iv devices clock networks cyclone iv device handbook, volume 1 ? december 2010 altera corporation figure 5?1 shows the clock control block. each pll generates five clock outputs through the c[4..0] counters. two of these clocks can drive the gclk through a clock control block, as shown in figure 5?1 . f for more information about how to use the clock control block in the quartus ii software, refer to the altclkctrl megafunction user guide . figure 5?1. clock control block notes to figure 5?1 : (1) the clkswitch signal can either be set through the configuration file or dynamically set when using the manual pll switchover feature. the output of the multiplexer is the input clock (f in ) for the pll. (2) the clkselect[1..0] signals are fed by internal logic and are used to dynamically select the clock source for the gclk when the device is in user mode. (3) the static clock select signals are set in the configuration file. therefore, dynamic control when the device is in user mod e is not feasible. (4) two out of four pll clock outputs are selected from adjacent plls to drive into the clock control block. (5) you can use internal logic to enable or disable the gclk in user mode. (6) clk[ n ] is not available on the left side of cyclone iv e devices. clkswitch (1) static clock select (3) static clock select (3) internal logic clock control block not applicable to cyclone i v e devices dpclk clkselect[1..0] (2) internal logic (5) inclk1 inclk0 clk[ n + 3] clk[ n + 2] clk[ n + 1] clk[ n ] (6) f in c0 c1 c2 pll global clock enable/ disable c3 c4 clkswitch (1) inclk1 inclk0 f in c0 c1 c2 pll c3 c4 (4) chapter 5: clock networks and plls in cyclone iv devices 5?11 clock networks ? december 2010 altera corporation cyclone iv device handbook, volume 1 gclk network clock source generation figure 5?2 , figure 5?3 , and figure 5?4 on page 5?13 show the cyclone iv plls, clock inputs, and clock control block location for different cyclone iv device densities. figure 5?2. clock networks and clock control block locations in ep4cgx15, ep4cgx22 , and ep4cgx30 devices (note 1) , (2) notes to figure 5?2 : (1) the clock networks and clock control block locations apply to all ep4cgx15, ep4cgx22, and ep4cgx30 devices except ep4cgx30 device in f484 package. (2) pll_1 and pll_2 are multipurpose plls while pll_3 and pll_4 are general purpose plls. (3) there are five clock control blocks on each side. (4) pll_4 is only available in ep4cgx22 and ep4cgx30 devices in f324 package. (5) the ep4cgx15 device has two dpclk pins on three sides of the device: dpclk2 and dpclk5 on bottom side, dpclk7 and dpclk8 on the right side, dpclk10 and dpclk13 on the top side of device. (6) dedicated clock pins can feed into this pll. however, these paths are not fully compensated. pll_ 1 pll_3 pll_4 pll_ 2 20 20 20 20 4 4 4 22 22 2 2 5 5 dpclk[13..12] (5) dpclk[11..10] (5) clk[11..8] gclk[19..0] gclk[19..0] dpclk[9..8] (5) clk[7..4] dpclk[7..6] (5) dpclk[3..2] (5) clk[15..12] dpclk[5..4] (5) (4) (6) hssi 4 5 4 5 4 5 4 5 4 5 4 5 clock control block (3) clock control block (3) clock control block (3) clock control block (3) (6) 5?12 chapter 5: clock networks and plls in cyclone iv devices clock networks cyclone iv device handbook, volume 1 ? december 2010 altera corporation figure 5?3. clock networks and clock control block locations in ep4cgx30, ep4cgx50, ep4cgx75, ep4cgx110, and ep4cgx150 devices (note 1) , (2) notes to figure 5?3 : (1) the clock networks and clock control block locations in this figure apply to only the ep4cgx30 device in f484 package and al l ep4cgx50, ep4cgx75, ep4cgx110, and ep4cgx150 devices. (2) pll_1 , pll_2 , pll_3 , and pll_4 are general purpose plls while pll_5 , pll_6 , pll_7 , and pll_8 are multipurpose plls. (3) there are 6 clock control blocks on the top, right and bottom sides of the device and 12 clock control blocks on the left si de of the device. (4) refclk[0,1]p/n and refclk[4,5]p/n can only drive the general purpose plls and multipurpose plls on the left side of the device. these clock pins do not have access to the clock control blocks and gclk networks. the refclk[4,5]p/n pins are not available in devices in f484 package. (5) not available for ep4cgx30, ep4cgx50, ep4cgx75, ep4cgx110, and ep4cgx150 devices in f484 package. (6) dedicated clock pins can feed into this pll. however, these paths are not fully compensated. pll_ 1 pll_3 pll_4 pll_ 2 30 30 30 30 4 4 4 4 4 4 33 33 3 3 4 5 4 4 5 5 4 5 5 5 dpclk[17..15] dpclk[14..12] clkio[11..8] gclk[29..0] gclk[29..0] dpclk[11..9] clkio[7..4] dpclk[8..6] dpclk[2..0] clkio[15..12] refclk[0,1]p/n (4) refclk[4,5]p/n (4) dpclk[5..3] clock control block (3) clock control block (3) clock control block (3) clock control block (3) clock control block (3) 3 3 2 2 4 4 5 4 5 hssi hssi pll_ 8 (5) pll_ 5 pll_ 7 (5) pll_ 6 (6) (6) (6) (6) (6) (6) (6) (6) chapter 5: clock networks and plls in cyclone iv devices 5?13 clock networks ? december 2010 altera corporation cyclone iv device handbook, volume 1 the inputs to the clock control blocks on each side of the cyclone iv gx device must be chosen from among the following clock sources: four clock input pins ten pll counter outputs (five from each adjacent plls) two, four, or six dpclk pins from the top, bottom, and right sides of the device five signals from internal logic figure 5?4. clock networks and clock control bloc k locations in cyclone iv e devices notes to figure 5?4 : (1) there are five clock control blocks on each side. (2) only one of the corner cdpclk pins in each corner can feed the clock control block at a time. you can use the other cdpclk pins as general-purpose i/o (gpio) pins . (3) dedicated clock pins can feed into this pll. however, these paths are not fully compensated. (4) pll_3 and pll_4 are not available in ep4ce6 and ep4ce10 devices. pll_1 pll_4 pll_2 pll_3 20 20 20 20 4 4 4 4 3 4 4 4 2 2 2 2 22 22 5 5 5 5 (2) (2) (2) (2) cdpclk7 cdpclk0 cdpclk1 dpclk1 dpclk[11.10] dpclk[9..8] clk[11..8] cdpclk6 dpclk0 clk[3..1] gclk[19..0] gclk[19..0] cdpclk5 dpclk7 clk[7..4] dpclk6 cdpclk4 cdpclk2 dpclk[3..2] clk[15..12] dpclk[5..4] cdpclk3 4 4 4 4 (3) (3) (3) (4) (4) (3) clock control block (1) clock control block (1) clock control block (1) clock control block (1) 5?14 chapter 5: clock networks and plls in cyclone iv devices clock networks cyclone iv device handbook, volume 1 ? december 2010 altera corporation from the clock sources listed above, only two clock input pins, two out of four pll clock outputs (two clock outputs from either adjacent plls), one dpclk pin, and one source from internal logic can drive into any given clock control block, as shown in figure 5?1 on page 5?10 . out of these six inputs to any clock control block, the two clock input pins and two pll outputs are dynamically selected to feed a gclk. the clock control block supports static selection of the signal from internal logic. figure 5?5 shows a simplified version of the clock control blocks on each side of the cyclone iv gx device periphery. the inputs to the five clock control blocks on each side of the cyclone iv e device must be chosen from among the following clock sources: three or four clock input pins, depending on the specific device five pll counter outputs two dpclk pins and two cdpclk pins from both the left and right sides and four dpclk pins from both the top and bottom five signals from internal logic from the clock sources listed above, only two clock input pins, two pll clock outputs, one dpclk or cdpclk pin, and one source from internal logic can drive into any given clock control block, as shown in figure 5?1 on page 5?10 . out of these six inputs to any clock control block, the two clock input pins and two pll outputs are dynamically selected to feed a gclk. the clock control block supports static selection of the signal from internal logic. figure 5?6 shows a simplified version of the five clock control blocks on each side of the cyclone iv e device periphery. figure 5?5. clock control blocks on each side of cyclone iv gx device notes to figure 5?5 : (1) the ep4cgx15 device has two dpclk pins; the ep4cgx22 and ep4cgx30 devices have four dpclk pins; the ep4cgx50, ep4cgx75, ep4cgx110, and ep4cgx150 devices have six dpclk pins. (2) each clock control block in the ep4cgx15, ep4cgx22, and ep4cgx30 devices can drive five gclk networks. each clock control block in the ep4cgx50, ep4cgx75, ep4cgx110, and ep4cgx150 devices can drive six gclk networks. 5 or 6 (2) gclk clock input pins 4 dpclk (1) internal logic clock control block 10 pll outputs 5 2, 4, or 6 five or six clock control blocks on each side of the device chapter 5: clock networks and plls in cyclone iv devices 5?15 clock networks ? december 2010 altera corporation cyclone iv device handbook, volume 1 gclk network power down you can disable a cyclone iv device?s gclk (power down) using both static and dynamic approaches. in the static approach, configuration bits are set in the configuration file generated by the quartus ii software, which automatically disables unused gclks. the dynamic clock enable or disable feature allows internal logic to control clock enable or disable the gclks in cyclone iv devices. when a clock network is disabled, all the logic fed by the clock network is in an off-state, thereby reducing the overall power consumption of the device. this function is independent of the pll and is applied directly on the clock network, as shown in figure 5?1 on page 5?10 . you can set the input clock sources and the clkena signals for the gclk multiplexers through the quartus ii software using the altclkctrl megafunction. f for more information, refer to the altclkctrl megafunction user guide . clkena signals cyclone iv devices support clkena signals at the gclk network level. this allows you to gate-off the clock even when a pll is used. upon re-enabling the output clock, the pll does not need a resynchronization or re-lock period because the circuit gates off the clock at the clock network level. in addition, the pll can remain locked independent of the clkena signals because the loop-related counters are not affected. figure 5?7 shows how to implement the clkena signal with a single register. figure 5?6. clock control blocks on each side of cyclone iv e device (note 1) note to figure 5?6 : (1) the left and right sides of the device have two dpclk pins; the top and bottom of the device have four dpclk pins. 5 gclk clock inp u t pins 3 or 4 dpclk internal logic clock control block 5 pll o u tp u ts 5 2 or 4 cdpclk 2 five clock control blocks on each side of the device figure 5?7. clkena implementation dq clkena clkena_o u t clk_o u t clkin 5?16 chapter 5: clock networks and plls in cyclone iv devices plls in cyclone iv devices cyclone iv device handbook, volume 1 ? december 2010 altera corporation 1 the clkena circuitry controlling the output c0 of the pll to an output pin is implemented with two registers instead of a single register, as shown in figure 5?7 . figure 5?8 shows the waveform example for a clock output enable. the clkena signal is sampled on the falling edge of the clock ( clkin ). 1 this feature is useful for applications that require low power or sleep mode. the clkena signal can also disable clock outputs if the system is not tolerant to frequency overshoot during pll resynchronization. altera recommends using the clkena signals when switching the clock source to the plls or the gclk. the recommended sequence is: 1. disable the primary output clock by de-asserting the clkena signal. 2. switch to the secondary clock using the dynamic select signals of the clock control block. 3. allow some clock cycles of the secondary clock to pass before reasserting the clkena signal. the exact number of clock cycles you must wait before enabling the secondary clock is design-dependent. you can build custom logic to ensure glitch-free transition when switching between different clock sources. plls in cyclone iv devices cyclone iv gx devices offer two variations of plls: general purpose plls and multipurpose plls. cyclone iv e devices only have the general purpose plls. the general purpose plls are used for general-purpose applications in the fpga fabric and periphery such as external memory interfaces. the multipurpose plls are used for clocking the transceiver blocks. when the multipurpose plls are not used for transceiver clocking, they can be used for general-purpose clocking. f for more details about the multipurpose plls used for transceiver clocking, refer to the cyclone iv transceivers chapter. figure 5?8. clkena implementation: output enable clkin clkena clk_o u t chapter 5: clock networks and plls in cyclone iv devices 5?17 plls in cyclone iv devices ? december 2010 altera corporation cyclone iv device handbook, volume 1 cyclone iv gx devices contain up to eight general purpose plls and multipurpose plls while cyclone iv e devices have up to four general purpose plls that provide robust clock management and synthesis for device clock management, external system clock management, and high-speed i/o interfaces. f for more information about the number of general purpose plls and multipurpose plls in each device density, refer to the cyclone iv device family overview chapter. 1 the general i/o pins cannot drive the pll clock input pins. ta b l e 5 ?5 lists the features available in cyclone iv gx plls. table 5?5. cyclone iv gx pll features (part 1 of 2) features availability general purpose plls multipurpose plls pll_1 (1) , (10) pll_2 (1) , (10) pll_3 (2) pll_4 (3) pll_1 (4) pll_2 (4) pll_5 (1) , (10) pll_6 (1) , (10) pll_7 (1) pll_8 (1) c (output counters) 5 m, n, c counter sizes 1 to 512 (5) dedicated clock outputs 1 single-ended or 1 differential pair clock input pins 12 single-ended or 6 differential pairs (6) and 4 differential pairs (7) spread - spectrum input clock tracking v (8) pll cascading through gclk source - synchronous mode v v vvvv v ?? v no compensation mode v v vvvv v v vv normal mode v v vvvv v ?? v zero delay buffer mode v v vvvv v ?? v deterministic latency compensation mode vv ?? vv v v vv phase shift resolution (9) down to 96 ps increments programmable duty cycle v output counter cascading v input clock switchover v user mode reconfiguration v loss of lock detection v pll drives tx serial clock, tx load enable, and tx parallel clock vv ?? v vco output drives rx clock data recovery (cdr) clock ? v 5?18 chapter 5: clock networks and plls in cyclone iv devices plls in cyclone iv devices cyclone iv device handbook, volume 1 ? december 2010 altera corporation ta b l e 5 ?6 lists the features available in cyclone iv e plls. pll drives fref for ppm detect vv ?? v notes to table 5?5 : (1) this is only applicable to ep4cgx50, ep4cgx75, ep4cgx110, and ep4cgx150 devices in f672 and f896 package. (2) this is applicable to all cyclone iv devices. (3) this is applicable to all cyclone iv devices except ep4cgx15 devices in all packages, ep4cgx22, and ep4cgx30 devices in f169 package. (4) this is only applicable to ep4cgx15, ep4cgx22, and all ep4cgx30 devices except ep4cgx30 in the f484 package.. (5) c counters range from 1 through 512 if the output clock uses a 50% duty cycle. for any output clocks using a non-50% duty cy cle, the post - scale counters range from 1 through 256. (6) these clock pins can access the gclk networks. (7) these clock pins are only available in ep4cgx50, ep4cgx75, ep4cgx110, and ep4cgx150 devices and cannot access the gclk netwo rks. clk[17,19,20,21]p can be used as single-ended clock input pins. (8) only applicable if the input clock jitter is in the input jitter tolerance specifications. (9) the smallest phase shift is determined by the voltage - controlled oscillator (vco) period divided by eight. for degree increments, cyclone iv gx devices can shift all output frequencies in increments of at least 45. smaller degree increments are possible depending on the frequen cy and divide parameters. (10) this is applicable to the ep4cgx30, ep4cgx50, ep4cgx75, ep4cgx110, and ep4cgx150 devices in f484 package. table 5?5. cyclone iv gx pll features (part 2 of 2) features availability general purpose plls multipurpose plls pll_1 (1) , (10) pll_2 (1) , (10) pll_3 (2) pll_4 (3) pll_1 (4) pll_2 (4) pll_5 (1) , (10) pll_6 (1) , (10) pll_7 (1) pll_8 (1) table 5?6. cyclone iv e pll features hardware features availability c (output counters) 5 m, n, c counter sizes 1 to 512 (1) dedicated clock outputs 1 single-ended or 1 differential pair clock input pins 4 single-ended or 2 differential pairs spread-spectrum input clock tracking v (2) pll cascading through gclk compensation modes source-synchronous mode, no compensation mode, normal mode, and zero delay buffer mode phase shift resolution down to 96-ps increments (3) programmable duty cycle v output counter cascading v input clock switchover v user mode reconfiguration v loss of lock detection v notes to table 5?6 : (1) c counters range from 1 through 512 if the output clock uses a 50% duty cycle. for any output clocks using a non-50% duty cycle, the post-scale counters range from 1 through 256. (2) only applicable if the input clock jitter is in the input jitter tolerance specifications. (3) the smallest phase shift is determined by the vco period divided by eight. for degree increments, cyclone iv e devices can shift all output frequencies in increments of at least 45. smaller degree increments are possible depending on the frequency and divide parameters. chapter 5: clock networks and plls in cyclone iv devices 5?19 cyclone iv pll hardware overview ? december 2010 altera corporation cyclone iv device handbook, volume 1 cyclone iv pll hardware overview this section gives a hardware overview of the cyclone iv pll. figure 5?9 shows a simplified block diagram of the major components of the pll of cyclone iv gx devices. figure 5?9. cyclone iv gx pll block diagram (note 1) notes to figure 5?9 : (1) each clock source can come from any of the four clock pins located on the same side of the device as the pll. (2) there are additional 4 pairs of dedicated differential clock inputs in ep4cgx50, ep4cgx75, ep4cgx110, and ep4cgx150 devices that can only drive general purpose plls and multipurpose plls on the left side of the device. clk[19..16] can access pll_2 , pll_6 , pll_7 , and pll_8 while clk[23..20] can access pll_1 , pll_5 , pll_6 , and pll_7 . for the location of these clock input pins, refer to figure 5?3 on page 5?12 . (3) this is the vco post - scale counter k. (4) this input port is fed by a pin - driven dedicated gclk, or through a clock control block if the clock control block is fed by an output from another pll or a pin - driven dedicated gclk. an internally generated global signal cannot drive the pll. (5) for the general purpose pll and multipurpose pll counter outputs connectivity to the gclks, refer to table 5?1 on page 5?2 and table 5?2 on page 5?4 . (6) only the ci output counter can drive the tx serial clock. (7) only the c2 output counter can drive the tx load enable. (8) only the c3 output counter can drive the tx parallel clock. clock s w itcho v er block inclk0 inclk1 clock inp u ts from pins gclk pfdena clks w itch clk b ad0 clk b ad1 acti v eclock fref for ppm detect (mplls, gpll1, and gpll2 only) pfd lock circ u it lock to rx cdr clocks (mplls only) n cp lf vco 2 (3) c0 c1 c2 c3 c4 m pll o u tp u t m u x gclks (5) tx serial clock (mplls, gpll1, and gpll2 only) (6) tx load ena b le (mplls, gpll1, and gpll2 only) (7) tx parallel clock (mplls , gpll1, and gpll2only) ( 8 ) deterministic latency compensation (mplls, gpll1, and gpll2 only) external clock o u tp u t 8 8 8 2, 4 4 (2) gclk net w orks no compensation; zdb mode so u rce-synchrono u s; normal mode vco range detector vcoovrr vcou n dr (4) 5?20 chapter 5: clock networks and plls in cyclone iv devices cyclone iv pll hardware overview cyclone iv device handbook, volume 1 ? december 2010 altera corporation figure 5?10 shows a simplified block diagram of the major components of the pll of cyclone iv e devices. 1 the vco post-scale counter k is used to divide the supported vco range by two. the vco frequency reported by the quartus ii software in the pll summary section of the compilation report takes into consideration the vco post-scale counter value. therefore, if the vco post-scale counter has a value of 2, the frequency reported is lower than the f vco specification specified in the cyclone iv device datasheet chapter. figure 5?10. cyclone iv e pll block diagram (note 1) notes to figure 5?10 : (1) each clock source can come from any of the four clock pins located on the same side of the device as the pll. (2) this is the vco post-scale counter k. (3) this input port is fed by a pin-driven dedicated gclk, or through a clock control block if the clock control block is fed by an output from another pll or a pin-driven dedicated gclk. an internally generated global signal cannot drive the pll. clock s w itcho v er block inclk0 inclk1 clock inp u ts from pins gclk pfdena clks w itch clk b ad0 clk b ad1 acti v eclock pfd lock circ u it lock n cp lf vco 2 (2) c0 c1 c2 c3 c4 m pll o u tp u t m u x gclks external clock o u tp u t 8 8 4 gclk net w orks no compensation; zdb mode so u rce-synchrono u s; normal mode vco range detector vcoovrr vcou n dr (3) chapter 5: clock networks and plls in cyclone iv devices 5?21 cyclone iv pll hardware overview ? december 2010 altera corporation cyclone iv device handbook, volume 1 external clock outputs each pll of cyclone iv devices supports one single-ended clock output or one differential clock output. only the c0 output counter can feed the dedicated external clock outputs, as shown in figure 5?11 , without going through the gclk. other output counters can feed other i/o pins through the gclk. figure 5?11 shows the external clock outputs for plls. each pin of a differential output pair is 180 out of phase. the quartus ii software places the not gate in your design into the i/o element to implement 180 phase with respect to the other pin in the pair. the clock output pin pairs support the same i/o standards as standard output pins. f to determine which i/o standards are supported by the pll clock input and output pins, refer to the cyclone iv device i/o features chapter. cyclone iv plls can drive out to any regular i/o pin through the gclk. you can also use the external clock output pins as gpio pins if external pll clocking is not required. figure 5?11. external clock outputs for plls notes to figure 5?11 : (1) these external clock enable signals are available only when using the altclkctrl megafunction. (2) pll#_clkoutp and pll#_clkoutn pins are dual - purpose i/o pins that you can use as one single - ended clock output or one differential clock output. when using both pins as single - ended i/os, one of them can be the clock output while the other pin is configured as a regular user i/o. c0 c1 c2 c4 c3 pll# clkena 1 (1 ) clkena 0 (1) pll#_clkoutp (2) pll#_clkoutn (2) 5?22 chapter 5: clock networks and plls in cyclone iv devices clock feedback modes cyclone iv device handbook, volume 1 ? december 2010 altera corporation clock feedback modes cyclone iv plls support up to five different clock feedback modes. each mode allows clock multiplication and division, phase shifting, and programmable duty cycle. for the supported feedback modes, refer to table 5?5 on page 5?17 for cyclone iv gx plls and table 5?6 on page 5?18 for cyclone iv e plls. 1 input and output delays are fully compensated by the pll only if you are using the dedicated clock input pins associated with a given pll as the clock sources. when driving the pll using the gclk network, the input and output delays may not be fully compensated in the quartus ii software. source-synchronous mode if the data and clock arrive at the same time at the input pins, the phase relationship between the data and clock remains the same at the data and clock ports of any i/o element input register. figure 5?12 shows an example waveform of the data and clock in this mode. use this mode for source-synchronous data transfers. data and clock signals at the i/o element experience similar buffer delays as long as the same i/o standard is used. source-synchronous mode compensates for delay of the clock network used, including any difference in the delay between the following two paths: data pin to i/o element register input clock input pin to the pll phase frequency detector (pfd) input 1 set the input pin to the register delay chain in the i/o element to zero in the quartus ii software for all data pins clocked by a source-synchronous mode pll. also, all data pins must use the pll compensated logic option in the quartus ii software. figure 5?12. phase relationship between data and clock in source - synchronous mode data pin pll reference clock at inp u t pin data at register clock at register chapter 5: clock networks and plls in cyclone iv devices 5?23 clock feedback modes ? december 2010 altera corporation cyclone iv device handbook, volume 1 no compensation mode in no compensation mode, the pll does not compensate for any clock networks. this provides better jitter performance because clock feedback into the pfd does not pass through as much circuitry. both the pll internal and external clock outputs are phase shifted with respect to the pll clock input. figure 5?13 shows a waveform example of the phase relationship of the pll clock in this mode. figure 5?13. phase relationship between pll clocks in no compensation mode notes to figure 5?13 : (1) internal clocks fed by the pll are phase - aligned to each other. (2) the pll clock outputs can lead or lag the pll input clocks. pll reference clock at the inp u t pin pll clock at the register clock port (1), (2) external pll clock o u tp u ts (2) phase aligned 5?24 chapter 5: clock networks and plls in cyclone iv devices clock feedback modes cyclone iv device handbook, volume 1 ? december 2010 altera corporation normal mode an internal clock in normal mode is phase-aligned to the input clock pin. the external clock output pin has a phase delay relative to the clock input pin if connected in this mode. the quartus ii software timing analyzer reports any phase difference between the two. in normal mode, the pll fully compensates the delay introduced by the gclk network. figure 5?14 shows a waveform example of the phase relationship of the pll clocks in this mode. figure 5?14. phase relationship between pll clocks in normal mode note to figure 5?14 : (1) the external clock output can lead or lag the pll internal clock signals. pll reference clock at the inp u t pin pll clock at the register clock port external pll clock o u tp u ts (1) phase aligned chapter 5: clock networks and plls in cyclone iv devices 5?25 clock feedback modes ? december 2010 altera corporation cyclone iv device handbook, volume 1 zero delay buffer mode in zero delay buffer (zdb) mode, the external clock output pin is phase-aligned with the clock input pin for zero delay through the device. when using this mode, use the same i/o standard on the input clock and output clocks to guarantee clock alignment at the input and output pins. figure 5?15 shows an example waveform of the phase relationship of the pll clocks in zdb mode. deterministic latency compensation mode the deterministic latency mode compensates for the delay of the multipurpose plls through the clock network and serializer in common public radio interface (cpri) applications. in this mode, the pll pfd feedback path compensates the latency uncertainty in tx dataout and tx clkout paths relative to the reference clock. figure 5?15. phase relationship between pll clocks in zdb mode pll reference clock at the inp u t pin pll clock at the register clock port external pll clock o u tp u t at the o u tp u t pin phase aligned 5?26 chapter 5: clock networks and plls in cyclone iv devices hardware features cyclone iv device handbook, volume 1 ? december 2010 altera corporation hardware features cyclone iv plls support several features for general-purpose clock management. this section discusses clock multiplication and division implementation, phase shifting implementations, and programmable duty cycles. clock multiplication and division each cyclone iv pll provides clock synthesis for pll output ports using m/(n*post-scale counter) scaling factors. the input clock is divided by a pre-scale factor, n, and is then multiplied by the m feedback factor. the control loop drives the vco to match f in (m/n). each output port has a unique post-scale counter that divides down the high-frequency vco. for multiple pll outputs with different frequencies, the vco value is the least common multiple of the output frequencies that meets its frequency specifications. for example, if output frequencies required from one pll are 33 and 66 mhz, the quartus ii software sets the vco to 660 mhz (the least common multiple of 33 and 66 mhz in the vco range). then, the post-scale counters scale down the vco frequency for each output port. there is one pre-scale counter, n, and one multiply counter, m, per pll, with a range of 1 to 512 for both m and n. the n counter does not use duty cycle control because the purpose of this counter is only to calculate frequency division. there are five generic post-scale counters per pll that can feed gclks or external clock outputs. these post-scale counters range from 1 to 512 with a 50% duty cycle setting. the post-scale counters range from 1 to 256 with any non-50% duty cycle setting. the sum of the high/low count values chosen for a design selects the divide value for a given counter. the quartus ii software automatically chooses the appropriate scaling factors according to the input frequency, multiplication, and division values entered into the altpll megafunction. 1 phase alignment between output counters is determined using the t pll_pserr specification. chapter 5: clock networks and plls in cyclone iv devices 5?27 hardware features ? december 2010 altera corporation cyclone iv device handbook, volume 1 post-scale counter cascading plls of cyclone iv devices support post-scale counter cascading to create counters larger than 512. this is implemented by feeding the output of one c counter into the input of the next c counter, as shown in figure 5?16 . when cascading counters to implement a larger division of the high-frequency vco clock, the cascaded counters behave as one counter with the product of the individual counter settings. for example, if c0 = 4 and c1 = 2, the cascaded value is c0 c1 = 8. 1 post-scale counter cascading is automatically set by the quartus ii software in the configuration file. post-scale counter cascading cannot be performed using the pll reconfiguration. programmable duty cycle the programmable duty cycle allows plls to generate clock outputs with a variable duty cycle. this feature is supported on the pll post-scale counters. you can achieve the duty cycle setting by a low and high time count setting for the post-scale counters. the quartus ii software uses the frequency input and the required multiply or divide rate to determine the duty cycle choices. the post-scale counter value determines the precision of the duty cycle. the precision is defined by 50% divided by the post-scale counter value. for example, if the c0 counter is 10, steps of 5% are possible for duty cycle choices between 5 to 90%. combining the programmable duty cycle with programmable phase shift allows the generation of precise non-overlapping clocks. figure 5?16. counter cascading c0 c1 c2 c3 c4 vco o u tp u t vco o u tp u t vco o u tp u t vco o u tp u t vco o u tp u t vco o u tp u t 5?28 chapter 5: clock networks and plls in cyclone iv devices hardware features cyclone iv device handbook, volume 1 ? december 2010 altera corporation pll control signals you can use the pfdena , areset , and locked signals to observe and control the pll operation and resynchronization. f for more information about the pll control signals, refer to the altpll megafunction user guide . clock switchover the clock switchover feature allows the pll to switch between two reference input clocks. use this feature for clock redundancy or for a dual-clock domain application, such as a system that turns on the redundant clock if the previous clock stops running. your design can automatically perform clock switchover when the clock is no longer toggling, or based on the user control signal, clkswitch . automatic clock switchover plls of cyclone iv devices support a fully configurable clock switchover capability. when the current reference clock is not present, the clock-sense block automatically switches to the backup clock for pll reference. the clock switchover circuit also sends out three status signals? clkbad0 , clkbad1 , and activeclock ?from the pll to implement a custom switchover circuit. you can select a clock source at the backup clock by connecting it to the inclk1 port of the pll in your design. figure 5?17 shows the block diagram of the switchover circuit built into the pll. figure 5?17. automatic clock switchover circuit switchover state machine clock sense n counter pfd clkswitch (provides manual switchover support) activeclock clkbad1 clkbad0 muxout inclk0 inclk1 refclk fbclk clksw chapter 5: clock networks and plls in cyclone iv devices 5?29 hardware features ? december 2010 altera corporation cyclone iv device handbook, volume 1 there are two ways to use the clock switchover feature: use the switchover circuitry for switching from inclk0 to inclk1 running at the same frequency. for example, in applications that require a redundant clock with the same frequency as the reference clock, the switchover state machine generates a signal that controls the multiplexer select input shown in figure 5?17 . in this case, inclk1 becomes the reference clock for the pll. this automatic switchover can switch back and forth between the inclk0 and inclk1 clocks any number of times, when one of the two clocks fails and the other clock is available. use the clkswitch input for user- or system-controlled switch conditions. this is possible for same-frequency switchover or to switch between inputs of different frequencies. for example, if inclk0 is 66 mhz and inclk1 is 200 mhz, you must control the switchover because the automatic clock-sense circuitry cannot monitor primary and secondary clock frequencies with a frequency difference of more than 20%. this feature is useful when clock sources can originate from multiple cards on the backplane, requiring a system-controlled switchover between frequencies of operation. choose the secondary clock frequency so the vco operates in the recommended frequency range. also, set the m , n , and c counters accordingly to keep the vco operating frequency in the recommended range. figure 5?18 shows a waveform example of the switchover feature when using automatic loss of clock detection. here, the inclk0 signal remains low. after the inclk0 signal remains low for approximately two clock cycles, the clock-sense circuitry drives the clkbad0 signal high. also, because the reference clock signal is not toggling, the switchover state machine controls the multiplexer through the clksw signal to switch to inclk1 . figure 5?18. automatic switchover upon clock loss detection (note 1) note to figure 5?18 : (1) switchover is enabled on the falling edge of inclk0 or inclk1 , depending on which clock is available. in this figure, switchover is enabled on the falling edge of inclk1 . inclk0 inclk1 m u xo u t clk b ad0 clk b ad1 (1) acti v eclock 5?30 chapter 5: clock networks and plls in cyclone iv devices hardware features cyclone iv device handbook, volume 1 ? december 2010 altera corporation manual override if you are using the automatic switchover, you must switch input clocks with the manual override feature with the clkswitch input. figure 5?19 shows an example of a waveform illustrating the switchover feature when controlled by clkswitch . in this case, both clock sources are functional and inclk0 is selected as the reference clock. a low-to-high transition of the clkswitch signal starts the switchover sequence. the clkswitch signal must be high for at least three clock cycles (at least three of the longer clock period if inclk0 and inclk1 have different frequencies). on the falling edge of inclk0 , the reference clock of the counter, muxout , is gated off to prevent any clock glitching. on the falling edge of inclk1 , the reference clock multiplexer switches from inclk0 to inclk1 as the pll reference. on the falling edge of inclk1 , the reference clock multiplexer switches from inclk0 to inclk1 as the pll reference, and the activeclock signal changes to indicate which clock is currently feeding the pll. in this mode, the activeclock signal mirrors the clkswitch signal. as both blocks are still functional during the manual switch, neither clkbad signals go high. because the switchover circuit is positive edge-sensitive, the falling edge of the clkswitch signal does not cause the circuit to switch back from inclk1 to inclk0 . when the clkswitch signal goes high again, the process repeats. the clkswitch signal and the automatic switch only works depending on the availability of the clock that is switched to. if the clock is unavailable, the state machine waits until the clock is available. 1 when clkswitch = 1, it overrides the automatic switch-over function. as long as clkswitch signal is high, further switch-over action is blocked. figure 5?19. clock switchover using the clkswitch control (1) note to figure 5?19 : (1) both inclk0 and inclk1 must be running when the clkswitch signal goes high to start a manual clock switchover event. inclk0 inclk1 m u xo u t clks w itch acti v eclock clk b ad0 clk b ad1 chapter 5: clock networks and plls in cyclone iv devices 5?31 hardware features ? december 2010 altera corporation cyclone iv device handbook, volume 1 manual clock switchover plls of cyclone iv devices support manual switchover, in which the clkswitch signal controls whether inclk0 or inclk1 is the input clock to the pll. the characteristics of a manual switchover are similar to the manual override feature in an automatic clock switchover, in which the switchover circuit is edge-sensitive. when the clkswitch signal goes high, the switchover sequence starts. the falling edge of the clkswitch signal does not cause the circuit to switch back to the previous input clock. f for more information about pll software support in the quartus ii software, refer to the altpll megafunction user guide . guidelines use the following guidelines to design with clock switchover in plls: clock loss detection and automatic clock switchover require the inclk0 and inclk1 frequencies be within 20% of each other. failing to meet this requirement causes the clkbad0 and clkbad1 signals to function improperly. when using manual clock switchover, the difference between inclk0 and inclk1 can be more than 20%. however, differences between the two clock sources (frequency, phase, or both) can cause the pll to lose lock. resetting the pll ensures that the correct phase relationships are maintained between the input and output clocks. both inclk0 and inclk1 must be running when the clkswitch signal goes high to start the manual clock switchover event. failing to meet this requirement causes the clock switchover to malfunction. applications that require a clock switchover feature and a small frequency drift must use a low-bandwidth pll. when referencing input clock changes, the low-bandwidth pll reacts slower than a high-bandwidth pll. when the switchover happens, the low-bandwidth pll propagates the stopping of the clock to the output slower than the high-bandwidth pll. the low-bandwidth pll filters out jitter on the reference clock. however, the low-bandwidth pll also increases lock time. after a switchover occurs, there may be a finite resynchronization period for the pll to lock onto a new clock. the exact amount of time it takes for the pll to re-lock is dependent on the pll configuration. if the phase relationship between the input clock to the pll and output clock from the pll is important in your design, assert areset for 10 ns after performing a clock switchover. wait for the locked signal (or gated lock) to go high before re-enabling the output clocks from the pll. figure 5?20 shows how the vco frequency gradually decreases when the primary clock is lost and then increases as the vco locks on to the secondary clock. after the vco locks on to the secondary clock, some overshoot can occur (an over-frequency condition) in the vco frequency. 5?32 chapter 5: clock networks and plls in cyclone iv devices programmable bandwidth cyclone iv device handbook, volume 1 ? december 2010 altera corporation disable the system during switchover if the system is not tolerant to frequency variations during the pll resynchronization period. you can use the clkbad0 and clkbad1 status signals to turn off the pfd ( pfdena = 0 ) so the vco maintains its last frequency. you can also use the switchover state machine to switch over to the secondary clock. upon enabling the pfd, output clock enable signals ( clkena ) can disable clock outputs during the switchover and resynchronization period. after the lock indication is stable, the system can re-enable the output clock or clocks. programmable bandwidth the pll bandwidth is the measure of the pll?s ability to track the input clock and its associated jitter. plls of cyclone iv devices provide advanced control of the pll bandwidth using the programmable characteristics of the pll loop, including loop filter and charge pump. the closed-loop gain 3-db frequency in the pll determines the pll bandwidth. the bandwidth is approximately the unity gain point for open loop pll response. phase shift implementation phase shift is used to implement a robust solution for clock delays in cyclone iv devices. phase shift is implemented with a combination of the vco phase output and the counter starting time. the vco phase output and counter starting time are the most accurate methods of inserting delays, because they are based only on counter settings that are independent of process, voltage, and temperature. you can phase shift the output clocks from the plls of cyclone iv devices in one of two ways: fine resolution using vco phase taps coarse resolution using counter starting time fine resolution phase shifts are implemented by allowing any of the output counters ( c[4..0] ) or the m counter to use any of the eight phases of the vco as the reference clock. this allows you to adjust the delay time with a fine resolution. figure 5?20. vco switchover operating frequency f v co primary clock stops r u nning s w itcho v er occ u rs vco tracks secondary cloc k fre qu ency o v ershoot chapter 5: clock networks and plls in cyclone iv devices 5?33 phase shift implementation ? december 2010 altera corporation cyclone iv device handbook, volume 1 equation 5?1 shows the minimum delay time that you can insert using this method. in which f ref is the input reference clock frequency. for example, if f ref is 100 mhz, n = 1, and m = 8, then f vco = 800 mhz, and ? fine = 156.25 ps. the pll operating frequency defines this phase shift, a value that depends on reference clock frequency and counter settings. coarse resolution phase shifts are implemented by delaying the start of the counters for a predetermined number of counter clocks. equation 5?2 shows the coarse phase shift. c is the count value set for the counter delay time (this is the initial setting in the pll usage section of the compilation report in the quartus ii software). if the initial value is 1, c ? 1 = 0 phase shift. figure 5?21 shows an example of phase shift insertion using fine resolution through vco phase taps method. the eight phases from the vco are shown and labeled for reference. in this example, clk0 is based on 0 phase from the vco and has the c value for the counter set to one. the clk1 signal is divided by four, two vco clocks for high time and two vco clocks for low time. clk1 is based on the 135 phase tap from the vco and has the c value for the counter set to one. the clk1 signal is also divided by four. in this case, the two clocks are offset by 3 ? fine . clk2 is based on the 0 phase from the vco but has the c value for the counter set to three. this creates a delay of two ? coarse (two complete vco periods). equation 5?1. fine resolution phase shift equation 5?2. coarse resolution phase shift ? fine t vco 8 ----------- 1 8 f vco ------------- - n 8 mf ref ----------------- - == = ? coarse c 1 ? f vco ----------- - c 1 ? ?? n mf ref -------------------- - == 5?34 chapter 5: clock networks and plls in cyclone iv devices pll cascading cyclone iv device handbook, volume 1 ? december 2010 altera corporation you can use the coarse and fine phase shifts to implement clock delays in cyclone iv devices. cyclone iv devices support dynamic phase shifting of vco phase taps only. the phase shift is configurable for any number of times. each phase shift takes about one scanclk cycle, allowing you to implement large phase shifts quickly. pll cascading cyclone iv devices allow cascading between general purpose plls and multipurpose plls in normal or direct mode through the gclk network. if your design cascades plls, the source (upstream) pll must have a low-bandwidth setting, while the destination (downstream) pll must have a high-bandwidth setting. 1 pll_6 and pll7 have upstream cascading capability only. figure 5?21. delay insertion using vco phase output and counter delay time t d0-1 t d0-2 1/8 t vco t vco 0 90 135 1 8 0 225 270 315 clk0 clk1 clk2 45 chapter 5: clock networks and plls in cyclone iv devices 5?35 pll reconfiguration ? december 2010 altera corporation cyclone iv device handbook, volume 1 pll reconfiguration plls use several divide counters and different vco phase taps to perform frequency synthesis and phase shifts. in plls of cyclone iv devices, you can reconfigure both counter settings and phase shift the pll output clock in real time. you can also change the charge pump and loop filter components, which dynamically affects pll bandwidth. you can use these pll components to update the output clock frequency, pll bandwidth, and phase shift in real time, without reconfiguring the entire fpga. the ability to reconfigure the pll in real time is useful in applications that might operate at multiple frequencies. it is also useful in prototyping environments, allowing you to sweep pll output frequencies and adjust the output clock phase dynamically. for instance, a system generating test patterns is required to generate and send patterns at 75 or 150 mhz, depending on the requirements of the device under test. reconfiguring pll components in real time allows you to switch between two such output frequencies in a few microseconds. you can also use this feature to adjust clock-to-out (t co ) delays in real time by changing the pll output clock phase shift. this approach eliminates the need to regenerate a configuration file with the new pll settings. pll reconfiguration hardware implementation the following pll components are configurable in real time: pre-scale counter (n) feedback counter (m) post-scale output counters ( c0?c4 ) dynamically adjust the charge pump current (i cp ) and loop filter components (r, c) to facilitate on-the-fly reconfiguration of the pll bandwidth figure 5?22 shows how to adjust pll counter settings dynamically by shifting their new settings into a serial shift register chain or scan chain. serial data shifts to the scan chain via the scandataport , and shift registers are clocked by scanclk . the maximum scanclk frequency is 100 mhz. after shifting the last bit of data, asserting the configupdate signal for at least one scanclk clock cycle synchronously updates the pll configuration bits with the data in the scan registers. 5?36 chapter 5: clock networks and plls in cyclone iv devices pll reconfiguration cyclone iv device handbook, volume 1 ? december 2010 altera corporation 1 the counter settings are updated synchronously to the clock frequency of the individual counters. therefore, not all counters update simultaneously. to reconfigure the pll counters, perform the following steps: 1. the scanclkena signal is asserted at least one scanclk cycle prior to shifting in the first bit of scandata ( d0 ). 2. serial data ( scandata ) is shifted into the scan chain on the second rising edge of scanclk . 3. after all 144 bits have been scanned into the scan chain, the scanclkena signal is de-asserted to prevent inadvertent shifting of bits in the scan chain. 4. the configupdate signal is asserted for one scanclk cycle to update the pll counters with the contents of the scan chain. 5. the scandone signal goes high indicating that the pll is being reconfigured. a falling edge indicates that the pll counters have been updated with new settings. 6. reset the pll using the areset signal if you make any changes to the m, n, post-scale output c counters, or the i cp , r, c settings. 7. you can repeat steps 1 through 5 to reconfigure the pll any number of times. figure 5?22. pll reconfiguration scan chain /c4 /c3 /c2 /c1 /c0 /m / n scanclk scandone scandata lf/k/cp config u pdate inclk pfd vco f vco scanclkena scandatao u t from m co u nter from n co u nter chapter 5: clock networks and plls in cyclone iv devices 5?37 pll reconfiguration ? december 2010 altera corporation cyclone iv device handbook, volume 1 figure 5?23 shows a functional simulation of the pll reconfiguration feature. 1 when reconfiguring the counter clock frequency, the corresponding counter phase shift settings cannot be reconfigured using the same interface. you can reconfigure phase shifts in real time using the dynamic phase shift reconfiguration interface. if you reconfigure the counter frequency, but wish to keep the same non-zero phase shift setting (for example, 90) on the clock output, you must reconfigure the phase shift after reconfiguring the counter clock frequency. post-scale counters (c0 to c4) you can configure multiply or divide values and duty cycle of post-scale counters in real time. each counter has an 8-bit high time setting and an 8-bit low time setting. the duty cycle is the ratio of output high or low time to the total cycle time, that is the sum of the two. additionally, these counters have two control bits, rbypass , for bypassing the counter, and rselodd , to select the output clock duty cycle. when the rbypass bit is set to 1, it bypasses the counter, resulting in a divide by one. when this bit is set to 0, the pll computes the effective division of the vco output frequency based on the high and low time counters. for example, if the post-scale divide factor is 10, the high and low count values are set to 5 and 5, to achieve a 50?50% duty cycle. the pll implements this duty cycle by transitioning the output clock from high-to-low on the rising edge of the vco output clock. however, a 4 and 6 setting for the high and low count values, respectively, would produce an output clock with a 40?60% duty cycle. figure 5?23. pll reconfiguration scan chain scandata scanclk scanclkena scandataout configupdate scandone areset d0_old dn_old dn dn (msb) d0 (lsb) 5?38 chapter 5: clock networks and plls in cyclone iv devices pll reconfiguration cyclone iv device handbook, volume 1 ? december 2010 altera corporation the rselodd bit indicates an odd divide factor for the vco output frequency with a 50% duty cycle. for example, if the post-scale divide factor is three, the high and low time count values are 2 and 1, respectively, to achieve this division. this implies a 67%?33% duty cycle. if you need a 50%?50% duty cycle, you must set the rselodd control bit to 1 to achieve this duty cycle despite an odd division factor. the pll implements this duty cycle by transitioning the output clock from high-to-low on a falling edge of the vco output clock. when you set rselodd = 1, subtract 0.5 cycles from the high time and add 0.5 cycles to the low time. for example: high time count = 2 cycles low time count = 1 cycle rselodd = 1 effectively equals: high time count = 1.5 cycles low time count = 1.5 cycles duty cycle = (1.5/3)% high time count and (1.5/3)% low time count scan chain description cyclone iv plls have a 144-bit scan chain. ta b l e 5 ?7 lists the number of bits for each component of the pll. table 5?7. cyclone iv pll reprogramming bits block name number of bits counter other total c4 (1) 16 2 (2) 18 c3 16 2 (2) 18 c2 16 2 (2) 18 c1 16 2 (2) 18 c0 16 2 (2) 18 m162 (2) 18 n162 (2) 18 charge pump 9 0 9 loop filter (3) 909 total number of bits: 144 notes to table 5?7 : (1) lsb bit for c4 low - count value is the first bit shifted into the scan chain. (2) these two control bits include rbypass , for bypassing the counter, and rselodd , to select the output clock duty cycle. (3) msb bit for loop filter is the last bit shifted into the scan chain. chapter 5: clock networks and plls in cyclone iv devices 5?39 pll reconfiguration ? december 2010 altera corporation cyclone iv device handbook, volume 1 figure 5?24 shows the scan chain order of the pll components. figure 5?25 shows the scan chain bit order sequence for one pll post-scale counter in plls of cyclone iv devices. charge pump and loop filter you can reconfigure the charge pump and loop filter settings to update the pll bandwidth in real time. table 5?8 through table 5?10 list the possible settings for charge pump current (i cp ), loop filter resistor (r) , and capacitor (c) values for plls of cyclone iv devices. figure 5?24. pll component scan chain order data i n c1 c2 c3 c4 datao u t msb lf cp lsb n mc0 figure 5?25. scan chain bit order datai n r b ypass hb 7 hb 6 hb 5 hb 4 hb 3 hb 2 hb 1 hb 0 rselodd lb 7 lb 6 lb 5 lb 4 lb 3 lb 2 lb 1 lb 0 dataout hb 9 hb 8 lb 9 lb 8 table 5?8. charge pump bit control cp[2] cp[1] cp[0] setting (decimal) 0000 1001 1103 1117 table 5?9. loop filter resistor value control (part 1 of 2) lfr[4] lfr[3] lfr[ 2] lfr[1] lfr[0] setting (decimal) 000000 000113 001004 010008 1000016 1001119 1010020 5?40 chapter 5: clock networks and plls in cyclone iv devices pll reconfiguration cyclone iv device handbook, volume 1 ? december 2010 altera corporation bypassing a pll counter bypassing a pll counter results in a divide (n, c0 to c4 counters) factor of one. ta b l e 5 ?11 lists the settings for bypassing the counters in plls of cyclone iv devices. to bypass any of the pll counters, set the bypass bit to 1. the values on the other bits are then ignored. 1100024 1101127 1110028 1111030 table 5?10. loop filter control of high frequency capacitor lfc[1] lfc[0] setting (decimal) 000 011 113 table 5?11. pll counter settings pll scan chain bits [0..8] settings description lsb msb x x x x x x x x 1 (1) pll counter bypassed x x x x x x x x 0 (1) pll counter not bypassed note to table 5?11 : (1) bypass bit. table 5?9. loop filter resistor value control (part 2 of 2) lfr[4] lfr[3] lfr[ 2] lfr[1] lfr[0] setting (decimal) chapter 5: clock networks and plls in cyclone iv devices 5?41 pll reconfiguration ? december 2010 altera corporation cyclone iv device handbook, volume 1 dynamic phase shifting the dynamic phase shifting feature allows the output phase of individual pll outputs to be dynamically adjusted relative to each other and the reference clock without sending serial data through the scan chain of the corresponding pll. this feature simplifies the interface and allows you to quickly adjust t co delays by changing output clock phase shift in real time. this is achieved by incrementing or decrementing the vco phase-tap selection to a given c counter or to the m counter. the phase is shifted by 1/8 the vco frequency at a time. the output clocks are active during this phase reconfiguration process. ta b l e 5 ?1 2 lists the control signals that are used for dynamic phase shifting. ta b l e 5 ?1 3 lists the pll counter selection based on the corresponding phasecounterselect setting. table 5?12. dynamic phase shifting control signals signal name description source destination phasecounterselect[2..0] counter select. three bits decoded to select either the m or one of the c counters for phase adjustment. one address map to select all c counters. this signal is registered in the pll on the rising edge of scanclk . logic array or i/o pins pll reconfiguration circuit phaseupdown selects dynamic phase shift direction; 1= up, 0 = down. signal is registered in the pll on the rising edge of scanclk . logic array or i/o pins pll reconfiguration circuit phasestep logic high enables dynamic phase shifting. logic array or i/o pins pll reconfiguration circuit scanclk free running clock from core used in combination with phasestep to enable or disable dynamic phase shifting. shared with scanclk for dynamic reconfiguration. gclk or i/o pins pll reconfiguration circuit phasedone when asserted, it indicates to core logic that the phase adjustment is complete and pll is ready to act on a possible second adjustment pulse. asserts based on internal pll timing. de - asserts on the rising edge of scanclk . pll reconfiguration circuit logic array or i/o pins table 5?13. phase counter select mapping phasecounterselect selects [2] [1] [0] 000 all output counters 001 m counter 010 c0 counter 011 c1 counter 100 c2 counter 101 c3 counter 110 c4 counter 5?42 chapter 5: clock networks and plls in cyclone iv devices pll reconfiguration cyclone iv device handbook, volume 1 ? december 2010 altera corporation to perform one dynamic phase shift step, follow these steps: 1. set phaseupdown and phasecounterselect as required. 2. assert phasestep for at least two scanclk cycles. each phasestep pulse enables one phase shift. 3. de-assert phasestep . 4. wait for phasedone to go high. 5. you can repeat steps 1 through 4 as many times as required to get multiple phase shifts. all signals are synchronous to scanclk , so they are latched on the scanclk edges and must meet t su or t h requirements (with respect to the scanclk edges). dynamic phase shifting can be repeated indefinitely. all signals are synchronous to scanclk , so they must meet t su or t h requirements (with respect to scanclk edges). the phasestep signal is latched on the negative edge of scanclk . in figure 5?26 , this is shown by the second scanclk falling edge. phasestep must stay high for at least two scanclk cycles. on the second scanclk rising edge after phasestep is latched (indicated by the fourth rising edge), the values of phaseupdown and phasecounterselect are latched and the pll starts dynamic phase shifting for the specified counter or counters and in the indicated direction. on the fourth scanclk rising edge, phasedone goes high to low and remains low until the pll finishes dynamic phase shifting. you can perform another dynamic phase shift after the phasedone signal goes from low to high. depending on the vco and scanclk frequencies, the phasedone low time may be greater than or less than one scanclk cycle. after phasedone goes from low to high, you can perform another dynamic phase shift. phasestep pulses must be at least one scanclk cycle apart. f for information about the altpll_reconfig megawizard ? plug-in manager , refer to the altpll_reconfig megafunction user guide . figure 5?26. pll dynamic phase shift phaseupdown phasecounterselect scanclk phasestep phasedone chapter 5: clock networks and plls in cyclone iv devices 5?43 spread-spectrum clocking ? december 2010 altera corporation cyclone iv device handbook, volume 1 spread-spectrum clocking cyclone iv devices can accept a spread-spectrum input with typical modulation frequencies. however, the device cannot automatically detect that the input is a spread-spectrum signal. instead, the input signal looks like deterministic jitter at the input of the pll. plls of cyclone iv devices can track a spread-spectrum input clock as long as it is in the input jitter tolerance specifications and the modulation frequency of the input clock is below the pll bandwidth, that is specified in the fitter report. cyclone iv devices cannot generate spread-spectrum signals internally. pll specifications f for information about pll specifications, refer to the cyclone iv device datasheet chapter. document revision history ta b l e 5 ?1 4 lists the revision history for this chapter. table 5?14. document revision history date version changes made december 2010 2.2 updated for the quartus ii software version 10.1 release. updated figure 5?3 and figure 5?10 . updated ?gclk network clock source generation? , ?plls in cyclone iv devices? , and ?manual override? sections. minor text edits. july 2010 2.1 updated figure 5?2, figure 5?3, figure 5?4, and figure 5?10. updated table 5?1, table 5?2, and table 5?5. updated ?clock feedback modes? section. february 2010 2.0 added cyclone iv e devices information for the quartus ii software version 9.1 sp1 release. updated ?clock networks? section. updated table 5?1 and table 5?2. added table 5?3. updated figure 5?2, figure 5?3, and figure 5?9. added figure 5?4 and figure 5?10. november 2009 1.0 initial release. 5?44 chapter 5: clock networks and plls in cyclone iv devices document revision history cyclone iv device handbook, volume 1 ? december 2010 altera corporation ? december 2010 altera corporation cyclone iv device handbook, volume 1 section ii. i/o interfaces this section provides information about cyclone ? iv device family i/o features and high-speed differential and external memory interfaces. this section includes the following chapters: chapter 6, i/o features in cyclone iv devices chapter 7, external memory interfaces in cyclone iv devices revision history refer to each chapter for its own specific revision history. for information about when each chapter was updated, refer to the chapter revision dates section, which appears in the complete handbook. ? december 2010 altera corporation cyclone iv device handbook, volume 1 6. i/o features in cyclone iv devices this chapter describes the i/o and high speed i/o capabilities and features offered in cyclone ? iv devices. the i/o capabilities of cyclone iv devices are driven by the diversification of i/o standards in many low-cost applications, and the significant increase in required i/o performance. altera?s objective is to create a device that accommodates your key board design needs with ease and flexibility. the i/o flexibility of cyclone iv devices is increased from the previous generation low-cost fpgas by allowing all i/o standards to be selected on all i/o banks. improvements to on-chip termination (oct) support and the addition of true differential buffers have eliminated the need for external resistors in many applications, such as display system interfaces. high-speed differential i/o standards have become popular in high-speed interfaces because of their significant advantages over single-ended i/o standards. the cyclone iv devices support lvds, blvds, rsds, mini-lvds, and ppds. the transceiver reference clocks and the existing general-purpose i/o (gpio) clock input features also support the lvds i/o standards. the quartus ? ii software completes the solution with powerful pin planning features that allow you to plan and optimize i/o system designs even before the design files are available. this chapter includes the following sections: ?cyclone iv i/o elements? on page 6?2 ?i/o element features? on page 6?3 ?oct support? on page 6?7 ?i/o standards? on page 6?12 ?termination scheme for i/o standards? on page 6?13 ?i/o banks? on page 6?16 ?pad placement and dc guidelines? on page 6?22 ?clock pins functionality? on page 6?23 ?high-speed i/o interface? on page 6?23 ?high-speed i/o standards support? on page 6?27 ?true output buffer feature? on page 6?35 ?high-speed i/o timing? on page 6?36 ?design guidelines? on page 6?38 ?software overview? on page 6?39 cyiv-51006-2.2 6?2 chapter 6: i/o features in cyclone iv devices cyclone iv i/o elements cyclone iv device handbook, volume 1 ? december 2010 altera corporation cyclone iv i/o elements cyclone iv i/o elements (ioes) contain a bidirectional i/o buffer and five registers for registering input, output, output-enable signals, and complete embedded bidirectional single-data rate transfer. i/o pins support various single-ended and differential i/o standards. the ioe contains one input register, two output registers, and two output-enable (oe) registers. the two output registers and two oe registers are used for ddr applications. you can use input registers for fast setup times and output registers for fast clock-to-output times. additionally, you can use oe registers for fast clock-to-output enable timing. you can use ioes for input, output, or bidirectional data paths. figure 6?1 shows the cyclone iv devices ioe structure for single data rate (sdr) operation. figure 6?1. cyclone iv ioes in a bidirectio nal i/o configuration for sdr mode d q e n a d q e n a v ccio v ccio optional pci clamp programma b l e p u ll-up resistor bus hold inp u t pin to inp u t register delay or inp u t pin to logic array delay o u tp u t pin delay clkin oe_in data_in0 data_in1 sclr/ preset chip- w ide reset aclr/prn oe_o u t clko u t oe oe register c u rrent strength control open-drain o u t col u mn or ro w interconnect io_clk[5..0] sle w rate control aclr /pr n aclr /pr n o u tp u t register d q e n a aclr /pr n inp u t register chapter 6: i/o features in cyclone iv devices 6?3 i/o element features ? december 2010 altera corporation cyclone iv device handbook, volume 1 i/o element features the cyclone iv ioe offers a range of programmable features for an i/o pin. these features increase the flexibility of i/o utilization and provide a way to reduce the usage of external discrete components, such as pull-up resistors and diodes. programmable current strength the output buffer for each cyclone iv i/o pin has a programmable current strength control for certain i/o standards. the lvttl, lvcmos, sstl-2 class i and ii, sstl-18 class i and ii, hstl-18 class i and ii, hstl-15 class i and ii, and hstl-12 class i and ii i/o standards have several levels of current strength that you can control. table 6?2 on page 6?7 shows the possible settings for i/o standards with current strength control. these programmable current strength settings are a valuable tool in helping decrease the effects of simultaneously switching outputs (sso) in conjunction with reducing system noise. the supported settings ensure that the device driver meets the specifications for ioh and iol of the corresponding i/o standard. 1 when you use programmable current strength, on-chip series termination (r s oct) is not available. slew rate control the output buffer for each cyclone iv i/o pin provides optional programmable output slew-rate control. table 6?2 on page 6?7 shows the possible slew rate option and the quartus ii default slew rate setting. however, these fast transitions may introduce noise transients in the system. a slower slew rate reduces system noise, but adds a nominal delay to rising and falling edges. because each i/o pin has an individual slew-rate control, you can specify the slew rate on a pin-by-pin basis. the slew-rate control affects both the rising and falling edges. slew rate control is available for single-ended i/o standards with current strength of 8 ma or higher. 1 you cannot use the programmable slew rate feature when using oct with calibration. 1 you cannot use the programmable slew rate feature when using the 3.0-v pci, 3.0-v pci-x, 3.3-v lvttl, or 3.3-v lvcmos i/o standards. only the fast slew rate (default) setting is available. open-drain output cyclone iv devices provide an optional open-drain (equivalent to an open-collector) output for each i/o pin. this open-drain output enables the device to provide system-level control signals (for example, interrupt and write enable signals) that are asserted by multiple devices in your system. 6?4 chapter 6: i/o features in cyclone iv devices i/o element features cyclone iv device handbook, volume 1 ? december 2010 altera corporation bus hold each cyclone iv device user i/o pin provides an optional bus-hold feature. the bus-hold circuitry holds the signal on an i/o pin at its last-driven state. because the bus-hold feature holds the last-driven state of the pin until the next input signal is present, an external pull-up or pull-down resistor is not necessary to hold a signal level when the bus is tri-stated. the bus-hold circuitry also pulls undriven pins away from the input threshold voltage in which noise can cause unintended high-frequency switching. you can select this feature individually for each i/o pin. the bus-hold output drives no higher than v ccio to prevent overdriving signals. 1 if you enable the bus-hold feature, the device cannot use the programmable pull-up option. disable the bus-hold feature when the i/o pin is configured for differential signals. bus-hold circuitry is not available on dedicated clock pins. bus-hold circuitry is only active after configuration. when going into user mode, the bus-hold circuit captures the value on the pin present at the end of configuration. f for the specific sustaining current for each v ccio voltage level driven through the resistor and for the overdrive current used to identify the next driven input level, refer to the cyclone iv device datasheet chapter. programmable pull-up resistor each cyclone iv device i/o pin provides an optional programmable pull-up resistor while in user mode. if you enable this feature for an i/o pin, the pull-up resistor holds the output to the v ccio level of the output pin?s bank. 1 if you enable the programmable pull-up resistor, the device cannot use the bus-hold feature. programmable pull-up resistors are not supported on the dedicated configuration, jtag, and dedicated clock pins. 1 when the optional dev_oe signal drives low, all i/o pins remains tri-stated even with the programmable pull-up option enabled. programmable delay the cyclone iv ioe includes programmable delays to ensure zero hold times, minimize setup times, increase clock-to-output times, and delay the clock input signal. a path in which a pin directly drives a register may require a programmable delay to ensure zero hold time, whereas a path in which a pin drives a register through combinational logic may not require the delay. programmable delays minimize setup time. the quartus ii compiler can program these delays to automatically minimize setup time while providing a zero hold time. programmable delays can increase the register-to-pin delays for output registers. each dual-purpose clock input pin provides a programmable delay to the global clock networks. chapter 6: i/o features in cyclone iv devices 6?5 i/o element features ? december 2010 altera corporation cyclone iv device handbook, volume 1 ta b l e 6 ?1 shows the programmable delays for cyclone iv devices. there are two paths in the ioe for an input to reach the logic array. each of the two paths can have a different delay. this allows you to adjust delays from the pin to the internal logic element (le) registers that reside in two different areas of the device. you must set the two combinational input delays with the input delay from pin to internal cells logic option in the quartus ii software for each path. if the pin uses the input register, one of the delays is disregarded and the delay is set with the input delay from pin to input register logic option in the quartus ii software. the ioe registers in each i/o block share the same source for the preset or clear features. you can program preset or clear for each individual ioe, but you cannot use both features simultaneously. you can also program the registers to power-up high or low after configuration is complete. if programmed to power-up low, an asynchronous clear can control the registers. if programmed to power-up high, an asynchronous preset can control the registers. this feature prevents the inadvertent activation of the active-low input of another device upon power-up. if one register in an ioe uses a preset or clear signal, all registers in the ioe must use that same signal if they require preset or clear. additionally, a synchronous reset signal is available for the ioe registers. f for more information about the input and output pin delay settings, refer to the area and timing optimization chapter in volume 2 of the quartus ii handbook . table 6?1. cyclone iv devices programmable delay chain programmable delay quartus ii logic option input pin-to-logic array delay input delay from pin to internal cells input pin-to-input register delay input delay from pin to input register output pin delay (1) delay from output register to output pin dual-purpose clock input pin delay input delay from dual-purpose clock pin to fan-out destinations note to table 6?1 : (1) cyclone iv e devices do not support delay from output register to output pin. 6?6 chapter 6: i/o features in cyclone iv devices i/o element features cyclone iv device handbook, volume 1 ? december 2010 altera corporation pci-clamp diode cyclone iv devices provide an optional pci-clamp diode enabled input and output for each i/o pin. dual-purpose configuration pins support the diode in user mode if the specific pins are not used as configuration pins for the selected configuration scheme. for example, if you are using the active serial (as) configuration scheme, you cannot use the clamp diode on the asdo and ncso pins in user mode. dedicated configuration pins do not support the on-chip diode. the pci-clamp diode is available for the following i/o standards: 3.3-v lvttl 3.3-v lvcmos 3.0-v lvttl 3.0-v lvcmos 2.5-v lvttl/lvcmos pci pci-x if the input i/o standard is one of the listed standards, the pci-clamp diode is enabled by default in the quartus ii software. chapter 6: i/o features in cyclone iv devices 6?7 oct support ? december 2010 altera corporation cyclone iv device handbook, volume 1 oct support cyclone iv devices feature oct to provide i/o impedance matching and termination capabilities. oct helps prevent reflections and maintain signal integrity while minimizing the need for external resistors in high pin-count ball grid array (bga) packages. cyclone iv devices provide i/o driver on-chip impedance matching and r s oct for single-ended outputs and bidirectional pins. 1 when using r s oct, programmable current strength is not available. there are two ways to implement oct in cyclone iv devices: oct with calibration oct without calibration ta b l e 6 ?2 lists the i/o standards that support impedance matching and series termination. table 6?2. cyclone iv device i/o features support (part 1 of 2) i/o standard ioh/iol current strength setting (ma) (1) r s oct with calibration setting, ohm ( ? ) r s oct without calibration setting, ohm ( ? ) cyclone iv e i/o banks support cyclone iv gx i/o banks support slew rate option (6) pci- clamp diode support column i/o row i/o column i/o row i/o (8) column i/o row i/o (8) 3.3-v lvttl 4,8 4,8 ? ? ? ? 1,2,3,4, 5,6,7,8 3,4,5,6, 7,8,9 ? v 3.3-v lvcmos 2 2 ? ? ? ? ? v 3.0-v lvttl 4,8,12,16 4,8,12,16 50,25 50,25 50,25 50,25 0,1, 2 v 3.0-v lvcmos 4,8,12,16 4,8,12,16 50,25 50,25 50,25 50,25 v 3.0-v pci/pci-x ? ? ? ? ? ? ? v 2.5-v lvttl/lvcmos 4,8,12,16 4,8,12,16 50,25 50,25 50,25 50,25 0,1, 2 v 1.8-v lvttl/lvcmos 2,4,6,8,10,12,16 2,4,6,8,10,12,16 50,25 50,25 50,25 50,25 ? 1.5-v lvcmos 2,4,6,8,10,12,16 2,4,6,8,10,12,16 50,25 50,25 50,25 50,25 ? 1.2-v lvcmos 2,4,6,8,10,12 2,4,6,8,10 50,25 50 50,25 50 4,5,6,7,8 ? sstl-2 class i 8,12 8,12 50 50 50 50 3,4,5,6, 7,8,9 ? sstl-2 class ii 16 16 25 25 25 25 ? sstl-18 class i 8,10,12 8,10,12 50 50 50 50 ? sstl-18 class ii 12,16 12,16 25 25 25 25 ? hstl-18 class i 8,10,12 8,10,12 50 50 50 50 ? hstl-18 class ii 16 16 25 25 25 25 ? hstl-15 class i 8,10,12 8,10,12 50 50 50 50 ? hstl-15 class ii 16 16 25 25 25 25 ? hstl-12 class i 8,10,12 8,10 50 50 50 50 4,5,6,7,8 ? hstl-12 class ii 14 ? 25 ? 25 ? 3,4,7,8 4,7,8 ? 6?8 chapter 6: i/o features in cyclone iv devices oct support cyclone iv device handbook, volume 1 ? december 2010 altera corporation 1 for more details about the differential i/o standards supported in cyclone iv i/o banks, refer to ?high-speed i/o interface? on page 6?23 . differential sstl-2 class i (2) , (7) 8,12 8,12 50 50 50 50 1,2,3,4, 5,6,7,8 3,4,5,6, 7,8 0,1, 2 ? differential sstl-2 class ii (2) , (7) 16 16 25 25 25 25 ? differential sstl-18 (2) , (7) 8,10,12 ? 50 ? 50 ? ? differential hstl-18 (2) , (7) 8,10,12 ? 50 ? 50 ? ? differential hstl-15 (2) , (7) 8,10,12 ? 50 ? 50 ? ? differential hstl-12 (2) , (7) 8,10,12 ? 50 ? 50 ? 3,4,7,8 4,7,8 ? blvds 8,12,16 8,12,16 ? ? ? ? 1,2,3,4, 5,6,7,8 3,4,5,6, 7,8 0,1, 2 ? lvds (3) ? ? ???? 5,6 ?? ppds (3) , (4) ? ? ???? ?? rsds and mini-lvds (3) , (4) ? ? ???? ?? differential lvpecl (5) ? ? ???? 3,4,5,6, 7,8 ?? notes to table 6?2 : (1) the default current strength setting in the quartus ii software is 50- ? oct without calibration for all non-voltage reference and hstl/sstl class i i/o standards. the default setting is 25- ? oct without calibration for hstl/sstl class ii i/o standards. (2) the differential sstl-18 and sstl-2, differential hstl-18, hstl-15, and hstl-12 i/o standards are supported only on clock in put pins and pll output clock pins. (3) true differential (ppds, lvds, mini-lvds, and rsds i/o standards) outputs are supported in row i/o banks 1, 2, 5, and 6 only for cyclone iv e devices and right i/o banks 5 and 6 only for cyclone iv gx devices. differential outputs in column i/o banks require an external resistor net work. (4) this i/o standard is supported for outputs only. (5) this i/o standard is supported for clock inputs only (6) the default quartus ii slew rate setting is in bold; 2 for all i/o standards that supports slew rate option. (7) differential sstl-18, differential hstl-18, hstl-15, and hstl-12 i/o standards do not support class ii output. (8) cyclone iv gx devices only support right i/o pins. table 6?2. cyclone iv device i/o features support (part 2 of 2) i/o standard ioh/iol current strength setting (ma) (1) r s oct with calibration setting, ohm ( ? ) r s oct without calibration setting, ohm ( ? ) cyclone iv e i/o banks support cyclone iv gx i/o banks support slew rate option (6) pci- clamp diode support column i/o row i/o column i/o row i/o (8) column i/o row i/o (8) chapter 6: i/o features in cyclone iv devices 6?9 oct support ? december 2010 altera corporation cyclone iv device handbook, volume 1 on-chip series termination with calibration cyclone iv devices support r s oct with calibration in the top, bottom, and right i/o banks. the r s oct calibration circuit compares the total impedance of the i/o buffer to the external 25- ? 1% or 50- ? 1% resistors connected to the rup and rdn pins, and dynamically adjusts the i/o buffer impedance until they match (as shown in figure 6?2 ). the r s shown in figure 6?2 is the intrinsic impedance of the transistors that make up the i/o buffer. oct with calibration is achieved using the oct calibration block circuitry. there is one oct calibration block in each of i/o banks 2, 4, 5, and 7 for cyclone iv e devices and i/o banks 4, 5, and 7 for cyclone iv gx devices. each calibration block supports each side of the i/o banks. because there are two i/o banks sharing the same calibration block, both banks must have the same v ccio if both banks enable oct calibration. if two related banks have different v ccio , only the bank in which the calibration block resides can enable oct calibration. figure 6?10 on page 6?18 shows the top-level view of the oct calibration blocks placement. each calibration block comes with a pair of rup and rdn pins. when used for calibration, the rup pin is connected to v ccio through an external 25- ? 1% or 50- ? 1% resistor for an r s oct value of 25 ? or 50 ? , respectively. the rdn pin is connected to gnd through an external 25- ? 1% or 50- ? 1% resistor for an r s oct value of 25 ? or 50 ? , respectively. the external resistors are compared with the internal resistance using comparators. the resultant outputs of the comparators are used by the oct calibration block to dynamically adjust buffer impedance. 1 during calibration, the resistance of the rup and rdn pins varies. figure 6?2. cyclone iv devices r s oct with calibration cyclone iv device family driver series termination receiving device v ccio r s r s z o g n d 6?10 chapter 6: i/o features in cyclone iv devices oct support cyclone iv device handbook, volume 1 ? december 2010 altera corporation figure 6?3 shows the external calibration resistors setup on the rup and rdn pins and the associated oct calibration circuitry. rup and rdn pins go to a tri-state condition when calibration is completed or not running. these two pins are dual-purpose i/os and function as regular i/os if you do not use the calibration circuit. figure 6?3. cyclone iv devices r s oct with calibration setup cyclone iv device family oct with calibration with rup and rdn pins oct cali b ration circ u itry v ccio v ccio rup rd n external cali b ration resistor external cali b ration resistor g n d chapter 6: i/o features in cyclone iv devices 6?11 oct support ? december 2010 altera corporation cyclone iv device handbook, volume 1 on-chip series termination without calibration cyclone iv devices support driver impedance matching to match the impedance of the transmission line, which is typically 25 or 50 ? . when used with the output drivers, oct sets the output driver impedance to 25 or 50 ? . cyclone iv devices also support i/o driver series termination (r s =50 ? ) for sstl-2 and sstl-18. figure 6?4 shows the single-ended i/o standards for oct without calibration. the r s shown is the intrinsic transistor impedance. all i/o banks and i/o pins support impedance matching and series termination. dedicated configuration pins and jtag pins do not support impedance matching or series termination. r s oct is supported on any i/o bank. v ccio and v ref must be compatible for all i/o pins to enable r s oct in a given i/o bank. i/o standards that support different r s values can reside in the same i/o bank as long as their v ccio and v ref do not conflict. impedance matching is implemented using the capabilities of the output driver and is subject to a certain degree of variation, depending on the process, voltage, and temperature. f for more information about tolerance specification, refer to the cyclone iv device datasheet chapter. figure 6?4. cyclone iv devices r s oct without calibration cyclone iv device driver series termination receiving device v ccio r s r s z o g n d 6?12 chapter 6: i/o features in cyclone iv devices i/o standards cyclone iv device handbook, volume 1 ? december 2010 altera corporation i/o standards cyclone iv devices support multiple single-ended and differential i/o standards. cyclone iv devices support 3.3-, 3.0-, 2.5-, 1.8-, 1.5-, and 1.2-v i/o standards. ta b l e 6 ?3 summarizes i/o standards supported by cyclone iv devices and which i/o pins support them. table 6?3. cyclone iv devices supported i/o standards and constraints (part 1 of 2) i/o standard type standard support v ccio level (in v) column i/o pins row i/o pins (1) input output clk, dqs pll_out user i/o pins clk, dqs user i/o pins 3.3-v lvttl, 3.3-v lvcmos (2) single-ended jesd8-b 3.3/3.0/2.5 (3) 3.3 vv vvv 3.0-v lvttl, 3.0-v lvcmos (2) single-ended jesd8-b 3.3/3.0/2.5 (3) 3.0 vv vvv 2.5-v lvttl / lvcmos single-ended jesd8-5 3.3/3.0/2.5 (3) 2.5 vv vvv 1.8-v lvttl / lvcmos single-ended jesd8-7 1.8/1.5 (3) 1.8 vv vvv 1.5-v lvcmos single-ended jesd8-11 1.8/1.5 (3) 1.5 vv vvv 1.2-v lvcmos (4) single-ended jesd8-12a 1.2 1.2 vv vvv sstl-2 class i, sstl-2 class ii voltage- referenced jesd8-9a 2.5 2.5 vv vvv sstl-18 class i, sstl-18 class ii voltage- referenced jesd815 1.8 1.8 vv vvv hstl-18 class i, hstl-18 class ii voltage- referenced jesd8-6 1.8 1.8 vv vvv hstl-15 class i, hstl-15 class ii voltage- referenced jesd8-6 1.5 1.5 vv vvv hstl-12 class i voltage- referenced jesd8-16a 1.2 1.2 vv vvv hstl-12 class ii (9) voltage- referenced jesd8-16a 1.2 1.2 vv v ?? pci and pci-x single-ended ? 3.0 3.0 vv vvv differential sstl-2 class i or class ii differential (5) jesd8-9a ?2.5? v ?? ? 2.5 ? v ?? v ? differential sstl-18 class i or class ii differential (5) jesd815 ?1.8? v ?? ? 1.8 ? v ?? v ? differential hstl-18 class i or class ii differential (5) jesd8-6 ?1.8? v ?? ? 1.8 ? v ?? v ? differential hstl-15 class i or class ii differential (5) jesd8-6 ?1.5? v ?? ? 1.5 ? v ?? v ? differential hstl-12 class i or class ii differential (5) jesd8-16a ?1.2? v ?? ? 1.2 ? v ?? v ? chapter 6: i/o features in cyclone iv devices 6?13 termination scheme for i/o standards ? december 2010 altera corporation cyclone iv device handbook, volume 1 cyclone iv devices support pci and pci-x i/o standards at 3.0-v v ccio . the 3.0-v pci and pci-x i/o are fully compatible for direct interfacing with 3.3-v pci systems without requiring any additional components. the 3.0-v pci and pci-x outputs meet the v ih and v il requirements of 3.3-v pci and pci-x inputs with sufficient noise margin. f for more information about the 3.3/3.0/2.5-v lvttl & lvcmos multivolt i/o support, refer to an 447: interfacing cyclone iii and cyclone iv devices with 3.3/3.0/2.5-v lvttl/lvcmos i/o systems . termination scheme for i/o standards this section describes recommended termination schemes for voltage-referenced and differential i/o standards. the 3.3-v lvttl, 3.0-v lvttl and lvcmos, 2.5-v lvttl and lvcmos, 1.8-v lvttl and lvcmos, 1.5-v lvcmos, 1.2-v lvcmos, 3.0-v pci, and pci-x i/o standards do not specify a recommended termination scheme per the jedec standard ppds (6) differential ? ? 2.5 ? vv ? v lvds (10) differential ansi/tia/ eia-644 2.5 2.5 vv vvv rsds and mini-lvds (6) differential ? ? 2.5 ? vv ? v blvds (8) differential ? 2.5 2.5 ? ? v ? v lvpecl (7) differential ? 2.5 ? v ?? v ? notes to table 6?3 : (1) cyclone iv gx devices only support right i/o pins. (2) the pci-clamp diode must be enabled for 3.3-v/3.0-v lvttl/lvcmos. (3) the cyclone iv architecture supports the multivolt i/o interface feature that allows cyclone iv devices in all packages to i nterface with i/o systems that have different supply voltages. (4) cyclone iv gx devices do not support 1.2-v v ccio in banks 3 and 9. i/o pins in bank 9 are dual-purpose i/o pins that are used as configuration or gpio pins. configuration scheme is not support at 1.2 v, therefore bank 9 can not be powered up at 1.2-v v ccio . (5) differential hstl and sstl outputs use two single-ended outputs with the second output programmed as inverted. differential hstl and sstl inputs treat differential inputs as two single-ended hstl and sstl inputs and only decode one of them. differential hstl and ss tl are only supported on clk pins. (6) ppds, mini-lvds, and rsds are only supported on output pins. (7) lvpecl is only supported on clock inputs. (8) bus lvds (blvds) output uses two single-ended outputs with the second output programmed as inverted. blvds input uses lvds i nput buffer. (9) 1.2-v hstl input is supported at both column and row i/os regardless of class i or class ii. (10) true lvds, rsds, and mini-lvds i/o standards are supported in right i/o pins, while emulated lvds, rsds, and mini-lvds i/o standards are supported in the top, bottom, and right i/o pins. table 6?3. cyclone iv devices supported i/o standards and constraints (part 2 of 2) i/o standard type standard support v ccio level (in v) column i/o pins row i/o pins (1) input output clk, dqs pll_out user i/o pins clk, dqs user i/o pins 6?14 chapter 6: i/o features in cyclone iv devices termination scheme for i/o standards cyclone iv device handbook, volume 1 ? december 2010 altera corporation voltage-referenced i/o standard termination voltage-referenced i/o standards require an input reference voltage (v ref ) and a termination voltage (v tt ). the reference voltage of the receiving device tracks the termination voltage of the transmitting device, as shown in figure 6?5 and figure 6?6 . figure 6?5. cyclone iv devices hstl i/o standard termination figure 6?6. cyclone iv devices sstl i/o standard termination hstl class i hstl class ii external on-board termination oct with and without calibration v tt 50 50 v tt 50 v tt 50 transmitter transmitter recei v er recei v er v tt 50 transmitter recei v er v tt 50 v tt 50 transmitter recei v er cyclone iv de v ice family series oct 50 cyclone iv de v ice family series oct 25 v ref v ref v ref v ref termination 50 50 50 sstl class i sstl class ii external on-board termination oct with and without calibration v tt 50 25 v tt 50 25 v tt 50 transmitter transmitter recei v er recei v er v tt 50 50 transmitter recei v er cyclone iv de v ice family series oct 50 v tt 50 25 50 v tt 50 transmitter recei v er cyclone iv de v ice family series oct v ref v ref v ref v ref termination 50 50 chapter 6: i/o features in cyclone iv devices 6?15 termination scheme for i/o standards ? december 2010 altera corporation cyclone iv device handbook, volume 1 differential i/o standard termination differential i/o standards typically require a termination resistor between the two signals at the receiver. the termination resistor must match the differential load impedance of the bus (refer to figure 6?7 and figure 6?8 ). cyclone iv devices support differential sstl-2 and sstl-18, differential hstl-18, hstl-15, and hstl-12, ppds, lvds, rsds, mini-lvds, and differential lvpecl. figure 6?7. cyclone iv devices differential hstl i/o standard class i and class ii interface and termination figure 6?8. cyclone iv devices differential sstl i/o standard class i and class ii interface and termination (note 1) note to figure 6?8 : (1) only differential sstl-2 i/o standard supports class ii output. external on-board termination oct transmitter recei v er v tt v tt transmitter recei v er v tt v tt cyclone iv de v ice family series oct 50 differential hstl class i termination differential hstl class ii transmitter recei v er 50 50 50 50 v tt v tt 50 50 v tt v tt transmitter recei v er 50 50 ? 50 50 v tt v tt 50 50 v tt v tt cyclone iv de v ice family series oct 25 50 50 50 50 50 50 50 50 differential sstl class i differential sstl class ii external on-board termination oct transmitter recei v er 50 50 50 50 ? v tt v tt 25 25 transmitter recei v er 50 50 50 50 v tt v tt 25 25 50 50 v tt v tt transmitter recei v er 50 50 ? 50 50 v tt v tt 50 50 v tt v tt cyclone iv de v ice family series oct 25 transmitter recei v er 50 50 50 50 v tt v tt 50 cyclone iv de v ice family series oct termination 6?16 chapter 6: i/o features in cyclone iv devices i/o banks cyclone iv device handbook, volume 1 ? december 2010 altera corporation i/o banks i/o pins on cyclone iv devices are grouped together into i/o banks. each bank has a separate power bus. cyclone iv e devices have eight i/o banks, as shown in figure 6?9 . each device i/o pin is associated with one i/o bank. all single-ended i/o standards are supported in all banks except hstl-12 class ii, which is only supported in column i/o banks. all differential i/o standards are supported in all banks. the only exception is hstl-12 class ii, which is only supported in column i/o banks. cyclone iv gx devices have up to ten i/o banks and two configuration banks, as shown in figure 6?10 on page 6?18 and figure 6?11 on page 6?19 . the cyclone iv gx configuration i/o bank contains three user i/o pins that can be used as normal user i/o pins if they are not used in configuration modes. each device i/o pin is associated with one i/o bank. all single-ended i/o standards are supported except hstl-12 class ii, which is only supported in column i/o banks. all differential i/o standards are supported in top, bottom, and right i/o banks. the only exception is hstl-12 class ii, which is only supported in column i/o banks. the entire left side of the cyclone iv gx devices contain dedicated high-speed transceiver blocks for high speed serial interface applications. there are a total of 2, 4, and 8 transceiver channels for cyclone iv gx devices, depending on the density and package of the device. for more information about the transceiver channels supported, refer to figure 6?10 on page 6?18 and figure 6?11 on page 6?19 . chapter 6: i/o features in cyclone iv devices 6?17 i/o banks ? december 2010 altera corporation cyclone iv device handbook, volume 1 figure 6?9 shows the overview of cyclone iv e i/o banks. figure 6?9. cyclone iv e i/o banks (note 1) , (2) notes to figure 6?9 : (1) this is a top view of the silicon die. this is only a graphical representation. for exact pin locations, refer to the pin li st and the quartus ii software. (2) true differential (ppds, lvds, mini-lvds, and rsds i/o standards) outputs are supported in row i/o banks 1, 2, 5, and 6 only . external resistors are needed for the differential outputs in column i/o banks. (3) the lvpecl i/o standard is only supported on clock input pins. this i/o standard is not supported on output pins. (4) the hstl-12 class ii is supported in column i/o banks 3, 4, 7, and 8 only. (5) the differential sstl-18 and sstl-2, differential hstl-18, and hstl-15 i/o standards are supported only on clock input pins and phase-locked loops (plls) output clock pins. differential sstl-18, differential hstl-18, and hstl-15 i/o standards do not support class ii o utput. (6) the differential hstl-12 i/o standard is only supported on clock input pins and pll output clock pins. differential hstl-12 class ii is supported only in column i/o banks 3, 4, 7, and 8. (7) blvds output uses two single-ended outputs with the second output programmed as inverted. blvds input uses true lvds input b uffer. all i/o banks s u pport: 3.3-v lvttl/lvcmos 3.0-v lvttl/lvcmos 2.5-v lvttl/lvcmos 1. 8 -v lvttl/lvcmos 1.5-v lvcmos 1.2-v lvcmos ppds lvds rsds mini-lvds b u s lvds ( 7) lvpecl (3) sstl-2 class i and ii sstl-1 8 class i and ii hstl-1 8 class i and ii hstl-15 class i and ii hstl-12 class i and ii (4) differential sstl-2 (5) differential sstl-1 8 (5) differential hstl-1 8 (5) differential hstl-15 (5) differential hstl-12 (6) i/o bank 8 i/o bank 7 i/o bank 3 i/o bank 4 i/o bank 2 i/o bank 1 i/o bank 5 i/o bank 6 i/o b ank w ith cali b ration b lock i/o b ank w itho u t cali b ration b lock cali b ration b lock co v erage 6?18 chapter 6: i/o features in cyclone iv devices i/o banks cyclone iv device handbook, volume 1 ? december 2010 altera corporation figure 6?10 and figure 6?11 show the overview of cyclone iv gx i/o banks. figure 6?10. cyclone iv gx i/o banks for ep4cgx15, ep4cgx22, and ep4cgx30 (note 1) , (2) , (9) notes to figure 6?10 : (1) this is a top view of the silicon die. for exact pin locations, refer to the pin list and the quartus ii software. channels 2 and 3 are not available in ep4cgx15 and f169 package type in ep4cgx22 and ep4cgx30 devices. (2) true differential (ppds, lvds, mini-lvds, and rsds i/o standards) outputs are supported in row i/o banks 5 and 6 only. exter nal resistors are needed for the differential outputs in column i/o banks. (3) the lvpecl i/o standard is only supported on clock input pins. this i/o standard is not supported on output pins. (4) the hstl-12 class ii is supported in column i/o banks 4, 7, and 8. (5) the differential sstl-18 and sstl-2, differential hstl-18, and hstl-15 i/o standards are supported only on clock input pins and phase-locked loops (plls) output clock pins. pll output clock pins do not support class ii interface type of differential sstl-18, hstl-18, hstl-15, and hstl-12 i/o standards. (6) the differential hstl-12 i/o standard is only supported on clock input pins and pll output clock pins. differential hstl-12 class ii is supported only in column i/o banks 4, 7, and 8. (7) blvds output uses two single-ended outputs with the second output programmed as inverted. blvds input uses the lvds input bu ffer. (8) the pci-x i/o standard does not meet the iv curve requirement at the linear region. (9) the oct block is located in the shaded banks 4, 5, and 7. (10) there are two dedicated clock input i/o banks (i/o bank 3a and i/o bank 8a) that can be used for either high-speed serial i nterface (hssi) input reference clock pins or clock input pins. (11) there are dual-purpose i/o pins in bank 9. if input pins with vref i/o standards are used on these dual-purpose i/o pins during user mode, they share the vref pin in bank 8.these dual-purpose io pins in bank 9 when used in user mode also support r s oct without calibration and they share the oct block with bank 8. vccio9 config u ration pins config u ration pins vcc_clki n 3a i/o bank 3 i/o bank 3a (10) i/o bank 8 i/o bank 9 (11) i/o bank 8 a (10) right, top, and bottom banks s u pport: 3.3-v lvttl/lvcmos 3.0-v lvttl/lvcmos 2.5-v lvttl/lvcmos 1. 8 -v lvttl/lvcmos 1.5-v lvcmos 1.2-v lvcmos ppds lvds rsds mini-lvds b u s lvds ( 7) lvpecl (3) sstl-2 class i and ii sstl-1 8 class i and ii hstl-1 8 class i and ii hstl-15 class i and ii hstl-12 class i and ii (4) differential sstl-2 (5) differential sstl-1 8 (5) differential hstl-1 8 (5) differential hstl-15 (5) differential hstl-12 (6) 3.0-v pci/pci-x ( 8 ) vccio7 vccio6 vccio5 vccio4 vccio3 config u ration pins vcc_clki n8 a vccio 8 i/o bank 7 i/o bank 4 i/o bank 5 pcie hard ip x1, x2, and x4 i/o bank 6 channel 3 channel 2 channel 1 channel 0 i/o b ank w ith cali b ration b lock i/o b ank w itho u t cali b ration b lock cali b ration b lock co v erage chapter 6: i/o features in cyclone iv devices 6?19 i/o banks ? december 2010 altera corporation cyclone iv device handbook, volume 1 figure 6?11. cyclone iv gx i/o banks for ep4cgx50, ep4cgx75, ep4cgx110, and ep4cgx150 (note 1) , (2) , (9) notes to figure 6?11 : (1) this is a top view of the silicon die. for exact pin locations, refer to the pin list and the quartus ii software. (2) true differential (ppds, lvds, mini-lvds, and rsds i/o standards) outputs are supported in row i/o banks 5 and 6 only. exter nal resistors are needed for the differential outputs in column i/o banks. (3) the lvpecl i/o standard is only supported on clock input pins. this i/o standard is not supported on output pins. (4) the hstl-12 class ii is supported in column i/o banks 4, 7, and 8. (5) the differential sstl-18 and sstl-2, differential hstl-18, and hstl-15 i/o standards are supported only on clock input pins and phase-locked loops (plls) output clock pins. pll output clock pins do not support class ii interface type of differential sstl-18, hstl-18, hstl-15, and hstl-12 i/o standards. (6) the differential hstl-12 i/o standard is only supported on clock input pins and pll output clock pins. differential hstl-12 class ii is supported only in column i/o banks 4, 7, and 8. (7) blvds output uses two single-ended outputs with the second output programmed as inverted. blvds input uses the lvds input bu ffer. (8) the pci-x i/o standard does not meet the iv curve requirement at the linear region. (9) the oct block is located in the shaded banks 4, 5, and 7. (10) the dedicated clock input i/o banks 3a, 3b, 8a, and 8b can be used either for hssi input reference clock pins or clock inpu t pins. (11) single-ended clock input support is available for dedicated clock input i/o banks 3b and 8b. right, top, and bottom banks s u pport: 3.3-v lvttl/lvcmos 3.0-v lvttl/lvcmos 2.5-v lvttl/lvcmos 1. 8 -v lvttl/lvcmos 1.5-v lvcmos 1.2-v lvcmos ppds lvds rsds mini-lvds b u s lvds ( 7) lvpecl (3) sstl-2 class i and ii sstl-1 8 class i and ii hstl-1 8 class i and ii hstl-15 class i and ii hstl-12 class i and ii (4) differential sstl-2 (5) differential sstl-1 8 (5) differential hstl-1 8 (5) differential hstl-15 (5) differential hstl-12 (6) 3.0-v pci/pci-x ( 8 ) vccio9 config u ration pins config pins vccio 8 vcc_clki n8 a vcc_clki n 3a vccio7 vccio6 vccio5 vccio4 vccio3 i/o bank 9 i/o bank 7 i/o bank 4 i/o bank 5 pcie hard ip x1, x2, and x4 i/o bank 6 vcc_clki n8 b vccio3 vcc_clki n 3b ch0 ch1 ch2 gxbl0 ch3 ch0 ch1 ch2 gxbl1 ch3 i/o b ank w ith cali b ration b lock i/o b ank w itho u t cali b ration b lock cali b ration b lock co v erage i/o bank 8 i/o bank 8 a (10) i/o bank 8 b (10), (11) i/o bank 3 i/o bank 3a (10) i/o bank 3b (10), (11) 6?20 chapter 6: i/o features in cyclone iv devices i/o banks cyclone iv device handbook, volume 1 ? december 2010 altera corporation each cyclone iv i/o bank has a vref bus to accommodate voltage-referenced i/o standards. each vref pin is the reference source for its v ref group. if you use a v ref group for voltage-referenced i/o standards, connect the vref pin for that group to the appropriate voltage level. if you do not use all the v ref groups in the i/o bank for voltage-referenced i/o standards, you can use the vref pin in the unused voltage-referenced groups as regular i/o pins. for example, if you have sstl-2 class i input pins in i/o bank 3 and they are all placed in the vrefb1n[0] group, vrefb1n[0] must be powered with 1.25 v, and the remaining vrefb1n[1..3] pins (if available) are used as i/o pins. if multiple v ref groups are used in the same i/o bank, the vref pins must all be powered by the same voltage level because the vref pins are shorted together within the same i/o bank. 1 when vref pins are used as regular i/os, they have higher pin capacitance than regular user i/o pins. this has an impact on the timing if the pins are used as inputs and outputs. f for more information about vref pin capacitance, refer to the pin capacitance section in the cyclone iv device datasheet chapter. f for information about how to identify v ref groups, refer to the cyclone iv device pin-out files or the quartus ii pin planner tool. table 6?4 and table 6?5 summarize the number of vref pins in each i/o bank for the cyclone iv device family. table 6?4. number of vref pins per i/o bank for cyclone iv e devices device ep4ce6 ep4ce10 ep4ce15 ep4ce22 ep4ce30 ep4ce40 ep4ce55 ep4ce75 ep4ce115 i/o bank (1) 144- eqpf 256- ubga 256- fbga 144- eqpf 256- ubga 256- fbga 144- eqpf 164- mbga 256- ubga 256- fbga 484- fbga 144- eqpf 256- ubga 256- fbga 484- fbga 780- fbga 484- ubga 484- fbga 780- fbga 484- ubga 484- fbga 780- fbga 484- ubga 484- fbga 780- fbga 484- fbga 780- fbga 1 1111112 2 2221114444422233333 2 1111112 2 2221114444422233333 3 1111112 2 2221114444422233333 4 1111112 2 2221114444422233333 5 1111112 2 2221114444422233333 6 1111112 2 2221114444422233333 7 1111112 2 2221114444422233333 8 1111112 2 2221114444422233333 note to table 6?4 : (1) user i/o pins are used as inputs or outputs; clock input pins are used as inputs only; clock output pins are used as output only. chapter 6: i/o features in cyclone iv devices 6?21 i/o banks ? december 2010 altera corporation cyclone iv device handbook, volume 1 each cyclone iv i/o bank has its own vccio pins. each i/o bank can support only one v ccio setting from among 1.2, 1.5, 1.8, 3.0, or 3.3 v. any number of supported single-ended or differential standards can be simultaneously supported in a single i/o bank, as long as they use the same v ccio levels for input and output pins. when designing lvttl/lvcmos inputs with cyclone iv devices, refer to the following guidelines: all pins accept input voltage (v i ) up to a maximum limit (3.6 v), as stated in the recommended operating conditions provided in the cyclone iv device datasheet chapter . whenever the input level is higher than the bank v ccio , expect higher leakage current. the lvttl/lvcmos i/o standard input pins can only meet the v ih and v il levels according to bank voltage level. voltage-referenced standards are supported in an i/o bank using any number of single-ended or differential standards, as long as they use the same v ref and v ccio values. for example, if you choose to implement both sstl-2 and sstl-18 in your cyclone iv devices, i/o pins using these standards?because they require different v ref values?must be in different banks from each other. however, the same i/o bank can support sstl-2 and 2.5-v lvcmos with the v ccio set to 2.5 v and the v ref set to 1.25 v. 1 when using cyclone iv devices as a receiver in 3.3-, 3.0-, or 2.5-v lvttl/lvcmos systems, you are responsible for managing overshoot or undershoot to stay in the absolute maximum ratings and the recommended operating conditions, provided in the cyclone iv device datasheet chapter. 1 the pci clamping diode is enabled by default in the quartus ii software for input signals with bank v ccio at 2.5, 3.0, or 3.3 v. table 6?5. number of vref pins per i/o bank for cyclone iv gx devices device 4cgx15 4cgx22 4cgx30 4cgx50 4cgx75 4cgx110 4cgx150 i/o bank (1) 148- qfn 169- fbga 169- fbga 324- fbga 169- fbga 324- fbga 484- fbga 672- fbga 484- fbga 672- fbga 484- fbga 672- fbga 896- fbga 484- fbga 672- fbga 896- fbga 311133 3 3 411133 3 3 511133 3 3 611133 3 3 711133 3 3 8 (2) 11133 3 3 notes to table 6?5 : (1) user i/o pins are used as inputs or outputs; clock input pins are used as inputs only; clock output pins are used as output only. (2) bank 9 does not have vref pin. if input pins with vref i/o standards are used in bank 9 during user mode, it shares the vref pin in bank 8. 6?22 chapter 6: i/o features in cyclone iv devices pad placement and dc guidelines cyclone iv device handbook, volume 1 ? december 2010 altera corporation high-speed differential interfaces cyclone iv devices can send and receive data through lvds signals. for the lvds transmitter and receiver, the input and output pins of cyclone iv devices support serialization and deserialization through internal logic. the blvds extends the benefits of lvds to multipoint applications such as bidirectional backplanes. the loading effect and the need to terminate the bus at both ends for multipoint applications require blvds to drive out a higher current than lvds to produce a comparable voltage swing. all the i/o banks of cyclone iv devices support blvds for user i/o pins. the rsds and mini-lvds standards are derivatives of the lvds standard. the rsds and mini-lvds i/o standards are similar in electrical characteristics to lvds, but have a smaller voltage swing and therefore provide increased power benefits and reduced electromagnetic interference (emi). the ppds standard is the next generation of the rsds standard introduced by national semiconductor corporation. cyclone iv devices meet the national semiconductor corporation ppds interface specification and support the ppds standard for outputs only. all the i/o banks of cyclone iv devices support the ppds standard for output pins only. the lvds standard does not require an input reference voltage, but it does require a 100- ? termination resistor between the two signals at the input buffer. an external resistor network is required on the transmitter side for the top and bottom i/o banks. external memory interfacing cyclone iv devices support i/o standards required to interface with a broad range of external memory interfaces, such as ddr sdram, ddr2 sdram, and qdr ii sram. f for more information about cyclone iv devices external memory interface support, refer to the external memory interfaces in cyclone iv devices chapter . pad placement and dc guidelines you can use the quartus ii software to validate your pad and pin placement. pad placement altera recommends that you create a quartus ii design, enter your device i/o assignments and compile your design to validate your pin placement. the quartus ii software checks your pin connections with respect to the i/o assignment and placement rules to ensure proper device operation. these rules depend on device density, package, i/o assignments, voltage assignments and other factors that are not fully described in this chapter. f for more information about how the quartus ii software checks i/o restrictions, refer to the i/o management chapter in volume 2 of the quartus ii handbook . chapter 6: i/o features in cyclone iv devices 6?23 clock pins functionality ? december 2010 altera corporation cyclone iv device handbook, volume 1 dc guidelines for the quartus ii software to automatically check for illegally placed pads according to the dc guidelines, set the dc current sink or source value to electromigration current assignment on each of the output pins that are connected to the external resistive load. the programmable current strength setting has an impact on the amount of dc current that an output pin can source or sink. determine if the current strength setting is sufficient for the external resistive load condition on the output pin. clock pins functionality cyclone iv clock pins have multiple purposes, as per listed: clk pins?input support for single-ended and voltage-referenced standards. for i/o standard support, refer to table 6?3 on page 6?12 . diffclk pins?input support for differential standards. for i/o standard support, refer to table 6?3 on page 6?12 . when used as diffclk pins, dc or ac coupling can be used depending on the interface requirements and external termination is required. for more information, refer to ?high-speed i/o standards support? on page 6?27 . refclk pins?input support for high speed differential reference clocks used by the transceivers in cyclone iv gx devices. for i/o support, coupling, and termination requirements, refer to table 6?10 on page 6?28 . high-speed i/o interface cyclone iv e i/os are separated into eight i/o banks, as shown in figure 6?9 on page 6?17 . cyclone iv gx i/os are separated into six user i/o banks with the left side of the device as the transceiver block, as shown in figure 6?10 on page 6?18 . each bank has an independent power supply. true output drivers for lvds, rsds, mini-lvds, and ppds are on the right i/o banks. on the cyclone iv e row i/o banks and the cyclone iv gx right i/o banks, some of the differential pin pairs ( p and n pins) of the true output drivers are not located on adjacent pins. in these cases, a power pin is located between the p and n pins. these i/o standards are also supported on all i/o banks using two single-ended output with the second output programmed as inverted, and an external resistor network. true input buffers for these i/o standards are supported on the top, bottom, and right i/o banks except for i/o bank 9. 6?24 chapter 6: i/o features in cyclone iv devices high-speed i/o interface cyclone iv device handbook, volume 1 ? december 2010 altera corporation ta b l e 6 ?6 and ta b l e 6? 7 summarize which i/o banks support these i/o standards in the cyclone iv device family. table 6?6. differential i/o standards supported in cyclone iv e i/o banks differential i/o standards i/o bank location external resistor network at transmitter transmitter (tx) receiver (rx) lvds 1,2,5,6 not required vv all three resistors rsds 1,2,5,6 not required v ? 3,4,7,8 three resistors all single resistor mini-lvds 1,2,5,6 not required v ? all three resistors ppds 1,2,5,6 not required v ? all three resistors blvds (1) all single resistor vv lvpecl (2) all ? ? v differential sstl-2 (3) all ? vv differential sstl-18 (3) all ? vv differential hstl-18 (3) all ? vv differential hstl-15 (3) all ? vv differential hstl-12 (3) , (4) all ? vv notes to table 6?6 : (1) transmitter and receiver f max depend on system topology and performance requirement. (2) the lvpecl i/o standard is only supported on dedicated clock input pins. (3) the differential sstl-2, sstl-18, hstl-18, hstl-15, and hstl-12 i/o standards are only supported on clock input pins and pll output clock pins. pll output clock pins do not support class ii interface type of differential sstl-18, hstl-18, hstl-15, and hstl-12 i/o s tandards. (4) differential hstl-12 class ii is supported only in column i/o banks. chapter 6: i/o features in cyclone iv devices 6?25 high-speed i/o interface ? december 2010 altera corporation cyclone iv device handbook, volume 1 you can use i/o pins and internal logic to implement a high-speed differential interface in cyclone iv devices. cyclone iv devices do not contain dedicated serialization or deserialization circuitry. therefore, shift registers, internal phase-locked loops (plls), and i/o cells are used to perform serial-to-parallel conversions on incoming data and parallel-to-serial conversion on outgoing data. the differential interface data serializers and deserializers (serdes) are automatically constructed in the core logic elements (les) with the quartus ii software altlvds megafunction. table 6?7. differential i/o standards supported in cyclone iv gx i/o banks differential i/o standards i/o bank location external resistor network at transmitter transmitter (tx) receiver (rx) lvds 5,6 not required vv 3,4,5,6,7,8 three resistors rsds 5,6 not required v ? 3,4,7,8 three resistors 3,4,5,6,7,8 single resistor mini-lvds 5,6 not required v ? 3,4,5,6,7,8 three resistors ppds 5,6 not required v ? 3,4,5,6,7,8 three resistors blvds (1) 3,4,5,6,7,8 single resistor vv lvpecl (2) 3,4,5,6,7,8 ? ? v differential sstl-2 (3) 3,4,5,6,7,8 ? vv differential sstl-18 (3) 3,4,5,6,7,8 ? vv differential hstl-18 (3) 3,4,5,6,7,8 ? vv differential hstl-15 (3) 3,4,5,6,7,8 ? vv differential hstl-12 (3) 4,5,6,7,8 ? vv notes to table 6?7 : (1) transmitter and receiver f max depend on system topology and performance requirement. (2) the lvpecl i/o standard is only supported on dedicated clock input pins. (3) the differential sstl-2, sstl-18, hstl-18, hstl-15, and hstl-12 i/o standards are only supported on clock input pins and pll output clock pins. pll output clock pins do not support class ii interface type of differential sstl-18, hstl-18, hstl-15, and hstl-12 i/o s tandards. 6?26 chapter 6: i/o features in cyclone iv devices high-speed i/o interface cyclone iv device handbook, volume 1 ? december 2010 altera corporation table 6?8 and table 6?9 summarize the total number of supported row and column differential channels in the cyclone iv device family. table 6?8. cyclone iv e i/o and differential channel count device ep4ce6 ep4ce10 ep4ce15 ep4ce22 ep4ce30 ep4ce40 ep4ce55 ep4ce75 ep4ce115 numbers of differential channels (1) , (2) 144- eqpf 256- ubga 256- fbga 144- eqpf 256- ubga 256- fbga 144- eqpf 164- mbga 256- ubga 256- fbga 484- fbga 144- eqpf 256- ubga 256- fbga 484- fbga 780- fbga 484- ubga 484- fbga 780- fbga 484- ubga 484- fbga 780- fbga 484- ubga 484- fbga 780- fbga 484- fbga 780- fbga user i/o (3) 91 179 179 91 179 179 81 89 165 165 343 79 153 153 328 532 328 328 532 324 324 374 292 292 426 280 528 user i/o banks 88888888 8888888888888888888 lvds (4) 8 2323 8 2323 6 8 212167 7 202060112606011262627054547950103 emulated lvds (5) 13 43 43 13 43 43 12 13 32 32 70 10 32 32 64 112 64 64 112 70 70 90 56 56 99 53 127 notes to table 6?8 : (1) user i/o pins are used as inputs or outputs; clock input pins are used as inputs only; clock output pins are used as output only. (2) for differential pad placement guidelines, refer to ?pad placement? on page 6?22 . (3) the i/o pin count includes all gpios, dedicated clock pins, and dual-purpose configuration pins. dedicated configuration pin s are not included in the pin count. (4) the true lvds count includes all lvds i/o pairs, differential clock input and clock output pins in row i/o banks 1, 2, 5, an d 6. (5) the emulated lvds count includes all lvds i/o pairs, differential clock input and clock output pins in column i/o banks 3, 4 , 7, and 8. chapter 6: i/o features in cyclone iv devices 6?27 high-speed i/o standards support ? december 2010 altera corporation cyclone iv device handbook, volume 1 high-speed i/o standards support this section provides information about the high-speed i/o standards and the hssi input reference clock supported in cyclone iv devices. high speed serial interface (hssi) input reference clock support cyclone iv gx devices support the same i/o features for gpios with additional new features where current i/o banks 3a and 8a consist of dual-purpose clock input pins ( clkin ) and 3b and 8b consist of dedicated clkin that can be used to support the high-speed transceiver input reference clock ( refclk ) features on top of the general-purpose clock input function. i/o banks 3b and 8b are dedicated to high- speed transceiver input refclk only. the ep4cgx15, ep4cgx22, and ep4cgx30 devices contain two pairs of clkin/refclk pins located in i/o banks 3a and 8a. i/o banks 3b and 8b are not available in ep4cgx15, ep4cgx22, and ep4cgx30 devices. the ep4cgx50, ep4cgx75, ep4cgx110, and ep4cgx150 devices have a total of four pairs of clkin/refclk pins located in i/o banks 3a, 3b, 8a, and 8b. i/o banks 3b and 8b can also support single-ended clock inputs. for more information about the clkin/refclk pin location, refer to figure 6?10 on page 6?18 and figure 6?11 on page 6?19 . the clkin/refclk pins are powered by dedicated v cc_clkin3a , v cc_clkin3b , v cc_clkin8a , and v cc_clkin8b power supplies separately in their respective i/o banks to avoid the different power level requirements in the same bank for gpio. table 6?9. cyclone iv gx i/o, differential, and xcvrs channel count device 4cgx15 4cgx22 4cgx30 4cgx50 4cgx75 4cgx110 4cgx150 numbers of differential channels (1) , (2) 148- qfn 169- fbga 169- fbga 324- fbga 169- fbga 324- fbga 484- fbga 484- fbga 672- fbga 484- fbga 672- fbga 484- fbga 672- fbga 896- fbga 484- fbga 672- fbga 896- fbga user i/o (3) 72 72 72 150 72 150 290 290 310 290 310 270 393 475 270 393 475 user i/o banks 9 (4) 9 (4) 9 (4) 9 (4) 9 (4) 9 (4) 11 (5) 11 (5) , (6) 11 (5) , (6) 11 (5) , (6) 11 (5) , (6) 11 (5) , (6) 11 (5) , (6) 11 (5) , (6) 11 (5) , (6) 11 (5) , (6) 11 (5) , (6) lvds (7) 9 9 9 16 9 164545514551385263385263 emulated lvds (8) 16 16 16 48 16 48 85 85 89 85 89 82 129 157 82 129 157 xcvrs 22242444848488488 notes to table 6?9 : (1) user i/o pins are used as inputs or outputs; clock input pins are used as inputs only; clock output pins are used as outputs only. (2) for differential pad placement guidelines, refer to ?pad placement? on page 6?22 . (3) the i/o pin count includes all gpios, dedicated clock pins, and dual-purpose configuration pins. transceivers pins and dedic ated configuration pins are not included in the pin count. (4) includes one configuration i/o bank and two dedicated clock input i/o banks for hssi input reference clock. (5) includes one configuration i/o bank and four dedicated clock input i/o banks for hssi input reference clock. (6) single-ended clock input support is available for dedicated clock input i/o banks 3b (pins clkio20 and clkio22 ) and 8b (pins clkio17 and clkio19 ). (7) the true lvds count includes all lvds i/o pairs, differential clock input and clock output pins in right i/o banks 5 and 6. (8) the emulated lvds count includes all lvds i/o pairs, differential clock input and clock output pins in column i/o banks 3, 4 , 7, and 8. 6?28 chapter 6: i/o features in cyclone iv devices high-speed i/o standards support cyclone iv device handbook, volume 1 ? december 2010 altera corporation f for more information about the ac-coupled termination scheme for the hssi reference clock, refer to the cyclone iv transceivers architecture chapter. lvds i/o standard support in cyclone iv devices the lvds i/o standard is a high-speed, low-voltage swing, low power, and gpio interface standard. cyclone iv devices meet the ansi/tia/eia-644 standard with the following exceptions: the maximum differential output voltage (v od ) is increased to 600 mv. the maximum v od for ansi specification is 450 mv. the input voltage range is reduced to the range of 1.0 v to 1.6 v, 0.5 v to 1.85 v, or 0 v to 1.8 v based on different frequency ranges. the ansi/tia/eia-644 specification supports an input voltage range of 0 v to 2.4 v. f for lvds i/o standard electrical specifications in cyclone iv devices, refer to the cyclone iv device datasheet chapter. designing with lvds cyclone iv i/o banks support the lvds i/o standard. the cyclone iv gx right i/o banks support true lvds transmitters while the cyclone iv e left and right i/o banks support true lvds transmitters. on the top and bottom i/o banks, the emulated lvds transmitters are supported using two single-ended output buffers with external resistors. one of the single-ended output buffers is programmed to have opposite polarity. the lvds receiver requires an external 100- ? termination resistor between the two signals at the input buffer. table 6?10. cyclone iv gx hssi refclk i/o standard support using gpio clkin pins (note 1) , (2) i/o standard hssi protocol coupling termination vcc_clkin level i/o pin type input output column i/o row i/o supported i/o banks lvds all differential ac (need off chip resistor to restore v cm ) off chip 2.5v not supported yes no 3a, 3b, 8a, 8b lvpecl all off chip 2.5v not supported yes no 3a, 3b, 8a, 8b 1.2v, 1.5v, 3.3v pcml all off chip 2.5v not supported yes no 3a, 3b, 8a, 8b all off chip 2.5v not supported yes no 3a, 3b, 8a, 8b all off chip 2.5v not supported yes no 3a, 3b, 8a, 8b hcsl pcie differential dc off chip 2.5v not supported yes no 3a, 3b, 8a, 8b notes to table 6?10 : (1) the ep4cgx15, ep4cgx22, and ep4cgx30 devices have two pairs of dedicated clock input pins in banks 3a and 8a for hssi input reference clock. i/o banks 3b and 8b are not availabl e in ep4cgx15, ep4cgx22, and ep4cgx30 devices. (2) the ep4cgx50, ep4cgx75, ep4cgx110, and ep4cgx150 devices have four pairs of dedicated clock input pins in banks 3a, 3b, 8a, and 8b for hssi input or single-ended clock input. chapter 6: i/o features in cyclone iv devices 6?29 high-speed i/o standards support ? december 2010 altera corporation cyclone iv device handbook, volume 1 figure 6?12 shows a point-to-point lvds interface using cyclone iv devices true lvds output and input buffers. figure 6?13 shows a point-to-point lvds interface with cyclone iv devices lvds using two single-ended output buffers and external resistors. blvds i/o standard support in cyclone iv devices the blvds i/o standard is a high-speed differential data transmission technology that extends the benefits of standard point-to-point lvds to multipoint configuration that supports bidirectional half-duplex communication. blvds differs from standard lvds by providing a higher drive to achieve similar signal swings at the receiver while loaded with two terminations at both ends of the bus. figure 6?12. cyclone iv devices lvds interface with true output buffer on the right i/o banks transmitting device cyclone i v device 100 cyclone i v device family logic array 100 input buffer output buffer receiving device txout + txout - rxin + rxin - txout + txout - rxin + rxin - 50 50 50 50 figure 6?13. lvds interface with external resistor network on the top and bottom i/o banks (note 1) note to figure 6?13 : (1) r s = 120 ? . r p = 170 ? . l v ds receiver 100 50 cyclo n e iv device resistor network emulated l v ds transmitter r s r p r s 50 6?30 chapter 6: i/o features in cyclone iv devices high-speed i/o standards support cyclone iv device handbook, volume 1 ? december 2010 altera corporation figure 6?14 shows a typical blvds topology with multiple transmitter and receiver pairs. the blvds i/o standard is supported on the top, bottom, and right i/o banks of cyclone iv devices. the blvds transmitter uses two single-ended output buffers with the second output buffer programmed as inverted, while the blvds receiver uses a true lvds input buffer. the transmitter and receiver share the same pins. an output-enabled ( oe ) signal is required to tristate the output buffers when the lvds input buffer receives a signal. f for more information, refer to the cyclone iv device datasheet chapter. designing with blvds the blvds bidirectional communication requires termination at both ends of the bus in blvds. the termination resistor (r t ) must match the bus differential impedance, which in turn depends on the loading on the bus. increasing the load decreases the bus differential impedance. with termination at both ends of the bus, termination is not required between the two signals at the input buffer. a single series resistor (r s ) is required at the output buffer to match the output buffer impedance to the transmission line impedance. however, this series resistor affects the voltage swing at the input buffer. the maximum data rate achievable depends on many factors. 1 altera recommends that you perform simulation using the ibis model while considering factors such as bus loading, termination values, and output and input buffer location on the bus to ensure that the required performance is achieved. f for more information about blvds interface support in altera devices, refer to an 522: implementing bus lvds interface in supported altera device families . figure 6?14. blvds topology with cyclone iv devices transmitters and receivers v cc r t 50 100 k 100 k gnd output data input data cyclone i v device family oe r s r s output data input data cyclone i v device family oe r s r s output data input data cyclone i v device family oe r s r s v cc r t 100 k 100 k gnd 50 50 50 50 50 50 50 50 50 50 50 50 50 chapter 6: i/o features in cyclone iv devices 6?31 high-speed i/o standards support ? december 2010 altera corporation cyclone iv device handbook, volume 1 rsds, mini-lvds, and ppds i/o standard support in cyclone iv devices the rsds, mini-lvds, and ppds i/o standards are used in chip-to-chip applications between the timing controller and the column drivers on the display panels such as lcd monitor panels and lcd televisions. cyclone iv devices meet the national semiconductor corporation rsds interface specification, texas instruments mini-lvds interface specification, and national semiconductor corporation ppds interface specification to support rsds, mini-lvds and ppds output standards, respectively. f for cyclone iv devices rsds, mini-lvds, and ppds output electrical specifications, refer to the cyclone iv device datasheet chapter. f for more information about the rsds i/o standard, refer to the rsds specification from the national semiconductor website ( www.national.com ). designing with rsds, mini-lvds, and ppds cyclone iv i/o banks support rsds, mini-lvds, and ppds output standards. the right i/o banks support true rsds, mini-lvds, and ppds transmitters. on the top and bottom i/o banks, rsds, mini-lvds, and ppds transmitters are supported using two single-ended output buffers with external resistors. the two single-ended output buffers are programmed to have opposite polarity. figure 6?15 shows an rsds, mini-lvds, or ppds interface with a true output buffer. figure 6?15. cyclone iv devices rsds, mini-lvds, or ppds interface with true output buffer on the right i/o banks cyclone iv device 100 50 50 tr u e rsds, mini-lvds, or ppds transmitter rsds, mini-lvds, or ppds recei v er 6?32 chapter 6: i/o features in cyclone iv devices high-speed i/o standards support cyclone iv device handbook, volume 1 ? december 2010 altera corporation figure 6?16 shows an rsds, mini-lvds, or ppds interface with two single-ended output buffers and external resistors. a resistor network is required to attenuate the output voltage swing to meet rsds, mini-lvds, and ppds specifications when using emulated transmitters. you can modify the resistor network values to reduce power or improve the noise margin. the resistor values chosen must satisfy equation 6?1 . 1 altera recommends that you perform simulations using cyclone iv devices ibis models to validate that custom resistor values meet the rsds, mini-lvds, or ppds requirements. it is possible to use a single external resistor instead of using three resistors in the resistor network for an rsds interface, as shown in figure 6?17 . the external single-resistor solution reduces the external resistor count while still achieving the required signaling level for rsds. however, the performance of the single-resistor solution is lower than the performance with the three-resistor network. figure 6?16. rsds, mini-lvds, or ppds interface with external resistor network on the top and bottom i/o banks (note 1) note to figure 6?16 : (1) r s and r p values are pending characterization. equation 6?1. resistor network 100 50 cyclone iv device resis t o r ne t wo r k r s r p r s 50 emulated rsds, mini-l v ds, or ppds transmitter rsds, mini-l v ds, or ppds receiver r s r p 2 ------ ? r s r p 2 ------ + ------------------- 5 0 ? = chapter 6: i/o features in cyclone iv devices 6?33 high-speed i/o standards support ? december 2010 altera corporation cyclone iv device handbook, volume 1 figure 6?17 shows the rsds interface with a single resistor network on the top and bottom i/o banks. lvpecl i/o support in cyclone iv devices the lvpecl i/o standard is a differential interface standard that requires a 2.5-v v ccio. this standard is used in applications involving video graphics, telecommunications, data communications, and clock distribution. cyclone iv devices support the lvpecl input standard at the dedicated clock input pins only. the lvpecl receiver requires an external 100- ? termination resistor between the two signals at the input buffer. f for the lvpecl i/o standard electrical specification, refer to the cyclone iv device datasheet chapter. ac coupling is required when the lvpecl common mode voltage of the output buffer is higher than the cyclone iv devices lvpecl input common mode voltage. figure 6?18 shows the ac-coupled termination scheme. the 50- ? resistors used at the receiver are external to the device. dc-coupled lvpecl is supported if the lvpecl output common mode voltage is in the cyclone iv devices lvpecl input buffer specification (refer to figure 6?19 ). figure 6?17. rsds interface with single resistor network on the top and bottom i/o banks (note 1) note to figure 6?17 : (1) r p value is pending characterization. rsds receiver 100 50 cyclone iv device single resistor network emulated rsds transmitter r p 50 6?34 chapter 6: i/o features in cyclone iv devices high-speed i/o standards support cyclone iv device handbook, volume 1 ? december 2010 altera corporation figure 6?19 shows the lvpecl dc-coupled termination. differential sstl i/o standard support in cyclone iv devices the differential sstl i/o standard is a memory-bus standard used for applications such as high-speed ddr sdram interfaces. cyclone iv devices support differential sstl-2 and sstl-18 i/o standards. the differential sstl i/o standard requires two differential inputs with an external reference voltage ( vref ) as well as an external termination voltage ( vtt ) of 0.5 v ccio to which termination resistors are connected. the differential sstl output standard is only supported at pll#_clkout pins using two single-ended sstl output buffers ( pll#_clkoutp and pll#_clkoutn ), with the second output programmed to have opposite polarity. the differential sstl input standard is supported on the gclk pins only, treating differential inputs as two single-ended sstl and only decoding one of them. f for differential sstl electrical specifications, refer to ?differential i/o standard termination? on page 6?15 and the cyclone iv device datasheet chapter. 1 figure 6?8 on page 6?15 shows the differential sstl class i and class ii interface. figure 6?18. lvpecl ac-coupled termination (note 1) note to figure 6?18 : (1) the lvpecl ac-coupled termination is applicable only when an altera fpga transmitter is used. figure 6?19. lvpecl dc-coupled termination (note 1) note to figure 6?19 : (1) the lvpecl dc-coupled termination is applicable only when an altera fpga transmitter is used. cyclone iv device lvpecl receiver 50 50 v icm z 0 = 50 z 0 = 50 lvpecl transmitter 0.1 f 0.1 f cyclone iv de v ice lvpecl recei v er 100 50 50 lvpecl transmitter chapter 6: i/o features in cyclone iv devices 6?35 true output buffer feature ? december 2010 altera corporation cyclone iv device handbook, volume 1 differential hstl i/o standard support in cyclone iv devices the differential hstl i/o standard is used for the applications designed to operate in 0v to 1.2v, 0v to 1.5v, or 0v to 1.8v hstl logic switching range. cyclone iv devices support differential hstl-18, hstl-15, and hstl-12 i/o standards. the differential hstl input standard is available on gclk pins only, treating the differential inputs as two single-ended hstl and only decoding one of them. the differential hstl output standard is only supported at the pll#_clkout pins using two single-ended hstl output buffers ( pll#_clkout p and pll#_clkout n ), with the second output programmed to have opposite polarity. the standard requires two differential inputs with an external reference voltage ( vref ), as well as an external termination voltage ( vtt ) of 0.5 v ccio to which termination resistors are connected. f for differential hstl signaling characteristics, refer to ?differential i/o standard termination? on page 6?15 and the cyclone iv device datasheet chapter. 1 figure 6?7 on page 6?15 shows the differential hstl class i and class ii interface. true output buffer feature cyclone iv devices true differential transmitters offer programmable pre-emphasis? you can turn it on or off. the default setting is on. programmable pre-emphasis the programmable pre-emphasis boosts the high frequencies of the output signal to compensate the frequency-dependant attenuation of the transmission line to maximize the data eye opening at the far-end receiver. without pre-emphasis, the output current is limited by the v od specification and the output impedance of the transmitter. at high frequency, the slew rate may not be fast enough to reach full v od before the next edge; this may lead to pattern-dependent jitter. with pre-emphasis, the output current is momentarily boosted during switching to increase the output slew rate. the overshoot produced by this extra switching current is different from the overshoot caused by signal reflection. this overshoot happens only during switching, and does not produce ringing. the quartus ii software allows two settings for programmable pre-emphasis control? 0 and 1 , in which 0 is pre-emphasis off and 1 is pre-emphasis on. the default setting is 1 . the amount of pre-emphasis needed depends on the amplification of the high-frequency components along the transmission line. you must adjust the setting to suit your designs, as pre-emphasis decreases the amplitude of the low-frequency component of the output signal. 6?36 chapter 6: i/o features in cyclone iv devices high-speed i/o timing cyclone iv device handbook, volume 1 ? december 2010 altera corporation figure 6?20 shows the differential output signal with pre-emphasis. high-speed i/o timing this section discusses the timing budget, waveforms, and specifications for source-synchronous signaling in cyclone iv devices. timing for source-synchronous signaling is based on skew between the data and clock signals. high-speed differential data transmission requires timing parameters provided by ic vendors and requires you to consider the board skew, cable skew, and clock jitter. this section provides information about high-speed i/o standards timing parameters in cyclone iv devices. ta b l e 6 ?11 defines the parameters of the timing diagram shown in figure 6?21 . figure 6?20. the output signal with pre-emphasis v od positive channel (p) negative channel (n) overshoot undershoot table 6?11. high-speed i/o timing definitions parameter symbol description transmitter channel-to-channel skew (1) tccs the timing difference between the fastest and slowest output edges, including t co variation and clock skew. the clock is included in the tccs measurement. sampling window sw the period of time during which the data must be valid in order for you to capture it correctly. the setup and hold times determine the ideal strobe position in the sampling window. t sw =t su +t hd + pll jitter. time unit interval tui the tui is the data-bit timing budget allowed for skew, propagation delays, and data sampling window. receiver input skew margin rskm rskm is defined by the total margin left after accounting for the sampling window and tccs. the rskm equation is: input jitter tolerance (peak-to-peak) ? allowed input jitter on the input clock to the pll that is tolerable while maintaining pll lock. output jitter (peak-to-peak) ? peak-to-peak output jitter from the pll. note to table 6?11 : (1) the tccs specification applies to the entire bank of differential i/o as long as the serdes logic is placed in the logic arr ay block (lab) adjacent to the output pins. rskm tui sw tccs ? ? ?? 2 ---------------------------------------------- = chapter 6: i/o features in cyclone iv devices 6?37 high-speed i/o timing ? december 2010 altera corporation cyclone iv device handbook, volume 1 figure 6?22 shows the cyclone iv devices high-speed i/o timing budget. f for more information, refer to the cyclone iv device datasheet chapter. figure 6?21. high-speed i/o timing diagram sampling w indo w (s w ) time unit inter v al (tui) rskm tccs rskm tccs internal clock external inp u t clock recei v er inp u t data figure 6?22. cyclone iv devices high-speed i/o timing budget (note 1) note to figure 6?22 : (1) the equation for the high-speed i/o timing budget is: internal clock period rskm 0.5 tccs rskm 0.5 tccs s w period 0.5 tccs rskm sw rskm 0.5 tccs. ? ++++ ? = 6?38 chapter 6: i/o features in cyclone iv devices design guidelines cyclone iv device handbook, volume 1 ? december 2010 altera corporation design guidelines this section provides guidelines for designing with cyclone iv devices. differential pad placement guidelines to maintain an acceptable noise level on the v ccio supply, you must observe some restrictions on the placement of single-ended i/o pins in relation to differential pads. 1 for guidelines on placing single-ended pads with respect to differential pads in cyclone iv devices, refer to ?pad placement and dc guidelines? on page 6?22 . board design considerations this section explains how to achieve the optimal performance from a cyclone iv i/o interface and ensure first-time success in implementing a functional design with optimal signal quality. you must consider the critical issues of controlled impedance of traces and connectors, differential routing, and termination techniques to get the best performance from cyclone iv devices. use the following general guidelines to improve signal quality: base board designs on controlled differential impedance. calculate and compare all parameters, such as trace width, trace thickness, and the distance between two differential traces. maintain equal distance between traces in differential i/o standard pairs as much as possible. routing the pair of traces close to each other maximizes the common-mode rejection ratio (cmrr). longer traces have more inductance and capacitance. these traces must be as short as possible to limit signal integrity issues. place termination resistors as close to receiver input pins as possible. use surface mount components. avoid 90 corners on board traces. use high-performance connectors. design backplane and card traces so that trace impedance matches the impedance of the connector and termination. keep an equal number of vias for both signal traces. create equal trace lengths to avoid skew between signals. unequal trace lengths result in misplaced crossing points and decrease system margins as the tccs value increases. limit vias because they cause discontinuities. keep switching transistor-to-transistor logic (ttl) signals away from differential signals to avoid possible noise coupling. do not route ttl clock signals to areas under or above the differential signals. analyze system-level signals. chapter 6: i/o features in cyclone iv devices 6?39 software overview ? december 2010 altera corporation cyclone iv device handbook, volume 1 f for pcb layout guidelines, refer to an 224: high-speed board layout guidelines and an 315: guidelines for designing high-speed fpga pcbs . software overview cyclone iv devices high-speed i/o system interfaces are created in core logic by a quartus ii software megafunction because they do not have a dedicated circuit for the serdes. cyclone iv devices use the i/o registers and le registers to improve the timing performance and support the serdes. the quartus ii software allows you to design your high-speed interfaces using altlvds megafunction. this megafunction implements either a high-speed deserializer receiver or a high-speed serializer transmitter. there is a list of parameters in the altlvds megafunction that you can set to customize your serdes based on your design requirements. the megafunction is optimized to use cyclone iv devices resources to create high-speed i/o interfaces in the most effective manner. 1 when you use cyclone iv devices with the altlvds megafunction, the interface always sends the msb of your parallel data first. f for more details about designing your high-speed i/o systems interfaces using the altlvds megafunction, refer to the altlvds megafunction user guide and the quartus ii handbook . 6?40 chapter 6: i/o features in cyclone iv devices document revision history cyclone iv device handbook, volume 1 ? december 2010 altera corporation document revision history ta b l e 6 ?1 2 lists the revision history for this chapter. table 6?12. document revision history date version changes made december 2010 2.2 updated for the quartus ii software version 10.1 release. added cyclone iv e new device package information. added ?clock pins functionality? section. updated table 6?4 and table 6?8 . minor text edits. july 2010 2.1 updated ?cyclone iv i/o elements?, ?programmable pull-up resistor?, ?i/o banks?, ?high-speed i/o interface?, and ?designing with blvds? sections. updated table 6?6 and table 6?7. updated figure 6?19. february 2010 2.0 added cyclone iv e devices information for the quartus ii software version 9.1 sp1 release. updated table 6?2, table 6?3, and table 6?10. updated ?i/o banks? section. added figure 6?9. updated figure 6?10 and figure 6?11. added table 6?4, table 6?6, and table 6?8. november 2009 1.0 initial release. ? december 2010 altera corporation cyclone iv device handbook, volume 1 7. external memory interfaces in cyclone iv devices this chapter describes the memory interface pin support and the external memory interface features of cyclone ? iv devices. in addition to an abundant supply of on-chip memory, cyclone iv devices can easily interface with a broad range of external memory devices, including ddr2 sdram, ddr sdram, and qdr ii sram. external memory devices are an important system component of a wide range of image processing, storage, communications, and general embedded applications. 1 altera recommends that you construct all ddr2 or ddr sdram external memory interfaces using the altera ? altmemphy megafunction. you can implement the controller function using the altera ddr2 or ddr sdram memory controllers, third-party controllers, or a custom controller for unique application needs. cyclone iv devices support qdr ii interfaces electrically, but altera does not supply controller or physical layer (phy) megafunctions for qdr ii interfaces. this chapter includes the following sections: ?cyclone iv devices memory interfaces pin support? on page 7?2 ?cyclone iv devices memory interfaces features? on page 7?12 f for more information about supported maximum clock rate, device and pin planning, ip implementation, and device termination, refer to the external memory interface handbook . figure 7?1 shows the block diagram of a typical external memory interface data path in cyclone iv devices. figure 7?1. cyclone iv devices external memory data path (note 1) note to figure 7?1 : (1) all clocks shown here are global clocks. dqs/cq/cqn oe v cc pll g n d system clock dq oe dataa datab -90 shifted clock ioe register ioe register ioe register ioe register ioe register ioe register ioe register le register le register le register ioe register capt u re clock cyiv-51007-2.2 7?2 chapter 7: external memory interfaces in cyclone iv devices cyclone iv devices memory interfaces pin support cyclone iv device handbook, volume 1 ? december 2010 altera corporation f for more information about implementing complete external memory interfaces, refer to the external memory interface handbook . cyclone iv devices memory interfaces pin support cyclone iv devices use data (dq), data strobe (dqs), clock, command, and address pins to interface with external memory. some memory interfaces use the data mask (dm) or byte write select (bws#) pins to enable data masking. this section describes how cyclone iv devices support all these different pins. f for more information about pin utilization, refer to volume 2: device, pin, and board layout guidelines of the external memory interface handbook. data and data clock/strobe pins cyclone iv data pins for external memory interfaces are called d for write data, q for read data, or dq for shared read and write data pins. the read-data strobes or read clocks are called dqs pins. cyclone iv devices support both bidirectional data strobes and unidirectional read clocks. depending on the external memory standard, the dq and dqs are bidirectional signals (in ddr2 and ddr sdram) or unidirectional signals (in qdr ii sram). connect the bidirectional dq data signals to the same cyclone iv devices dq pins. for unidirectional d or q signals, connect the read-data signals to a group of dq pins and the write-data signals to a different group of dq pins. 1 in qdr ii sram, the q read-data group must be placed at a different v ref bank location from the d write-data group, command, or address pins. in cyclone iv devices, dqs is used only during write mode in ddr2 and ddr sdram interfaces. cyclone iv devices ignore dqs as the read-data strobe because the phy internally generates the read capture clock for read mode. however, you must connect the dqs pin to the dqs signal in ddr2 and ddr sdram interfaces, or to the cq signal in qdr ii sram interfaces. 1 cyclone iv devices do not support differential strobe pins, which is an optional feature in the ddr2 sdram device. f when you use the altera memory controller megacore ? function, the phy is instantiated for you. for more information about the memory interface data path, refer to the external memory interface handbook . 1 altmemphy is a self-calibrating megafunction, enhanced to simplify the implementation of the read-data path in different memory interfaces. the auto-calibration feature of altmemphy provides ease-of-use by optimizing clock phases and frequencies across process, voltage, and temperature (pvt) variations. you can save on the global clock resources in cyclone iv devices through the altmemphy megafunction because you are not required to route the dqs signals on the global clock buses (because dqs is ignored for read capture). resynchronization issues do not arise because no transfer occurs from the memory domain clock (dqs) to the system domain for capturing data dq. chapter 7: external memory interfaces in cyclone iv devices 7?3 cyclone iv devices memory interfaces pin support ? december 2010 altera corporation cyclone iv device handbook, volume 1 all i/o banks in cyclone iv devices can support dq and dqs signals with dq-bus modes of 8, 9, 16, 18, 32, and 36 except cyclone iv gx devices that do not support left i/o bank interface. ddr2 and ddr sdram interfaces use 8 mode dqs group regardless of the interface width. for a wider interface, you can use multiple 8 dq groups to achieve the desired width requirement. in the 9, 18, and 36 modes, a pair of complementary dqs pins (cq and cq#) drives up to 9, 18, or 36 dq pins, respectively, in the group, to support one, two, or four parity bits and the corresponding data bits. the 9, 18, and 36 modes support the qdr ii memory interface. cq# is the inverted read-clock signal that is connected to the complementary data strobe (dqs or cq# ) pin. you can use any unused dq pins as regular user i/o pins if they are not used as memory interface signals. f for more information about unsupported dqs and dq groups of the cyclone iv transceivers that run at ? 2.97 gbps data rate, refer to the cyclone iv device family pin connection guidelines . ta b l e 7 ?1 lists the number of dqs or dq groups supported on each side of the cyclone iv gx device. table 7?1. cyclone iv gx device dqs and dq bus mode support for each side of the device (note 1) (part 1 of 2) device package side number 8 groups number 9 groups number 16 groups number 18 groups number 32 groups number 36 groups ep4cgx15 148-pin qfn right 1000?? top (2) 1000?? bottom (3) 1000?? 169-pin fbga right 1000?? top (2) 1000?? bottom (3) 1000?? ep4cgx22 ep4cgx30 169-pin fbga right 1000?? top (2) 1000?? bottom (3) 1000?? 324-pin fbga right 2211?? top 2211?? bottom 2211?? 484-pin fbga (4) right 422211 top 422211 bottom 422211 ep4cgx50 ep4cgx75 484-pin fbga right 422211 top 422211 bottom 422211 672-pin fbga right 422211 top 422211 bottom 422211 7?4 chapter 7: external memory interfaces in cyclone iv devices cyclone iv devices memory interfaces pin support cyclone iv device handbook, volume 1 ? december 2010 altera corporation ta b l e 7 ?2 lists the number of dqs or dq groups supported on each side of the cyclone iv e device. ep4cgx110 ep4cgx150 484-pin fbga right 422211 top 422211 bottom 422211 672-pin fbga right 422211 top 422211 bottom 422211 896-pin fbga right 622211 top 623311 bottom 623311 notes to table 7?1 : (1) the number of the dqs/dq group is still preliminary. (2) some of the dq pins can be used as rup and rdn pins. you cannot use these groups if you are using these pins as rup and rdn pins for oct calibration. (3) some of the dq pins can be used as rup pins while the dm pins can be used as rdn pins. you cannot use these groups if you ar e using the rup and rdn pins for oct calibration. (4) only available for ep4cgx30 device. table 7?1. cyclone iv gx device dqs and dq bus mode support for each side of the device (note 1) (part 2 of 2) device package side number 8 groups number 9 groups number 16 groups number 18 groups number 32 groups number 36 groups table 7?2. cyclone iv e device dqs and dq bus mode support for each side of the device (note 1) (part 1 of 3) device package side number 8 groups number 9 groups number 16 groups number 18 groups number 32 groups number 36 groups ep4ce6 ep4ce10 144-pin eqfp left 0000?? right 0000?? bottom (2) , (4) 1000?? top (2) , (5) 1000?? 256-pin ubga left (2) 1100?? right (3) 1100?? bottom 2 2 1 1 ? ? top 2 2 1 1 ? ? 256-pin fbga left (2) 1100?? right (3) 1100?? bottom 2211?? top 2 2 1 1 ? ? chapter 7: external memory interfaces in cyclone iv devices 7?5 cyclone iv devices memory interfaces pin support ? december 2010 altera corporation cyclone iv device handbook, volume 1 ep4ce15 144-pin eqfp left 0000?? right 0000?? bottom (2) , (4) 1000?? top (2) , (5) 1000?? 164-pin mbga left 0000?? right 0000?? bottom (2) , (4) 1000?? top (2) , (5) 1000?? 256-pin ubga left (2) 1100?? right (3) 1100?? bottom 2 2 1 1 ? ? top 2 2 1 1 ? ? 256-pin fbga left (2) 1100?? right (3) 1100?? bottom 2211?? top 2 2 1 1 ? ? 484-pin fbga left 442211 right 442211 bottom 442211 top 442211 ep4ce22 144-pin eqfp left 0000?? right 0000?? bottom (2) , (4) 1000?? top (2) , (5) 1000?? 256-pin ubga left (2) 1100?? right (3) 1100?? bottom 2211?? top 2 2 1 1 ? ? 256-pin fbga left (2) 1100?? right (3) 1100?? bottom 2211?? top 2 2 1 1 ? ? table 7?2. cyclone iv e device dqs and dq bus mode support for each side of the device (note 1) (part 2 of 3) device package side number 8 groups number 9 groups number 16 groups number 18 groups number 32 groups number 36 groups 7?6 chapter 7: external memory interfaces in cyclone iv devices cyclone iv devices memory interfaces pin support cyclone iv device handbook, volume 1 ? december 2010 altera corporation f for more information about device package outline, refer to the device packaging specifications webpage. dqs pins are listed in the cyclone iv pin tables as dqsxy , in which x indicates the dqs grouping number and y indicates whether the group is located on the top ( t ), bottom ( b ), or right ( r ) side of the device. similarly, the corresponding dq pins are marked as dqxy , in which the x denotes the dq grouping number and y denotes whether the group is located on the top ( t ), bottom ( b ), or right ( r ) side of the device. for example, dqs2t indicates a dqs pin belonging to group 2 , located on the top side of the device. similarly, the dq pins belonging to that group is shown as dq2t . ep4ce30 ep4ce115 484-pin fbga left 442211 right 442211 bottom 442211 top 442211 780-pin fbga left 442211 right 442211 bottom 662211 top 662211 ep4ce40 ep4ce55 ep4ce75 484-pin ubga left 442211 right 442211 bottom 442211 top 442211 484-pin fbga left 442211 right 442211 bottom 442211 top 442211 780-pin fbga left 442211 right 442211 bottom 662211 top 662211 notes to table 7?2 : (1) the number of the dqs/dq group is still preliminary. (2) some of the dq pins can be used as rup and rdn pins. you cannot use these groups if you are using these pins as rup and rdn pins for oct calibration. (3) some of the dq pins can be used as rup pins while the dm pins can be used as rdn pins. you cannot use these groups if you ar e using the rup and rdn pins for oct calibration. (4) there is no dm pin support for these groups. (5) pllclkout3n and pllclkout3p pins are shared with the dq or dm pins to gain 8 dq group. you cannot use these groups if you are using pllclkout3n and pllclkout3p . table 7?2. cyclone iv e device dqs and dq bus mode support for each side of the device (note 1) (part 3 of 3) device package side number 8 groups number 9 groups number 16 groups number 18 groups number 32 groups number 36 groups chapter 7: external memory interfaces in cyclone iv devices 7?7 cyclone iv devices memory interfaces pin support ? december 2010 altera corporation cyclone iv device handbook, volume 1 1 each dq group is associated with its corresponding dqs pins, as defined in the cyclone iv pin tables. for example: for ddr2 or ddr sdram, 8 dq group dq3b[7..0] pins are associated with the dqs3b pin (same 3b group index) for qdr ii sram, 9 q read-data group dq3t[8..0] pins are associated with dqs0t/cq0t and dqs1t/cq0t# pins (same 0t group index) the quartus ? ii software issues an error message if a dq group is not placed properly with its associated dqs. figure 7?2 shows the location and numbering of the dqs, dq, or cq# pins in the cyclone iv gx i/o banks. figure 7?3 shows the location and numbering of the dqs, dq, or cq# pins in i/o banks of the cyclone iv gx device in the 324-pin fbga package only. figure 7?2. dqs, cq, or cq# pins in cyclone iv gx i/o banks (note 1) note to figure 7?2 : (1) the dqs, cq, or cq# pin locations in this diagram apply to all packages in cyclone iv gx devices except devices in 148-pin qfp, 169-pin fbga, and 324-pin fbga. i/o bank 8 b i/o bank 3b i/o bank 3 i/o bank 3a i/o bank 4 i/o bank 8 i/o bank 8 a i/o bank 7 i/o bank 9 transcei v er block (ql1) transcei v er block (ql0) i/o bank 6 i/o bank 5 cyclone iv gx de v ice dqs4t/cq5t dqs2t/cq3t dqs0t/cq1t dqs4r/cq5r dqs2r/cq3r dqs0r/cq1r dqs1r/cq1r# dqs3r/cq3r# dqs5r/cq5r# dqs1b/cq1b# dqs3b/cq3b# dqs5b/cq5b# dqs4b/cq5b dqs2b/cq3b dqs0b/cq1b dqs1t/cq1t# dqs3t/cq3t# dqs5t/cq5t# 7?8 chapter 7: external memory interfaces in cyclone iv devices cyclone iv devices memory interfaces pin support cyclone iv device handbook, volume 1 ? december 2010 altera corporation figure 7?4 shows the location and numbering of the dqs, dq, or cq# pins in i/o banks of the cyclone iv gx device in the 148-pin qfp and 169-pin fbga packages. figure 7?3. dqs, cq, or cq# pins for cyclone iv gx devices in the 324-pin fbga package figure 7?4. dqs, cq, or cq# pins for cyclone iv gx devices in the 148-pin qfp and 169-pin fbga packages i/o bank 9 i/o bank 3 i/o bank 3a i/o bank 4 i/o bank 8 i/o bank 8 a i/o bank 7 transcei v er block (ql1) i/o bank 6 i/o bank 5 cyclone iv gx de v ice 324-pin fbga package dqs2t/cq1t dqs0t/cq0t dqs2r/cq1r dqs0r/cq0r dqs1r/cq0r# dqs3r/cq1r# dqs1b/cq0b# dqs3b/cq1b# dqs2b/cq1b dqs0b/cq0b dqs1t/cq0t# dqs3t/cq1t# i/o bank 9 i/o bank 3 i/o bank 3a i/o bank 4 i/o bank 8 i/o bank 8 a i/o bank 7 transcei v er block (ql1) i/o bank 6 i/o bank 5 cyclone iv gx de v ice 14 8 -pin qfp and 169-pin fbga packages dqs0t/cq0t dqs0r/cq0r dqs1r/cq0r# dqs1b/cq0b# dqs0b/cq0b dqs1t/cq0t# chapter 7: external memory interfaces in cyclone iv devices 7?9 cyclone iv devices memory interfaces pin support ? december 2010 altera corporation cyclone iv device handbook, volume 1 figure 7?5 shows the location and numbering of the dqs, dq, or cq# pins in the cyclone iv e device i/o banks. figure 7?5. dqs, cq, or cq# pins in cyclone iv e i/o banks (note 1) note to figure 7?5 : (1) the dqs, cq, or cq# pin locations in this diagram apply to all packages in cyclone iv e devices except devices in 144-pin eq fp. i/o bank 8 i/o bank 7 i/o bank 3 i/o bank 4 i/o bank 2 i/o bank 1 i/o bank 6 i/o bank 5 cyclone iv e de v ice dqs2l/cq3l dqs0l/cq1l dqs1l/cq1l# dqs3l/cq3l# dqs2r/cq3r dqs0r/cq1r dqs1r/cq1r# dqs3r/cq3r# dqs1b/cq1b# dqs3b/cq3b# dqs5b/cq5b# dqs4b/cq5b dqs2b/cq3b dqs0b/cq1b dqs1t/cq1t# dqs3t/cq3t# dqs5t/cq5t# dqs4t/cq5t dqs2t/cq3t dqs0t/cq1t 7?10 chapter 7: external memory interfaces in cyclone iv devices cyclone iv devices memory interfaces pin support cyclone iv device handbook, volume 1 ? december 2010 altera corporation figure 7?6 shows the location and numbering of the dqs, dq, or cq# pins in i/o banks of the cyclone iv e device in the 144-pin eqfp and 164-pin mbga packages. in cyclone iv devices, the 9 mode uses the same dq and dqs pins as the 8 mode, and one additional dq pin that serves as a regular i/o pin in the 8 mode. the 18 mode uses the same dq and dqs pins as 16 mode, with two additional dq pins that serve as regular i/o pins in the 16 mode. similarly, the 36 mode uses the same dq and dqs pins as the 32 mode, with four additional dq pins that serve as regular i/o pins in the 32 mode. when not used as dq or dqs pins, the memory interface pins are available as regular i/o pins. optional parity, dm, and error correction coding pins cyclone iv devices support parity in 9, 18, and 36 modes. one parity bit is available per eight bits of data pins. you can use any of the dq pins for parity in cyclone iv devices because the parity pins are treated and configured similarly to dq pins. dm pins are only required when writing to ddr2 and ddr sdram devices. qdr ii sram devices use the bws# signal to select the byte to be written into memory. a low signal on the dm or bws# pin indicates the write is valid. driving the dm or bws# pin high causes the memory to mask the dq signals. each group of dqs and dq signals has one dm pin. similar to the dq output signals, the dm signals are clocked by the -90 shifted clock. in cyclone iv devices, the dm pins are preassigned in the device pinouts. the quartus ii fitter treats the dq and dm pins in a dqs group equally for placement purposes. the preassigned dq and dm pins are the preferred pins to use. figure 7?6. dqs, cq, or cq# pins for cyclone iv e devices in the 144-pin eqfp and 164-pin mbga packages cyclone iv e de v ices in 144-pin eqfp and 164-pin mbga i/o bank 8 i/o bank 7 i/o bank 4 i/o bank 3 i/o bank 2 i/o bank 1 i/o bank 6 i/o bank 5 dqs0l/cq1l dqs1l/cq1l# dqs1r/cq1r# dqs0r/cq1r dqs1t/cq1t# dqs0t/cq1t dqs0b/cq1b dqs1b/cq1b# chapter 7: external memory interfaces in cyclone iv devices 7?11 cyclone iv devices memory interfaces pin support ? december 2010 altera corporation cyclone iv device handbook, volume 1 some ddr2 sdram and ddr sdram devices support error correction coding (ecc), a method of detecting and automatically correcting errors in data transmission. in 72-bit ddr2 or ddr sdram, there are eight ecc pins and 64 data pins. connect the ddr2 and ddr sdram ecc pins to a separate dqs or dq group in cyclone iv devices. the memory controller needs additional logic to encode and decode the ecc data. address and control/command pins the address signals and the control or command signals are typically sent at a single data rate. you can use any of the user i/o pins on all i/o banks of cyclone iv devices to generate the address and control or command signals to the memory device. 1 cyclone iv devices do not support qdr ii sram in the burst length of two. memory clock pins in ddr2 and ddr sdram memory interfaces, the memory clock signals (ck and ck#) are used to capture the address signals and the control or command signals. similarly, qdr ii sram devices use the write clocks (k and k#) to capture the address and command signals. the ck/ck# and k/k# signals are generated to resemble the write-data strobe using the ddio registers in cyclone iv devices. 1 ck/ck# pins must be placed on differential i/o pins (diffio in pin planner) and in the same bank or on the same side as the data pins. you can use either side of the device for wraparound interfaces. as seen in the pin planner pad view, ck0 cannot be located in the same row and column pad group as any of the interfacing dq pins. f for more information about memory clock pin placement, refer to volume 2: device, pin, and board layout guidelines of the external memory interface handbook. 7?12 chapter 7: external memory interfaces in cyclone iv devices cyclone iv devices memory interfaces features cyclone iv device handbook, volume 1 ? december 2010 altera corporation cyclone iv devices memory interfaces features this section discusses cyclone iv memory interfaces, including ddr input registers, ddr output registers, oct, and phase-lock loops (plls). ddr input registers the ddr input registers are implemented with three internal logic element (le) registers for every dq pin. these le registers are located in the logic array block (lab) adjacent to the ddr input pin. figure 7?7 illustrates cyclone iv ddr input registers. these ddr input registers are implemented in the core of devices. the ddr data is first fed to two registers, input register a i and input register b i . input register a i captures the ddr data present during the rising edge of the clock input register b i captures the ddr data present during the falling edge of the clock register c i aligns the data before it is synchronized with the system clock the data from the ddr input register is fed to two registers, sync_reg_h and sync_reg_l , then the data is typically transferred to a fifo block to synchronize the two data streams to the rising edge of the system clock. because the read-capture clock is generated by the pll, the read-data strobe signal (dqs or cq) is not used during read operation in cyclone iv devices; hence, postamble is not a concern in this case. figure 7?7. cyclone iv ddr input registers datao u t_h le register le register le register dq datao u t_l inp u t register b i inp u t register a i neg_reg_o u t register c i ddr inp u t registers in cyclone iv de v ice capt u re clock pll chapter 7: external memory interfaces in cyclone iv devices 7?13 cyclone iv devices memory interfaces features ? december 2010 altera corporation cyclone iv device handbook, volume 1 ddr output registers a dedicated write ddio block is implemented in the ddr output and output enable paths. figure 7?8 shows how a cyclone iv dedicated write ddio block is implemented in the i/o element (ioe) registers. the two ddr output registers are located in the i/o element (ioe) block. two serial data streams routed through datain_l and datain_h , are fed into two registers, output register ao and output register bo , respectively, on the same clock edge. the output from output register ao is captured on the falling edge of the clock, while the output from output register bo is captured on the rising edge of the clock. the registered outputs are multiplexed by the common clock to drive the ddr output pin at twice the data rate. the ddr output enable path has a similar structure to the ddr output path in the ioe block. the second output enable register provides the write preamble for the dqs strobe in ddr external memory interfaces. this active-low output enable register extends the high-impedance state of the pin by half a clock cycle to provide the external memory?s dqs write preamble time specification. f for more information about cyclone iv ioe registers, refer to the cyclone iv device i/o features chapter. figure 7?8. cyclone iv dedicated write ddio ioe register ioe register ou t pu t enable -90 shif t ed clock da t ain_l output enable register a oe output enable register b oe data1 data0 ioe register output register a o data0 data1 da t ain_h ioe register output register b o ddr output registers ddr output enable registers dq or dqs ? 7?14 chapter 7: external memory interfaces in cyclone iv devices cyclone iv devices memory interfaces features cyclone iv device handbook, volume 1 ? december 2010 altera corporation figure 7?9 illustrates how the second output enable register extends the dqs high-impedance state by half a clock cycle during a write operation. oct with calibration cyclone iv devices support calibrated on-chip series termination (r s oct) in both vertical and horizontal i/o banks. to use the calibrated oct, you must use the rup and rdn pins for each r s oct control block (one for each side). you can use each oct calibration block to calibrate one type of termination with the same v ccio for that given side. f for more information about the cyclone iv devices oct calibration block, refer to the cyclone iv device i/o features chapter. pll when interfacing with external memory, the pll is used to generate the memory system clock, the write clock, the capture clock and the logic-core clock. the system clock generates the dqs write signals, commands, and addresses. the write-clock is shifted by -90 from the system clock and generates the dq signals during writes. you can use the pll reconfiguration feature to calibrate the read-capture phase shift to balance the setup and hold margins. 1 the pll is instantiated in the altmemphy megafunction. all outputs of the pll are used when the altmemphy megafunction is instantiated to interface with external memories. pll reconfiguration is used in the altmemphy megafunction to calibrate and track the read-capture phase to maintain the optimum margin. f for more information about usage of pll outputs by the altmemphy megafunction, refer to the external memory interface handbook . f for more information about cyclone iv pll, refer to the clock networks and plls in cyclone iv devices chapter. figure 7?9. extending the oe disable by half a clock cycle for a write transaction (note 1) note to figure 7?9 : (1) the waveform reflects the software simulation result. the oe signal is an active low on the device. however, the quartus ii software implements the signal as an active high and automatically adds an inverter before the a oe register d input. system clock (o u tclock for dqs) oe for dqs (from logic array) dqs w rite clock (o u tclock for dq, -90 phase shifted from system clock) o datain_h (from logic array) datain_i (from logic array) oe for dq (from logic array) dq d0 d1 d2 d3 d0 d2 d1 d3 pream b le postam b le delay b y half a clock cycle 90 o chapter 7: external memory interfaces in cyclone iv devices 7?15 document revision history ? december 2010 altera corporation cyclone iv device handbook, volume 1 document revision history ta b l e 7 ?3 lists the revision history for this chapter. table 7?3. document revision history date version changes made december 2010 2.2 updated for the quartus ii software version 10.1 release. added cyclone iv e new device package information. updated table 7?2 . minor text edits. november 2010 2.1 updated ?data and data clock/strobe pins? section. february 2010 2.0 added cyclone iv e devices information for the quartus ii software version 9.1 sp1 release. updated table 7?1. added table 7?2. added figure 7?5 and figure 7?6. november 2009 1.0 initial release. 7?16 chapter 7: external memory interfaces in cyclone iv devices document revision history cyclone iv device handbook, volume 1 ? december 2010 altera corporation ? december 2010 altera corporation cyclone iv device handbook, volume 1 section iii. system integration this section includes the following chapters: chapter 8, configuration and remote system upgrades in cyclone iv devices chapter 9, seu mitigation in cyclone iv devices chapter 10, jtag boundary-scan testing for cyclone iv devices chapter 11, power requirements for cyclone iv devices revision history refer to each chapter for its own specific revision history. for information on when each chapter was updated, refer to the chapter revision dates section, which appears in the complete handbook. ? december 2010 altera corporation cyclone iv device handbook, volume 1 8. configuration and remote system upgrades in cyclone iv devices this chapter describes the configuration and remote system upgrades in cyclone ? iv devices. cyclone iv (cyclone iv gx and cyclone iv e) devices use sram cells to store configuration data. you must download the configuration data to cyclone iv devices each time the device powers up because sram memory is volatile. cyclone iv devices are configured using one of the following configuration schemes: active serial (as) active parallel (ap) (supported in cyclone iv e devices only) passive serial (ps) fast passive parallel (fpp) (not supported in ep4cgx15, ep4cgx22, and ep4cgx30 [except for the f484 package] devices) jtag cyclone iv devices offer the following configuration features: configuration data decompression ( ?configuration data decompression? on page 8?2 ) remote system upgrade ( ?remote system upgrade? on page 8?68 ) system designers face difficult challenges, such as shortened design cycles, evolving standards, and system deployments in remote locations. cyclone iv devices help overcome these challenges with inherent re-programmability and dedicated circuitry to perform remote system upgrades. remote system upgrades help deliver feature enhancements and bug fixes without costly recalls, reduced time-to-market, and extended product life. configuration this section describes cyclone iv device configuration and includes the following topics: ?configuration features? on page 8?2 ?configuration requirement? on page 8?3 ?configuration process? on page 8?6 ?configuration scheme? on page 8?8 ?as configuration (serial configuration devices)? on page 8?10 ?ap configuration (supported flash memories)? on page 8?20 ?ps configuration? on page 8?31 ?fpp configuration? on page 8?39 ?jtag configuration? on page 8?44 ?device configuration pins? on page 8?61 cyiv-51008-1.3 8?2 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation configuration features ta b l e 8 ?1 lists the configuration methods you can use in each configuration scheme. configuration data decompression cyclone iv devices support configuration data decompression, which saves configuration memory space and time. this feature allows you to store compressed configuration data in configuration devices or other memory and send the compressed bitstream to cyclone iv devices. during configuration, cyclone iv devices decompress the bitstream in real time and program the sram cells. 1 preliminary data indicates that compression reduces the configuration bitstream size by 35 to 55%. when you enable compression, the quartus ii software generates configuration files with compressed configuration data. this compressed file reduces the storage requirements in the configuration device or flash memory and decreases the time required to send the bitstream to the cyclone iv device. the time required by a cyclone iv device to decompress a configuration file is less than the time required to send the configuration data to the device. there are two methods for enabling compression for the cyclone iv device bitstreams in the quartus ii software: before design compilation (through the compiler settings menu) after design compilation (through the convert programming files dialog box) to enable compression in the compiler settings of the project in the quartus ii software, perform the following steps: 1. on the assignments menu, click device . the settings dialog box appears. 2. click device and pin options . the device and pin options dialog box appears. 3. click the configuration tab. 4. turn on generate compressed bitstreams . 5. click ok . 6. in the settings dialog box, click ok . table 8?1. configuration features in cyclone iv devices configuration scheme configuration method decompression remote system upgrade (1) as serial configuration device vv ap supported flash memory (2) ? v ps external host with flash memory vv (3) download cable v ? fpp external host with flash memory ? v (3) jtag based configuration external host with flash memory ? ? download cable ? ? notes to table 8?1 : (1) remote update mode is supported when you use the remote system upgrade feature. you can enable or disable remote update mode with an option setting in the quartus ? ii software. (2) for more information about the supported device families for the numonyx commodity parallel flash, refer to table 8?8 on page 8?21 . (3) remote update mode is supported externally using the parallel flash loader (pfl) with the quartus ii software. chapter 8: configuration and remote system upgrades in cyclone iv devices 8?3 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 you can enable compression when creating programming files from the convert programming files dialog box. to enable compression, perform the following steps: 1. on the file menu, click convert programming files . 2. under output programming file , select your desired file type from the programming file type list. 3. if you select programmer object file (.pof) , you must specify the configuration device in the configuration device list. 4. under input files to convert , select sof data . 5. click add file to browse to the cyclone iv device sram object files ( .sof) . 6. in the convert programming files dialog box, select the .pof you added to sof data and click properties . 7. in the sof file properties dialog box, turn on the compression option. when multiple cyclone iv devices are cascaded, you can selectively enable the compression feature for each device in the chain. figure 8?1 shows a chain of two cyclone iv devices. the first device has compression enabled and receives compressed bitstream from the configuration device. the second device has the compression feature disabled and receives uncompressed data. you can generate programming files for this setup in the convert programming files dialog box. configuration requirement this section describes cyclone iv device configuration requirement and includes the following topics: ?power-on reset (por) circuit? on page 8?4 ?configuration file size? on page 8?4 ?power up? on page 8?6 figure 8?1. compressed and uncompressed configuration data in the same configuration file nce gnd nceo decompression controller cyclone i v device nce nceo not connected (n.c.) cyclone i v device serial configuration device se r ial data comp r e ss ed u n comp r e ss ed v cc 10 k 8?4 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation power-on reset (por) circuit the por circuit keeps the device in reset state until the power supply voltage levels have stabilized during device power up. after device power up, the device does not release nstatus until v ccint , v cca , and v ccio (for i/o banks in which the configuration and jtag pins reside) are above the por trip point of the device. v ccint and v cca are monitored for brown-out conditions after device power up. 1 v cca is the analog power to the phase-locked loop (pll). in some applications, it is necessary for a device to wake up very quickly to begin operation. cyclone iv devices offer the fast por time option to support fast wake-up time applications. the fast por time option has stricter power-up requirements when compared with the standard por time option. you can select either the fast option or the standard por option with the msel pin settings. 1 if your system exceeds the fast or standard por time, you must hold nconfig low until all the power supplies are stable. f for more information about the por specifications, refer to the cyclone iv device datasheet . f for more information about the wake-up time and por circuit, refer to the power requirements for cyclone iv devices chapter. configuration file size ta b l e 8 ?2 lists the approximate uncompressed configuration file sizes for cyclone iv devices. to calculate the amount of storage space required for multiple device configurations, add the file size of each device together. table 8?2. uncompressed raw binary file (.rbf) sizes for cyclone iv devices (part 1 of 2) device data size (bits) cyclone iv e ep4ce6 2,944,088 ep4ce10 2,944,088 ep4ce15 4,086,848 ep4ce22 5,748,552 ep4ce30 9,534,304 ep4ce40 9,534,304 ep4ce55 14,889,560 ep4ce75 19,965,752 ep4ce115 28,571,696 chapter 8: configuration and remote system upgrades in cyclone iv devices 8?5 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 use the data in table 8?2 to estimate the file size before design compilation. different configuration file formats, such as hexadecimal ( .hex ) or tabular text file ( .ttf ) formats, have different file sizes. however, for any specific version of the quartus ii software, any design targeted for the same device has the same uncompressed configuration file size. if you use compression, the file size varies after each compilation, because the compression ratio depends on the design. f for more information about setting device configuration options or creating configuration files, refer to the software settings section in volume 2 of the configuration handbook . configuration and jtag pin i/o requirements cyclone iv devices are manufactured using the tsmc 60-nm low-k dielectric process. although cyclone iv devices use tsmc 2.5-v transistor technology in the i/o buffers, the devices are compatible and able to interface with 2.5, 3.0, and 3.3-v configuration voltage standards by following specific requirements. all i/o inputs must maintain a maximum ac voltage of 4.1 v. when using a serial configuration device in an as configuration scheme, you must connect a 25- ? series resistor for the data[0] pin. when cascading the cyclone iv device family in a multi-device configuration for as, ap, fpp, and ps configuration schemes, you must connect the repeater buffers between the master and slave devices for the data and dclk pins. when using the jtag configuration scheme in a multi-device configuration, connect 25- ? resistors on both ends of the tdo-tdi path if the tdo output driver is a non-cyclone iv device. the output resistance of the repeater buffers and the tdo path for all cases must fit the maximum overshoot equation shown in equation 8?1 . cyclone iv gx ep4cgx15 3,805,568 ep4cgx22 7,600,040 ep4cgx30 7,600,040 24,500,000 (1) , (2) ep4cgx50 24,500,000 (1) ep4cgx75 24,500,000 (1) ep4cgx110 39,425,016 ep4cgx150 39,425,016 notes to table 8?2 : (1) these values are preliminary. (2) only for the f484 package. table 8?2. uncompressed raw binary file (.rbf) sizes for cyclone iv devices (part 2 of 2) device data size (bits) equation 8?1. (note 1) note to equation 8?1 : (1) z o is the transmission line impedance and r e is the equivalent resistance of the output buffer. 0.8 z o r e 1.8 z o ?? 8?6 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation configuration process this section describes cyclone iv device configuration requirements and includes the following topics: ?power up? on page 8?6 ?reset? on page 8?6 ?configuration? on page 8?6 ?configuration error? on page 8?7 ?initialization? on page 8?7 ?user mode? on page 8?7 f for more information about the altera ? fpga configuration cycle state machine, refer to the configuring altera fpgas chapter in volume 1 of the configuration handbook . power up if the device is powered up from the power-down state, v ccint , v cca , and v ccio (for the i/o banks in which the configuration and jtag pins reside) must be powered up to the appropriate level for the device to exit from por. reset after power up, cyclone iv devices go through por. por delay depends on the msel pin settings, which correspond to your configuration scheme. during por, the device resets, holds nstatus and conf_done low, and tri-states all user i/o pins (for ps and fpp configuration schemes only). to tri-state the configuration bus for as and ap configuration schemes, you must tie nce high. the user i/o pins and dual-purpose i/o pins have weak pull-up resistors, which are always enabled (after por) before and during configuration. when the device exits por, all user i/o pins continue to tri-state. while nconfig is low, the device is in reset. when nconfig goes high, the device exits reset and releases the open-drain nstatus pin, which is then pulled high by an external 10-k ? pull-up resistor. after nstatus is released, the device is ready to receive configuration data and the configuration stage starts. f for more information about the value of the weak pull-up resistors on the i/o pins that are on before and during configuration, refer to the cyclone iv device datasheet chapter. configuration configuration data is latched into the cyclone iv device at each dclk cycle. however, the width of the data bus and the configuration time taken for each scheme are different. after the device receives all the configuration data, the device releases the open-drain conf_done pin, which is pulled high by an external 10-k ?? pull-up resistor. a low-to-high transition on the conf_done pin indicates that the configuration is complete and initialization of the device can begin. chapter 8: configuration and remote system upgrades in cyclone iv devices 8?7 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 you can begin reconfiguration by pulling the nconfig pin low. the nconfig pin must be low for at least 500 ns. when nconfig is pulled low, the cyclone iv device is reset. the cyclone iv device also pulls nstatus and conf_done low and all i/o pins are tri-stated. when nconfig returns to a logic-high level and nstatus is released by the cyclone iv device, reconfiguration begins. configuration error if an error occurs during configuration, cyclone iv devices assert the nstatus signal low, indicating a data frame error and the conf_done signal stays low. if the auto-restart configuration after error option (available in the quartus ii software in the general tab of the device and pin options dialog box) is turned on, the cyclone iv device releases nstatus after a reset time-out period (a maximum of 230 ? s), and retries configuration. if this option is turned off, the system must monitor nstatus for errors and then pulse nconfig low for at least 500 ns to restart configuration. initialization in cyclone iv devices, the initialization clock source is either the internal oscillator or the optional clkusr pin. by default, the internal oscillator is the clock source for initialization. if you use the internal oscillator, the device provides itself with enough clock cycles for proper initialization. when using the internal oscillator, you do not have to send additional clock cycles from an external source to the clkusr pin during the initialization stage. additionally, you can use the clkusr pin as a user i/o pin. you also have the flexibility to synchronize initialization of multiple devices or to delay initialization with the clkusr option. the clkusr pin allows you to control when your device enters user mode for an indefinite amount of time. you can turn on the enable user-supplied start-up clock (clkusr) option in the quartus ii software in the general tab of the device and pin options dialog box. when you turn on the enable user supplied start-up clock option (clkusr) option, the clkusr pin is the initialization clock source. supplying a clock on the clkusr pin does not affect the configuration process. after the configuration data is accepted and conf_done goes high, cyclone iv devices require 3,192 clock cycles to initialize properly and enter user mode. 1 if you use the optional clkusr pin and the nconfig pin is pulled low to restart configuration during device initialization, ensure that the clkusr pin continues to toggle when nstatus is low (a maximum of 230 ? s). user mode an optional init_done pin is available, which signals the end of initialization and the start of user mode with a low-to-high transition. the enable init_done output option is available in the quartus ii software in the general tab of the device and pin options dialog box. if you use the init_done pin, it is high due to an external 10-k ? pull-up resistor when nconfig is low and during the beginning of configuration. after the option bit to enable init_done is programmed into the device (during the first frame of configuration data), the init_done pin goes low. when initialization is complete, the init_done pin is released and pulled high. this low-to-high transition signals that the device has entered user mode. in user mode, the user i/o pins function as assigned in your design and no longer have weak pull-up resistors. 8?8 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation configuration scheme a configuration scheme with different configuration voltage standards is selected by driving the msel pins either high or low, as shown in table 8?3 , table 8?4 , and ta b l e 8 ?5 . 1 hardwire the msel pins to v cca or gnd without pull-up or pull-down resistors to avoid problems detecting an incorrect configuration scheme. do not drive the msel pins with a microprocessor or another device. table 8?3. configuration schemes for cyclone iv gx devices (ep4cgx15, ep4cgx22, and ep4cgx30 [except for f484 package]) configuration scheme msel2 msel1 msel0 por delay configuration voltage standard (v) (1) as 1 0 1 fast 3.3 0 1 1 fast 3.0, 2.5 0 0 1 standard 3.3 0 1 0 standard 3.0, 2.5 ps 1 0 0 fast 3.3, 3.0, 2.5 1 1 0 fast 1.8, 1.5 0 0 0 standard 3.3, 3.0, 2.5 jtag-based configuration (2) (3) (3) (3) ?? notes to table 8?3 : (1) configuration voltage standard applied to the v ccio supply of the bank in which the configuration pins reside. (2) jtag-based configuration takes precedence over other configuration schemes, which means the msel pin settings are ignored. (3) do not leave the msel pins floating. connect them to v cca or gnd. these pins support the non-jtag configuration scheme used in production. altera recommends connecting the msel pins to gnd if your device is only using jtag configuration. table 8?4. configuration schemes for cyclone iv gx devices (ep4cgx30 [only for f484 package], ep4cgx50, ep4cgx75, ep4cgx110, and ep4cgx150) (part 1 of 2) configuration scheme msel3 msel2 msel1 msel0 por delay configuration voltage standard (v) (1) as 1101 fast 3.3 1011 fast 3.0, 2.5 1001standard 3.3 1 0 1 0 standard 3.0, 2.5 ps 1100 fast 3.3, 3.0, 2.5 1110 fast 1.8, 1.5 1 0 0 0 standard 3.3, 3.0, 2.5 0 0 0 0 standard 1.8, 1.5 fpp 0011 fast 3.3, 3.0, 2.5 0100 fast 1.8, 1.5 0 0 0 1 standard 3.3, 3.0, 2.5 0 0 1 0 standard 1.8, 1.5 chapter 8: configuration and remote system upgrades in cyclone iv devices 8?9 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 1 smaller cyclone iv e devices or package options (e144 and f256 packages) do not have the msel[3] pin. the as fast por configuration scheme at 3.0- or 2.5-v configuration voltage standard and the ap configuration scheme are not supported in cyclone iv e devices without the msel[3] pin. to configure these devices with other supported configuration schemes, select msel[2..0] pins according to the msel settings in table 8?5 . jtag-based configuration (2) (3) (3) (3) (3) ?? notes to table 8?4 : (1) configuration voltage standard applied to the v ccio supply of the bank in which the configuration pins reside. (2) jtag-based configuration takes precedence over other configuration schemes, which means the msel pin settings are ignored. (3) do not leave the msel pins floating. connect them to v cca or gnd. these pins support the non-jtag configuration scheme used in production. altera recommends connecting the msel pins to gnd if your device is only using jtag configuration. table 8?5. configuration schemes for cyclone iv e devices configuration scheme msel3 msel2 msel1 msel0 por delay configuration voltage standard (v) (1) as 1 1 0 1 fast 3.3 0 1 0 0 fast 3.0, 2.5 0 0 1 0 standard 3.3 0 0 1 1 standard 3.0, 2.5 ap 0 1 0 1 fast 3.3 0 1 1 0 fast 1.8 0 1 1 1 standard 3.3 1 0 1 1 standard 3.0, 2.5 1 0 0 0 standard 1.8 ps 1 1 0 0 fast 3.3, 3.0, 2.5 0 0 0 0 standard 3.3, 3.0, 2.5 fpp 1 1 1 0 fast 3.3, 3.0, 2.5 1 1 1 1 fast 1.8, 1.5 jtag-based configuration (2) (3)(3) (3)(3) ?? notes to table 8?5 : (1) configuration voltage standard applied to the v ccio supply of the bank in which the configuration pins reside. (2) jtag-based configuration takes precedence over other configuration schemes, which means the msel pin settings are ignored. (3) do not leave the msel pins floating. connect them to v cca or gnd. these pins support the non-jtag configuration scheme used in production. altera recommends connecting the msel pins to gnd if your device is only using jtag configuration. table 8?4. configuration schemes for cyclone iv gx devices (ep4cgx30 [only for f484 package], ep4cgx50, ep4cgx75, ep4cgx110, and ep4cgx150) (part 2 of 2) configuration scheme msel3 msel2 msel1 msel0 por delay configuration voltage standard (v) (1) 8?10 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation 1 for cyclone iv e devices, the quartus ii software prohibits you from using the lvds i/o standard in i/o bank 1 when the configuration device i/o voltage is not 2.5 v. if you need to assign lvds i/o standard in i/o bank 1, navigate to assignments > device > settings > device and pin option > configuration to change the configuration device i/o voltage to 2.5 v or auto . as configuration (serial configuration devices) in the as configuration scheme, cyclone iv devices are configured with a serial configuration device. these configuration devices are low-cost devices with non-volatile memories that feature a simple four-pin interface and a small form factor. these features make serial configuration devices the ideal low-cost configuration solution. f for more information about serial configuration devices, refer to the serial configuration devices (epcs1, epcs4, epcs16, epcs64, and epcs128) datasheet in volume 2 of the configuration handbook . serial configuration devices provide a serial interface to access the configuration data. during device configuration, cyclone iv devices read the configuration data through the serial interface, decompress the data if necessary, and configure their sram cells. this scheme is referred to as the as configuration scheme because the device controls the configuration interface. single-device as configuration the four-pin interface of serial configuration devices consists of the following pins: serial clock input ( dclk ) serial data output ( data ) active-low chip select ( ncs ) as data input ( asdi ) this four-pin interface connects to cyclone iv device pins, as shown in figure 8?2 . chapter 8: configuration and remote system upgrades in cyclone iv devices 8?11 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 1 the 25- ? resistor at the near end of the serial configuration device for data[0] works to minimize the driver impedance mismatch with the board trace and reduce the overshoot seen at the cyclone iv device data[0] input pin. in the single-device as configuration, the maximum board loading and board trace length between the supported serial configuration device and the cyclone iv device must follow the recommendations in table 8?6 on page 8?17 . the dclk generated by the cyclone iv device controls the entire configuration cycle and provides timing for the serial interface. cyclone iv devices use an internal oscillator or an external clock source to generate the dclk . for cyclone iv e devices, you can use a 40-mhz internal oscillator to generate the dclk and for cyclone iv gx devices you can use a slow clock (20 mhz maximum) or a fast clock (40 mhz maximum) from the internal oscillator or an external clock from clkusr to generate the dclk . there are some variations in the internal oscillator frequency because of the process, voltage, and temperature (pvt) conditions in cyclone iv devices. the internal oscillator is designed to ensure that its maximum frequency is guaranteed to meet epcs device specifications. cyclone iv devices offer the option to select clkusr as the external clock source for dclk . you can change the clock source option in the quartus ii software in the configuration tab of the device and pin options dialog box. figure 8?2. single-device as configuration notes to figure 8?2 : (1) connect the pull-up resistors to the v ccio supply of the bank in which the pin resides. (2) cyclone iv devices use the asdo -to- asdi path to control the configuration device. (3) the nceo pin is left unconnected or used as a user i/o pin when it does not feed the nce pin of another device. (4) the msel pin settings vary for different configuration voltage standards and por time. to connect the msel pins, refer to table 8?3 on page 8?8 , table 8?4 on page 8?8 , and table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (5) connect the series resistor at the near end of the serial configuration device. (6) these pins are dual-purpose i/o pins. the ncso pin functions as flash_nce pin in ap mode. the asdo pin functions as the data[1] pin in ap and fpp modes. (7) only cyclone iv gx devices have an option to select clkusr (40 mhz maximum) as the external clock source for dclk . nstatus nconfig conf_done nce data[0] dclk ncso (6) asdo (6) nceo msel[ ] data dclk ncs asdi v ccio (1) gnd 10 k v ccio (1) 10 k v ccio (1) 10 k n.c. (3 ) (4) clkusr (7) (2) 25 (5) se r ial configu r a t ion device cyclone iv device 8?12 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation 1 epcs1 does not support cyclone iv devices because of its insufficient memory capacity. in configuration mode, the cyclone iv device enables the serial configuration device by driving the ncso output pin low, which connects to the ncs pin of the configuration device. the cyclone iv device uses the dclk and data[1] pins to send operation commands and read address signals to the serial configuration device. the configuration device provides data on its data pin, which connects to the data[0] input of the cyclone iv device. all as configuration pins ( data[0] , dclk , ncso , and data[1] ) have weak internal pull-up resistors that are always active. after configuration, these pins are set as input tri-stated and are driven high by the weak internal pull-up resistors. the timing parameters for as mode are not listed here because the t cf2cd , t cf2st0 , t cfg , t status , t cf2st1 , and t cd2um timing parameters are identical to the timing parameters for ps mode shown in table 8?10 on page 8?35 . multi-device as configuration you can configure multiple cyclone iv devices with a single serial configuration device. when the first device captures all its configuration data from the bitstream, it drives the nceo pin low, enabling the next device in the chain. if the last device in the chain is a cyclone iv device, you can leave the nceo pin of the last device unconnected or use it as a user i/o pin after configuration. the nconfig , nstatus , conf_done , dclk , and data[0] pins of each device in the chain are connected together ( figure 8?3 ). chapter 8: configuration and remote system upgrades in cyclone iv devices 8?13 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 the first cyclone iv device in the chain is the configuration master and it controls the configuration of the entire chain. other altera devices that support ps configuration can also be part of the chain as configuration slaves. 1 in the multi-device as configuration, the board trace length between the serial configuration device and the master device of the cyclone iv device must follow the recommendations in table 8?6 on page 8?17 . figure 8?3. multi-device as configuration notes to figure 8?3 : (1) connect the pull-up resistors to the v ccio supply of the bank in which the pin resides. (2) connect the pull-up resistor to the v ccio supply voltage of i/o bank in which the nce pin resides. (3) you can leave the nceo pin unconnected or use it as a user i/o pin when it does not feed the nce pin of another device. (4) the msel pin settings vary for different configuration voltage standards and por time. you must set the master device of the cyclone iv device in as mode and the slave devices in ps mode. to connect the msel pins for the master device in as mode and slave devices in ps mode, refer to table 8?3 on page 8?8 , table 8?4 on page 8?8 , and table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (5) connect the series resistor at the near end of the serial configuration device. (6) connect the repeater buffers between the master and slave devices of the cyclone iv device for data[0] and dclk . all i/o inputs must maintain a maximum ac voltage of 4.1 v. the output resistance of the repeater buffers must fit the maximum overshoot equation outlined in ?configuration and jtag pin i/o requirements? on page 8?5 . (7) the 50- ? series resistors are optional if the 3.3-v configuration voltage standard is applied. for optimal signal integrity, connect th ese 50- ? series resistors if the 2.5- or 3.0-v configuration voltage standard is applied. (8) these pins are dual-purpose i/o pins. the ncso pin functions as flash_nce pin in ap mode. the asdo pin functions as data[1] pin in ap and fpp modes. (9) only cyclone iv gx devices have an option to select clkusr (40 mhz maximum) as the external clock source for dclk . nstatus nconfig conf_done nce data[0] dclk nceo data dclk ncs asdi n.c. (3 ) (4) se r ial configu r a t ion device cyclone iv slave device nstatus nconfig conf_done nce data[0] dclk ncso (8) asdo (8) nceo msel[ ] (4) msel[ ] v ccio (1) gnd v ccio (1) v ccio (2) (5) v ccio (1) b u ffe rs (6) 10 k 10 k 10 k 10 k 25 50 (5), (7) 50 (7) c yclo n e iv ma s te r device clkusr (9) 8?14 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation the nstatus and conf_done pins on all target devices are connected together with external pull-up resistors, as shown in figure 8?3 on page 8?13 . these pins are open-drain bidirectional pins on the devices. when the first device asserts nceo (after receiving all its configuration data), it releases its conf_done pin. however, the subsequent devices in the chain keep this shared conf_done line low until they receive their configuration data. when all target devices in the chain receive their configuration data and release conf_done , the pull-up resistor drives a high level on conf_done line and all devices simultaneously enter initialization mode. 1 although you can cascade cyclone iv devices, serial configuration devices cannot be cascaded or chained together. if the configuration bitstream size exceeds the capacity of a serial configuration device, you must select a larger configuration device, enable the compression feature, or both. when configuring multiple devices, the size of the bitstream is the sum of the individual device?s configuration bitstream. configuring multiple cyclone iv devices with the same design certain designs require that you configure multiple cyclone iv devices with the same design through a configuration bitstream, or a .sof . you can do this through the following methods: multiple .sof single .sof 1 for both methods, the serial configuration devices cannot be cascaded or chained together. multiple sram object files two copies of the .sof are stored in the serial configuration device. use the first copy to configure the master device of the cyclone iv device and the second copy to configure all remaining slave devices concurrently. all slave devices must have the same density and package. the setup is similar to figure 8?3 on page 8?13 . to configure four identical cyclone iv devices with the same .sof , you must set up the chain similar to the example shown in figure 8?4 . the first device is the master device and its msel pins must be set to select as configuration. the other three slave devices are set up for concurrent configuration and their msel pins must be set to select ps configuration. the nceo pin from the master device drives the nce input pins on all three slave devices, as well as the data and dclk pins that connect in parallel to all four devices. during the first configuration cycle, the master device reads its configuration data from the serial configuration device while holding nceo high. after completing its configuration cycle, the master device drives nce low and sends the second copy of the configuration data to all three slave devices, configuring them simultaneously. the advantage of the setup in figure 8?4 is that you can have a different .sof for the master device. however, all the slave devices must be configured with the same .sof . you can either compress or uncompress the .sof in this configuration method. 1 you can still use this method if the master and slave devices use the same .sof . chapter 8: configuration and remote system upgrades in cyclone iv devices 8?15 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 figure 8?4. multi-device as configuration in which devices receive the same data with multiple .sof notes to figure 8?4 : (1) connect the pull-up resistors to the v ccio supply of the bank in which the pin resides. (2) connect the pull-up resistor to the v ccio supply voltage of the i/o bank in which the nce pin resides. (3) the nceo pin is left unconnected or used as a user i/o pin when it does not feed the nce pin of another device. (4) the msel pin settings vary for different configuration voltage standards and por time. you must set the master device in as mode and th e slave devices in ps mode. to connect the msel pins for the master device in as mode and the slave devices in ps mode, refer to table 8?3 on page 8?8 , table 8?4 on page 8?8 , and table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (5) connect the series resistor at the near end of the serial configuration device. (6) connect the repeater buffers between the master and slave devices for data[0] and dclk . all i/o inputs must maintain a maximum ac voltage of 4.1 v. the output resistance of the repeater buffers must fit the maximum overshoot equation outlined in ?configuration and jtag pin i/o requirements? on page 8?5 . (7) the 50- ? series resistors are optional if the 3.3-v configuration voltage standard is applied. for optimal signal integrity, connect th ese 50- ? series resistors if the 2.5- or 3.0-v configuration voltage standard is applied. (8) these pins are dual-purpose i/o pins. the ncso pin functions as flash_nce pin in ap mode. the asdo pin functions as data[1] pin in ap and fpp modes. (9) only cyclone iv gx devices have an option to select clkusr (40 mhz maximum) as the external clock source for dclk . nstatus nconfig conf_done nce data[0] dclk nceo n.c. (3) (4) cyclone iv slave device nstatus nconfig conf_done nce data[0] dclk nceo n.c. (3) (4) v ccio (1) v ccio (1) nstatus nconfig conf_done nce data[0] dclk nceo msel[ ] n.c. (3) (4) nstatus nconfig conf_done nce data[0] dclk ncso (8) asdo (8) nceo (4) msel[ ] msel[ ] msel[ ] data dclk ncs asdi se r ial configu r a t ion device gnd v ccio (1) v ccio (2) 10 k 10 k 10 k 10 k (5) 25 (5), 50 (7) b u ffe rs (6) (7) 50 cyclone iv slave device cyclone iv slave device cyclone iv mas t e r device clkusr (9) 8?16 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation single sram object file the second method configures both the master device and slave devices with the same .sof . the serial configuration device stores one copy of the .sof . you must set up one or more slave devices in the chain. all the slave devices must be set up in the same way ( figure 8?5 ). in this setup, all the cyclone iv devices in the chain are connected for concurrent configuration. this reduces the as configuration time because all the cyclone iv devices are configured in one configuration cycle. connect the nce input pins of all the cyclone iv devices to gnd. you can either leave the nceo output pins on all the cyclone iv devices unconnected or use the nceo output pins as normal user i/o pins. the data and dclk pins are connected in parallel to all the cyclone iv devices. figure 8?5. multi-device as configuration in which devices receive the same data with a single .sof notes to figure 8?5 : (1) connect the pull-up resistors to the v ccio supply of the bank in which the pin resides. (2) the nceo pin is left unconnected or used as a user i/o pin when it does not feed the nce pin of another device. (3) the msel pin settings vary for different configuration voltage standards and por time. you must set the master device of the cyclone iv device in as mode and the slave devices in ps mode. to connect the msel pins for the master device in as mode and slave devices in ps mode, refer to table 8?3 on page 8?8 , table 8?4 on page 8?8 , and table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (4) connect the series resistor at the near end of the serial configuration device. (5) connect the repeater buffers between the master and slave devices for data[0] and dclk . all i/o inputs must maintain a maximum ac voltage of 4.1 v. the output resistance of the repeater buffers must fit the maximum overshoot equation outlined in ?configuration and jtag pin i/o requirements? on page 8?5 . (6) the 50- ? series resistors are optional if the 3.3-v configuration voltage standard is applied. for optimal signal integrity, connect the se 50- ? series resistors if the 2.5- or 3.0-v configuration voltage standard is applied. (7) these pins are dual-purpose i/o pins. the ncso pin functions as flash_nce pin in ap mode. the asdo pin functions as data[1] pin in ap and fpp modes. (8) only cyclone iv gx devices have an option to select clkusr (40 mhz maximum) as the external clock source for dclk . nstatus nconfig conf_done nce data[0] dclk nceo n.c. (2) (3) nstatus nconfig conf_done nce data[0] dclk nceo n.c. (2) (3) nstatus nconfig conf_done nce data[0] dclk ncso (7) asdo (7) nceo msel[ ] (3) msel[ ] msel[ ] data dclk ncs asdi se r ial configu r a t ion device gnd gnd gnd n.c. (2) v ccio (1) v ccio (1) v ccio (1) b u ffe rs (5) 10 k 10 k 10 k (4) 25 (7) 50 (4),(6) 50 cyclone iv slave device 2 cyclone iv slave device 1 cyclone iv mas t e r device clkusr (9) chapter 8: configuration and remote system upgrades in cyclone iv devices 8?17 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 altera recommends putting a buffer before the data and dclk output from the master device to avoid signal strength and signal integrity issues. the buffer must not significantly change the data -to- dclk relationships or delay them with respect to other as signals ( asdi and ncs ). also, the buffer must only drive the slave devices to ensure that the timing between the master device and the serial configuration device is unaffected. this configuration method supports both compressed and uncompressed .sof . therefore, if the configuration bitstream size exceeds the capacity of a serial configuration device, you can enable the compression feature in the .sof or you can select a larger serial configuration device. guidelines for connecting a serial configuration device to cyclone iv devices for an as interface for single- and multi-device as configurations, the board trace length and loading between the supported serial configuration device and cyclone iv device must follow the recommendations listed in ta b l e 8? 6 . estimating as configuration time as configuration time is dominated by the time it takes to transfer data from the serial configuration device to the cyclone iv device. this serial interface is clocked by the cyclone iv device dclk output (generated from a 40-mhz internal oscillator for cyclone iv e devices, a 20- or 40-mhz internal oscillator, or an external clkusr of up to 40 mhz for cyclone iv gx devices). equation 8?2 and equation 8?3 show the configuration time calculations. enabling compression reduces the amount of configuration data that is sent to the cyclone iv device, which also reduces configuration time. on average, compression reduces configuration time by 50%. table 8?6. maximum trace length and loading for as configuration cyclone iv device as pins maximum board trace length from a cyclone iv device to a serial configuration device (inches) maximum board load (pf) cyclone iv e cyclone iv gx dclk 10 6 15 data[0] 10 6 30 ncso 10 6 30 asdo 10 6 30 equation 8?2. equation 8?3. rbf size maximum dclk period 1 bit ------------------------------------------------------ - ?? ?? ? estimated maximum configuration time = 9,600,000 bits 50 ns 1 bit ------------ - ?? ?? ? 480 ms = 8?18 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation programming serial configuration devices serial configuration devices are non-volatile, flash memory-based devices. you can program these devices in-system with the usb-blaster? or byteblaster? ii download cables. alternatively, you can program them with the altera programming unit (apu), supported third-party programmers, or a microprocessor with the srunner software driver. you can perform in-system programming of serial configuration devices through the as programming interface. during in-system programming, the download cable disables device access to the as interface by driving the nce pin high. cyclone iv devices are also held in reset by a low level on nconfig . after programming is complete, the download cable releases nce and nconfig , allowing the pull-down and pull-up resistors to drive v cc and gnd, respectively. to perform in-system programming of a serial configuration device through the as programming interface, you must place the diodes and capacitors as close as possible to the cyclone iv device. you must ensure that the diodes and capacitors maintain a maximum ac voltage of 4.1 v ( figure 8?6 ). 1 if you want to use the setup shown in figure 8?6 to perform in-system programming of a serial configuration device and single- or multi-device as configuration, you do not require a series resistor on the data line at the near end of the serial configuration device. the existing diodes and capacitors are sufficient. altera has developed the serial flashloader (sfl), a jtag-based in-system programming solution for altera serial configuration devices. the sfl is a bridge design for the cyclone iv device that uses its jtag interface to access the epcs jic (jtag indirect configuration device programming) file and then uses the as interface to program the epcs device. both the jtag interface and as interface are bridged together inside the sfl design. f for more information about implementing the sfl with cyclone iv devices, refer to an 370: using the serial flashloader with the quartus ii software . f for more information about the usb-blaster download cable, refer to the usb-blaster download cable user guide . for more information about the byteblaster ii download cable, refer to the byteblaster ii download cable user guide . chapter 8: configuration and remote system upgrades in cyclone iv devices 8?19 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 figure 8?6 shows the download cable connections to the serial configuration device. figure 8?6. in-system programming of serial configuration devices notes to figure 8?6 : (1) connect these pull-up resistors to the v ccio supply of the bank in which the pin resides. (2) the nceo pin is left unconnected or used as a user i/o pin when it does not feed the nce pin of another device. (3) power up the v cc of the byteblaster ii or usb-blaster download cable with the 3.3-v supply. (4) the msel pin settings vary for different configuration voltage standards and por time. to connect the msel pins, refer to table 8?3 on page 8?8 , table 8?4 on page 8?8 , and table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (5) the diodes and capacitors must be placed as close as possible to the cyclone iv device. you must ensure that the diodes and capacitors maintain a maximum ac voltage of 4.1 v. the external diodes and capacitors are required to prevent damage to the cyclone iv device as co nfiguration input pins due to possible overshoot when programming the serial configuration device with a download cable. altera recommends using the schottky diode, which has a relatively lower forward diode voltage (vf) than the switching and zener diodes, for effective volt age clamping. (6) when cascading cyclone iv devices in a multi-device as configuration, connect the repeater buffers between the master and sl ave devices for data[0] and dclk . all i/o inputs must maintain a maximum ac voltage of 4.1 v. the output resistance of the repeater buffers must fit the maximum overshoot equation outlined in ?configuration and jtag pin i/o requirements? on page 8?5 . (7) these pins are dual-purpose i/o pins. the ncso pin functions as flash_nce pin in ap mode. the asdo pin functions as data[1] pin in ap and fpp modes. (8) only cyclone iv gx devices have an option to select clkusr (40 mhz maximum) as the external clock source for dclk. nstatus nconfig conf_done nce data[0] (6) dclk (6) ncso (7) asdo (7) nceo msel[ ] (4) cyclone iv device data dclk ncs asdi se r ial configu r a t ion device gnd gnd n.c. (2) v ccio (1) v ccio (1) v ccio (1) 3.3 v (3) gnd pi n 1 bytebla s te r ii o r usb bla s te r 10-pi n male heade r 3.3 v 10 pf gnd gnd 10 pf (5) 10 pf gnd 10 pf gnd (5) 10 k 10 k 10 k 10 k 3.3 v 3.3 v 3.3 v clkusr (8) 8?20 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation you can use the quartus ii software with the apu and the appropriate configuration device programming adapter to program serial configuration devices. all serial configuration devices are offered in an 8- or 16-pin small outline integrated circuit (soic) package. in production environments, serial configuration devices are programmed using multiple methods. altera programming hardware or other third-party programming hardware is used to program blank serial configuration devices before they are mounted onto pcbs. alternatively, you can use an on-board microprocessor to program the serial configuration device in-system by porting the reference c-based srunner software driver provided by altera. a serial configuration device is programmed in-system by an external microprocessor with the srunner software driver. the srunner software driver is a software driver developed for embedded serial configuration device programming, which is easily customized to fit in different embedded systems. the srunner software driver is able to read a raw programming data ( .rpd ) file and write to serial configuration devices. the serial configuration device programming time, using the srunner software driver, is comparable to the programming time with the quartus ii software. f for more information about the srunner software driver, refer to an 418: srunner: an embedded solution for serial configuration device programming and the source code at the altera website. ap configuration (supported flash memories) the ap configuration scheme is only supported in cyclone iv e devices. in the ap configuration scheme, cyclone iv e devices are configured using commodity 16-bit parallel flash memory. these external non-volatile configuration devices are industry standard microprocessor flash memories. the flash memories provide a fast interface to access configuration data. the speed up in configuration time is mainly due to the 16-bit wide parallel data bus, which is used to retrieve data from the flash memory. some of the smaller cyclone iv e devices or package options do not support the ap configuration scheme. table 8?7 lists the supported ap configuration scheme for each cyclone iv e devices. table 8?7. supported ap configuration scheme for cyclone iv e devices device package options e144 m164 u256 f256 u484 f484 f780 ep4ce6 ??????? ep4ce10 ??????? ep4ce15 ????? v ? ep4ce22 ??????? ep4ce30 ????? vv ep4ce40 ? ? ? ? vvv ep4ce55 ? ? ? ? vvv ep4ce75 ? ? ? ? vvv ep4ce115 ? ? ? ? ? vv chapter 8: configuration and remote system upgrades in cyclone iv devices 8?21 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 during device configuration, cyclone iv e devices read configuration data using the parallel interface and configure their sram cells. this scheme is referred to as the ap configuration scheme because the device controls the configuration interface. this scheme contrasts with the fpp configuration scheme, where an external host controls the interface. ap configuration supported flash memories the ap configuration controller in cyclone iv e devices is designed to interface with two industry-standard flash families?the numonyx strataflash ? embedded memory p30 flash family and the numonyx strataflash embedded memory p33 flash family. unlike serial configuration devices, both of the flash families supported in ap configuration scheme are designed to interface with microprocessors. by configuring from an industry standard microprocessor flash which allows access to the flash after entering user mode, the ap configuration scheme allows you to combine configuration data and user data (microprocessor boot code) on the same flash memory. the numonyx p30 flash family and the p33 flash family support a continuous synchronous burst read mode at 40 mhz dclk frequency for reading data from the flash. additionally, the numonyx p30 and p33 flash families have identical pin-out and adopt similar protocols for data access. 1 cyclone iv e devices use a 40-mhz oscillator for the ap configuration scheme. the oscillator is the same oscillator used in the cyclone iv e as configuration scheme. ta b l e 8 ?8 lists the supported families of the commodity parallel flash for the ap configuration scheme. configuring cyclone iv e devices from the numonyx p30 and p33 family 512-mbit flash memory is possible, but you must properly drive the extra address and flash_nce pins as required by these flash memories. f to check for supported speed grades and package options, refer to the respective flash datasheets. the ap configuration scheme in cyclone iv e devices supports flash speed grades of 40 mhz and above. however, ap configuration for all these speed grades must be capped at 40 mhz. the advantage of faster speed grades is realized when your design in the cyclone iv e devices accesses flash memory in user mode. table 8?8. supported commodity flash for ap configuration scheme for cyclone iv e devices (note 1) flash memory density numonyx p30 flash family (2) numonyx p33 flash family (3) 64 mbit vv 128 mbit vv 256 mbit vv notes to table 8?8 : (1) the ap configuration scheme only supports flash memory speed grades of 40 mhz and above. (2) 3.3- , 3.0-, 2.5-, and 1.8-v i/o options are supported for the numonyx p30 flash family. (3) 3.3-, 3.0- and 2.5-v i/o options are supported for the numonyx p33 flash family. 8?22 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation f for more information about the operation of the numonyx strataflash embedded memory p30 and p33 flash memories, search for the keyword ?p30? or ?p33? on the numonyx website ( www.numonyx.com ) to obtain the p30 or p33 family datasheet. single-device ap configuration the following groups of interface pins are supported in numonyx p30 and p33 flash memories: control pins address pins data pins the following control signals are from the supported parallel flash memories: clk active-low reset ( rst# ) active-low chip enable ( ce#) active-low output enable ( oe# ) active-low address valid ( adv# ) active-low write enable ( we# ) the supported parallel flash memories output a control signal ( wait ) to cyclone iv e devices to indicate when synchronous data is ready on the data bus. cyclone iv e devices have a 24-bit address bus connecting to the address bus ( a[24:1] ) of the flash memory. a 16-bit bidirectional data bus ( data[15..0] ) provides data transfer between the cyclone iv e device and the flash memory. the following control signals are from the cyclone iv e device to flash memory: dclk active-low hard rest ( nreset ) active-low chip enable ( flash_nce) active-low output enable for the data[15..0] bus and wait pin ( noe) active-low address valid signal and is used to write data into the flash ( navd) active-low write enable and is used to write data into the flash ( nwe ) chapter 8: configuration and remote system upgrades in cyclone iv devices 8?23 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 figure 8?7 shows the interface for the numonyx p30 flash memory and p33 flash memory to the cyclone iv e device pins. 1 in a single-device ap configuration, the maximum board loading and board trace length between supported parallel flash and cyclone iv e devices must follow the recommendations listed in table 8?9 on page 8?27 . 1 if you use the ap configuration scheme for cyclone iv e devices, the v ccio of i/o banks 1, 6, 7, and 8 must be 3.3, 3.0, 2.5, or 1.8 v. altera does not recommend using the level shifter between the numonyx p30 or p33 flash and the cyclone iv e device in the ap configuration scheme. 1 there are no series resistors required in ap configuration mode for cyclone iv e devices when using the numonyx flash at 2.5-, 3.0-, and 3.3-v i/o standard. the output buffer of the numonyx p30 ibis model does not overshoot above 4.1 v. thus, series resistors are not required for the 2.5-, 3.0-, and 3.3-v ap configuration option. however, if there are any other devices sharing the same flash i/os with cyclone iv e devices, all shared pins are still subject to the 4.1-v limit and may require series resistors. figure 8?7. single-device ap configuration using numonyx p30 and p33 flash memory notes to figure 8?7 : (1) connect the pull-up resistors to the v ccio supply of the bank in which the pin resides. (2) the nceo pin is left unconnected or used as a user i/o pin when it does not feed the nce pin of another device. (3) the msel pin settings vary for different configuration voltage standards and por time. to connect msel[3..0] , refer to table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (4) ap configuration ignores the wait signal during configuration mode. however, if you are accessing flash during user mode with user logic, you can optionally use normal i/o to monitor the wait signal from the numonyx p30 or p33 flash. clk rst# ce# oe# adv# w e# w ait dq[15:0] a[24:1] dclk nreset flash_nce noe navd n w e i/o (4) data[15..0] padd[23..0] nce v ccio (1) v ccio (1) 10k ? 10k ? nco n fig nstatus co n f_do n e msel[3..0] (3) nceo n .c. (2) cyclone iv e device numonyx p30/p33 flash g n d v ccio (1) 10k ? 8?24 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation default read mode of the supported parallel flash memory and all writes to the parallel flash memory are asynchronous. both the parallel flash families support a synchronous read mode, with data supplied on the positive edge of dclk . the serial clock ( dclk ) generated by cyclone iv e devices controls the entire configuration cycle and provides timing for the parallel interface. multi-device ap configuration you can configure multiple cyclone iv e devices using a single parallel flash. you can cascade multiple cyclone iv e devices using the chip-enable ( nce ) and chip-enable-out ( nceo ) pins. the first device in the chain must have its nce pin connected to gnd. you must connect its nceo pin to the nce pin of the next device in the chain. use an external 10-k ? pull-up resistor to pull the nceo signal high to its v ccio level to help the internal weak pull-up resistor. when the first device captures all its configuration data from the bitstream, it drives the nceo pin low, enabling the next device in the chain. you can leave the nceo pin of the last device unconnected or use it as a user i/o pin after configuration if the last device in the chain is a cyclone iv e device. the nconfig , nstatus , conf_done , dclk , data[15..8] , and data[7..0] pins of each device in the chain are connected ( figure 8?8 on page 8?25 and figure 8?9 on page 8?26 ). the first cyclone iv e device in the chain, as shown in figure 8?8 on page 8?25 and figure 8?9 on page 8?26 , is the configuration master device and controls the configuration of the entire chain. you must connect its msel pins to select the ap configuration scheme. the remaining cyclone iv e devices are used as configuration slaves. you must connect their msel pins to select the fpp configuration scheme. any other altera device that supports fpp configuration can also be part of the chain as a configuration slave. the following are the configurations for the data[15..0] bus in a multi-device ap configuration: byte-wide multi-device ap configuration word-wide multi-device ap configuration chapter 8: configuration and remote system upgrades in cyclone iv devices 8?25 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 byte-wide multi-device ap configuration the simpler method for multi-device ap configuration is the byte-wide multi-device ap configuration. in the byte-wide multi-device ap configuration, the lsb of the data[7..0] pin from the flash and master device (set to the ap configuration scheme) is connected to the slave devices set to the fpp configuration scheme, as shown in figure 8?8 . word-wide multi-device ap configuration the more efficient setup is one in which some of the slave devices are connected to the lsb of the data[7..0] and the remaining slave devices are connected to the msb of the data[15..8] . in the word-wide multi-device ap configuration, the nceo pin of the master device enables two separate daisy chains of slave devices, allowing both chains to be programmed concurrently, as shown in figure 8?9 . figure 8?8. byte-wide multi-device ap configuration notes to figure 8?8 : (1) connect the pull-up resistors to the v ccio supply of the bank in which the pin resides. (2) connect the pull-up resistor to the v ccio supply voltage of the i/o bank in which the nce pin resides. (3) the nceo pin is left unconnected or used as a user i/o pin when it does not feed the nce pin of another device. (4) the msel pin settings vary for different configuration voltage standards and por time. you must set the master device in ap mode and th e slave devices in fpp mode. to connect msel[3..0] for the master device in ap mode and the slave devices in fpp mode, refer to table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (5) the ap configuration ignores the wait signal during configuration mode. however, if you are accessing flash during user mode with user logic, you can optionally use the normal i/o to monitor the wait signal from the numonyx p30 or p33 flash. (6) connect the repeater buffers between the cyclone iv e master device and slave devices for data[15..0] and dclk . all i/o inputs must maintain a maximum ac voltage of 4.1 v. the output resistance of the repeater buffers must fit the maximum overshoot equation ou tlined in ?configuration and jtag pin i/o requirements? on page 8?5 . clk rst# ce# oe# adv# w e# w ait dq[15:0] a[24:1] dclk nreset flash_nce noe navd n w e i/o (5) data[15..0] padd[23..0] nce v ccio (1) v ccio (1) nco n fig nstatus co n f_do n e msel[3..0] (4) nceo n .c. (3) cyclone iv e master device numonyx p30/p33 flash g n d data[7..0] dclk nce nco n fig nstatus co n f_do n e msel[3..0] (4) nceo cyclone iv e slave device data[7..0] dclk nce nco n fig nstatus co n f_do n e msel[3..0] (4) nceo cyclone iv e slave device v ccio (2) v ccio (2) buffers (6) dq[7..0] dq[7..0] 10 k 10 k 10 k 10 k v ccio (1) 10 k 8?26 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation 1 in a multi-device ap configuration, the board trace length between the parallel flash and the master device must follow the recommendations listed in table 8?9 . figure 8?9. word-wide multi-device ap configuration notes to figure 8?9 : (1) connect the pull-up resistors to the v ccio supply of the bank in which the pin resides. (2) connect the pull-up resistor to the v ccio supply voltage of the i/o bank in which the nce pin resides. (3) the nceo pin is left unconnected or used as a user i/o pin when it does not feed the nce pin of another device. (4) the msel pin settings vary for different configuration voltage standards and por time. you must set the master device in ap mode and th e slave devices in fpp mode. to connect msel[3..0] for the master device in ap mode and the slave devices in fpp mode, refer to table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (5) the ap configuration ignores the wait signal during configuration mode. however, if you are accessing flash during user mode with user logic, you can optionally use the normal i/o pin to monitor the wait signal from the numonyx p30 or p33 flash. (6) connect the repeater buffers between the cyclone iv e master device and slave devices for data[15..0] and dclk . all i/o inputs must maintain a maximum ac voltage of 4.1 v. the output resistance of the repeater buffers must fit the maximum overshoot equation ou tlined in ?configuration and jtag pin i/o requirements? on page 8?5 . clk rst# ce# oe# adv# w e# w ait dq[15:0] a[24:1] dclk nreset flash_nce noe navd n w e i/o (5) data[15..0] padd[23..0] nce v ccio (1) v ccio (1) 10 k ? 10 k ? nco n fig nstatus co n f_do n e msel[3..0] (4) nceo n .c. (3) cyclone iv e master device numonyx p30/p33 flash g n d data[7..0] dclk nce nco n fig nstatus co n f_do n e msel[3..0] (4) nceo cyclone iv e slave device data[7..0] dclk nce nco n fig nstatus co n f_do n e msel[3..0] (4) nceo cyclone iv e slave device v ccio (2) 10 k ? v ccio (2) 10 k ? buffers (6) dq[7..0] n .c. (3) data[7..0] dclk nce nco n fig nstatus co n f_do n e msel[3..0] (4) nceo cyclone iv e slave device data[7..0] dclk nce nco n fig nstatus co n f_do n e msel[3..0] (4) nceo cyclone iv e slave device dq[7..0] v ccio (1) dq[15.. 8 ] dq[15.. 8 ] v ccio (1) 10 k ? 10 k ? chapter 8: configuration and remote system upgrades in cyclone iv devices 8?27 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 the nstatus and conf_done pins on all target devices are connected together with external pull-up resistors, as shown in figure 8?8 on page 8?25 and figure 8?9 on page 8?26 . these pins are open-drain bidirectional pins on the devices. when the first device asserts nceo (after receiving all its configuration data), it releases its conf_done pin. however, the subsequent devices in the chain keep this shared conf_done line low until they receive their configuration data. when all target devices in the chain receive their configuration data and release conf_done , the pull-up resistor drives a high level on this line and all devices simultaneously enter initialization mode. guidelines for connecting parallel flash to cyclone iv e devices for an ap interface for single- and multi-device ap configuration, the board trace length and loading between the supported parallel flash and cyclone iv e devices must follow the recommendations listed in table 8?9 . these recommendations also apply to an ap configuration with multiple bus masters. configuring with multiple bus masters similar to the as configuration scheme, the ap configuration scheme supports multiple bus masters for the parallel flash. for another master to take control of the ap configuration bus, the master must assert nconfig low for at least 500 ns to reset the master cyclone iv e device and override the weak 10-k ? pull-down resistor on the nce pin. this resets the master cyclone iv e device and causes it to tri-state its ap configuration bus. the other master device then takes control of the ap configuration bus. after the other master device is done, it releases the ap configuration bus, then releases the nce pin, and finally pulses nconfig low to restart the configuration. in the ap configuration scheme, multiple masters share the parallel flash. similar to the as configuration scheme, the bus control is negotiated by the nce pin. table 8?9. maximum trace length and loading for ap configuration cyclone iv e ap pins maximum board trace length from cyclone iv e device to flash device (inches) maximum board load (pf) dclk 615 data[15..0] 630 padd[23..0] 630 nreset 630 flash_nce 630 noe 630 navd 630 nwe 630 i/o (1) 630 note to table 8?9 : (1) the ap configuration ignores the wait signal from the flash during configuration mode. however, if you are accessing flash during user mode with user logic, you can optionally use the normal i/o to monitor the wait signal from the numonyx p30 or p33 flash. 8?28 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation figure 8?10 shows the ap configuration with multiple bus masters. figure 8?10. ap configuration with multiple bus masters notes to figure 8?10 : (1) connect the pull-up resistors to the v ccio supply of the bank in which the pin resides. (2) the nceo pin is left unconnected or used as a user i/o pin when it does not feed the nce pin of another device. (3) the msel pin settings vary for different configuration voltage standards and por time. to connect msel[3..0] , refer to table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (4) the ap configuration ignores the wait signal during configuration mode. however, if you are accessing flash during user mode with user logic, you can optionally use the normal i/o to monitor the wait signal from the numonyx p30 or p33 flash. (5) when cascading cyclone iv e devices in a multi-device ap configuration, connect the repeater buffers between the master devic e and slave devices for data[15..0] and dclk . all i/o inputs must maintain a maximum ac voltage of 4.1 v. the output resistance of the repeater buffers must fit the maximum overshoot equation outlined in ?configuration and jtag pin i/o requirements? on page 8?5 . (6) the other master device must fit the maximum overshoot equation outlined in ?configuration and jtag pin i/o requirements? on page 8?5 . (7) the other master device can control the ap configuration bus by driving the nce to high with an output high on the i/o pin. (8) the other master device can pulse nconfig if it is under system control and not tied to v ccio . clk rst# ce# oe# adv# w e# w ait dq[15:0] a[24:1] i/o (7) nco n fig ( 8 ) clk rst# ce# oe# adv# w e# w ait dq[15:0] a[24:1] dclk (5) nreset flash_nce noe navd n w e i/o (4) data[15..0] (5) padd[23..0] nce v ccio (1) v ccio (1) 10 k ? 10 k ? nco n fig nstatus co n f_do n e msel[3..0] (3 ) nceo cyclone iv e master device numonyx p30/p33 flash g n d 10 k ? (2 ) other master device (6) v ccio (1) 10 k ? chapter 8: configuration and remote system upgrades in cyclone iv devices 8?29 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 figure 8?11 shows the recommended balanced star routing for multiple bus master interfaces to minimize signal integrity issues. estimating ap configuration time ap configuration time is dominated by the time it takes to transfer data from the parallel flash to cyclone iv e devices. this parallel interface is clocked by the cyclone iv e dclk output (generated from an internal oscillator). the dclk minimum frequency when using the 40-mhz oscillator is 20 mhz (50 ns). in word-wide cascade programming, the data[15..0] bus transfers a 16-bit word and essentially cuts configuration time to approximately 1/16 of the as configuration time. equation 8?4 and equation 8?5 show the configuration time calculations. figure 8?11. balanced star routing notes to figure 8?11 : (1) altera recommends that m does not exceed 6 inches, as listed in table 8?9 on page 8?27 . (2) altera recommends using a balanced star routing. keep the n length equal and as short as possible to minimize reflection noise from the transmission line. the m length is applicable for this setup. equation 8?4. equation 8?5. external master device cyclone i v e master device numonyx flash dclk m (1) n (2) n (2) rbf size maximum dclk period 16 bits per dclk cycle ------------------------------------------------------ - ?? ?? ? estimated maximum configuration time = 9,600,000 bits 50 ns 16 bit ------------ - ?? ?? ? 30 ms = 8?30 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation programming parallel flash memories supported parallel flash memories are external non-volatile configuration devices. they are industry standard microprocessor flash memories. for more information about the supported families for the commodity parallel flash, refer to table 8?8 on page 8?21 . cyclone iv e devices in a single- or multiple-device chain support in-system programming of a parallel flash using the jtag interface with the flash loader megafunction. the board intelligent host or download cable uses the four jtag pins on cyclone iv e devices to program the parallel flash in system, even if the host or download cable cannot access the configuration pins of the parallel flash. f for more information about using the jtag pins on cyclone iv e devices to program the parallel flash in-system, refer to an 478: using fpga-based parallel flash loader (pfl) with the quartus ii software . in the ap configuration scheme, the default configuration boot address is 0010000 when represented in 16-bit word addressing in the supported parallel flash memory ( figure 8?12 ). in the quartus ii software, the default configuration boot address is 0020000 because it is represented in 8-bit byte addressing. cyclone iv e devices configure from word address 0010000, which is equivalent to byte address 0020000. 1 the quartus ii software uses byte addressing for the default configuration boot address. you must set the start address field to 0020000 . the default configuration boot address allows the system to use special parameter blocks in the flash memory map. parameter blocks are at the top or bottom of the memory map. figure 8?12 shows the configuration boot address in the ap configuration scheme. you can change the default configuration default boot address 0010000 to any desired address using the apfc_boot_addr jtag instruction. for more information about the apfc_boot_addr jtag instruction, refer to ?jtag instructions? on page 8?56 . chapter 8: configuration and remote system upgrades in cyclone iv devices 8?31 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 ps configuration you can perform ps configuration on cyclone iv devices with an external intelligent host, such as a max ? ii device, microprocessor with flash memory, or a download cable. in the ps scheme, an external host controls the configuration. configuration data is clocked into the target cyclone iv device through data[0] at each rising edge of dclk . if your system already contains a common flash interface (cfi) flash memory, you can use it for cyclone iv device configuration storage as well. the max ii pfl feature provides an efficient method to program cfi flash memory devices through the jtag interface and the logic to control the configuration from the flash memory device to the cyclone iv device. f for more information about the pfl, refer to an 386: using the parallel flash loader with the quartus ii software . 1 cyclone iv devices do not support enhanced configuration devices for ps configuration. figure 8?12. configuration boot address in ap flash memory map note to figure 8?12 : (1) the default configuration boot address is x010000 when represented in 16-bit word addressing. other data/code config u ration data 12 8 -k b it parameter area cyclone iv e defa u lt boot address x010000 (1) x00ffff x000000 other data/code config u ration data other data/code cyclone iv e defa u lt boot address x010000 (1) x00ffff x000000 12 8 -k b it parameter area bottom parameter flash memory top parameter flash memory 16- b it w ord b it[15] b it[0] 16- b it w ord b it[15] b it[0] 8?32 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation ps configuration using an external host in the ps configuration scheme, you can use an intelligent host such as a max ii device or microprocessor that controls the transfer of configuration data from a storage device, such as flash memory, to the target cyclone iv device. you can store the configuration data in .rbf , .hex , or .ttf format. figure 8?13 shows the configuration interface connections between a cyclone iv device and an external host device for single-device configuration. to begin the configuration, the external host device must generate a low-to-high transition on the nconfig pin. when nstatus is pulled high, the external host device must place the configuration data one bit at a time on data[0] . if you use configuration data in .rbf , .ttf , or .hex , you must first send the lsb of each data byte. for example, if the .rbf contains the byte sequence 02 1b ee 01 fa, the serial bitstream you must send to the device is: 0100-0000 1101-1000 0111-0111 1000-0000 0101-1111 cyclone iv devices receive configuration data on data[0] and the clock is received on dclk . data is latched into the device on the rising edge of dclk . data is continuously clocked into the target device until conf_done goes high and the device enters initialization state. 1 two dclk falling edges are required after conf_done goes high to begin the initialization of the device. init_done is released and pulled high when initialization is complete. the external host device must be able to detect this low-to-high transition which signals the device has entered user mode. when initialization is complete, the device enters user mode. in user mode, the user i/o pins no longer have weak pull-up resistors and function as assigned in your design. figure 8?13. single-device ps configuration using an external host notes to figure 8?13 : (1) connect the pull-up resistor to a supply that provides an acceptable input signal for the device. v cc must be high enough to meet the v ih specification of the i/o on the device and the external host. (2) the nceo pin is left unconnected or used as a user i/o pin when it does not feed the nce pin of another device. (3) the msel pin settings vary for different configuration voltage standards and por time. to connect the msel pins, refer to table 8?3 on page 8?8 , table 8?4 on page 8?8 , and table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (4) all i/o inputs must maintain a maximum ac voltage of 4.1 v. data[0] and dclk must fit the maximum overshoot outlined in equation 8?1 on page 8?5 . external host (max ii device or microprocessor) memory addr nstatus conf_done nce nceo data[0] gnd v ccio (1) v ccio (1) msel[ ] n.c. (2) data[0] (4) nconfig dclk (4) (3) cyclone i v device 10 k 10 k chapter 8: configuration and remote system upgrades in cyclone iv devices 8?33 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 to e n su re dclk and data[0] are not left floating at the end of configuration, the max ii device must drive them either high or low, whichever is convenient on your board. the data[0] pin is available as a user i/o pin after configuration. in the ps scheme, the data[0] pin is tri-stated by default in user mode and must be driven by the external host device. to change this default option in the quartus ii software, select the dual-purpose pins tab of the device and pin options dialog box. the configuration clock ( dclk ) speed must be below the specified system frequency to ensure correct configuration. no maximum dclk period exists, which means you can pause configuration by halting dclk for an indefinite amount of time. the external host device can also monitor conf_done and init_done to ensure successful configuration. the conf_done pin must be monitored by the external device to detect errors and to determine when programming is complete. if all configuration data is sent, but conf_done or init_done has not gone high, the external device must reconfigure the target device. figure 8?14 shows how to configure multiple devices using an external host device. this circuit is similar to the ps configuration circuit for a single device, except that cyclone iv devices are cascaded for multi-device configuration. figure 8?14. multi-device ps configuration using an external host notes to figure 8?14 : (1) the pull-up resistor must be connected to a supply that provides an acceptable input signal for all devices in the chain. v cc must be high enough to meet the v ih specification of the i/o on the device and the external host. (2) connect the pull-up resistor to the v ccio supply voltage of the i/o bank in which the nce pin resides. (3) the nceo pin is left unconnected or used as a user i/o pin when it does not feed the nce pin of another device. (4) the msel pin settings vary for different configuration voltage standards and por time. to connect the msel pins, refer to table 8?3 on page 8?8 , table 8?4 on page 8?8 , and table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (5) all i/o inputs must maintain a maximum ac voltage of 4.1 v. data[0] and dclk must fit the maximum overshoot outlined in equation 8?1 on page 8?5 . external host (max ii de v ice or microprocessor) memory addr cyclone iv de v ice 1 nstatus co n f_do n e 10 k ? nce nceo data[0] g n d v ccio (1) v ccio (1) 10 k ? msel[ ] data[0] (5) nco n fig dclk (5) nstatus co n f_do n e nce nceo n .c. (3 ) data[0] (5) nco n fig dclk (5) v ccio (2) 10 k ? cyclone iv de v ice 2 (4) msel[ ] (4) buffers (5) 8?34 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation after the first device completes configuration in a multi-device configuration chain, its nceo pin drives low to activate the nce pin of the second device, which prompts the second device to begin configuration. the second device in the chain begins configuration in one clock cycle. therefore, the transfer of data destinations is transparent to the external host device. nconfig , nstatus , dclk , data[0] , and conf_done configuration pins are connected to every device in the chain. to ensure signal integrity and prevent clock skew problems, configuration signals may require buffering. ensure that dclk and data lines are buffered. all devices initialize and enter user mode at the same time because all conf_done pins are tied together. if any device detects an error, configuration stops for the entire chain and you must reconfigure the entire chain because all nstatus and conf_done pins are tied together. for example, if the first device flags an error on nstatus , it resets the chain by pulling its nstatus pin low. this behavior is similar to a single device detecting an error. you can have multiple devices that contain the same configuration data in your system. to support this configuration scheme, all device nce inputs are tied to gnd, while the nceo pins are left floating. nconfig , nstatus , dclk , data[0] , and conf_done configuration pins are connected to every device in the chain. to ensure signal integrity and prevent clock skew problems, configuration signals may require buffering. ensure that the dclk and data lines are buffered. devices must be of the same density and package. all devices start and complete configuration at the same time. figure 8?15 shows a multi-device ps configuration when both cyclone iv devices are receiving the same configuration data. figure 8?15. multi-device ps configuration when both devices receive the same data notes to figure 8?15 : (1) you must connect the pull-up resistor to a supply that provides an acceptable input signal for all devices in the chain. v cc must be high enough to meet the v ih specification of the i/o on the device and the external host. (2) the nceo pins of both devices are left unconnected or used as user i/o pins when configuring the same configuration data into multiple devices. (3) the msel pin settings vary for different configuration voltage standards and por time. to connect the msel pins, refer to table 8?3 on page 8?8 , table 8?4 on page 8?8 , and table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (4) all i/o inputs must maintain a maximum ac voltage of 4.1 v. data[0] and dclk must fit the maximum overshoot outlined in equation 8?1 on page 8?5 . external host (max ii de v ice or microprocessor) memory addr cyclone iv master de v ice nstatus co n f_do n e nce nceo data[0] g n d msel[ ] data[0] (4) nco n fig dclk (4) nstatus co n f_do n e nce nceo n .c. (2) data[0] (4) nco n fig dclk (4) cyclone iv sla v e de v ice n .c. (2) g n d (3) msel[ ] (3) buffers (4) 10 k ? v ccio (1) v ccio (1) 10 k ? chapter 8: configuration and remote system upgrades in cyclone iv devices 8?35 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 ps configuration timing a ps configuration must meet the setup and hold timing parameters and the maximum clock frequency. when using a microprocessor or another intelligent host to control the ps interface, ensure that you meet these timing requirements. figure 8?16 shows the timing waveform for ps configuration when using an external host device. ta b l e 8 ?1 0 lists the ps configuration timing parameters for cyclone iv devices. figure 8?16. ps configuration timing waveform (note 1) notes to figure 8?16 : (1) the beginning of this waveform shows the device in user mode. in user mode, nconfig , nstatus , and conf_done are at logic-high levels. when nconfig is pulled low, a reconfiguration cycle begins. (2) after power up, the cyclone iv device holds nstatus low during por delay. (3) after power up, before and during configuration, conf_done is low. (4) in user mode, drive dclk either high or low when using the ps configuration scheme, whichever is more convenient. when using the as configuration scheme, dclk is a cyclone iv device output pin and must not be driven externally. (5) do not leave the data[0] pin floating after configuration. drive the data[0] pin high or low, whichever is more convenient. nconfig nstatus (2) conf_done (3) dclk (4) data[0] user i/o init_done bit 0 bit 1 bit 2 bit 3 bit n t cd2um t cf2st1 t cf2cd t cfg t ch t cl t dh t dsu t cf2ck t status t clk t cf2st0 t st2ck user mode (5) tri-stated with internal pull-up resistor table 8?10. ps configuration timing parameters for cyclone iv devices (part 1 of 2) (note 1) symbol parameter minimum maximum unit cyclone iv (2) cyclone iv e (3) cyclone iv (2) cyclone iv e (3) t cf2cd nconfig low to conf_done low ? 500 ns t cf2st0 nconfig low to nstatus low ? 500 ns t cfg nconfig low pulse width 500 ? ns t status nstatus low pulse width 45 230 (4) s 8?36 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation ps configuration using a download cable in this section, the generic term ?download cable? includes the altera usb-blaster usb port download cable, masterblaster? serial and usb communications cable, byteblaster ii parallel port download cable, the byteblastermv ? parallel port download cable, and the ethernetblaster communications cable. in the ps configuration with a download cable, an intelligent host (such as a pc) transfers data from a storage device to the cyclone iv device through the download cable. t cf2st1 nconfig high to nstatus high ? 230 (5) s t cf2ck nconfig high to first rising edge on dclk 230 (4) ?s t st2ck nstatus high to first rising edge of dclk 2?s t dh data hold time after rising edge on dclk 0?ns t cd2um conf_done high to user mode (6) 300 650 s t cd2cu conf_done high to clkusr enabled 4 maximum dclk period ? ? t cd2umc conf_done high to user mode with clkusr option on t cd2cu + (3,192 clkusr period) ?? t dsu data setup time before rising edge on dclk 58??ns t ch dclk high time 3.2 6.4 ? ? ns t cl dclk low time 3.2 6.4 ? ? ns t clk dclk period 7.5 15 ? ? ns f max dclk frequency (7) ??13366mhz notes to table 8?10 : (1) this information is preliminary. (2) applicable for cyclone iv gx and cyclone iv e devices with 1.2-v core voltage. (3) applicable for cyclone iv e devices with 1.0-v core voltage. (4) this value is applicable if you do not delay configuration by extending the nconfig or nstatus low pulse width. (5) this value is applicable if you do not delay configuration by externally holding the nstatus low. (6) the minimum and maximum numbers apply only if you choose the internal oscillator as the clock source for starting the device . (7) cyclone iv e devices with 1.0-v core voltage have slower f max when compared with cyclone iv gx devices with 1.2-v core voltage. table 8?10. ps configuration timing parameters for cyclone iv devices (part 2 of 2) (note 1) symbol parameter minimum maximum unit cyclone iv (2) cyclone iv e (3) cyclone iv (2) cyclone iv e (3) chapter 8: configuration and remote system upgrades in cyclone iv devices 8?37 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 the programming hardware or download cable then places the configuration data one bit at a time on the data[0] pin of the device. the configuration data is clocked into the target device until conf_done goes high. the conf_done pin must have an external 10-k ? pull-up resistor for the device to initialize. when you use a download cable, setting the auto-restart configuration after error option does not affect the configuration cycle because you must manually restart configuration in the quartus ii software if an error occurs. additionally, the enable user-supplied start-up clock (clkusr) option has no effect on device initialization, because this option is disabled in the .sof when programming the device with the quartus ii programmer and download cable. therefore, if you turn on the clkusr option, you do not have to provide a clock on clkusr when you configure the device with the quartus ii programmer and a download cable. figure 8?17 shows ps configuration for cyclone iv devices with a download cable. figure 8?17. ps configuration using a download cable notes to figure 8?17 : (1) you must connect the pull-up resistor to the same supply voltage as the v cca supply. (2) the pull-up resistors on data[0] and dclk are only required if the download cable is the only configuration scheme used on your board. this is to ensure that data[0] and dclk are not left floating after configuration. for example, if you also use a configuration device, the pull-up resistors on data[0] and dclk are not required. (3) pin 6 of the header is a v io reference voltage for the masterblaster output driver. v io must match the v cca of the device. for this value, refer to the masterblaster s erial/u s b communications cable user guide . with the usb-blaster, byteblaster ii, byteblaster mv, and ethernetblaster, this pin is a no connect. (4) the nceo pin is left unconnected or used as a user i/o pin when it does not feed the nce pin of another device. (5) the msel pin settings vary for different configuration voltage standards and por time. to connect the msel pins, refer to table 8?3 on page 8?8 , table 8?4 on page 8?8 , and table 8?5 on page 8?9 for ps configuration schemes. connect the msel pins directly to v cca or gnd. (6) power up the v cc of the byteblaster ii, usb-blaster, or byteblastermv cable with a 2.5-v supply from v cca . third-party programmers must switch to 2.5 v. pin 4 of the header is a v cc power supply for the masterblaster cable. the masterblaster cable can receive power from either 5.0- or 3.3-v circuit boards, dc power supply, or 5.0 v from the usb cable. for this value, refer to the masterblaster s erial/u s b communications cable user guide . msel[ ] (5) nconfig conf_done v cca (1) v cca (6) shield gnd v cca (1) gnd v cca (1) 10 k 10 k v cca (1) 10 k 10 k nstatus pin 1 dow n load cable 10-pi n male heade r (top view) gnd v io (3) cyclone i v device nceo dclk data[0] nce v cca (1) n.c. (4) (2) (2) 10 k 8?38 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation you can use a download cable to configure multiple cyclone iv device configuration pins. nconfig , nstatus , dclk , data[0] , and conf_done are connected to every device in the chain. all devices in the chain utilize and enter user mode at the same time because all conf_done pins are tied together. in addition, the entire chain halts configuration if any device detects an error because the nstatus pins are tied together. figure 8?18 shows the ps configuration for multiple cyclone iv devices using a masterblaster, usb-blaster, byteblaster ii, or byteblastermv cable. figure 8?18. multi-device ps configuration using a download cable notes to figure 8?18 : (1) you must connect the pull-up resistor to the same supply voltage as the v cca supply. (2) the pull-up resistors on data[0] and dclk are only required if the download cable is the only configuration scheme used on your board. this ensures that data[0 ] and dclk are not left floating after configuration. for example, if you also use a configuration device, the pull-up resistors on data[0] and dclk are not required. (3) pin 6 of the header is a v io reference voltage for the masterblaster output driver. v io must match the v cca of the device. for this value, refer to the masterblaster s erial/u s b communications cable user guide . when using the byteblastermv download cable, this pin is a no connect. when using usb-blaster, byteblaster ii, and ethernetblaster cables, this pin is connected to nce when it is used for as programming. otherwise, it is a no connect. (4) connect the pull-up resistor to the v ccio supply voltage of the i/o bank in which the nce pin resides. (5) the nceo pin of the last device in the chain is left unconnected or used as a user i/o pin. (6) the msel pin settings vary for different configuration voltage standards and por time. to connect msel for ps configuration schemes, refer to table 8?3 on page 8?8 , table 8?4 on page 8?8 , and table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (7) power up the v cc of the byteblaster ii, usb-blaster, or byteblastermv cable with a 2.5 v supply from v cca . third-party programmers must switch to 2.5 v. pin 4 of the header is a v cc power supply for the masterblaster cable. the masterblaster cable can receive power from either 5.0- or 3.3-v circuit boards, dc power supply, or 5.0 v from the usb cable. for this value, refer to the masterblaster s erial/u s b communications cable user guide . cyclone i v device 1 cyclone i v device 2 msel[ ] (6) nce nconfig conf_done dclk nce nceo nconfig conf_done dclk nceo gnd (pa ss ive se r ial mode) v cca (7) v cca (1) gnd v cca (1) v cca (1) nstatus nstatus data[0] data[0] msel[ ] (6) pi n 1 dow n load cable 10-pi n male heade r n.c. (5) v io (3 ) gnd v cca (1) (2) v cca (1) (2) v ccio (4) 10 k 10 k 10 k 10 k 10 k 10 k chapter 8: configuration and remote system upgrades in cyclone iv devices 8?39 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 fpp configuration the fpp configuration in cyclone iv devices is designed to meet the increasing demand for faster configuration time. cyclone iv devices are designed with the capability of receiving byte-wide configuration data per clock cycle. you can perform fpp configuration of cyclone iv devices with an intelligent host, such as a max ii device or microprocessor with flash memory. if your system already contains a cfi flash memory, you can use it for the cyclone iv device configuration storage as well. the max ii pfl feature in max ii devices provides an efficient method to program cfi flash memory devices through the jtag interface and the logic to control configuration from the flash memory device to the cyclone iv device. f for more information about the pfl, refer to an 386: using the parallel flash loader with the quartus ii software . 1 fpp configuration is supported in ep4cgx30 (only for f484 package), ep4cgx50, ep4cgx75, ep4cgx110, ep4cgx150, and all cyclone iv e devices. 1 the fpp configuration is not supported in e144 package of cyclone iv e devices. 1 cyclone iv devices do not support enhanced configuration devices for fpp configuration. fpp configuration using an external host fpp configuration using an external host provides a fast method to configure cyclone iv devices. in the fpp configuration scheme, you can use an external host device to control the transfer of configuration data from a storage device, such as flash memory, to the target cyclone iv device. you can store configuration data in an .rbf , .hex , or .ttf format. when using the external host, a design that controls the configuration process, such as fetching the data from flash memory and sending it to the device, must be stored in the external host device. figure 8?19 shows the configuration interface connections between the cyclone iv devices and an external device for single-device configuration. 8?40 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation after nstatus is released, the device is ready to receive configuration data and the configuration stage begins. when nstatus is pulled high, the external host device places the configuration data one byte at a time on the data[7..0] pins. cyclone iv devices receive configuration data on the data[7..0] pins and the clock is received on the dclk pin. data is latched into the device on the rising edge of dclk . data is continuously clocked into the target device until conf_done goes high. the conf_done pin goes high one byte early in fpp configuration mode. the last byte is required for serial configuration (as and ps) modes. 1 two dclk falling edges are required after conf_done goes high to begin initialization of the device. supplying a clock on clkusr does not affect the configuration process. after the conf_done pin goes high, clkusr is enabled after the time specified as t cd2cu . after this time period elapses, cyclone iv devices require 3,192 clock cycles to initialize properly and enter user mode. for more information about the supported clkusr f max value for cyclone iv devices, refer to table 8?11 on page 8?43 . the init_done pin is released and pulled high when initialization is complete. the external host device must be able to detect this low-to-high transition, which signals the device has entered user mode. when initialization is complete, the device enters user mode. in user mode, the user i/o pins no longer have weak pull-up resistors and function as assigned in your design. to e n s u re t h a t dclk and data[0] are not left floating at the end of the configuration, the max ii device must drive them either high or low, whichever is convenient on your board. the data[0] pin is available as a user i/o pin after configuration. when you choose the fpp scheme in the quartus ii software, the data[0] pin is tri-stated by default in user mode and must be driven by the external host device. to change this default option in the quartus ii software, select the dual-purpose pins tab of the device and pin options dialog box. figure 8?19. single-device fpp configuration using an external host notes to figure 8?19 : (1) connect the pull-up resistor to a supply that provides an acceptable input signal for the device. v cc must be high enough to meet the v ih specification of the i/o on the device and the external host. (2) the nceo pin is left unconnected or used as a user i/o pin when it does not feed the nce pin of another device. (3) the msel pin settings vary for different configuration voltage standards and por time. to connect the msel pins, refer to table 8?4 on page 8?8 and table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (4) all i/o inputs must maintain a maximum ac voltage of 4.1 v. data[7..0] and dclk must fit the maximum overshoot outlined in equation 8?1 on page 8?5 . external host (max ii de v ice or microprocessor) memory addr cyclone iv de v ice nstatus co n f_do n e 10 k ? nce nceo data[7..0] g n d v ccio (1) v ccio (1) 10 k ? msel[3..0] n .c. (2) data[7..0] (4) nco n fig dclk (4) (3) chapter 8: configuration and remote system upgrades in cyclone iv devices 8?41 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 the dclk speed must be below the specified system frequency to ensure correct configuration. no maximum dclk period exists, which means you can pause configuration by halting dclk for an indefinite amount of time. the external host device can also monitor the conf_done and init_done pins to ensure successful configuration. the conf_done pin must be monitored by the external device to detect errors and to determine when programming is complete. if all configuration data is sent, but conf_done or init_done has not gone high, the external device must reconfigure the target device. figure 8?20 shows how to configure multiple devices with a max ii device. this circuit is similar to the fpp configuration circuit for a single device, except the cyclone iv devices are cascaded for multi-device configuration. after the first device completes configuration in a multi-device configuration chain, its nceo pin drives low to activate the nce pin of the second device, which prompts the second device to begin configuration. the second device in the chain begins configuration in one clock cycle; therefore, the transfer of data destinations is transparent to the max ii device. all other configuration pins ( nconfig , nstatus , dclk , data[7..0] , and conf_done ) are connected to every device in the chain. configuration signals may require buffering to ensure signal integrity and prevent clock skew problems. ensure that the dclk and data lines are buffered. all devices initialize and enter user mode at the same time, because all device conf_done pins are tied together. all nstatus and conf_done pins are tied together and if any device detects an error, configuration stops for the entire chain and the entire chain must be reconfigured. for example, if the first device flags an error on nstatus , it resets the chain by pulling its nstatus pin low. this behavior is similar to a single device detecting an error. figure 8?20. multi-device fpp configuration using an external host notes to figure 8?20 : (1) the pull-up resistor must be connected to a supply that provides an acceptable input signal for all devices in the chain. v cc must be high enough to meet the v ih specification of the i/o on the device and the external host. (2) connect the pull-up resistor to the v ccio supply voltage of the i/o bank in which the nce pin resides. (3) the nceo pin is left unconnected or used as a user i/o pin when it does not feed the nce pin of another device. (4) the msel pin settings vary for different configuration voltage standards and por time. to connect the msel pins, refer to table 8?4 on page 8?8 and table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (5) all i/o inputs must maintain a maximum ac voltage of 4.1 v. data[7..0] and dclk must fit the maximum overshoot outlined in equation 8?1 on page 8?5 . external host (max ii de v ice or microprocessor) memory addr cyclone iv de v ice 1 nstatus co n f_do n e 10 k ? nce nceo data[7..0] g n d v ccio (1) v ccio (1) 10 k ? msel[3..0] data[7..0] (5) nco n fig dclk (5) nstatus co n f_do n e nce nceo n .c. (3 ) data[7..0] (5) nco n fig dclk (5) v ccio (2) 10 k ? cyclone iv de v ice 2 (4) (4) buffers (5) msel[3..0] 8?42 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation figure 8?21 shows multi-device fpp configuration when both cyclone iv devices are receiving the same configuration data. configuration pins ( nconfig , nstatus , dclk , data[7..0] , and conf_done ) are connected to every device in the chain. configuration signals may require buffering to ensure signal integrity and prevent clock skew problems. ensure that the dclk and data lines are buffered. devices must be of the same density and package. all devices start and complete configuration at the same time. you can use a single configuration chain to configure cyclone iv devices with other altera devices that support fpp configuration. to ensure that all devices in the chain complete configuration at the same time or that an error flagged by one device starts reconfiguration in all devices, tie all the conf_done and nstatus pins together. f for more information about configuring multiple altera devices in the same configuration chain, refer to configuring mixed altera fpga chains in volume 2 of the configuration handbook . figure 8?21. multi-device fpp configuration using an external host when both devices receive the same data notes to figure 8?21 : (1) you must connect the pull-up resistor to a supply that provides an acceptable input signal for all devices in the chain. v cc must be high enough to meet the v ih specification of the i/o on the device and the external host. (2) the nceo pins of both devices are left unconnected or used as user i/o pins when configuring the same configuration data into multiple devices. (3) the msel pin settings vary for different configuration voltage standards and por time. to connect the msel pins, refer to table 8?4 on page 8?8 and table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (4) all i/o inputs must maintain a maximum ac voltage of 4.1 v. data[7..0] and dclk must fit the maximum overshoot outlined in equation 8?1 on page 8?5 . external host (max ii de v ice or microprocessor) memory addr cyclone iv de v ice 1 nstatus co n f_do n e nce nceo data[7..0] g n d v ccio (1) v ccio (1) msel[3..0] msel[3..0] data[7..0] (4) nco n fig dclk (4) nstatus co n f_do n e nce nceo n .c. (2) data[7..0] (4) nco n fig dclk (4) cyclone iv de v ice 2 (3) (3) g n d n .c. (2) buffers (4) 10 k ? 10 k ? chapter 8: configuration and remote system upgrades in cyclone iv devices 8?43 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 fpp configuration timing figure 8?22 shows the timing waveform for the fpp configuration when using an external host. ta b l e 8 ?11 lists the fpp configuration timing parameters for cyclone iv devices. figure 8?22. fpp configuration timing waveform (note 1) notes to figure 8?22 : (1) the beginning of this waveform shows the device in user mode. in user mode, nconfig , nstatus , and conf_done are at logic-high levels. when nconfig is pulled low, a reconfiguration cycle begins. (2) after power up, the cyclone iv device holds nstatus low during por delay. (3) after power up, before and during configuration, conf_done is low. (4) do not leave dclk floating after configuration. it must be driven high or low, whichever is more convenient. (5) data[7..0] is available as a user i/o pin after configuration; the state of the pin depends on the dual-purpose pin settings. nconfig nstatus (2) conf_done (3) dclk data[7..0] user i/o init_done byte 0 byte 1 byte 2 byte 3 byte n-1 t cd2um t cf2st1 t cf2cd t cfg t ch t cl t dh t dsu t cf2ck t status t clk t cf2st0 t st2ck user mode (5) tri-stated with internal pull-up resistor (4) user mode byte n table 8?11. fpp timing parameters for cyclone iv devices (part 1 of 2) (note 1) symbol parameter minimum maximum unit cyclone iv (2) cyclone iv e (3) cyclone iv (2) cyclone iv e (3) t cf2cd nconfig low to conf_done low ? 500 ns t cf2st0 nconfig low to nstatus low ? 500 ns t cfg nconfig low pulse width 500 ? ns t status nstatus low pulse width 45 230 (4) s t cf2st1 nconfig high to nstatus high ? 230 (5) s t cf2ck nconfig high to first rising edge on dclk 230 (4) ?s 8?44 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation jtag configuration jtag has developed a specification for boundary-scan testing (bst). the bst architecture offers the capability to efficiently test components on pcbs with tight lead spacing. the bst architecture can test pin connections without using physical test probes and capture functional data while a device is normally operating. you can also use the jtag circuitry to shift configuration data into the device. the quartus ii software automatically generates .sof for jtag configuration with a download cable in the quartus ii software programmer. t st2ck nstatus high to first rising edge of dclk 2?s t dh data hold time after rising edge on dclk 0?ns t cd2um conf_done high to user mode (6) 300 650 s t cd2cu conf_done high to clkusr enabled 4 maximum dclk period ? ? t cd2umc conf_done high to user mode with clkusr option on t cd2cu + (3,192 clkusr period) ?? t dsu data setup time before rising edge on dclk 58??ns t ch dclk high time 3.2 6.4 ? ? ns t cl dclk low time 3.2 6.4 ? ? ns t clk dclk period 7.5 15 ? ? ns f max dclk frequency (7) ? ? 133 66 mhz notes to table 8?11 : (1) this information is preliminary. (2) applicable for cyclone iv gx and cyclone iv e with 1.2-v core voltage. (3) applicable for cyclone iv e with 1.0-v core voltage. (4) this value is applicable if you do not delay configuration by extending the nconfig or nstatus low pulse width. (5) this value is applicable if you do not delay configuration by externally holding the nstatus low. (6) the minimum and maximum numbers apply only if you choose the internal oscillator as the clock source for starting the device . (7) cyclone iv e devices with 1.0-v core voltage have slower f max when compared with cyclone iv gx devices with 1.2-v core voltage. table 8?11. fpp timing parameters for cyclone iv devices (part 2 of 2) (note 1) symbol parameter minimum maximum unit cyclone iv (2) cyclone iv e (3) cyclone iv (2) cyclone iv e (3) chapter 8: configuration and remote system upgrades in cyclone iv devices 8?45 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 f for more information about the jtag boundary-scan testing, refer to the jtag boundary-scan testing for cyclone iv devices chapter. jtag instructions have precedence over any other configuration modes. therefore, jtag configuration can take place without waiting for other configuration modes to complete. for example, if you attempt jtag configuration in cyclone iv devices during ps configuration, ps configuration terminates and jtag configuration begins. if the msel pins are set to as mode, the cyclone iv device does not output a dclk signal when jtag configuration takes place. the four required pins for a device operating in jtag mode are tdi , tdo , tms , and tck . all the jtag input pins are powered by the v ccio pin and support the lvttl i/o standard only. all user i/o pins are tri-stated during jtag configuration. ta b l e 8 ?1 2 explains the function of each jtag pin. you can download data to the device through the usb-blaster, masterblaster, byteblaster ii, or byteblastermv download cable, or the ethernetblaster communications cable during jtag configuration. configuring devices with a cable is similar to programming devices in-system. figure 8?23 and figure 8?24 show the jtag configuration of a single cyclone iv device. for device using v ccio of 2.5, 3.0, and 3.3 v, refer to figure 8?23 . all i/o inputs must maintain a maximum ac voltage of 4.1 v because jtag pins do not have the internal pci clamping diodes to prevent voltage overshoot when using v ccio of 2.5, 3.0, and 3.3 v. you must power up the v cc of the download cable with a 2.5-v supply from v cca . for device using v ccio of 1.2, 1.5, and 1.8 v, refer to figure 8?24 . you can power up the v cc of the download cable with the supply from v ccio . table 8?12. dedicated jtag pins pin name pin type description tdi test data input serial input pin for instructions as well as test and programming data. data shifts in on the rising edge of tck . if the jtag interface is not required on the board, the jtag circuitry is disabled by connecting this pin to v cc . tdi pin has weak internal pull-up resistors (typically 25 k ? ). tdo test data output serial data output pin for instructions as well as test and programming data. data shifts out on the falling edge of tck . the pin is tri-stated if data is not being shifted out of the device. if the jtag interface is not required on the board, the jtag circuitry is disabled by leaving this pin unconnected. tms test mode select input pin that provides the control signal to determine the transitions of the tap controller state machine. transitions in the state machine occur on the rising edge of tck . therefore, tms must be set up before the rising edge of tck . tms is evaluated on the rising edge of tck . if the jtag interface is not required on the board, the jtag circuitry is disabled by connecting this pin to v cc . tms pin has weak internal pull-up resistors (typically 25 k ? ). tck test clock input the clock input to the bst circuitry. some operations occur at the rising edge, while others occur at the falling edge. if the jtag interface is not required on the board, the jtag circuitry is disabled by connecting this pin to gnd. the tck pin has an internal weak pull-down resistor. 8?46 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation figure 8?23. jtag configuration of a single device using a download cable (2.5, 3.0, and 3.3-v v ccio powering the jtag pins) notes to figure 8?23 : (1) connect these pull-up resistors to the v ccio supply of the bank in which the pin resides. (2) connect the nconfig and msel pins to support a non-jtag configuration scheme. if you only use jtag configuration, connect the nconfig pin to logic-high and the msel pins to gnd. in addition, pull dclk and data[0] to either high or low, whichever is convenient on your board. (3) pin 6 of the header is a v io reference voltage for the masterblaster output driver. v io must match the device?s v cca . for this value, refer to the masterblaster s erial/u s b communications cable user guide . when using the usb-blaster, byteblaster ii, byteblastermv, and ethernetblaster cables, this pin is a no connect. (4) the nce pin must be connected to gnd or driven low for successful jtag configuration. (5) the nceo pin is left unconnected or used as a user i/o pin when it does not feed the nce pin of another device. (6) power up the v cc of the ethernetblaster, byteblaster ii, usb-blaster, or byteblastermv cable with a 2.5-v supply from v cca . third-party programmers must switch to 2.5 v. pin 4 of the header is a v cc power supply for the masterblaster cable. the masterblaster cable can receive power from either 5.0- or 3.3-v circuit boards, dc power supply, or 5.0 v from the usb cable. for this value, refer to the masterblaster s erial/u s b communications cable user guide . (7) resistor value can vary from 1 k ? to 10 k ? .. nce (4) msel[ ] nconfig conf_done v cca v cca (6) gnd v ccio (1) gnd v ccio (1) (2) v cca 10 k 10 k (7) nstatus pi n 1 dow n load cable 10-pi n male heade r (top view) gnd tck tdo tms tdi gnd v io (3) cyclone i v device nceo n.c. (5) dclk data[0] (2) (2) (2) (7) 1 k chapter 8: configuration and remote system upgrades in cyclone iv devices 8?47 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 to configure a single device in a jtag chain, the programming software places all other devices in bypass mode. in bypass mode, devices pass programming data from the tdi pin to the tdo pin through a single bypass register without being affected internally. this scheme enables the programming software to program or verify the target device. configuration data driven into the device appears on the tdo pin one clock cycle later. the quartus ii software verifies successful jtag configuration after completion. at the end of configuration, the software checks the state of conf_done through the jtag port. when quartus ii generates a .jam for a multi-device chain, it contains instructions so that all the devices in the chain are initialized at the same time. if conf_done is not high, the quartus ii software indicates that configuration has failed. if conf_done is high, the software indicates that configuration was successful. after the configuration bitstream is serially sent using the jtag tdi port, the tck port clocks an additional clock cycles to perform device initialization. figure 8?24. jtag configuration of a single device using a download cable (1.5-v or 1.8-v v ccio powering the jtag pins) notes to figure 8?24 : (1) connect these pull-up resistors to the v ccio supply of the bank in which the pin resides. (2) connect the nconfig and msel pins to support a non-jtag configuration scheme. if you only use jtag configuration, connect the nconfig pin to logic-high and the msel pins to gnd. in addition, pull dclk and data[0] to either high or low, whichever is convenient on your board. (3) in the usb-blaster and byteblaster ii cables, this pin is connected to nce when it is used for as programming; otherwise it is a no connect. (4) the nce must be connected to gnd or driven low for successful jtag configuration. (5) the nceo pin is left unconnected or used as a user i/o pin when it does not feed the nce pin of another device. (6) power up the v cc of the ethernetblaster, byteblaster ii or usb-blaster cable with supply from v ccio . the ethernet-blaster, byteblaster ii, and usb-blaster cables do not support a target supply voltage of 1.2 v. for the target supply voltage value, refer to the byteblaster ii download cable user guide , the u s b-blaster download cable user guide , and the ethernetblaster communications cable user guide . (7) resistor value can vary from 1 k ? to 10 k ? .. nce (4) msel[ ] nconfig conf_done v ccio v ccio (6) gnd v ccio (1) gnd v ccio (1) (2) v ccio 10 k 10 k (7) (7) nstatus pi n 1 dow n load cable 10-pi n male heade r (top view) gnd tck tdo tms tdi gnd v io (3) cyclone i v device nceo n.c. (5) dclk data[0] (2) (2) (2) 1 k 8?48 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation you can perform jtag testing on cyclone iv devices before, during, and after configuration. cyclone iv devices support the bypass , idcode , and sample instructions during configuration without interrupting configuration. all other jtag instructions can only be issued by first interrupting configuration and reprogramming i/o pins with the active_disengage and config_io instructions. the config_io instruction allows you to configure the i/o buffers through the jtag port and interrupts configuration when issued after the active_disengage instruction. this instruction allows you to perform board-level testing prior to configuring the cyclone iv device or waiting for a configuration device to complete configuration. prior to issuing the config_io instruction, you must issue the active_disengage instruction. this is because in cyclone iv devices, the config_io instruction does not hold nstatus low until reconfiguration, so you must disengage the active configuration mode controller when active configuration is interrupted. the active_disengage instruction places the active configuration mode controllers in an idle state prior to jtag programming. additionally, the active_engage instruction allows you to re-engage a disengaged active configuration mode controller. 1 you must follow a specific flow when executing the active_disengage , config_io , and active_engage jtag instructions in cyclone iv devices. the chip-wide reset ( dev_clrn ) and chip-wide output enable ( dev_oe ) pins in cyclone iv devices do not affect jtag boundary-scan or programming operations. toggling these pins do not affect jtag operations (other than the usual boundary-scan operation). when designing a board for jtag configuration of cyclone iv devices, consider the dedicated configuration pins. table 8?13 describes how you must connect these pins during jtag configuration. table 8?13. dedicated configuration pin connections during jtag configuration signal description nce on all cyclone iv devices in the chain, nce must be driven low by connecting it to gnd, pulling it low through a resistor, or driving it by some control circuitry. for devices that are also in multi-device as, ap, ps, or fpp configuration chains, you must connect the nce pins to gnd during jtag configuration or jtag configured in the same order as the configuration chain. nceo on all cyclone iv devices in the chain, nceo is left floating or connected to the nce of the next device. msel these pins must not be left floating. these pins support whichever non-jtag configuration that you used in production. if you only use jtag configuration, tie these pins to gnd. nconfig driven high by connecting to the v ccio supply of the bank in which the pin resides and pulling up through a resistor or driven high by some control circuitry. nstatus pull to the v ccio supply of the bank in which the pin resides through a 10-k ? resistor. when configuring multiple devices in the same jtag chain, each nstatus pin must be pulled up to the v ccio individually. conf_done pull to the v ccio supply of the bank in which the pin resides through a 10-k ? resistor. when configuring multiple devices in the same jtag chain, each conf_done pin must be pulled up to v ccio supply of the bank in which the pin resides individually. conf_done going high at the end of jtag configuration indicates successful configuration. dclk must not be left floating. drive low or high, whichever is more convenient on your board. chapter 8: configuration and remote system upgrades in cyclone iv devices 8?49 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 when programming a jtag device chain, one jtag-compatible header is connected to several devices. the number of devices in the jtag chain is limited only by the drive capability of the download cable. when four or more devices are connected in a jtag chain, altera recommends buffering the tck , tdi , and tms pins with an on-board buffer. jtag-chain device programming is ideal when the system contains multiple devices, or when testing your system with jtag bst circuitry. figure 8?25 and figure 8?26 show multi-device jtag configuration. for devices using 2.5-, 3.0-, and 3.3-v v ccio supply, you must refer to figure 8?25 . all i/o inputs must maintain a maximum ac voltage of 4.1 v because jtag pins do not have the internal pci clamping diodes to prevent voltage overshoot when using 2.5-, 3.0-, and 3.3- v v ccio supply. you must power up the v cc of the download cable with a 2.5-v v cca supply. for device using v ccio of 1.2, 1.5 v, and 1.8 v, refer to figure 8?26 . you can power up the v cc of the download cable with the supply from v ccio . figure 8?25. jtag configuration of multiple devices using a download cable (2.5, 3.0, and 3.3-v v ccio powering the jtag pins) notes to figure 8?25 : (1) connect these pull-up resistors to the v ccio supply of the bank in which the pin resides. (2) connect the nconfig and msel pins to support a non-jtag configuration scheme. if you only use a jtag configuration, connect the nconfig pin to logic-high and the msel pins to gnd. in addition, pull dclk and data[0] to either high or low, whichever is convenient on your board. (3) pin 6 of the header is a v io reference voltage for the masterblaster output driver. v io must match the v cca of the device. for this value, refer to the masterblaster s erial/u s b communications cable user guide . in the byteblastermv cable, this pin is a no connect. in the usb-blaster and byteblaster ii cables, this pin is connected to nce when it is used for as programming, otherwise it is a no connect. (4) you must connect the nce pin to gnd or driven low for successful jtag configuration. (5) power up the v cc of the byteblaster ii, usb-blaster, or byteblastermv cable with a 2.5-v supply from v cca . third-party programmers must switch to 2.5 v. pin 4 of the header is a v cc power supply for the masterblaster cable. the masterblaster cable can receive power from either 5.0- or 3.3-v circuit boards, dc power supply, or 5.0 v from the usb cable. for this value, refer to the masterblaster s erial/u s b communications cable user guide . (6) resistor value can vary from 1 k ? to 10 k ? .. tms tck dow n load cable 10-pi n male heade r tdi tdo pi n 1 nst a tus nconfig nce (4) conf_done v ccio (2) (2) v io (3) (6) (6) (1) (1) (2) data[0] dclk (2) msel[ ] nceo (2) tms tck tdi tdo nst a tus nconfig nce (4) conf_done (2) (2) (1) (2) data[0] dclk (2) nceo (2) (1) tms tck tdi tdo nst a tus nconfig nce (4) v ccio v ccio v ccio v ccio v cca v cca conf_done (2) (2) (2) data[0] dclk (2) nceo (2) (1) (1) 10 k 10 k 10 k 10 k 10 k 10 k cyclone iv device cyclone iv device cyclone iv device v ccio (5) msel[ ] msel[ ] v cca 1 k 8?50 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation 1 if a non-cyclone iv device is cascaded in the jtag-chain, tdo of the non-cyclone iv device driving into tdi of the cyclone iv device must fit the maximum overshoot outlined in equation 8?1 on page 8?5 . the conf_done and nstatus signals are shared in multi-device as, ap, ps, and fpp configuration chains to ensure that the devices enter user mode at the same time after configuration is complete. when the conf_done and nstatus signals are shared among all the devices, you must configure every device when jtag configuration is performed. if you only use jtag configuration, altera recommends that you connect the circuitry as shown in figure 8?25 or figure 8?26 , in which each of the conf_done and nstatus signals are isolated so that each device can enter user mode individually. after the first device completes configuration in a multi-device configuration chain, its nceo pin drives low to activate the nce pin of the second device, which prompts the second device to begin configuration. therefore, if these devices are also in a jtag chain, ensure that the nce pins are connected to gnd during jtag configuration or that the devices are jtag configured in the same order as the configuration chain. as long as the devices are jtag configured in the same order as the multi-device configuration chain, the nceo of the previous device drives the nce pin of the next device low when it has successfully been jtag configured. you can place other altera devices that have jtag support in the same jtag chain for device programming and configuration. figure 8?26. jtag configuration of multiple devices using a download cable (1.2, 1.5, and 1.8-v v ccio powering the jtag pins) notes to figure 8?26 : (1) connect these pull-up resistors to the v ccio supply of the bank in which the pin resides. (2) connect the nconfig and msel pins to support a non-jtag configuration scheme. if you only use a jtag configuration, connect the nconfig pin to logic-high and the msel pins to gnd. in addition, pull dclk and data[0] to either high or low, whichever is convenient on your board. (3) in the usb-blaster and byteblaster ii cable, this pin is connected to nce when it is used for as programming, otherwise it is a no connect. (4) you must connect the nce pin to gnd or driven low for successful jtag configuration. (5) power up the v cc of the byteblaster ii or usb-blaster cable with supply from v ccio . the byteblaster ii and usb-blaster cables do not support a target supply voltage of 1.2 v. for the target supply voltage value, refer to the byteblaster ii download cable user guide and the u s b-blaster download cable user guide . (6) resistor value can vary from 1 k ? to 10 k ? .. tms tck dow n load cable 10-pi n male heade r tdi tdo v ccio (5) pi n 1 nst a tus nconfig nce (4) conf_done (2) (2) v io (3) (6) (6) (1) (1) (2) data[0] dclk (2) msel[ ] nceo (2) tms tck tdi tdo nst a tus nconfig nce (4) conf_done (2) (2) (1) (2) data[0] dclk (2) nceo (2) (1) tms tck tdi tdo nst a tus nconfig nce (4) conf_done v ccio v ccio v ccio v ccio v ccio v ccio v ccio v ccio (2) (2) (2) data[0] dclk (2) nceo (2) (1) (1) 10 k 10 k 10 k 10 k 10 k 10 k cyclone iv device cyclone iv device cyclone iv device msel[ ] msel[ ] 1 k chapter 8: configuration and remote system upgrades in cyclone iv devices 8?51 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 1 jtag configuration allows an unlimited number of cyclone iv devices to be cascaded in a jtag chain. f for more information about configuring multiple altera devices in the same configuration chain, refer to the configuring mixed altera fpga chains chapter in volume 2 of the configuration handbook . figure 8?27 shows jtag configuration with a cyclone iv device and a microprocessor. configuring cyclone iv devices with jam stapl jam ? stapl, jedec standard jesd-71, is a standard file format for in-system programmability (isp) purposes. jam stapl supports programming or configuration of programmable devices and testing of electronic systems, using the ieee 1149.1 jtag interface. jam stapl is a freely licensed open standard. the jam player provides an interface for manipulating the ieee std. 1149.1 jtag tap state machine. f for more information about jtag and jam stapl in embedded environments, refer to an 425: using command-line jam stapl solution for device programming . to download the jam player, visit the altera website ( www.altera.com ). figure 8?27. jtag configuration of a single device using a microprocessor notes to figure 8?27 : (1) you must connect the pull-up resistor to a supply that provides an acceptable input signal for all devices in the chain. (2) connect the nconfig and msel pins to support a non-jtag configuration scheme. if you only use a jtag configuration, connect the nconfig pin to logic-high and the msel pins to gnd. in addition, pull dclk and data[0] to either high or low, whichever is convenient on your board. (3) you must connect the nce pin to gnd or driven low for successful jtag configuration. (4) all i/o inputs must maintain a maximum ac voltage of 4.1 v. signals driving into tdi , tms , and tck must fit the maximum overshoot outlined in equation 8?1 on page 8?5 . nconfig data[0] dclk tdi (4) tck (4) tms (4) microprocessor memory addr tdo cyclone i v device nstatus conf_done v ccio v ccio 10 k 10 k (2) (2) n.c. (2) (2) (1) (1) (3) msel[ ] nce nceo data 8?52 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation configuring cyclone iv devices with the jrunner software driver the jrunner software driver allows you to configure cyclone iv devices through the byteblaster ii or byteblastermv cables in jtag mode. the supported programming input file is in .rbf format. the jrunner software driver also requires a chain description file ( .cdf ) generated by the quartus ii software. the jrunner software driver is targeted for embedded jtag configuration. the source code is developed for the windows nt operating system (os). you can customize the code to make it run on your embedded platform. 1 the .rbf used by the jrunner software driver cannot be a compressed .rbf because the jrunner software driver uses jtag-based configuration. during jtag-based configuration, the real-time decompression feature is not available. f for more information about the jrunner software driver, refer to an 414: jrunner software driver: an embedded solution for pld jtag configuration and the source files on the altera website at ( www.altera.com ). combining jtag and as configuration schemes you can combine the as configuration scheme with the jtag-based configuration ( figure 8?28 ). this setup uses two 10-pin download cable headers on the board. one download cable is used in jtag mode to configure the cyclone iv device directly through the jtag interface. the other download cable is used in as mode to program the serial configuration device in-system through the as programming interface. if you try configuring the device using both schemes simultaneously, jtag configuration takes precedence and as configuration terminates. chapter 8: configuration and remote system upgrades in cyclone iv devices 8?53 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 figure 8?28. combining jtag and as configuration schemes notes to figure 8?28 : (1) connect these pull-up resistors to the v ccio supply of the bank in which the pin resides. (2) power up the v cc of the ethernetblaster, byteblaster ii, or usb-blaster cable with the 3.3-v supply. (3) pin 6 of the header is a v io reference voltage for the masterblaster output driver.the v io must match the v cca of the device. for this value, refer to the masterblaster s erial/u s b communications cable user guide . when using the byteblastermv download cable, this pin is a no connect. when using the usb-blaster and byteblaster ii cables, this pin is connected to nce when it is used for as programming, otherwise it is a no connect. (4) the msel pin settings vary for different configuration voltage standards and por time. to connect msel for as configuration schemes, refer to table 8?3 on page 8?8 , table 8?4 on page 8?8 , and table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (5) power up the v cc of the ethernetblaster, byteblaster ii, usb-blaster, or byteblastermv cable with a 2.5-v v cca supply. third-party programmers must switch to 2.5 v. pin 4 of the header is a v cc power supply for the masterblaster cable. the masterblaster cable can receive power from either 5.0- or 3.3-v circuit boards, dc power supply, or 5.0 v from the usb cable. for this value, refer to the masterblaster s erial/u s b communications cable user guide . (6) you must place the diodes and capacitors as close as possible to the cyclone iv device. altera recommends using the schottky diode, which has a relatively lower forward diode voltage (vf) than the switching and zener diodes, for effective voltage clamping. (7) these pins are dual-purpose i/o pins. the ncso pin functions as flash_nce pin in ap mode. the asdo pin functions as data[1] pin in ap and fpp modes. (8) resistor value can vary from 1 k ? to 10 k ? .. (9) only cyclone iv gx devices have an option to select clkusr (40 mhz maximum) as the external clock source for dclk . data dclk ncs asdi serial configuration device cyclone i v device 10 k 10 k v ccio v ccio gnd nceo nce nstatus conf_done 10 k v ccio nconfig msel[ ] (1) (1) (1) (4) 10k v cca n.c. v cca tck tdo tms tdi clkusr (9) gnd v cca (5) v io (3) 3.3 v (2) pin 1 pin 1 download cable (jtag mode) 10-pin male header (top view) download cable (as mode) 10-pin male header 3.3 v 10 pf gnd gnd 10 pf 10 pf gnd 10 pf gnd (6) (6) (8) (8) 3.3 v 3.3 v 3.3 v data[0] dclk ncso (7) asdo (7) 1 k 8?54 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation programming serial configuration devices in-system with the jtag interface cyclone iv devices in a single- or multiple-device chain support in-system programming of a serial configuration device with the jtag interface through the sfl design. the intelligent host or download cable of the board can use the four jtag pins on the cyclone iv device to program the serial configuration device in system, even if the host or download cable cannot access the configuration pins ( dclk , data , asdi , and ncs pins). the sfl design is a jtag-based in-system programming solution for altera serial configuration devices. the sfl is a bridge design for the cyclone iv device that uses their jtag interface to access the epcs jtag indirect configuration device programming ( .jic ) file and then uses the as interface to program the epcs device. both the jtag interface and as interface are bridged together inside the sfl design. in a multiple device chain, you must only configure the master device that controls the serial configuration device. slave devices in the multiple device chain that are configured by the serial configuration device do not have to be configured when using this feature. to successfully use this feature, set the msel pins of the master device to select the as configuration scheme ( table 8?3 on page 8?8 , ta b l e 8 ?4 on page 8?8 , and table 8?5 on page 8?9 ). the serial configuration device in-system programming through the cyclone iv device jtag interface has three stages, which are described in the following sections: ?loading the sfl design? ?isp of the configuration device? on page 8?55 ?reconfiguration? on page 8?56 loading the sfl design the sfl design is a design inside the cyclone iv device that bridges the jtag interface and as interface with glue logic. the intelligent host uses the jtag interface to configure the master device with a sfl design. the sfl design allows the master device to control the access of four serial configuration device pins, also known as the active serial memory interface (asmi) pins, through the jtag interface. the asmi pins are serial clock input ( dclk ), serial data output ( data ), as data input ( asdi ), and active-low chip select ( ncs ) pins. if you configure a master device with an sfl design, the master device enters user mode even though the slave devices in the multiple device chain are not being configured. the master device enters user mode with a sfl design even though the conf_done signal is externally held low by the other slave devices in chain. figure 8?29 shows the jtag configuration of a single cyclone iv device with a sfl design. chapter 8: configuration and remote system upgrades in cyclone iv devices 8?55 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 isp of the configuration device in the second stage, the sfl design in the master device allows you to write the configuration data for the device chain into the serial configuration device with the cyclone iv device jtag interface. the jtag interface sends the programming data for the serial configuration device to the cyclone iv device first. the cyclone iv device then uses the asmi pins to send the data to the serial configuration device. figure 8?29. programming serial configuration device s in-system using the jtag interface notes to figure 8?29 : (1) connect the pull-up resistors to the v ccio supply of the bank in which the pin resides. (2) the msel pin settings vary for different configuration voltage standards and por time. to connect msel for as configuration schemes, refer to table 8?3 on page 8?8 , table 8?4 on page 8?8 , and table 8?5 on page 8?9 . connect the msel pins directly to v cca or gnd. (3) pin 6 of the header is a v io reference voltage for the masterblaster output driver. the v io must match the v cca of the device. for this value, refer to the masterblaster s erial/u s b communications cable user guide . when using the byteblastermv download cable, this pin is a no connect. when using usb-blaster, byteblaster ii, and ethernetblaster cables, this pin is connected to nce when it is used for as programming, otherwise it is a no connect. (4) you must connect the nce pin to gnd or driven low for successful jtag configuration. (5) the nceo pin is left unconnected or used as a user i/o pin when it does not feed the nce pin of another device. (6) power up the v cc of the ethernetblaster, byteblaster ii, usb-blaster, or byteblastermv cable with a 2.5- v v cca supply. third-party programmers must switch to 2.5 v. pin 4 of the header is a v cc power supply for the masterblaster cable. the masterblaster cable can receive power from either 5.0- or 3.3-v circuit boards, dc power supply, or 5.0 v from the usb cable. for this value, refer to the masterblaster s erial/u s b communications cable user guide . (7) connect the series resistor at the near end of the serial configuration device. (8) these pins are dual-purpose i/o pins. the ncso pin functions as flash_nce pin in ap mode. the asdo pin functions as data[1] pin in ap and fpp modes. (9) resistor value can vary from 1 k ? to 10 k ? .. (10) only cyclone iv gx devices have an option to select clkusr (40 mhz maximum) as the external clock source for dclk . nce (4) msel[ ] nconfig conf_done v cca v cca (6) gnd v ccio (1) gnd v ccio (1) (2) (10) v cca (9) (9) 1 k 10 k 10 k nstatus pi n 1 dow n load cable 10-pi n male heade r (top view) gnd tck tdo tms tdi clkusr gnd v io (3) cyclone i v device nceo n.c. (5) dclk data[0] ncso (8) asdo (8) dclk data ncs asdi serial configuration device v ccio (1) 10 k serial flash loader 25 (7) 8?56 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation reconfiguration after the configuration data is successfully written into the serial configuration device, the cyclone iv device does not automatically start reconfiguration. the intelligent host issues the pulse_nconfig jtag instruction to initialize the reconfiguration process. during reconfiguration, the master device is reset and the sfl design no longer exists in the cyclone iv device and the serial configuration device configures all the devices in the chain with the user design. f for more information about the sfl, refer to an 370: using the serial flashloader with quartus ii software. jtag instructions f for more information about the jtag binary instruction code, refer to the jtag boundary-scan testing for cyclone iv devices chapter. i/o reconfiguration use the config_io instruction to reconfigure the i/o configuration shift register (iocsr) chain. this instruction allows you to perform board-level testing prior to configuring the cyclone iv device or waiting for a configuration device to complete configuration. after the configuration is interrupted and jtag testing is complete, you must reconfigure the part through the pulse_nconfig jtag instruction or by pulsing the nconfig pin low. you can issue the config_io instruction any time during user mode. you must meet the following timing restrictions when using the config_io instruction: the config_io instruction cannot be issued when the nconfig pin is low you must observe a 230 ? s minimum wait time after any of the following conditions: nconfig pin goes high issuing the pulse_nconfig instruction issuing the active_engage instruction, before issuing the config_io instruction you must wait 230 ? s after power up, with the nconfig pin high before issuing the config_io instruction (or wait for the nstatus pin to go high) use the active_disengage instruction with the config_io instruction to interrupt configuration. table 8?14 lists the sequence of instructions to use for various config_io usage scenarios. chapter 8: configuration and remote system upgrades in cyclone iv devices 8?57 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 the config_io instruction does not hold nstatus low until reconfiguration. you must disengage the as or ap configuration controller by issuing the active_disengage and active_engage instructions when active configuration is interrupted. you must issue the active_disengage instruction alone or prior to the config_io instruction if the jtag_program instruction is to be issued later ( table 8?15 ). this puts the active configuration controllers into the idle state. the active configuration controller is re-engaged after user mode is reached through jtag programming ( table 8?15 ). 1 while executing the config_io instruction, all user i/os are tri-stated. if reconfiguration after interruption is performed using configuration modes (rather than using jtag_program ), it is not necessary to issue the active_disengage instruction prior to config_io . you can start reconfiguration by either pulling nconfig low for at least 500 ns or issuing the pulse_nconfig instruction. if the active_disengage instruction was issued and the jtag_program instruction fails to enter user mode, you must issue the active_engage instruction to reactivate the active configuration controller. issuing the active_engage instruction also triggers reconfiguration in configuration modes; therefore, it is not necessary to pull nconfig low or issue the pulse_nconfig instruction. active_disengage the active_disengage instruction places the active configuration controller (as and ap) into an idle state prior to jtag programming. the two purposes of placing the active controller in an idle state are: to ensure that it is not trying to configure the device during jtag programming table 8?14. jtag config_io (wit hout jtag_program) instruction flows (note 1) jtag instruction configuration scheme and current state of the cyclone iv device prior to user mode (interrupting configuration) user mode power up ps fpp as ap ps fpp as ap ps fpp as ap active_disengage o o o 0 o o o 0 ???? config_io r r r r r r r r na na na na jtag boundary scan instructions (no jtag_program ) o o o 0 o o o 0 ???? active_engage aa r (2) r (2) aa r (2) r (2) ???? pulse_nconfig a (3) a (3) o 0 ???? pulse nconfig pin a (3) a (3) o 0 ???? jtag tap reset r r r r r r r r ? ? ? ? notes to table 8?14 : (1) you must execute ?r? indicates that the instruction before the next instruction, ?o? indicates the optional instruction, ?a? indicates that the instruction must be executed, and ?na? indicates that the instruction is not allowed in this mode. (2) required if you use active_disengage . (3) neither of the instruction is required if you use active_engage . 8?58 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation to allow the controllers to properly recognize a successful jtag programming that results in the device reaching user mode the active_disengage instruction is required before jtag programming regardless of the current state of the cyclone iv device if the msel pins are set to an as or ap configuration scheme. if the active_disengage instruction is issued during a passive configuration scheme (ps or fpp), it has no effect on the cyclone iv device. similarly, the config_io instruction is issued after an active_disengage instruction, but is no longer required to properly halt configuration. table 8?15 lists the required, recommended, and optional instructions for each configuration mode. the ordering of the required instructions is a hard requirement and must be met to ensure functionality. in the as or ap configuration scheme, the active_disengage instruction puts the active configuration controller into idle state. if a successful jtag programming is executed, the active controller is automatically re-engaged after user mode is reached through jtag programming. this causes the active controller to transition to their respective user mode states. if jtag programming fails to get the cyclone iv device to enter user mode and re-engage active programming, there are available methods to achieve this: in as configuration scheme, you can re-engage the as controller by moving the jtag tap controller to the reset state or by issuing the active_engage instruction. in ap configuration scheme, the only way to re-engage the ap controller is to issue the active_engage instruction. in this case, asserting the nconfig pin does not re-engage either active controller. table 8?15. jtag programming instruction flows (note 1) jtag instruction configuration scheme and current state of the cyclone iv device prior to user mode (interrupting configuration) user mode power up ps fpp as ap ps fpp as ap ps fpp as ap active_disengage o o r r oooro o rr config_io rc rc o o o o o 0 na na na na other jtag instructions o o o o o o o 0 o o o 0 jtag_program r r r r rrrrr r rr check_status rc rc rc rc rc rc rc rc rc rc rc rc jtag_startup r r r r rrrrr r rr jtag tap reset/other instruction r r r r rrrrr r rr note to table 8?15 : (1) ?r? indicates that the instruction must be executed before the next instruction, ?o? indicates the optional instruction, ?rc ? indicates the recommended instruction, and ?na? indicates that the instruction is not allowed in this mode. chapter 8: configuration and remote system upgrades in cyclone iv devices 8?59 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 active_engage the active_engage instruction allows you to re-engage a disengaged active controller. you can issue this instruction any time during configuration or user mode to re-engage an already disengaged active controller, as well as trigger reconfiguration of the cyclone iv device in the active configuration scheme. the active_engage instruction functions as the pulse_nconfig instruction when the device is in the ps or fpp configuration schemes. the nconfig pin is disabled when the active_engage instruction is issued. 1 altera does not recommend using the active_engage instruction, but it is provided as a fail-safe instruction for re-engaging the active configuration controller (as and ap). overriding the internal oscillator this feature allows you to override the internal oscillator during the active configuration scheme. the as and ap configuration controllers use the internal oscillator as the clock source. you can change the clock source to clkusr through the jtag instruction. the en_active_clk and dis_active_clk jtag instructions toggle on or off whether or not the active clock is sourced from the clkusr pin or the internal configuration oscillator. to source the active clock from the clkusr pin, issue the en_active_clk instruction. this causes the clkusr pin to become the active clock source. when using the en_active_clk instruction, you must enable the internal oscillator for the clock change to occur. by default, the configuration oscillator is disabled after configuration and initialization is complete as well as the device has entered user mode. however, the internal oscillator is enabled in user mode by any of the following conditions: a reconfiguration event (for example, driving the nconfig pin to go low) remote update is enabled error detection is enabled you must clock the clkusr pin at two times the expected dclk frequency. the clkusr pin allows a maximum frequency of 80 mhz (40 mhz dclk ). normally, a test instrument uses the clkusr pin when it wants to drive its own clock to control the as state machine. to revert the clock source back to the configuration oscillator, issue the dis_active_clk instruction. after you issue the dis_active_clk instruction, you must continue to clock the clkusr pin for 10 clock cycles. otherwise, even toggling the nconfig pin does not revert the clock source and reconfiguration does not occur. a por reverts the clock source back to the configuration oscillator. toggling the nconfig pin or driving the jtag state machine to reset state does not revert the clock source. 8?60 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation en_active_clk the en_active_clk instruction causes the clkusr pin signal to replace the internal oscillator as the clock source. when using the en_active_clk instruction, you must enable the internal oscillator for the clock change to occur. after this instruction is issued, other jtag instructions can be issued while the clkusr pin signal remains as the clock source. the clock source is only reverted back to the internal oscillator by issuing the dis_active_clk instruction or a por. dis_active_clk the dis_active_clk instruction breaks the clkusr enable latch set by the en_active_clk instruction and causes the clock source to revert back to the internal oscillator. after the dis_active_clk instruction is issued, you must continue to clock the clkusr pin for 10 clock cycles. 1 you must clock the clkusr pin at two times the expected dclk frequency. the clkusr pin allows a maximum frequency of 80 mhz (40 mhz dclk ). changing the start boot address of the ap flash in the ap configuration scheme (for cyclone iv e devices only), you can change the default configuration boot address of the parallel flash memory to any desired address using the apfc_boot_addr jtag instruction. apfc_boot_addr the apfc_boot_addr instruction is for cyclone iv e devices only and allows you to define a start boot address for the parallel flash memory in the ap configuration scheme. this instruction shifts in a start boot address for the ap flash. when this instruction becomes the active instruction, the tdi and tdo pins are connected through a 22-bit active boot address shift register. the shifted-in boot address bits get loaded into the 22-bit ap boot address update register, which feeds into the ap controller. the content of the ap boot address update register can be captured and shifted-out of the active boot address shift register from tdo . the boot address in the boot address shift register and update register are shifted to the right (in the lsb direction) by two bits versus the intended boot address. the reason for this is that the two lsb of the address are not accessible. when this boot address is fed into the ap controller, two 0s are attached in the end as lsb, thereby pushing the shifted-in boot address to the left by two bits, which become the actual ap boot address the ap controller gets. if you have enabled the remote update feature, the apfc_boot_addr instruction sets the boot address for the factory configuration only. 1 the apfc_boot_addr instruction is retained after reconfiguration while the system board is still powered on. however, you must reprogram the instruction whenever you restart the system board. chapter 8: configuration and remote system upgrades in cyclone iv devices 8?61 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 device configuration pins ta b l e 8 ?1 6 through ta b l e 8 ?1 9 describe the connections and functionality of all the configuration related pins on cyclone iv devices. ta b l e 8 ?1 6 and table 8?17 list the device pin configuration for the cyclone iv gx and cyclone iv e, respectively. table 8?16. configuration pin summary for cyclone iv gx devices bank description input/output dedicated powered by configuration mode 8 data[4:2] input ? v ccio fpp 3 data[7:5] input ? v ccio fpp 9 ncso (2) output ? v ccio as 3 crc_error output ? v ccio /pull-up (1) optional, all modes 9 data[0] (2) input yes v ccio ps, fpp, as 9 data[1]/asdo (2) input ? v ccio fpp output v ccio as 3 init_done output ? pull-up optional, all modes 3 nstatus bidirectional yes pull-up all modes 9 nce input yes v ccio all modes 9 dclk (2) input yes v ccio ps, fpp output v ccio as 3 conf_done bidirectional yes pull-up all modes 9 tdi input yes v ccio jtag 9 tms input yes v ccio jtag 9 tck input yes v ccio jtag 9 nconfig input yes v ccio all modes 8 clkusr input ? v ccio optional 3 nceo output ? v ccio optional, all modes 3 msel input yes v ccint all modes 9 tdo output yes v ccio jtag 6 dev_oe input ? v ccio optional 6 dev_clrn input ? v ccio optional notes to table 8?16 : (1) the crc_error pin is a dedicated output by default. optionally, you can enable the crc_error pin as an open-drain output in the crc error detection tab of the device and pin options dialog box. (2) to tri-state as configuration pins in the as configuration scheme, turn on the enable input tri-state on active configuration pins in user mode option from the device and pin options dialog box. this tri-states dclk , ncso , data[0] , and data[1]/asdo pins. dual-purpose pins settings for these pins are ignored. to set these pins to different settings, turn off the enable input tri-state on active configuration pins in user mode option and set the desired setting from the dual-purpose pins setting menu. 8?62 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation table 8?17. configuration pin summary for cyclone iv e devices (part 1 of 2) bank description input/output dedicated powered by configuration mode 1 ncso (1) , flash_nce (2) output ? v ccio as, ap 6 crc_error (3) output ? v ccio /pull-up (4) optional, all modes 1 data[0] (1) , (2) input yes v ccio ps, fpp, as bidirectional v ccio ap 1 data[1] (2) / asdo (1) input ? v ccio fpp output v ccio as bidirectional v ccio ap 8 data[7..2] (2) input ? v ccio fpp bidirectional v ccio ap 8 data[15..8] (2) bidirectional ? v ccio ap 6 init_done output ? pull-up optional, all modes 1 nstatus bidirectional yes pull-up all modes 1 nce input yes v ccio all modes 1 dclk (1) , (2) input yes v ccio ps, fpp output v ccio as, ap 6 conf_done bidirectional yes pull-up all modes 1 tdi input yes v ccio jtag 1 tms input yes v ccio jtag 1 tck input yes v ccio jtag 1 nconfig input yes v ccio all modes 6 clkusr input ? v ccio optional 6 nceo output ? v ccio optional, all modes 6 msel[] input yes v ccint all modes 1 tdo output yes v ccio jtag 7 padd[14..0] output ? v ccio ap 8 padd[19..15] output ? v ccio ap 6 padd[23..20] output ? v ccio ap 1 nreset output ? v ccio ap 6 navd output ? v ccio ap 6 noe output ? v ccio ap 6 nwe output ? v ccio ap 5 dev_oe input ? v ccio optional, ap chapter 8: configuration and remote system upgrades in cyclone iv devices 8?63 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 ta b l e 8 ?1 8 describes the dedicated configuration pins. you must properly connect these pins on your board for successful configuration. you may not need some of these pins for your configuration schemes. 5 dev_clrn input ? v ccio optional, ap notes to table 8?17 : (1) to tri-state as configuration pins in the as configuration scheme, turn-on the enable input tri-state on active configuration pins in user mode option from the device and pin options dialog box. this tri-states dclk , ncso , data[0] , and data[1]/asdo pins. dual-purpose pins settings for these pins are ignored. to set these pins to different settings, turn off the enable input tri-state on active configuration pins in user mode option and set the desired setting from the dual-purpose pins setting menu. (2) to tri-state ap configuration pins in the ap configuration scheme, turn-on the enable input tri-state on active configuration pins in user mode option from the device and pin options dialog box. this tri-states dclk , data[0..15] , flash_nce , and other ap pins. dual-purpose pins settings for these pins are ignored. to set these pins to different settings, turn off the enable input tri-state on active configuration pins in user mode option and set the desired setting from the dual-purpose pins setting menu. (3) the crc_error pin is not available in cyclone iv e devices with 1.0-v core voltage. (4) the crc_error pin is a dedicated output by default. optionally, you can enable the crc_error pin as an open-drain output in the crc error detection tab of the device and pin options dialog box. table 8?17. configuration pin summary for cyclone iv e devices (part 2 of 2) bank description input/output dedicated powered by configuration mode table 8?18. dedicated configuration pins on the cyclone iv device (part 1 of 4) pin name user mode configuration scheme pin type description msel n/a all input configuration input that sets the cyclone iv device configuration scheme. you must hardwire these pins to v cca or gnd. the msel pins have internal 9-k ? pull-down resistors that are always active. nconfig n/a all input configuration control input. pulling this pin low with external circuitry during user mode causes the cyclone iv device to lose its configuration data, enter a reset state, and tri-state all i/o pins. returning this pin to a logic-high level starts a reconfiguration. nstatus n/a all bidirectional open-drain the cyclone iv device drives nstatus low immediately after power-up and releases it after the por time. status output?if an error occurs during configuration, nstatus is pulled low by the target device. status input?if an external source (for example, another cyclone iv device) drives the nstatus pin low during configuration or initialization, the target device enters an error state. driving nstatus low after configuration and initialization does not affect the configured device. if you use a configuration device, driving nstatus low causes the configuration device to attempt to configure the device, but because the device ignores transitions on nstatus in user mode, the device does not reconfigure. to start a re configuration, you must pull nconfig low. 8?64 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation conf_done n/a all bidirectional open-drain status output?the target cyclone iv device drives the conf_done pin low before and during configuration. after all the configuration data is received without error and the initialization cycle starts, the target device releases conf_done. status input?after all the data is received and conf_done goes high, the target device initializes and enters user mode. the conf_done pin must have an external 10-k ? pull-up resistor in order for the device to initialize. driving conf_done low after configuration and initialization does not affect the configured device. do not connect bus holds or adc to conf_done pin. nce n/a all input active-low chip enable. the nce pin activates the cyclone iv device with a low signal to allow configuration. you must hold nce pin low during configuration, initialization, and user-mode. in a single-device configuration, you must tie the nce pin low. in a multi-device configuration, nce of the first device is tied low while its nceo pin is connected to nce of the next device in the chain. you must hold the nce pin low for successful jtag programming of the device. nceo n/a if option is on. i/o if option is off. all output open-drain output that drives low when configuration is complete. in a single-device configuration, you can leave this pin floating or use it as a user i/o pin after configuration. in a multi-device configuration, this pin feeds the nce pin of the next device. the nceo of the last device in the chain is left floating or used as a user i/o pin after configuration. if you use the nceo pin to feed the nce pin of the next device, use an external 10-k ? pull-up resistor to pull the nceo pin high to the v ccio voltage of its i/o bank to help the internal weak pull-up resistor. if you use the nceo pin as a user i/o pin after configuration, set the state of the pin on the dual-purpose pin settings. ncso, flash_nce i/o as, ap (1) output output control signal from the cyclone iv device to the serial configuration device in as mode that enables the configuration device. this pin functions as ncso in as mode and flash_nce in ap mode. output control signal from the cyclone iv device to the parallel flash in ap mode that enables the flash. connects to the ce# pin on the numonyx p30 or p33 flash. (1) this pin has an internal pull-up resistor that is always active. table 8?18. dedicated configuration pins on the cyclone iv device (part 2 of 4) pin name user mode configuration scheme pin type description chapter 8: configuration and remote system upgrades in cyclone iv devices 8?65 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 dclk n/a ps, fpp, as, ap (1) input (ps, fpp). output (as, ap) (1) in ps and fpp configuration, dclk is the clock input used to clock data from an external source into the target cyclone iv device. data is latched into the device on the rising edge of dclk . in as mode, dclk is an output from the cyclone iv device that provides timing for the configuration interface. it has an internal pull-up resistor (typically 25 k ? ) that is always active. in ap mode, dclk is an output from the cyclone iv e device that provides timing for the configuration interface. (1) in as or ap configuration schemes, this pin is driven into an inactive state after configuration completes. alternatively, in active schemes, you can use this pin as a user i/o during user mode. in ps or fpp schemes that use a control host, you must drive dclk either high or low, whichever is more convenient. in passive schemes, you cannot use dclk as a user i/o in user mode. toggling this pin after configuration does not affect the configured device. data[0] i/o ps, fpp, as, ap (1) input (ps, fpp, as). bidirectional (ap) (1) data input. in serial configuration modes, bit-wide configuration data is presented to the target cyclone iv device on the data[0] pin. in as mode, data[0] has an internal pull-up resistor that is always active. after as configuration, data[0] is a dedicated input pin with optional user control. after ps or fpp configuration, data[0] is available as a user i/o pin. the state of this pin depends on the dual-purpose pin settings. after ap configuration, data[0] is a dedicated bidirectional pin with optional user control. (1) data[1] / asdo i/o fpp, as, ap (1) input (fpp). output (as). bidirectional (ap) (1) the data[1] pin functions as the asdo pin in as mode. data input in non-as mode. control signal from the cyclone iv device to the serial configuration device in as mode used to read out configuration data. in as mode, data[1] has an internal pull-up resistor that is always active. after as configuration, data[1] is a dedicated output pin with optional user control. in a ps configuration scheme, data[1] functions as a user i/o pin during configuration, which means it is tri-stated. after fpp configuration, data[1] is available as a user i/o pin and the state of this pin depends on the dual-purpose pin settings. in an ap configuration scheme, for cyclone iv e devices only, the byte-wide or word-wide configuration data is presented to the target cyclone iv e device on data[7..0] or data[15..0] , respectively. after ap configuration, data[1] is a dedicated bidirectional pin with optional user control. (1) table 8?18. dedicated configuration pins on the cyclone iv device (part 3 of 4) pin name user mode configuration scheme pin type description 8?66 chapter 8: configuration and remote system upgrades in cyclone iv devices configuration cyclone iv device handbook, volume 1 ? december 2010 altera corporation data[7..2] i/o fpp, ap (1) inputs (fpp). bidirectional (ap) (1) in an as or ps configuration scheme, data[7..2] function as user i/o pins during configuration, which means they are tri-stated. after fpp configuration, data[7..2] are available as user i/o pins and the state of these pin depends on the dual-purpose pin settings. in an ap configuration scheme, for cyclone iv e devices only, the byte-wide or word-wide configuration data is presented to the target cyclone iv e device on data[7..0] or data[15..0] , respectively. after ap configuration, data[7..2] are dedicated bidirectional pins with optional user control. (1) data[15..8] i/o ap (1) bidirectional data inputs. word-wide configuration data is presented to the target cyclone iv e device on data[15..0] . in a ps, fpp, or as configuration scheme, data[15:8] function as user i/o pins during configuration, which means they are tri stated. after ap configuration, data[15:8] are dedicated bidirectional pins with optional user control. padd[23..0] i/o ap (1) output in ap mode, it is a 24-bit address bus from the cyclone iv e device to the parallel flash. connects to the a[24:1] bus on the numonyx p30 or p33 flash. nreset i/o ap (1) output active-low reset output. driving the nreset pin low resets the parallel flash. connects to the rst# pin on the numonyx p30 or p33 flash. navd i/o ap (1) output active-low address valid output. driving the navd pin low during read or write operation indicates to the parallel flash that a valid address is present on the padd[23..0] address bus. connects to the adv# pin on the numonyx p30 or p33 flash. noe i/o ap (1) output active-low output enable to the parallel flash. during the read operation, driving the noe pin low enables the parallel flash outputs ( data[15..0] ). connects to the oe# pin on the numonyx p30 or p33 flash. nwe i/o ap (1) output active-low write enable to the parallel flash. during the write operation, driving the nwe pin low indicates to the parallel flash that data on the data[15..0] bus is valid. connects to the we# pin on the numonyx p30 or p33 flash. note to table 8?18 : (1) the ap configuration scheme is for cyclone iv e devices only. table 8?18. dedicated configuration pins on the cyclone iv device (part 4 of 4) pin name user mode configuration scheme pin type description chapter 8: configuration and remote system upgrades in cyclone iv devices 8?67 configuration ? december 2010 altera corporation cyclone iv device handbook, volume 1 ta b l e 8 ?1 9 lists the optional configuration pins. if you do not enable these optional configuration pins in the quartus ii software, they are available as general-purpose user i/o pins. therefore, during configuration, these pins function as user i/o pins and are tri-stated with weak pull-up resistors. table 8?19. optional configuration pins pin name user mode pin type description clkusr n/a if option is on. i/o if option is off. input optional user-supplied clock input synchronizes the initialization of one or more devices. this pin is enabled by turning on the enable user-supplied start-up clock (clkusr) option in the quartus ii software. in as configuration for cyclone iv gx devices, you can use this pin as an external clock source to generate the dclk by changing the clock source option in the quartus ii software in the configuration tab of the device and pin options dialog box. init_done n/a if option is on. i/o if option is off. output open-drain status pin is used to indicate when the device has initialized and is in user-mode. when nconfig is low, the init_done pin is tri-stated and pulled high due to an external 10-k ? pull-up resistor during the beginning of configuration. after the option bit to enable init_done is programmed into the device (during the first frame of configuration data), the init_done pin goes low. when initialization is complete, the init_done pin is released and pulled high and the device enters user mode. thus, the monitoring circuitry must be able to detect a low-to-high transition. this pin is enabled by turning on the enable init_done output option in the quartus ii software. the functionality of this pin changes if the enable oct_done option is enabled in the quartus ii software. this option controls whether the init_done signal is gated by the oct_done signal, which indicates the power-up on-chip termination (oct) calibration is complete. if this option is turned off, the init_done signal is not gated by the oct_done signal. dev_oe n/a if option is on. i/o if option is off. input optional pin that allows you to override all tri-states on the device. when this pin is driven low, all i/o pins are tri-stated; when this pin is driven high, all i/o pins behave as programmed. this pin is enabled by turning on the enable device-wide output enable (dev_oe) option in the quartus ii software. dev_clrn n/a if option is on. i/o if option is off. input optional pin that allows you to override all clears on all device registers. when this pin is driven low, all registers are cleared; when this pin is driven high, all registers behave as programmed. you can enable this pin by turning on the enable device-wide reset (dev_clrn) option in the quartus ii software. 8?68 chapter 8: configuration and remote system upgrades in cyclone iv devices remote system upgrade cyclone iv device handbook, volume 1 ? december 2010 altera corporation remote system upgrade cyclone iv devices support remote system upgrade in as and ap configuration schemes. you can also implement remote system upgrade with advanced cyclone iv features such as real-time decompression of configuration data in the as configuration scheme. 1 remote system upgrade is not supported in a multi-device configuration chain for any configuration scheme. functional description the dedicated remote system upgrade circuitry in cyclone iv devices manages remote configuration and provides error detection, recovery, and status information. a nios ? ii processor or a user logic implemented in the cyclone iv device logic array provides access to the remote configuration data source and an interface to the configuration memory. 1 configuration memory refers to serial configuration devices (epcs) or supported parallel flash memory, depending on the configuration scheme that is used. the remote system upgrade process of the cyclone iv device consists of the following steps: 1. a nios ii processor (or user logic) implemented in the cyclone iv device logic array receives new configuration data from a remote location. the connection to the remote source is a communication protocol, such as the transmission control protocol/internet protocol (tcp/ip), peripheral component interconnect (pci), user datagram protocol (udp), universal asynchronous receiver/transmitter (uart), or a proprietary interface. 2. the nios ii processor (or user logic) writes this new configuration data into a configuration memory. 3. the nios ii processor (or user logic) starts a reconfiguration cycle with the new or updated configuration data. 4. the dedicated remote system upgrade circuitry detects and recovers from any error that might occur during or after the reconfiguration cycle and provides error status information to the user design. figure 8?30 shows the steps required for performing remote configuration updates (the numbers in figure 8?30 coincide with steps 1 ? 3 ). figure 8?30. functional diagram of cyclone iv device remote system upgrade development location device configuration cyclone i v device control module data data data 1 2 3 configuration memory chapter 8: configuration and remote system upgrades in cyclone iv devices 8?69 remote system upgrade ? december 2010 altera corporation cyclone iv device handbook, volume 1 figure 8?31 shows the block diagrams to implement remote system upgrade in cyclone iv devices. the msel pin setting in the remote system upgrade mode is the same as the standard configuration mode. standard configuration mode refers to normal cyclone iv device configuration mode with no support for remote system upgrades (the remote system upgrade circuitry is disabled). when using remote system upgrade in cyclone iv devices, you must enable the remote update mode option setting in the quartus ii software. enabling remote update you can enable or disable remote update for cyclone iv devices in the quartus ii software before design compilation (in the compiler settings menu). to enable remote update in the compiler settings of the project, perform the following steps: 1. on the assignments menu, click device . the settings dialog box appears. 2. click device and pin options . the device and pin options dialog box appears. 3. click the configuration tab. 4. from the configuration mode list, select remote . 5. click ok . 6. in the settings dialog box, click ok . configuration image types when using remote system upgrade, cyclone iv device configuration bitstreams are classified as factory configuration images or application configuration images. an image, also referred to as a configuration, is a design loaded into the device that performs certain user-defined functions. each device in your system requires one factory image or with addition of one or more application images. the factory image is a user-defined fall-back or safe configuration and is responsible for administering remote updates with the dedicated circuitry. application images implement user-defined functionality in the target cyclone iv device. you can include the default application image functionality in the factory image. figure 8?31. remote system upgrade block diagrams for as and ap configuration schemes serial config u ration de v ice s u pported parallel flash n ios processor or user logic cyclone iv de v ice n ios processor or user logic cyclone iv e de v ice serial configuration device parallel flash memory 8?70 chapter 8: configuration and remote system upgrades in cyclone iv devices remote system upgrade cyclone iv device handbook, volume 1 ? december 2010 altera corporation remote system upgrade mode in remote update mode, cyclone iv devices load the factory configuration image after power up. the user-defined factory configuration determines the application configuration to be loaded and triggers a reconfiguration cycle. the factory configuration can also contain application logic. when used with configuration memory, the remote update mode allows an application configuration to start at any flash sector boundary. additionally, the remote update mode features a user watchdog timer that can detect functional errors in an application configuration. remote update mode in as configuration scheme, when a cyclone iv device is first powered up in remote update, it loads the factory configuration located at address boot_address[23:0] = 24b'0 . altera recommends storing the factory configuration image for your system at boot address 24b'0 , which corresponds to the start address location 0000000 in the serial configuration device. a factory configuration image is a bitstream for the cyclone iv device in your system that is programmed during production and is the fall-back image when an error occurs. this image is stored in non-volatile memory and is never updated or modified using remote access. when you use the ap configuration in cyclone iv e devices, the cyclone iv e device loads the default factory configuration located at the following address after device power-up in remote update mode: boot_address[23:0] = 24'h010000 = 24'b1 0000 0000 0000 0000 . you can change the default factory configuration address to any desired address using the apfc_boot_addr jtag instruction. the factory configuration image is stored in non-volatile memory and is never updated or modified using remote access. this corresponds to the default start address location 0010000 represented in 16-bit word addressing (or the updated address if the default address is changed) in the supported parallel flash memory. for more information about the application of the apfc_boot_addr jtag instruction in ap configuration scheme, refer to the ?jtag instructions? on page 8?56 . chapter 8: configuration and remote system upgrades in cyclone iv devices 8?71 remote system upgrade ? december 2010 altera corporation cyclone iv device handbook, volume 1 the factory configuration image is user-designed and contains soft logic (nios ii processor or state machine and the remote communication interface) to: process any errors based on status information from the dedicated remote system upgrade circuitry communicate with the remote host and receive new application configurations and store the new configuration data in the local non-volatile memory device determine the application configuration to be loaded into the cyclone iv device enable or disable the user watchdog timer and load its time-out value (optional) instruct the dedicated remote system upgrade circuitry to start a reconfiguration cycle figure 8?32 shows the transitions between the factory configuration and application configuration in remote update mode. after power up or a configuration error, the factory configuration logic writes the remote system upgrade control register to specify the address of the application configuration to be loaded. the factory configuration also specifies whether or not to enable the user watchdog timer for the application configuration and, if enabled, specifies the timer setting. 1 only valid application configurations designed for remote update mode include the logic to reset the timer in user mode. for more information about the user watchdog timer, refer to the ?user watchdog timer? on page 8?78 . figure 8?32. transitions between configurations in remote update mode set control register and reconfig u re set control register and reconfig u re reload a different application reload a different application application n config u ration application 1 config u ration factory config u ration config u ration error config u ration error po w er up config u ration error 8?72 chapter 8: configuration and remote system upgrades in cyclone iv devices remote system upgrade cyclone iv device handbook, volume 1 ? december 2010 altera corporation if there is an error while loading the application configuration, the remote system upgrade status register is written by the dedicated remote system upgrade circuitry of the cyclone iv device to specify the cause of the reconfiguration. the following actions cause the remote system upgrade status register to be written: nstatus driven low externally internal cyclical redundancy check (crc) error user watchdog timer time-out a configuration reset (logic array nconfig signal or external nconfig pin assertion) the cyclone iv device automatically loads the factory configuration when an error occurs. this user-designed factory configuration reads the remote system upgrade status register to determine the reason for reconfiguration. then the factory configuration takes the appropriate error recovery steps and writes to the remote system upgrade control register to determine the next application configuration to be loaded. when cyclone iv devices successfully load the application configuration, they enter user mode. in user mode, the soft logic (the nios ii processor or state machine and the remote communication interface) assists the cyclone iv device in determining when a remote system update is arriving. when a remote system update arrives, the soft logic receives the incoming data, writes it to the configuration memory device and triggers the device to load the factory configuration. the factory configuration reads the remote system upgrade status register, determines the valid application configuration to load, writes the remote system upgrade control register accordingly, and starts system reconfiguration. chapter 8: configuration and remote system upgrades in cyclone iv devices 8?73 remote system upgrade ? december 2010 altera corporation cyclone iv device handbook, volume 1 dedicated remote system upgrade circuitry this section describes the implementation of the cyclone iv device remote system upgrade dedicated circuitry. the remote system upgrade circuitry is implemented in hard logic. this dedicated circuitry interfaces with the user-defined factory application configurations implemented in the cyclone iv device logic array to provide the complete remote configuration solution. the remote system upgrade circuitry contains the remote system upgrade registers, a watchdog timer, and state machines that control those components. figure 8?33 shows the data path of the remote system upgrade block. figure 8?33. remote system upgrade circuit data path (note 1) notes to figure 8?33 : (1) the ru_dout , ru_shiftnld , ru_captnupdt , ru_clk , ru_din,ru_nconfig , and ru_nrstimer signals are internally controlled by the altremote_update megafunction. (2) the ru_clk refers to the altremote_update megafunction block "clock" input. for more information, refer to the remote update circuitry (altremote_update) megafunction user guide. stat u s register (sr) pre v io u s state register 2 bit[30..0] pre v io u s state register 1 bit[30..0] c u rrent state logic bit[31..0] internal oscillator/ clkusr control register bit [3 8 ..0] logic update register bit [3 8 ..0] u pdate logic bit [40..39] do u t din bit [3 8 ..0] do u t din capt u re shift register clko u t capt u re u pdate logic clkin ru_di n ru_shiftnld ru_captnupdt ru_clk (2) ru_dout ru_nco n fig ru_nrstimer logic array rsu reconfig u ration state machine user w atchdog timer rsu master state machine timeo u t 8?74 chapter 8: configuration and remote system upgrades in cyclone iv devices remote system upgrade cyclone iv device handbook, volume 1 ? december 2010 altera corporation remote system upgrade registers the remote system upgrade block contains a series of registers that stores the configuration addresses, watchdog timer settings, and status information. table 8?20 lists these registers. the control and status registers of the remote system upgrade are clocked by the 10-mhz internal oscillator (the same oscillator that controls the user watchdog timer) or the clkusr . however, the shift and update registers of the remote system upgrade are clocked by the maximum frequency of 40-mhz user clock input ( ru_clk ). there is no minimum frequency for ru_clk. remote system upgrade control register the remote system upgrade control register stores the application configuration address, the user watchdog timer settings, and option bits for a application configuration. in remote update mode for the as configuration scheme, the control register address bits are set to all zeros ( 24'b0 ) at power up to load the as factory configuration. in remote update mode for the ap configuration scheme, the control register address bits are set to 24'h010000 ( 24'b1 0000 0000 0000 0000 ) at power up to load the ap default factory configuration. however, for the ap configuration scheme, you can change the default factory configuration address to any desired address using the apfc_boot_addr jtag instruction. additionally, a factory configuration in remote update mode has write access to this register. figure 8?34 shows the control register bit positions. table 8?21 defines the control register bit contents. the numbers in figure 8?34 show the bit position of a setting in a register. for example, bit number 35 is the enable bit for the watchdog timer. table 8?20. remote system upgrade registers register description shift register this register is accessible by the logic array and allows the update, status, and control registers to be written and sampled by user logic. write access is enabled in re mote update mode for factory configurations to allow writing to the update register. write access is disabled for all application configurations in remote update mode. control register this register contains the current configuration address, the user watchdog timer settings, one option bit for checking early conf_done , and one option bit for selecting the internal oscillator as the startup state machine clock. during a read operation in an application configuration, this register is read into the shift register. when a reconfiguration cycle is started, the cont ents of the update register are written into the control register. update register this register contains data similar to that in the control register. however, it can only be updated by the factory configuration by shifting data into the shift register and issuing an update operation. when a reconfiguration cycle is triggered by the factory configuration, the control register is updated with the contents of the update register. during a read in a factory configuration, this register is read into the shift register. status register this register is written by the remote system upgrade circuitry on every reconfiguration to record the cause of the reconfiguration. this information is used by the factory configuration to determine the appropriate action following a reconfiguration. during a capture cycle, this register is read into the shift register. chapter 8: configuration and remote system upgrades in cyclone iv devices 8?75 remote system upgrade ? december 2010 altera corporation cyclone iv device handbook, volume 1 when enabled, the early conf_done check ( cd_early ) option bit ensures that there is a valid configuration at the boot address specified by the factory configuration and that it is of the proper size. if an invalid configuration is detected or the conf_done pin is asserted too early, the device resets and then reconfigures the factory configuration image. the internal oscillator (as the startup state machine clock [ osc_int ] option bit) ensures a functional startup clock to eliminate the hanging of startup. when all option bits are turned on, they provide complete coverage for the programming and startup portions of the application configuration. altera recommends turning on both the cd_early and osc_int option bits. 1 the cd_early and osc_int option bits for the application configuration must be turned on by the factory configuration. remote system upgrade status register the remote system upgrade status register specifies the reconfiguration trigger condition. the various trigger and error conditions include: cyclical redundancy check (crc) error during application configuration nstatus assertion by an external device due to an error cyclone iv device logic array triggers a reconfiguration cycle, possibly after downloading a new application configuration image external configuration reset ( nconfig ) assertion user watchdog timer time out figure 8?34. remote system upgrade control register rsv2 cd_early osc_int wd_en rsv1 ru_address[21..0] wd_timer[11.. 0] 38 37 36 35 34 33 12 11 0 table 8?21. remote system upgrade control register contents control register bit value definition wd_timer[11..0] 12'b000000000000 user watchdog time-out value (most significant 12 bits of 29-bit count value: {wd_timer[11..0],17'b1000} ) ru_address[21..0] 22'b0000000000000000000000 configuration address (most significant 22 bits of 24-bit boot address value: boot_address[23:0] = {ru_address[21..0],2'b0} ) rsv1 1'b0 reserved bit wd_en 1'b1 user watchdog timer enable bit osc_int (1) 1'b1 internal oscillator as startup state machine clock enable bit cd_early (1) 1'b1 early conf_done check rsv2 1'b1 reserved bit note to table 8?21 : (1) option bit for the application configuration. 8?76 chapter 8: configuration and remote system upgrades in cyclone iv devices remote system upgrade cyclone iv device handbook, volume 1 ? december 2010 altera corporation ta b l e 8 ?2 2 lists the contents of the current state logic in the status register, when the remote system upgrade master state machine is in factory configuration or application configuration accessing the factory information or application information, respectively. the status register bit in table 8?22 lists the bit positions in a 32-bit logic. the previous two application configurations are available in the previous state registers (previous state register 1 and previous state register 2), but only for debugging purposes. ta b l e 8 ?2 3 lists the contents of previous state register 1 and previous state register 2 in the status register. the status register bit in table 8?23 shows the bit positions in a 3-bit register. the previous state register 1 and previous state register 2 have the same bit definitions. the previous state register 1 reflects the current application configuration and the previous state register 2 reflects the previous application configuration. table 8?22. remote system upgrade current state logic contents in status register remote system upgrade master state machine status register bit definition description factory information (1) 31:30 master state machine current state the current state of the remote system upgrade master state machine 29:24 reserved bits padding bits that are set to all 0?s 23:0 boot address the current 24-bit boot address that was used by the configuration scheme as the start address to load the current configuration. application information 1 (2) 31:30 master state machine current state the current state of the remote system upgrade master state machine 29 user watchdog timer enable bit the current state of the user watchdog enable, which is active high 28:0 user watchdog timer time-out value the current entire 29-bit watchdog time-out value. application information 2 (2) 31:30 master state machine current state the current state of the remote system upgrade master state machine 29:24 reserved bits padding bits that are set to all 0?s 23:0 boot address the current 24-bit boot address that was used as the start address to load the current configuration notes to table 8?22 (1) the remote system upgrade master state machine is in factory configuration. (2) the remote system upgrade master state machine is in application configuration. chapter 8: configuration and remote system upgrades in cyclone iv devices 8?77 remote system upgrade ? december 2010 altera corporation cyclone iv device handbook, volume 1 if a capture is inappropriately done while capturing a previous state before the system has entered remote update application configuration for the first time, a value outputs from the shift register to indicate that the capture is incorrectly called. remote system upgrade state machine the remote system upgrade control and update registers have identical bit definitions, but serve different roles ( table 8?20 on page 8?74 ). while both registers can only be updated when the device is loaded with a factory configuration image, the update register writes are controlled by the user logic, and the control register writes are controlled by the remote system upgrade state machine. in factory configurations, the user logic should send the option bits ( cd_early and osc_int ), the configuration address, and watchdog timer settings for the next application configuration bit to the update register. when the logic array configuration reset ( ru_nconfig ) goes high, the remote system upgrade state machine updates the control register with the contents of the update register and starts system reconfiguration from the new application page. 1 to ensure the successful reconfiguration between the pages, assert the ru_nconfig signal for a minimum of 250 ns. this is equivalent to strobing the reconfig input of the altremote_update megafunction high for a minimum of 250 ns. if there is an error or reconfiguration trigger condition, the remote system upgrade state machine directs the system to load a factory or application configuration (based on mode and error condition) by setting the control register accordingly. ta b l e 8 ?2 4 lists the contents of the control register after such an event occurs for all possible error or trigger conditions. the remote system upgrade status register is updated by the dedicated error monitoring circuitry after an error condition, but before the factory configuration is loaded. table 8?23. remote system upgrade previous state register 1 and previous state register 2 contents in status register status register bit definition description 30 nconfig source one-hot, active-high field that describes the reconfiguration source that caused the cyclone iv device to leave the previous application configuration. if there is a tie, the higher bit order indicates precedence. for example, if nconfig and remote system upgrade nconfig reach the reconfiguration state machine at the same time, the nconfig precedes the remote system upgrade nconfig . 29 crc error source 28 nstatus source 27 user watchdog timer source 26 remote system upgrade nconfig source 25:24 master state machine current state the state of the master state machine during reconfiguration causes the cyclone iv device to leave the previous application configuration. 23:0 boot address the address used by the configuration scheme to load the previous application configuration. 8?78 chapter 8: configuration and remote system upgrades in cyclone iv devices remote system upgrade cyclone iv device handbook, volume 1 ? december 2010 altera corporation user watchdog timer the user watchdog timer prevents a faulty application configuration from indefinitely stalling the device. the system uses the timer to detect functional errors after an application configuration is successfully loaded into the cyclone iv device. the user watchdog timer is a counter that counts down from the initial value loaded into the remote system upgrade control register by the factory configuration. the counter is 29 bits wide and has a maximum count value of 2 29 . when specifying the user watchdog timer value, specify only the most significant 12 bits. the remote system upgrade circuitry appends 17 ' b1000 to form the 29-bits value for the watchdog timer. the granularity of the timer setting is 2 17 cycles. the cycle time is based on the frequency of the 10-mhz internal oscillator or clkusr (maximum frequency of 40 mhz). table 8?24. control register contents after an er ror or reconfiguration trigger condition reconfiguration error/trigger control register setting in remote update nconfig reset all bits are 0 nstatus error all bits are 0 core triggered reconfiguration update register crc error all bits are 0 wd time out all bits are 0 chapter 8: configuration and remote system upgrades in cyclone iv devices 8?79 remote system upgrade ? december 2010 altera corporation cyclone iv device handbook, volume 1 ta b l e 8 ?2 5 lists the operating range of the 10-mhz internal oscillator. the user watchdog timer begins counting after the application configuration enters device user mode. this timer must be periodically reloaded or reset by the application configuration before the timer expires by asserting ru_nrstimer . if the application configuration does not reload the user watchdog timer before the count expires, a time-out signal is generated by the remote system upgrade dedicated circuitry. the time-out signal tells the remote system upgrade circuitry to set the user watchdog timer status bit ( wd ) in the remote system upgrade status register and reconfigures the device by loading the factory configuration. 1 to allow the remote system upgrade dedicated circuitry to reset the watchdog timer, you must assert the ru_nrstimer signal active for a minimum of 250 ns. this is equivalent to strobing the reset_timer input of the altremote_update megafunction high for a minimum of 250 ns. errors during configuration are detected by the crc engine. functional errors must not exist in the factory configuration because it is stored and validated during production and is never updated remotely. 1 the user watchdog timer is disabled in factory configurations and during the configuration cycle of the application configuration. it is enabled after the application configuration enters user mode. quartus ii software support implementation in your design requires a remote system upgrade interface between the cyclone iv device logic array and remote system upgrade circuitry. you must also generate configuration files for production and remote programming of the system configuration memory. the quartus ii software provides these features. the two implementation options, altremote_update megafunction and remote system upgrade atom, are for the interface between the remote system upgrade circuitry and the device logic array interface. using the megafunction block instead of creating your own logic saves design time and offers more efficient logic synthesis and device implementation. f for more information about the altremote_update megafunction, refer to the remote update circuitry (altremote_update) megafunction user guide . table 8?25. 10-mhz internal oscillator specifications minimum typical maximum unit 56.510mhz 8?80 chapter 8: configuration and remote system upgrades in cyclone iv devices document revision history cyclone iv device handbook, volume 1 ? december 2010 altera corporation document revision history ta b l e 8 ?2 6 lists the revision history for this chapter. table 8?26. document revision history date version changes made december 2010 1.3 updated for the quartus ii software version 10.1 release. added cyclone iv e new device package information. updated table 8?7 , table 8?10 , and table 8?11 . minor text edits. july 2010 1.2 updated for the quartus ii software 10.0 release: updated ?power-on reset (por) circuit?, ?configuration and jtag pin i/o requirements?, and ?reset? sections. updated figure 8?10. updated table 8?16 and table 8?17. february 2010 1.1 updated for the quartus ii software 9.1 sp1 release: added?overriding the internal oscillator? and ?ap configuration (supported flash memories)? sections. updated ?jtag instructions? section. added table 8?6. updated table 8?2, table 8?3, table 8?4, table 8?6, table 8?11, table 8?13, table 8?14, table 8?15, and table 8?18. updated figure 8?4, figure 8?5, figure 8?6, figure 8?13, figure 8?14, figure 8?15, figure 8?17, figure 8?18, figure 8?23, figure 8?24, figure 8?25, figure 8?26, figure 8?27, figure 8?28, and figure 8?29. november 2009 1.0 initial release. ? february 2010 altera corporation cyclone iv device handbook, volume 1 9. seu mitigation in cyclone iv devices this chapter describes the cyclical redundancy check (crc) error detection feature in user mode and how to recover from soft errors. 1 configuration error detection is supported in all cyclone ? iv devices including cyclone iv gx devices, cyclone iv e devices with 1.0-v core voltage, and cyclone iv e devices with 1.2-v core voltage. however, user mode error detection is only supported in cyclone iv gx devices and cyclone iv e devices with 1.2-v core voltage. dedicated circuitry built into cyclone iv devices consists of a crc error detection feature that can optionally check for a single-event upset (seu) continuously and automatically. in critical applications used in the fields of avionics, telecommunications, system control, medical, and military applications, it is important to be able to: confirm the accuracy of the configuration data stored in an fpga device alert the system to an occurrence of a configuration error using the crc error detection feature for cyclone iv devices does not impact fitting or performance. this chapter contains the following sections: ?configuration error detection? on page 9?1 ?user mode error detection? on page 9?2 ?automated seu detection? on page 9?3 ?crc_error pin? on page 9?3 ?error detection block? on page 9?4 ?error detection timing? on page 9?5 ?software support? on page 9?7 ?recovering from crc errors? on page 9?10 configuration error detection 1 configuration error detection is available in all cyclone iv devices including cyclone iv gx devices, cyclone iv e devices with 1.0-v core voltage, and cyclone iv e devices with 1.2-v core voltage. configuration error detection determines if the configuration data received through an external memory device is corrupted during configuration. to validate the configuration data, the quartus ? ii software uses a function to calculate the crc value for each configuration data frame and stores the frame-based crc value in the configuration data as part of the configuration bit stream. cyiv-51009-1.1 9?2 chapter 9: seu mitigation in cyclone iv devices user mode error detection cyclone iv device handbook, volume 1 ? february 2010 altera corporation during configuration, cyclone iv devices use the same methodology to calculate the crc value based on the frame of data that is received and compares it against the frame crc value in the data stream. configuration continues until either the device detects an error or all the values are calculated. in addition to the frame-based crc value, the quartus ii software generates a 32-bit crc value for the whole configuration bit stream. this 32-bit crc value is stored in the 32-bit storage register at the end of the configuration and is used for user mode error detection that is discussed in ?user mode error detection? . user mode error detection 1 user mode error detection is available in cyclone iv gx and cyclone iv e devices with 1.2-v core voltage. cyclone iv e devices with 1.0-v core voltage do not support user mode error detection. soft errors are changes in a configuration random-access memory (cram) bit state due to an ionizing particle. cyclone iv devices have built-in error detection circuitry to detect data corruption by soft errors in the cram cells. this error detection capability continuously computes the crc of the configured cram bits based on the contents of the device and compares it with the pre-calculated crc value obtained at the end of the configuration. if the crcs match, there is no error in the current configuration cram bits. the process of error detection continues until the device is reset (by setting nconfig to low). the cyclone iv device error detection feature does not check memory blocks and i/o buffers. these device memory blocks support parity bits that are used to check the contents of memory blocks for any error. the i/o buffers are not verified during error detection because the configuration data uses flip-flops as storage elements that are more resistant to soft errors. similar flip-flops are used to store the pre-calculated crc and other error detection circuitry option bits. the error detection circuitry in cyclone iv devices uses a 32-bit crc ieee 802 standard and a 32-bit polynomial as the crc generator. therefore, a single 32-bit crc calculation is performed by the device. if a soft error does not occur, the resulting 32-bit signature value is 0x00000000 , that results in a 0 on the crc_error output signal. if a soft error occurs in the device, the resulting signature value is non-zero and the crc_error output signal is 1 . you can inject a soft error by changing the 32-bit crc storage register in the crc circuitry. after verifying the induced failure, you can restore the 32-bit crc value to the correct crc value with the same instruction and inserting the correct value. 1 before updating it with a known bad value, altera recommends reading out the correct value. chapter 9: seu mitigation in cyclone iv devices 9?3 automated seu detection ? february 2010 altera corporation cyclone iv device handbook, volume 1 in user mode, cyclone iv devices support the change_edreg jtag instruction, that allows you to write to the 32-bit storage register. you can use jam ? stapl files ( .jam ) to automate the testing and verification process. you can only execute this instruction when the device is in user mode, and it is a powerful design feature that enables you to dynamically verify the crc functionality in-system without having to reconfigure the device. you can then use the crc circuit to check for real errors induced by an seu. ta b l e 9 ?1 describes the change_edreg jtag instructions. 1 after the test completes, altera recommends that you power cycle the device. automated seu detection cyclone iv devices offer on-chip circuitry for automated checking of seu detection. applications that require the device to operate error-free at high elevations or in close proximity to earth?s north or south pole require periodic checks to ensure continued data integrity. the error detection cyclic redundancy code feature controlled by the device and pin options dialog box in the quartus ii software uses a 32-bit crc circuit to ensure data reliability and is one of the best options for mitigating seu. you can implement the error detection crc feature with existing circuitry in cyclone iv devices, eliminating the need for external logic. the crc is computed by the device during configuration and checked against an automatically computed crc during normal operation. the crc_error pin reports a soft error when configuration cram data is corrupted. you must decide whether to reconfigure the fpga by strobing the nconfig pin low or ignore the error. crc_error pin a specific crc_error error detection pin is required to monitor the results of the error detection circuitry during user mode. table 9?2 describes the crc_error pin. table 9?1. change_edreg jtag instruction jtag instruction instruction code description change_edreg 00 0001 0101 this instruction connects the 32-bit crc storage register between tdi and tdo . any precomputed crc is loaded into the crc storage register to test the operation of the error detection crc circuitry at the crc_error pin. table 9?2. cyclone iv device crc_error pin description crc_error pin type description dedicated output or open drain output (optional) by default, the quartus ii software sets the crc_error pin as a dedicated output. if the crc_error pin is used as a dedicated output, you must ensure that the v ccio of the bank in which the pin resides meets the input voltage specification of the system receiving the signal. optionally, you can set this pin to be an open-drain output by enabling the option in the quartus ii software from the error detection crc tab of the device and pin options dialog box. using the pin as an open-drain pr ovides an advantage on the voltage leveling. to use this pin as open-drain, you can tie this pin to v ccio of bank 1 through a 10-k ? pull-up resistor. alternatively, depending on the voltage input specification of the system receiving the signal, you can tie the pull-up resistor to a different pull-up voltage. 9?4 chapter 9: seu mitigation in cyclone iv devices error detection block cyclone iv device handbook, volume 1 ? february 2010 altera corporation f the crc_error pin information for cyclone iv devices is reported in the cyclone iv devices pin-outs on the altera ? website. 1 wysiwyg is an optimization technique that performs optimization on a vqm (verilog quartus mapping) netlist in the quartus ii software. error detection block ta b l e 9 ?3 lists the types of crc detection to check the configuration bits. this section focuses on the first type?the 32-bit crc when the device is in user mode. error detection registers there are two sets of 32-bit registers in the error detection circuitry that store the computed crc signature and pre-calculated crc value. a non-zero value on the signature register causes the crc_error pin to set high. figure 9?1 shows the block diagram of the error detection block and the two related 32-bit registers: the signature register and the storage register. table 9?3. types of crc detection to check the configuration bits first type of crc detection second type of crc detection cram error checking ability (32-bit crc) during user mode, for use by the crc_error pin. there is only one 32-bit crc value. this value covers all the cram data. 16-bit crc embedded in every configuration data frame. during configuration, after a frame of data is loaded into the device, the pre-computed crc is shifted into the crc circuitry. simultaneously, the crc value for the data frame shifted-in is calculated. if the pre-computed crc and calculated crc values do not match, nstatus is set low. every data frame has a 16-bit crc. therefore, there are many 16-bit crc values for the whole configuration bit stream. every device has a different length of configuration data frame. figure 9?1. error detection block diagram control signals error detection state machine 32- b it storage register comp u te & compare crc 32- b it signat u re register 32 32 32 chapter 9: seu mitigation in cyclone iv devices 9?5 error detection timing ? february 2010 altera corporation cyclone iv device handbook, volume 1 ta b l e 9 ?4 defines the registers shown in figure 9?1 . error detection timing when the error detection crc feature is enabled through the quartus ii software, the device automatically activates the crc process upon entering user mode after configuration and initialization is complete. the crc_error pin is driven low until the error detection circuitry detects a corrupted bit in the previous crc calculation. after the pin goes high, it remains high during the next crc calculation. this pin does not log the previous crc calculation. if the new crc calculation does not contain any corrupted bits, the crc_error pin is driven low. the error detection runs until the device is reset. the error detection circuitry runs off an internal configuration oscillator with a divisor that sets the maximum frequency. ta b l e 9 ?5 lists the minimum and maximum error detection frequencies. table 9?4. error detection registers register function 32-bit signature register this register contains the crc signature. the signature register contains the result of the user mode calculated crc value compared against the pre-calculated crc value. if no errors are detected, the signature register is all zeros. a non-zero signature register indicates an error in the configuration cram contents. the crc_error signal is derived from the contents of this register. 32-bit storage register this register is loaded with the 32-bit pre-computed crc signature at the end of the configuration stage. the signature is then loaded into the 32-bit crc circuit (called the compute and compare crc block, as shown in figure 9?1 ) during user mode to calculate the crc error. this register forms a 32-bit scan chain during execution of the change_edreg jtag instruction. the change_edreg jtag instruction can change the content of the storage register. therefore, the functionality of the error detection crc circuitry is checked in-system by executing the instruction to inject an error during the operation. the operation of the device is not halted when issuing the change_edreg instruction. table 9?5. minimum and maximum error detection frequencies for cyclone iv devices error detection frequency maximum error detection frequency minimum error detection frequency valid divisors (2 n ) 80 mhz/2 n 80 mhz 312.5 khz 0, 1, 2, 3, 4, 5, 6, 7, 8 9?6 chapter 9: seu mitigation in cyclone iv devices error detection timing cyclone iv device handbook, volume 1 ? february 2010 altera corporation you can set a lower clock frequency by specifying a division factor in the quartus ii software (for more information, refer to ?software support? ). the divisor is a power of two (2), where n is between 0 and 8. the divisor ranges from one through 256. refer to equation 9?1 . crc calculation time depends on the device and the error detection clock frequency. ta b l e 9 ?6 lists the estimated time for each crc calculation with minimum and maximum clock frequencies for cyclone iv devices. equation 9?1. error detection frequency 80 mhz 2 n ------------------- = table 9?6. crc calculation time device minimum time (ms) (1) maximum time (s) (2) cyclone iv e ep4ce6 (3) 5 2.29 ep4ce10 (3) 5 2.29 ep4ce15 (3) 73.17 ep4ce22 (3) 9 4.51 ep4ce30 (3) 15 7.48 ep4ce40 (3) 15 7.48 ep4ce55 (3) 23 11.77 ep4ce75 (3) 31 15.81 ep4ce115 (3) 45 22.67 cyclone iv gx ep4cgx15 6 2.93 ep4cgx22 12 5.95 ep4cgx30 12 5.95 34 (4) 17.34 (4) ep4cgx50 34 17.34 ep4cgx75 34 17.34 ep4cgx110 62 31.27 ep4cgx150 62 31.27 notes to table 9?6 : (1) the minimum time corresponds to the maximum error detection clock frequency and may vary with different processes, voltages, and temperatures (pvt). (2) the maximum time corresponds to the minimum error detection clock frequency and may vary with different pvt. (3) only applicable for device with 1.2-v core voltage (4) only applicable for the f484 device package. chapter 9: seu mitigation in cyclone iv devices 9?7 software support ? february 2010 altera corporation cyclone iv device handbook, volume 1 software support enabling the crc error detection feature in the quartus ii software generates the crc _ error output to the optional dual purpose crc _ error pin. to enable the error detection feature using crc, perform the following steps: 1. open the quartus ii software and load a project using cyclone iv devices. 2. on the assignments menu, click settings . the settings dialog box appears. 3. in the category list, select device . the device page appears. 4. click device and pin options . the device and pin options dialog box appears as shown in figure 9?2 . 5. in the device and pin options dialog box, click the error detection crc tab. 6. turn on enable error detection crc . 7. in the divide error check frequency by box, enter a valid divisor as documented in table 9?5 on page 9?5 . 1 the divisor value divides the frequency of the configuration oscillator output clock. this output clock is used as the clock source for the error detection process. 8. click ok . figure 9?2. enabling the error detection crc feature in the quartus ii software 9?8 chapter 9: seu mitigation in cyclone iv devices software support cyclone iv device handbook, volume 1 ? february 2010 altera corporation accessing error detection block through user logic the error detection circuit stores the computed 32-bit crc signature in a 32-bit register, which is read out by user logic from the core. the cycloneiv _ crcblock primitive is a wysiwyg component used to establish the interface from the user logic to the error detection circuit. the cycloneiv _ crcblock primitive atom contains the input and output ports that must be included in the atom. to access the logic array, the cycloneiv _ crcblock wysiwyg atom must be inserted into your design. figure 9?3 shows the error detection block diagram in fpga devices and shows the interface that the wysiwyg atom enables in your design. 1 the user logic is affected by the soft error failure, so reading out the 32-bit crc signature through the regout should not be relied upon to detect a soft error. you should rely on the crc_error output signal itself, because this crc_error output signal cannot be affected by a soft error. to enable the cycloneiv_crcblock wysiwyg atom, you must name the atom for each cyclone iv device accordingly. figure 9?3. error detection block diagram clock divider (1 to 256 factor) pre-computed crc (saved in the option register) crc computation error detection logic sram bits crc_error (shown in bidir mode) v cc logic array clk shiftnld ldsrc regout crc_error 80 mhz internal chip oscillator chapter 9: seu mitigation in cyclone iv devices 9?9 software support ? february 2010 altera corporation cyclone iv device handbook, volume 1 example 9?1 shows an example of how to define the input and output ports of a wysiwyg atom in a cyclone iv device. ta b l e 9 ?7 lists the input and output ports that you must include in the atom. example 9?1. error detection block diagram cycloneiv_crcblock |
Price & Availability of EP4CE30F23C7N
![]() |
|
|
All Rights Reserved © IC-ON-LINE 2003 - 2022 |
[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy] |
Mirror Sites : [www.datasheet.hk]
[www.maxim4u.com] [www.ic-on-line.cn]
[www.ic-on-line.com] [www.ic-on-line.net]
[www.alldatasheet.com.cn]
[www.gdcy.com]
[www.gdcy.net] |