3.6.1.22 Struct Variable/Argument Packing
(Ask a Question)- 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
wherebit
packing packs thestruct
fields using the exact bit-width andbyte
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 totrue
. Note thatbyte_enable
is only valid withbyte
packing. - Parameters
Parameter Value Optional Default Description variable/argument
string No - Variable/Argument Name pack
bit|byte
No - Packing Mode byte_enable
true|false
Yes false
Use 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) ... }