Abstract:
A method includes filling a cache memory with a test pattern and forcing a write-back of the cache memory to a region of memory. The cache memory is refilled with the contents of the region of memory, and the contents of the cache memory are compared with the test pattern.

Description:
BACKGROUND 
     1. Field 
     The invention relates to the testing of memory circuits. 
     2. Background Information 
     During the course of operation computer systems may perform procedures known as power on self test (POST) and boot. A computer system is any device comprising a processor and a memory to store instructions and data to be supplied to the processor. Typically, the processor and memory are coupled by way of one or more busses. Booting is typically accomplished by either powering on the computer system, or resetting the computer system to an initial state. A POST may then be performed to diagnose and initialize resources, such as random access memory (RAM), before transferring control to the computer system&#39;s basic input/output system (BIOS). 
     Diagnosing memory may be complicated by the presence of cache memories. A cache memory is any memory which operates to store a copy of the contents of a larger, slower memory. The operation and benefits of cache memories are well known in the art. During POST, data values may be read and written to memory. A pre-selected data pattern may be written to a memory region to test and then read back. The data pattern written is compared with the data pattern read to verify the read-write operation of the memory. When the memory cache is present and enabled, write operations to the memory may modify ranges of the cache memory, not the memory to which the write operation is addressed. Likewise, read operations from the memory may result in the reading of data from regions of cache memory and not from the memory regions addressed. Consequently, operation of the memory regions may not be properly validated during POST. 
     Prior art approaches to this problem have taken the approach of disabling cache memory before writing the test pattern to and reading it back from the memory region to test. However, the performance benefits associated with enabling cache memory are lost under these approaches. 
     SUMMARY 
     In one aspect, a method includes filling a cache memory with a test pattern and forcing a write-back of the cache memory to a region of memory. The cache memory is refilled with the contents of the region of memory, and the contents of the cache memory are compared with the test pattern. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     The subject matter regarded as the invention is particularly pointed out and distinctly claimed in the concluding portion of the specification. The invention, however, may be further understood by reference to the following detailed description read with reference to the accompanying drawings. 
     FIG. 1 is a block diagram of an embodiment of a system in accordance with the present invention. 
     FIG. 2 is a block diagram of an embodiment of a processor in accordance with the present invention. 
     FIG. 3 is a flow chart of an embodiment of a method in accordance with the present invention. 
     FIG. 4 is a flow chart of an embodiment of a method in accordance with the present invention. 
    
    
     DETAILED DESCRIPTION 
     The embodiments described herein are merely illustrative, and one skilled in the art will appreciate that numerous modifications can be made which nonetheless fall within the scope of the present invention. 
     FIG. 1 shows an embodiment  100  of a system in accordance with the present invention. Embodiment  100  comprises a processor  120  and a POST memory  130 . Post memory  130  stores POST instructions and data, and may be a read-only memory, flash memory, or other type of memory. Processor  120  is coupled to a processor bus  110 , which is also sometimes referred to as a “front side bus”. A controller  116  is also coupled to bus  110  and provides for the routing and control of signals between processor  120  and memory  118 . Memory  118  is coupled to controller  116  by memory bus  112 . A bus  114  is also coupled to controller. Post memory  130  is coupled to bus  114 . The controller  116  may rout signals from devices, such as post memory  130 , coupled to bus  114  to and from memory  118  and to and from processor  120 . 
     The processor  120  may be implemented using any semiconductor fabrication technology and may execute any instruction set including, but not limited to, instruction sets supported by an Intel Corporation Pentium® processor or compatible processor. The busses may be implemented using technologies for propagating signals including, but not limited to, electronic and optical conductors. The memory  118  is typically some form of random access memory technology, of which many are well known in the art. 
     FIG. 2 shows an embodiment of processor  120  in accordance with the present invention. Processor  120  includes logic circuits  202  for executing instructions. Logic circuits  202  may comprise, for example, an arithmetic logic unit and a floating point unit. A level one (L1) cache  204  and a level two (L2) cache  206  are coupled to logic circuits  202  and provide caching of memory regions which are likely to be accessed during the course of instruction execution by logic circuits  202 . In one embodiment L1 cache  204  is substantially smaller in terms of storage capacity than L2 cache  206 . However L1 cache  204  will provide logic circuits  202  with faster access to instructions and data than will L2 cache  206 . 
     L2 cache  206  may comprise a copy of the contents of memory  118  likely to be accessed by logic circuits  202  during the course of execution. L1 cache  204  may comprise a copy of the contents of memory  118  which are most likely to be accessed during the course of execution. The contents of the L 1  cache  204  may comprise the portion of the contents of the L2 cache  206  that are most likely to be accessed in the course of execution. 
     FIG. 3 shows a method in accordance with the present invention. At  302  the process of booting a computer system starts. Initial configuration tasks are performed at  304 . At  306  caching is enabled. Memory is tested at  308  with caching enabled. At  310  additional configuration tasks are performed. An operating system is booted at  312 . 
     Advantages of caching are realized by enabling caching during the memory test. For example, it the memory test involves comparing the contents of memory with a test pattern, caching may substantially improve the speed the test because the contents of the memory may be cached during the comparison. Prior art approaches disabled caching during the memory test because caching interferes with the reading and writing of data patterns to the memory to test. 
     FIG. 4 shows a memory test process in accordance with the present invention. At  402 , the first address of each line of memory to test is read. A line of memory is a sequence of bytes the size of a cache line. A cache line is a number of bytes in the cache memory which may be read or written in a single bus cycle. In one embodiment, reading the first address of a line of memory to test with caching enabled copies the contents of the memory line to cache memory. An entire line of the memory, beginning at the address which is read, is loaded to the cache. Many conventional cache memories operate in this fashion. 
     The range of memory to test for a particular iteration of process  400  may be confined to the size of largest available cache, for example the size of the L2 cache. In this case the entire contents of the memory range to test for a particular iteration will fit into the cache memory. In addition, some range of the memory to test may be copied to the L1 cache (if L1 cache is present) according to the replacement algorithms employed by the caches. 
     At  404  a test pattern is written to each address of the memory to test. With caching enabled, the test pattern is actually written to the cache, not to the memory to test. At  406  a write-back from the cache to the memory is forced to occur. This causes the test pattern stored in the cache to be written to the range of memory to test. At  408  the cache is invalidated. When the cache is invalidated subsequent memory reads result in replacement of the contents of the cache. In some embodiments, execution of a single instruction by the processor may result in both the forced write-back and invalidation of the cache. For example, some processors manufactured by Intel Corporation may have an instruction WBINVD which operates in this manner. 
     At  410  the first address of each line of memory to test is read. In some embodiments, this will again result in the cache memory loading a copy of each line of the memory to test. If the memory is operating properly the contents will include the test pattern which was written to the memory as a result of the write-back from the cache. At  412  each memory address is compared with the test pattern. With caching enabled, this comparison is carried out on the contents of cache memory, resulting in a performance improvement. If the contents match the test pattern, memory operation is verified. If the pattern does not match the test pattern, this might be an indication that memory is not operating properly. In one embodiment, the cache memory itself is tested independently before executing method embodiment  400 . Therefore deviations detected in a test pattern  412  by method  400  indicate a defect in the operation of memory  118 , not cache memory. 
     While certain features of the invention have been illustrated as described herein, many modifications, substitutions, changes and equivalents will now occur to those skilled in the art. It is, therefore, to be understood that the appended claims are intended to cover all such embodiments and changes as fall within the true spirit of the invention.