byuccl / bfat

Bitstream Fault Analysis Tool
Apache License 2.0
12 stars 1 forks source link

BFAT (Bitstream Fault Analysis Tool)


About:

BFAT is a tool used for analysis of a design's bitstream to evaluate and report any relevant information about given fault bits as well as any errors that they would cause in the design's implementation. BFAT is being used for research purposes and is currently under development. So far BFAT supports most Xilinx 7-Series FPGAs that are documented in the Project X-Ray database. The full list of parts can be found below in the "Supported Parts" section.

BFAT consists of the following scripts:

Scripts included from the local library:

Utility scripts to generate fault bit lists for user designs (see here for more info):

Other utility scripts:

BFAT requires the use of Vivado or Rapidwright to read dcp files in order to retrieve information about the design being analyzed. BFAT runs using a sourced version of Vivado by default, but can be run using Rapidwright with the -rpd flag.

BFAT utilizes the ProjectXray database in its design analysis and clones the database repo from Github during setup.


BFAT Process Flowchart

Image


Quickstart Guide

  1. Clone the BFAT repo from Github along with its submodule

    git clone --recurse-submodules https://github.com/byuccl/bfat.git
    cd bfat
  2. Install Vivado HDL Tools

    Note: We recommend Vivado version 2021.2 or later, as earlier versions are untested and we cannot guarantee that they will work

  3. Install Python 3.8+, its corresponding Virtual Environement (venv) module, and a valid Java JDK

    sudo apt install python<dist> python<dist>-venv default-jdk
  4. Create and activate a Python Virtual Environment

    python<dist> -m venv env/
    source env/bin/activate
  5. Install required packages for Rapidwright (while venv is activated)

    pip install -r requirements.txt

How to Use BFAT

  1. Source Python Virtual Environment

    source env/bin/activate
  2. Source Vivado tooling

    source /opt/Xilinx/Vivado/<vivado_version>/settings64.sh

    Note: This is the default path for Vivado installation. Vivado may be installed in a different directory on your machine.

  3. Run the bfat.py script providing it with:

    • The bitstream of the design to be analyzed

      Note: If the bits_file flag (-bf) is used, a .bits file (as generated from bitread.py) will be read in instead of a bitstream

    • A dcp checkpoint file of the routed design to be analyzed
    • A list of fault bits to evaluate in a .json file (see here for details on formatting)
    • The -rpd flag if running with Rapidwright
  4. (Optional) Using the -of flag you can specify the file the fault report will be output to. If not used, the report will be saved to a file with a generated name in the current directory.

Template command to run BFAT:

    python3 bfat.py <bitstream> <dcp> <fault_bits>

Notes:


Supported Parts:

Artix-7

Kintex-7

Spartan-7

Zynq-7000