DexterLab

🚨 New downloadable modules coming soon📘 Electrical Signaling & PHY Interfaces — new overview📘 Electrical I/O Standards — new overview📘 Integration between Theory and Design Library in progress

Safety in State Machines

Overview

State machines control sequencing, decisions, and transitions across nearly every functional block in a digital system. They orchestrate protocols, manage handshakes, regulate pipelines, and enforce timing relationships. Because they determine what happens next, faults in a state machine can lead to unpredictable or hazardous behavior. Safety analysis focuses on ensuring that state transitions are valid, that illegal states are detectable, and that the system can recover or enter a safe state when corruption occurs.

Main Safety Risks

  • Illegal state entry
    SEU, SET, or logic corruption causing the FSM to enter a state not defined in the design.
  • Stuck states
    The FSM becomes trapped in a state due to a missing transition or corrupted condition.
  • Unexpected transitions
    Transitions triggered by corrupted inputs, metastability, or timing faults.
  • State bit corruption
    Single‑bit or multi‑bit flips altering the encoded state.
  • Output corruption
    Incorrect control signals generated due to invalid or misaligned states.
  • Divergence between redundant FSMs
    Mismatch between lockstep or dual‑path state machines.
  • Clock or reset faults
    Asynchronous reset glitches or clock instability causing partial state updates.
  • I/O‑related upstream faults
    Invalid or unstable inputs driving the FSM into unsafe transitions.
  • Deadlock or livelock
    The FSM stops progressing or loops indefinitely due to logic faults.

Mitigation Techniques

  • Safe state encoding
    One‑hot, Gray, or Hamming‑distance‑optimized encodings to detect invalid states.
  • Illegal‑state detection
    Monitoring for undefined state patterns and forcing a safe recovery.
  • Redundant FSMs
    Dual or lockstep state machines with comparison for high‑integrity systems.
  • Transition plausibility checks
    Verifying that transitions follow allowed paths.
  • Input filtering
    Debouncing, synchronization, and glitch suppression on FSM inputs.
  • Timeout supervision
    Detecting stalled states or missing transitions.
  • Reset hardening
    Ensuring clean, synchronized reset signals across all FSM registers.
  • Built‑In Self‑Test
    Validating FSM logic, transitions, and outputs at startup.
  • ATPG/DFT support
    Scan‑based observability of state registers and transition logic, plus fault‑coverage measurement.

Safety Architecture Considerations

  • State encoding strategy
    Encoding must support illegal‑state detection, error containment, and safe fallback behavior.
  • Recovery behavior
    Define how the system reacts to illegal states, unexpected transitions, or divergence between redundant FSMs.
  • Interaction with protocols
    FSM safety must align with protocol timing, handshake rules, and retry/error‑handling mechanisms.
  • FMEDA assumptions
    State‑machine robustness contributes to diagnostic coverage, latent‑fault detection, and safe‑state guarantees.
  • Verification evidence
    Safety‑critical FSMs require formal verification of transitions, fault‑injection campaigns, coverage reports, and reset‑sequence validation.

Related Technical Pages