The invention generally relates to memory devices.
A memory device often comprises logic that manages the flow of data going to and from a memory array. Often, the memory device includes a memory controller that processes Input/Output (I/O) commands to address specific memory locations in the memory array to read data from and write data to the array. Depending on the command set of the memory controller, the I/O commands can implement write operations through different ways. For example, a read-modify-write I/O command directs the memory controller to read a memory location and then write a new value to that location at once, either with a completely new value or some function of the previous value. In some instances, the memory device is accessible from multiple master components/devices through slave logic. And, those master components can assign their own identifications (IDs) with each I/O command issued to the memory device, leaving the slave logic with potential ID collisions that can prevent the I/O commands from operating on data in the memory device.
Some embodiments of the present invention are now described, by way of example only, and with reference to the accompanying drawings. The same reference number represents the same element or the same type of element on all drawings.
The figures and the following description illustrate specific exemplary embodiments of the invention. It will thus be appreciated that those skilled in the art will be able to devise various arrangements that, although not explicitly described or shown herein, embody the principles of the invention and are included within the scope of the invention. Furthermore, any examples described herein are intended to aid in understanding the principles of the invention and are to be construed as being without limitation to such specifically recited examples and conditions. As a result, the invention is not limited to the specific embodiments or examples described below.
The slave logic 200 is operable to receive and buffer read I/O commands and various forms of write I/O commands, including I/O commands that perform read-modify-write operations. Generally, I/O commands from the master devices 120 are processed in the order that they are received. Each of the I/O commands comprises an identification (ID) assigned by its originating master device. The slave logic 200 is operable to determine the IDs of the I/O commands so as to prevent ID collisions.
For example, master devices assign IDs to each of the I/O commands issued to the memory device. As master devices generally do not keep track of how other master devices assign IDs, the slave logic 200 is likely to receive I/O commands with the same ID. The slave logic 200 thus extracts IDs from each of the I/O commands received and determines whether any given ID exists with an I/O command presently being processed, more specifically an I/O command operable to perform a read-modify-write operation in the memory 110. If an I/O command with the same ID is being processed, the slave logic 200 stalls the later I/O command until the “in-progress” I/O command is complete. In this regard, the slave logic 200 is any device, system, software, or combination thereof operable to prevent ID collisions when multiple master devices issue I/O commands with the same IDs.
A memory controller 100 processes the I/O commands to specific locations in the memory 110. For example, each I/O command may have an address of a memory bank 111 in the memory 110 to where data is to be operated on. The memory controller 100 is any device, system, software, or combination thereof operable to process I/O commands to access memory locations in the memory 110 for read and write operations. In processing the I/O commands, the memory controller 100 determines an address within each I/O command that directs the read/write operation to a specific location in one of the memory banks 111-1-111-NM (where the reference number “M” merely represents an integer greater than “1” and not necessarily equal to any other “M” reference designated herein).
The memory controller 100 is operable to determine the order in which the I/O commands are processed is operable to “load” the I/O commands in the order that they are received so as to process the various read/write operations of the commands. For example, the memory controller 100 may load a write I/O command that writes to a specific address in one of the memory banks 111. Then, the memory controller 100 may load a read I/O command that reads from a specific address of the memory banks 111. Once read, the data is output from the memory 110 through a read multiplexer 112. Another example of an operation that may be formed via the I/O commands includes a read-modify-write operation that reads data from a location in the memory 110. The read-modify-write operation then writes a new value at that location in one clock cycle, either with a completely new value or some function of the previous value, as mentioned.
In this embodiment, the slave logic 200 and the memory controller 100 are configured “on-chip” with the memory 110. Generally, the slave logic 200 and the memory controller 100 are operable with various forms of data storage devices used to implement the memory 110. Some examples of the memory 110 include static random access memory (SRAM) and dynamic random access memory (DRAM).
After tracking the ID of the read-modify-write I/O command, in the process element 154, the slave logic 200 determines whether the I/O command has the same ID of any in-progress read-modify-write I/O command, in the process element 155. If so, the slave logic 200 stalls the other I/O command, in the process element 156, and loops until the previous read-modify-write I/O command is complete. Once the previous read-modify-write I/O command is complete, the slave logic 200 transfers the next read-modify-write I/O command to the memory controller 100 for processing and tracks the ID of that read-modify-write I/O command until it is complete.
The command FIFO buffer 201 is operable to receive and buffer read I/O commands (via an AXI4 AR interface) and various forms of write I/O commands (via an AXI4 AW interface), including read-modify-write operations. Data associated with the write commands is processed through the write data buffer 203 (via an AXI4 W interface). The I/O commands are queued for processing in the command queue 202. Once a write I/O command is processed and the data is written to the memory 110, the write response logic 204 replies to the appropriate master device issuing the I/O command (via an AXI4 B interface). Similarly, when a read I/O command is processed and the data is read from the memory 110, the data is transferred from the memory 110 (via the read multiplexer 112) to the appropriate master device issuing the I/O command (via an AXI4 R interface).
The command FIFO buffer 201 receives I/O commands from the master devices 120 such that they may be processed in the order that they are received. Each of the I/O commands comprises an identification (ID) assigned by its originating master device 120. The command queue 202 is operable to determine the IDs of the I/O commands so as to prevent ID collisions.
For example, master devices 120 assign IDs to each of the I/O commands issued to the memory device 140. Again, because master devices generally do not keep track of how other master devices assign IDs, the command FIFO buffer 201 is likely to receive I/O commands with the same ID. The command queue 202 thus extracts IDs from each of the I/O commands received and determines whether any given ID exists with a read-modify-write I/O command presently being processed. If a read-modify-write I/O command with the same ID is being processed, the command queue 202 determines whether the subsequent I/O command is also a read-modify-write command. If so, the command queue 202 stalls the subsequent I/O command until the in-progress I/O command is complete. Otherwise, the command queue 202 to assess the subsequent I/O command to the memory controller 100 for processing.
In other words, the command queue 202 is operable to receive a first read-modify-write I/O command from a first master device 120 while a second read-modify-write I/O command is presently operating on data in the memory 110. The second read-modify-write I/O command is from a second different master device 120 but has the same ID as the first read-modify-write I/O command. The command queue 202 stalls the first read-modify-write I/O command until the second read-modify-write I/O command is complete. In the meantime, the command queue 202 tracks the ID of the second read-modify-write I/O command until the second read-modify-write I/O command is complete. And, if a third I/O command is received by the command FIFO 201 and that I/O command is not a read-modify-write, the command queue 202 allows the third I/O command to be processed by the memory controller 100 regardless of its ID even while the first I/O command is in progress.
If the AXI I/O command comprises an ID that is the same as an ID existing in the ID tracker 253 and the I/O command is a read-modify-write command, then the command queue 202 stalls the subsequent AXI I/O command, in the process element 255 and loops until the ID of the previous AXI read-modify-write I/O command is complete. Otherwise, the command queue 202 allows the AXI read-modify-write I/O command to be processed by the memory controller 100, in the process element 256.
To illustrate, suppose a first master device 120-1 (i.e., of
As illustrated, the ID tracker 253 comprises six buffers corresponding to the number of cycles it will take for a read-modify-write operation to complete. Accordingly, for any subsequent AXI read-modify-write I/O command, the ID that is extracted from the subsequent command is compared via the comparator 278 to the ID existing in the ID tracker 253. If no matching ID exists in the ID tracker 253, the comparator 278 allows the subsequent AXI read-modify-write I/O command to be processed by the memory controller 100 (in the process element 279). Otherwise, the subsequent AXI read-modify-write I/O command is stalled until the previous AXI read-modify-write I/O command is complete.
It should be noted that the invention is not intended to be limited to the number of clock cycles it takes to process an I/O command. The ID tracker 253 can be configured with any number of buffers to accommodate the number of clock cycles it takes for any given I/O command. In some embodiments, the number of buffers in the ID tracker 253 can be configured on the fly to accommodate various I/O command processing durations.
Additionally, the invention can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment containing both hardware and software elements. In one embodiment, the invention is implemented in software, which includes but is not limited to firmware, resident software, microcode, etc.
Furthermore, the invention can take the form of a computer program product accessible from the computer readable medium 306 providing program code for use by or in connection with a computer or any instruction execution system. For the purposes of this description, the computer readable medium 306 can be any apparatus that can tangibly store the program for use by or in connection with the instruction execution system, apparatus, or device, including the computer system 300.
The medium 306 can be any tangible electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system (or apparatus or device). Examples of a computer readable medium 306 include a semiconductor or solid state memory, magnetic tape, a removable computer diskette, a random access memory (RAM), a read-only memory (ROM), a rigid magnetic disk and an optical disk. Some examples of optical disks include compact disk-read only memory (CD-ROM), compact disk-read/write (CD-R/W) and DVD.
The computing system 300, suitable for storing and/or executing program code, can include one or more processors 302 coupled directly or indirectly to memory 308 through a system bus 310. The memory 308 can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code is retrieved from bulk storage during execution. Input/output or I/O devices 304 (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly or through intervening I/O controllers. Network adapters may also be coupled to the system to enable the computing system 300 to become coupled to other data processing systems, such as through host systems interfaces 312, or remote printers or storage devices through intervening private or public networks. Modems, cable modem and Ethernet cards are just a few of the currently available types of network adapters.