Altera Home Page
文档资料 许可
在线购买 下载

  主页   |   产品   |   支持   |   最终市场   |   技术中心   |   教育与活动   |   公司介绍   |   在线购买  
  mySupport   |   器件   |   软件   |   IP   |   设计范例   |   参考设计  

 产品
      MAX/MAX II
      Stratix/Stratix GX
      Nios II
  
 功能
      算法
      存储器
      总线及I/O
      逻辑
      接口与外设
      DSP
      通信
      PLL & Clocking
  
 设计输入方法
      Quartus II软件工程
      Tcl
      VHDL
      Verilog HDL
      C Code 范例
      DSP Builder
      TimeQuest
   片内调试
  
 仿真工具
      Mentor Graphics ModelSim
      Cadence NCsim
      Synopsys VCS
  
 旧范例
      图形编辑器
      AHDL
  

Nios II C2H Compiler Image Rotate Design Example

The Nios® II C-to-Hardware Acceleration Compiler (C2H Compiler) Image Rotate design example demonstrates how the Nios II C2H Compiler is used to accelerate an image rotation algorithm in hardware. The design example contains both hardware and software.

The hardware part of the example is created in SOPC Builder and contains the necessary peripherals to read a bitmap image from flash memory, rotate the image in RAM, then write the rotated image to a display frame buffer located in Synchronous SRAM. The hardware design also contains a performance counter to measure the speed of the rotation algorithm, and a JTAG UART to report the measurement results.

The software part of the example is a Nios II Integrated Development Environment (IDE) project written in C. The project contains a main loop which calls an image rotate function 360 times, incrementing the number of degrees to rotate the image once per iteration. The rotated output image can optionally be displayed on the KROS LCD daughter card for Nios II development boards.

Hardware Design Specifications

  • Board support: Nios Development Board, Cyclone® II edition
  • Nios II core: Nios II /f, debug-enabled, 4 Kbytes I-cache, 8 Kbytes d-cache
  • On-chip RAM: 12 Kbytes
  • Off-chip synchronous SRAM: 1 Mbyte
  • Common flash interface (CFI) flash memory interface: 8 Mbytes
  • Compact flash interface: 1
  • SDRAM controller: 32 Mbytes
  • JTAG UART - 1
  • Timer: 1
  • Color LCD controller: 1
  • System ID peripheral: 1
  • Performance counter: 1

Block Diagram

Figure 1. Nios II C2H Image Rotate System Block Diagram

Nios II C2H Image Rotate System Block Diagram

C2H Acceleration Results

In this example, the C2H Compiler is able to accelerate the image rotate algorithm to run 57 times faster than software compiled with no optimization (-O0), running on the fastest Nios II embedded processor. Compared to software compiled with full optimization (-O3), the C2H Compiler accelerated algorithm runs 24 times faster.

Using This Design Example

Download the Nios II C2H Image Rotate Design Example (.zip file).

The use of this design is governed by, and subject to, the terms and conditions of the Altera Hardware Reference Design License Agreement.

The .zip file contains all the necessary hardware and software files to reproduce the example, as well as a readme.txt file. The readme.txt file contains instructions for re-building the design.

Design Examples Disclaimer

These design examples may only be used within Altera Corporation devices and remain the property of Altera. They are being provided on an “as-is” basis and as an accommodation; therefore, all warranties, representations, or guarantees of any kind (whether express, implied, or statutory) including, without limitation, warranties of merchantability, non-infringement, or fitness for a particular purpose, are specifically disclaimed. Altera expressly does not recommend, suggest, or require that these examples be used in combination with any other product not provided by Altera.

 
Nios II Literature

Nios II Integrated Development Environment Tutorial

  请填写反馈意见