Intel® High Level Synthesis Compiler Standard Edition: Reference Manual

ID 683310
Date 12/18/2019
Public
Document Table of Contents

8. Arbitrary Precision Math Support

The Intel® HLS Compiler supports a range of FPGA-optimized arbitrary-precision data types that are defined in header files that you can include in your designs.

Some of these header files are based on the Algorithmic C (AC) data types that Mentor Graphics* provides under the Apache license. For more information about the Algorithmic C data types, refer to Mentor Graphics Algorithmic C (AC) Datatypes, which is available as a part of your Intel® HLS Compiler installation: <quartus_installdir>/hls/include/ref/ac_datatypes_ref.pdf.

The Intel® HLS Compiler also supports arbitrary-precision IEEE 754 compliant floating point data types that is not based on the AC data types.

The Intel® HLS Compiler supports the following arbitrary precision data types:
Table 16.  Arbitrary Precision Data Types Supported by the Intel® HLS Compiler Standard Edition
Data Type Intel Header File Description
ac_int HLS/ac_int.h 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 HLS/ac_fixed.h Arbitrary-precision fixed-point number support

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

HLS/ac_fixed_math.h Support for some nonstandard math functions for arbitrary-precision fixed-point data types

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

The Intel® HLS Compiler also supports some nonstandard math functions for the following data types when you include an additional header file:
  • ac_fixed data type

    Include the HLS/ac_fixed_math.h header file

Advantages of Arbitrary Precision Data Types

The arbitrary precision data types have the following advantages over using standard C/C++ data types in your components:

  • You can achieve narrower data paths and processing elements for various operations in the circuit.
  • The data types ensure that all operations are carried out in a size guaranteed not to lose any data. However, you can still lose data if you store data into a location where the data type is too narrow.

Limitations of AC Data Types

The AC data types have the following limitations:

  • Multipliers are limited to generating 512-bit results.
  • Dividers are limited to consuming a maximum of 64 bits.
  • The FPGA-optimized header files provided by the Intel® HLS Compiler are not compatible with GCC or MSVC. When you use the Intel® HLS Compiler header files, you cannot use GCC or MSVC to compile your testbench. Both your component and testbench must be compiled with the Intel® HLS Compiler.

    To compile AC data types with GCC or MSVC, use the reference AC data types headers also provided with he Intel® HLS Compiler. For details, see AC Data Types and Native Compilers.