Intel® High Level Synthesis Accelerator Functional Unit Design Example User Guide
A newer version of this document is available. Customers should click here to go to the newest version.
Visible to Intel only — GUID: pko1537525721288
Ixiasoft
Visible to Intel only — GUID: pko1537525721288
Ixiasoft
2.2. Compiling and Simulating the HLS Component with the i++ Command
- Initialize your current session so that you can run the Intel® HLS Compiler. In your terminal session, change directories to the hls directory in your Acceleration Stack installation directory.
For example:
$ cd /home/<username>/inteldevstack/intelFPGA_pro/hls
- Run the following command from the hls directory to set the environment variables for the i++ command in the current terminal session:
$ source init_hls.sh
The environment initialization script shows the environment variables that it sets. - Navigate to the HLS soruce code.
The HLS source code is in <design location>/hls_afu/hw/rtl/hls/.
- Build and emulate the design using x86 instructions run these commands:
$ make test-x86-64 $ ./test-x86-64
The test-x86-64 command gives you the following output:i++ src/hls_afu.cpp src/test.cpp --fp-relaxed -ghdl -march=x86-64 -o test-x86-64 +--------------------------------------------+ | Run ./test-x86-64 <n> to execute the test. | | <n> is 0, 1, or 2 depending on desired | | test behavior: | | <n> | effect | | ------+-------------------- | | 0 | test both (default) | | 1 | test ac_int only | | 2 | test float only | +--------------------------------------------+ Control which component gets tested by passing an integer! arg | effect ------+-------------------- 0 | test both (default) 1 | test ac_int only 2 | test float only test AC_INT version and FLOAT version AC_INT COMPONENT - 81 ELEMENTS ac_inc: sizeof(uint512) = 64 (64) number of 512 bit (64-byte) numbers: 6 PASS FLOATING-POINT COMPONENT - 81 ELEMENTS fp_inc: PASS OVERALL: PASSED
- Generate RTL and simulate generated RTL with the ModelSim simulator:
$ make test-fpga $ ./test-fpga
The test-fpga command gives you the following output:Control which component gets tested by passing an integer! arg | effect ------+-------------------- 0 | test both (default) 1 | test ac_int only 2 | test float only test AC_INT version and FLOAT version AC_INT COMPONENT - 81 ELEMENTS ac_inc: sizeof(uint512) = 64 (64) number of 512 bit (64-byte) numbers: 6 PASS FLOATING-POINT COMPONENT - 81 ELEMENTS fp_inc: PASS OVERALL: PASSED
- Confirm that the outputs from the test-x86-64 command and the test-fpga command match.
The test-x86-64 command runs C++ code on the processor, while the test-fpga command compiles the C++ source to to Verilog RTL and then simulates the generate RTL using the testbench defined in the code.
For instructions about how to view the waveforms for this component, see the Intel High Level Synthesis Compiler User Guide.