The laboratory project needs to configure the network parameters that ran out of the server section to the FPGA. One method is to directly use verilog or vhdl to write a forward propagation model of the network, and the other is to use C/C++ to describe The forward propagation model of the network is then converted into a hardware description language-verilog or vhdl using Vivado's HLS. The first method has high resource utilization, but it needs to consider timing and parallelism (two important factors in hardware language design), which is more difficult; the second method is relatively efficient and a little easier; as a novice, in line with For the idea of running through the process, I chose the second method as the first attempt. I learned it through the video class of teacher Gao Yajun, and attached the link:
Let’s talk about the difference between CPU, GPU, DSP, and FPGA first:
For a software engineer, what should be mastered:
To sum it up, just one sentence"How can we make the HDL code converted into C/C++ run efficiently?”
CAD-CAE-EDA
- Computer Aided Design
- Computer Aided Engineering
- Electronic Design Automation
At this stage of EDA, the most typical feature is the emergence of hardware description languages-VHDL and Verilog;
Up to now, the concept of ESL (Electronic System Level Design Method) has emerged. Its essence is to say that at this stage of ESL we hope to use a higher degree of abstraction to describe system behavior, so there are two notable aspects at this stage feature:
After the algorithm description is completed, a corresponding text is needed to test our algorithm,

Let's look at some examples of these processes:
The example of Scheduling and Binding Example is as follows, the following example is relatively simple, so there is only one state C0;

Extend to the logic extraction example, there are four states, in the C0 state execute b+c, the C1 state generates x and the address of the array, the C2 state executes the corresponding multiplication operation, and the C3 state The result is written into the corresponding bit of the y array, and the loop is repeated several times until it reaches the loop boundary and exits the loop. It should be noted that the generated control state (bottom left) and the state machine (bottom right) are not in a one-to-one correspondence, but they are very close.






Two ways of Directives:
Store each directive separately as a Tcl command in directives.tcl format, with "#" as the mark;
The advantage is: each solution has independent directives. If the solution needs to be re-synthesized, then only the directives under this solution will play a role; the disadvantage is: if the C source code If the file needs to be given to a third party, then the directives.tcl needs to be included. For a code that needs to obtain the same comprehensive result, then the same directives.tcl is essential.
Embed each directive into the C/C++ source code and appear in pragma format, with "%" as the mark;
The advantage of is: if the C source code file needs to be given to a third party, there is no need to deliver the directives.tcl separately, and the same comprehensive result is required for a code, and no additional directives are needed. .tcl; The disadvantage is: if a solution needs to be re-synthesized, then all directives must be executed.
A few tips:
Common types of interfaces in Vivado HLS are: 1. ap_none The default type, which does not apply to any I/O conversion protocol, is used to represent a read-only input signal that corresponds to the wi...
Windows vivado high level synthesis (HLS) to configure a custom text editor cases vscode Recently started using hls, vivado hls own editor experience is very bad, so would like to replace vscode, but ...
Foreword: This example comes from the official Xilinx HLS Manual - (UG871), shows how to create a TCL script-based command Vivado HLS project already exists and how to use TCL Interface (existing proj...
What is hls Vivado HLS——oneOne is to use advanced language to describe system behavior, that is, C/C ++ is used to achieve system modeling.Software engineers can use this to improve system...
Optimization of VIVADO HLS function level references Project Overview type of data Implement inline operations on functions Allocation operation of function Function dataflow operation to sum up refer...
For Vivado Hls, the input includes Tesbench, C/C++ source code and Directives, and the corresponding output is IP Catalog, DSP and SysGen. In particular, a project can only have one top-level funct...
Explanation of common time terms in high-level synthesis (HLS) references Project Overview HLS working principle High-level integration (HLS) indicators to sum up references [1], Xiaoyu FPGA (WeChat p...
HLS advanced synthesis can achieve hardware acceleration of software code, mainly because it optimizes the parallelism of the loop body (for, while) in the code, and uses pipelining, expansion, mergin...
Vivado HLS 4: Basic Concept Thanks to FPGA's public account, providing a lot of entry knowledge! This article references themselves: Basic concept of HLS: 1, HLS supports C, C ++ and Systemc as...
Vivado HLS 3: Basic Concept reference: Directory: 1. Concept of LUT, LATCH, FF in FPGA 2, LUT, LATCH, FF 's interrelationship 3, Verilog statement corresponds to the correspondence between LUT, LATCH,...