High-Level Synthesis
Xilinx Vivado HLS
Hao Zheng Comp Sci & Eng University of South Florida
1
High-Level Synthesis Xilinx Vivado HLS Hao Zheng Comp Sci & - - PowerPoint PPT Presentation
High-Level Synthesis Xilinx Vivado HLS Hao Zheng Comp Sci & Eng University of South Florida 1 Reading The Zynq Book , chapter 14, 15 Vivado Design Suite Tutorial: High-Level Synthesis 2 Overview 3 4 5 6 Implementation
1
2
3
4
5
6
7
8
9
10
11
Operators Control flows Scalars Arrays Memories Wires or registers Control logics Functional units Functions Modules Arguments Input/output ports à à à à à à HW Components C Constructs
➜Function inlining eliminates hierarchy
➜ Used to develop C-testbench
12
void C() { .. body C .. } void B() { C(); } void TOP( ) { A(…); B(…); }
TOP A B C Source code RTL hierarchy
➜Interface follows certain protocol to synchronize data
13
in1 in2
Datapath
FSM
in1_vld in2_vld
void TOP(int* in1, int* in2, int* out1) { *out1 = *in1 + *in2; }
➜Timing constraints influence the degree of registering
14
int P; P = (A+B)*C+D
A B C D P
➜Read & write array -> RAM; Constant array -> ROM ➜ An array can be partitioned and map to multiple RAMs ➜ Multiples arrays can be merged and map to one RAM ➜ An array can be partitioned into individual elements and
15
{ int A[N]; for (i = 0; i < N; i++) A[i+x] = A[i] + i; } N-1 N-2 … 1
TOP
DOUT DIN ADDR CE WE
RAM
A[N] A_out
A_in
➜Each loop iteration corresponds to a “sequence” of
➜This state sequence will be repeated multiple times
16
... for (i = 0; i < N; i++) b += a[i]; }
TOP S1 a[i] b
+
LD S2
➜Pros
➜Decrease loop overhead ➜Increase parallelism for scheduling ➜Facilitate constant propagation and
➜Cons – increase operation count,
17
A[i] = C[i] + D[i]; A[0] = C[0] + D[0]; A[1] = C[1] + D[1]; A[2] = C[2] + D[2]; .....
➜ Loop pipelining is one of the most important
➜ Allows a new iteration to begin processing before the previous
➜ Key metric: Initiation Interval (II) in # cycles
18
p[i] = x[i] * y[i];
II = 1
ld ld ld
st st ld – Load st – Store ld ld
×
st x[i] y[i]
p[i]
i=0 i=1 i=2 cycles ld st i=3
19
20
21
22
23
24
25
26