SPRADS4 October 2025 TDA4VM
An B FSM config parity error occurs when a parity mismatch is detected in the HWA_CONFIG register. The procedure on how to inject the B FSM Config parity error are listed in the following steps.
The values in the vector registers are corrupted by software in the specific field to be tested(B FSM).
The HWARCV instruction is executed to observe the error
#pragma FUNCTION_OPTIONS(Get_BFSM_Corrupt_config,"--opt_level=off")
__HWA_CONFIG_REG_v1 Get_BFSM_Corrupt_config(void)
{
__HWA_CONFIG_REG_v1 corrupted_config = __gen_HWA_CONFIG_REG_v1();
corrupted_config.B_BSWPER = 100;
corrupted_config.B_BTYPE = __MMA_B_CONFIG_SIZE32;
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_BFSM_configParityError_injection,"--opt_level=off")
void MMA_BFSM_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);
__HWAADV();
__HWAADV();
__HWAADV();
__asm(" HWALDB .L2 VB1");
__HWAXFER(__MMA_XFER_SRC_C);
__HWA_CONFIG_REG_v1 mma_config_corrupt = Get_BFSM_Corrupt_config();
mma_config_corrupt.PARITYCTRL = __MMA_PNCM_CK;
__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();
__asm(" HWALDB .L2 VB0"); //Load to B matrix
__HWAXFER(__MMA_XFER_SRC_HWA_CONFIG);
__HWAADV();
__HWAADV();
__HWAADV();
__HWARCV(0);
__asm(" NOP");
__asm(" NOP");
}