2D shuffle from higher address to lower address - 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 goal is to exchange the position of the 16 first and last samples in dimension 0. This cannot be done if we consider the whole buffer (32 x 4) as a single entity. For that matter we will consider each line individually, meaning that the external world will send the data continuously but the shared memory will process each line as they arrive:

adf::write_access(mtxin1.in[0]) = 
    adf::tiling({.buffer_dimension = {32,1},
                  .tiling_dimension = {32,1},
                  .offset = {0, 0}});

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

It is more or less a single dimension buffer processing.

Let’s diplay the output:

Utils/GetTiles.py doc_x86simulator_output/data/Output_24.txt 2Do 32 4 0

This give:

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

filename: doc_x86simulator_output/data/Output_24.txt
NCols: 32
NRows: 4
NLayers: 1

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

Static Tile Selection

Tile: 0
 16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31   0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
 48  49  50  51  52  53  54  55  56  57  58  59  60  61  62  63  32  33  34  35  36  37  38  39  40  41  42  43  44  45  46  47
 80  81  82  83  84  85  86  87  88  89  90  91  92  93  94  95  64  65  66  67  68  69  70  71  72  73  74  75  76  77  78  79
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127  96  97  98  99 100 101 102 103 104 105 106 107 108 109 110 111
------------------------------------------------------------