Intel® High Level Synthesis Compiler Pro Edition: Best Practices Guide

ID 683152
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

9.1. Avoid Implicit Data Type Conversions

Compile your component code with the -W conversion compiler option, especially if your component uses floating point variables.

Using this option helps you avoid inadvertently having conversions between double-precision and single-precision values when double-precision variables are not needed. In FPGAs, using double-precision variables can negatively affect the data transfer rate, the latency, and resource utilization of your component.

Additionally, constants are treated as signed int or signed double. If you want efficient operations with narrower constants, cast constants to other, narrower data types like ac_int<> or float.

If you use the Algorithmic C (AC) arbitrary precision datatypes, pay attention to the type propagation rules.