Abstract:
A personal computer has a memory system including a write-through cache which is accessible by more than one device. A snoop mechanism includes logic that monitors bus master control signals to determine if a new memory write cycle has been started before a current snoop cycle has finished. If a new cycle has been started, then a corresponding snoop cycle occurs which overlaps the new memory cycle and is pipelined with the previous snoop cycle so that the snooping mechanism does not fall behind the memory write cycles.

Description:
FIELD OF THE INVENTION 
     This invention relates to the field of data processing, and, more particularly, to improvements in a personal computer having a memory system provided with a write-through cache and pipelined snoop cycles for invalidating lines in such cache. 
     BACKGROUND OF THE INVENTION 
     Memory systems are known which include a main memory and a high speed cache for temporarily storing data, the data in the cache being readily accessible by a processor or microprocessor. If a computer is designed so that more than one device has access to the cacheable memory, cache coherency must be maintained to keep the cache contents consistent with memory. Consider the following situation: a central processing unit (CPU) is using a write-through cache to temporarily store data from main memory while an alternate bus master also has access to the data in main memory. If the bus master writes new data into a memory location which also happens to reside in the CPU cache, then an invalidation cycle must occur to let the CPU know that the data in its cache is no longer valid. An invalidation cycle, also known as a &#34;snoop&#34; cycle, must occur simultaneously with the bus master write cycle. Such action will eliminate any latency between the time that new data is written into main memory and the time that the CPU knows that its cache location is invalid. 
     If a bus master performs several write cycles to main memory, each cache line affected must be invalidated in the cache. As long as the basic snoop cycle is shorter in duration than a memory write cycle, there is no problem in performing consecutive snoop cycles. However, if the length of the basic snoop cycle is longer than a memory write cycle, one of two situations might occur: 1) cache coherency (contents of cache being the same as corresponding contents of main memory) will not be maintained because the snoop control mechanism cannot keep up with the bus master write cycles, or 2) the bus master is forced to run slower cycles so that the snoop cycles can be completed. If the snoop cycles can be pipelined, then such situations can be avoided. 
     SUMMARY OF THE INVENTION 
     One of the objects of the invention is to provide an improved snoop control mechanism for a memory system having a write-through cache, which mechanism pipelines successive snoop cycles having a basic snoop cycle duration longer than the duration of a memory write cycle. 
     Another object of the invention is to provide a snoop control mechanism in which snoop cycles are pipelined to prevent cache incoherency. 
     A further object of the invention is to pipeline snoop cycles so as to allow a bus master to run at full speed to perform successive write cycles. 
     Still another object of the invention is to write to memory locations having corresponding cache locations located in different cache lines and invalidate such cache lines using snoop cycles that are pipelined and have a basic duration longer than that of a memory write cycle. 
     Briefly, in accordance with the invention, a memory system has a write-through cache which is accessible by more than one device. A snoop mechanism includes logic that monitors bus master control signals to determine if a new memory write cycle has been started before a current snoop cycle has finished. If a new cycle has been started, then a corresponding snoop cycle occurs which overlaps and is pipelined with the previous snoop cycle so that the snooping mechanism does not fall behind the memory write cycles. 
    
    
     DRAWINGS 
     Other objects and advantages of the invention will be apparent from the following description taken in connection with the accompanying drawings wherein: 
     FIG. 1 is a block diagram of a personal computer embodying the invention; 
     FIG. 2 is a more detailed block diagram of a portion shown in FIG. 1; 
     FIG. 3 is a diagram of a state machine shown in FIG. 2; and 
     FIG. 4 is a timing diagram of waveforms illustrating pipelined snoop cycles produced by the state machine shown in FIG. 3. 
    
    
     DESCRIPTION 
     The following description first describes an exemplary data processing system which incorporates the invention, and then describes details of a snoop mechanism constructed in accordance with the invention. 
     DATA PROCESSING SYSTEM 
     Referring to FIG. 1, computer system 10 includes system board (i.e., planar) 12 as well as processor complex 14. Processor complex 14 is connected to planar 12 via processor complex connector 15. Planar 12 includes a planar memory 16 as well as input/output (I/O) bus 18, which may for example conform to the MICRO CHANNEL computer architecture. Memory 16 includes two banks 17A and 17B which forms a two-way interleaved memory. Expansion devices 19 may be connected to computer 10 via I/O bus 18. Planar 12 may also include conventional video circuitry, timing circuitry, keyboard control circuitry and interrupt circuitry (all not shown) which are used by computer 10 during normal operation. 
     Processor complex 14 includes processor portion 20 and base portion 22. Processor portion 20 is connected to base portion 22 via local bus connector 24. Processor portion 20 operates at 50 MHz and base portion 22 operates at 40 MHz. 
     Processor portion 20 includes microprocessor 30 (e.g., available from Intel, Inc. under the trade designation 486), cache control module 32, memory 34 (e.g., static random access memory (SRAM)), and frequency control module 35 as well as address buffer 36 and data buffer 38. A data information path is provided between microprocessor 30, memory 34 and data buffer 38. An address information path is provided between microprocessor 30, cache control circuit 32 and address buffer 36. A control information path is provided between microprocessor 30, cache control module 32 and frequency control module 35. Additionally, an address information path and a control information path are provided between cache control module 32 and memory 34. The data, address and control information paths represent a processor bus. 
     Memory 34 provides a second level cache function by storing in short term memory information from memory 16 or from memory which is located on an expansion device 19. Cache control module 32 includes tag random access memory (RAM) 37 which stores the address of memory 16 to which the information, which is stored in memory 34, corresponds. 
     Frequency control module 35 synchronizes the 50 MHz processor portion with the 40 MHz base portion; frequency control module 35 also controls buffers 36, 38. Accordingly, frequency control module 35 determines when information is captured by buffers 36, 38 and when information that is stored in buffers 36, 38 is overwritten. Buffers 36, 38 are configured to allow two writes from memory 16 to be stored in buffers 36, 38 simultaneously. Buffers 36, 38 are bidirectional, i.e., buffers 36, 38 can latch information which is provided by processor portion 20 and information which is provided to processor portion 20. Because buffers 36, 38 are bidirectional, processor portion 20 may be replaced or upgraded while maintaining a standard base portion 22. 
     Base portion 22 includes memory controller 50, direct memory access (DMA)controller (DMAC) 52, central arbitration control point (CACP) circuit 53, bus interface unit (BIU) 54 and buffer/error correction code (ECC) circuit 56. Base portion 22 also includes driver circuit 58, read only memory (ROM) 60, self test circuit 62 and buffer circuit 64. A control information path is provided between memory controller 50 and frequency control module 35 of processor portion 20. Control information paths are also provided between: memory controller 50, DMA controller 52 and bus interface unit 54; memory controller 50 and driver 58; driver 58 and memory 16; bus interface unit 54 and buffer 64; buffer 64 and I/O bus 18 of planar 12; and, CACP 53 and I/O bus 18 of planar 12. An address information path is provided between memory controller 50, ROM 60 and self test circuit 62 as well as address buffer 36 of processor portion 20. Address information paths are also provided between: memory controller 50, DMA controller 52 and bus interface unit 54; memory controller 50 and driver 58; driver 58 and memory 16; bus interface unit 54 and buffer 64; and, buffer 64 and I/O bus 18 of planar 12. A data information path is provided between buffer/ECC circuit 56, ROM 60, and self test circuit 62 as well as data buffer 38 of processor portion 20. Data information paths are also provided between: buffer/ECC circuit 56, DMA controller 52 and bus interface unit 54; buffer/ECC circuit 56 and memory 16; buffer/ECC circuit 56 and memory 17; bus interface unit 54 and buffer 64; and, buffer 64 and I/O bus 18 of planar 12. The information paths may also be referred to hereinafter as &#34;busses&#34;. 
     Memory controller 50 analyzes address information which is received from processor portion 20 to determine if this information corresponds to an address of planar memory 16 or to an address of memory which is on an expansion device 19 (i.e., expansion memory). If the address information corresponds to an address of memory 16, then memory controller 50 initiates a planar memory cycle to memory 16. The address information from processor 30 comprises thirty two bits which are converted by memory controller into the appropriate row and column address bits for accessing memory 16. While the planar memory cycle is occurring, memory controller 50 allows either DMA controller 52, or a bus master expansion device 19 to access information via I/O bus 18. 
     If the address information corresponds to an expansion memory address, then memory controller 50 initiates an expansion memory cycle with the expansion memory. During an expansion memory cycle, the address which is provided to memory controller 50 is provided via bus interface unit 54 to I/O bus 18. The expansion device which includes the memory to which the address corresponds receives the memory address from I/O bus 18. If the data is being retrieved from the expansion memory, the data information which is stored in the expansion memory is provided to processor portion 20 via I/O bus 18, buffer circuit 64, bus interface unit 54, buffer/ECC circuit 56 and driver circuit 58. If the data is being written to the expansion memory, the data information is provided to the expansion memory via bus interface unit 54 and I/O bus 18. Also, DMA controller 52 controls interchanging information between memory 16 and memory which is on an expansion device 19. 
     DMA controller 52 provides three functions for processor complex 14. DMA controller 52 utilizes a small computer subsystem control block (SCB) architecture to configure DMA channels, thus avoiding the necessity of using programmed I/O to configure DMA channels. DMA controller 52 also provides a buffering function to optimize transfers between slow expansion devices and fast memory devices. DMA controller 52 also provides an eight channel, 32-bit data, address and byte transfer count direct memory access function. When providing the DMA function, DMA controller 52 may function in two modes. In a first mode, DMA controller 52 functions in a programmed I/O mode in which DMA controller 52 is functionally an I/0 slave. In a second mode, DMA controller 52 functions as a DMA bus master, in which DMA controller 52 arbitrates for and controls I/O bus 18. During this second mode, DMA controller 52 uses a first in, first out (FIFO) register circuit; data from a source is passed through the FIFO register circuit prior to being provided to a destination. Accordingly, a serial DMA operation is performed. 
     CACP 53 functions as the arbiter for computer system 10. CACP 53 receives arbitration control signals from DMA controller 52 as well as expansion devices 19 and controls, by providing arbitration control information, which device may transfer information via I/O bus 18 and for how long a particular device may control (i.e., own) I/O bus 18. 
     Bus interface unit 54 provides the bi-directional interface between the architecture of processor complex 14 and the architecture of I/O bus 18. Bus interface unit 54 also provides a buffering function to optimize the interface between the two architectures. Bus interface unit 54 also provides a bus sizing function. I.e., bus interface unit 54 can receive information in 32-bit wide segments and provide the information to I/O bus 18 in smaller segments depending on the requirements of the expansion device 19 with which processor complex 14 is communicating. 
     Buffer/ECC circuit 56 provides a data path between processor portion 20 and memory 16, a data path between memory 16 and DMA controller 52 and bus controller 54. Buffer/ECC circuit 56 also provides a data path between processor portion 20 and DMA controller 52 and bus interface circuit 54. Buffer/ECC circuit 56 checks for errors via error correction code; additionally, buffer/ECC circuit 56 is capable of operating with and supporting parity memory for downward compatibility with planar 12 which include parity memory. 
     Driver circuit 58 provides control information and address information from memory controller 50 to memory 16. Driver circuit 58 drives this information based upon the number of SIMMs which are used in memory 16. I.e., driver circuit 58 varies the signal intensity of the control and address information which is provided to memory 16 based upon the size of memory 16. The size of memory 16 is determined by software during an initialization of computer 10. 
     Buffer circuit 64 provides isolation between base portion 22 and planar 12. Buffer circuit 64 uses buffers which allow buffer circuit 64 to capture boundary information between I/O bus 18 and bus interface unit 54 in real time; i.e., the buffers store the information as it appears at connector 15. Accordingly, if computer 10 experiences a failure condition, buffer circuit 64 may be accessed by a computer repair person to determine the information which was present at connector 15 upon failure of computer 10. 
     Self test circuit 62, which is connected to a plurality of locations within base portion 22, provides a plurality of self test features. Self test circuit 62 accesses buffer circuit 64 to determine if failure conditions exist. Self test circuit 62 also tests the other major components of base portion 22 upon power-on to determine whether computer 10 is ready for operation. 
     Microprocessor chip 30 has a CPU 66 and a first level write-through cache 68. Such cache has a plurality of storage location arranged in cache lines where each cache line holds sixteen bytes of information. When CPU accesses a location in main memory, that location along with adjacent locations are read into a line of caches 34 or 68. DMA controller 52 and BIU 54 act as bus masters and can access memory 16 directly. Should a bus master write to a location in memory 16, a check is also made to see if the contents of such location are also stored in either cache. If so, the cache line containing such location must be invalidated. Cache line invalidation is done by snoop cycles under the control of a snoop mechanism located in memory controller 50. 
     SNOOP MECHANISM 
     Referring to FIG. 2, controller 50 receives a plurality of input signals and produces a plurality of output signals, which signals are discussed in more detail hereinafter and control memory and snoop cycles. The operation of controller 50 is timed in accordance with a CLK signal received from a standard system clock or oscillator (not shown). Controller 50 generally comprises a snoop state machine (SM) 70, a system SM 72, decode logic 74, and an address driver 80. Snoop SM 70 controls snoop cycles and system SM 72 controls memory accesses including memory write cycles. Memory controller 50 is connected to DMAC 52 and to BIU 54 via address and control lines including an address bus 76 for receiving SADDR signals, control lines 77 for receiving SADS, SWR and SMIO signals, and control line 78 for sending a SRDY signal. Bus 76 is further connected to decode logic 74 and driver 80. Driver 80 is a bidirectional driver. Control lines 77 are further connected to both state machines 70 and 72, and control line 78 is connected to system SM 72. SM 72 is connected to memory through a planar memory bus 83 that includes lines for transmitting RAS, CAS, and MADDR signals from SM 72 to memory 16. 
     The general operation of system SM 72 is as follows. When a system address SADDR is received on bus 76, decode logic 74 determines if the address is a planar memory cacheable address, and if so, produces an output that is fed on bus 75 to both state machines. System SM 72 also receives the system address strobe, write/read, and memory IO signals SADS, SWR, and SMIO on lines 77. When the combination of such signals defines a memory write request to planar memory 16, state SM 72 transmits to memory 16 time multiplexed row and column addresses MADDR, and row and column address strobe signals RAS and CAS, to write to the addressed location. System SM 72 sends a SRDY signal to the bus master when data has been accepted, which signal may be used to gate the next data item to be stored. The SADS and SRDY signals define the beginning and end of a memory cycle. 
     Snoop SM 70 has inputs connected to lines 75 and 77. When a write request is made to cacheable memory, SM 70 determines if a snoop cycle is required. If a snoop cycle is required, snoop SM 70 then generates on lines 82, 86 and 88 ENABLE, AHOLD, and EADS signals. In response to receiving an active ENABLE signal, driver 80 gates a snoop address onto bus 84 which address goes to the caches in processor portion 20. The AHOLD and EADS signals control invalidating cycles in the caches. The AHOLD signal is sent to the microprocessor as a standard address hold request permitting access to the local processor bus for performing an invalidation. EADS is an external address valid input signal indicating a valid snoop address, and such signal causes a cache line invalidation to occur. 
     The memory controller external signals shown in FIG. 2 are standard and it is the timing thereof in accordance with the invention that produces pipelined snoop cycles. There are certain assumptions or conditions that the overall system must satisfy in order to utilize the invention. The system is a store-through memory/cache system which requires invalidation of bus master write cycles. The worst case conditions for snoop cycles to keep up with memory write cycles occur when memory writes occur back-to-back on consecutive cycles to different cache lines all having the same row address. A basic snoop cycle has a predetermined fixed length due to system timing and cache architecture. A memory write cycle is shorter than the basic snoop cycle. The basic snoop cycle can be shortened when operating in pipelined mode. In the exemplary embodiment, the memory write cycle requires four clock periods or simply &#34;clocks&#34;, a basic snoop cycle requires seven clocks, and the basic snoop cycle can be shortened to four clocks in pipelined mode. 
     Referring to FIG. 3, snoop SM 70 has seven states respectively denoted S0-S6. State S0 is an idle state which remains in a loop denoted by path 100 until a negative going SADS signal is received from a bus master whereupon SM 70 switches to state S1. In state S1, the decode logic output becomes available, a determination is made if the current cycle is a memory write to cacheable planar memory and if it will require a corresponding invalidation or snoop cycle. It is possible that the address is to a cacheable planar memory location but that because a previous snoop cycle has already invalidated the corresponding cache line, a snoop cycle is not required. If no snoop cycle is required, a transition 102 switches SM 70 back to the idle state S0. If a snoop cycle is required, SM 70 switches to state S2 in which the AHOLD signal is driven high or activated. This action gains access to the local processor address bus and allows second level cache 34 to setup and prepare for receiving the snoop address. In the particular implementation, two clocks are required to accomplish such setup. Thus, following S2, two delay states S3 and S4 occur allowing the second level cache setup to be made. 
     State S5 generates the ENABLE signal causing driver 78 to place a snoop address onto bus 84. Then, address strobe EADS is driven in state S6 and this signal is received by the caches and causes the addressed cache line to be invalidated. State S4 also monitors or looks for an active SADS signal and makes note of such fact which note is made use of in state S6. If no active SADS signal is detected or noted in state S6, a snoop cycle ends and a transition 110 is made switching SM 70 back to state S0. If an active SADS signal is noted in S4, a transition 104 is made switching SM 70 back to state S3 to execute a pipelined snoop cycle having a duration of four clocks. Such transition eliminates or bypasses the first three clocks in a basic snoop cycle (BSC) for the following reasons. First, the first two clocks of a BSC are used to receive the SADDR signals and process them in decode logic 74 which is independent of the snoop SM. When the SADS signal becomes available in S4, decode logic 74 makes its determination during S5 and S6 and such determination thereupon becomes available to SM 70. Second, since the AHOLD signal is already driven high, state S2 can be eliminated. 
     The foregoing discussion of using transition 104 occurs using a fast memory that requires four clocks. If the memory is slower and requires five clocks, the SADS signal occurs in state S5 and a transition 106 returns from state S6 to S2. If the memory is still slower and requires six clocks, transition 108 is made from state S6 to state S1. 
     Referring to FIG. 4, the clocks as defined by CLK signal are consecutively numbered on the top line, and three consecutive memory write cycles (MwC) MWC1-MwC3 are shown as occurring during clocks 1-12. Each MRC has a duration of four clocks. During each memory write cycle, the address SADDR of the location to be written to, along with an address strobe signal SADS, is sent to controller 50 and the SMs. System SM 72 then acts in normal fashion to generate planar memory address MADDR and the column and row strobes CAS and RAS for writing to the addressed locations. FIG. 4 illustrates operation at the highest performance in which the snoop cycles are able to keep up with consecutive memory write cycles under the aforementioned worst case conditions. At the end of each memory cycle, SM 72 sends the SRDY signal back to the bus master thereby allowing the bus master to write to a new location. 
     A basic snoop cycle (BSC) lasts seven clocks and the consecutive pipelined snoop cycles (PSC) each last four cycles. In the BSC, states S1-S3 occur in clocks 1-3 and AHOLD is switched in clock 3 to prepare the caches for line invalidation. Such preparation occurs during clocks 4 and 5. A SNOOP ADDRESS is driven onto bus 84 and thereby becomes valid in clock 6 and the BSC ends with the EADS signal being transmitted in clock 7. Since a SADS appeared in clock 5, when the snoop SM is in state S4, PSC1 then follows in clocks 8-11, and because of the SADS signal in clock 12, PSC2 occurs in clocks 12-15. Note should be made that the memory write cycles precede the pipeline snoop cycles and thus allow a snoop cycle to determine before it ends that another memory write cycle is occurring which requires a subsequent pipeline snoop cycle. 
     It should be apparent to those skilled in the art that many changes can be made in the details and arrangements of steps and parts without departing from the scope of the invention as defined in the appended claims.