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

  • 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 84
Altera Corporation 9.1 3–45
November 2009 Nios II C2H Compiler User Guide
C-to-Hardware Mapping Reference
Figure 3–22 shows the dependency graph for the do loop in
Example 3–36, which has loop-carried dependencies.
Example 3–36. Loop-Carried Dependency
int simple_hash(int *data, int len)
{
int hash = 0;
do
{
int data_word = *data++;
hash = hash + data_word;
hash = hash ^ data_word;
} while (len--);
return hash;
}
Figure 3–22. Loop-Carried Dependency
Variables data and hash have loop-carried dependencies, illustrated by
the cyclic arrows in Figure 3–22. The arrow for hash indicates that the
calculation on State 1 in iteration N is dependent on the result of the
calculation from State 2 in iteration (N-1). The arrow for data in State 0
illustrates the ideal case in which a state depends only on its own output.
The ideal case does not restrict the scheduling of successive iterations.
Zobrazit stránku 84
1 2 ... 80 81 82 83 84 85 86 87 88 89 90 ... 137 138

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

Žádné komentáře