# IDFix: Infrastructure for the Design of Fixed-point systems

IDFix or **Infrastructure for the Design of Fixed-point systems** is a source to source tool which convert a C source code specified with floating data type to a C/C++ source code specified with fixed-point data type based on a analytical approach. IDFix was developed by the Cairn team at INRIA and IRISA, first as part of a joint collaboration with STMicroelectronics, and then with support from INRIA and ANR funding agency.

IDFix is developed in theGeCoS (Generic Compiler Suite) framework, an open source compiler infrastructure developed by the Cairn team.

# Why IDFix

Efficient implementation of digital signal processing (DSP) applications in embedded systems requires the use of **fixed point arithmetic**. Thus, DSP applications are designed and simulated using **floating-point data types** but they are finally implemented using **fixed-point arithmetic**. The fixed-point conversion process has been identified as one of **the most difficult** aspect of implementing a signal proccessing algorithm in an embedded platform. In finite precision arithmetic, signal quantization leads to unavoidable errors which degrade the final computation quality. Thus, the design of a fixed-point system is a trade-off between the computation quality and the implementation cost. Tools to automate this phase and to explore the design space are required.

The objective of IDFix tool is therefore to **determine automatically** the correct fixed-point specification which minimizes the implementation cost for a given computation quality (i.e. a maximal degradation of the approximation due to reduced precision). This tool is developed in the context of source-to-source transformation for high-level synthesis. Commercial tools (like Catapult or Vivado) can be used to synthesize the architecture to the RT-Level from a fixed-point description of the application using C/C++. Thus, the goal is to **bridge the gap** between the floating-point description developed by the algorithm designers and the fixed-point description used as input for high-level synthesis tools.

# How IDFix works

IDFix uses an analytical approach to realize the floating-point to fixed-point conversion. The user **provides some information** to IDFix. Obviously, the first is the C source code using floating-point data types. The C source code needs to be expanded **with some #pragma**. Some pragmas are necessary while others are optional. In the previous exemple, *MAIN_FUNC*, *OUTPUT* and *DYNAMIC* are mandatory pragmas. *WIDTH* and *DELAY* are optional.

The second information the user needs to provide is the main feature of the targeting hardware. In our case, it is **an architecture model** which describes available operators on the hardware platform. The last information is **the accuracy loss** (or accuracy constraint) allowed by the user. During this transformation, the word-length for the integer part and the fractional part are determined.

# References

- Daniel Menard and Olivier Sentieys. Automatic Evaluation of the Accuracy of Fixed-point Algorithms. In IEEE/ACM Design, Automation and Test in Europe (DATE), pages 529 – 535, Paris, March 2002
- D. Menard, R. Rocher, and O. Sentieys, “Analytical Fixed-Point Accuracy Evaluation in Linear Time-Invariant Systems,” IEEE Transactions on Circuits and Systems I. Part I, Regular Papers, vol. 55, iss. 10, pp. 3197-3208, 2008
- R. Rocher, D. Ménard, O. Sentieys, and P. Scalart, “Analytical Approach for Numerical Accuracy Estimation of Fixed-Point Systems Based on Smooth Operations,” IEEE Transactions on Circuits and Systems. Part I, Regular Papers, vol. 59, iss. 10, pp. 2326-2339, 2012
- K. N. Parashar, D. Menard, and O. Sentieys, “Accelerated Performance Evaluation of Fixed-Point Systems With Un-Smooth Operations” IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, vol. 33, iss. 4, pp. 599-612, 2014
- K. Parashar, D. Menard, and O. Sentieys, “A polynomial time algorithm for solving the word-length optimization problem,” in IEEE/ACM International Conference on Computer-Aided Design (ICCAD), San Diego, United States, 2013