CLAP: Cross-Layer Approximate Computing on Custom RISC-V Processors
This project involves developing a platform to deploy approximate arithmetic circuits in fault-tolerant applications at the SoC level. This is achieved by implementing a custom non-standard extension to the RISC-V ISA called the 'X' extension. Furthermore, a C/Assembly level library called 'Axkit' was also developed in order to abstract the use of the 'X' approximate computing hardware with the help of the 'X' extension.
Collaborators
Siddharth Rajawat, ECE Dept, Indian Institute of Information Technology Guwahati, India
Supervisors
Dr. Babita Jajodia, Assistant Professor, ECE Dept, Indian Institute of Information Technology Guwahati, India
Dr. Dip Sankar Banerjee, Assistant Professor, CSE Dept, Indian Institute of Technology Jodhpur, India.
Extending RISC-V: The ’X’ Extension
The ‘X’ (Approximate Computing) extension is a non-standard RISC-V ISA extension that provides the support for approximate computing on RISC-V-based systems. It enables the use of approximate computing hardware in the form of in-pipeline approximate computing blocks or dedicated hardware accelerators. It acts as an interface between the approximate computing hardware and driver software typically written in a higher-level language like C. The 'X' extension proposes 4 new instructions:
R-type Encoded Instructions
I-type Encoded Instructions
xADD
xADD stands for approximate addition. It uses the ’R’-type instruction encoding format to perform the approximate addition of two 32 bit unsigned integers using the available approximate adder hardware and store the results into the destination register.
xMUL
xMUL stands for approximate multiplication. It uses the ’R’-type instruction encoding format to perform approximate multiplication of two 32 bit unsigned integers using the available approximate multiplier hardware and store the lower 32-bit of the product into a destination register.
xMAC
xMAC stands for approximate Multiply and Accumulate (MAC). It is used to perform approximate multiplication of two 32 bit unsigned integers and then the accumulation of result into a predefined register.
xCONF
xCONF stands for configure approximate device. This instruction is not used for any kind of computation, rather it is used to configure any run-time reconfigurable approximate circuits. It is the only ’I’-type encoded instruction in the ’X’ extension. The instruction is flexible enough to be used with multiple approximate devices on the same processor. The user is free to decode the immediate field of this instruction in their own way and accordingly configure their circuits for variation in accuracy, power, delay etc.
The AxKit Library
In this work, we also propose the Axkit library. It is a header-only library that can be included in C or assembly programs containing end-application code. Axkit allows us to abstract low-level approximate computing operations on a higher-level language such as C. Axkit provides the macros to inject approximate computing instructions provided by the 'X' extension into the output stream of the RISC-V GNU cross-compiler. This allows us to invoke approximate computing hardware to perform approximate calculations directly from assembly/C-code. Axkit also provides a set of wrapper functions to these macros for ease of use.