Encoding:

POOL32A

000000

0

0000000000

DERET

1110001101

POOL32AXf

111100

6

10

10

6

Format:

DERET 

microMIPS32, EJTAG

Debug Exception Return

Purpose:

Debug Exception Return

To Return from a debug exception.

Description:

DERET clears execution and instruction hazards, returns from Debug Mode and resumes non-debug execution at the instruction whose address is contained in the DEPC register. DERET does not execute the next instruction (i.e. it has no delay slot).

Restrictions:

A DERET placed between an LL and SC instruction does not cause the SC to fail.

If the DEPC register with the return address for the DERET was modified by an MTC0 or a DMTC0 instruction, a

CP0 hazard exists that must be removed via software insertion of the appropriate number of SSNOP instructions (for implementations of Release 1 of the Architecture) or by an EHB, or other execution hazard clearing instruction (for implementations of Release 2 of the Architecture).

DERET implements a software barrier that resolves all execution and instruction hazards created by Coprocessor 0 state changes (for Release 2 implementations, refer to the SYNCI instruction for additional information on resolving instruction hazards created by writing the instruction stream). The effects of this barrier are seen starting with the instruction fetch and decode of the instruction at the PC to which the DERET returns.

This instruction is legal only if the processor is executing in Debug Mode.

Pre-Release 6: The operation of the processor is UNDEFINED if a DERET is executed in the delay slot of a branch or jump instruction. In Release 6, in the absence of delay/forbidden slots, this restriction does not apply.

Operation:

DebugDM = 0
DebugIEXI = 0
if IsMIPS16Implemented() | (Config3ISA > 0) then
   PC = DEPC63..1 || 0
   ISAMode = DEPC0
else
   PC = DEPC
endif
ClearHazards()

Exceptions:

Coprocessor Unusable, Reserved Instruction