Altera Nios II C2H Compiler Bedienungsanleitung Seite 124

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 138
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 123
6–6 9.1 Altera Corporation
Nios II C2H Compiler User Guide November 2009
Unshare Pointer Pragma
Example 6–5. Automatically Shared Master Port
#pragma altera_accelerate connect_variable ptr_a to onchip_memory_0
#pragma altera_accelerate connect_variable ptr_a to onchip_memory_1
#pragma altera_accelerate connect_variable ptr_b to onchip_memory_0
#pragma altera_accelerate connect_variable ptr_b to onchip_memory_1
if (x)
{
ptr_a = ONCHIP_MEMORY_1_BASE;
ptr_b = ONCHIP_MEMORY_2_BASE;
}
else
{
ptr_a = ONCHIP_MEMORY_2_BASE;
ptr_b = ONCHIP_MEMORY_1_BASE;
}
/* ... perform some dereference operations with ptr_a and ptr_b ... */
To overcome this problem, use the unshare_pointer pragma, which
instructs the compiler to always optimize for speed, and never defer
operations for the purposes of resource scheduling. The syntax is as
follows, for a pointer my_ptr in function my_func:
#pragma altera_accelerate unshare_pointer my_func/my_ptr
Seitenansicht 123
1 2 ... 119 120 121 122 123 124 125 126 127 128 129 ... 137 138

Kommentare zu diesen Handbüchern

Keine Kommentare