Burst Inference Failure 13 - 2023.2 English

Vitis HLS Messaging (UG1448)

Document ID
UG1448
Release Date
2023-10-18
Version
2023.2 English

Description

Warning: [214-378] Unsupported access data type. Expected integer or floating point type but received %struct.mytype = type { i8, i8, i8 }.

Explanation

Bursts are not supported for structs in the interface. However, using special alignment directives (specified by the user), Vitis HLS can aggregate the struct into a single integer access to allow bursts on this port.

Example

//////////// ORIGINAL ////////////
// For MYSTRUCT *a, the type alignment is 1. Auto aggregation on `a` will not occur since that will cause data layout changes. As a result, bursts will not be inferred on this struct type port.
struct mystruct {
  char r;
  char g;
  char b;
};

typedef struct mystruct MYSTRUCT;

void foo(MYSTRUCT *a) {
  for( int i = 0; i < 256; ++i )
  ... = a[i];
}

// Resolution Workaround:
// Rewrite the code with `alignas(N)`, where N is >= sizeof(MYSTRUCT) to allow Vitis HLS to aggregate struct elements into a single scalar. This enables bursting on this port.

struct alignas(4) mystruct {
  char r;
  char g;
  char b;
};

typedef struct mystruct MYSTRUCT;

void foo(MYSTRUCT *a) {
  for( int i = 0; i < 256; ++i )
  ... = a[i];
}