[go: up one dir, main page]

CN114296896A - Method, device, computer storage medium and terminal for realizing command scheduling - Google Patents

Method, device, computer storage medium and terminal for realizing command scheduling Download PDF

Info

Publication number
CN114296896A
CN114296896A CN202111613708.0A CN202111613708A CN114296896A CN 114296896 A CN114296896 A CN 114296896A CN 202111613708 A CN202111613708 A CN 202111613708A CN 114296896 A CN114296896 A CN 114296896A
Authority
CN
China
Prior art keywords
command
commands
read
queue
consistency
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
CN202111613708.0A
Other languages
Chinese (zh)
Other versions
CN114296896B (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.)
Hefei Datang Storage Technology Co ltd
Original Assignee
Hefei Datang Storage Technology Co ltd
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 Hefei Datang Storage Technology Co ltd filed Critical Hefei Datang Storage Technology Co ltd
Priority to CN202111613708.0A priority Critical patent/CN114296896B/en
Publication of CN114296896A publication Critical patent/CN114296896A/en
Application granted granted Critical
Publication of CN114296896B publication Critical patent/CN114296896B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

Disclosed herein are a method, an apparatus, a computer storage medium and a terminal for implementing command scheduling, including: determining whether a first position for inserting a first command exists in a command queue when a Dynamic Random Access Memory (DRAM) receives the first command; when a first location exists, determining whether the first location passes a consistency conflict check; inserting a first command into a first location that passes a consistency conflict check; wherein the first command comprises: a read command or a write command. The embodiment of the invention carries out insertion processing after the consistency conflict check on the newly received first command under the condition of not carrying out read-write grouping on the command queue, thereby improving the read-write performance of a System On Chip (SOC).

Description

一种实现命令调度的方法、装置、计算机存储介质及终端A method, device, computer storage medium and terminal for realizing command scheduling

技术领域technical field

本文涉及但不限于片上系统技术,尤指一种实现命令调度的方法、装置、计算机存储介质及终端。This article relates to, but is not limited to, SoC technology, especially a method, device, computer storage medium, and terminal for implementing command scheduling.

背景技术Background technique

随着片上系统(SOC)的规模越来越大,SOC内部集成的中央处理器(CPU)、数据处理器(DPU)等模块也越来越多;系统对各个模块的DRAM缓存执行的效率,将直接影响到SOC的整体性能。With the increasing scale of the system on chip (SOC), more and more modules such as central processing unit (CPU) and data processing unit (DPU) are integrated in the SOC; the efficiency of the system to execute the DRAM cache of each module, It will directly affect the overall performance of the SOC.

动态随机存取存储器(DRAM)控制器是解析和处理SOC总线命令的基础构件,主要根据读写分类或队列重排技术进行读写命令的调度;其中,相关技术中的读写分类,固定规则及强耦合逻辑的队列调度策略;使得当前调度策略的复杂度越来越高,存在灵活性低、逻辑紧耦合和兼容性差等问题;成为当前DRAM控制器设计的一大难题。The dynamic random access memory (DRAM) controller is the basic component for parsing and processing SOC bus commands. It mainly schedules read and write commands according to the read and write classification or queue rearrangement technology; among them, the read and write classification in the related art, fixed rules And the queue scheduling strategy of strongly coupled logic; the complexity of the current scheduling strategy is getting higher and higher, and there are problems such as low flexibility, tight logic coupling and poor compatibility; it has become a major problem in the design of current DRAM controllers.

发明内容SUMMARY OF THE INVENTION

以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this article. This summary is not intended to limit the scope of protection of the claims.

本发明实施例提供一种实现命令调度的方法、装置、计算机存储介质及终端,能够提升片上系统的数据读写性能。Embodiments of the present invention provide a method, a device, a computer storage medium and a terminal for implementing command scheduling, which can improve the data read and write performance of the system on chip.

本发明实施例提供了一种实现命令调度的方法,包括:An embodiment of the present invention provides a method for implementing command scheduling, including:

动态随机存取存储器DRAM接收到新的第一命令时,确定命令队列中是否动态随机存取存储器DRAM接收到第一命令时,确定命令队列中是否存在用于插入第一命令的第一位置;When the dynamic random access memory DRAM receives a new first command, determine whether the dynamic random access memory DRAM receives the first command in the command queue, and determine whether there is a first position in the command queue for inserting the first command;

存在第一位置时,确定第一位置是否通过一致性冲突检查;When the first position exists, determine whether the first position passes the consistency conflict check;

将第一命令插入通过一致性冲突检查的第一位置;inserting the first command into the first position that passes the consistency conflict check;

其中,所述第一命令包括:读命令或写命令。Wherein, the first command includes: a read command or a write command.

另一方面,本发明实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机程序,所述计算机程序被处理器执行时实现上述实现命令调度的方法。On the other hand, an embodiment of the present invention further provides a computer storage medium, where a computer program is stored in the computer storage medium, and when the computer program is executed by a processor, the above method for implementing command scheduling is implemented.

再一方面,本发明实施例还提供一种终端,包括:存储器和处理器,所述存储器中保存有计算机程序;其中,In another aspect, an embodiment of the present invention further provides a terminal, including: a memory and a processor, where a computer program is stored in the memory; wherein,

处理器被配置为执行存储器中的计算机程序;the processor is configured to execute the computer program in the memory;

所述计算机程序被所述处理器执行时实现如上述实现命令调度的方法。The computer program, when executed by the processor, implements the method for implementing command scheduling as described above.

还一方面,本发明实施例还提供一种实现命令调度的装置,包括:确定位置单元、冲突检查单元和插入处理单元;其中,In another aspect, an embodiment of the present invention further provides an apparatus for implementing command scheduling, including: a location determination unit, a conflict checking unit, and an insertion processing unit; wherein,

确定位置单元设置为:接收到第一命令时,确定命令队列中是否存在用于插入第一命令的第一位置;The determining position unit is set to: when the first command is received, determine whether there is a first position for inserting the first command in the command queue;

冲突检查单元设置为:存在第一位置时,确定第一位置是否通过一致性冲突检查;The conflict checking unit is set to: when the first position exists, determine whether the first position passes the consistency conflict check;

插入处理单元设置为:将第一命令插入通过一致性冲突检查的第一位置;The insertion processing unit is set to: insert the first command into the first position that has passed the consistency conflict check;

其中,所述第一命令包括:读命令或写命令。Wherein, the first command includes: a read command or a write command.

本申请技术方案包括:动态随机存取存储器(DRAM)接收到第一命令时,确定命令队列中是否存在用于插入第一命令的第一位置;存在第一位置时,确定第一位置是否通过一致性冲突检查;将第一命令插入通过一致性冲突检查的第一位置;其中,第一命令包括:读命令或写命令。本发明实施例不对命令队列进行读写分组的情况下,对新接收的第一命令执行一致性冲突检查后进行插入处理,提升了片上系统(SOC)的读写性能。The technical solution of the present application includes: when the dynamic random access memory (DRAM) receives the first command, determining whether there is a first position for inserting the first command in the command queue; when the first position exists, determining whether the first position passes the Consistency conflict check; insert the first command into the first position that passes the consistency conflict check; wherein the first command includes: a read command or a write command. When the embodiment of the present invention does not perform read and write grouping on the command queue, the newly received first command is checked for consistency conflict and then inserted, thereby improving the read and write performance of the system on chip (SOC).

本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。Other features and advantages of the present invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the description, claims and drawings.

附图说明Description of drawings

附图用来提供对本发明技术方案的进一步理解,并且构成说明书的一部分,与本申请的实施例一起用于解释本发明的技术方案,并不构成对本发明技术方案的限制。The accompanying drawings are used to provide a further understanding of the technical solutions of the present invention, and constitute a part of the specification. They are used to explain the technical solutions of the present invention together with the embodiments of the present application, and do not limit the technical solutions of the present invention.

图1为本发明实施例实现命令调度的方法的流程图;1 is a flowchart of a method for implementing command scheduling according to an embodiment of the present invention;

图2为本发明一实施例第一位置的示意图;2 is a schematic diagram of a first position according to an embodiment of the present invention;

图3为本发明另一实施例第一位置的示意图;3 is a schematic diagram of a first position according to another embodiment of the present invention;

图4为本发明再一实施例第一位置的示意图;FIG. 4 is a schematic diagram of a first position according to yet another embodiment of the present invention;

图5为本发明一实施例插入第四命令的示意图;5 is a schematic diagram of inserting a fourth command according to an embodiment of the present invention;

图6为本发明另一实施例插入第四命令的示意图;6 is a schematic diagram of inserting a fourth command according to another embodiment of the present invention;

图7为本发明实施例数据缓存的示意图;7 is a schematic diagram of a data cache according to an embodiment of the present invention;

图8为本发明实施例告警处理的示意图;FIG. 8 is a schematic diagram of alarm processing according to an embodiment of the present invention;

图9为本发明实施例实现命令调度的装置的结构框图。FIG. 9 is a structural block diagram of an apparatus for implementing command scheduling according to an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚明白,下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。In order to make the objectives, technical solutions and advantages of the present invention clearer, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, the embodiments in the present application and the features in the embodiments may be arbitrarily combined with each other if there is no conflict.

在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。The steps shown in the flowcharts of the figures may be performed in a computer system, such as a set of computer-executable instructions. Also, although a logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in an order different from that herein.

图1为本发明实施例实现命令调度的方法的流程图,如图1所示,包括:FIG. 1 is a flowchart of a method for implementing command scheduling according to an embodiment of the present invention, as shown in FIG. 1 , including:

步骤101、动态随机存取存储器(DRAM)接收到第一命令时,确定命令队列中是否存在用于插入第一命令的第一位置;Step 101, when the dynamic random access memory (DRAM) receives the first command, determine whether there is a first position for inserting the first command in the command queue;

在一种示例性实例中,本发明实施例中的第一命令包括新接收到的命令。In an exemplary example, the first command in the embodiment of the present invention includes a newly received command.

在一种示例性实例中,本发明实施例确定命令队列中是否存在用于插入第一命令的第一位置,包括:In an exemplary example, the embodiment of the present invention determines whether there is a first position in the command queue for inserting the first command, including:

按照从命令队列的尾部到头部的顺序,确定命令队列中是否存在用于插入第一命令的第一位置。In order from the tail of the command queue to the head, it is determined whether there is a first position in the command queue for inserting the first command.

步骤102、存在第一位置时,确定第一位置是否通过一致性冲突检查;Step 102, when the first position exists, determine whether the first position passes the consistency conflict check;

步骤103、将第一命令插入通过一致性冲突检查的第一位置;Step 103, inserting the first command into the first position that has passed the consistency conflict check;

其中,第一命令包括:读命令或写命令。Wherein, the first command includes: a read command or a write command.

需要说明的是,本发明实施例命令队列中的读命令和写命令是串行处理的,因此一次命令调度只处理一个第一命令。It should be noted that, in the embodiment of the present invention, the read command and the write command in the command queue are processed serially, so only one first command is processed in one command scheduling.

本发明实施例不对命令队列进行读写分组的情况下,对新接收的第一命令执行一致性冲突检查后进行插入处理,提升了片上系统(SOC)的读写性能。When the embodiment of the present invention does not perform read and write grouping on the command queue, the newly received first command is checked for consistency conflict and then inserted, thereby improving the read and write performance of the system on chip (SOC).

在一种示例性实例中,本发明实施例确定命令队列中是否存在用于插入第一命令的第一位置,包括:In an exemplary example, the embodiment of the present invention determines whether there is a first position in the command queue for inserting the first command, including:

命令队列中存在符合页命中(Page Hit,访问相同的组(Bank)或行(Row))的命令时,将符合页命中的命令之后的位置确定为第一位置;When there is a command conforming to a page hit (Page Hit, accessing the same bank (Bank) or row (Row)) in the command queue, the position after the command conforming to the page hit is determined as the first position;

命令队列中存在有组冲突(Bank Conflict)的两个命令时,将两个有组冲突的命令的中间位置确定为第一位置;When there are two commands with bank conflict (Bank Conflict) in the command queue, the middle position of the two commands with bank conflict is determined as the first position;

需要说明的是,有组冲突的两个第四命令应该是相邻的命令,只有相邻的命令,才有可能存在组冲突。It should be noted that the two fourth commands with a group conflict should be adjacent commands, and only the adjacent commands may have a group conflict.

命令队列中存在操作类型一致且相邻的两个命令时,将两个操作类型一致且相邻的命令的中间位置确定为第一位置;When there are two adjacent commands with the same operation type in the command queue, the middle position of the two adjacent commands with the same operation type is determined as the first position;

其中,操作类型包括:读操作和写操作。Among them, the operation type includes: read operation and write operation.

针对确定第一位置的不同,以下通过示例进行简要说明;图2为本发明一实施例第一位置的示意图,如图2所示,图中WR_Bx_Rx_Cx中的WR表示写操作,Bx表示xBank,Rx表示第x行,Cx表示第x列,上述命令表示写xbank的x行x列;RD_Bx_Rx_Cx中的RD表示读,上述命令表示读xbank的x行x列;图2中标识1、2和3分别表示确定的三个存在符合Page Hit的命令的第一位置;其中,标识1的第一位置靠近命令队列的头部,进行第一命令插入处理时,标识1的第一位置的优先级,大于标识2的第一位置的优先级;标识2的第一位置的优先级,大于标识3的第一位置的优先级;在进行一致性冲突检查时,本发明实施例按照上述优先级由高到低的顺序逐个进行判断处理。For the difference in determining the first position, a brief description is given below through an example; FIG. 2 is a schematic diagram of the first position according to an embodiment of the present invention, as shown in FIG. 2 , WR in WR_Bx_Rx_Cx in the figure represents a write operation, Bx represents xBank, Rx Represents the xth row, Cx represents the xth column, the above command means to write the x row and x column of the xbank; RD in RD_Bx_Rx_Cx means read, and the above command means to read the x row and x column of the xbank; Indicates that there are three determined first positions of commands that conform to the Page Hit; wherein, the first position of the identifier 1 is close to the head of the command queue, and when the first command insertion processing is performed, the priority of the first position of the identifier 1 is greater than The priority of the first position of the identification 2; the priority of the first position of the identification 2 is greater than the priority of the first position of the identification 3; when the consistency conflict check is performed, the embodiments of the present invention follow the above priorities from high to high The lower order is judged one by one.

图3为本发明另一实施例第一位置的示意图,如图3所示,图中标识1、2和3分别表示三个存在有组冲突的两个命令时的第一位置;标识1靠近命令队列的头部,进行第一命令插入处理时,标识1的第一位置的优先级,大于标识2的第一位置的优先级;标识2的第一位置的优先级,大于标识3的第一位置的优先级;在进行一致性冲突检查时,本发明实施例按照上述优先级由高到低的顺序逐个进行判断处理。FIG. 3 is a schematic diagram of the first position of another embodiment of the present invention. As shown in FIG. 3 , the marks 1, 2 and 3 in the figure respectively represent the first position when there are three two commands with group conflicts; mark 1 is close to In the head of the command queue, when the first command insertion processing is performed, the priority of the first position of ID 1 is greater than the priority of the first position of ID 2; the priority of the first position of ID 2 is greater than the priority of the first position of ID 3 The priority of a position; when performing the consistency conflict check, the embodiment of the present invention performs judgment processing one by one according to the above-mentioned priority from high to low.

图4为本发明再一实施例第一位置的示意图,如图4所示,图中标识1、2和3分别表示三个存在操作类型一致且相邻的两个命令时的第一位置;标识1靠近命令队列的头部,进行第一命令插入处理时,标识1的第一位置的优先级,大于标识2的第一位置的优先级;标识2的第一位置的优先级,大于标识3的第一位置的优先级;在进行一致性冲突检查时,本发明实施例按照上述优先级由高到低的顺序逐个进行判断处理。FIG. 4 is a schematic diagram of the first position of still another embodiment of the present invention, as shown in FIG. 4 , the marks 1, 2 and 3 in the figure respectively represent the first position when there are two commands with the same operation type and adjacent to each other; ID 1 is close to the head of the command queue, and when the first command is inserted, the priority of the first position of ID 1 is greater than the priority of the first position of ID 2; the priority of the first position of ID 2 is greater than that of ID 2 The priority of the first position of 3; when performing the consistency conflict check, the embodiment of the present invention performs judgment processing one by one according to the above-mentioned priority from high to low.

在一种示例性示例中,本发明实施例可以仅根据是否存在符合页命中的命令的判断,确定第一位置;在一种示例性示例中,本发明实施例可以仅根据是否存在有组冲突的两个命令的判断,确定第一位置;在一种示例性示例中,本发明实施例可以根据是否存在操作类型一致且相邻的两个命令的顺序的判断,确定第一位置。在一种示例性示例中,本发明实施例可以从:是否存在符合页命中的命令,是否存在有组冲突的两个命令,和是否存在操作类型一致且相邻的两个命令的判断中选出两个,按照:是否存在符合页命中的命令,是否存在有组冲突的两个命令,和是否存在操作类型一致且相邻的两个命令的顺序,顺序执行第一位置的判断处理。在一种示例性示例中,本发明实施例可以根据:是否存在符合页命中的命令,是否存在有组冲突的两个命令,和是否存在操作类型一致且相邻的两个命令的判断,按照:是否存在符合页命中的命令,是否存在有组冲突的两个命令,和是否存在操作类型一致且相邻的两个命令的顺序,逐个执行第一位置的判断处理。In an exemplary example, the embodiment of the present invention may determine the first position only based on the judgment of whether there is a command that matches the page hit; in an exemplary example, the embodiment of the present invention may only determine the first position based on whether there is a group conflict The first position is determined by judging the two commands; in an exemplary example, the embodiment of the present invention can determine the first position according to the judgment of whether there are two adjacent commands of the same operation type and the order of the adjacent commands. In an exemplary example, the embodiment of the present invention may be selected from the judgments of whether there is a command that matches a page hit, whether there are two commands that have a group conflict, and whether there are two adjacent commands that have the same operation type and are adjacent to each other. Two, according to the order of whether there is a command that matches the page hit, whether there are two commands with a group conflict, and whether there are two adjacent commands with the same operation type, the judgment processing of the first position is executed sequentially. In an exemplary example, the embodiment of the present invention can judge whether there is a command that matches a page hit, whether there are two commands with group conflicts, and whether there are two adjacent commands with the same operation type, according to : Whether there is a command that matches the page hit, whether there are two commands with a group conflict, and whether there is an order of two adjacent commands with the same operation type, execute the judgment processing of the first position one by one.

在一种示例性实例中,本发明实施例确定第一位置是否通过一致性冲突检查,包括:In an exemplary example, the embodiment of the present invention determines whether the first location passes the consistency conflict check, including:

按照从命令队列头部到尾部的顺序,对第一位置进行第一命令与第二命令的一致性冲突检查;According to the sequence from the head to the tail of the command queue, the first position is checked for the consistency conflict between the first command and the second command;

第一命令与第二命令通过一致性冲突检查时,确定该第一位置通过一致性冲突检查;When the first command and the second command pass the consistency conflict check, determine that the first position passes the consistency conflict check;

其中,第二命令包括:与第一位置紧邻的读命令和/或写命令。Wherein, the second command includes: a read command and/or a write command adjacent to the first position.

需要说明的是,本发明实施例中的一致性冲突检查基于模块的地址和读写的属性定义,可以包括:模块地址冲突和/或读写冲突;例如、根据模块的数据处理过程,预先设置了模块的读写顺序,因此,读写顺序一旦不符合预设,则认为存在冲突。在一种示例性实例中,本发明实施例一致性冲突的规则可以由本领域技术人员根据实施场景进行设置。在一种示例性实例中,本发明实施例中的模块包括集成在SOC中的中央处理器(CPU)、数据处理器(DPU)和显示模块等需要通过DRAM进行数据读写的模块;在一种示例性实例中,本发明实施例可以通过预先设定的编号区分SOC中的各个模块,基于编号区分各个模块的命令和地址,进而进行一致性冲突检查。本发明实施例一致性冲突检测确定存在一致性冲突时,将第一位置从可插入第一指令的位置中删除。It should be noted that the consistency conflict check in the embodiment of the present invention is based on the address of the module and the attribute definition of read and write, and may include: module address conflict and/or read and write conflict; for example, according to the data processing process of the module, preset Therefore, once the read and write sequence does not conform to the preset, it is considered that there is a conflict. In an exemplary example, the rules for consistency conflicts in the embodiments of the present invention may be set by those skilled in the art according to implementation scenarios. In an exemplary example, the modules in this embodiment of the present invention include modules such as a central processing unit (CPU), a data processing unit (DPU), and a display module integrated in the SOC, which need to read and write data through DRAM; In this exemplary example, the embodiment of the present invention can distinguish each module in the SOC by a preset number, distinguish the command and address of each module based on the number, and then perform a consistency conflict check. When the consistency conflict detection in the embodiment of the present invention determines that there is a consistency conflict, the first position is deleted from the position where the first instruction can be inserted.

在一种示例性实例中,本发明实施例将第一命令插入通过一致性冲突检查的第一位置,包括:In an exemplary example, the embodiment of the present invention inserts the first command into the first position that passes the consistency conflict check, including:

将第一命令插入最靠近命令队列头部、且通过一致性冲突检查的第一位置。Insert the first command in the first position closest to the head of the command queue that passes the consistency conflict check.

在一种示例性实例中,本发明实施例也可以将第一命令插入其他通过一致性冲突检查第一位置。将第一命令插入最靠近命令队列头部且通过一致性冲突检查的第一位置,提升了第一命令的处理效率,也避免对后续命令进行插入时,由于第一命令插入的位置带来的时序(在后接收到的命令插入到了第一命令前面)问题。In an exemplary example, the embodiment of the present invention may also insert the first command into another first position that passes the consistency conflict check. Inserting the first command into the first position that is closest to the head of the command queue and passes the consistency conflict check improves the processing efficiency of the first command, and also avoids any problems caused by the position where the first command is inserted when inserting subsequent commands. Timing (later received commands inserted before the first) issue.

在一种示例性实例中,本发明实施例方法还包括:In an exemplary embodiment, the method according to the embodiment of the present invention further includes:

确定命令队列中不存在用于插入第一命令的第一位置时,将第一命令写入命令队列的尾部。When it is determined that the first position for inserting the first command does not exist in the command queue, the first command is written to the tail of the command queue.

本发明实施例当不存在第一位置时,保持命令队列的排序不变,新增的第一命令写入命令队列的尾部。In this embodiment of the present invention, when the first position does not exist, the order of the command queue is kept unchanged, and the newly added first command is written to the tail of the command queue.

在一种示例性实例中,本发明实施例方法还包括:In an exemplary embodiment, the method according to the embodiment of the present invention further includes:

为命令队列中的一个以上第三命令设置超时阈值;set a timeout threshold for more than one third command in the command queue;

第三命令在超时阈值内未执行时,将该第三命令插入到命令队列的头部。When the third command is not executed within the timeout threshold, the third command is inserted into the head of the command queue.

在一种示例性实例中,本发明实施例可以由技术人员根据系统应用设置超时阈值;例如、第六命令的访问唯一标识(ID)是一笔显示模块(Display)的读操作,可以根据Display分辨率动态配置超时阈值。本发明实施例超时阈值的设置可以理解为超时机制或老化机制,通过超时阈值的设置,避免了具有时限要求的命令的卡滞。In an exemplary example, in this embodiment of the present invention, a technician may set a timeout threshold according to a system application; for example, the access unique identifier (ID) of the sixth command is a read operation of the display module (Display), which can be set according to the Display The resolution dynamically configures the timeout threshold. The setting of the timeout threshold in the embodiment of the present invention can be understood as a timeout mechanism or an aging mechanism, and by setting the timeout threshold, the blocking of commands with time limit requirements is avoided.

在一种示例性实例中,本发明实施例方法还包括:In an exemplary embodiment, the method according to the embodiment of the present invention further includes:

确定命令队列中可并行操作的第四命令;determining a fourth command in the command queue that can be operated in parallel;

在第一个第四命令的组冲突(Bank Conflict)的第一时延间隔内,插入一个以上可并行操作的第四命令;Insert more than one fourth command that can be operated in parallel within the first delay interval of the bank conflict (Bank Conflict) of the first fourth command;

其中,第四命令包括:多组(Muti-Bank)命令和/或组群(BankGroup)命令;第一个第四命令包括:靠近命令队列头部的第四命令;插入的一个以上可并行操作的第四命令包括:除第一个第四命令以外的其他可并行操作的第四命令;插入的一个以上可并行操作的第四命令的组冲突的第二时延间隔的累加和,小于第一时延间隔。Wherein, the fourth command includes: a multi-group (Muti-Bank) command and/or a group (BankGroup) command; the first fourth command includes: a fourth command close to the head of the command queue; more than one inserted can operate in parallel The fourth command includes: other parallel operable fourth commands except the first fourth command; the cumulative sum of the second delay intervals of the group conflicts of the inserted more than one parallel operable fourth commands is less than the first a delay interval.

在一种示例性实例中,本发明实施例可以本发明实施例DRAM的使用场景,设定在第一时延间隔内插入固定数量的可并行操作的第四命令;例如、插入两个可并行操作的第四命令。直接设置固定数量,可以减少第二时延间隔的累加和的计算步骤,提升处理速度。在一种示例性实例中,本发明实施例可以按照从头部到尾部的顺序查找可并行操作的第四命令。可并行操作的第四命令可以包含多组,本发明实施例对每一组第四命令,分别执行上述处理。在一种示例性实例中,插入的一个以上可并行操作的第四命令为按照命令队列排序确定的第四命令,即插入的第四命令在命令队列中的排序与未插入命令前一致。In an exemplary example, the embodiment of the present invention may use the DRAM usage scenario of the embodiment of the present invention to set a fixed number of fourth commands that can be operated in parallel within the first delay interval; for example, insert two parallel-operable fourth commands; The fourth command of the operation. Directly setting a fixed number can reduce the calculation steps of the accumulated sum of the second delay interval and improve the processing speed. In an exemplary example, the embodiment of the present invention may search for the fourth command that can be operated in parallel in order from the head to the tail. The fourth commands that can be operated in parallel may include multiple groups, and the embodiment of the present invention performs the foregoing processing for each group of fourth commands respectively. In an exemplary example, the inserted one or more fourth commands that can be operated in parallel are fourth commands determined according to the order of the command queue, that is, the order of the inserted fourth commands in the command queue is consistent with that before the uninserted commands.

图5为本发明一实施例插入第四命令的示意图,如图5所示,图5中的时许参数为JEDEC的标准定义的参数,本发明实施例将B4-R3的写操作隐藏在B0的组冲突的第一时延间隔(组冲突周期)内;本发明实施例根据组冲突之间的隔断操作属性(需要长延迟等待的特性),将后续其他可以并行操作的组的读或写命令提前到该组冲突的第一时延间隔内执行;通过并行方式隐藏了组冲突的延迟。FIG. 5 is a schematic diagram of inserting a fourth command according to an embodiment of the present invention. As shown in FIG. 5 , the timing parameter in FIG. 5 is a parameter defined by the JEDEC standard. The embodiment of the present invention hides the write operation of B4-R3 in B0 within the first delay interval (group conflict period) of the group conflict; the embodiment of the present invention reads or writes subsequent groups that can operate in parallel according to the isolation operation attribute between group conflicts (the feature that requires long delay and waiting). The command is executed in advance to the first delay interval of the group conflict; the delay of the group conflict is hidden in parallel.

本发明实施例插入第四命令的处理可以避免设计复杂的插队排序的逻辑机制,降低DRAM的逻辑耦合度。在一种示例性实例中,本发明实施例第四命令执行的操作为写操作时,写操作的组冲突的第一时延间隔TCFH=tWR+tRP+tRCD;其中,tWR表示写恢复的时间、tRP表示预充电的时间、tRCD表示激活时间,上述时间信息可以从电子器件工程联合委员会JEDEC手册上获取。相应的,理论上插入的多组写命令的数目=第一时延间隔/(数据总线(DQ)冲突长度(Burst Length)/2),这里,需要说明的是,但命令队列中包含的多组写命令的个数小于计算出来可以插入的命令个数时,仅插入命令队列中包含的多组写命令即可;图6为本发明另一实施例插入第四命令的示意图,如图6所示,图6中的时许参数为JEDEC的标准定义的参数,本发明实施例较图5在第一时延间隔内多插入了3个多组命令,通过并行操作的插入处理,本发明实施例提升了数据总线的带宽利用。The processing of inserting the fourth command in the embodiment of the present invention can avoid designing a complex logic mechanism of queue insertion sorting, and reduce the logic coupling degree of the DRAM. In an exemplary example, when the operation performed by the fourth command in the embodiment of the present invention is a write operation, the first delay interval of the group conflict of the write operation is TCFH=tWR+tRP+tRCD; wherein, tWR represents the write recovery time , tRP represents the precharge time, and tRCD represents the activation time. The above-mentioned time information can be obtained from the JEDEC handbook of the Joint Electronic Device Engineering Committee. Correspondingly, the number of multiple groups of write commands inserted theoretically = the first delay interval/(data bus (DQ) conflict length (Burst Length)/2), here, it should be noted that, but the command queue contains many When the number of group write commands is less than the calculated number of commands that can be inserted, only multiple groups of write commands included in the command queue are inserted; FIG. 6 is a schematic diagram of inserting a fourth command according to another embodiment of the present invention, as shown in FIG. 6 As shown, the timing parameters in FIG. 6 are parameters defined by the JEDEC standard. Compared with FIG. 5, the embodiment of the present invention inserts three more sets of commands in the first delay interval. Embodiments improve the bandwidth utilization of the data bus.

在一种示例性实例中,插入一个以上可并行操作的第四命令之后,本发明实施例方法还包括:In an exemplary example, after inserting more than one fourth command that can be operated in parallel, the method according to the embodiment of the present invention further includes:

对一个以上可并行操作的第四命令中的每一个第四命令,分别与第五命令进行一致性冲突检查;Performing a consistency conflict check with the fifth command for each of the more than one fourth commands that can be operated in parallel;

第四命令与第五命令通过一致性冲突检查时,读取第四命令时根据第四命令进行数据操作;When the fourth command and the fifth command pass the consistency conflict check, the data operation is performed according to the fourth command when the fourth command is read;

第四命令与第五命令未通过一致性冲突检查时,读取第四命令时对第四命令执行激活操作;When the fourth command and the fifth command fail the consistency conflict check, the activation operation is performed on the fourth command when the fourth command is read;

其中,第五命令包括:命令队列中排序在一个以上可并行操作的第四命令之后的第一个命令。Wherein, the fifth command includes: the first command in the command queue after the fourth command that can be operated in parallel.

在一种示例性实例中,本发明实施例方法还包括:In an exemplary embodiment, the method according to the embodiment of the present invention further includes:

根据命令的地址信息确定命令队列中N个命令的地址连续时,读取第N+1个地址的数据,将读取的数据和地址信息缓存在预设的缓存区域;When it is determined that the addresses of N commands in the command queue are continuous according to the address information of the command, the data of the N+1th address is read, and the read data and address information are cached in the preset cache area;

接收到包含第N+1个地址的指令时,从缓存区域中根据地址信息读取缓存的数据。When an instruction containing the N+1th address is received, the cached data is read from the cache area according to the address information.

本发明实施例通过对命令的地址进行连续性判断,在N个命令的地址连续时,读取第N+1个地址的数据,实现了对数据的预读取;图7为本发明实施例数据缓存的示意图,如图7所示,预读取的地址是Bank2-Row1-Col4;预读取对应DRAM地址中的数据存储在缓存(Buffer)中并记录该笔数据的地址信息;如果后续没有写操作到该地址,则Buffer中一直是最新的数据,若写操作到该地址则更新该Buffer中的写数据。如果新的读命令命中该Buffer,则直接从Buffer中读取该数据,无需再从DRAM颗粒中读取数据。In the embodiment of the present invention, by judging the continuity of the addresses of the commands, when the addresses of the N commands are continuous, the data of the N+1th address is read to realize the pre-reading of the data; FIG. 7 is an embodiment of the present invention. The schematic diagram of the data cache, as shown in Figure 7, the pre-read address is Bank2-Row1-Col4; the data in the pre-read corresponding DRAM address is stored in the buffer (Buffer) and the address information of the data is recorded; if the subsequent If there is no write operation to this address, the Buffer has always been the latest data. If the write operation reaches this address, the write data in the Buffer will be updated. If the new read command hits the Buffer, the data will be read directly from the Buffer, and there is no need to read data from the DRAM particles.

需要说明的是,本发明实施例地址连续包括:组和行地址相同,列地址连续;如bank1-row1-c1->bank1-row1-c2->bank1-row1-c3->bank1-row1-c4;N的值由用户根据DRAM的应用场景进行设定。缓存的深度D可以由用户根据系统性能和应用需求进行设定;在一种示例性实例中,本发明实施例可以通过批量性能测试进行仿真,确定合理D和N的值,使系统能够达到性能最优。It should be noted that the address continuity in the embodiment of the present invention includes: the group and row addresses are the same, and the column addresses are continuous; for example, bank1-row1-c1->bank1-row1-c2->bank1-row1-c3->bank1-row1-c4 ; The value of N is set by the user according to the application scenario of DRAM. The cache depth D can be set by the user according to system performance and application requirements; in an exemplary embodiment, the embodiment of the present invention can perform simulation through batch performance tests to determine reasonable values of D and N, so that the system can achieve performance optimal.

在一种示例性实例中,本发明实施例方法还包括:In an exemplary embodiment, the method according to the embodiment of the present invention further includes:

缓存在缓存区域的数据在预设时长内未被读取且未更新时,删除数据;When the data cached in the cache area has not been read or updated within a preset period of time, delete the data;

缓存在缓存区域的数据在预设时长内未被读取但发生更新时,将该数据输出到DRAM中后,删除缓存区域中该输出到DRAM中的数据。When the data cached in the cache area has not been read within a preset period of time but is updated, after the data is output to the DRAM, the data output to the DRAM in the cache area is deleted.

在一种示例性实例中,本发明实施例预设时长可以由本领域技术人员根据经验值设定。In an exemplary example, the preset duration in this embodiment of the present invention may be set by those skilled in the art based on empirical values.

在一种示例性实例中,本发明实施例方法还包括:In an exemplary embodiment, the method according to the embodiment of the present invention further includes:

确定第一命令是否插入第一位置;determining whether the first command is inserted at the first position;

第一命令未插入第一位置时,进行告警处理。When the first command is not inserted into the first position, alarm processing is performed.

本发明实施例通过设置自检功能,当出现包括逻辑运算错误在内的问题,导致第一命令没有插入第一位置时进行告警处理;图8为本发明实施例告警处理的示意图,如图8所示,在两个组冲突之间没有插入其他组命令时,进行告警处理;在一种示例性实例中,本发明实施例进行告警处理包括:根据第一命令未插入第一位置生成错误报告,将生成的错误报告通过系统消息、邮件或其他方式反馈给用户或在系统中设置的对告警进行自动处理的模块;用户或对告警进行自动处理的模块根据接收到的错误报告执行包括:关闭插入功能等处理。By setting a self-check function in the embodiment of the present invention, when a problem including a logical operation error occurs, causing the first command to not be inserted into the first position, alarm processing is performed; FIG. 8 is a schematic diagram of the alarm processing according to the embodiment of the present invention, as shown in FIG. 8 . As shown in the figure, when no other group command is inserted between the two group conflicts, alarm processing is performed; in an exemplary example, performing the alarm processing in this embodiment of the present invention includes: generating an error report according to the fact that the first command is not inserted into the first position , the generated error report is fed back to the user through system messages, emails or other means, or the module that automatically handles the alarm is set in the system; the user or the module that automatically handles the alarm executes according to the received error report, including: closing: Insert functions, etc.

本发明实施例对可插入第一命令的第一位置进行确定,实现命令队列的重排,通过一致性冲突检查避免了读写冲突;通过超时阈值的设置,避免命令等待出现等待时间过长的问题。通过将可并行操作的第四命令的插入组冲突之间的间隔时间,简化了命令调度的复杂度和耦合度,提升了DRAM的执行效率。通过地址的连续性判断,进行数据的预读取,使得使用较少队列资源,在连续读的情况下也能够取得比较好的读效率;本发明实施例通过告警处理实现了队列调度问题的实时发现,为及时的进行命令调度的调整提供基础。The embodiment of the present invention determines the first position where the first command can be inserted, realizes the rearrangement of the command queue, and avoids read and write conflicts through consistency conflict checking; and through the setting of the timeout threshold, it avoids the occurrence of excessively long waiting times for commands. question. By inserting the fourth command that can be operated in parallel into the interval time between group conflicts, the complexity and coupling degree of command scheduling are simplified, and the execution efficiency of the DRAM is improved. By judging the continuity of the address, data pre-reading is performed, so that less queue resources are used, and better read efficiency can be achieved in the case of continuous reading; the embodiment of the present invention realizes real-time queue scheduling problems through alarm processing. Discovery provides a basis for timely adjustment of command scheduling.

本发明实施例还提供一种计算机存储介质,计算机存储介质中存储有计算机程序,计算机程序被处理器执行时实现上述实现命令调度的方法。An embodiment of the present invention further provides a computer storage medium, where a computer program is stored in the computer storage medium, and the above method for implementing command scheduling is implemented when the computer program is executed by a processor.

本发明实施例还提供一种终端,包括:存储器和处理器,存储器中保存有计算机程序;其中,An embodiment of the present invention further provides a terminal, including: a memory and a processor, and a computer program is stored in the memory; wherein,

处理器被配置为执行存储器中的计算机程序;the processor is configured to execute the computer program in the memory;

计算机程序被处理器执行时实现如上述实现命令调度的方法。When the computer program is executed by the processor, the method for implementing command scheduling as described above is implemented.

图9为本发明实施例实现命令调度的装置的结构框图,如图9所示,包括:确定位置单元、冲突检查单元和插入处理单元;其中,FIG. 9 is a structural block diagram of an apparatus for implementing command scheduling according to an embodiment of the present invention. As shown in FIG. 9 , it includes: a location determination unit, a conflict checking unit, and an insertion processing unit; wherein,

确定位置单元设置为:接收到第一命令时,确定命令队列中是否存在用于插入第一命令的第一位置;The determining position unit is set to: when the first command is received, determine whether there is a first position for inserting the first command in the command queue;

冲突检查单元设置为:存在第一位置时,确定第一位置是否通过一致性冲突检查;The conflict checking unit is set to: when the first position exists, determine whether the first position passes the consistency conflict check;

插入处理单元设置为:将第一命令插入通过一致性冲突检查的第一位置;The insertion processing unit is set to: insert the first command into the first position that has passed the consistency conflict check;

其中,第一命令包括:读命令或写命令。Wherein, the first command includes: a read command or a write command.

本发明实施例不对命令队列进行读写分组的情况下,对新接收的第一命令执行一致性冲突检查后进行插入处理,提升了片上系统(SOC)的读写性能。When the embodiment of the present invention does not perform read and write grouping on the command queue, the newly received first command is checked for consistency conflict and then inserted, thereby improving the read and write performance of the system on chip (SOC).

在一种示例性实例中,本发明实施例确定位置单元是设置为:In an exemplary example, the embodiment of the present invention determines that the location unit is set to:

命令队列中存在符合页命中的命令时,将符合页命中的命令之后的位置确定为第一位置;When there is a command matching the page hit in the command queue, the position after the command matching the page hit is determined as the first position;

命令队列中存在有组冲突的两个命令时,将两个有组冲突的命令的中间位置确定为第一位置;When there are two commands with group conflict in the command queue, the middle position of the two commands with group conflict is determined as the first position;

命令队列中存在操作类型一致且相邻的两个命令时,将两个操作类型一致且相邻的命令的中间位置确定为第一位置;其中,操作类型包括:读操作和写操作。When there are two adjacent commands with the same operation type in the command queue, the middle position of the two adjacent commands with the same operation type is determined as the first position; wherein the operation types include: read operation and write operation.

在一种示例性实例中,本发明实施例冲突检查单元是设置为:In an exemplary embodiment, the conflict checking unit in the embodiment of the present invention is set to:

按照从命令队列头部到尾部的顺序,对第一位置进行第一命令与第二命令的一致性冲突检查;According to the sequence from the head to the tail of the command queue, the first position is checked for the consistency conflict between the first command and the second command;

第一命令与第二命令通过一致性冲突检查时,确定该第一位置通过一致性冲突检查;When the first command and the second command pass the consistency conflict check, determine that the first position passes the consistency conflict check;

其中,第二命令包括:与第一位置紧邻的读命令和/或写命令。Wherein, the second command includes: a read command and/or a write command adjacent to the first position.

在一种示例性实例中,本发明实施例插入处理单元是设置为:In an exemplary embodiment, the insertion processing unit according to the embodiment of the present invention is configured as:

将第一命令插入最靠近命令队列头部、且通过一致性冲突检查的第一位置。Insert the first command in the first position closest to the head of the command queue that passes the consistency conflict check.

在一种示例性实例中,本发明实施例插入处理单元还设置为:In an exemplary embodiment, the insertion processing unit according to the embodiment of the present invention is further configured to:

确定位置单元确定命令队列中不存在用于插入第一命令的第一位置时,将第一命令写入命令队列的尾部。When the position determining unit determines that the first position for inserting the first command does not exist in the command queue, the first command is written to the tail of the command queue.

在一种示例性实例中,本发明实施例装置还包括超时处理单元,设置为:In an exemplary embodiment, the apparatus according to the embodiment of the present invention further includes a timeout processing unit, which is set to:

为命令队列中的一个以上第三命令设置超时阈值;第三命令在超时阈值内未执行时,将该第三命令插入到命令队列的头部。A timeout threshold is set for more than one third command in the command queue; when the third command is not executed within the timeout threshold, the third command is inserted into the head of the command queue.

在一种示例性实例中,本发明实施例装置还包括并行处理单元,设置为:In an exemplary embodiment, the apparatus according to the embodiment of the present invention further includes a parallel processing unit, configured as:

确定命令队列中可并行操作的第四命令;在第一个第四命令的组冲突的第一时延间隔内,插入一个以上可并行操作的第四命令;determining a fourth command that can be operated in parallel in the command queue; inserting more than one fourth command that can be operated in parallel within the first delay interval of the group conflict of the first fourth command;

其中,第四命令包括:多组命令和/或组群命令;第一个第四命令包括:靠近命令队列头部的第四命令;插入的一个以上可并行操作的第四命令包括:除第一个第四命令以外的其他可并行操作的第四命令;插入的一个以上可并行操作的第四命令的组冲突的第二时延间隔的累加和,小于第一时延间隔。Wherein, the fourth command includes: multiple groups of commands and/or group commands; the first fourth command includes: a fourth command close to the head of the command queue; the inserted more than one fourth command that can be operated in parallel includes: A fourth command other than the fourth command that can be operated in parallel; the cumulative sum of the second delay interval of the group conflict of the inserted one or more fourth commands that can be operated in parallel is smaller than the first delay interval.

在一种示例性实例中,本发明实施例并行处理单元还设置为:In an exemplary example, the parallel processing unit in the embodiment of the present invention is further configured as:

对一个以上可并行操作的第四命令中的每一个第四命令,分别与第五命令进行一致性冲突检查;Performing a consistency conflict check with the fifth command for each of the more than one fourth commands that can be operated in parallel;

第四命令与第五命令通过一致性冲突检查时,读取第四命令时根据第四命令进行数据操作;When the fourth command and the fifth command pass the consistency conflict check, the data operation is performed according to the fourth command when the fourth command is read;

第四命令与第五命令未通过一致性冲突检查时,读取第四命令时对第四命令执行激活操作;When the fourth command and the fifth command fail the consistency conflict check, the activation operation is performed on the fourth command when the fourth command is read;

其中,第五命令包括:命令队列中排序在一个以上可并行操作的第四命令之后的第一个命令。Wherein, the fifth command includes: the first command in the command queue after the fourth command that can be operated in parallel.

在一种示例性实例中,本发明实施例装置还包括预读取单元,设置为:In an exemplary embodiment, the device according to the embodiment of the present invention further includes a pre-reading unit, configured as:

根据命令的地址信息确定命令队列中N个命令的地址连续时,读取第N+1个地址的数据,将读取的数据和地址信息缓存在预设的缓存区域;When it is determined that the addresses of N commands in the command queue are continuous according to the address information of the command, the data of the N+1th address is read, and the read data and address information are cached in the preset cache area;

接收到包含第N+1个地址的指令时,从缓存区域中根据地址信息读取缓存的数据。When an instruction containing the N+1th address is received, the cached data is read from the cache area according to the address information.

在一种示例性实例中,本发明实施例预读取单元还设置为:In an exemplary embodiment, the pre-reading unit in the embodiment of the present invention is further set to:

缓存在缓存区域的数据在预设时长内未被读取且未更新时,删除数据;When the data cached in the cache area has not been read or updated within a preset period of time, delete the data;

缓存在缓存区域的数据在预设时长内未被读取但发生更新时,将该数据输出到DRAM中后,删除缓存区域中该输出到DRAM中的数据。When the data cached in the cache area has not been read within a preset period of time but is updated, after the data is output to the DRAM, the data output to the DRAM in the cache area is deleted.

在一种示例性实例中,本发明实施例装置还包括告警单元,设置为:In an exemplary example, the apparatus according to the embodiment of the present invention further includes an alarm unit, which is set to:

确定第一命令是否插入第一位置;第一命令未插入第一位置时,进行告警处理。It is determined whether the first command is inserted into the first position; when the first command is not inserted into the first position, alarm processing is performed.

本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, functional modules/units in the systems, and devices can be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical components Components execute cooperatively. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer-readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As is known to those of ordinary skill in the art, the term computer storage media includes both volatile and nonvolatile implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data flexible, removable and non-removable media. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cartridges, magnetic tape, magnetic disk storage or other magnetic storage devices, or may Any other medium used to store desired information and which can be accessed by a computer. In addition, communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and can include any information delivery media, as is well known to those of ordinary skill in the art .

Claims (14)

1.一种实现命令调度的方法,包括:1. A method for implementing command scheduling, comprising: 动态随机存取存储器DRAM接收到第一命令时,确定命令队列中是否存在用于插入第一命令的第一位置;When the dynamic random access memory DRAM receives the first command, determine whether there is a first position for inserting the first command in the command queue; 存在第一位置时,确定第一位置是否通过一致性冲突检查;When the first position exists, determine whether the first position passes the consistency conflict check; 将第一命令插入通过一致性冲突检查的第一位置;inserting the first command into the first position that passes the consistency conflict check; 其中,所述第一命令包括:读命令或写命令。Wherein, the first command includes: a read command or a write command. 2.根据权利要求1所述的方法,其特征在于,所述确定命令队列中是否存在用于插入第一命令的第一位置,包括:2. The method according to claim 1, wherein the determining whether there is a first position for inserting the first command in the command queue comprises: 所述命令队列中存在符合页命中的命令时,将符合页命中的命令之后的位置确定为所述第一位置;When there is a command conforming to the page hit in the command queue, the position after the command conforming to the page hit is determined as the first position; 所述命令队列中存在有组冲突的两个命令时,将两个有组冲突的命令的中间位置确定为所述第一位置;When there are two commands with group conflict in the command queue, the middle position of the two commands with group conflict is determined as the first position; 所述命令队列中存在操作类型一致且相邻的两个命令时,将两个操作类型一致且相邻的命令的中间位置确定为所述第一位置;When there are two adjacent commands with the same operation type in the command queue, the middle position of the two adjacent commands with the same operation type is determined as the first position; 其中,所述操作类型包括:读操作和写操作。Wherein, the operation types include: read operation and write operation. 3.根据权利要求1所述的方法,其特征在于,所述确定第一位置是否通过一致性冲突检查,包括:3. The method according to claim 1, wherein the determining whether the first position passes the consistency conflict check comprises: 按照从所述命令队列头部到尾部的顺序,对所述第一位置进行第一命令与第二命令的一致性冲突检查;According to the sequence from the head to the tail of the command queue, the first position is checked for consistency conflict between the first command and the second command; 所述第一命令与所述第二命令通过所述一致性冲突检查时,确定该第一位置通过一致性冲突检查;When the first command and the second command pass the consistency conflict check, determine that the first position passes the consistency conflict check; 其中,所述第二命令包括:与所述第一位置紧邻的读命令和/或写命令。Wherein, the second command includes: a read command and/or a write command adjacent to the first position. 4.根据权利要求1所述的方法,其特征在于,所述将第一命令插入通过一致性冲突检查的第一位置,包括:4. The method according to claim 1, wherein the inserting the first command into the first position that passes the consistency conflict check comprises: 将所述第一命令插入最靠近所述命令队列头部、且通过所述一致性冲突检查的第一位置。Inserting the first command into the first position closest to the head of the command queue that passes the consistency conflict check. 5.根据权利要求1~4任一项所述的方法,其特征在于,所述方法还包括:5. The method according to any one of claims 1 to 4, wherein the method further comprises: 确定所述命令队列中不存在用于插入第一命令的第一位置时,将所述第一命令写入所述命令队列的尾部。When it is determined that the first position for inserting the first command does not exist in the command queue, the first command is written to the tail of the command queue. 6.根据权利要求1~4任一项所述的方法,其特征在于,所述方法还包括:6. The method according to any one of claims 1 to 4, wherein the method further comprises: 为所述命令队列中的一个以上第三命令设置超时阈值;setting a timeout threshold for more than one third command in the command queue; 所述第三命令在所述超时阈值内未执行时,将该第三命令插入到所述命令队列的头部。When the third command is not executed within the timeout threshold, the third command is inserted into the head of the command queue. 7.根据权利要求1~4任一项所述的方法,其特征在于,所述方法还包括:7. The method according to any one of claims 1 to 4, wherein the method further comprises: 确定所述命令队列中可并行操作的第四命令;determining a fourth command in the command queue that can operate in parallel; 在第一个第四命令的组冲突的第一时延间隔内,插入一个以上可并行操作的第四命令;Inserting more than one fourth command that can be operated in parallel within the first delay interval of the group conflict of the first fourth command; 其中,所述第四命令包括:多组命令和/或组群命令;所述第一个第四命令包括:靠近命令队列头部的第四命令;插入的所述一个以上可并行操作的第四命令包括:除所述第一个第四命令以外的其他可并行操作的第四命令;插入的所述一个以上可并行操作的第四命令的组冲突的第二时延间隔的累加和,小于所述第一时延间隔。Wherein, the fourth command includes: multiple groups of commands and/or group commands; the first fourth command includes: a fourth command close to the head of the command queue; The four commands include: other fourth commands that can be operated in parallel except the first fourth command; the accumulated sum of the second delay intervals of the group conflicts of the inserted one or more fourth commands that can be operated in parallel, less than the first delay interval. 8.根据权利要求7所述的方法,其特征在于,所述插入一个以上可并行操作的第四命令之后,所述方法还包括:8. The method according to claim 7, wherein after inserting more than one fourth command that can be operated in parallel, the method further comprises: 对所述一个以上可并行操作的第四命令中的每一个所述第四命令,分别与第五命令进行一致性冲突检查;Performing a consistency conflict check with the fifth command for each of the more than one fourth commands that can be operated in parallel; 所述第四命令与第五命令通过一致性冲突检查时,读取所述第四命令时根据第四命令进行数据操作;When the fourth command and the fifth command pass the consistency conflict check, the data operation is performed according to the fourth command when the fourth command is read; 所述第四命令与第五命令未通过一致性冲突检查时,读取所述第四命令时对所述第四命令执行激活操作;When the fourth command and the fifth command fail the consistency conflict check, perform an activation operation on the fourth command when reading the fourth command; 其中,所述第五命令包括:所述命令队列中排序在所述一个以上可并行操作的第四命令之后的第一个命令。Wherein, the fifth command includes: a first command in the command queue after the one or more parallel operable fourth commands. 9.根据权利要求1~4任一项所述的方法,其特征在于,所述方法还包括:9. The method according to any one of claims 1 to 4, wherein the method further comprises: 根据命令的地址信息确定所述命令队列中N个命令的地址连续时,读取第N+1个地址的数据,将读取的数据和地址信息缓存在预设的缓存区域;According to the address information of the command, when it is determined that the addresses of N commands in the command queue are continuous, the data of the N+1th address is read, and the read data and address information are cached in a preset cache area; 接收到包含所述第N+1个地址的指令时,从所述缓存区域中根据所述地址信息读取缓存的数据。When an instruction including the N+1 th address is received, the cached data is read from the cache area according to the address information. 10.根据权利要求9所述的方法,其特征在于,所述方法还包括:10. The method according to claim 9, wherein the method further comprises: 缓存在缓存区域的数据在预设时长内未被读取且未更新时,删除所述数据;When the data cached in the cache area has not been read or updated within a preset period of time, delete the data; 缓存在缓存区域的数据在预设时长内未被读取但发生更新时,将该数据输出到DRAM中后,删除所述缓存区域中该输出到DRAM中的数据。When the data cached in the cache area has not been read within a preset period of time but is updated, after the data is output to the DRAM, the data output to the DRAM in the cache area is deleted. 11.根据权利要求1~4任一项所述的方法,其特征在于,所述方法还包括:11. The method according to any one of claims 1 to 4, wherein the method further comprises: 确定所述第一命令是否插入所述第一位置;determining whether the first command is inserted into the first location; 所述第一命令未插入所述第一位置时,进行告警处理。When the first command is not inserted into the first position, alarm processing is performed. 12.一种计算机存储介质,所述计算机存储介质中存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1~11中任一项所述的实现命令调度的方法。12 . A computer storage medium, wherein a computer program is stored in the computer storage medium, and when the computer program is executed by a processor, the method for implementing command scheduling according to any one of claims 1 to 11 is implemented. 13.一种终端,包括:存储器和处理器,所述存储器中保存有计算机程序;其中,13. A terminal, comprising: a memory and a processor, wherein a computer program is stored in the memory; wherein, 处理器被配置为执行存储器中的计算机程序;the processor is configured to execute the computer program in the memory; 所述计算机程序被所述处理器执行时实现如权利要求1~11中任一项所述的实现命令调度的方法。When the computer program is executed by the processor, the method for implementing command scheduling according to any one of claims 1 to 11 is implemented. 14.一种实现命令调度的装置,包括:确定位置单元、冲突检查单元和插入处理单元;其中,14. An apparatus for implementing command scheduling, comprising: a location determination unit, a conflict checking unit, and an insertion processing unit; wherein, 确定位置单元设置为:接收到第一命令时,确定命令队列中是否存在用于插入第一命令的第一位置;The determining position unit is set to: when the first command is received, determine whether there is a first position for inserting the first command in the command queue; 冲突检查单元设置为:存在第一位置时,确定第一位置是否通过一致性冲突检查;The conflict checking unit is set to: when the first position exists, determine whether the first position passes the consistency conflict check; 插入处理单元设置为:将第一命令插入通过一致性冲突检查的第一位置;The insertion processing unit is set to: insert the first command into the first position that has passed the consistency conflict check; 其中,所述第一命令包括:读命令或写命令。Wherein, the first command includes: a read command or a write command.
CN202111613708.0A 2021-12-27 2021-12-27 A method, device, computer storage medium and terminal for implementing command scheduling Active CN114296896B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111613708.0A CN114296896B (en) 2021-12-27 2021-12-27 A method, device, computer storage medium and terminal for implementing command scheduling

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111613708.0A CN114296896B (en) 2021-12-27 2021-12-27 A method, device, computer storage medium and terminal for implementing command scheduling

Publications (2)

Publication Number Publication Date
CN114296896A true CN114296896A (en) 2022-04-08
CN114296896B CN114296896B (en) 2024-12-10

Family

ID=80970562

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111613708.0A Active CN114296896B (en) 2021-12-27 2021-12-27 A method, device, computer storage medium and terminal for implementing command scheduling

Country Status (1)

Country Link
CN (1) CN114296896B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6490635B1 (en) * 2000-04-28 2002-12-03 Western Digital Technologies, Inc. Conflict detection for queued command handling in disk drive controller
US6557078B1 (en) * 2000-02-21 2003-04-29 Hewlett Packard Development Company, L.P. Cache chain structure to implement high bandwidth low latency cache memory subsystem
CN1735869A (en) * 2001-09-27 2006-02-15 英特尔公司 Method and apparatus for memory access scheduling to reduce memory access latency
CN107450844A (en) * 2016-06-01 2017-12-08 忆锐公司 Memory Controller and memory module and the processor for including it

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6557078B1 (en) * 2000-02-21 2003-04-29 Hewlett Packard Development Company, L.P. Cache chain structure to implement high bandwidth low latency cache memory subsystem
US6490635B1 (en) * 2000-04-28 2002-12-03 Western Digital Technologies, Inc. Conflict detection for queued command handling in disk drive controller
CN1735869A (en) * 2001-09-27 2006-02-15 英特尔公司 Method and apparatus for memory access scheduling to reduce memory access latency
CN107450844A (en) * 2016-06-01 2017-12-08 忆锐公司 Memory Controller and memory module and the processor for including it

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HOKEUN KIM 等: "A predictable and command-level priority-based DRAM controller for mixed-criticality systems", 《21ST IEEE REAL-TIME AND EMBEDDED TECHNOLOGY AND APPLICATIONS SYMPOSIUM》, 18 May 2015 (2015-05-18), pages 317 - 326 *

Also Published As

Publication number Publication date
CN114296896B (en) 2024-12-10

Similar Documents

Publication Publication Date Title
CN113791994B (en) DDR controller based on AXI protocol wrap access and processing method
US8954644B2 (en) Apparatus and method for controlling memory
CN106856098A (en) A kind of devices and methods therefor refreshed for DRAM or eDRAM
US20120246369A1 (en) Bus monitor circuit and bus monitor method
US10157123B1 (en) Methods and apparatus for a scheduler for memory access
CN103064802B (en) Ram memory device
US20090235026A1 (en) Data transfer control device and data transfer control method
CN114296896A (en) Method, device, computer storage medium and terminal for realizing command scheduling
CN115794446B (en) Message processing method and device, electronic equipment and storage medium
CN111414148A (en) Hybrid FIFO data storage method and device for high-performance processor
CN115840654B (en) Message processing method, system, computing device and readable storage medium
US20050209839A1 (en) Data processing apparatus simulation
US8452920B1 (en) System and method for controlling a dynamic random access memory
CN115148273A (en) Automatic calibration method for test command sequence, test machine, equipment and storage medium
CN109582523B (en) Method and system for effectively analyzing performance of NVMe (network video recorder) module at front end of SSD (solid State drive)
CN114564423A (en) DRAM access system based on mirror image storage
CN112988654A (en) Circuit system suitable for Hash algorithm
CN119512995B (en) Arbitration circuit and method for write request
US12254214B2 (en) Input output control device
US20250013378A1 (en) Apparatus and method for controlling nonvolatile memory
CN117742606B (en) DPU chip, message storage module thereof and message copying method
CN119884025B (en) Row activation method, DDR controller and system on chip
US11704218B2 (en) Information processing apparatus and information processing method to analyze a state of dynamic random access memory (DRAM)
US9583158B2 (en) Method of managing requests for access to memories and data storage system
CN112965816B (en) Memory Management Technology and Computer System

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