This repositoy works as a utility library to successfully generate and validate the ITL (Image Test Library) technique for ultra-low power Edge Accelerators (i.e., the RISC-v 32 bit integer multiplier used by the X-HEEP platform). Note: to date [10/2024] an interpreter < "Python 3.12" must be used due to the lack of compatibility between Tensoflow Lite module and the latest version of the interpreter.
Calling the main function, different functionalities can be chosen to be executed:
python3 main.py --save_weights
-- save to file the trained weights of the specified model and layer in the specified format (hex, bin, int8)python3 main.py --save_pairs
-- save to file the <input, weight> pairs involved during the convolution algorithm of the specified model and convolutional layerpython3 main.py --generate_atpg_scripts
-- generate .tcl scripts for the ATPG process, one .tcl for each trained signed weight of the first convolutinal layerpython3 main.py --save_model_hex_format
-- save the model in .hex (words/bytes) to run it into the X-HEEP platform running on the PYNQ-Z2 boardpython3 main.py --gather_patterns_input_positions
-- collect, for all the test patterns, all the input positions which are multiplied for a given a weight which is, in turn, multiplied for a given test patternpython3 main.py --generate_FI_files
-- collect itl-validation fault injection filespython3 main.py --generate_custom_input_image
-- generate a input image as specified by this parameter (e.g. FWP = fill with pattern)python3 main.py --print_image
-- print a .png version of an input image stored as .npy tensor
The .ipynb file contained in this repository allows the complete management of the LeNet-5 network, and input image creation exploiting the IICV technique.
Giacomo Perlo: Linkedin, perlogiacomo@gmail.com
If you need help or want to know something more about all of this, I'm ready and excited to help you!