Stage 1: Create and Simulate the Design - 2023.2 English

Vitis Tutorials: AI Engine

Document ID
Release Date
2023.2 English
  1. On the MATLAB GUI, select the Home Tab, and click Simulink.

    missing image

  2. Select Blank Model to create a new canvas on which to design the Decimation Chain.

    missing image

    Perform the next two steps to enhance the User Experience. This allows you to have an instant access to the initialization file and to automatically call it when opening the design or when you update it.

  3. Right-click in the canvas, and select Model Properties:

    • Click the Callbacks tab.

    • Click PreLoadFcn, and type CreateFilter; in the edit window on the right.

    • Click InitFcn, and type CreateFilter; in the edit window on the right.

    • Click Apply.

      missing image

  4. Click on the canvas, and type subsys. Select the first Subsystem displayed in the list (Subsystem, Simulink/Ports & Subsystem).

    missing image

    • Double-click the new block, and remove all blocks inside (CTRL-A and Del).

    • Go back to the top level by clicking on the Up-arrow.

    missing image

    • Right-click the Subsystem, and select Properties.

    • Click the Callbacks tab.

    • Select OpenFcn in the Callback function list.

    • Type open('CreateFilter.m'); in the edit window on the right.

    • Click Apply and OK.

    Now when you double-click this block, you will open the initialization matlab function (CreateFilter.m) in the MATLAB editor. Save the model CTRL+S, and assign the name VMC_DSPLib.

  5. Click the Library Browser icon.

    missing image

    In the list of libraries, you will find the AMD Toolbox. This contains four sub-libraries:

    • AI Engine

    • HDL

    • HLS

    • Utilities

    Click the AI Engine section. This reveals seven subsections:

    • DSP

    • Interfaces

    • Signal Routing

    • Sinks

    • Sources

    • Tools

    • User-Defined functions

  6. Click the DSP sub-section. There are two sub-menu entries:

    • Buffer IO: which contains filter implementations using frame-based input and output.

    • Stream IO : which contains filter implementations using streaming input and output.

  7. Click the Buffer IO sub-section and place the FIR Halfband Decimator block in the canvas as shown in the following figure.

    missing image

  8. Double-click the FIR Halfband Decimator block to open the GUI. Populate the GUI with the following parameters :

    • Input/output data type: cint16

    • Filter coefficients data type: int16

    • Filter coefficients: hb1_aie

    • Input Window size (Number of samples): 2048

    • Scale output down by 2: Shift1

    • Rounding mode: Floor

    Leave all other settings at their default values. Click Apply and OK.