There are several different ways in which we can implement our design in programmable logic, e.g. RTL, HLS, SDSoC and SDAccel, and over the years I have looked at most of these for this blog or my Hackster projects.
One method of programmable logic development we have not looked at is Model Composer, which enables a model-based design flow.
If you are not familiar with Model Composer, it is used in conjunction with MathWorks Simulink and provides a library of blocks which are optimized for implementation in programmable logic. This library features support for a number of applications and functions, including computer vision, mage processing, math, linear algebra, and of course, logic functions.
Just like using the IP Integrator in Vivado, Simulink and Model Composer allow us to develop, simulate, and verify our algorithms in a graphical environment.
Once we are happy with the performance of the algorithm in Simulink / Model Composer, we can implement the algorithm in programmable logic. This implementation uses high-level synthesis with automatic insertion of high-level synthesis optimizations to obtain the desired performance.
To show just how easy it can be to get started with using Model Composer and Simulink, MathWorks recently released four videos outlining how Simulink and Model Composer can be used to create a image processing application that detects road signs on a Ultra96.
The four videos walk us through the complete project creation in just under 25 minutes:
Video One — Introduces us to the project, the toolchains used, and how to set up the project.
Video Two — Shows how we can create the algorithm and update simulate performance using live video. Before showing how we can generate the RTL for implementation using HLS.
Video Three — Demonstrates how the IP block created in the MATLAB Simulink environment, can be imported, and used in our Vivado design.
Video Four — Concludes the lab, outlining how the bit file can be generated and used.
Of course, the output from this video series is an IP block that has been implemented in a Ultra96. To create an application around it as shown in the Simulink Simulation video, we would need to be able to interface with both a camera and a display.
An example of this camera / display solution would be the implementation of the IP block with a MIPI camera input and DisplayPort output on the Ultra96 (see how to use DisplayPort here P1 and P2).
To help demonstrate such an example, I have just purchased a MIPI interface board for my Ultra96. This board supports a range of MIPI cameras, including R-PI cameras and also provides a DSI output. The board I purchased came with dual OV5640 cameras.
Using this board, we can configure and control the MIPI cameras using I2C located in either the processing system or the programmable logic, and capture the camera output using MIPI CSI-2 receivers in the PL.
Creating this example will take me a little time. However, for now we can see from the videos model composer provides a very easy flow which we can use to create and implement algorithms in our programmable logic design.
Keep an eye on my Hackster.io projects, the MIPI / DisplayPort example will be appearing soon!