1. Introduction
The Intel® HLS (High Level Synthesis) compiler is a command line tool (CUI), which can be difficult for users unfamiliar with command line based work.
This content introduces the Intel® HLS compiler for Linux and how it can be used from coding to compilation in the Eclipse GUI.
Environment used for verification
- Intel® HLS Compiler ver. 19.3
- Intel® Quartus® Prime Development Software Pro Edition ver. 19.3
- Linux distribution: Red Hat Enterprise Linux workstation release 6.10 (Santiago)
- Eclipse version: Mars.2 Release (4.5.2)
2. preliminary preparation
The method described here uses the Eclipse environment used for Nios® II SBT.
If you have already set up the Nios® II SBT environment, no additional work is required.
If you have not yet set up the Nios® II SBT environment, please refer to the following contents to install Eclipse, although this article is for the Windows version.
- Installation instructions for using Nios® II SBT / SoC EDS with Quartus® Prime Pro ver 19.1
- Installation instructions for using Nios® II Software Build Tools / SoC Embedded Development Suite with Quartus® Prime Pro Edition 19.1
3. execution in Eclipse
3-1. initial settings before starting GUI
First, run the script provided to set environment variables for running HLS.
$ source <TOOL INSTALL FOLDER>/hls/init_hls.sh
This will enable the i++ command.
3-2. launching the gui
Next, start Eclipse.
Execute nios2 command shell as follows and then eclipse-nios2.
$ eclipse-nios2 &
Eclipse will start, and a GUI for specifying a workspace will be displayed.
Then Eclipse will be launched. 3-3.
3-3. creating a project
Import the base project.
File menu → Import... → General → Existing Projects into Work → General → Existing Projects into Workspace.
As an example, we will use the sample provided when the tool is installed.
<TOOL INSTALL FOLDER>\hls\examples\counter
Select the above directory in "Browse" and check "Copy projects workspace" to copy this sample under workspace.
The project is now imported into Eclipse as shown below.
3-4. editing source code
Double-click the code to be edited in the Project Explorer on the left to open the editor.
You can edit the source code there.
3-5. compile the project
In the sample makefile, there are targets for emulation of software execution and co-simulation of hardware execution. By selecting these targets, the respective compilations are executed.
Right-click on the project and click Make Targets → Build.
You will then be prompted to select a target.
The targets shown here are those listed in the Makefile, and in this sample they are as follows.
- test-x86-64: Emulation
- test-fpga: Co-simulation
Emulation is to check the functionality without actually generating HDL IP, while co-simulation is to execute the generated HDL IP and check the performance aspect.
In this example, we will run co-simulation.
Select test-fpga and click Build to execute the co-simulation flow, and when it finishes, an executable file (test-fpga) and reports, component files, etc. are generated under test-fpga.prj as shown below.
Thus, the HLS compiler can now be used with Eclipse.
If you want to change the options added to i++ for execution, you can change the Makefile or add a target to the Makefile.
Executing the generated component
When executing the executable file generated earlier, you can confirm that the results are output as shown below. 5.
5. other reference materials