Abstract:
A digital signal processor evaluation chip has a sequencer for fetching and decoding instructions, and a processor core for executing the instructions. When the sequencer attempts to fetch an instruction from a preset break address, a register transfer instruction is supplied in place of the program instruction at that address, then clock input to the sequencer is halted. After the processor core has executed the register transfer instruction, clock input to the processor means is also halted, leaving the data transferred by the register transfer instruction available to be read.

Description:
This is a continuation of application Ser. No. 07/829,921 filed on Feb. 3, 1992 now abandoned. 
    
    
     BACKGROUND OF THE INVENTION 
     This invention relates to a digital signal processor evaluation chip (integrated circuit) and a debug method using this evaluation chip. 
     Digital signal processors (DSPs) are widely used in communication and image-processing equipment, to name only two of many applications. To assist in the debugging of DSP applications, manufacturers provide DSP evaluation chips adapted so that the user can halt program execution at an arbitrary address and examine the contents of internal DSP registers. 
     Prior-art evaluation chips comprise, for example, a clock control circuit For halting the DSP clock in response to a break signal, a step-execution control circuit for executing instructions one at a time during the break state, and a data bus monitor circuit for transferring data from an on-chip data bus to external emulator apparatus. To halt program execution and see register contents, the debugger sends the clock control circuit a break signal, then sends the step-execution control circuit a register data transfer instruction. This instruction causes register contents to be placed on the data bus, from which they can be read via the data bus monitor circuit. 
     The complexity of step-execution control circuits and clock control circuits, however, makes these prior-art evaluation chips difficult and costly to manufacture. In many cases the step execution function is-not needed. It would suffice to halt program execution at a selected address and view register contents, but the prior art provides no means of accomplishing tills in DSP chips without a step-execution control circuit. 
     SUMMARY OF THE INVENTION 
     It is accordingly an object of the present invention to enable register contents to be viewed in a DSP evaluation chip without a step-execution Function. 
     The invention employs a DSP evaluation chip comprising sequencer means for generating program addresses and Fetching and decoding instructions, and processor means for executing the instructions. The sequencer means and processor means are driven by separate clock signals. When an external circuit detects agreement between a program address output by the sequencer means and a preset address, first a register transfer Instruction is input to the sequencer means in place of the next program instruction, then clock input to the sequencer means is halted. After the register transfer instruction has been executed by the processor means, clock input to the processor means is also halted, and the data transferred by the register transfer instruction are read. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram of a preferred embodiment of the invented digital signal processor evaluation chip. 
     FIG. 2 is a timing chart illustrating a preferred embodiment of the invented debug method. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     The invented DSP evaluation chip and debug method will be described with reference to the drawings. The drawings are illustrative in nature and do not restrict the scope of the invention, which should be determined solely from the appended claims. 
     Referring to FIG. 1, a novel DSP evaluation chip 2 comprises a clock generator 4 that generates a four-phase clock signal, which it provides as Input to a first AND gate 6 and a second AND gate 8. The output of the first AND gate 6 drives a sequencer 10 that generates program addresses, fetches program instructions, and decodes the instructions. The output of the second AND gate 8 drives a processor core 12 that executes the instructions fetched and decoded by the sequencer 10. 
     The invention is not limited to the use of AND gales 6 and 8. Other gating means such as OR gates can be used, depending on signal polarity. 
     The instructions executed include arithmetic instructions that perform an arithmetic operation on the contents of two registers such as registers R1 and R2 in FIG. 1 and place the result in a third register such as register R3, and transfer instructions that transfer the contents of a register such as register R1 to another register or to external memory. When a data transfer instruction is executed, the register contents are placed on a data bus 14. A data bus monitor circuit 16 enables an external emulator system to read the data on the data bus 14. 
     The external emulator system comprises an instruction memory 18 that stores the instructions fetched by the sequencer 10, a system instruction memory 20 that stores other instructions for use in debugging, and an address matching circuit 22 that (a) compares program addresses generated by the sequencer 10 with a preset break address, (b) sends a first break signal as input to the first AND gate 6, and (c) sends a second break signal as input to the second AND gate 8. 
     The invented debug method will be described with reference to FIG. 2, which also explains the operation of the DSP evaluation chip 2 in FIG. 1. 
     Referring to FIGS. 1 and 2, at the beginning of a debug run the operator enters a break address 31 to the address matching circuit 22. If the operator wants to stop program execution after the instruction at address n and examine the contents of a certain target register, for example, he enters the subsequent address n+1, and stores in the system instruction memory 20 a transfer instruction that transfers data from the target register to the data bus 14. Then the operator starts program execution. 
     As the DSP evaluation chip 2 executes the program, the sequencer 10 generates successive program addresses 32 and sends them to the instruction memory 18. As long as these addresses do not match the break address 31, the first break signal 33 and second break signal 36 remain high, and no instruction 34 is output from the system instruction memory 20. The instruction memory 18 outputs program instructions 35 from successive program addresses 32, the sequencer 10 decodes these instructions, and the processor core 12 executes the instructions. As a result, register contents 37 in the processor core 12 change. In FIG. 2, R(k) indicates the register contents resulting from execution of instruction k (the instruction at address k; k=n-1, n, n+1, . . . ). 
     During this process the data bus contents 38 also change. In general the data bus 14 alternates between carrying a program counter (PC) value and register input or output data, indicated In FIG. 2 as Bus(n-2), Bus(n-1), etc. 
     At a time shown by reference numeral 40 in FIG. 2, the address matching circuit 22 will eventually detect a match between the address 32 output by the sequencer 10 and the preset break address 31. The address matching circuit 22 thereupon sends signals to the instruction memory 18 and the system instruction memory 20 that disable output from the instruction memory 18 and enable output from the system instruction memory 20. As a result, the sequencer 10 receives and decodes the target register transfer instruction stored in the system instruction memory 20. 
     Next the address matching circuit 22 drives the first break signal 33 low, causing the first AND gate 6 in FIG. 1 to stop supplying the four-phase clock signal to the sequencer 10. The clock input to the sequencer 10 is indicated by the signal waveforms 41, 42, 43, and 44 at the top of FIG. 2. During the interval while the first break signal 33 is low and the clock input 41, . . . 44 is stopped, the sequencer 10 continues to output the value n+1 as the program address 32. 
     The processor core 12, which is still receiving clock signals 45 to 48 from the second AND gate 8, executes the target register transfer instruction and places the contents of the target register on the data bus 14. Since the transfer instruction does not alter register contents, the data on the data bus 14 are the register contents R(n) following execution of the previous program instruction n. 
     After this transfer instruction has been executed, the address matching circuit 22 drives the second break signal 36 low, halting clock input 45, . . . , 48 to the processor core 12. No further instructions are executed, and the target register value R(n) remains on the data bus 14. The data bus monitor circuit 16 provides tills value R(n) as output 39 to the emulator system. 
     After viewing the target register data R(n), or storing the data in the system instruction memory 20, the operator can resume program execution by entering a command that causes the address matching circuit 22 to drive the first break signal 33 and the second break signal 36 high again, while enabling output from the instruction memory 18 and disabling output from the system instruction memory 20. Execution resumes from the point at which it halted: the sequencer 10 fetches the instruction at address n+1 in the instruction memory 18, and the processor core 12 executes this instruction. 
     The novel DSP evaluation chip thus breaks program execution and affords a view of register data without requiring complex circuitry for step execution or clock control. The only extra circuits required in this embodiment are a pair of AND gates G and 8 and the data bus monitor circuit 16. The novel DSP evaluation chip can thus be manufactured easily and supplied to users at a comparatively low cost. 
     It will be apparent to those skilled in the art that uses of the novel DSP evaluation chip are not limited to the debug method described above, but include other methods as well. For example: the contents of two or more registers crux be viewed by having the processor core 12 execute two or more transfer instructions; the program address can be altered by supplying a branch instruction instead of a transfer instruction from the system instruction memory 20; and program instructions can be skipped by allowing the sequencer 10 to run while halting the processor core 12. Thus a fairly extensive set of debug functions can be implemented in a simple and economical manner.