OpenCL Kernel Optimization via Manual Verilog Replacement
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing high-level synthesis tools for OpenCL on FPGA platforms generate inefficient Verilog code with redundancy and poor resource utilization, limiting the potential performance and efficiency of FPGA hardware.
Innovation Solution
Manual optimization of Verilog code for specific kernels, analyzing and modifying auto-generated code to improve performance and resource utilization, while maintaining compatibility with the OpenCL environment, by parsing compilation flows and interfaces, and inserting optimized code after the high-level synthesis step.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of manufacture
If high-level synthesis tool is used to automatically convert OpenCL code to Verilog, then development time is reduced and ease of programming is improved, but resource utilization deteriorates and execution efficiency decreases
Solution Approach 1:
The patent segments the Verilog code into two parts: auto-generated interface code (kept as-is) and manually optimized kernel code (replaced). This allows selective optimization of only the computationally intensive kernel portion while preserving the automatically generated interface structures, thereby improving execution efficiency without requiring complete manual rewriting.
Solution Approach 2:
The patent applies local quality by manually optimizing only the specific kernel code portion that requires performance improvement, while leaving the interface code auto-generated by the high-level synthesis tool. This targeted approach improves resource utilization and execution efficiency in critical areas without compromising the overall integration.
2Productivity
If more FPGA resources are allocated to improve performance, then execution efficiency is improved, but working frequency decreases due to increased complexity
Solution Approach 1:
The patent changes the implementation parameters of the kernel by manually optimizing the Verilog code to use more FPGA resources (such as DSP blocks, memory resources, and logic elements). This parameter change allows the design to achieve higher execution efficiency through better resource utilization, while the manual optimization ensures that the critical path is carefully managed to maintain acceptable working frequencies.
3Productivity
If manual optimization of Verilog code is performed, then resource utilization and execution efficiency are improved, but development complexity increases
Solution Approach 1:
The patent segments the optimization workload by clearly separating the auto-generated interface code from the manually optimized kernel code. This segmentation reduces development complexity by limiting manual intervention to only the necessary kernel portion, while the interface code remains automatically generated and requires no manual optimization.
Solution Approach 2:
The patent performs preliminary action by using the high-level synthesis tool to generate the initial Verilog code and interface structures before manual optimization. This preliminary auto-generation provides a solid foundation that reduces the amount of manual work required, as the optimizer only needs to focus on enhancing the kernel code rather than creating everything from scratch.
Data Source
AI summary
A method for improving OpenCL hardware execution efficiency described in this invention comprises the following steps: compiling a kernel implemented in OpenCL, generating Verilog code with a high-level synthesis tool; analyzing the interfaces of auto-generated Verilog code, recording signals, timing sequence, and function of the interfaces; manually modifying and optimizing the Verilog code; inserting a file replacement command in the script responsible for flow control, replacing the auto-generated code with the optimized Verilog code; rerunning OpenCL compiler and generating an ultimate FPGA configuration file. The invention makes manual optimization of the auto-generated Verilog code becomes possible, by parsing the compilation flow of OpenCL environment and analyzing the structure and interfaces of the auto-generated Verilog code. It promotes the performance of kernels, by increasing working frequency, achieving more parallelism and taking full advantages of FPGA hardware resources, and improves the execution efficiency of OpenCL on FPGA platform significantly.

