ZHCAFU0 October   2025 TDA4VM

 

  1.   1
  2.   摘要
  3.   商标
  4. 1简介
  5. 2指令
    1. 2.1 范围
    2. 2.2 HWA 指令定义
    3. 2.3 故障注入程序
      1. 2.3.1 方框图
      2. 2.3.2 故障注入:步骤
        1. 2.3.2.1 下溢错误
        2. 2.3.2.2 溢出错误
        3. 2.3.2.3 偏移奇偶校验错误
        4. 2.3.2.4 配置奇偶校验错误
          1. 2.3.2.4.1 FSM 配置奇偶校验错误
          2. 2.3.2.4.2 B FSM 配置奇偶校验错误
          3. 2.3.2.4.3 C FSM 配置奇偶校验错误
          4. 2.3.2.4.4 X FSM 配置奇偶校验错误
        5. 2.3.2.5 C 读取错误
        6. 2.3.2.6 C 写入错误
  6. 3流程图
    1. 3.1 代码更改
      1. 3.1.1 返回挂钩定义
      2. 3.1.2 清除 MMA 函数
      3. 3.1.3 序列测试
  7. 4总结
  8. 5参考资料

序列测试

以下函数验证是否存在 MMA 错误注入测试序列。以下代码是完全取决于用户的最终实现的示例。

volatile unit8_t track_exception = 0;
void test_fun(void)
{
    switch(track_exception)   /*track exception is a global variable ,        initialized to zero*/
    {
        case 0:
            clear_mma(); /*this cleares the previous mma error code, definition is given above*/
            track_exception = track_exception+1;//increment track //exception 
            overflow_exception();//generate exception
            break;
        case 1:
            clear_mma();
            track_exception = track_exception+1;
            appLogPrintf("Under flow exception\n"); /*Only for debug, remove*/
            underflow_exception(); // generate exception
            break;
        case 2:
            clear_mma();
            track_exception = track_exception+1;
            appLogPrintf("offset parity exception\n"); /*only for debug remove*/
            offset_parity_test();//generate excpetion
            break;
        case 3:
            clear_mma(); 
            appLogPrintf("config parity exception\n"); /*Only for debug*/
            track_exception = track_exception+1;
            config_parity_test();
            break;
        case 4:
            clear_mma();
            track_exception = track_exception+1;
            appLogPrintf("offset parity exception\n");/*Only for debug*/
            offset_parity_test();
            break;
        case 5: 
            appLogPrintf("Signal ESM\n");
            appLogPrintf("Waiting for ESM event\n");
            while(1) /*it needs to wait, if not the program doesnt go , and it would generate multiple exceptions*/
            {

            }
            break;
        default:
    //Handle any unlikely scenario
        break;
}
    return;
}