Recommended Project Directory Structure - 2020.2 English

Versal ACAP AI Engine Programming Environment User Guide (UG1076)

Document ID
UG1076
Release Date
2020-11-24
Version
2020.2 English

The following directory structure and coding practices are recommended for organizing your AI Engine projects to provide clarity and reuse.

  • All adaptive data flow (ADF) graph class definitions, that is, all the ADF graphs that are a subclass of graph, must be located in a header file. Multiple ADF graph definitions can be included in the same header file. This class header file should be included in the main application file where the actual top-level graph is declared in the file scope (see Creating a Data Flow Graph (Including Kernels)).
  • There should be no dependencies on the order that the header files are included. All header files must be self-contained and include all the other header files that it needs.
  • There should be no file scoped variable or data-structure definitions in the graph header files. Any definitions (including static) must be declared in a separate source file that can be identified in the header property of the kernel where they are referenced (see Look-up Tables).
  • There is no need to declare the kernels under extern "C" {...}. However, this declaration can be used in an application meant to run full-program simulation, but it must adhere to the following conditions:
    • If the kernel-function declaration is wrapped with extern "C", then the definition must know about it. This can be done by either including the header file inside the definition file, or wrapping the definition with extern "C".
    • The extern "C" must be wrapped with #ifdef __cplusplus. This is synonymous to how extern "C" is used in stdio.h.