4K Format Conversion Reference Design

Similar documents
Video and Image Processing Design Example

White Paper Streaming Multichannel Uncompressed Video in the Broadcast Environment

Using Altera MAX Series as Microcontroller I/O Expanders

Applying the Benefits of Network on a Chip Architecture to FPGA System Design

Video and Image Processing Suite

High-Definition Video Reference Design (UDX4)

PROFINET IRT: Getting Started with The Siemens CPU 315 PLC

Using the Altera Serial Flash Loader Megafunction with the Quartus II Software

Video and Image Processing Suite User Guide

USB-Blaster Download Cable User Guide

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

December 2002, ver. 1.0 Application Note 285. This document describes the Excalibur web server demonstration design and includes the following topics:

Nios II Software Developer s Handbook

Altera SoC Embedded Design Suite User Guide

Nios II System Architect Design Tutorial

White Paper Utilizing Leveling Techniques in DDR3 SDRAM Memory Interfaces

Qsys System Design Tutorial

Using the On-Chip Signal Quality Monitoring Circuitry (EyeQ) Feature in Stratix IV Transceivers

13. Publishing Component Information to Embedded Software

1. Overview of Nios II Embedded Development

Quartus II Software Download and Installation Quick Start Guide

Altera Error Message Register Unloader IP Core User Guide

15. Introduction to ALTMEMPHY IP

1. Overview of Nios II Embedded Development

MAX 10 Analog to Digital Converter User Guide

FPGAs for High-Performance DSP Applications

Using the Agilent 3070 Tester for In-System Programming in Altera CPLDs

Nios II Development Kit Version 5.1 SP1 Release Notes

Networking Remote-Controlled Moving Image Monitoring System

Quartus II Software and Device Support Release Notes Version 15.0

Quartus II Software Design Series : Foundation. Digitale Signalverarbeitung mit FPGA. Digitale Signalverarbeitung mit FPGA (DSF) Quartus II 1

Fujisoft solves graphics acceleration for the Android platform

Avalon Interface Specifications

ModelSim-Altera Software Simulation User Guide

Nios II-Based Intellectual Property Camera Design

White Paper Increase Flexibility in Layer 2 Switches by Integrating Ethernet ASSP Functions Into FPGAs

Creating a Webserver on the Nios development kit Stratix Edition board Enoch Hwang

Building an IP Surveillance Camera System with a Low-Cost FPGA

AN 588: 10-Gbps Ethernet Hardware Demonstration Reference Designs

Using Nios II Floating-Point Custom Instructions Tutorial

Qsys and IP Core Integration

Configuration via Protocol (CvP) Implementation in Altera FPGAs User Guide

Lesson 10: Video-Out Interface

Video Conference System

White Paper Video Surveillance Implementation Using FPGAs

White Paper Video and Image Processing Design Using FPGAs

USB-Blaster II Download Cable User Guide

Building an Embedded Processor System on a Xilinx Zync FPGA (Profiling): A Tutorial

Gauge Drawing Tool Slider Drawing Tool Toggle Button Drawing Tool One-Way List Drawing Tool... 8

A Safety Methodology for ADAS Designs in FPGAs

Using the NicheStack TCP/IP Stack - Nios II Edition Tutorial

Nios II Classic Software Developer s Handbook

Guidelines for Developing a Nios II HAL Device Driver

Epiphan Frame Grabber User Guide

DE4 NetFPGA Packet Generator Design User Guide

Note monitors controlled by analog signals CRT monitors are controlled by analog voltage. i. e. the level of analog signal delivered through the

Nios II IDE Help System

Embedded Electric Power Network Monitoring System

Engineering Change Order (ECO) Support in Programmable Logic Design

Ping Pong Game with Touch-screen. March 2012

Zynq-7000 Platform Software Development Using the ARM DS-5 Toolchain Authors: Simon George and Prushothaman Palanichamy

Ocularis Media Server Installation & Administration Guide

Enhancing High-Speed Telecommunications Networks with FEC

Quartus II Handbook Volume 3: Verification

White Paper FPGA Performance Benchmarking Methodology

ChipScope Pro Tutorial

NetFlow Collection and Processing Cartridge Pack User Guide Release 6.0

AN FPGA FRAMEWORK SUPPORTING SOFTWARE PROGRAMMABLE RECONFIGURATION AND RAPID DEVELOPMENT OF SDR APPLICATIONS

Von der Hardware zur Software in FPGAs mit Embedded Prozessoren. Alexander Hahn Senior Field Application Engineer Lattice Semiconductor

About This Guide Signature Manager Outlook Edition Overview... 5

MONITORING PERFORMANCE IN WINDOWS 7

8. Hardware Acceleration and Coprocessing

9. Configuration, Design Security, and Remote System Upgrades in the Cyclone III Device Family

ADVANTAGES OF AV OVER IP. EMCORE Corporation

MAX II ISP Update with I/O Control & Register Data Retention

Implementation of Web-Server Using Altera DE2-70 FPGA Development Kit

Download the Design Files

MAX 10 Clocking and PLL User Guide

DRV8312-C2-KIT How to Run Guide

CONTENTS. Section 1 Document Descriptions Purpose of this Document Nomenclature of this Document... 3

A Scalable Large Format Display Based on Zero Client Processor

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

PCB Project (*.PrjPcb)

White Paper Understanding Metastability in FPGAs

ProSafe Plus Switch Utility

Document ID: FLXN111 PRODUCTS AND LICENSING

MPC8245/MPC8241 Memory Clock Design Guidelines: Part 1

SAN Conceptual and Design Basics

OTU2 I.7 FEC IP Core (IP-OTU2EFECI7Z) Data Sheet

Understanding the Performance of an X User Environment

CSE467: Project Phase 1 - Building the Framebuffer, Z-buffer, and Display Interfaces

OPERATION MANUAL. MV-410RGB Layout Editor. Version 2.1- higher

Introduction to the Altera Qsys System Integration Tool. 1 Introduction. For Quartus II 12.0

Getting Started on the PC and MAC

Cisco TelePresence VCR MSE 8220

Media Server Installation & Administration Guide

Remote Configuration Over Ethernet with the Nios II Processor

SPI Flash Programming and Hardware Interfacing Using ispvm System

Using Pre-Emphasis and Equalization with Stratix GX

ebus Player Quick Start Guide

Transcription:

4K Format Conversion Reference Design AN-646 Application Note This application note describes a 4K format conversion reference design. 4K resolution is the next major enhancement in video because of the benefits in picture clarity and realism. Many leading projector, broadcast, and camera manufacturers are shipping 4K enabled systems. Altera enables this next generation format conversion by reducing the system device count, which lowers the overall costs, reduces the cost of development, and simplifies board design. Previous systems required as many as nine off-the-shelf devices to perform 4K format conversion four 1080p format conversion devices and five devices for serial digital interface (SDI) input and output. The 4K format conversion reference design uses less than 50% of a single Altera Stratix IV EP4SGX230 FPGA. With migration paths to any Altera FPGA device families, you can integrate these functions with ample headroom remaining to incorporate other video functionality and interfaces such as DisplayPort and video compression (encoding or decoding). 4K resolution refers to any resolutions that have approximately 4,000 horizontal pixels on a display screen. In digital cinema, a typical resolution is 4,096 by 2,160 pixels, and in computer graphics, quad full high definition (QFHD) is 3, 840 by 2,160 pixels. Typically, the of 4K video requires more than four times the capability of 1080p60 video. Features The reference design offers the following features: Support for the following inputs: PAL 720p60 1080i50 1080i60 1080p60 One QFHD output transmitted over four 3G-SDI 1080p60 outputs. Four video pipelines running at 148.5 MHz and each including: A prescaler clipper to select a portion of the input video lines to be upscaled A scaler with eight horizontal and eight vertical taps performing a four times upscale Double buffering of the video to external DDR3 SDRAM System initialization and run-time configuration in software. 101 Innovation Drive San Jose, CA 95134 www.altera.com 2012 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS, QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark Office and in other countries. All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www.altera.com/common/legal.html. Altera warrants performance of its semiconductor products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use of any information, product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services. ISO 9001:2008 Registered August 2012 Altera Corporation Feedback Subscribe

Page 2 General Description Rapid system capture and design with Qsys, the Quartus II software, and the Nios II development environments. Highly parameterizable and modular hardware functions: and Image Processing Suite MegaCore functions Nios II processor Clear text system-configuration software DDR3 SDRAM controllers Peripherals Autogeneration of switch fabric Standard Avalon Streaming (Avalon-ST) and Avalon Memory-Mapped (Avalon-MM) interfaces for rapid integration and the Avalon-ST protocol for video transmission between functions. Runs on the Altera Stratix IV GX FPGA Development Kit with two Terasic Transceiver SDI High-Speed Mezzanine Card (HSMC) boards. f f f For more information on the video and image and the Avalon-ST Message protocol, refer to the and Image Processing Component Library Functional Description (available from Altera). For more information about the Avalon-ST protocol, refer to the and Image Processing Suite User Guide. For more information about the Avalon-ST and the Avalon-MM interfaces, refer to the Avalon Interface Specification. General Description The 4K format conversion reference design takes a PAL, 720p, 1080i, or 1080p input over a 3G-SDI interface and upscales it to QFHD resolution output over four 3G-SDI interfaces. The Altera SDI IP core supports the 3G-SDI interfaces in the FPGA. A video server provides the SDI input; the four SDI outputs display on four separate monitors, or a quartered 4K capable monitor. The reference design was demonstrated on a single Stratix IV EP4SGX230 FPGA at International Broadcast Convention (IBC) 2010. The reference design uses IP cores from the and Image Processing Suite and components from the video and image, which is a collection of components that you use to build video and image IP cores or reference designs. The allows you to create more complex systems than the and Image Processing Suite offers. You cannot use components alone you must also use a scheduler, for example, a CPU or state machine. f For more information about the and Image Processing Suite, refer to the and Image Processing Suite User Guide. 4K Format Conversion Reference Design August 2012 Altera Corporation

Performance and Resource Utilization Page 3 Performance and Resource Utilization Table 1. Resource Usage Usage ALUTs Table 1 lists the resource utilization on a Stratix IV GX device (S4GX230). Logic Registers Logic Utilization Memory Bits Total Blocks Memory Implementation Bits M9K M144K DSP Block 18-Bit Elements On device 51,810 60,616 77,148 4,824,456 8,985,600 623 22 190 Total available 182,400 182,400 182,400 14,625,792 14,625,792 1,235 22 1,288 on device Percentage used on device 28% 33% 42% 33% 61% 50% 100% 15% August 2012 Altera Corporation 4K Format Conversion Reference Design

Page 4 Functional Description Functional Description Figure 1. Block Diagram Figure 1 on page 4 shows a block diagram of the reference design. Scaler Kernel Creator SDI Input Deinterlacer II Input Bridge Clocked Input Packet Switch Line Buffer Scalar Line Buffer Scalar Duplicator Line Buffer Scalar Line Buffer Scalar Input Component Pipeline Component Control Component Output Component Memory Component Avalon-ST Avalon-MM Interface Avalon-ST Message (Data) Avalon-ST Message (Command) Avalon-ST Message (Response) Packet Writer Packet Writer Packet Writer Packet Writer Message Interface Unit Control Slave Pipeline 1 Output 1 Pipeline 2 Output 2 Pipeline 3 Output 3 Pipeline 4 Output 4 DDR3 SDRAM Frame Reader Frame Reader Frame Reader Frame Reader Gamma Corrector Gamma Corrector Gamma Corrector Gamma Corrector Clocked Output Clocked Output Clocked Output Clocked Output Nios II Scheduler Nios II Controller SDI Outputs 4K Format Conversion Reference Design August 2012 Altera Corporation

Functional Description Page 5 Table 2. Input Blocks Table 2 describes the video input blocks. The video input takes a single SDI input, checks that it is in a supported format, and then duplicates it to the four video pipelines. Block Source Description Clocked video input IP core input bridge Duplicator and image suite and image and image Table 3. Pipeline Blocks The clocked video input converts the output of the SDI IP core into Avalon-ST protocol. The video input bridge alerts the scheduler to a new packet arriving on its Avalon-ST input and then sends it to the destination that the scheduler commands. The duplicator duplicates each received input packet to all of its four outputs. Table 3 describes the video pipeline blocks. The video pipeline takes a portion of the video input and upscales it before writing the result into external memory. Block Source Description algorithmic IP core Line buffer Scaler algorithmic IP core Packet writer and image and image and image and image Table 4. Control Blocks (Part 1 of 2) The clipper algorithmic IP core clips away most of the input line allowing only approximately a quarter of it to propagate to its output. The quarter that is propagated is different for each video pipeline. The line buffer uses on-chip memory to store multiple lines and then outputs them in parallel as one packet. This reference design configures each line buffer to support four vertical taps. The scaler algorithmic IP core upscales the input line by a factor of two. The packet writer writes the lines of output video frame (packets) into external memory. Table 4 describes the video control blocks. The Nios II scheduler controls the IP cores. It allows you to use the register maps to configure, start, and stop the IP cores and also the components. The components require much lower-level control as they only perform tasks, such as input packets, when they receive a command from the scheduler. Block Source Description Scaler kernel creator Packet switch and image and image The scaler kernel creator is a hardware accelerator block that returns the input lines required to produce an output line. The scheduler uses this fact to determine which input lines need to be stored in the line buffer. The packet switch routes messages to the end point specified in the destination address. This process allows the Nios II processor to send messages to any component in the reference design by altering the destination address. August 2012 Altera Corporation 4K Format Conversion Reference Design

Page 6 Functional Description Table 4. Control Blocks (Part 2 of 2) Block Source Description Nios II message interface unit Control slave Nios II scheduler Nios II controller and image and image Qsys Qsys Table 5. Control Blocks Components use the Avalon-ST Message format to send and receive messages. The message interface unit is a memory-mapped peripheral that the Nios II processor uses to send and receive messages. The control slave provides a register map interface between the Nios II controller and the Nios II scheduler. It updates scaling parameters and synchronizes the switching of the read and write sides of the DDR3 double buffer. The design uses a Nios II processor to schedule the scaling subsystem in the following ways: Sends command messages to the components Receives response messages from the components The design uses another Nios II processor to control the system in the following ways: Reacts to interrupts from the clocked video input triggered by changes in the input video format Configures the IP cores through their register maps Table 5 describes the video output blocks. The video output reads the upscaled output video from external memory and feeds it to four SDI outputs. Block Source Description Frame reader Gamma corrector Clocked video output and image suite and image suite and image suite The frame reader reads frames from external memory and converts them into Avalon-ST packets. The gamma corrector corrects any out of range values that occur as a result of scaling. This block brings the color values back into the acceptable SDI range of 64 Y 940 and 64 Cb/Cr 960. In this reference design the clocked video outputs convert Avalon-ST to a format the SDI IP core can take in. The DDR3 SDRAM Controller with ALTMEMPHY and the multiport front end perform the following actions: Perform the buffering of video to and from external DDR3 SDRAM. Handle the arbitration of multiple packet writers and frame reader masters on the single slave interface of the DDR3 SDRAM Controller with ALTMEMPHY. Pipelines The reference design consists of four video pipelines that can each process 1080p60 video. The design splits the 4K upscale across the four video pipelines. Extra video pipelines can be added to process higher resolutions the only limit is the size of the FPGA used and the DDR3 SDRAM bandwidth that is available. Conversely, the number of video pipelines required is reduced as the achievable f MAX increases. For example, doubling the f MAX results in a halving the number of video pipelines required. 4K Format Conversion Reference Design August 2012 Altera Corporation

Functional Description Page 7 You can parameterize each video pipeline, which consists of a chain of functions. Avalon-ST interfaces allow you to connect any number of functions with Qsys. Figure 2 shows a video pipeline, which has the following features: A clipper algorithmic IP core selects the part of the input line that this video pipeline processes A line buffer to buffer multiple input lines and provide the scaler algorithmic IP core with the correct pixel kernels to produce the required output lines A scaler algorithmic IP core performs the upscale and produces the output lines A packet writer writes the output lines into DDR3 SDRAM Figure 2. Pipeline Block Diagram From Input 1 Line Buffer Scalar Packet Writer To DDR3 SDRAM August 2012 Altera Corporation 4K Format Conversion Reference Design

Page 8 Functional Description Vertical bands split the incoming video across the four pipelines. Each video pipeline processes a different vertical band of the incoming video frame. Figure 3 shows that each pipeline selects a different quarter of the line (with a small overlap) and upscales only that portion of the video. Figure 3. A Frame Split Over The Processing Pipelines Pipeline 1 Pipeline 2 Pipeline 3 Pipeline 4 Line N...... Line 3 Line 2 Line 1 Upscale Upscale Upscale Upscale Line N...... Line 3 Line 2 Line 1 4K Format Conversion Reference Design August 2012 Altera Corporation

Functional Description Page 9 To simultaneously produce the required four SDI outputs, the design must write the 4K frame into a double buffer. Figure 4 shows buffering of the 4K frame. The design writes the 4K frame as vertical bands, then swaps the double buffer, reads out the frame as four quadrants, and sends each to a separate SDI output. Figure 4. Buffering of 4K Frame in DDR3 SDRAM Pipeline 4 Pipeline 3 Pipeline 2 Pipeline 1 DDR3 SDRAM Double Buffer Output 1 Output 2 Output 3 Output 4 August 2012 Altera Corporation 4K Format Conversion Reference Design

Page 10 Functional Description The design then recombines the upscaled output lines, removing any overlap, to produce the 4K frame (Figure 5). Figure 5. 4K Frame Output 1 Output 2 Output 3 Output 4 Monitor Control Interfaces The reference design introduces the video and image, which allows greater flexibility and control in video designs. The is a collection of common video function building blocks that build the video and image suite with IP cores. When you use the component library as part of a MegaCore function, the software hides the control and parameterization of the components. In the reference design, a selection of components (the clipper algorithmic IP core, line buffer, scaler algorithmic IP core, and the packet writer) create a flexible video pipeline. Each component has a command interface through which it receives messages from a scheduler instructing it to perform a specific function. Some example functions for a line buffer include: receive a new line, shift the lines it contains, or send a kernel of pixels to another component. You can implement the scheduler as an HDL state machine that controls a handful of components, or a CPU that runs software to control large systems of components. The reference design scheduler is a Nios II processor. For each line the video input bridge receives, it sends a response message to the scheduler. The scheduler then sends out a message to the video input bridge, which instructs it to send the line to a particular destination. In this case, the design sends the line a duplicator, which sends copies of the line to multiple destinations. The scheduler also sends messages to each of the components in the video pipelines. The messages instruct the components which functions to perform on the line. A software scheduler provides increased flexibility in both system debugging and modifying run-time functionality, to give a more productive design cycle and greatly reduced time-to-market. 4K Format Conversion Reference Design August 2012 Altera Corporation

Getting Started Page 11 Software Schedule The main_core.cpp file contains the software schedule, comments, and a detailed description of the schedule that the Nios II scheduler uses. A number of C macros, in the alt_vip_beta_nios_ii_miu_api.h and alt_vip_beta_nios_ii_miu_regs.h files file use the message interface unit to allow the Nios II processor to send and receive messages. The macros translate to simple memory-mapped reads or writes and describe the API to allow you to use the Nios II message interface unit. f For more details on the Nios II message interface unit, refer to the and Image Processing Component Library Functional Description (available from Altera). Each component in the reference design also has a set of commands that it accepts and a set of responses that it returns. The alt_vip_common_pkg.h file lists the commands. The main_top.cpp file contains the top-level control software that monitors and configures the input and output video interfaces. The Nios II controller switches the read side of the video double buffer. The top-level control software contains detailed comments that describe its operation. Clocks Table 6 lists the clocks and frequencies. Table 6. Clocks and Frequencies Clock Domain f MAX (MHz) Description sdi_rx_clk[0] 148.5 The SDI input clock. sdi_clk148 148.5 The SDI output clock for the four outputs. vip_clk 148.5 The video pipelines clock. altmemddr_0_sysclk 200.0 The local interface of the memory controller clock. DDR3 clock 400.0 The DDR3 SDRAM is clocked at 400 MHz Getting Started This section describes the following topics: Hardware and Software Requirements Downloading and Installing the Reference Design Generating the Qsys System Compiling the Software Compiling the Design Programming a Device Hardware and Software Requirements The reference design requires the following hardware: Stratix IV GX FPGA development board August 2012 Altera Corporation 4K Format Conversion Reference Design

Page 12 Getting Started Two Terasic Transceiver SDI High-Speed Mezzanine Card (HSMC) boards A 1080p60 SDI video source Four 1080p60 SDI monitors or DVI monitors with SDI-to-DVI converters The reference design requires the following software: Quartus II software v10.1 Nios II EDS v10.1 Downloading and Installing the Reference Design To download and install the reference design, follow these steps: 1. Request the reference design (.zip) files from the 4K Format Conversion Reference Design web page. 2. Extract the contents of the archive file to a directory on your computer. Do not use spaces in the directory path name. Figure 6 shows the reference design directory structure. Figure 6. Directory Structure fourk-<version> Contains the 4K format conversion reference design files. es Contains the precompiled.sof for engineering sample devices. s4gx_pcie Contains the Quartus II project. clock_gen Contains the PLLs for SDI clock generation. ip Contains beta versions of IP MegaCore functions. sdi_dprio_siv Contains the SDI transceiver reconfiguration controller. sdi_dual Contains the SDI MegaCore function configurations. software Contains the Nios II application project and Nios II C++ source code. top Contains the top-level design file (s4gx_pcie.v) and interface configuration file (config.v). FourK.qsys Qsys system files. FourK_core.qsys Qsys system file. make_project.bat Run this script on Windows to create the project. make_project.sh Run this script on Linux to create the project. s4gx_pcie.sdc The timing constraints file. s4gx_pcie.tcl Tcl file that make_project script uses to create the Quartus II project. s4gx_pcie.sof The precompiled.sof for production devices. 4K Format Conversion Reference Design August 2012 Altera Corporation

Getting Started Page 13 Generating the Qsys System To generate the Qsys system, follow these steps: 1. Create the Quartus II project file s4gx_pcie.qpf: On Windows operating systems, run the make_project.bat script from the Nios II EDS Command Shell by typing./make_project.bat. On Linux operating systems, run the make_project.sh script. 2. Open the Quartus II software and open the project file s4gx_pcie.qpf. 3. On the Tools menu click Qsys. 4. Open the FourK.qsys system. 1 The reference design includes two Qsys systems. The FourK_core.qsys system contains the four video scaling pipelines and the components required to schedule them. The FourK.qsys system includes one instance of the FourK_core.qsys system. 5. In Qsys, click the Generation tab. 6. Click Generate. 7. When the System generation was successful message displays, start the Nios II Software Build Tools for Eclipse: on the Windows Start menu, point to Altera, click Nios II EDS <version> and click Nios II Software Build Tools for Eclipse. Compiling the Software This section describes how to create the FourK_top_cpu_memory.hex and FourK_FourK_core_inst_control_memory.hex files in the Nios II Software Build Tools for Eclipse. To create the FourK_top_cpu_memory.hex file, follow these steps: 1. In the Workspace Launcher window click Browse... and create a new workspace directory, workspace, in the project s4gx_pcie directory. Then click OK to open the workspace. 2. In the Nios II Eclipse window, right-click in the Project Explorer tab, point to New and click Nios II Application and BSP from Template. 3. In the Nios II Application and BSP from Template window fill in the following information: For SOPC Information File Name, browse to locate the FourK.sopcinfo file. For CPU name, select top_cpu. For Project name, enter s4gx_pcie_controller. For Templates, select Blank Project. 4. Click Finish. 5. On the Project Explorer tab, right-click on s4gx_pcie_controller_bsp, point to Nios II, and click BSP Editor. 6. On the Main tab for stdout select lcd. Turn on enable_interrupt_stack and for interrupt_stack_memory_region_name select top_cpu_memory. August 2012 Altera Corporation 4K Format Conversion Reference Design

Page 14 Getting Started 7. On the Linker Script tab for.bss,.heap,.rodata,.rwdata,.stack and.text set the Linker Region Name to top_cpu_memory. For reset set the Memory Device Name to top_cpu_memory. 8. Click Generate. 9. In the Nios II Eclipse window, expand s4gx_pcie_controller to open the list of files. Right-click on main_top.cpp and video_standard.cpp and click Add to Nios II Build. Collapse the list of files. 10. In the Project Explorer tab, right-click on s4gx_pcie_controller and click Properties. 11. In the Properties for s4gx_pcie_controller window, select Nios II Application Properties and change the Optimization level: to Level 3. Click OK. 12. In the Project Explorer tab, right-click on the s4gx_pcie_controller_bsp, and select Properties. 13. In the Properties for s4gx_pcie_controller_bsp window, select Nios II BSP Properties and change the Optimization level: to Level 3. Click OK. 14. On the Project Explorer tab, right-click on the s4gx_pcie_controller, and click Build Project. 15. On the Project Explorer tab, right-click on the s4gx_pcie_controller, point to Make Targets and click Build... 16. In the Make Targets window, select mem_init_generate and then click Build. 17. The software creates the FourK_top_cpu_memory.hex file. To create the FourK_FourK_core_inst_control_memory.hex file, follow these steps: 1. In the Nios II Eclipse window, right-click in the Project Explorer tab, point to New and click Nios II Application and BSP from Template. 2. In the Nios II Application and BSP from Template window fill in the following information: For SOPC Information File Name, browse to locate the FourK.sopcinfo file. For CPU name, select FourK_core_inst_control_cpu. For Project name, enter core_controller. For Templates, select Blank Project. 3. Click Finish. 4. In the Nios II - Eclipse window, expand core_controller, to open the list of files. Right-click on main_core.cpp and click Add to Nios II Build. 5. On the Project Explorer tab, right-click on core_controller and click Properties. 6. In the Properties window, select Nios II Application Properties and change Optimization level: to Level 3. Click OK. 7. On the Project Explorer tab, right-click on core_controller_bsp, and click Properties. 8. In the Properties window, select Nios II BSP Properties and change Optimization level: to Level 3. Click OK. 4K Format Conversion Reference Design August 2012 Altera Corporation

Getting Started Page 15 9. On the Project Explorer tab, right-click on core_controller, and click Build Project. 10. On the Project Explorer tab, right-click on core_controller, point to Make Targets and click Build... 11. In the Make Targets window, select mem_init_generate and click Build. 12. The software creates the FourK_FourK_core_inst_control_memory.hex file. Compiling the Design To compile the design in the Quartus II software and create the s4gx_pcie.sof file, follow these steps: 1. On the Tools menu, click Start Compilation. 2. When compilation completes, the design creates the s4gx_pcie.sof file. Programming a Device To program the FPGA and set up the reference design, follow these steps: August 2012 Altera Corporation 4K Format Conversion Reference Design

Page 16 Getting Started 1. Connect the two SDI HSMC boards as Figure 7 shows. Figure 7. Reference Design Setup To Top Right SDI Montior To Bottom Right SDI Montior To Top Left SDI Montior To Bottom Left SDI Monitor From SDI Source 2. Connect the four SDI monitor cables to the SDI_OUT1 and SDI_OUT2 outputs. 3. Turn on the Stratix IV GX FPGA development board. 4. In the Quartus II software, on the Tools menu, click Programmer, to program the FPGA with the s4gx_pcie.sof file. 5. Check that LED0 flashes. 6. Connect your SDI source cable to the SDI_IN1 input. When you connect an input, the LCD displays the detected format. 7. Press push button 0 (PB0) to enable or disable the edge adaptive scaling mode within the scaler algorithmic IP cores. 8. Press push button 1 (PB1) to increase the edge threshold that the edge adaptive scaling algorithm uses. 9. Press push button 2 (PB2) to decrease the edge threshold. 4K Format Conversion Reference Design August 2012 Altera Corporation

Document Revision History Page 17 Table 7 describes the Stratix IV GX FPGA Development Board LEDs. Table 7. LEDs LED Description 0 Software heartbeat. Flashes when the software is running on the Nios II processor. 1 Illuminates when the output runs. 2 Illuminates when the SDI_IN1 input detects a supported input format. 3 Illuminates when Illuminates when the input receives overflow. 4 Illuminates when the output transmits underflow. 5 60 frames per second heartbeat. Flashes every 60 frames of the input video. 6 Illuminates when the output is generator locked to the input. 7 Illuminates when you enables edge adaptive scaling. Document Revision History Table 8 shows the revision history for this document. Table 8. Document Revision History Date Version Changes August 2012 2.0 Updated for Qsys and the Quartus II software v12.0. May 2011 1.0 Initial release. August 2012 Altera Corporation 4K Format Conversion Reference Design

Page 18 Document Revision History 4K Format Conversion Reference Design August 2012 Altera Corporation