Specifying arbitration shares – Altera Nios II C2H Compiler User Manual
Page 65

Altera Corporation
9.1
3–25
November 2009
Nios II C2H Compiler User Guide
C-to-Hardware Mapping Reference
illustrates usage of the connection pragma to connect two
master ports for the variable my_ptr to the memory module named
onchip_buffer
.
Example 3–15. Pragma Connecting a Master Port to a Slave Port
#pragma altera_accelerate connect_variable foo/my_ptr to onchip_buffer
int foo(int *my_ptr)
{
int x = *my_ptr;
my_ptr[8] = 23;
}
illustrates using multiple pragmas to connect a pointer
variable's master ports to multiple slave ports.
Example 3–16. Pragma Connecting a Master Port to Multiple Slave Ports
#pragma altera_accelerate connect_variable foo/my_ptr to onchip_buffer_0
#pragma altera_accelerate connect_variable foo/my_ptr to ext_ram_bridge
#pragma altera_accelerate connect_variable foo/my_ptr to sdram
#pragma altera_accelerate connect_variable foo/my_ptr to \
onchip_buffer_1/s2
int foo(int *my_ptr)
{
int x = *my_ptr;
my_ptr[8] = 23;
}
Specifying Arbitration Shares
Arbitration shares benefit memories that have higher efficiency when
accessed sequentially, such as SDRAM. You can use arbitration shares to
reduce interruptions to sequences of transfers with a specific slave. For
example, if a master-slave connection has an arbitration share value of
ten, then the arbitrator grants at least ten consecutive transfers to the
master port when it begins a sequence of transfer requests.
The connection pragma with additional terms for arbitration share is
defined as follows, where <shares> is a positive integer from 1 to 100:
#pragma altera_accelerate connect_variable \
<
function name
>/<
variable name
> to
<
module
>[/<
slave name
>] arbitration_share <
shares
>