SERDES Transmitter/Receiver (ALTLVDS) Megafunction User...

106
101 Innovation Drive San Jose, CA 95134 www.altera.com SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide Software Version: 7.2 Document Version: 3.3 Document Date: November 2007

Transcript of SERDES Transmitter/Receiver (ALTLVDS) Megafunction User...

Page 1: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

101 Innovation DriveSan Jose, CA 95134www.altera.com

SERDES Transmitter/Receiver (ALTLVDS)

Megafunction User Guide

Software Version: 7.2 Document Version: 3.3 Document Date: November 2007

Page 2: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Copyright © 2007 Altera Corporation. All rights reserved. Altera, The Programmable Solutions Company, the stylized Altera logo, specific device des-ignations, and all other words and logos that are identified as trademarks and/or service marks are, unless noted otherwise, the trademarks andservice marks of Altera Corporation in the U.S. and other countries. All other product or service names are the property of their respective holders. Al-tera products are protected under numerous U.S. and foreign patents and pending applications, maskwork rights, and copyrights. Altera warrantsperformance of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to makechanges to any products and services at any time without notice. Altera assumes no responsibility or liability arising out of the ap-plication or use of any information, product, or service described herein except as expressly agreed to in writing by AlteraCorporation. Altera customers are advised to obtain the latest version of device specifications before relying on any published in-formation and before placing orders for products or services.

ii MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User GuidePreliminary November 2007

UG-MF9504-3.3

Page 3: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation iiiSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Contents

About this User GuideRevision History ........................................................................................................................................ vReferenced Documents ............................................................................................................................. vHow to Contact Altera ............................................................................................................................ viTypographic Conventions ...................................................................................................................... vi

Chapter 1. About this MegafunctionDevice Family Support ......................................................................................................................... 1–1Introduction ............................................................................................................................................ 1–1Features ................................................................................................................................................... 1–2General Description ............................................................................................................................... 1–2

Soft CDR Mode ................................................................................................................................. 1–3Clock Forwarding ............................................................................................................................. 1–3Soft CDR Recovered Clock Simulation ......................................................................................... 1–4Common Applications .................................................................................................................... 1–4

Resource Utilization and Performance ............................................................................................... 1–5

Chapter 2. Getting StartedSoftware and System Requirements ................................................................................................... 2–1MegaWizard Plug-In Manager Customization ................................................................................. 2–1MegaWizard Page Descriptions .......................................................................................................... 2–2

MegaWizard Plug-In Manager Pages for the LVDS Transmitter ............................................. 2–5LVDS Transmitter Using a Dedicated SERDES Block or SERDES in LEs .......................... 2–5LVDS Transmitter Using an External PLL ............................................................................ 2–12

LVDS Transmitter Using External PLL and Dedicated SERDES Block ....................... 2–13LVDS Transmitter Using External PLL and SERDES in LEs ........................................ 2–15

MegaWizard Plug-In Manager Pages for the LVDS Receiver ................................................. 2–16LVDS Receiver Using a Dedicated SERDES Block or SERDES in LEs .............................. 2–16LVDS Receiver Using an External PLL .................................................................................. 2–31

LVDS Receiver Using External PLL and Dedicated SERDES Block ............................ 2–31LVDS Receiver Using External PLL and SERDES in LEs .............................................. 2–33

Common Pages for ALTLVDS Receiver and Transmitter ....................................................... 2–34Instantiating Megafunctions in HDL Code or Schematic Designs ............................................... 2–36

Generating a Netlist for EDA Tool Use ....................................................................................... 2–37Using the Port and Parameter Definitions .................................................................................. 2–37

Identifying a Megafunction After Compilation .............................................................................. 2–40Simulation ............................................................................................................................................. 2–42

Quartus II Software Simulation ................................................................................................... 2–42EDA Simulation .............................................................................................................................. 2–43

SignalTap II Embedded Logic Analyzer .......................................................................................... 2–43Design Example 1: LVDS-to-LVDS Bridge Using Different Clock Frequencies ........................ 2–44

Page 4: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

iv MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Contents

Design Files ..................................................................................................................................... 2–44Example ........................................................................................................................................... 2–44Generate an altlvds Receiver and altlvds Transmitter .............................................................. 2–45Functional Results—Simulate the altlvds Receiver/Transmitter Design in the ModelSim-Altera Simulator .......................................................................................................... 2–50

Design Example 2: Cyclone II altlvds Using External PLL Option .............................................. 2–51Design Files ..................................................................................................................................... 2–52Example ........................................................................................................................................... 2–52Generate an altlvds Receiver and altlvds Transmitter .............................................................. 2–52

Integrating the altlvds Receiver and Transmitter in the Design ........................................ 2–56Parameters Used by altpll ........................................................................................................ 2–57

Functional Results—Simulate the altlvds Receiver/Transmitter Design in the Quartus II Software ........................................................................................................................................... 2–59Timing Results—Simulate the altlvds Receiver/Transmitter Design in the Quartus II Software............................................................................................................................................................2–60

Functional Results—Simulate the altlvds Receiver/Transmitter Design in the ModelSim-Altera Simulator ......................................................................................................................................... 2–62

Design Example 3: Stratix III Soft Clock Data Recovery ................................................................ 2–64Design Files ..................................................................................................................................... 2–64Example ........................................................................................................................................... 2–65Generate an altlvds Receiver and altlvds Transmitter .............................................................. 2–65Functional Results—Simulate the altlvds Receiver/Transmitter Design in the ModelSim-Altera Simulator .......................................................................................................... 2–69

Conclusion ............................................................................................................................................ 2–70

Chapter 3. SpecificationsPorts and Parameters ............................................................................................................................ 3–1

Page 5: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variablevNovember 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

About this User Guide

Revision History The following table shows the revision history for this user guide.

Referenced Documents

This user guide references the following documents:

■ altpll Megafunction User Guide■ AN 236: Using Source-Synchronous Signaling with DPA in Stratix GX

Devices

Date and Document Version Changes Made Summary of Changes

November 2007v3.3

Updated for the Quartus® II software v7.2, including:● Added soft-CDR mode.● Added description of new receiver output port

“rx_divfwdclk[]”.● Added description of new receiver parameters

“ENABLE_SOFT_CDR”, “IS_NEGATIVE_PPM_DRIFT”, “NET_PPM_VARIATION”, “ENABLE_DPA_INITIAL_PHASE _SELECTION”, “DPA_INITIAL_PHASE_ VALUE”, and “ENABLE_DPA_ALIGN_TO_ RISING_EDGE_ONLY”.

● Updated two design examples.● Added third design example using soft-CDR

mode.

Updated for the Quartus II software v7.2 release, including soft-CDR mode and extra design example additions.

March 2007v3.2

Updated for Quartus II software 7.0, including

Cyclone® III information.

December 2006v3.1

Updated Table 1-1 to include Stratix® III information. —

November 2006v3.0

Updated for the Quartus II software 6.1. —

June 2006v2.0

Updated for the Quartus II software 6.0. —

August 2005v1.1

Minor content changes. —

December 2004v1.0

Initial release. —

Page 6: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

vi MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

How to Contact Altera

■ AN 409: Design Example Using the altlvds Megafunction & the External PLL Option in Stratix II Devices

■ Clock Networks and PLLs in Stratix III Devices chapter in volume 1 of the Stratix III Device Handbook

■ Design Debugging Using the SignalTap II Embedded Logic Analyzer chapter in volume 3 of the Quartus II Handbook

■ Quartus II Integrated Synthesis chapter in volume 1 of the Quartus II Handbook

■ Recommended HDL Coding Styles chapter in volume 1 of the Quartus II Handbook

■ Simulation section in volume 3 of the Quartus II Handbook■ Synthesis section in volume 1 of the Quartus II Handbook

How to Contact Altera

For the most up-to-date information about Altera® products, refer to the following table.

Typographic Conventions

This document uses the following typographic conventions.

Contact (1) Contact Method Address

Technical support Website www.altera.com/mysupport

Technical training Website www.altera.com/training

Email [email protected]

Product literature Website www.altera.com/literature

Altera literature services Email [email protected]

Non-technical support (General) Email [email protected]

(Software Licensing) Email [email protected]

Note to table:(1) You can also contact your local Altera sales office or sales representative.

Visual Cue Meaning

Bold Type with Initial Capital Letters

Command names, dialog box titles, checkbox options, and dialog box options are shown in bold, initial capital letters. Example: Save As dialog box.

bold type External timing parameters, directory names, project names, disk drive names, filenames, filename extensions, and software utility names are shown in bold type. Examples: fMAX, \qdesigns directory, d: drive, chiptrip.gdf file.

Italic Type with Initial Capital Letters

Document titles are shown in italic type with initial capital letters. Example: AN 75: High-Speed Board Design.

Page 7: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variableviiNovember 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

About this User Guide

Italic type Internal timing parameters and variables are shown in italic type. Examples: tPIA, n + 1.

Variable names are enclosed in angle brackets (< >) and shown in italic type. Example: <file name>, <project name>.pof file.

Initial Capital Letters Keyboard keys and menu names are shown with initial capital letters. Examples: Delete key, the Options menu.

“Subheading Title” References to sections within a document and titles of on-line help topics are shown in quotation marks. Example: “Typographic Conventions.”

Courier type Signal and port names are shown in lowercase Courier type. Examples: data1, tdi, input. Active-low signals are denoted by suffix n, e.g., resetn.

Anything that must be typed exactly as it appears is shown in Courier type. For example: c:\qdesigns\tutorial\chiptrip.gdf. Also, sections of an actual file, such as a Report File, references to parts of files (e.g., the AHDL keyword SUBDESIGN), as well as logic function names (e.g., TRI) are shown in Courier.

1., 2., 3., anda., b., c., etc.

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

■ ● • Bullets are used in a list of items when the sequence of the items is not important.

v The checkmark indicates a procedure that consists of one step only.

1 The hand points to information that requires special attention.

c A caution calls attention to a condition or possible situation that can damage or destroy the product or the user’s work.

w A warning calls attention to a condition or possible situation that can cause injury to the user.

r The angled arrow indicates you should press the Enter key.

f The feet direct you to more information about a particular topic.

Visual Cue Meaning

Page 8: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

viii MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Typographic Conventions

Page 9: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 1–1November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Chapter 1. About thisMegafunction

Device Family Support

The SERDES Transmitter/Receiver (ALTLVDS) megafunctions support the following target Altera® device families:

■ Arria™ GX■ Stratix® III■ Stratix II■ Stratix II GX■ Stratix■ Stratix GX■ Cyclone® III■ Cyclone II■ Cyclone■ HardCopy® II■ HardCopy Stratix■ MAX® II■ MAX 7000AE■ MAX 7000B■ MAX 7000S■ MAX 3000A■ ACEX 1K®

■ APEX™ II■ APEX 20KC■ APEX 20KE■ FLEX 10K®

■ FLEX® 10KA■ FLEX 10KE■ FLEX 6000

Introduction As design complexities increase, use of vendor-specific IP blocks has become a common design methodology. Altera provides parameterizable megafunctions that are optimized for Altera device architectures. Using megafunctions instead of coding your own logic saves valuable design time. Additionally, the Altera-provided functions may offer more efficient logic synthesis and device implementation. You can scale the megafunction’s size by setting parameters.

Page 10: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

1–2 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Features

Features The altlvds megafunctions implement either an LVDS deserializer receiver or an LVDS serializer transmitter and offer many additional features:

■ Parameterizable data channel widths■ Parameterizable serializer/deserializer (SERDES) factors■ Registered inputs and outputs■ Dynamic Phase Alignment (DPA) mode support in Stratix III,

Stratix II GX, Stratix II and Stratix GX receivers■ Ability to share fast phase-locked loops (PLL) between transmitter

and receivers■ PLL control signals■ Have flexibility to implement in dedicated circuitry or in logic cells.

This varies according to the device.■ Support for separate PLL in Stratix III, Stratix II, Stratix II GX,

Cyclone III, Cyclone II, Cyclone, and HardCopy II devices■ Soft Clock-Data Recovery (CDR) mode support for Stratix III devices

General Description

The altlvds megafunctions are provided in the Quartus® II software MegaWizard® Plug-In Manager. The altlvds megafunctions instantiate LVDS transmitters (altlvds_tx) and LVDS receivers (altlvds_rx). The altlvds_tx megafunction implements a serialization transmitter, and the altlvds_rx megafunction implements a deserialization receiver. These megafunctions can be used to take advantage of the dedicated SERDES circuitry for high-speed differential data transfer applications in Stratix III, Stratix II, Stratix II GX, Stratix GX, Stratix, HardCopy II, and HardCopy devices. The altlvds megafunctions can also be used to implement SERDES circuitry using logic elements (LEs) and PLLs in Cyclone III, Cyclone II and Cyclone devices. By using the altlvds megafunctions, you can customize and control LVDS data received or transmitted to many source synchronous channels. The altlvds megafunctions have features that are unique to each supported device family.

To achieve high data transfer rates, the Stratix III, Stratix II, Stratix II GX, Stratix GX, Stratix, HardCopy II, and HardCopy devices support True-LVDS™ differential I/O interfaces that have dedicated SERDES circuitry for each differential I/O pair. Refer to the specific device data sheets for transmitting and receiving data rates for respective devices.

On the receiver side, the high-frequency clock generated by the PLL shifts the serial data through a shift register (also called the deserializer). The parallel data is clocked out to the logic array that is synchronized with the low frequency clock.

Administrator
高亮
Administrator
高亮
Page 11: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable1–3November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

About this Megafunction

On the transmitter side, the parallel data from the logic array is first clocked into a parallel-in, serial-out shift register that is synchronized with the low-frequency clock, and then transmitted out by the output buffers.

The DPA circuitry supports multiple SERDES factors. Each channel has its own DPA circuit that provides independent data alignment for each channel; therefore, DPA can reduce channel-to-channel skew as well as clock-to-channel skew.

Cyclone series (Cyclone III, Cyclone II, and Cyclone) devices do not support the dedicated DPA circuitry.

Cyclone series (Cyclone III, Cyclone II, and Cyclone) devices also allow the SERDES implementation at certain data rates for a specific device. Refer to the specific device data sheets for supported data rates. For the LVDS transmitter and receiver, the altlvds megafunctions implement serialization and deserialization using LEs and PLLs.

Soft CDR Mode

Stratix III devices support a new soft CDR mode. This mode supports the Serial Gigabit Media Independent Interface (SGMII) protocol. Clock-data recovery removes the clock from the clock-embedded data, a capability required for SGMII support.

The Stratix III LVDS block requires the new mode to support clock forwarding to the core, described in the “Clock Forwarding” section. In Stratix III devices, each LVDS channel can be in soft CDR mode and can drive the core. However, Stratix III devices do not contain dedicated hardware for CDR support. Instead, the CDR circuitry is implemented as part of the altlvds megafunction instantiation.

Clock Forwarding

The Stratix III LVDS block supports clock forwarding to the core. In soft CDR mode, the DPA clock is forwarded to the core after being divided by the deserialization factor. The divclkout output signal from the LVDS block holds the forwarded clock signal. The signal is routed to the new Periphery Clock (PCLK) network.

The DPA block determines the optimal DPA clock, which is forwarded to the core. As in normal DPA operation, the DPA block selects an optimal phase to sample the data. The captured data is passed to the bitslip block, and then to the deserializer. The deserializer divides both the DPA clock and the data by the deserialization factor. The newly divided clock

Administrator
高亮
Administrator
附注
动态相位校准
Administrator
高亮
Administrator
高亮
Page 12: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

1–4 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

General Description

signal is placed on the PCLK network, which carries the clock signal to the core. In Stratix III devices, each LVDS channel can be in soft CDR mode and can drive the core using the PCLK network.

f The PCLK network originates in the DPA block of a Stratix III device. For more information about PCLKs, refer to the Clock Networks and PLLs in Stratix III Devices chapter in volume 1 of the Stratix III Device Handbook.

Soft CDR Recovered Clock Simulation

The Quartus II software supports simulation of the forwarded clock, also called the recovered clock, based on the user-specified ppm value. The ppm value specifies the number of clock cycles drift between the transmitter and receiver after a million clock cycles. The drift is positive if the transmitter is faster than the receiver, and negative if the receiver is faster than the transmitter.

You can specify the ppm value using two new simulation-only parameters for the altlvds megafunction. The value of NET_PPM_VARIATION is the absolute value of the drift, and the IS_NEGATIVE_PPM_DRIFT parameter specifies whether the drift is positive or negative. The Quartus II simulator simulates the ppm variation by shifting the recovered data and clock based on the user-specified ppm value.

Common Applications

The SERDES interface is used to transmit and receive high-speed differential data. This enables moving data from board-to-board or box-to-box with great efficiency. This high performance consumes a minimum of power, is relatively immune to noise, and is cost effective. Typical applications of LVDS technology are common in PC computing (such as flat panel displays and monitor links), telecommunication and data-communication systems (such as routers, hubs, and switches) and other common consumer and commercial applications (such as set-top boxes and in-flight entertainment).

The Stratix III LVDS block supports a new soft CDR mode. This mode supports the widely-used SGMII protocol. Clock-data recovery removes the clock from the clock-embedded data, a capability required for SGMII support. This new mode is called soft CDR mode because the CDR circuitry is implemented in the LEs.

f For additional information about common applications supported, and for full details on the I/O standards and high-speed protocols supported, refer to the applicable data sheet or device handbook for each device family.

Administrator
高亮
Page 13: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable1–5November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

About this Megafunction

Resource Utilization and Performance

Every instantiation of altlvds uses one fast PLL. The Quartus II software properly configures the PLL according to the settings you apply in the altlvds wizard. Stratix III, Stratix II, Stratix II GX, Cyclone III, Cyclone II, Cyclone, HardCopy II, and HardCopy Stratix devices provide the option to use an external PLL, which requires you to enter the appropriate PLL parameters.

f For more information about the PLL parameters, refer to the altpll Megafunction User Guide.

All Stratix families support the Use Shared PLL(s) for Receiver and Transmitter option to place both the LVDS transmitter and the LVDS receiver in the same device I/O bank. The Quartus II software lets the transmitter and receiver share the same fast PLL when both use the same input clock frequency. Although you must separate the transmitter and receiver modules in your design, the Quartus II software merges the fast PLLs, when appropriate, and gives you the following message:

Info: Receiver fast PLL <lvds_rx PLL name> and transmitter fast PLL <lvds_tx PLL name> are merged together

The Quartus II software displays the following message when it cannot merge the fast PLLs for the LVDS transmitter and receiver pair in the design:

Warning: Can't merge transmitter-only fast PLL <lvds_tx PLL name> and receiver-only fast PLL <lvds_rx PLL name>

For Stratix device families, the side I/O banks contain dedicated SERDES circuitry, which includes the fast PLLs, serial shift registers, and parallel registers. The transmit and receive functions use varying numbers of LEs depending on the number of channels and serialization and deserialization factors. For best performance, these LEs must be placed in the columns as close to the SERDES circuitry and LVDS pins as possible. This is done by the Quartus II software automatically during place-and-route.

Cyclone III, Cyclone II, and Cyclone devices use DDIO registers as part of the SERDES interface. Since data is clocked on both the rising and falling edge, the clock frequency must be half the data rate; therefore, the PLL runs at half the frequency of the data rate. The core clock frequency for the transmitter is data rate divided by the serialization factor (J). For the Odd serialization factors, depending on the output clock-divide factor (B) and device family, an optional core clock frequency of data rate divided by two times the serialization factor (J) is also available.

Administrator
高亮
Administrator
高亮
Administrator
高亮
Page 14: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

1–6 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Resource Utilization and Performance

Use Table 1–1 and Table 1–2 to determine the clock and data rate relationships.

The Quartus II software reports the number of LEs used per altlvds function in the Fitter Resource Utilization by Entity section within the Resource section of the Compilation Report file.

Table 1–1. Cyclone III, Cyclone II, and Cyclone altlvds Receiver Clock Relationships

Clock Type J = Even J = Odd

Fast Clock Data Rate / 2 Data Rate / 2

Slow Clock (outclock) Data Rate / J Data Rate / J

Table 1–2. Cyclone III, Cyclone II, and Cyclone altlvds Transmitter Clock Relationships

Clock Type J = Even J = Odd

Fast Clock Data Rate / 2 Data Rate / 2

Slow Clock (outclock) Data Rate / 2 * B Data Rate / 2 * B

Core Clock Data Rate / J Data Rate / J

Page 15: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–1November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

2. Getting Started

Software and System Requirements

The instructions in this section require the following software:

■ For operating system support information, refer to:

www.altera.com/support/software/os_support/oss-index.html

■ Quartus® II software

MegaWizard Plug-In Manager Customization

Use the MegaWizard® Plug-In Manager to create or modify design files that contain custom altlvds variations which can then be instantiated in a design file. The MegaWizard Plug-In Manager provides a wizard that allows you to specify options for the custom altlvds megafunction freatures in your design.

The MegaWizard Plug-In Manager is the most efficient way to customize your altlvds functions. Stratix® III, Stratix II, Stratix II GX, Stratix, Stratix GX, HardCopy® II, and HardCopy devices each have different features available when using the dedicated serializer/deserializer (SERDES) circuitry. Cyclone® III, Cyclone II, and Cyclone devices do not have dedicated SERDES circuitry; therefore, the functions are implemented in registers using logic elements. The wizard displays only the features that are appropriate to the selected device family. Within each selected device, certain features are available, depending on the modes that you specify.

Start the MegaWizard Plug-In Manager in one of the following ways:

■ On the Tools menu, click MegaWizard Plug-In Manager.■ When working in the Block Editor, from the Edit menu, click Insert

Symbol as Block, or right-click in the Block Editor, point to Insert, and click Symbol as Block. In the Symbol window, click MegaWizard Plug-In Manager.

■ Start the stand-alone version of the MegaWizard Plug-In Manager by typing the following command at the command prompt:qmegawiz r

Administrator
高亮
Administrator
高亮
Page 16: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–2 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

MegaWizard Page Descriptions

MegaWizard Page Descriptions

This section provides descriptions of the options available on the individual pages of the altlvds wizard.

The first two pages of the megafunction are the same for all supported devices. On page 1 of the MegaWizard Plug-In Manager, you can select Create a new custom megafunction variation, Edit an existing custom megafunction variation, or Copy an existing custom megafunction variation (Figure 2–1).

Figure 2–1. MegaWizard Plug-In Manager [page 1]

On page 2a of the MegaWizard Plug-In Manager, you can specify the megafunction, the family of device to use, the type of output file to create, and the name of the output file (Figure 2–2). The altlvds megafunction appears in the I/O category. You can choose AHDL (.tdf), VHDL (.vhd), or Verilog HDL (.v) as the output file type.

Page 17: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–3November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

Figure 2–2. MegaWizard Plug-In Manager [page 2a]

The selections you make on page 3 dictate the format of the remaining pages. The device family that you select determines the ports and parameters that are available on this and the following pages. For every device family, the pages for the LVDS transmitter are different than the pages for the LVDS receiver. For the receiver or the transmitter, if the device allows you to choose whether to implement the serializer/deserializer (SERDES) circuitry in logic cells or in a dedicated SERDES block, your choice affects the other parametrization choices available to you. Similarly, you may be able to choose whether to use an external PLL. For the receiver, if you can choose whether to enable Dynamic Phase Alignment mode, your choice affects the other parametrization choices available to you.

Page 18: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–4 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

MegaWizard Page Descriptions

Figure 2–3. MegaWizard Plug-In Manager—ALTLVDS receiver [page 3 of 5]

On page 3, you specify whether this megafunction is an LVDS transmitter or receiver, the number of channels, and the deserialization factor. The number of channels you select changes the width of the rx_in port, and the deserialization factor changes the width of the rx_out port. If the required number of channels is not available in the list, type the desired number in the What is the number of channels? box. The list for the deserialization factor is device-dependent.

Your choice of device and transmitter or receiver determines whether the remaining options on this page are available to you or are greyed out.

The left side of the MegaWizard Plug-In Manager displays a schematic representation of the custom megafunction variation that you are creating. The schematic updates automatically as the ports and parameters change.

1 For online help assistance, click the Documentation button to view the Quartus II Help file for the LVDS transmit or receive megafunction.

Administrator
高亮
Page 19: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–5November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

MegaWizard Plug-In Manager Pages for the LVDS Transmitter

On page 3, after you select the LVDS transmitter, depending on the device you selected, you can choose to implement the SERDES circuitry in logic cells or in a dedicated SERDES block. Similarly, depending on the device, you can choose to use an external PLL.

LVDS Transmitter Using a Dedicated SERDES Block or SERDES in LEs

This section discusses the options available for configuring the LVDS transmitter megafunction if an internal PLL is used.

The general LVDS transmitter page appears in Figure 2–4.

Figure 2–4. MegaWizard Plug-In Manager—ALTLVDS [page 3 of 5]: LVDS Transmitter

Page 20: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–6 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

MegaWizard Page Descriptions

On page 3, several options can be customized for the transmitter settings. The options are described in Table 2–1.

Table 2–1. altlvds Transmitter Settings Options (Page 3)

Option Description Comments

Implement Serializer/Deserializer circuitry in logic cells

If not enabled, the megafunction takes advantage of dedicated SERDES circuitry in the device. If enabled, SERDES circuitry is implemented in logic cells. This feature is supported by Arria GX, Stratix III, Stratix II, Stratix II GX, Stratix GX, Stratix, HardCopy II, and HardCopy Stratix devices. In the Cyclone series devices, SERDES circuitry is always implemented in logic cells.

If enabled, the transmitter starts its operation on the first fast clock edge after the PLL is locked. This option is intended for slow speeds and byte alignment may be different from the hard SERDES implementation.

What is the number of channels? Number of output channels available for the LVDS transmitter. The allowed values depend on the pins available in the device. Refer to the relevant device handbook for the allowed values for your device.

For example, if the number of channels is 44, a tx_out[43..0] port is created.

What is the deserialization factor? This value determines the number of parallel bits from the core that the transmitter serializes and sends out. Refer to the relevant device handbook for the valid deserialization factors for your device.

For example, if the deserialization factor is 10 and the number of output channels is 1, the transmitter serializes every 10 parallel bits into the single output channel. If the deserialization factor is 10 and the number of channels is 44, a tx_in[439..0] port is created.

Use External PLL This determines whether to use an external PLL to clock the SERDES transmitter. If this option is not enabled, the megafunction automatically implements an internal PLL to clock the LVDS transmitter block. If this option is enabled, a separate PLL must be used to provide the clocking source. It is the user’s responsibility to make the necessary connections.

If not enabled, the next page displays the PLL settings. The PLL settings page is skipped if this option is enabled.

Page 21: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–7November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

Page 4 of the wizard is the Frequency/PLL settings page (Figure 2–5). This page appears only if an internal PLL is used.

Figure 2–5. MegaWizard Plug-In Manager—ALTLVDS [page 4 of 7]: LVDS Transmitter

Page 22: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–8 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

MegaWizard Page Descriptions

Table 2–2 describes the options you have on page 4 to customize the frequency and PLL settings.

Table 2–2. altlvds Transmitter Frequency/PLL Settings Options (Page 4) (Part 1 of 3)

Option Description Comments

What is the output data rate? The value specifies the data rate for the output channel of the transmitter, in Mbps. For data rate ranges, refer to the specific DC & Switching Characteristics chapter in the appropriate device handbook.

This value determines the allowed input clock rate values.

Specify the input clock rate by The value specifies the tx_inclock frequency to the internal PLL. The allowed values depend on the output data rate selected.

What is the phase alignment of ‘tx_in’ with respect to the rising edge of 'tx_inclock'? (in degrees)

This value determines the phase alignment of the data transmitted by the transmitter core with respect to the tx_inclock. Available values are 0 (edge-aligned), 45, 90, 135, 180 (center-aligned), 225, 270, 315.

Use ‘tx_pll_enable’ input port This port gives you control over the enable port of the fast PLL that is used with this function.

If the transmitter shares the PLL with the receiver, and the tx_pll_enable port is used, this port must be used in both megafunction instantiations and the two signals must be tied together in the design file. If the PLL-enable port is used in one megafunction instance and not the other, the PLLs are not shared, and a warning appears during compilation.

Page 23: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–9November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

Use "pll_areset" input port This option gives you control over the asynchronous reset port of the fast PLL that is used with this function.

When the transmitter shares the PLL with the receiver and the pll_areset port is used, this port must be used in both megafunction instantiations and the two signals must be tied together in the design file. If the PLL-enable port is used in one megafunction instance and not the other, the PLLs are not shared, and a warning appears during compilation.

Align clock to the center of the data window

When enabled, a phase shift of 90 degrees is added to the clock to center the clock in the data. Use this parameter for PLL merging if the receiver has the option enabled.

This option is available only for Arria GX, Stratix II GX, Stratix II, and HardCopy II devices when SERDES is implemented in logic cells, and for Cyclone II devices. For Cyclone III devices and Stratix III (LE Implementation) devices, the option is always enabled.

Enable self-reset on lost lock in PLL If enabled, the PLL resets automatically whenever it loses lock.

This option is available only for Stratix III and Cyclone III devices when SERDES is implemented in logic cells.

Table 2–2. altlvds Transmitter Frequency/PLL Settings Options (Page 4) (Part 2 of 3)

Option Description Comments

Page 24: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–10 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

MegaWizard Page Descriptions

Use shared PLL(s) for receivers and transmitters

When this option is enabled, your LVDS receivers and transmitters can share the same PLL.

This option can be used if the LVDS receivers and transmitters use the same input clock frequency, deserialization factor, and data rates.

Register "tx_in" input port using If enabled, specify whether input registers are clocked by tx_inclock or by tx_coreclock. When PLLs are shared, the tx_inclock port should be connected to the same reference clock as the receiver function. For example, if tx_inclock is connected to a 500 MHz input reference clock, and the parallel data rate is not 500 MHz, then the parallel data should be registered using tx_coreclock, which runs at the output serial data rate divided by the deserialization factor. This frequency matches the parallel data rate from the FPGA core.

If you turn this parameter off, a warning message appears directing you to pre-register the inputs in the logic that feeds the transmitter and also directing you to specify values for Multicycle and Multicycle Hold assignment from the input registers to the transmitter. The values are equal to the deserialization factor minus one, and the deserialization factor, respectively.

Table 2–2. altlvds Transmitter Frequency/PLL Settings Options (Page 4) (Part 3 of 3)

Option Description Comments

Page 25: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–11November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

Page 5 (shown in Figure 2–6) is used to specify the transmitter settings options. The options for this page are described in Table 2–3.

Figure 2–6. MegaWizard Plug-In Manager—ALTLVDS [page 5 of 7]: LVDS Transmitter

Table 2–3 describes the transmitter settings options available on page 5.

Table 2–3. altlvds Transmitter Settings Options (Page 5) (Part 1 of 2)

Option Description Comments

Use "tx_outclock" output port The tx_outclock signal is associated with the serial transmit data stream.

What is the outclock divide factor (B)?

Specifies the frequency of the tx_outclock port as[transmitter output data rate / B]. Refer to the relevant device handbook for valid values.

The tx_outclock frequency is the transmitter output data rate divided by the outclock divide factor.

Page 26: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–12 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

MegaWizard Page Descriptions

LVDS Transmitter Using an External PLL

This section discusses the options available for configuring the LVDS transmitter megafunction if an external PLL is used. To use an external PLL, select Use External PLL on page 3 of the wizard (Figure 2–4 on page 2–5). The options for this page are described in Table 2–1 on page 2–6.

What is the phase alignment of "tx_outclock" with respect to ‘tx_out’ (in degrees)?

This value specifies the phase alignment of tx_outclock with respect to tx_out or tx_inclock. Available values are 0 (edge-aligned), 45, 90, 135, 180 (center-aligned), 225, 270, and 315.

This option is available only if the tx_outclock port is used.

Use "tx_locked " output port This port allows you to monitor the lock status of the PLL.

The status of the lock port is identical for the transmitter and receiver when shared PLLs are used.

Use “tx_coreclock” output port This port is used to show the core clock frequency during simulation. The tx_coreclock port should be used to register all logic that feeds the LVDS transmitter function. If any other clock feeds the transmit function, your design must implement the clock domain transfer circuitry.

What is the clock resource used for “tx_coreclock”?

This value specifies the clock resource type fed to the tx_coreclock port. Allowed values are Auto Selection (type is determined by the compiler), Global Clock, and Regional Clock. The default value is Auto Selection.

This information assists with clock management in the device.

Table 2–3. altlvds Transmitter Settings Options (Page 5) (Part 2 of 2)

Option Description Comments

Page 27: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–13November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

If you choose to implement the LVDS transmitter using an external PLL, you must implement a PLL outside of the LVDS megafunction. You must ensure your circuit has the correct input and functionality to generate an appropriate clock frequency, and is connected to the LVDS transmitter correctly.

f Information about external PLL options can be found in the application note AN 409: Design Example Using the altlvds Megafunction & the External PLL Option in Stratix II Devices.

LVDS Transmitter Using External PLL and Dedicated SERDES BlockThe ability to use a dedicated SERDES block in your LVDS transmitter and to clock the transmitter using an external PLL is device-dependent.

If you use a Stratix III device, clock your LVDS transmitter using an external PLL, and implement the SERDES for the transmitter using a dedicated SERDES block, a notification window pops up after you enter these settings on page 3 of the wizard (Figure 2–7).

Figure 2–7. MegaWizard Plug-In Manager Notification for Stratix III Device (LVDS Transmitter)

Administrator
高亮
Page 28: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–14 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

MegaWizard Page Descriptions

If you use an Arria GX, Stratix II, Stratix II GX, or HardCopy II device, clock your LVDS transmitter using an external PLL, and implement the SERDES for the transmitter using a dedicated SERDES block, a different notification window pops up after you enter these settings on page 3 of the wizard (Figure 2–8).

Figure 2–8. MegaWizard Plug-In Manager Notification for Other Devices (LVDS Transmitter)

For Stratix, Stratix GX, and HardCopy Stratix devices, if you implement the SERDES for your LVDS transmitter using a dedicated SERDES block, you do not have the option to use an external PLL.

The Cyclone series of devices (Cyclone III, Cyclone II, and Cyclone devices) do not have a dedicated SERDES block available for use by your LVDS transmitter. Therefore, you do not have the option to use a dedicated SERDES block in these devices.

After you select Use External PLL and do not select Implement Serializer/Deserializer circuitry in logic cells on page 3 of the wizard, and click Next, the Transmitter settings page appears (Figure 2–9). If you choose to use an external PLL, this page appears only if you choose to implement SERDES in a dedicated SERDES block.

This page is the same as the Transmitter settings page that appears when you choose to use an internal PLL (Figure 2–6 on page 2–11), except the options to create tx_locked and tx_coreclock output ports are not available. The options that appear in the Transmitter settings page are described in Table 2–3 on page 2–11.

Page 29: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–15November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

Figure 2–9. MegaWizard Plug-In Manager—ALTLVDS [page 4 of 6]: Transmitter Settings Page

LVDS Transmitter Using External PLL and SERDES in LEsIf you use an Arria GX, Stratix series, Cyclone series, HardCopy II, or HardCopy Stratix device, clock your LVDS transmitter using an external PLL, and implement the SERDES for the transmitter using logic cells, a notification window pops up after you enter these settings on page 3 of the wizard (Figure 2–10).

Page 30: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–16 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

MegaWizard Page Descriptions

Figure 2–10. MegaWizard Plug-In Manager Notification for SERDES in LEs (LVDS Transmitter)

The Transmitter settings page does not appear.

MegaWizard Plug-In Manager Pages for the LVDS Receiver

On page 3, after you select the LVDS receiver, depending on the device you selected, you can choose to implement the SERDES circuitry in logic cells or in a dedicated SERDES block. Similarly, depending on the device, you can choose to use an external PLL. In addition, for the LVDS receiver only, you can choose to enable DPA mode.

LVDS Receiver Using a Dedicated SERDES Block or SERDES in LEs

This section discusses the options available for configuring the LVDS receiver megafunction if an internal PLL is used. The general LVDS receiver page appears in Figure 2–11.

Page 31: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–17November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

Figure 2–11. MegaWizard Plug-In Manager—ALTLVDS [page 3 of 5]: LVDS Receiver

On page 3, several options can be customized for the receiver settings. The options are described in Table 2–4. Except for the option to enable DPA mode, these options are the same as those described in Table 2–1 on

Page 32: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–18 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

MegaWizard Page Descriptions

page 2–6 for the LVDS transmitter. However, their meanings are slightly different for the LVDS receiver, because both the data flow and SERDES functionality are reversed.

Table 2–4. altlvds Receiver Settings Options (Page 3) (Part 1 of 2)

Option Description Comments

Implement Serializer/Deserializer circuitry in logic cells

If not enabled, the megafunction takes advantage of dedicated SERDES circuitry in the device. If enabled, SERDES circuitry is implemented in logic cells. This feature is supported by Arria GX, Stratix III, Stratix II, Stratix II GX, Stratix GX, Stratix, HardCopy II, and HardCopy Stratix devices. In the Cyclone series devices, SERDES circuitry is always implemented in logic cells.

If enabled, the receiver starts its operation on the first fast clock edge after the PLL is locked. This option is intended for slow speeds and byte alignment may be different from the hard SERDES implementation.

Enable Dynamic Phase Alignment mode (receiver only)

If enabled, DPA mode helps to correct skew created by different trace lengths on the data channels routed to the device. This mode adds several ports and parameters to the megafunction instantiation. This option is available for Arria GX, Stratix III, Stratix II, Stratix II GX, Stratix GX, and HardCopy II devices only.

Enabling DPA mode changes the appearance of the graphic representation of the megafunction in the left-hand pane. When DPA mode is turned on, two pages are added to the wizard to include the additional DPA mode ports and parameters (the DPA Settings 1 and DPA Settings 2 pages).

What is the number of channels? Number of input channels available for the LVDS receiver. The allowed values depend on the pins available in the device. Refer to the relevant device handbook for the allowed values for your device.

For example, if the number of channels is 44, an rx_in[43..0] port is created.

Administrator
高亮
Page 33: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–19November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

What is the deserialization factor? This value determines the number of serial input data bits that the receiver deserializes to send to the core on a single cycle. Refer to the relevant device handbook for the valid deserialization factors for your device.

For example, if the deserialization factor is 10 and the number of input channels is 1, the transmitter deserializes every 10 serial bits into 10 bits of parallel data to send to the core. If the deserialization factor is 10 and the number of channels is 44, an rx_out[439..0] port is created.

Use External PLL This determines whether to use an external PLL to clock the SERDES receiver. If this option is not enabled, the megafunction automatically implements an internal PLL to clock the LVDS receiver block. If this option is enabled, a separate PLL must be used to provide the clocking source. It is the user’s responsibility to make the necessary connections.

If not enabled, the next page displays the PLL settings. The PLL settings page is skipped if this option is enabled.

Table 2–4. altlvds Receiver Settings Options (Page 3) (Part 2 of 2)

Option Description Comments

Administrator
高亮
Page 34: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–20 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

MegaWizard Page Descriptions

Page 4 of the wizard is the Frequency/PLL settings page (Figure 2–12). This page appears only if an internal PLL is used.

Figure 2–12. MegaWizard Plug-In Manager—ALTLVDS [page 4 of 9]: LVDS Receiver

Table 2–5 describes the options you have on page 4 to customize the frequency and PLL settings, depending on the device and options you selected on previous pages. These options are different than those described in Table 2–2 on page 2–8 for the LVDS transmitter.

Table 2–5. altlvds Receiver Frequency/PLL Settings Options (Page 4) (Part 1 of 4)

Option Description Comments

What is the input data rate? The value specifies the data rate for the input channel of the receiver, in Mbps. For data rate ranges, refer to the specific DC & Switching Characteristics chapter in the appropriate device handbook.

This value determines the allowed input clock rate values.

Specify the input clock rate by The value specifies the input clock frequency to the internal PLL. The allowed values depend on the input data rate selected.

Page 35: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–21November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

Use source-synchronous mode of the PLL

If enabled, the phase relationship between data and clock at the pin is maintained at the data capture point. Selecting this option forces the megafunction instantiation to make the required phase adjustments to guarantee a consistent relationship between the clock and data at the capture register and at the pin.

This option should always be selected, unless you have already performed all of the necessary phase adjustments manually. Altera recommends that you enable this option when using flexible LVDS schemes. This option is available only if the SERDES is implemented in LEs.

Align clock to the center of the data window

When enabled, a phase shift of 90 degrees is added to the clock to center the clock in the data.

This option is available only for Arria GX, Stratix II GX, Stratix II, and HardCopy II devices when SERDES is implemented in logic cells, and for Cyclone II devices. For Cyclone III devices and Stratix III (LE Implementation) devices, this option is not available.

Enable self-reset on lost lock in PLL If enabled, the PLL resets automatically whenever it loses lock.

This option is available only for Stratix III and Cyclone III devices when SERDES is implemented in logic cells.

Use shared PLL(s) for receivers and transmitters

When this option is enabled, your LVDS receivers and transmitters can share the same PLL.

This option can be used if the LVDS receivers and transmitters use the same input clock frequency, deserialization factor, and data rates.

Use "pll_areset" input port This option gives you control over the asynchronous reset port of the fast PLL that is used with this function.

When the transmitter shares the PLL with the receiver and the pll_areset port is used, this port must be used in both megafunction instantiations and the two signals must be tied together in the design file. If the PLL-enable port is used in one megafunction instance and not the other, the PLLs are not shared, and a warning appears during compilation.

Table 2–5. altlvds Receiver Frequency/PLL Settings Options (Page 4) (Part 2 of 4)

Option Description Comments

Administrator
高亮
Administrator
高亮
Page 36: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–22 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

MegaWizard Page Descriptions

Use ‘rx_pll_enable’ input port This port gives you control over the enable port of the fast PLL that is used with this function.

If the receiver shares the PLL with the transmitter, and the tx_pll_enable port is used, this port must be used in both megafunction instantiations and the two signals must be tied together in the design file. If the PLL-enable port is used in one megafunction instance and not the other, the PLLs are not shared, and a warning appears during compilation.

Use ‘rx_locked’ output port This port allows you to monitor the lock status of the PLL. The status of the lock port is identical for the transmitter and the receiver when shared PLLs are used. In this case, monitor the lock output from the receiver megafunction.

What is the phase alignment of ‘rx_in’ with respect to the rising edge of 'rx_inclock'? (in degrees)

This value determines the phase alignment of the data received by the receiver core with respect to the rx_inclock. Available values are 0 (edge-aligned), 45, 90, 135, 180 (center-aligned), 225, 270, 315.If DPA mode is not used, the extra two pages for DPA do not appear, but the option, What is the alignment of data with respect to the rising edge of ‘rx_inclock’? (in degrees) is added.

This option is only available if DPA mode is not enabled.

Table 2–5. altlvds Receiver Frequency/PLL Settings Options (Page 4) (Part 3 of 4)

Option Description Comments

Administrator
高亮
Page 37: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–23November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

What is the clock resource used for ‘rx_outclock’?

This value specifies the clock resource type fed from the rx_outclock port. Allowed values are Auto Selection (type is determined by the compiler), Global Clock, and Regional Clock. The default value is Auto Selection.

This information assists with clock management in the device.

Enable FIFO for DPA channels The phase-compensation FIFO synchronizes parallel data to the global clock domain of the core. This option is available only in Stratix GX devices when DPA mode is enabled.

Table 2–5. altlvds Receiver Frequency/PLL Settings Options (Page 4) (Part 4 of 4)

Option Description Comments

Page 38: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–24 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

MegaWizard Page Descriptions

If DPA mode is enabled, the DPA Settings 1 and DPA Settings 2 pages appear. DPA mode is supported by Arria GX, Stratix III, Stratix II, Stratix II GX, Stratix GX, and HardCopy II devices only. The DPA Settings 1 page appears in Figure 2–13.

Figure 2–13. MegaWizard Plug-In Manager—ALTLVDS [page 5 of 9]: LVDS Receiver

Page 39: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–25November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

The options on the DPA Settings 1 page are described in Table 2–6.

Table 2–6. altlvds Receiver DPA Settings 1 Options (Page 5) (Part 1 of 2)

Option Description Comments

Use "rx_divfwdclk" output port and bypass the DPA FIFO

If enabled, the DPA clock is divided by the deserialization factor and then forwarded to the core. The DPA clock drives the bitslip and alignment circuitry, bypassing the FIFO.

This feature is the soft-CDR feature. It is available in Stratix III devices only.

What is the simulated recovered clock phase drift?

The Quartus II software supports simulation of the recovered clock using the user-specified ppm value. The ppm value specifies the number of clock cycles drift between the transmitter and the receiver after a million clock cycles. The drift is positive if the transmitter is faster than the receiver, and negative if the receiver is faster than the transmitter. The Quartus II simulator simulates the ppm variation by shifting the recovered data and clock based on the user-specified ppm value.

This feature is available in Stratix III devices only. It is part of the soft-CDR feature. It is available only if the Use ‘rx_divfwdclk’ output port and bypass the DPA FIFO option is enabled.

Use "rx_dpll_enable" input port This port enables the path through the DPA circuitry. The option supports dynamic, channel-by-channel control of the DPA circuitry.

To enable the DPA circuitry for a channel, set the port for the target channel to 1. If this port is not used, the Quartus II software enables all of the channels. This option is available only if the Use ‘rx_divfwdclk’ output port and bypass the DPA FIFO option is disabled.

Page 40: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–26 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

MegaWizard Page Descriptions

Use ‘rx_dpll_hold’ input port This port prevents the DPA circuitry from switching to a new clock phase on the target channel. Each DPA block monitors the phase of the incoming data stream continuously, and selects a new clock phase when needed. When this port is held high, the selected channels hold their current phase setting.

Use ‘rx_fifo_reset’ input port This port resets the FIFO between the DPA circuit and the data alignment circuit. The FIFO holds data passing between the DPA and LVDS clock domains. When this port is held high, the FIFOs in the selected channels are reset.

This option is available only if the Use ‘rx_divfwdclk’ output port and bypass the DPA FIFO option is disabled.

Table 2–6. altlvds Receiver DPA Settings 1 Options (Page 5) (Part 2 of 2)

Option Description Comments

Page 41: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–27November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

The DPA Settings 2 page appears in Figure 2–14.

Figure 2–14. MegaWizard Plug-In Manager—ALTLVDS [page 6 of 9]: LVDS Receiver

Page 42: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–28 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

MegaWizard Page Descriptions

The options on the DPA Settings 2 page are described in Table 2–7.

f For more information about the DPA receiver circuit, refer to AN 236: Using Source-Synchronous Signaling with DPA in Stratix GX Devices.

Table 2–7. altlvds Receiver DPA Settings 2 Options (Page 6)

Parameter Description Comments

Use ‘rx_reset’ input port This port resets all of the components of the DPA circuit. Under this option, specify the condition for DPA circuit reset—either automatic reset when rx_dpa_locked rises for the first time or explicit reset of the serial FIFO using the rx_reset input port.

The DPA circuit must be retrained after it is reset using this port.

Use ‘rx_dpa_locked’ output port The DPA block samples the data on one of eight phase clocks with a 45-degree resolution between phases. This port lets you monitor the status of the DPA circuit and determine when it has locked onto the phase closest to the incoming data phase. The rx_dpa_locked ports de-assert (drive low), depending on the selections made under When should 'rx_dpa_locked' fall low? This can occur when a new phase has been selected or when the DPA has made two 45-degree phase shifts in the same direction. The data may still be valid when the rx_dpa_locked port is de-asserted.

Altera recommends that you use data checkers to validate the data in this condition.

Use a DPA initial phase selection of This option selects the initial phase setting. Specify whether to enable this option, and its value. Simulation honors this phase selection in simulating the forwarded clock.

This new option is available for Stratix III devices only.

Align DPA to rising edge of data only This option determines whether the DPA aligns to the rising edge of the data only, or to both the rising and falling edges of the data.

This option is available for Stratix III devices only.

Page 43: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–29November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

The Receiver Settings page appears in Figure 2–15.

Figure 2–15. MegaWizard Plug-In Manager—ALTLVDS [page 7 of 9]: LVDS Receiver

Page 44: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–30 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

MegaWizard Page Descriptions

The options on the Receiver Settings page are described in Table 2–8..

Table 2–8. altlvds Receiver Settings Options (Page 7) (Part 1 of 2)

Parameter Description Comments

Register outputs If this option is enabled, the outputs of the receiver are registered by rx_outclock.

If you do not register the receiver outputs here, you must register them in the design logic that is fed by the receiver and specify a 'Source Multiply' assignment from the receiver to the output registers with a value equal to the deserialization factor.

Use 'rx_channel_data_align' input port

This port lets you control bit insertion on a channel-by-channel basis to align the word boundaries of the incoming data. The data slips one bit for every pulse on the rx_channel_data_align port. This option is available only if a dedicated SERDES block is used.

The following requirements must be met for this port:● The minimum pulse width is one

period of the parallel clock in the logic array (rx_outclock).

● The minimum low time between pulses is one period of the parallel clock.

● There is no maximum high or low time.

● Valid data is available two parallel clock cycles after the rising edge of rx_channel_data_align.

Use 'rx_cda_reset' input port This port is available only if Use 'rx_channel_data_align' input port is turned on. The port resets the data alignment circuitry, restoring the latency bit counter to zero. This option is available only if a dedicated SERDES block is used.

Use 'rx_cda_max' output port This port indicates when the rollover point has been reached in the data alignment circuit. This port is available only if Use 'rx_channel_data_align' input port is turned on. This option is available only if a dedicated SERDES block is used.

After how many pulses does the data alignment circuitry restore the serial latency back to 0?

Available values for this option range from 1 to 11. The value does not have to be the same as the deserialization factor. This option is available only if a dedicated SERDES block is used.

Administrator
高亮
Page 45: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–31November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

LVDS Receiver Using an External PLL

This section discusses the options available for configuring the LVDS receiver megafunction when an external PLL is used. To use an external PLL, select Use External PLL on page 3 of the wizard (Figure 2–11 on page 2–17). The options for this page are described in Table 2–4 on page 2–18.

If you choose to implement the LVDS receiver using an external PLL, you must implement a PLL outside of the LVDS megafunction. You must ensure your circuit has the correct input and functionality to generate an appropriate clock frequency, and is connected to the LVDS receiver correctly.

f Information about external PLL options can be found in the application note AN 409: Design Example Using the altlvds Megafunction & the External PLL Option in Stratix II Devices.

LVDS Receiver Using External PLL and Dedicated SERDES BlockThe ability to use a dedicated SERDES block in your LVDS receiver and to clock the transmitter using an external PLL is device-dependent, just as it is for an LVDS transmitter.

If you use a Stratix III device, clock your LVDS receiver using an external PLL, and implement the SERDES for the receiver using a dedicated SERDES block, a notification window pops up after you enter these settings on page 3 of the wizard (Figure 2–16).

Align data to the rising edge of clock LVDS input data is aligned at the rising edge of the LVDS clock. This option is available only if a dedicated SERDES block is used.

Use ‘rx_data_align’ input port This port allows you to enable the receiver’s synchronization register. If you enable this option, you can also add an extra register to register the new port using rx_outclock.

This option is available if the SERDES is implemented in LEs.

Table 2–8. altlvds Receiver Settings Options (Page 7) (Part 2 of 2)

Parameter Description Comments

Page 46: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–32 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

MegaWizard Page Descriptions

Figure 2–16. MegaWizard Plug-In Manager Notification for Stratix III Device (LVDS Receiver)

If you use an Arria GX, Stratix II, Stratix II GX, or HardCopy II device, clock your LVDS receiver using an external PLL, and implement the SERDES for the receiver using a dedicated SERDES block, a different notification window pops up after you enter these settings on page 3 of the wizard (Figure 2–17).

Figure 2–17. MegaWizard Plug-In Manager Notification for Other Devices (LVDS Receiver)

In Stratix, Stratix GX, and HardCopy Stratix devices, if you implement the SERDES for your LVDS receiver using a dedicated SERDES block, you do not have the option to use an external PLL.

The Cyclone series of devices (Cyclone III, Cyclone II, and Cyclone devices) do not have a dedicated SERDES block available for use by your LVDS receiver. Therefore, you do not have the option to use a dedicated SERDES block in these devices.

Page 47: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–33November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

After you select Use External PLL and do not select Implement Serializer/Deserializer circuitry in logic cells on page 3 of the wizard, and then click Next, the DPA settings 1 page or the Receiver settings page appears (Figure 2–18).

This page is the same as the Receiver settings page that appears when you choose to use an internal PLL (Figure 2–15 on page 2–29), except different options are greyed out. The options that appear in the Receiver settings page are described in Table 2–8 on page 2–30.

Figure 2–18. MegaWizard Plug-In Manager—ALTLVDS [page 4 of 6]: Receiver Settings Page

LVDS Receiver Using External PLL and SERDES in LEsIf you use an Arria GX, Stratix series, Cyclone series, HardCopy II, or HardCopy Stratix device, clock your LVDS receiver using an external PLL, and implement the SERDES for the receiver using logic cells, a notification window pops up after you enter these settings on page 3 of the wizard (Figure 2–19).

Administrator
高亮
Page 48: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–34 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

MegaWizard Page Descriptions

Figure 2–19. MegaWizard Plug-In Manager Notification for SERDES in LEs (LVDS Receiver)

The Receiver settings page appears with only the Use ‘rx_data_align’ input port option available.

Common Pages for ALTLVDS Receiver and Transmitter

Page 8 lists the simulation libraries required for functional simulation by third-party tools (Figure 2–20). On this page, you can choose to generate a synthesis area and timing estimation netlist.

Page 49: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–35November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

Figure 2–20. MegaWizard Plug-In Manager—ALTLVDS [page 8 of 9] — EDA

Page 9 of the altlvds MegaWizard plug-in displays a list of the types of files to be generated. The automatically generated Variation file contains wrapper code in the language you specified on page 2a. On page 9, you can specify additional types of files to be generated. Choose from the PinPlanner ports PPF file (.ppf), AHDL Include file (<function name>.inc), VHDL component declaration file, <function name>.cmp), Quartus II symbol file (<function name>.bsf), Instantiation template file (<function name> .v), and Verilog HDL black box file (<function name>_bb.v). (Figure 2–21). If you selected Generate netlist on page 8, the file for the synthesis area and timing estimation netlist is also available. A gray checkmark indicates a file that is automatically generated, and a red checkmark indicates an optional file.

Page 50: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–36 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Instantiating Megafunctions in HDL Code or Schematic Designs

Figure 2–21. MegaWizard Plug-In Manager—ALTLVDS [page 9 of 9] — Summary

For more information about the ports and parameters for the altlvds megafunction, refer to Chapter 3, Specifications.

Instantiating Megafunctions in HDL Code or Schematic Designs

When you use the MegaWizard Plug-In Manager to customize and parameterize a megafunction, it creates a set of output files that allow you to instantiate the customized function in your design. Depending on the language you choose in the MegaWizard Plug-In Manager, the wizard instantiates the megafunction with the correct parameter values and generates a megafunction variation file (wrapper file) in Verilog HDL (.v), VHDL (.vhd), or AHDL (.tdf), along with other supporting files.

The MegaWizard Plug-In Manager provides options to create the following files:

■ A sample instantiation template for the language of the variation file (_inst.v, _inst.vhd, or _inst.tdf)

■ Component Declaration File (.cmp) that can be used in VHDL Design Files

■ ADHL Include File (.inc) that can be used in Text Design Files (.tdf)

Page 51: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–37November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

■ Quartus II Block Symbol File (.bsf) that can be used in schematic designs

■ Verilog HDL module declaration file that can be used when instantiating the megafunction as a black box in a third-party synthesis tool (_bb.v)

f For more information about the wizard-generated files, refer to the Quartus II Help or to the Recommended HDL Coding Styles chapter in volume 1 of the Quartus II Handbook.

Generating a Netlist for EDA Tool Use

If you use a third-party EDA synthesis tool, you can instantiate the megafunction variation file as a black box for synthesis. Use the VHDL component declaration or Verilog module declaration black box file to define the function in your synthesis tool, and then include the megafunction variation file in your Quartus II project.

If you enable the option to generate a synthesis area and timing estimation netlist in the MegaWizard Plug-In Manager, the wizard generates an additional netlist file (_syn.v). The netlist file is a representation of the customized logic used in the Quartus II software. The file provides the connectivity of the architectural elements in the megafunction but may not represent true functionality. This information enables certain third-party synthesis tools to better report area and timing estimates. In addition, synthesis tools can use the timing information to focus timing-driven optimizations and improve the quality of results.

f For more information about using megafunctions in your third-party synthesis tool, refer to the appropriate chapter in the Synthesis section in volume 1 of the Quartus II Handbook.

Using the Port and Parameter Definitions

Instead of using the MegaWizard Plug-In Manager, you can instantiate the megafunction directly in your Verilog HDL, VHDL, or AHDL code by calling the megafunction and setting its parameters as you would any other module, component, or subdesign. For the altlvds megafunction, many ports and parameters are available for specific device families only, and some are available only when other features have been enabled. For example, in Stratix GX devices, the rx_channel_data_align[] port is available only when the DPA mode option is turned on. When DPA mode is turned off, the rx_data_align port is available for use.

Page 52: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–38 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Instantiating Megafunctions in HDL Code or Schematic Designs

1 Altera strongly recommends that you use the MegaWizard Plug-In Manager for complex megafunctions. The MegaWizard Plug-In Manager ensures that you set all megafunction parameters properly.

Refer to Chapter 3, Specifications for a list of the megafunction ports and parameters.

Page 53: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–39November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

Example 2–1 contains the VHDL code from a Stratix LVDS receiver. This template can be used for any VHDL altlvds function. Substitute appropriate ports and parameters as needed in your design.

Example 2–1. VHDL Code from the Stratix LVDS ReceiverINCLUDE "altlvds_rx.inc";

SUBDESIGN stratix_rx(

rx_in[0..0] : INPUT;rx_inclock : INPUT = GND;rx_pll_enable : INPUT = VCC;rx_data_align : INPUT;pll_areset : INPUT = GND;rx_out[3..0] : OUTPUT;rx_locked : OUTPUT;rx_outclock : OUTPUT;

)

VARIABLE

altlvds_rx_component : altlvds_rx WITH (INTENDED_DEVICE_FAMILY = "Stratix",NUMBER_OF_CHANNELS = 1,DESERIALIZATION_FACTOR = 4,LPM_TYPE = "altlvds_rx",COMMON_RX_TX_PLL = "ON",OUTCLOCK_RESOURCE = "AUTO",INCLOCK_PERIOD = 9523,INPUT_DATA_RATE = 840,INCLOCK_DATA_ALIGNMENT = "EDGE_ALIGNED",REGISTERED_OUTPUT = "ON",REGISTERED_DATA_ALIGN_INPUT = "ON");

BEGIN

rx_locked = altlvds_rx_component.rx_locked;rx_out[3..0] = altlvds_rx_component.rx_out[3..0];rx_outclock = altlvds_rx_component.rx_outclock;altlvds_rx_component.pll_areset = pll_areset;altlvds_rx_component.rx_inclock = rx_inclock;altlvds_rx_component.rx_in[0..0] = rx_in[0..0];altlvds_rx_component.rx_data_align = rx_data_align;altlvds_rx_component.rx_pll_enable = rx_pll_enable;

END;

Administrator
高亮
Page 54: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–40 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Identifying a Megafunction After Compilation

Identifying a Megafunction After Compilation

During compilation with the Quartus II software, analysis and elaboration is performed to build the structure of your design. To locate your megafunction in the Project Navigator window, expand the compilation hierarchy and find the megafunction by its name. To search for node names within the megafunction (using the Node Finder), click Browse in the Look in box and select the megafunction in the Hierarchy box (Figure 2–22).

Figure 2–22. Compilation Hierarchy Window

You can use the project hierarchy to find megafunction instantiations in the Floorplan Editor. Right-click on the megafunction you want to view, and choose the Quartus II editor in which you want to view it (Figure 2–23).

Page 55: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–41November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

Figure 2–23. Compilation Hierarchy Navigation Option

You can also locate your megafunctions in the Node Finder when making assignments in the assignment editor. Figure 2–24 shows an example of how the megafunction logic is shown in the Node Finder.

Page 56: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–42 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Simulation

Figure 2–24. Node Finder View of altlvds Transmitter Megafunction

Simulation The Quartus II Simulator provides an easy-to-use, integrated solution for performing simulations. The following sections describe the simulation options.

Quartus II Software Simulation

With the Quartus II Simulator, you can perform two types of simulation: functional and timing. A functional simulation enables you to verify the logical operation of your design without taking into consideration the timing delays in the FPGA. This simulation is performed using only your register transfer level (RTL) code. When performing a functional simulation, add only signals that exist before synthesis. You can find these signals with the Registers: Pre-Synthesis, Design Entry, or Pin filters in the Node Finder. The top-level ports of megafunctions are found using these three filters.

In contrast, timing simulation in the Quartus II software verifies the operation of your design with annotated timing information. This simulation is performed using the post place-and-route netlist. When performing a timing simulation, add only signals that exist after

Page 57: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–43November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

place-and-route. These signals are found with the post-compilation filter of the Node Finder. During synthesis and place-and-route, the names of RTL signals change. Therefore, it may be difficult to find signals from your megafunction instantiation in the post-compilation filter. To preserve the names of your signals during the synthesis and place-and-route stages, use the HDL synthesis attributes keep and preserve. These attributes direct Analysis and Synthesis to keep a particular wire, register, or node intact. Use these synthesis attributes to keep a combinational logic node so you can observe the node during simulation.

f For more information about these attributes, refer to the Quartus II Integrated Synthesis chapter in volume 1 of the Quartus II Handbook.

EDA Simulation

Depending on which simulation tool you are using, refer to the appropriate chapter in the Simulation section in volume 3 of the Quartus II Handbook. The Quartus II Handbook chapters describe how to perform functional and gate-level timing simulations that include the megafunctions, with details about the files that are needed and the directories where the files are located.

SignalTap II Embedded Logic Analyzer

The SignalTap® II Embedded Logic Analyzer provides a non-intrusive method of debugging the Altera megafunctions within your design. With the SignalTap II Embedded Logic Analyzer, you can capture and analyze data samples for the top-level ports of the Altera megafunctions while your system is running at full speed.

To monitor signals from Altera megafunctions, configure the SignalTap II Embedded Logic Analyzer in the Quartus II software, and include the analyzer as part of your Quartus II project. The Quartus II software then embeds the analyzer in your design in the selected device seamlessly.

f For more information about using the SignalTap II Embedded Logic Analyzer, refer to the Design Debugging Using the SignalTap II Embedded Logic Analyzer chapter in volume 3 of the Quartus II Handbook.

Page 58: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–44 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Design Example 1: LVDS-to-LVDS Bridge Using Different Clock Frequencies

Design Example 1: LVDS-to-LVDS Bridge Using Different Clock Frequencies

With the inclusion of dynamic phase alignment (DPA) circuitry, Stratix II devices offer enhanced support for source-synchronous protocols. The enhanced source-synchronous channels on Stratix II devices support 1-Gbps data transfer, while the dedicated DPA circuitry simplifies printed circuit board design by eliminating signal-alignment issues introduced by clock-to-channel and channel-to-channel skew. Stratix II devices support a wide array of high-speed protocols and can be used to bridge high-speed interfaces.

This design example uses a Stratix II device to bridge a 1-Gbps LVDS interface using a 500-MHz reference clock to a 1-Gbps LVDS interface using a 250-MHz reference clock. The altlvds receiver function uses DPA circuitry. The transmitter and receiver share one fast PLL.

The focus of this design is to illustrate the features available in the MegaWizard Plug-In Manager. No user logic is shown between the receiver and transmitter blocks, and all ports are connected to input or output pins. Most designs use custom logic for many of the control ports within the FPGA. However, for this design example, all such parameters are controlled outside of the Stratix II device.

Design Files

The design files are available with this user guide in the Quartus II Project section and in the User Guides section of the Altera website (www.altera.com).

In this example, you create two files using the MegaWizard Plug-In Manager: one for an altlvds receiver and one for an altlvds transmitter. Both files are created in Verilog HDL and are included in your project directory when completed.

Example

In this example, you will complete the following tasks:

■ Generate a high-speed differential receiver in DPA mode using the altlvds megafunction and the MegaWizard Plug-In Manager

■ Generate a high-speed differential transmitter using the altlvds megafunction and the MegaWizard Plug-In Manager

■ Implement the receiver and transmitter functions in the device by adding your custom megafunctions to the project and compiling the project

■ Simulate the high-speed differential interface design using the ModelSim-Altera software

Administrator
高亮
Page 59: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–45November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

Generate an altlvds Receiver and altlvds Transmitter

To generate the LVDS receiver, perform the following steps:

1. Open the altlvds_DesignExample.zip file and extract the Quartus II archive project altlvds_stratixII.qar.

2. In the Quartus II software, open altlvds_stratixII.qar and restore the archive file into your working directory.

3. Open the top-level block editor file altlvds_stratixII.bdf.

The file altlvds_stratixII.bdf is an incomplete file that you will complete in the course of this example. The altlvds megafunctions created in this example are added to the top-level file.

4. Double-click anywhere in the white space in the block editor file. The Symbol window appears.

5. In the Symbol window, click on MegaWizard Plug-In Manager. Page 1 of the MegaWizard Plug-In Manager appears.

6. Select Create a new custom megafunction variation.

7. Click Next. Page 2a of the MegaWizard Plug-In Manager appears.

8. In the MegaWizard Plug-In Manager pages, select or verify the configuration settings shown in Table 2–9. Click Next to advance from one page to the next.

Table 2–9. Configuration Settings for Design Example 1 (LVDS Receiver) (Part 1 of 3)

MegaWizard Plug-In

Manager Page

MegaWizard Plug-In Manager Configuration Setting Value

2a Megafunction Under I/O, select ALTLVDS

Device family Stratix II

Output file type Verilog HDL

Output file name stratixii_rx

Return to this page for another create operation Selected

Page 60: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–46 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Design Example 1: LVDS-to-LVDS Bridge Using Different Clock Frequencies

3 Currently selected device family Stratix II

Match project/default Selected

This module acts as an LVDS receiver

Implement SERDES in logic cells Not selected

Enable DPA mode Selected

Number of channels 8

Deserialization factor 8

Use External PLL Not selected

4 Input data rate 1 Gbps (1000 Mbps)

Specify the input clock rate by Clock frequency

Clock frequency 500 MHz

Use shared PLLs Selected

Use pll_areset Selected

Use rx_pll_enable Selected

Use rx_locked Not selected

Clock resource for rx_outclock Auto selection

5 Use rx_dpll_enable Selected

Use rx_dpll_hold Selected

Use rx_fifo_reset Selected

6 Use rx_reset Selected

Reset DPA circuitry Automatically when rx_dpa_locked rises for the first time

Use rx_dpa_locked Selected

When should rx_dpa_locked fall low When there are two phase changes in the same direction

7 Register outputs Selected

Use rx_channel_data_align Selected

Use rx_cda_reset Selected

Use rx_cda_max Selected

After how many pulses 8

8 Generate netlist Not selected

Table 2–9. Configuration Settings for Design Example 1 (LVDS Receiver) (Part 2 of 3)

MegaWizard Plug-In

Manager Page

MegaWizard Plug-In Manager Configuration Setting Value

Page 61: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–47November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

9. Click Finish. The stratixii_rx module is built.

10. Click OK. The MegaWizard Plug-In Manager resets to page 2a to allow you to create a new custom megafunction variation for the LVDS transmitter.

11. In the MegaWizard Plug-In Manager pages, select or verify the configuration settings shown in Table 2–10.

9 Variation file Selected

PinPlanner ports PPF file Selected

AHDL Include file Selected

VHDL component declaration file Selected

Quartus II symbol file Selected

Instantiation template file Selected

Verilog HDL black box file Selected

Table 2–9. Configuration Settings for Design Example 1 (LVDS Receiver) (Part 3 of 3)

MegaWizard Plug-In

Manager Page

MegaWizard Plug-In Manager Configuration Setting Value

Table 2–10. Configuration Settings for Design Example 1 (LVDS Transmitter) (Part 1 of 2)

MegaWizard Plug-In

Manager Page

MegaWizard Plug-In Manager Configuration Setting Value

2a Megafunction Under I/O, select ALTLVDS

Device family Stratix II

Output file type Verilog HDL

Output file name stratixii_tx

Return to this page for another create operation Not selected

3 Currently selected device family Stratix II

Match project/default Selected

This module acts as an LVDS transmitter

Implement SERDES in logic cells Not selected

Number of channels 8

Deserialization factor 8

Use External PLL Not selected

Page 62: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–48 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Design Example 1: LVDS-to-LVDS Bridge Using Different Clock Frequencies

12. Click Finish. The stratixii_tx module is built.

13. Click OK.

14. Place the stratixii_tx symbol in the altlvds_stratixii block editor design file under the text INSERT STRATIXII_TX HERE, aligning the input and output ports with the signals already present in the design file.

15. Double-click anywhere in the white space of the design file. The Symbol dialog box appears.

4 Output data rate 1 Gbps (1000 Mbps)

Specify the input clock rate by Clock frequency

Clock frequency 500 MHz

Phase alignment of tx_in with tx_inclock rise 0

Use tx_pll_enable Selected

Use pll_areset Selected

Use shared PLLs Selected

Register tx_in using tx_coreclock

5 Use tx_outclock Selected

Outclock divide factor 4

Phase alignment of tx_outclock with tx_out 0

Use tx_locked Selected

Use tx_coreclock Selected

Clock resource for tx_coreclock Auto selection

6 Generate netlist Not selected

7 Variation file Selected

PinPlanner ports PPF file Selected

AHDL Include file Selected

VHDL component declaration file Selected

Quartus II symbol file Selected

Instantiation template file Selected

Verilog HDL black box file Selected

Table 2–10. Configuration Settings for Design Example 1 (LVDS Transmitter) (Part 2 of 2)

MegaWizard Plug-In

Manager Page

MegaWizard Plug-In Manager Configuration Setting Value

Page 63: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–49November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

16. Choose stratixii_rx from the Project library list and click OK (Figure 2–25). You may have to expand the Project folder to see the megafunctions it contains.

Figure 2–25. Design Example 1 Symbol View of stratixii_rx

17. Place the stratixii_rx symbol in the altlvds_stratixII block editor design file under the text INSERT STRATIXII_RX HERE and align the input and output ports with the signals already present in the design file.

The block diagram file should look similar to Figure 2–26.

Figure 2–26. Design Example 1 Top-Level Block Design File

Page 64: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–50 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Design Example 1: LVDS-to-LVDS Bridge Using Different Clock Frequencies

18. On the File menu, click Save.

19. On the Processing menu, click Start Compilation.

20. When the Full Compilation was successful message box appears, click OK.

Functional Results—Simulate the altlvds Receiver/Transmitter Design in the ModelSim-Altera Simulator

Simulate the design in the ModelSim-Altera software to generate a waveform display of the device behavior.

This user guide assumes that you are familiar with using the ModelSim-Altera tool before trying out the design example. If you are unfamiliar with using the ModelSim-Altera simulator, refer to the support page for software products on the Altera website (www.altera.com). On the support page, there are various links to topics such as installation, usage, and troubleshooting.

Set up the ModelSim-Altera simulator by performing the following steps:

1. Unzip the altlvds_ex1_msim.zip file to any working directory on your PC.

2. Start the ModelSim-Altera software.

3. On the File menu, click Change Directory.

4. Select the folder in which you unzipped the files. Click OK.

5. On the Tools menu, click Execute Macro.

6. Select the altlvds_ex1_msim.do file and click Open. This is a script file for the ModelSim software that automates all the necessary settings for the simulation.

7. Verify the results shown in the Waveform Viewer window.

You can rearrange signals, remove signals, add signals, and change the radix by modifying the script in altlvds_ex1_msim.do. Figure 2–27 shows the expected simulation results in the ModelSim simulator.

Page 65: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–51November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

Figure 2–27. Design Example 1 ModelSim Simulation Results

This waveform file contains only the input and output pins that are shown. You can add internal post-compilation nodes with the Node Finder to view all of the data paths in the design. You can verify that tx_outclock has a 4-ns period, which corresponds to a 250-MHz clock rate, as specified in the design.

The input serial data rx_in is edge-aligned to the reference clock clk_in_500MHz, and the output serial data tx_out is edge-aligned to the tx_outclock as specified in the transmitter megafunction.

This simulation output verifies that 1-Gbps data can be successfully received by and transmitted from the Stratix II device.

You can change the input vectors in the waveform editor to experiment with the other features, such as data alignment, to view the functionality and help you understand the altlvds megafunction.

Design Example 2: Cyclone II altlvds Using External PLL Option

The following design example illustrates the connection scheme used in Cyclone II devices for an altlvds receiver and transmitter using a common PLL. The altlvds_rx and altlvds_tx functions are set up using the external PLL option. This example shows step by step how to set up the altlvds_rx and altlvds_tx functions. Note that the altpll function has already been set up in the design file.

f For PLL-specific information and for examples of PLL clock relationships, refer to the altpll Megafunction Users Guide.

Page 66: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–52 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Design Example 2: Cyclone II altlvds Using External PLL Option

You can use the external PLL option in altlvds to give you direct access to all of the PLL clocks that are not accessible when you allow altlvds to infer the PLL for you. This option gives you the ability to use the PLL output clocks throughout your design for other functions besides the serialization and deserialization of data.

Design Files

The design files are available with this user guide in the Quartus II Project section and in the User Guides section of the Altera website (www.altera.com).

In this example, you create two files using the MegaWizard Plug-In Manager: one for an altlvds receiver and one for an altlvds transmitter. Both files are created in VHDL and are included in your project directory when completed. The PLL block is already customized in the design.

Example

This example shows how to design a 600 Mbps receiver with a deserialization factor of 8 and a 600 Mbps transmitter with the same deserialization factor of 8. The input reference clock frequency is 75 MHz.

In this example, you will perform the following activities:

■ Generate a high-speed differential receiver using the altlvds megafunction and the MegaWizard Plug-In Manager.

■ Generate a high-speed differential transmitter using the altlvds megafunction and the MegaWizard Plug-In Manager.

■ View description of the external PLL settings used to clock the transmitter and receiver blocks.

■ Implement the receiver, transmitter, and PLL in the device by adding your custom megafunctions to the project and compiling the project.

■ Simulate the high-speed differential interface design.

Generate an altlvds Receiver and altlvds Transmitter

To generate the LVDS receiver, perform the following steps:

1. Open the altlvds_DesignExample_ex2.zip file and extract the Quartus II archive project cii_altlvds_extpll.qar.

2. In the Quartus II software, open cii_altlvds_extpll.qar and restore the archive file into your working directory.

3. Open the top-level block editor file cii_altlvds_extpll.bdf.

Page 67: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–53November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

The file cii_altlvds_extpll.bdf is an incomplete file that you will complete in the course of this example. The altlvds megafunctions created in this example are added to the top-level file.

4. Double-click anywhere in the white space in the block editor file. The Symbol window appears.

5. In the Symbol window, click on MegaWizard Plug-In Manager. Page 1 of the MegaWizard Plug-In Manager appears.

6. Select Create a new custom megafunction variation.

7. Click Next. Page 2a of the MegaWizard Plug-In Manager appears.

8. In the MegaWizard Plug-In Manager pages, select or verify the configuration settings shown in Table 2–11. Click Next to advance from one page to the next.

Table 2–11. Configuration Settings for Design Example 2 (LVDS Receiver) (Part 1 of 2)

MegaWizard Plug-In

Manager Page

MegaWizard Plug-In Manager Configuration Setting Value

2a Megafunction Under I/O, select ALTLVDS

Device family Cyclone II

Output file type VHDL

Output file name rx_block

Return to this page for another create operation Selected

3 Currently selected device family Cyclone II

Match project/default Selected

This module acts as an LVDS receiver

Implement SERDES in logic cells Selected

Number of channels 4

Deserialization factor 8

Use External PLL Selected

4 Use rx_data_align Not selected

5 Generate netlist Not selected

Page 68: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–54 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Design Example 2: Cyclone II altlvds Using External PLL Option

9. Click Finish. The rx_block module is built.

10. Click OK. The MegaWizard Plug-In Manager resets to page 2a to allow you to create a new custom megafunction variation for the LVDS transmitter.

11. In the MegaWizard Plug-In Manager pages, select or verify the configuration settings shown in Table 2–12.

6 Variation file Selected

PinPlanner ports PPF file Selected

AHDL Include file Selected

VHDL component declaration file Selected

Quartus II symbol file Selected

Instantiation template file Selected

Table 2–11. Configuration Settings for Design Example 2 (LVDS Receiver) (Part 2 of 2)

MegaWizard Plug-In

Manager Page

MegaWizard Plug-In Manager Configuration Setting Value

Table 2–12. Configuration Settings for Design Example 2 (LVDS Transmitter) (Part 1 of 2)

MegaWizard Plug-In

Manager Page

MegaWizard Plug-In Manager Configuration Setting Value

2a Megafunction Under I/O, select ALTLVDS

Device family Cyclone II

Output file type VHDL

Output file name tx_block

Return to this page for another create operation Not selected

3 Currently selected device family Cyclone II

Match project/default Selected

This module acts as an LVDS transmitter

Implement SERDES in logic cells Selected

Number of channels 4

Deserialization factor 8

Use External PLL Selected

4 Generate netlist Not selected

Page 69: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–55November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

12. Click Finish. The tx_block module is built.

The symbol for the altlvds transmitter function you just created appears in the Symbol window (Figure 2–28).

Figure 2–28. Design Example 2 Symbol View of tx_block

5 Variation file Selected

PinPlanner ports PPF file Selected

AHDL Include file Selected

VHDL component declaration file Selected

Quartus II symbol file Selected

Instantiation template file Selected

Table 2–12. Configuration Settings for Design Example 2 (LVDS Transmitter) (Part 2 of 2)

MegaWizard Plug-In

Manager Page

MegaWizard Plug-In Manager Configuration Setting Value

Page 70: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–56 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Design Example 2: Cyclone II altlvds Using External PLL Option

Integrating the altlvds Receiver and Transmitter in the Design

To integrate the altlvds receiver and transmitter in the final design:

1. After the altlvds transmitter function you just created appears in the Symbol window, click OK to return to the block design editor with the tx_block attached to your cursor.

2. Place the rx_block representation in the top-level file under the text Place tx_block here, aligning the input and output ports to the existing connections. Left-click to drop the tx_block in place.

3. Double-click anywhere in the white space of the design file. The Symbol window appears.

4. Select rx_block from the Project library list and click OK. You may have to expand the Project folder to see the megafunctions it contains.

5. Place the rx_block symbol in the block editor design file under the text Place rx_block here and align the input and output ports with the signals already present in the design file.

The rest of the components for this design are already in the top-level file. They include two instantiations of DFF and one instantiation of altpll named lvds_pll in this example. After you place the rx_block and tx_block, the top level should look like Figure 2–29.

Page 71: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–57November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

Figure 2–29. Design Example 2 Top-Level Block Design File

If you do not want to create the rx_block and tx_block, they are located in the backup folder within the project directory. You can move them to the top-level directory and insert them directly into the top-level design.

Parameters Used by altpll

When you instantiate an altlvds megafunction in external PLL mode, Altera recommends you set up the data rate and clocking using the altpll megafunction. For Cyclone devices, you must use Normal Mode compensation. For Cyclone II devices, you can choose either Normal Mode or Source-Synchronous Compensation Mode. Source-Synchronous is the recommended compensation mode in Cyclone II devices.

f For details about PLL compensation modes, refer to the PLL chapter of the relevant device handbook.

The LVDS receiver and transmitter in this design example operate at a 600 Mbps data rate with deserialization and serialization factors of 8. The reference clock frequency is equal to the data rate divided by the deserialization factor, which is 75 MHz.

Page 72: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–58 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Design Example 2: Cyclone II altlvds Using External PLL Option

Cyclone and Cyclone II devices use DDIO registers as part of the SERDES interface. Because data is clocked on both the rising and falling edge, the clock frequency must be half the data rate; therefore, the fast clock from the PLL runs at half the data rate. The core clock frequency (also referred to as the slow clock) is the data rate divided by the serialization factor (J). In this example, the slow clock is the same frequency as the reference clock, but is phase aligned to the fast clock from the PLL.

The PLL in this design example is in Source-Synchronous Compensation mode, using the following selections for the megafunction.

■ Select C0 for Which output clock will be compensated for? ■ Enter 75 MHz for What is the frequency of the inclock0 input?■ Turn on ports for the asynchronous reset function and locked output.

C0 is the high speed clock. The data rate for this design example is 600 Mbps. The C0 signal must have a frequency of one half the data rate, so the output frequency must be set to 300 MHz. The phase you select depends on the reference clock to data relationship at the pins of the device. Source-Synchronous Compensation mode maintains the clock to data relationship to the I/O element capture registers on the receiver.

In this design example, the reference clock and data are rising edge aligned (the bit boundary is synchronous to the rising edge of the reference clock, and 8 bits are received in every clock period). C0 must be phase-shifted to properly capture the data internally at the registers.

For edge-aligned interfaces, you would normally phase-shift your high speed clock by –180 degrees to center-align the clock and data relationship at the capture register. However, because Cyclone and Cyclone II devices use a half-rate high-speed clock, due to the DDIO implementation, a –180 degree phase shift would simply switch the rising edge with the falling edge. To move the capture clock with respect to the DDIO data, a –90 degree phase shift is required.

C1 is the low speed clock. For even SERDES factors, it must be the data rate divided by the SERDES factor (J). In this example, C1 is 75 MHz (600 Mbps / 8). The phase shift on C1 must correspond to the phase shift on C0. The data is edge aligned with respect to the reference clock at the input pins, so the clocks have to phase shift to center-align the rising edge in the core. The high speed to low speed data transfer does not use DDIO circuitry, so you can calculate –180 degrees / J to determine the correct phase shift for this clock to achieve the desired data alignment. In this example, the result is –22.5 degrees, which you use for the C1 phase shift.

Page 73: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–59November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

The receiver and transmitter use the same PLL in this example. The phase shifts are optimized to capture data at the receiver, but they also determine a fixed relationship of clock and data at the transmitter. If the slow clock is forwarded with the transmit data, it is center aligned. If a different clock frequency and phase are desired, you can enable the C2 output port of the PLL (in Cyclone devices, the third port of the PLL is E0). The frequency and phase are restricted to the possibilities available for the altpll megafunction parameters.

Functional Results—Simulate the altlvds Receiver/Transmitter Design in the Quartus II Software

This section describes how to verify the cii_altlvds_stratixii design example you just created. It illustrates the data and clock relationship on the serial channels received and transmitted by the Cyclone II device. The design example files include a simple vector waveform created for this example. The following steps assume that you have successfully compiled the cii_altlvds_extpll design.

1. On the Processing menu, click Generate Functional Simulation Netlist.

2. When the Functional Simulation Netlist Generation was successful message box appears, click OK.

3. On the Assignments menu, click Settings.

4. In the Category list, select Simulator Settings.

5. In the Simulation mode list, select Functional.

6. In the Simulation input box, type cii_altlvds_extpll.vwf, or click Browse (...) to select the file in the project folder.

7. Select Run simulation until all vector stimuli are used.

8. In the Category list, select Simulation Verification.

9. Select Simulation coverage reporting and deselect Check outputs.

10. In the Category list, select Simulation Output Files.

11. Select Automatically add pins to simulation output waveforms, deselect Overwrite simulation input file with simulation results, and deselect Generate Signal Activity File.

12. Click OK.

Page 74: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–60 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Design Example 2: Cyclone II altlvds Using External PLL Option

13. On the Processing menu, click Start Simulation.

14. When the Simulator was successful message box appears, click OK.

15. Verify the simulation results in the Simulation Report window. A portion of the vector waveform output is shown in Figure 2–30.

Figure 2–30. Design Example 2 Functional Simulation Results

Timing Results—Simulate the altlvds Receiver/Transmitter Design in the Quartus II Software

This section describes how to verify the cii_altlvds_extpll design example you just created via timing. It illustrates the requirement for word boundary detection logic to be added to the design. The design example files include a simple vector waveform created for this example. The following steps assume that you have successfully compiled the cii_altlvds_extpll design.

1. On the Processing menu, click Generate Functional Simulation Netlist.

2. When the Functional Simulation Netlist Generation was successful message box appears, click OK.

3. On the Assignments menu, click Settings.

4. In the Category list, select Simulator Settings.

Page 75: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–61November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

5. In the Simulation mode list, select Timing.

6. In the Simulation input box, type cii_altlvds_extpll.vwf or click Browse (...) to select the file in the project folder.

7. Select Run simulation until all vector stimuli are used.

8. In the Category list, select Simulation Verification.

9. Select Simulation coverage reporting and deselect Check outputs.

10. In the Category list, select Simulation Output Files.

11. Select Automatically add pins to simulation output waveforms, deselect Overwrite simulation input file with simulation results, and deselect Generate Signal Activity File.

12. Click OK.

13. On the Processing menu, click Start Simulation.

14. When the Simulator was successful message box appears, click OK.

15. Verify the simulation results in the Simulation Report window. A portion of the timing vector waveform output is shown in Figure 2–31.

Page 76: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–62 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Design Example 2: Cyclone II altlvds Using External PLL Option

Figure 2–31. Design Example 2 Timing Simulation Results

The receiver channels bring serial data in to the device, edge aligned with the reference clock (ref_clock). rx_in0 receives a data value of 1, rx_in1 receives a data value of 2, rx_in2 receives a data value of 3, and rx_in3 receives a data value of 4. You can expand the parallel receiver channels (rx_parallel_out) in the waveform editor to see the word alignment position. The parallel data is shifted two bits toward the MSB in each channel.

The transmitter channel sends data from the device center aligned with the slow_clock output pin. tx_out0 transmits a data value of 1, tx_out1 transmits a data value of 2, tx_out2 transmits a data value of 3, and tx_out3 transmits a data value of 4. Depending on your system requirements, you can add the remaining output clock port of the PLL and forward a clock that is aligned differently with respect to the data. The timing simulation shows the transmitted data is three bit positions shifted toward the MSB with respect to the slow_clock.

Functional Results—Simulate the altlvds Receiver/Transmitter Design in the ModelSim-Altera Simulator

Simulate the design in the ModelSim-Altera software to compare the results of both simulators.

Page 77: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–63November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

This user guide assumes that you are familiar with using the ModelSim-Altera tool before trying out the design example. If you are unfamiliar with using the ModelSim-Altera simulator, refer to the support page for software products on the Altera website (www.altera.com). The support page contains various links to topics such as installation, usage, and troubleshooting.

Set up the ModelSim-Altera simulator by performing the following steps:

1. Unzip the altlvds_ex2_msim.zip file to any working directory on your PC.

2. Start the ModelSim-Altera software.

3. On the File menu, click Change Directory.

4. Select the folder in which you unzipped the files. Click OK.

5. On the Tools menu, click Execute Macro.

6. Select the altlvds_ex2_msim.do file and click Open. This is a script file for the ModelSim software that automates all the necessary settings for the simulation.

7. Verify the results shown in the Waveform Viewer window.

You can rearrange signals, remove signals, add signals, and change the radix by modifying the script in altlvds_ex2_msim.do. Figure 2–32 shows the expected simulation results in the ModelSim simulator.

Page 78: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–64 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Design Example 3: Stratix III Soft Clock Data Recovery

Figure 2–32. Design Example 2 ModelSim Simulation Results

Design Example 3: Stratix III Soft Clock Data Recovery

With the inclusion of soft CDR circuitry for clock data recovery (CDR), Stratix III devices offer support for the widely-used Gigabit Ethernet/SGMII protocol. Clock-data recovery removes the clock from the clock-embedded data, a capability required for SGMII support. Stratix III devices support a wide array of high-speed protocols and can be used to bridge high-speed interfaces.

This design example uses a Stratix III device to receive a single, 1-Gbps LVDS channel using a 50-MHz reference clock to the FPGA core. This design uses an LVDS transmitter and an LVDS receiver. The transmitter and receiver use separate PLLs. The core clock frequency is 100 MHz. The deserialization factor in both the receiver and the transmitter is 10. The LVDS receiver function uses soft-CDR circuitry.

The focus of this design is to illustrate the recovered clock—the clock that is recovered and forwarded to the core by the LVDS receiver.

Design Files

The design files are available with this user guide in the Quartus II Project section and in the User Guides section of the Altera website (www.altera.com).

Page 79: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–65November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

In this example, you create two files using the MegaWizard Plug-In Manager: one for an altlvds receiver and one for an altlvds transmitter. Both files are created in Verilog HDL and are included in your project directory when completed.

Example

In this example, you will complete the following tasks:

■ Generate a high-speed differential receiver in DPA mode and soft-CDR mode using the altlvds megafunction and the MegaWizard Plug-In Manager

■ Generate a high-speed differential transmitter using the altlvds megafunction and the MegaWizard Plug-In Manager

■ Implement the receiver and transmitter functions in the device by adding your custom megafunctions to the project and compiling the project

■ Simulate the high-speed differential interface design using the ModelSim-Altera software

Generate an altlvds Receiver and altlvds Transmitter

To generate the LVDS receiver, perform the following steps:

1. Open the altlvds_DesignExample_ex3.zip file and extract the Quartus II archive project altlvds_s3_serial_link.qar.

2. In the Quartus II software, open altlvds_s3_serial_link.qar and restore the archive file into your working directory.

3. Open the top-level file altlvds_s3_serial_link.v.

4. On the Tools menu, click MegaWizard Plug-In Manager. Page 1 of the MegaWizard Plug-In Manager appears.

5. Select Create a new custom megafunction variation.

6. Click Next. Page 2a of the MegaWizard Plug-In Manager appears.

Page 80: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–66 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Design Example 3: Stratix III Soft Clock Data Recovery

7. In the MegaWizard Plug-In Manager pages, select or verify the configuration settings shown in Table 2–13. Click Next to advance from one page to the next.

Table 2–13. Configuration Settings for Design Example 3 (LVDS Receiver) (Part 1 of 2)

MegaWizard Plug-In

Manager Page

MegaWizard Plug-In Manager Configuration Setting Value

2a Megafunction Under I/O, select ALTLVDS

Device family Stratix III

Output file type Verilog HDL

Output file name rx_block

Return to this page for another create operation Selected

3 Currently selected device family Stratix III

Match project/default Selected

This module acts as an LVDS receiver

Implement SERDES in logic cells Not selected

Enable DPA mode Selected

Number of channels 1

Deserialization factor 10

Use External PLL Not selected

4 Input data rate 1 Gbps (1000 Mbps)

Specify the input clock rate by Clock frequency

Clock frequency 50 MHz

Use shared PLLs Not selected

Use pll_areset Not selected

Use rx_locked Selected

Clock resource for rx_outclock Auto selection

5 Use rx_divfwdclk output port Selected

Simulated recovered clock phase drift 0 PPM

Use rx_dpll_hold Not selected

6 Use rx_reset Not selected

Use rx_dpa_locked Not selected

Use DPA initial phase selection Not selected

Align DPA to rising edge of data only Not selected

7 Register outputs Selected

Use rx_channel_data_align Not selected

Page 81: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–67November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

8. Click Finish. The rx_block module is built.

9. Click OK. The MegaWizard Plug-In Manager resets to page 2a to allow you to create a new custom megafunction variation for the LVDS transmitter.

10. In the MegaWizard Plug-In Manager pages, select or verify the configuration settings shown in Table 2–14.

8 Generate netlist Not selected

9 Variation file Selected

PinPlanner ports PPF file Selected

AHDL Include file Selected

VHDL component declaration file Selected

Quartus II symbol file Selected

Instantiation template file Selected

Verilog HDL black box file Selected

Table 2–13. Configuration Settings for Design Example 3 (LVDS Receiver) (Part 2 of 2)

MegaWizard Plug-In

Manager Page

MegaWizard Plug-In Manager Configuration Setting Value

Table 2–14. Configuration Settings for Design Example 3 (LVDS Transmitter) (Part 1 of 2)

MegaWizard Plug-In

Manager Page

MegaWizard Plug-In Manager Configuration Setting Value

2a Megafunction Under I/O, select ALTLVDS

Device family Stratix III

Output file type Verilog HDL

Output file name tx_block

Return to this page for another create operation Not selected

3 Currently selected device family Stratix III

Match project/default Selected

This module acts as an LVDS transmitter

Implement SERDES in logic cells Not selected

Number of channels 1

Deserialization factor 10

Use External PLL Not selected

Page 82: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–68 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Design Example 3: Stratix III Soft Clock Data Recovery

11. Click Finish. The tx_block module is built.

12. On the File menu, click Save Project.

13. On the Processing menu, click Start Compilation.

14. When the Full Compilation was successful message box appears, click OK.

15. On the Tools menu, select Netlist Viewers, and click RTL Viewer to view the design schematic in the RTL Viewer.

The block diagram file should look like Figure 2–33.

4 Output data rate 1 Gbps (1000 Mbps)

Specify the input clock rate by Clock frequency

Clock frequency 50 MHz

Phase alignment of tx_in with tx_inclock rise 0

Use tx_pll_enable not available

Use pll_areset Not selected

Use shared PLLs Not selected

Register tx_in using tx_coreclock

5 Use tx_outclock Not selected

Use tx_locked Selected

Use tx_coreclock Not selected

6 Generate netlist Not selected

7 Variation file Selected

PinPlanner ports PPF file Selected

AHDL Include file Selected

VHDL component declaration file Selected

Quartus II symbol file Selected

Instantiation template file Selected

Verilog HDL black box file Selected

Table 2–14. Configuration Settings for Design Example 3 (LVDS Transmitter) (Part 2 of 2)

MegaWizard Plug-In

Manager Page

MegaWizard Plug-In Manager Configuration Setting Value

Page 83: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 2–69November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Getting Started

Figure 2–33. Design Example 3 in RTL Viewer

16. On the Processing menu, click Compilation Report to view the resource usage of this design.

Functional Results—Simulate the altlvds Receiver/Transmitter Design in the ModelSim-Altera Simulator

Simulate the design in the ModelSim-Altera software to generate a waveform display of the device behavior.

This user guide assumes that you are familiar with using the ModelSim-Altera simulator before trying out the design example. If you are unfamiliar with using the ModelSim-Altera simulator, refer to the support page for software products on the Altera website (www.altera.com). The support page contains various links to topics such as installation, usage, and troubleshooting.

Set up the ModelSim-Altera simulator by performing the following steps:

1. Unzip the altlvds_ex3_msim.zip file to any working directory on your PC.

2. Start the ModelSim-Altera software.

3. On the File menu, click Change Directory.

4. Select the folder in which you unzipped the files. Click OK.

5. On the Tools menu, click Execute Macro.

6. Select the altlvds_ex3_msim.do file and click Open. This is a script file for the ModelSim software that automates all the necessary settings for the simulation.

7. Verify the results shown in the Waveform Viewer window.

Page 84: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

2–70 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Conclusion

You can rearrange signals, remove signals, add signals, and change the radix by modifying the script in altlvds_ex1_msim.do. Figure 2–34 shows the expected simulation results in the ModelSim simulator.

Figure 2–34. Design Example 3 ModelSim Simulation Results

This waveform file contains only the input and output pins that are shown. You can add internal post-compilation nodes with the Node Finder to view all of the data paths in the design, including the soft-CDR data path.

This simulation output confirms that 1-Gbps data can be successfully received using the recovered clock from the soft CDR and then transmitted from the Stratix III device. You can observe this by comparing the values on the text_rx_in and text_tx_out ports.

Conclusion The Quartus II software provides parameterizable megafunctions ranging from simple arithmetic units, such as adders and counters, to advanced phase-locked loop (PLL) blocks, multipliers, and memory structures. These megafunctions are performance-optimized for Altera devices and therefore provide more efficient logic synthesis and device implementation, because they automate the coding process and save valuable design time. Altera recommends using these functions during design implementation so you can consistently meet your design goals.

Page 85: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable 3–1November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Chapter 3. Specifications

Ports and Parameters

The Quartus® II software provides the altlvds megafunction that supports LVDS transmitter and receiver functionality. This chapter describe the ports and parameters of the altlvds megafunction. These ports and parameters are available to customize the altlvds megafunction according to your application.

Enabling or disabling some parameters changes which ports are available for use in the altlvds megafunction. For example, if you enable the Dynamic Phase Alignment (DPA) mode for Stratix® III, Stratix II, Stratix II GX, or Stratix GX devices, several different ports become available. Some of these ports replace non-DPA ports, and some control features that are unique to the DPA function. The following tables show all of the available ports and parameters and which Stratix and Cyclone® device families support those features.

The parameter details are only relevant for users who bypass the MegaWizard® Plug-In Manager interface and use the megafunction as a directly parameterized instantiation in their design. The details of these parameters are hidden from the user of the MegaWizard Plug-In Manager interface.

f Refer to the latest version of the Quartus II Help for the most current information on the ports and parameters for this megafunction.

Table 3–1 shows the transmitter input ports, Table 3–2 shows the transmitter output ports, and Table 3–3 shows the transmitter parameters. Table 3–4 shows the receiver input ports, Table 3–5 shows the receiver output ports, and Table 3–6 shows the receiver parameters.

Page 86: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

3–2 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Ports and Parameters

Table 3–1. Transmitter Input Ports

Port Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tix II

GX,

and

Stra

tixIII

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

sync_inclockNo — — — — —

Optional clock for the input registers. This port is available for APEX™ 20KE, APEX 20KC, Mercury™, and APEX II devices only.

tx_in[]

Yes v v v v vInput port [DESERIALIZATION_FACTOR × NUMBER_OF_CHANNELS – 1..0] wide. This is parallel data that is serially transmitted by the megafunction.

tx_inclock Yes v v v v v LVDS reference input clock.

tx_pll_enableNo v v v v v Enable control for the LVDS PLL. Not available in

Cyclone III device.

pll_areset No v v v v v Asynchronously resets all PLL counters to initial values.

tx_enable

No — — v — —

This port is used only when USE_EXTERNAL_PLL is selected and must connect to the enable0 or enable1 output port of an altpll megafunction configured in LVDS mode.

Page 87: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable3–3November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Specifications

Table 3–2. Transmitter Output Ports

Port Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tix II

GX,

and

Stra

tixIII

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

tx_out[]

Yes v v v v vOutput port [NUMBER_OF_CHANNELS – 1..0] wide. After serialization, tx_in[n-1] is the first bit transmitted and tx_in[0] is the last bit transmitted for channel one; for channel two, tx_in[2n-1] is the first bit transmitted and tx_in[n] is the last bit transmitted.

tx_outclock No v v v v v External reference clock.

tx_coreclock No v v v v v Output clock used to feed non-peripheral logic.

tx_lockedNo v v v v v

Gives the status of the LVDS PLL. When the PLL is locked, this signal is VCC. When the PLL fails to lock, this signal is GND.

Page 88: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

3–4 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Ports and Parameters

Table 3–3. Transmitter Parameters (Part 1 of 6)

Parameter Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tix II

GX,

and

Stra

tixIII

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

INTENDED_DEVICE_FAMILY

Yes v v v v v

[String] Select from "Stratix III ", "Stratix II GX", "Stratix II", "Stratix", "Stratix GX", "Cyclone III","Cyclone II", or "Cyclone". The ports and parameters that are available in the wizard change depending on this selection, since some features are device-dependent.

NUMBER_OF_CHANNELSYes v v v v v [Integer] Specifies the number of LVDS

channels.

DESERIALIZATION_FACTOR

Yes v v v v v

[Integer] Specifies the number of bits per channel. Values are:

Device Family Values

Stratix III, Stratix II, Stratix II GX, Cyclone III,Cyclone II, Cyclone, HardCopy II, and APEX II

1, 2, 4, 5, 6, 7, 8, 9, 10

Stratix and Stratix GX 1, 2, 4, 7, 8, 10

APEX 20KC, APEX 20KE

1, 4, 7, 8

Mercury 1, 2, 4, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20

LPM_TYPE

Yes v v v v v[String] Select LVDS transmitter in the wizard to instantiate a serializer function. For HDL instantiation, the usage is "altlvds_tx".

Page 89: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable3–5November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Specifications

USE_EXTERNAL_PLL

No — — v v v[String] Values are "ON" or "OFF". Specify "ON" to prevent the altlvds function from instantiating a fast PLL automatically.

OUTCLOCK_DIVIDE_BY

No v v v v v

[Integer] Specifies the period of the tx_outclock port as INCLOCK_PERIOD × OUTCLOCK_DIVIDE_BY and the frequency of the tx_outclock port as INCLOCK PERIOD / OUTCLOCK_DIVIDE_BY. The default value for this parameter is DESERIALIZATION_FACTOR.

CORECLOCK_DIVIDE_BY

No — — — v v

[Integer] Values are 1 or 2. Specifies the CORECLOCK output frequency to either be CORECLOCK or CORECLOCK divided by 2. This is only available when using odd SERDES factors. When using a divide-by factor of 1, fewer device resources are used, but you may not be able to achieve timing at higher data rates. Altera recommends using a divide by factor of 2 for higher data rates.

Table 3–3. Transmitter Parameters (Part 2 of 6)

Parameter Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tix II

GX,

and

Stra

tixIII

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

Page 90: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

3–6 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Ports and Parameters

OUTCLOCK_ALIGNMENT

Refer to Figure 3–1.

Yes v v v v v

[String] Specifies the alignment of tx_outclock with respect to the rising edge of tx_inclock. Figure 3–1 shows the relationship between tx_inclock and tx_outclock for three different values of OUTCLOCK_ALIGNMENT. Values are"EDGE_ALIGNED", "45_DEGREES", "90_DEGREES", "135_DEGREES", "CENTER_ALIGNED", "235_DEGREES", "270_DEGREES", and "315_DEGREES". If omitted, the default is "EDGE_ALIGNED".

INCLOCK_PERIOD

Yes v v v v v[Integer] Specifies the input clock either by frequency (MHz in the wizard) or period (ps in HDL code). This parameter is required when the external PLL option is not used.

OUTPUT_DATA_RATE

Yes v v v v v[Integer] Specifies the data rate out of the PLL. The multiplication value for the PLL is OUTPUT_DATA_RATE / INCLOCK_PERIOD.

INCLOCK_DATA_ALIGNMENT

Refer to Figure 3–2.

Yes v v v v v

[String] Specifies the alignment of input data with respect to the rising edge of the rx_inclock port. Figure 3–2 shows the relationship between input data and the clock for three different values of INCLOCK_DATA_ALIGNMENT. Supported values are "EDGE_ALIGNED", "45_DEGREES", "90_DEGREES", "135_DEGREES", "CENTER_ALIGNED", "235_DEGREES", "270_DEGREES", and "315_DEGREES". If omitted, the default is "EDGE_ALIGNED".

Table 3–3. Transmitter Parameters (Part 3 of 6)

Parameter Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tix II

GX,

and

Stra

tixIII

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

Page 91: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable3–7November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Specifications

REGISTERED_INPUT

No v v v v v

[String] Indicates whether the tx_in[]ports should be registered and the clock that registers the parallel data. Values are "ON", "OFF", "TX_INCLK", and "TX_CORECLK". The default value is "OFF". "TX_INCLK" must be used when the parallel data rate is equal to the tx_inclk frequency, but not equal to the tx_coreclk frequency. "TX_CORECLK" must be used when the parallel data rate is not equal to the tx_inclk frequency. When the tx_inclk frequency is equal to the tx_coreclk frequency, either can be used to register the inputs. The frequency of the tx_coreclk is equal to the OUTPUT_DATA_RATE / DESERIALIZATION_FACTOR.

COMMON_RX_TX_PLL

No v v v v v

[String] Specifies whether the compiler may use the same PLL for both the LVDS receiver and the LVDS transmitter, provided they have the same input clock frequency. Values are "ON" and "OFF". If omitted, the default is "ON".

OUTCLOCK_RESOURCENo v v v v v

[String] Specifies the resource used for the output clock. Values are "AUTO", "GLOBAL CLOCK", or "REGIONAL CLOCK".

Table 3–3. Transmitter Parameters (Part 4 of 6)

Parameter Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tix II

GX,

and

Stra

tixIII

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

Page 92: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

3–8 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Ports and Parameters

IMPLEMENT_IN_LES

No v v v v v

[String] Specifies whether to implement serializer/deserializer circuitry in logic cells, which allows the circuitry to behave similar to Stratix LVDS circuitry. The IMPLEMENT_IN_LES parameter should be used for SERDES functions that require data rates that are lower than the dedicated circuitry. Values are "ON" and "OFF". This parameter is available for Stratix III, Stratix II, Stratix II GX, Stratix, and Stratix GX devices only. This parameter is always enabled for Cyclone III, Cyclone II, and Cyclone devices only.

MULTI_CLOCK

No — — — — —

[String] Indicates whether the sync_inclock port is used for input registering. Values are "ON" and "OFF." If omitted, the default is "OFF". This parameter is available for APEX 20KC, APEX 20KE, Mercury, and APEX II devices only.

INCLOCK_BOOST

No — — — — —

[Integer] The effective clock period used to sample output data. Values are 1, 2, and 4-10. This parameter is available for APEX II and Mercury devices only.

Table 3–3. Transmitter Parameters (Part 5 of 6)

Parameter Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tix II

GX,

and

Stra

tixIII

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

Page 93: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable3–9November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Specifications

CENTER_ALIGN_MSB

No — — — — —

[String] Indicates whether the most significant bit center alignment is used for data bit alignment. Values are "ON" and "OFF". If omitted, the default is "OFF". This parameter is available for APEX II devices only.

OUTCLOCK_DUTY_CYCLE

No v v v v v

[Integer] Duty cycle (% of the clock cycle during which the clock signal is high) for the external clock. A value of 50 is not supported when all of the following conditions hold:● DESERIALIZATION_FACTOR value

is 5, 7, or 9● OUTLCLOCK_DIVIDE_BY value is

same as value of DESERIALIZATION_FACTOR

● OUTCLOCK_MULTIPLY_BY value is 2

Table 3–3. Transmitter Parameters (Part 6 of 6)

Parameter Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tix II

GX,

and

Stra

tixIII

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

Page 94: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

3–10 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Ports and Parameters

Table 3–4. Receiver Input Ports (Part 1 of 3)

Port Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tix II

GX,

and

Stra

tixIII

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

rx_in[]

Yes v v v v v

Input port [NUMBER_OF_CHANNELS – 1..0] wide. After deserialization, rx_out[n-1] is the first bit received and rx_out[0] is the last bit received for channel one; for channel two, rx_out[2n-1] is the first bit received and rx_out[n] is the last bit received.

rx_inclock Yes v v v v v LVDS reference input clock.

rx_pll_enableNo v v v v v Enable control for the LVDS PLL. This

port is not available in Cyclone III.

rx_data_align

No v v — — —

Controls byte alignment circuitry by delaying the data on all channels by one bit when asserted. You can register this port using the rx_outclock port. For Stratix GX devices, this port is available in non-DPA mode.

rx_channel_data_align[]

No — v v — —

Input port [NUMBER_OF_CHANNELS – 1..0] wide. Controls byte alignment circuitry. A pulse to this input causes the data alignment circuitry to remove one bit of latency from the serial data stream in Stratix GX devices, or add one bit of latency into the serial data stream for Stratix III, Stratix II, and Stratix II GX devices. You can register this port using the rx_outclock port. For Stratix GX devices, this port is available in DPA mode.

Page 95: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable3–11November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Specifications

rx_dpll_enable[] (1)

No — — v — —

Input port [NUMBER_OF_CHANNELS – 1..0] wide. Enables the path through DPA circuitry.

rx_dpll_hold[] (1)

No — — v — —

Input port [NUMBER_OF_CHANNELS – 1..0] wide. Prevents the DPA from switching to a new phase.

rx_reset[] (1)

No — v v — —

Input port [NUMBER_OF_CHANNELS – 1..0] wide. Synchronizes all channels and resets the DPA circuitry. This port must be connected if the ENABLE_DPA_MODE parameter is turned on in Stratix GX.

rx_dpll_reset[] (1)

No — v — — —

Input port [NUMBER_OF_CHANNELS - 1..0] wide. Asynchronous reset for all channels.

rx_fifo_reset[] (1)

No — — v — —

Input port [NUMBER_OF_CHANNELS - 1..0] wide. Resets the FIFO between DPA and data alignment circuits.

rx_cda_reset[]No — — v — —

Input port [NUMBER_OF_CHANNELS - 1..0] wide. Resets the data alignment circuitry.

rx_coreclk[] (1)

No — v — — —

Input port [NUMBER_OF_CHANNELS - 1..0] wide. LVDS reference input clock used to synchronize the output of the receiver to a clock used in the core. One clock is used for each channel.

Table 3–4. Receiver Input Ports (Part 2 of 3)

Port Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tix II

GX,

and

Stra

tixIII

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

Page 96: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

3–12 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Ports and Parameters

pll_aresetNo v v v v v Asynchronously resets all counters to

initial values.

rx_enable

No — — v — —

This port is used only when USE_EXTERNAL_PLL is selected and must connect to the enable0 or enable1 output port of an altpll megafunction configured in LVDS mode.

rx_deskewNo — — — — —

Specifies whether to activate calibration mode. This port is available for APEX 20KE and APEX 20KC devices only.

Note to Table 3–4:(1) These functions are only available when using DPA mode in Stratix III, Stratix II, Stratix II GX, and Stratix GX

devices.

Table 3–4. Receiver Input Ports (Part 3 of 3)

Port Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tix II

GX,

and

Stra

tixIII

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

Page 97: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable3–13November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Specifications

Table 3–5. Receiver Output Ports

Port NameRe

quire

d

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tix II

GX,

and

Stra

tixIII

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

rx_out[]Yes v v v v v

Output port [DESERIALIZATION_FACTOR × NUMBER_OF_CHANNELS - 1..0] wide. Deserialized data signal.

rx_outclock No v v v v v Internal reference clock.

rx_lockedNo v v v v v

Provides the status of the LVDS PLL. When the PLL is locked, this signal is VCC. When the PLL fails to lock, this signal is GND.

rx_dpa_locked[]No — — v — —

Output port [NUMBER_OF_CHANNELS - 1..0] wide. Indicates whether the channel is locked to the phase of rx_in[] when in DPA mode.

rx_cda_max[]

No — — v — —

Output port [NUMBER_OF_CHANNELS - 1..0] wide. Indicates when the next rx_channel_data_align[] pulse restores the serial data latency back to 0.

rx_divfwdclk[]

No — — v — —

Recovered clock output from the DPA block and sent to the core via the PCLK network. The DPA output clock selected by the DPA block is divided by the deserialization factor. This divided clock is the recovered clock.

Page 98: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

3–14 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Ports and Parameters

Table 3–6. Receiver Parameters (Part 1 of 8)

Parameter Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tixII

GX, a

nd S

tratix

III

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

INTENDED_DEVICE_FAMILY

Yes v v v v v

[String] Select from "Stratix III", "Stratix II GX", "Stratix II", "Stratix", "Stratix GX", "Cyclone III", "Cyclone II", or "Cyclone". The ports and parameters that are available in the wizard change depending on this selection, since some features are device-dependent.

NUMBER_OF_CHANNELSYes v v v v v [Integer] Specifies the number of LVDS

channels.

DESERIALIZATION_FACTORYes v v v v v [Integer] Specifies the number of bits per

channel.

ENABLE_DPA_MODENo — v v — —

[String] Turns on DPA mode. Values are "ON" and "OFF"; if omitted, the default value is "OFF".

USE_EXTERNAL_PLL

No — — v v v

[String] Values are "ON" or "OFF". Specify "ON" to prevent the altlvds function from instantiating a fast PLL automatically.

This option is not available when using odd J factors in Cyclone III, Cyclone II, and Cyclone devices.

COMMON_RX_TX_PLL

No v v v v v

[String] Specifies whether the compiler may use the same PLL for both the LVDS receiver and the LVDS transmitter, provided they have the same input clock frequency. Values are "ON" and "OFF". If omitted, the default is "ON".

Page 99: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable3–15November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Specifications

OUTCLOCK_RESOURCE

No v v v — —

[String] Specifies the resource used for the output clock. Values are "AUTO", "GLOBAL CLOCK", or "REGIONAL CLOCK".

INCLOCK_PERIODYes v v v v v

[Integer] Specifies the input clock either by frequency (MHz) or period (ns in the wizard or ps in HDL code).

INPUT_DATA_RATE

Yes v v v v v[Integer] Specifies the data rate into the PLL. The multiplication value for the PLL is INPUT_DATA_RATE / INCLOCK_PERIOD.

INCLOCK_DATA_ALIGNMENT

Yes v v v(1) v v

[String] Specifies the alignment of input data with respect to the rising edge of the rx_inclock port. Values are "EDGE_ALIGNED", "45_DEGREES", "90_DEGREES", "135_DEGREES", "CENTER_ALIGNED", "235_DEGREES", "270_DEGREES", and "315_DEGREES". If omitted, the default is "EDGE_ALIGNED".

ENABLE_DPA_FIFO

No — v v(2)

— —

[String] Values are "ON" or "OFF". Indicates whether the DPA FIFO buffer is enabled for this channel. If omitted, the default is "ON".

Table 3–6. Receiver Parameters (Part 2 of 8)

Parameter Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tixII

GX, a

nd S

tratix

III

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

Page 100: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

3–16 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Ports and Parameters

USE_CORECLOCK_INPUT

No — v v(2)

— —

[String] Values are "ON" or "OFF". Indicates whether the rx_coreclk port or the clock from PLL is used as the non-peripheral clock. The rx_coreclk port must be connected if you turn on this parameter. If omitted, the default is "OFF".

RESET_FIFO_AT_FIRST_LOCK

No — — v — —

[String] Values are "ON" to automatically reset the bit serial FIFO when rx_dpa_locked rises for the first time or "OFF" to explicitly reset the FIFO through rx_reset. Resets the FIFO between the DPA and the deserializer.

LOSE_LOCK_ON_ONE_CHANGE

No — — v — —

[String] Values are "ON" if phase alignment circuitry switches to a new phase or "OFF" if there are two phase changes in the same direction. Indicates when the DPA circuit has lost phase lock.

REGISTERED_OUTPUTNo v v v v v

[String] Values are "ON" or "OFF". Indicates whether the rx_out[] port should be registered.

REGISTERED_DATA_ALIGN_INPUT

No v v v(1)

— —

[String] Values are "ON" or "OFF". Specifies whether the rx_data_align port is registered, which controls the enabling of the synchronization register in the receiver.

Table 3–6. Receiver Parameters (Part 3 of 8)

Parameter Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tixII

GX, a

nd S

tratix

III

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

Page 101: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable3–17November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Specifications

DATA_ALIGN_ROLLOVER

No — — v — —

[Integer] Values are 1 through 11, which indicate the number of pulses it takes for the data alignment circuitry to restore the serial data latency back to 0. This parameter is only available if the rx_channel_data_align input port is used.

INCLOCK_BOOST

No — — — — —

[Integer] The effective clock period used to sample output data. Values are 1, 2, and 4-10. This parameter is available for APEX II and Mercury devices only.

CDS_MODE

No — — — — —

[String] Values are SINGLE_BIT, MULTIPLE_BIT, and UNUSED. If omitted, the default is UNUSED. When this parameter is set to SINGLE_BIT, the deskew circuitry will expect a bit pattern like 00001111, which can correct for clock skew up to 50% of one clock edge. When this parameter is set to MULTIPLE_BIT, the deskew circuitry will expect a pattern like 01010101, which can correct for any clock skew but requires user circuitry to align data. This parameter is available for APEX II devices only.

Table 3–6. Receiver Parameters (Part 4 of 8)

Parameter Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tixII

GX, a

nd S

tratix

III

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

Page 102: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

3–18 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Ports and Parameters

IMPLEMENT_IN_LES

No v v v — —

[String] Specifies whether to implement serializer/deserializer circuitry in logic cells, which allows the circuitry to behave similar to Stratix LVDS circuitry. The IMPLEMENT_IN_LES parameter should be used for SERDES functions that require data rates that are lower than the dedicated circuitry. Values are "ON" and "OFF". This parameter is available for Stratix III, Stratix II, Stratix, and Stratix GX devices only.

Table 3–6. Receiver Parameters (Part 5 of 8)

Parameter Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tixII

GX, a

nd S

tratix

III

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

Page 103: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable3–19November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Specifications

BUFFER_IMPLEMENTATION

No v v v v v

[String] Specifies where to implement the buffer. BUFFER IMPLEMENTATION applies only to Cyclone III, Cyclone II, and Cyclone, and Stratix III, Stratix II, and Stratix (LE implementations only for Stratix series) for Odd deserialization factors.

To use the BUFFER_IMPLEMENTATION parameter, the IMPLEMENT_IN_LES parameter must be turned on. Also, the BUFFER_IMPLEMENTATION parameter can be used with deserialization factors of 5, 7, or 9 only.

Values are:

Parameter Value: MUXDescription: Uses mux implementation instead of buffer implementation.

Parameter Value: RAMDescription: Buffer is implemented in RAM blocks.

Parameter Value: LESDescription: Buffer is implemented in logic elements.

If omitted, the default is “RAM”.

Table 3–6. Receiver Parameters (Part 6 of 8)

Parameter Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tixII

GX, a

nd S

tratix

III

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

Page 104: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

3–20 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Ports and Parameters

PORT_RX_DATA_ALIGN

No v v — — —

[String] Determines if the rx_data_align port is used or unused. Values are:

Parameter Value: PORT_USEDDescription: Value assumes the rx_data_align port is used.

Parameter Value: PORT_UNUSEDDescription: Value assumes the rx_data_align port is not used.

Parameter Value: PORT_CONNECTIVITYDescription: Value checks the connectivity of the rx_data_align port to determine usage.

If omitted, the default is "PORT_CONNECTIVITY".

ENABLE_SOFT_CDRNo — — v — —

Enables soft-CDR mode. Applies to Stratix III devices only.

IS_NEGATIVE_PPM_DRIFT

No — — v — —

Simulation-only parameter. Determines whether the PPM drift of the recovered clock is negative (receiver is faster than transmitter) or positive (transmitter is faster than receiver). Applies to Stratix III devices only.

NET_PPM_VARIATION

No — — v — —

Simulation-only parameter. User-specified PPM drift for the recovered clock. Applies to Stratix III devices only.

Table 3–6. Receiver Parameters (Part 7 of 8)

Parameter Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tixII

GX, a

nd S

tratix

III

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

Page 105: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

Altera Corporation MegaCore Version a.b.c variable3–21November 2007 SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide

Specifications

ENABLE_DPA_INITIAL_PHASE_SELECTION No — — v — —

Enables the user-specified initial DPA phase setting. Applies to Stratix III devices only.

DPA_INITIAL_PHASE_VALUE

No — — v — —

User-specified choice of the initial DPA phase (out of 8 possible DPA phases). Available phases are 0, 45, 90, 135, 180, 225, 270, and 315 degrees. Applies to Stratix III devices only.

ENABLE_DPA_ALIGN_TO_RISING_EDGE_ONLY

No — — v — —

If TRUE, DPA clock aligns to rising edge of data only. If FALSE, DPA clock aligns to both rising and falling data edges. Default value is FALSE. Applies to Stratix III devices only.

Notes to Table 3–6:(1) This parameter is not available for Stratix III, Stratix II, and Stratix GX devices when using DPA mode.(2) This parameter is available only for Stratix III, Stratix II, and Stratix GX devices when using DPA mode.

Table 3–6. Receiver Parameters (Part 8 of 8)

Parameter Name

Requ

ired

Stra

tix

Stra

tix G

X

Stra

tixII,

Stra

tixII

GX, a

nd S

tratix

III

Cycl

one

Cycl

one

III a

nd C

yclo

ne II

Description

Page 106: SERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guideread.pudn.com/downloads111/sourcecode/embed/461016/altera exa… · November 2007 SERDES Transmitter/Receiver (ALTLVDS)

3–22 MegaCore Version a.b.c variable Altera CorporationSERDES Transmitter/Receiver (ALTLVDS) Megafunction User Guide November 2007

Ports and Parameters

Figure 3–1. OUTCLOCK_ALIGNMENT

Figure 3–2. INCLOCK_DATA_ALIGNMENT

tx_inclock

tx_outclock

tx_outclock

tx_outclock

Edge 180

Reference Edge

A

A

A

B

B

B

C

C

C180o Phase

45o Phase

Edge Aligned

Input Clock

Edge 180