3.5.1.20.3 Pointer Argument and Shared Global Variable

Pointer arguments and global variables are considered as "memories" that maintain states in the circuit. The "memories" may be implemented inside or outside of the SmartHLS-generated circuit, depending on the specified interface type. For a global variable, a top-level RTL interface is only created if the variable is shared/accessed by both the software test bench and the HLS function. If the global variable is only accessed by the HLS function, the "memory" will be implemented inside the generated circuit and has no top-level interface.

There are four interface types for pointer arguments and shared global variables: memory, AXI4 initiator, AXI4 target and legacy AXI4 slave. As shown in the table below, the available interface types vary depending on the data type of the pointer or global variable. We will explain each interface type in the sections below.

Data TypeInterface Type
Memory (default)AXI4 InitiatorAXI4 TargetLegacy AXI4 Slave
ArrayPointer arguments and global variables of these data types are supported.Pointer arguments of these data types are supported, but not for global variables.n/a
StructSupports global struct only.
Scalarn/a