set_directive_aggregate - 2020.2 English

Vitis High-Level Synthesis User Guide (UG1399)

Document ID
UG1399
Release Date
2021-03-22
Version
2020.2 English

Description

This directive collects the data fields of a struct into a single wide scalar. Any arrays declared within the struct and Vitis HLS performs a similar operation as set_directive_array_reshape, and completely partitions and reshapes the array into a wide scalar and packs it with other elements of the struct.
Tip: Arrays of structs are restructured as arrays of aggregated elements.

The bit alignment of the resulting new wide-word can be inferred from the declaration order of the struct elements. The first element takes the least significant sector of the word and so forth until all fields are mapped.

Note: The AGGREGATE optimization does not pack the structs, and cannot be used on structs that contain other structs.

Syntax

set_directive_aggregate <location> <variable>
  • <location> is the location (in the format function[/label]) which contains the variable which will be packed.
  • <variable> is the struct variable to be packed.

Options

This command has no options.

Examples

Aggregates struct pointer AB with three 8-bit fields (typedef struct {unsigned char R, G, B;} pixel) in function foo, into a new 24-bit pointer.

set_directive_aggregate foo AB