A data processing system having debugging circuitry and a method for operating the data processing system is provided. In the system, a processor has a cache memory and is coupled to a system bus. An instruction is received which indicates an effective address. The instruction is executed and it is determined if the effective address results in a hit or a miss in the cache. If the effective address results in a hit, data associated with the effective address is provided from the cache to the system bus without modifying a state of the cache. The instruction allows real-time debugging circuits to be able to view the current value of one or more variables in memory that may be hidden from access due to cache hierarchy without modifying the value or impacting the current state of the cache.
|
18. A method for operating a processor having a table look-aside buffer (tlb), the method comprising:
receiving an instruction which indicates an effective address and which includes a tlb exception indicator;
providing the effective address to the tlb;
when the effective address results in a miss in the tlb, selectively taking an exception based on the tlb exception indicator; and
when the effective address results in a hit in the tlb, providing a translated address from the tlb corresponding to the effective address.
0. 26. A method for operating a processor coupled to a system bus and having a cache, comprising:
receiving an instruction which indicates an effective address and provides a tlb (table look-aside buffer) exception indicator; and
executing the instruction, wherein executing the instruction comprises:
determining if the effective address results in a hit or a miss in the tlb; and
when the effective address results in a miss, selectively taking an exception based on the tlb exception indicator, and
when the effective address results in a hit in the tlb, providing a translated address from the tlb corresponding to the effective address.
13. A method for operating a processor coupled to a system bus and having a cache, comprising:
receiving an instruction which indicates an effective address, the instruction including a size indicator;
determining that the effective address results in a hit in the cache, wherein determining comprises identifying a hit entry in the cache associated with the effective address; and
when a dirty bit of the hit entry indicates that data stored in the hit entry is clean, providing at least a portion of the data stored in the hit entry from the cache to the system bus, wherein a size of the at least a portion of the data is determined based on the size indicator.
0. 25. A method for operating a processor coupled to a system bus and having a cache, comprising:
receiving an instruction from debug circuitry which indicates an effective address; and
executing the instruction, wherein executing the instruction comprises:
determining if the effective address results in a hit or a miss in the cache; and
when the effective address results in a hit, providing data associated with the effective address from the cache to the system bus without modifying a state of the cache; and
when the effective address results in a miss, selectively enabling, by the processor, a fetch of the data associated with the effective address from a memory coupled to the system bus, wherein the fetched data associated with the effective address is not stored in the cache.
0. 24. A method for operating a processor coupled to a system bus and having a cache;
receiving an instruction which indicates an effective address and provides a size indicator and an error update indicator; and
executing the instruction, wherein executing the instruction comprises:
determining if the effective address results in a hit or a miss in the cache;
when the effective address results in a hit, providing data associated with the effective address from the cache to the system bus without modifying a state of the cache, wherein a size of the data provided is determined based on the size indicator; and
based on the error update indicator, selectively updating a field in a condition register of the processor in response to an error occurring during execution of the instruction.
0. 23. A method for operating a processor coupled to a system bus and having a cache comprising:
receiving an instruction which indicates an effective address and provides a tlb (table look-aside buffer) exception indicator that indicates whether or not an exception is to be taken if the effective address results in a miss in a tlb: and
executing the instruction, wherein executing the instruction comprises:
determining if the effective address results in a hit or a miss in the cache;
translating the effective address to a translated address using the tlb, wherein determining if the effective address results in a hit or a miss in the cache comprises using the translated address to determine if the effective address results in a hit or a miss; and
when the effective address results in a hit, providing data associated with the effective address from the cache to the system bus without modifying a state of the cache.
1. A method for operating a processor coupled to a system bus and having a cache, comprising:
receiving an instruction which indicates an effective address and provides a breakpoint disable indicator; and executing the instruction, wherein executing the instruction comprises:
selectively disabling data breakpoints during execution of the instruction based on the breakpoint disable indicator;
determining if the effective address results in a hit or a miss in the cache; and
when the effective address results in a hit, providing data associated with the effective address from the cache to the system bus without modifying a state of the cache; and
when the effective address results in a miss, selectively providing data associated with the effective address from a memory to the system bus based on a fetch indicator provided by the instruction, wherein when the data associated with the effective address is provided from the memory to the system bus, the data associated with the effective address is not stored in the cache.
22. A data processing system comprising:
a processor having a cache, the processor coupled to receive and execute instructions from debug circuitry, the cache comprising:
a cache array storing a plurality of cache entries; and
cache control circuitry coupled to the cache array, the cache control circuitry determining if an effective address indicated by an instruction received from the debug circuitry results in a hit or a miss in the cache array, and
wherein:
when the effective address results in a hit, the cache control circuitry enables the cache array to provide data associated with the effective address to a system bus coupled to the processor and the debug circuitry, without modifying a state of the cache array, and
when the effective address results in a miss, the processor selectively enables a fetch of the data associated with the effective address from a memory coupled to the system bus, wherein when the processor enables the fetch of the data associated with the effective address from the memory to the system bus, the data associated with the effective address is not stored in the cache array.
0. 2. The method of
when the effective address results in a miss, selectively providing data associated with the effective address from a memory to the system bus, wherein when the data associated with the effective address is provided from the memory to the system bus, the data associated with the effective address is not stored in the cache.
0. 3. The method of
4. The method of claim 3 1, wherein when the fetch indicator indicates fetching and when the effective address results in a miss, data associated with the effective address is provided from the memory to the system bus.
5. The method of
6. The method of
providing the data associated with the effective address from the cache to the bus without modifying a dirty bit in the cache associated with the effective address, the dirty bit indicating whether or not the data associated with the effective address stored in the cache is different from data stored at a memory location in the memory corresponding to the effective address.
7. The method of
8. The method of
9. The method of
10. The method of
translating the effective address to a translated address using a translation look-aside buffer (tlb), wherein determining if the effective address results in a hit or a miss in the cache comprises using the translated address to determine if the effective address results in a hit or a miss.
11. The method of
12. The method of
based on the error update indicator, selectively updating a field in a condition register of the processor in response to an error occurring during execution of the instruction.
14. The method of
15. The method of
when the dirty bit of the hit entry indicates that data stored in the hit entry is dirty, providing at least a portion of the data associated with the effective address from the cache to the system bus.
16. The method of
17. The method of
19. The method of
20. The method of
21. The method of
|
The present invention relates generally to data processing, and more particularly, to a data processing system having cache memory debugging support and method therefor.
Data processing systems typically include debug circuitry to permit a programmer to determine various values within the system at different points in time. Some data processing systems allow the debug circuitry to operate in near “real-time”. Currently in real-time debugging, if a variable is cached, the debug circuitry has no easy access to the latest value of the variable without a very intrusive set of operations to cause a central processing unit (CPU) in the system to be halted and the value extracted from the cache via execution of multiple instructions including load and store instructions passed in through a JTAG (Joint Test Action Group) port or other debug interface. This may cause undesirable state changes within the cache memory. Also, the load and store instructions can cause additional message generation for real-time debug trace units, in order to expose the variable, which may result in a bandwidth issue. In addition, the problem is more acute if a cache hierarchy exists between the CPU and the debug circuitry. Further, because current intrusive methods of determining cache values affect the state of the cache, particular debugging issues may not be exposed in the same manner due to differences in the cache and system state caused by the debugging operation, and may even hide the problem being debugged.
Therefore, there is a need for a debugging circuit and method that solves the above problems.
The present invention is illustrated by way of example and not limited by the accompanying figures, in which like references indicate similar elements, and in which:
Skilled artisans appreciate that elements in the figures are illustrated for simplicity and clarity and have not necessarily been drawn to scale. For example, the dimensions of some of the elements in the figures may be exaggerated relative to other elements to help improve the understanding of the embodiments of the present invention.
As used herein, the term “bus” is used to refer to a plurality of signals or conductors which may be used to transfer one or more various types of information, such as data, addresses, control, or status. The conductors as discussed herein may be illustrated or described in reference to being a single conductor, a plurality of conductors, unidirectional conductors, or bidirectional conductors. However, different embodiments may vary the implementation of the conductors. For example, separate unidirectional conductors may be used rather than bidirectional conductors and vice versa. Also, plurality of conductors may be replaced with a single conductor that transfers multiple signals serially or in a time multiplexed manner. Likewise, single conductors carrying multiple signals may be separated out into various different conductors carrying subsets of these signals. Therefore, many options exist for transferring signals.
Generally, the present invention provides, in one embodiment, a method and apparatus for showing a data block from a cache memory that is not directly visible on a system bus during a debugging operation. The data block is shown by making the data block available on a system bus. When shown, the data block cache status is not modified regardless of whether it is currently “dirty” or “clean”. In one embodiment, the method is implemented as an instruction in a data processing system. The instruction causes the data block to be exposed to the system bus where it can be captured by a debugging circuit, such as an IEEE ISTO-5001 compliant Nexus™ debugging unit. Nexus™ is a trademark of Freescale Semiconductor, Inc. located in Austin, Tex. The current state of the cache is not affected, including data tag and status information associated with each cache entry, as well as all replacement location logic used to determine an entry to next be replaced on a cache miss. Also, if the value is not in the cache, the value can be retrieved from the system external to the cache so that it is made visible to the debugging circuit, without having the value written to the cache. The instruction allows real-time debugging circuits to be able to view the current value of one or more variables in memory that may be hidden from access due to cache hierarchy without modifying the value or impacting the current state of the cache.
Normally, prior art systems utilize a series of memory access instructions such as load and store instructions, or utilize one or more cache management instructions, such as a block flush instruction, to cause operand values contained in one or more memory locations (which may be cached) to be made visible to a real-time debug unit so that the values can be captured and messaged out externally to the user of the system for debugging purposes. However, these prior art methods interact with a cache or caches in the system and cause normal activity such as cache line replacements and allocations, and state changes to cache line status to occur, which intrusively modify the state of the system. This intrusive modification is not desirable, since it interacts with the normal activity of the system which would have occurred if no debugging activity was performed, and this interaction may cause numerous unintended side-effects.
In one aspect there is provided a method for operating a processor coupled to a system bus and having a cache. The method comprises: receiving an instruction which indicates an effective address; and executing the instruction, wherein executing the instruction comprises: determining if the effective address results in a hit or a miss in the cache; and when the effective address results in a hit, providing data associated with the effective address from the cache to the system bus without modifying a state of the cache.
In another aspect there is provided a method for operating a processor coupled to a system bus and having a cache, the method comprising: receiving an instruction which indicates an effective address; determining that the effective address results in a hit in the cache, wherein determining comprises identifying a hit entry in the cache associated with the effective address; and when a dirty bit of the hit entry indicates that data stored in the hit entry is clean, providing at least a portion of the data stored in the hit entry from the cache to the system bus.
In yet another aspect there is provided a method for operating a processor having a table look-aside buffer (TLB). The method comprises: receiving an instruction which indicates an effective address and which includes a TLB exception indicator; providing the effective address to the TLB; when the effective address results in a miss in the TLB, selectively taking an exception based on the TLB exception indicator; and when the effective address results in a hit in the TLB, providing a translated address from the TLB corresponding to the effective address.
In yet another aspect there is provided a data processing system that comprises a processor having a cache, the processor coupled to receive and execute instructions from debug circuitry. The cache comprises a cache array storing a plurality of cache entries and cache control circuitry. The cache control circuitry is coupled to the cache array and determines if an effective address indicated by an instruction received from the debug circuitry results in a hit or a miss in the cache array. When the effective address results in a hit, the cache control circuitry enables the cache array to provide data associated with the effective address to a system bus coupled to the processor and the debug circuitry without modifying a state of the cache array.
Note that in one embodiment, all of data processing system 10 may be located on a single integrated circuit or within a same device. Alternatively, data processing system 10 may include any number of separate integrated circuits or separate devices interconnected with each other. For example, in one embodiment, the memory 18 may be located on one or more integrated circuits, separate from the rest of data processing system 10.
The memory 18 may be any type of memory, such as, for example, a read only memory (ROM), a random access memory (RAM), non-volatile memory (e.g. Flash), etc. Also, memory 18 may be a memory or other data storage located within another peripheral or slave or on a different integrated circuit.
In one embodiment, processor 12 and debug circuitry 14 are bus masters. In one embodiment, processor 12 is a processor capable of executing instructions, such as a microprocessor, digital signal processor, etc., or may be any other type of bus master, such as for example, a direct memory access (DMA) controller, or the like. Note that other slave devices may be included in data processing system 10 that are not illustrated in
Processor 12 includes a cache 13. Cache 13 functions as a level one (L1) cache for storing data and/or instructions for use by processor 12. Typically, data and/or instructions are loaded into cache 13 from memory 18 before being executed by the processor. Cache 13 may comprise a separate data cache and a separate instruction cache. Cache 13 comprises one or more data arrays, one or more tag arrays, and one or more status bit arrays. In some embodiments the tag and status information may be stored in a common array. Each cache entry consists of a block or line of data, a tag value which associates the data with a memory address, and status information, including whether the cache entry is valid, whether the cache entry is “dirty”, i.e. modified with respect to the data associated with the same address in memory 18 or other external memory blocks if present, and other associated status information. In one embodiment, memory 18, or a portion of memory 18 may be characterized as a level two (L2) cache.
An input/output (I/O) module 16 is bi-directionally connected to the bus 20 and to external circuitry (not shown). The I/O module 16 includes various interface circuits depending upon type of external circuitry that is connected to the I/O module 16. 1/0 module 16 may optionally contain one or more alternate bus masters coupled to bus 20.
Debug circuit 14 is bi-directionally connected to bus 13 and to processor 12 via bus 15. Debug circuit 14 is also bi-directionally connected to external circuitry (not shown) such as a hardware tester or other debugging interface hardware.
In general, debug circuitry 14 functions as a diagnostic check for data processing operations related to an access to cache 13, memory 18, and I/O module 16, and in other embodiments, other types of data retention circuits utilized by data processing system 10 whether internal to or external to data processing system 10. The processor 12 and alternate bus masters obtain mastership of the system bus 20 as needed and selectively access the system memory 18 to retrieve and store data and instructions. Debug circuitry 14 may be configured by the user of data processing system 10 to capture the values of one or more memory locations by monitoring addresses presented on bus 20, and capturing or sampling the related data values presented on bus 20. During bus read operations, the data values are provided by a selected slave device such as memory 18. During bus write operations, the data values are provided by a bus master of bus 20 such as processor 12. As the bus transfers occur, debug circuitry 14 monitors each transfer and selectively captures data values corresponding to data locations the user of debug circuitry 14 wishes to monitor. These values and conditions may be programmed into and transferred from debug circuitry 14 via the terminals shown in
Certain limitations in prior art systems are overcome by the current invention. In prior art systems, if a data variable or value is located within cache 13, the data value may be modified with respect to the corresponding value in memory 18, i.e. the latest (most up to date) value is not present in memory 18, but only within cache 13. If debug circuitry 14 accesses memory 18 to obtain the desired variable's value, it will not get a correct copy, since the copy may be modified internally in cache 13.
An instruction is provided in data processing system 10 to allow debug circuitry 14 to “see” a value which may be stored in cache 13. The instruction is herein after referred to as a “data cache block show” instruction and includes an effective address corresponding to the value. The instruction is executed by the processor. It is determined if the effective address results in a “hit” or a “miss” in the cache. When the effective address results in a hit, the value is provided to bus 20 associated with the effective address from the cache 13. Debug circuitry 14 then has access to the value from the bus 20 as it is provided by the processor. In one embodiment, debug circuitry 14 monitors transactions on bus 20, and is capable of sampling the address and associated data values as bus transfers occur. Desired values can then be transferred after sampling to a user of the system performing a debugging operation by means of signals from debug circuitry 14 of
Typically, some data values are subject to change and are updated in response to executing instructions. In some debugging situations it may be desirable to retrieve the latest version of the value even when resident in the cache. A “dirty bit” is associated with a cache entry indicates whether or not data in the cache associated with the effective address is different (i.e. has been modified) from data stored at another memory location, such as memory 18, corresponding to the effective address. In accordance with the disclosed embodiment, a “dirty bit” associated with the effective address of the value is not modified when the value is retrieved from the cache and presented to the system bus 20 in response to executing the data cache block show instruction. Likewise, cache 13 is not modified if the value associated with the effective address in cache 13 is the same as the value in another memory location, i.e. the data is clean. In other words, even when a dirty bit of the hit cache entry indicates that data stored in the entry is clean, the data stored in the entry is provided to bus 20 and the entry is not modified. When a dirty bit of the hit cache entry indicates that data stored in the entry is dirty, the data stored in the entry is still provided to bus 20, and the entry is not modified, and the dirty bit is not cleared, unlike in prior art cache control instructions. The data cache block show instruction will be discussed in more detail below.
#opt=[miss_fetch_true, signal_TLB_exceptions, size_of_show, mask_data_bkpt, record_status].
Bits [11-15], labeled “RA” and bits [16-20] labeled “RB” are the effective address offset and the effective address base register values, respectively, use to compute the effective address of the data to be made available on bus 20. Bits [21-30] labeled “TBD” are not used for this instruction. Bit [31] indicates the end of the instruction.
The data cache block show instruction is provided to force visibility of a potentially cached location to an agent external to the processor 12, for example, debug circuitry 14 for debug visibility purposes. No data breakpoint event occurs as part of the execution of this instruction if the option bit field #opt[mask_data_bkpt] of bits [6-10] indicates breakpoints should be masked. Normal load and store instructions continue to generate data breakpoint events if so enabled by internal debug circuitry 34 of
The size of the data block written to bus 20 is determined by the feature #opt[size_of_show], where “size_of_show” is a data block size indicator. The data block “shown” by the instruction may be all of a cache line associated with an effective address or may be less than all of a cache line based on the size indicator. If the data block containing the byte addressed by the effective address is not in cache 13 and the feature #opt[miss_fetch_true] indicates that miss fetching should occur, the addressed block is fetched from another memory of the system, such as memory 18, to be made visible on bus 20 for capture by debug circuitry 14, and is discarded by processor 12. Otherwise, if #opt[miss_fetch_true] indicates no miss fetching is to occur, then the instruction is treated as a NOP (no operation) if a miss occurs and no data is provided to bus 20.
If #opt[signal_TLB_exceptions] is set as true, then the effective address is translated to a physical address by TLB 35 and the physical address used to determine if the effective address results in a hit or a miss. If a TLB Miss or TLB Protection violation occurs, it is signaled within processor 12, and exception processing is initiated to deal with the generated error condition. Conversely, if #opt[signal_TLB_exceptions] is set as false, TLB Miss and TLB Protection violations are ignored, and the instruction is treated as a NOP of one if these conditions is encountered, and no exception is taken. If TLB errors, bus errors, or other errors occur as part of the execution of this instruction, the errors are signaled via a status bit in the control register 37 if #opt[record_status] is set.
The feature #opt[signal_TLB_exceptions] can be used with other instructions besides the data cache block show instruction. When #opt[signal_TLB_exceptions] is set true, a effective address associated with an instruction is provided to TLB 35. When the effective address results in a miss in the TLB 35, an exception is taken based on the whether #opt[signal_TLB_exceptions] is set true or false. When the effective address results in a hit in TLB 35, a translated address is provided from TLB 35 for the effective address. When the effective address results in a miss in TLB 35 and the #opt[signal_TLB_exceptions] is set true, execution of the instruction will result in a TLB Miss exception being signaled, and appropriate exception processing activity is initiated by processor 12. When the effective address results in a miss in TLB 35 and the #opt[signal_TLB_exceptions] is set false, execution of the instruction will not result in a TLB Miss exception being signaled, and instead, a no-operation, or other default result will be processed by processor 12. In this manner, an instruction specifier can be used to condition whether a normally generated TLB exception condition will result in exception processing or will result in a default result being provided, such as a no-operation.
Note that the function of the data cache block show instruction is independent of whether the data block containing the byte addressed by an effective address is characterized as “write through required” or “caching inhibited”. In either case, the execution of the data cache block show instruction causes the data value to be made visible on bus 20 for sampling or capture by debug circuitry 14, without affecting the state of the cache. It should be apparent now, that using the data cache block show instruction of the current invention causes the latest data value associated with a memory location to be made visible on the system bus for sampling or capture by debug circuitry, regardless of whether the associated memory location is resident or not in the cache, and if resident, regardless of the clean or dirty status of the data, and in the process of making the value visible, no current cache state, data, tag, or status is altered. Such control results in greatly improved ability to debug a system.
In the foregoing specification, the invention has been described with reference to specific embodiments. However, one of ordinary skill in the art appreciates that various modifications and changes can be made without departing from the scope of the present invention as set forth in the claims below. Accordingly, the specification and figures are to be regarded in an illustrative rather than a restrictive sense, and all such modifications are intended to be included within the scope of present invention.
Benefits, other advantages, and solutions to problems have been described above with regard to specific embodiments. However, the benefits, advantages, solutions to problems, and any element(s) that may cause any benefit, advantage, or solution to occur or become more pronounced are not to be construed as a critical, required, or essential feature or element of any or all the claims. The terms a or an, as used herein, are defined as one or more than one. The terms including and/or having, as used herein, are defined as comprising (i.e., open language). As used herein, the terms “comprises,” “comprising,” or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Patent | Priority | Assignee | Title |
Patent | Priority | Assignee | Title |
4635193, | Jun 27 1984 | Freescale Semiconductor, Inc | Data processor having selective breakpoint capability with minimal overhead |
5185878, | Jan 20 1988 | Advanced Micro Device, Inc. | Programmable cache memory as well as system incorporating same and method of operating programmable cache memory |
5313608, | Feb 27 1990 | Kabushiki Kaisha Toshiba | Microprocessor with cache memory for supporting debugging operations |
5317711, | Jun 14 1991 | Integrated Device Technology, Inc. | Structure and method for monitoring an internal cache |
5491793, | Jul 31 1992 | Fujitsu Semiconductor Limited | Debug support in a processor chip |
5636363, | Jun 14 1991 | Integrated Device Technology, Inc. | Hardware control structure and method for off-chip monitoring entries of an on-chip cache |
5892897, | Feb 05 1997 | Freescale Semiconductor, Inc | Method and apparatus for microprocessor debugging |
6016555, | Nov 19 1997 | Texas Instruments Incorporated | Non-intrusive software breakpoints in a processor instruction execution pipeline |
6044478, | May 30 1997 | GLOBALFOUNDRIES Inc | Cache with finely granular locked-down regions |
6145099, | Aug 13 1996 | NEC Corporation | Debugging system |
6260131, | Nov 18 1997 | Apple Inc | Method and apparatus for TLB memory ordering |
6321329, | |||
6502209, | May 13 1998 | AXIS AB | Chip with debug capability |
6668339, | Jul 28 1999 | Renesas Electronics Corporation; NEC Electronics Corporation | Microprocessor having a debug interruption function |
6954826, | May 21 2003 | Rambus Inc | Read access and storage circuitry read allocation applicable to a cache |
7346744, | Nov 04 2002 | SANMINA CORPORATION | Methods and apparatus for maintaining remote cluster state information |
7533302, | Nov 15 2004 | Sunplus Technology Co., Ltd. | Trace and debug method and system for a processor |
8352713, | Aug 09 2006 | Qualcomm Incorporated; QUALCOMM INCORPORATED, A DELAWARE CORPORATION | Debug circuit comparing processor instruction set operating mode |
20020013893, | |||
20030191624, | |||
20040193831, | |||
20040236911, | |||
20050273559, | |||
20060206763, | |||
20060271919, | |||
20070006042, | |||
EP569987, | |||
EP1286269, | |||
JP5289904, |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Jun 29 2011 | Rambus Inc. | (assignment on the face of the patent) | / |
Date | Maintenance Fee Events |
Sep 30 2020 | M1553: Payment of Maintenance Fee, 12th Year, Large Entity. |
Date | Maintenance Schedule |
Feb 11 2023 | 4 years fee payment window open |
Aug 11 2023 | 6 months grace period start (w surcharge) |
Feb 11 2024 | patent expiry (for year 4) |
Feb 11 2026 | 2 years to revive unintentionally abandoned end. (for year 4) |
Feb 11 2027 | 8 years fee payment window open |
Aug 11 2027 | 6 months grace period start (w surcharge) |
Feb 11 2028 | patent expiry (for year 8) |
Feb 11 2030 | 2 years to revive unintentionally abandoned end. (for year 8) |
Feb 11 2031 | 12 years fee payment window open |
Aug 11 2031 | 6 months grace period start (w surcharge) |
Feb 11 2032 | patent expiry (for year 12) |
Feb 11 2034 | 2 years to revive unintentionally abandoned end. (for year 12) |