Skip to content

jackperlo/Gate2Bit-FI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Gate2Bit-FI: Cross-Layer Hardware-to-Software Fault Injection Framework

License: MIT Framework: LiteRT Framework: TFLite Target: RISC-V

Gate2Bit-FI is an end-to-end reliability evaluation framework designed to bridge the gap between gate-level hardware defects and application-level software degradation in Image Classification - Quantized Neural Networks (QNNs).

The tool is composed by two main engines:

  • Gate-level Fault Injector: it is able to perform statistcial fault injection campaigns of permanent stuck-@ faults at gate-level (within the core arithmetic units (Adders and Multipliers)) of a general-purpose processor core (RISC-V cve2)
  • BitFlipper: it is a hardware-agnostic software bit-flip masks applied directly to the model weights and biases.
Tool Overview

📌 Key Features

  • Cross-Layer Fault Mapping: Avoids the multi-order simulation slowdowns of full gate-level netlist execution by allowing the user to emulate it via software-level bit-flips in model tensors.
  • High-Fidelity Evaluation: Validated on real-world edge-AI workloads (find more in DEEP-VAULT), achieving a peak end-to-end cross-correlation of 99.90% (87.24% average, for MUL and Adder) at the network's final output.
  • Edge-AI Focused: Native support for UINT8, INT8 quantized models evaluated on the CIFAR-10 dataset.

📁 Repository Structure

The framework is organized into two main co-dependent layers:

📁 Gate2Bit-FI
├── 📁 Gate-level-FI/                              # Hardware Logic Layer
│    ├── 📁 apps/ 
│    │    └── 📁 hw_fault_injector/                # hw-level simulated fault injector core 
│    │          ├── 📁 tools/
│    │          |         └──  📁 stats_extractor/ # Tool to extract top-1 and top-5 stats
│    │          ├── main.cpp                       # Entry point
│    │          └── 📁 data/
│    │            └── 📁 configs/                  # contains JSON config files
│    ├── 📁 gatelevel/                             # Gate-level RV32IM multiplier and adder descriptions 
│    ├── 📁 includes/                              # Header files and common definitions
│    ├── 📁 injectors/                             # Modules responsible for injecting faults into the C++ verilated circuit wrapper
│    ├── 📁 tflm/                                  # TensorFlow Lite Micro (LiteRT) source and related files
│    └── 📁 tools/                                 # Injector class generation utilities
├── 📁 BitFlipper/             # Application Layer Bit Flipper for Weights and Biases
│   ├── 📁 utils/              # Utils files for proper functioning
│   ├── 📁 config/             # Configuration files
│   └── main.py                # Entry point

⚙️ Core Engines

1. Gate-Level Fault Injector (/Gate-level_FI)

This module targets hardware datapath blocks. It injects permanent stuck-at-0 and stuck-at-1 faults into the netlist execution of functional units. It outputs the exact bit-level corruption profiles resulting from faulty hardware operations.

2. Software Bit-Flip Emulator (/BitFLipper)

A "plug-and-play", hardware-agnostic Python framework. It reads the pre-characterized hardware fault profiles and emulates their exact mathematical impact by applying deterministic single or double bit-flips within the static weight tensors of PyTorch INT8 models.


🚀 Quick Start

Refer to the readme.md files in both Gate-level_FI and Bitflipper folders.


📄 Citation

If you use Gate2Bit-FI in your research, please cite our work:

@INPROCEEDINGS{11480360,
  author={Perlo, Giacomo and Porsia, Antonio and Ruospo, Annachiara and Sanchez, Ernesto},
  booktitle={2026 IEEE 27th Latin American Test Symposium (LATS)}, 
  title={Emulating SDC-1 Hardware Faults Through Application Level Bit-Flip Injections in QNNs}, 
  year={2026},
  volume={},
  number={},
  pages={1-6},
  keywords={Activity recognition;Human activity recognition;Circuits;System-on-chip;Microcontrollers;Register transfer level;Very large scale integration;Circuits and systems;Microprocessors;AI accelerators},
  doi={10.1109/LATS70329.2026.11480360}}

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

End-to-end framework to bridge gate-level hardware stuck-at faults and application-level software degradation in INT8/UINT8 Quantized Neural Networks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors