Altera Nios II C2H Compiler Manuel d'utilisateur Page 124

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 138
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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
Vue de la page 123
1 2 ... 119 120 121 122 123 124 125 126 127 128 129 ... 137 138

Commentaires sur ces manuels

Pas de commentaire