SDSoC Environment API

Thissectiondescribes functions insds_libavailable for applications developed in the SDSoC environment.

Note:To use the library, #include "sds_lib.h"in source files. You must include stdlib.hbefore including sds_lib.hto provide the size_ttype declaration.
The SDSoC™ environment API provides functions to map memory spaces, and to wait for asynchronous accelerator calls to complete.
void sds_wait(unsigned int id)
Wait for the first accelerator in the queue identified by id, to complete. The recommended alternative is the use #pragma SDS wait(id), as described in Asynchronous Function Execution.
void *sds_alloc(size_t size)
Allocate a physically contiguous array of sizebytes.
void *sds_alloc_non_cacheable(size_t size)
Allocate a physically contiguous array of sizebytes that is marked as non-cacheable. Memory allocated by this function is not cached in the processing system. Pointers to this memory should be passed to a hardware function in conjunction with
#pragma SDS data mem_attribute (p:NON_CACHEABLE)
void sds_free(void *memptr)
Free an array allocated through sds_alloc()
void *sds_mmap(void *physical_addr, size_t size, void *virtual_addr)
Create a virtual address mapping to access a memory of sizebytes located at physical address physical_addr.
  • physical_addr: physical address to be mapped.
  • size: size of physical address to be mapped.
  • virtual_addr:
    • If not null, it is considered to be the virtual-address already mapped to thephysical_addr, andsds_mmapkeeps track of the mapping.
    • If null,sds_mmapinvokesmmap()to generate the virtual address, andvirtual_addris assigned this value.
void *sds_munmap(void *virtual_addr)
Unmaps a virtual address associated with a physical address created using sds_mmap().
unsigned long long sds_clock_counter(void)
Returns the value associated with a free-running counter used for fine grain time interval measurements.
unsigned long long sds_clock_frequency(void)
Returns the frequency (in ticks/second) associated with the free-running counter that is read by calls to sds_clock_counter. This is used to translate counter ticks to seconds.