WO2020063735A1 - Memory access technology and computer system - Google Patents

Memory access technology and computer system Download PDF

Info

Publication number
WO2020063735A1
WO2020063735A1 PCT/CN2019/108122 CN2019108122W WO2020063735A1 WO 2020063735 A1 WO2020063735 A1 WO 2020063735A1 CN 2019108122 W CN2019108122 W CN 2019108122W WO 2020063735 A1 WO2020063735 A1 WO 2020063735A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
value
dram
memory
stored
Prior art date
Application number
PCT/CN2019/108122
Other languages
French (fr)
Chinese (zh)
Inventor
基拉·卡夫
迪帕克·马修
奇拉格·苏尔达山
马赛厄斯·荣格
克里斯蒂安·韦斯
诺伯特·韦恩
朗诺斯·弗洛里安
李鸽子
杨伟
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN201811369316.2A external-priority patent/CN110968451B/en
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2020063735A1 publication Critical patent/WO2020063735A1/en
Priority to US17/217,570 priority Critical patent/US11521674B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's

Definitions

  • the present application relates to the field of computer technology, and in particular, to a memory access technology and a computer system.
  • DRAM Dynamic random access memory
  • Cell leakage cell leakage
  • Crosstalk Crosstalk
  • the memory controller design has a fixed refresh interval for each row, for example, the refresh interval can be 64ms.
  • the refresh interval needs to be reduced, which will cause frequent refresh of DRAM, increase system power consumption and occupy system bandwidth.
  • a memory access technology and a computer system provided in the present application can reduce the error probability of data stored in a DRAM memory.
  • the present application provides a memory access method. According to the method, after receiving the first data to be written into the dynamic random access memory DRAM, it is determined that the number of the first value in the first data is greater than the number of the second value, and it is determined that the DRAM is used to be high on the bit line. The first value is stored when voltage is applied and the second value is stored when the bit line is low voltage. In response to the above determination, the first data is inverted to obtain second data, and the second data is stored in the DRAM.
  • the above-mentioned memory access method provided in this application may determine whether the first data to be stored is inverted and stored according to the number of first and second values in the first data to be written into the DRAM memory and the storage mode of the DRAM. In order to reduce the number of high-charge memory cells in the dynamic random access memory DRAM, the error probability of the first data is reduced.
  • the first value in the first data is flipped to the second value, and the second value in the first data is flipped. Is the first value to obtain the second data.
  • the method described in this application can reuse the data bus flip DBI signal on the existing memory bus, making the method easier to implement.
  • the first or second possible implementation manner of the first aspect in a third possible implementation manner of the first aspect, is “1", and the second value Is "0"; or the first value is "0" and the second value is "1".
  • the method further includes, after receiving the read request, according to the first carried in the read request.
  • An address reads the second data from the DRAM. After determining that the second data is data stored after being inverted, the second data is inverted to obtain the first data.
  • the determining that the second data is data stored after being flipped includes: according to the second data, The flip flag in the ECC encoding determines that the second data is data stored after the flip.
  • the present application provides a computer device.
  • the computer device includes a dynamic random access memory DRAM, and a memory controller connected to the DRAM.
  • the memory controller is configured to execute the first aspect and any of the first aspects.
  • the present application provides a memory.
  • the memory includes a dynamic random access memory DRAM, a communication interface, and a flip module.
  • the DRAM is used to store data
  • the communication interface is connected to the DRAM, and is used to determine that the number of first values in the first data is greater than the number of second values, and to determine that the DRAM is used for high voltage on the bit line
  • the first value is stored at times and the second value is stored when the bit line is low voltage, and in response to the above determination, the first data is inverted to obtain the second data, and the second data is stored In the DRAM.
  • the inversion module is configured to invert the first value in the first data to the second value, and invert the The second value is inverted to the first value to obtain the second data.
  • the inversion module is configured to invert the first of the received data according to the indication of the DBI signal on the first data bus. A value is converted to a second value to obtain the second data.
  • the communication interface is further configured to receive a read request, and the read request carries a first address.
  • the flip module is further configured to determine that the second data read from the DRAM according to the first address is data stored after the flip, and in response to the above determination, flip the second data to obtain Said first data.
  • the first value is “1" and the second value is “0" ; Or the first value is "0" and the second value is "1".
  • the present application provides a memory access method.
  • the method includes, after receiving first data to be written into a dynamic random access memory DRAM, determining that the number of “1” in the first data is greater than the number of “0”.
  • the storage mode of the DRAM is a storage mode in which the stored data is logic "1" when the bit line is at a high voltage.
  • the first data is inverted to obtain second data, and the second data is stored in the DRAM.
  • the present application provides another memory access method.
  • the method includes, after receiving third data to be written into the dynamic random access memory DRAM, determining that the number of "1" in the third data is less than "0".
  • the storage mode of the DRAM is a storage mode in which data is stored at logic "0" when the bit line is at a high voltage.
  • the third data is inverted to obtain fourth data, and the fourth data is stored in the DRAM.
  • the memory access method may determine whether the data to be stored is inverted and stored according to the number of "1" and "0" in the data to be written into the DRAM memory, and the storage mode of the DRAM. In order to reduce the number of high-charge memory cells in the dynamic random access memory DRAM, the probability of data errors is reduced.
  • the present application further provides a computer program product including program code, and the instructions included in the program code are executed by a computer to implement the method described in the first aspect or the second aspect.
  • the present application further provides a computer-readable storage medium for storing program code, and the instructions included in the program code are executed by a computer to implement the foregoing first aspect, the first The method described in the fourth aspect, or the fifth aspect.
  • FIG. 1 is a schematic diagram of a computer system architecture according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a memory controller according to an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of a data flipping method according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of still another memory controller according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of still another computer system according to an embodiment of the present invention.
  • FIG. 6 is a flowchart of a method for reading data according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of writing data according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of reading data according to an embodiment of the present invention.
  • FIG. 9 is a flowchart of a memory access method according to an embodiment of the present invention.
  • FIG. 1 is a schematic diagram of a computer system architecture according to an embodiment of the present invention.
  • the computer system 100 may include at least a processor 102, a memory controller 106, and a memory 108.
  • the memory controller 106 may be integrated in the processor 102.
  • the computer system 100 may further include a communication interface and other devices such as an externally stored magnetic disk, which is not limited herein.
  • the processor 102 is a computing core and a control core of the computer system 100.
  • the processor 102 may include a plurality of processor cores 104.
  • the processor 102 may be a very large-scale integrated circuit.
  • An operating system and other software programs are installed in the processor 102, so that the processor 102 can implement access to the memory 108, cache, and disk.
  • the Core 104 in the processor 102 may be, for example, a central processing unit (CPU), or other specific integrated circuit (Application Specific Integrated Circuit, ASIC).
  • the memory controller 106 is a bus circuit controller that controls the memory 108 internally of the computer system 100 and is used to manage and plan data transmission from the memory 108 to the Core 104. Through the memory controller 106, data can be exchanged between the memory 108 and the Core 104.
  • the memory controller 106 may be a separate chip and connected to the Core 104 through a system bus. Those skilled in the art may know that the memory controller 106 may also be integrated into the processor 102 (as shown in FIG. 1) or may be built into the Northbridge. The embodiment of the present invention does not limit the specific position of the memory controller 20. In practical applications, the memory controller 106 may control necessary logic to write data to or read data from the memory 108.
  • the memory 108 is the main memory of the computer system 100.
  • the memory 108 is connected to the memory 108 through a double data rate (DDR) bus.
  • the memory 108 is generally used to store various running software in the operating system, input and output data, and information exchanged with external storage. In order to improve the access speed of the processor 102, the memory 108 needs to have the advantage of fast access speed.
  • dynamic random access memory DRAM
  • the processor 102 can access the memory 108 at a high speed through the memory controller 106, and perform a read operation and a write operation on any storage unit in the memory 1080.
  • the memory 108 is described as an example of DRAM. Therefore, the memory 108 may also be referred to as a DRAM 108.
  • the data is stored in a storage unit (also called a DRAM cell) of the DRAM 108.
  • the storage unit refers to the smallest storage cell (cell) for storing data.
  • a memory cell can store 1 bit of data.
  • some storage units can also implement multi-value storage.
  • DRAM uses the amount of storage capacity of the capacitor to represent data 0 and 1. Due to the leakage phenomenon of the capacitor, if the charge in the capacitor is insufficient, the stored data will be wrong.
  • the memory controller 106 refreshes the data in the DRAM 108 to prevent the DRAM 108 from losing data.
  • DRAM 108 is volatile. When the computer system 100 is powered off, the information in DRAM 108 will no longer be saved.
  • the DRAM cells in the DRAM 108 are arranged into a matrix. This matrix is called DRAM bank.
  • the memory controller 106 can locate any bit in the DRAM bank through the corresponding row and column decoder.
  • Multiple DRAM banks can form a DRAM chip (also known as a memory chip), and multiple DRAM chips can form a DRAM rank.
  • Multiple DRAM ranks can be integrated into a dual-inline-memory-modules (DIMM).
  • the DRAM 108 may include a plurality of channels 110. Each channel 110 may include at least one rank, and each rank may include at least one bank.
  • Each bank includes multiple storage units for storing data.
  • rank refers to a memory chip connected to the same chip select signal.
  • the memory controller 106 can write to chips in the same rank, and chips in the same rank also share the same control signals.
  • the memory controller 106 can respectively access the data in the memory cells in the various channels in the DRAM 108 through the memory bus.
  • the memory cells in a DRAM bank are connected to a word line and a bit line, respectively.
  • the word line connects multiple memory cells in the horizontal direction
  • the bit line is used to connect multiple memory cells in the vertical direction. unit.
  • the word line is used to enable the memory cell
  • the bit line is used to charge the capacitor in each memory cell, so that the amount of storage capacity of the capacitor can be used to represent the data 0 and 1. It can be understood that when the bit line is at a high level, there is more electric energy stored in the capacitor, or in other words, there is more electric charge in the capacitor. When the bit line is low, there is less power stored in the capacitor, or less charge in the capacitor.
  • a DRAM memory cell can be considered as a noise channel.
  • the inventor found in the process of implementing the present invention that data error conditions in DRAM can be divided into two types, one is that the data changes from logic 0 to logic 1 and the other is that the data changes from logic 1 to logic 0.
  • Studies have shown that assuming that the amount of charge in a DRAM memory cell is high in logic 1, the probability of the data changing from logic 0 to logic 1 is much smaller than the probability of changing logic 1 to logic 0. Therefore, reducing the number of memory cells storing high charges in the DRAM array can greatly reduce the error probability of the DRAM array.
  • FIG. 2 is a schematic structural diagram of a memory controller according to an embodiment of the present invention.
  • the memory controller 106 may include a communication interface 1061, an ECC module 1062, and a flip module 1063.
  • the communication interface 1061 may be implemented based on an existing DDR bus interface protocol.
  • the communication interface 1061 is configured to receive data to be written and sent to the memory DRAM 108 by the Core 104.
  • the ECC module 1062 is configured to check and correct the data to be written received by the communication interface 1061 to obtain the ECC code of the data to be written.
  • the flip module 1063 may be used to execute the data flip method shown in FIG. 3.
  • FIG. 3 is a flowchart of a data reversing method according to an embodiment of the present invention. Specifically, as shown in FIG. 3, the method may include the following steps. It can be understood that the data inversion method shown in FIG. 3 may also be referred to as a memory access method provided by an embodiment of the present invention.
  • step 302 first data to be written into a memory is received.
  • the memory controller 106 can receive the first data sent by the core 104 through the communication interface 1061 between the memory controller 106 and the core 104.
  • the size of the first data may be determined according to a bandwidth of the DDR bus.
  • the first data may be 64 bits or 32 bits. The size of the first data is not limited herein.
  • step 304 it is determined whether the number of "1" in the first data is greater than the number of "0". When the number of “1” in the first data is greater than the number of “0”, the method proceeds to step 306. When the number of “1” in the first data is less than the number of “0”, the method proceeds to step 308.
  • step 306 it is determined whether the storage mode of the DRAM is a first mode, where the first mode is used to indicate that the corresponding data when the amount of charge in the capacitor in the storage unit is high is a storage form of logic "1" .
  • the method proceeds to step 310.
  • the storage mode of the DRAM is not the first mode, the method proceeds to step 314.
  • the memory module of the DRAM may include a first mode and a second mode, wherein the first mode may also be referred to as a true cell bit storage mode, and the true cell bit storage mode refers to a DRAM array
  • the second mode may also be referred to as an anti-cell bit storage mode.
  • the anti-cell bit storage mode refers to a storage form in which the data corresponding to a higher amount of charge in the capacitance of a memory cell is a logic "0".
  • the true cell bit storage mode refers to a storage mode that stores a logic “1” when the bit line is high voltage and a logic “0" when the bit line is low voltage.
  • the anti-cell bit storage mode refers to a storage mode that stores a logic "1” when the bit line is at a low voltage and a logic “0” when the bit line is at a high voltage.
  • the first mode is a storage mode in which data is stored at a logic “1” when the bit line is at a high voltage
  • the second mode is a storage mode in which data is stored at a logic “0” when the bit line is at a high voltage. Storage mode. It should be noted that the storage mode of the DRAM can be obtained according to the factory information provided by the manufacturer of the DRAM chip, or it can be detected by itself.
  • step 304 If it is determined in step 304 that the number of "1" in the first data is greater than the number of "0”, and in this step, it is determined that the storage data is a logical "1" storage when the bit line is a high voltage Mode, the method proceeds to step 310. If it is determined in this step that the storage mode is a storage mode in which the stored data is a logic “0” when the bit line is at a high voltage, the method proceeds to step 314.
  • step 308 it is determined whether the storage mode of the DRAM is a first mode, where the first mode is used to indicate that when the amount of charge in the capacitance of the storage unit is high, the corresponding data is a logical "1" storage .
  • the method proceeds to step 314.
  • the storage mode of the DRAM is not the first mode, the method proceeds to step 310. Specifically, if it is determined in step 304 that the number of "1" in the first data is less than the number of "0”, and if it is further determined in this step that the storage mode is that the bit line is high voltage, the stored data is If the storage mode is logic “1”, the method proceeds to step 314.
  • the method proceeds to step 310.
  • step 310 the data of each bit in the first data is flipped to obtain the second data, and the process proceeds to step 312.
  • the logical "1" in the first data may be inverted to a logical "0”
  • the logical "0" in the first data may be inverted to a logical "1"
  • the data obtained by inverting the first data is referred to as the second data.
  • this can be achieved using a flip circuit.
  • the flip circuit can be implemented by negating the value of each bit through an NOT gate array.
  • the second data is written into a memory cell of the DRAM.
  • the memory controller may send the flipped second data to the memory 108, and carry the flipped identifier in the ECC code obtained by the ECC module to the memory 108, and the memory 108 may store the obtained second data and the ECC code.
  • the flip flag is used to indicate whether the received first data is flipped.
  • the flip flag is used to indicate whether the second data stored in the DRAM is the flipped data.
  • the flip flag may be carried in the ECC code, and whether the second data is the flipped data is indicated by a preset bit in the preset ECC code.
  • the identification of the flip flag is not specifically limited. For example, a logic “1” may be used to indicate that the first data is flipped, and a logic “0” may be used to indicate that the first data is not flipped.
  • step 314 the first data is written into the DRAM. Specifically, the memory controller writes the first data and the ECC code obtained by the ECC coding module according to the first data into a storage unit of the DRAM.
  • the following four situations may occur.
  • step 304 it can be known in combination with steps 304, 308, and 310 that if it is determined in step 304 that the number of "1" in the first data is less than the number of "0", and in step 308, If the storage mode of the DRAM is a storage mode where the data stored when the bit line is at a high voltage is a logic "0", it means that after the first data is written into the DRAM, a high charge is stored in a memory cell for storing the first data There are also more storage units, which may increase the probability of data errors in the storage units. Therefore, in this case, data of each bit in the first data needs to be stored after being inverted.
  • step 304 it is further determined that the storage mode of the DRAM is not a storage mode where the data stored when the bit line is high voltage is a logic "1", but a storage mode where the data stored when the bit line is high voltage is a logic "0" , It means that after the first data is written into the DRAM, there are not many high-charge memory cells in the memory cells used to store the first data. In this case, the probability of error is not high, so there is no need to The first data is stored after being inverted.
  • step 304 if it is determined in step 304 that the number of "1" in the first data is less than the number of "0", and in step 308, it is further determined that the storage mode of the DRAM is a storage mode in which the data stored when the bit line is at a high voltage is a logic "1", then the first data is written into the DRAM to store the first data.
  • the probability of error is not high, so there is no need to store the first data after it is inverted.
  • whether to treat the data may be determined according to the number of logical "1" and logical "0" in the data to be written and the storage mode of the DRAM.
  • the stored data is stored after being inverted, so that after the data is stored in the DRAM, the number of high-charge memory cells in the DRAM array can be reduced, and the probability of data errors is reduced.
  • the embodiment of the present invention uses the first data as an example to describe different situations that may occur when writing one data to a DRAM having different storage modes.
  • the first data is written to In the first DRAM, the first situation described in steps 304, 306, and 310 may occur.
  • the second situation described in steps 304, 308, and 310 may occur.
  • the third data may be inverted to obtain the fourth data And writing the obtained fourth data into the second DRAM to reduce the number of high-charge memory cells in the second DRAM and reduce the error probability.
  • the third and fourth situations described above may also occur.
  • the flip flag may be carried in the ECC code, and a preset bit in the preset ECC code is used to indicate whether the first data to be written to the DRAM is flipped and stored. .
  • 8-bit ECC encoding is required for 64-bit data.
  • a part of 8 bits can be used as a flip flag.
  • the last 1 bit in the ECC code may be used as the flip flag, and the last 2 or 3 bits in the ECC code may be used as the flip flag.
  • the number of bits occupied by the flip flag can be determined according to specific conditions.
  • how many bits of the flip flag are needed can be determined according to the size of the data to be flipped. For example, assuming that the size of the first data is 64 bits, and the 64 bits are also inverted when performing the inversion, one bit in the ECC encoding may be used as the inversion identifier. If the inversion is performed to determine whether the inversion is performed on the upper 32 bits and the lower 32 bits in the first data respectively, 2 bits in the ECC encoding may be used as the inversion flag.
  • the first data is data of 64 bits.
  • the first data may be sent to the ECC module 1062 and the flip module 1063, respectively.
  • the ECC module 1062 performs ECC processing on the first data to obtain a 6-bit ECC code.
  • the flip module 1063 may process the high 32-bit and low 32-bit of the first data respectively according to the method shown in FIG. 3 described above, to determine whether to flip and store the high 32-bit and low 32-bit data, and generate a 2-bits flip flag.
  • 1 bit in the flip flag is used to indicate whether the data of higher 32 bits in the first data is flipped, and the other 1 bit is used to indicate whether the data in the lower 32 bits of the first data is flipped. It can be understood that no matter whether the first data is inverted, the data generated by the memory controller to the memory 108 is 64 bits.
  • the memory controller 106 may send the 64-bits data, the 6-bit ECC code, and the 2-bit flip flag to the memory 108 for storage in the storage unit of the DRAM. Specifically, during the transmission, the memory controller 106 can transmit the 64-bit data to be stored and the DRAM through DQ [63: 0] on the DQ line, and transmit the 6-bit ECC code through DQ [69:64], and pass DQ [71:70] transmits the flip flag.
  • the flip flag and the ECC code can be stored together in the ECC memory chip area. It can be seen from the above embodiments that since the data inversion and ECC encoding are performed in parallel in this embodiment, no additional inversion delay is introduced.
  • FIG. 4 is a schematic structural diagram of another memory controller 106 according to an embodiment of the present invention.
  • the memory controller shown in FIG. 4 includes a data queue 1064 in addition to the communication interface 1061, the ECC module 1062, and the flip module 1063 shown in FIG. Still taking the above-mentioned first data of 64bits as an example, in the memory controller shown in FIG. 4, after the communication interface 1061 receives the first data, the first data can be used by the flip module 1063 according to the above FIG.
  • the method shown determines whether to perform a flip process and obtains a flip flag.
  • the data processed by the inversion module 1063 and the inversion flag may be sent to the data queue 1064 and the ECC module 1062, respectively.
  • the data processed by the inversion module includes the second data obtained by inverting the first data, and may also refer to the first data that is not inverted.
  • the ECC module 1062 can perform ECC encoding on the data processed by the flip module 1063 and the flip flag.
  • the data processed by the flip module 1063, the flip flag, and the ECC code in the data queue 1064 can be sent to the memory together. 108 for storage. It can be understood that the embodiment shown in FIG.
  • the ECC module 1062 only encodes the input first data
  • the ECC module may perform ECC processing on the data processed by the inversion module 1063 and the obtained inversion identifier to obtain an ECC code.
  • the above embodiment is described by using the data inversion method shown in FIG. 3 in a memory controller as an example.
  • the memory access method provided by the embodiment of the present invention may also be implemented in a DRAM memory module.
  • the following describes still another implementation method provided by an embodiment of the present invention with reference to FIGS. 3 and 5.
  • the existing DDR4 has DBI technology, which is mainly used to invert data on the bus to reduce power consumption when data is transmitted on the bus. If the embodiment shown in FIG. 5 is designed based on a DBI scheme in an existing computer system.
  • FIG. 5 is a schematic structural diagram of a computer system according to an embodiment of the present invention.
  • the memory controller 106 in the computer system shown in FIG. 5 includes a communication interface 1061, an ECC module 1062, and a main DDR physical layer interface (PHY) 1065.
  • the communication interface 1061 is configured to communicate with the core 104 and receive first data to be written into the memory 108 sent by the core 104.
  • the ECC module 1062 is configured to perform an ECC check on the first data to obtain an ECC code.
  • the main DDR physical layer interface (also known as the main DDR PHY) 1065 is a physical layer interface connected to the memory 108 on the host side.
  • the main DDR PHY1065 has a Data Bus Inversion (DBI) function.
  • DBI Data Bus Inversion
  • the existing DBI technology less power consumption is required when transmitting logic "1" on the bus. Therefore, the existing DBI technology will determine whether to be transmitted according to the number of "1" in the data to be transmitted. The data is transferred in reverse.
  • the master DDR 1065 on the memory controller 106 side and the slave DDR physical layer interface on the memory 108 side have DBI functions.
  • the main DDR PHY 1065 on the side of the memory controller 106 is mainly used to detect the number of “1” in the data sent by the memory controller 106 to the memory 108 to determine whether it is necessary to perform a post-flip transmission.
  • the dbi_n signal is used to notify whether the data received from the DDR physical layer interface (from the DDR PHY) 1081 in the memory 108 is the data that is transmitted by being inverted. It should be noted that, in the computer system shown in FIG. 5, the structure of the memory controller 106 is not changed.
  • the memory 108 in the computer system shown in FIG. 5 includes a slave DDR physical layer interface (PHY) 1081 and a DRAM array 1084 connected to the slave DDR 1081.
  • the DDR PHY 1081 may include a flip module 1082 and a second DBI module 1083.
  • the DRAM array 1084 includes a plurality of DRAM ranks, and each rank includes a plurality of DRAM storage cells (also referred to as: DRAM cells) for storing data.
  • the second DBI module 1082 is a DBI module corresponding to the first DBI module 1066 on the memory controller 106 side, and is used to reverse the received data according to the dbi_n signal after the first DBI module 1066 implements the reverse transmission of the first data.
  • the first DBI module 1066 does not perform the flip transmission on the first data
  • the second DBI module also does not perform flip processing on the data it receives according to the received dbi_n signal.
  • the data output by the second DBI module is the data to be stored that the core 104 sends to the memory controller.
  • a flip module 1083 is added to the existing DDR PHY 1081.
  • the inversion module 1083 is configured to receive the data processed by the second DBI module 1082 and process the data input to the inversion module 1083 according to the data inversion method shown in FIG. 3.
  • the flip module 1083 may reuse the dbi_n signal indication sent by the main DDR 1065 to determine whether the data output by the second DBI module 1082 needs to be flipped and stored.
  • the first data is still used as an example for description. Because DBI technology is to ensure that there are as many logic "1" s transmitted on the bus as possible to reduce the power consumption of the bus transmission. Therefore, when the received dbi_n signal from the second DBI module 1083 in the secondary PHY 1081 indicates that the primary DDR PHY 1065 has not reversed the transmission of the first data, it means that the number of logic "1" in the first data is greater than The number of "0". When the received dbi_n signal from the second DBI module 1083 in the slave PHY 1081 indicates that the master DDR 1065 has reversed the transmission of the first data, it means that the number of logic "1" in the first data is less than logic "0 "quantity.
  • the flip module 1083 After obtaining the ratio of the number of logic “1” in the data to be stored, the flip module 1083 further determines whether the data output by the second DBI module needs to be flipped and stored in the DRAM according to the storage mode of the DRAM array.
  • the dbi_n signal may also be referred to as a data bus inversion DBI signal.
  • the inversion module 1083 only reuses the dbi_n signal in the existing DBI function to judge the logic "1" and logic "0" in the data to be stored The number of sizes without the need to detect it by yourself.
  • FIG. 5 is described with the flip module 1083 located in the slave PHY 1081. In practical applications, the flip module 1083 may also exist independently of the slave PHY 1081. It is not limited here.
  • the above embodiment describes the data flip processing method from the process of writing data.
  • the following will briefly introduce the process of reading data.
  • the data reading method described in FIG. 6 may be used for processing.
  • the method for reading data may include the following steps.
  • step 602 a read request sent by a host is received, and the read request carries an address of data to be read.
  • the second data and the corresponding ECC code are read from the memory according to the address.
  • the embodiment of the present invention is described by using the second data stored in the foregoing data writing process as an example.
  • step 606 it is determined that the second data is the data stored after the inversion according to the inversion identifier in the ECC encoding.
  • step 608 the second data is decoded to obtain the first data. Specifically, the second data is flipped according to the flip flag to obtain the first data.
  • the above-mentioned method for reading data may be implemented by the memory controller 106, and specifically may be implemented by the flip module 1063 in the memory controller 106 shown in FIG. 2 and FIG. 4, or may be implemented by the memory 108 It is realized by turning over the module 1083. It is not limited here. In practical applications, the flip module 1083 in the memory controller 106 shown in FIG. 5 may also exist independently of the memory controller.
  • the flip module 1083 in FIG. 5 is not necessary, and the second DBI module 1082 in the DDR PHY 1081 can be directly multiplexed to implement the method shown in FIG. 3.
  • the memory controller can generate two flags to separately control the DBI function of the host and the DBI function of the memory module.
  • the memory controller generates a flip flag from the number of 1 in the data to notify the DBI function of the host whether to perform a data flip operation.
  • the memory controller also generates a dbi_n signal from the mapping relationship between the address and the Anti Cell / True cell in parallel and sends it directly to the memory module to control whether the module performs a flip operation.
  • the final data, flip flag (flip flag) and ECC code are all stored in the DRAM particles.
  • the first data is 0000 and 1111 are taken as examples to describe how to write data into DRAMs of different storage modes in combination with the DBI function.
  • the memory controller In the first case, assuming that the first data is “0000” and the storage mode of the DRAM corresponding to the address where the first data is to be stored is true, the memory controller generates a flip.
  • the identification bit (such as the flip identification bit in FIG. 7) and the dbi_n signal, wherein the flip identification bit (flip) is 1, and the dbi_n signal is 1.
  • the flip flag is used to instruct the first DBI module 1066 (the host-side DBI module) in the memory controller 106 shown in FIG. 5 to perform a flip operation. As mentioned before, the flip flag can be carried in the ECC encoding of the first data.
  • the first DBI module 1066 When the first DBI module 1066 receives the first data and the ECC encoding of the first data, the first data "0000” is inverted according to the flip flag to obtain data "Data”: “1111”, and The inverted data “1111” is transmitted to the second DBI module 1082 in the DDR HPY through the memory bus. And, the memory controller sends the dbi_n signal to the second DBI module 1082 in the DDR HPY through the memory bus. When the second DBI module 1082 receives the dbi_n signal, it will invert the data Data ': “1111” received from the memory bus to obtain the data "Data”: 0000, and the inverted data "Data”: 0000 Stored in a memory cell of a DRAM array. Among them, the data “” after the data is turned over: 0000 is the same as the first data. According to this method, when the first data is 0000 and the storage mode is true, the data may not be stored when the data is stored. Perform flip storage
  • the memory controller when the first data Data is "1111" and the storage mode corresponding to the address of the first data is true, the memory controller generates a flip flag of 0, and the generated The dbi_n signal is 1. According to the flip identification, the first DBI module 1066 on the host side will not flip the first data, but directly transmits the first data “1111” through the memory bus.
  • the second DBI module 1082 receives the first data "1111” and the dbi_n: 1 signal, the second DBI module 1082 will flip the received first data according to the dbi_n signal, and after the flip is obtained, The second data (Data): 0000 is stored in the DRAM array. According to this method, when the first data is "1111" and the storage mode is true, the existing memory can be reused.
  • the DBI module (such as the second DBI module 1082 in FIG. 5) inverts the first data to be stored and stores the first data.
  • the memory controller when the first data Data is 0000 and the storage mode corresponding to the memory address to store the first data is an anti-cell storage mode, the memory controller generates a flip flag of 1 and generates The dbi_n signal is 0.
  • the host-side DBI module (such as the first DBI module 1066 in FIG. 5) flips the first data "0000" according to the flip identifier to obtain Data ': 1111, and passes the flipped data Data': 1111 through The memory bus is sent to the second DBI module 1082 in the memory.
  • the second DBI module 1082 After the second DBI module 1082 receives the data Data ': 1111, since the dbi_n signal is 0, the second DBI module 1082 does not flip the received data Data': 1111, and directly turns the memory controller side
  • the data of the first DBI module 1066 after the inversion Data ': 1111 is stored in a storage unit of the DRAM array. In this case, when the first data is "0000" and the storage mode is anticell, the data can be reused by multiplexing the first DBI module 1066 in the existing memory controller shown in FIG. 5 to the data. Storing data as a result of the flip can also achieve the effect of reducing the error rate of the data.
  • the memory controller when the first data Data is 1111 and the storage mode corresponding to the memory address to store the first data is an anti-cell storage mode, the memory controller generates a flip identifier. Is 0, and the generated dbi_n signal is 0.
  • the host-side DBI module (such as the first DBI module 1066 in FIG. 5) does not transmit the first data "1111" according to the flip identifier.
  • the second DBI module 1082 on the memory side receives data from the memory bus, After 1111 (see Data ': 1111 in Figure 7) and the dbi_n signal, since the dbi_n signal is 0, it is used to indicate that the received data is not inverted.
  • the second DBI module 1082 will not perform the first data received.
  • the 1111 is reversed, and the first data 1111 (see Data ": 1111 in Fig. 7) can be directly stored in the DRAM array.
  • the first data is" 1111 "and the storage mode is In the case of an anti-cell, neither the first DBI module nor the second DBI module need to flip the first data.
  • the above description takes the first data as "0000” and "1111” as examples.
  • the first data is stored in the DRAM and anti of the true cell respectively.
  • a case where flip memory is required in a cell's DRAM is described in detail. It can be understood that the data "1111” is only an example of the first data whose number of "1” is greater than the number of "0”, and "0000" is also only the first data whose number of "0” is greater than the number of "1” An example.
  • true cell refers to a storage mode where the bit line is at a high voltage when the data is "1”
  • anti cell refers to a storage mode where the bit line is at a high voltage when the data is "0”.
  • the flip flag bit is “1” to indicate that data needs to be flipped
  • the flip flag bit is “0” to indicate that data needs not to be flipped.
  • the dbi_n signal is “1” to indicate that data needs to be inverted
  • the dbi_n signal is “0” to indicate that data is not to be inverted.
  • the flip flag bit can be “0” to indicate that data needs to be flipped
  • the dbi_n signal is “0” to indicate that data needs to be flipped. It is not limited here.
  • FIG. 7 uses a DBI module in an existing computer system as an example to describe how to write data to reduce the probability of error in storing data.
  • Figure 8 will briefly introduce how to read data from the multiplexed DBI module.
  • the memory controller sends a read request and a dbi_n signal to the memory module.
  • the memory module receives the dbi_n signal, it configures whether the DBI module of the DDR PHY (such as the second DBI module 1082 in FIG. 5) turns the read data.
  • the DBI module through the memory module is flipped, and then the corresponding data, flip flag (flip flag bit) and ECC code are returned to the host-side DRR PHY.
  • the host uses the DQ line corresponding to the flip flag bit to determine whether to perform data flipping on the received data.
  • the data and ECC are returned to the memory controller.
  • the first data is read, and the first data is 0000 and 1111, respectively. How to read data from DRAMs of different storage modes in combination with the DBI function is described as an example.
  • the dbi_n signal can be configured to “1” to indicate the DBI module in the memory (as shown in FIG. 5).
  • the second DBI module 1082) inverts the data.
  • the first data is "0000” and the storage mode is True cell storage mode
  • the data stored in the DRAM array is Data ": 0000, and the flip flag in the ECC encoding is 1 Therefore, in the process of reading data, as shown in FIG.
  • the read process shown in FIG. 8 is an opposite process to the corresponding write process in FIG. 7.
  • the process of reading data 1111 from the True Cell DRAM can be seen in the diagram of the second case in Figure 8.
  • the process of reading the data 0000 from Anti Cell's DRAM can be seen in the diagram of the third case in Figure 8.
  • For the process of reading data 1111 in the cell's DRAM refer to the illustration of the fourth scenario in FIG. 8.
  • the second to fourth situations in FIG. 8 reference may be made to the specific description of the first situation, and details are not described herein again.
  • the dbi_n signal when the storage mode is True cell mode, the dbi_n signal is configured to be “1”, which is used to instruct the second DBI module in the memory to perform the received data. Flip. When the storage mode is the Anti cell mode, the dbi_n signal is configured to be "0", which is used to instruct the second DBI module in the memory not to flip the received data.
  • the data received by the second DBI module includes data sent from the memory controller received from the memory bus, and also includes data read from the DRAM array. In practical applications, the dbi_n signal can also be "0" to instruct the second DBI module in the memory to flip the received data.
  • the embodiment of the present invention does not limit the specific identification of the dbi_n signal.
  • FIG. 9 is a flowchart of a memory access method according to an embodiment of the present invention. As shown in FIG. 9, the method may be executed by a memory controller, or may be a flip module (also referred to as a flip circuit) in a memory module. carried out. For convenience of description, the method shown in FIG. 9 is described below by taking a memory controller as an example.
  • the memory controller receives first data to be written into the dynamic random access memory DRAM.
  • the storage mode of the DRAM is a storage mode in which the stored data is the first value when the bit line is at a high voltage.
  • the first value or the second value is used to indicate a bit value in the first data. For example, in one case, the first value is “1" and the second value is "0". In another case, the first value is "0" and the second value is "1".
  • the memory controller inverts the first data to obtain the second data in response to the judgment. Specifically, the memory controller needs to invert the first value "1" in the first data to the second value "0", and invert the second value "0" in the first data to the first value. "1” to get the second data. Then in step 908, the second data is stored in the DRAM.
  • the storage mode of the DRAM is a storage mode in which the data is "1" when the bit line is at a high voltage (that is, a true cell storage mode)
  • the second data is stored in the DRAM, the The number of high charges in the memory cell storing the second data in the DRAM is relatively small, and the probability of the second data being wrong will be less than the error probability of the first data.
  • the memory controller when the first value is “0" and the second value is “1”, if the storage mode in the DRAM is a high voltage on the bit line, the stored data is the first value (that is, “0” ”) Storage mode (that is, the aforementioned Anti-cell storage mode), in step 906, the memory controller also responds to the above determination, and inverts the first data to obtain the second data. Specifically, the memory controller needs to invert the first value "0" in the first data to the second value "1”, and invert the second value "1” in the first data to the first value. "0” to get the second data. Then in step 908, the second data is stored in the DRAM.
  • the storage mode of the DRAM is a storage mode in which data is stored as "0" when the bit line is at a high voltage (that is, an anti-cell storage mode)
  • the second data is stored in the DRAM, the The number of high charges in the memory cell storing the second data in the DRAM is relatively small, and the probability of the second data being wrong will be less than the error probability of the first data.
  • the number of the first numerical values in the first data may be greater than the number of the second numerical values according to the data bus inverting the DBI signal (that is, the dbi_n signal in the foregoing embodiment).
  • the DBI signal is used to indicate whether data needs to be transmitted in reverse. When the number of "1" in the data is greater than the number of "0", the power consumption of the bus transmission is small.
  • the first value when the first value is “1” and the second value is “0”, it can be determined that the number of the first value in the first data is greater than A second value, wherein the first DBI signal is used to indicate that the first data is data that does not need to be transmitted on a data bus after being inverted.
  • the first value when the first value is "1” and the second value is “0”, it can be learned from the first DBI signal that the number of "1" in the first data is greater than "0”, The first data does not need to be flipped and transmitted, and bus transmission power consumption can be saved.
  • the first value When the first value is “0" and the second value is “1”, it can be judged according to the second data bus that the DBI signal is inverted. The number of the first value in the data is greater than the second value. Quantity, wherein the second DBI signal is used to indicate that the first data is data to be transmitted on the data bus after being inverted. Put another way, when the first value is "0" and the second value is “1", it can be learned from the second DBI signal that the number of "0" in the first data is greater than "1", The first data needs to be inverted and transmitted to save bus transmission power consumption.
  • the storage mode of the DRAM chip in the DRAM array of data determines whether the data to be stored is inverted and stored to reduce the number of high-charge storage cells in the DRAM array and reduce the data error rate.
  • the device embodiments described above are only schematic.
  • the division of the modules is only a logical function division, and there may be another division manner in actual implementation.
  • multiple modules or components can be combined or integrated into another system, or some features can be ignored or not implemented.
  • the connections between the modules discussed in the above embodiments may be electrical, mechanical, or other forms.
  • the modules described as separate components may or may not be physically separated.
  • the component displayed as a module may or may not be a physical module.
  • each functional module in each of the applied embodiments may exist independently or be integrated into a processing module.
  • An embodiment of the present invention further provides a computer program product for data processing, including a computer-readable storage medium storing program code, where the program code includes instructions for executing the method flow described in any one of the foregoing method embodiments.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a magnetic disk, an optical disk, a random access memory (RAM), a solid state hard disk (Solid State Disk, SSD), or a nonvolatile Various non-transitory machine-readable media such as memory (non-volatile memory) that can store program code.

Abstract

Provided are a memory access method and a computer system. The memory access method can determine, on the basis of the number of "1"s and "0"s in data to be written to DRAM memory and a DRAM storage mode, whether data to be stored is to be rotated and stored, thereby reducing the number of storage units in DRAM carrying a high charge, and so lowering the probability of data error.

Description

内存访问技术及计算机系统Memory access technology and computer system 技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种内存访问技术及计算机系统。The present application relates to the field of computer technology, and in particular, to a memory access technology and a computer system.
背景技术Background technique
动态随机存取存储器(Dynamic Random Access Memory,DRAM)是各种计算系统的核心部件。随着需要处理数据量的不断增大,DRAM成为影响整个计算系统性能和功耗的最重要因素之一。DRAM是用电容来存储电荷,电容中电荷的多寡状态决定了这个DRAM单位的逻辑状态是1还是0。但是由于电容不可避免的存在漏电现象,漏电现象包括单元的电荷流失(Cell leakage)、串音(Crosstalk)等等。如果电荷不足会导致数据出错,因此电容必须被周期性的刷新来补充电容的漏电电荷,这种刷新操作也被称为预充电操作。通常,内存控制器设计每个行的刷新时间间隔是固定的,例如,刷新时间间隔可以为64ms。然而,如果DRAM中最坏单元的错误率很高,就需要将刷新时间间隔降低,从而会造成对DRAM的频繁刷新,增加系统功耗并占用系统带宽。Dynamic random access memory (Dynamic Random Access Memory, DRAM) is a core component of various computing systems. With the increasing amount of data to be processed, DRAM has become one of the most important factors affecting the performance and power consumption of the entire computing system. DRAM uses a capacitor to store charge. The amount of charge in the capacitor determines whether the logic state of this DRAM unit is 1 or 0. However, due to the unavoidable leakage phenomenon of the capacitor, the leakage phenomenon includes the cell's charge leakage (Cell leakage), crosstalk (Crosstalk), and so on. If the insufficient charge will cause data error, the capacitor must be refreshed periodically to supplement the leakage charge of the capacitor. This refresh operation is also called pre-charge operation. Generally, the memory controller design has a fixed refresh interval for each row, for example, the refresh interval can be 64ms. However, if the error rate of the worst cell in DRAM is high, the refresh interval needs to be reduced, which will cause frequent refresh of DRAM, increase system power consumption and occupy system bandwidth.
发明内容Summary of the Invention
本申请中提供的一种内存访问技术及计算机系统,能够降低DRAM内存中存储的数据的出错概率。A memory access technology and a computer system provided in the present application can reduce the error probability of data stored in a DRAM memory.
第一方面,本申请提供了一种内存访问方法。根据该方法,在接收待写入动态随机存储器DRAM的第一数据后,确定所述第一数据中第一数值的数量大于第二数值的数量,并确定所述DRAM用于在位线为高电压时存储所述第一数值且在位线为低电压时存储所述第二数值。响应于上述确定,将所述第一数据进行翻转以获得第二数据,并将所述第二数据存储于所述DRAM中。In a first aspect, the present application provides a memory access method. According to the method, after receiving the first data to be written into the dynamic random access memory DRAM, it is determined that the number of the first value in the first data is greater than the number of the second value, and it is determined that the DRAM is used to be high on the bit line. The first value is stored when voltage is applied and the second value is stored when the bit line is low voltage. In response to the above determination, the first data is inverted to obtain second data, and the second data is stored in the DRAM.
本申请提供的上述内存访问方法可以根据待写入DRAM内存的第一数据中第一数值和第二数值的数量以及DRAM的存储模式,确定是否将待存储的所述第一数据进行翻转存储,以减少动态随机存储器DRAM中高电荷的存储单元的数量,降低所述第一数据的出错概率。The above-mentioned memory access method provided in this application may determine whether the first data to be stored is inverted and stored according to the number of first and second values in the first data to be written into the DRAM memory and the storage mode of the DRAM. In order to reduce the number of high-charge memory cells in the dynamic random access memory DRAM, the error probability of the first data is reduced.
根据第一方面,在第一种可能的实现方式中,将所述第一数据中的所述第一数值翻转为所述第二数值,将所述第一数据中的所述第二数值翻转为所述第一数值,以获得所述第二数据。According to the first aspect, in a first possible implementation manner, the first value in the first data is flipped to the second value, and the second value in the first data is flipped. Is the first value to obtain the second data.
根据第一方面或第一方面的第一种可能的实现方式,在第二种可能的实现方式中,根据数据总线翻转DBI信号确定所述第一数据中第一数值的数量大于第二数值的数量。根据这种方式,本申请所述的方法,可以复用现有的内存总线上的数据总线翻转DBI信号,使得该方法实施起来更简单。According to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner, it is determined that the number of the first value in the first data is greater than the second value according to the data bus inversion of the DBI signal. Quantity. According to this method, the method described in this application can reuse the data bus flip DBI signal on the existing memory bus, making the method easier to implement.
根据第一方面、第一方面的第一种或第二种可能的实现方式,在第 一方面的第三种可能的实现方式中,所述第一数值为“1”,所述第二数值为“0”;或者,所述第一数值为“0”,所述第二数值为“1”。According to the first aspect, the first or second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the first value is "1", and the second value Is "0"; or the first value is "0" and the second value is "1".
根据第一方面或第一方面的上述任意一种实现方式,在第一方面的第四种可能的实现方式中,所述方法还包括在接收读请求后,根据所述读请求中携带的第一地址从所述DRAM中读取所述第二数据。在确定所述第二数据为翻转后存储的数据后,对所述第二数据进行翻转以获得所述第一数据。According to the first aspect or any one of the foregoing implementation manners of the first aspect, in a fourth possible implementation manner of the first aspect, the method further includes, after receiving the read request, according to the first carried in the read request. An address reads the second data from the DRAM. After determining that the second data is data stored after being inverted, the second data is inverted to obtain the first data.
结合第一方面的第四种可能的实现方式,在第一方面的第五种可能的实现方式中,所述确定所述第二数据为翻转后存储的数据包括:根据所述第二数据的ECC编码中的翻转标识位确定所述第二数据为翻转后被存储的数据。With reference to the fourth possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, the determining that the second data is data stored after being flipped includes: according to the second data, The flip flag in the ECC encoding determines that the second data is data stored after the flip.
第二方面,本申请提供了一种计算机设备,所述计算机设备包括动态随机存储器DRAM,与所述DRAM连接的内存控制器,所述内存控制器用于执行上述第一方面以及第一方面的任意一种可能的实现方式中的方法。In a second aspect, the present application provides a computer device. The computer device includes a dynamic random access memory DRAM, and a memory controller connected to the DRAM. The memory controller is configured to execute the first aspect and any of the first aspects. One possible implementation.
第三方面,本申请提供了一种存储器,所述存储器包括动态随机存储器DRAM、通信接口以及翻转模块。所述DRAM用于存储数据,所述通信接口与所述DRAM连接并用于确定所述第一数据中第一数值的数量大于第二数值的数量,确定所述DRAM用于在位线为高电压时存储所述第一数值且在位线为低电压时存储所述第二数值,并响应于上述确定,将所述第一数据进行翻转以获得第二数据,并将所述第二数据存储于所述DRAM中。In a third aspect, the present application provides a memory. The memory includes a dynamic random access memory DRAM, a communication interface, and a flip module. The DRAM is used to store data, the communication interface is connected to the DRAM, and is used to determine that the number of first values in the first data is greater than the number of second values, and to determine that the DRAM is used for high voltage on the bit line The first value is stored at times and the second value is stored when the bit line is low voltage, and in response to the above determination, the first data is inverted to obtain the second data, and the second data is stored In the DRAM.
结合第三方面,在第一种可能的实现方式中,所述翻转模块用于将所述第一数据中的所述第一数值翻转为所述第二数值,将所述第一数据中的所述第二数值翻转为所述第一数值,以获得所述第二数据。With reference to the third aspect, in a first possible implementation manner, the inversion module is configured to invert the first value in the first data to the second value, and invert the The second value is inverted to the first value to obtain the second data.
结合第三方面或第三方面的第一种可能的实现方式,在第二种可能的实现方式中,所述翻转模块用于根据第一数据总线翻转DBI信号的指示将接收的数据中的第一数值转变为第二数值,以获得所述第二数据。With reference to the third aspect or the first possible implementation manner of the third aspect, in a second possible implementation manner, the inversion module is configured to invert the first of the received data according to the indication of the DBI signal on the first data bus. A value is converted to a second value to obtain the second data.
结合第三方面或第三方面上述任意一种可能的实现方式,在第三种可能的实现方式中,所述通信接口还用于接收读请求,所述读请求中携带有第一地址。所述翻转模块还用于确定根据所述第一地址从所述DRAM中读取的所述第二数据为翻转后存储的数据,并响应于上述确定,对所述第二数据进行翻转以获得所述第一数据。With reference to the third aspect or any one of the foregoing possible implementation manners of the third aspect, in a third possible implementation manner, the communication interface is further configured to receive a read request, and the read request carries a first address. The flip module is further configured to determine that the second data read from the DRAM according to the first address is data stored after the flip, and in response to the above determination, flip the second data to obtain Said first data.
结合第三方面或第三方面上述任意一种可能的实现方式,在第三方面的第四种可能的实现方式中,所述第一数值为“1”,所述第二数值为“0”;或所述第一数值为“0”,所述第二数值为“1”。With reference to the third aspect or any one of the foregoing possible implementation manners of the third aspect, in a fourth possible implementation manner of the third aspect, the first value is "1" and the second value is "0" ; Or the first value is "0" and the second value is "1".
第四方面,本申请提供了一种内存访问方法,该方法包括在接收待写入动态随机存储器DRAM的第一数据后,确定所述第一数据中“1”的数量大于“0”的数量且所述DRAM的存储模式为位线为高电压时存储数据为逻辑“1”的存储模式。响应于上述判断,将所述第一数据进行翻转以获得第二数据,并将所述第二数据存储于所述DRAM中。In a fourth aspect, the present application provides a memory access method. The method includes, after receiving first data to be written into a dynamic random access memory DRAM, determining that the number of “1” in the first data is greater than the number of “0”. In addition, the storage mode of the DRAM is a storage mode in which the stored data is logic "1" when the bit line is at a high voltage. In response to the above judgment, the first data is inverted to obtain second data, and the second data is stored in the DRAM.
第五方面,本申请提供了又一种内存访问方法,该方法包括在接收 待写入动态随机存储器DRAM的第三数据后,确定所述第三数据中“1”的数量小于“0”的数量且所述DRAM的存储模式为位线为高电压时存储数据为逻辑“0”的存储模式。响应于上述判断,将所述第三数据进行翻转以获得第四数据,并将所述第四数据存储于所述DRAM中。In a fifth aspect, the present application provides another memory access method. The method includes, after receiving third data to be written into the dynamic random access memory DRAM, determining that the number of "1" in the third data is less than "0". And the storage mode of the DRAM is a storage mode in which data is stored at logic "0" when the bit line is at a high voltage. In response to the above judgment, the third data is inverted to obtain fourth data, and the fourth data is stored in the DRAM.
本申请提供的第四方面或第五方面的内存访问方法可以根据待写入DRAM内存的数据中“1”和“0”的数量以及DRAM的存储模式,确定是否将待存储数据进行翻转存储,以减少动态随机存储器DRAM中高电荷的存储单元的数量,降低数据的出错概率。The memory access method according to the fourth aspect or the fifth aspect provided in this application may determine whether the data to be stored is inverted and stored according to the number of "1" and "0" in the data to be written into the DRAM memory, and the storage mode of the DRAM. In order to reduce the number of high-charge memory cells in the dynamic random access memory DRAM, the probability of data errors is reduced.
第六方面,本申请还提供了一种计算机程序产品,包括程序代码,所述程序代码包括的指令被计算机所执行,以实现所述第一方面或第二方面中所述的方法。According to a sixth aspect, the present application further provides a computer program product including program code, and the instructions included in the program code are executed by a computer to implement the method described in the first aspect or the second aspect.
第七方面,本申请还提供了一种计算机可读存储介质,所述计算机可读存储介质用于存储程序代码,所述程序代码包括的指令被计算机所执行,以实现前述第一方面、第四方面、或第五方面中所述的方法。According to a seventh aspect, the present application further provides a computer-readable storage medium for storing program code, and the instructions included in the program code are executed by a computer to implement the foregoing first aspect, the first The method described in the fourth aspect, or the fifth aspect.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only the present invention. Some embodiments.
图1为本发明实施例提供的一种计算机系统架构示意图;FIG. 1 is a schematic diagram of a computer system architecture according to an embodiment of the present invention; FIG.
图2为本发明实施例提供的一种内存控制器的结构示意图;2 is a schematic structural diagram of a memory controller according to an embodiment of the present invention;
图3为本发明实施例提供的一种数据翻转方法的流程示意图;3 is a schematic flowchart of a data flipping method according to an embodiment of the present invention;
图4为本发明实施例提供的又一种内存控制器的结构示意图;4 is a schematic structural diagram of still another memory controller according to an embodiment of the present invention;
图5为本发明实施例提供的又一种计算机系统的结构示意图;5 is a schematic structural diagram of still another computer system according to an embodiment of the present invention;
图6为本发明实施例提供的一种读数据的方法流程图;6 is a flowchart of a method for reading data according to an embodiment of the present invention;
图7为本发明实施例提供的一种写数据的示意图;FIG. 7 is a schematic diagram of writing data according to an embodiment of the present invention; FIG.
图8为本发明实施例提供的一种读数据的示意图;8 is a schematic diagram of reading data according to an embodiment of the present invention;
图9为本发明实施例提供的一种内存访问方法的流程图。FIG. 9 is a flowchart of a memory access method according to an embodiment of the present invention.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚地描述。显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of embodiments of the present invention, but not all the embodiments.
图1为本发明实施例提供的计算机系统架构示意图。如图1所示,计算机系统100至少可以包括处理器102、内存控制器106以及内存108。通常,内存控制器106可以集成在处理器102中。需要说明的是,本发明实施例提供的计算机系统中,除了图1所示的器件外,计算机系统100还可以包括通信接口以及作为外存的磁盘等其他器件,在此不做限制。FIG. 1 is a schematic diagram of a computer system architecture according to an embodiment of the present invention. As shown in FIG. 1, the computer system 100 may include at least a processor 102, a memory controller 106, and a memory 108. Generally, the memory controller 106 may be integrated in the processor 102. It should be noted that, in the computer system provided by the embodiment of the present invention, in addition to the devices shown in FIG. 1, the computer system 100 may further include a communication interface and other devices such as an externally stored magnetic disk, which is not limited herein.
处理器(Processor)102是计算机系统100的运算核心和控制核心(Control Unit)。处理器102中可以包括多个处理器核(core)104。处理器102可以是一块超大规模的集成电路。在处理器102中安装有操作系统和其他软件程序,从而处理器102能够实现对内存108、缓存及磁盘的访问。可以理解的是,在本发明实施例中,处理器102中的Core 104例如可以是中央处理器(Central Processing unit,CPU),还可以是其他特定集成电路(Application Specific Integrated Circuit,ASIC)。The processor 102 is a computing core and a control core of the computer system 100. The processor 102 may include a plurality of processor cores 104. The processor 102 may be a very large-scale integrated circuit. An operating system and other software programs are installed in the processor 102, so that the processor 102 can implement access to the memory 108, cache, and disk. It can be understood that, in the embodiment of the present invention, the Core 104 in the processor 102 may be, for example, a central processing unit (CPU), or other specific integrated circuit (Application Specific Integrated Circuit, ASIC).
内存控制器(Memory Controller)106是计算机系统100内部控制内存108并用于管理与规划从内存108到Core 104间的数据传输的总线电路控制器。通过内存控制器106,内存108与Core 104之间可以交换数据。内存控制器106可以是一个单独的芯片,并通过系统总线与Core 104连接。本领域技术人员可以知道,内存控制器106也可以被集成到处理器102中(如图1所示)也可以被内置于北桥中。本发明实施例不对内存控制器20的具体位置进行限定。实际应用中,内存控制器106可以控制必要的逻辑以将数据写入内存108或从内存108中读取数据。The memory controller 106 is a bus circuit controller that controls the memory 108 internally of the computer system 100 and is used to manage and plan data transmission from the memory 108 to the Core 104. Through the memory controller 106, data can be exchanged between the memory 108 and the Core 104. The memory controller 106 may be a separate chip and connected to the Core 104 through a system bus. Those skilled in the art may know that the memory controller 106 may also be integrated into the processor 102 (as shown in FIG. 1) or may be built into the Northbridge. The embodiment of the present invention does not limit the specific position of the memory controller 20. In practical applications, the memory controller 106 may control necessary logic to write data to or read data from the memory 108.
内存108是计算机系统100的主存。内存108通过双倍速率(double data rate,DDR)总线和内存108相连。内存108通常用来存放操作系统中各种正在运行的软件、输入和输出数据以及与外存交换的信息等。为了提高处理器102的访问速度,内存108需要具备访问速度快的优点。在传统的计算机系统架构中,通常采用动态随机存取存储器(Dynamic Random Access Memory,DRAM)作为内存108。处理器102能够通过内存控制器106高速访问内存108,对内存1080中的任意一个存储单元进行读操作和写操作。The memory 108 is the main memory of the computer system 100. The memory 108 is connected to the memory 108 through a double data rate (DDR) bus. The memory 108 is generally used to store various running software in the operating system, input and output data, and information exchanged with external storage. In order to improve the access speed of the processor 102, the memory 108 needs to have the advantage of fast access speed. In the traditional computer system architecture, dynamic random access memory (Dynamic Random Access Memory, DRAM) is usually used as the memory 108. The processor 102 can access the memory 108 at a high speed through the memory controller 106, and perform a read operation and a write operation on any storage unit in the memory 1080.
在本发明实施例中,以内存108为DRAM为例进行描述,因此,内存108也可以被称为DRAM 108。数据存储于DRAM 108的存储单元(又可以被称为DRAM cell)中,在本发明实施例中,存储单元是指用于存储数据的最小存储单元(cell)。通常,一个存储单元可以存储1位(bit)数据。当然,有的存储单元也可以实现多值存储。如前所述,DRAM是利用电容存储电量的多寡来代表数据0和1。由于电容存在漏电现象,如果电容中的电荷不足,会导致存储的数据出错。因此,每隔一段时间,内存控制器106会刷新DRAM108中的数据,以防止DRAM 108丢失数据。并且,DRAM 108是易失性的,当计算机系统100关闭电源后,DRAM 108中的信息将不再保存。In the embodiment of the present invention, the memory 108 is described as an example of DRAM. Therefore, the memory 108 may also be referred to as a DRAM 108. The data is stored in a storage unit (also called a DRAM cell) of the DRAM 108. In the embodiment of the present invention, the storage unit refers to the smallest storage cell (cell) for storing data. Generally, a memory cell can store 1 bit of data. Of course, some storage units can also implement multi-value storage. As mentioned earlier, DRAM uses the amount of storage capacity of the capacitor to represent data 0 and 1. Due to the leakage phenomenon of the capacitor, if the charge in the capacitor is insufficient, the stored data will be wrong. Therefore, at regular intervals, the memory controller 106 refreshes the data in the DRAM 108 to prevent the DRAM 108 from losing data. In addition, DRAM 108 is volatile. When the computer system 100 is powered off, the information in DRAM 108 will no longer be saved.
实际应用中,DRAM 108中的DRAM cell被排列分布成一个矩阵,这个矩阵我们称之为DRAM bank,内存控制器106通过相应的行列解码器可以定位到DRAM bank中的任意一个bit。多个DRAM bank可以组成一个DRAM chip(又可被称为内存芯片),多个DRAM chip可以组成一个DRAM rank。多个DRAM rank又可以被集成为一个双列直插式存储模块(Dual-Inline-Memory-Modules,DIMM)。例如,如图1所示,DRAM 108可以包括多个通道(channel)110。每个通道110中可以包括至少一个rank,每个rank 中可以包括至少一个bank。每个bank都包括多个用于存储数据的存储单元。本领域技术人员可以知道,rank指的是连接到同一个片选(chip select)信号的内存颗粒(chip)。内存控制器106能够对同一个rank中的chip进行写操作,而在同一个rank的chip也共享同样的控制信号。内存控制器106可以通过内存总线分别访问DRAM 108中各个通道内的存储单元中的数据。In practical applications, the DRAM cells in the DRAM 108 are arranged into a matrix. This matrix is called DRAM bank. The memory controller 106 can locate any bit in the DRAM bank through the corresponding row and column decoder. Multiple DRAM banks can form a DRAM chip (also known as a memory chip), and multiple DRAM chips can form a DRAM rank. Multiple DRAM ranks can be integrated into a dual-inline-memory-modules (DIMM). For example, as shown in FIG. 1, the DRAM 108 may include a plurality of channels 110. Each channel 110 may include at least one rank, and each rank may include at least one bank. Each bank includes multiple storage units for storing data. Those skilled in the art can know that rank refers to a memory chip connected to the same chip select signal. The memory controller 106 can write to chips in the same rank, and chips in the same rank also share the same control signals. The memory controller 106 can respectively access the data in the memory cells in the various channels in the DRAM 108 through the memory bus.
实际应用中,DRAM bank中的存储单元分别连接字线(word line)和位线(bit line),字线在水平方向上连接多个存储单元,位线用于在垂直方向上连接多个存储单元。字线用于使能存储单元,位线用于向各存储单元中的电容充电,从而可以利用电容存储电量的多寡来代表数据0和1。可以理解的是,当位线为高电平时,电容中存储的电量较多,或者说,电容中的电荷较多。当位线为低电平时,电容中存储的电量较少,或者说,电容中的电荷较少。可以应用中,一种情况下,当电容中电荷较多时可以用于指示存储单元中存储的数据为“1”,电荷较少时用于指示存储的数据为“0”。在另一种情况下,当电容中电荷较多时也可以用于指示存储的数据为“0”,电荷较少时用于指示存储的数据为“1”。In practical applications, the memory cells in a DRAM bank are connected to a word line and a bit line, respectively. The word line connects multiple memory cells in the horizontal direction, and the bit line is used to connect multiple memory cells in the vertical direction. unit. The word line is used to enable the memory cell, and the bit line is used to charge the capacitor in each memory cell, so that the amount of storage capacity of the capacitor can be used to represent the data 0 and 1. It can be understood that when the bit line is at a high level, there is more electric energy stored in the capacitor, or in other words, there is more electric charge in the capacitor. When the bit line is low, there is less power stored in the capacitor, or less charge in the capacitor. In the application, in one case, when there is more charge in the capacitor, it can be used to indicate that the data stored in the storage unit is "1", and when there is less charge, it is used to indicate that the stored data is "0". In another case, it can also be used to indicate that the stored data is "0" when there is more charge in the capacitor, and it is used to indicate "1" when the charge is less.
从理论上分析,DRAM存储单元可以认为是一个噪声信道(noisy channel)。发明人在实现本发明的过程中发现,DRAM中的数据发生错误情况可以分为两种,一种是数据由逻辑0变成逻辑1,另外一种是数据由逻辑1变成逻辑0。经研究表明,假设DRAM存储单元中的电荷量较高时表示逻辑1,则数据由逻辑0变成逻辑1的概率远小于由逻辑1变成逻辑0的概率。因此,降低DRAM阵列中存储高电荷的存储单元的数量可以大大降低DRAM阵列的出错概率。Theoretically, a DRAM memory cell can be considered as a noise channel. The inventor found in the process of implementing the present invention that data error conditions in DRAM can be divided into two types, one is that the data changes from logic 0 to logic 1 and the other is that the data changes from logic 1 to logic 0. Studies have shown that assuming that the amount of charge in a DRAM memory cell is high in logic 1, the probability of the data changing from logic 0 to logic 1 is much smaller than the probability of changing logic 1 to logic 0. Therefore, reducing the number of memory cells storing high charges in the DRAM array can greatly reduce the error probability of the DRAM array.
为了降低DRAM中存储的数据的出错概率,本发明实施例提出了一种内存访问方法,该方法可以在内存控制器中来实现,也可以在DRAM内存中来实现。下面将先结合图1、图2和图3对如何在内存控制器中实现来进行描述。图2为本发明实施例提供的一种内存控制器的结构示意图。如图2所示,内存控制器106可以包括通信接口1061、ECC模块1062以及翻转模块1063。通信接口1061可以基于现有的DDR总线接口协议来实现。通信接口1061用于接收Core104发送的待写入内存DRAM 108的待写入数据。ECC模块1062,用于对通信接口1061接收的待写入数据进行校验和纠错,以获得所述待写入数据的ECC编码。翻转模块1063可以用于执行图3所示的数据翻转方法。图3为本发明实施例提供的一种数据翻转方法的流程图,具体的,如图3所示,该方法可以包括下述步骤。可以理解的是,图3所示的数据翻转方法也可以被称为本发明实施例提供的一种内存访问方法。In order to reduce the error probability of the data stored in the DRAM, an embodiment of the present invention proposes a memory access method, which can be implemented in a memory controller or in a DRAM memory. The following will first describe how to implement it in the memory controller with reference to FIG. 1, FIG. 2, and FIG. 3. FIG. 2 is a schematic structural diagram of a memory controller according to an embodiment of the present invention. As shown in FIG. 2, the memory controller 106 may include a communication interface 1061, an ECC module 1062, and a flip module 1063. The communication interface 1061 may be implemented based on an existing DDR bus interface protocol. The communication interface 1061 is configured to receive data to be written and sent to the memory DRAM 108 by the Core 104. The ECC module 1062 is configured to check and correct the data to be written received by the communication interface 1061 to obtain the ECC code of the data to be written. The flip module 1063 may be used to execute the data flip method shown in FIG. 3. FIG. 3 is a flowchart of a data reversing method according to an embodiment of the present invention. Specifically, as shown in FIG. 3, the method may include the following steps. It can be understood that the data inversion method shown in FIG. 3 may also be referred to as a memory access method provided by an embodiment of the present invention.
在步骤302中,接收待写入内存的第一数据。实际应用中,内存控制器106能够通过内存控制器106与core 104之间的通信接口1061接收core 104发送的第一数据。实际应用中,所述第一数据的大小可以根据DDR总线的带宽来确定,例如,第一数据可以为64比特(bit)或32bit。在此不对第一数据的大小进行限定。In step 302, first data to be written into a memory is received. In practical applications, the memory controller 106 can receive the first data sent by the core 104 through the communication interface 1061 between the memory controller 106 and the core 104. In practical applications, the size of the first data may be determined according to a bandwidth of the DDR bus. For example, the first data may be 64 bits or 32 bits. The size of the first data is not limited herein.
在步骤304中,判断所述第一数据中“1”的数量是否大于“0”的数量。当所述第一数据中“1”的数量大于“0”的数量时,该方法进入步骤306。当所述第一数据中“1”的数量小于“0”的数量时,该方法进入步骤308。In step 304, it is determined whether the number of "1" in the first data is greater than the number of "0". When the number of “1” in the first data is greater than the number of “0”, the method proceeds to step 306. When the number of “1” in the first data is less than the number of “0”, the method proceeds to step 308.
在步骤306中,判断所述DRAM的存储模式是否为第一模式,其中,所述第一模式用于指示存储单元中电容中的电荷量较高时对应的数据为逻辑“1”的存储形式。当所述DRAM的存储模式为第一模式时,该方法进入步骤310。当所述DRAM的存储模式不为第一模式时,该方法进入步骤314。在本发明实施例中,DRAM的存储模块可以包括第一模式和第二模式,其中,所述第一模式也可以被称为true cell位存储模式,所述true cell位存储模式是指DRAM阵列中存储单元的电容中的电荷量较高对应的数据为逻辑“1”时的存储模式。所述第二模式也可以被称为anti cell位存储模式,所述anti cell位存储模式是指存储单元的电容中的电荷量较高对应的数据为逻辑“0”的存储形式。换一种表达方式,true cell位存储模式是指位线为高电压时存储逻辑“1”,位线为低电压时存储逻辑“0”的存储模式。anti cell位存储模式是指位线为低电压时存储逻辑“1”,位线为高电压时存储逻辑“0”的存储模式。在本发明实施例中,第一模式也就是指位线为高电压时存储数据为逻辑“1”的存储模式,第二模式也就是指位线为高电压时存储数据为逻辑“0”的存储模式。需要说明的是,DRAM的存储模式可以根据生产DRAM芯片的生产商给的出厂信息获得,也可以自行进行检测得到。In step 306, it is determined whether the storage mode of the DRAM is a first mode, where the first mode is used to indicate that the corresponding data when the amount of charge in the capacitor in the storage unit is high is a storage form of logic "1" . When the storage mode of the DRAM is the first mode, the method proceeds to step 310. When the storage mode of the DRAM is not the first mode, the method proceeds to step 314. In the embodiment of the present invention, the memory module of the DRAM may include a first mode and a second mode, wherein the first mode may also be referred to as a true cell bit storage mode, and the true cell bit storage mode refers to a DRAM array The storage mode when the amount of charge in the capacitance of the middle storage unit is higher and the corresponding data is logic "1". The second mode may also be referred to as an anti-cell bit storage mode. The anti-cell bit storage mode refers to a storage form in which the data corresponding to a higher amount of charge in the capacitance of a memory cell is a logic "0". To put it another way, the true cell bit storage mode refers to a storage mode that stores a logic "1" when the bit line is high voltage and a logic "0" when the bit line is low voltage. The anti-cell bit storage mode refers to a storage mode that stores a logic "1" when the bit line is at a low voltage and a logic "0" when the bit line is at a high voltage. In the embodiment of the present invention, the first mode is a storage mode in which data is stored at a logic “1” when the bit line is at a high voltage, and the second mode is a storage mode in which data is stored at a logic “0” when the bit line is at a high voltage. Storage mode. It should be noted that the storage mode of the DRAM can be obtained according to the factory information provided by the manufacturer of the DRAM chip, or it can be detected by itself.
若在步骤304中判断所述第一数据中的“1”的数量大于“0”的数量,且在本步骤中,判断存储模式为位线为高电压时存储数据为逻辑“1”的存储模式,则该方法进入步骤310。若本步骤中,判断存储模式为位线为高电压时存储数据为逻辑“0”的存储模式,则该方法进入步骤314。If it is determined in step 304 that the number of "1" in the first data is greater than the number of "0", and in this step, it is determined that the storage data is a logical "1" storage when the bit line is a high voltage Mode, the method proceeds to step 310. If it is determined in this step that the storage mode is a storage mode in which the stored data is a logic “0” when the bit line is at a high voltage, the method proceeds to step 314.
在步骤308中,判断所述DRAM的存储模式是否为第一模式,其中,所述第一模式用于指示存储单元的电容中的电荷量较高时对应的数据为逻辑“1”的存储形式。当所述DRAM的存储模式为第一模式时,该方法进入步骤314。当所述DRAM的存储模式不为第一模式时,该方法进入步骤310。具体的,若在步骤304中判断出所述第一数据中的“1”的数量小于“0”的数量,且若在本步骤中进一步判断出存储模式为位线为高电压时存储数据为逻辑“1”的存储模式,则该方法进入步骤314。若在在本步骤中进一步判断存储模式不是位线为高电压时存储的数据为逻辑“1”的存储模式,也就是说若DRAM的存储模式为位线为高电压时存储的数据为逻辑“0”的存储模式,则该方法进入步骤310。In step 308, it is determined whether the storage mode of the DRAM is a first mode, where the first mode is used to indicate that when the amount of charge in the capacitance of the storage unit is high, the corresponding data is a logical "1" storage . When the storage mode of the DRAM is the first mode, the method proceeds to step 314. When the storage mode of the DRAM is not the first mode, the method proceeds to step 310. Specifically, if it is determined in step 304 that the number of "1" in the first data is less than the number of "0", and if it is further determined in this step that the storage mode is that the bit line is high voltage, the stored data is If the storage mode is logic “1”, the method proceeds to step 314. If it is further determined in this step that the storage mode is not a storage mode where the data stored when the bit line is high voltage is a logic "1", that is, if the storage mode of the DRAM is a data stored when the bit line is high voltage is a logic "" 0 "storage mode, the method proceeds to step 310.
在步骤310中,对所述第一数据中的各位数据进行翻转(flip),获得第二数据,并进入步骤312。具体的,可以将第一数据中的逻辑“1”翻转为逻辑“0”,将第一数据中的逻辑“0”翻转为逻辑“1”。在本发明实施例中,将对第一数据进行翻转后得到的数据称为第二数据。实际应用中,可以利用翻转电路来实现。例如,翻转电路可以通过非门阵列对每位数值进行取反来实现。In step 310, the data of each bit in the first data is flipped to obtain the second data, and the process proceeds to step 312. Specifically, the logical "1" in the first data may be inverted to a logical "0", and the logical "0" in the first data may be inverted to a logical "1". In the embodiment of the present invention, the data obtained by inverting the first data is referred to as the second data. In practical applications, this can be achieved using a flip circuit. For example, the flip circuit can be implemented by negating the value of each bit through an NOT gate array.
在步骤312中,将所述第二数据写入DRAM的存储单元中。具体的, 内存控制器可以将翻转后的第二数据发送给内存108,并将翻转标识携带在ECC模块获得的ECC编码中发送给内存108,内存108可以将获得的第二数据和ECC编码存储于DRAM阵列中。在本发明实施例中,翻转标识用于指示是否对接收的第一数据进行了翻转。换一种表达方式,翻转标识用于指示存储于DRAM中的第二数据是否为翻转后的数据。在本发明实施例中,可以将翻转标识携带在ECC编码中,通过预设的ECC编码中预设的位来指示是否所述第二数据是否为翻转后的数据。在本发明实施例中不对翻转标识的标识进行具体限定,例如,可以用逻辑“1”指示对所述第一数据进行了翻转,用逻辑“0”指示未对所述第一数据进行翻转。In step 312, the second data is written into a memory cell of the DRAM. Specifically, the memory controller may send the flipped second data to the memory 108, and carry the flipped identifier in the ECC code obtained by the ECC module to the memory 108, and the memory 108 may store the obtained second data and the ECC code. In DRAM array. In the embodiment of the present invention, the flip flag is used to indicate whether the received first data is flipped. In another expression, the flip flag is used to indicate whether the second data stored in the DRAM is the flipped data. In the embodiment of the present invention, the flip flag may be carried in the ECC code, and whether the second data is the flipped data is indicated by a preset bit in the preset ECC code. In the embodiment of the present invention, the identification of the flip flag is not specifically limited. For example, a logic “1” may be used to indicate that the first data is flipped, and a logic “0” may be used to indicate that the first data is not flipped.
在步骤314中,将所述第一数据写入DRAM中。具体的,内存控制器将所述第一数据以及ECC编码模块根据所述第一数据获得的ECC编码写入DRAM的存储单元中。In step 314, the first data is written into the DRAM. Specifically, the memory controller writes the first data and the ECC code obtained by the ECC coding module according to the first data into a storage unit of the DRAM.
基于上述实施例的描述可以知道,在本发明实施例中,针对不同的数据写入不同存储模式的DRAM时,可能会出现下述四种情形。在一种情形下,结合步骤304、306和310可以知道,若在步骤304中确定所述第一数据中的“1”的数量大于“0”的数量,且在步骤306中进一步判断所述DRAM的存储模式为位线为高电压时存储的数据为逻辑“1”的存储模式,则说明将所述第一数据写入DRAM后,用于存储所述第一数据的存储单元中高电荷的存储单元较多,这就可能使得存储单元中数据出错(例如,逻辑“1”变成逻辑“0”)的概率增大。因此,为了降低出错概率,需要对第一数据中的各位数据进行翻转,将翻转后获得的第二数据写入DRAM中。Based on the description of the foregoing embodiments, it can be known that in the embodiments of the present invention, when different types of DRAMs are written to different data, the following four situations may occur. In one case, it can be known in combination with steps 304, 306, and 310 that if it is determined in step 304 that the number of "1" in the first data is greater than the number of "0", and in step 306, it is further determined that The storage mode of the DRAM is a storage mode in which the data stored when the bit line is at a high voltage is a logic "1". It means that after the first data is written into the DRAM, the high-charge There are many storage units, which may increase the probability of data in the storage units (for example, a logical "1" becomes a logical "0"). Therefore, in order to reduce the error probability, each bit of data in the first data needs to be inverted, and the second data obtained after the inversion is written into the DRAM.
在第二种情形下,结合步骤304、308和310可以知道,若在步骤304中确定所述第一数据中的“1”的数量小于“0”的数量,且在步骤308中进一步判断所述DRAM的存储模式为位线为高电压时存储的数据为逻辑“0”的存储模式,则说明将所述第一数据写入DRAM后,用于存储所述第一数据的存储单元中高电荷的存储单元也较多,这就可能使得存储单元中的数据出错的概率增大。因此,在这种情形下也需要对第一数据中的各位数据进行翻转后存储。In the second case, it can be known in combination with steps 304, 308, and 310 that if it is determined in step 304 that the number of "1" in the first data is less than the number of "0", and in step 308, If the storage mode of the DRAM is a storage mode where the data stored when the bit line is at a high voltage is a logic "0", it means that after the first data is written into the DRAM, a high charge is stored in a memory cell for storing the first data There are also more storage units, which may increase the probability of data errors in the storage units. Therefore, in this case, data of each bit in the first data needs to be stored after being inverted.
结合在本发明实施例中的步骤304、306和314可以知道,在第三种情形下,若在步骤304中确定所述第一数据中的“1”的数量大于“0”的数量,且在步骤306中进一步判断所述DRAM的存储模式不是位线为高电压时存储的数据为逻辑“1”的存储模式,而是位线为高电压时存储的数据为逻辑“0”的存储模式,则说明将所述第一数据写入DRAM后,用于存储所述第一数据的存储单元中高电荷的存储单元不多,在这种情形下,出错的概率并不高,因此,无需对所述第一数据进行翻转后存储。In combination with steps 304, 306, and 314 in the embodiment of the present invention, it can be known that, in the third case, if it is determined in step 304 that the number of "1" in the first data is greater than the number of "0", and In step 306, it is further determined that the storage mode of the DRAM is not a storage mode where the data stored when the bit line is high voltage is a logic "1", but a storage mode where the data stored when the bit line is high voltage is a logic "0" , It means that after the first data is written into the DRAM, there are not many high-charge memory cells in the memory cells used to store the first data. In this case, the probability of error is not high, so there is no need to The first data is stored after being inverted.
结合在本发明实施例中的步骤304、308和314可以知道,在第四种情形下,若在步骤304中确定所述第一数据中的“1”的数量小于“0”的数量,且在步骤308中进一步确定所述DRAM的存储模式是位线为高电压时存储的数据为逻辑“1”的存储模式,则说明将所述第一数据写入DRAM后,用于存储所 述第一数据的存储单元中高电荷的存储单元也并不多。在这种情形下,出错的概率也并不高,因此,无需对所述第一数据进行翻转后存储。In combination with steps 304, 308, and 314 in the embodiment of the present invention, it can be known that, in the fourth case, if it is determined in step 304 that the number of "1" in the first data is less than the number of "0", and In step 308, it is further determined that the storage mode of the DRAM is a storage mode in which the data stored when the bit line is at a high voltage is a logic "1", then the first data is written into the DRAM to store the first data. There are not many high-charge memory cells in a data memory cell. In this case, the probability of error is not high, so there is no need to store the first data after it is inverted.
根据本发明实施例提供的内存访问方法,在将数据写入DRAM内存时,可以根据待写入数据中的逻辑“1”和逻辑“0”的数量的大小以及DRAM的存储模式来确定是否对待存储的数据进行翻转后存储,从而在将数据存储于DRAM中后,能够降低DRAM阵列中的高电荷的存储单元的数量,降低数据的出错概率。According to the memory access method provided by the embodiment of the present invention, when data is written into the DRAM memory, whether to treat the data may be determined according to the number of logical "1" and logical "0" in the data to be written and the storage mode of the DRAM. The stored data is stored after being inverted, so that after the data is stored in the DRAM, the number of high-charge memory cells in the DRAM array can be reduced, and the probability of data errors is reduced.
需要说明的是,本发明实施例是以第一数据为例说明将一个数据写入具有不同存储模式的DRAM时可能出现的不同情形。实际应用中,由于一个DRAM内存的存储模式在出厂时就是固定的,假设第一DRAM阵列的存储模式为第一模式,第二DRAM阵列的存储模式为第二模式,则将第一数据写入第一DRAM时,可能会出现上述步骤304、306和310描述的第一种情形。将第三数据写入第二DRAM时,可能会出现上述步骤304、308和310描述的第二种情形,例如,若需要将第三数据写入第二DRAM,第三数据中的逻辑“0”的数量多于逻辑“1”的数量,且第二DRAM的存储模式为高电压时存储的数据为逻辑“0”的存储模式,则可以对所述第三数据中进行翻转获得第四数据,并将获得的第四数据写入所述第二DRAM中,以减少第二DRAM中高电荷的存储单元的数量,降低出错概率。当然,将其他数据存储于不同的DRAM中时,也可能出现上述第三和第四种情形。It should be noted that the embodiment of the present invention uses the first data as an example to describe different situations that may occur when writing one data to a DRAM having different storage modes. In actual application, since the storage mode of a DRAM memory is fixed at the factory, assuming that the storage mode of the first DRAM array is the first mode and the storage mode of the second DRAM array is the second mode, the first data is written to In the first DRAM, the first situation described in steps 304, 306, and 310 may occur. When writing the third data to the second DRAM, the second situation described in steps 304, 308, and 310 may occur. For example, if the third data needs to be written to the second DRAM, the logic "0" in the third data "Is greater than the number of logic" 1 ", and the data stored when the storage mode of the second DRAM is a high voltage is a storage mode of logic" 0 ", then the third data may be inverted to obtain the fourth data And writing the obtained fourth data into the second DRAM to reduce the number of high-charge memory cells in the second DRAM and reduce the error probability. Of course, when other data is stored in different DRAMs, the third and fourth situations described above may also occur.
如前所述,在本发明实施例中,可以将翻转标识携带在ECC编码中,通过预设的ECC编码中预设的位来指示是否对待写入所述DRAM的第一数据进行了翻转存储。通常,对于64bits的数据需要8bits的ECC编码。在本发明实施例中可以利用8bits中的一部分作为翻转标识。例如,可以利用ECC编码中的最后1位作为翻转标识,也可以利用ECC编码中的最后2位或3位作为翻转标识。实际应用中,可以根据具体情况确定翻转标识所占的bit数量。可以理解的是,具体需要多少位翻转标识可以根据被执行翻转的数据的大小来决定。例如,假设第一数据的大小为64bits,执行翻转时也是对64bits进行翻转,则可以利用ECC编码中的1个bit作为翻转标识。若执行翻转时是分别对第一数据中的高32位和低32位分别确定是否进行了翻转,则可以利用ECC编码中的2bits来作为翻转标识。As mentioned above, in the embodiment of the present invention, the flip flag may be carried in the ECC code, and a preset bit in the preset ECC code is used to indicate whether the first data to be written to the DRAM is flipped and stored. . Generally, 8-bit ECC encoding is required for 64-bit data. In the embodiment of the present invention, a part of 8 bits can be used as a flip flag. For example, the last 1 bit in the ECC code may be used as the flip flag, and the last 2 or 3 bits in the ECC code may be used as the flip flag. In practical applications, the number of bits occupied by the flip flag can be determined according to specific conditions. It can be understood that how many bits of the flip flag are needed can be determined according to the size of the data to be flipped. For example, assuming that the size of the first data is 64 bits, and the 64 bits are also inverted when performing the inversion, one bit in the ECC encoding may be used as the inversion identifier. If the inversion is performed to determine whether the inversion is performed on the upper 32 bits and the lower 32 bits in the first data respectively, 2 bits in the ECC encoding may be used as the inversion flag.
为了更好的理解本方案,下面将以一个具体的示例对图2和图3描述的方法进行描述。例如,第一数据为64bits的数据,当内存控制器106的通信接口1061接收到所述第一数据后,所述第一数据可以被分别发送给ECC模块1062和翻转模块1063。ECC模块1062对所述第一数据进行ECC处理,获得6bits的ECC编码。翻转模块1063可以根据上述图3所示的方法对所述第一数据的高32bit和低32bit分别进行处理,以确定是否对高32bit和低32bit的数据进行翻转存储,并生成2bits的翻转标识。其中,翻转标识中的1bit用于指示是否对所述第一数据中的高32bits的数据进行了翻转,另外1bit用于指示是否对所述第一 数据中的低32bits的数据进行了翻转。可以理解的是,无论是否对所述第一数据进行了翻转,内存控制器向内存108发生的数据均为64bits。In order to better understand this solution, the method described in FIG. 2 and FIG. 3 will be described below with a specific example. For example, the first data is data of 64 bits. After the communication interface 1061 of the memory controller 106 receives the first data, the first data may be sent to the ECC module 1062 and the flip module 1063, respectively. The ECC module 1062 performs ECC processing on the first data to obtain a 6-bit ECC code. The flip module 1063 may process the high 32-bit and low 32-bit of the first data respectively according to the method shown in FIG. 3 described above, to determine whether to flip and store the high 32-bit and low 32-bit data, and generate a 2-bits flip flag. Among them, 1 bit in the flip flag is used to indicate whether the data of higher 32 bits in the first data is flipped, and the other 1 bit is used to indicate whether the data in the lower 32 bits of the first data is flipped. It can be understood that no matter whether the first data is inverted, the data generated by the memory controller to the memory 108 is 64 bits.
在获得6bits的ECC编码和2bit的翻转标识后,内存控制器106可以将64bits的数据、6bits的ECC编码以及2bits的翻转标识一起发送给内存108以存储到DRAM的存储单元中。具体的,在传输时,内存控制器106可以通过DQ线上的DQ[63:0]传输待存储与DRAM中的64bits的数据,通过DQ[69:64]来传输6bits的ECC编码,并通过DQ[71:70]传输翻转标识。其中,翻转标识和ECC编码可以一起被存储于ECC存储芯片区域内。从上述实施例可以看出,由于本实施例将数据翻转和ECC编码并行进行,因此,并没有引入额外的翻转延迟。After obtaining the 6-bit ECC code and the 2-bit flip flag, the memory controller 106 may send the 64-bits data, the 6-bit ECC code, and the 2-bit flip flag to the memory 108 for storage in the storage unit of the DRAM. Specifically, during the transmission, the memory controller 106 can transmit the 64-bit data to be stored and the DRAM through DQ [63: 0] on the DQ line, and transmit the 6-bit ECC code through DQ [69:64], and pass DQ [71:70] transmits the flip flag. The flip flag and the ECC code can be stored together in the ECC memory chip area. It can be seen from the above embodiments that since the data inversion and ECC encoding are performed in parallel in this embodiment, no additional inversion delay is introduced.
实际应用中,在另一种情形下,还可以先确定是否对接收的第一数据进行翻转,在获得翻转标识后,将翻转标识和第一数据一起输入ECC模块1062进行ECC编码。在这种情形下,可以如图4所示,图4为本发明实施例提供的另一种内存控制器106的结构示意图。图4所示的内存控制器除了包括如图2所示的通信接口1061、ECC模块1062以及翻转模块1063外,还包括数据队列1064。仍以上述64bits的第一数据为例,在图4所示的内存控制器中,当通信接口1061接收到所述第一数据后,可以利用翻转模块1063对所述第一数据按照上述图3所示的方法确定是否进行翻转处理,并获得翻转标识。在获得翻转标识后,可以将翻转模块1063处理后的数据以及翻转标识分别发送到数据队列1064和ECC模块1062。可以理解的是,翻转模块处理后的数据包括将所述第一数据进行翻转后获得的第二数据,也可以是指未进行翻转的所述第一数据。ECC模块1062可以对翻转模块1063处理后的数据以及翻转标识一起进行ECC编码,在获得ECC编码后,可以将数据队列1064中的翻转模块1063处理后的数据、翻转标识以及ECC编码一起发送到内存108进行存储。可以理解的是,图4所示的实施例与图2所示的实施例的不同点在于,在图2所示的实施例中,ECC模块1062只对输入的所述第一数据进行编码,而在图4所示的实施例中,ECC模块可以对翻转模块1063处理后的数据以及获得的翻转标识一起进行ECC处理获得ECC编码。In practical applications, in another case, it may also be determined whether the first received data is inverted. After obtaining the inverted flag, the inverted flag and the first data are input to the ECC module 1062 for ECC encoding. In this case, as shown in FIG. 4, FIG. 4 is a schematic structural diagram of another memory controller 106 according to an embodiment of the present invention. The memory controller shown in FIG. 4 includes a data queue 1064 in addition to the communication interface 1061, the ECC module 1062, and the flip module 1063 shown in FIG. Still taking the above-mentioned first data of 64bits as an example, in the memory controller shown in FIG. 4, after the communication interface 1061 receives the first data, the first data can be used by the flip module 1063 according to the above FIG. 3 The method shown determines whether to perform a flip process and obtains a flip flag. After obtaining the inversion flag, the data processed by the inversion module 1063 and the inversion flag may be sent to the data queue 1064 and the ECC module 1062, respectively. It can be understood that the data processed by the inversion module includes the second data obtained by inverting the first data, and may also refer to the first data that is not inverted. The ECC module 1062 can perform ECC encoding on the data processed by the flip module 1063 and the flip flag. After obtaining the ECC code, the data processed by the flip module 1063, the flip flag, and the ECC code in the data queue 1064 can be sent to the memory together. 108 for storage. It can be understood that the embodiment shown in FIG. 4 is different from the embodiment shown in FIG. 2 in that in the embodiment shown in FIG. 2, the ECC module 1062 only encodes the input first data, In the embodiment shown in FIG. 4, the ECC module may perform ECC processing on the data processed by the inversion module 1063 and the obtained inversion identifier to obtain an ECC code.
上面的实施例是以图3所示的数据翻转方法在内存控制器中实现为例进行描述。实际应用中,本发明实施例提供的内存访问方法还可以在DRAM内存模块中来实现。下面将结合图3和图5对本发明实施例提供的又一种实现方法进行描述。本领域技术人员可以知道,现有的DDR4具有DBI技术,主要用于对总线上的数据进行翻转,以减少数据在总线上传输时的功耗。如果图5所示的实施例就是基于现有计算机系统中的DBI方案进行设计。The above embodiment is described by using the data inversion method shown in FIG. 3 in a memory controller as an example. In practical applications, the memory access method provided by the embodiment of the present invention may also be implemented in a DRAM memory module. The following describes still another implementation method provided by an embodiment of the present invention with reference to FIGS. 3 and 5. Those skilled in the art can know that the existing DDR4 has DBI technology, which is mainly used to invert data on the bus to reduce power consumption when data is transmitted on the bus. If the embodiment shown in FIG. 5 is designed based on a DBI scheme in an existing computer system.
图5为本发明实施例提供的一种计算机系统的结构示意图。如图5所示,图5所示的计算机系统中内存控制器106中包括通信接口1061、ECC模块1062以及主DDR物理层接口(Physical Interface,PHY)1065。其中通信接口1061用于与core104进行通信,接收core104发送的待写入内存108的第一数据。 ECC模块1062用于对所述第一数据进行ECC校验,获得ECC编码。FIG. 5 is a schematic structural diagram of a computer system according to an embodiment of the present invention. As shown in FIG. 5, the memory controller 106 in the computer system shown in FIG. 5 includes a communication interface 1061, an ECC module 1062, and a main DDR physical layer interface (PHY) 1065. The communication interface 1061 is configured to communicate with the core 104 and receive first data to be written into the memory 108 sent by the core 104. The ECC module 1062 is configured to perform an ECC check on the first data to obtain an ECC code.
主DDR物理层接口(又可称为主DDR PHY)1065是主机侧与内存108连接的物理层接口。主DDR PHY1065具有数据总线翻转(Data Bus Inversion,DBI)功能。根据现有的DBI技术,当总线上传输逻辑“1”时所需的功耗较少,因此,现有的DBI技术会根据待传输中的数据中“1”的数量来确定是否需要对待传输的数据进行翻转传输。具体的,在内存控制器106侧的主DDR PHY1065以及在内存108侧的从DDR物理层接口均具有DBI功能。内存控制器106侧的主DDR PHY1065主要用于对内存控制器106发送给内存108的数据中的“1”的数量进行检测,以确定是否需要进行翻转后传输。并通过dbi_n信号通知内存108中的从DDR物理层接口(从DDR PHY)1081其接收的数据是否为被翻转传输的数据。需要说明的是,图5所示的计算机系统中,并未对内存控制器106的结构进行改动。The main DDR physical layer interface (also known as the main DDR PHY) 1065 is a physical layer interface connected to the memory 108 on the host side. The main DDR PHY1065 has a Data Bus Inversion (DBI) function. According to the existing DBI technology, less power consumption is required when transmitting logic "1" on the bus. Therefore, the existing DBI technology will determine whether to be transmitted according to the number of "1" in the data to be transmitted. The data is transferred in reverse. Specifically, the master DDR 1065 on the memory controller 106 side and the slave DDR physical layer interface on the memory 108 side have DBI functions. The main DDR PHY 1065 on the side of the memory controller 106 is mainly used to detect the number of “1” in the data sent by the memory controller 106 to the memory 108 to determine whether it is necessary to perform a post-flip transmission. The dbi_n signal is used to notify whether the data received from the DDR physical layer interface (from the DDR PHY) 1081 in the memory 108 is the data that is transmitted by being inverted. It should be noted that, in the computer system shown in FIG. 5, the structure of the memory controller 106 is not changed.
在图5所示的计算机系统中的内存108中包括从DDR物理层接口(Physical Interface,PHY)1081以及与从DDR PHY 1081连接的DRAM阵列1084。其中,从DDR PHY 1081中可以包括翻转模块1082以及第二DBI模块1083。DRAM阵列1084中包括多个DRAM rank,每个rank中包括多个用于存储数据的DRAM存储单元(又称为:DRAM cell)。The memory 108 in the computer system shown in FIG. 5 includes a slave DDR physical layer interface (PHY) 1081 and a DRAM array 1084 connected to the slave DDR 1081. Among them, the DDR PHY 1081 may include a flip module 1082 and a second DBI module 1083. The DRAM array 1084 includes a plurality of DRAM ranks, and each rank includes a plurality of DRAM storage cells (also referred to as: DRAM cells) for storing data.
第二DBI模块1082为与内存控制器106侧第一DBI模块1066对应的DBI模块,用于在第一DBI模块1066对第一数据实现翻转传输后,根据dbi_n信号将接收的数据再次进行翻转,以得到core 104发送给内存控制器的待存储数据。可以理解的是,如果第一DBI模块1066未对第一数据进行翻转传输,则第二DBI模块根据接收的dbi_n信号也不会对其接收的数据进行翻转处理。根据这种方式,第二DBI模块输出的数据即为core 104发送给内存控制器的待存储数据。The second DBI module 1082 is a DBI module corresponding to the first DBI module 1066 on the memory controller 106 side, and is used to reverse the received data according to the dbi_n signal after the first DBI module 1066 implements the reverse transmission of the first data. In order to obtain the data to be stored that the core 104 sends to the memory controller. It can be understood that if the first DBI module 1066 does not perform the flip transmission on the first data, the second DBI module also does not perform flip processing on the data it receives according to the received dbi_n signal. According to this method, the data output by the second DBI module is the data to be stored that the core 104 sends to the memory controller.
在本发明实施例中,为了降低存储于DRAM阵列1084中的数据的错误率,在现有的从DDR PHY 1081中增加了翻转模块1083。其中,翻转模块1083用于接收第二DBI模块1082处理后的数据,并根据图3所示的数据翻转方法对输入翻转模块1083的数据进行处理。具体的,翻转模块1083可以复用主DDR PHY 1065发送的dbi_n信号指示以判断是否需要对第二DBI模块1082输出的数据进行翻转存储。In the embodiment of the present invention, in order to reduce the error rate of data stored in the DRAM array 1084, a flip module 1083 is added to the existing DDR PHY 1081. The inversion module 1083 is configured to receive the data processed by the second DBI module 1082 and process the data input to the inversion module 1083 according to the data inversion method shown in FIG. 3. Specifically, the flip module 1083 may reuse the dbi_n signal indication sent by the main DDR 1065 to determine whether the data output by the second DBI module 1082 needs to be flipped and stored.
具体的,仍然以第一数据为例进行描述。由于DBI技术是要保证总线上传输的逻辑“1”尽量多,以降低总线传输的功耗。因此,当从DDR PHY 1081中的第二DBI模块1083当接收的dbi_n信号指示主DDR PHY 1065对所述第一数据未进行翻转传输,则说明第一数据中的逻辑“1”的数量大于逻辑“0”的数量。当从DDR PHY 1081中的第二DBI模块1083当接收的dbi_n信号指示主DDR PHY 1065对所述第一数据进行了翻转传输,则说明第一数据中的逻辑“1”的数量小于逻辑“0”的数量。在获得待存储的数据中的逻辑“1”的数量的占比后,翻转模块1083会进一步根据DRAM阵列的存储模式确定是否需要对第二 DBI模块输出的数据进行翻转处理后存储于DRAM中。翻转模块1083的具体处理方法可以参见前述对图3的具体描述,在此不再赘述。需要说明的是,在本发明实施例中,dbi_n信号也可以被称为数据总线翻转DBI信号。Specifically, the first data is still used as an example for description. Because DBI technology is to ensure that there are as many logic "1" s transmitted on the bus as possible to reduce the power consumption of the bus transmission. Therefore, when the received dbi_n signal from the second DBI module 1083 in the secondary PHY 1081 indicates that the primary DDR PHY 1065 has not reversed the transmission of the first data, it means that the number of logic "1" in the first data is greater than The number of "0". When the received dbi_n signal from the second DBI module 1083 in the slave PHY 1081 indicates that the master DDR 1065 has reversed the transmission of the first data, it means that the number of logic "1" in the first data is less than logic "0 "quantity. After obtaining the ratio of the number of logic “1” in the data to be stored, the flip module 1083 further determines whether the data output by the second DBI module needs to be flipped and stored in the DRAM according to the storage mode of the DRAM array. For a specific processing method of the flip module 1083, refer to the foregoing detailed description of FIG. 3, and details are not described herein again. It should be noted that, in the embodiment of the present invention, the dbi_n signal may also be referred to as a data bus inversion DBI signal.
需要说明的是,本发明实施例在内存侧实现数据翻转方法时,翻转模块1083只是复用了现有的DBI功能中的dbi_n信号来判断待存储数据中的逻辑“1”和逻辑“0”的数量的大小,而不需要自行去检测。并且,需要说明的是,图5是以翻转模块1083位于从DDR PHY 1081中来描述,实际应用中,翻转模块1083也可以独立于从DDR PHY 1081而独立存在。在此不做限定。It should be noted that when the method of data inversion is implemented on the memory side in the embodiment of the present invention, the inversion module 1083 only reuses the dbi_n signal in the existing DBI function to judge the logic "1" and logic "0" in the data to be stored The number of sizes without the need to detect it by yourself. In addition, it should be noted that FIG. 5 is described with the flip module 1083 located in the slave PHY 1081. In practical applications, the flip module 1083 may also exist independently of the slave PHY 1081. It is not limited here.
可以理解的是,在图3和图5所示的实施例中,由于翻转模块1083复用了DDR PHY 1081中的DBI功能,对内存控制器没有改变,因此,实际应用中很容易实现。It can be understood that, in the embodiments shown in FIG. 3 and FIG. 5, since the flip module 1083 multiplexes the DBI function in the DDR PHY 1081, there is no change to the memory controller, so it is easy to implement in practical applications.
上述实施例从写数据的过程对数据的翻转处理方法进行描述。下面将简单介绍一下读数据的过程。对于基于上述翻转存储后的数据,在读数据的过程中可以通过图6所述的读数据方法进行处理。如图6所示,该读数据的方法可以包括下述步骤。The above embodiment describes the data flip processing method from the process of writing data. The following will briefly introduce the process of reading data. For the data stored based on the above flipping, during the data reading process, the data reading method described in FIG. 6 may be used for processing. As shown in FIG. 6, the method for reading data may include the following steps.
在步骤602中,接收主机发送的读请求,所述读请求中携带有待读取数据的地址。在步骤604中,根据所述地址从所述内存中读取第二数据及相应的ECC编码。为了描述方便,本发明实施例以前述写数据流程中存储的第二数据为例进行描述。在步骤606中,根据所述ECC编码中的翻转标识确定所述第二数据为翻转后被存储的数据。在步骤608中,对所述第二数据进行解码以获得所述第一数据。具体的,根据所述翻转标识对所述第二数据进行翻转以获得所述第一数据。In step 602, a read request sent by a host is received, and the read request carries an address of data to be read. In step 604, the second data and the corresponding ECC code are read from the memory according to the address. For convenience of description, the embodiment of the present invention is described by using the second data stored in the foregoing data writing process as an example. In step 606, it is determined that the second data is the data stored after the inversion according to the inversion identifier in the ECC encoding. In step 608, the second data is decoded to obtain the first data. Specifically, the second data is flipped according to the flip flag to obtain the first data.
可以理解的是,上述读数据的方法可以由内存控制器106来实现,具体可以由图2和图4中所示的内存控制器106中的翻转模块1063来实现,也可以由内存108中的翻转模块1083来实现。在此不做限定。实际应用中,图5所示的内存控制器106中的翻转模块1083也可以独立于内存控制器存在。It can be understood that the above-mentioned method for reading data may be implemented by the memory controller 106, and specifically may be implemented by the flip module 1063 in the memory controller 106 shown in FIG. 2 and FIG. 4, or may be implemented by the memory 108 It is realized by turning over the module 1083. It is not limited here. In practical applications, the flip module 1083 in the memory controller 106 shown in FIG. 5 may also exist independently of the memory controller.
在实际应用中,在另一种情况下,图5中的翻转模块1083也不是必须的,可以直接复用从DDR PHY1081中的第二DBI模块1082来实现图3所示的方法。具体的,在内存控制器可以生成两个标志位来单独控制Host端的DBI功能和内存模组断的DBI功能。内存控制器从数据中1的个数生成flip标志位通知Host端的DBI功能是否进行翻转数据操作。内存控制器也并行从地址和Anti Cell/True Cell的映射关系生成dbi_n信号直接发送给内存模组来控制模组上要不要进行翻转操作。最后数据、翻转标识(flip标志位)和ECC编码都被存储到DRAM颗粒中。如图7所示,图7分别以第一数据为0000和1111为例对如何结合DBI功能将数据写入不同存储模式的DRAM进行了示例性描述。In practical applications, in another case, the flip module 1083 in FIG. 5 is not necessary, and the second DBI module 1082 in the DDR PHY 1081 can be directly multiplexed to implement the method shown in FIG. 3. Specifically, the memory controller can generate two flags to separately control the DBI function of the host and the DBI function of the memory module. The memory controller generates a flip flag from the number of 1 in the data to notify the DBI function of the host whether to perform a data flip operation. The memory controller also generates a dbi_n signal from the mapping relationship between the address and the Anti Cell / True cell in parallel and sends it directly to the memory module to control whether the module performs a flip operation. The final data, flip flag (flip flag) and ECC code are all stored in the DRAM particles. As shown in FIG. 7, in FIG. 7, the first data is 0000 and 1111 are taken as examples to describe how to write data into DRAMs of different storage modes in combination with the DBI function.
如图7所示,在第一种情形下,假设第一数据为“0000”,所述第一数据待存储的地址对应的DRAM的存储模式为true cell的情况下,内存控制器生成的翻转标识位(如图7中的flip标识位)以及dbi_n信号,其中,翻转(flip) 标识位(flip)为1,dbi_n信号为1。所述翻转标识位用于指示如图5所示的内存控制器106中的第一DBI模块1066(主机端的DBI模块)执行翻转操作。如前所述,翻转标识位可以携带在所述第一数据的ECC编码中。当第一DBI模块1066接收到第一数据以及所述第一数据的ECC编码时,根据所述flip标识位对所述第一数据“0000”进行翻转得到数据Data’:“1111”,并将翻转后的数据“1111”通过内存总线传输给从DDR HPY中的第二DBI模块1082。并且,所述内存控制器通过内存总线将所述dbi_n信号发送给从DDR HPY中的第二DBI模块1082。当所述第二DBI模块1082接收到所述dbi_n信号后,将对从内存总线上接收的数据Data’:“1111”进行翻转得到数据Data”:0000,并将翻转后的数据Data”:0000存储在DRAM阵列的存储单元中。其中,翻转后的数据Data”:0000与所述第一数据相同。根据这种方式,在所述第一数据为0000,且存储模式为true cell的情况下,在存储数据时可以不将数据进行翻转存储。As shown in FIG. 7, in the first case, assuming that the first data is “0000” and the storage mode of the DRAM corresponding to the address where the first data is to be stored is true, the memory controller generates a flip. The identification bit (such as the flip identification bit in FIG. 7) and the dbi_n signal, wherein the flip identification bit (flip) is 1, and the dbi_n signal is 1. The flip flag is used to instruct the first DBI module 1066 (the host-side DBI module) in the memory controller 106 shown in FIG. 5 to perform a flip operation. As mentioned before, the flip flag can be carried in the ECC encoding of the first data. When the first DBI module 1066 receives the first data and the ECC encoding of the first data, the first data "0000" is inverted according to the flip flag to obtain data "Data": "1111", and The inverted data "1111" is transmitted to the second DBI module 1082 in the DDR HPY through the memory bus. And, the memory controller sends the dbi_n signal to the second DBI module 1082 in the DDR HPY through the memory bus. When the second DBI module 1082 receives the dbi_n signal, it will invert the data Data ': "1111" received from the memory bus to obtain the data "Data": 0000, and the inverted data "Data": 0000 Stored in a memory cell of a DRAM array. Among them, the data “" after the data is turned over: 0000 is the same as the first data. According to this method, when the first data is 0000 and the storage mode is true, the data may not be stored when the data is stored. Perform flip storage.
在第二种情形下,当所述第一数据Data为“1111”,所述第一数据的地址对应的存储模式为true cell的存储模式下,内存控制器生成flip标识为0,且生成的dbi_n信号为1。根据所述flip标识,所述主机端的第一DBI模块1066将不对所述第一数据进行翻转,而是直接通过内存总线传输所述第一数据“1111”。当第二DBI模块1082接收到所述第一数据“1111”以及dbi_n:1信号时,所述第二DBI模块1082将根据所述dbi_n信号对接收的所述第一数据进行翻转,得到翻转后的第二数据(Data”:0000)存储到DRAM阵列中。根据这种方式,在所述第一数据为“1111”,且存储模式为true cell的情况下,可以通过复用现有内存中的DBI模块(如图5中的第二DBI模块1082)将待存储的所述第一数据进行翻转后进行存储。In the second case, when the first data Data is "1111" and the storage mode corresponding to the address of the first data is true, the memory controller generates a flip flag of 0, and the generated The dbi_n signal is 1. According to the flip identification, the first DBI module 1066 on the host side will not flip the first data, but directly transmits the first data “1111” through the memory bus. When the second DBI module 1082 receives the first data "1111" and the dbi_n: 1 signal, the second DBI module 1082 will flip the received first data according to the dbi_n signal, and after the flip is obtained, The second data (Data): 0000 is stored in the DRAM array. According to this method, when the first data is "1111" and the storage mode is true, the existing memory can be reused. The DBI module (such as the second DBI module 1082 in FIG. 5) inverts the first data to be stored and stores the first data.
在第三种情况下,当所述第一数据Data为0000,待存储所述第一数据的内存地址对应的存储模式为anti cell的存储模式时,内存控制器生成flip标识为1,且生成的dbi_n信号为0。所述主机端的DBI模块(如图5中第一DBI模块1066)根据所述flip标识对所述第一数据“0000”进行翻转获得Data’:1111,并将翻转后的数据Data’:1111通过内存总线发送给内存中的第二DBI模块1082。当所述第二DBI模块1082接收到数据Data’:1111后,由于dbi_n信号为0,因此,第二DBI模块1082并不对接收到的数据Data’:1111进行翻转,而直接将内存控制器侧的第一DBI模块1066翻转后的数据Data’:1111存储在所述DRAM阵列的存储单元中。在这种情形下,在所述第一数据为“0000”,且存储模式为anti cell的情况下,可以通过复用现有图5所示的内存控制器中的第一DBI模块1066对数据翻转的结果存储数据,也同样能够达到降低数据的错误率的效果。In the third case, when the first data Data is 0000 and the storage mode corresponding to the memory address to store the first data is an anti-cell storage mode, the memory controller generates a flip flag of 1 and generates The dbi_n signal is 0. The host-side DBI module (such as the first DBI module 1066 in FIG. 5) flips the first data "0000" according to the flip identifier to obtain Data ': 1111, and passes the flipped data Data': 1111 through The memory bus is sent to the second DBI module 1082 in the memory. After the second DBI module 1082 receives the data Data ': 1111, since the dbi_n signal is 0, the second DBI module 1082 does not flip the received data Data': 1111, and directly turns the memory controller side The data of the first DBI module 1066 after the inversion Data ': 1111 is stored in a storage unit of the DRAM array. In this case, when the first data is "0000" and the storage mode is anticell, the data can be reused by multiplexing the first DBI module 1066 in the existing memory controller shown in FIG. 5 to the data. Storing data as a result of the flip can also achieve the effect of reducing the error rate of the data.
继续参见图7,在第四种情形下,当所述第一数据Data为1111,待存储所述第一数据的内存地址对应的存储模式为anti cell的存储模式时,内存控制器生成flip标识为0,且生成的dbi_n信号为0。所述主机端的DBI模块(如图5中第一DBI模块1066)根据所述flip标识不对所述第一数据“1111”进行翻转传输,当内存侧的第二DBI模块1082从内存总线接收到数据1111(参见图 7中的Data’:1111)以及dbi_n信号后,由于所述dbi_n信号为0,用于指示不对接收的数据进行翻转,因此,第二DBI模块1082不会对接收的第一数据1111进行翻转,可以直接将第一数据1111(参见图7中的Data”:1111)存储在所述DRAM阵列中。在这种情形下,在所述第一数据为“1111”,且存储模式为anti cell的情况下,第一DBI模块和第二DBI模块均不需要对所述第一数据进行翻转。Continuing to refer to FIG. 7, in the fourth case, when the first data Data is 1111 and the storage mode corresponding to the memory address to store the first data is an anti-cell storage mode, the memory controller generates a flip identifier. Is 0, and the generated dbi_n signal is 0. The host-side DBI module (such as the first DBI module 1066 in FIG. 5) does not transmit the first data "1111" according to the flip identifier. When the second DBI module 1082 on the memory side receives data from the memory bus, After 1111 (see Data ': 1111 in Figure 7) and the dbi_n signal, since the dbi_n signal is 0, it is used to indicate that the received data is not inverted. Therefore, the second DBI module 1082 will not perform the first data received. The 1111 is reversed, and the first data 1111 (see Data ": 1111 in Fig. 7) can be directly stored in the DRAM array. In this case, the first data is" 1111 "and the storage mode is In the case of an anti-cell, neither the first DBI module nor the second DBI module need to flip the first data.
可以理解的是,上述描述是以第一数据分别为“0000”和“1111”为例,通过复用现有计算机系统中的DBI模块,对将第一数据分别存储于true cell的DRAM和anti cell的DRAM中是否需要进行翻转存储的情形进行了详细描述。可以理解的是数据“1111”只是“1”的数量大于“0”的数量的第一数据的一种示例,“0000”也只是“0”的数量大于“1”的数量的第一数据的一种示例。如前所述,true cell是指位线为高电压时存储数据为“1”的存储模式,anti cell是指位线为高电压时存储数据为“0”的存储模式。在图7所示的实施例中,是以flip标识位为“1”指示需要对数据进行翻转,flip标识位为“0”指示不需要对数据进行翻转为例进行描述。并且,图7所示的实施例中,是以dbi_n信号为“1”指示需要对数据进行翻转,dbi_n信号为“0”用于指示不需要对数据进行翻转为例进行描述。可以理解的是,实际应用中,也可以以flip标识位为“0”指示需要对数据进行翻转,dbi_n信号为“0”指示需要对数据进行翻转。在此不做限定。It can be understood that the above description takes the first data as "0000" and "1111" as examples. By multiplexing the DBI module in the existing computer system, the first data is stored in the DRAM and anti of the true cell respectively. A case where flip memory is required in a cell's DRAM is described in detail. It can be understood that the data "1111" is only an example of the first data whose number of "1" is greater than the number of "0", and "0000" is also only the first data whose number of "0" is greater than the number of "1" An example. As mentioned earlier, true cell refers to a storage mode where the bit line is at a high voltage when the data is "1", and anti cell refers to a storage mode where the bit line is at a high voltage when the data is "0". In the embodiment shown in FIG. 7, an example is described in which the flip flag bit is “1” to indicate that data needs to be flipped, and the flip flag bit is “0” to indicate that data needs not to be flipped. Furthermore, in the embodiment shown in FIG. 7, the dbi_n signal is “1” to indicate that data needs to be inverted, and the dbi_n signal is “0” to indicate that data is not to be inverted. For example, description is made. It can be understood that in actual application, the flip flag bit can be “0” to indicate that data needs to be flipped, and the dbi_n signal is “0” to indicate that data needs to be flipped. It is not limited here.
图7以复用现有计算机系统中的DBI模块为例,对写数据的流程如何减少存储数据的出错概率进行了举例描述。图8将对复用DBI模块如何读数据的流程进行简单介绍。如图8所示,在读数据过程中,在本发明读数据被内存颗粒返回的时候,内存控制器发送读请求和dbi_n信号给内存模组。内存模组接收dbi_n信号的时候就配置DDR PHY的DBI模块(如图5中的第二DBI模块1082)是否将读数据翻转。在需要翻转的情况下,读数据从DRAM颗粒回来之后,通过内存模组的DBI模块被翻转,然后对应的数据、翻转标识(flip标志位)和ECC编码被返回给主机侧的DRR PHY。主机使用对应flip标志位的DQ线来判断是否对接收的数据进行数据翻转。最后数据和ECC被返回到内存控制器。如图8所示,图8分别以读取第一数据,且第一数据为0000和1111为例对如何结合DBI功能从不同存储模式的DRAM读出数据进行了示例性描述。FIG. 7 uses a DBI module in an existing computer system as an example to describe how to write data to reduce the probability of error in storing data. Figure 8 will briefly introduce how to read data from the multiplexed DBI module. As shown in FIG. 8, during the data reading process, when the read data of the present invention is returned by the memory particles, the memory controller sends a read request and a dbi_n signal to the memory module. When the memory module receives the dbi_n signal, it configures whether the DBI module of the DDR PHY (such as the second DBI module 1082 in FIG. 5) turns the read data. In the case of flipping, after the read data comes back from the DRAM particles, the DBI module through the memory module is flipped, and then the corresponding data, flip flag (flip flag bit) and ECC code are returned to the host-side DRR PHY. The host uses the DQ line corresponding to the flip flag bit to determine whether to perform data flipping on the received data. Finally the data and ECC are returned to the memory controller. As shown in FIG. 8, in FIG. 8, the first data is read, and the first data is 0000 and 1111, respectively. How to read data from DRAMs of different storage modes in combination with the DBI function is described as an example.
例如,如图8所示,在第一种情形下,当DRAM的存储模式为True cell的存储模式,可以配置dbi_n信号为“1”,用于指示内存中的DBI模块(如图5中的第二DBI模块1082)对数据进行翻转。如图7所示,当所述第一数据为“0000”,且存储模式为True cell的存储模式时,DRAM阵列中存储的数据为Data”:0000,且ECC编码中的flip标识位为1。因此,在读数据的过程中,如图8所示,当待读取的数据为“0000”时,从DRAM中读取的数据为Data”:0000,第二DBI模块1082根据配置的dbi_n信号对读取的数据Data”:0000进行翻转,获得Data’:1111,并将翻转后的数据Data’:1111通过内存总线发送给主DDR PHY侧的第一DBI模块1066,第一DBI模块1066接收到Data’:1111后,根据 ECC编码中的flip标识位“1”判断需要对接收的数据Data’:1111进行翻转,因此第一DBI模块1066可以将接收的数据Data’:1111翻转后得到待读取的数据(Data:0000),并将翻转后的数据“0000”及ECC编码发送给内存控制器。For example, as shown in FIG. 8, in the first case, when the storage mode of the DRAM is a true cell storage mode, the dbi_n signal can be configured to “1” to indicate the DBI module in the memory (as shown in FIG. 5). The second DBI module 1082) inverts the data. As shown in FIG. 7, when the first data is "0000" and the storage mode is True cell storage mode, the data stored in the DRAM array is Data ": 0000, and the flip flag in the ECC encoding is 1 Therefore, in the process of reading data, as shown in FIG. 8, when the data to be read is "0000", the data read from the DRAM is Data ": 0000, and the second DBI module 1082 according to the configured dbi_n signal The read data "Data": 0000 is inverted to obtain Data ': 1111, and the inverted data Data': 1111 is sent through the memory bus to the first DBI module 1066 on the main PHY side, and the first DBI module 1066 receives After Data ': 1111, it is judged that the received data Data': 1111 needs to be inverted according to the flip flag bit "1" in the ECC encoding. Therefore, the first DBI module 1066 can invert the received data Data ': 1111 and wait for it. Read the data (Data: 0000), and send the inverted data "0000" and ECC code to the memory controller.
可以理解的是,图8所示的读流程是与图7中对应的写流程的一个相反的过程。从True cell的DRAM中读取数据1111的过程可以参见图8第二种情形的图示,从Anti cell的DRAM中读取数据0000的过程可以参见图8第三种情形的图示,从Anti cell的DRAM中读取数据1111的过程可以参见图8第四种情形的图示。对图8中第二种至第四种情形的理解可以参见对第一种情形的具体描述,在此不再赘述。It can be understood that the read process shown in FIG. 8 is an opposite process to the corresponding write process in FIG. 7. The process of reading data 1111 from the True Cell DRAM can be seen in the diagram of the second case in Figure 8. The process of reading the data 0000 from Anti Cell's DRAM can be seen in the diagram of the third case in Figure 8. For the process of reading data 1111 in the cell's DRAM, refer to the illustration of the fourth scenario in FIG. 8. For the understanding of the second to fourth situations in FIG. 8, reference may be made to the specific description of the first situation, and details are not described herein again.
需要说明的是,在图7和图8所示的实施例中,当存储模式为True cell模式时,配置dbi_n信号为“1”,用于指示内存中的第二DBI模块对接收的数据进行翻转。当存储模式为Anti cell模式时,配置dbi_n信号为“0”,用于指示内存中的第二DBI模块对接收的数据不进行翻转。可以理解的是,第二DBI模块接收的数据包括从内存总线接收的内存控制器发送的数据,也包括从DRAM阵列读取的数据。实际应用中,也可以用dbi_n信号为“0”用于指示内存中的第二DBI模块对接收的数据进行翻转。本发明实施例不对dbi_n信号的具体标识进行限制。It should be noted that, in the embodiments shown in FIG. 7 and FIG. 8, when the storage mode is True cell mode, the dbi_n signal is configured to be “1”, which is used to instruct the second DBI module in the memory to perform the received data. Flip. When the storage mode is the Anti cell mode, the dbi_n signal is configured to be "0", which is used to instruct the second DBI module in the memory not to flip the received data. It can be understood that the data received by the second DBI module includes data sent from the memory controller received from the memory bus, and also includes data read from the DRAM array. In practical applications, the dbi_n signal can also be "0" to instruct the second DBI module in the memory to flip the received data. The embodiment of the present invention does not limit the specific identification of the dbi_n signal.
需要说明的是,上述实施例分别以第一数据中“1”和“0”的数量为例分别对是否需要对所述第一数据进行翻转存储进行了描述。下面将简单对本发明实施例提供的内存访问方法进行总结描述。图9为本发明实施例提供的一种内存访问方法流程图,如图9所示,该方法可以由内存控制器执行,也可以由内存模块中的翻转模块(又可以被称为翻转电路)执行。为了描述方便,下面以内存控制器为例对图9所示的方法进行描述。It should be noted that, in the foregoing embodiment, the number of “1” and “0” in the first data is taken as an example to describe whether the first data needs to be flipped and stored. The following briefly summarizes the memory access method provided by the embodiment of the present invention. FIG. 9 is a flowchart of a memory access method according to an embodiment of the present invention. As shown in FIG. 9, the method may be executed by a memory controller, or may be a flip module (also referred to as a flip circuit) in a memory module. carried out. For convenience of description, the method shown in FIG. 9 is described below by taking a memory controller as an example.
如图9所示,在步骤902中,内存控制器接收待写入动态随机存储器DRAM的第一数据。在步骤904中,判断所述第一数据中第一数值的数量大于第二数值的数量且所述DRAM的存储模式为位线为高电压时存储数据为所述第一数值的存储模式。在本发明实施例中,第一数值或第二数值用于指示第一数据中比特位的值。例如,在一种情形下,第一数值为“1”,第二数值为“0”。在另一种情形下,第一数值为“0”,第二数值为“1”。As shown in FIG. 9, in step 902, the memory controller receives first data to be written into the dynamic random access memory DRAM. In step 904, it is determined that the number of the first value in the first data is greater than the number of the second value and the storage mode of the DRAM is a storage mode in which the stored data is the first value when the bit line is at a high voltage. In the embodiment of the present invention, the first value or the second value is used to indicate a bit value in the first data. For example, in one case, the first value is "1" and the second value is "0". In another case, the first value is "0" and the second value is "1".
当第一数值为“1”,第二数值为“0”时,如果所述DRAM中的存储模式为位线为高电压时存储数据为第一数值(即“1”)的存储模式(即前述的True cell存储模式),则在步骤906中,所述内存控制器响应于上述判断,将所述第一数据进行翻转以获得第二数据。具体的,所述内存控制器需要分别将第一数据中的第一数值“1”翻转为第二数值“0”,将所述第一数据中的第二数值“0”翻转为第一数值“1”,以得到第二数据。然后在步骤908中,将所述第二数据存储于所述DRAM中。可以理解的是,将所述第一数据进行翻转后,得到的所述第二数据中第一数值“1”的数量小于第二数值“0”的数量。又由于所述DRAM的存储模式为位线为高电压时存储数据为“1”的存储模式(即True cell存储模 式),因此,将所述第二数据存储于所述DRAM中后,所述DRAM中存储所述第二数据的存储单元中高电荷的数量比较少,所述第二数据出错的概率将小于所述第一数据的错误概率。When the first value is "1" and the second value is "0", if the storage mode in the DRAM is a storage mode in which the stored data is the first value (ie, "1") when the bit line is at a high voltage (ie In the aforementioned True cell storage mode), in step 906, the memory controller inverts the first data to obtain the second data in response to the judgment. Specifically, the memory controller needs to invert the first value "1" in the first data to the second value "0", and invert the second value "0" in the first data to the first value. "1" to get the second data. Then in step 908, the second data is stored in the DRAM. It can be understood that after the first data is inverted, the number of the first value “1” in the second data obtained is smaller than the number of the second value “0”. Because the storage mode of the DRAM is a storage mode in which the data is "1" when the bit line is at a high voltage (that is, a true cell storage mode), after the second data is stored in the DRAM, the The number of high charges in the memory cell storing the second data in the DRAM is relatively small, and the probability of the second data being wrong will be less than the error probability of the first data.
在另一种情形下,当第一数值为“0”,第二数值为“1”时,如果所述DRAM中的存储模式为位线为高电压时存储数据为第一数值(即“0”)的存储模式(即前述的Anti cell存储模式),则在步骤906中,所述内存控制器也会响应于上述判断,将所述第一数据进行翻转以获得第二数据。具体的,所述内存控制器需要分别将第一数据中的第一数值“0”翻转为第二数值“1”,将所述第一数据中的第二数值“1”翻转为第一数值“0”,以得到第二数据。然后在步骤908中,将所述第二数据存储于所述DRAM中。可以理解的是,将所述第一数据进行翻转后,得到的所述第二数据中第一数值“0”的数量小于第二数值“1”的数量。又由于所述DRAM的存储模式为位线为高电压时存储数据为“0”的存储模式(即Anti cell存储模式),因此,将所述第二数据存储于所述DRAM中后,所述DRAM中存储所述第二数据的存储单元中高电荷的数量比较少,所述第二数据出错的概率将小于所述第一数据的错误概率。In another case, when the first value is "0" and the second value is "1", if the storage mode in the DRAM is a high voltage on the bit line, the stored data is the first value (that is, "0" ”) Storage mode (that is, the aforementioned Anti-cell storage mode), in step 906, the memory controller also responds to the above determination, and inverts the first data to obtain the second data. Specifically, the memory controller needs to invert the first value "0" in the first data to the second value "1", and invert the second value "1" in the first data to the first value. "0" to get the second data. Then in step 908, the second data is stored in the DRAM. It can be understood that after the first data is inverted, the number of the first value “0” in the second data obtained is less than the number of the second value “1”. Because the storage mode of the DRAM is a storage mode in which data is stored as "0" when the bit line is at a high voltage (that is, an anti-cell storage mode), after the second data is stored in the DRAM, the The number of high charges in the memory cell storing the second data in the DRAM is relatively small, and the probability of the second data being wrong will be less than the error probability of the first data.
可以理解的是,实际应用中,可以根据数据总线翻转DBI信号(即前述实施例中的dbi_n信号)来判断所述第一数据中的第一数值的数量大于所述第二数值的数量。如前所述,所述DBI信号用于指示是否需要将数据翻转传输。当所述数据中的“1”的数量大于“0”的数量时,总线传输的功耗较小。因此,在本发明实施例中,当第一数值为“1”,所述第二数值为“0”,可以根据第一数据总线翻转DBI信号判断所述第一数据中第一数值的数量大于第二数值的数量,其中,所述第一DBI信号用于指示所述第一数据为不需要经过翻转后在数据总线上传输的数据。换一种表达方式,当第一数值为“1”,所述第二数值为“0”,可以根据所述第一DBI信号获知所述第一数据中“1”的数量大于“0”,不需要对所述第一数据进行翻转传输也可以节省总线传输功耗。It can be understood that, in practical applications, the number of the first numerical values in the first data may be greater than the number of the second numerical values according to the data bus inverting the DBI signal (that is, the dbi_n signal in the foregoing embodiment). As mentioned above, the DBI signal is used to indicate whether data needs to be transmitted in reverse. When the number of "1" in the data is greater than the number of "0", the power consumption of the bus transmission is small. Therefore, in the embodiment of the present invention, when the first value is “1” and the second value is “0”, it can be determined that the number of the first value in the first data is greater than A second value, wherein the first DBI signal is used to indicate that the first data is data that does not need to be transmitted on a data bus after being inverted. Put another way, when the first value is "1" and the second value is "0", it can be learned from the first DBI signal that the number of "1" in the first data is greater than "0", The first data does not need to be flipped and transmitted, and bus transmission power consumption can be saved.
当所述第一数值为“0”,所述第二数值为“1”时,可以根据第二数据总线翻转DBI信号判断所述数据中所述第一数值的数量大于所述第二数值的数量,其中,所述第二DBI信号用于指示所述第一数据为需要翻转后在数据总线上传输的数据。换一种表达方式,当第一数值为“0”,所述第二数值为“1”,可以根据所述第二DBI信号获知所述第一数据中“0”的数量大于“1”,需要对所述第一数据进行翻转传输以节省总线传输功耗。When the first value is "0" and the second value is "1", it can be judged according to the second data bus that the DBI signal is inverted. The number of the first value in the data is greater than the second value. Quantity, wherein the second DBI signal is used to indicate that the first data is data to be transmitted on the data bus after being inverted. Put another way, when the first value is "0" and the second value is "1", it can be learned from the second DBI signal that the number of "0" in the first data is greater than "1", The first data needs to be inverted and transmitted to save bus transmission power consumption.
可以理解的是,在按照图9所示的方法将第一数据翻转写入DRAM后,当需要读取第一数据时,可以参照图6所示的方法对从DRAM中读取的数据进行判断是否需要翻转。读取数据的过程可以参加前述图6的实施例的描述,在此不再赘述。从本发明实施例提供的上述方法可以看出,本发明实施例为了降低存储于DRAM阵列中的数据的出错概率,根据待存储数据中的逻辑“1”和逻辑“0”的数量,结合存储数据的DRAM阵列中DRAM芯片的存储模式确定是否对待存储的数据进行翻转存储,以减少DRAM阵列中高电荷的存储单元的数 量,降低数据的错误率。It can be understood that after the first data is written into the DRAM in the reverse manner according to the method shown in FIG. 9, when the first data needs to be read, the data read from the DRAM can be determined by referring to the method shown in FIG. 6. Whether it needs to be flipped. The process of reading data may participate in the description of the foregoing embodiment of FIG. 6, and details are not described herein again. It can be seen from the foregoing methods provided by the embodiments of the present invention that, in order to reduce the error probability of data stored in the DRAM array, according to the number of logical "1" and logical "0" in the data to be stored, in combination with storage The storage mode of the DRAM chip in the DRAM array of data determines whether the data to be stored is inverted and stored to reduce the number of high-charge storage cells in the DRAM array and reduce the data error rate.
可以理解的是,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。例如,多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,上述实施例所讨论的模块相互之间的连接可以是电性、机械或其他形式。所述作为分离部件说明的模块可以是物理上分开的,也可以不是物理上分开的。作为模块显示的部件可以是物理模块或者也可以不是物理模块。另外,在申请实施例各个实施例中的各功能模块可以独立存在,也可以集成在一个处理模块中。It can be understood that the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division, and there may be another division manner in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not implemented. In addition, the connections between the modules discussed in the above embodiments may be electrical, mechanical, or other forms. The modules described as separate components may or may not be physically separated. The component displayed as a module may or may not be a physical module. In addition, each functional module in each of the applied embodiments may exist independently or be integrated into a processing module.
本发明实施例还提供一种数据处理的计算机程序产品,包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令用于执行前述任意一个方法实施例所述的方法流程。本领域普通技术人员可以理解,前述的存储介质包括:U盘、移动硬盘、磁碟、光盘、随机存储器(Random-Access Memory,RAM)、固态硬盘(Solid State Disk,SSD)或者非易失性存储器(non-volatile memory)等各种可以存储程序代码的非短暂性的(non-transitory)机器可读介质。An embodiment of the present invention further provides a computer program product for data processing, including a computer-readable storage medium storing program code, where the program code includes instructions for executing the method flow described in any one of the foregoing method embodiments. Those of ordinary skill in the art can understand that the foregoing storage medium includes: a U disk, a mobile hard disk, a magnetic disk, an optical disk, a random access memory (RAM), a solid state hard disk (Solid State Disk, SSD), or a nonvolatile Various non-transitory machine-readable media such as memory (non-volatile memory) that can store program code.
需要说明的是,本申请所提供的实施例仅仅是示意性的。所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。在本发明实施例、权利要求以及附图中揭示的特征可以独立存在也可以组合存在。在本发明实施例中以硬件形式描述的特征可以通过软件来执行,反之亦然。在此不做限定。It should be noted that the embodiments provided in this application are merely schematic. Those skilled in the art can clearly understand that, for the convenience and brevity of the description, in the above embodiments, the description of each embodiment has its own emphasis. For a part that is not detailed in an embodiment, refer to other implementations. Description of the case. The features disclosed in the embodiments of the present invention, the claims, and the drawings may exist independently or in combination. Features described in the form of hardware in the embodiments of the present invention may be executed by software, and vice versa. It is not limited here.

Claims (15)

  1. 一种内存访问方法,其特征在于,包括:A memory access method, including:
    接收待写入动态随机存储器DRAM的第一数据;Receiving first data to be written into a dynamic random access memory DRAM;
    确定所述第一数据中第一数值的数量大于第二数值的数量;Determining that the number of first values in the first data is greater than the number of second values;
    确定所述DRAM用于在位线为高电压时存储所述第一数值且在位线为低电压时存储所述第二数值;Determining that the DRAM is configured to store the first value when the bit line is high voltage and store the second value when the bit line is low voltage;
    响应于上述确定,将所述第一数据进行翻转以获得第二数据;In response to the above determination, inverting the first data to obtain second data;
    将所述第二数据存储于所述DRAM中。The second data is stored in the DRAM.
  2. 根据权利要求1所述的方法,其特征在于,所述将所述第一数据进行翻转以获得第二数据包括:The method according to claim 1, wherein the inverting the first data to obtain the second data comprises:
    将所述第一数据中的所述第一数值翻转为所述第二数值,将所述第一数据中的所述第二数值翻转为所述第一数值,以获得所述第二数据。Invert the first value in the first data to the second value, and invert the second value in the first data to the first value to obtain the second data.
  3. 根据权利要求1或2所述的方法,其特征在于,所述确定所述第一数据中第一数值的数量大于第二数值的数量包括:The method according to claim 1 or 2, wherein determining that the number of first values in the first data is greater than the number of second values comprises:
    根据数据总线翻转DBI信号确定所述第一数据中第一数值的数量大于第二数值的数量。It is determined according to the data bus inversion DBI signal that the number of first values in the first data is greater than the number of second values.
  4. 根据权利要求1或2所述的方法,其特征在于:The method according to claim 1 or 2, characterized in that:
    所述第一数值为“1”,所述第二数值为“0”;或The first value is "1" and the second value is "0"; or
    所述第一数值为“0”,所述第二数值为“1”。The first value is "0" and the second value is "1".
  5. 根据权利要求1-4任意一项所述的方法,其特征在于,还包括:The method according to any one of claims 1-4, further comprising:
    接收读请求,所述读请求中携带有第一地址;Receiving a read request, where the read request carries a first address;
    根据所述第一地址从所述DRAM中读取所述第二数据;Reading the second data from the DRAM according to the first address;
    确定所述第二数据为翻转后存储的数据;Determining that the second data is data stored after the inversion;
    响应于所述确定,对所述第二数据进行翻转以获得所述第一数据。In response to the determination, the second data is inverted to obtain the first data.
  6. 根据权利要求5所述的方法,其特征在于,所述确定所述第二数据为翻转后存储的数据包括:The method according to claim 5, wherein the determining that the second data is data stored after flipping comprises:
    根据所述第二数据的ECC编码中的翻转标识位确定所述第二数据为翻转后被存储的数据。It is determined that the second data is stored data after the inversion according to the inversion flag in the ECC encoding of the second data.
  7. 一种计算机设备,其特征在于,包括:A computer device, comprising:
    动态随机存储器DRAM,用于存储数据;Dynamic random access memory DRAM for storing data;
    内存控制器,与所述DRAM连接并用于:A memory controller connected to the DRAM and configured to:
    接收待写入所述DRAM的第一数据;Receiving first data to be written into the DRAM;
    确定所述第一数据中第一数值的数量大于第二数值的数量;Determining that the number of first values in the first data is greater than the number of second values;
    确定所述DRAM用于在位线为高电压时存储所述第一数值且在位线为低电压时存储所述第二数值;Determining that the DRAM is configured to store the first value when the bit line is high voltage and store the second value when the bit line is low voltage;
    响应于上述确定,将所述第一数据进行翻转以获得第二数据;In response to the above determination, inverting the first data to obtain second data;
    将所述第二数据存储于所述DRAM中。The second data is stored in the DRAM.
  8. 根据权利要求7所述的计算机设备,其特征在于,所述内存控制器用于:The computer device according to claim 7, wherein the memory controller is configured to:
    将所述第一数据中的所述第一数值翻转为所述第二数值,将所述第一数据中的所述第二数值翻转为所述第一数值,以获得所述第二数据。Invert the first value in the first data to the second value, and invert the second value in the first data to the first value to obtain the second data.
  9. 根据权利要求7或8所述的计算机设备,其特征在于:The computer equipment according to claim 7 or 8, characterized in that:
    所述第一数值为“1”,所述第二数值为“0”;或The first value is "1" and the second value is "0"; or
    所述第一数值为“0”,所述第二数值为“1”。The first value is "0" and the second value is "1".
  10. 根据权利要求9所述的计算机设备,其特征在于,所述内存控制器用于:The computer device according to claim 9, wherein the memory controller is configured to:
    接收读请求,所述读请求中携带有第一地址;Receiving a read request, where the read request carries a first address;
    根据所述第一地址从所述DRAM中读取所述第二数据;Reading the second data from the DRAM according to the first address;
    确定所述第二数据为翻转后存储的数据;Determining that the second data is data stored after the inversion;
    响应于所述确定,对所述第二数据进行翻转以获得所述第一数据。In response to the determination, the second data is inverted to obtain the first data.
  11. 一种存储器,其特征在于,包括:A memory, including:
    动态随机存储器DRAM,用于存储数据;Dynamic random access memory DRAM for storing data;
    通信接口,与所述DRAM连接并用于接收待写入所述DRAM的第一数据;A communication interface connected to the DRAM and configured to receive first data to be written into the DRAM;
    翻转模块,与所述通信接口连接并用于:A flip module, connected to the communication interface and used to:
    确定所述第一数据中第一数值的数量大于第二数值的数量;Determining that the number of first values in the first data is greater than the number of second values;
    确定所述DRAM用于在位线为高电压时存储所述第一数值且在位线为低电压时存储所述第二数值;Determining that the DRAM is configured to store the first value when the bit line is high voltage and store the second value when the bit line is low voltage;
    响应于上述确定,将所述第一数据进行翻转以获得第二数据;In response to the above determination, inverting the first data to obtain second data;
    将所述第二数据存储于所述DRAM中。The second data is stored in the DRAM.
  12. 根据权利要求11所述的存储设备,其特征在于:The storage device according to claim 11, wherein:
    所述翻转模块用于将所述第一数据中的所述第一数值翻转为所述第二数值,将所述第一数据中的所述第二数值翻转为所述第一数值,以获得所述第二数据。The flip module is configured to flip the first value in the first data to the second value, and flip the second value in the first data to the first value to obtain The second data.
  13. 根据权利要求11或12所述的存储设备,其特征在于:The storage device according to claim 11 or 12, wherein:
    所述翻转模块用于根据第一数据总线翻转DBI信号的指示将接收的数据中的第一数值转变为第二数值,以获得所述第二数据。The inversion module is configured to convert a first value in the received data into a second value according to an instruction of inverting the DBI signal by the first data bus to obtain the second data.
  14. 根据权利要求11-13任意一项所述的存储设备,其特征在于:The storage device according to any one of claims 11-13, wherein:
    所述通信接口还用于接收读请求,所述读请求中携带有第一地址;The communication interface is further configured to receive a read request, where the read request carries a first address;
    所述翻转模块还用于:The flip module is further configured to:
    确定根据所述第一地址从所述DRAM中读取的所述第二数据为翻转后存储的数据;Determining that the second data read from the DRAM according to the first address is data stored after being flipped;
    响应于所述确定,对所述第二数据进行翻转以获得所述第一数据。In response to the determination, the second data is inverted to obtain the first data.
  15. 根据权利要求11-14任意一项所述的存储设备,其特征在于:The storage device according to any one of claims 11 to 14, wherein:
    所述第一数值为“1”,所述第二数值为“0”;或The first value is "1" and the second value is "0"; or
    所述第一数值为“0”,所述第二数值为“1”。The first value is "0" and the second value is "1".
PCT/CN2019/108122 2018-09-30 2019-09-26 Memory access technology and computer system WO2020063735A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/217,570 US11521674B2 (en) 2018-09-30 2021-03-30 Memory access technology and computer system for reducing data error probability

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201811163105 2018-09-30
CN201811163105.3 2018-09-30
CN201811369316.2 2018-11-16
CN201811369316.2A CN110968451B (en) 2018-09-30 2018-11-16 Memory access technology and computer system

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/217,570 Continuation US11521674B2 (en) 2018-09-30 2021-03-30 Memory access technology and computer system for reducing data error probability

Publications (1)

Publication Number Publication Date
WO2020063735A1 true WO2020063735A1 (en) 2020-04-02

Family

ID=69953352

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/108122 WO2020063735A1 (en) 2018-09-30 2019-09-26 Memory access technology and computer system

Country Status (1)

Country Link
WO (1) WO2020063735A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1518742A (en) * 2001-06-11 2004-08-04 ģ��װ�ù�˾ Low power hynamic RAM with bit line pre-charge, inversion data write and storing data output
CN106406767A (en) * 2016-09-26 2017-02-15 上海新储集成电路有限公司 A nonvolatile dual-in-line memory and storage method
CN108369819A (en) * 2015-12-09 2018-08-03 英特尔公司 The execution of refresh operation is added during self-refresh mode

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1518742A (en) * 2001-06-11 2004-08-04 ģ��װ�ù�˾ Low power hynamic RAM with bit line pre-charge, inversion data write and storing data output
CN108369819A (en) * 2015-12-09 2018-08-03 英特尔公司 The execution of refresh operation is added during self-refresh mode
CN106406767A (en) * 2016-09-26 2017-02-15 上海新储集成电路有限公司 A nonvolatile dual-in-line memory and storage method

Similar Documents

Publication Publication Date Title
US11681579B2 (en) Semiconductor memory devices and memory systems including the same
EP3458966B1 (en) Apparatuses and methods for performing intra-module databus inversion operations
KR101528659B1 (en) Variable memory refresh devices and methods
US7916570B2 (en) Low power memory device
KR102223007B1 (en) Semiconductor memory device, method of refreshing the same and refresh counter of semiconductor memory device
US10908827B2 (en) Semiconductor memory devices, and memory systems and electronic apparatuses having the same
US10795759B2 (en) Apparatuses and methods for error correction coding and data bus inversion for semiconductor memories
EP4141872A1 (en) Memory controller and memory system including the same
US20160299719A1 (en) Memory device and method for data exchanging thereof
US11955159B2 (en) Semiconductor memory device and memory system including the same
US11521674B2 (en) Memory access technology and computer system for reducing data error probability
US8750068B2 (en) Memory system and refresh control method thereof
US11901025B2 (en) Semiconductor memory device and method of operating semiconductor memory device
WO2020063735A1 (en) Memory access technology and computer system
CN107369473B (en) Storage system and operation method thereof
KR20190119489A (en) Semiconductor memory devices and memory systems including the same
US11513976B2 (en) Advanced CE encoding for bus multiplexer grid for SSD
US20230162770A1 (en) Memory device deserializer circuit with a reduced form factor
US20240118970A1 (en) Techniques for memory scrubbing associated with reliability availability and serviceability features
CN109817257B (en) Power saving method under dynamic memory refresh operation and dynamic memory
US20230376427A1 (en) Memory system and computing system including the same
KR20230017711A (en) Memory device, memory system having the same and operating method thereof
KR20230071683A (en) Memory device, host device and method for operating the memory device
KR20230115012A (en) Memory Device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19867447

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19867447

Country of ref document: EP

Kind code of ref document: A1