Step 3: Code Generation and Running AI Engine SystemC Simulation - 2020.2 English

Vivado Design Suite Tutorial: Model-Based DSP Design using Add-on for MATLAB and Simulink (UG1498)

Document ID
Release Date
2020.2 English
Model Composer can generate graph code from your design. But this is not all. It also generates a make file and collects data from the input and output port of your system. In this step you will see how this is done.
  1. Create a subsystem from all three blocks in your design. You can do this by selecting the blocks and clicking the Create Subsystem button as shown in the following figure.

  2. Assign a name to the subsystem, for example aie_system.
  3. Drag the Model Composer Hub from the library browser or simply click on the canvas and start typing Model Composer Hub.

  4. Double-click the Model Composer Hub and make changes as follows.

    When you check Create testbench, the tool generates a testbench, including input and output test vectors from Model Composer. You can useAI Engine SystemC Simulator to verify the correctness of the design by comparing the results with the test vectors from Model Composer.
    Note: The AI Engine SystemC simulation may take some time to complete.
  5. Click Apply and then Generate and Run. Within a few seconds the code directory gets created. Because you also checked Create testbench, the aiecompiler will get invoked under the hood and compile the code using the generated graph code and the kernel source codes. It subsequently runs the AI Engine SystemC Simulation.

    This operation will take a couple of minutes. Observe the simulation completion message along with the comparison of the output to the Simulink output (data/reference_output/Out1.txt). It prints any diff, in the wait dialog.

  6. Click OK to exit the progress window.
  7. Navigate to code/src_aie to inspect the generated graph code and Makefile. The tool automates the generation of all these files.

  8. Navigate to the data folder and observe the reference_output/ directory where the data logged from Simulink gets stored. The aiesimulator_output/ folder logs the data from AI Engine SystemC simulator and Model Composer compares the results at the end of simulation.