Subfunction calls, Subfunction calls –11, Figure 3–7 – Altera Nios II C2H Compiler User Manual

Page 51

Advertising
background image

Altera Corporation

9.1

3–11

November 2009

Nios II C2H Compiler User Guide

C-to-Hardware Mapping Reference

Figure 3–7. switch Logic

Subfunction Calls

A subfunction is a C function called from within an accelerated function.
The C2H Compiler translates subfunctions to hardware using the same
mapping rules as for the top-level function. The resulting HDL module
for the accelerated subfunction becomes a submodule of the top-level
function, as illustrated in

Figure 3–8 on page 3–12

.

The C2H Compiler translates the top-level function and all subfunctions
to a single hardware accelerator. The C2H Compiler creates only one
instance of the subfunction hardware logic, regardless of how many times
the subfunction is called within the top-level function. If the calling
function calls the subfunction multiple times, the subfunction logic
becomes a shared resource. However, the subfunction is a private
resource exclusive to the calling function. In other words, if multiple
separate, accelerated functions call a common subfunction, the
C2H Compiler creates separate instances of the subfunction logic.

Advertising