AXI4 Target for Module Control
(Ask a Question)The HLS module can also be controlled via an AXI4 target interface in a memory-mapped
manner. When axi_target
interface type is specified in the pragma, a
module control register and a return value register will be created and
made accessible behind the HLS module’s AXI4 target interface. The AXI4 target interface’s
associated ports are named as axi4target_*
. Writing a value of 1 to the
module control register will start the HLS module. When reading from the
module control register, a value of 1 means the HLS module is still running; a
value of 0 means the HLS module is idle (or has finished running). When the HLS module
finishes, the return value of the top-level function (if not void
type)
can be retrieved by reading the return value register. The memory-mapped address
offsets of these registers can be found in the AXI4 Target Interface Address Map section of the SmartHLS Report. In addition, driver functions are
generated for convenient module control from an attached processor (see Module Control Driver Functions ).
Note that to use AXI4 target interface for module control, the top-level function's return
type must be a C primitive data type (e.g., char, unsigned int, double, and etc; cannot be
a struct or ap_int
type). Using AXI4 target interface for module control
is not suitable for designs with pipeline functions.