This repo contains the code to reproduce the experiments, as well as the results, from the paper
Generating Posit-Based Accelerators With High-Level Synthesis.
It can also serve as an example of how to use HLS for the generation of posit arithmetic accelerators.
You need to install a modified version of the Bambu framework. More precisely, clone the following repo, which contains the necessary modifications to make Bambu work with posit units: https://github.com/RaulMurillo/PandA-bambu. Then follow the official installation instructions.
After the installation, you must pre-characterize the target device you wish to use. To that end, you need to use the Eucalyptus tool. You can use the characterize_device_custom.sh
script from PandA-bambu/etc/devices/
directory with the following arguments:
--devices=<list of target devices comma separated> --eucalyptus=/bin/eucalyptus --spider=/<bambu installation dir>/bin/spider -j8 -c"--flopoco=posit"
The resulting .xml
file must be copied into the corresponding folder within PandA-bambu/etc/devices/
.
Finally, compile and install the tool again.
To generate a posit-based accelerator, take any C program using floating-point numbers, and use the option --flopoco=posit
when calling Bambu. The float
and double
types will be automatically translated by 32 or 64-bit posits.
- Both
Bambu
andVitis_HLS
contain a similar structure, with one subdir per test. Operation-level applications can be found at the root, while real applications are grouped under thepolybench
folder. - The sources from
Bambu
can serve as examples of how to use Bambu to generate posit-based accelerators. For more details, see thebambu.sh
scripts. - In
error_eval
, the numerical error of the different PolyBench applications is computed via software emulation (for faster computation).
Overview paper:
R. Murillo, A. A. D. Barrio, G. Botella and C. Pilato, "Generating Posit-Based Accelerators With High-Level Synthesis," in IEEE Transactions on Circuits and Systems I: Regular Papers, doi: 10.1109/TCSI.2023.3299009.
If you find this project useful, please do not forget to cite this paper.
This work was supported in part by MCIN/AEI/10.13039/ 501100011033 under Grant PID2021-123041OB-I00; in part by the “ERDF—A Way of Making Europe;” in part by the 2020 Leonardo Grant for Researchers and Cultural Creators, BBVA Foundation, under Grant PR2003_20/01; in part by CM under Grant S2018/TCS-4423; in part by the EU Horizon 2020 Programme under Grant 957269; and in part by the HiPEAC6 Network funded by the EU Horizon 2020 Programme under Grant ICT-2019-871174.