Altera Nios II C2H Compiler Uživatelský manuál Strana 90

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 138
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 89
3–50 9.1 Altera Corporation
Nios II C2H Compiler User Guide November 2009
Scheduling
Example 3–38. Pipelined Subfunction
int MAX(int a, int b)
{
return ((a > b)? a : b);
}
#pragma altera_accelerate connect_variable MAX_loop/a to sdram
#pragma altera_accelerate connect_variable MAX_loop/b to
onchip_ram_64_kbytes
int MAX_loop(int * __restrict__ a, int * __restrict__ b)
{
int i, c = 0;
for (i = 0; i < 1024; i++)
{
c += MAX(a[i], b[i]);
}
return c;
}
If the subfunction performs a memory access that stalls, then the outer
state machine also stalls.
Pipelined subfunctions provide a useful option for controlling shared
resources. For further information, see “Resource Sharing”.
Zobrazit stránku 89
1 2 ... 85 86 87 88 89 90 91 92 93 94 95 ... 137 138

Komentáře k této Příručce

Žádné komentáře