Visible to Intel only — GUID: mwh1416946938871
Ixiasoft
Visible to Intel only — GUID: mwh1416946938871
Ixiasoft
10.6.3. HAL Behavior for Managing Cache in Multi-Master and Multi-Processor Systems
For more information, refer to the "HAL I/O Macros to Bypass the Data Cache" table (Table 9–1 on page 9–4).
These macros are provided to access noncacheable memory regions.
The HAL provides the alt_uncached_malloc(), alt_uncached_free(), alt_remap_uncached(), and alt_remap_cached() routines to allocate and manipulate regions of uncached memory. These routines are available on Nios® II cores with or without a data cache—code written for a Nios® II core with a data cache is completely compatible with a Nios® II core without a data cache.
The alt_uncached_malloc() routine guarantees that the allocated memory region is not in the data cache and that all subsequent accesses to the allocated memory regions bypass the data cache. In the case there is no data cache implemented the alt_uncached_malloc() routine simply calls malloc(). If data cache is implemented, but bit 31 is not set to be used as a cache bypass then the following link error results when building the code:ALT_LINK_ERROR("alt_uncached_malloc() is not available because CPU is not configured to use bit 31 of address to bypass data cache");.
The alt_remap_uncached() routine is not available with Nios® II cores with data caches because mixing cacheable and uncacheable data on the same line is not supported. This function results in a link error when used with Nios® II cores.
In the case there is no data cache implemented the alt_uncached_free() routine simply calls free(). If data cache is implemented, but bit 31 is not set to be used as a cache bypass then a link error results when building the code.