Virtual memory system

Abstract: An apparatus and method for reducing the cache miss penalty in a virtual memory system is provided. The virtual memory system includes a processor core which generates virtual addresses and a cache configured to supply information in response to receipt of physical addresses. The apparatus includes a logical-to-physical translation unit which converts the virtual addresses generated by the processor core to physical addresses. The logical-to-physical translation unit includes an accurate translation unit, a speculative translation unit, and a comparing unit. The accurate translation unit accurately converts logical addresses to physical addresses. The speculative translation unit generates and transmits a speculative physical address to the cache before the accurate translation unit completes generation of the accurate physical address. When the accurate translation unit completes generation of the accurate physical address, the comparing unit compares the accurate physical address with the speculative physical address. If the accurate physical address does not match the speculative physical address, the transmission of the speculative physical address to the cache is aborted, and the accurate physical address is transmitted to the cache.

Description: The present invention relates to a method and apparatus for decreasing the average time required to retrieve information required by a processor, and more particularly to an apparatus and method for reducing the cache miss penalty in a caching system by generating a speculative physical address in parallel with the translation of a virtual address to a physical address. One way to increase the performance of a computer system is to decrease the time required to supply a microprocessor with the information it requires. Such information, which may include both data and instructions, is typically stored in a memory connected to the microprocessor. To access required information, the microprocessor transmits to the memory an address which corresponds to the physical location in the memory (the "physical address") in which the required information is stored. In response, the memory transmits back to the microprocessor the information stored in memory location designated by the physical address. The time required to supply a microprocessor with required information may be decreased by decreasing the time lapse between the memory's receipt of the physical address and the transmission of the required information. This time lapse is determined by the "speed" of the memory. Unfortunately, the cost of memory increases dramatically with the speed of the memory. Thus, it is rarely practical to use the fastest memory available, especially in systems which require large quantities of memory. Consequently, it has been discovered that by using a relatively small bank of relatively high-speed memory ("cache memory") as a buffer for a larger bank of slower memory ("system memory"), the average information-request to information-supply speed can be greatly improved. Specifically, in a system having a cache memory (a "cache system"), the microprocessor initially requests information it needs from the cache memory. If the information is stored in the cache memory, the request is said to be a "cache hit" and the information is provided to the microprocessor from the cache memory at the faster rate. If the required information is not stored in the cache memory, the information request is said to be a "cache miss" and the information is retrieved from the system memory at the slower transfer rate. When the information is supplied to the microprocessor from the system memory, a copy of the information is typically stored in the cache memory in anticipation of subsequent requests for the same information. The computational efficiency lost due to a cache miss is referred to herein as the "cache miss penalty." Many modern computer systems are designed to allow software to address "virtual memory" using "virtual addresses", rather than the actual memory on the system using physical addresses. In a system that supports virtual memory (a "virtual memory system"), the software is allowed to assume that the process it implements may access the system's entire address space, that the memory is contiguous, and that the memory begins at a particular address. Due to these assumptions, the software need not be aware of the actual configuration or usage of the system's memory. Virtual memory systems and the benefits thereof are described in detail by David A. Patterson and John L. Hennessy in Computer Architecture A Quantitative Approach (1990), published by Morgan Kaufmann Publishers, Inc. San Mateo, California, published by Morgan Kaufmann Publishers, Inc. San Mateo, California, published by Morgan Kaufmann Publishers, Inc. San Mateo, California, pages 432-454. In virtual memory systems, information must still be stored in the actual system memory. Thus, virtual memory systems must provide a mechanism for translating the virtual addresses generated by the software into physical addresses corresponding to actual memory locations of the system memory. One mechanism commonly used to perform this translation is a translation-lookaside buffer. The concept of translation-lookaside buffers is generally well-known in the art, and is described in detail by David A. Patterson and John L. Hennessy in Computer Architecture A Quantitative Approach (1990), pages 437-438. Similar to non-virtual memory systems, virtual memory systems may employ caching techniques to decrease the time required to retrieve required information. Virtual memory systems may be designed with cache memories which supply required information in response to physical addresses ("physical-address-indexed caches"), cache memories which supply required information in response to virtual addresses ("virtual-address-indexed caches"), or both. Virtual-address-indexed caches are described in detail by David A. Patterson and John L. Hennessy in Computer Architecture A Quantitative Approach (1990), at page 460. When information is required in a virtual memory system which employs both a physical-address-indexed cache and a virtual-address-indexed cache, a search for the desired information is performed in the virtual-address-indexed cache while the virtual address is translated to a physical address. If the desired information is not present in the virtual-address-indexed cache, the processor awaits the result of a search for the desired information in the physical-address-indexed cache. Such a search is begun only after the process of determining a physical address is completed. Information retrieval from the physical-address-indexed cache is slower than retrieval from the virtual-address-indexed cache since a translation delay is imposed prior to the search of the physical-address-indexed cache. Thus, a cache miss in the virtual-address-indexed cache results in a cache miss penalty. In light of the foregoing, in a virtual memory system having a virtual-address-indexed cache and a physical-address-indexed cache, a method and apparatus for reducing the cache miss penalty caused by a cache miss of the virtual-address-indexed cache is clearly desirable. Further, it is clearly desirable to provide an apparatus and method for avoiding the logical-to-physical address translation time for at least some cache information retrievals from the physical-address-indexed cache. EP-A-395 835 discloses an addressable cache memory which stores a plurality of lines of data from the main memory, and a tag memory (typically a part of the cache memory) stores a corresponding plurality of real addresses associated with each line of data. A cache accessing unit receives a virtual address from a CPU. The virtual address comprises a real address portion and a virtual address portion, and the virtual address portion includes a virtual page and segment address. On each cache access, the cache accessing unit initially addresses the cache memory by concatenating the real address portion of the virtual address with an algorithmically determined first real address (i.e. a real page address). A translation memory translates the virtual address portion of the virtual address into a second real address as the cache memory is being accessed. A comparator compares the second real address with the first real address, and the data is retrieved from the cache memory when the first real address matches the second real address. All subsequent cache accesses are made using a combined address formed by concatenating the real address portion of the current virtual address to the previously translated real page address. SUMMARY OF THE INVENTION The present invention provides an apparatus for use in a virtual memory system for reducing delay between generation of a virtual address by a processor core and transmission to a memory of a physical address corresponding to said virtual address, said generation of said virtual address by said processor core effecting a request for required information, the apparatus comprising: an accurate physical address generation unit operatively connected with said processor core and said memory and configured to receive said virtual address and to generate an accurate physical address; a speculative address generation unit operatively connected with said accurate physical address generation unit and said memory for generating a speculative address based only on another accurate physical address generated by said accurate physical address for a previous virtual address that corresponds to a previous request for required information output from said processor core; and a comparator unit operatively connected with said accurate physical address generation unit, said memory and said speculative address generation unit, for comparing said accurate physical address with said speculative address; characterised in that said speculative address generation unit transmits said speculative address to said memory prior to said accurate physical address generation unit generating said accurate physical address, said virtual address being generated after generation of said previous request for required information by said processor core, no other address requests to said memory being generated by said processor core in between generation of said virtual address and said previous request for required information; said comparator unit transmits said accurate physical address received from said accurate physical address generation unit directly to said memory in a transmission path from said comparator unit to said memory, said transmission path bypassing said speculative address generation unit when said accurate physical address does not match said speculative address, wherein said memory is configured to initiate a first lookup operation based on said speculative address substantially upon receipt of said speculative address, said comparator unit being configured to transmit to said memory a control signal indicative of whether said speculative address matches said accurate physical address, said memory being configured to abort said first lookup operation based on said speculative address and initiate a second lookup operation based on said accurate physical address when said control signal indicates that said speculative address does not match said accurate physical address. According to a further aspect of the present invention there is provided a method for use in a virtual memory system for reducing delay between generation of a virtual address by a processor core and transmission to a memory of a physical address corresponding to said virtual address, said generation of said virtual address by said processor core effecting a request for required information, the method comprising: receiving, in an accurate physical address generation unit operatively connected with said processor core and said memory, said virtual address and generating an accurate physical address; generating, in a speculative address generation unit operatively connected with said accurate physical address generation unit and said memory, a speculative address based only on another accurate physical address generated by said accurate physical address for a previous virtual address that corresponds to a previous request for required information output from said processor core; and comparing, in a comparator unit operatively connected with said accurate physical address generation unit, said memory and said speculative address generation unit, said accurate physical address with said speculative address; characterised by said speculative address generation unit transmitting said speculative address to said memory prior to said accurate physical address generation unit generating said accurate physical address, said virtual address being generated after generation of said previous request for required information by said processor core, no other address requests to said memory being generated by said processor core in between generation of said virtual address and said previous request for required information; said comparator unit transmitting said accurate physical address received from said accurate physical address generation unit directly to said memory in a transmission path from said comparator unit to said memory, said transmission path bypassing said speculative address generation unit when said accurate physical address does not match said speculative address, including configuring said memory to initiate a first lookup operation based on said speculative address substantially upon receipt of said speculative address, said comparator unit being configured to transmit to said memory a control signal indicative of whether said speculative address matches said accurate physical address, said memory being configured to abort said first lookup operation based on said speculative address and initiate a second lookup operation based on said accurate physical address when said control signal indicates that said speculative address does not match said accurate physical address. Preferably said speculative address generation unit includes storage for storing a previous physical page address, said previous physical page address being a selected accurate physical page address previously generated by said translation lookaside buffer, at least a portion of said speculative page address being related with at least a portion of said previous physical page address according to a predetermined relationship. Preferably said virtual memory system includes a virtual-address-indexed cache memory operatively connected with said processor core, said virtual-address-indexed cache memory receiving said virtual address from said processor core and transmitting said required information to said processor core when said required information is present in said virtual-address-indexed cache memory. Preferably said generation of said virtual address by said processor core effects a present request for said required information, said present request being a present instruction request when said required information is an instruction, said present request being a present data request when said required information is data, said speculative address generation unit including an instruction storage area configured to store at least one previous instruction page address and a data storage area configured to store at least one previous data page address, said at least one previous instruction page address being a first selected accurate physical page address being a first selected accurate physical page address previously generated by said translation lookaside buffer, said at least one previous data page address being a second selected accurate previous physical page address previously generated by said translation lookaside buffer, at least a portion of said speculative page address being related with at least a portion of said at least one previous instruction page address according to a first predetermined relationship when said present request is said present instruction request, at least a portion of said speculative page address being related with a least a portion of said at least one previous data page address according to a second predetermined relationship when said present request is said present data request, said speculative address generation unit further including a multiplexer having a first input port connected to said instruction storage area and having a second input port connected to said data storage area, said multiplexer being configured to output said at least one previous instruction page address received from said first input port when said present request is said present instruction request, and said multiplexer being configured to output said at least one previous data page address received from said second input port when said present request is said present data request. Preferably said memory is a cache memory configured to supply said required information in response to said physical address. Preferably said speculative address generation unit is separate and distinct from said cache memory. Preferably where the accurate physical page address is obtained prior to the memory outputting data based on the first lookup operation, said control signal causes the abort in which the memory does not output any data based on the first lookup operation. BRIEF DESCRIPTION OF THE DRAWINGS The features of the present invention, are set forth with particularity in the appended claims. The invention, together with further objects and advantages thereof, may best be understood by making reference to the following description taken in conjunction with the accompanying drawings, in the several figures of which like reference numerals identify like elements, and wherein: Figure 1 illustrates in block diagram form a virtual memory system according to the preferred embodiment of the invention; and Figure 2 illustrates in block diagram form the presently preferred embodiment of a logical-to-physical translation unit. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT Figure 1 illustrates in block diagram form a virtual memory system 10 according to the preferred embodiment of the invention. Virtual memory system 10 generally includes a processor core 12, a virtual-address-indexed cache memory 14, a physical-address-indexed cache memory 16 and a logical-to-physical translation unit 18. Processor core 12 generally represents those components in a processor 13 which decode and execute instructions. Processor core 12 is coupled to physical-address-indexed cache memory 16 through a line buffer 20 by a plurality of data buses 22 and 24. Processor core 12 is coupled to logical-to-physical translation unit 18 by a virtual address bus 26 and by a required-information status line 30. Processor core 12 is also coupled to virtual-address-indexed cache memory 14 by virtual address bus 26. Since system 10 is a virtual memory system, the instructions executed by processor core 12 refer to logical addresses rather physical addresses. When information is required by processor core 12, processor core 12 generates a virtual address identifying the logical location of the required information. Processor core 12 further generates a status signal over line 30 indicative of whether the required information is data or an instruction. Virtual-address-indexed cache memory 14 is internal, residing on processor 13 with processor core 12. Virtual-address-indexed cache memory 14 is coupled to data bus 22 and includes a plurality of storage locations 15. Virtual-address-indexed cache memory 14 is arranged to transmit information stored within its storage locations 15 in response to virtual addresses received from processor core 12 over virtual address bus 26. Physical-address-indexed cache memory 16 is external, residing exterior to processor 13. Physical-address-indexed cache memory 16 is coupled to logical-to-physical translation unit 18 and line buffer 20 by a physical address bus 32 and a speculative read control line 33. Physical-address-indexed cache memory 16 includes a plurality of storage locations 17 for storing information, and control circuitry for supplying over data bus 24 information stored in storage locations 17. In contrast to virtual-address-indexed cache memory 14, the information within storage locations 17 is supplied by physical-address-indexed cache memory 16 in response to physical addresses. Since physical-address-indexed cache memory 16 supplies information in response to physical addresses, the virtual addresses generated by processor core 12 must be translated by logical-to-physical translation unit 18 into physical addresses before required information can be retrieved from physical-address-indexed cache memory 16. The process by which processor core 12 retrieves required information shall now be explained in greater detail. As mentioned above, when processor core 12 requires information, processor core 12 generates a virtual address indicative of the required information. Processor core 12 transmits this virtual address on virtual address bus 26. Both logical-to-physical translation unit 18 and virtual-address-indexed cache memory 14 receive the virtual addresses transmitted by processor core 12 over virtual address bus 26. In response to the receipt of the virtual address, logical-to-physical translation unit 18 begins to translate the virtual address to a physical address. Simultaneously, virtual-address-indexed cache memory 14 determines whether the required information currently resides in any of its storage locations 15. If the required data does reside in one of storage locations 15, virtual-address-indexed cache memory 14 transmits the required information to processor core 12 over data bus 22. If the required data does not reside in any of storage locations 15, logical-to-physical translation unit 18 completes the translation of the virtual address into a physical address, and generates the physical address to physical-address-indexed cache memory 16 over physical address bus 32. Upon receipt of the physical address, physical-address-indexed cache memory 16 performs a search to determine if the required information resides in storage locations 17. If the required information is found, physical address-based cache memory 16 transmits the information to processor core 12 through line buffer 20 over data buses 24 and 22. Virtual-address-indexed cache memory 14 may optionally be configured to read and store the information sent from physical-address-indexed cache memory 16 to processor core 12 into one of its storage locations 15 in anticipation of later requests for the same information. Logical-to-physical translation unit 18 generally includes an accurate address generating unit 40 and a speculative address generating unit 42. When logical-to-physical translation unit 18 receives a virtual address on virtual address bus 26, accurate address generating unit 40 and speculative address generating unit 42, in parallel, generate physical addresses. Accurate address generating unit 40 is configured to generate physical addresses that always accurately correspond to the storage locations indicated by the received virtual addresses ("accurate physical addresses"). Thus, accurate address generating unit 40 may be, for example, a translation lookaside buffer implemented as commonly known in the art. The logical-to-physical address translation process implemented by speculative address generating unit 42 differs from that implemented by accurate address generating unit 40 in two significant ways. First, the process implemented by speculative address generating unit 42 need not guarantee that the generated physical address will be accurate. Second, the process implemented by speculative address generating unit 42 must complete the generation of a speculative address in less time than it takes for accurate address generating unit 40 to generate the accurate physical address. As long as these two criteria are met, the specific embodiment of speculative address generating unit 42 may vary. The presently preferred embodiment of speculative address generating unit 42 is responsive to the status signal on line 30, and will be described in greater detail below. Thus, after logical-to-physical translation unit 18 receives a virtual address, and while accurate address generating unit 40 is determining the accurate physical address, speculative address generating unit 42 completes generation of a speculative address. Logical-to-physical translation unit 18 transmits the speculative address to physical-address-indexed cache memory 16 to initiate a lookup operation based on the speculative address. Logical-to-physical translation unit 18 further transmits a signal over line 33 to indicate that the physical address currently being supplied to physical-address-indexed cache memory 16 is a speculative address. For example, logical-to-physical translation unit 18 may drive line 33 HIGH when the physical address currently being supplied to physical-address-indexed cache memory 16 is a speculative address. Accurate address generating unit 40 completes generation of the accurate physical address after the generation of the speculative address, but prior to the completion of the lookup operation based on the speculative address. When accurate address generating unit 40 completes generation of the accurate physical address, logical-to-physical translation unit 18 compares the accurate physical address with the speculative address. If the speculative address is the same as the accurate physical address, then the lookup operation based on the speculative address is allowed to complete. If the required information is found in physical-address-indexed cache memory 16, it is supplied to processor core 12 through line buffer 20 via data buses 24 and 22. On the other hand, if the accurate physical address is different from the speculative address, logical-to-physical translation unit 18 aborts the transmission of the speculative address over physical address bus 32, begins transmitting the accurate physical address to physical-address-indexed cache memory 16 over physical address bus 32, and transmits a signal over line 33 indicating that the address on bus 32 is not a speculative address. For example, logical-to-physical translation unit 18 may drive line 33 LOW when the physical address currently being supplied to physical-address-indexed cache memory 16 is not a speculative address. Because the control signal on line 33 changes state when the transmission of the speculative address is aborted and the transmission of the accurate physical address is initiated, the control signal effectively indicates to memory 16 the outcome of the comparison of the speculative address and the accurate physical address. While the control signal on line 33 has been described herein as one which changes states to indicate the outcome of the comparison of the speculative address and the accurate physical address, the specific signal indication used to indicate the comparison outcome may vary. Upon receipt of the new address on bus 32 and the change in the signal over line 33, the control circuitry of physical-address-indexed cache memory 16 aborts the lookup operation based on the speculative address and initiates a lookup operation based on the accurate physical address. If the required information is found in the physical-address-indexed cache memory 16, it is supplied to processor core 12 through line buffer 20 via data buses 24 and 22. When the speculative address is inaccurate, physical-address-indexed cache memory 16 receives the accurate physical address over physical address bus 32 in substantially the same amount of time it would have taken to generate the accurate address in the absence of speculative address generating unit 42. Hence, no additional delay is imposed by the parallel address generation of speculative address generating unit 42. On the other hand, when the speculative address is accurate, the physical-address-indexed cache memory 16 is able to supply processor core 12 with required information faster than is possible in systems which rely exclusively on always-accurate logical-to-physical address translation techniques. The actual performance increase obtained by operating speculative address generating unit 42 in parallel with accurate address generating unit 40 depends on how quickly and how accurately the process implemented in speculative address generating unit 42 can predict the correct physical address. The presently preferred-embodiment of a speculative address generating unit shall now be described in greater detail with reference to Figure 2. Figure 2 illustrates in block diagram form the presently preferred embodiment of logical-to-physical translation unit 18. Logical-to-physical translation unit 18 is arranged to work with processor core 12 of a virtual memory system which employs virtual page techniques to implement virtual memory (a "virtual page system"). In virtual page systems, the storage locations in system memory are divided into a plurality of equal-sized groups, called pages. Each page has a physical page address which uniquely identifies the page, and each storage location within each page has a unique offset from its respective physical page address. Thus, information in any given storage location in the system memory may be accessed by sending to the system memory a physical address containing the physical page address and the offset which, together, uniquely identify the designated storage location. In virtual page systems, software references storage locations in the system memory by virtual addresses which include a virtual page address and an offset. The offset component of a virtual address is identical to the offset component of the physical address of the storage location represented by the virtual address. Therefore, the offset portion of virtual addresses need not be changed during the logical-to-physical address translation process. The virtual page address portion of the virtual address, however, must be translated into the physical page address to which it corresponds before information can be retrieved from the system memory. Because processor core 12 belongs to a virtual page system, virtual addresses generated by processor core 12 include a logical page address and an offset. Virtual address bus 26 includes a logical page address bus 58 over which the logical page address portion of each virtual address is transmitted to memory 16, and an offset bus 60 over which the offset portion of each virtual address is transmitted to memory 16. Logical-to-physical translation unit 18 generally includes a translation lookaside buffer 62, speculative address generating unit 42, and a comparing unit 68. Translation lookaside buffer 62 is coupled to processor core 12 by logical page address bus 58. Translation lookaside buffer 62 is also coupled to speculative address generating unit 42 by a bus 73. Speculative address generating unit 42 is further coupled to processor core 12 by line 30. Logical-to-physical translation unit 18 is coupled to physical-address-indexed cache memory 16 by physical address bus 32 which includes physical page address bus 58 coupled to comparing unit 68, and offset bus 60. Speculative address generating unit 42 generally includes control logic 84, an instruction address latch 86 a data address latch 88 and a multiplexer 90. Control logic 84 is coupled to control line 33, to instruction address latch 86 by a line 92, to data address latch 88 by a line 94, to multiplexer 90 by a line 96, to comparing unit 68 by a line 95, and to processor core 12 by line 30. The operation of logical-to-physical translation unit 18 shall now be explained in greater detail. Logical-to-physical translation unit 18 receives from processor core 12, over virtual address bus 26, a virtual address which identifies the storage location that holds required information. More specifically, the logical page address corresponding to the required information's physical storage location is transmitted on logical page address bus 58, and the offset corresponding to the required information's physical storage location is transmitted on offset bus 60. Processor core 12 also transmits over line 30 a signal indicating whether the required information represents an instruction or data. In response to the virtual address, translation lookaside buffer 62 begins converting the logical page address of the virtual address to an accurate physical page address. Simultaneously, speculative address generating unit 42 causes a speculative address to be sent to memory 16 over physical page address bus 82 via comparing unit 68 and a bus 74, and control logic 84 transmits a signal to memory 16 on line 33 to indicate that the physical address on bus 32 is a speculative address. In response to receipt of the speculative address on bus 32 and the signal on line 33, memory 16 initiates a lookup operation based on the speculative address. When translation lookaside buffer 62 finishes translating the logical page address to an accurate physical page address, translation lookaside buffer 62 transmits the accurate physical page address to the comparing unit 68 over a bus 72. Comparing unit 68 compares the accurate physical page address with the speculative page address. If the accurate physical page address matches.the speculative page address, then the comparing unit 68 completes the transmission of the speculative page address over physical page address bus 82 and memory 16 completes the lookup operation based on the speculative address. If the accurate physical page address does not match the speculative page address, then comparing unit 68 ceases to transmit the speculative page address on physical page address bus 58, sends a signal to control logic 84 over line 95 to indicate that the current speculative page address is not accurate, and begins to transmit the accurate physical page address over physical page address bus 82. In response to the signal on line 95, control logic 84 transmits a signal on line 33 to indicate that the physical address on bus 32 is no longer a speculative address. Upon receipt of the signal on line 33, memory 16 aborts the lookup operation based on the speculative address and initiates a search based on the accurate physical address. Speculative address generating unit 42 is configured to generate a speculative page address based on the accurate physical page address most recently generated by translation lookaside buffer 62 for information of the same type as the information that is currently required. For example, if, in response to the last request for an instruction, the translation lookaside buffer 62 generated a physical page address 0, then speculative address generating unit 42 will generate, in response to a request for the retrieval of an instruction, page address 0 as a speculative page address. Similarly, if, in response to the last request for data, the translation lookaside buffer 62 generated physical page address 1, then speculative address generating unit 42 will generate, in response to a request for the retrieval of data, page address 1 as a speculative page address. Speculative address generating unit 42 implements the above prediction process as follows. After translation lookaside buffer 62 generates an accurate physical page address, translation lookaside buffer 62 transmits the accurate physical page address over bus 73 to instruction address latch 86 and data address latch 88. In response to the signal on line 30, control logic 84 determines whether the accurate physical page address was generated in response to a request for an instruction or a request for data. If the accurate physical page address was generated in response to a request for an instruction, control logic 84 transmits a control signal over line 92 to instruction address latch 86 to cause the accurate physical page address on bus 73 to be latched into instruction address latch 86. On the other hand, if the accurate physical page address was generated in response to a request for data, control logic 84 transmits a control signal over line 94 to data address latch 88 to cause the accurate physical page address on bus 73 to be latched into data address latch 88. In response to a subsequent request for information, control logic 84 transmits a signal over line 96 to multiplexer 90 to select either instruction address latch 86 or data address latch 88. Specifically, if the signal on line 30 indicates that an instruction is being requested by processor core 12, then control logic 84 transmits a signal over line 96 to multiplexer 90 to cause the page address previously stored in instruction address latch 86 to be transmitted through multiplexer 90 onto bus 74. If the signal on line 30 indicates that data is being requested by processor core 12, control logic 84 transmits a signal over line 96 to multiplexer 90 to cause the page address stored in data address latch 88 to be transmitted through multiplexer 90 onto bus 74. Thus, the preferred embodiment of speculative address generating unit 42 stores the most recently generated actual page address for an instruction request in instruction address latch 86, and the most recently generated actual page address for a data request in data address latch 88. When a request for an instruction is received, speculative address generating unit 42 immediately transmits the contents of instruction address latch 86 as a speculative page address. Likewise, when a request for data is received, speculative address generating unit 42 immediately transmits the contents of data address latch 88 as a speculative page address. The physical page of the currently required data or instruction is not necessarily the physical page of the most recently requested data or instruction. For this reason, the speculative page address must always be checked against an accurate page address. However, related instructions tend to be clustered together in memory, and related data tend to be clustered together in memory. Further, to perform any given operation, a processor is generally required to execute a plurality of related instructions on a plurality of related data. Consequently, there tends to be a high correlation between the physical page of data requested and the physical page of data previously requested. Likewise, there tends to be a high correlation between the physical page of instructions requested and the physical page of instructions previously requested. The stronger these correlations, the more often the speculative address generated by speculative address generating unit 42 is accurate. As can be seen from the foregoing, an apparatus and method are provided which reduce the average time required to retrieve information from a physical-address-indexed cache in a virtual memory system. The access time is reduced by initiating a preliminary search for the required information while the virtual address generated by the processor core is being converted to an accurate physical address. The preliminary search is based on a speculative address, which, in the preferred embodiment of the invention, is the physical address of the most recently retrieved information of the same type. Once an accurate physical address has been determined, it is compared with the speculative address. If the speculative and the actual addresses match, then the preliminary search is allowed to complete. If the speculative and the actual addresses do not match, the preliminary search is aborted and a search is begun based on the accurate physical address. It is to be understood that the detailed drawings and specific examples given describe a preferred embodiment of the invention and are for the purpose of illustration only, and that the apparatus of the invention is not limited to the precise details and conditions disclosed. For example, while an internal virtual-address-indexed cache memory and an external physical-address-indexed cache memory have been described, these caches may be either internal or external. In addition, while the present invention has been described with reference to a physical-address-indexed cache, it may alternatively be used with any physical-address-indexed memory, such as system memory.

Claims: An apparatus for use in a virtual memory system for reducing delay between generation of a virtual address by a processor core (12) and transmission to a memory (16) of a physical address corresponding to said virtual address, said generation of said virtual address by said processor core (12) effecting a request for required information, the apparatus comprising: an accurate physical address generation unit (62) operatively connected with said processor core (12) and said memory (16) and configured to receive said virtual address and to generate a corresponding accurate physical address; a speculative address generation unit (42) operatively connected with said accurate physical address generation unit (62) and said memory (16) for generating a speculative address based only on another accurate physical address generated by said accurate physical address generation unit (62) for a previous virtual address that corresponds to a previous request for required information output from said processor core (12); and a comparator unit (68) operatively connected with said accurate physical address generation unit (62), said memory (16) and said speculative address generation unit (42), for comparing said accurate physical address with said speculative address; characterised in that said speculative address generation unit (42) transmits said speculative address to said memory (16) prior to said accurate physical address generation unit (62) generating said accurate physical address, said virtual address being generated after generation of said previous request for required information by said processor core (12), no other address requests to said memory (16) being generated by said processor core (12) in between generation of said virtual address and said previous request for required information; said comparator unit (68) transmits said accurate physical address received from said accurate physical address generation unit (62) directly to said memory (16) in a transmission path from said comparator unit (68) to said memory (16), said transmission path bypassing said speculative address generation unit (42) when said accurate physical address does not match said speculative address, wherein said memory (16) is configured to initiate a first lookup operation based on said speculative address upon receipt of said speculative address without additional delay, said comparator unit (68) being configured to transmit to said memory a control signal indicative of whether said speculative address matches said accurate physical address, said memory (16) being configured to abort said first lookup operation based on said speculative address and initiate a second lookup operation based on said accurate physical address when said control signal indicates that said speculative address does not match said accurate physical address. An apparatus for use in a virtual memory system as claimed in claim 1 wherein said speculative address generation unit (42) includes storage (86) for storing a previous physical page address, said previous physical page address being a selected accurate physical page address previously generated by said accurate physical address generation unit (62), at least a portion of said speculative page address being related with at least a portion of said previous physical page address according to a predetermined relationship. An apparatus for use in a virtual memory system as claimed in claim 2 wherein said virtual memory system includes a virtual-address-indexed cache memory (14) operatively connected with said processor core (12), said virtual-address-indexed cache memory (14) receiving said virtual address from said processor core (12) and transmitting said required information to said processor core (12) when said required information is present in said virtual-address-indexed cache memory (14). An apparatus for use in a virtual memory system as claimed in claim 1 wherein said generation of said virtual address by said processor core (12) effects a present request for said required information, said present request being a present instruction request when said required information is an instruction, said present request being a present data request when said required information is data, said speculative address generation unit (42) including an instruction storage area (86) configured to store at least one previous instruction page address and a data storage area (88) configured to store at least one previous data page address, said at least one previous instruction page address being a first selected accurate physical page address previously generated by said accurate physical address generation unit (62), said at least one previous data page address being a second selected accurate previous physical page address previously generated by said accurate physical address generation unit (62), at least a portion of said speculative page address being related with at least a portion of said at least one previous instruction page address according to a first predetermined relationship when said present request is said present instruction request, at least a portion of said speculative page address being related with a least a portion of said at least one previous data page address according to a second predetermined relationship when said present request is said present data request, said speculative address generation unit (42) further including a multiplexer (90) having a first input port connected to said instruction storage area and having a second input port connected to said data storage area, said multiplexer (90) being configured to output said at least one previous instruction page address received from said first input port when said present request is said present instruction request, and said multiplexer being configured to output said at least one previous data page address received from said second input port when said present request is said present data request. An apparatus for use in a virtual memory system as claimed in claim 1 wherein said memory (16) is a cache memory configured to supply said required information in response to said physical address. An apparatus for use in a virtual memory system as claimed in claim 5 wherein said speculative address generation unit (42) is separate and distinct from said cache memory. An apparatus for use in a virtual memory system as claimed in claim 1, wherein a case where the accurate physical page address is obtained prior to the memory (16) outputting data based on the first lookup operation, said control signal causes the abort in which the memory (16) does not output any data based on the first lookup operation. A method for use in a virtual memory system for reducing delay between generation of a virtual address by a processor core (12) and transmission to a memory (16) of a physical address corresponding to said virtual address, said generation of said virtual address by said processor core (12) effecting a request for required information, the method comprising: receiving, in an accurate physical address generation unit (62) operatively connected with said processor core (12) and said memory (16), said virtual address and generating a corresponding accurate physical address; generating, in a speculative address generation unit (42) operatively connected with said accurate physical address generation unit (62) and said memory (16), a speculative address based only on another accurate physical address generated by said accurate physical address generation unit (62) for a previous virtual address that corresponds to a previous request for required information output from said processor core (12); and comparing, in a comparator unit (68) operatively connected with said accurate physical address generation unit (62), said memory (16) and said speculative address generation unit (42), said accurate physical address with said speculative address; characterised by said speculative address generation unit (42) transmitting said speculative address to said memory (16) prior to said accurate physical address generation unit (62) generating said accurate physical address, said virtual address being generated after generation of said previous request for required information by said processor core (12), no other address requests to said memory (16) being generated by said processor core (12) in between generation of said virtual address and said previous request for required information; said comparator unit (68) transmitting said accurate physical address received from said accurate physical address generation unit (62) directly to said memory (16) in a transmission path from said comparator unit (68) to said memory (16), said transmission path bypassing said speculative address generation unit (42) when said accurate physical address does not match said speculative address, including configuring said memory (16) to initiate a first lookup operation based on said speculative address upon receipt of said speculative address without additional delay, said comparator unit (68) being configured to transmit to said memory (16) a control signal indicative of whether said speculative address matches said accurate physical address, said memory (16) being configured to abort said first lookup operation based on said speculative address and initiate a second lookup operation based on said accurate physical address when said control signal indicates that said speculative address does not match said accurate physical address.

Inventors: KRANICH UWE, KRANICH, UWE
Applicants: ADVANCED MICRO DEVICES INC, ADVANCED MICRO DEVICES INC.
Application year: 1995
Main classification: G06F12
IPC codes: G06F12