CN104765701A - Data access method and device - Google Patents
Data access method and device Download PDFInfo
- Publication number
- CN104765701A CN104765701A CN201510131604.4A CN201510131604A CN104765701A CN 104765701 A CN104765701 A CN 104765701A CN 201510131604 A CN201510131604 A CN 201510131604A CN 104765701 A CN104765701 A CN 104765701A
- Authority
- CN
- China
- Prior art keywords
- data
- soc
- request
- target
- write
- 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
Links
Landscapes
- Communication Control (AREA)
- Bus Control (AREA)
Abstract
本发明公开了一种数据访问方法及设备,属于计算机领域。所述方法包括:在每个时钟周期,当检测到多个HAC通过与所述多个HAC分别连接的HAC-IF发送的数据访问请求时,基于多个数据访问请求的优先级,接收优先级最高的数据访问请求;基于接收的数据访问请求的类型,将所述接收的数据访问请求存储在LMI的数据队列中;基于所述LMI的数据队列中的目标数据访问请求携带的数据量、所述目标数据访问请求携带的起始地址和SOC数据总线的最大数据量,对SOC的存储资源进行数据访问。本发明通过LMI对HAC发送的数据访问请求进行仲裁、拆分以及协议转化,节省了拆分逻辑和协议转化逻辑的重复资源,并且SOC数据总线只需为LMI提供访问接口,减少了SOC数据总线的访问接口的数量。
The invention discloses a data access method and equipment, belonging to the field of computers. The method includes: at each clock cycle, when detecting data access requests sent by a plurality of HACs through HAC-IFs respectively connected to the plurality of HACs, based on the priorities of the plurality of data access requests, receiving priority The highest data access request; based on the type of the received data access request, storing the received data access request in the data queue of the LMI; based on the amount of data carried by the target data access request in the data queue of the LMI, the According to the start address carried in the target data access request and the maximum data volume of the SOC data bus, data access is performed on the storage resources of the SOC. The invention uses the LMI to arbitrate, split and convert the data access request sent by the HAC, saving the duplicate resources of split logic and protocol conversion logic, and the SOC data bus only needs to provide an access interface for the LMI, reducing the SOC data bus number of access interfaces.
Description
技术领域technical field
本发明涉及计算机领域,特别涉及一种数据访问方法及设备。The invention relates to the computer field, in particular to a data access method and device.
背景技术Background technique
随着芯片复杂度的不断增加,单个芯片内HAC(英文:Hardware Accelerator;中文:硬件加速器)的数量越来越多,且HAC对SOC(英文:System On Chip;中文:片上系统)的存储资源进行数据访问是HAC执行业务过程中比不可少的环节。With the increasing complexity of the chip, the number of HAC (English: Hardware Accelerator; Chinese: Hardware Accelerator) in a single chip is increasing, and the storage resources of the SOC (English: System On Chip; Chinese: System on Chip) are greatly affected by the HAC. Data access is an indispensable part of HAC's business execution process.
目前,HAC对SOC的存储资源进行数据访问的具体过程可以为:如图1所示,每个HAC分别连接一个HAC-IF(英文:Hardware Accelerator Interface;中文:硬件加速器接口),当每个HAC接收到数据访问请求时,该HAC将该数据访问请求发送给与其连接的HAC-IF,该HAC-IF基于指定数据量和该数据访问请求携带的数据量,在每个时钟周期,从该数据访问请求中拆分出一个子数据访问请求,子数据访问请求携带的子数据量小于或等于指定数据量。其中,指定数据量小于或等于SOC数据总线要求的最大数据量。之后,该HAC-IF将该子数据访问请求进行协议转化,得到数据访问命令,使该数据访问命令满足SOC数据总线的协议。该HAC-IF将该数据访问命令发送给SOC数据总线,当SOC数据总线检测到多个HAC-IF发送的数据访问命令时,基于每个HAC-IF接收的数据访问请求的优先级,接收优先级最高的数据访问请求拆分后的数据访问命令,并基于该数据访问命令,对SOC的存储资源进行数据访问。At present, the specific process of data access by HAC to SOC storage resources can be as follows: As shown in Figure 1, each HAC is connected to a HAC-IF (English: Hardware Accelerator Interface; Chinese: Hardware Accelerator Interface), when each HAC When receiving a data access request, the HAC sends the data access request to the HAC-IF connected to it, and the HAC-IF, based on the specified amount of data and the amount of data carried by the data access request, in each clock cycle, from the data A sub-data access request is split from the access request, and the amount of sub-data carried in the sub-data access request is less than or equal to the specified amount of data. Wherein, the designated data volume is less than or equal to the maximum data volume required by the SOC data bus. Afterwards, the HAC-IF performs protocol conversion on the sub-data access request to obtain a data access command, so that the data access command meets the protocol of the SOC data bus. The HAC-IF sends the data access command to the SOC data bus. When the SOC data bus detects the data access commands sent by multiple HAC-IFs, based on the priority of the data access requests received by each HAC-IF, the receiving priority The data access command after splitting the highest-level data access request, and based on the data access command, performs data access to the storage resources of the SOC.
在实现本发明的过程中,发明人发现现有技术至少存在以下问题:In the process of realizing the present invention, the inventor finds that there are at least the following problems in the prior art:
SOC数据总线为每个HAC-IF均提供一个访问接口,当HAC的数量增加时,SOC数据总线需要提供的访问接口也会增加;并且在每个HAC-IF内均需布置相同的拆分数据访问请求的逻辑和协议转化的逻辑,资源浪费较多。The SOC data bus provides an access interface for each HAC-IF. When the number of HACs increases, the access interfaces that the SOC data bus needs to provide will also increase; and the same split data needs to be arranged in each HAC-IF The logic of the access request and the logic of the protocol conversion waste a lot of resources.
发明内容Contents of the invention
为了解决现有技术的问题,本发明实施例提供了一种数据访问方法及设备。所述技术方案如下:In order to solve the problems in the prior art, embodiments of the present invention provide a data access method and device. Described technical scheme is as follows:
第一方面,提供了一种数据访问方法,所述方法包括:In a first aspect, a data access method is provided, the method comprising:
在每个时钟周期,当检测到多个硬件加速器HAC通过与所述多个HAC分别连接的硬件加速器接口HAC-IF发送的数据访问请求时,基于多个数据访问请求的优先级,接收优先级最高的数据访问请求;At each clock cycle, when multiple hardware accelerators HACs are detected to send data access requests through the hardware accelerator interface HAC-IF connected respectively with the multiple HACs, based on the priority of multiple data access requests, the priority of receiving highest data access request;
基于接收的数据访问请求的类型,将所述接收的数据访问请求存储在逻辑主接口LMI的数据队列中;Based on the type of the received data access request, storing the received data access request in a data queue of the logical master interface LMI;
基于所述LMI的数据队列中的目标数据访问请求携带的数据量、所述目标数据访问请求携带的起始地址和片上系统SOC数据总线的最大数据量,对SOC的存储资源进行数据访问。Based on the amount of data carried by the target data access request in the data queue of the LMI, the start address carried by the target data access request, and the maximum data amount of the SOC data bus of the system on chip, perform data access to the storage resources of the SOC.
结合第一方面,在上述第一方面的第一种可能的实现方式中,所述基于接收的数据访问请求的类型,将所述接收的数据访问请求存储在逻辑主接口LMI的数据队列中,包括:With reference to the first aspect, in a first possible implementation manner of the above first aspect, based on the type of the received data access request, storing the received data access request in a data queue of the logical master interface LMI, include:
如果接收的数据访问请求的类型为数据写请求,则将所述接收的数据访问请求存储在LMI的第一数据队列中最后一个数据访问请求之后,所述第一数据队列用于存储数据写请求;If the type of the received data access request is a data write request, the received data access request is stored after the last data access request in the first data queue of the LMI, and the first data queue is used to store the data write request ;
如果接收的数据访问请求的类型为数据读请求,则将所述接收的数据访问请求存储在所述LMI的第二数据队列中最后一个数据访问请求之后,所述第二数据队列用于存储数据读请求。If the type of the received data access request is a data read request, the received data access request is stored after the last data access request in the second data queue of the LMI, and the second data queue is used to store data read request.
结合第一方面,在上述第一方面的第二种可能的实现方式中,所述基于所述LMI的数据队列中的目标数据访问请求携带的数据量、所述目标数据访问请求携带的起始地址和片上系统SOC数据总线的最大数据量,对SOC的存储资源进行数据访问,包括:With reference to the first aspect, in the second possible implementation manner of the first aspect above, the amount of data carried by the target data access request in the LMI-based data queue, the start of the target data access request carried The address and the maximum data volume of the SOC data bus of the system on chip, and data access to the storage resources of the SOC, including:
从LMI的第一数据队列中,获取目标数据写请求,以及从所述LMI的第二数据队列中,获取目标数据读请求;Obtain a target data write request from the first data queue of the LMI, and obtain a target data read request from the second data queue of the LMI;
基于所述目标数据写请求携带的第一数据量、所述目标数据写请求携带的第一起始地址和SOC数据总线的最大数据量,将所述目标数据写请求的写数据写入SOC的存储资源中;Based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the maximum data amount of the SOC data bus, write the write data of the target data write request into the storage of the SOC resources;
基于所述目标数据读请求携带的第二数据量、所述目标数据读请求携带的第二起始地址和所述SOC数据总线的最大数据量,从所述SOC的存储资源中读取所述目标数据读请求的读数据。Based on the second data amount carried by the target data read request, the second start address carried by the target data read request, and the maximum data amount of the SOC data bus, read the The read data for the target data read request.
结合第一方面的第二种可能的实现方式,在上述第一方面的第三种可能的实现方式中,所述基于所述目标数据写请求携带的第一数据量、所述目标数据写请求携带的第一起始地址和SOC数据总线的最大数据量,将所述目标数据写请求的写数据写入SOC的存储资源中,包括:With reference to the second possible implementation of the first aspect, in the third possible implementation of the first aspect above, the first data amount carried in the target data write request, the target data write request Carrying the first start address and the maximum data volume of the SOC data bus, writing the write data of the target data write request into the storage resources of the SOC, including:
基于所述目标数据写请求携带的第一数据量、所述目标数据写请求携带的第一起始地址和芯片数据总线的位宽,从目标HAC中获取写数据,并对获取写数据的次数进行统计,得到第一次数,所述目标HAC为发送所述目标数据写请求的HAC;Based on the first amount of data carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, obtain the write data from the target HAC, and perform a calculation on the number of times of obtaining the write data. Statistics to obtain the first number, the target HAC is the HAC that sends the target data write request;
当所述第一次数达到第一指定次数时,从所述目标HAC中获取所述第一指定次数的下一次写数据的过程中,基于所述第一数据量、所述第一起始地址和所述SOC数据总线的最大数据量,从所述目标数据写请求中拆分出一个子数据写请求,并将所述子数据写请求进行协议转化,得到数据写命令,所述数据写命令携带第一子数据量和第一子起始地址;When the first number reaches the first specified number of times, in the process of obtaining the next write data of the first specified number of times from the target HAC, based on the first data amount and the first start address and the maximum data volume of the SOC data bus, split a sub-data write request from the target data write request, and perform protocol conversion on the sub-data write request to obtain a data write command, and the data write command carrying the first sub-data volume and the first sub-start address;
当所述第一次数达到第二指定次数时,从所述目标HAC中获取所述第二指定次数的下一次写数据的过程中,将所述数据写命令发送给所述SOC数据总线,并将所述第一次数清零,重新统计第一次数,返回上一步骤,直至将所述目标数据写请求拆分完毕;When the first number reaches the second specified number of times, during the process of obtaining the next write data of the second specified number of times from the target HAC, the data write command is sent to the SOC data bus, and clearing the first count, recounting the first count, and returning to the previous step until the splitting of the target data write request is completed;
当接收到所述SOC数据总线返回的数据写响应时,将多次从所述目标HAC中获取所述数据写命令的写数据,逐次发送给所述SOC数据总线,使所述SOC数据总线按照所述第一子数据量和所述第一子起始地址,将接收的写数据写入SOC的存储资源中。When receiving the data write response returned by the SOC data bus, the write data of the data write command will be obtained from the target HAC multiple times, and sent to the SOC data bus one by one, so that the SOC data bus follows the The first sub-data amount and the first sub-start address write the received write data into the storage resources of the SOC.
结合第一方面的第二种可能的实现方式,在上述第一方面的第四种可能的实现方式中,所述基于所述目标数据写请求携带的第一数据量、所述目标数据写请求携带的第一起始地址和SOC数据总线的最大数据量,将所述目标数据写请求的写数据写入SOC的存储资源中,包括:With reference to the second possible implementation of the first aspect, in the fourth possible implementation of the first aspect above, the first data amount carried in the target data write request, the target data write request Carrying the first start address and the maximum data volume of the SOC data bus, writing the write data of the target data write request into the storage resources of the SOC, including:
基于所述目标数据写请求携带的第一数据量、所述目标数据写请求携带的第一起始地址和芯片数据总线的位宽,从目标HAC中获取写数据,并对获取写数据的次数进行统计,得到第一次数,所述目标HAC为发送所述目标数据写请求的HAC;Based on the first amount of data carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, obtain the write data from the target HAC, and perform a calculation on the number of times of obtaining the write data. Statistics to obtain the first number, the target HAC is the HAC that sends the target data write request;
当所述第一次数达到第一指定次数时,从所述目标HAC中获取所述第一指定次数的下一次写数据的过程中,基于所述第一数据量、所述第一起始地址和所述SOC数据总线的最大数据量,从所述目标数据写请求中拆分出一个子数据写请求,将所述子数据写请求进行协议转化,得到数据写命令,返回本步骤,直至将所述目标数据写请求拆分完毕;When the first number reaches the first specified number of times, in the process of obtaining the next write data of the first specified number of times from the target HAC, based on the first data amount and the first start address and the maximum amount of data of the SOC data bus, split a sub-data write request from the target data write request, carry out protocol conversion with the sub-data write request, obtain a data write command, and return to this step until the The splitting of the target data write request is completed;
将所述数据写命令发送给所述SOC数据总线,所述数据写命令携带第一子数据量和第一子起始地址;Sending the data write command to the SOC data bus, the data write command carrying the first sub-data amount and the first sub-start address;
当接收到所述SOC数据总线返回的数据写响应时,将多次从所述目标HAC中获取的写数据,逐次发送给所述SOC数据总线,使所述SOC数据总线按照所述第一子数据量和所述第一子起始地址,将接收的写数据写入SOC的存储资源中。When the data write response returned by the SOC data bus is received, the write data obtained from the target HAC for multiple times will be sent to the SOC data bus one by one, so that the SOC data bus will follow the first sub- The data amount and the first sub-start address are used to write the received write data into the storage resources of the SOC.
结合第一方面的第三种可能的实现方式或者第一方面的第四种可能的实现方式,在上述第一方面的第五种可能的实现方式中,所述基于所述目标数据写请求携带的第一数据量、所述目标数据写请求携带的第一起始地址和芯片数据总线的位宽,从目标HAC中获取写数据,并对获取写数据的次数进行统计,得到第一次数,包括:With reference to the third possible implementation of the first aspect or the fourth possible implementation of the first aspect, in the fifth possible implementation of the first aspect above, the write request based on the target data carries The first data amount, the first start address carried by the target data write request and the bit width of the chip data bus, obtain the write data from the target HAC, and count the number of times of obtaining the write data to obtain the first number, include:
基于所述目标数据写请求携带的第一数据量、所述目标数据写请求携带的第一起始地址和芯片数据总线的位宽,计算从目标HAC中获取写数据的获取次数,所述芯片数据总线为与所述LMI连接的数据总线;Based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, calculate the number of acquisitions of write data from the target HAC, the chip data The bus is a data bus connected to the LMI;
基于所述获取次数,向所述目标HAC发送指示信息,所述指示信息用于指示所述目标HAC将所述目标数据写请求的写数据划分为所述获取次数次进行发送;Based on the acquisition times, sending indication information to the target HAC, where the indication information is used to instruct the target HAC to divide the write data of the target data write request into the acquisition times and send them;
接收所述目标HAC发送的写数据,并对接收写数据的次数进行统计,得到第一次数。The write data sent by the target HAC is received, and the number of times of receiving the write data is counted to obtain the first number.
结合第一方面的第二种可能的实现方式、第一方面的第三种可能的实现方式或者第一方面的第四种可能的实现方式,在上述第一方面的第六种可能的实现方式中,所述基于所述目标数据读请求携带的第二数据量、所述目标数据读请求携带的第二起始地址和所述SOC数据总线的最大数据量,从所述SOC的存储资源中读取所述目标数据读请求的读数据,包括:In combination with the second possible implementation of the first aspect, the third possible implementation of the first aspect, or the fourth possible implementation of the first aspect, the sixth possible implementation of the first aspect above In the above, based on the second data amount carried by the target data read request, the second start address carried by the target data read request, and the maximum data amount of the SOC data bus, from the storage resources of the SOC Read the read data of the target data read request, including:
基于所述目标数据读请求携带的第二数据量、所述目标数据读请求携带的第二起始地址和所述SOC数据总线的最大数据量,从所述目标数据读请求中拆分出一个子数据读请求,并将所述子数据读请求进行协议转化,得到数据读命令;Based on the second data amount carried by the target data read request, the second start address carried by the target data read request, and the maximum data amount of the SOC data bus, split one from the target data read request A sub-data read request, and performing protocol conversion on the sub-data read request to obtain a data read command;
将所述数据读命令发送给所述SOC数据总线,使所述SOC数据总线将所述数据读命令发送给SOC的存储资源,所述数据读命令中携带第二子数据量和第二子起始地址;Send the data read command to the SOC data bus, so that the SOC data bus sends the data read command to the storage resource of the SOC, and the data read command carries the second sub-data amount and the second sub-start origin address;
接收所述SOC的存储资源通过所述SOC数据总线发送的读数据,对接收读数据的次数进行统计,得到第二次数;receiving the read data sent by the storage resource of the SOC through the SOC data bus, and counting the number of times of receiving the read data to obtain a second number of times;
当所述第二次数达到第三指定次数时,接收所述SOC的存储资源通过所述SOC数据总线发送所述第三指定次数的下一次读数据的过程中,基于所述第二数据量、所述第二起始地址和所述SOC数据总线的最大数据量,从所述目标数据读请求中拆分出下一个子数据读请求,并将所述下一个子数据读请求进行协议转化,得到下一个数据读命令;When the second number of times reaches the third specified number of times, during the process of the storage resource receiving the SOC sending the next read data of the third specified number of times through the SOC data bus, based on the second data amount, The second starting address and the maximum data volume of the SOC data bus, splitting the next sub-data read request from the target data read request, and performing protocol conversion on the next sub-data read request, Get the next data read command;
当所述第二次数达到第四指定次数时,接收所述SOC的存储资源通过所述SOC数据总线发送所述第四指定次数的下一次读数据的过程中,将所述下一个数据读命令发送给所述SOC数据总线,并将所述第二次数清零,重新统计第二次数,返回上一步骤,直至将所述目标数据读请求拆分完毕。When the second number of times reaches the fourth specified number of times, the storage resource receiving the SOC transmits the next read data of the fourth specified number of times through the SOC data bus, and sends the next data read command Send to the SOC data bus, clear the second count, re-count the second count, and return to the previous step until the target data read request is split.
结合第一方面的第二种可能的实现方式、第一方面的第三种可能的实现方式或者第一方面的第四种可能的实现方式,在上述第一方面的第七种可能的实现方式中,所述基于所述目标数据读请求携带的第二数据量、所述目标数据读请求携带的第二起始地址和所述SOC数据总线的最大数据量,从所述SOC的存储资源中读取所述目标数据读请求的读数据,包括:In combination with the second possible implementation of the first aspect, the third possible implementation of the first aspect, or the fourth possible implementation of the first aspect, the seventh possible implementation of the first aspect above In the above, based on the second data amount carried by the target data read request, the second start address carried by the target data read request, and the maximum data amount of the SOC data bus, from the storage resources of the SOC Read the read data of the target data read request, including:
基于所述目标数据读请求携带的第二数据量、所述目标数据读请求携带的第二起始地址和所述SOC数据总线的最大数据量,从所述目标数据读请求中拆分出一个子数据读请求;Based on the second data amount carried by the target data read request, the second start address carried by the target data read request, and the maximum data amount of the SOC data bus, split one from the target data read request Subdata read request;
将所述子数据读请求进行协议转化,得到数据读命令,返回上一步骤,直至将所述目标数据读请求拆分完毕;Perform protocol conversion on the sub-data read request to obtain a data read command, and return to the previous step until the target data read request is split;
将所述数据读命令发送给所述SOC数据总线,使所述SOC数据总线将所述数据读命令发送给SOC的存储资源,所述数据读命令中携带第二子数据量和第二子起始地址;Send the data read command to the SOC data bus, so that the SOC data bus sends the data read command to the storage resource of the SOC, and the data read command carries the second sub-data amount and the second sub-start origin address;
逐次接收所述SOC的存储资源通过所述SOC数据总线发送的读数据。The read data sent by the storage resource of the SOC through the SOC data bus is successively received.
结合第一方面,在上述第一方面的第八种可能的实现方式中,所述方法还包括:With reference to the first aspect, in an eighth possible implementation manner of the above first aspect, the method further includes:
对于每个HAC,当向所述SOC数据总线发送属于所述HAC的数据写命令和数据读命令时,对发送的数据写命令个数进行统计,得到第一命令个数,以及对发送的数据读命令个数进行统计,得到第二命令个数;For each HAC, when sending data write commands and data read commands belonging to the HAC to the SOC data bus, the number of data write commands sent is counted to obtain the first number of commands, and the data sent Count the number of read commands to obtain the second number of commands;
当所述第一命令个数等于第一个数阈值时,停止接收所述HAC发送的类型为数据写请求的数据访问请求,直至所述第一命令个数小于所述第一个数阈值;When the number of the first command is equal to the first number threshold, stop receiving the data access request of the type sent by the HAC, which is a data write request, until the number of the first command is less than the first number threshold;
当所述第二命令个数等于第二个数阈值时,停止接收所述HAC发送的类型为数据读请求的数据访问请求,直至所述第二命令个数小于所述第二个数阈值。When the second number of commands is equal to the second number threshold, stop receiving the data access request sent by the HAC, whose type is a data read request, until the second number of commands is less than the second number threshold.
第二方面,提供了一种数据访问设备,所述设备包括:In a second aspect, a data access device is provided, and the device includes:
接收模块,用于在每个时钟周期,当检测到多个硬件加速器HAC通过与所述多个HAC分别连接的硬件加速器接口HAC-IF发送的数据访问请求时,基于多个数据访问请求的优先级,接收优先级最高的数据访问请求;The receiving module is used for each clock cycle, when detecting the data access requests sent by multiple hardware accelerators HAC through the hardware accelerator interface HAC-IF respectively connected with the multiple HACs, based on the priority of multiple data access requests level, receiving the data access request with the highest priority;
存储模块,用于基于接收的数据访问请求的类型,将所述接收的数据访问请求存储在逻辑主接口LMI的数据队列中;A storage module, configured to store the received data access request in the data queue of the logical main interface LMI based on the type of the received data access request;
数据访问模块,用于基于所述LMI的数据队列中的目标数据访问请求携带的数据量、所述目标数据访问请求携带的起始地址和片上系统SOC数据总线的最大数据量,对SOC的存储资源进行数据访问。The data access module is used to store the SOC based on the amount of data carried by the target data access request in the data queue of the LMI, the start address carried by the target data access request, and the maximum data amount of the SOC data bus of the system on chip. resources for data access.
结合第二方面,在上述第二方面的第一种可能的实现方式中,所述存储模块包括:With reference to the second aspect, in the first possible implementation manner of the above second aspect, the storage module includes:
存储单元,用于如果接收的数据访问请求的类型为数据写请求,则将所述接收的数据访问请求存储在LMI的第一数据队列中最后一个数据访问请求之后,所述第一数据队列用于存储数据写请求;The storage unit is configured to store the received data access request after the last data access request in the first data queue of the LMI if the type of the received data access request is a data write request, and the first data queue uses For storing data write requests;
所述存储单元,还用于如果接收的数据访问请求的类型为数据读请求,则将所述接收的数据访问请求存储在所述LMI的第二数据队列中最后一个数据访问请求之后,所述第二数据队列用于存储数据读请求。The storage unit is further configured to store the received data access request after the last data access request in the second data queue of the LMI if the type of the received data access request is a data read request, the The second data queue is used to store data read requests.
结合第二方面,在上述第二方面的第二种可能的实现方式中,所述数据访问模块包括:With reference to the second aspect, in a second possible implementation manner of the above second aspect, the data access module includes:
获取单元,用于从LMI的第一数据队列中,获取目标数据写请求,以及从所述LMI的第二数据队列中,获取目标数据读请求;An acquisition unit, configured to acquire a target data write request from the first data queue of the LMI, and acquire a target data read request from the second data queue of the LMI;
写入单元,用于基于所述目标数据写请求携带的第一数据量、所述目标数据写请求携带的第一起始地址和SOC数据总线的最大数据量,将所述目标数据写请求的写数据写入SOC的存储资源中;A writing unit, configured to write the target data write request based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the maximum data amount of the SOC data bus. Data is written into the storage resources of the SOC;
读取单元,用于基于所述目标数据读请求携带的第二数据量、所述目标数据读请求携带的第二起始地址和所述SOC数据总线的最大数据量,从所述SOC的存储资源中读取所述目标数据读请求的读数据。A reading unit, configured to read from the storage of the SOC based on the second data amount carried by the target data read request, the second start address carried by the target data read request, and the maximum data amount of the SOC data bus. The resource reads the read data of the target data read request.
结合第二方面的第二种可能的实现方式,在上述第二方面的第三种可能的实现方式中,所述写入单元包括:With reference to the second possible implementation of the second aspect, in the third possible implementation of the second aspect above, the writing unit includes:
获取子单元,用于基于所述目标数据写请求携带的第一数据量、所述目标数据写请求携带的第一起始地址和芯片数据总线的位宽,从目标HAC中获取写数据,并对获取写数据的次数进行统计,得到第一次数,所述目标HAC为发送所述目标数据写请求的HAC;The obtaining subunit is configured to obtain write data from the target HAC based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, and Obtaining the number of times of writing data is counted to obtain the first number, and the target HAC is the HAC that sends the writing request of the target data;
拆分子单元,用于当所述第一次数达到第一指定次数时,从所述目标HAC中获取所述第一指定次数的下一次写数据的过程中,基于所述第一数据量、所述第一起始地址和所述SOC数据总线的最大数据量,从所述目标数据写请求中拆分出一个子数据写请求,并将所述子数据写请求进行协议转化,得到数据写命令,所述数据写命令携带第一子数据量和第一子起始地址;Splitting subunits, used for obtaining the next write data of the first specified number of times from the target HAC when the first number reaches the first specified number of times, based on the first data amount, The first start address and the maximum data volume of the SOC data bus, split a sub-data write request from the target data write request, and perform protocol conversion on the sub-data write request to obtain a data write command , the data write command carries a first sub-data amount and a first sub-start address;
发送子单元,用于当所述第一次数达到第二指定次数时,从所述目标HAC中获取所述第二指定次数的下一次写数据的过程中,将所述数据写命令发送给所述SOC数据总线,并将所述第一次数清零,重新统计第一次数,返回上一拆分子单元,直至将所述目标数据写请求拆分完毕;The sending subunit is used to send the data write command to The SOC data bus, and clear the first number, re-count the first number, and return to the previous split subunit until the target data write request is split;
所述发送子单元,还用于当接收到所述SOC数据总线返回的数据写响应时,将多次从所述目标HAC中获取所述数据写命令的写数据,逐次发送给所述SOC数据总线,使所述SOC数据总线按照所述第一子数据量和所述第一子起始地址,将接收的写数据写入SOC的存储资源中。The sending subunit is further configured to obtain the write data of the data write command from the target HAC multiple times when receiving the data write response returned by the SOC data bus, and send them to the SOC data one by one bus, so that the SOC data bus writes the received write data into the storage resources of the SOC according to the first sub-data amount and the first sub-start address.
结合第二方面的第二种可能的实现方式,在上述第二方面的第四种可能的实现方式中,所述写入单元包括:With reference to the second possible implementation of the second aspect, in the fourth possible implementation of the second aspect above, the writing unit includes:
获取子单元,用于基于所述目标数据写请求携带的第一数据量、所述目标数据写请求携带的第一起始地址和芯片数据总线的位宽,从目标HAC中获取写数据,并对获取写数据的次数进行统计,得到第一次数,所述目标HAC为发送所述目标数据写请求的HAC;The obtaining subunit is configured to obtain write data from the target HAC based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, and Obtaining the number of times of writing data is counted to obtain the first number, and the target HAC is the HAC that sends the writing request of the target data;
拆分子单元,用于当所述第一次数达到第一指定次数时,从所述目标HAC中获取所述第一指定次数的下一次写数据的过程中,基于所述第一数据量、所述第一起始地址和所述SOC数据总线的最大数据量,从所述目标数据写请求中拆分出一个子数据写请求,将所述子数据写请求进行协议转化,得到数据写命令,返回本拆分子单元,直至将所述目标数据写请求拆分完毕;Splitting subunits, used for obtaining the next write data of the first specified number of times from the target HAC when the first number reaches the first specified number of times, based on the first data amount, The first starting address and the maximum data volume of the SOC data bus, splitting a sub-data write request from the target data write request, performing protocol conversion on the sub-data write request, and obtaining a data write command, Return to the split subunit until the splitting of the target data write request is completed;
发送子单元,用于将所述数据写命令发送给所述SOC数据总线,所述数据写命令携带第一子数据量和第一子起始地址;A sending subunit, configured to send the data write command to the SOC data bus, where the data write command carries a first sub-data amount and a first sub-start address;
所述发送子单元,还用于当接收到所述SOC数据总线返回的数据写响应时,将多次从所述目标HAC中获取的写数据,逐次发送给所述SOC数据总线,使所述SOC数据总线按照所述第一子数据量和所述第一子起始地址,将接收的写数据写入SOC的存储资源中。The sending subunit is further configured to, when receiving the data write response returned by the SOC data bus, send the write data obtained from the target HAC multiple times to the SOC data bus one by one, so that the The SOC data bus writes the received write data into the storage resources of the SOC according to the first sub-data amount and the first sub-start address.
结合第二方面的第三种可能的实现方式或者第二方面的第四种可能的实现方式,在上述第二方面的第五种可能的实现方式中,In combination with the third possible implementation of the second aspect or the fourth possible implementation of the second aspect, in the fifth possible implementation of the second aspect above,
所述获取子单元,具体用于:The acquisition subunit is specifically used for:
基于所述目标数据写请求携带的第一数据量、所述目标数据写请求携带的第一起始地址和芯片数据总线的位宽,计算从目标HAC中获取写数据的获取次数,所述芯片数据总线为与所述LMI连接的数据总线;Based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, calculate the number of acquisitions of write data from the target HAC, the chip data The bus is a data bus connected to the LMI;
基于所述获取次数,向所述目标HAC发送指示信息,所述指示信息用于指示所述目标HAC将所述目标数据写请求的写数据划分为所述获取次数次进行发送;Based on the acquisition times, sending indication information to the target HAC, where the indication information is used to instruct the target HAC to divide the write data of the target data write request into the acquisition times and send them;
接收所述目标HAC发送的写数据,并对接收写数据的次数进行统计,得到第一次数。The write data sent by the target HAC is received, and the number of times of receiving the write data is counted to obtain the first number.
结合第二方面的第二种可能的实现方式、第二方面的第三种可能的实现方式或者第二方面的第四种可能的实现方式,在上述第二方面的第六种可能的实现方式中,所述读取单元包括:In combination with the second possible implementation of the second aspect, the third possible implementation of the second aspect, or the fourth possible implementation of the second aspect, the sixth possible implementation of the second aspect above In, the reading unit includes:
拆分子单元,用于基于所述目标数据读请求携带的第二数据量、所述目标数据读请求携带的第二起始地址和所述SOC数据总线的最大数据量,从所述目标数据读请求中拆分出一个子数据读请求,并将所述子数据读请求进行协议转化,得到数据读命令;splitting subunits, for reading from the target data based on the second data amount carried by the target data read request, the second start address carried by the target data read request, and the maximum data amount of the SOC data bus Splitting a sub-data read request from the request, and performing protocol conversion on the sub-data read request to obtain a data read command;
发送子单元,用于将所述数据读命令发送给所述SOC数据总线,使所述SOC数据总线将所述数据读命令发送给SOC的存储资源,所述数据读命令中携带第二子数据量和第二子起始地址;A sending subunit, configured to send the data read command to the SOC data bus, so that the SOC data bus sends the data read command to the storage resource of the SOC, and the data read command carries the second sub-data amount and the second sub-start address;
接收子单元,用于接收所述SOC的存储资源通过所述SOC数据总线发送的读数据,对接收读数据的次数进行统计,得到第二次数;The receiving subunit is used to receive the read data sent by the storage resources of the SOC through the SOC data bus, and count the number of times of receiving the read data to obtain the second number of times;
所述拆分子单元,还用于当所述第二次数达到第三指定次数时,接收所述SOC的存储资源通过所述SOC数据总线发送所述第三指定次数的下一次读数据的过程中,基于所述第二数据量、所述第二起始地址和所述SOC数据总线的最大数据量,从所述目标数据读请求中拆分出下一个子数据读请求,并将所述下一个子数据读请求进行协议转化,得到下一个数据读命令;The splitting subunit is also used in the process of sending the next read data of the third specified number of times by the storage resource receiving the SOC through the SOC data bus when the second number of times reaches the third specified number of times , splitting the next sub-data read request from the target data read request based on the second data amount, the second start address, and the maximum data amount of the SOC data bus, and dividing the next sub-data read request Perform protocol conversion on a sub-data read request to obtain the next data read command;
所述发送子单元,还用于当所述第二次数达到第四指定次数时,接收所述SOC的存储资源通过所述SOC数据总线发送所述第四指定次数的下一次读数据的过程中,将所述下一个数据读命令发送给所述SOC数据总线,并将所述第二次数清零,重新统计第二次数,返回上一拆分子单元,直至将所述目标数据读请求拆分完毕。The sending subunit is also used for receiving the storage resource of the SOC in the process of sending the next read data of the fourth specified number of times through the SOC data bus when the second number of times reaches the fourth specified number of times , sending the next data read command to the SOC data bus, and clearing the second number of times, recounting the second number of times, and returning to the previous split subunit until the target data read request is split complete.
结合第二方面的第二种可能的实现方式、第二方面的第三种可能的实现方式或者第二方面的第四种可能的实现方式,在上述第二方面的第七种可能的实现方式中,所述读取单元包括:In combination with the second possible implementation of the second aspect, the third possible implementation of the second aspect, or the fourth possible implementation of the second aspect, the seventh possible implementation of the second aspect above In, the reading unit includes:
拆分子单元,用于基于所述目标数据读请求携带的第二数据量、所述目标数据读请求携带的第二起始地址和所述SOC数据总线的最大数据量,从所述目标数据读请求中拆分出一个子数据读请求;splitting subunits, for reading from the target data based on the second data amount carried by the target data read request, the second start address carried by the target data read request, and the maximum data amount of the SOC data bus Split a sub-data read request from the request;
协议转化子单元,用于将所述子数据读请求进行协议转化,得到数据读命令,返回上一拆分子单元,直至将所述目标数据读请求拆分完毕;The protocol conversion subunit is used to perform protocol conversion on the sub-data read request, obtain a data read command, and return to the previous split sub-unit until the target data read request is split;
发送子单元,用于将所述数据读命令发送给所述SOC数据总线,使所述SOC数据总线将所述数据读命令发送给SOC的存储资源,所述数据读命令中携带第二子数据量和第二子起始地址;A sending subunit, configured to send the data read command to the SOC data bus, so that the SOC data bus sends the data read command to the storage resource of the SOC, and the data read command carries the second sub-data amount and the second sub-start address;
接收子单元,用于逐次接收所述SOC的存储资源通过所述SOC数据总线发送的读数据。The receiving subunit is configured to successively receive the read data sent by the storage resources of the SOC through the SOC data bus.
结合第二方面,在上述第二方面的第八种可能的实现方式中,所述设备还包括:With reference to the second aspect, in an eighth possible implementation manner of the second aspect above, the device further includes:
统计模块,用于对于每个HAC,当向所述SOC数据总线发送属于所述HAC的数据写命令和数据读命令时,对发送的数据写命令个数进行统计,得到第一命令个数,以及对发送的数据读命令个数进行统计,得到第二命令个数;The statistical module is used for, for each HAC, when sending data write commands and data read commands belonging to the HAC to the SOC data bus, counting the number of data write commands sent to obtain the first number of commands, And counting the number of data read commands sent to obtain the second number of commands;
停止模块,用于当所述第一命令个数等于第一个数阈值时,停止接收所述HAC发送的类型为数据写请求的数据访问请求,直至所述第一命令个数小于所述第一个数阈值;A stop module, configured to stop receiving the data access request sent by the HAC when the number of the first command is equal to the first number threshold, until the number of the first command is less than the first number threshold a number threshold;
所述停止模块,还用于当所述第二命令个数等于第二个数阈值时,停止接收所述HAC发送的类型为数据读请求的数据访问请求,直至所述第二命令个数小于所述第二个数阈值。The stop module is further configured to stop receiving data access requests sent by the HAC when the number of the second commands is equal to the second number threshold until the number of the second commands is less than The second number threshold.
本发明实施例提供的技术方案带来的有益效果是:在本发明实施例中,通过LMI对HAC发送的数据访问请求进行仲裁、拆分以及协议转化,节省了拆分逻辑和协议转化逻辑的重复资源,并且LMI与SOC数据总线连接,SOC数据总线只需为LMI提供访问接口,无需为每个HAC-IF提供数据访问接口,减少了SOC数据总线的访问接口数量。The beneficial effect brought by the technical solution provided by the embodiment of the present invention is: in the embodiment of the present invention, the data access request sent by the HAC is arbitrated, split and protocol converted through the LMI, which saves the cost of split logic and protocol conversion logic. The resources are repeated, and the LMI is connected to the SOC data bus. The SOC data bus only needs to provide an access interface for the LMI, and does not need to provide a data access interface for each HAC-IF, which reduces the number of access interfaces of the SOC data bus.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort.
图1是现有技术提供的一种数据访问系统架构图;Fig. 1 is an architecture diagram of a data access system provided by the prior art;
图2是本发明实施例提供的一种数据访问系统架构图;FIG. 2 is an architecture diagram of a data access system provided by an embodiment of the present invention;
图3是本发明实施例提供的一种数据访问方法流程图;Fig. 3 is a flow chart of a data access method provided by an embodiment of the present invention;
图4是本发明实施例提供的另一种数据访问方法流程图;FIG. 4 is a flow chart of another data access method provided by an embodiment of the present invention;
图5是本发明实施例提供的一种数据访问设备结构示意图;Fig. 5 is a schematic structural diagram of a data access device provided by an embodiment of the present invention;
图6是本发明实施例提供的另一种数据访问设备结构示意图。Fig. 6 is a schematic structural diagram of another data access device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。In order to make the object, technical solution and advantages of the present invention clearer, the implementation manner of the present invention will be further described in detail below in conjunction with the accompanying drawings.
图2是本发明实施例提供的一种数据访问系统架构图。参见图2,该数据访问系统包括多个HAC、多个HAC-IF、LMI(英文:Logic Master Interface;中文:逻辑主接口)、SOC数据总线和SOC的多个存储资源。该多个HAC的输出端与多个HAC-IF的输入端分别连接,且一个HAC可以连接至少一个HAC-IF,每个HAC-IF的输出端分别与LMI的输入端连接,LMI的输出端与SOC数据总线的输入端连接,SOC数据总线的输出端与该多个存储资源分别连接。该多个HAC用于对HAC执行业务过程中产生的任务进行调度,并生成对应的第一数据访问请求;该多个HAC-IF用于将HAC生成的第一数据访问请求发送给LMI,且该多个HAC-IF的输出端接口相同,也即是,LMI只需提供多个相同的接口与多个HAC-IF连接,LMI用于对该多个HAC-IF发送的第一数据访问请求进行仲裁、拆分和协议转化,从而将协议转化后的数据访问命令发送给SOC数据总线;SOC数据总线将接收的数据访问命令发送给对应的存储资源,实现对SOC的存储资源进行访问。FIG. 2 is an architecture diagram of a data access system provided by an embodiment of the present invention. Referring to Fig. 2, the data access system includes multiple HACs, multiple HAC-IFs, LMI (English: Logic Master Interface; Chinese: Logic Master Interface), SOC data bus and multiple storage resources of the SOC. The output terminals of the multiple HACs are respectively connected to the input terminals of multiple HAC-IFs, and one HAC can be connected to at least one HAC-IF, and the output terminals of each HAC-IF are respectively connected to the input terminals of the LMI, and the output terminals of the LMI It is connected to the input end of the SOC data bus, and the output end of the SOC data bus is respectively connected to the plurality of storage resources. The multiple HACs are used to schedule the tasks generated during the HAC's business execution process, and generate corresponding first data access requests; the multiple HAC-IFs are used to send the first data access requests generated by the HACs to the LMI, and The output ports of the multiple HAC-IFs are the same, that is, the LMI only needs to provide multiple identical interfaces to connect to multiple HAC-IFs, and the LMI is used to send the first data access request to the multiple HAC-IFs Carry out arbitration, splitting, and protocol conversion, so as to send the data access command after the protocol conversion to the SOC data bus; the SOC data bus sends the received data access command to the corresponding storage resource, so as to realize the access to the storage resource of the SOC.
图3是本发明实施例提供的一种数据访问方法流程图。参见图3,该方法包括:Fig. 3 is a flowchart of a data access method provided by an embodiment of the present invention. Referring to Figure 3, the method includes:
步骤301:在每个时钟周期,当检测到多个HAC通过与该多个HAC分别连接的HAC-IF发送的数据访问请求时,基于多个数据访问请求的优先级,接收优先级最高的数据访问请求。Step 301: In each clock cycle, when multiple HACs are detected to send data access requests through the HAC-IFs respectively connected to the multiple HACs, based on the priorities of the multiple data access requests, receive the data with the highest priority access request.
步骤302:基于接收的数据访问请求的类型,将接收的数据访问请求存储在LMI的数据队列中。Step 302: Based on the type of the received data access request, store the received data access request in the data queue of the LMI.
步骤303:基于LMI的数据队列中的目标数据访问请求携带的数据量、目标数据访问请求携带的起始地址和SOC数据总线的最大数据量,对SOC的存储资源进行数据访问。Step 303: Based on the amount of data carried by the target data access request in the data queue of the LMI, the start address carried by the target data access request, and the maximum data amount of the SOC data bus, perform data access to the storage resources of the SOC.
在本发明实施例中,通过LMI对HAC发送的数据访问请求进行仲裁、拆分以及协议转化,节省了拆分逻辑和协议转化逻辑的重复资源,并且LMI与SOC数据总线连接,SOC数据总线只需为LMI提供访问接口,无需为每个HAC-IF提供数据访问接口,减少了SOC数据总线的访问接口数量。In the embodiment of the present invention, the data access request sent by the HAC is arbitrated, split, and protocol converted through the LMI, saving the duplicate resources of split logic and protocol conversion logic, and the LMI is connected to the SOC data bus, and the SOC data bus only An access interface needs to be provided for the LMI, and there is no need to provide a data access interface for each HAC-IF, which reduces the number of access interfaces of the SOC data bus.
可选地,基于接收的数据访问请求的类型,将接收的数据访问请求存储在LMI的数据队列中,包括:Optionally, based on the type of the received data access request, the received data access request is stored in the data queue of the LMI, including:
如果接收的数据访问请求的类型为数据写请求,则将接收的数据访问请求存储在LMI的第一数据队列中最后一个数据访问请求之后,第一数据队列用于存储数据写请求;If the type of the received data access request is a data write request, then the received data access request is stored after the last data access request in the first data queue of the LMI, and the first data queue is used to store the data write request;
如果接收的数据访问请求的类型为数据读请求,则将接收的数据访问请求存储在LMI的第二数据队列中最后一个数据访问请求之后,第二数据队列用于存储数据读请求。If the type of the received data access request is a data read request, the received data access request is stored after the last data access request in the second data queue of the LMI, and the second data queue is used for storing the data read request.
可选地,基于LMI的数据队列中的目标数据访问请求携带的数据量、目标数据访问请求携带的起始地址和SOC数据总线的最大数据量,对SOC的存储资源进行数据访问,包括:Optionally, based on the amount of data carried by the target data access request in the data queue of the LMI, the start address carried by the target data access request, and the maximum data amount of the SOC data bus, data access is performed on the storage resources of the SOC, including:
从LMI的第一数据队列中,获取目标数据写请求,以及从LMI的第二数据队列中,获取目标数据读请求;Obtain a target data write request from the first data queue of the LMI, and obtain a target data read request from the second data queue of the LMI;
基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和SOC数据总线的最大数据量,将目标数据写请求的写数据写入SOC的存储资源中;Write the write data of the target data write request into the storage resource of the SOC based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the maximum data volume of the SOC data bus;
基于目标数据读请求携带的第二数据量、目标数据读请求携带的第二起始地址和SOC数据总线的最大数据量,从SOC的存储资源中读取目标数据读请求的读数据。Based on the second data amount carried by the target data read request, the second start address carried by the target data read request, and the maximum data amount of the SOC data bus, the read data of the target data read request is read from the storage resource of the SOC.
可选地,基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和SOC数据总线的最大数据量,将目标数据写请求的写数据写入SOC的存储资源中,包括:Optionally, write the write data of the target data write request into the storage resources of the SOC based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the maximum data amount of the SOC data bus ,include:
基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和芯片数据总线的位宽,从目标HAC中获取写数据,并对获取写数据的次数进行统计,得到第一次数,目标HAC为发送目标数据写请求的HAC;Based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, the write data is obtained from the target HAC, and the number of times of obtaining the write data is counted to obtain the first One time, the target HAC is the HAC that sends the target data write request;
当第一次数达到第一指定次数时,从目标HAC中获取第一指定次数的下一次写数据的过程中,基于第一数据量、第一起始地址和SOC数据总线的最大数据量,从目标数据写请求中拆分出一个子数据写请求,并将该子数据写请求进行协议转化,得到数据写命令,该数据写命令携带第一子数据量和第一子起始地址;When the first number reaches the first specified number of times, in the process of obtaining the next write data of the first specified number of times from the target HAC, based on the first data amount, the first starting address and the maximum data amount of the SOC data bus, from Splitting a sub-data write request from the target data write request, and performing protocol conversion on the sub-data write request to obtain a data write command, the data write command carries the first sub-data amount and the first sub-start address;
当第一次数达到第二指定次数时,从目标HAC中获取第二指定次数的下一次写数据的过程中,将该数据写命令发送给SOC数据总线,并将第一次数清零,重新统计第一次数,返回上一步骤,直至将目标数据写请求拆分完毕;When the first number reaches the second specified number of times, in the process of obtaining the next write data of the second specified number of times from the target HAC, the data write command is sent to the SOC data bus, and the first number is cleared, Re-count the number for the first time, and return to the previous step until the splitting of the target data write request is completed;
当接收到SOC数据总线返回的数据写响应时,将多次从目标HAC中获取数据写命令的写数据,逐次发送给SOC数据总线,使SOC数据总线按照第一子数据量和第一子起始地址,将接收的写数据写入SOC的存储资源中。When receiving the data write response returned by the SOC data bus, the write data of the data write command will be obtained from the target HAC multiple times, and sent to the SOC data bus one by one, so that the SOC data bus will start according to the first sub data volume and the first sub data. Write the received write data into the storage resources of the SOC.
可选地,基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和SOC数据总线的最大数据量,将目标数据写请求的写数据写入SOC的存储资源中,包括:Optionally, write the write data of the target data write request into the storage resources of the SOC based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the maximum data amount of the SOC data bus ,include:
基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和芯片数据总线的位宽,从目标HAC中获取写数据,并对获取写数据的次数进行统计,得到第一次数,目标HAC为发送目标数据写请求的HAC;Based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, the write data is obtained from the target HAC, and the number of times of obtaining the write data is counted to obtain the first One time, the target HAC is the HAC that sends the target data write request;
当第一次数达到第一指定次数时,从目标HAC中获取第一指定次数的下一次写数据的过程中,基于第一数据量、第一起始地址和SOC数据总线的最大数据量,从目标数据写请求中拆分出一个子数据写请求,将该子数据写请求进行协议转化,得到数据写命令,返回本步骤,直至将目标数据写请求拆分完毕;When the first number reaches the first specified number of times, in the process of obtaining the next write data of the first specified number of times from the target HAC, based on the first data amount, the first starting address and the maximum data amount of the SOC data bus, from Split a sub-data write request from the target data write request, perform protocol conversion on the sub-data write request, obtain a data write command, and return to this step until the split of the target data write request is completed;
将该数据写命令发送给SOC数据总线,该数据写命令携带第一子数据量和第一子起始地址;Send the data write command to the SOC data bus, the data write command carries the first sub-data volume and the first sub-start address;
当接收到SOC数据总线返回的数据写响应时,将多次从目标HAC中获取的写数据,逐次发送给SOC数据总线,使SOC数据总线按照第一子数据量和第一子起始地址,将接收的写数据写入SOC的存储资源中。When the data write response returned by the SOC data bus is received, the write data obtained from the target HAC is sent to the SOC data bus one by one, so that the SOC data bus is based on the first sub-data volume and the first sub-start address, Write the received write data into the storage resources of the SOC.
可选地,基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和芯片数据总线的位宽,从目标HAC中获取写数据,并对获取写数据的次数进行统计,得到第一次数,包括:Optionally, based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, the write data is obtained from the target HAC, and the number of times of obtaining the write data is calculated. Statistics, get the first number, including:
基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和芯片数据总线的位宽,计算从目标HAC中获取写数据的获取次数,该芯片数据总线为与LMI连接的数据总线;Based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, calculate the number of acquisitions of the write data from the target HAC, the chip data bus is connected to the LMI data bus;
基于该获取次数,向目标HAC发送指示信息,该指示信息用于指示目标HAC将目标数据写请求的写数据划分为获取次数次进行发送;Based on the acquisition times, send indication information to the target HAC, where the indication information is used to instruct the target HAC to divide the write data of the target data write request into acquisition times and send them;
接收目标HAC发送的写数据,并对接收写数据的次数进行统计,得到第一次数。Receive the write data sent by the target HAC, and count the number of times the write data is received to obtain the first count.
可选地,基于目标数据读请求携带的第二数据量、目标数据读请求携带的第二起始地址和SOC数据总线的最大数据量,从SOC的存储资源中读取目标数据读请求的读数据,包括:Optionally, based on the second data amount carried by the target data read request, the second start address carried by the target data read request, and the maximum data amount of the SOC data bus, the read data of the target data read request is read from the storage resource of the SOC. data, including:
基于目标数据读请求携带的第二数据量、目标数据读请求携带的第二起始地址和SOC数据总线的最大数据量,从目标数据读请求中拆分出一个子数据读请求,并将该子数据读请求进行协议转化,得到数据读命令;Based on the second data volume carried by the target data read request, the second start address carried by the target data read request, and the maximum data volume of the SOC data bus, a sub-data read request is split from the target data read request, and the The sub-data read request performs protocol conversion to obtain a data read command;
将该数据读命令发送给SOC数据总线,使SOC数据总线将该数据读命令发送给SOC的存储资源,该数据读命令中携带第二子数据量和第二子起始地址;Send the data read command to the SOC data bus, so that the SOC data bus sends the data read command to the storage resource of the SOC, and the data read command carries the second sub-data volume and the second sub-start address;
接收SOC的存储资源通过SOC数据总线发送的读数据,对接收读数据的次数进行统计,得到第二次数;receiving the read data sent by the storage resources of the SOC through the SOC data bus, counting the number of times of receiving the read data, and obtaining the second number of times;
当第二次数达到第三指定次数时,接收SOC的存储资源通过SOC数据总线发送该第三指定次数的下一次读数据的过程中,基于第二数据量、第二起始地址和SOC数据总线的最大数据量,从目标数据读请求中拆分出下一个子数据读请求,并将下一个子数据读请求进行协议转化,得到下一个数据读命令;When the second number of times reaches the third specified number of times, the storage resource receiving the SOC sends the next read data of the third specified number of times through the SOC data bus, based on the second data amount, the second start address and the SOC data bus split the next sub-data read request from the target data read request, and perform protocol conversion on the next sub-data read request to obtain the next data read command;
当第二次数达到第四指定次数时,接收SOC的存储资源通过SOC数据总线发送第四指定次数的下一次读数据的过程中,将该下一个数据读命令发送给SOC数据总线,并将第二次数清零,重新统计第二次数,返回上一步骤,直至将目标数据读请求拆分完毕。When the second number of times reaches the fourth specified number of times, the storage resource receiving the SOC sends the next read data of the fourth specified number of times through the SOC data bus, sends the next data read command to the SOC data bus, and sends the first The second count is cleared, the second count is counted again, and the previous step is returned until the target data read request is split.
可选地,基于目标数据读请求携带的第二数据量、目标数据读请求携带的第二起始地址和SOC数据总线的最大数据量,从SOC的存储资源中读取目标数据读请求的读数据,包括:Optionally, based on the second data amount carried by the target data read request, the second start address carried by the target data read request, and the maximum data amount of the SOC data bus, the read data of the target data read request is read from the storage resource of the SOC. data, including:
基于目标数据读请求携带的第二数据量、目标数据读请求携带的第二起始地址和SOC数据总线的最大数据量,从目标数据读请求中拆分出一个子数据读请求;Splitting a sub-data read request from the target data read request based on the second data amount carried by the target data read request, the second start address carried by the target data read request, and the maximum data amount of the SOC data bus;
将该子数据读请求进行协议转化,得到数据读命令,返回上一步骤,直至将目标数据读请求拆分完毕;Perform protocol conversion on the sub-data read request to obtain a data read command, and return to the previous step until the target data read request is split;
将该数据读命令发送给SOC数据总线,使SOC数据总线将该数据读命令发送给SOC的存储资源,该数据读命令中携带第二子数据量和第二子起始地址;Send the data read command to the SOC data bus, so that the SOC data bus sends the data read command to the storage resource of the SOC, and the data read command carries the second sub-data volume and the second sub-start address;
逐次接收SOC的存储资源通过SOC数据总线发送的读数据。Receive the read data sent by the storage resources of the SOC through the SOC data bus one by one.
可选地,该方法还包括:Optionally, the method also includes:
对于每个HAC,当向SOC数据总线发送属于该HAC的数据写命令和数据读命令时,对发送的数据写命令个数进行统计,得到第一命令个数,以及对发送的数据读命令个数进行统计,得到第二命令个数;For each HAC, when sending data write commands and data read commands belonging to the HAC to the SOC data bus, the number of data write commands sent is counted to obtain the first number of commands and the number of data read commands sent The number is counted to obtain the number of the second command;
当第一命令个数等于第一个数阈值时,停止接收该HAC发送的类型为数据写请求的数据访问请求,直至第一命令个数小于第一个数阈值;When the number of the first command is equal to the first number threshold, stop receiving the data access request sent by the HAC as a data write request until the number of the first command is less than the first number threshold;
当第二命令个数等于第二个数阈值时,停止接收该HAC发送的类型为数据读请求的数据访问请求,直至第二命令个数小于第二个数阈值。When the second number of commands is equal to the second number threshold, stop receiving data access requests of the type sent by the HAC, which are data read requests, until the second number of commands is less than the second number threshold.
上述所有可选技术方案,均可按照任意结合形成本发明的可选实施例,本发明实施例对此不再一一赘述。All the above optional technical solutions can be combined in any way to form optional embodiments of the present invention, which will not be repeated in the embodiments of the present invention.
图4是本发明实施例提供的一种数据访问方法流程图。参见图4,该方法包括:Fig. 4 is a flowchart of a data access method provided by an embodiment of the present invention. Referring to Figure 4, the method includes:
步骤401:对于每个HAC,当该HAC生成数据访问请求时,将该数据访问请求通过与该HAC连接的HAC-IF发送给LMI。Step 401: For each HAC, when the HAC generates a data access request, send the data access request to the LMI through the HAC-IF connected to the HAC.
具体地,对于每个HAC,当该HAC生成数据访问请求时,如果与该HAC连接的HAC-IF为多个,则该HAC可以从与其连接的多个HAC-IF中,选择一个处于空闲状态的HAC-IF,之后,将生成的数据访问请求发送给选择的HAC-IF。当选择的HAC-IF接收到该数据访问请求时,将该数据访问请求发送给LMI。Specifically, for each HAC, when the HAC generates a data access request, if there are multiple HAC-IFs connected to the HAC, the HAC can select one of the multiple HAC-IFs connected to it to be in an idle state The selected HAC-IF then sends the generated data access request to the selected HAC-IF. When the selected HAC-IF receives the data access request, it sends the data access request to the LMI.
在本发明实施例中,一个HAC可以连接多个HAC-IF,该HAC生成的数据访问请求可以通过该多个HAC-IF发送给LMI,提升了系统的并行调度性能。并且通过LMI连接HAC与SOC数据总线,实现了HAC与SOC数据总线的解耦。In the embodiment of the present invention, one HAC can be connected to multiple HAC-IFs, and the data access requests generated by the HAC can be sent to the LMI through the multiple HAC-IFs, which improves the parallel scheduling performance of the system. Moreover, the HAC and the SOC data bus are connected through the LMI to realize the decoupling of the HAC and the SOC data bus.
步骤402:LMI在每个时钟周期,当检测到多个HAC通过与该多个HAC分别连接的HAC-IF发送的数据访问请求时,基于该多个数据访问请求的优先级,接收优先级最高的数据访问请求。Step 402: In each clock cycle, when the LMI detects data access requests sent by multiple HACs through the HAC-IFs connected to the multiple HACs, based on the priorities of the multiple data access requests, the receiving priority is the highest data access requests.
具体地,在每个时钟周期,当LMI检测到多个HAC通过与该多个HAC分别连接的HAC-IF发送的数据访问请求时,LMI获取该多个数据访问请求的优先级,从该多个数据访问请求中,选择优先级最高的数据访问请求,并接收优先级最高的数据访问请求。Specifically, in each clock cycle, when the LMI detects data access requests sent by multiple HACs through the HAC-IFs respectively connected to the multiple HACs, the LMI obtains the priorities of the multiple data access requests, and obtains the priorities of the multiple data access requests from the multiple HACs. Among the data access requests, select the data access request with the highest priority and receive the data access request with the highest priority.
需要说明的是,在当前时钟周期,LMI未接收的数据访问请求,在下一个时钟周期,LMI还可以基于上述仲裁的方法,接收优先级最高的数据访问请求。其中,在本发明实施例中,LMI在每个时钟周期,选择并接收优先级最高的数据访问请求的方法可以称为LMI对多个数据访问请求的仲裁。It should be noted that, in the current clock cycle, the LMI does not receive the data access request, and in the next clock cycle, the LMI may also receive the data access request with the highest priority based on the above arbitration method. Wherein, in the embodiment of the present invention, the method for the LMI to select and receive the data access request with the highest priority in each clock cycle may be referred to as the arbitration of multiple data access requests by the LMI.
比如,在第一时钟周期,LMI检测到3个数据访问请求,分别为数据访问请求1、数据访问请求2和数据访问请求3,数据访问请求1的优先级大于数据访问请求2的优先级,数据访问请求2的优先级大于数据访问请求3的优先级,因此,LMI在第一时钟周期选择并接收数据访问请求1。在第二时钟周期,如果没有新的HAC生成数据访问请求,则LMI会检测到数据访问请求2和数据访问请求3,由于数据访问请求2的优先级大于数据访问请求3的优先级,因此,在第二时钟周期,LMI会选择并接收数据访问请求2。For example, in the first clock cycle, LMI detects three data access requests, which are data access request 1, data access request 2, and data access request 3, and the priority of data access request 1 is higher than that of data access request 2. The priority of data access request 2 is higher than that of data access request 3, therefore, the LMI selects and receives data access request 1 in the first clock cycle. In the second clock cycle, if no new HAC generates a data access request, the LMI will detect data access request 2 and data access request 3, since the priority of data access request 2 is higher than that of data access request 3, therefore, On the second clock cycle, the LMI selects and accepts Data Access Request 2.
需要说明的是,当HAC-IF对数据访问请求进行拆分和协议转化、SOC数据总线对数据访问命令进行仲裁时,如果该HAC-IF发送的数据访问命令所属的数据访问请求的优先级最高,当HAC-IF与SOC数据总线之间的通道出现异常时,SOC数据总线在当前时刻就无法处理该HAC-IF发送的数据访问命令,进而会影响后续其他HAC-IF发送的数据访问命令的处理,需要对HAC-IF、HAC、数据总线等都进行复位。而在本发明实施例中,LMI接收HAC发送的数据访问请求,并将接收的数据访问请求存储在LMI的数据队列中,如此,当HAC-IF与LMI之间的通道出现故障时,LMI会继续将数据队列中存储的该HAC发送的数据访问请求进行处理,不会影响与该HAC的数据访问请求处于同一数据队列中的其他数据访问请求的处理,支持单个HAC出现异常可以自恢复,不会影响其余HAC对SOC存储资源的访问,此时,需要对出现异常的HAC进行复位,无需对LMI、SOC数据总线等进行复位。It should be noted that when the HAC-IF splits and converts the data access request and the SOC data bus arbitrates the data access command, if the data access request sent by the HAC-IF has the highest priority , when the channel between the HAC-IF and the SOC data bus is abnormal, the SOC data bus cannot process the data access commands sent by the HAC-IF at the current moment, which will affect the subsequent data access commands sent by other HAC-IFs. For processing, it is necessary to reset the HAC-IF, HAC, data bus, etc. In the embodiment of the present invention, the LMI receives the data access request sent by the HAC, and stores the received data access request in the data queue of the LMI. In this way, when the channel between the HAC-IF and the LMI fails, the LMI will Continue to process the data access request sent by the HAC stored in the data queue, without affecting the processing of other data access requests in the same data queue as the data access request of the HAC. It supports self-recovery when a single HAC is abnormal. It will affect other HACs' access to SOC storage resources. At this time, it is necessary to reset the abnormal HAC, and it is not necessary to reset the LMI, SOC data bus, and the like.
另外,将数据访问请求存储在LMI的数据队列中,如此,HAC无需等上一个数据访问请求处理完毕之后,才发送下一个数据访问请求,只需确定上一个数据访问请求被LMI接收并存储在数据队列中,就可以发送下一个数据访问请求,支持HAC连续地发送数据访问请求,最大化地利用LMI与HAC之间的数据总线,提高总线利用率。In addition, the data access request is stored in the data queue of the LMI. In this way, the HAC does not need to wait for the previous data access request to be processed before sending the next data access request. It only needs to confirm that the last data access request is received by the LMI and stored in the In the data queue, the next data access request can be sent, supporting the HAC to send data access requests continuously, maximizing the use of the data bus between the LMI and the HAC, and improving bus utilization.
步骤403:LMI基于接收的数据访问请求的类型,将接收的数据访问请求存储在LMI的数据队列中,LMI包括第一数据队列和第二数据队列,第一数据队列用于存储数据写请求,第二数据队列用于存储数据读请求。Step 403: The LMI stores the received data access request in the data queue of the LMI based on the type of the received data access request, the LMI includes a first data queue and a second data queue, the first data queue is used to store the data write request, The second data queue is used to store data read requests.
具体地,如果接收的数据访问请求的类型为数据写请求,则LMI将接收的数据访问请求存储在第一数据队列中最后一个数据访问请求之后;如果接收的数据访问请求的类型为数据读请求,则将接收的数据访问请求存储在第二数据队列中最后一个数据访问请求之后。Specifically, if the type of the received data access request is a data write request, then the LMI stores the received data access request after the last data access request in the first data queue; if the type of the received data access request is a data read request , then store the received data access request after the last data access request in the second data queue.
需要说明的是,在本发明实施例中,第一数据队列和第二数据队列均可以为先入先出的数据队列,比如FIFO(英文:First Input First Output;中文:先入先出),本发明实施例对此不做具体限定。另外,在本发明实施例中,每个HAC生成的数据访问请求之间互不影响,因此,可以将数据读请求存储在一个数据队列中,将数据写请求存储在另一个数据队列中,且该两个数据队列可以相互独立,互不影响,进而可以并行地访问SOC的存储资源。It should be noted that, in the embodiment of the present invention, both the first data queue and the second data queue can be first-in-first-out data queues, such as FIFO (English: First Input First Output; Chinese: First In First Out), the present invention The embodiment does not specifically limit this. In addition, in the embodiment of the present invention, the data access requests generated by each HAC do not affect each other, therefore, the data read request can be stored in one data queue, and the data write request can be stored in another data queue, and The two data queues can be independent of each other without affecting each other, and thus can access the storage resources of the SOC in parallel.
通过上述401-403的步骤,LMI可以在每个时钟周期接收一个优先级最高的数据访问请求,并存储在LMI的数据队列中。并且在LMI接收优先级最高的数据访问请求的同时,还可以根据如下404-411的步骤,对LMI的数据队列中存储的数据访问请求进行并行处理。另外,第一数据队列中存储的数据访问请求和第二数据队列中存储的数据访问请求之间互不影响,因此,可以通过如下405-408的步骤是对第一数据队列中存储的数据访问请求进行处理,通过如下409-411的步骤对第二数据队列中存储的数据访问请求进行处理,且405-408的步骤可以与409-411的步骤并行执行。Through the above steps 401-403, the LMI can receive a data access request with the highest priority every clock cycle, and store it in the data queue of the LMI. And while the LMI is receiving the data access request with the highest priority, the data access requests stored in the data queue of the LMI can also be processed in parallel according to the following steps 404-411. In addition, the data access requests stored in the first data queue and the data access requests stored in the second data queue do not affect each other, therefore, the data access stored in the first data queue can be accessed through the following steps 405-408 The request is processed, and the data access request stored in the second data queue is processed through the following steps 409-411, and the steps 405-408 can be executed in parallel with the steps 409-411.
步骤404:LMI从第一数据队列中,获取目标数据写请求,以及从第二数据队列中,获取目标数据读请求。Step 404: The LMI acquires the target data write request from the first data queue, and acquires the target data read request from the second data queue.
具体地,LMI从第一数据队列中,选择排列在第一位的数据访问请求,将选择的数据访问请求确定为目标数据写请求,以及从第二数据队列中,选择排列在第一位的数据访问请求,将选择的数据访问请求确定为目标数据读请求。Specifically, the LMI selects the first data access request from the first data queue, determines the selected data access request as the target data write request, and selects the first data access request from the second data queue. A data access request, determining the selected data access request as a target data read request.
步骤405:LMI基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和芯片数据总线的位宽,从目标HAC中获取写数据,并对获取写数据的次数进行统计,得到第一次数,目标HAC为发送目标数据写请求的HAC。Step 405: Based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, the LMI obtains the write data from the target HAC, and calculates the number of times of obtaining the write data. Statistics, get the first number, the target HAC is the HAC that sends the target data write request.
具体地,LMI基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和芯片数据总线的位宽,计算从目标HAC中获取写数据的获取次数,芯片数据总线为与LMI连接的数据总线。基于该获取次数,向目标HAC发送指示信息,该指示信息用于指示目标HAC将目标数据写请求的写数据划分为获取次数次进行发送。当目标HAC接收到该指示信息时,目标HAC基于该获取次数,将目标数据写请求的写数据进行划分,得到多个写数据块,并将划分后得到的多个写数据块,在多个连续的时钟周期,分别发送给LMI。LMI接收目标HAC发送的写数据,并对接收写数据的次数进行统计,得到第一次数。Specifically, the LMI calculates the number of acquisitions of write data from the target HAC based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus. The chip data bus is Data bus to interface with LMI. Based on the number of times of acquisition, indication information is sent to the target HAC, where the indication information is used to instruct the target HAC to divide the write data of the target data write request into the number of times of acquisition and send it. When the target HAC receives the indication information, the target HAC divides the write data of the target data write request based on the acquisition times to obtain multiple write data blocks, and divides the multiple write data blocks obtained after division into multiple Consecutive clock cycles, respectively sent to the LMI. The LMI receives the write data sent by the target HAC, and counts the number of times the write data is received to obtain the first count.
LMI基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和芯片数据总线的位宽,计算从目标HAC中获取写数据的获取次数的具体操作可以为:LMI基于目标数据写请求携带的第一起始地址,判断第一起始地址与目标HAC中存储写数据的起始存储地址是否地址对齐,如果地址对齐,则将目标数据写请求携带的第一数据量除以芯片数据总线的位宽,得到获取次数。如果地址不对齐,则将芯片数据总线的位宽减去第一起始地址对应的比特,得到获取数据量,之后,将第一数据量除以获取数据量,将得到的数值向上取整,得到获取次数。Based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, the LMI calculates the number of acquisitions of the write data from the target HAC. The specific operation can be: LMI based on The first start address carried by the target data write request, judge whether the first start address is aligned with the start storage address of the target HAC storing the write data, and if the addresses are aligned, divide the first data amount carried by the target data write request by The bit width of the chip data bus to get the number of acquisitions. If the addresses are not aligned, subtract the bits corresponding to the first start address from the bit width of the chip data bus to obtain the acquired data volume, and then divide the first data volume by the acquired data volume, and round up the obtained value to obtain Acquisitions.
比如,芯片数据总线的位宽为16bit,第一数据量为48bit,如果第一起始地址为0bit对应位置,目标HAC中存储写数据的起始存储地址为0bit对应位置,那么两者地址对齐。此时,将第一数据量48bit除以芯片数据总线的位宽16bit,得到获取次数为3。如果第一起始地址为1bit对应位置,目标HAC中存储写数据的起始存储地址为0bit对应位置,那么两者地址不对齐,将芯片数据总线的位宽16bit减去第一起始地址对应的1bit,得到获取数据量为15bit,之后,将第一数据量48bit除以获取数据量15bit,得到的数值为3.2,将3.2向上取整,得到获取次数为4。For example, the bit width of the chip data bus is 16 bits, and the first data volume is 48 bits. If the first start address is the corresponding position of 0 bit, and the starting storage address of the target HAC storing the write data is the corresponding position of 0 bit, then the two addresses are aligned. At this time, divide the first data amount of 48 bits by the bit width of the chip data bus of 16 bits, and obtain the acquisition times as 3. If the first starting address corresponds to 1 bit, and the starting storage address of the target HAC to store write data is corresponding to 0 bit, then the two addresses are not aligned, and the bit width of the chip data bus is 16 bits minus 1 bit corresponding to the first starting address , the acquired data amount is 15 bits, and then, divide the first data amount 48 bits by the acquired data amount 15 bits, and the obtained value is 3.2, round up 3.2, and the obtained number of times is 4.
再比如,获取次数为3,则目标HAC将目标数据写请求的写数据进行划分,得到3个数据块,并在3个连续的时钟周期,分别将该3个数据块发送给LMI,使LMI在3个时钟周期,分别从目标HAC中获取一次写数据。For another example, if the number of acquisitions is 3, the target HAC divides the write data of the target data write request to obtain 3 data blocks, and sends the 3 data blocks to the LMI respectively in 3 consecutive clock cycles, so that the LMI In 3 clock cycles, write data is obtained from the target HAC respectively.
需要说明的是,与LMI连接的数据总线包括LMI与SOC数据总线之间的数据总线,还包括LMI与HAC-IF连接的数据总线,且该两个数据总线的位宽相同。另外,判断地址是否对齐的方法可以参考相关技术,并且当地址对齐时,总线每次能传输多少的数据量,地址不对齐时,总线每次又能传输多少的数据量都可以参考相关技术。It should be noted that the data bus connected to the LMI includes the data bus between the LMI and the SOC data bus, and also includes the data bus connected between the LMI and the HAC-IF, and the two data buses have the same bit width. In addition, the method for judging whether the addresses are aligned can refer to related technologies, and when the addresses are aligned, how much data the bus can transmit each time, and when the addresses are not aligned, how much data the bus can transmit each time can refer to related technologies.
步骤406:当第一次数达到第一指定次数时,从目标HAC中获取第一指定次数的下一次写数据的过程中,基于第一数据量、第一起始地址和SOC数据总线的最大数据量,从目标数据写请求中拆分出一个子数据写请求,并将该子数据写请求进行协议转化,得到数据写命令,该数据写命令携带第一子数据量和第一子起始地址。Step 406: When the first number reaches the first specified number of times, in the process of obtaining the next write data of the first specified number of times from the target HAC, based on the first data amount, the first start address and the maximum data of the SOC data bus Amount, split a sub-data write request from the target data write request, and convert the sub-data write request to a protocol to obtain a data write command, the data write command carries the first sub-data amount and the first sub-start address .
具体地,将第一次数与第一指定次数进行比较,当第一次数等于第一指定次数时,接收目标HAC发送第一指定次数的下一次写数据的过程中,基于SOC数据总线的最大数据量,将第一数据量进行划分,得到多个第一子数据量,且多个第一子数据量小于或等于SOC数据总线的最大数据量。获取第一子起始地址,生成子数据写请求,该子数据写请求携带第一子数据量和第一子起始地址。将该子数据写请求进行协议转化,得到数据写命令,该数据写命令携带第一子数据量和第一子起始地址。Specifically, the first count is compared with the first specified count, and when the first count is equal to the first specified count, in the process of receiving the target HAC sending the next write data for the first specified count, based on the SOC data bus For the maximum data volume, the first data volume is divided to obtain multiple first sub-data volumes, and the multiple first sub-data volumes are less than or equal to the maximum data volume of the SOC data bus. The first sub-start address is acquired, and a sub-data write request is generated, where the sub-data write request carries the first sub-data amount and the first sub-start address. Perform protocol conversion on the sub-data write request to obtain a data write command, and the data write command carries the first sub-data amount and the first sub-start address.
获取第一子起始地址包括:对于第一个拆分出的子数据写请求,该子数据写请求的第一子起始地址为第一起始地址。对于其他子数据写请求,该其他子数据写请求的第一子起始地址为上一个子数据写请求的结束地址之后连续的地址。也即是,基于第一子数据量和上一个拆分的子数据写请求携带的第一子起始地址,计算当前拆分的子数据写请求的第一子起始地址,其他子数据写请求为第一个拆分出的子数据写请求之后拆分出的子数据写请求。另外,基于第一子数据量和上一个拆分的子数据写请求携带的第一子起始地址,计算当前拆分的子数据写请求的第一子起始地址的方法可以参考现有方式,本发明实施例对此不做详细阐述。Obtaining the first sub-start address includes: for the first split sub-data write request, the first sub-start address of the sub-data write request is the first start address. For other sub-data write requests, the first sub-start address of the other sub-data write request is an address continuous after the end address of the previous sub-data write request. That is, based on the first sub-data amount and the first sub-start address carried in the last split sub-data write request, calculate the first sub-start address of the current split sub-data write request, and other sub-data write The request is a sub-data write request split after the first split sub-data write request. In addition, based on the first sub-data amount and the first sub-start address carried in the last split sub-data write request, the method of calculating the first sub-start address of the current split sub-data write request can refer to the existing method , which is not described in detail in the embodiment of the present invention.
在本发明实施例中,从目标HAC中获取写数据时,存在数据反馈的延迟时间,并且从目标数据写请求中拆分子数据写请求只需一个时钟周期,因此,优选地,可以设置第一指定次数为每个子数据写请求的写数据获取次数减去2,也即是,第一子数据量对应的写数据获取次数减去2。这样,在获取当前子数据写请求的倒数第二次写数据的过程中,可以从目标数据写请求中拆分出当前子数据写请求,有效利用数据反馈的延迟时间,提高了数据访问效率。In the embodiment of the present invention, when the write data is obtained from the target HAC, there is a delay time for data feedback, and it only takes one clock cycle to split the sub-data write request from the target data write request. Therefore, preferably, the first The specified number of times is the number of write data acquisitions for each sub-data write request minus 2, that is, the number of write data acquisitions corresponding to the first amount of sub-data minus 2. In this way, in the process of obtaining the penultimate write data of the current sub-data write request, the current sub-data write request can be split from the target data write request, effectively utilizing the delay time of data feedback, and improving data access efficiency.
当然,第一指定次数还可以为每个子数据写请求的写数据获取次数减去3、4等,且第一指定次数大于1即可,本发明实施例对此不做具体限定。Of course, the first specified number of times may also be the write data acquisition times of each sub-data write request minus 3, 4, etc., and the first specified number of times only needs to be greater than 1, which is not specifically limited in this embodiment of the present invention.
需要说明的是,在本发明实施例中,SOC数据总线单次访问的数据量一定,因此,在本发明实施例中,如果目标数据写请求携带的第一数据量大于SOC数据总线的最大数据量时,需要对目标数据写请求进行拆分,使拆分后的子数据写请求携带的第一子数据量小于或等于SOC数据总线单次访问的最大数据量。而为了尽可能地提高数据访问效率,可以使第一子数据量尽可能地等于SOC数据总线单次访问的最大数据量。It should be noted that, in the embodiment of the present invention, the amount of data for a single access of the SOC data bus is constant. Therefore, in the embodiment of the present invention, if the first data amount carried by the target data write request is greater than the maximum data of the SOC data bus When the amount is large, it is necessary to split the target data write request so that the first sub-data amount carried by the split sub-data write request is less than or equal to the maximum data amount of a single access of the SOC data bus. In order to improve data access efficiency as much as possible, the first sub-data volume may be equal to the maximum data volume of a single access of the SOC data bus as much as possible.
步骤407:当第一次数达到第二指定次数时,从目标HAC中获取第二指定次数的下一次写数据的过程中,将该数据写命令发送给SOC数据总线,并将第一次数清零,重新统计第一次数,返回步骤406,直至将目标数据写请求拆分完毕。Step 407: When the first number reaches the second specified number of times, in the process of obtaining the next write data of the second specified number of times from the target HAC, send the data write command to the SOC data bus, and send the first number Clear to zero, re-count the number for the first time, and return to step 406 until the splitting of the target data write request is completed.
具体地,将第一次数与第二指定次数进行比较,当第一次数等于第二指定次数时,接收目标HAC发送的第二指定次数的下一次写数据的过程中,将该数据写命令发送给SOC数据总线,使SOC数据总线将该数据写命令发送给SOC的存储资源,并将第一次数清零。当再接收到目标HAC发送的写数据时,重新对接收写数据的次数进行统计,也即是,重新统计第一次数,返回步骤406,直至将目标数据写请求拆分完毕。Specifically, compare the first number with the second specified number, and when the first number is equal to the second specified number, during the process of receiving the next write data for the second specified number of times sent by the target HAC, write the data to The command is sent to the SOC data bus, so that the SOC data bus sends the data write command to the storage resource of the SOC, and the first number is cleared. When the write data sent by the target HAC is received again, count the number of times of receiving write data again, that is, re-count the number for the first time, and return to step 406 until the split of the target data write request is completed.
在本发明实施例中,从目标HAC中获取写数据时,存在数据反馈的延迟时间,并且将数据写命令发送给SOC数据总线只需一个时钟周期,因此,优选地,可以设置第二指定次数为每个子数据写请求的写数据获取次数减去1,也即是,第一子数据量对应的写数据获取次数减去1。这样,在获取当前子数据访问请求的最后一次写数据的过程中,可以将该数据写命令发送给SOC数据总线,有效利用数据反馈的延迟时间,提高了数据访问效率。In the embodiment of the present invention, when the write data is obtained from the target HAC, there is a delay time for data feedback, and it only takes one clock cycle to send the data write command to the SOC data bus. Therefore, preferably, the second specified number of times can be set The write data acquisition times for each sub-data write request is subtracted by 1, that is, the write data acquisition times corresponding to the first sub-data amount is subtracted by 1. In this way, during the process of obtaining the last write data of the current sub-data access request, the data write command can be sent to the SOC data bus, effectively utilizing the delay time of data feedback, and improving the data access efficiency.
步骤408:当接收到SOC数据总线返回的数据写响应时,将多次从目标HAC中获取该数据写命令的写数据,逐次发送给SOC数据总线,使SOC数据总线按照第一子数据量和第一子起始地址,将接收的写数据写入SOC的存储资源中,结束操作。Step 408: When receiving the data write response returned by the SOC data bus, the write data of the data write command will be obtained from the target HAC for multiple times, and sent to the SOC data bus one by one, so that the SOC data bus will follow the first sub-data amount and The first sub-start address writes the received write data into the storage resources of the SOC, and ends the operation.
具体地,当接收到SOC数据总线返回的数据写响应时,将多次从目标HAC中获取该数据写命令的写数据,逐次发送给SOC数据总线,使SOC数据总线将该写数据发送给SOC的存储资源,由SOC的存储资源按照第一子数据量和第一子起始地址,将接收的写数据写入SOC的存储资源中。Specifically, when receiving the data write response returned by the SOC data bus, the write data of the data write command will be obtained from the target HAC multiple times, and sent to the SOC data bus one by one, so that the SOC data bus sends the write data to the SOC The storage resource of the SOC writes the received write data into the storage resource of the SOC according to the first sub-data amount and the first sub-start address.
在本发明实施例中,通过上述405-408的步骤,在下一个数据写命令发送之前,预先从目标数据写请求中拆分该下一个数据写命令,并且在上一个数据写命令的最后一次写数据发送的同时,将下一个数据写命令发送给SOC数据总线,使写操作实现流水操作,进而保证SOC数据总线的有效利用,并且通过此方式,还可以防止写数据未发送出去,过多的数据写命令无效占住SOC存储资源的端口,导致其余总线的访问者无法访问。In the embodiment of the present invention, through the above-mentioned steps 405-408, before the next data write command is sent, the next data write command is split from the target data write request in advance, and the last write of the previous data write command At the same time as the data is sent, the next data write command is sent to the SOC data bus, so that the write operation can achieve pipeline operation, thereby ensuring the effective use of the SOC data bus, and in this way, it can also prevent the write data from being sent out, and excessive The invalid data write command occupies the port of the SOC storage resource, causing the rest of the bus visitors to be unable to access.
可选地,在本发明实施例中,不仅可以通过上述405-408的步骤,将目标数据写请求进行拆分、协议转化等操作,实现对SOC的存储资源的访问,还可以通过如下(1)-(4)的步骤来实现,包括:Optionally, in the embodiment of the present invention, not only can the target data write request be split, protocol converted and other operations can be performed through the above steps 405-408 to realize access to the storage resources of the SOC, but also the following (1 )-(4) steps to achieve, including:
(1)、基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和芯片数据总线的位宽,从目标HAC中获取写数据,并对获取写数据的次数进行统计,得到第一次数,目标HAC为发送目标数据写请求的HAC。(1), based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, the write data is obtained from the target HAC, and the number of times of obtaining the write data is calculated Statistics, get the first number, the target HAC is the HAC that sends the target data write request.
本步骤与上述步骤405相同,在此不再进行赘述。This step is the same as the above step 405 and will not be repeated here.
(2)、当第一次数达到第一指定次数时,从目标HAC中获取第一指定次数的下一次写数据的过程中,基于第一数据量、第一起始地址和SOC数据总线的最大数据量,从目标数据写请求中拆分出一个子数据写请求,将该子数据写请求进行协议转化,得到数据写命令,返回本步骤,直至将目标数据写请求拆分完毕。(2), when the first number reaches the first specified number of times, in the process of obtaining the next write data of the first specified number of times from the target HAC, based on the first data amount, the first starting address and the maximum of the SOC data bus For data volume, split a sub-data write request from the target data write request, perform protocol conversion on the sub-data write request, obtain a data write command, and return to this step until the split of the target data write request is completed.
在本发明实施例中,通过步骤(2),可以在连续的多个时钟周期中,对目标数据写请求进行拆分,得到多个子数据写请求,从而对该多个子数据写请求进行协议转化,得到多个数据写命令。In the embodiment of the present invention, through step (2), the target data write request can be split in multiple consecutive clock cycles to obtain multiple sub-data write requests, thereby performing protocol conversion on the multiple sub-data write requests , get multiple data write commands.
(3)、将该数据写命令发送给SOC数据总线,该数据写命令携带第一子数据量和第一子起始地址。(3) Send the data write command to the SOC data bus, where the data write command carries the first sub-data amount and the first sub-start address.
(4)、当接收到SOC数据总线返回的数据写响应时,将多次从目标HAC中获取的写数据,逐次发送给SOC数据总线,使SOC数据总线按照第一子数据量和第一子起始地址,将接收的写数据写入SOC的存储资源中。(4), when receiving the data writing response that SOC data bus returns, with the writing data that obtains from target HAC for many times, send to SOC data bus one by one, make SOC data bus according to the first sub-data volume and the first sub-data The starting address is used to write the received write data into the storage resources of the SOC.
对目标数据写请求进行拆分的过程中,每得到一个数据写命令,可以在拆分下一个子数据写请求的过程中,将该数据写命令发送给SOC数据总线,如此,将多个数据写命令在多个时钟周期,连续地发送给SOC数据总线,从而将该多个数据写命令的写数据发送给SOC数据总线。In the process of splitting the target data write request, each time a data write command is obtained, the data write command can be sent to the SOC data bus during the process of splitting the next sub-data write request, so that multiple data The write commands are continuously sent to the SOC data bus in multiple clock cycles, so as to send the write data of the multiple data write commands to the SOC data bus.
步骤409:LMI基于目标数据读请求携带的第二数据量、目标数据读请求携带的第二起始地址和SOC数据总线的最大数据量,从目标数据读请求中拆分出一个子数据读请求,并将该子数据读请求进行协议转化,得到数据读命令。Step 409: LMI splits a sub-data read request from the target data read request based on the second data volume carried in the target data read request, the second start address carried in the target data read request, and the maximum data volume of the SOC data bus , and perform protocol conversion on the sub-data read request to obtain a data read command.
具体地,基于SOC数据总线的最大数据量,将目标数据读请求携带的第二数据量进行划分,得到多个第二子数据量,且多个第二子数据量小于或等于SOC数据总线单次访问的最大数据量。获取第二子起始地址,生成子数据读请求,该子数据读请求携带第二子数据量和第二子起始地址。将该子数据读请求进行协议转化,得到数据读命令。Specifically, based on the maximum data volume of the SOC data bus, the second data volume carried by the target data read request is divided to obtain a plurality of second sub-data volumes, and the multiple second sub-data volumes are less than or equal to the SOC data bus unit The maximum amount of data accessed at one time. The second sub-start address is obtained, and a sub-data read request is generated, where the sub-data read request carries the second sub-data amount and the second sub-start address. Perform protocol conversion on the sub-data read request to obtain a data read command.
获取第二子起始地址包括:对于第一个拆分出的子数据读请求,该子数据读请求的第二子起始地址为第二起始地址。对于其他子数据读请求,该其他子数据读请求的第二子起始地址为上一个子数据读请求的结束地址之后连续的地址。也即是,基于第二子数据量和上一个拆分的子数据读请求携带的第二子起始地址,计算当前拆分的子数据读请求的第二子起始地址,其他子数据读请求为第一个拆分出的子数据读请求之后拆分出的子数据读请求。而基于第二子数据量和上一个拆分的子数据读请求携带的第二子起始地址,计算当前拆分的子数据读请求的第二子起始地址的方法可以参考现有的方法,本发明实施例对此不做详细阐述。Obtaining the second sub-start address includes: for the first split sub-data read request, the second sub-start address of the sub-data read request is the second start address. For other sub-data read requests, the second sub-start address of the other sub-data read request is an address continuous after the end address of the previous sub-data read request. That is, based on the second sub-data amount and the second sub-start address carried in the last split sub-data read request, calculate the second sub-start address of the currently split sub-data read request, and other sub-data read requests The request is a sub-data read request split after the first split sub-data read request. Based on the second sub-data amount and the second sub-start address carried in the last split sub-data read request, the method for calculating the second sub-start address of the currently split sub-data read request can refer to the existing method , which is not described in detail in the embodiment of the present invention.
在本发明实施例中,从SOC的存储资源中获取读数据时,存在数据反馈的延迟时间,并且从目标数据读请求中拆分子数据读请求只需一个时钟周期,因此,优选地,可以设置第三指定次数为每个子数据读请求的读数据获取次数减去2,也即是,第二子数据量对应的读数据获取次数减去2。这样,在获取当前子数据读请求的倒数第二次读数据的过程中,可以从目标数据读请求中拆分出下一个子数据读请求,有效利用数据反馈的延迟时间,提高了数据访问效率。In the embodiment of the present invention, when the read data is obtained from the storage resources of the SOC, there is a delay time for data feedback, and it only takes one clock cycle to split the sub-data read request from the target data read request, therefore, preferably, it can be set The third specified number of times is the number of read data acquisitions for each sub-data read request minus 2, that is, the number of read data acquisitions corresponding to the second amount of sub-data minus 2. In this way, in the process of obtaining the penultimate read data of the current sub-data read request, the next sub-data read request can be split from the target data read request, effectively utilizing the delay time of data feedback, and improving data access efficiency .
当然,第三指定次数还可以为每个子数据读请求的读数据获取次数减去3、4等,且第三指定次数大于1即可,本发明实施例对此不做具体限定。Of course, the third specified number of times can also be the number of read data acquisitions of each sub-data read request minus 3, 4, etc., and the third specified number of times only needs to be greater than 1, which is not specifically limited in this embodiment of the present invention.
需要说明的是,在本发明实施例中,SOC数据总线单次访问的数据量一定,因此,在本发明实施例中,如果目标数据读请求携带的第二数据量大于SOC数据总线的最大数据量时,需要对目标数据读请求进行拆分,使拆分后的子数据读请求携带的第二子数据量小于或等于SOC数据总线单次访问的最大数据量。而为了尽可能地提高数据访问效率,可以使第二子数据量尽可能地等于SOC数据总线单次访问的最大数据量。It should be noted that, in the embodiment of the present invention, the data amount of a single access of the SOC data bus is constant, therefore, in the embodiment of the present invention, if the second data amount carried by the target data read request is greater than the maximum data of the SOC data bus When the amount is large, the target data read request needs to be split so that the second sub-data amount carried by the split sub-data read request is less than or equal to the maximum data amount of a single access to the SOC data bus. In order to improve data access efficiency as much as possible, the second sub-data volume may be equal to the maximum data volume of a single access of the SOC data bus as much as possible.
步骤410:LMI将该数据读命令发送给SOC数据总线,使SOC数据总线将该数据读命令发送给SOC的存储资源,该数据读命令中携带第二子数据量和第二子起始地址。Step 410: The LMI sends the data read command to the SOC data bus, so that the SOC data bus sends the data read command to the storage resource of the SOC, and the data read command carries the second sub-data amount and the second sub-start address.
具体地,将该数据读命令发送给SOC数据总线,使SOC数据总线将该数据读命令发送给SOC的存储资源,该数据读命令中携带第二子数据量和第二子起始地址。当SOC的存储资源接收到该SOC数据总线发送的数据读命令时,可以根据该数据读命令携带的第二子数据量和第二子起始地址,从SOC的存储资源中,获取该数据读命令的读数据。SOC的存储资源基于第二子数据量、第二子起始地址和芯片数据总线的位宽,计算将该读数据发送给LMI的发送次数。基于该发送次数,将该读数据进行划分,得到多个读数据块,将划分得到的多个读数据块,在多个连续的时钟周期,通过SOC数据总线分别发送给LMI。Specifically, the data read command is sent to the SOC data bus, so that the SOC data bus sends the data read command to the storage resources of the SOC, and the data read command carries the second sub-data amount and the second sub-start address. When the storage resource of the SOC receives the data read command sent by the SOC data bus, the data read command can be obtained from the storage resource of the SOC according to the second sub-data amount and the second sub-start address carried by the data read command. command read data. The storage resource of the SOC calculates the number of times to send the read data to the LMI based on the second sub-data amount, the second sub-start address and the bit width of the chip data bus. Based on the sending times, the read data is divided to obtain multiple read data blocks, and the divided multiple read data blocks are respectively sent to the LMI through the SOC data bus in multiple consecutive clock cycles.
SOC的存储资源基于第二子数据量、第二子起始地址和芯片数据总线的位宽,计算将该读数据发送给LMI的发送次数的具体操作可以为:基于第二子起始地址,判断第二子起始地址与SOC的存储资源中存储读数据的起始存储地址是否地址对齐,如果地址对齐,则将第二子数据量除以芯片数据总线的位宽,得到发送次数。如果地址不对齐,则将芯片数据总线的位宽减去第二子起始地址对应的比特,得到发送数据量,之后,将第二子数据量除以发送数据量,将得到的数值向上取整,得到发送次数。The storage resources of the SOC are based on the second sub-data volume, the second sub-start address and the bit width of the chip data bus. The specific operation for calculating the number of times the read data is sent to the LMI can be: based on the second sub-start address, Judging whether the second sub-start address is aligned with the start storage address for storing read data in the storage resource of the SOC, if the address is aligned, divide the second sub-data amount by the bit width of the chip data bus to obtain the number of transmissions. If the addresses are not aligned, subtract the bits corresponding to the second sub-start address from the bit width of the chip data bus to obtain the amount of sent data, and then divide the second sub-data amount by the amount of sent data, and round up the obtained value Integrate to get the sending times.
步骤411:LMI接收SOC的存储资源通过SOC数据总线发送的读数据,对接收读数据的次数进行统计,得到第二次数。Step 411: The LMI receives the read data sent by the storage resources of the SOC through the SOC data bus, counts the times of receiving the read data, and obtains a second number of times.
由于SOC的存储资源是在多个连续的时钟周期,将读数据通过SOC数据总线发送给LMI,因此,LMI接收到读数据时,可以对接收读数据的次数进行统计,得到第二次数。Since the storage resource of the SOC sends the read data to the LMI through the SOC data bus in multiple consecutive clock cycles, when the LMI receives the read data, it can count the times of receiving the read data to obtain the second number.
步骤412:当第二次数达到第三指定次数时,接收SOC的存储资源通过SOC数据总线发送第三指定次数的下一次读数据的过程中,基于第二数据量、第二起始地址和SOC数据总线的最大数据量,从目标数据读请求中拆分出下一个子数据读请求,并将下一个子数据读请求进行协议转化,得到下一个数据读命令。Step 412: When the second number of times reaches the third specified number of times, the storage resource receiving the SOC sends the next read data of the third specified number of times through the SOC data bus, based on the second data amount, the second start address and the SOC The maximum data volume of the data bus, split the next sub-data read request from the target data read request, and perform protocol conversion on the next sub-data read request to obtain the next data read command.
在本发明实施例中,接收SOC数据总线发送的读数据时,存在数据反馈的延迟时间,并且从目标数据读请求中拆分子数据读请求只需一个时钟周期,因此,优选地,可以设置第三指定次数为每个子数据读请求的读数据发送次数减去2,也即是,第二子数据量对应的读数据发送次数减去2。这样,在获取当前子数据读请求的倒数第二次读数据的过程中,从目标数据读请求中拆分出下一个的子数据读请求,有效利用数据反馈的延迟时间,提高了数据访问效率。In the embodiment of the present invention, when receiving the read data sent by the SOC data bus, there is a delay time for data feedback, and it only takes one clock cycle to split the sub-data read request from the target data read request. Therefore, preferably, the second 3. The specified number of times is the number of times for sending read data for each sub-data read request minus 2, that is, the number of times for sending read data corresponding to the second amount of sub-data minus 2. In this way, in the process of obtaining the penultimate read data of the current sub-data read request, the next sub-data read request is split from the target data read request, effectively utilizing the delay time of data feedback, and improving data access efficiency .
步骤413:当第二次数达到第四指定次数时,接收SOC的存储资源通过SOC数据总线发送第四指定次数的下一次读数据的过程中,将下一个数据读命令发送给SOC数据总线,并将第二次数清零,重新统计第二次数,返回步骤412,直至将目标数据读请求拆分完毕。Step 413: When the second number of times reaches the fourth specified number of times, the storage resource receiving the SOC sends the next read data of the fourth specified number of times through the SOC data bus, and sends the next data read command to the SOC data bus, and Clear the second count to zero, re-count the second count, and return to step 412 until the splitting of the target data read request is completed.
具体地,将第二次数与第四指定次数进行比较,当第二次数等于第四指定次数时,接收SOC的存储资源通过SOC数据总线发送第四指定次数的下一次读数据的过程中,将下一个数据读命令发送给SOC数据总线,使SOC数据总线将下一个数据读命令发送给SOC的存储资源,并将第二次数清零。当再接收到SOC的存储资源通过SOC数据总线发送的读数据时,重新对接收读数据的次数进行统计,也即是,重新统计第二次数,返回步骤412,直至将目标数据读请求拆分完毕。Specifically, the second number of times is compared with the fourth specified number of times, and when the second number of times is equal to the fourth specified number of times, the storage resource receiving the SOC sends the next read data of the fourth specified number of times through the SOC data bus. The next data read command is sent to the SOC data bus, so that the SOC data bus sends the next data read command to the storage resources of the SOC, and the second count is cleared. When the read data sent by the storage resources of the SOC through the SOC data bus is received again, the number of times the read data is received is counted again, that is, the second count is counted again, and the step 412 is returned until the target data read request is split complete.
在本发明实施例中,接收SOC的存储资源通过SOC数据总线发送的读数据时,存在数据反馈的延迟时间,并且将数据读命令通过SOC数据总线发送给SOC的存储资源只需一个时钟周期,因此,优选地,可以设置第四指定次数为每个子数据读请求的读数据发送次数减去1,也即是,第二子数据量对应的读数据发送次数减去1。这样,在获取当前子数据读请求的最后一次读数据的过程中,将下一个数据读命令通过SOC数据总线发送给SOC的存储资源,有效利用数据反馈的延迟时间,提高了数据访问效率。In the embodiment of the present invention, when receiving the read data sent by the storage resources of the SOC through the SOC data bus, there is a delay time for data feedback, and it only takes one clock cycle to send the data read command to the storage resources of the SOC through the SOC data bus. Therefore, preferably, the fourth specified number of times can be set as the number of read data transmissions for each sub-data read request minus 1, that is, the number of read data transmissions corresponding to the second amount of sub-data minus 1. In this way, in the process of obtaining the last read data of the current sub-data read request, the next data read command is sent to the storage resource of the SOC through the SOC data bus, effectively utilizing the delay time of data feedback, and improving the data access efficiency.
在本发明实施例中,通过上述409-413的步骤,在下一个数据读命令发送之前,预先从目标数据读请求中拆分该下一个数据读命令,并且在上一个数据读命令的最后一次读数据接收的同时,将下一个数据读命令发送给SOC数据总线,使读操作也实现流水操作,进而保证SOC数据总线的有效利用,并且通过此方式,还可以防止读数据未接收到,过多的数据读命令无效占住SOC存储资源的端口,导致其余总线的访问者无法访问。In the embodiment of the present invention, through the above-mentioned steps 409-413, before the next data read command is sent, the next data read command is pre-split from the target data read request, and the last read command of the previous data read command At the same time as the data is received, the next data read command is sent to the SOC data bus, so that the read operation also realizes pipeline operation, thereby ensuring the effective use of the SOC data bus, and in this way, it can also prevent the read data from not being received, excessive The invalid data read command occupies the port of the SOC storage resource, causing the rest of the bus visitors to be unable to access.
可选地,在本发明实施例中,不仅可以通过上述409-413的步骤,将目标数据读请求进行拆分、协议转化等操作,实现对SOC的存储资源的访问,还可以通过如下(1)-(4)的步骤来实现,包括:Optionally, in the embodiment of the present invention, not only can the target data read request be split, protocol converted and other operations can be performed through the above steps 409-413 to realize access to the storage resources of the SOC, but also the following (1 )-(4) steps to achieve, including:
(1)、基于目标数据读请求携带的第二数据量、目标数据读请求携带的第二起始地址和SOC数据总线的最大数据量,从目标数据读请求中拆分出一个子数据读请求。(1), based on the second data volume carried by the target data read request, the second start address carried by the target data read request, and the maximum data volume of the SOC data bus, a sub-data read request is split from the target data read request .
本步骤与上述步骤409相同,在此不再进行赘述。This step is the same as the above step 409, and will not be repeated here.
(2)、将该子数据读请求进行协议转化,得到数据读命令,返回步骤(1),直至将目标数据读请求拆分完毕。(2) Perform protocol conversion on the sub-data read request to obtain a data read command, and return to step (1) until the target data read request is split.
在本发明实施例中,通过步骤(1)和(2),可以在连续的多个时钟周期中,对目标数据读请求进行拆分,得到多个子数据读请求,从而对该多个子数据读请求进行协议转化,得到多个数据读命令。In the embodiment of the present invention, through steps (1) and (2), the target data read request can be split in multiple consecutive clock cycles to obtain multiple sub-data read requests, so that the multiple sub-data read requests Request protocol conversion and get multiple data read commands.
(3)、将数据读命令发送给SOC数据总线,使SOC数据总线将该数据读命令发送给SOC的存储资源,该数据读命令中携带第二子数据量和第二子起始地址。(3) Send the data read command to the SOC data bus, so that the SOC data bus sends the data read command to the storage resources of the SOC, and the data read command carries the second sub-data amount and the second sub-start address.
(4)、逐次接收SOC的存储资源通过SOC数据总线发送的读数据。(4) Receive sequentially the read data sent by the storage resources of the SOC through the SOC data bus.
对目标数据读请求进行拆分的过程中,每得到一个数据读命令,可以在拆分下一个子数据读请求的过程中,将该数据读命令发送给SOC数据总线,如此,将多个数据读命令在多个时钟周期,连续地发送给SOC数据总线,从而从SOC的存储资源中获取该多个数据读命令的读数据。In the process of splitting the target data read request, each time a data read command is obtained, the data read command can be sent to the SOC data bus in the process of splitting the next sub-data read request, so that multiple data The read commands are continuously sent to the SOC data bus in multiple clock cycles, so as to obtain the read data of the multiple data read commands from the storage resources of the SOC.
需要说明的是,在本发明实施例中,LMI与SOC数据总线连接,如下,SOC数据总线只需为LMI提供一个访问接口即可,减少了SOC数据总线的接口数目,降低了成本,进而也使SOC数据总线接收的命令的维持时序较好。另外,通过LMI对数据访问请求进行拆分和协议转化,也即是,只需在LMI内布置拆分数据访问请求的逻辑和协议转化的逻辑,无需在每个HAC-IF内布置拆分数据访问请求的逻辑和协议转化的逻辑,避免了重复资源的浪费。It should be noted that, in the embodiment of the present invention, the LMI is connected to the SOC data bus, as follows, the SOC data bus only needs to provide an access interface for the LMI, which reduces the number of interfaces of the SOC data bus, reduces the cost, and furthermore It is better to maintain the timing of the commands received by the SOC data bus. In addition, the data access request is split and protocol converted through the LMI, that is, the logic of splitting the data access request and the logic of protocol conversion only need to be arranged in the LMI, and there is no need to arrange the split data in each HAC-IF The logic of access request and protocol conversion avoids the waste of repeated resources.
进一步地,对于每个HAC,当向SOC数据总线发送属于该HAC的数据写命令和数据读命令时,对发送的数据写命令个数进行统计,得到第一命令个数;以及对发送的数据读命令个数进行统计,得到第二命令个数;当第一命令个数等于第一个数阈值时,停止接收该HAC发送的类型为数据写请求的数据访问请求,直至第一命令个数小于第一个数阈值。当第二命令个数等于第二个数阈值时,停止接收该HAC发送的类型为数据读请求的数据访问请求,直至第二命令个数小于第二个数阈值。Further, for each HAC, when sending data write commands and data read commands belonging to the HAC to the SOC data bus, the number of data write commands sent is counted to obtain the first number of commands; and the data sent Count the number of read commands to obtain the second number of commands; when the first number of commands is equal to the threshold of the first number, stop receiving data access requests sent by the HAC with the type of data write request until the first number of commands less than the first number threshold. When the second number of commands is equal to the second number threshold, stop receiving data access requests of the type sent by the HAC, which are data read requests, until the second number of commands is less than the second number threshold.
可选地,在本发明实施例中,第一个数阈值和第二个数阈值是事先设置的,且第一个数阈值和第二个数阈值可以相等,也可以不相等,本发明实施例对此不做具体限定。另外,对于不同的HAC,第一个数阈值可以不同,第二个数阈值也可以不同,也即是,不同的HAC可以具有不同的第一个数阈值,也可以具有不同的第二个数阈值,本发明实施例对此同样不做具体限定。Optionally, in this embodiment of the present invention, the first number threshold and the second number threshold are set in advance, and the first number threshold and the second number threshold may be equal or unequal. The example does not specifically limit this. In addition, for different HACs, the first number threshold can be different, and the second number threshold can also be different, that is, different HACs can have different first number thresholds, and can also have different second number thresholds. The threshold is also not specifically limited in this embodiment of the present invention.
其中,通过统计HAC发送命令个数,对LMI中接收该HAC发送的数据访问请求的数量进行控制,实现了流量控制,提高了LMI的处理速度,进而也会提高数据访问的速度,并且还防止高优先级的数据访问请求频繁大量地访问SOC的存储资源。Among them, by counting the number of commands sent by the HAC, the number of data access requests sent by the HAC in the LMI is controlled to achieve flow control, improve the processing speed of the LMI, and further increase the speed of data access, and also prevent High-priority data access requests frequently and massively access the storage resources of the SOC.
在本发明实施例中,通过LMI对HAC发送的数据访问请求进行仲裁、拆分以及协议转化,节省了拆分逻辑和协议转化逻辑的重复资源,并且LMI与SOC数据总线连接,SOC数据总线只需为LMI提供访问接口,无需为每个HAC-IF提供数据访问接口,减少了SOC数据总线的访问接口数量。另外,在本发明实施例中,可以并行地对写操作和读操作进行处理,且写操作和读操作可以分别进行流水操作,提高了总线利用率,并且有效利用了数据反馈的延迟时间,提高了数据访问的效率。In the embodiment of the present invention, the data access request sent by the HAC is arbitrated, split, and protocol converted through the LMI, saving the duplicate resources of split logic and protocol conversion logic, and the LMI is connected to the SOC data bus, and the SOC data bus only An access interface needs to be provided for the LMI, and there is no need to provide a data access interface for each HAC-IF, which reduces the number of access interfaces of the SOC data bus. In addition, in the embodiment of the present invention, the write operation and the read operation can be processed in parallel, and the write operation and the read operation can be pipelined separately, which improves the bus utilization rate, and effectively utilizes the delay time of data feedback, improving improve the efficiency of data access.
图5是本发明实施例提供的一种数据访问设备结构示意图。参见图5,该设备包括:Fig. 5 is a schematic structural diagram of a data access device provided by an embodiment of the present invention. Referring to Figure 5, the device includes:
接收模块501,用于在每个时钟周期,当检测到多个HAC通过与该多个HAC分别连接的HAC-IF发送的数据访问请求时,基于多个数据访问请求的优先级,接收优先级最高的数据访问请求;The receiving module 501 is configured to receive the priority based on the priorities of the multiple data access requests when multiple HACs are detected to send data access requests through the HAC-IFs respectively connected to the multiple HACs in each clock cycle highest data access request;
存储模块502,用于基于接收的数据访问请求的类型,将接收的数据访问请求存储在LMI的数据队列中;The storage module 502 is configured to store the received data access request in the data queue of the LMI based on the type of the received data access request;
数据访问模块503,用于基于LMI的数据队列中的目标数据访问请求携带的数据量、目标数据访问请求携带的起始地址和SOC数据总线的最大数据量,对SOC的存储资源进行数据访问。The data access module 503 is configured to perform data access to the storage resources of the SOC based on the amount of data carried by the target data access request in the data queue of the LMI, the start address carried by the target data access request, and the maximum data amount of the SOC data bus.
可选地,存储模块502包括:Optionally, the storage module 502 includes:
存储单元,用于如果接收的数据访问请求的类型为数据写请求,则将接收的数据访问请求存储在LMI的第一数据队列中最后一个数据访问请求之后,第一数据队列用于存储数据写请求;The storage unit is configured to store the received data access request after the last data access request in the first data queue of the LMI if the type of the received data access request is a data write request, and the first data queue is used to store the data write ask;
该存储单元,还用于如果接收的数据访问请求的类型为数据读请求,则将接收的数据访问请求存储在LMI的第二数据队列中最后一个数据访问请求之后,第二数据队列用于存储数据读请求。The storage unit is also used to store the received data access request after the last data access request in the second data queue of the LMI if the type of the received data access request is a data read request, and the second data queue is used for storing Data read request.
可选地,数据访问模块503包括:Optionally, the data access module 503 includes:
获取单元,用于从LMI的第一数据队列中,获取目标数据写请求,以及从LMI的第二数据队列中,获取目标数据读请求;An acquisition unit, configured to acquire a target data write request from the first data queue of the LMI, and acquire a target data read request from the second data queue of the LMI;
写入单元,用于基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和SOC数据总线的最大数据量,将目标数据写请求的写数据写入SOC的存储资源中;The write unit is used to write the write data of the target data write request into the storage of the SOC based on the first data volume carried by the target data write request, the first start address carried by the target data write request, and the maximum data volume of the SOC data bus resources;
读取单元,用于基于目标数据读请求携带的第二数据量、目标数据读请求携带的第二起始地址和SOC数据总线的最大数据量,从SOC的存储资源中读取目标数据读请求的读数据。The reading unit is used to read the target data read request from the storage resource of the SOC based on the second data amount carried by the target data read request, the second start address carried by the target data read request, and the maximum data amount of the SOC data bus read data.
可选地,写入单元包括:Optionally, the writing unit includes:
获取子单元,用于基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和芯片数据总线的位宽,从目标HAC中获取写数据,并对获取写数据的次数进行统计,得到第一次数,目标HAC为发送该目标数据写请求的HAC;The obtaining subunit is used to obtain the write data from the target HAC based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, and obtain the write data. The number of times is counted to obtain the first number, and the target HAC is the HAC that sends the target data write request;
拆分子单元,用于当第一次数达到第一指定次数时,从目标HAC中获取第一指定次数的下一次写数据的过程中,基于第一数据量、第一起始地址和SOC数据总线的最大数据量,从目标数据写请求中拆分出一个子数据写请求,并将该子数据写请求进行协议转化,得到数据写命令,该数据写命令携带第一子数据量和第一子起始地址;Splitting the sub-units is used for obtaining the next write data of the first specified number of times from the target HAC when the first number reaches the first specified number of times, based on the first data amount, the first start address and the SOC data bus The maximum data volume of the target data write request is split into a sub-data write request, and the sub-data write request is converted into a protocol to obtain a data write command. The data write command carries the first sub-data volume and the first sub-data initial address;
发送子单元,用于当第一次数达到第二指定次数时,从目标HAC中获取第二指定次数的下一次写数据的过程中,将该数据写命令发送给SOC数据总线,并将第一次数清零,重新统计第一次数,返回上一拆分子单元,直至将目标数据写请求拆分完毕;The sending subunit is used to send the data write command to the SOC data bus in the process of obtaining the next write data of the second specified number of times from the target HAC when the first number reaches the second specified number of times, and sends the second Clear the first count, re-count the first count, and return to the previous split subunit until the target data write request is split;
发送子单元,还用于当接收到SOC数据总线返回的数据写响应时,将多次从目标HAC中获取该数据写命令的写数据,逐次发送给SOC数据总线,使SOC数据总线按照第一子数据量和第一子起始地址,将接收的写数据写入SOC的存储资源中。The sending subunit is also used to obtain the write data of the data write command from the target HAC multiple times when receiving the data write response returned by the SOC data bus, and send it to the SOC data bus one by one, so that the SOC data bus follows the first The amount of sub-data and the first sub-start address, and write the received write data into the storage resources of the SOC.
可选地,写入单元包括:Optionally, the writing unit includes:
获取子单元,用于基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和芯片数据总线的位宽,从目标HAC中获取写数据,并对获取写数据的次数进行统计,得到第一次数,目标HAC为发送该目标数据写请求的HAC;The obtaining subunit is used to obtain the write data from the target HAC based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, and obtain the write data. The number of times is counted to obtain the first number, and the target HAC is the HAC that sends the target data write request;
拆分子单元,用于当第一次数达到第一指定次数时,从目标HAC中获取第一指定次数的下一次写数据的过程中,基于第一数据量、第一起始地址和SOC数据总线的最大数据量,从目标数据写请求中拆分出一个子数据写请求,将该子数据写请求进行协议转化,得到数据写命令,返回本拆分子单元,直至将目标数据写请求拆分完毕;Splitting the sub-units is used for obtaining the next write data of the first specified number of times from the target HAC when the first number reaches the first specified number of times, based on the first data amount, the first start address and the SOC data bus split a sub-data write request from the target data write request, perform protocol conversion on the sub-data write request, obtain the data write command, and return to the split sub-unit until the target data write request is split. ;
发送子单元,用于将该数据写命令发送给SOC数据总线,该数据写命令携带第一子数据量和第一子起始地址;The sending subunit is used to send the data write command to the SOC data bus, and the data write command carries the first sub-data amount and the first sub-start address;
发送子单元,还用于当接收到SOC数据总线返回的数据写响应时,将多次从目标HAC中获取的写数据,逐次发送给SOC数据总线,使SOC数据总线按照第一子数据量和第一子起始地址,将接收的写数据写入SOC的存储资源中。The sending subunit is also used to send the write data obtained from the target HAC to the SOC data bus one by one when receiving the data write response returned by the SOC data bus, so that the SOC data bus can be used according to the first sub data amount and The first sub-start address writes the received write data into the storage resources of the SOC.
可选地,Optionally,
获取子单元,具体用于:Get subunits, specifically for:
基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和芯片数据总线的位宽,计算从目标HAC中获取写数据的获取次数,该芯片数据总线为与LMI连接的数据总线;Based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, calculate the number of acquisitions of the write data from the target HAC, the chip data bus is connected to the LMI data bus;
基于该获取次数,向目标HAC发送指示信息,该指示信息用于指示目标HAC将目标数据写请求的写数据划分为获取次数次进行发送;Based on the acquisition times, send indication information to the target HAC, where the indication information is used to instruct the target HAC to divide the write data of the target data write request into acquisition times and send them;
接收目标HAC发送的写数据,并对接收写数据的次数进行统计,得到第一次数。Receive the write data sent by the target HAC, and count the number of times the write data is received to obtain the first count.
可选地,读取单元包括:Optionally, the reading unit includes:
拆分子单元,用于基于目标数据读请求携带的第二数据量、目标数据读请求携带的第二起始地址和SOC数据总线的最大数据量,从目标数据读请求中拆分出一个子数据读请求,并将拆分的子数据读请求进行协议转化,得到数据读命令;split sub-units, for splitting a sub-data from the target data read request based on the second data amount carried by the target data read request, the second start address carried by the target data read request, and the maximum data amount of the SOC data bus Read request, and perform protocol conversion on the split sub-data read request to obtain a data read command;
发送子单元,用于将该数据读命令发送给SOC数据总线,使SOC数据总线将该数据读命令发送给SOC的存储资源,该数据读命令中携带第二子数据量和第二子起始地址;The sending subunit is used to send the data read command to the SOC data bus, so that the SOC data bus sends the data read command to the storage resource of the SOC, and the data read command carries the second sub-data amount and the second sub-start address;
接收子单元,用于接收SOC的存储资源通过SOC数据总线发送的读数据,对接收读数据的次数进行统计,得到第二次数;The receiving subunit is used to receive the read data sent by the storage resources of the SOC through the SOC data bus, and count the number of times of receiving the read data to obtain the second number of times;
拆分子单元,还用于当第二次数达到第三指定次数时,接收SOC的存储资源通过SOC数据总线发送第三指定次数的下一次读数据的过程中,基于第二数据量、第二起始地址和SOC数据总线的最大数据量,从目标数据读请求中拆分出下一个子数据读请求,并将下一个子数据读请求进行协议转化,得到下一个数据读命令;Splitting sub-units is also used when the second number of times reaches the third specified number of times, the storage resource receiving the SOC sends the next read data of the third specified number of times through the SOC data bus, based on the second data amount, the second start address and the maximum data volume of the SOC data bus, split the next sub-data read request from the target data read request, and perform protocol conversion on the next sub-data read request to obtain the next data read command;
发送子单元,还用于当第二次数达到第四指定次数时,接收SOC的存储资源通过SOC数据总线发送第四指定次数的下一次读数据的过程中,将下一个数据读命令发送给SOC数据总线,并将第二次数清零,重新统计第二次数,返回上一拆分子单元,直至将目标数据读请求拆分完毕。The sending subunit is also used to send the next data read command to the SOC during the process of sending the next read data of the fourth specified number of times by the storage resource receiving the SOC through the SOC data bus when the second number reaches the fourth specified number of times Data bus, clear the second count to zero, re-count the second count, and return to the previous split subunit until the target data read request is split.
可选地,读取单元包括:Optionally, the reading unit includes:
拆分子单元,用于基于目标数据读请求携带的第二数据量、目标数据读请求携带的第二起始地址和SOC数据总线的最大数据量,从目标数据读请求中拆分出一个子数据读请求;split sub-units, for splitting a sub-data from the target data read request based on the second data amount carried by the target data read request, the second start address carried by the target data read request, and the maximum data amount of the SOC data bus read request;
协议转化子单元,用于将拆分的子数据读请求进行协议转化,得到数据读命令,返回上一拆分子单元,直至将目标数据读请求拆分完毕;The protocol conversion subunit is used to perform protocol conversion on the split sub-data read request, obtain a data read command, and return to the previous split sub-unit until the target data read request is split;
发送子单元,用于将该数据读命令发送给SOC数据总线,使SOC数据总线将该数据读命令发送给SOC的存储资源,该数据读命令中携带第二子数据量和第二子起始地址;The sending subunit is used to send the data read command to the SOC data bus, so that the SOC data bus sends the data read command to the storage resource of the SOC, and the data read command carries the second sub-data amount and the second sub-start address;
接收子单元,用于逐次接收SOC的存储资源通过SOC数据总线发送的读数据。The receiving subunit is configured to successively receive the read data sent by the storage resources of the SOC through the SOC data bus.
可选地,该设备还包括:Optionally, the device also includes:
统计模块,用于对于每个HAC,当向SOC数据总线发送属于该HAC的数据写命令和数据读命令时,对发送的数据写命令个数进行统计,得到第一命令个数,以及对发送的数据读命令个数进行统计,得到第二命令个数;The statistics module is used for each HAC, when sending data write commands and data read commands belonging to the HAC to the SOC data bus, counting the number of data write commands sent, obtaining the first number of commands, and sending Count the number of data read commands to obtain the second number of commands;
停止模块,用于当第一命令个数等于第一个数阈值时,停止接收该HAC发送的类型为数据写请求的数据访问请求,直至第一命令个数小于第一个数阈值;The stop module is used to stop receiving the data access request sent by the HAC when the number of the first command is equal to the first number threshold, until the number of the first command is less than the first number threshold;
停止模块,还用于当第二命令个数等于第二个数阈值时,停止接收该HAC发送的类型为数据读请求的数据访问请求,直至第二命令个数小于第二个数阈值。The stop module is further configured to stop receiving data access requests sent by the HAC when the number of the second commands is equal to the second threshold until the number of the second commands is less than the second threshold.
在本发明实施例中,通过LMI对HAC发送的数据访问请求进行仲裁、拆分以及协议转化,节省了拆分逻辑和协议转化逻辑的重复资源,并且LMI与SOC数据总线连接,SOC数据总线只需为LMI提供访问接口,无需为每个HAC-IF提供数据访问接口,减少了SOC数据总线的访问接口数量。In the embodiment of the present invention, the data access request sent by the HAC is arbitrated, split, and protocol converted through the LMI, saving the duplicate resources of split logic and protocol conversion logic, and the LMI is connected to the SOC data bus, and the SOC data bus only An access interface needs to be provided for the LMI, and there is no need to provide a data access interface for each HAC-IF, which reduces the number of access interfaces of the SOC data bus.
图6是本发明实施例提供的一种数据访问设备结构示意图。参见图6,该设备包括:Fig. 6 is a schematic structural diagram of a data access device provided by an embodiment of the present invention. Referring to Figure 6, the device includes:
接收机601,用于在每个时钟周期,当检测到多个HAC通过与该多个HAC分别连接的HAC-IF发送的数据访问请求时,基于多个数据访问请求的优先级,接收优先级最高的数据访问请求。The receiver 601 is configured to, in each clock cycle, when detecting data access requests sent by multiple HACs through the HAC-IFs respectively connected to the multiple HACs, based on the priorities of the multiple data access requests, receive the priority Highest data access request.
存储器602,用于基于接收的数据访问请求的类型,将接收的数据访问请求存储在LMI的数据队列中。The memory 602 is configured to store the received data access request in the data queue of the LMI based on the type of the received data access request.
处理器603,还用于基于LMI的数据队列中的目标数据访问请求携带的数据量、目标数据访问请求携带的起始地址和SOC数据总线的最大数据量,对SOC的存储资源进行数据访问。The processor 603 is further configured to perform data access to the storage resources of the SOC based on the amount of data carried by the target data access request in the data queue of the LMI, the start address carried by the target data access request, and the maximum data amount of the SOC data bus.
可选地,存储器602具体用于:Optionally, the memory 602 is specifically used for:
如果接收的数据访问请求的类型为数据写请求,则将接收的数据访问请求存储在LMI的第一数据队列中最后一个数据访问请求之后,第一数据队列用于存储数据写请求;If the type of the received data access request is a data write request, then the received data access request is stored after the last data access request in the first data queue of the LMI, and the first data queue is used to store the data write request;
如果接收的数据访问请求的类型为数据读请求,则将接收的数据访问请求存储在LMI的第二数据队列中最后一个数据访问请求之后,第二数据队列用于存储数据读请求。If the type of the received data access request is a data read request, the received data access request is stored after the last data access request in the second data queue of the LMI, and the second data queue is used for storing the data read request.
可选地,处理器603具体用于:Optionally, the processor 603 is specifically configured to:
从LMI的第一数据队列中,获取目标数据写请求,以及从LMI的第二数据队列中,获取目标数据读请求;Obtain a target data write request from the first data queue of the LMI, and obtain a target data read request from the second data queue of the LMI;
基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和SOC数据总线的最大数据量,将目标数据写请求的写数据写入SOC的存储资源中;Write the write data of the target data write request into the storage resource of the SOC based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the maximum data volume of the SOC data bus;
基于目标数据读请求携带的第二数据量、目标数据读请求携带的第二起始地址和SOC数据总线的最大数据量,从SOC的存储资源中读取目标数据读请求的读数据。Based on the second data amount carried by the target data read request, the second start address carried by the target data read request, and the maximum data amount of the SOC data bus, the read data of the target data read request is read from the storage resource of the SOC.
可选地,处理器603具体用于:Optionally, the processor 603 is specifically configured to:
基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和芯片数据总线的位宽,从目标HAC中获取写数据,并对获取写数据的次数进行统计,得到第一次数,目标HAC为发送目标数据写请求的HAC;Based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, the write data is obtained from the target HAC, and the number of times of obtaining the write data is counted to obtain the first One time, the target HAC is the HAC that sends the target data write request;
当第一次数达到第一指定次数时,从目标HAC中获取第一指定次数的下一次写数据的过程中,基于第一数据量、第一起始地址和SOC数据总线的最大数据量,从目标数据写请求中拆分出一个子数据写请求,并将该子数据写请求进行协议转化,得到数据写命令,该数据写命令携带第一子数据量和第一子起始地址;When the first number reaches the first specified number of times, in the process of obtaining the next write data of the first specified number of times from the target HAC, based on the first data amount, the first starting address and the maximum data amount of the SOC data bus, from Splitting a sub-data write request from the target data write request, and performing protocol conversion on the sub-data write request to obtain a data write command, the data write command carries the first sub-data amount and the first sub-start address;
当第一次数达到第二指定次数时,从目标HAC中获取第二指定次数的下一次写数据的过程中,将该数据写命令发送给SOC数据总线,并将第一次数清零,重新统计第一次数,返回上一步骤,直至将目标数据写请求拆分完毕;When the first number reaches the second specified number of times, in the process of obtaining the next write data of the second specified number of times from the target HAC, the data write command is sent to the SOC data bus, and the first number is cleared, Re-count the number for the first time, and return to the previous step until the splitting of the target data write request is completed;
当接收到SOC数据总线返回的数据写响应时,将多次从目标HAC中获取数据写命令的写数据,逐次发送给SOC数据总线,使SOC数据总线按照第一子数据量和第一子起始地址,将接收的写数据写入SOC的存储资源中。When receiving the data write response returned by the SOC data bus, the write data of the data write command will be obtained from the target HAC multiple times, and sent to the SOC data bus one by one, so that the SOC data bus will start according to the first sub data volume and the first sub data. Write the received write data into the storage resources of the SOC.
可选地,处理603具体用于:Optionally, processing 603 is specifically used for:
基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和芯片数据总线的位宽,从目标HAC中获取写数据,并对获取写数据的次数进行统计,得到第一次数,目标HAC为发送目标数据写请求的HAC;Based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, the write data is obtained from the target HAC, and the number of times of obtaining the write data is counted to obtain the first One time, the target HAC is the HAC that sends the target data write request;
当第一次数达到第一指定次数时,从目标HAC中获取第一指定次数的下一次写数据的过程中,基于第一数据量、第一起始地址和SOC数据总线的最大数据量,从目标数据写请求中拆分出一个子数据写请求,将该子数据写请求进行协议转化,得到数据写命令,返回本步骤,直至将目标数据写请求拆分完毕;When the first number reaches the first specified number of times, in the process of obtaining the next write data of the first specified number of times from the target HAC, based on the first data amount, the first starting address and the maximum data amount of the SOC data bus, from Split a sub-data write request from the target data write request, perform protocol conversion on the sub-data write request, obtain a data write command, and return to this step until the split of the target data write request is completed;
将该数据写命令发送给SOC数据总线,该数据写命令携带第一子数据量和第一子起始地址;Send the data write command to the SOC data bus, the data write command carries the first sub-data volume and the first sub-start address;
当接收到SOC数据总线返回的数据写响应时,将多次从目标HAC中获取的写数据,逐次发送给SOC数据总线,使SOC数据总线按照第一子数据量和第一子起始地址,将接收的写数据写入SOC的存储资源中。When the data write response returned by the SOC data bus is received, the write data obtained from the target HAC is sent to the SOC data bus one by one, so that the SOC data bus is based on the first sub-data volume and the first sub-start address, Write the received write data into the storage resources of the SOC.
可选地,处理器603具体用于:Optionally, the processor 603 is specifically configured to:
基于目标数据写请求携带的第一数据量、目标数据写请求携带的第一起始地址和芯片数据总线的位宽,计算从目标HAC中获取写数据的获取次数,该芯片数据总线为与LMI连接的数据总线;Based on the first data amount carried by the target data write request, the first start address carried by the target data write request, and the bit width of the chip data bus, calculate the number of acquisitions of the write data from the target HAC, the chip data bus is connected to the LMI data bus;
基于该获取次数,向目标HAC发送指示信息,该指示信息用于指示目标HAC将目标数据写请求的写数据划分为获取次数次进行发送;Based on the acquisition times, send indication information to the target HAC, where the indication information is used to instruct the target HAC to divide the write data of the target data write request into acquisition times and send them;
接收目标HAC发送的写数据,并对接收写数据的次数进行统计,得到第一次数。Receive the write data sent by the target HAC, and count the number of times the write data is received to obtain the first count.
可选地,处理器603具体用于:Optionally, the processor 603 is specifically configured to:
基于目标数据读请求携带的第二数据量、目标数据读请求携带的第二起始地址和SOC数据总线的最大数据量,从目标数据读请求中拆分出一个子数据读请求,并将该子数据读请求进行协议转化,得到数据读命令;Based on the second data volume carried by the target data read request, the second start address carried by the target data read request, and the maximum data volume of the SOC data bus, a sub-data read request is split from the target data read request, and the The sub-data read request performs protocol conversion to obtain a data read command;
将该数据读命令发送给SOC数据总线,使SOC数据总线将该数据读命令发送给SOC的存储资源,该数据读命令中携带第二子数据量和第二子起始地址;Send the data read command to the SOC data bus, so that the SOC data bus sends the data read command to the storage resource of the SOC, and the data read command carries the second sub-data volume and the second sub-start address;
接收SOC的存储资源通过SOC数据总线发送的读数据,对接收读数据的次数进行统计,得到第二次数;receiving the read data sent by the storage resources of the SOC through the SOC data bus, counting the number of times of receiving the read data, and obtaining the second number of times;
当第二次数达到第三指定次数时,接收SOC的存储资源通过SOC数据总线发送该第三指定次数的下一次读数据的过程中,基于第二数据量、第二起始地址和SOC数据总线的最大数据量,从目标数据读请求中拆分出下一个子数据读请求,并将下一个子数据读请求进行协议转化,得到下一个数据读命令;When the second number of times reaches the third specified number of times, the storage resource receiving the SOC sends the next read data of the third specified number of times through the SOC data bus, based on the second data amount, the second start address and the SOC data bus split the next sub-data read request from the target data read request, and perform protocol conversion on the next sub-data read request to obtain the next data read command;
当第二次数达到第四指定次数时,接收SOC的存储资源通过SOC数据总线发送第四指定次数的下一次读数据的过程中,将该下一个数据读命令发送给SOC数据总线,并将第二次数清零,重新统计第二次数,返回上一步骤,直至将目标数据读请求拆分完毕。When the second number of times reaches the fourth specified number of times, the storage resource receiving the SOC sends the next read data of the fourth specified number of times through the SOC data bus, sends the next data read command to the SOC data bus, and sends the first The second count is cleared, the second count is counted again, and the previous step is returned until the target data read request is split.
可选地,处理器603具体用于:Optionally, the processor 603 is specifically configured to:
基于目标数据读请求携带的第二数据量、目标数据读请求携带的第二起始地址和SOC数据总线的最大数据量,从目标数据读请求中拆分出一个子数据读请求;Splitting a sub-data read request from the target data read request based on the second data amount carried by the target data read request, the second start address carried by the target data read request, and the maximum data amount of the SOC data bus;
将该子数据读请求进行协议转化,得到数据读命令,返回上一步骤,直至将目标数据读请求拆分完毕;Perform protocol conversion on the sub-data read request to obtain a data read command, and return to the previous step until the target data read request is split;
将该数据读命令发送给SOC数据总线,使SOC数据总线将该数据读命令发送给SOC的存储资源,该数据读命令中携带第二子数据量和第二子起始地址;Send the data read command to the SOC data bus, so that the SOC data bus sends the data read command to the storage resource of the SOC, and the data read command carries the second sub-data volume and the second sub-start address;
逐次接收SOC的存储资源通过SOC数据总线发送的读数据。Receive the read data sent by the storage resources of the SOC through the SOC data bus one by one.
可选地,该设备还包括:Optionally, the device also includes:
处理器603,还用于对于每个HAC,当向SOC数据总线发送属于该HAC的数据写命令和数据读命令时,对发送的数据写命令个数进行统计,得到第一命令个数,以及对发送的数据读命令个数进行统计,得到第二命令个数;The processor 603 is further configured to, for each HAC, when sending data write commands and data read commands belonging to the HAC to the SOC data bus, count the number of data write commands sent to obtain the first number of commands, and Counting the number of data read commands sent to obtain the second number of commands;
处理器603,还用于当第一命令个数等于第一个数阈值时,停止接收该HAC发送的类型为数据写请求的数据访问请求,直至第一命令个数小于第一个数阈值;The processor 603 is further configured to, when the number of the first command is equal to the first number threshold, stop receiving the data access request sent by the HAC as a data write request until the number of the first command is less than the first number threshold;
处理器603,还用于当第二命令个数等于第二个数阈值时,停止接收该HAC发送的类型为数据读请求的数据访问请求,直至第二命令个数小于第二个数阈值。The processor 603 is further configured to, when the second number of commands is equal to the second number threshold, stop receiving data access requests sent by the HAC as data read requests until the second number of commands is less than the second number threshold.
在本发明实施例中,通过LMI对HAC发送的数据访问请求进行仲裁、拆分以及协议转化,节省了拆分逻辑和协议转化逻辑的重复资源,并且LMI与SOC数据总线连接,SOC数据总线只需为LMI提供访问接口,无需为每个HAC-IF提供数据访问接口,减少了SOC数据总线的访问接口数量。In the embodiment of the present invention, the data access request sent by the HAC is arbitrated, split, and protocol converted through the LMI, saving the duplicate resources of split logic and protocol conversion logic, and the LMI is connected to the SOC data bus, and the SOC data bus only An access interface needs to be provided for the LMI, and there is no need to provide a data access interface for each HAC-IF, which reduces the number of access interfaces of the SOC data bus.
需要说明的是:上述实施例提供的数据访问设备在数据访问时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的数据访问设备与数据访问方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: the data access device provided by the above embodiment only uses the division of the above functional modules as an example for data access. In practical applications, the above function allocation can be completed by different functional modules according to needs. The internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the data access device and the data access method embodiments provided by the above embodiments belong to the same idea, and the specific implementation process thereof is detailed in the method embodiments, and will not be repeated here.
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, and can also be completed by instructing related hardware through a program. The program can be stored in a computer-readable storage medium. The above-mentioned The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, and the like.
以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection of the present invention. within range.
Claims (18)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510131604.4A CN104765701B (en) | 2015-03-24 | 2015-03-24 | Data access method and equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510131604.4A CN104765701B (en) | 2015-03-24 | 2015-03-24 | Data access method and equipment |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN104765701A true CN104765701A (en) | 2015-07-08 |
| CN104765701B CN104765701B (en) | 2018-05-29 |
Family
ID=53647542
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510131604.4A Active CN104765701B (en) | 2015-03-24 | 2015-03-24 | Data access method and equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN104765701B (en) |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105893286A (en) * | 2015-12-14 | 2016-08-24 | 乐视网信息技术(北京)股份有限公司 | Data processing method and apparatus |
| CN107291650A (en) * | 2016-04-06 | 2017-10-24 | 无锡小天鹅股份有限公司 | Washing machine and its communicator and communication means |
| CN107544926A (en) * | 2017-09-06 | 2018-01-05 | 上海兆芯集成电路有限公司 | Processing system and its access method |
| TWI777481B (en) * | 2021-04-08 | 2022-09-11 | 鴻海精密工業股份有限公司 | Data control method, data processing method, electronic equipment and storage medium |
| CN115460038A (en) * | 2022-08-31 | 2022-12-09 | 广西玉柴机器股份有限公司 | Method, system, equipment and storage medium for improving controller writing efficiency |
| CN115617732A (en) * | 2022-11-14 | 2023-01-17 | 南京芯驰半导体科技有限公司 | APB bus structure, system on chip, vehicle and access method |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101901199A (en) * | 2010-07-30 | 2010-12-01 | 中兴通讯股份有限公司 | Method and system for transparent data transmission |
| WO2011095012A1 (en) * | 2010-02-03 | 2011-08-11 | 中兴通讯股份有限公司 | Method and system for data transmission in search engine real time system |
| CN102236622A (en) * | 2010-04-30 | 2011-11-09 | 中兴通讯股份有限公司 | Dynamic memory controller and method for increasing bandwidth utilization rate of dynamic memory |
| CN102855156A (en) * | 2011-06-30 | 2013-01-02 | 重庆重邮信科通信技术有限公司 | Interrupt controller and interrupt controlling method |
| CN103049408A (en) * | 2012-12-28 | 2013-04-17 | 苏州国芯科技有限公司 | Multi-interface SRAM (static random access memory) read-write control circuit and multi-interface SRAM read-write control method |
| CN103353851A (en) * | 2013-07-01 | 2013-10-16 | 华为技术有限公司 | Method and equipment for managing tasks |
-
2015
- 2015-03-24 CN CN201510131604.4A patent/CN104765701B/en active Active
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2011095012A1 (en) * | 2010-02-03 | 2011-08-11 | 中兴通讯股份有限公司 | Method and system for data transmission in search engine real time system |
| CN102236622A (en) * | 2010-04-30 | 2011-11-09 | 中兴通讯股份有限公司 | Dynamic memory controller and method for increasing bandwidth utilization rate of dynamic memory |
| CN101901199A (en) * | 2010-07-30 | 2010-12-01 | 中兴通讯股份有限公司 | Method and system for transparent data transmission |
| CN102855156A (en) * | 2011-06-30 | 2013-01-02 | 重庆重邮信科通信技术有限公司 | Interrupt controller and interrupt controlling method |
| CN103049408A (en) * | 2012-12-28 | 2013-04-17 | 苏州国芯科技有限公司 | Multi-interface SRAM (static random access memory) read-write control circuit and multi-interface SRAM read-write control method |
| CN103353851A (en) * | 2013-07-01 | 2013-10-16 | 华为技术有限公司 | Method and equipment for managing tasks |
Cited By (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105893286A (en) * | 2015-12-14 | 2016-08-24 | 乐视网信息技术(北京)股份有限公司 | Data processing method and apparatus |
| CN107291650A (en) * | 2016-04-06 | 2017-10-24 | 无锡小天鹅股份有限公司 | Washing machine and its communicator and communication means |
| CN107291650B (en) * | 2016-04-06 | 2023-10-31 | 无锡小天鹅电器有限公司 | Washing machine and communication device and communication method thereof |
| CN107544926A (en) * | 2017-09-06 | 2018-01-05 | 上海兆芯集成电路有限公司 | Processing system and its access method |
| CN107544926B (en) * | 2017-09-06 | 2020-04-07 | 上海兆芯集成电路有限公司 | Processing system and memory access method thereof |
| US11263139B2 (en) | 2017-09-06 | 2022-03-01 | Shanghai Zhaoxin Semiconductor Co., Ltd. | Hardware accelerators and access methods thereof |
| TWI777481B (en) * | 2021-04-08 | 2022-09-11 | 鴻海精密工業股份有限公司 | Data control method, data processing method, electronic equipment and storage medium |
| CN115460038A (en) * | 2022-08-31 | 2022-12-09 | 广西玉柴机器股份有限公司 | Method, system, equipment and storage medium for improving controller writing efficiency |
| CN115617732A (en) * | 2022-11-14 | 2023-01-17 | 南京芯驰半导体科技有限公司 | APB bus structure, system on chip, vehicle and access method |
| CN115617732B (en) * | 2022-11-14 | 2023-03-31 | 南京芯驰半导体科技有限公司 | APB bus structure, system on chip, vehicle and access method |
Also Published As
| Publication number | Publication date |
|---|---|
| CN104765701B (en) | 2018-05-29 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104765701B (en) | Data access method and equipment | |
| CN109271335B (en) | FPGA implementation method for DDR cache of multi-channel data source | |
| CN100524266C (en) | Method and equipment for transmitting data transmission request by packets in a bus | |
| US20200081850A1 (en) | Unified address space for multiple hardware accelerators using dedicated low latency links | |
| CN107220200B (en) | Dynamic priority based time-triggered Ethernet data management system and method | |
| EP2902914B1 (en) | Data transmission method and device | |
| KR20120087980A (en) | Multi-interface solid state disk(ssd), processing method and system thereof | |
| CN103714027B (en) | A kind of data transmission method of direct memory access controller and device | |
| KR20120040535A (en) | Bus system and operating method thereof | |
| EP2899644A1 (en) | Device and method for inter-core communication in multi-core processor | |
| CN118550857B (en) | Data transmission method, device, electronic device and storage medium | |
| US12101239B2 (en) | Execution offset rate limiter | |
| TWI717373B (en) | Method and system for usb 2.0 bandwidth reservation | |
| JP2017527219A (en) | Tunneling within a network-on-chip topology | |
| CN116961696A (en) | Dual-mode module communication method and device, electronic equipment and storage medium | |
| CN111290983A (en) | USB transmission equipment and transmission method | |
| US8533377B2 (en) | System and method for allocating transaction ID in a system with a plurality of processing modules | |
| KR101420290B1 (en) | Bus arbiter for grouping transactions, bus devices and systems containing them | |
| US20120281713A1 (en) | Communication system and corresponding integrated circuit and method | |
| CN114296918B (en) | Resource allocation system and method | |
| CN114443400B (en) | Signal testing method and device, system on chip, electronic equipment and storage medium | |
| CN115955441A (en) | Management scheduling method and device based on TSN queue | |
| EP2854042A1 (en) | Information processing apparatus, data transfer apparatus, and data transfer method | |
| CN109947470A (en) | Interrupt arbitrage method and its system based on variable priority | |
| CN118377743B (en) | Arbitration method, device, equipment, medium and product for input request |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| EXSB | Decision made by sipo to initiate substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |