FlexFi: A Flexible Fault Injection Environment for Microprocessor-Based Systems