<div class='quotetop'>QUOTE </div>
--- Quote Start ---
Hi,
You can allocate the buffer by using fuction:
alt_uncached_malloc()
which is discribed in 'NiosII Software Development Handbook'.
Also you can use bit31 method. NiosII CPU can address 4G space, but the higher 2G and the lower 2G are overlaying, the only different is that the higher 2G address will bypass the Cache which means that is the bit31 of address equals to 1, then the access will by pass the Cache.
The third to by pass Cache is IO operations, as the following show:
IORD_ALTERA_AVALON_PIO_DATA(base)
IOWR_ALTERA_AVALON_PIO_DATA(base, data)
The HAL provides the C-language macros IORD and IOWR that expand to
the appropriate assembly instructions to bypass the data cache. The IORD
macro expands to the ldwio instruction, and the IOWR macro expands to
the stwio instruction. These macros should be used by HAL device
drivers to access device registers.
regards,
David[/b]
--- Quote End ---
You should use ath alt_uncached_malloc call or the alt_remap_uncached call. Don't explicitly set the bit 31 as that's the current hardware implementation. Besides the functions do just this, the difference is that if the behaviour of the hardware ever changes Altera can change the behaviour of alt_uncached_malloc or alt_remap_uncached and you don't need to change your code