Creating an accelerator from the command line, Creating an accelerator from the command line –1, Explains how – Altera Nios II C2H Compiler User Manual

Page 115

Advertising
background image

Altera Corporation

9.1

5–1

November 2009

5. Accelerating Code Using

the Nios II Software Build

Tools Command Line

Creating an
Accelerator from
the Command
Line

The Nios II software build tools support the Nios II C2H Compiler on the
command line with the nios2-c2h-generate-makefile command. This
command creates a C2H makefile fragment that specifies all accelerators
and accelerator options for an application.

1

C2H Compiler projects created on the command line cannot be
imported into the Nios II Software Build Tools for Eclipse.
Altera recommends creating new C2H accelerators with the
Nios II IDE.

The nios2-c2h-generate-makefile command usage is as follows:

nios2-c2h-generate-makefile \

--sopcinfo=

<SOPC Builder System File>

[OPTIONS]

1

This command creates a new c2h.mk each time it is called,
overwriting the existing c2h.mk.

Table 5–1

lists the command line arguments for the

nios2-c2h-generate-makefile

command.

Table 5–1. nios2-c2h-generate-makefile Command Line Arguments (Part 1 of 2)

Argument Name

Meaning

--sopcinfo

The path to the SOPC Builder system file (

.sopcinfo

).

--app-dir

Directory to place the application Makefile and ELF. If
omitted, it defaults to the current directory.

--accelerator

Specifies a function to be accelerated. This argument
accepts up to four comma-separated values:

Target function name

Target function file

Link hardware accelerator instead of original
software. 1 or 0. Defaults to 1.

Flush data cache before each call. 1 or 0. Defaults
to 1.

Examples:

--accelerator=doDMA,../../DMA.c,1,0

--accelerator=analyze,../../finite.c

--enable_quartus

Building the application compiles the associated
Quartus II project. Defaults to 0.

Advertising