Memory Model - 2022.2 English

Vitis High-Level Synthesis User Guide (UG1399)

Document ID
UG1399
Release Date
2022-12-07
Version
2022.2 English

One key difference between Vivado® HLS and Vitis™ HLS is how the internal memory model is implemented. The memory model defines the way data is arranged and accessed in computer memory. It consists of two separate but related issues: data alignment and data structure padding. Vitis HLS uses a different memory model from Vivado HLS and the key differences are as follows:

  • Vitis HLS follows the GCC Compiler standard for data alignment
  • Vitis HLS differs significantly from Vivado HLS in how it aggregates and disaggregates structs/classes in the interface
    • Vivado HLS used to disaggregate structs in the interface by default. Vitis HLS instead keeps structs aggregated. You can use the AGGREGATE/pragma HLS disaggregate pragma/directive to match the Vivado HLS behavior.
      • The exception is when there is a hls::stream object in the struct or an array inside the struct is partitioned, Vitis HLS will disaggregate the struct in both of these cases.
    • Structs in the code, both internal and global variables, are disaggregated by default and decomposed into their member elements, as described in Structs. The number and type of elements created are determined by the contents of the struct itself. Arrays of structs are implemented as multiple arrays, with a separate array for each member of the struct.
  • Vitis HLS also differs in how data alignment is handled for interface protocols (such as AXI).
  • Changes also include deprecated pragmas such as DATA_PACK.

These changes are fully described in the Vitis HLS Memory Layout Model section of the user guide (UG1399) and should be reviewed before proceeding further.