Question: I have no idea VLE_INSTRUCTION for? how to get VLEV_INSTRUCTION value?
background:
In AN4648 document
there is an algorithm to decide skip 2 or 4 instruction for ECC error.
However, I got the other algorithm from other supplier as blow
the Major different is about VLE_INSTRUCTION.
So I would like to know what is VLE_INSTRUCTION for? how does it decide the skipping length of instruction?
Do you have comment for other supplier code for VLE decided?
By the way, our MCU is MPC5746C.
NPX algorithm:
if(VLE_INSTRUCTION)
{
if((instruction & 0x9000) == 0x1000)
{
// first 4 bits have a value of 1,3,5,7
return address +=4; //instruction was 32-bit
}
else
{
// first 4 bits have a value of 0,2,4,6,8,9,A,B,C,D,E (and F, but F is reserved)
return address +=2; //instruction was 16-bit
}
}
the other supplier algorithm
opCode = (*instrAddress) & 0x90u;
if ((!((excDetails->syndrome & EXC_ESR_VLEMI) == 0)) || (opCode == 0x10))
{
instrAddress += 4;
}
else
{
instrAddress += 2;
}