Approximate arithmetic circuits for FPGAs
This is a GitHub repository of subset of EvoApproxLib optimized for FPGAs . The library consists of hardware and software models of approximate circuits that are designed to be easily used in arbitrary application. Web-based GUI and the full version of EvoApproxLib can be found on our websites
This library is licenced under MIT licence. If you use the library in your research, please refer the following paper:
PRABAKARAN B. S., MRAZEK V., VASICEK Z., SEKANINA L., SHAFIQUE M. ApproxFPGAs: Embracing ASIC-based Approximate Arithmetic Components for FPGA-Based Systems. The 57th Annual Design Automation Conference 2020 (DAC ‘20), 2020.
@INPROCEEDINGS{approxfpgas,
author = "Bharath S. Prabakaran and Vojtech Mrazek and Zdenek Vasicek and Lukas Sekanina and Muhammad Shafique",
title = "ApproxFPGAs: Embracing ASIC-based Approximate Arithmetic Components for FPGA-Based Systems",
booktitle = "The 57th Annual Design Automation Conference 2020 (DAC '20)",
publisher = "Association for Computing Machinery",
volume={},
number={},
pages={6},
}
To use the models from Python, it is possible to generate and compile binary extensions using cython.
Make sure cython is installed
pip install --user cython
Generate cython sources (creates cython
directory):
python3 make_cython.py
Compile and install binary extensions (*.so
on linux, *.pyd
on Windows):
cd cython
python3 setup.py build_ext
python3 setup.py install --user
Finally, the extension can be used in a Python script as follows:
```python
import approxfpga as eal
e = 0
for i in range(0, 28):
for j in range(0, 28):
e += abs(eal.add8u_04A.calc(i, j) - (i+j))
print(‘MAE calculated’, e / (2*(28)))
print(‘MAE from lib’, eal.add8u_04A.MAE)
```