Section_1HLS_Overview_Powerpoint
Section_1HLS_Overview_Powerpoint
Course Prepared by
Digitronix Nepal
www.digitronixnepal.com
➢HLS: ………………
………………
VHDL
• Creating project on modules, integrating Verilog
System C
the library files (header files)
• Enables design optimization for resources
utilization and latency of the project. RTL Export
IP-XACT Sys Gen PCore
Video Processing
Masterclass with FPGA
VIVADO HLS Tool Overview:
• HLS is developed for implementing complex signal processing and
mathematical implementation on FPGA, while this implementation is
quite complex on HDL.
• HLS converts the C/C++ source in to HDL source , i.e
VHDL/Verilog/SystemC
• There are many libraries and functions for signal processing and math
computation on HLS.
Information
Auxiliary Pane
Pane
Project
Explorer
Pane
Console
Pane
12- 9
Video Processing Masterclass with FPGA
Vivado HLS Projects and Solutions
• Vivado HLS is project based
• A project specifies the C/C++/OpenCL code which will be synthesized
• Each project is based on one set of source code or main module and
project can have user defined name Source
Vivado HLS
………………
………………
VHDL
Verilog
System C
RTL Export
IP-XACT Sys Gen PCore
Reference: Xilinx
Video Processing Masterclass with FPGA
The Key Attributes of C code
Functions: functions in the source code represent the design hierarchy: the same
void fir ( in hardware
data_t *y,
coef_t c[4],
data_t x Top Level IO : The arguments of the top-level function of source code determine
){ the hardware RTL (VHDL/Verilog) interface ports of input, output or in/out.
static data_t shift_reg[4];
acc_t acc; Data-Types: All variables are of a defined type. Different types of datatype can influence
int i; the area and performance. As some data type are 8 bit some are 16 bit or more.
acc=0;
loop: for (i=3;i>=0;i--) { Loops: Functions on the source model may contain loops. Handling of loops can have a
if (i==0) {
acc+=x*c[0]; major impact on area and performance as loops take large number of LUT and FF..
shift_reg[0]=x;
} else {
shift_reg[i]=shift_reg[i-1]; Arrays: Arrays on source code or module can influence the device IO and become
acc+=shift_reg[i] * c[i];
}
performance bottlenecks. Array must be defined the specific size, undefined array
} wont support on HLS.
*y=acc;
}
Operators: Operators in the source code or module may require sharing to control
area or specific hardware implementations to meet performance. Operations
consume LUT, so the use of operator for operation also play role on resource
consumption and performance standards.
The resource or control sharing can be planned as well as pipelined on HLS.
Reference: Xilinx
Video Processing Masterclass with FPGA
Functions & RTL Hierarchy
• Each function is translated into an RTL block
• Verilog module, VHDL entity
Source Code RTL hierarchy
void A() { ..body A..}
void B() { ..body B..} foo_top
void C() { C
B(); B
} A
void D() {
B();
} D
B
void foo_top() {
A(…);
C(…);
D(…)
} my_code.c
+
b
a[N]
• Loops can be unrolled if their indices are statically determinable at elaboration time
• Not when the number of iterations is variable
• Unrolled loops result in more elements to schedule but greater operator mobility
• Let’s look at an example …. Reference: Xilinx
Video Processing Masterclass with FPGA
Arrays in HLS
• An array in C code is implemented by a memory in the RTL
• By default, arrays are implemented as RAMs, optionally a FIFO
foo_top
N-1 SPRAMB
void foo_top(int x, …) A[N]
{ N-2 A_in DIN DOUT A_out
int A[N];
L1: for (i = 0; i < N; i++) … Synthesis ADDR
A[i+x] = A[i] + i;
1 CE
}
0 WE
+
}
CE0
WE0
Name Description