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.

J721S2XSOMXEVM: c7 dsp Streaming Engine

Part Number: J721S2XSOMXEVM

HI 

when c7 dsp funcA use Streaming Engine, then a interrupt coming, interrupt func also use Streaming Engine, when interrupt return, funcA will error ?

  • Hi,

    Part of the behavior depends on the ISR and what behavior you would want after returning to the ISR. However in general, under the assumption that you are interested in using SE with the following behavior - 

    1. Program has Function A which is running and utilizing SE0
    2. Interrupt is triggered
    3. ISR uses SE0 for another operation
    4. Program returns to Function A 
    5. Function A continues with SE0 at the exact state that SE0 was at step 2 when the interrupt was triggered

    Then the general steps would be the following:

    1. SE state is frozen by hardware when the ISR is entered (no explicit action needs to be taken by the program)
    2. SESAVE instruction is used by the ISR itself to save current SE state to memory
    3. Other ISR tasks and whatever streaming engine utilization by the ISR
    4. At the end of the ISR, SERSTR instruction is used by ISR itself to write back the saved SE state
    5. When leaving the ISR and jumping back to Function A, SE will then resume at whatever state was loaded back at step 4 automatically

    Essentially, if the same streaming engine will be used by the ISR, steps 2 and 4 will need to be included by the ISR so that the SE state is properly preserved by state 5. 

    Without those steps, the behavior SE would show would be determined by what the ISR actually does with streaming engine. I'd imagine you would see unexpected behavior such as reading from the wrong memory region. 

    Best,

    Asha

  • thank you,   when c7 use freertos,  if taskA use SE0, taskB also use SE0; when taskA using SE0 then c7 start taskB ,when taskB ok return,and taskA run continue, it will ok ?  when taskA start use SE0, it need off irq to prevent taskB ?

  • Hi,

    The C7x streaming engine was designed to handle context switching and would follow a similar process to what I defined in the early answer. I would recommend taking a look at the User’s Guide C71x DSP CPU, Instruction Set, and Matrix Multiply Accelerator document and the sections 3.22.4.2 Stream States, 3.22.4.2.3 Context Switching: Saving and Restoring Streams, and 3.18.4.12 Saving and Restoring Streams: SESAVE / SERSTR.

    Best,

    Asha

  • thank you , how to get User’s Guide C71x DSP CPU, Instruction Set, and Matrix Multiply Accelerator document, i do not find it

  • Hi,

    Let me check internally about this.

    Best,

    Asha