- Open a Vitis Model Composer model, then open the Model Composer Hub block. This populates with all the available compilation targets.
- In the
MATLAB®
Command Window, modify the
path as per your requirements, then enter the following command:
xilinx.environment.addCompilationTarget('Impl', 'U:\demo')
This provides a template derived class for you to edit.
- In the MATLAB Command Window, enter the
following
command:
xilinx.environment.rehashCompilationTarget
This ensures that the new compilation target is picked up by the Model Composer Hub block.
- Close and then re-open the Model Composer Hub block. You now see the compilation target, Impl.
- At this point, selecting Impl does not perform any customized operations on the Model Composer Hub block. It is equivalent to an HDL Netlist compilation target.
- Open U:\demo\Impl\@Impl\Impl.m in the MATLAB Editor.
- Populate the
setup_sysgen_token()
function as per the requirements. Using this approach, you can control how the Model Composer Hub block should look, including the enabled/disabled fields when the user-defined custom compilation is selected.
- In the MATLAB Command Window,
you should enter the following command:
xilinx.environment.rehashCompilationTarget
This ensures that the updated class definition of Impl is used.
- Close and then re-open the Model Composer Hub block.
- Select Impl from the list of Compilation targets.
- The Model Composer Hub block displays:
- Observe that the Hardware description language field and the Implementation strategy field are fixed to what you set in the Impl class and are disabled for user modification.
- All the user specified files and additional Tcl commands to be run
are known before the
Vivado®
IDE project is
created. The next step is to populate the
pre_project_creation()
function as indicated below:
- In the MATLAB Command Window,
enter the following command:
xilinx.environment.rehashCompilationTarget
This ensures that the updated class definition of Impl is used.
- Close and then re-open the Model Composer Hub block.
- Select Impl from the list of Compilation targets.
- Click Generate. Once the process is finished, you can see the implementation results by opening up the Vivado IDE project.