[go: up one dir, main page]

CN108959106A - Memory pool access method and device - Google Patents

Memory pool access method and device Download PDF

Info

Publication number
CN108959106A
CN108959106A CN201710353012.6A CN201710353012A CN108959106A CN 108959106 A CN108959106 A CN 108959106A CN 201710353012 A CN201710353012 A CN 201710353012A CN 108959106 A CN108959106 A CN 108959106A
Authority
CN
China
Prior art keywords
address
row
dram
weak
offset
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201710353012.6A
Other languages
Chinese (zh)
Other versions
CN108959106B (en
Inventor
展旭升
孙凝晖
包云岗
黄巍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Institute of Computing Technology of CAS
Original Assignee
Huawei Technologies Co Ltd
Institute of Computing Technology of CAS
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
Application filed by Huawei Technologies Co Ltd, Institute of Computing Technology of CAS filed Critical Huawei Technologies Co Ltd
Priority to CN201710353012.6A priority Critical patent/CN108959106B/en
Publication of CN108959106A publication Critical patent/CN108959106A/en
Application granted granted Critical
Publication of CN108959106B publication Critical patent/CN108959106B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • G06F13/1605Handling requests for interconnection or transfer for access to memory bus based on arbitration
    • G06F13/161Handling requests for interconnection or transfer for access to memory bus based on arbitration with latency improvement
    • G06F13/1626Handling requests for interconnection or transfer for access to memory bus based on arbitration with latency improvement by reordering requests
    • G06F13/1631Handling requests for interconnection or transfer for access to memory bus based on arbitration with latency improvement by reordering requests through address comparison

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Dram (AREA)

Abstract

本申请公开了一种内存访问方法和装置,属于存储器技术领域,所述方法包括:接收内存访问请求;所述内存访问请求用于请求访问动态随机访问存储器DRAM中的目标行;在所述目标行是弱行时,根据偏移量表和预设起始地址确定所述目标行在所述DRAM中的预留域中所对应的映射地址;所述偏移量表中包括所述DRAM中的弱行在所述预留域中所对应的地址偏移量,所述预设起始地址为所述预留域的起始地址;所述地址偏移量在所述预留域中所指向的行不是弱行;根据所述映射地址访问所述预留域;返回访问结果。解决了相关技术中总线中的刷新命令较多,可能会导致总线拥塞,降低系统的性能的问题;达到了可以避免总线拥塞,提高性能的效果。

The present application discloses a memory access method and device, which belong to the field of memory technology. The method includes: receiving a memory access request; the memory access request is used to request access to a target row in a dynamic random access memory DRAM; When the row is a weak row, determine the corresponding mapping address of the target row in the reserved domain in the DRAM according to the offset table and the preset start address; the offset table includes The address offset corresponding to the weak row in the reserved field, the preset start address is the start address of the reserved field; the address offset is set in the reserved field The pointed row is not a weak row; the reserved field is accessed according to the mapped address; and the access result is returned. It solves the problem in the related art that there are many refresh commands in the bus, which may cause bus congestion and reduce the performance of the system; the effect of avoiding bus congestion and improving performance is achieved.

Description

内存访问方法和装置Memory access method and device

技术领域technical field

本申请涉及存储器技术领域,特别涉及一种内存访问方法和装置。The present application relates to the technical field of memory, in particular to a memory access method and device.

背景技术Background technique

动态随机访问存储器(Dynamic Random Access Memory,DRAM)用一个晶体管和一个电容构成一个单元,进而存储一位数据。A dynamic random access memory (Dynamic Random Access Memory, DRAM) uses a transistor and a capacitor to form a unit, and then stores one bit of data.

然而随着时间变化,电容会出现电荷泄露进而导致该单元中存储的数据丢失。因此为了维持存储在单元中的数据,会定期执行刷新各单元中存储的数据的操作,并且实际实现时,以行(字线(Wordline)将同一行中的多个单元串联起来形成行)为单位来执行刷新操作。DRAM中大部分单元维持数据的时长均在256ms以上,而少部分单元维持数据的时长小于256ms甚至小于64ms,因此,为了保证某一行中的各个单元的数据不会丢失,相关技术中需要采用小于目标时长的刷新周期来刷新该行中的数据。其中,目标时长为该行中维持时间最短的单元所对应的维持时间。比如,某一行中维持时间最短的单元所对应的维持时间为40ms,则对于该行,需要采用小于40ms的时长来刷新如采用35ms的刷新周期刷新。However, over time, the capacitor will leak charge and cause the data stored in the cell to be lost. Therefore, in order to maintain the data stored in the cells, the operation of refreshing the data stored in each cell will be periodically performed, and in actual implementation, the row (Wordline (Wordline) connects multiple cells in the same row in series to form a row) as Unit to perform refresh operations. Most of the units in DRAM maintain data for more than 256ms, while a small number of units maintain data for less than 256ms or even less than 64ms. Therefore, in order to ensure that the data of each unit in a certain row will not be lost, it is necessary to use less than The refresh cycle of the target duration to refresh the data in the row. Wherein, the target duration is the maintenance time corresponding to the unit with the shortest maintenance time in the row. For example, if the holding time corresponding to the unit with the shortest holding time in a certain row is 40ms, then for this row, it needs to be refreshed with a duration less than 40ms, for example, a refresh period of 35ms is used for refreshing.

上述方案中,在DRAM中的弱行较多时,由于刷新各个弱行的刷新周期较短,因此总线中的刷新命令较多,可能会导致总线拥塞,降低了系统的性能。In the above solution, when there are many weak rows in the DRAM, since the refresh cycle for refreshing each weak row is short, there are many refresh commands in the bus, which may cause bus congestion and reduce system performance.

发明内容Contents of the invention

为了解决相关技术中总线拥塞系统性能低的问题,本申请实施例提供了一种内存访问方法和装置。In order to solve the problem of low performance of a bus congestion system in the related art, an embodiment of the present application provides a memory access method and device.

第一方面,提供了一种内存访问方法,该内存访问方法包括:In the first aspect, a memory access method is provided, and the memory access method includes:

接收内存访问请求;内存访问请求用于请求访问动态随机访问存储器DRAM中的目标行;Receive a memory access request; the memory access request is used to request access to a target row in the dynamic random access memory DRAM;

在目标行是弱行时,根据偏移量表和预设起始地址确定目标行在DRAM中的预留域中所对应的映射地址;偏移量表中包括DRAM中的弱行在预留域中所对应的地址偏移量,预设起始地址为预留域的起始地址;地址偏移量在预留域中所指向的行不是弱行;When the target line is a weak line, determine the corresponding mapping address of the target line in the reserved domain in the DRAM according to the offset table and the preset start address; the offset table includes the weak line in the DRAM in the reserved The address offset corresponding to the domain, the default starting address is the starting address of the reserved domain; the row pointed to by the address offset in the reserved domain is not a weak row;

根据映射地址访问预留域;Access the reserved domain according to the mapped address;

返回访问结果。Return access result.

在请求访问的目标行是弱行时,通过根据预先保存的偏移量表以及预设起始地址计算该目标行在DRAM的预留域中所对应的映射地址,进而根据映射地址来访问DRAM中的预留域,返回访问结果;其中,由于偏移量表中的各个地址偏移量在预留域中所指向的行均不是弱行,因此,上述方案在请求访问弱行时通过转换其访问地址使得可以访问DRAM中的正常行,这样后续在刷新DRAM时均可以按照正常的刷新周期进行刷新,解决了相关技术中总线中的刷新命令较多,可能会导致总线拥塞,降低系统的性能的问题;达到了可以避免总线拥塞,提高性能的效果。When the target row requested to be accessed is a weak row, the corresponding mapping address of the target row in the DRAM reserved area is calculated according to the pre-saved offset table and the preset start address, and then the DRAM is accessed according to the mapping address The reserved field in , returns the access result; among them, since the row pointed to by each address offset in the offset table in the reserved field is not a weak row, the above scheme passes conversion when requesting to access a weak row Its access address makes it possible to access normal rows in the DRAM, so that when the DRAM is refreshed subsequently, it can be refreshed according to the normal refresh cycle, which solves the problem that there are many refresh commands in the bus in the related art, which may cause bus congestion and reduce system performance. Performance issues; achieve the effect of avoiding bus congestion and improving performance.

在第一种可能的实现方式中,返回访问结果,包括:In the first possible implementation manner, the access result is returned, including:

接收DRAM返回的携带有第一地址的返回结果,第一地址为DRAM中被访问的地址;receiving a return result carrying a first address returned by the DRAM, where the first address is an accessed address in the DRAM;

计算第一地址与预设起始地址的差值;calculating the difference between the first address and the preset starting address;

若差值大于0,则根据偏移量表、预设起始地址计算第一地址所对应的第二地址;If the difference is greater than 0, calculate the second address corresponding to the first address according to the offset table and the preset start address;

返回携带有第二地址的访问结果。Return the access result carrying the second address.

在第二种可能的实现方式中,方法还包括:In a second possible implementation, the method further includes:

检测目标行是否为弱行列表中的行,弱行列表中包括DRAM中的各个弱行;Detect whether the target row is a row in the weak row list, and the weak row list includes each weak row in the DRAM;

若是,则确定目标行是弱行。If so, determine that the target row is a weak row.

结合第二种可能的实现方式,在第三种可能的实现方式中,方法还包括:In combination with the second possible implementation, in the third possible implementation, the method further includes:

对于DRAM中的每一行,检测行中是否包括维持时间小于预设时长的单元;For each row in the DRAM, detecting whether the row includes cells whose duration is less than a preset duration;

若包括维持时间小于预设时长的单元,则将行确定为弱行;If it includes units whose maintenance time is less than the preset duration, the row is determined as a weak row;

根据确定结果生成并保存弱行列表。A list of weak rows is generated and saved based on the determination result.

结合第一方面以及第一方面的上述几种可能的实现方式,在第四种可能的实现方式中,根据偏移量表和预设起始地址确定目标行在DRAM中的预留域中所对应的映射地址之前,方法还包括:In combination with the first aspect and the above-mentioned several possible implementations of the first aspect, in a fourth possible implementation, the location of the target row in the reserved area in the DRAM is determined according to the offset table and the preset start address. Before the corresponding mapped address, the method also includes:

获取DRAM中的弱行的行数以及每个弱行的大小;Obtain the number of weak rows in the DRAM and the size of each weak row;

根据获取到的行数以及每个弱行的大小,计算DRAM中的各个弱行所对应的总大小;Calculate the total size corresponding to each weak row in the DRAM according to the obtained number of rows and the size of each weak row;

在DRAM中预留预设大小的存储空间作为预留域,预设大小大于等于计算得到的总大小;Reserve a storage space of a preset size in the DRAM as a reserved domain, and the preset size is greater than or equal to the calculated total size;

将预留域的起始地址保存为预设起始地址。Save the start address of the reserved domain as the default start address.

结合第一方面以及第一方面的上述几种可能的实现方式,在第五种可能的实现方式中,根据偏移量表和预设起始地址确定目标行在DRAM中的预留域中所对应的映射地址之前,方法还包括:In combination with the first aspect and the above-mentioned several possible implementations of the first aspect, in a fifth possible implementation, the location of the target row in the reserved area in the DRAM is determined according to the offset table and the preset start address. Before the corresponding mapped address, the method also includes:

根据DRAM中的各个弱行的排序,确定每个弱行在预留域中所对应的地址偏移量;According to the sorting of each weak row in the DRAM, determine the address offset corresponding to each weak row in the reserved field;

保存包括各个地址偏移量的偏移量表。An offset table including offsets for individual addresses is maintained.

第二方面,提供了一种内存访问装置,该装置包括:内存控制器和与内存控制器相连的DRAM;内存控制器被配置为执行指令,内存控制器通过执行指令来实现上述第一方面的内存访问方法。In a second aspect, there is provided a memory access device, which includes: a memory controller and a DRAM connected to the memory controller; the memory controller is configured to execute instructions, and the memory controller realizes the above-mentioned first aspect by executing the instructions memory access method.

附图说明Description of drawings

图1是本申请各个实施例所涉及的实施环境的示意图;FIG. 1 is a schematic diagram of the implementation environment involved in various embodiments of the present application;

图2是本申请一实施例提供的内存访问方法的方法流程图;Fig. 2 is a method flowchart of a memory access method provided by an embodiment of the present application;

图3是本申请一实施例提供的内存控制器确定弱行的地址偏移量的示意图;FIG. 3 is a schematic diagram of determining the address offset of a weak row by a memory controller provided by an embodiment of the present application;

图4是本申请一实施例提供的内存控制器保存的偏移量表的示意图;FIG. 4 is a schematic diagram of an offset table stored by a memory controller provided by an embodiment of the present application;

图5是本申请一个实施例提供的内存访问方法的示意框图;FIG. 5 is a schematic block diagram of a memory access method provided by an embodiment of the present application;

图6是本申请一个实施例提供的内存访问装置的示意图。Fig. 6 is a schematic diagram of a memory access device provided by an embodiment of the present application.

具体实施方式Detailed ways

本文所提及的“第一”、“第二”以及类似的词语并不表示任何顺序、数量或者重要性,而只是用来区分不同的组成部分。同样,“一个”或者“一”等类似词语也不表示数量限制,而是表示存在至少一个。“连接”或者“相连”等类似的词语并非限定于物理的或者机械的连接,而是可以包括电性的连接,不管是直接的还是间接的。"First", "second" and similar words mentioned herein do not indicate any order, quantity or importance, but are only used to distinguish different components. Likewise, words like "a" or "one" do not denote a limitation in quantity, but indicate that there is at least one. Words such as "connected" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.

在本文提及的“模块”通常是指存储在存储器中的能够实现某些功能的程序或指令;在本文中提及的“单元”通常是指按照逻辑划分的功能性结构,该“单元”可以由纯硬件实现,或者,软硬件的结合实现。The "module" mentioned in this article usually refers to the program or instruction that can realize certain functions stored in the memory; the "unit" mentioned in this article usually refers to a functional structure divided according to logic, and the "unit" It can be implemented by pure hardware, or a combination of software and hardware.

在本文中提及的“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。The "plurality" mentioned herein means two or more. "And/or" describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B may indicate: A exists alone, A and B exist simultaneously, and B exists independently. The character "/" generally indicates that the contextual objects are an "or" relationship.

请参考图1,其示出了本发明各个实施例所涉及的实施环境的示意图,如图1所示,该实施环境包括中央处理器(Central Processing Unit,CPU)110、内存控制器120和DRAM130。其中:Please refer to FIG. 1, which shows a schematic diagram of an implementation environment involved in various embodiments of the present invention. As shown in FIG. 1, the implementation environment includes a central processing unit (Central Processing Unit, CPU) 110, a memory controller 120 and a DRAM 130 . in:

CPU110用于通过内存控制器120来访问DRAM130。比如,CPU110可以发送用于读写内存的读写请求至内存控制器120。实际实现时,CPU110可以有一个也可以有多个,对此并不做限定。CPU 110 is used to access DRAM 130 through memory controller 120 . For example, the CPU 110 may send a read/write request for reading and writing memory to the memory controller 120 . In actual implementation, there may be one or more CPUs 110 , which is not limited.

内存控制器120是指终端中用于控制DRAM130的器件。比如,内存控制器120接收到CPU110发送的读写请求之后,可以根据读写请求中请求读写的地址对DRAM进行读写操作。另外,内存控制器120还可以接收DRAM返回的读写结果,将读写结果反馈至CPU110。The memory controller 120 refers to a device used to control the DRAM 130 in the terminal. For example, after receiving the read/write request sent by the CPU 110 , the memory controller 120 may perform read/write operations on the DRAM according to the address requested for read/write in the read/write request. In addition, the memory controller 120 may also receive the read and write results returned by the DRAM, and feed back the read and write results to the CPU 110 .

请参考图2,其示出了本申请一个实施例提供的内存访问方法的方法流程图,本实施例以该方法用于图1所示的内存控制器中来举例说明。如图2所示,该内存访问方法包括如下步骤:Please refer to FIG. 2 , which shows a method flowchart of a memory access method provided by an embodiment of the present application. This embodiment is described by using the method in the memory controller shown in FIG. 1 as an example. As shown in Figure 2, the memory access method includes the following steps:

步骤201,对于DRAM中的每一行,检测行中是否包括维持时间小于预设时长的单元。Step 201 , for each row in the DRAM, check whether the row includes cells whose retention time is shorter than a preset duration.

在终端中首次插入DRAM内存之后,对于DRAM中的每一行,内存控制器可以检测该行中是否包括维持时间小于预设时长的单元。其中,预设时长为内存控制器中预先设定的时长,该预设时长可以为256ms,当然实际实现时,根据实际设计需求的不同,该预设时长还可以为其他值,比如128ms或者64ms,本实施例对此并不做限定。After the DRAM memory is inserted into the terminal for the first time, for each row in the DRAM, the memory controller may detect whether the row includes cells whose maintenance time is shorter than a preset duration. Wherein, the preset duration is a preset duration in the memory controller, and the preset duration can be 256ms. Of course, in actual implementation, according to different actual design requirements, the preset duration can also be other values, such as 128ms or 64ms , which is not limited in this embodiment.

实际实现时,对于每一行中的每个单元,内存控制器可以检测该单元的维持时间是否小于预设时长,如果检测结果为小于,则确定该行中包括维持时间小于预设时长的单元;而如果检测结果为不小于,则内存控制器可以继续检测该行中的其他单元直至该行中的所有单元检测完毕为止。In actual implementation, for each unit in each row, the memory controller can detect whether the maintenance time of the unit is less than the preset duration, and if the detection result is less than, then determine that the row includes units whose maintenance time is shorter than the preset duration; And if the detection result is not less than, the memory controller may continue to detect other cells in the row until all the cells in the row are detected.

步骤202,若包括维持时间小于预设时长的单元,则将包括维持时间小于预设时长的单元的行确定为弱行。Step 202, if the unit with the maintenance time shorter than the preset duration is included, the row including the unit with the maintenance time shorter than the preset duration is determined as a weak row.

如果某一行中包括维持时间小于预设时长的单元,则说明该单元中存储的数据短时间内就会丢失,此时,内存控制器可以确定该行为弱行。If a certain row includes a unit whose maintenance time is shorter than a preset duration, it means that the data stored in the unit will be lost in a short time, and at this time, the memory controller can determine that the behavior is weak.

而如果某一行中不包括维持时间小于预设时长的单元,则此时内存控制器可以确定该行为正常行。On the other hand, if a row does not include cells whose maintenance time is shorter than a preset duration, the memory controller can determine that the behavior is normal.

步骤203,根据确定结果生成并保存弱行列表。Step 203, generate and save a list of weak rows according to the determination result.

弱行列表中包括DRAM中的各个弱行。实际实现时,弱行列表中包括各个弱行的地址。比如,DRAM中的某一行为弱行,该行的地址(此处是指该行的起始地址)为0xff00,则该弱行列表中即可包括0xff00。The list of weak rows includes each weak row in the DRAM. In actual implementation, the weak row list includes the address of each weak row. For example, a certain row in the DRAM is a weak row, and the address of the row (here, the starting address of the row) is 0xff00, then the list of weak rows can include 0xff00.

可选地,内存控制器可以在自身通过硬件保存该弱行列表。Optionally, the memory controller may keep this list of weak rows in hardware itself.

需要补充说明的是,步骤201至步骤203为DRAM首次插入至终端之后,内存控制器执行的步骤。It should be added that steps 201 to 203 are steps performed by the memory controller after the DRAM is inserted into the terminal for the first time.

步骤204,获取DRAM中的弱行的行数以及每个弱行的大小。Step 204, acquiring the number of weak rows in the DRAM and the size of each weak row.

当终端被重启之后,内存控制器可以获取DRAM中的弱行的行数以及每个弱行的大小。其中:After the terminal is restarted, the memory controller can obtain the number of weak rows in the DRAM and the size of each weak row. in:

内存控制器获取弱行的行数的步骤包括:读取自身保存的弱行列表,根据读取结果统计所有弱行的行数。The steps for the memory controller to obtain the number of weak rows include: reading the list of weak rows saved by itself, and counting the numbers of all weak rows according to the reading result.

内存控制器获取每个弱行的大小的步骤包括:读取预设的DRAM中的各个行的大小。DRAM是阵列存储器,每一行的单元的个数相同也即每一行的大小相同且是DRAM硬件决定的,因此,内存控制器可以直接读取该DRAM中的行的大小。比如,某一DRAM中的行的大小为8kB,则内存控制器可以读取得到各个弱行的大小为8kB。The step for the memory controller to obtain the size of each weak row includes: reading the preset size of each row in the DRAM. DRAM is an array memory. The number of cells in each row is the same, that is, the size of each row is the same and is determined by the DRAM hardware. Therefore, the memory controller can directly read the size of the row in the DRAM. For example, if the size of a row in a certain DRAM is 8kB, the memory controller can read and obtain that the size of each weak row is 8kB.

步骤205,根据获取到的行数以及每个弱行的大小,计算DRAM中的弱行所对应的总大小。Step 205: Calculate the total size corresponding to the weak rows in the DRAM according to the acquired number of rows and the size of each weak row.

可选地,内存控制器可以计算获取到的行数和每个弱行的大小的乘积,将该乘积作为DRAM中的各个弱行所对应的总大小。Optionally, the memory controller may calculate the product of the obtained number of rows and the size of each weak row, and use the product as a total size corresponding to each weak row in the DRAM.

步骤206,在DRAM中预留预设大小的存储空间作为预留域,预设大小大于等于计算得到的总大小。Step 206: Reserve a storage space of a preset size in the DRAM as a reserved area, and the preset size is greater than or equal to the calculated total size.

在计算得到总大小之后,内存控制器可以在DRAM中预留一个预设大小的存储空间。该预设大小可以为计算得到的总大小,并且为了保证DRAM的正常运行,该预设大小还可以为该总大小+固定大小,该固定大小为预留的以备后续使用的存储空间的大小。After calculating the total size, the memory controller can reserve a storage space of a preset size in the DRAM. The preset size may be the calculated total size, and in order to ensure the normal operation of the DRAM, the preset size may also be the total size + a fixed size, the fixed size is the size of the storage space reserved for subsequent use .

可选地,内存控制器可以在DRAM的最后预留一个预设大小的存储空间;或者,在DRAM的起始地址预留一个预设大小的存储空间;又或者,在DRAM的预设位置处预留一个预设大小的存储空间,本实施例对此并不做限定。并且,下述除特殊说明外以在最后预留该存储空间为例。Optionally, the memory controller can reserve a storage space of a preset size at the end of the DRAM; or, reserve a storage space of a preset size at the start address of the DRAM; or, at a preset location of the DRAM A storage space of a preset size is reserved, which is not limited in this embodiment. And, unless otherwise specified, the storage space reserved at the end is used as an example below.

需要说明的是,DRAM中除预留域之外的存储区域为正常域。It should be noted that the storage areas in the DRAM other than the reserved domains are normal domains.

步骤207,将预留域的起始地址保存为预设起始地址。Step 207, saving the start address of the reserved domain as a preset start address.

在内存控制器预留预留域之后,内存控制器可以将预留域的起始地址保存为预设起始地址。实际实现时,内存控制器可以在自身的基地址存储器(Base Address Register)中保存该预设起始地址。After the memory controller reserves the reserved domain, the memory controller may save the start address of the reserved domain as a preset start address. In actual implementation, the memory controller may store the preset start address in its own base address register (Base Address Register).

步骤208,根据DRAM中的各个弱行的排序,确定每个弱行在预留域中所对应的地址偏移量。Step 208, according to the sorting of each weak row in the DRAM, determine the address offset corresponding to each weak row in the reserved field.

内存控制器可以根据弱行列表中的各个弱行的地址获取各个弱行的排序。比如,内存控制器获取得到某一DRAM中的弱行分别为第3行、第10行、第12行等等,也即第3行在弱行中的排序为第0位,第10行在弱行中的排序为第1位,以此类推可以得到各个弱行的排序。可选地,内存控制器可以获取正常域中的各个弱行的排序。The memory controller can obtain the order of each weak row according to the address of each weak row in the weak row list. For example, the memory controller acquires that the weak rows in a certain DRAM are the 3rd row, the 10th row, the 12th row, etc. The ranking in the weak row is the first, and the ranking of each weak row can be obtained by analogy. Optionally, the memory controller can obtain the ordering of individual weak rows in the normal domain.

此后,内存控制器根据获取到的排序确定每个弱行的地址偏移量。可选地,对于排名在第i位的弱行,内存控制器可以将i确定为该弱行的地址偏移量。比如,对于上述第3行的弱行,内存控制器可以确定该弱行的地址偏移量为0,而对于第10行的弱行,内存控制器可以确定该弱行的地址偏移量为1。Thereafter, the memory controller determines the address offset of each weak row according to the acquired ordering. Optionally, for the weak row ranked i, the memory controller may determine i as the address offset of the weak row. For example, for the weak line in the third line above, the memory controller can determine that the address offset of the weak line is 0, and for the weak line in the tenth line, the memory controller can determine that the address offset of the weak line is 1.

实际实现时,由于预留域中也可能会包括弱行,因此,为了避免在偏移之后在预留域中对应于弱行,在确定地址偏移量时,对于排名在第i位的弱行,内存控制器可以检测预留域中偏移j之后的行是否为弱行,若是,则将j+1,并再次检测预留域中偏移j之后的行是否为弱行,直至偏移j之后的行不是弱行为止,并将j确定为该弱行的地址偏移量;而若不是,则将j确定为该弱行的地址偏移量。其中,j-1是指排名在第i-1位的弱行所对应的地址偏移量。In actual implementation, since weak lines may also be included in the reserved field, in order to avoid corresponding weak lines in the reserved field after the offset, when determining the address offset, for the weak line ranked i row, the memory controller can detect whether the row after offset j in the reserved field is a weak row, if so, add j+1, and check again whether the row after offset j in the reserved field is a weak row, until offset If the row after shifting j is not a weak row, determine j as the address offset of the weak row; and if not, determine j as the address offset of the weak row. Wherein, j-1 refers to the address offset corresponding to the weak row ranked i-1.

在一个示例性例子中,对于上述第3行的弱行,由于预留域的起始地址处也即预留域的首行不是弱行,因此,内存控制器可以将0确定为该行的地址偏移量;而对于上述第10行的弱行,由于预留域中的第2行是弱行,则内存控制器可以检测预留域中的第3行是否为弱行,并在不是弱行时,将2确定为该行的地址偏移量,以此类推,内存控制器可以确定正常域中的各个弱行所对应的地址偏移量。比如,确定得到的地址偏移量依次为0、2、3、6、7等等。In an illustrative example, for the weak line of the third line above, since the start address of the reserved field, that is, the first line of the reserved field is not a weak line, the memory controller can determine 0 as the line address offset; and for the weak line of the 10th line above, since the 2nd line in the reserved field is a weak line, the memory controller can detect whether the 3rd line in the reserved field is a weak line, and if it is not When a row is weak, 2 is determined as the address offset of the row, and so on, the memory controller can determine the address offset corresponding to each weak row in the normal domain. For example, it is determined that the obtained address offsets are 0, 2, 3, 6, 7 and so on.

比如,请参考图3,其示出了内存控制器确定地址偏移量的一种可能的示意图。For example, please refer to FIG. 3 , which shows a possible schematic diagram of the memory controller determining the address offset.

需要说明的一点是,由于DRAM中的每一行的大小相同且固定,因此上述所说的偏移j之后的行是指预留域中偏移j*n的大小之后所对应的空间。其中,n为DRAM中的每一行的大小。It should be noted that since the size of each row in the DRAM is the same and fixed, the above-mentioned row after the offset j refers to the corresponding space after the offset j*n in the reserved area. Wherein, n is the size of each row in the DRAM.

需要说明的另一点是,上述仅以地址偏移量通过偏移的行数表示来举例说明,实际实现时,该地址偏移量还可以通过偏移的地址表示,也即该地址偏移量为偏移后的地址与偏移前的地址的差值。Another point that needs to be explained is that the above is only an example of the address offset represented by the number of offset lines. In actual implementation, the address offset can also be expressed by the offset address, that is, the address offset It is the difference between the address after offset and the address before offset.

步骤209,保存包括各个地址偏移量的偏移量表。Step 209, saving an offset table including each address offset.

可选地,内存控制器可以在自身通过硬件保存该偏移量表。比如,请参考图4,其示出了内存控制器保存的一种可能的偏移量表。Optionally, the memory controller can save the offset table itself through hardware. For example, please refer to FIG. 4, which shows a possible offset table kept by the memory controller.

步骤210,接收内存访问请求;内存访问请求用于请求访问动态随机访问存储器DRAM中的目标行。Step 210, receiving a memory access request; the memory access request is used to request access to a target row in the DRAM.

在CPU需要访问DRAM时,CPU可以发送内存访问请求至内存控制器,内存控制器可以相应的接收到该内存访问请求。其中,该内存访问请求可以为读请求或者写请求,并且,实际实现时该内存访问请求中携带有请求访问的目标行的目标地址。When the CPU needs to access the DRAM, the CPU can send a memory access request to the memory controller, and the memory controller can correspondingly receive the memory access request. Wherein, the memory access request may be a read request or a write request, and in actual implementation, the memory access request carries the target address of the target row requested to be accessed.

比如,在CPU需要写入内容至DRAM中的0xfff0处时,CPU可以发送携带有0xfff0的写请求至内存控制器。For example, when the CPU needs to write content to 0xfff0 in the DRAM, the CPU can send a write request carrying 0xfff0 to the memory controller.

可选地,内存控制器接收到内存访问请求之后,将该内存访问请求放入输入队列(Input Queue)中。Optionally, after receiving the memory access request, the memory controller puts the memory access request into an input queue (Input Queue).

步骤211,检测目标行是否为弱行列表中的行。Step 211, detecting whether the target row is a row in the weak row list.

内存控制器可以检测弱行列表中是否包括内存访问请求中的目标地址,若包括,则确定请求访问的目标行是弱行,反之,则确定请求访问的目标行不是弱行。The memory controller can detect whether the target address in the memory access request is included in the weak line list, and if so, determine that the target line requested to be accessed is a weak line, otherwise, determine that the target line requested to access is not a weak line.

步骤212,若是,则确定目标行是弱行。Step 212, if yes, determine that the target row is a weak row.

而若检测结果为目标行不是弱行,则此时,内存控制器可以通过相关技术提供的访问方法访问DRAM,在此不再赘述。And if the detection result shows that the target row is not a weak row, then at this time, the memory controller can access the DRAM through the access method provided by the related technology, which will not be repeated here.

步骤213,在目标行是弱行时,根据偏移量表和预设起始地址确定目标行在DRAM中的预留域中所对应的映射地址。Step 213, when the target row is a weak row, determine the corresponding mapping address of the target row in the reserved area in the DRAM according to the offset table and the preset start address.

如果内存控制器检测到请求访问的目标行是弱行,则说明存储在该行中的数据可能会丢失,此时为了保证数据安全,内存控制器可以在偏移量表查询目标行所对应的地址偏移量,并将预留域中从预设起始地址处偏移查询到的地址偏移量之后的地址确定为该目标行在预留域中所对应的映射地址。If the memory controller detects that the target row requested to be accessed is a weak row, it means that the data stored in the row may be lost. At this time, in order to ensure data security, the memory controller can query the offset table corresponding to the address offset, and determine the address in the reserved field after the address offset obtained by offsetting the query from the preset start address as the corresponding mapping address of the target row in the reserved field.

比如,预设起始地址为0xfff0,则在查询到的地址偏移量为0时,确定的映射地址即为0xfff0;而在查询到的地址偏移量为1时,确定的映射地址即为从0xfff0处偏移一行之后的地址。For example, if the default starting address is 0xfff0, then when the queried address offset is 0, the determined mapping address is 0xfff0; and when the queried address offset is 1, the determined mapping address is The address after offsetting one line from 0xfff0.

可选地,在确定映射地址之后,内存控制器可以将内存访问请求转换为一系列的DRAM命令,并将该DRAM命令放入至队列池(Queue Pool)中。Optionally, after determining the mapping address, the memory controller may convert the memory access request into a series of DRAM commands, and put the DRAM commands into a queue pool (Queue Pool).

步骤214,根据映射地址访问预留域。Step 214, access the reserved domain according to the mapped address.

内存控制器可以直接访问预留域中该映射地址所对应的位置处。比如,在内存访问请求为写请求时,写入内容至该映射地址所对应的存储空间中;又比如,在内存访问请求为读请求时,读取映射地址所对应的存储空间中的内容。The memory controller can directly access the location corresponding to the mapped address in the reserved domain. For example, when the memory access request is a write request, the content is written into the storage space corresponding to the mapping address; for another example, when the memory access request is a read request, the content in the storage space corresponding to the mapping address is read.

实际实现时,内存控制器可以根据预设调度策略在队列池中选择需要执行的命令,然后利用信号接口将所选择的命令发送至DRAM,DRAM接收到命令之后对映射地址所对应的存储空间中执行对应的操作。In actual implementation, the memory controller can select the command to be executed in the queue pool according to the preset scheduling strategy, and then use the signal interface to send the selected command to the DRAM. Perform the corresponding operation.

步骤215,接收DRAM返回的携带有第一地址的访问结果。第一地址为在DRAM中访问的地址。Step 215, receiving the access result carrying the first address returned by the DRAM. The first address is an address accessed in the DRAM.

内存控制器在根据映射地址访问DRAM中的预留域之后,DRAM可以返回访问结果至内存控制器。其中,DRAM返回的访问结果的地址为在DRAM中实际访问的地址。也即,假设内存控制器根据映射地址访问DRAM时,该访问结果中携带有该映射地址。After the memory controller accesses the reserved domain in the DRAM according to the mapped address, the DRAM can return the access result to the memory controller. Wherein, the address of the access result returned by the DRAM is an address actually accessed in the DRAM. That is, it is assumed that when the memory controller accesses the DRAM according to the mapped address, the mapped address is carried in the access result.

实际实现时,访问结果中还可以包括其他内容,比如,在内存访问请求为读请求时,该访问结果中还可以包括读取到的内容;而在内存访问请求为写请求时,该访问结果中还可以包括写入结果如携带有写入成功信息或者携带有写入失败信息。In actual implementation, the access result may also include other content, for example, when the memory access request is a read request, the access result may also include the read content; and when the memory access request is a write request, the access result may also include a writing result such as carrying successful writing information or carrying failed writing information.

步骤216,计算第一地址与预设起始地址的差值。Step 216, calculating the difference between the first address and the preset start address.

内存控制器接收到访问结果之后,可以计算访问结果中的第一地址与预设起始地址的差值。After receiving the access result, the memory controller may calculate the difference between the first address in the access result and the preset start address.

步骤217,若差值大于0,则根据偏移量表、预设起始地址计算第一地址所对应的第二地址。Step 217, if the difference is greater than 0, calculate the second address corresponding to the first address according to the offset table and the preset start address.

如果该差值大于0,则说明该访问结果访问的是DRAM中的预留域中的内容,也即内存访问请求请求访问的行为DRAM中的弱行,因此,为了恢复该访问结果所对应的原始地址,进而使得CPU可以识别该访问结果,内存控制器可以根据偏移量表、预设起始地址计算第一地址所对应的第二地址。If the difference is greater than 0, it means that the access result accesses the content in the reserved field in the DRAM, that is, the behavior requested by the memory access request is a weak row in the DRAM. Therefore, in order to restore the corresponding The original address, so that the CPU can identify the access result, and the memory controller can calculate the second address corresponding to the first address according to the offset table and the preset start address.

可选地,内存控制器可以在偏移量表中查询计算得到的差值所对应的弱行的地址,将查询得到的弱行的地址作为该第二地址。比如,第一地址和预设起始地址的差值为2行的内容,则可以确定其地址偏移量为2,此时,内存控制器可以在图4所述的偏移量表中查询地址偏移量为2的弱行的地址。Optionally, the memory controller may query the address of the weak row corresponding to the calculated difference in the offset table, and use the address of the weak row obtained through query as the second address. For example, if the difference between the first address and the preset start address is 2 lines, then it can be determined that the address offset is 2. At this time, the memory controller can query in the offset table described in FIG. 4 The address of the weak row at address offset 2.

需要说明的是,若差值小于0,则说明内存访问请求访问的是DRAM中正常域,也即其访问的是正常行的内容,此时,内存控制器可以直接返回访问结果至CPU。It should be noted that if the difference is less than 0, it means that the memory access request accesses the normal domain in the DRAM, that is, the content of the normal row is accessed. At this time, the memory controller can directly return the access result to the CPU.

步骤218,返回携带有第二地址的访问结果。Step 218, return the access result carrying the second address.

可选地,内存控制器在确定第二地址之后,可以将更新地址后的访问结果添加至返回事务队列(Return Transaction Queue)中,进而按照预设调度规则返回该返回事务队列中的内容至CPU。Optionally, after the memory controller determines the second address, the access result after the updated address can be added to the return transaction queue (Return Transaction Queue), and then return the content in the return transaction queue to the CPU according to the preset scheduling rule .

请参考图5,其示出了本实施例提供的内存访问方法的示意图。Please refer to FIG. 5 , which shows a schematic diagram of a memory access method provided by this embodiment.

在一个示例性实施例中,DRAM的总容量为32GB,包含2个通道,每个通道有4个存储区块(rank),每个rank有8个存储阵列bank,每个bank有64000行。每行的大小为8KB。其中维持时间小于128ms的行有28行,维持时间介于128ms到256ms的有978行,所有剩余行的维持时间都超过256ms。本发明将维持时间介于小于256ms的1006行都当作弱行,并将32GB存储空间分为正常域和预留域两部分,其中预留域的大小为8KB*(28+978)=7.86MB,不及总容量的0.024%,但是在上述方案中,内存控制器在刷新DRAM中的各个单元中存储的数据时,内存控制器可以以256ms的刷新周期进行刷新,也即本实施例提供的方案以总容量的0.024%的存储空间来换取4倍的刷新周期。In an exemplary embodiment, the total capacity of the DRAM is 32GB, and includes 2 channels, each channel has 4 memory blocks (rank), each rank has 8 memory array banks, and each bank has 64000 rows. Each row is 8KB in size. Among them, there are 28 rows whose duration is less than 128ms, 978 rows whose duration is between 128ms and 256ms, and the duration of all remaining rows exceeds 256ms. The present invention regards the 1006 lines whose maintenance time is less than 256ms as weak lines, and divides the 32GB storage space into two parts, the normal domain and the reserved domain, wherein the size of the reserved domain is 8KB*(28+978)=7.86 MB, less than 0.024% of the total capacity, but in the above-mentioned scheme, when the memory controller refreshes the data stored in each unit in the DRAM, the memory controller can refresh with a refresh cycle of 256ms, which is what this embodiment provides The solution uses 0.024% of the total storage space in exchange for 4 times the refresh cycle.

需要说明的一点是,步骤210至步骤218可以在步骤209之后执行一次,也可以执行多次,本实施例对此并不做限定。It should be noted that steps 210 to 218 may be performed once or multiple times after step 209, which is not limited in this embodiment.

需要说明的另一点是,上述各个实施例均以通过内存控制器实现上述方法为例,实际实现时,还可以通过新增的控制器来实现,该控制器可以位于CPU与内存控制器之间,或者位于内存控制器和DRAM之间,对此并不做限定。Another point that needs to be explained is that each of the above-mentioned embodiments uses a memory controller as an example to implement the above method. In actual implementation, it can also be implemented through a newly added controller, which can be located between the CPU and the memory controller. , or between the memory controller and the DRAM, which is not limited.

综上所述,本实施例提供的内存访问方法,在请求访问的目标行是弱行时,通过根据预先保存的偏移量表以及预设起始地址计算该目标行在DRAM的预留域中所对应的映射地址,进而根据映射地址来访问DRAM中的预留域,返回访问结果;其中,由于偏移量表中的各个地址偏移量在预留域中所指向的行均不是弱行,因此,上述方案在请求访问弱行时通过转换其访问地址使得可以访问DRAM中的正常行,这样后续在刷新DRAM时均可以按照正常的刷新周期进行刷新,解决了相关技术中总线中的刷新命令较多,可能会导致总线拥塞,降低系统的性能的问题;达到了可以避免总线拥塞,提高性能的效果。To sum up, the memory access method provided by this embodiment, when the target row requested to be accessed is a weak row, calculates the reserved area of the target row in the DRAM according to the pre-saved offset table and the preset start address The corresponding mapping address in the DRAM, and then access the reserved domain in the DRAM according to the mapping address, and return the access result; wherein, because each address offset in the offset table points to a row in the reserved domain is not weak Therefore, the above scheme can access the normal row in the DRAM by converting its access address when requesting to access the weak row, so that the follow-up DRAM can be refreshed according to the normal refresh cycle when refreshing the DRAM, which solves the problems in the bus in the related art. There are many refresh commands, which may cause bus congestion and reduce the performance of the system; the effect of avoiding bus congestion and improving performance is achieved.

请参考图6,其示出了本发明一个实施例提供的内存访问装置的结构示意图,如图6所示,该内存访问装置可以包括:接收单元610、确定单元620、访问单元630和返回单元640。Please refer to FIG. 6, which shows a schematic structural diagram of a memory access device provided by an embodiment of the present invention. As shown in FIG. 6, the memory access device may include: a receiving unit 610, a determining unit 620, an accessing unit 630 and a returning unit 640.

接收单元610,用于接收内存访问请求;所述内存访问请求用于请求访问动态随机访问存储器DRAM中的目标行;The receiving unit 610 is configured to receive a memory access request; the memory access request is used to request access to a target row in a dynamic random access memory DRAM;

确定单元620,用于在所述目标行是弱行时,根据偏移量表和预设起始地址确定所述目标行在所述DRAM中的预留域中所对应的映射地址;所述偏移量表中包括所述DRAM中的弱行在所述预留域中所对应的地址偏移量,所述预设起始地址为所述预留域的起始地址;所述地址偏移量在所述预留域中所指向的行不是弱行;A determining unit 620, configured to determine a corresponding mapping address of the target row in a reserved domain in the DRAM according to an offset table and a preset start address when the target row is a weak row; The offset table includes the address offset corresponding to the weak line in the DRAM in the reserved area, and the preset start address is the start address of the reserved area; the address offset the row pointed to by the offset in the reserved field is not a weak row;

访问单元630,用于根据所述映射地址访问所述预留域;An access unit 630, configured to access the reserved domain according to the mapped address;

返回单元640,用于返回访问结果。A return unit 640, configured to return an access result.

综上所述,本实施例提供的内存访问装置,在请求访问的目标行是弱行时,通过根据预先保存的偏移量表以及预设起始地址计算该目标行在DRAM的预留域中所对应的映射地址,进而根据映射地址来访问DRAM中的预留域,返回访问结果;其中,由于偏移量表中的各个地址偏移量在预留域中所指向的行均不是弱行,因此,上述方案在请求访问弱行时通过转换其访问地址使得可以访问DRAM中的正常行,这样后续在刷新DRAM时均可以按照正常的刷新周期进行刷新,解决了相关技术中总线中的刷新命令较多,可能会导致总线拥塞,降低系统的性能的问题;达到了可以避免总线拥塞,提高性能的效果。To sum up, the memory access device provided by this embodiment, when the target row requested to be accessed is a weak row, calculates the reserved area of the target row in the DRAM according to the pre-saved offset table and the preset start address. The corresponding mapping address in the DRAM, and then access the reserved domain in the DRAM according to the mapping address, and return the access result; wherein, because each address offset in the offset table is not weak in the row pointed to in the reserved domain Therefore, the above scheme can access the normal row in the DRAM by converting its access address when requesting to access the weak row, so that the follow-up DRAM can be refreshed according to the normal refresh cycle when refreshing the DRAM, which solves the problems in the bus in the related art. There are many refresh commands, which may cause bus congestion and reduce the performance of the system; the effect of avoiding bus congestion and improving performance is achieved.

基于上述实施例提供的内存访问装置,可选地,所述返回单元640,还用于:Based on the memory access device provided in the foregoing embodiments, optionally, the returning unit 640 is also configured to:

接收所述DRAM返回的携带有第一地址的返回结果,所述第一地址为在所述DRAM中访问的地址;receiving a return result that carries a first address returned by the DRAM, where the first address is an address accessed in the DRAM;

计算所述第一地址与所述预设起始地址的差值;calculating a difference between the first address and the preset start address;

若所述差值大于0,则根据所述偏移量表、所述预设起始地址计算所述第一地址所对应的第二地址;If the difference is greater than 0, calculate a second address corresponding to the first address according to the offset table and the preset start address;

返回携带有所述第二地址的所述访问结果。Returning the access result carrying the second address.

可选地,所述装置还包括:Optionally, the device also includes:

第一检测单元,用于检测所述目标行是否为弱行列表中的行,所述弱行列表中包括所述DRAM中的各个弱行;a first detection unit, configured to detect whether the target row is a row in a weak row list, and the weak row list includes each weak row in the DRAM;

所述确定单元620,还用于在所述第一检测单元的检测结果为目标行是弱行列表中的行时,确定所述目标行是弱行。The determining unit 620 is further configured to determine that the target row is a weak row when the detection result of the first detection unit is that the target row is a row in the weak row list.

可选地,所述装置还包括:Optionally, the device also includes:

第二检测单元,用于对于所述DRAM中的每一行,检测所述行中是否包括维持时间小于预设时长的单元;The second detection unit is configured to, for each row in the DRAM, detect whether the row includes a unit whose maintenance time is shorter than a preset duration;

所述确定单元620,还用于在所述第二检测单元的检测结果为所述行中包括维持时间小于所述预设时长的单元时,将所述行确定为弱行;The determination unit 620 is further configured to determine the row as a weak row when the detection result of the second detection unit is that the row includes units whose maintenance time is less than the preset duration;

第一保存单元,用于根据确定结果生成并保存所述弱行列表。The first saving unit is configured to generate and save the weak row list according to the determination result.

可选地,所述装置还包括:Optionally, the device also includes:

获取单元,用于在所述确定单元根据偏移量表和预设起始地址确定所述目标行在所述DRAM中的预留域中所对应的映射地址之前,获取所述DRAM中的弱行的行数以及每个弱行的大小;An acquiring unit, configured to acquire the weak address in the DRAM before the determining unit determines the corresponding mapping address of the target row in the reserved domain in the DRAM according to the offset table and the preset start address the number of rows and the size of each weak row;

计算单元,用于根据获取到的行数以及每个弱行的大小,计算所述DRAM中的各个弱行所对应的总大小;A calculation unit, configured to calculate the total size corresponding to each weak row in the DRAM according to the obtained number of rows and the size of each weak row;

预留单元,用于在所述DRAM中预留预设大小的存储空间作为所述预留域,所述预设大小大于等于计算得到的所述总大小;A reservation unit, configured to reserve a storage space of a preset size in the DRAM as the reserved domain, where the preset size is greater than or equal to the calculated total size;

第二保存单元,用于将所述预留域的起始地址保存为所述预设起始地址。The second saving unit is configured to save the start address of the reserved domain as the preset start address.

可选地,所述装置还包括:Optionally, the device also includes:

所述确定单元620,还用于在根据偏移量表和预设起始地址确定所述目标行在所述DRAM中的预留域中所对应的映射地址之前,根据所述DRAM中的各个弱行的排序,确定每个弱行在所述预留域中所对应的地址偏移量;The determining unit 620 is further configured to determine the corresponding mapping address of the target row in the reserved area in the DRAM according to the offset table and the preset start address, according to each of the DRAM Sorting the weak rows, determining the address offset corresponding to each weak row in the reserved field;

第三保存单元,用于保存包括各个地址偏移量的所述偏移量表。The third storage unit is configured to store the offset table including each address offset.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution.

本领域普通技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those of ordinary skill in the art can clearly understand that for the convenience and brevity of description, the specific working process of the devices and units described above can refer to the corresponding process in the foregoing method embodiments, and details are not repeated here.

在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,可以仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。In the embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units may only be a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined Or it can be integrated into another system, or some features can be ignored, or not implemented.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。The above is only a specific implementation of the application, but the scope of protection of the application is not limited thereto. Anyone familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the application. Should be covered within the protection scope of this application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims (12)

1. a kind of memory pool access method, which is characterized in that the described method includes:
Receive memory access request;The memory access request is used to request access to the mesh in dynamic RAM DRAM Mark row;
When the target line is weak row, determine the target line in the DRAM according to offset-lists and default initial address Reserved domain in corresponding mapping address;It include the institute in the reserved domain of the weak row in the DRAM in the offset-lists Corresponding address offset amount, the default initial address are the initial address in the reserved domain;The address offset amount is described In reserved domain it is pointed it is capable be not weak row;
The reserved domain is accessed according to the mapping address;
Backward reference result.
2. the method according to claim 1, wherein the backward reference result, comprising:
Receive the DRAM return carries returning the result for the first address, and first address is to be accessed in the DRAM Address;
Calculate the difference of first address Yu the default initial address;
If the difference is greater than 0, calculated corresponding to first address according to the offset-lists, the default initial address The second address;
Return carries the two address access result.
3. the method according to claim 1, wherein the method also includes:
Detect whether the target line is row in weak row-column list, includes each weak in the DRAM in the weak row-column list Row;
If so, determining that the target line is weak row.
4. according to the method described in claim 3, it is characterized in that, the method also includes:
Whether for every a line in the DRAM, detecting in the row includes the unit held time less than preset duration;
If the row is determined as weak row including the unit held time less than the preset duration;
It is generated according to definitive result and saves the weak row-column list.
5. method according to any one of claims 1 to 4, which is characterized in that described according to offset-lists and default starting point Before location determines target line mapping address corresponding in the reserved domain in the DRAM, the method also includes:
Obtain the line number of the weak row in the DRAM and the size of each weak row;
According to the size of the line number and each weak row that get, calculate total big corresponding to each weak row in the DRAM It is small;
The memory space of default size is reserved in the DRAM as the reserved domain, the default size, which is more than or equal to, to be calculated The obtained total size;
The initial address in the reserved domain is saved as into the default initial address.
6. method according to any one of claims 1 to 4, which is characterized in that described according to offset-lists and default starting point Before location determines target line mapping address corresponding in the reserved domain in the DRAM, the method also includes:
According to the sequence of each weak row in the DRAM, each weak row address offset corresponding in the reserved domain is determined Amount;
Save the offset-lists including each address offset amount.
7. a kind of internal storage access device, which is characterized in that described device includes:
Receiving unit, for receiving memory access request;The memory access request is deposited for requesting access to dynamic random-access Target line in reservoir DRAM;
Determination unit, for determining the target according to offset-lists and default initial address when the target line is weak row Row mapping address corresponding in the reserved domain in the DRAM;Exist in the offset-lists including the weak row in the DRAM Corresponding address offset amount in the reserved domain, the default initial address are the initial address in the reserved domain;Describedly Location offset in the reserved domain it is pointed it is capable be not weak row;
Access unit, for accessing the reserved domain according to the mapping address;
Return unit is used for backward reference result.
8. device according to claim 7, which is characterized in that the return unit is also used to:
Receive the DRAM return carries returning the result for the first address, and first address is to be accessed in the DRAM Address;
Calculate the difference of first address Yu the default initial address;
If the difference is greater than 0, calculated corresponding to first address according to the offset-lists, the default initial address The second address;
Return carries the two address access result.
9. device according to claim 7, which is characterized in that described device further include:
First detection unit includes institute in the weak row-column list for detecting whether the target line is row in weak row-column list State each weak row in DRAM;
The determination unit is also used to be target line in the testing result of the first detection unit to be row in weak row-column list When, determine that the target line is weak row.
10. device according to claim 9, which is characterized in that described device further include:
Whether second detection unit includes holding time to be less than for for every a line in the DRAM, detecting in the row The unit of preset duration;
The determination unit is also used to be in the row in the testing result of the second detection unit to include holding time to be less than When the unit of the preset duration, the row is determined as weak row;
First storage unit, for the weak row-column list to be generated and saved according to definitive result.
11. according to any device of claim 7 to 10, which is characterized in that described device further include:
Acquiring unit, for determining the target line described according to offset-lists and default initial address in the determination unit In reserved domain in DRAM before corresponding mapping address, obtain the weak row in the DRAM line number and each weak row Size;
Computing unit calculates each weak row in the DRAM for the size according to the line number and each weak row got Corresponding total size;
Prearranged elements, the memory space for default size reserved in the DRAM are described default big as the reserved domain It is small more than or equal to the total size being calculated;
Second storage unit, for the initial address in the reserved domain to be saved as the default initial address.
12. according to any device of claim 7 to 10, which is characterized in that described device further include:
The determination unit is also used to determining the target line in the DRAM according to offset-lists and default initial address Reserved domain in front of corresponding mapping address, according to the sequence of each weak row in the DRAM, determine that each weak row exists Corresponding address offset amount in the reserved domain;
Third storage unit, for saving the offset-lists including each address offset amount.
CN201710353012.6A 2017-05-18 2017-05-18 Memory access method and apparatus Active CN108959106B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710353012.6A CN108959106B (en) 2017-05-18 2017-05-18 Memory access method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710353012.6A CN108959106B (en) 2017-05-18 2017-05-18 Memory access method and apparatus

Publications (2)

Publication Number Publication Date
CN108959106A true CN108959106A (en) 2018-12-07
CN108959106B CN108959106B (en) 2020-12-18

Family

ID=64461931

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710353012.6A Active CN108959106B (en) 2017-05-18 2017-05-18 Memory access method and apparatus

Country Status (1)

Country Link
CN (1) CN108959106B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022012143A1 (en) * 2020-07-17 2022-01-20 华为技术有限公司 Memory management technology and computer system

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1801395A (en) * 2004-11-13 2006-07-12 因芬尼昂技术股份公司 Method for repairing and running storage devices
CN1869721A (en) * 2005-05-27 2006-11-29 尔必达存储器株式会社 Chip information managing method, chip information managing system, and chip information managing program
CN1879173A (en) * 2003-11-07 2006-12-13 英飞凌科技股份公司 Refresh for dynamic cells with weak retention
CN102800353A (en) * 2011-05-25 2012-11-28 三星电子株式会社 Method of refreshing a memory device, refresh address generator and memory device
US20130262740A1 (en) * 2012-03-30 2013-10-03 Samsung Electronics Co., Ltd. Semiconductor memory device, systems and methods improving refresh quality for weak cell
CN103377158A (en) * 2012-04-24 2013-10-30 三星电子株式会社 Volatile memory device, operation method thereof and method for controlling memory system
US20140269123A1 (en) * 2013-03-15 2014-09-18 Samsung Electronics Co., Ltd. Semiconductor memory device and refresh method thereof
US20150043295A1 (en) * 2013-08-06 2015-02-12 Samsung Electronics Co., Ltd. Method of refreshing volatile memory device
US9099165B1 (en) * 2012-05-02 2015-08-04 Inphi Corporation Single chip mixed memory for dynamic replacement of DRAM bad cell
CN105340016A (en) * 2013-06-24 2016-02-17 高通股份有限公司 Refresh scheme for memory cells with weak retention time
KR20170053373A (en) * 2015-11-06 2017-05-16 삼성전자주식회사 Memory Device and Memory System Performing Request-based Refresh and Operating Method of Memory Device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1879173A (en) * 2003-11-07 2006-12-13 英飞凌科技股份公司 Refresh for dynamic cells with weak retention
CN1801395A (en) * 2004-11-13 2006-07-12 因芬尼昂技术股份公司 Method for repairing and running storage devices
CN1869721A (en) * 2005-05-27 2006-11-29 尔必达存储器株式会社 Chip information managing method, chip information managing system, and chip information managing program
CN102800353A (en) * 2011-05-25 2012-11-28 三星电子株式会社 Method of refreshing a memory device, refresh address generator and memory device
US20130262740A1 (en) * 2012-03-30 2013-10-03 Samsung Electronics Co., Ltd. Semiconductor memory device, systems and methods improving refresh quality for weak cell
CN103377158A (en) * 2012-04-24 2013-10-30 三星电子株式会社 Volatile memory device, operation method thereof and method for controlling memory system
US9099165B1 (en) * 2012-05-02 2015-08-04 Inphi Corporation Single chip mixed memory for dynamic replacement of DRAM bad cell
US20140269123A1 (en) * 2013-03-15 2014-09-18 Samsung Electronics Co., Ltd. Semiconductor memory device and refresh method thereof
CN105340016A (en) * 2013-06-24 2016-02-17 高通股份有限公司 Refresh scheme for memory cells with weak retention time
US20150043295A1 (en) * 2013-08-06 2015-02-12 Samsung Electronics Co., Ltd. Method of refreshing volatile memory device
KR20170053373A (en) * 2015-11-06 2017-05-16 삼성전자주식회사 Memory Device and Memory System Performing Request-based Refresh and Operating Method of Memory Device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022012143A1 (en) * 2020-07-17 2022-01-20 华为技术有限公司 Memory management technology and computer system

Also Published As

Publication number Publication date
CN108959106B (en) 2020-12-18

Similar Documents

Publication Publication Date Title
US9129672B2 (en) Semiconductor device and operating method thereof
CN105280215B (en) Dynamic random access memory DRAM method for refreshing, equipment and system
JP6408712B2 (en) Memory access method, storage class memory, and computer system
CN101038783B (en) Semiconductor memory, memory system, and method of operating the memory system
US11392488B2 (en) Optimizing storage of application data in memory
US9563565B2 (en) Apparatuses and methods for providing data from a buffer
US10535393B1 (en) Configuring dynamic random access memory refreshes for systems having multiple ranks of memory
KR102701812B1 (en) Non-volatile memory system using volatile memory as cache
CN104981789A (en) Apparatuses and methods for variable latency memory operations
CN106856098B (en) A device and method for refreshing DRAM or eDRAM
US20230128653A1 (en) Memory device and method for controlling row hammer
WO2018090255A1 (en) Memory access technique
US11216386B2 (en) Techniques for setting a 2-level auto-close timer to access a memory device
CN106782633B (en) dynamic random access memory, method for storing data and reading and refreshing
US20180260127A1 (en) Management device, information processing apparatus, and management method
US20160034392A1 (en) Shared memory system
CN108959106B (en) Memory access method and apparatus
US11755235B2 (en) Increasing random access bandwidth of a DDR memory in a counter application
US20200143275A1 (en) Information processing device, information processing method, and computer program product
KR20170114991A (en) Method for logging using non-volatile memory

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant