3.6.1.22 Struct Variable/Argument Packing

Syntax
#pragma HLS memory impl variable(<var_name>) pack(bit|byte) byte_enable(true|false)
#pragma HLS memory impl argument(<arg_name>) pack(bit|byte) byte_enable(true|false
Description
The pragma is to be used to pack a global interface / local memory variable with struct type. There are two packing modes: bit/ byte where bit packing packs the struct fields using the exact bit-width and byte mode packs the fields with 8-bit alignment. byte_enable option creates an interface / memory with byte enable signals to write individual fields when set to true. Note that byte_enable is only valid with byte packing.
Parameters
ParameterValueOptionalDefaultDescription
variable/argumentstringNo-Variable/Argument Name
packbit|byteNo-Packing Mode
byte_enabletrue|falseYesfalseUse byte-enable to write stuct fields
Position

Argument - At the beginning of the function definition block.

Variable - Before the global / local variable declaration.

Examples
#pragma HLS memory impl variable(b) pack(bit)
struct S b[100];

int sum(struct S &s) {
#pragma HLS function top
#pragma HLS memory impl argument(s) pack(byte) byte_enable(true)
 ...
}