Getting started tutorial, Introduction, C2h compiler design flow – Altera Nios II C2H Compiler User Manual

Page 23: Starting point for the c2h compiler design flow, Chapter 2. getting started tutorial, Introduction –1 c2h compiler design flow –1, Starting point for the c2h compiler design flow –1, Chapter 2, getting started tutorial

Advertising
background image

Altera Corporation

9.1

2–1

November 2009

2. Getting Started Tutorial

Introduction

This chapter describes the design flow for the Nios

®

II C-to-Hardware

Acceleration (C2H) Compiler. This chapter provides a design example
and gives you a step-by-step tutorial to guide you through the process of
creating your first hardware accelerator.

The example software design performs multiple iterations of a data-copy
function. By accelerating the data-copy function, you achieve more than
a 10-fold improvement in the execution performance. The resulting
hardware accelerator resembles a hardware block with direct memory
access (DMA) to copy data without processor intervention.

This tutorial assumes that you are familiar with the Nios II processor and
the Nios II design flow.

f

For introductory information on designing with the Nios II processor,
refer to the

Nios II Hardware Development Tutorial

available on the Altera

Nios II literature page at

http://www.altera.com/literature/lit-nio2.jsp

,

and to the Nios II Software Development Tutorial available in the Nios II
integrated development environment (IDE) help system.

C2H Compiler
Design Flow

This section discusses the design flow to create a hardware accelerator
with the C2H Compiler.

Starting Point for the C2H Compiler Design Flow

The design flow for the C2H Compiler starts with one or more C files that
compile successfully targeting the Nios II processor. Before you accelerate
a function with the C2H Compiler, you must:

Identify the functions that require acceleration.

Debug the functions first targeting the Nios II processor. After
accelerating a function, you can no longer debug individual C
statements within the function.

You might have existing C code that you need to accelerate to improve
performance. Alternatively, you might develop and debug a function in
C with the explicit purpose of converting it to hardware. In either case,
you achieve the best results if the C code is structured for the
C2H Compiler. To start with, you can accelerate your code as-is, and
determine if the results meet the design requirements.

Advertising