Vivado HLS Update
Vivado HLS Update
C, C++ or SystemC
Vivado
IP Catalog
.
Page 2 © Copyright 2013 Xilinx
.
Vivado HLS Video Libraries
C Video Libraries
– Available within Vivado HLS header files
• hls_video.h library
• hls_opencv.h library
.
Page 3 © Copyright 2013 Xilinx
.
Video Library: 12 New Functions
Video Functions
AbsDiff Duplicate MaxS Remap
AddS EqualizeHist Mean Resize
AddWeighted Erode Merge Scale
And FASTX Min Set
Avg Filter2D MinMaxLoc Sobel
AvgSdv GaussianBlur MinS Split
Cmp Harris Mul SubRS
CmpS HoughLines2 Not SubS
CornerHarris Integral PaintMask Sum
CvtColor InitUndistortRectifyMap Range Threshold
Dilate Max Reduce Zero
.
Page 4 © Copyright 2013 Xilinx
.
C Test Bench: Interface Library
Standard OpenCV
#include "hls_opencv.h" files, formats & types
//Top Level C Function
int main (int argc, char** argv) { HLS Video Libraries
IplImage* src = cvLoadImage(INPUT_IMAGE);
IplImage* dst = cvCreateImage(cvGetSize(src), src->depth, src->nChannels);
.
Page 5 © Copyright 2013 Xilinx
.
C Function to Synthesize
#include "hls_video.h"
#include "ap_axi_sdata.h";
HLS Video & AXI Struct Libraries
//Top Level C Function for Synthesis
void image_filter(AXI_STREAM& inter_pix, AXI_STREAM& out_pix, int rows, int cols) {
//Create AXI streaming interfaces for the core
.
Page 6 © Copyright 2013 Xilinx
.
Application Note XAPP1167
Accelerating OpenCV Applications with Zynq using
Vivado HLS Video Libraries
Zynq PS
High Throughput Access to HLS Accelerator
Memory HP Port AXI
AXI4 Stream
– AXI4-Stream using AXI-DMA DMA
ACP Port
– AXI4-Master
• The Accelerator is the master Zynq PS
HLS Accelerator
External Memory Access : HP
HP Port
L2 Cache Access: ACP AXI4 Master
ACP Port
Data transfer between HLS
IP blocks
– AXI4-Stream
Add to IP Catalog
Vivado HLS IP Vivado IP Integrator (IPI)
Export to Vivado
IP Catalog
Add IP block
& connect up
.
Page 10 © Copyright 2013 Xilinx
.
Improved Software Driver Support
.
Page 11 © Copyright 2013 Xilinx
.
Enhanced Report File
Top-Level function
Latency and Interval
.
Page 12 © Copyright 2013 Xilinx
.
Analysis Perspective
Module Hierarchy
Hierarchical Summary
and Navigation
Performance View
Scheduled operations.
.
Page 13 © Copyright 2013 Xilinx
.
Performance View
Hierarchical Navigation
Loop Hierarchy
.
Page 14 © Copyright 2013 Xilinx
.
Resource Analysis
Resource View
Scheduled operations
associated with resource:
anything on the same row
shares the same resource
Resource Profile
Resource summary for this
block
.
Page 15 © Copyright 2013 Xilinx
.
Analysis Perspective Tutorials
.
Page 16 © Copyright 2013 Xilinx
.
Assertion Support
* Loop Latency:
+----------+-----------+----------+ Loop Latency:
|Target II |Trip Count |Pipelined | +----------+-----------+----------+
|Target II |Trip Count |Pipelined | Index counter
+----------+-----------+----------+
|- SUM_X |1 ~ 256 |no | +----------+-----------+----------+ hardware is
|- SUM_Y |1 ~ 256 |no | |- SUM_X |1 ~ 32 |no | accurately
|- SUM_Y |1 ~ 16 |no |
+----------+-----------+----------+
+----------+-----------+----------+
sized
.
Page 17 © Copyright 2013 Xilinx
.
Improved Tutorials
.
Page 18 © Copyright 2013 Xilinx
.
Improved AXI4 & SystemC Support
SystemC
– AXI4 Master, Streams and Lite protocols now supported
• Lite: Use the RESOURCE directive to assign ports (as C/C++)
• Stream: Use the RESOUCE directive on sc_fifo_in and sc_fifo_out ports
• Master: Use the AXI4M_bus_port class
.
Page 19 © Copyright 2013 Xilinx
.
RTL cosimulation of Floating Point Designs
Floating Point Designs
– The IEEE operators are now in the RTL simulation model
– This requires the Xilinx IEEE library is used when RTL-cosimulation is
performed
.
Page 20 © Copyright 2013 Xilinx
.
DSP48 Adder Resource
Resource Specification
– Targets the adder or subtractor to a DSP48 Resource
(* USE_DSP48 = "YES" *)
module adders_add_32ns_32ns_32_1_AddSub_DSP_0 (a, b, s);
endmodule
module adders_add_32ns_32ns_32_1( …)
adders_add_32ns_32ns_32_1_AddSub_DSP_0 U1 (
.a( din0 ),
.b( din1 ),
.s( dout ));
endmodule
.
Page 21 © Copyright 2013 Xilinx
.
DSP48 Adder Implementation
.
Page 22 © Copyright 2013 Xilinx
.
FFT and FIR IP in HLS
High-Quality Implementation
– Same hardware as implemented by RTL versions of this IP
– Functionality fully described in Xilinx Documentation
• LogiCORE IP Fast Fourier Transform v9.0 (document PG109)
• LogiCORE IP FIR Compiler v7.1 (document PG149)
.
Page 23 © Copyright 2013 Xilinx
.
IP Examples
Examples IP Designs
1024-point FFT and Inverse FFT (fixed point)
Single FFT 1024-point (fixed point)
.
Page 24 © Copyright 2013 Xilinx
.
FFT Function
.
Page 25 © Copyright 2013 Xilinx
.
FIR Function
.
Page 26 © Copyright 2013 Xilinx
.
Using the FFT and FIR IP
Recommendation
– Use these IP in regions where dataflow optimization is used
– This will auto-convert the input and output arrays into streaming
arrays
Alternatively, a Requirement:
– The input and output arrays must be marked as streaming using the
command set_directive_stream (pragma STREAM)
.
Page 27 © Copyright 2013 Xilinx
.
Fixed Point Math Functions
.
Page 28 © Copyright 2013 Xilinx
.
AXI4 Stream Interface: Ease of Use
.
Page 29 © Copyright 2013 Xilinx
.
Pre-2013.3 Approach to AXI Streams
#if 1
// Use New Method
#pragma HLS interface axis port=portA
Warning:
– If you use the method for adding AXI4 Streams before 2013.3
• This is were you set the interface as a FIFO then add an AXI Resource
– You will get a FIFO interface in the RTL
– And the AXI4 Stream adapter is added during export_design
Recommendation
– Change existing AXI4 Stream directives to use the INTERFACE
directive
.
Page 30 © Copyright 2013 Xilinx
.
AXI4 Master Interface: Pipeline Support
Transaction involving an AXI4 Master Interface is now Pipelined
– Prior to 2013.3 this interface would not pipeline
– Each transfer was an “atomic” process
• The for-loop/memcpy waits until a transfer completes before starting next transfer
• This was the limiting factor in the pipeline interval
.
Page 31 © Copyright 2013 Xilinx
.
Enhanced Support for Exporting IP
.
Page 33 © Copyright 2013 Xilinx
.
Design Hubs: Easier Access to Documentation
.
Page 34 © Copyright 2013 Xilinx
.
Thank You
.
Page 35 © Copyright 2013 Xilinx
.