Altera Nios II C2H Compiler Manual de usuario Pagina 52

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 138
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 51
3–12 9.1 Altera Corporation
Nios II C2H Compiler User Guide November 2009
One-to-One C-to-Hardware Mapping
Table 3–5 shows an example of a subfunction called by two different
functions. In this case, functions foo() and bar() both call a
subfunction foobar_sub().
Figure 3–8 shows the hardware structure of the accelerators resulting
from the code in Table 35. Logic for the function foobar_sub() exists
within both accelerators.
Figure 3–8. Shared Subfunction Logic
The C2H Compiler does not support external subfunctions. You must
locate the subfunction in the same source file as the accelerated function.
This is because, unlike the #include construct, a C external function
reference requires the presence of a linker. The C2H Compiler has no
linker.
Table 3–5. Shared Subfunction foobar_sub()
Top-Level Accelerated Function: foo() Top-Level Accelerated Function: bar()
void foo(int *data_in,
int *data_out)
{
...
foobar_sub();
...
}
void bar(int *data_in,
int *data_out)
{
...
foobar_sub();
...
foobar_sub();
...
}
Vista de pagina 51
1 2 ... 47 48 49 50 51 52 53 54 55 56 57 ... 137 138

Comentarios a estos manuales

Sin comentarios