Description
Specify that two or more M_AXI
pointer arguments point to the same
underlying buffer in memory (DDR or HBM) and indicate any 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
and dependency analysis can be maintained.
This enables data dependence analysis in Vitis HLS by defining the distance between pointers in the buffer.
Requirements for syn.directive.alias
:
- All ports must be assigned to
M_AXI
interfaces and also assigned to different bundles, as shown in the example below - Each port can only be used in one
syn.directive.alias
command - All ports assigned to
syn.directive.alias
must have the same depth - When offset is specified, each port can have one offset
- The offset for the
M_AXI
port must be specified asslave
ordirect
,offset=off
is 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
ports
list 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