A multi-port memory module generally comprises a plurality of banks for storing data, and each bank is allowed to be accessed independently. However, when the memory receives two or more read commands to access the addresses within a single bank, a bank conflict occurs and the read commands are required to be sequentially executed, causing memory access latency and worse memory access efficiency. To solve this problem, the conventional multi-port memory module uses a customized circuit to enable multiple access ports, or assigns more memory cells to support more concurrent accesses. These methods, however, may increase the design and manufacture cost and/or increase the chip area and power consumption. Therefore, how to provide to a memory control method to support the multiple accesses efficiently is an important topic.
It is therefore an objective of the present invention to provide a method for accessing a multi-port memory module, which can lower the probability of the bank conflict and increase the access efficiency, to solve the above-mentioned problems.
According to one embodiment of the present invention, a method for accessing a multi-port memory module comprising a plurality of banks is provided, and the method comprises: generating a plurality of parities, wherein each parity is generated according to bits of a portion of the banks; and writing the parities into the banks, respectively.
According to another embodiment of the present invention, a memory controller coupled to a multi-port memory module comprising a plurality of banks is provided. The memory controller is arranged for generating a plurality of parities, and writing the parities into the different banks, respectively, wherein each parity is generated according to bits of a portion of the banks.
According to another embodiment of the present invention, a method for accessing a multi-port memory module comprising a plurality of banks is provided, and the method comprises: when two bits corresponding to two different addresses within a specific bank are requested to be read in response to two read commands, directly reading the bit corresponding to one of the two different address of the specific bank; and generating the bit corresponding to the other address of the specific bank by reading the bits of the other banks without the specific bank.
These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.
Certain terms are used throughout the following description and claims to refer to particular system components. As one skilled in the art will appreciate, manufacturers may refer to a component by different names. This document does not intend to distinguish between components that differ in name but not function. In the following discussion and in the claims, the terms “including” and “comprising” are used in an open-ended fashion, and thus should be interpreted to mean “including, but not limited to . . . ” The terms “couple” and “couples” are intended to mean either an indirect or a direct electrical connection. Thus, if a first device couples to a second device, that connection may be through a direct electrical connection, or through an indirect electrical connection via other devices and connections.
Please refer to
Regarding the operations of the elements within the memory controller 110, the address decoder 112 is arranged to decode a received signal from the CPU 102 or GPU 104 or the other elements required to access the memory module 120 to generate a plurality of read command(s) and/or write command(s); the processing circuit 114 is arranged to manage and process the read/write commands; the write/read buffer 116 is arranged to temporarily store the data to be written into the memory module 120 and/or to store the data read from the memory module 120; the control logic 118 is arranged to generate the bits and corresponding parities in response to the write command, and to generate the bits in response to the read command according to the data read from the memory module 120; and the arbiter 119 is arranged to schedule the write commands and the read commands.
Regarding the elements within the memory module 120, the write/read controller 122 may comprises a row decoder and a column decoder, and is arranged to decode the write/read command(s) from the memory controller 110 to access the bit(s) corresponding to the address within the banks 120 specified by the write/read command(s); the registers 124 is arranged to temporarily stores the parities; and each of the banks 126 is implemented by one or more memory chips for storing data.
In the embodiment of the present invention, the parities are generated according to the data stored in the banks 126 or the data to be stored in the banks 126, and the parities are evenly written into the banks 126. By using this method, the memory controller 110 can simultaneously obtain two bits corresponding to the addresses within a single bank, to reduce the probability of bank conflict. Detailed descriptions of the embodiment are as follows.
Please refer to
Similarly, the parity P(b01, b11, b21) is generated by performing XOR operations upon the bits b01, b11 and b21 corresponding the addresses A1 of the banks Bank0, Bank1 and Bank3, and the parity P(b01, b11, b21) is stored into the cell having the address A1 of the bank Bank2. The parity P (b02, b12, b22) is generated by performing XOR operations upon the bits b02, b12 and b22 corresponding the addresses A2 of the banks Bank0, Bank2 and Bank3, and the parity P(b02, b12, b22) is stored into the cell having the address A2 of the bank Bank1. The parity P(b03, b13, b23) is generated by performing XOR operations upon the bits b03, b13 and b23 corresponding the addresses A3 of the banks Bank1-Bank3, and the parity P (b03, b13, b23) is stored into the cell having the address A3 of the bank Bank0. Similarly, the parities P(b04, b14, b24), P(b05, b15, b25), P(b06, b16, b26) and P(b07, b17, b27), are written into the banks Bank3, Bank2, Bank1 and Bank0, respectively.
In addition, regarding the write command W23, the data b23′ is written into the cell having the address A3 of the bank Bank3, the memory controller 110 further reads the bits b03 and b13 from the banks Bank1 and Bank2, respectively, and performs the XOR operations upon the bits b23′, b03 and b13 to generate an updated parity P′(b03, b13, b23′), and stores the updated parity P′(b03, b13, b23′) into the register Reg0.
In addition, regarding the write command W16, the data b16′ is written into the cell having the address A6 of the bank Bank2, the memory controller 110 further reads the bits b06 and b26 from the banks Bank0 and Bank3, respectively, and performs the XOR operations upon the bits b16′, b06 and b26 to generate an updated parity P′ (b06, b16′, b26). At this time, the previous updated parity P′ (b02, b12′, b22) is moved from the register Reg1 to the cell having the address A2 of the bank Bank1, and the current updated parity P′(b06, b16′, b26) is stored into the register Reg1.
It is noted that the “addresses A0-A7” shown in
The embodiments shown in
Step 600: The flow starts.
Step 602: Receive one write command and two read commands.
Step 604: In the write path, write the data directly into its address, read data from the same address (offset) of the other banks excluding the parity, perform XOR operations upon the read data and the written data to generate the updated parity, and store the updated parity into the register.
Step 606: In the read path, determine whether the read commands have bank conflict? If no bank conflict, the flow enters Step 608; if yes, the flow enters Step 610.
Step 608: Read the data directly.
Step 610: Read the data corresponding to one of the read commands directly from the memory module, and read the data from the same address (offset) of the other banks and perform the XOR operations upon the read data to generate/recover the data corresponding to the other one of the read commands.
Step 612: The flow finishes.
Briefly summarized, in the method for accessing a multi-port memory module of the present invention, each parity is generated by performing the XOR operations upon the data corresponding to the same address (offset) of a portion of banks, and storing the parity into the cell having the same address (offset) of the remaining bank. In addition, the parities are distributed into the banks. By using the technique of the present invention, the probability of the bank conflict can be reduced to increase the access efficiency.
Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.
This application claims the priority of U.S. Provisional Application No. 62/150,862, filed on Apr. 22, 2015, which is included herein by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
62150862 | Apr 2015 | US |