UG0651 User Guide. Scaler. February2018

Similar documents
UG0682 User Guide. Pattern Generator. February 2018

Clarke and Inverse ClarkeTransformations Hardware Implementation. User Guide

Total Ionizing Dose Test Report. No. 14T-RTSX32SU-CQ256-D1RH41

2D Scaler IP Core User s Guide

VIDEO 2D SCALER. User Guide. 10/2014 Capital Microelectronics, Inc. China

Video and Image Processing Suite

DG0755 Demo Guide PolarFire FPGA JESD204B Standalone Interface

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Introductory Digital Systems Laboratory

Self Restoring Logic (SRL) Cell Targets Space Application Designs

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Introductory Digital Systems Laboratory

Block Diagram. pixin. pixin_field. pixin_vsync. pixin_hsync. pixin_val. pixin_rdy. pixels_per_line. lines_per_field. pixels_per_line [11:0]

VID_OVERLAY. Digital Video Overlay Module Rev Key Design Features. Block Diagram. Applications. Pin-out Description

Table of content. Table of content Introduction Concepts Hardware setup...4

2. Logic Elements and Logic Array Blocks in the Cyclone III Device Family

RTG4 Radiation Update J.J. Wang, Chief Engineer Nadia Rezzak, Staff Engineer Stephen Varela, Engineer

White Paper. Timing for cran Fronthaul LTE

Application Note. RTC Binary Counter An Introduction AN-CM-253

Branding Guidelines NOTICE:

Single Channel LVDS Tx

RAPID SOC PROOF-OF-CONCEPT FOR ZERO COST JEFF MILLER, PRODUCT MARKETING AND STRATEGY, MENTOR GRAPHICS PHIL BURR, SENIOR PRODUCT MANAGER, ARM

Application Note. Traffic Signal Controller AN-CM-231

Laboratory Exercise 7

CN12 Technical Reference Guide. CN12 NTSC/PAL Camera. Technical Reference Guide PCB Rev

AND9191/D. KAI-2093 Image Sensor and the SMPTE Standard APPLICATION NOTE.

Is Now Part of To learn more about ON Semiconductor, please visit our website at

IP-DDC4i. Four Independent Channels Digital Down Conversion Core for FPGA FEATURES. Description APPLICATIONS HARDWARE SUPPORT DELIVERABLES

FIFO Memories: Solution to Reduce FIFO Metastability

Objectives. Combinational logics Sequential logics Finite state machine Arithmetic circuits Datapath

Quick Guide Book of Sending and receiving card

Applications. NCO Clock Generator 1. Fine freq. adjustment. Synthesizer 0. Fine freq. adjustment. Synthesizer 1 Fs= Bs 1. *Ks 1. *16*Ms 1.

Memory Efficient VLSI Architecture for QCIF to VGA Resolution Conversion

SignalTap Analysis in the Quartus II Software Version 2.0

Modeling Latches and Flip-flops

Block Diagram. 16/24/32 etc. pixin pixin_sof pixin_val. Supports 300 MHz+ operation on basic FPGA devices 2 Memory Read/Write Arbiter SYSTEM SIGNALS

ExtIO Plugin User Guide

2.6 Reset Design Strategy

SHA-256 Module Specification

Frame Processing Time Deviations in Video Processors

CHAPTER 6 DESIGN OF HIGH SPEED COUNTER USING PIPELINING

Experiment # 12. Traffic Light Controller

Block Diagram. RGB or YCbCr. pixin_vsync. pixin_hsync. pixin_val. pixin_rdy. clk

Configuring and using the DCU2 on the MPC5606S MCU

Traffic Light Controller

ECT 224: Digital Computer Fundamentals Digital Circuit Simulation & Timing Analysis

SDI Audio IP Cores User Guide

Altera s Max+plus II Tutorial

Lab Assignment 2 Simulation and Image Processing

Using the Synchronized Pulse-Width Modulation etpu Function by:

MaxView Cinema Kit Quick Install Guide

LUT Optimization for Memory Based Computation using Modified OMS Technique

California State University, Bakersfield Computer & Electrical Engineering & Computer Science ECE 3220: Digital Design with VHDL Laboratory 7

Multi-Media Card (MMC) DLL Tuning

SDI Audio IP Cores User Guide

Block Diagram. dw*3 pixin (RGB) pixin_vsync pixin_hsync pixin_val pixin_rdy. clk_a. clk_b. h_s, h_bp, h_fp, h_disp, h_line

This document describes a program for 7-segment LED display (dynamic lighting).

Video and Image Processing Suite User Guide

SMPTE 292M EG-1 Color Bar Generation, RP 198 Pathological Generation, Grey Pattern Generation IP Core - AN4088

Logic Controls LV3000 VGA Connected Virtual Pole Display

ECE532 Digital System Design Title: Stereoscopic Depth Detection Using Two Cameras. Final Design Report

LogiCORE IP Spartan-6 FPGA Triple-Rate SDI v1.0

This document describes a program for 7-segment LED display (dynamic lighting) and key matrix and input.

Mask Set Errata for Mask 1M07J

FPGA Laboratory Assignment 4. Due Date: 06/11/2012

VGA Controller. Leif Andersen, Daniel Blakemore, Jon Parker University of Utah December 19, VGA Controller Components

Quadro Plex D2. Mosaic Mode for windows XP Reference Guide

Serial FIR Filter. A Brief Study in DSP. ECE448 Spring 2011 Tuesday Section 15 points 3/8/2011 GEORGE MASON UNIVERSITY.

Is Now Part of To learn more about ON Semiconductor, please visit our website at

Block Diagram. deint_mode. line_width. log2_line_width. field_polarity. mem_start_addr0. mem_start_addr1. mem_burst_size.

AND9185/D. Large Signal Output Optimization for Interline CCD Image Sensors APPLICATION NOTE

Debugging of Verilog Hardware Designs on Altera s DE-Series Boards. 1 Introduction. For Quartus Prime 15.1

Upgrading a FIR Compiler v3.1.x Design to v3.2.x

SMPTE 259M EG-1 Color Bar Generation, RP 178 Pathological Generation, Grey Pattern Generation IP Core AN4087

Engineering Bulletin. General Description. Provided Files. AN2297/D Rev. 0.1, 6/2002. Implementing an MGT5100 Ethernet Driver

AN 776: Intel Arria 10 UHD Video Reference Design

LAX_x Logic Analyzer

Enable input provides synchronized operation with other components

VHDL Design and Implementation of FPGA Based Logic Analyzer: Work in Progress

AL330B-DMB-A0 Digital LCD Display SOC Demo Board

HCS08 SG Family Background Debug Mode Entry

TV Character Generator

Altera's 28-nm FPGAs Optimized for Broadcast Video Applications

Using the XC9500/XL/XV JTAG Boundary Scan Interface

Memory Interfaces Data Capture Using Direct Clocking Technique Author: Maria George

Laboratory Exercise 7

TV Synchronism Generation with PIC Microcontroller

Design and Implementation of SOC VGA Controller Using Spartan-3E FPGA

LFSRs as Functional Blocks in Wireless Applications Author: Stephen Lim and Andy Miller

Application Note PG001: Using 36-Channel Logic Analyzer and 36-Channel Digital Pattern Generator for testing a 32-Bit ALU

Solutions to Embedded System Design Challenges Part II

ivw-ud322 / ivw-ud322f

Chapter 5 Synchronous Sequential Logic

Laboratory 1 - Introduction to Digital Electronics and Lab Equipment (Logic Analyzers, Digital Oscilloscope, and FPGA-based Labkit)

Ryerson University Department of Electrical and Computer Engineering EES508 Digital Systems

SN54192, SN54193, SN54LS192, SN54LS193, SN74192, SN74193, SN74LS192, SN74LS193 SYNCHRONOUS 4-BIT UP/DOWN COUNTERS (DUAL CLOCK WITH CLEAR)

HDMI to 3G-SDI Scaler Installation Guide

CSCB58 - Lab 4. Prelab /3 Part I (in-lab) /1 Part II (in-lab) /1 Part III (in-lab) /2 TOTAL /8

Memory Interfaces Data Capture Using Direct Clocking Technique Author: Maria George

Setup Guide. Dolby PRM Rev. 1.1

Bring out the Best in Pixels Video Pipe in Intel Processor Graphics

EECS150 - Digital Design Lecture 10 - Interfacing. Recap and Topics

Transcription:

UG0651 User Guide Scaler February2018

Contents 1 Revision History... 1 1.1 Revision 5.0... 1 1.2 Revision 4.0... 1 1.3 Revision 3.0... 1 1.4 Revision 2.0... 1 1.5 Revision 1.0... 1 2 Introduction... 2 3 Hardware Implementation... 4 3.1 Inputs and Outputs... 5 3.2 Configuration Parameters... 6 3.3 FSM Implementation... 6 3.4 Timing Diagrams... 7 3.5 Testbench... 8 3.6 Resource Utilization... 15 UG0651 User Guide Revision 5.0

1 Revision History The revision history describes the changes that were implemented in the document. The changes are listed by revision, starting with the most current publication. 1.1 Revision 5.0 In revision 5.0 of this document, the Resource Utilization section and the Resource Utilization Report were updated. For more information, see Resource Utilization (see page 15). 1.2 Revision 4.0 In revision 4.0 of this document, the Steps to simulate the core using testbench was added. For more information, see TestBench (see page 8). 1.3 Revision 3.0 The following is a summary of changes in revision 3.0 of this document. Updated the Configuration Parameters table. For more information, see Testbench Configuration Parameters (see page 8). Updated the timing diagram. For more information, see Timing Diagram (see page 7). Added the Information about image buffer 0 and image buffer 1. For more information, see Hardware Implementation (see page 4). Updated the Information about FSM states. For more information, see FSM Implementation (see page 6). 1.4 Revision 2.0 The following is a summary of changes in revision 2.0 of this document. Added the Testbench Configuration Parameters table. For more information, see Testbench Configuration Parameters (see page 8). Updated the tables such as, Scaler Input and Output Ports and Resource Utilization Report. For more information, see Inputs and Outputs (see page 5) and Resource Utilization Report (see page 15). Updated the figures such as, Scaler Block Diagram and Timing Diagram. For more information, see Scalar Block Diagram (see page 4) and Timing Diagram (see page 7). 1.5 Revision 1.0 Revision 1.0 is the first publication of this document. UG0651 User Guide Revision 5.0 1

2 Introduction Image scaling is a process of constructing a resized image from a given input image. The constructed image can be smaller, larger, or equal in size, depending on the scaling ratio. While scaling up an image, empty spaces are introduced in the base image. The following figure shows an image at its original dimensions (2x2) and at scaled-up dimensions (4x4). The white pixels represent empty spaces where interpolation is required, and the complete picture is the result of the nearest neighbor interpolation. Interpolation algorithms attempt to generate continuous data from a set of discrete data samples through an interpolation function. The interpolation algorithms minimize the visual defects arising from the inevitable resampling error and improve the quality of the resampled images. The interpolation function is performed by the convolution operation that involves a large number of additions and multiplications. However, a trade-off is required between the computation complexity and quality of the scaled image. Based on the content awareness of the algorithm, the image scaling algorithms are classified as adaptive image scaling and non-adaptive image scaling. Adaptive image scaling algorithms modify their interpolation technique based on whether the image has a smooth texture or a sharp edge. The interpolation method changes in real-time, therefore these algorithms are complex and computationally intensive. They find widespread use in image editing software, as they ensure a high quality scaled image. Non-adaptive image scaling algorithms such as nearest neighbor, bilinear, bicubic, and Lanczos algorithms have a fixed interpolation method irrespective of the image content. Using the nearest neighbor algorithm, image scaling is performed by interpolating a pixel's color and intensity values (horizontally and vertically) based on the values of neighboring pixels. The nearest neighbor algorithm is used to find the empty spaces in the original image, and to replace them with the nearest neighboring pixel. UG0651 User Guide Revision 5.0 2

Figure 1 Scale-Up from 2x2 to 4x4 UG0651 User Guide Revision 5.0 3

3 Hardware Implementation The scaler module contains two internal buffers that can store one line of the image for processing Image_Buffer0_i and Image_Buffer1_i. Each line of input data is written to Image_Buffer0_i and Image_Buffer1_i, alternately. The line_ready signal indicates that the scaler can start processing the next line. It must be set to high after the input line write to the buffer is completed. With the exception of the first line, after one line of data is input to the scaler, the next line must be input only after the Line_Done_o signal goes high. For a new frame, the first two lines of the frame need to be input before the scaler starts processing the data. The data stored in the image buffer is scaled to calculate the output data based on the nearest neighbor algorithm. When downscaling the height of the image, the next input line to the scaler must begin with the pixel number mentioned in NxtLine_PixelNum_Offset_o. When upscaling, the value of NxtLine_PixelNum_Offset_o is the first pixel of the next line in sequence. The following equations are used to calculate scaling factors for horizontal and vertical resolutions. X scale_factor = x inp/x out x 2g scaling_bitwidth Y scale_factor = y inp/y out x 2g scaling_bitwidth The following figure shows the scaler block diagram. Figure 2 Scalar Block Diagram UG0651 User Guide Revision 5.0 4

3.1 Inputs and Outputs The following table describes the input and output ports. Table 1 Inputs and Outputs Signal Name Direction Width Description nreset_i Input - Active low asynchronous reset signal to design. SYS_CLK_I Input - System clock. DATA_In_i Input [g_data_bitwidth * g_channels - 1 : 0] Input data to scaler. DATAIn_VLD_i Input - Set when input data is valid. Start_i Input - Scaler start signal. To be set to high before loading a new frame. InputXRes_i Input [g_input_x_res_bitwidth - 1 : 0] Input image width resolution. OutputXRes_i Input [g_output_x_res_bitwidth - 1 : 0] Output image width resolution. OutputYRes_i Input [g_output_y_res_bitwidth - 1 : 0] Output image height resolution. xscalefactor_i Input [g_scale_factor_bitwidth - 1 : 0] Width scale factor. yscalefactor_i Input [g_scale_factor_bitwidth - 1 : 0] Height scale factor. Scaler_done_o Output - Set to high for one clock cycle of system clock when the scaler completes scaling of one frame. Line_Done_o Output - Set to high after one line is processed. NxtLine_PixelNum_Offset_o Output [(g_input_y_res_bitwidth+g_input_ X_RES_BITWIDTH - 1): 0] DATA_OUT_o Output [g_data_bitwidth * g_channels - 1 : 0] Indicates the pixel number of the source image from which the next line is to be dumped into the scaler image buffer. When downscaling height wise, this signal indicates the next line in sequence. Scaled data output. DATAOut_VLD_o Output - Sets when output data is a valid register and describes the output of the scaler. line_ready Input - Set when writing the current line to the image buffer is complete, indicating that buffer data is ready for processing. UG0651 User Guide Revision 5.0 5

3.2 Configuration Parameters The following table describes the configuration parameters used in the hardware implementation of the scaler. These are generic parameters and can vary based on the application requirements. Table 2 Configuration Parameters Signal Name g_data_bitwidth g_channels g_input_x_res_bitwidth g_input_y_res_bitwidth g_output_x_res_bitwidth g_output_y_res_bitwidth g_scale_factor_bitwidth g_sf_rounding_precision g_buff_depth Description Width of the data input or output Number of data channels Input resolution X bit width Input resolution Y bit width Output resolution X bit width Output resolution Y bit width Scaling factor bit width Scaling factor's rounding precision bit width. Default value is configured to 256 (28). Line buffer depth 3.3 FSM Implementation The scaler finite state machine (FSM) goes through the following states during implementation. IDLE: After the module is reset or frame processing is complete, the FSM goes to IDLE state and waits for the start signal to move to the RAM_FULL_CHECK state. RAM_FULL_CHECK: The FSM remains in this state until the write to the image buffer is completed and line_ready signal is received. Then, it moves to the INP_PIXEL_INC state. INP_PIXEL_INC: The FSM moves to the NXT_PIXEL state in the next cycle. NXT_PIXEL: The FSM moves to WAIT_STATE in the next cycle. WAIT_STATE: The FSM moves to DATAOUT state in the next cycle. DATAOUT: The output pixel is calculated based on the horizontal counter, vertical counter, and scaling factors. The horizontal and vertical counters are updated and the read address and read enable signal (for reading from one of the two image buffers) is generated. On completion of processing of one input line, the FSM moves to RAM_FULL_CHECK state. After the total frame data is output, the FSM moves to IDLE state. UG0651 User Guide Revision 5.0 6

The following figure shows the scaler FSM implementation. Figure 3 Scaler FSM States 3.4 Timing Diagrams The following figure shows the timing diagram of the scaler. Figure 4 Timing Diagram UG0651 User Guide Revision 5.0 7

3.5 Testbench A testbench is provided to check the functionality of the scaler core. The following table lists the parameters that can be configured according to the application. Table 3 Testbench Configuration Parameters Name CLKPERIOD IN_HEIGHT IN_WIDTH OUT_HEIGHT OUT_WIDTH IMAGE_FILE_NAME Description Clock Period Height of the input image Width of the input image Height of the output frame Width of the output frame Input file name The following steps describe how to simulate the core using the testbench. 1. In the Design Flow window, expand Create Design. Right-click Create SmartDesign Testbench and click Run as shown in the following figure. Figure 5 Creating SmartDesign Testbench UG0651 User Guide Revision 5.0 8

2. In the Create New SmartDesign Testbench dialog box, enter a name and click OK. Figure 6 Create New SmartDesign Testbench Dialog SmartDesign testbench is created, and a canvas appears to the right of the Design Flow pane. UG0651 User Guide Revision 5.0 9

3. In the Libero SoC Catalog window, expand Solutions-Video, and drag the Scaler core onto the SmartDesign testbench canvas. Figure 7 Scaler The core appears on the canvasas shown in the following figure. Figure 8 Scaler Core on SmartDesign Testbench Canvas UG0651 User Guide Revision 5.0 10

4. Select all the ports of the core, right-click and select Promote to Top Levelas shown in the following figure. Figure 9 Promote to Top Level The ports are promoted to the top level as shown in the following figure. Figure 10 Scaler Ports Promoted to Top Level 5. On the SmartDesign toolbar, click Generate Component highilighted in the following figure. The SmartDesign component is generated. Figure 11 Generate Component UG0651 User Guide Revision 5.0 11

6. In the Files window, right-click simulation and click Import Files... as shown in the following figure. Figure 12 Import Files UG0651 User Guide Revision 5.0 12

7. Do one of the following: To import the sample testbench input file, browse to sample testbench input file to the stimulus directory and click Open as shown in the following figure. A sample RGB_in.txt file is provided with the testbench at the following path:..\project_name\component\microsemi\solutioncore\scaler\2.0.0 \Stimulus To import a different file, browse to the folder containing the image file and click Open. Figure 13 Input File Selection The imported file is listed under simulation as shown in the following figure. Figure 14 Input File in Simulation Directory 8. From Stimulus Hierarchy window expand Work, right-click Scaler_test ( Scaler_tb.v) and select Simulate Pre-Synth Design and then click Open Interactively. The core is simulated for one frame. UG0651 User Guide Revision 5.0 13

Figure 15 Simulating Pre-Synthesis Design The ModelSim tool appears with the testbench file loaded into itas shown in the following figure. Figure 16 ModelSim Tool with Scaler Testbench File If the simulation is interrupted because of the runtime limit specified in the DO file, use the run - all command to complete the simulation. After the simulation is completed, the testbench output image file appears in the simulation folder. UG0651 User Guide Revision 5.0 14

3.6 Resource Utilization The scaler is implemented in the SmartFusion 2 system-on-chip (SoC) FPGA (M2S150T-1FC1152 package) and PolarFire FPGA (MPF300TS_ES-1FCG1152E package). The following table lists the resources used by the FPGA. Table 4 Resource Utilization Report Resource Usage DFFs 328 4-Input LUTs 510 MACC 3 RAM1Kx18 2 RAM64x18 0 UG0651 User Guide Revision 5.0 15

Microsemi Corporate Headquarters One Enterprise, Aliso Viejo, CA 92656 USA Within the USA: +1 (800) 713-4113 Outside the USA: +1 (949) 380-6100 Fax: +1 (949) 215-4996 Email: sales.support@microsemi.com www.microsemi.com 2018 Microsemi Corporation. All rights reserved. Microsemi and the Microsemi logo are trademarks of Microsemi Corporation. All other trademarks and service marks are the property of their respective owners. Microsemi makes no warranty, representation, or guarantee regarding the information contained herein or the suitability of its products and services for any particular purpose, nor does Microsemi assume any liability whatsoever arising out of the application or use of any product or circuit. The products sold hereunder and any other products sold by Microsemi have been subject to limited testing and should not be used in conjunction with mission-critical equipment or applications. Any performance specifications are believed to be reliable but are not verified, and Buyer must conduct and complete all performance and other testing of the products, alone and together with, or installed in, any end-products. Buyer shall not rely on any data and performance specifications or parameters provided by Microsemi. It is the Buyer's responsibility to independently determine suitability of any products and to test and verify the same. The information provided by Microsemi hereunder is provided "as is, where is" and with all faults, and the entire risk associated with such information is entirely with the Buyer. Microsemi does not grant, explicitly or implicitly, to any party any patent rights, licenses, or any other IP rights, whether with regard to such information itself or anything described by such information. Information provided in this document is proprietary to Microsemi, and Microsemi reserves the right to make any changes to the information in this document or to any products and services at any time without notice. Microsemi Corporation (Nasdaq: MSCC) offers a comprehensive portfolio of semiconductor and system solutions for aerospace & defense, communications, data center and industrial markets. Products include high-performance and radiation-hardened analog mixed-signal integrated circuits, FPGAs, SoCs and ASICs; power management products; timing and synchronization devices and precise time solutions, setting the world's standard for time; voice processing devices; RF solutions; discrete components; enterprise storage and communication solutions; security technologies and scalable anti-tamper products; Ethernet solutions; Power-over-Ethernet ICs and midspans; as well as custom design capabilities and services. Microsemi is headquartered in Aliso Viejo, California, and has approximately 4,800 employees globally. Learn more at www.microsemi.com. 50200651 UG0651 User Guide Revision 5.0 16