Skip to main content
. 2025 Jul 16;11:e2996. doi: 10.7717/peerj-cs.2996

Table 2. Pseudocode for DA-FIS fault injection framework.

//Initialize DA-FIS System
BEGIN
  Initialize FPGA System (Xilinx Zynq-7000)
  Load Benchmark Workloads (Bubble Sort, 4-bit Adder, etc.)
  Configure Clock Generator (100 MHz)
  Initialize Memory (SRAM/DDR3)
  Setup UART Debugging & GPIO Monitoring
END
//DA-FIS Architecture Setup
//Adaptive Fault Injection Model
BEGIN
  Configure LFSR-Based Fault Generator
  SET LFSR_Polynomial ← Select Feedback Polynomial
  SET Fault_Seed ← Random Initial Value
  SELECT Fault_Type ← {SEU, MBU, Burst}
  SET Injection_Rate ← Adaptive based on FPGA Workload
END
//Multi-Bit Fault Injection Logic
BEGIN
 WHILE FPGA is Running DO
  SELECT Target Circuit (Adder, Multiplier, Counter, etc.)
  IDENTIFY Critical Flip-Flops & Memory Cells
  MASK Non-Critical Regions
  IF (Fault_Type = SEU) THEN
   Inject Single-event Fault at Target Location
  ELSE IF (Fault_Type = MBU) THEN
   Inject Multi-Bit Fault in Adjacent Memory Cells
  ELSE IF (Fault_Type = Burst) THEN
   Inject Consecutive Errors in Timing Sequence
  END IF
 END WHILE
END
//Configurable Fault Injection Control
BEGIN
  SET Fault_Enable ← TRUE
  WHILE Fault_Enable DO
    Inject Faults into FPGA Logic
    Monitor Error Propagation
    IF (Fault Impact > Threshold) THEN
     Log Error and Adjust Injection Rate
    END IF
  END WHILE
END
//Fault Injection Sequence Execution
BEGIN
  SELECT Fault Model (SEU, MBU, Burst)
  WHILE Experiment is Running DO
    GENERATE Fault Pattern using LFSR
    INJECT Fault into Target Circuit
    MONITOR FPGA Output for Fault Impact
    IF (Fault Detected) THEN
     LOG Error into Fault Database
    END IF
  END WHILE
END
//Experimental Execution and Performance Analysis
BEGIN
  FOR EACH Benchmark Circuit (Bubble Sort, Adder, Multiplier, Counter) DO
    RESET FPGA Configuration
    ACTIVATE Fault Injection
    RUN FPGA Workload
    RECORD Fault Occurrences
    MEASURE Fault Injection Speed, Error Propagation
    COMPARE DA-FIS Results with {BUFIT, DPR, SCFIT}
  END FOR
  GENERATE Performance Report
END
//Fault Logging and System Analysis
BEGIN
  OPEN Fault_Log_File
  WRITE Fault Type, Target Circuit, Injection Rate, Error Impact
  CLOSE Fault_Log_File
  DISPLAY Fault Summary on PC via UART
END