3.5.1.21 API Driver Functions for AXI4 Target

SmartHLS offers a comprehensive suite of C/C++ functions that serve as an Application Program Interface (API) to interface with the RTL modules produced by the SmartHLS tool. This API is dynamically tailored to accommodate different operating environments, whether the CPU is operating under a Linux-based system or in a bare-metal context. The generated API functions are reflective of the top-level functions defined within SmartHLS, adhering to naming conventions that incorporate the original function name, the data transfer type, and the specific argument types and names.

For systems running Linux, the API is designed to interact with virtual memory addresses, providing a layer of abstraction that facilitates ease of use within the operating system's memory management framework. Conversely, for bare-metal systems, the API functions are mapped directly to the physical base addresses of the RTL modules within the CPU's memory map, ensuring direct and efficient access to the hardware.

The distinction between axi target and axi initiator argument types further influences the API's structure, ensuring that the interface is optimized for the intended data transfer operations. Each top-level function's API is meticulously crafted to provide robust control, drive functionality, and enable status monitoring of the corresponding RTL module, thereby streamlining the integration of SmartHLS-generated hardware accelerators into a variety of computational environments.

Important: The convention followed by the API driver functions is as follows: if the CPU is running a Linux operating system (e.g when using an Icicle_SoC project), the functions use a virtual memory address as an argument to determine which SmartHLS module to control. However, if the CPU runs in a baremetal context (e.g. when using a MiV_SoC project) the functions use a physical base address as the SmartHLS module selector because there is no virtual memory management. In the later case, the physical base address is known at compile time therefore the API has a default assignment making it an optional argument.