This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

NMI or illegal instructions

Hey,

i'm trying to simulate memory bit-flips inside the L1P memory. The reason for this is that we want to simulate SEU effects. So i looked into the CPU instr. Set manual and created some testcode.

What does the CPU do in case of an illegal OpCode during Run-time? I thought it would raise a NMI interrupt, but thats not happening. (GIE enabled and NMI also enabled)
After programming the code into L1P i changed some instructions via the memory-view and did also using DMA. As i can see in the disassembly windows the disassembler shows thats it is not a instruction anymore  (still OK). But if the execution is done it does not raise any exception at all.
I did test it on single instructions and parallel instructions. But it looks like the functional units just throw those "words" away. The illegal code was inserted 100 cycles before the actual VLIW fetch.

Whats curious is running on the simulator the NMI gets raised. Is the NMI only related to the NMI INT-Pin?
Is there an other way to detect illegal op-code ?
Do i have to check it myself via control flow checks?

btw: I'm using a C6701 EVM.

  • Exceptions did not exist until you get to the C64x+ or C674x architectures.  The 6701 is a much older C67x core.  Execution of invalid instructions on that core would simply result in undefined behavior.  I would not expect the simulator to exhibit this behavior, unless you were simulating the C674x or C64x+, but I'm no expert in the simulators included in CCS.

    Regards, Daniel

  • thank you for the reply.

    I was simulating a C67XX CPU but as i looked into my testcode there was a region were i manually set the NMIE interrupt flag.  Shame on me ;)

    Hm, this sounds like there is no way to internal detect bit-flips inside the program memory (on the fly by the device itself).

    This would mean that i need some external watchdog , which is able to detect if the device is executing wrong code for a "longer time".
    If for e.g. a multiply instruction is hit and has been changed to anything else  (inside a loop) , i have no chance to detect it at all.

    Can you confirm this?

     

    best regards

    Bernhard

  • Bernhard Fuchs said:

    Hm, this sounds like there is no way to internal detect bit-flips inside the program memory (on the fly by the device itself).

    This would mean that i need some external watchdog , which is able to detect if the device is executing wrong code for a "longer time".
    If for e.g. a multiply instruction is hit and has been changed to anything else  (inside a loop) , i have no chance to detect it at all.

    For these older architectures, with no internal exception mechanism, there is no way, that I'm aware of, for a device to detect a corrupted program memory on its own.  If this is something you need, then I would recommend looking into a device based on the C674x architecture.

    Regards, Daniel

  • hi Daniel,

     

    thank for confirming this. I do have an idea to solve it in software but the exceptions would have been nice :)
    I'm not able to switch the architecture because TI only has 2 space-qualified dsp's with C67X and C67X+ architecture.

    best regards
    Bernhard