1D Linear Transferring From Source to Destination - 2025.1 English - XD100

Vitis Tutorials: AI Engine Development (XD100)

Document ID
XD100
Release Date
2025-08-25
Version
2025.1 English

In this example, the input data is transferred from the source to the destination without any changes. The input data is read in a linear fashion and written to the destination in a linear fashion using 3 different tiling parameters.

The first way is to just specify the buffer dimension and the tiling dimension as the same. This is the simplest way to transfer data from source to destination.

adf::read_access(mtxin.out[0]) = adf::tiling({
    .buffer_dimension = {256},
    .tiling_dimension = {256},
    .offset = {0}});

For the other ways a stride and a wrap are added to the tiling parameters. the stride is the distance between the start of the next tile and the start of the current tile in the specified dimensions. The wrap is the number of Tiles to read before moving to the next tile traversal.

In the second way the tiling dimension is equal to the buffer dimension so a single tile will be transferred (wrap = 1), so the straide value is not important.

adf::read_access(mtxin.out[0]) = adf::tiling({
    .buffer_dimension = {256},
    .tiling_dimension = {256},
    .offset = {0}});

In the third way the tiling dimension is set to 1 so 256 tiles will be transferred (wrap = 256), and the stride should be 1in order to read all data in a sequential way.

adf::read_access(mtxin.out[2]) = adf::tiling({
    .buffer_dimension = {256},
    .tiling_dimension = {1},
    .offset = {0},
    .tile_traversal = {{.dimension = 0, .stride = 1, .wrap = 256}} });

In a general manner the wrap can be set to w and the stride (and the tiling dimension) must be set to s in such a way that s*w = 256. In order to start to read from the beginning of the buffer the offset should be set to 0.

1D Linear Transferring

The red frame represents the buffer area, the moving blue frame is the tile area (this changes over time if there are multiple tiles). The light blue area is the validated buffer area, the one which is within the boundaries, as defined in the tiling parameters (all buffer by default). The white area within the buffer and outside the buffer will be replaced by zeros by the reading DMA.

Using GetTiles.py one can dig inside output files:

  • filename doc_x86simulator_output/data/Output_10.txt

  • 1Do tile with optimized display

  • 256 tile width 256

  • 0 1display tiles from 0 to 1

Utils/GetTiles.py doc_x86simulator_output/data/Output_10.txt 1Do 256 0 1

The output for this command line is:

------------------------------------------------------

filename: doc_x86simulator_output/data/Output_10.txt
NCols: 256
NRows: 1
NLayers: 1

------------------------------------------------------

Static Tile Selection

Tile: 0
 0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19    ...    236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
------------------------------------------------------------
Tile: 1
1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019    ...    1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255
------------------------------------------------------------