Intel® High Level Synthesis Compiler Pro Edition: Reference Manual

ID 683349
Date 10/02/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

2.3.1. Compiling Your Testbench and Component Separately

In some cases, you might want to decouple your testbench development from your component development. For example, you might want to change your testbench code without recompiling your HLS component.

You can compile your testbench and component separately in one of the following ways:
  • Compile your testbench with the Intel® HLS Compiler and then compile your component code with the Intel® HLS Compiler.
  • Compile your testbench with GCC or Microsoft Visual Studio, and then compile your component code with the Intel® HLS Compiler.
In either case, the build flow is similar:
  1. Use the i++ -c command to compile your component code to an object file.

    For example, i++ -c component.cpp -o component.o -march=<target_platform>

  2. Use any compiler supported by the Intel® HLS Compiler to compile your testbench to an object file (or files):
    • Intel® HLS Compiler: i++ -c
    • GCC: g++ -c
    • MSVC: cl /c

    For example, g++ -c testbench.cpp -o testbench.o

  3. Link the component and testbench object files with the i++.

    For example, i++ testbench.o component.o -o prog -march=<target_platform> .

For an example of compiling your testbench and component separately, review the following tutorial:
<quartus_installdir>/hls/examples/tutorials/usability/compiler_interoperability