Computer memory system

Abstract: A computer memory system (10) is adapted for connection to a processor which is of one of a plurality of processor types. The memory system (10) has programmable characteristics which are programmable in dependence on the connected processor type. The memory system (10) includes a first cache (16), for which a programmable characteristic is the type of data stored therein and a second cache (20) for which a programmable characteristic relates to which devices can have access thereto. A third programmable characteristic relates to the type of data stored on pages of the main memory (12) in the memory system (10).

Description: This invention relates to computer memory systems. The performance of a computer system including a host processor and a memory system can be enhanced by the use of a memory hierarchy. For example, a three tiered memory can be constructed from low, medium, and high speed memories. A low speed memory may be a magnetic disk for low cost, bulk storage of data. A medium speed memory may be constructed from DRAMs for use as the computer system's main memory. A high speed memory may employ SRAMs for use as a processor cache memory. The theory behind memory hierarchy is to group code (instructions) and other data to be executed by the system processor in the highest speed memory. Since high speed memory is typically the most expensive memory available, economics dictate that it be relatively small. Main memory consisting of DRAMs is denser and less expensive than a cache memory with SRAMs, and can therefore be significantly larger than the cache memory. During operation, instructions and other data are transferred from system memory to the cache memory in order to have quick access to the variables of the currently executing program. As additional data, not in the cache, is required, such data is transferred from the main memory by replacing selected data in the cache. Various replacement algorithms are utilized to determine which data is replaced. An efficiently operating cache architecture exhibits a high ratio of "hits" to accesses. A "hit" occurs when data requested is in the cache. A number of factors influence the hit ratio. The dominant factor is the locality of reference of the code being executed. In other words, if the code is located in proximate physical locations in memory, the hit ratio will be higher than if the code is widely distributed throughout memory. Another factor influencing the hit ratio of a cache is the number of devices having access to the memory. If only a single bus master, such as the system processor, has access to the memory, the data stored in the cache can be controlled to achieve a reasonably high hit ratio. However, when more than a single bus master has access to the memory through the same cache, the cache can bounce back and forth between requests from the bus masters, greatly reducing the hit ratio. In other words, the cache is non-discriminatory, with the demands of the system processor and other bus masters affecting the cache equally. One operation can significantly impact the data make-up of the cache. For example, data cached in response to memory accesses from a non-host CPU bus master will overwrite data needed by the host processor. Another factor affecting the hit ratio relates to the fact that both code and non-code data are cached. Blocks of data in the system memory are mapped into different physical locations in the cache. If each block of data in system memory may be mapped to only a single location, the cache is known as a direct mapped cache. Set associative mapping involves each block of data being mapped to more than a single location. For example, if each block of data may be mapped to either of two locations, the cache is known as two-way set associative. Irrespective of the number of locations available for a system memory block, when both code and non-code data are being cached, there will be overlap in their respective mappings. Thus, when both code and non-code data are cached, there can be significant thrashing which takes place as data is replaced in response to memory accesses. In a known computer system including a host processor and a system memory, the operational characteristics of the system memory are designed in dependence on the type of host processor used. Thus, the operational efficiency of the computer system may be degraded if it is attempted to utilize a different type processor for the host processor. A computer memory system comprising a cache dedicated to a processor is known from US-A-4 078 254. It is an object of the present invention to provide a computer memory system which is efficiently operable with different types of host processors. Therefore, according to the present invention, there is provided a computer memory system adapted to be connected by bus means to a processor which is one of a plurality of different processor types, said memory system including a main memory connected to said bus means and at least a first cache connected to said bus means, said first cache being arranged to store data which is selected solely on the basis of memory accesses by said processor, characterized in that said first cache is arranged to store only code data if said processor is of a first type and is arranged to store both code data and non-code data if said processor is of a second type. One embodiment of the present invention will now be described by way of example with reference to the accompanying drawing, in which:- Figure 1 is a block diagram of a high performance computer memory system according to one form of the present invention. Figure 1 shows a block diagram of a computer memory system 10. System 10 includes a system memory 12 which in a preferred embodiment consists of dynamic random access memory (DRAM) chips. The data stored in memory 12 can be generally divided into code data (instructions) and non-code data. As used herein, the term "data" refers to information and includes both code data (instructions) and non-code data. Memory 12 is connected to other parts of a computer system (not shown) by bus means 14. Memory system 10 is designed for use with two or more bus masters. More particularly, it is designed for use with a host processor such as an Intel processor 386, 386sx or 486 in combination with other bus masters or devices which will compete with the host processor for access to memory system 10. Access to DRAM 12 is controlled by DRAM controller 22 which is located within bus means 14. Memory system 10 also includes an internal cache 16, a pre-fetch cache 18 and a write buffer cache 20, each connected to bus means 14. In a preferred form, internal cache 16 is a 4K byte, four-way set associative cache, pre-fetch cache 18 is a 128 byte, direct-mapped cache, and write buffer cache 20 is a 128 byte, two-way set associative cache. An important feature of the present invention is that the functionality of the various caches may be varied depending upon the host processor type (386, 386sx or 486) utilized. Memory system 10 has programmable operational characteristics based on characteristics of the processor. However, certain features of the caches do not vary. For example, internal cache 16 holds data which is selected solely on the basis of memory accesses by the host processor. In other words, internal cache 16 is dedicated to the host processor and will not be affected by memory accesses by other bus masters. It will be appreciated that each of the caches is readable by any of the bus masters. Thus, even though cache 16 will not allow data writes therein based on memory accesses by other than the system processor, it will be read by another bus master if requested data happens to reside therein. It will further be appreciated that each of the caches snoops (observes) any data writes not intended for it in order to invalidate its contents upon snoop hits, thereby ensuring coherency. Another immutable feature of the caches is that pre-fetch cache 18 contains solely code data pre-fetched from DRAM 12. Furthermore, it only pre-fetches code based on a memory access by the host processor. In operation, whenever the system processor requests code data not already in the pre-fetch cache, the next sequential 128 bytes of code are pre-fetched into cache 18 as a queue in anticipation of subsequent requests for code. Write buffer cache 20 only buffers data to be written into DRAM 12. It is not merely a write buffer, but is a cache which, as mentioned above, can be read by any bus master. However, it will not cache data from DRAM 12. An important feature of the present system is the separation of the functionality of each of the caches, such that the selective definition of those functions based on the processor type is readily effected. By this insight, the present system is able to achieve or exceed the performance of a system utilizing a cache many times larger than the cumulative size of the subject caches. With respect to the selective definition of function based on processor type, each cache exhibits operational characteristics which are programmable as a function of characteristics based on processor type. For example, one programmable characteristic of internal cache 16 is whether it holds only code data. For a system employing a 386 or 386sx system processor, internal cache 16 holds only code data, whereas for a system employing a 486 processor, internal cache 16 holds both code and non-code data. A programmable characteristic of write buffer cache 20 is whether or not it buffers data solely from a bus master other than the system processor. For a system employing a 486 system processor, write buffer cache 20 buffers data writes by any bus master other than the system processor, whereas for a system employing a 386 or 386sx system processor, write buffer cache 20 buffers data writes by any bus master including the system processor. The operational characteristics of the caches are defined through self configuration at power-on time based on information relating to the type of host processor present. DRAM controller 22 supports fast page mode for accesses to DRAM 12. Fast page mode is a well known technique for speeding up accesses to DRAM by activating a row line in a memory page and then strobing sequential column lines to transfer data into or out of DRAM. In the present embodiment, DRAM 12 is divided into pages which contain either code or non-code data. A register associated with DRAM 12 is located either in DRAM 12 or DRAM controller 22 and holds the page address of a most recently accessed page. In effect, the system provides a bias towards code pages or non-code pages depending upon the type of processor connected to the system. The type of data (code or non-code) for which the main memory 12 through controller 22 provides a bias, is another programmable characteristic of the present embodiment. For example, if the system processor is a 486, the address of the most recently accessed code address page is held in the register. In operation, both code and non-code data pages in DRAM 12 can be randomly accessed. If a code page is accessed on one cycle and a non-code page is accessed on the next cycle, the address of the code page is held in a register while the non-code page is accessed. Immediately after the non-code page access, the address in the register is used to reopen the code page. In contrast, if the system processor is a 386 or 386sx, the address of the most recently accessed non-code address page is held in the register. The combination of selective open page bias, fast page mode accesses and multiple caches provides increased system performance. Write buffer cache 20 is a two-way set associative cache. The non-code data region of memory may be divided into three areas known as list, heap and stack. Data blocks in memory are reserved for the list, heap and stack, each of which has its own organization and purpose. For example, a stack is a set of data elements, only one of which can be accessed at a time. The list data is primarily read and generally not written to. In structured programs, a high percentage of writes occur to the stack with the second most data writes occurring to the heap. By proper assignment of the heap and stack data blocks in DRAM and mapping respective blocks to opposing sets in the two-way set associative cache, increased operational efficiency can be realized. Furthermore, an open page bias in the DRAM for non-code data will effectively be an open page bias for list data. In this manner, operational efficiency of the subject invention is further enhanced. A significant advantage of the dual or multiple mode operation of the present invention is that it allows different types of processors to be installed with the subject memory system without significantly compromising their individual performance. One feature which is not programmable is the dedication of internal cache 16, which is the largest of the caches (4K Byte), to the host processor. Since the majority of memory operations come from the host processor, this allows the efficiency of the host processor to be maximized. Moreover, in a 386/486 Micro Channel environment, the other bus masters can utilize the streaming mode to improve their performance, an option not available to the system processor. As discussed previously, a programmable feature of internal cache 16 is whether or not it holds only code data. Because a 386 processor has no cache internal to itself, internal cache 16 is dedicated to code data - the primary type of data accessed by the 386 processor from memory. On the other hand, a 486 processor has its own internal cache and also has the ability to burst-read code data from prefetch cache 18 or from the DRAM 12 open page. Thus, for a 486 host processor, internal cache 16 is dedicated primarily to non-code data. Again, as discussed previously, a programmable feature of write buffer cache 20 is whether it buffers data solely from bus masters other than the host processor. For a 386 host processor, cache 20 buffers data writes from both the 386 and other bus masters. It buffers 386 data writes since internal cache 16 is dedicated solely to code, and it buffers data writes from other bus masters since internal cache 16 is dedicated solely to the 386. For a 486 host processor, cache 20 is dedicated solely to the other bus masters since internal cache 16 handles code and non-code data solely for the 486 host processor. The programmable operational characteristic of DRAM 12, whether the open page bias is for code or non-code data, is closely associated with the programmable characteristics of internal cache 16 and write buffer cache 20. For example, since the 486 can burst read code data, DRAM 12 is provided with an open page bias for code data. This also allows prefetch cache 18 to operate efficiently as internal cache 16 does not assist greatly with code data in this mode. In contrast, with a 386 processor, the open page bias for non-code data balances internal cache 16 which holds only code data.

Claims: A computer memory system adapted to be connected by bus means (14) to a processor which is one of a plurality of different processor types, said memory system including a main memory (12) connected to said bus means (14) and at least a first cache (16) connected to said bus means, said first cache (16) being arranged to store data which is selected solely on the basis of memory accesses by said processor, characterized in that said first cache is arranged to store only code data if said processor is of a first type and is arranged the store both code data and non-code data if said processor is of a second type. A computer memory system according to claim 1, characterized in that said first cache (16) is arranged to store only code data if said processor is of a type which has no cache internal to itself, and is arranged to store both code data and non-code data if said processor is of a type which has its own internal cache. A computer memory system according to either claim 1 or claim 2, characterized in that said bus means (14) is connectable to at least one bus master which competes with said processor for access to said memory system (10), and in that said memory system includes at least a second cache (20) which is arranged to buffer data to be written into the main memory (12), said second cache being arranged to buffer data writes from said at least one bus master and also from said processor if said processor is of said first type, and being arranged to buffer data writes solely from said at least one bus master if said processor is of said second type. A computer memory system according to claim 3, characterized in that said main memory (12) includes a plurality of first pages and a plurality of second pages, and in that a register is provided, arranged to hold the page address of the most recently accessed of said first pages, said page address being used to reopen the most recently accessed of said first pages after one of said second pages has been accessed, and said main memory (12) being arranged to store non-code data in said first pages if said processor is of said first type, and being arranged to store code data in said first pages if said processor is of said second type.

Inventors: ARNOLD FORREST O, ELLIS JACKSON L, KING EDWARD C, MOUSSAVI ROBERT B, VERMEER FULPS V, WEISSER PIRMIN L, ARNOLD, FORREST O., ELLIS, JACKSON L., KING, EDWARD C., MOUSSAVI, ROBERT B., VERMEER, FULPS V., WEISSER, PIRMIN L.
Applicants: NCR INT INC, NCR INTERNATIONAL, INC.
Application year: 1991
Main classification: G06F12
IPC codes: G06F12