section 7 - Index of

section 7 - Index of section 7 - Index of

11.07.2015 Views

7.3.3.3 Other Interrupt SourcesOther interrupt sources include the stack error interrupt and trace interrupt (DSP56000156001) which are IPL3 interrupts.An overflow or underflow of the system stack (SS) causes a stack error interrupt which isvectored to P:$0002 (see SECTION 5 - PROGRAM CONTROL UNIT for additional informationon the stack error flag). Since the stack error is nonrecoverable, a long interruptshould be used to service it. The service routine should not end in an RTI because executingan RTI instruction "pops" the stack, which has been corrupted.The DSP56000/56001 includes a facility for instruction-by-instruction tracing as a programdevelopment aid. This trace mode generates a trace exception after each instructionexecuted (see Figure 7-7), which can be used by a debugger program to monitor theexecution of a program. (With members of the DSP56K family other than DSP56000156001, use the OnCE trace mode described in 10.5.)The trace bit in the SR defines the trace mode. In the trace mode, the processor will generatea trace exception after it executes each instruction. When the processor is servicingthe trace exception, it expects to encounter a JSR in the trace vector locations,thereby forming a long interrupt routine. The JSR stacks the SR and clears the trace bitto prevent tracing while executing the trace exception service routine. This service routineshould end with an RTI instruction, which restores the SR (with the trace bit set) fromthe SS, and causes the next instruction to be traced. The pipeline must be flushed toallow each sequential instruction to be traced. The tracing facility appends three instructioncycles to the end of each instruction traced (see the three NOP instructions shown inFigure 7-7) to flush the pipeline and allow the next trace interrupt to follow the nextsequential interrupt.During tracing, the processor considers the REP instruction and the instruction beingrepeated as a single two-word instruction. That is, only after executing the REP instructionand all of the repeats of the next instruction will the trace exception be generated.Fast interrupts can not be traced because they are uninterruptable. Long interrupts willnot be traced unless the processor enters the trace mode in the subroutine because theSR is pushed on the stack and the trace bit is cleared. Tracing is resumed upon returningfrom a long interrupt because the trace bit is restored when the SR is restored. Interruptsare not likely to occur during tracing because only an interrupt with a higher IPL can interruptduring a trace operation. While executing the program being traced, the trace interruptwill always be pending and will win the interrupt arbitration. During the traceinterrupt, the interrupt mask is set to reject interrupts below IPL3.

MAINPROGRAMFETCHESTRACE INSTRUCTION n1\-------:---\ J~SFt~~~~I~NS INSERTEDf---------i BY TRACE MODETRACE BITSETINSRn1n2r---.,..-L,::----, FAST INTERRUPT\---___: ___ -=--\ ~A~~~~~t TRACEDEBUGGERPROGRAMNEXT TRACEOPERATIONRTISET TRACE BIT IN SSL(a) Instruction Fetches from Memory,.-- INTERRUPT SYNCHRONIZED AND ,.-- INTERRUPT SYNCHRONIZED ANDRECOGNIZED AS PENDINGRECOGNIZED AS PENDINGINTERRUPT CONTROL CYCLE 1 i IIINTERRUPT CONTROL CYCLE 2 i IIFETCH nl NOP NOP NOP JSR - TRACE PROGRAM RTI - n2 NOP NOP NOPDECODE nl NOP NOP NOP JSR NOP TRACE PROGRAM RTI NOP n2 NOP NOP NOPEXECUTE nl NOP NOP NOP JSR NOpJ TRACE PROGRAM Rli NOP n2 NOP NOPINSTRUCTION CYCLE COUNT 1 2 3 4 5 6 7 89 I 10 11 12 13 14 15 16 17=INTERRUPTii INTERRUPT INSTRUCTION WORDII = ILLEGAL INSTRUCTIONn = NORMAL INSTRUCTION WORD(b) Program Controller PipelineFigure 7-7 Trace ExceptionNOP18

7.3.3.3 Other Interrupt SourcesOther interrupt sources include the stack error interrupt and trace interrupt (DSP56000156001) which are IPL3 interrupts.An overflow or underflow <strong>of</strong> the system stack (SS) causes a stack error interrupt which isvectored to P:$0002 (see SECTION 5 - PROGRAM CONTROL UNIT for additional informationon the stack error flag). Since the stack error is nonrecoverable, a long interruptshould be used to service it. The service routine should not end in an RTI because executingan RTI instruction "pops" the stack, which has been corrupted.The DSP56000/56001 includes a facility for instruction-by-instruction tracing as a programdevelopment aid. This trace mode generates a trace exception after each instructionexecuted (see Figure 7-7), which can be used by a debugger program to monitor theexecution <strong>of</strong> a program. (With members <strong>of</strong> the DSP56K family other than DSP56000156001, use the OnCE trace mode described in 10.5.)The trace bit in the SR defines the trace mode. In the trace mode, the processor will generatea trace exception after it executes each instruction. When the processor is servicingthe trace exception, it expects to encounter a JSR in the trace vector locations,thereby forming a long interrupt routine. The JSR stacks the SR and clears the trace bitto prevent tracing while executing the trace exception service routine. This service routineshould end with an RTI instruction, which restores the SR (with the trace bit set) fromthe SS, and causes the next instruction to be traced. The pipeline must be flushed toallow each sequential instruction to be traced. The tracing facility appends three instructioncycles to the end <strong>of</strong> each instruction traced (see the three NOP instructions shown inFigure 7-7) to flush the pipeline and allow the next trace interrupt to follow the nextsequential interrupt.During tracing, the processor considers the REP instruction and the instruction beingrepeated as a single two-word instruction. That is, only after executing the REP instructionand all <strong>of</strong> the repeats <strong>of</strong> the next instruction will the trace exception be generated.Fast interrupts can not be traced because they are uninterruptable. Long interrupts willnot be traced unless the processor enters the trace mode in the subroutine because theSR is pushed on the stack and the trace bit is cleared. Tracing is resumed upon returningfrom a long interrupt because the trace bit is restored when the SR is restored. Interruptsare not likely to occur during tracing because only an interrupt with a higher IPL can interruptduring a trace operation. While executing the program being traced, the trace interruptwill always be pending and will win the interrupt arbitration. During the traceinterrupt, the interrupt mask is set to reject interrupts below IPL3.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!