CN117851312B - Data reading system, electronic component, electronic device and data reading method - Google Patents
Data reading system, electronic component, electronic device and data reading method Download PDFInfo
- Publication number
- CN117851312B CN117851312B CN202410257132.6A CN202410257132A CN117851312B CN 117851312 B CN117851312 B CN 117851312B CN 202410257132 A CN202410257132 A CN 202410257132A CN 117851312 B CN117851312 B CN 117851312B
- Authority
- CN
- China
- Prior art keywords
- request
- related information
- fifo
- target
- storage unit
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/20—Handling requests for interconnection or transfer for access to input/output bus
- G06F13/28—Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Bus Control (AREA)
- Communication Control (AREA)
Abstract
Description
技术领域Technical Field
本公开涉及数据处理技术领域,尤其涉及一种数据读取系统、电子组件、电子设备及数据读取方法。The present disclosure relates to the field of data processing technology, and in particular to a data reading system, an electronic component, an electronic device, and a data reading method.
背景技术Background technique
现有的AXI(Advanced eXtensible Interface )总线协议支持乱序传输,所谓乱序传输是指:从机针对携带不同请求ID(即arid)的多个读请求,可以不按照多个读请求的接收顺序向主机返回每个读请求的请求结果。比如从机依次接收到读请求a和读请求b,读请求a携带的arid与读请求b携带的arid是不同的,如果从机率先准备好读请求b对应的请求结果,则从机可以先将读请求b的请求结果返回给主机,之后在准备好读请求a对应的请求结果后,再将读请求a的请求结果返回给主机。The existing AXI (Advanced eXtensible Interface) bus protocol supports out-of-order transmission. The so-called out-of-order transmission means that the slave can return the request result of each read request to the host in a non-sequential order for multiple read requests carrying different request IDs (i.e., arid). For example, the slave receives read request a and read request b in sequence, and the arid carried by read request a is different from the arid carried by read request b. If the slave prepares the request result corresponding to read request b first, the slave can first return the request result of read request b to the host, and then return the request result of read request a to the host after preparing the request result corresponding to read request a.
现有的AXI总线协议并没有与DMA(Direct Memory Access直接内存访问)有效结合,导致DMA的功能单一。The existing AXI bus protocol is not effectively combined with DMA (Direct Memory Access), resulting in a single DMA function.
发明内容Summary of the invention
本公开的目的是提供一种数据读取系统、电子组件、电子设备及数据读取方法,对AXI总线协议与DMA进行有效结合,解决DMA功能单一的问题。The purpose of the present disclosure is to provide a data reading system, an electronic component, an electronic device and a data reading method, which effectively combine the AXI bus protocol with DMA to solve the problem of single DMA function.
根据本公开的一个方面,提供一种数据读取系统,所述系统包括DMA,所述DMA包括:多个第一存储单元、第二FIFO及控制电路;According to one aspect of the present disclosure, there is provided a data reading system, the system comprising a DMA, the DMA comprising: a plurality of first storage units, a second FIFO and a control circuit;
所述控制电路被配置为在接收到任一DMA通道发送的AXI读请求后,将请求相关信息存入该DMA通道对应的所述第一存储单元,所述请求相关信息用于表征所述AXI读请求未处理完毕,不同DMA通道发送的AXI读请求具有不同的请求ID;将所述AXI读请求发送给从机;将从机返回的请求结果存入所述第二FIFO;The control circuit is configured to, after receiving an AXI read request sent by any DMA channel, store request related information in the first storage unit corresponding to the DMA channel, wherein the request related information is used to indicate that the AXI read request has not been processed, and AXI read requests sent by different DMA channels have different request IDs; send the AXI read request to the slave; and store the request result returned by the slave in the second FIFO;
所述控制电路还被配置为根据目标请求结果的目标请求ID,从所述目标请求ID对应的第一存储单元中清除或读取出所述目标请求ID对应的请求相关信息,并从所述第二FIFO中读取出所述目标请求结果,将所述目标请求结果发送给相应DMA通道的下游模块;其中,所述目标请求结果是未读取的请求结果中最早被接收到的请求结果。The control circuit is also configured to clear or read out request-related information corresponding to the target request ID from the first storage unit corresponding to the target request ID according to the target request ID of the target request result, read out the target request result from the second FIFO, and send the target request result to the downstream module of the corresponding DMA channel; wherein the target request result is the earliest received request result among the unread request results.
本公开一种可行的实现方式中,所述请求相关信息包括所述AXI请求的请求ID,所述控制电路在从所述目标请求ID对应的第一存储单元中清除或读取出所述目标请求ID对应的请求相关信息时,具体被配置为:In a feasible implementation of the present disclosure, the request related information includes a request ID of the AXI request, and when the control circuit clears or reads the request related information corresponding to the target request ID from the first storage unit corresponding to the target request ID, it is specifically configured as follows:
判断每个第一存储单元中最先存入的请求相关信息中是否包含所述目标请求ID,从而查询出所述目标请求ID对应的第一存储单元;Determine whether the request related information first stored in each first storage unit contains the target request ID, thereby querying the first storage unit corresponding to the target request ID;
从所述目标请求ID对应的第一存储单元中清除或读取出包含所述目标请求ID的请求相关信息。The request related information including the target request ID is cleared or read out from the first storage unit corresponding to the target request ID.
本公开一种可行的实现方式中,所述DMA还包括第三FIFO,所述第三FIFO用于存储请求结果对应的请求ID;所述控制电路在判断每个第一存储单元中最先存入的请求相关信息中是否包含所述目标请求ID时,具体被配置为:In a feasible implementation of the present disclosure, the DMA further includes a third FIFO, and the third FIFO is used to store a request ID corresponding to the request result; when the control circuit determines whether the request related information first stored in each first storage unit includes the target request ID, the control circuit is specifically configured as follows:
读取第三FIFO的读指针当前指向的表项中存储的请求ID,并更新第三FIFO的读指针;判断每个第一存储单元中最先存入的请求相关信息中是否包含该请求ID。The request ID stored in the entry currently pointed to by the read pointer of the third FIFO is read, and the read pointer of the third FIFO is updated; and it is determined whether the request related information first stored in each first storage unit includes the request ID.
本公开一种可行的实现方式中,所述控制电路还被配置为:In a feasible implementation of the present disclosure, the control circuit is further configured as follows:
针对当前正在被接收的请求结果,在接收到该请求结果对应的传输完成信号last后,将该请求结果对应的请求ID存入所述第三FIFO。For the request result currently being received, after receiving the transmission completion signal last corresponding to the request result, the request ID corresponding to the request result is stored in the third FIFO.
本公开一种可行的实现方式中,所述请求相关信息中还包括拍数arlen,所述控制电路在从所述第二FIFO中读取出所述目标请求结果时,具体被配置为:In a feasible implementation of the present disclosure, the request related information also includes a beat number arlen, and when the control circuit reads the target request result from the second FIFO, it is specifically configured as follows:
根据所述拍数arlen,从所述第二FIFO中读取出最先存入的所述拍数arlen个请求结果。According to the beat number arlen, the first stored request results of the beat number arlen are read out from the second FIFO.
本公开一种可行的实现方式中,每个AXI读请求的请求ID的预设数据位用于表示发送该AXI读请求的DMA通道。In a feasible implementation of the present disclosure, a preset data bit of the request ID of each AXI read request is used to indicate a DMA channel that sends the AXI read request.
本公开一种可行的实现方式中,所述控制电路在将所述目标请求结果发送给相应DMA通道的下游模块时,具体被配置为:In a feasible implementation of the present disclosure, when the control circuit sends the target request result to the downstream module of the corresponding DMA channel, it is specifically configured as follows:
根据所述目标请求ID的所述预设数据位,将所述目标请求结果发送给该预设数据位表示的DMA通道的下游模块。According to the preset data bit of the target request ID, the target request result is sent to a downstream module of the DMA channel represented by the preset data bit.
本公开一种可行的实现方式中,所述DMA还包括第四FIFO,所述第四FIFO用于存储每个DMA通道的AXI读请求的请求相关信息;所述控制电路还用于:在接收到任一DMA通道发送的AXI读请求后,将请求相关信息存入所述第四FIFO;所述请求相关信息中包括所述AXI读请求的请求ID和拍数arlen;In a feasible implementation of the present disclosure, the DMA further includes a fourth FIFO, and the fourth FIFO is used to store request related information of the AXI read request of each DMA channel; the control circuit is further used to: after receiving the AXI read request sent by any DMA channel, store the request related information into the fourth FIFO; the request related information includes the request ID and the beat number arlen of the AXI read request;
所述控制电路在将请求相关信息存入该DMA通道对应的所述第一存储单元时,具体被配置为:When the control circuit stores the request related information into the first storage unit corresponding to the DMA channel, the control circuit is specifically configured as follows:
读取出所述第四FIFO中最先存入的请求相关信息,并根据读取出的请求相关信息所包含的请求ID的所述预设数据位,将所述请求相关信息存入该预设数据位表示的DMA通道所对应的第一存储单元。The request related information first stored in the fourth FIFO is read out, and according to the preset data bit of the request ID contained in the read request related information, the request related information is stored in the first storage unit corresponding to the DMA channel represented by the preset data bit.
本公开一种可行的实现方式中,每个第一存储单元的深度均等于1。In a feasible implementation of the present disclosure, the depth of each first storage unit is equal to 1.
根据本公开的另一方面,还提供一种电子组件,该电子组件包括上述任一实施例中所述的数据读取系统。在一些使用场景下,该电子组件的产品形式体现为显卡;在另一些使用场景下,该电子组件的产品形式体现为CPU主板。According to another aspect of the present disclosure, an electronic component is also provided, which includes the data reading system described in any of the above embodiments. In some usage scenarios, the product form of the electronic component is embodied as a graphics card; in other usage scenarios, the product form of the electronic component is embodied as a CPU motherboard.
根据本公开的另一方面,还提供一种电子设备,该电子设备包括上述的电子组件。在一些使用场景下,该电子设备的产品形式是便携式电子设备,例如智能手机、平板电脑、VR设备等;在一些使用场景下,该电子设备的产品形式是个人电脑、游戏主机等。According to another aspect of the present disclosure, an electronic device is also provided, the electronic device comprising the above-mentioned electronic component. In some usage scenarios, the product form of the electronic device is a portable electronic device, such as a smart phone, a tablet computer, a VR device, etc.; in some usage scenarios, the product form of the electronic device is a personal computer, a game console, etc.
根据本公开的另一方面,还提供一种数据读取方法,所述方法包括:According to another aspect of the present disclosure, a data reading method is further provided, the method comprising:
在接收到任一DMA通道发送的AXI读请求后,将请求相关信息存入该DMA通道对应的第一存储单元,所述请求相关信息用于表征所述AXI读请求未处理完毕,不同DMA通道发送的AXI读请求具有不同的请求ID;After receiving an AXI read request sent by any DMA channel, storing request related information in a first storage unit corresponding to the DMA channel, wherein the request related information is used to indicate that the AXI read request has not been processed, and AXI read requests sent by different DMA channels have different request IDs;
将所述AXI读请求发送给从机;Sending the AXI read request to the slave;
将从机返回的请求结果存入第二FIFO;Store the request result returned by the slave into the second FIFO;
根据目标请求结果的目标请求ID,从目标请求ID对应的第一存储单元中清除或读取出所述目标请求ID对应的请求相关信息,并从所述第二FIFO中读取出所述目标请求结果,将所述目标请求结果发送给相应DMA通道的下游模块;其中,所述目标请求结果是未读取的请求结果中最早被所述DMA接收到的请求结果。According to the target request ID of the target request result, the request related information corresponding to the target request ID is cleared or read from the first storage unit corresponding to the target request ID, and the target request result is read from the second FIFO, and the target request result is sent to the downstream module of the corresponding DMA channel; wherein, the target request result is the earliest request result received by the DMA among the unread request results.
本公开一种可行的实现方式中,所述请求相关信息包括所述AXI请求的请求ID,所述从目标请求ID对应的第一存储单元中清除或读取出所述目标请求ID对应的请求相关信息,包括:In a feasible implementation of the present disclosure, the request related information includes a request ID of the AXI request, and clearing or reading the request related information corresponding to the target request ID from the first storage unit corresponding to the target request ID includes:
判断每个第一存储单元中最先存入的请求相关信息中是否包含所述目标请求ID,从而查询出所述目标请求ID对应的第一存储单元;Determine whether the request related information first stored in each first storage unit contains the target request ID, thereby querying the first storage unit corresponding to the target request ID;
从所述目标请求ID对应的第一存储单元中清除或读取出包含所述目标请求ID的请求相关信息。The request related information including the target request ID is cleared or read out from the first storage unit corresponding to the target request ID.
本公开一种可行的实现方式中,所述判断每个第一存储单元中最先存入的请求相关信息中是否包含所述目标请求ID,包括:In a feasible implementation of the present disclosure, the determining whether the request related information first stored in each first storage unit contains the target request ID includes:
读取第三FIFO的读指针当前指向的表项中存储的请求ID,并更新第三FIFO的读指针;判断每个第一存储单元中最先存入的请求相关信息中是否包含该请求ID;其中,所述第三FIFO用于存储请求结果对应的请求ID。Read the request ID stored in the table entry currently pointed to by the read pointer of the third FIFO, and update the read pointer of the third FIFO; determine whether the request related information first stored in each first storage unit contains the request ID; wherein the third FIFO is used to store the request ID corresponding to the request result.
本公开一种可行的实现方式中,所述方法还包括:In a feasible implementation of the present disclosure, the method further includes:
针对当前正在被接收的请求结果,在接收到该请求结果对应的传输完成信号last后,将该请求结果对应的请求ID存入所述第三FIFO。For the request result currently being received, after receiving the transmission completion signal last corresponding to the request result, the request ID corresponding to the request result is stored in the third FIFO.
本公开一种可行的实现方式中,所述请求相关信息中还包括拍数arlen,所述从所述第二FIFO中读取出所述目标请求结果,包括:In a feasible implementation of the present disclosure, the request related information also includes a beat number arlen, and reading the target request result from the second FIFO includes:
根据所述拍数arlen,从所述第二FIFO中读取出最先存入的所述拍数arlen个请求结果。According to the beat number arlen, the first stored request results of the beat number arlen are read out from the second FIFO.
本公开一种可行的实现方式中,每个AXI读请求的请求ID的预设数据位用于表示发送该AXI读请求的DMA通道。In a feasible implementation of the present disclosure, a preset data bit of the request ID of each AXI read request is used to indicate a DMA channel that sends the AXI read request.
本公开一种可行的实现方式中,所述将所述目标请求结果发送给相应DMA通道的下游模块,包括:In a feasible implementation of the present disclosure, sending the target request result to a downstream module of the corresponding DMA channel includes:
根据所述目标请求ID的所述预设数据位,将所述目标请求结果发送给该预设数据位表示的DMA通道的下游模块。According to the preset data bit of the target request ID, the target request result is sent to a downstream module of the DMA channel represented by the preset data bit.
本公开一种可行的实现方式中,所述将所述AXI读请求的请求相关信息存入该DMA通道对应的第一存储单元,包括:In a feasible implementation of the present disclosure, storing the request related information of the AXI read request into the first storage unit corresponding to the DMA channel includes:
读取出第四FIFO中最先存入的请求相关信息;其中,所述第四FIFO用于存储每个DMA通道的AXI读请求的请求相关信息;Read out the request related information first stored in the fourth FIFO; wherein the fourth FIFO is used to store the request related information of the AXI read request of each DMA channel;
根据读取出的请求相关信息所包含的请求ID的所述预设数据位,将所述请求相关信息存入该预设数据位表示的DMA通道所对应的第一存储单元。According to the preset data bit of the request ID included in the read request related information, the request related information is stored in a first storage unit corresponding to the DMA channel represented by the preset data bit.
本公开一种可行的实现方式中,每个第一存储单元的深度均等于1。In a feasible implementation of the present disclosure, the depth of each first storage unit is equal to 1.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本公开一实施例提出的数据读取系统的结构示意图;FIG1 is a schematic diagram of the structure of a data reading system proposed in an embodiment of the present disclosure;
图2是本公开另一实施例提出的数据读取系统的结构示意图;FIG2 is a schematic diagram of the structure of a data reading system proposed in another embodiment of the present disclosure;
图3是本公开另一实施例提出的数据读取系统的结构示意图;FIG3 is a schematic diagram of the structure of a data reading system proposed in another embodiment of the present disclosure;
图4是本公开一实施例提供的数据读取方法的流程示意图。FIG. 4 is a schematic flow chart of a data reading method provided in an embodiment of the present disclosure.
具体实施方式Detailed ways
在介绍本公开实施例之前,应当说明的是:Before introducing the embodiments of the present disclosure, it should be noted that:
本公开部分实施例被描述为处理流程,虽然流程的各个操作步骤可能被冠以顺序的步骤编号,但是其中的操作步骤可以被并行地、并发地或者同时实施。Some embodiments of the present disclosure are described as processing flows. Although the various operation steps of the flow may be given sequential step numbers, the operation steps therein may be implemented in parallel, concurrently or simultaneously.
本公开实施例中可能使用了术语“第一”、“第二”等等来描述各个特征,但是这些特征不应当受这些术语限制。使用这些术语仅仅是为了将一个特征与另一个特征进行区分。In the embodiments of the present disclosure, the terms "first", "second", etc. may be used to describe various features, but these features should not be limited by these terms. These terms are used only to distinguish one feature from another.
本公开实施例中可能使用了术语“和/或”,“和/或”包括其中一个或更多所列出的相关联特征的任意和所有组合。The term “and/or” may be used in embodiments of the present disclosure. “And/or” includes any and all combinations of one or more of the associated features listed.
应当理解的是,当描述两个部件的连接关系或通信关系时,除非明确指明两个部件之间直接连接或直接通信,否则,两个部件的连接或通信可以理解为直接连接或通信,也可以理解为通过中间部件间接连接或通信。It should be understood that when describing the connection or communication relationship between two components, unless it is explicitly stated that the two components are directly connected or directly communicating, the connection or communication between the two components can be understood as direct connection or communication, or as indirect connection or communication through an intermediate component.
为了使本公开实施例中的技术方案及优点更加清楚明白,以下结合附图对本公开的示例性实施例进行进一步详细的说明,显然,所描述的实施例仅是本公开的一部分实施例,而不是所有实施例的穷举。需要说明的是,在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。In order to make the technical solutions and advantages of the embodiments of the present disclosure more clearly understood, the exemplary embodiments of the present disclosure are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments and features in the embodiments of the present disclosure can be combined with each other without conflict.
考虑到现有技术中并没有对AXI总线协议与DMA进行有效结合,导致DMA存在功能单一的问题,本公开提供一种数据读取系统。参考图1,图1是本公开一实施例提出的数据读取系统的结构示意图,如图1所示,该数据读取系统包括DMA,DMA包括多个第一存储单元,DMA还包括第二FIFO(First Input First Output,先进先出)和控制电路(图1中未示出控制电路)。Considering that the AXI bus protocol and DMA are not effectively combined in the prior art, resulting in the problem of single function of DMA, the present disclosure provides a data reading system. Referring to FIG1 , FIG1 is a structural schematic diagram of a data reading system proposed in an embodiment of the present disclosure. As shown in FIG1 , the data reading system includes DMA, the DMA includes multiple first storage units, and the DMA also includes a second FIFO (First Input First Output) and a control circuit (the control circuit is not shown in FIG1 ).
本公开中,每个第一存储单元分别对应一个DMA通道,每个第一存储单元用于存储相应DMA通道的AXI读请求的请求相关信息,请求相关信息用于表征所述AXI读请求未处理完毕。其中,AXI读请求是指基于AXI协议的读数据请求,用于读取从机侧的数据。每个第一存储单元的深度均等于1,例如每个第一存储单元可以是深度为1的FIFO,每个第一存储单元仅最多仅能存储一个AXI读请求的请求相关信息。具体而言,当一个AXI读请求的请求相关信息从第一存储单元中被清除后或者被读取出来后,控制电路才能将下一个AXI读请求的请求相关信息存入第一存储单元,并将下一个AXI读请求发送给从机。In the present disclosure, each first storage unit corresponds to a DMA channel, and each first storage unit is used to store request-related information of an AXI read request of a corresponding DMA channel, and the request-related information is used to characterize that the AXI read request has not been processed. Among them, an AXI read request refers to a read data request based on the AXI protocol, which is used to read data from the slave side. The depth of each first storage unit is equal to 1. For example, each first storage unit can be a FIFO with a depth of 1, and each first storage unit can only store request-related information of at most one AXI read request. Specifically, when the request-related information of an AXI read request is cleared or read out from the first storage unit, the control circuit can store the request-related information of the next AXI read request into the first storage unit, and send the next AXI read request to the slave.
本公开中,第二FIFO用于存储每个AXI读请求的请求结果。In the present disclosure, the second FIFO is used to store the request result of each AXI read request.
本公开中,控制电路被配置为:在接收到任一DMA通道发送的AXI读请求后,将请求相关信息存入该DMA通道对应的第一存储单元,该请求相关信息用于表征该AXI读请求未处理完毕,不同DMA通道发送的AXI读请求具有不同的请求ID;将该AXI读请求发送给从机;将从机返回的请求结果存入第二FIFO;In the present disclosure, the control circuit is configured to: after receiving an AXI read request sent by any DMA channel, store the request related information in a first storage unit corresponding to the DMA channel, the request related information is used to indicate that the AXI read request has not been processed, and the AXI read requests sent by different DMA channels have different request IDs; send the AXI read request to the slave; store the request result returned by the slave in the second FIFO;
控制电路还被配置为根据目标请求结果的目标请求ID,从目标请求ID对应的第一存储单元中清除或读取出目标请求ID对应的请求相关信息,并从第二FIFO中读取出目标请求结果,将目标请求结果发送给相应DMA通道的下游模块;其中,目标请求结果是未读取的请求结果中最早被接收到的请求结果。The control circuit is also configured to clear or read request related information corresponding to the target request ID from the first storage unit corresponding to the target request ID according to the target request ID of the target request result, read the target request result from the second FIFO, and send the target request result to the downstream module of the corresponding DMA channel; wherein the target request result is the earliest received request result among the unread request results.
需要说明的是,本公开中的控制电路可以是:通过对硬件描述语言HDL编写的代码依次经过综合和布局布线后产生的电路。具体地,可以按照本公开中控制电路所需实现的功能,基于硬件描述语言(例如Verilog语言)编写出能实现相应功能的代码,然后对编写出的代码依次经过综合和布局布线,从而得到本公开中的控制电路。It should be noted that the control circuit in the present disclosure may be a circuit generated by synthesizing and placing and routing the code written in the hardware description language HDL in sequence. Specifically, according to the functions to be implemented by the control circuit in the present disclosure, codes that can implement the corresponding functions may be written based on the hardware description language (such as the Verilog language), and then the written codes may be synthesized and placed and routed in sequence to obtain the control circuit in the present disclosure.
或者,本公开中的控制电路还可以是通用处理器,该通用处理器中存储有用于实现相应功能的代码或指令,该通用处理器通过执行其存储的代码或指令,从而实现本公开中控制电路所需实现的功能。Alternatively, the control circuit in the present disclosure may also be a general-purpose processor, which stores codes or instructions for implementing corresponding functions. The general-purpose processor implements the functions that the control circuit in the present disclosure needs to implement by executing the codes or instructions stored therein.
本公开在实施期间,当DMA的控制电路接收到某个DMA通道发送的AXI读请求后,一方面,控制电路从该AXI读请求中提取出请求相关信息,并将请求相关信息存入该DMA通道对应的第一存储单元,DMA通道存储请求相关信息后,表示该DMA通道的一个AXI读请求正在被处理;另一方面,控制电路作为AXI协议主机的角色,将该AXI读请求发送给相应从机(例如从机可以是内存)。During the implementation of the present disclosure, when the DMA control circuit receives an AXI read request sent by a DMA channel, on the one hand, the control circuit extracts request-related information from the AXI read request and stores the request-related information in a first storage unit corresponding to the DMA channel. After the DMA channel stores the request-related information, it indicates that an AXI read request of the DMA channel is being processed; on the other hand, the control circuit acts as an AXI protocol host and sends the AXI read request to the corresponding slave (for example, the slave may be a memory).
当DMA的控制电路接收到某个从机返回的请求结果后,控制电路将请求结果存入第二FIFO。When the DMA control circuit receives a request result returned by a slave, the control circuit stores the request result in the second FIFO.
此外,DMA的控制电路一方面还从第二FIFO中读取出最先存入的请求结果(即目标请求结果),另一方面,根据该请求结果的请求ID确定该请求ID对应的第一存储单元,并从该第一存储单元中清除或读取出该请求ID对应的请求相关信息;DMA的控制电路还将读取出的请求结果发送给相应DMA通道的下游模块。其中,相应DMA通道是指该请求ID对应的第一存储单元所对应的DMA通道,相应DMA通道的下游模块是指:对于该DMA通道的请求结果存在使用需求的模块。还需要说明的是,第二FIFO是一个先进先出队列,第二FIFO中剩余的请求结果均是未被读取的请求结果,第二FIFO中最先存入的请求结果,即是未读取的请求结果中最早被接收到的请求结果(即所述目标请求结果)。In addition, the DMA control circuit also reads the first stored request result (i.e., the target request result) from the second FIFO on the one hand, and determines the first storage unit corresponding to the request ID according to the request ID of the request result on the other hand, and clears or reads the request related information corresponding to the request ID from the first storage unit; the DMA control circuit also sends the read request result to the downstream module of the corresponding DMA channel. Among them, the corresponding DMA channel refers to the DMA channel corresponding to the first storage unit corresponding to the request ID, and the downstream module of the corresponding DMA channel refers to: a module that has a use demand for the request result of the DMA channel. It should also be noted that the second FIFO is a first-in-first-out queue, and the remaining request results in the second FIFO are all unread request results. The request result first stored in the second FIFO is the earliest received request result among the unread request results (i.e., the target request result).
本公开中,不同的DMA通道发送的AXI读请求具有不同的请求ID,从机基于AXI协议的乱序传输特性,可以乱序地向DMA返回不同DMA通道发送的AXI读请求的请求结果。进一步的,本公开中不同DMA通道分别对应不同的第一存储单元,而不是将多个DMA通道的请求相关信息存入同一个第一存储单元,因此DMA不会受到第一存储单元先进先出机制的限制,也可以乱序向下游模块返回不同DMA通道发送的AXI读请求的请求结果。In the present disclosure, the AXI read requests sent by different DMA channels have different request IDs, and the slave can return the request results of the AXI read requests sent by different DMA channels to the DMA in a disorderly manner based on the disorderly transmission characteristics of the AXI protocol. Furthermore, in the present disclosure, different DMA channels correspond to different first storage units respectively, instead of storing the request-related information of multiple DMA channels in the same first storage unit, so the DMA will not be limited by the first-in-first-out mechanism of the first storage unit, and can also return the request results of the AXI read requests sent by different DMA channels to the downstream module in a disorderly manner.
对于同一个DMA通道(比如通道CH0)而言,由于第一存储单元的深度等于1,当该DMA通道一个AXI读请求的请求相关信息从第一存储单元中读取出来后(伴随着将该AXI读请求的请求结果发送给该DMA通道的下游模块),控制电路才能将该DMA通道的下一个AXI读请求的请求相关信息存入第一存储单元,并将下一个AXI读请求发送给从机。因此,对于同一DMA通道的各个AXI读请求,DMA会按序返回各个AXI读请求的请求结果。For the same DMA channel (such as channel CH0), since the depth of the first storage unit is equal to 1, after the request-related information of an AXI read request of the DMA channel is read out from the first storage unit (accompanied by sending the request result of the AXI read request to the downstream module of the DMA channel), the control circuit can store the request-related information of the next AXI read request of the DMA channel into the first storage unit and send the next AXI read request to the slave. Therefore, for each AXI read request of the same DMA channel, DMA will return the request results of each AXI read request in sequence.
简言之,本公开的DMA同时兼具乱序传输能力和按序传输能力,具有更强的适应性,当应用程序对请求结果存在保序要求时,可以调用同一个DMA通道向DMA依次发送多个AXI读请求;当应用程序对请求结果不存在保序要求时,可以调用多个DMA通道向DMA发送多个AXI读请求,从而可以更快速地获得多个请求结果。In short, the DMA disclosed in the present invention has both out-of-order transmission capabilities and in-order transmission capabilities, and has stronger adaptability. When the application has order-preserving requirements for the request results, the same DMA channel can be called to send multiple AXI read requests to the DMA in sequence; when the application has no order-preserving requirements for the request results, multiple DMA channels can be called to send multiple AXI read requests to the DMA, so that multiple request results can be obtained more quickly.
为便于理解,示例性地,如图1所示,DMA包括4个第一存储单元,分别为第一存储单元-0、第一存储单元-1、第一存储单元-2及第一存储单元-3,这4个第一存储单元对应的DMA通道分别为CH0、CH1、CH2及CH3,DMA还包括1个第二FIFO。For ease of understanding, illustratively, as shown in Figure 1, the DMA includes four first storage units, namely the first storage unit-0, the first storage unit-1, the first storage unit-2 and the first storage unit-3, and the DMA channels corresponding to these four first storage units are CH0, CH1, CH2 and CH3, respectively. The DMA also includes a second FIFO.
假设在第一时刻,DMA的控制电路通过CH0接收到AXI读请求a,控制电路将AXI读请求a的请求相关信息a’存入第一存储单元-0,并将AXI读请求a发送给从机;请求相关信息a’中包括请求ID,该请求ID是arid-a。Assume that at the first moment, the DMA control circuit receives an AXI read request a through CH0, the control circuit stores the request related information a' of the AXI read request a into the first storage unit -0, and sends the AXI read request a to the slave; the request related information a' includes a request ID, which is arid-a.
假设在第二时刻(第二时刻晚于第一时刻),DMA的控制电路通过CH2接收到AXI读请求b,控制电路将AXI读请求b的请求相关信息b’存入第一存储单元-2,并将AXI读请求b发送给从机;请求相关信息b’中包括请求ID,该请求ID是arid-b。Assume that at a second moment (the second moment is later than the first moment), the DMA control circuit receives an AXI read request b through CH2, the control circuit stores the request related information b' of the AXI read request b into the first storage unit -2, and sends the AXI read request b to the slave; the request related information b' includes a request ID, which is arid-b.
假设在第三时刻(第三时刻晚于第二时刻),DMA的控制电路接收到请求结果b’’,控制电路将请求结果b’’存入第二FIFO(假设此时第二FIFO是空的),请求结果b’’携带有请求ID,该请求ID是rid-b(在AXI协议中,请求结果携带的rid与相应AXI读请求携带的arid是相同的字符串或二进制串)。Assume that at the third moment (the third moment is later than the second moment), the DMA control circuit receives the request result b'', and the control circuit stores the request result b'' in the second FIFO (assuming that the second FIFO is empty at this time). The request result b'' carries the request ID, which is rid-b (in the AXI protocol, the rid carried by the request result and the arid carried by the corresponding AXI read request are the same string or binary string).
假设在第四时刻(第四时刻晚于第三时刻),DMA的控制电路接收到请求结果a’’,控制电路将请求结果a’’存入第二FIFO,请求结果a’’携带有请求ID,该请求ID是rid-a。Assume that at the fourth moment (the fourth moment is later than the third moment), the DMA control circuit receives the request result a'', and the control circuit stores the request result a'' in the second FIFO. The request result a'' carries the request ID, which is rid-a.
需要说明的是,在第三时刻之后,DMA的控制电路会从第二FIFO中读取出最先存入的请求结果(即请求结果b’’),并根据请求结果b’’的请求ID(即rid-b),从第一存储单元-2中读取出包含rid-b的请求相关信息b,并且控制电路还会将请求结果b’’发送给CH2的下游模块。本公开中,由于CH2的AXI读请求b的相关请求信息b’与CH0的AXI读请求a的相关请求信息a’分别存入不同的第一存储单元,因此虽然相关请求信息a’先被存入第一存储单元-0,相关请求信息b’后被存入第一存储单元-2,也不影响先将相关请求信息b’从第一存储单元-2读取出。可见,本公开中的DMA具有乱序传输的能力。It should be noted that after the third moment, the DMA control circuit will read the first stored request result (i.e., request result b'') from the second FIFO, and read the request related information b including rid-b from the first storage unit-2 according to the request ID (i.e., rid-b) of the request result b'', and the control circuit will also send the request result b'' to the downstream module of CH2. In the present disclosure, since the relevant request information b' of the AXI read request b of CH2 and the relevant request information a' of the AXI read request a of CH0 are respectively stored in different first storage units, although the relevant request information a' is first stored in the first storage unit-0 and the relevant request information b' is later stored in the first storage unit-2, it does not affect the relevant request information b' being read out from the first storage unit-2 first. It can be seen that the DMA in the present disclosure has the ability of out-of-order transmission.
还需要说明的是,DMA的控制电路可以通过某种信号(比如指针,本公开不限定该信号的具体选择)表示第一存储单元-2已经被填满,从而限制CH2不能再向DMA发送AXI读请求。It should also be noted that the DMA control circuit can indicate through a certain signal (such as a pointer, the present disclosure does not limit the specific selection of the signal) that the first storage unit-2 has been filled, thereby restricting CH2 from sending AXI read requests to the DMA.
又假设在第五时刻(第五时刻晚于第三时刻),DMA的控制电路通过CH2接收到AXI读请求c,控制电路将AXI读请求c的请求相关信息c存入第一存储单元-2,并将AXI读请求c发送给从机;请求相关信息c中包括请求ID,该请求ID是arid-c。Assume that at the fifth moment (the fifth moment is later than the third moment), the DMA control circuit receives an AXI read request c through CH2, the control circuit stores the request related information c of the AXI read request c into the first storage unit -2, and sends the AXI read request c to the slave; the request related information c includes a request ID, which is arid-c.
假设在第六时刻(第六时刻晚于第五时刻,且晚于第四时刻),DMA的控制电路接收到请求结果c,控制电路将请求结果c存入第二FIFO,请求结果c携带有请求ID,该请求ID是rid-c。Assume that at the sixth moment (the sixth moment is later than the fifth moment and later than the fourth moment), the DMA control circuit receives the request result c, and the control circuit stores the request result c into the second FIFO. The request result c carries a request ID, which is rid-c.
在第六时刻之后,假设此时第二FIFO还包括请求结果a和请求结果c,则DMA的控制电路先从第二FIFO中读取出请求结果a,并根据请求结果a的请求ID(即rid-a),从第一存储单元-0中读取出包含rid-a的请求相关信息a,并且控制电路还会将请求结果a发送给CH0的下游模块;然后控制电路从第二FIFO中读取出请求结果c,并根据请求结果c的请求ID(即rid-c),从第一存储单元-2中读取出包含rid-c的请求相关信息c,并且控制电路还会将请求结果c发送给CH2的下游模块。可见,对于CH2的AXI读请求b和AXI读请求c,DMA按序返回了这两个AXI读请求的请求结果。总言之,本公开中的DMA对于同一DMA通道的多个AXI读请求而言,具有按序传输的能力。After the sixth moment, assuming that the second FIFO also includes request result a and request result c at this time, the control circuit of the DMA first reads the request result a from the second FIFO, and reads the request related information a containing rid-a from the first storage unit-0 according to the request ID of the request result a (i.e., rid-a), and the control circuit also sends the request result a to the downstream module of CH0; then the control circuit reads the request result c from the second FIFO, and reads the request related information c containing rid-c from the first storage unit-2 according to the request ID of the request result c (i.e., rid-c), and the control circuit also sends the request result c to the downstream module of CH2. It can be seen that for the AXI read request b and AXI read request c of CH2, the DMA returns the request results of the two AXI read requests in sequence. In summary, the DMA in the present disclosure has the ability to transmit in sequence for multiple AXI read requests of the same DMA channel.
在一些具体实施方式中,请求相关信息包括所述AXI请求的请求ID,控制电路在从目标请求ID对应的第一存储单元中清除或读取出目标请求ID对应的请求相关信息时,具体被配置为:判断每个第一存储单元中最先存入的请求相关信息中是否包含目标请求ID,从而查询出目标请求ID对应的第一存储单元;从目标请求ID对应的第一存储单元中清除或读取出包含目标请求ID的请求相关信息。In some specific embodiments, the request-related information includes the request ID of the AXI request. When the control circuit clears or reads the request-related information corresponding to the target request ID from the first storage unit corresponding to the target request ID, it is specifically configured to: determine whether the request-related information first stored in each first storage unit contains the target request ID, thereby querying the first storage unit corresponding to the target request ID; clear or read the request-related information containing the target request ID from the first storage unit corresponding to the target request ID.
具体而言,对于第一存储单元的深度大于1的情况,即第一存储单元中可以同时存储多份请求相关信息的情况,控制电路以目标请求ID为查询依据,查询每个第一存储单元中最先存入的请求相关信息中是否包含目标请求ID,然后针对查询到的第一存储单元,读取出该第一存储单元中最先存入的请求相关信息。Specifically, for the case where the depth of the first storage unit is greater than 1, that is, the first storage unit can store multiple request-related information at the same time, the control circuit uses the target request ID as the query basis to query whether the request-related information first stored in each first storage unit contains the target request ID, and then reads out the request-related information first stored in the first storage unit for the queried first storage unit.
对于第一存储单元的深度等于1的情况,即每个第一存储单元中仅可以同时存储一份请求相关信息的情况,控制电路以目标请求ID为查询依据,查询每个第一存储单元中存储的请求相关信息中是否包含目标请求ID,然后针对查询到的第一存储单元,读取出该第一存储单元中存储的请求相关信息。For the case where the depth of the first storage unit is equal to 1, that is, each first storage unit can only store one copy of request-related information at a time, the control circuit uses the target request ID as the query basis to query whether the request-related information stored in each first storage unit contains the target request ID, and then reads out the request-related information stored in the queried first storage unit.
参考图2,图2是本公开另一实施例提出的数据读取系统的结构示意图。如图2所示,在一些具体实施方式中,DMA还包括第三FIFO,第三FIFO用于存储请求结果对应的请求ID。控制电路还用于:针对当前正在被接收的请求结果,在接收到该请求结果对应的传输完成信号last后,将该请求结果对应的请求ID存入第三FIFO。Referring to FIG. 2 , FIG. 2 is a schematic diagram of the structure of a data reading system proposed in another embodiment of the present disclosure. As shown in FIG. 2 , in some specific implementations, the DMA further includes a third FIFO, and the third FIFO is used to store a request ID corresponding to a request result. The control circuit is also used to: for a request result currently being received, after receiving a transmission completion signal last corresponding to the request result, store the request ID corresponding to the request result into the third FIFO.
控制电路在判断每个第一存储单元中最先存入的请求相关信息中是否包含目标请求ID时,具体被配置为:读取第三FIFO的读指针当前指向的表项中存储的请求ID,并更新第三FIFO的读指针;判断每个第一存储单元中最先存入的请求相关信息中是否包含该请求ID。When the control circuit determines whether the request-related information first stored in each first storage unit contains the target request ID, the control circuit is specifically configured to: read the request ID stored in the table entry currently pointed to by the read pointer of the third FIFO, and update the read pointer of the third FIFO; determine whether the request-related information first stored in each first storage unit contains the request ID.
本公开中,请求ID在第三FIFO中的存储顺序,与相应请求结果在第二FIFO中的存储顺序是一致的。第三FIFO中最先存入的请求ID(即读指针当前指向的表项中存储的请求ID)即是目标请求ID。具体而言,DMA的控制电路每接收到一拍(beat)请求结果,将这一拍请求结果存入第二FIFO,当接收到该请求结果对应的传输完成信号last后,将该请求结果对应的请求ID存入第三FIFO。In the present disclosure, the order in which the request IDs are stored in the third FIFO is consistent with the order in which the corresponding request results are stored in the second FIFO. The request ID first stored in the third FIFO (i.e., the request ID stored in the table entry currently pointed to by the read pointer) is the target request ID. Specifically, the DMA control circuit stores the request result in the second FIFO for each beat received by the DMA control circuit, and stores the request result in the third FIFO after receiving the transmission completion signal last corresponding to the request result.
为便于理解,示例性地,如图2所示,当前第三FIFO中最先存入的请求ID是rid-c;其次是rid-d;最晚存入的请求ID是rid-e。当前第二FIFO中最先存入的请求结果是多拍请求结果c,每一拍请求结果c占用第二FIFO的一个深度(即第二FIFO的一个entry);其次是多拍请求结果d,每一拍请求结果d占用第二FIFO的一个深度;再其次是多拍请求结果e,每一拍请求结果e占用第二FIFO的一个深度;最晚存入的请求结果是多拍请求结果f,每一拍请求结果f占用第二FIFO的一个深度,由于DMA的控制电路当前还没有收到请求结果f对应的传输完成信号last,因此控制电路暂时还未将请求结果f对应的请求ID(即rid-f)存入第三FIFO。For ease of understanding, exemplarily, as shown in FIG2 , the first request ID stored in the third FIFO is rid-c; the second is rid-d; the last request ID stored is rid-e. The first request result stored in the second FIFO is the multi-beat request result c, and each request result c occupies a depth of the second FIFO (i.e., an entry of the second FIFO); the second is the multi-beat request result d, and each request result d occupies a depth of the second FIFO; the third is the multi-beat request result e, and each request result e occupies a depth of the second FIFO; the last request result stored is the multi-beat request result f, and each request result f occupies a depth of the second FIFO. Since the DMA control circuit has not yet received the transmission completion signal last corresponding to the request result f, the control circuit has not yet stored the request ID (i.e., rid-f) corresponding to the request result f in the third FIFO.
当前控制电路需要从第三FIFO中读取出读指针当前指向的表项中存储的请求ID(即最先存入的请求ID(即rid-c)),然后以rid-c为查询依据,判断每个第一存储单元中最先存入的请求相关信息中是否包含rid-c。假设第一存储单元-2中最先存入的请求相关信息c中包含rid-c,则从第一存储单元-2中读取出包含rid-c的请求相关信息c,并且从第二FIFO中读取出每一拍请求结果c,然后将每一拍请求结果c发送给CH2的下游模块。需要说明的是,当rid-c从第三FIFO中被读取出后,按照FIFO先入先出的固有特性,第三FIFO中最先存入的请求ID变为rid-d。The current control circuit needs to read the request ID stored in the table entry currently pointed to by the read pointer from the third FIFO (i.e., the first stored request ID (i.e., rid-c)), and then use rid-c as the query basis to determine whether the first stored request related information in each first storage unit contains rid-c. Assuming that the first stored request related information c in the first storage unit-2 contains rid-c, the request related information c containing rid-c is read from the first storage unit-2, and each request result c is read from the second FIFO, and then each request result c is sent to the downstream module of CH2. It should be noted that after rid-c is read out from the third FIFO, according to the inherent characteristics of FIFO first-in first-out, the first stored request ID in the third FIFO becomes rid-d.
在一些具体实施方式中,DMA的控制电路在接收到每一拍请求结果时,将这一拍请求结果及相应的rid存入第二FIFO的一个entry。当需要从第二FIFO中读取请求结果时,按照请求结果存入第二FIFO的先后顺序,依次判断每个entry中的rid是否与目标请求ID一致,如果一致,则读取出该entry中的请求结果和rid。In some specific implementations, when receiving each request result, the DMA control circuit stores the request result and the corresponding rid in an entry of the second FIFO. When the request result needs to be read from the second FIFO, the rid in each entry is determined to be consistent with the target request ID in the order in which the request results are stored in the second FIFO. If they are consistent, the request result and rid in the entry are read out.
或者,在另一些具体实施方式中,请求相关信息中还包括拍数arlen,拍数arlen用于表示相应AXI读请求的请求结果的拍数。为便于理解,示例性地,假设AXI读请求c的拍数arlen等于32,则表示AXI读请求的请求结果总共有32拍。Alternatively, in some other specific implementations, the request-related information further includes a beat number arlen, and the beat number arlen is used to indicate the beat number of the request result of the corresponding AXI read request. For ease of understanding, illustratively, assuming that the beat number arlen of the AXI read request c is equal to 32, it means that the request result of the AXI read request has a total of 32 beats.
控制电路在从第二FIFO中读取出目标请求结果时,具体用于:根据拍数arlen,从第二FIFO中读取出最先存入的拍数arlen个请求结果。When the control circuit reads the target request result from the second FIFO, it is specifically used to: read out the first stored request results of number arlen from the second FIFO according to the number arlen.
具体而言,DMA的控制电路根据目标请求ID,查询每个第一存储单元中最先存入的请求相关信息中是否包含目标请求ID,从查询出的第一存储单元中读取出包含目标请求ID的请求相关信息,再根据该请求相关信息中包含的拍数arlen信息,从第三FIFO中读取出拍数arlen个请求结果。比如该请求相关信息中包含的拍数arlen为32,则从第三FIFO中读取出最先存入的32拍请求结果。Specifically, the DMA control circuit queries the first request related information stored in each first storage unit according to the target request ID to see whether the target request ID is included, reads the request related information including the target request ID from the queried first storage unit, and then reads the request results with the number of beats arlen from the third FIFO according to the number of beats arlen information included in the request related information. For example, if the number of beats arlen included in the request related information is 32, the first 32 request results stored are read from the third FIFO.
本公开中,通过在请求相关信息中记录拍数arlen信息,在从第二FIFO中读取请求结果时,可以直接根据arlen,从第二FIFO中读取最先存入的arlen拍请求结果。如此,不需要将rid存入第二FIFO的每个entry,从而可以减小第二FIFO的每个entry的位宽,进而减小第二FIFO的面积和硬件成本。In the present disclosure, by recording the beat number arlen information in the request related information, when reading the request result from the second FIFO, the first stored arlen beat request result can be directly read from the second FIFO according to arlen. In this way, there is no need to store rid in each entry of the second FIFO, so that the bit width of each entry of the second FIFO can be reduced, thereby reducing the area and hardware cost of the second FIFO.
在一些具体实施方式中,DMA的控制电路从第三FIFO中读取出最先存入的请求ID(即目标请求ID),在根据目标请求ID查询到存储有目标请求ID的第一存储单元,并从该第一存储单元中读取出包含目标请求ID的请求信息,以及从第二FIFO中读取出目标请求结果后,根据第一存储单元与DMA通道的对应关系,将目标请求结果发送给该第一存储单元对应的DMA通道的下游模块。In some specific embodiments, the DMA control circuit reads the first stored request ID (i.e., the target request ID) from the third FIFO, queries the first storage unit storing the target request ID according to the target request ID, reads the request information including the target request ID from the first storage unit, and reads the target request result from the second FIFO, and then, according to the correspondence between the first storage unit and the DMA channel, sends the target request result to the downstream module of the DMA channel corresponding to the first storage unit.
或者,在另一些具体实施方式中,每个AXI读请求的请求ID的预设数据位用于表示发送该AXI读请求的DMA通道。为便于理解,示例性地,假设每个AXI读请求的请求ID为4位的二进制数,请求ID的低两位arid[1:0]等于00时,表示AXI读请求来自于通道CH0;请求ID的低两位arid[1:0]等于01时,表示AXI读请求来自于通道CH1;请求ID的低两位arid[1:0]等于10时,表示AXI读请求来自于通道CH2;请求ID的低两位arid[1:0]等于11时,表示AXI读请求来自于通道CH3。Alternatively, in some other specific implementations, the preset data bits of the request ID of each AXI read request are used to indicate the DMA channel that sends the AXI read request. For ease of understanding, illustratively, assuming that the request ID of each AXI read request is a 4-bit binary number, when the lower two bits arid[1:0] of the request ID are equal to 00, it indicates that the AXI read request comes from channel CH0; when the lower two bits arid[1:0] of the request ID are equal to 01, it indicates that the AXI read request comes from channel CH1; when the lower two bits arid[1:0] of the request ID are equal to 10, it indicates that the AXI read request comes from channel CH2; when the lower two bits arid[1:0] of the request ID are equal to 11, it indicates that the AXI read request comes from channel CH3.
控制电路在将目标请求结果发送给相应DMA通道的下游模块时,具体用于:根据目标请求ID的预设数据位,将目标请求结果发送给该预设数据位表示的DMA通道的下游模块。When the control circuit sends the target request result to the downstream module of the corresponding DMA channel, it is specifically used to: according to the preset data bit of the target request ID, send the target request result to the downstream module of the DMA channel represented by the preset data bit.
具体而言,DMA的控制电路从第三FIFO中读取出最先存入的请求ID(即目标请求ID),在根据目标请求ID从相应第一存储单元中读取出包含目标请求ID的请求信息,以及从第二FIFO中读取出目标请求结果后,根据目标请求ID的低两位,确定出相应的DMA通道,然后将目标请求结果发送给该DMA通道的下游模块。Specifically, the DMA control circuit reads the first stored request ID (i.e., the target request ID) from the third FIFO, reads the request information including the target request ID from the corresponding first storage unit according to the target request ID, and reads the target request result from the second FIFO, then determines the corresponding DMA channel according to the lower two bits of the target request ID, and then sends the target request result to the downstream module of the DMA channel.
在一些具体实施方式中,如图2所示,DMA还包括第四FIFO,第四FIFO用于存储每个DMA通道的AXI读请求的请求相关信息。控制电路还用于:在接收到任一DMA通道发送的AXI读请求后,将请求相关信息存入第四FIFO;请求相关信息中包括AXI读请求的请求ID和拍数arlen。In some specific implementations, as shown in FIG2 , the DMA further includes a fourth FIFO, and the fourth FIFO is used to store request-related information of the AXI read request of each DMA channel. The control circuit is also used to: after receiving the AXI read request sent by any DMA channel, store the request-related information into the fourth FIFO; the request-related information includes the request ID and the beat number arlen of the AXI read request.
控制电路在将请求相关信息存入该DMA通道对应的第一存储单元时,具体用于:读取出第四FIFO中最先存入的请求相关信息,并根据读取出的请求相关信息所包含的请求ID的预设数据位,将请求相关信息存入该预设数据位表示的DMA通道所对应的第一存储单元。When the control circuit stores the request related information into the first storage unit corresponding to the DMA channel, it is specifically used to: read out the request related information first stored in the fourth FIFO, and according to the preset data bits of the request ID contained in the read request related information, store the request related information into the first storage unit corresponding to the DMA channel represented by the preset data bits.
具体而言,一方面,当DMA的控制电路接收到一个AXI读请求时,读取出该AXI读请求的请求相关信息,并将请求相关信息存入第四FIFO。另一方面,DMA的控制电路从第四FIFO中读取出最先存入的请求相关信息,并根据读取出的请求相关信息中的请求ID的预设数据位(比如arid[1:0]),确定出相应AXI读请求来自的DMA通道,从而将读取的请求相关信息存入该DMA通道对应的第一存储单元。Specifically, on the one hand, when the DMA control circuit receives an AXI read request, it reads out the request related information of the AXI read request and stores the request related information in the fourth FIFO. On the other hand, the DMA control circuit reads out the request related information first stored in the fourth FIFO, and determines the DMA channel from which the corresponding AXI read request comes according to the preset data bits (such as arid[1:0]) of the request ID in the read request related information, thereby storing the read request related information in the first storage unit corresponding to the DMA channel.
在一些具体实施方式中,如图3所示,数据读取系统包括DMA,DMA包括4个第一存储单元,分别为第一存储单元-0、第一存储单元-1、第一存储单元-2及第一存储单元-3,每个第一存储单元的深度等于1,位宽等于15。每个第一存储单元的低四位用于存储arid,其余位用于存储arlen。4个第一存储单元各自对应的DMA通道分别为CH0、CH1、CH2及CH3。In some specific embodiments, as shown in FIG3 , the data reading system includes a DMA, and the DMA includes four first storage units, namely, first storage unit-0, first storage unit-1, first storage unit-2, and first storage unit-3, each of which has a depth of 1 and a bit width of 15. The lower four bits of each first storage unit are used to store arid, and the remaining bits are used to store arlen. The DMA channels corresponding to the four first storage units are CH0, CH1, CH2, and CH3, respectively.
DMA还包括第二FIFO、第三FIFO及第四FIFO。其中,第二FIFO的位宽等于256,与AXI总线协议中每一拍请求结果的位宽相等,第二FIFO的深度depth应足够深,至少应能同时存储4个DMA通道各自的AXI读请求的请求结果。DMA also includes the second FIFO, the third FIFO and the fourth FIFO. The bit width of the second FIFO is equal to 256, which is equal to the bit width of each request result in the AXI bus protocol. The depth of the second FIFO should be deep enough to store at least the request results of the AXI read requests of the four DMA channels at the same time.
第三FIFO的位宽等于3,深度等于4。第三FIFO的每个entry的低两位用于存储rid的低两位(即rid[1:0]),每个entry的最高位用于指示该entry是否存储了rid[1:0],如果存储了rid[1:0],则将该entry的最高位置为1,否则将该entry的最高位置为0。只有当entry的最高位被置位1时,DMA的控制电路才会从该entry读取rid。本实施例中,通过使用每个entry的最高位来表示每个entry是否存储了rid,可以防止控制电路对rid等于00和entry为空这两种情况造成混淆。比如第三FIFO的一个entry为100,则表示等于00的rid已经被填充至该entry。比如FIFO的一个entry为000,则表示该entry为空。The bit width of the third FIFO is equal to 3, and the depth is equal to 4. The lower two bits of each entry of the third FIFO are used to store the lower two bits of rid (i.e., rid[1:0]), and the highest bit of each entry is used to indicate whether the entry stores rid[1:0]. If rid[1:0] is stored, the highest bit of the entry is set to 1, otherwise the highest bit of the entry is set to 0. Only when the highest bit of the entry is set to 1, the DMA control circuit will read rid from the entry. In this embodiment, by using the highest bit of each entry to indicate whether each entry stores rid, the control circuit can be prevented from being confused by the two situations where rid is equal to 00 and the entry is empty. For example, if an entry in the third FIFO is 100, it means that rid equal to 00 has been filled into the entry. For example, if an entry in the FIFO is 000, it means that the entry is empty.
第四FIFO的位宽等于16,深度等于4。第四FIFO的每个entry的低四位用于存储arid,每个entry的最高位用于指示该entry是否存储了请求相关信息,每个entry的其余位用于存储arlen。只有当entry的最高位被置位1时,DMA的控制电路才会从该entry读取请求相关信息,即arlen与arid。The bit width of the fourth FIFO is 16 and the depth is 4. The lower four bits of each entry of the fourth FIFO are used to store arid, the highest bit of each entry is used to indicate whether the entry stores request related information, and the remaining bits of each entry are used to store arlen. Only when the highest bit of the entry is set to 1, the DMA control circuit will read the request related information, that is, arlen and arid, from the entry.
此外,DMA中还包括控制电路,图3中仅示出了控制电路的一部分,具体而言,图3中各个FIFO之间的连线即箭头可以理解为控制电路,控制电路具有以下功能:In addition, the DMA also includes a control circuit. FIG3 shows only a part of the control circuit. Specifically, the connecting lines between the FIFOs in FIG3, i.e., the arrows, can be understood as the control circuit. The control circuit has the following functions:
1、控制电路在接收到任一DMA通道发送的AXI读请求后,一方面,从该AXI读请求中读取出arlen和arid,将arlen和arid存入第四FIFO的一个entry,并将该entry的最高位置为1;另一方面,将该AXI读请求发送给从机;1. After receiving an AXI read request sent by any DMA channel, the control circuit, on the one hand, reads arlen and arid from the AXI read request, stores arlen and arid into an entry of the fourth FIFO, and sets the highest bit of the entry to 1; on the other hand, sends the AXI read request to the slave;
2、控制电路从第四FIFO中读取出最先存入的arlen和arid,并将该arlen和arid所在的entry的最高位置为0,以及根据该arid的低两位arid[1:0],将该arlen和arid存入相应的第一存储单元;2. The control circuit reads the first stored arlen and arid from the fourth FIFO, sets the highest position of the entry where the arlen and arid are located to 0, and stores the arlen and arid into the corresponding first storage unit according to the lower two bits of the arid, arid[1:0];
3、控制电路接收从机返回的每一拍请求结果和请求结果对应的相关信息,控制电路将接收到的每一拍请求结果存入第二FIFO的一个entry;每一拍请求结果对应的相关信息中包括rid,如果某一拍请求结果对应的相关信息中还包括last信息,则将该相关信息中rid的低两位rid[1:0]存入第三FIFO的一个entry,并将该entry的最高位置为1;3. The control circuit receives each request result and the related information corresponding to the request result returned by the slave, and stores each request result received into an entry of the second FIFO; the related information corresponding to each request result includes rid. If the related information corresponding to a request result also includes last information, the lower two bits rid[1:0] of rid in the related information are stored into an entry of the third FIFO, and the highest bit of the entry is set to 1;
4、控制电路从第三FIFO中读取出最先存入的rid[1:0],并将该rid[1:0]所在entry的最高位置为0,然后以该rid[1:0]为查询依据,查询每个第一存储单元的低两位是否等于rid[1:0],如果某个第一存储单元的低两位等于rid[1:0],则从该第一存储单元中读取出arlen和arid,并根据读取出的arlen,从第二FIFO中读取出arlen拍最先存入的请求结果,然后将读取的请求结果发送给该第一存储单元对应的DMA通道的下游模块。4. The control circuit reads the rid[1:0] stored first from the third FIFO, and sets the highest position of the entry where the rid[1:0] is located to 0, and then uses the rid[1:0] as a query basis to query whether the lower two bits of each first storage unit are equal to rid[1:0]. If the lower two bits of a first storage unit are equal to rid[1:0], arlen and arid are read from the first storage unit, and based on the read arlen, the request result stored first by arlen is read from the second FIFO, and then the read request result is sent to the downstream module of the DMA channel corresponding to the first storage unit.
本公开实施例还提供一种电子组件,该电子组件包括上述任一实施例中所述的数据读取系统。在一些使用场景下,该电子组件的产品形式体现为显卡;在另一些使用场景下,该电子组件的产品形式体现为CPU主板。The disclosed embodiment also provides an electronic component, which includes the data reading system described in any of the above embodiments. In some usage scenarios, the product form of the electronic component is a graphics card; in other usage scenarios, the product form of the electronic component is a CPU motherboard.
本公开实施例还提供一种电子设备,该电子设备包括上述的电子组件。在一些使用场景下,该电子设备的产品形式是便携式电子设备,例如智能手机、平板电脑、VR设备等;在一些使用场景下,该电子设备的产品形式是个人电脑、游戏主机、工作站、服务器等。The disclosed embodiments also provide an electronic device, which includes the above-mentioned electronic components. In some usage scenarios, the product form of the electronic device is a portable electronic device, such as a smart phone, a tablet computer, a VR device, etc.; in some usage scenarios, the product form of the electronic device is a personal computer, a game console, a workstation, a server, etc.
本公开实施例还提供一种数据读取方法,该数据读取方法与前述数据读取系统基于同一发明构思,为了避免重复,以下对数据读取方法仅做简要介绍,相关之处可以参考前述数据读取系统。The disclosed embodiment also provides a data reading method. The data reading method and the aforementioned data reading system are based on the same inventive concept. To avoid repetition, the data reading method is only briefly introduced below, and the relevant parts may refer to the aforementioned data reading system.
参考图4,图4是本公开一实施例提供的数据读取方法的流程示意图。如图4所示,该数据读取方法包括以下步骤:Referring to FIG4 , FIG4 is a flow chart of a data reading method provided by an embodiment of the present disclosure. As shown in FIG4 , the data reading method includes the following steps:
S410:在接收到任一DMA通道发送的AXI读请求后,将请求相关信息存入该DMA通道对应的第一存储单元,该请求相关信息用于表征该AXI读请求未处理完毕,不同DMA通道发送的AXI读请求具有不同的请求ID;S410: after receiving an AXI read request sent by any DMA channel, storing request related information in a first storage unit corresponding to the DMA channel, the request related information is used to indicate that the AXI read request has not been processed, and the AXI read requests sent by different DMA channels have different request IDs;
S420:将所述AXI读请求发送给从机;S420: Send the AXI read request to the slave;
S430:将从机返回的请求结果存入第二FIFO;S430: storing the request result returned by the slave into the second FIFO;
S440:根据目标请求结果的目标请求ID,从目标请求ID对应的第一存储单元中清除或读取出目标请求ID对应的请求相关信息,并从第二FIFO中读取出目标请求结果,将目标请求结果发送给相应DMA通道的下游模块;其中,目标请求结果是未读取的请求结果中最早被DMA接收到的请求结果。S440: According to the target request ID of the target request result, clear or read the request related information corresponding to the target request ID from the first storage unit corresponding to the target request ID, read the target request result from the second FIFO, and send the target request result to the downstream module of the corresponding DMA channel; wherein, the target request result is the earliest request result received by DMA among the unread request results.
需要说明的是,本公开不限定上述步骤S410至步骤S440的执行顺序。It should be noted that the present disclosure does not limit the execution order of the above steps S410 to S440.
在一些具体实施方式中,请求相关信息包括AXI请求的请求ID,从目标请求ID对应的第一存储单元中清除或读取出目标请求ID对应的请求相关信息,包括:In some specific implementations, the request related information includes a request ID of the AXI request, and clearing or reading the request related information corresponding to the target request ID from the first storage unit corresponding to the target request ID includes:
判断每个第一存储单元中最先存入的请求相关信息中是否包含目标请求ID,从而查询出目标请求ID对应的第一存储单元;Determine whether the request related information first stored in each first storage unit contains the target request ID, thereby querying the first storage unit corresponding to the target request ID;
从目标请求ID对应的第一存储单元中清除或读取出包含目标请求ID的请求相关信息。The request related information including the target request ID is cleared or read from the first storage unit corresponding to the target request ID.
在一些具体实施方式中,判断每个第一存储单元中最先存入的请求相关信息中是否包含目标请求ID,包括:In some specific implementations, determining whether the request related information first stored in each first storage unit includes the target request ID includes:
读取第三FIFO的读指针当前指向的表项中存储的请求ID,并更新第三FIFO的读指针;判断每个第一存储单元中最先存入的请求相关信息中是否包含该请求ID;其中,第三FIFO用于存储请求结果对应的请求ID。Read the request ID stored in the table entry currently pointed to by the read pointer of the third FIFO, and update the read pointer of the third FIFO; determine whether the request related information first stored in each first storage unit contains the request ID; wherein the third FIFO is used to store the request ID corresponding to the request result.
在一些具体实施方式中,该方法还包括:In some embodiments, the method further comprises:
针对当前正在被接收的请求结果,在接收到该请求结果对应的传输完成信号last后,将该请求结果对应的请求ID存入第三FIFO。For the request result currently being received, after receiving the transmission completion signal last corresponding to the request result, the request ID corresponding to the request result is stored in the third FIFO.
在一些具体实施方式中,请求相关信息中还包括拍数arlen,从第二FIFO中读取出目标请求结果,包括:In some specific implementations, the request related information also includes the beat number arlen, and the target request result is read from the second FIFO, including:
根据拍数arlen,从第二FIFO中读取出最先存入的拍数arlen个请求结果。According to the beat number arlen, the first stored request results of the beat number arlen are read out from the second FIFO.
在一些具体实施方式中,每个AXI读请求的请求ID的预设数据位用于表示发送该AXI读请求的DMA通道。In some specific implementations, a preset data bit of the request ID of each AXI read request is used to indicate a DMA channel that sends the AXI read request.
在一些具体实施方式中,将目标请求结果发送给相应DMA通道的下游模块,包括:In some specific implementations, sending the target request result to a downstream module of the corresponding DMA channel includes:
根据目标请求ID的预设数据位,将目标请求结果发送给该预设数据位表示的DMA通道的下游模块。According to the preset data bit of the target request ID, the target request result is sent to the downstream module of the DMA channel represented by the preset data bit.
在一些具体实施方式中,将AXI读请求的请求相关信息存入该DMA通道对应的第一存储单元,包括:In some specific implementations, storing request related information of the AXI read request in a first storage unit corresponding to the DMA channel includes:
读取出第四FIFO中最先存入的请求相关信息;其中,第四FIFO用于存储每个DMA通道的AXI读请求的请求相关信息;Read out the request related information first stored in the fourth FIFO; wherein the fourth FIFO is used to store the request related information of the AXI read request of each DMA channel;
根据读取出的请求相关信息所包含的请求ID的预设数据位,将请求相关信息存入该预设数据位表示的DMA通道所对应的第一存储单元。According to the preset data bit of the request ID included in the read request related information, the request related information is stored in a first storage unit corresponding to the DMA channel represented by the preset data bit.
在一些具体实施方式中,每个第一存储单元的深度均等于1。In some specific implementations, the depth of each first storage unit is equal to 1.
尽管已描述了本公开的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本公开范围的所有变更和修改。Although the preferred embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present disclosure.
显然,本领域的技术人员可以对本公开进行各种改动和变型而不脱离本公开的精神和范围。这样,倘若本公开的这些修改和变型属于本公开权利要求及其等同技术的范围之内,则本公开也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is also intended to include these modifications and variations.
Claims (16)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410257132.6A CN117851312B (en) | 2024-03-07 | 2024-03-07 | Data reading system, electronic component, electronic device and data reading method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410257132.6A CN117851312B (en) | 2024-03-07 | 2024-03-07 | Data reading system, electronic component, electronic device and data reading method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN117851312A CN117851312A (en) | 2024-04-09 |
| CN117851312B true CN117851312B (en) | 2024-06-21 |
Family
ID=90532976
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202410257132.6A Active CN117851312B (en) | 2024-03-07 | 2024-03-07 | Data reading system, electronic component, electronic device and data reading method |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117851312B (en) |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101308450A (en) * | 2008-06-27 | 2008-11-19 | 北京中星微电子有限公司 | FIFO control circuit and control method |
| CN110322904A (en) * | 2019-07-05 | 2019-10-11 | 南京芯驰半导体科技有限公司 | Compress image information reading and control method thereof and device |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114564234B (en) * | 2022-02-23 | 2025-09-05 | 北京奕斯伟计算技术股份有限公司 | Processing device, method and system for performing data processing on multiple channels |
| CN114546277A (en) * | 2022-02-23 | 2022-05-27 | 北京奕斯伟计算技术有限公司 | Device, method, processing device and computer system for accessing data |
| CN115658625B (en) * | 2022-12-12 | 2023-03-14 | 北京象帝先计算技术有限公司 | Data decompression system, graphic processing system, device, equipment and decompression method |
-
2024
- 2024-03-07 CN CN202410257132.6A patent/CN117851312B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101308450A (en) * | 2008-06-27 | 2008-11-19 | 北京中星微电子有限公司 | FIFO control circuit and control method |
| CN110322904A (en) * | 2019-07-05 | 2019-10-11 | 南京芯驰半导体科技有限公司 | Compress image information reading and control method thereof and device |
Also Published As
| Publication number | Publication date |
|---|---|
| CN117851312A (en) | 2024-04-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6925520B2 (en) | Self-optimizing crossbar switch | |
| US6823403B2 (en) | DMA mechanism for high-speed packet bus | |
| US20030005239A1 (en) | Virtual-port memory and virtual-porting | |
| JPH09223089A (en) | Method and apparatus for allowing packet data to be split into multiple bus targets | |
| US10628340B2 (en) | Method for reordering out of order responses from decomposed requests in bridge IP | |
| CN111159075A (en) | Data transmission method and data transmission device | |
| EP2097828A2 (en) | Dmac to handle transfers of unknown lengths | |
| EP1508100B1 (en) | Inter-chip processor control plane | |
| CN113900974A (en) | Storage device, data storage method and related equipment | |
| CN116521096B (en) | Memory access circuit and memory access method, integrated circuit and electronic device | |
| CN116737083B (en) | Memory access circuit, memory access method, integrated circuit, and electronic device | |
| CN116257479B (en) | Reordering buffer, system, device, device and transmission method | |
| US6764017B2 (en) | Multi-function electronic card | |
| CN100504824C (en) | Method, device and system for processing read request | |
| US5497466A (en) | Universal address generator | |
| JP2002544585A (en) | FIFO system with variable width interface to host processor | |
| CN117851312B (en) | Data reading system, electronic component, electronic device and data reading method | |
| US6625700B2 (en) | Arbitration and select logic for accessing a shared memory | |
| CN117707994A (en) | Request buffer, system, component, device and transmission method | |
| US9665519B2 (en) | Using a credits available value in determining whether to issue a PPI allocation request to a packet engine | |
| US7219193B2 (en) | FIFO control circuit | |
| US20220374369A1 (en) | Data bus communications | |
| KR102326892B1 (en) | Adaptive transaction handling method and device for same | |
| US20040193771A1 (en) | Method, apparatus, and system for processing a plurality of outstanding data requests | |
| CN101097555B (en) | Method and system for processing data on chip |
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 | ||
| PE01 | Entry into force of the registration of the contract for pledge of patent right | ||
| PE01 | Entry into force of the registration of the contract for pledge of patent right |
Denomination of invention: Data reading system, electronic components, electronic devices, and data reading methods Granted publication date: 20240621 Pledgee: Ji Aiqin Pledgor: Xiangdixian Computing Technology (Chongqing) Co.,Ltd.|Beijing xiangdixian Computing Technology Co.,Ltd. Registration number: Y2024980043989 |