Intel® High Level Synthesis Compiler Pro Edition: Reference Manual

ID 683349
Date 12/19/2022
Public

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

Document Table of Contents

13.2. Intel® HLS Compiler Pro Edition Header Files

Coding your component to be compiled by the Intel® HLS Compiler requires you to include the hls.h header file. Other header files provided with the Intel® HLS Compiler provide FPGA-optimized implementations of certain C and C++ functions.

Table 37.   Intel® HLS Compiler Pro Edition Header Files Summary
HLS Header File Description
HLS/hls.h Required for component identification and component parameter interfaces.
HLS/math.h Includes FPGA-specific definitions for the math functions from the math.h for your operating system.
HLS/extendedmath.h Includes additional FPGA-specific definitions of math functions not in math.h.
HLS/ac_int.h Provides FPGA-optimized arbitrary width integer support.
HLS/ac_fixed.h

Provides FPGA-optimized arbitrary precision fixed point support.

HLS/ac_fixed_math.h

Provides FPGA-optimized arbitrary precision fixed point math functions.

HLS/ac_complex.h Provides FPGA-optimized complex number support.
HLS/hls_float.h Provides FPGA-optimized arbitrary-precision IEEE-754 compliant floating-point number support.
HLS/hls_float_math.h Provides FPGA-optimized floating-point math functions.
HLS/math_dsp_control.h Provides the ihc::math_dsp_control function to control the hardware implementation for supported data types and math functions at a local-scope.
HLS/stdio.h Provides printf support for components so that printf statements work in x86 emulations, but are disabled in component when compiling to an FPGA architecture.
<iostream> To use cout and cerr in your component, guard the statements with the HLS_SYNTHESIS macro.

hls.h Header File

Syntax
#include "HLS/hls.h"
Description
Required for component identification and component parameter interfaces.

math.h Header File

Syntax
#include "HLS/math.h"
Description
Includes FPGA-specific definitions for the math functions from the math.h for your operating system.

To learn more, review the following tutorial: <quartus_installdir>/hls/examples/tutorials/best_practices/single_vs_double_precision_math.

extendedmath.h Header File

Syntax
#include "HLS/extendedmath.h"
Description
Includes additional FPGA-specific definitions of math functions not in math.h.

To learn more, review the following design: <quartus_installdir>/hls/examples/QRD.

ac_int.h Header File

Syntax
#include "HLS/ac_int.h"
Description
Intel® HLS Compiler version of ac_int header file.

Provides FPGA-optimized arbitrary width integer support.

To learn more, review the following tutorials:
  • <quartus_installdir>/hls/examples/tutorials/ac_datatypes/ac_int_basic_ops
  • <quartus_installdir>/hls/examples/tutorials/ac_datatypes/ac_int_overflow
  • <quartus_installdir>/hls/examples/tutorials/best_practices/struct_interfaces

ac_fixed.h Header File

Syntax
#include "HLS/ac_fixed.h"
Description
Intel® HLS Compiler version of the ac_fixed header file.

Provides FPGA-optimized arbitrary precision fixed point support.

To learn more, review the following tutorial: <quartus_installdir>/hls/examples/tutorials/ac_datatypes/ac_fixed_constructor.

ac_fixed_math.h Header File

Syntax
#include "HLS/ac_fixed_math.h"
Description
Intel® HLS Compiler version of the ac_fixed_math header file.

Provides FPGA-optimized arbitrary precision fixed point math functions.

To learn more, review the following tutorial: <quartus_installdir>/hls/examples/tutorials/ac_datatypes/ac_fixed_math_library.

ac_complex.h Header File

Syntax
#include "HLS/ac_complex.h"
Description
Intel® HLS Compiler version of the ac_comple header file.

Provides FPGA-optimized complex math functions.

hls_float.h Header File

Syntax
#include "HLS/hls_float.h"
Description
Header file to provide FPGA-optimized arbitrary-precision IEEE 754 compliant floating-point number support.
To learn more, review the following tutorials:
  • <quartus_installdir>/hls/examples/tutorials/hls_float/1_reduced_doubl
  • <quartus_installdir>/hls/examples/tutorials/hls_float/2_explicit_arithmetic
  • <quartus_installdir>/hls/examples/tutorials/hls_float/3_conversions

hls_float_math.h Header File

Syntax
#include "HLS/hls_float_math.h"
Description
Header file to provide math functions for hls_float data types.
To learn more, review the following tutorials:
  • <quartus_installdir>/hls/examples/tutorials/hls_float/1_reduced_doubl
  • <quartus_installdir>/hls/examples/tutorials/hls_float/2_explicit_arithmetic
  • <quartus_installdir>/hls/examples/tutorials/hls_float/3_conversions

math_dsp_control.h Header File

Syntax
#include "HLS/math_dsp_control.h"
Description
Header file to provide the ihc::math_dsp_control function to control the hardware implementation for supported data types and math functions at a local-scope.

For control at a global-scope, use the --dsp-mode option of the i++ command.

To learn more, review the following tutorial: <quartus_installdir>/hls/examples/tutorials/best_practices/control_of_dsp_usage

stdio.h Header File

Syntax
#include "HLS/stdio.h"
Description
Provides printf support for components so that printf statements work in x86 emulations, but are disabled in component when compiling to an FPGA architecture.

Standard C++ <iostream> Header File

Syntax
#include <iostream>
Description
To use the C++ standard output streams (cout and cerr) provided by the standard <iostream> header, you must guard any standard output statements with the HLS_SYNTHESIS macro.

This macro ensures that statements in a component work in x86 emulations but are disabled in the component when compiling to an FPGA architecture.