Description
Specifies that two or more M_AXI
pointer arguments point to the same underlying buffer in memory (DDR or HBM).
Indicates aliasing between the pointers by setting the distance or offset between
them.
syn.directive.alias applies to top-level function arguments
mapped to M_AXI interfaces.
Vitis HLS considers different
pointers to be independent channels and generally does not provide any dependency
analysis. However, in cases where the host allocates a single buffer for multiple
pointers, this relationship can be communicated through syn.directive.alias. Communicating this way maintains dependency
analysis. Communicating through syn.directive.alias also enables data dependence analysis in Vitis HLS by defining the distance between pointers
in the buffer.
Requirements for syn.directive.alias:
- You must assign all ports to
M_AXIinterfaces and also assign them to different bundles. See example below for details. - You can only use each port one time in a
syn.directive.aliascommand. - All ports assigned to
syn.directive.aliasmust have the same depth. - Each port can have one offset if you specify the offset.
- You must specify the offset for the
M_AXIport asslaveordirect.offset=offis not supported.
Syntax
syn.directive.alias=[OPTIONS] <location> <ports>
-
<location>is the location string in the formatfunction[/label]that the ALIAS pragma applies to. -
<ports>specifies the ports to alias.
Options
-
distance=<integer> - Specifies the difference between the pointer values passed to the ports in the list.
-
offset=<string> - Specifies the offset of the pointer passed to each port in
the
portslist with respect to the origin of the array.
Example
For the following function top:
void top(int *arr0, int *arr1, int *arr2, int *arr3, ...) {
#pragma HLS interface M_AXI port=arr0 bundle=hbm0 depth=0x40000000
#pragma HLS interface M_AXI port=arr1 bundle=hbm1 depth=0x40000000
#pragma HLS interface M_AXI port=arr2 bundle=hbm2 depth=0x40000000
#pragma HLS interface M_AXI port=arr3 bundle=hbm3 depth=0x40000000
distance between
them:syn.directive.alias=top arr0,arr1,arr2,arr3 distance=10000000
offset between pointers, to accomplish the same
effect:syn.directive.alias=top arr0,arr1,arr2,arr3 offset=00000000,10000000,20000000,30000000