The present disclosure is directed to communication and control systems, and more particularly, but not by way of limitation, to emulation environments for debugging code.
To facilitate debugging executable code, emulation environments have been developed that enable a user to suspend program execution at various break events (e.g., software breakpoint instructions, specified program accesses, data accesses, analysis breakpoints, or watchpoints). To debug code, a user can step through each instruction or run a series of instructions (e.g., to the next break event). Some emulation environments support different modes. For example, the different modes may enable a user to perform different types of debug activities. Switching between different modes in an emulation environment can be problematic.
In at least some embodiments, a computing system comprises a processor and a debug module coupled to the processor. The debug module controls an emulation environment for debugging code, the emulation environment having a first mode that enables time-critical code to execute while non-time-critical code is halted and a second mode that halts execution of both time-critical code and non-time-critical code. The computing system also comprises switch logic in communication with the processor and the debug module, wherein the switch logic enables dynamic switching between the first and second modes.
In at least some embodiments, a method for a debugger comprises providing a first mode that executes time-critical code while non-time-critical code is halted. The method further comprises providing a second mode that halts execution of both time-critical code and non-time-critical code. The method further comprises dynamically switching between the first and second modes.
In at least some embodiments, a system comprises a processor and means for debugging code. The means for debugging code supports a first mode that enables time-critical code to execute while non-time-critical code is halted and a second mode that halts execution of both time-critical code and non-time-critical code. The system also comprises means for dynamically switching between the first and second modes.
For a detailed description of various embodiments of the invention, reference will now be made to the accompanying drawings in which:
Certain terms are used throughout the following description and claims to refer to particular system components. As one skilled in the art will appreciate, companies may refer to a component by different names. This document does not intend to distinguish between components that differ in name but not function. In the following discussion and in the claims, the terms “including” and “comprising” are used in an open-ended fashion, and thus should be interpreted to mean “including, but not limited to . . . ”. Also, the term “couple” or “couples” is intended to mean either an indirect, direct, optical or wireless electrical connection. Thus, if a first device couples to a second device, that connection may be through a direct electrical connection, through an indirect electrical connection via other devices and connections, through an optical electrical connection, or through a wireless electrical connection
It should be understood at the outset that although an exemplary implementation of one embodiment of the present disclosure is illustrated below, the present system may be implemented using any number of techniques, whether currently known or in existence. The present disclosure should in no way be limited to the exemplary implementations, drawings, and techniques illustrated below, including the exemplary design and implementation illustrated and described herein, but may be modified within the scope of the appended claims along with their full scope of equivalents.
Embodiments of the disclosure are directed to devices having an Emulation Environment (EE) that supports multiple modes. In at least some embodiments, the EE has a first mode (referred to herein as a “stop-mode”) that halts execution of all code and a second mode (referred to herein as a “real-time mode”) that allows selected interrupt service routines (ISRs) to be performed while execution of background code is halted. “Background code” refers to the main body of code which is generally not as time-critical as the interrupt routines which service, for example, motor controls or high-speed timers. In other words, the real-time mode provides for the debug of code that interacts with interrupts that cannot be disabled whereas the stop-mode provides complete control of program execution, allowing for the disabling of all interrupts (including resets and non-maskable interrupts). Both EE modes can suspend program execution at break events such as software breakpoint instructions, specified program accesses or data accesses (e.g., analysis breakpoints or watchpoints), and upon request from the host or external hardware. In accordance with embodiments, a user is able to dynamically switch (back and forth) between the stop-mode and the real-time mode.
In at least some embodiments, suspending program execution causes instruction decoding to stop (similar to an IDLE instruction). In a pipeline embodiment, suspension of execution causes instruction decoding to stop while the pipeline flushes (all current pipeline activity completes). Interrupts can restart execution, but after the interrupt service routine is complete, the device returns to a suspended state. When suspended, interrupt control signals are employed to determine which interrupts to service (i.e., to identify time-critical interrupts).
During the stop-mode and/or the real-time mode, an EE user interface (EEUI) is provided to enable a user to debug code. The EEUI supports various commands such as a “run” command and a “step” command. The “run” command gives precedence to non-time-critical interrupts and resets over the execution of the next instruction. In contrast, the “step” command gives precedence to execution of the next instruction over non-time-critical interrupts and resets.
To dynamically switch back and forth between the real-time mode 104 and the stop mode 106, the system 100 employs switch logic 110A and 110B in communication with the emulation environment 102. The switch logic 110A and 110B represents hardware, firmware and/or software in communication with the emulation environment 102. As shown, the switch logic 110A comprises a “verify central processing unit (CPU) halt status” block (VCHS) 112. The VCHS block 112 ensures that a CPU has halted (e.g., a requested stop-mode has started) before entering the real-time mode 104.
The switch logic 110B also comprises a “complete pending interrupts” block (CPI) 114 and a “prevent new interrupts” block (PNI) 116. The CPI block 114 tracks whether a time-critical interrupt is received prior to a given stop-mode request (pending interrupts). In at least some embodiments, all pending time-critical interrupts are allowed to complete before switching to the stop-mode 106. Meanwhile, the PNI block 116 tracks whether a time-critical interrupt is received after the given stop-mode request (new interrupts). New time-critical interrupts not serviced, even if the switch to the stop-mode 106 is delayed to complete execution of pending time-critical interrupts or other delays. Any interrupt request received after the given stop-mode switch request will remain pending until execution resumes or the real-time mode is activated again.
In at least some embodiments, the EE 102 is a component of a debug module 250 that is in communication with the processor 204 or that is part of processor 204. For example, in some embodiments, the debug module 250 is attached directly to a processor's pipeline. As shown, the emulation environment 102 provides the real-time mode 104, the stop-mode 106 and the switch logic 110 described previously. In alternative embodiments, the switch logic 110 is coupled to, but separate from, the emulation environment 102.
In at least some embodiments, the debug module 250 supports a user interface (UI) 252 that enables a user to enter (e.g., type) debug commands via an input device 206 coupled to the processor 204. The input device 206 represents, for example, a keyboard, a mouse and/or other devices that enable a user to interact with the computing device 202. In accordance with some embodiments, at least one corresponding user interface window may be displayed via a graphic user interface (GUI) 208 coupled to the processor 204. The user interface window may display information related to the real-time mode 104 and/or the stop-mode 106 described herein.
In
As shown, the interrupt handler block 310 also receives the output of the stop-mode posting block 302. If the stop-mode posting block 302 indicates that a stop-mode request has not been received, the interrupt handler block 310 outputs a real-time interrupt enable (RTIE) signal in response to receiving an interrupt request. In at least some embodiments, the RTIE signal enables time-critical interrupts to be executed during the real-time mode 104. If the stop-mode posting block 302 indicates that a stop-mode request has been received, the interrupt handler block 310 de-asserts the RTIE signal even if additional interrupt requests are received. In this manner, interrupt requests received after a stop-mode request is received are ignored. As shown, the functions of the interrupt handler block 310 may be performed by an AND gate 312 that receives interrupt requests at one input and that receives the inverted output of the stop-mode posting block 302 at the other input. In
Although various signal names shown in
While several embodiments have been provided in the present disclosure, it should be understood that the disclosed systems and methods may be embodied in many other specific forms without departing from the spirit or scope of the present disclosure. The present examples are to be considered as illustrative and not restrictive, and the intention is not to be limited to the details given herein, but may be modified within the scope of the appended claims along with their full scope of equivalents. For example, the various elements or components may be combined or integrated in another system or certain features may be omitted, or not implemented
Also, techniques, systems, subsystems and methods described and illustrated in the various embodiments as discrete or separate may be combined or integrated with other systems, modules, techniques, or methods without departing from the scope of the present disclosure. Other items shown or discussed as directly coupled or communicating with each other may be coupled through some interface or device, such that the items may no longer be considered directly coupled to each other but may still be indirectly coupled and in communication, whether electrically, mechanically, or otherwise with one another. Other examples of changes, substitutions, and alterations are ascertainable by one skilled in the art and could be made without departing from the spirit and scope disclosed herein.
This application is a non-provisional application claiming priority to U.S. Pat. App. Ser. No. 60/927,951, entitled “Automatic emulation mode switching feature”, filed on May 7, 2007. The above-referenced application is hereby incorporated herein by reference.
| Number | Date | Country | |
|---|---|---|---|
| 60927951 | May 2007 | US |