Abstract:
A multiprocessor data processing system in which a number of independent processors can concurrently operate on a shared memory even when one processor is performing a read-modify-write (RMW) operation, the system having a locking, content-associative write buffer and a controller for identifying RMW requests, for addressing the buffer and, for issuing directives to lock the buffer, to validate particular data blocks in the buffer and to transfer data back and forth between the processors, the memory and the buffer.

Description:
BACKGROUND OF THE INVENTION 
     This invention is in the field of data processing and, in particular, relates to a method and apparatus for the resolution of memory access demands in multiple processor systems. 
     In many advanced data processing systems, a number of independent processors can have access to a main memory shared by the system. When a processor wishes only to read a particular memory location or even rewrite a specified location, access can be controlled sequentially with little cost in performance. However, it is also common for processors to perform an operation known as a read-modify-write (RMW) operation or the like. This operation involves reading data out of a selected memory location, processing the data read out, and writing modified data back into the specified location. 
     The conventional method for protecting the system from situations in which a second processor seeks access to a location in the middle of a RMW operation has been to freeze the memory bus until the operation is completed; this solution, unfortunately, cuts drastically into performance. In response, systems also have been proposed that use flags, lock bits or the like to deactivate a block of data being manipulated. Nonetheless, a problem remains because when one processor is operating on such locked data, another processor often cannot read the data much less operate upon it concurrently. 
     The problem of handling multiple access requests can become acute when one of the independent processors is carrying out instructions on a string of data, such as moving a string of ASCII-coded data. Since the 8-bit ASCII words (representing language characters, punctuation, etc.) are smaller than the typical 16 bit (or 32 bit) registers around which advanced systems are designed, a modification which involves changing less than the full 16 (or 32) bits often is not controlled by the system hardware. 
     For example, a 32-bit wide memory register common to a number of processors can store two data blocks consisting of an integer value (i.e., a fortran *2 integer) on one side (the upper 16 bits) and two ASCII characters on the other side (the lower 16 bits). If a first processor wished to replace the ASCII characters only, it would need to read the entire register, modify the contents to keep the integer value on one side while changing the characters on the other side and then write the modified 32-bits into the memory. Since this RMW operation cannot occur instantaneously, a second processor might write a new entry into part of the register in the interim (i.e., to replace the integer value) and this data would be lost if the first processor was allowed to enter its modification without any controls. Hence, the solution to date has been to exclude the second processor in one fashion or another while the first processor performs a RMW operation. 
     There exists a need for better memory access systems in which a plurality of processors can share memory locations with a minimum of interruptions. In particular, a long-felt need would be satisfied by an access scheme which would permit other processors to perform RMW operations without freezing the memory bus or completely deactivating a block of data. 
     SUMMARY OF THE INVENTION 
     The present invention resides in an improved data processing system and method wherein a plurality of processors can concurrently operate on the system&#39;s memory even when one processor is performing a read-modify-write (RMW) operation a particular memory location. The conventional techniques of &#34;freezing&#34; the memory bus or deactivating a block of data are avoided by employing a content-associative write buffer in conjunction with a memory controller which locks the associated location until the read-modify-write operation is completed. 
     This invention is most useful in data processing systems which employ write-through buffers to control the movement of data between the processors and main memory. In a write-through scheme, a buffer is used to store a series of write instructions from a processor until the memory bus is cleared. Preferably, the buffer is a content associative buffer which also permits a processor seeking to read data to poll the buffer for latest data. In the present invention, the content-associate buffer also permits the controller to control new entries whenever data is undergoing a RMW operation. 
     In one preferred embodiment a field in microcode is provided for the issuance of a directive whenever a read-modify-write sequence is initiated by a processor. The directive (i.e., &#34;TAKE A LOCK&#34;) is dumped into the write buffer at the appropriate address with a tag bit denoting the operation as a lock--not a write, as well as another tag bit identifying the processor. Subsequently processors seeking to merely read data from the same location will not be impeded and such other processors, in fact, can also write new data for insertion into the memory location. However, new data transmitted to the memory location will not be entered but rather will remain in the write buffer until the read-modify-write process of the first processor is completed. Moreover, the microcode instructions further prevent the overwriting of the second processor&#39;s data by the first processor, thereby reversing the typical process wherein a second write command to same address in write buffer overrides any data residing there. Thus, uninterrupted processing essentially is maintained for the two processors. This technique can be applied as well to the case of three or more processors by extrapolation. 
     The invention will next be described in connection with certain preferred embodiments, however, it should be clear that those skilled in the art can make various changes and modifications without departing from the spirit or scope of the invention. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a general block diagram of the memory access system of the invention. 
     FIG. 2 is a more detailed block diagram of the locking content-associative write buffer of FIG. 1. 
     FIGS. 3a-3d are schematic drawings of the memory access process of the invention. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     In FIG. 1, a general block diagram of the memory access system 10 is shown including at least two processors 12 and 14 connected to a common memory 18 via a memory bus 16 which includes a data path 16a, an address path 16b, and a command path 16c. (Of course, the data, address and command signals could be transmitted by less than three discrete physical lines; for example, all three signals could be multiplexed or otherwise encoded onto a single line). The common memory 18 is typically a high speed MOS memory of about one megabyte although the access system could also be implemented with different types of memories or memories of different sizes. 
     Interposed between the processors 12, 14 and the memory 18 is a controller 20 and a locking content-associative write buffer 22. The controller 20 is similar is most aspects to conventional controllers used to control access to memory locations. Typically, the controller 20 is implemented by a combination of hardware and firmware (or microcode). In the present invention, controller 20 can include microcode instructions for identifying RMW requests for addressing and formatting the buffer 20, and for issuing the necessary directives as described below to lock particular addresses, and to transfer data back and forth between the processors 12, 14, the memory 18 and the buffer 22. Implementation of the buffer 22 can be achieved with commercially available components or individualized designs by those skilled in the art. Essentially, the content-associative structure is an address-organized buffer accessed by applying the address word. In one preferred embodiment, the structure contains four addressed entries. 
     The structure of the buffer 22 is shown in more detail in FIG. 2. The buffer includes a plurality of address blocks A, B, etc. Each address in buffer 22 corresponds to a memory location in the main memory 18. Associated with each address are two sixteen-bit strings of data A 1  . . . A 16  and A 17  . . . A 32 , a validity bit for each string V 1 , V 2 , a lock bit L, and at least one bit for identifying the processor that issues the lock directive ID. (For the case of two processors, only one bit is typically needed to distinguish between processors; however, for three or more processors, additional bits would be needed). Each of the two sixteen-bit strings of data stored in buffer 22 is called a &#34;data block&#34;. The two data blocks make up a memory data word. In the illustrated embodiment, data is transfered as a block or set of two blocks. Sixteen-bit blocks are the minimum size for a data transmission. 
     The structure described above is intended for use in a system where the data path of the memory bus can accomodate thirty-two bit wide data transmissions and the operating system is designed to assure the integrity of sixteen-bit block transmissions as well. Of course, the teachings herein can also be applied to sixteen-bit data transmissions and eight-bit data block designs as well. 
     The operation of the memory access scheme is shown schematically in FIGS. 3a through 3d. In FIG. 3a, a single entry in buffer 22 is shown in its initial state containing data from any one of the processors connected to the system. When a RMW operation is initiated by a processor, for example CPU .0. as shown in FIG. 3b, controller 20 sets the lock bit (i.e., to a &#34;1&#34; value) and the validity bits V 1  and V 2  are initialized as well (i.e., to a &#34;.0.&#34; value) indicating that one of the first or second data blocks is being modified. The processor performing the modification is also identified at the same time by the identification bit ID (i.e., set to &#34;.0.&#34; for CPU .0.). 
     Since the buffer entry in FIGS. 3a-3d is associated with an address as shown in FIG. 2, this &#34;content-associative&#34; characteristic is used to advantage by controller 22. If during the RMW of the CPU .0., another processor seeks to execute a write instruction for a particular memory location, controller 22 polls the buffer 20 for the address associated with that location. If the address is not listed in the buffer 22, the processor is allowed to write through the buffer 22 into memory 18. 
     If, on the other hand, the other processor wished to write into one of the memory addresses already stored in the buffer 22 under a lock bit, the controller recognizes the address sought as a locked address and takes the necessary steps to preserve this new data while the RMW operation is being completed. For example, if as shown in FIG. 3c, were to write new data for the first data block, the validity bit V 1  associated with that block would be set (i.e., to a &#34;1&#34; value) indicating that this new data is to be saved at the expense of any modified data subsequently written by CPU .0.. (It is assumed that proper programming prevents the second processor from seeking to change that portion of the data in the buffer that is being modified by the first processor). When the first processor completes its modification of data as shown in FIG. 3d, only the portion (i.e., the second data block) that is governed by the validity bit V 2  which was not set by CPU1, is entered into the buffer. At this point, both validity bits are set and this state (or the incrementing of the lock bit or the identification bit) informs the controller 20 that this buffer address is ready for loading into memory. 
     Additions, subtractions, deletions and other modifications of the described preferred embodiments will be obvious to those practiced in the art and are within the scope of the following claims.