Field of the Invention
This invention relates to development systems tools, and more particularly to a standard debug peripheral for providing development systems support.
Background of the Invention
Today's high-performance microprocessors and microcomputers place ever increasing demands on the development system tools used for debugging these sophisticated integrated circuits. Moreover, the increasing variety of standard and custom/core microcomputer (MCU) designs, necessitates a fundamental change in the design of development system tools. New microprocessors (MPU), designed to operate at clock speeds upwards of 33 MHz, push development system technology to its limit. Meanwhile, the widespread usage of existing central processing unit (CPU) designs for the processor core in MCUs imposes constraints on the design of development system tools. As the design cycle for these standard and custom/core MCUs shortens, concurrent availability of development system tools becomes increasingly problematic. Consequently, the problem is one of timely availability of high performance development system tools to support the wide variety of microprocessors and microcomputers entering the marketplace.
The traditional design approach for development system support relies upon in-circuit emulation to debug the MCU/MPU prototype software/hardware. Typically, in-circuit emulation allows the software designer to trace the execution of the software by stopping the program execution, at various intervals, and examining the contents of the internal registers, memory locations, and the like. In some designs the in-circuit emulator operates in a foreground and background mode, whereby the emulator processes the application program (non-emulation) in the foreground mode and the debugging program (emulation) in the background mode. Accordingly, the in-circuit emulator switches banks between foreground and background memory space during the execution and debugging of the user program, therefore, the MCU must operate in an expanded mode, necessitating the reconstruction of I/O ports which are lost to the external bus interface. Generally, the switch back and forth between the foreground (user) and background (debugging) memory banks requires substantial amounts of external buffer circuitry, to facilitate the operation of the MCU in an expanded mode. Often this additional buffer circuitry degrades the performance of the emulator, and thus prevents real-time circuit emulation. Since the implementation of the foreground/background memory bank switch requires a substantial amount of external circuitry, an emulator pod is used rather than a small daughter-board probe. The design of the resultant emulator pod is time consuming, and costly due to the required development system engineering expenses.
In the prior art, system designers employed port-replacement devices or bond out devices, in an effort to reduce the amount of external circuitry required. The primary disadvantage of using a port-replacement or bond out device is the requirement for additional design and maintenance resources. Essentially, the system designer must allocate design resources for the port-replace or bond out device, in addition to those resources required for the MCU/MPU design. Yet another approach, disclosed in Vaglica et al. U.S. Ser. No. 115,479 filed Oct. 30, 1987, is to integrate a background mode into the CPU core. This solution is optimal in some cases, however, it is often infeasible to make anything other than minor modifications to existing CPU cores.
Summary of the Invention
An object of the present invention is to provide an improved development system support for a wide variety of integrated circuit designs.
Another object of the present invention is to provide the capability for background mode processing in an existing CPU core without modification to the core design.
Yet another object of the present invention is to provide real-time in-circuit emulators for MCUs or MPUs of arbitrarily high clock speeds.
Yet another object of the present invention is to provide a method for substantially reducing the design cycle time for development systems tools.
These and other objects of the present invention are achieved in a data processing system comprising: a processor for executing a first sequence of instructions received by the processor, in response to a first sequence of instruction addresses, and for executing an alternate sequence of externally provided instructions received by the processor, in response to an alternate sequence of instruction addresses; an internal communications bus coupled to the processor; a memory coupled to the internal communications bus for storing a plurality of instructions and for providing the first sequence of instructions to the processor, in response to the first sequence of instruction addresses received from a processor; and a debug peripheral coupled to the internal communications bus for storing information received from the processor, and for providing the externally provided instructions to the processor, comprising: serial means for receiving the alternate sequence of externally provided instructions, in a first debug mode, and for providing the information received from the processor to an external source, in a second debug mode; parallel means for providing the alternate sequence of externally provided instructions to the processor, in the first debug mode, and for receiving the information from the processor, in the second debug mode.
Brief Description of the Drawings
FIG. 1 is a block diagram illustrating a preferred embodiment of a core integrated circuit data processing system.
FIG. 2 is a block diagram illustrating a preferred embodiment of the internal architecture of the debug peripheral.
Description of the Invention
The terms "assert", "assertion", "negate" and "negation" will be used to avoid confusion when dealing with a mixture of "active high" and "active low" signals. "Assert" and "assertion" are used to indicate that a signal is rendered active, or logically true. "Negate" and "negation" are used to indicate that a signal is rendered inactive, or logically false.
Shown in FIG. 1 is a block diagram of a core integrated circuit (IC) data processing system 10, according to a preferred embodiment of the present invention. The data processing system 10 is comprised generally of a central processing unit (CPU) 12, a memory 14, and a debug peripheral 16. A CPU internal bus 18 facilitates the communication between the CPU 12, and the debug peripheral 16, and memory 14. A development system 20 operates in conjunction with data processing system 10, to assist in the "debugging" of the software and hardware of data processing system 10. The external emulator circuitry of the development system 20 allows the user to perform various functions, such as the insertion of and response to breakpoints, halting the execution of the CPU 12 to examine and alter the contents of various internal registers, and to trace software execution.
In the preferred embodiment, data processing system 10 operates in two modes, a user mode and a debug mode. In the user mode, data processing system 10 operates in a conventional manner. The CPU 12 fetches an instruction from the memory 14, decodes the instruction, executes the instruction, and fetches the next instruction in the sequence for execution. Typically, the execution of the program continues in a sequential manner until CPU 12 receives a conditional instruction or an interrupt. The manner in which the CPU 12 handles an interrupt is a function of the processor design. Generally, the occurrence of an interrupt causes CPU 12 to suspend its normal operation, and commence executing an exception processing or interrupt service routine. In the present invention, CPU 12 enters the debug (emulation) mode in response to an interrupt request, which may be the result of an internal event recognizer, or from an external source, such as the development system 20. During emulation (debug mode), CPU 12 fetches instructions from the debug peripheral 16, rather than the memory 14. Accordingly, CPU 12 suspends execution of the user (application) program, stored in memory 14, and commences executing instructions received from debug peripheral 16. Essentially, the debug peripheral 16 functions as an alternate memory in the data processing system 10.
Shown in FIG. 2 is a block diagram illustrating a preferred embodiment of the internal architecture of the debug peripheral 16. Debug peripheral 16 is a single-word, dual port memory, with parallel read-write access on one side, and synchronous, full-duplex serial read-write access on the other side. In the preferred embodiment, debug peripheral 16 is comprised of a shift register 22, an address decoder 24, and a controller 26. The serial side of debug peripheral 16 is connected to the development system 20 via serial input pad (SI) 28, serial clock/breakpoint input pad (SCLK/BRK*) 30, and serial output/attention pad (SO/ATTN*) 32, which provide respective signals SERIAL IN, SCLK/BRK*, and SERIAL OUT/ATTN*. Accordingly, the SERIAL IN, SCLK/BRK* and SERIAL OUT/ATTN* signals control the serial transfer of data between the debug peripheral 16 and the development system 20. Parallel access to the debug peripheral 16 is provided by the connection of the instruction/data bus 34 to the CPU internal bus 18, and the debug peripheral 16 is essentially accessed in the same manner as any other on-chip peripheral. Since the instructions may be several words in length, the debug peripheral 16 is addressed at 16 adjacent locations in the CPU 12 memory space. For convenience, the initial address of the debug peripheral 16 is hereafter referred to as DEBUG, and thus, the addresses at which CPU 12 may access the debug peripheral 16 are DEBUG to DEBUG+$F.
Data processing system 10 enters the debug mode upon the occurrence of a breakpoint condition, which results in an interrupt to the CPU 12. The breakpoint may be the result of the assertion of the BRK signal externally (by development system 20), or the result of an internal event recognizer consisting of a register and comparator (not shown). In the case where the interrupt is caused by an external BRK signal, controller 26 responds by asserting a debug interrupt request (DEBUG IRQ*) signal to CPU 12. The controller 26 places the DEBUG IRQ* signal on the CPU internal bus 18, causing the CPU 12 to respond, by asserting a debug interrupt acknowledge signal (DEBUG IACK*), and begin execution of a debug interrupt service routine. CPU 12 autovectors to the debug peripheral 16, at address DEBUG, by placing the DEBUG address on the CPU internal bus 18. In response to receiving the DEBUG address, address decoder 24 enables shift register 22, via a SELECT input signal.
CPU 12 begins an instruction fetch cycle, from the debug peripheral 16, at address DEBUG. As the instruction cycle begins, the shift register 22 responds by asserting a serial out (SO) signal. The controller 26, which is coupled to the shift register 22, receives the SO signal and asserts the ATTN* signal, thereby indicating that the peripheral requires attention, and notifying the development system 20 of the commencement of the debug instruction cycle. Essentially, the start of the instruction fetch cycle is reflected externally by driving the SO pin from its quiescent high level to a low level. The development system 20 responds by writing an instruction, from the CPU 12 instruction set, into the shift register 22, via SI input 28. The controller 26 receives the SCLK signal from the development system 20, and provides the SCLK signal to the shift register 22. Consequently, the instruction provided by the development system 20 is clocked, with the SCLK signal, into the shift register 22 via the SI input pad 28. As the data is written into the shift register 22, any previous write which the CPU 12 made to the debug peripheral 16 may be simultaneously shifted out, to development system 20, via the SO output pad 32. Consequently, if the CPU 12 performs a write to the debug peripheral 16 before fetching the current instruction or data resident in the debug peripheral 16, the CPU 12 will invalidate the current word in debug peripheral 16. In the event that this occurs, the debug peripheral 16 will notify the development system 20, via a status bit in the serial out stream, to reload that word.
Once the instruction is fully assembled in the shift register 22 (without error), the current instruction is placed on the instruction/data bus 34, via the parallel I/O port. The controller 26 then asserts a READY signal, thereby notifying the CPU 12 that the instruction may be transferred. CPU 12 transfers the instruction from the instruction/data bus 34, and completes the instruction fetch cycle. CPU 12 proceeds with execution of the instruction. In order to keep the program execution within 16 byte DEBUG address space, the subsequent instruction fetched by CPU 12 is either a jump or branch instructions back to DEBUG. The design of the addressing scheme is such that each of the 16 adjacent addresses refers the CPU 12 back to the shift register 22 of debug peripheral 16. Thus, the CPU 12 continues to fetch instructions from debug peripheral 16 at the designated addresses DEBUG to $F, until the debug interlude is complete, and the user wishes to resume executing the application code. Consequently, the mode of operation, normal or debug, is transparent to the CPU 12 since in either mode of operation (normal or debug) the CPU 12 executes the same instruction set. Essentially, the CPU 12 can not discern the difference between the instruction types in either mode of operation. Upon termination of the debug interlude, the final instruction written into debug peripheral 16, via SI input pad 28, is a return from interrupt. The instructions executed during the duration of the debug interlude are used to read and write internal registers, memory, or for any other operation associated with system debugging. Accordingly, the development system 20 may implement the usual in-circuit emulation primitives, including the insertion of and response to breakpoints, halting the execution of the data processor to examine the contents of system registers, and tracing software execution.
The serial protocol for debug peripheral 16 supports a simple error detection by employing start, stop, and parity bits. The protocol requires N+7 bits per transfer, therefore, the serial clock is counted by the development system 20 to provide the N+7 clocks required to complete the transfer. The following table illustrates the function of each bit in the serial in and out bit streams.
Debug peripheral 16 eliminates the need for large amounts of complex, external emulator circuitry, therefore, the size of the emulation probe is substantially reduced in size. The probe may be a daughter board which plugs directly into or clips onto the MCU/MPU, in the user's circuit board. For example, a typical emulation probe with dimensions 9.times.12.times.2 inches is reduced to 3.times.4.times.1 inches (or less) by using the debug peripheral 16. The elimination of the emulator cable, generally required in conventional in-circuit emulators, alleviates the need to completely buffer the processor. The reduction in the amount of buffer circuitry facilitates real-time emulation with high-speed MPU/MCU chips, without significant timing degradation.
The debug peripheral 16 provides a load path to the on-chip memory 14 (RAM), thereby eliminating the need for a bootstrap ROM. When the BRK* input signal is asserted, upon the negation of the RESET signal (not shown) of the CPU 12, the CPU 12 will fetch its first instruction from the debug peripheral 16. This feature allows the development system 20 to write any program into the on-chip memory 14, via the shift register 22 of the debug peripheral 16. Once the program is loaded, the debug peripheral 16 may pass control to the program.
The debug peripheral 16 enhances the testability of the MCU/MPU under test in a variety of ways. For example, the contents of a masked ROM may be verified through the serial interface, without entering any special test mode. Furthermore, processor register, on-chip RAM, and other on-chip peripherals may be tested without the need for entering a special test mode. Accordingly, the debug peripheral 16 provides a flexible, efficient standard design, which is easily ported from one integrated circuit to another, at a minimum cost.
While the invention has been described in a preferred embodiment, it will be apparent to those skilled in the art that the disclosed invention may be modified in numerous ways and may assume many embodiments other than that specifically set out and described above. For example, CPU 12 can obtain the interrupt vector directly from the debug peripheral 16, as opposed to the preferred embodiment, wherein the interrupt signal causes the CPU 12 to autovector to the address (DEBUG) of the debug peripheral 16. Accordingly, it is intended by the appended claims to cover all modifications of the invention which fall within the true spirit and scope of the invention.