JAJAA48 October 2025 TDA4VM
C 読み取りエラーは、同じ C マトリクス バンクに対して複数の読み取りアクセスが同時に行われ、競合が発生した場合に起こります。以下の手順に従って、このエラーを注入します。
void c_read_error(void)
{
int switch_period=0;
int repeat_op_count = 0;
for( ;switch_period<5;switch_period++)
{
__HWA_CONFIG_REG_v1 config_reg = __gen_HWA_CONFIG_REG_v1();
config_reg.C_OPERATION0 = __MMA_C_CONFIG_MULPLUS;
config_reg.C_OPERATION1 = __MMA_C_CONFIG_MULPLUS;
config_reg.C_CRSWPER = switch_period; //different switching period
config_reg.C_CWSWPER = switch_period+10000;
__HWA_OFFSET_REG offset_reg;
offset_reg = __gen_HWA_OFFSET_REG(); //This generates the offset register.
__HWAOPEN(config_reg,offset_reg,__MMA_OPEN_FSM_RESET); //This opens theHWAOPEN
repeat_op_count = 0;
for(;repeat_op_count<5;repeat_op_count++)
{
__asm(" HWAOP.S1 SA0");
__asm(" ||HWAXFER .L1 CMAT");
__HWAADV();
__HWAADV();
__HWAADV();
__HWAADV();
}
}
__HWARCV(0); //calls the error
__asm(" NOP");
__asm(" NOP");
}