A type-safe arbitrary precision arithmetic portability layer for HLS tools - Inria - Institut national de recherche en sciences et technologies du numérique Access content directly
Conference Papers Year : 2019

A type-safe arbitrary precision arithmetic portability layer for HLS tools


Recent studies have shown that High-Level Synthesis (HLS) is an efficient way to design operators for floating-point arithmetic, or for emerging alternative formats such as posits. However, HLS tools support different supersets of different subsets of the C language-for example, support for arbitrary-sized bit vectors may be provided through vendor-specific data-type libraries such as ac_int, ap_int, or int1 to int64, while others only support the standard C integer types. This is a problem when carefully tuning an operator's internal data-path, as there is no portable HLS standard for arbitrary width integers, and vendor libraries may introduce implicit casts and extensions that can hide subtle bugs. Each vendor also offers varying support for important operator-building primitives, such as platform-optimized leading-zero count. To address such problems, this work introduces Hint (hardware integer), a header-only compatibility layer offering a consistent and comprehensive interface to signed and unsigned arbitrary-sized integers. To avoid bugs Hint is strongly typed, requiring exact matching of expression widths and types-this type-checking is performed statically using the C++ template system, and adds no overhead at synthesis time. The current implementation wraps ac_int and ap_int with no performance or resource overhead when synthesized on Xilinx or Intel FPGAs. It also offers a Boost::multiprecision backend for fast simulation. Hint is open-source and extensible, and aims to provide an optimized superset of existing library primitives. This work is evaluated with arithmetic operators useful when implementing floating-point and posit operators (shifter, leading zero counter, fused shifter+sticky) deployed using two mainstream HLS tools (Xilinx VivadoHLS, and IntelHLS). A complete posit adder operator has also been written using Hint, showing no overhead when compared to the original operator written for Xilinx FPGAs.
Fichier principal
Vignette du fichier
hal_hint.pdf (502.92 Ko) Télécharger le fichier
Origin Files produced by the author(s)

Dates and versions

hal-02131798 , version 1 (17-05-2019)
hal-02131798 , version 2 (07-06-2019)



Luc Forget, Yohann Uguen, Florent de Dinechin, David Thomas. A type-safe arbitrary precision arithmetic portability layer for HLS tools. HEART 2019 - International Symposium on Highly Efficient Accelerators and Reconfigurable Technologies, Jun 2019, Nagasaki, Japan. pp.1-6, ⟨10.1145/3337801.3337809⟩. ⟨hal-02131798v2⟩
329 View
1221 Download



Gmail Mastodon Facebook X LinkedIn More