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.

SWE和SWENR指令

Other Parts Discussed in Thread: OMAP3530

你好!我现在你使用的是OMAP3530平台,DSP是3730。想了解下手册中的SWE和SWENR指令是什么?它们有什么用途?如何使用?

TI是否有相关的文档介绍?

  • OMAP3530是C64+的DSP核,参考文档spru732j:

    SWE:

    Description Causes an internal exception to be taken. It can be used as a mechanism for User mode
    programs to request Supervisor mode services. Execution of the SWE instruction results
    in an exception being recognized in the E1 pipeline phase containing the SWE
    instruction. The SXF bit in EFR is set to 1. The HWE bit in NTSR is cleared to 0. If
    exceptions have been globally enabled, this causes an exception to be recognized
    before execution of the next execute packet. The address of that next execute packet is
    placed in NRP.

    SWENR:

    Description Causes an internal exception to be taken. It is intended for use in systems supporting a
    secure operating mode. It can be used as a mechanism for User mode programs to
    request Supervisor mode services. It differs from the SWE instruction in four ways:
    1. TSR is not copied into NTSR.
    2. No return address is placed in NRP (it remains unmodified).
    3. The IB bit in TSR is set to 1. This will be observable only in the case where another
    exception is recognized simultaneously.
    4. A branch to REP (restricted entry point register) is forced in the context switch rather
    than the ISTP-based exception (NMI) vector.
    This instruction executes unconditionally.
    If another exception (internal or external) is recognized simultaneously with the
    SWENR-raised exception then the other exception(s) takes priority and normal exception
    behavior occurs; that is, NTSR and NRP are used and execution is directed to the NMI
    vector.

  • 你好,非常感谢你的回复。

    我已经查阅了相关文档,我在程序中想通过执行“SWE”指令来触发软件产生的异常中断(已经使能了C64x+ DSP的异常处理机制),在main()函数中调用包括下列语句的函数:

           asm(" SWE ");

    程序确实进入了SXF异常,但是执行完异常处理程序后,程序又进入了SXF异常,发现我在程序中触发了一次SXF异常,程序就反复进入SXF异常,为什么会出现这种情况?(在异常处理程序中,我已经通过ECR寄存器将EFR寄存器清零了。)

     

  • 参考一下这个贴子:

    http://www.deyisupport.com/question_answer/dsp_arm/omap_l1x/f/54/p/106196/288166.aspx#288166

  • 你好,上述帖子是我发起的。目前只涉及到外部可屏蔽异常的处理,我外部可屏蔽异常已经调通。

    现在想测试软件异常,在使用过程中出现了:触发一次软件异常,程序就不断进入异常的情况,麻烦你给些指导,非常感谢!!!

x 出现错误。请重试或与管理员联系。