你好!我现在你使用的是OMAP3530平台,DSP是3730。想了解下手册中的SWE和SWENR指令是什么?它们有什么用途?如何使用?
TI是否有相关的文档介绍?
Tony Tang:
OMAP3530是C64+的DSP核,参考文档spru732j:
SWE:
Description Causes an internal exception to be taken. It can be used as a mechanism for User modeprograms to request Supervisor mode services. Execution of the SWE instruction resultsin an exception being recognized in the E1 pipeline phase containing the SWEinstruction. The SXF bit in EFR is set to 1. The HWE bit in NTSR is cleared to 0. Ifexceptions have been globally enabled, this causes an exception to be recognizedbefore execution of the next execute packet. The address of that next execute packet isplaced in NRP.
SWENR:
Description Causes an internal exception to be taken. It is intended for use in systems supporting asecure operating mode. It can be used as a mechanism for User mode programs torequest 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 anotherexception is recognized simultaneously.4. A branch to REP (restricted entry point register) is forced in the context switch ratherthan the ISTP-based exception (NMI) vector.This instruction executes unconditionally.If another exception (internal or external) is recognized simultaneously with theSWENR-raised exception then the other exception(s) takes priority and normal exceptionbehavior occurs; that is, NTSR and NRP are used and execution is directed to the NMIvector.
zhiming xu:
回复 Tony Tang:
你好,非常感谢你的回复。
我已经查阅了相关文档,我在程序中想通过执行“SWE”指令来触发软件产生的异常中断(已经使能了C64x+ DSP的异常处理机制),在main()函数中调用包括下列语句的函数:
asm(" SWE ");
程序确实进入了SXF异常,但是执行完异常处理程序后,程序又进入了SXF异常,发现我在程序中触发了一次SXF异常,程序就反复进入SXF异常,为什么会出现这种情况?(在异常处理程序中,我已经通过ECR寄存器将EFR寄存器清零了。)
Tony Tang:
回复 zhiming xu:
参考一下这个贴子:
http://www.deyisupport.com/question_answer/dsp_arm/omap_l1x/f/54/p/106196/288166.aspx#288166
zhiming xu:
回复 Tony Tang:
你好,上述帖子是我发起的。目前只涉及到外部可屏蔽异常的处理,我外部可屏蔽异常已经调通。
现在想测试软件异常,在使用过程中出现了:触发一次软件异常,程序就不断进入异常的情况,麻烦你给些指导,非常感谢!!!