Run the project as software only – Altera Nios II C2H Compiler User Manual

Page 29

Advertising
background image

Altera Corporation

9.1

2–7

November 2009

Nios II C2H Compiler User Guide

Getting Started Tutorial

3.

If the Welcome to the Altera Nios II IDE page displays, close it to
view the workbench.

4.

Create a new C/C++ Application project.

a.

On the File menu, point to New and click C/C++ Application.
The New Project wizard appears.

b.

In the Name box, type

c2h_tutorial_sw

.

c.

In the Select Project Template list, select Blank Project.

d.

Use the Select Target Hardware settings to browse to and select
the SOPC Builder system (.ptf) file in your c2h_tutorial_hw
directory. After you specify the SOPC Builder system, the IDE
automatically sets the CPU setting to cpu, which is the name of
the only Nios II processor core available in this SOPC Builder
system.

e.

Click Finish. The IDE generates a new project c2h_tutorial_sw
and a new system library project c2h_tutorial_sw_syslib.

5.

Download the software file dma_c2h_tutorial.c from the Nios II
literature page and save it to a known location on your host
computer. The file is located next to this document (Nios II C2H
Compiler User Guide)
on the Altera Nios II literature page at

http://

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

.

6.

Import the C file dma_c2h_tutorial.c into the c2h_tutorial_sw
project. The easiest way to do this is to use an external file
management tool, such as Windows Explorer, and drag the file onto
the c2h_tutorial_sw project folder in the C/C++ Projects view of the
Nios II IDE.

Run the Project as Software Only

In this section, you build and run the project as a software-only
implementation, and observe the time required to run the program. To
run the program, perform the following steps:

1.

In the C/C++ Projects view, right-click the c2h_tutorial_sw project,
point to Run As and click Nios II Hardware. The Nios II IDE takes a
few minutes to build and run the program.

Advertising