Model Composer automatically generates AI Engine code (dataflow graph) from the subsystem that comprises blocks from the AI Engine Blockset library. However, an AI Engine model in Model Composer requires the addition of the Vitis Model Composer Hub block to configure compilation and generation of AI Engine output. In addition to the targets available in the Hub block which supports compilation of the design into low-level representations using blocks from the library, it also supports an AI Engine compilation target.
This section discusses only the graph code generation from Model Composer. For running and verifying the generated AI Engines code, refer to Verification of AI Engine Code.
The Model Composer Hub block settings specific to AI Engine compilation targets are shown in the following figure.
Add the Hub block from the library, and configure the AI Engine subsystem and settings as shown in the previous figure. For more details about adding the Model Composer Hub block into the design and associated features, refer to Vitis Model Composer Hub. Select the subsystem for which to generate code from the list on the left.
You can specify a cell array of AI Engine compiler options using the AIE Compiler Options edit button. This provides a method to control the compiler debug options, execution target options, file options and so on. Examples as follows:
- To control the debug option log-levels, you can specify the string
{'--log-level=5'}
in the AIE Compiler Options field. - For issues related to the stack size or heap size in the downstream
AI Engine flows, you can increase the size by
adding
--stacksize=<int>
and--heapsize=<int>
in the AIE Compiler options field.
Once the code generation process is initiated, the Progress window might display (based on whether the imported kernel/graph code is pre-compiled or not). If the design was already compiled during the Simulink simulation phase, you might not see this window. However, Model Composer displays the progress of code generation in the Progress window.
When Vitis Model Composer has completed
generating the code, it displays the status message Done code
generation
in the Progress window as shown in the following figure.