SPRADS4 October   2025 TDA4VM

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Instructions
    1. 2.1 Scope
    2. 2.2 HWA Instruction Definition
    3. 2.3 Fault Injection Procedure
      1. 2.3.1 Block Diagram
      2. 2.3.2 Fault Injection: Steps
        1. 2.3.2.1 Underflow Error
        2. 2.3.2.2 Overflow Error
        3. 2.3.2.3 Offset Parity Error
        4. 2.3.2.4 Config Parity Error
          1. 2.3.2.4.1 A FSM Config Parity Error
          2. 2.3.2.4.2 B FSM Config Parity Error
          3. 2.3.2.4.3 C FSM Config Parity Error
          4. 2.3.2.4.4 X FSM Config Parity Error
        5. 2.3.2.5 C READ Error
        6. 2.3.2.6 C Write Error
  6. 3Flow Diagram
    1. 3.1 Code Changes
      1. 3.1.1 Return Hook Definition
      2. 3.1.2 Clear MMA Function
      3. 3.1.3 Sequence Test
  7. 4Summary
  8. 5References
X FSM Config Parity Error

An X FSM config parity error occurs when a parity mismatch is detected in the HWA_CONFIG register. The procedure on how to inject the X FSM Config parity error are listed in the following steps.

  1. The HWAOPEN instruction is used to write HWA_CONFIG and HWA_OFFSET with parity computation enabled and parity checking enabled (PARITYCTRL = NORMAL) also configure HWA_CONFIG with the parameters mentioned in Get_MMAconfig().
  2. The values in the vector registers are corrupted by software in the specific field to be tested(X FSM).

  3. The HWAOPEN instruction is again used to write HWA_CONFIG and HWA_OFFSET using the corrupted data from that C7x vector register with the parity computation disabled and parity checking enabled (PARITYCTRL = PNCMCK). In this mode, the originally computed and saved parity value is checked against the parity computed on use in the affected register.
  4. Execute HWAXFER to inject the error. The error is updated in HWA_STATUS register.
  5. The HWARCV instruction is executed to observe the error.

#pragma FUNCTION_OPTIONS(Get_XFSM_Corrupt_config,"--opt_level=off")
__HWA_CONFIG_REG_v1 Get_XFSM_Corrupt_config(void)
{
  __HWA_CONFIG_REG_v1 corrupted_config = __gen_HWA_CONFIG_REG_v1(); 
  corrupted_config.X_ReLU = 1;
  return corrupted_config; 
}
#pragma FUNCTION_OPTIONS(Get_MMAconfig,"--opt_level=off")
__HWA_CONFIG_REG_v1 Get_MMAconfig(void)
{
  __HWA_CONFIG_REG_v1 mma_config_reg;
  mma_config_reg = __gen_HWA_CONFIG_REG_v1();
  mma_config_reg.A_ATYPE = __MMA_A_CONFIG_ATYPE_UINT16;
  mma_config_reg.A_ALUTEN = __MMA_A_LUTEN_LAST;
  mma_config_reg.B_BSWPER = 1000;
  mma_config_reg.B_BTYPE = __MMA_B_CONFIG_SIZE16;
  mma_config_reg.B_BSTART = 1;
  mma_config_reg.C_ATYPE = __MMA_C_CONFIG_ATYPE_SA;
  mma_config_reg.C_BTYPE = __MMA_C_CONFIG_BTYPE_UINT16;
  mma_config_reg.PARITYCTRL = __MMA_NORMAL;
  mma_config_reg.C_BSTART = 1; /* Initial B bank selection for reading B matrix data for the matrix computations */
  mma_config_reg.C_CRSTART = 1; /* Initial C bank selection for reading operands */
  mma_config_reg.C_CWSTART = 1; /* Initial C bank selection for writing computation results */
  mma_config_reg.C_CLSTART = 1; 
  return mma_config_reg;
}
#pragma FUNCTION_OPTIONS(MMA_XFSM_configParityError_injection,"--opt_level=off")
void MMA_XFSM_configParityError_injection(void)
{
  __HWA_CONFIG_REG_v1 mma_config_reg = Get_MMAconfig();
  __HWA_OFFSET_REG offset_reg;
  offset_reg = __gen_HWA_OFFSET_REG(); 
  __HWAOPEN(mma_config_reg,offset_reg,__MMA_OPEN_FSM_RESET); //Initialises Config,offset
 __HWAXFER(__MMA_XFER_SRC_HWA_CONFIG);
  __HWA_CONFIG_REG_v1 mma_config_corrupt = Get_XFSM_Corrupt_config(); //Receives X FSM corrupt configuration
  mma_config_corrupt.PARITYCTRL = __MMA_PNCM_CK; //Parity checking enabled calculation disabled
  __HWA_OFFSET_REG offset_reg2 = __gen_HWA_OFFSET_REG(); 
  __HWAADV();
  __HWAADV();
  __HWAADV();
  __HWAOPEN(mma_config_corrupt,offset_reg2,__MMA_OPEN_FSM_RESET);
 __HWAADV();
  __HWAADV();
  __HWAADV();
  __HWAXFER(__MMA_XFER_SRC_HWA_CONFIG); 
  __HWAADV();
  __HWAADV();
  __HWAADV();
  __HWARCV(0);
  __asm(" NOP");
  __asm(" NOP");
}