We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Showing results for 
Search instead for 
Did you mean: 

Adam Taylor’s MicroZed Chronicles Part 146: Cracking Open HLS, Part 3

Xilinx Employee
Xilinx Employee
0 0 44.3K


By Adam Taylor



So far we have examined the basics of Vivado HLS (high-level synthesis) and how we can define the interface we want on the resultant IP module. But what about the functionality we desire within the module itself? With a traditional HDL design, we could design it all ourselves from scratch. However, when we develop traditional HDL designs we normally use IP blocks where possible and create new modules only when they add value. When it comes to using HLS we need to follow a similar approach, as opposed to writing everything from scratch.





The IP Module we will create over the next few blogs



Vivado HLS provides several libraries that allow us to use canned functions to implement the more commonplace aspects of a design and to develop new code only when we can add value. What differs from HDL development is that Vivado HLS gives us the benefits of working with a higher abstraction level so that we can develop new code more efficiently, more cost effectively, and far more quickly.


We get six standard libraries with our HLS installation. These libraries provide a range of functions:


  • Math Library – Provides synthesisable implementations of the standard math libraries.
  • Video Library – Provides video-processing libraries similar to OpenCV.
  • IP Library – Provides IP libraries for implementing FFT, FIR, and Shift Register LUT functions.
  • Linear Algebra Library – Provides a library of commonly used Linear Algebra functions.
  • Stream Library – Provides structures for modelling streaming data interfaces.
  • Arbitrary Precision Data Types Library – Provides support for non-power-of-2, arbitrary length data using signed and unsigned integers. This library allows us to use the FPGA’s resources more efficiently.


We are now going to explore the Video Library in depth. The Vivado HLS Video Library includes a range of functions including the equivalent of an OpenCV library to help us test and implement embedded-vision systems. The Vivado HLS Video Library provides similar functions to those provided by OpenCV but it’s not possible to perform HLS synthesis directly on OpenCV libraries because they are not optimized for FPGA implementation due to their use of dynamic memory allocation. This Video Library will allow us to accelerate development of an image-processing pipeline.


We’ll be using the Avnet Embedded Vision Kit to demonstrate the functionality of the IP blocks in programmable logic. The HLS environment provides two libraries we can use to develop our embedded-vision application:


  • hls_video – This library provides embedded-vision functions and data structures. These elements can be synthesized.
  • hls_opencv – This library includes pre-compiled OpenCV functions along with special support functions required to interface with the IP module. This library is intended for use by a test bench and as such is not synthesizable.


We can develop at a high level using our HLS environment, initially using the hls_opencv library to prototype the algorithm. This allows us to quickly and easily create the system model of the algorithm within our HLS environment and verify that results meet requirements. 


Over the next few blogs we are going to look more into these video libraries and create a simple image processing module we can implement.



Code is available on Github as always.


If you want E book or hardback versions of previous MicroZed chronicle blogs, you can get them below.




  • First Year E Book here
  • First Year Hardback here.



 MicroZed Chronicles hardcopy.jpg




  • Second Year E Book here
  • Second Year Hardback here




 MicroZed Chronicles Second Year.jpg




All of Adam Taylor’s MicroZed Chronicles are cataloged here.