Application Note 147 August 2014 Altera Stratix IV FPGA Interface for LTM9011 ADC with LVDS Outputs Gary Yu Summary This document shows how to interface a Linear Technology LTM®9011 8-channel, simultaneous sampling 14-bit analog-to-digital converter (ADC) with high speed serial low voltage differential signaling (LVDS) to Altera Stratix IV FPGAs utilizing the dedicated I/O functions of the FPGA family. Introduction This document details the interface of an Altera Stratix IV FPGA to a high speed LTM9011 ADC from Linear Technology. Implementation is demonstrated via the LTM9011 demo board DC1884A and a Stratix IV GX FPGA development board contained in the Stratix IV GX FPGA development kits. To learn more detailed information regarding the Stratix IV GX FPGA development kits and Linear Technology DC1884A, refer to: www.altera.com/products/devkits/altera/kit-siv-gx.html n http://www.linear.com/demo/DC1884A The FPGA design, implementation and simulation are described here. ADC LVDS Interface The LTM9011 is a high speed, octal ADC with a serial LVDS interface. Each channel output can be configured in 2-bit (2-lane) mode or 1-bit (1-lane) mode. This document only demonstrates 2-lane mode and 16-bit format (14 bits of data with two dummy bits per frame) supporting the maximum sampling rate up to 125Msps per channel. The LTM9011 integrates two quad channel 14‑bit ADCs similar to the LTC2175, as shown in the block diagram in Figure 1. The sample clock, ENC±, launches the A/D conversion and the output sample data are carried on two serial data streams. Each 14-bit sample is formatted as 16 bits while the LSBs always contain zeroes. Data bits are synchronized with the bit clock, DCO±, and the sample boundaries are indicated by the frame signal FR±. For more about LTM9011, see the data sheet at http://www.linear. com/product/LTM9011 L, LT, LTC, LTM, Linear Technology and the Linear logo are registered trademarks and PScope is a trademark of Linear Technology Corporation. All other trademarks are the property of their respective owners. n 1.8V VDD 1.8V OVDD S/H 14-BIT ADC CORE OUT1A CHANNEL 2 ANALOG INPUT S/H 14-BIT ADC CORE OUT2A CHANNEL 8 ANALOG INPUT ENCODE INPUT S/H OUT1B ••• OUT2B ••• DATA SERIALIZER ••• ••• CHANNEL 1 ANALOG INPUT SERIALIZED LVDS OUTPUTS OUT8A 14-BIT ADC CORE OUT8B DATA CLOCK OUT PLL FRAME GND GND AN147 F01 Figure 1. LTM9011 Block Diagram an147f AN147-1 Application Note 147 tAP ANALOG INPUT N+1 N tENCH ENC– tENCL ENC+ tSER DCO– DCO+ tFRAME FR– FR+ OUT#A– OUT#A+ OUT#B– OUT#B+ tDATA tSER tPD tSER D5 D3 D1 0 D13 D11 D9 D7 D5 D3 D1 0 D13 D11 D9 D4 D2 D0 0 D12 D10 D8 D6 D4 D2 D0 0 D12 D10 D8 SAMPLE N-6 SAMPLE N-5 SAMPLE N-4 AN147 F02 Figure 2. LTM9011 Interface Timing Diagram Table 1. LTM9011 Interface Timing Diagram SYMBOL PARAMETER MIN TYP MAX UNIT tAP Sample-And-Hold Acquisition Delay 0 ns tENCL Sample Clock Low Time 2 4 100 ns tENCH Sample Clock High Time 2 4 100 ns tSER Serial Data Bit Period tDATA DATA to DCO Delay 0.35 1 0.5 0.65 ns ns tFRAME FR to DCO Delay 0.35 0.5 0.65 ns tPD Propagation Delay 2.7 3.1 3.5 ns Demonstration System Architecture The Stratix IV GX FPGA development board is a hardware platform for developing and prototyping low power, high performance and logic-intensive designs. The board contains a Stratix IV GX FPGA EP4SGX230KF40 (BGA 1517 pins) and offers a wide range of peripherals and interfaces to facilitate the development. The DC1884A demo board is connected to the FPGA board through a high density flexible cable, SAMTEC SCF-156146-02-MA, adapting the SAMTEC SEAF (FMC) connector of the demo board to a high speed mezzanine card (HSMC) connector (J2) of the FPGA board. This connection carries 20 high speed LVDS lines: 16 lines for data OUT#A and OUT#B, two lines for data clock DCOA and DCOB and two lines for the frame signals FRA and FRB, which are generated by the LTM9011 on the DC1884A demo board. The LTM9011 requires an external clock source with ultralow jitter as a sample clock (ENC) and eight analog signal inputs. The FPGA board includes an embedded USB blaster to allow the host to program the FPGA via a JTAG interface over a type-B USB cable. The host can also use this interface to dynamically capture data and set up parameters from the FPGA internal block memory during operation. Alternately, the data of a specified channel can be retrieved with an associated clock and control signal through a parallel I/O interface assigned to J1 of the FPGA board. This FPGA can also drive an LCD module card to display configuration information including buffer size, FPGA status and the channel number, which is specified for the parallel data output. The configuration and display logic utilize a second clock domain, SYSCLK, which is derived from a 50MHz onboard oscillator. The DC1884A demo board has an SPI interface for the LTM9011 for internal configuration and is controlled by the DC590B USB to SPI controller or DC2026 Linduino microcontroller board. I/O Architecture of Stratix IV FPGA The Stratix GX device includes a built-in serializer/deserializer (SERDES) circuit that supports high speed LVDS interfaces at data rates of up to 1.6Gbps. Pin assignment is important in Stratix IV FPGA LVDS applications because only some of the I/O blocks support full LVDS features and only some of the PLLs support these I/Os. The Stratix IV device family supports LVDS on both row and column I/O banks. an147f AN147-2 Application Note 147 HOST PC USB HOST USB HOST DC590B SPI CONTROLLER FPGA SYSCLK 50MHz OSCILLATOR dco_d_p/n fr_d_p/n out4a_p/n out4b_p/n out5a_p/n out5b_p/n out6a_p/n out6b_p/n out7a_p/n out7b_p/n cllclk cllctrl clldata STRATIX IV GX FPGA DEVELOPMENT BOARD SPI INTERFACE SEAF CONNECTOR LCD INTERFACE dco_u_p/n fr_u_p/n out0a_p/n out0b_p/n out1a_p/n out1b_p/n out2a_p/n out2b_p/n out3a_p/n out3b_p/n HSMC TO SEAF CABLE JTAG INTERFACE HSMC CONNECTOR LCD MODULE DCOA± FRA± OUT1A± OUT1B± OUT4A± OUT4B± OUT5A± OUT5B± OUT8A± OUT8B± DCOB± FRB± OUT2A± OUT2B± OUT3A± OUT3B± OUT6A± OUT6B± OUT7A± OUT7B± ENC± AIN1± AIN2± AIN3± AIN4± AIN5± AIN6± AIN7± AIN8± 125MHz CLOCK SOURCE 8 CHANNELS ANALOG SOURCE LTM9011 HSMC CONNECTOR EMBEDDED USB BLASTER DC1884A DEMO BOARD AN147 F03 Figure 3. Demonstration System Architecture Column I/O buffers (located on top and bottom sides) are connected to single-ended pads and need external termination schemes to support the LVDS I/O standard. n Row I/O buffers (located on left and right sides) are true LVDS buffers and only PLLs located on the left and right sides support these I/Os. n Dedicated SERDES circuitry is implemented on the row I/O banks with further enhanced LVDS interface performance in the device. For column I/O banks, the SERDES is implemented in the core logic because there is no dedicated SERDES circuitry on column I/O banks. The following dedicated components are contained in the SERDES circuitry: Differential I/O buffer n Transmitter serializer n Receiver deserializer n Data realignment n DPA (dynamic phase aligner) n Synchronizer (FIFO buffer) n Phase-locked loops (PLLs) n The direction of true differential I/O buffers is not configurable. The specific pin only supports one direction of data flow. an147f AN147-3 Application Note 147 This application uses only differential receivers. The receiver has a differential buffer, the left or right PLL that generates the clocks only for SERDES, a DPA block, a synchronizer, a data realignment block and a deserializer. The differential buffer can receive LVDS, mini-LVDS, and RSDS signal levels, which are statically set in QUARTUS II software assignment editor. The PLL is fed by an external clock, DCO, divided by the serialization factor from the LTM9011, and generates different phases of the same clock. The serial data, one line of data or frame stream in this application, is fed to the DPA circuitry first through differential data input buffers. The DPA block chooses one of the clocks and aligns the incoming data on each line. The synchronizer circuit is a 1 × 6-bit deep FIFO buffer that compensates for any phase difference between the DPA clock and the data realignment clock. Table 1 and Figure 2 illustrate the bit rate of each line going up to 1Gbps, if each channel’s maximum sample rate is 125Msps and data format is two lines of 16-bits. If the serialization factor is set to ×8, the parallel data bus generated by the deserializer to the FPGA fabric operates under the clock (RX_SYNCCLOCK) maximum of 125MHz. That is not critical. The ultrahigh speed parts are only handled by the FPGA using dedicated SERDES blocks. The interesting timing issue may be how to handle channelto-channel skew caused by the system architecture. The total propagation delay from ENC to the output of the deserializer for each channel of the LTM9011 is: total propagation delay = jitter of ENC + tPD + tAD + PCB delay (FPGA board + DC1884) + cable delay + input buffer of FPGA delay + delay of SERDES circuitry. where: tAD is the analog-to-digital conversion time equal to 5 • (tENCH + tENCL). The user-controlled data realignment circuitry (bit slip) inserts a single bit of latency in the serial bit stream to align to the word boundary. Max jitter of ENC (73.1dB SNR, analog frequency is 70MHz) is less than 1ps The deserializer includes shift registers and parallel load registers, and sends a maximum of 10 bits configured by the serialization factor (×3, ×4, ×6, ×7, ×8, or ×10) to the internal logic. The first bit is the MSB of the parallel data. The DPA block takes in high speed serial data from the differential input buffer and selects one of the eight phases generated by the left and right PLL—the one closest to the phase of the serial data—to sample the data. The maximum phase offset between the received data and the selected phase is 1/8 UI, the maximum quantization error of the DPA. The eight phases of the clock are equally divided, offering 45° resolution. PARALLEL DATA BUS DESERIALIZER SERIAL DATA BIT SLIP MUX Max differential of tPD at 125Msps is 0.8ns Max differential of PCB delay if matching the lengths of the differential traces ±5mil on FR4 is less than 10ps Max differential of cable delay is less than 10ps Max jitter of input buffer 160ps So the maximum skew for channel-to-channel from DCO to the input of the DPA is 0.001 + 0.8 + 0.01 + 0.01 + 0.16, or less than 1ns. Add the additional maximum phase offset of 0.125 • tSER generated by the DPA to calculate SERIAL DATA SYNCHRONIZER SERIAL DATA MUX DPA_rx_inclock FPGA FABRIC DPA_rx_enable LVDS_rx_enable LVDS_rx_inclock DATA INPUT BUFFER + – DPA CIRCUITRY 8 SERIAL LVDS CLOCK PHASES PLL CLOCK INPUT BUFFER + – rx_syncclock P PAD N PAD P PAD N PAD AN147 F04 Figure 4. Stratix IV Differential Receiver an147f AN147-4 Application Note 147 rx_in D0 D1 D2 D3 D4 Dn 0° 45° 90° 135° 180° 225° 270° 315° 0.125tVCO AN147 F05 tVCO Figure 5. DPA Clock Phase to Serial Data Timing Relationship tVCO Equal to tSER the maximum of skew from DCO to parallel output, or less than 1 + 0.125 • tSER or (1.125/8) • tRX_SYNCCLOCK). It is easy to latch the channels’ parallel data bus by shifting RX_SYNCCLOCK more than 1/4 cycle. There is one factor of uncertainty. The LTM9011 actually integrates two LTC2175-Style quad channel cores into one package, which shares one pair of differential clock pins (ENC). There is some skew between the two ENC inputs of each core, which causes skew between clock domain A (DCOA, FRA, channel 1, 4, 5, 8) and clock domain B (DCOB, FRB, channel 2, 3, 6, 7). The skew is not specified in the LTM9011 data sheet, but test results show that it is negligible in this application. FPGA Design In this application, two lines of serial data from one channel in 16-bit format are converted to 16 bits of parallel data, which is synchronized with the clock (RX_SYNCCLOCK) by configuring the serialization factor to ×8. So the eight channels of sixteen lines of serial data with two frame signals from the LTM9011 are converted to a 144-bit wide parallel data bus containing eight samples and two frame signals. The ALTLVDS MegaWizard Plug-In Manager software allows the user to choose whether to implement the LVDS interface via an external PLL or automatically provide the PLL. With the “Use External PLL” option disabled (Figure 6), the tool automatically creates an LVDS receiver with a PLL. The advantage of this solution is that the clock tree implementation and timing constraints are relatively easy. The disadvantage is that this PLL can’t be customized— an additional PLL may be required to divide an external clock source from the LTM9011 by ×8 and generate other necessary clock sources for FPGA logic usage. With the “Use External PLL” option enabled (Figure 7), the tool generates an LVDS receiver without a PLL. A dedicated PLL must be configured to generate all clock sources for the LVDS receiver to exactly meet its timing requirements and those for other FPGA logic. The advantage of this method is that we have control over the PLL settings, such as dynamically reconfiguring the PLL to support different data rates, dynamic phase shift, and other settings. Multiple LTM9011 Concept Figure 8 shows a solution for multiple LTM9011s. To implement the LVDS receivers for LTM9011 A and B in this application, several components on the Stratix IV GX FPGA development board come into play, including HSMC an147f AN147-5 Application Note 147 16 BITS CHANNEL 1 DATA BUS 16 SERIAL DATA STREAMS FROM 8 CHANNELS 16 BITS CHANNEL 2 DATA BUS 16 BITS CHANNEL 3 DATA BUS 2 FRAME STREAMS 16 BITS CHANNEL 4 DATA BUS + – P PAD + – P PAD + – P PAD + – P PAD N PAD N PAD 16 BITS CHANNEL 5 DATA BUS 16 BITS CHANNEL 6 DATA BUS DIFFERENTIAL RECEIVER 16 BITS CHANNEL 7 DATA BUS 16 BITS CHANNEL 8 DATA BUS 8 BITS FRAME A BUS 8 BITS FRAME B BUS DCOA EXTERNAL PLL 1/8 INTERNAL PLL MUX FPGA FABRIC DCOB N PAD N PAD AN147 F06 Figure 6. FPGA Design with External PLL Disabled 16 BITS CHANNEL 1 DATA BUS 16 SERIAL DATA STREAMS FROM 8 CHANNELS 16 BITS CHANNEL 2 DATA BUS 16 BITS CHANNEL 3 DATA BUS 2 FRAME STREAMS 16 BITS CHANNEL 4 DATA BUS + – P PAD + – P PAD + – P PAD + – P PAD N PAD N PAD 16 BITS CHANNEL 5 DATA BUS 16 BITS CHANNEL 6 DATA BUS DIFFERENTIAL RECEIVER 16 BITS CHANNEL 7 DATA BUS 16 BITS CHANNEL 8 DATA BUS rx_inclock rx_enable 8 BITS FRAME A BUS rx_syncclock DCOA EXTERNAL PLL MUX FPGA FABRIC 8 BITS FRAME B BUS DCOB N PAD N PAD AN147 F07 Figure 7. FPGA Design with External PLL Enabled an147f AN147-6 Application Note 147 16 SERIAL DATA STREAMS FROM 8 CHANNELS 128 BITS CHANNEL 1 DATA BUS + – P PAD + – P PAD + – P PAD + – P PAD + – P PAD + – P PAD + – P PAD + – P PAD + – P PAD + – P PAD + – P PAD + – P PAD + – P PAD + – P PAD + – P PAD + – P PAD N PAD 16 BITS FRAME BUS 2 FRAME STREAMS DIFFERENTIAL RECEIVER DCOA MUX EXTERNAL PLL DCOB 16 SERIAL DATA STREAMS FROM 8 CHANNELS 128 BITS CHANNEL 1 DATA BUS N PAD LTM9011 N PAD N PAD N PAD 16 BITS FRAME BUS 2 FRAME STREAMS DIFFERENTIAL RECEIVER DCOA MUX EXTERNAL PLL 16 SERIAL DATA STREAMS FROM 8 CHANNELS 128 BITS CHANNEL 1 DATA BUS LTM9011 N PAD N PAD N PAD 16 BITS FRAME BUS 2 FRAME STREAMS DIFFERENTIAL RECEIVER DCOA MUX EXTERNAL PLL DCOB 16 SERIAL DATA STREAMS FROM 8 CHANNELS 128 BITS CHANNEL 1 DATA BUS N PAD LTM9011 N PAD N PAD N PAD 16 BITS FRAME BUS 2 FRAME STREAMS DIFFERENTIAL RECEIVER DCOA EXTERNAL PLL MUX FPGA FABRIC DCOB N PAD DCOB N PAD LTM9011 N PAD N PAD AN147 F08 Figure 8. Multi-LTM9011 Solution A an147f AN147-7 Application Note 147 connector J1, the left side true LVDS buffers and two left side PLLs. Likewise, LTM9011 C & D utilize HSMC connector J2, the right side true LVDS buffers and two right side PLLs. The fitter summary report is: Figure 9 shows an alternative multiple-LTM9011 application, this one designed to maximize resource usage. Generating a super receiver that collects all data and frame streams from four LTM9011s driven by one PLL, +-------------------------------------------------------------------------------+ ; Fitter Summary; +-----------------------------------+-------------------------------------------+ ; Fitter Status; Successful - Tue Sep 11 17:01:59 2012 ; ; Quartus II Version ; 11.0 Build 157 04/27/2011 SJ Full Version ; ; Revision Name; top_FPGA; ; Top-level Entity Name; top_FPGA; ; Family; Stratix IV; ; Device; EP4SGX230KF40C2; ; Timing Models; Final; ; 3 % ; ; Logic utilization ; Combinational ALUTs ; 4,153 / 182,400 ( 2 % ) ; ; Memory ALUTs ; 0 / 91,200 ( 0 % ) ; ; Dedicated logic registers ; 4,466 / 182,400 ( 2 % ) ; ; Total registers ; 4466 ; ; Total pins ; 190 / 888 ( 21 % ) ; ; Total virtual pins ; 0 ; ; Total block memory bits ; 8,388,864 / 14,625,792 ( 57 % ) ; ; DSP block 18-bit elements ; 0 / 1,288 ( 0 % ) ; ; Total GXB Receiver Channel PCS ; 0 / 24 ( 0 % ) ; ; Total GXB Receiver Channel PMA ; 0 / 36 ( 0 % ) ; ; Total GXB Transmitter Channel PCS ; 0 / 24 ( 0 % ) ; ; Total GXB Transmitter Channel PMA ; 0 / 36 ( 0 % ) ; ; Total PLLs ; 5 / 8 ( 63 % ) ; ; Total DLLs ; 0 / 4 ( 0 % ) ; +-----------------------------------+-------------------------------------------+ an147f AN147-8 Application Note 147 16 SERIAL DATA STREAMS FROM 8 CHANNELS 128 BITS CHANNEL 1 DATA BUS + – P PAD + – P PAD + – P PAD + – P PAD + – P PAD + – P PAD N PAD 16 BITS FRAME BUS 2 FRAME STREAMS DIFFERENTIAL RECEIVER DCOA MUX EXTERNAL PLL 128 BITS CHANNEL 1 DATA BUS 16 SERIAL DATA STREAMS FROM 8 CHANNELS 16 BITS FRAME BUS 2 FRAME STREAMS FPGA FABRIC 128 BITS CHANNEL 1 DATA BUS 16 SERIAL DATA STREAMS FROM 8 CHANNELS 16 BITS FRAME BUS 2 FRAME STREAMS 128 BITS CHANNEL 1 DATA BUS 16 SERIAL DATA STREAMS FROM 8 CHANNELS 16 BITS FRAME BUS 2 FRAME STREAMS DCOB N PAD LTM9011 N PAD N PAD N PAD N PAD + – P PAD + – P PAD + – P PAD + – P PAD LTM9011 LOW SKEW CLOCK BUFFER N PAD N PAD LTM9011 N PAD N PAD LTM9011 AN147 F09 Figure 9. Multi-LTM9011 Solution B an147f AN147-9 Application Note 147 instead of four, requires an ultralow skew clock buffer to distribute DCO to all LTM9011s to minimize clock skew. This solution may not work for EP4SGX230KF40C2 using the Stratix IV GX FPGA development board, because the resources of one side of the FPGA are not sufficient to support four LTM9011s and the SERDES circuitries of each side, which are only supported by the PLLs on the same side. Single LTM9011 Design Details Figure 10 shows a block diagram of the tested, single LTM9011 FPGA design. The parallel data from the deserializer are captured and fed into the FPGA internal block RAM (altmem_ram2). The deserialized FRAME bus is synchronized with the data bus, and functions as a reference pattern that is sent to bitslip_gen. This circuitry SYSCLK altpll_source2 sclk configuration decoder altcnfig controls the data realignment circuitry of the LVDS receiver (altlvds_rx1) and inserts appropriate bits of latency in the serial bit stream to align to the word boundary. The altmem_ram2 block is controlled by address and read/ write signals generated by altbram_ctrl and altbram_addr. One 16-bit data output interface (clldata) is implemented for the user to directly collect the data of one of eight channels from the block RAM. A dedicated clock (cllclk) and control signal (cllctrl) are generated for the user to capture and qualify the data (Figure 11). Those signals are assigned to J1 of the FPGA board. The Stratix IV GX FPGA development board provides many peripheral interfaces such as PCI and USB but it can be easier to build a configuration and data capturing interface to the host by using a special feature of the FPGA, the lcd_d_cn lcd_wen lcd_csn lcd_data lcdrw_ctrl lcdfl_ctrl altbram_addr bram_clk clldata clldata altmem_ram2 cllctrl cllclk altbram_ctrl altclkctrll test_long 128 BITS DATA BUS 16 SERIAL DATA STREAMS FROM 8 CHANNELS altlvds_rx1 + – P PAD + – P PAD + – P PAD + – P PAD N PAD test_longf 2 FRAME STREAMS 16 BITS FRAME BUS rx_locked gtp_rst bitslip-gen INTERNAL PLL rx_inclk altpll_source4 dco_u_gen rx_reset othclk pre_clk pll4_locked clldclk 1/8 MUX cllclk dco_d_gen N PAD N PAD N PAD AN147 F10 areset Figure 10. FPGA Design Block Diagram an147f AN147-10 Application Note 147 Figure 11. clldata Interface Timing Diagram In-System Memory Content Editor, without any software or hardware effort. The In-System Memory Content Editor allows access to dense and complex FPGA designs. After programming devices, we have read and write access to the memories and constants through the JTAG interface. So we can not only capture data from block RAM (altmem_ram2) but we can dynamically change the configuration and monitor the FPGA running status from a circuit, altcnfig, which is implemented in 32 bytes of RAM and some small control logic circuitry. The capture buffer size, channel selection for data directly output to I/O (clldata), start and stop capturing, reset, etc., can be set up and controlled by altcnfig. The LVDS receiver, PLL, capture buffer status and flags are also monitored by altcnfig. The clock, DCO, from LTM9011 is divided by eight by PLL altpll_source4 and fed into the internal PLL of the LVDS receiver. The altpll_source4 generates other clocks for the data capture system. Another clock domain is built by PLL altpll_source2, which references clock SYSCLK provided by the FPGA’s on-board 50MHz oscillator. Table 2. FPGA Clock Tree CLOCK SOURCE CLOCK NAME LOADING FREQUENCY RATE UP TO altpll_source4 rx_inclk altlvds_rx1 125MHz altpll_source2 cllclk output pin 125MHz othclk bitslip_gen, rx_reset 125MHz pre_clk test_longf, test_long, altclkctrl, altbram_ctrl 125MHz clldclk Altclkctrl, clldata 125MHz sclk lcdrw_ctrl, lcdfl_ ctrl, altcnfig 500KHz The PLL altpll_source4 timing relationship is illustrated in Figure 12. an147f AN147-11 Application Note 147 Figure 12. PLL altpll_source4 Timing Diagram The clock rx_inclk is delivered to the differential receiver to generate a complex internal clock tree for the SERDES circuitry—we don’t need to worry too much about that. The clock pre_clk goes through a clock buffer (altclkctrl1), which is controlled by circuit altbram_ctrl, to clock altmem_ram2, which is built by FPGA block RAM, and address generator altbram_addr. The clock othclk is created for other applications such as an LVDS receiver reset generator, bit-slip pulse generator, etc. The clock clldclk drives a 16-bit parallel data bus output and generates the signal cllctrl. The clock cllclk directly drives the output clock pin for user-capture of the 16-bit parallel data. Address Offset: 0x00 Table 3. DPA Status Register BIT 7 Bit Name CH7 Read/Write Initial Value 6 CH6 5 CH5 4 3 CH4 CH3 Read 0x00 2 CH2 1 CH1 0 CH0 CHx: Channelx (0–7) serial line is locked by DPA. 1: locked 0: unlocked n As mentioned above, we have a controller built by a small block BRAM accessible by the host from the JTAG interface using Altera tools. Here is the register definition: an147f AN147-12 Application Note 147 Address Offset: 0x01 Address Offset: 0x02 Table 4. Capture Configuration Register Table 6. Capture Control Register BIT 7 Bit Name 6 5 4 3 MEMSIZE 2 1 CHSEL 0 BIT RSV Bit Name 7 6 5 4 3 Write Read/Write Write Initial Value 0x70 Initial Value 0x00 n n RSV: Reserved 1 0 START Read/Write n 2 RSV RSV: Reserved n CHSEL: Select Channel for data directly output to HSMC connector J1. Valid numbers 0–7 START: Start data capture. 1: Start. Need to reset to 0 after writing 1 to complete trigger n MEMSIZE: Buffer size select for date capture space of each channel. Address Offset: 0x03 Table 7. Collection Control Register Table 5. Buffer Size Configuration BIT 7 6 5 4 3 MEMSIZE BUFFER SIZE Bit Name 0 8 Samples Read/Write Write 1 16 Samples Initial Value 0x00 2 32 Samples 3 64 Samples n 4 128 Samples n 5 256 Samples 6 512 Samples 7 1K Samples 8 2K Samples 9 4K Samples A 8K Samples B 16K Samples 2 1 0 RSV START RSV: Reserved START: Start data collection from J1. 1: Start. Need to reset to 0 after writing 1 to complete trigger Address Offset: 0x04 Table 8. Capture Status Register n n n BIT 7 6 5 4 Bit Name FRB FRA CAPDONE CLLDONE Read/Write Read Initial Value 0x00 BSP: Bit-slip generator indicates that the data realignment circuitry has aligned to the word boundary successfully. 1: successful 0: Fail PLL4LOCK: PLL altpll_source4 is locked. 1: locked 0: unlocked PLL2LOCK: PLL altpll_source2 is locked. 1: locked 0: unlocked n 3 2 1 0 RXLOCK PLL2LOCK PLL4LOCK BSP RXLOCK: The internal PLL of LVDS receiver is locked. 1: locked 0: unlocked n CLLDONE: Data collection is done. 1: done 0: not yet n CAPDONE: Data capture is done. 1: done 0: not yet n n FRA: Frame A serial line is locked by DPA. 1: locked 0: unlocked FRB: Frame B serial line is locked by DPA. 1: locked 0: unlocked an147f AN147-13 Application Note 147 Address Offset: 0x1D Table 9. Reset Control Register BIT 7 Bit Name 6 5 4 3 RSV Read/Write Write Initial Value 0x00 2 1 0 RST RSV: Reserved n RST: Reset whole circuit except the LCD driver and system controller altcnfig. 1: Reset. Need to release to 0 after writing 1 to complete trigger n After place and routing, here is a simulation at 125MSPS for all channels. The output is from the deserializer and shown as a skew waveform. test_longx is from channelx. The FPGA design implements a full function LCD driver for FPGA configuration and status display. It supports the Lumex LCD module SML-LX1206GC-TR attached to the Stratix IV GX FPGA development board. The LCD driver circuits lcdrw_ctrl, lcdfl_ctrl are clocked by a second clock input SYSCLK from the FPGA’s onboard 50MHz oscillator. Below are two rows of the LCD 32 characters display: Table 10. LCD Display CHARACTERS DISPLAY DESCRIPTION XXX RDY FPGA Ready RST FPGA Reset Y 0-7 Channel Selected ZZZZ (Samples Counter) See Table 5 Buffer Size Configuration Figure 13. Post Place and Routing Simulation at 125Msps Channel Skew Figure 14. LCD Display an147f AN147-14 Application Note 147 PCB Guidelines Components should be placed as close as possible to each other on the PCB, aligned according to the pinout of the components. Components should be positioned to minimize the number of turns, corners, and vias. A straight, short connection improves all possible parameters of a PCB layout: Signal integrity n Transmission line effects n Capacitance and inductance n Operating frequency n Transmission line effects matter when distances between components are lengthy. All transmission lines should be terminated properly to control reflections. The key guidelines for PCB designers are: Match the lengths of the differential traces, such as the 16 pairs of data stream OUT#A, OUT#B, 2 pairs of data clock DCOA, DCOB and 2 pairs of frame signal FRA, FRB ±5mils. n Make turns with differential traces, take care to balance the number of left and right turns. When making a turn with a differential trace, the inner trace becomes shorter than the outer trace of the pair. When using more turns in one direction, one trace of the differential pair is longer than the other (without direct correction possibilities). n Spread traces after routing over the available space of the PCB to minimize crosstalk. n Do not route traces into 90° or 180° turns. Such turns increase the effective width of the trace, contributing to parasitic capacitance. At very fast edge rates, these discontinuities can cause significant signal integrity problems. Instead, use round, circular turns. If this is not possible, use 45° corners. n Spend sufficient time when placing the different circuit components for the layout. n Keep trace lengths as short as possible. n n n Spend more time on PCB stack-up design to get more strip-line channels for differential traces. n Follow the signal return path guidelines. Use guard traces where needed. Remember the importance of ground planes. n an147f AN147-15 Application Note 147 Reference Design Table 11. Reference Design Matrix PARAMETER DESCRIPTION General Developer Name Gary Yu Target Devices Stratix IV GX FPGA EP4SGX230KF40 Source Code Provided Yes Source Code Format Verilog Design Uses Code or IP from Existing Reference Design, Application Note, Yes 3rd party, or Megawizard Software Simulation Functional Simulation Performed Yes Timing Simulation Performed Yes Testbench Provided for Functional and Timing Simulations Yes Testbench Format Verilog Simulator Software and Version NCVerilog (64bit) 08.20-s014 SPICE/IBIS Simulations No Implementation Synthesis Software Tools and Version QUARTUS II v11.0 Implementation Software Tools and Version QUARTUS II v11.0 Static Timing Analysis Performed Yes Hardware Verification Hardware Verified Yes Hardware Platform Used for Verification DC1884A demo board and Stratix IV GX FPGA Development Board An application on Microsoft Windows is presented to the user for: Configuring LTM9011 by SPI. n Configuring FPGA by JTAG. n Capturing the datain FPGA internal block RAM during run time by JTAG. n Creating data file which can be read by PScope™. n The directories are set up as shown in Figure 15. The whole design, simulation and implementation environment are presented on the Red Hat LINUX operating system. The directories are set up as shown in Figure 16. Figure 15. Application Directory Setup an147f AN147-16 Application Note 147 Quick Start Guide Connect the LTM9011 demo board DC1884A to the FMC connector of the flexible cable SAMTEC SCF-15614602-MA. Plug the HSMC connector on the other end to J2 of the Stratix IV GX FPGA development board. n Connect the DC590B USB-to-SPI controller card to the DC1884A board by a 14-pin ribbon cable. n Connect DC590B J3 and Stratix IV GX FPGA development board J7 to a host PC with USB cables. n Connect the clock generator and the analog sources to the DC1884A board (J2, J4-J11). Coaxial cables are recommended. n Set Jumper JP14 to serial configuration mode and ignore others. n Power sequence: n 1.Turn on the 5V power supply for the DC1884A board. 2.Turn on the Stratix IV GX FPGA development board (SW1) and DC590B power. 3.Turn on the clock generator and the clock divider. 4.Turn on the analog sources. Launch PScope in Windows on the PC. n Open a DOS window and from the application directory launch a2psc.exe, which performs the following routines: n 1.Configures LTM9011 through the DC590B USB to SPI controller card. 2.Configures the FPGA. 3.Captures the data in the FPGA’s internal block RAM during run time by JTAG. 4.PScope then reads the data file created by a2psc and displays the waveform. The following illustrates that the LTM9011 has been enabled and configured successfully: 1.The current value of the 5V power supply for DC1884A board is changed to 590mA. Figure 16. Design Directory Setup an147f Information furnished by Linear Technology Corporation is believed to be accurate and reliable. However, no responsibility is assumed for its use. Linear Technology Corporation makes no representation that the interconnection of its circuits as described herein will not infringe on existing patent rights. AN147-17 Application Note 147 The following illustrates that the FPGA has been configured successfully: 1.D26 on FPGA board is on. It illuminates when the MAX II CPLD EPM2210 system controller is actively configuring the FPGA. It is driven by the MAX II CPLD EPM2210 System controller wire-ORed with the Embedded Blaster CPLD. 2.D5 on the FPGA board is on. It illuminates when the FPGA is successfully configured. It is driven by the MAX II CPLD EPM2210 System Controller. Conclusion The 1.6Gbps SERDES features of the Altera Stratix IV GX FPGA are an ideal match for the LTM9011 and other serial LVDS output analog to digital converters. The architecture of the ALTLVDS megafunction allows the implementation of ultra-high speed LVDS receivers under very simple timing constraints. The LVDS receivers can properly capture high speed serial data streams without input buffer skew adjustment since the DPA circuitry tracks any dynamic phase variations between the clock and data. 3.The LCD panel displays as in Figure 14. “XXX” should be RDY. Change the sample clock frequency generated by the clock generator if it is necessary. n Configure the capture buffer size using a2psc.exe if desired. n an147f AN147-18 Linear Technology Corporation LT 0914 • PRINTED IN USA 1630 McCarthy Blvd., Milpitas, CA 95035-7417 (408) 432-1900 ● FAX: (408) 434-0507 ● www.linear.com LINEAR TECHNOLOGY CORPORATION 2014