CN114546907A - Data sending and receiving method, device, equipment and storage medium - Google Patents
Data sending and receiving method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN114546907A CN114546907A CN202210130230.4A CN202210130230A CN114546907A CN 114546907 A CN114546907 A CN 114546907A CN 202210130230 A CN202210130230 A CN 202210130230A CN 114546907 A CN114546907 A CN 114546907A
- Authority
- CN
- China
- Prior art keywords
- fifo
- data
- receiving
- transmit
- processing module
- 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
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/16—Handling requests for interconnection or transfer for access to memory bus
- G06F13/1668—Details of memory controller
- G06F13/1673—Details of memory controller using buffers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/16—Handling requests for interconnection or transfer for access to memory bus
- G06F13/1668—Details of memory controller
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/40—Bus structure
- G06F13/4004—Coupling between buses
- G06F13/4027—Coupling between buses using bus bridges
- G06F13/404—Coupling between buses using bus bridges with address mapping
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Communication Control (AREA)
- Information Transfer Systems (AREA)
- Multi Processors (AREA)
Abstract
本申请实施例公开了一种数据发送和接收方法、装置、设备及存储介质,第一处理模块通过第一总线访问FIFO(发送FIFO或接收FIFO),第二处理模块通过缓冲器通用接口与缓冲器(发送缓冲器或接收缓冲器)相连,再通过第二总线访问FIFO。执行数据发送和接收时,基于控制寄存器中FIFO(发送FIFO或接收FIFO)的控制参数确定FIFO的读数据量或写数据量;基于读数据量或写数据量,第一处理模块通过第一总线读或写FIFO,第二处理模块通过缓冲器和第二总线读或写FIFO,使第一处理模块和第二处理模块之间进行缓冲数据交换,从而实现了一种接口友好的跨模块之间的数据交换,减少了总线负担。
The embodiments of the present application disclose a data transmission and reception method, device, device and storage medium. A first processing module accesses a FIFO (transmitting FIFO or receiving FIFO) through a first bus, and a second processing module communicates with the buffer through a buffer common interface. connected to the FIFO (transmit buffer or receive buffer), and then access the FIFO through the second bus. When performing data transmission and reception, the read data volume or the write data volume of the FIFO is determined based on the control parameters of the FIFO (transmit FIFO or receive FIFO) in the control register; based on the read data volume or the write data volume, the first processing module passes through the first bus. Read or write the FIFO, the second processing module reads or writes the FIFO through the buffer and the second bus, so that the buffered data exchange between the first processing module and the second processing module, thus realizing a friendly interface between modules data exchange, reducing the bus burden.
Description
技术领域technical field
本申请涉及计算机技术,尤其涉及一种数据发送和接收方法、装置、设备及存储介质。The present application relates to computer technology, and in particular, to a data transmission and reception method, apparatus, device, and storage medium.
背景技术Background technique
在芯片设计中,由于内存管理等需求,软件和硬件之间,经常需要相互传递大量内存指针等情况,此时需要应用缓冲器,以匹配不同的处理速度从而达到流水作业的目的。In chip design, due to the requirements of memory management, software and hardware often need to transfer a large number of memory pointers to each other. At this time, it is necessary to apply buffers to match different processing speeds to achieve the purpose of pipeline operation.
通常硬件内部数据的缓存及跨时钟域传输都离不开先进先出队列(First InFirst Out,FIFO)。FIFO主要由随机存取存储器(Random Access Memory,RAM)和FIFO控制器组成。在写数据时,写数据端只需要发出写使能和写数据,写指针控制会立刻计算出对应的写地址,数据便会在写使能有效的当拍被写入RAM。在读数据时,读数据端只需要发出读使能,读指针控制会立刻计算出对应的读地址,数据便会在读使能有效的下一拍被读出RAM。Usually, the buffering of data within the hardware and the transmission across clock domains are inseparable from the First In First Out (FIFO) queue. The FIFO is mainly composed of a random access memory (Random Access Memory, RAM) and a FIFO controller. When writing data, the write data terminal only needs to issue the write enable and write data, the write pointer control will immediately calculate the corresponding write address, and the data will be written to the RAM when the write enable is valid. When reading data, the read data terminal only needs to issue the read enable, the read pointer control will immediately calculate the corresponding read address, and the data will be read out of the RAM in the next beat when the read enable is valid.
现有技术中,软件模块和硬件模块之间的数据交互通常都需要通过总线完成对FIFO的读写控制,增加了总线负担,同时也增加了硬件模块的设计复杂度。In the prior art, the data interaction between the software module and the hardware module usually needs to complete the read and write control of the FIFO through the bus, which increases the bus burden and also increases the design complexity of the hardware module.
发明内容SUMMARY OF THE INVENTION
为解决上述技术问题,本申请实施例期望提供一种数据发送和接收方法、装置、设备及存储介质。In order to solve the above technical problems, the embodiments of the present application expect to provide a method, apparatus, device, and storage medium for sending and receiving data.
本申请的技术方案是这样实现的:The technical solution of the present application is realized as follows:
第一方面,提供了一种数据发送方法,包括:In a first aspect, a data sending method is provided, including:
基于发送控制寄存器中的发送FIFO的控制参数确定所述发送FIFO的读数据量;其中,第一处理模块通过第一总线将发送数据写入所述发送FIFO中;Determine the read data volume of the transmit FIFO based on the control parameter of the transmit FIFO in the transmit control register; wherein the first processing module writes the transmit data into the transmit FIFO through the first bus;
基于所述读数据量,通过第二总线从所述发送FIFO中读取数据到发送缓冲器中;Based on the amount of read data, read data from the transmit FIFO into the transmit buffer through the second bus;
控制所述发送缓冲器将所述第一处理模块的数据发送给所述第二处理模块。The sending buffer is controlled to send the data of the first processing module to the second processing module.
第二方面,提供了一种数据接收方法,包括:In a second aspect, a data receiving method is provided, including:
控制接收缓冲器接收第二处理模块的数据;controlling the receiving buffer to receive the data of the second processing module;
基于接收控制寄存器中的接收FIFO的控制参数确定所述接收FIFO的写数据量;Determine the write data volume of the receiving FIFO based on the control parameter of the receiving FIFO in the receiving control register;
基于所述写数据量,将所述接收缓冲器中的数据通过第二总线写入所述接收FIFO中,以供所述第一处理模块通过第一总线从所述接收FIFO中读取所述第二处理模块的数据。Based on the write data amount, write the data in the receive buffer into the receive FIFO through the second bus, so that the first processing module can read the data from the receive FIFO through the first bus The data of the second processing module.
第三方面,提供了一种数据发送装置,所述数据发送装置包括:发送控制寄存器、发送控制器和发送缓冲器;In a third aspect, a data sending apparatus is provided, the data sending apparatus comprising: a sending control register, a sending controller and a sending buffer;
所述发送控制寄存器,用于存储发送FIFO的控制参数;其中,第一处理模块通过第一总线将发送数据写入所述发送FIFO中;The transmission control register is used to store the control parameters of the transmission FIFO; wherein, the first processing module writes the transmission data into the transmission FIFO through the first bus;
所述发送控制器,用于基于发送控制寄存器中的发送FIFO的控制参数确定所述发送FIFO的读数据量;基于所述读数据量,通过第二总线从所述发送FIFO中读取数据到发送缓冲器中;The transmission controller is configured to determine the read data volume of the transmission FIFO based on the control parameter of the transmission FIFO in the transmission control register; based on the read data volume, read data from the transmission FIFO through the second bus to in the send buffer;
所述发送控制器,还用于控制所述发送缓冲器将所述第一处理模块的数据发送给所述第二处理模块。The sending controller is further configured to control the sending buffer to send the data of the first processing module to the second processing module.
第四方面,提供了一种数据接收装置,所述数据接收装置包括:接收控制寄存器、接收控制器和接收缓冲器;In a fourth aspect, a data receiving apparatus is provided, the data receiving apparatus comprising: a receiving control register, a receiving controller and a receiving buffer;
所述接收缓冲器,用于接收第二处理模块的数据;the receiving buffer, for receiving data of the second processing module;
所述接收控制寄存器,用于存储接收FIFO的控制参数;The receiving control register is used to store the control parameters of the receiving FIFO;
所述接收控制器,用于基于接收控制寄存器中的接收FIFO的控制参数确定所述接收FIFO的写数据量;基于所述写数据量,将所述接收缓冲器中的数据通过第二总线写入所述接收FIFO中,以供所述第一处理模块通过第一总线从所述接收FIFO中读取所述第二处理模块的数据。The receiving controller is configured to determine the write data amount of the receive FIFO based on the control parameter of the receive FIFO in the receive control register; based on the write data amount, write the data in the receive buffer through the second bus into the receiving FIFO for the first processing module to read the data of the second processing module from the receiving FIFO through the first bus.
第五方面,提供了一种电子设备,包括:处理器和配置为存储能够在处理器上运行的计算机程序的存储器,In a fifth aspect, there is provided an electronic device comprising: a processor and a memory configured to store a computer program executable on the processor,
其中,所述处理器配置为运行所述计算机程序时,执行前述第一方面或第二方面方法的步骤。Wherein, the processor is configured to execute the steps of the method of the first aspect or the second aspect when running the computer program.
第六方面,提供了一种计算机可读存储介质,其上存储有计算机程序,其中,该计算机程序被处理器执行时实现前述第一方面或第二方面方法的步骤。In a sixth aspect, a computer-readable storage medium is provided, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the method of the first aspect or the second aspect are implemented.
本申请实施例中提供了一种数据发送和接收方法、装置、设备及存储介质,其中,数据发送方法包括:基于发送控制寄存器中的发送FIFO的控制参数确定所述发送FIFO的读数据量;其中,第一处理模块通过第一总线将发送数据写入所述发送FIFO中;基于所述读数据量,通过第二总线从所述发送FIFO中读取数据到发送缓冲器中;控制所述发送缓冲器将所述第一处理模块的数据发送给所述第二处理模块。数据接收方法包括:控制接收缓冲器接收第二处理模块的数据;基于接收控制寄存器中的接收FIFO的控制参数确定所述接收FIFO的写数据量;基于所述写数据量,将所述接收缓冲器中的数据通过第二总线写入所述接收FIFO中,以供所述第一处理模块通过第一总线从所述接收FIFO中读取所述第二处理模块的数据。这样,第一处理模块通过第一总线访问FIFO(发送FIFO或接收FIFO),第二处理模块通过缓冲器通用接口与缓冲器(发送缓冲器或接收缓冲器)相连,再通过第二总线访问FIFO,实现了一种接口友好的跨模块之间的数据交换,减少了总线负担。进一步地,该方法通过设置寄存器中的控制参数,实现了FIFO深度可变的高灵活性跨模块之间的数据交换功能。Embodiments of the present application provide a data transmission and reception method, device, device, and storage medium, wherein the data transmission method includes: determining the read data volume of the transmission FIFO based on a control parameter of the transmission FIFO in the transmission control register; The first processing module writes the sending data into the sending FIFO through the first bus; based on the amount of read data, reads the data from the sending FIFO into the sending buffer through the second bus; controls the The sending buffer sends the data of the first processing module to the second processing module. The data receiving method includes: controlling a receiving buffer to receive data of a second processing module; determining a write data volume of the receiving FIFO based on a control parameter of a receiving FIFO in a receiving control register; The data in the processor is written into the receiving FIFO through the second bus, so that the first processing module can read the data of the second processing module from the receiving FIFO through the first bus. In this way, the first processing module accesses the FIFO (transmitting FIFO or receiving FIFO) through the first bus, the second processing module is connected to the buffer (transmitting buffer or receiving buffer) through the buffer common interface, and then accesses the FIFO through the second bus , realizes a friendly interface data exchange between modules and reduces the bus burden. Further, by setting the control parameters in the register, the method realizes the function of high flexibility cross-module data exchange with variable FIFO depth.
附图说明Description of drawings
图1为本申请实施例中数据发送方法的流程示意图;1 is a schematic flowchart of a data sending method in an embodiment of the present application;
图2为本申请实施例中数据发送系统的结构示意图;2 is a schematic structural diagram of a data transmission system in an embodiment of the application;
图3为本申请实施例中第一处理模块向发送FIFO写数据的流程示意图;3 is a schematic flowchart of the first processing module writing data to the sending FIFO in the embodiment of the application;
图4为本申请实施例中第二处理模块从发送FIFO读数据的流程示意图;4 is a schematic flowchart of a second processing module reading data from the transmission FIFO in the embodiment of the application;
图5为本申请实施例中数据接收方法的流程示意图;5 is a schematic flowchart of a data receiving method in an embodiment of the present application;
图6为本申请实施例中数据接收系统的结构示意图;6 is a schematic structural diagram of a data receiving system in an embodiment of the application;
图7为本申请实施例中第二处理模块向接收FIFO写数据的流程示意图;7 is a schematic flowchart of a second processing module writing data to a receiving FIFO in an embodiment of the present application;
图8为本申请实施例中第一处理模块从接收FIFO读数据的流程示意图;8 is a schematic flowchart of a first processing module reading data from a receiving FIFO in an embodiment of the present application;
图9为本申请实施例中数据发送和接收系统的组成结构示意图;FIG. 9 is a schematic diagram of the composition and structure of a data sending and receiving system in an embodiment of the application;
图10为本申请实施例中数据发送装置的组成结构示意图;FIG. 10 is a schematic diagram of the composition and structure of a data sending apparatus in an embodiment of the present application;
图11为本申请实施例中数据接收装置的组成结构示意图FIG. 11 is a schematic diagram of the composition and structure of a data receiving apparatus in an embodiment of the present application
图12为本申请实施例中电子设备的组成结构示意图。FIG. 12 is a schematic diagram of the composition and structure of an electronic device in an embodiment of the present application.
具体实施方式Detailed ways
为了能够更加详尽地了解本申请实施例的特点与技术内容,下面结合附图对本申请实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本申请实施例。In order to have a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
本申请实施例提供了一种数据发送和接收方法,其中,数据发送方法用于实现第一处理模块向第二处理模块发送数据,数据接收方法用于实现第一处理模块接收第二处理模块的数据。图1为本申请实施例中数据发送方法的流程示意图,如图1所示,该方法具体可以包括:An embodiment of the present application provides a data sending and receiving method, wherein the data sending method is used to enable a first processing module to send data to a second processing module, and the data receiving method is used to enable the first processing module to receive data from the second processing module data. FIG. 1 is a schematic flowchart of a data sending method in an embodiment of the present application. As shown in FIG. 1 , the method may specifically include:
步骤101:基于发送控制寄存器中的发送FIFO的控制参数确定所述发送FIFO的读数据量;其中,第一处理模块通过第一总线将发送数据写入所述发送FIFO中;Step 101: Determine the read data volume of the transmission FIFO based on the control parameter of the transmission FIFO in the transmission control register; wherein, the first processing module writes the transmission data into the transmission FIFO through the first bus;
示例性的,在一些实施例中,所述发送FIFO的控制参数包括:所述发送FIFO所在内存空间的基地址和深度,所述发送FIFO的写指针,读指针,满标志和空标志。Exemplarily, in some embodiments, the control parameters of the transmit FIFO include: a base address and depth of a memory space where the transmit FIFO is located, a write pointer, a read pointer, a full flag and an empty flag of the transmit FIFO.
基地址:指FIFO所在内存空间的起始地址。Base address: refers to the starting address of the memory space where the FIFO is located.
深度:指FIFO可以存储多少个N位的数据,例如8位、16位、32位等。Depth: Refers to how many N bits of data can be stored in the FIFO, such as 8 bits, 16 bits, 32 bits, etc.
读指针:总是指向下一个读取地址,在每个时钟沿来临时读数据,复位时指向第一个地址;Read pointer: always points to the next read address, reads data temporarily at each clock edge, and points to the first address when reset;
写指针:总是指向当前要写入地址,在每个时钟沿来临时写数据,复位时,指向第一个地址;Write pointer: always point to the current address to be written, write data at each clock edge, and point to the first address when reset;
满标志:FIFO已满或将要满时由FIFO状态电路送出一个信号以阻止FIFO的写操作继续向FIFO中继续写数据而造成溢出(overflow)。Full flag: When the FIFO is full or about to be full, a signal is sent by the FIFO status circuit to prevent the FIFO write operation from continuing to write data to the FIFO and cause overflow (overflow).
空标志:FIFO已空或将要空时由FIFO状态电路送出一个信号以阻止FIFO的读操作继续从FIFO中读出数据而造成数据无效读出(underflow)。Empty flag: When the FIFO is empty or about to be empty, a signal is sent by the FIFO status circuit to prevent the FIFO read operation from continuing to read data from the FIFO, resulting in invalid data readout (underflow).
示例性的,在一些实施例中,所述方法还包括:配置所述发送控制寄存器中所述发送FIFO所在内存空间的基地址和深度。这里,将数据存储在内存空间,通过配置发送控制寄存器中发送FIFO所在内存空间的基地址和深度,能够根据使用场景灵活设置FIFO深度,数据交互不受FIFO深度限制,实现高灵活性的数据交互方案。Exemplarily, in some embodiments, the method further includes: configuring the base address and depth of the memory space where the transmit FIFO is located in the transmit control register. Here, the data is stored in the memory space. By configuring the base address and depth of the memory space where the transmission FIFO is located in the transmission control register, the FIFO depth can be flexibly set according to the usage scenario, and the data interaction is not limited by the FIFO depth, realizing highly flexible data interaction. Program.
示例性的,在一些实施例中,所述基于发送控制寄存器中的发送FIFO的控制参数确定所述发送FIFO的读数据量,包括:所述发送控制寄存器中所述空标志指示所述发送FIFO非空,且所述发送缓冲器非满,基于所述发送FIFO的所述读指针和所述写指针,确定所述发送FIFO的已用空间;基于所述发送FIFO的已用空间,确定所述读数据量。具体地,发送FIFO的读指针和写指针相减得到发送FIFO的已用空间。Exemplarily, in some embodiments, the determining the read data volume of the transmit FIFO based on the control parameter of the transmit FIFO in the transmit control register includes: the empty flag in the transmit control register indicates that the transmit FIFO is not empty, and the transmit buffer is not full, the used space of the transmit FIFO is determined based on the read pointer and the write pointer of the transmit FIFO; based on the used space of the transmit FIFO, the used space of the transmit FIFO is determined. The amount of data read. Specifically, the used space of the transmit FIFO is obtained by subtracting the read pointer and the write pointer of the transmit FIFO.
这里,当空标志指示发送FIFO非空表示发送FIFO中包含第一处理模块发送给第二处理模块的数据,发送缓冲器非满表示发送缓冲器有可用空间用于缓存发送数据。当这两个条件同时满足时,第一处理模块利用发送FIFO和发送缓冲器向第二处理模块发送数据。Here, when the empty flag indicates that the transmission FIFO is not empty, it means that the transmission FIFO contains data sent by the first processing module to the second processing module, and the transmission buffer is not full means that the transmission buffer has available space for buffering the transmission data. When these two conditions are satisfied at the same time, the first processing module sends data to the second processing module by using the transmit FIFO and the transmit buffer.
进一步地,根据发送FIFO的已用空间确定本次发送从发送FIFO内的读数据量,读数据量不超过发送FIFO的已用空间存储的数据量。示例性的,读数据量为发送FIFO的已用空间存储的数据量,即本次发送过程将发送FIFO内的全部数据发送到发送缓冲器中。Further, according to the used space of the sending FIFO, the amount of read data sent from the sending FIFO this time is determined, and the amount of read data does not exceed the amount of data stored in the used space of the sending FIFO. Exemplarily, the amount of read data is the amount of data stored in the used space of the sending FIFO, that is, all data in the sending FIFO is sent to the sending buffer during this sending process.
示例性的,在一些实施例中,若读数据量受发送缓冲器空间的影响,则该方法还包括:确定所述发送缓冲器的可用空间;相应的,所述基于所述发送FIFO的已用空间,确定所述读数据量,包括:从所述发送FIFO的已用空间和所述发送缓冲器的可用空间中确定最小空间;将所述最小空间对应的数据容量作为所述读数据量。这里,读数据量的表达式可以为读数据量=Min[发送FIFO已用空间,发送缓冲器可用空间]。Exemplarily, in some embodiments, if the amount of read data is affected by the space of the sending buffer, the method further includes: determining the available space of the sending buffer; Using the space to determine the read data amount includes: determining a minimum space from the used space of the transmit FIFO and the available space of the transmit buffer; taking the data capacity corresponding to the minimum space as the read data amount . Here, the expression of the amount of read data may be the amount of read data=Min [the used space of the transmit FIFO, the free space of the transmit buffer].
示例性的,在一些实施例中,该方法还包括第一处理模块向发送FIFO写数据。具体地,所述发送控制寄存器中所述满标志指示所述发送FIFO非满,基于所述发送FIFO的所述读指针和所述写指针,确定所述发送FIFO的可用空间;基于所述发送FIFO的可用空间,确定所述第一处理模块写入所述发送FIFO的写数据量;基于所述写数据量,控制所述第一处理模块通过所述第一总线将发送数据写入所述发送FIFO中。具体地,发送FIFO的读指针和写指针相减得到发送FIFO的已用空间,发送FIFO的总空间和已用空间相减得到可用空间。Exemplarily, in some embodiments, the method further includes the first processing module writing data to the transmit FIFO. Specifically, the full flag in the transmit control register indicates that the transmit FIFO is not full, and the available space of the transmit FIFO is determined based on the read pointer and the write pointer of the transmit FIFO; based on the transmit FIFO The available space of the FIFO is used to determine the amount of write data that the first processing module writes into the transmit FIFO; and based on the amount of write data, the first processing module is controlled to write the transmit data into the transmit FIFO through the first bus. transmit FIFO. Specifically, the used space of the sending FIFO is obtained by subtracting the read pointer and the writing pointer of the sending FIFO, and the available space is obtained by subtracting the total space of the sending FIFO and the used space.
这里,写数据量不超过发送FIFO的可用空间对应的数据量。示例性的,在一些实施例中,所述基于所述发送FIFO的可用空间,确定所述第一处理模块写入所述发送FIFO的写数据量,包括:将所述发送FIFO的可用空间对应的数据量和所述第一处理模块的待发送数据量中的最小数据量,作为所述第一处理模块写入所述发送FIFO的写数据量。例如,待发送数据量小于发送FIFO的可用空间对应的数据量,将待发送数据量作为本次写数据量,待发送数据量大于等于发送FIFO的可用空间对应的数据量,将可用空间对应的数据量作为写数据量。Here, the amount of written data does not exceed the amount of data corresponding to the available space of the transmit FIFO. Exemplarily, in some embodiments, the determining, based on the available space of the sending FIFO, the amount of write data written into the sending FIFO by the first processing module includes: corresponding to the available space of the sending FIFO; The minimum data amount among the data amount to be sent by the first processing module and the data amount to be sent by the first processing module is taken as the write data amount written into the sending FIFO by the first processing module. For example, if the amount of data to be sent is less than the amount of data corresponding to the available space in the send FIFO, the amount of data to be sent is taken as the amount of data to be written this time, and the amount of data to be sent is greater than or equal to the amount of data corresponding to the available space in the send FIFO, and the amount of data to be sent is taken as the amount of data corresponding to the available space in the send FIFO. The amount of data is used as the amount of write data.
示例性的,在一些实施例中,所述基于所述写数据量,控制所述第一处理模块通过所述第一总线将发送数据写入所述发送FIFO中之后,所述方法还包括:更新所述发送控制寄存器中所述发送FIFO的所述写指针。Exemplarily, in some embodiments, after the first processing module is controlled to write the transmit data into the transmit FIFO through the first bus based on the amount of write data, the method further includes: The write pointer of the transmit FIFO in the transmit control register is updated.
步骤102:基于所述读数据量,通过第二总线从所述发送FIFO中读取数据到发送缓冲器中;Step 102: Based on the amount of read data, read data from the transmit FIFO into the transmit buffer through the second bus;
示例性的,在一些实施例中,所述基于所述读数据量,通过第二总线从所述发送FIFO中读取数据到发送缓冲器中之后,所述方法还包括:更新所述发送控制寄存器中所述发送FIFO的所述读指针。Exemplarily, in some embodiments, after the data is read from the transmit FIFO to the transmit buffer through the second bus based on the amount of read data, the method further includes: updating the transmit control the read pointer of the transmit FIFO in the register.
步骤103:控制所述发送缓冲器将所述第一处理模块的数据发送给所述第二处理模块。Step 103: Control the sending buffer to send the data of the first processing module to the second processing module.
这里,第二处理模块通过缓冲器通用接口与发送缓冲器相连,用于获取发送缓冲器中的数据。Here, the second processing module is connected to the sending buffer through the buffer general interface, and is used for acquiring data in the sending buffer.
实际应用中,第一处理模块和第二处理模块可以为同一电子设备中的不同模块,也可以是不同电子设备中的不同模块。In practical applications, the first processing module and the second processing module may be different modules in the same electronic device, or may be different modules in different electronic devices.
示例性的,在一些实施例中,所述第一处理模块为软件模块,所述第二处理模块为硬件模块。这里,软件模块通过第一总线与发送FIFO相连,用于将发送数据写入发送FIFO,硬件模块通过通用的FIFO接口(即发送缓冲器的接口)与发送缓冲器相连,通过发送缓冲器接收发送FIFO的数据,无需通过总线访问发送FIFO,使得硬件模块不需要更改原有的FIFO接口,即采用通用FIFO接口访问发送FIFO,使得软件模块采用总线接口访问发送FIFO,从而实现跨模块间的缓冲数据交换,有很好的通用性。Exemplarily, in some embodiments, the first processing module is a software module, and the second processing module is a hardware module. Here, the software module is connected to the sending FIFO through the first bus, and is used to write the sending data into the sending FIFO. FIFO data does not need to access the sending FIFO through the bus, so that the hardware module does not need to change the original FIFO interface, that is, the general FIFO interface is used to access the sending FIFO, so that the software module uses the bus interface to access the sending FIFO, so as to realize the buffered data across modules Swap, has good versatility.
本申请实施例提供的数据发送方法由数据发送装置实现,图2为本申请实施例中数据发送系统的结构示意图,如图2所示,数据发送系统包括软件模块、发送FIFO、数据发送装置和硬件模块,其中,数据发送装置包括如下组成结构:The data sending method provided by the embodiment of the present application is implemented by a data sending device, and FIG. 2 is a schematic structural diagram of the data sending system in the embodiment of the present application. As shown in FIG. 2 , the data sending system includes a software module, a sending FIFO, a data sending device and a Hardware module, wherein, the data transmission device includes the following composition:
1.发送控制寄存器:用于设置发送FIFO的控制参数,具体包括发送FIFO所在内存空间的基地址(tx_fifo_base_addr)和深度(tx_depth),发送FIFO的读写指针(tx_rd_ptr(hw write)和tx_wr_ptr(sw write)),以及空满信息(tx_full和tx_empty)。1. Send control register: used to set the control parameters of the send FIFO, including the base address (tx_fifo_base_addr) and depth (tx_depth) of the memory space where the send FIFO is located, the read and write pointers of the send FIFO (tx_rd_ptr (hw write) and tx_wr_ptr (sw write)), and empty full information (tx_full and tx_empty).
2.发送控制器:用于控制从发送FIFO中预取的数据量,通过第一总线向发送FIFO发出读请求,并更新读完成后的读指针。2. Sending controller: used to control the amount of data prefetched from the sending FIFO, send a read request to the sending FIFO through the first bus, and update the read pointer after the read is completed.
3.发送缓冲器:用于对接第二处理模块和发送控制器,并缓冲从发送FIFO中预取的数据。3. Sending buffer: used to connect the second processing module and the sending controller, and buffer the data prefetched from the sending FIFO.
其中,硬件模块通过通用接口与发送缓冲器连接,发送控制器与发送控制寄存器和发送缓冲器连接,发送控制器通过第二总线和发送FIFO连接,用于从发送FIFO中读取数据缓存到发送缓冲器中,软件模块通过第一总线与发送FIFO连接,用于向发送FIFO写数据。这里,第一总线和第二总线也可以统称为总线,用于实现组件之间的连接通信。Among them, the hardware module is connected with the sending buffer through a general interface, the sending controller is connected with the sending control register and the sending buffer, and the sending controller is connected with the sending FIFO through the second bus, which is used to read the data buffer from the sending FIFO to the sending In the buffer, the software module is connected with the sending FIFO through the first bus, and is used for writing data to the sending FIFO. Here, the first bus and the second bus may also be collectively referred to as buses, which are used to implement connection and communication between components.
图3为本申请实施例中第一处理模块向发送FIFO写数据的流程示意图,如图3所示,第一处理模块向发送FIFO写数据操作具体步骤如下:FIG. 3 is a schematic flowchart of the first processing module writing data to the sending FIFO in the embodiment of the application. As shown in FIG. 3 , the specific steps of the first processing module writing data to the sending FIFO are as follows:
S1:等待新的数据。S1: Wait for new data.
S2:读取发送控制寄存器,获得当前发送FIFO的满标记,写指针和读指针。S2: Read the transmit control register to obtain the current transmit FIFO full mark, write pointer and read pointer.
S3:软件判断当前发送FIFO是否为满状态:如为非满状态,则跳至S5;如为满状态,则跳至S4等待状态。S3: The software judges whether the current sending FIFO is full: if it is not full, it will jump to S5; if it is full, it will jump to S4 waiting state.
S4:等待发送FIFO非满再跳至S5。S4: Wait until the transmit FIFO is not full before jumping to S5.
S5:根据当前读写指针计算出发送FIFO可用空间,再根据如下公式计算出本次能写入发送FIFO的写数据量。S5: Calculate the available space of the transmit FIFO according to the current read/write pointer, and then calculate the amount of write data that can be written into the transmit FIFO this time according to the following formula.
写数据量=Min[发送FIFO可用空间,第一处理模块待发送数据量]Write data volume = Min [available space in the sending FIFO, the amount of data to be sent by the first processing module]
S6:根据S5的计算结果从发送FIFO的写指针开始,依次写入对应数量的数据至发送FIFO。S6: Start from the write pointer of the transmit FIFO according to the calculation result of S5, and sequentially write the corresponding amount of data to the transmit FIFO.
S7:根据S5的计算结果更新发送控制寄存器的写指针,之后跳转至S1继续下一次发送FIFO的写操作。S7: Update the write pointer of the sending control register according to the calculation result of S5, and then jump to S1 to continue the writing operation of the next sending FIFO.
需要说明的是,第一处理模块向发送FIFO写数据的控制过程可以由第一处理模块控制实现,也可以由图2中发送控制器控制实现。It should be noted that, the control process for the first processing module to write data to the sending FIFO can be controlled and implemented by the first processing module, or can be controlled and implemented by the sending controller in FIG. 2 .
图4为本申请实施例中第二处理模块从发送FIFO读数据的流程示意图,如图4所示,发送控制器的工作流程如下:FIG. 4 is a schematic flowchart of the second processing module reading data from the transmission FIFO in the embodiment of the application. As shown in FIG. 4 , the workflow of the transmission controller is as follows:
S1:等待发送缓冲器非满,且发送FIFO非空。S1: Wait until the transmit buffer is not full and the transmit FIFO is not empty.
这里,利用控制寄存器的空标记指示发送FIFO是否为非空。Here, whether the transmit FIFO is not empty is indicated by the empty flag of the control register.
S2:根据当前读写指针计算出发送FIFO可用空间,再根据如下公式计算出本次能从发送FIFO读数据量;S2: Calculate the available space of the sending FIFO according to the current read/write pointer, and then calculate the amount of data that can be read from the sending FIFO this time according to the following formula;
读数据量=Min[发送FIFO已用空间,发送缓冲器可用空间]Amount of read data = Min [Used space of transmit FIFO, free space of transmit buffer]
S3:发送控制器通过第二总线读取S2计算出读数据量的数据至发送缓冲器。S3: The sending controller reads the data of the amount of read data calculated by S2 through the second bus to the sending buffer.
S4:更新发送FIFO的读指针,之后跳转至S1继续下一次发送FIFO的读操作。S4: Update the read pointer of the transmit FIFO, and then jump to S1 to continue the next read operation of the transmit FIFO.
采用上述技术方案,第一处理模块通过第一总线向发送FIFO写数据,第二处理模块通过缓冲器通用接口与发送缓冲器相连,通过发送缓冲器从发送FIFO读数据,实现了一种接口友好的跨模块之间的数据交换,减少了总线负担。进一步地,该方法通过设置寄存器中的控制参数,实现了FIFO深度可变的高灵活性跨模块之间的数据交换功能。With the above technical solution, the first processing module writes data to the sending FIFO through the first bus, the second processing module is connected to the sending buffer through the buffer general interface, and reads data from the sending FIFO through the sending buffer, thereby realizing a friendly interface. The cross-module data exchange reduces the bus burden. Further, by setting the control parameters in the register, the method realizes the function of high flexibility cross-module data exchange with variable FIFO depth.
本申请实施例还提供了一种数据接收方法,图5为本申请实施例中数据接收方法的流程示意图,如图5所示,该方法具体可以包括:The embodiment of the present application also provides a data receiving method. FIG. 5 is a schematic flowchart of the data receiving method in the embodiment of the present application. As shown in FIG. 5 , the method may specifically include:
步骤501:控制接收缓冲器接收第二处理模块的数据;Step 501: control the receiving buffer to receive the data of the second processing module;
这里,第二处理模块通过缓冲器通用接口与接收缓冲器相连,用于向接收缓冲器写入数据。Here, the second processing module is connected to the receiving buffer through the buffer general interface, and is used for writing data to the receiving buffer.
步骤502:基于接收控制寄存器中的所述接收FIFO的控制参数确定所述接收FIFO的写数据量;Step 502: Determine the write data volume of the receiving FIFO based on the control parameter of the receiving FIFO in the receiving control register;
示例性的,在一些实施例中,所述接收FIFO的控制参数包括:所述接收FIFO所在内存空间的基地址和深度,所述发送FIFO的写指针,读指针,满标志和空标志。Exemplarily, in some embodiments, the control parameters of the receiving FIFO include: a base address and depth of the memory space where the receiving FIFO is located, a write pointer, a read pointer, a full flag and an empty flag of the sending FIFO.
示例性的,在一些实施例中,所述方法还包括:配置所述接收控制寄存器中所述接收FIFO所在内存空间的基地址和深度。这里,通过配置接收控制寄存器中接收FIFO所在内存空间的基地址和深度,能够根据使用场景灵活设置FIFO深度,数据交互不受FIFO深度限制,实现高灵活性的数据交互方案。Exemplarily, in some embodiments, the method further includes: configuring the base address and depth of the memory space where the receive FIFO in the receive control register is located. Here, by configuring the base address and depth of the memory space where the receiving FIFO is located in the receiving control register, the FIFO depth can be flexibly set according to the usage scenario, the data interaction is not limited by the FIFO depth, and a highly flexible data interaction scheme is realized.
示例性的,在一些实施例中,所述基于接收控制寄存器中的接收FIFO的控制参数确定所述接收FIFO的写数据量,包括:所述接收控制寄存器中所述满标志指示所述接收FIFO非满,且所述接收缓冲器非空,基于所述接收FIFO的所述读指针和所述写指针,确定所述接收FIFO的可用空间;基于所述接收FIFO的可用空间,确定所述写数据量。具体地,接收FIFO的读指针和写指针相减得到接收FIFO的已用空间,接收FIFO的总空间和已用空间相减得到可用空间。Exemplarily, in some embodiments, the determining the write data volume of the receiving FIFO based on the control parameter of the receiving FIFO in the receiving control register includes: the full flag in the receiving control register indicates that the receiving FIFO is full. is not full, and the receive buffer is not empty, determine the available space of the receive FIFO based on the read pointer and the write pointer of the receive FIFO; determine the write based on the available space of the receive FIFO The amount of data. Specifically, the used space of the receiving FIFO is obtained by subtracting the read pointer and the writing pointer of the receiving FIFO, and the available space is obtained by subtracting the total space of the receiving FIFO and the used space.
这里,当满标志指示接收FIFO非满表示接收FIFO表示发接收FIFO有可用空间用于接收第二处理模块的数据,接收缓冲器非空表示接收缓冲器中包含第二处理模块发送给第一处理模块的数据。当这两个条件同时满足时,第一处理模块利用发送FIFO和发送缓冲器接收第二处理模块的数据。Here, when the full flag indicates that the receiving FIFO is not full, it indicates that the receiving FIFO indicates that the sending and receiving FIFO has available space for receiving data from the second processing module, and that the receiving buffer is not empty indicates that the receiving buffer contains the second processing module and sends it to the first processing module. module data. When these two conditions are satisfied at the same time, the first processing module receives the data of the second processing module by using the transmit FIFO and the transmit buffer.
进一步地,根据接收FIFO的可用空间确定本次接收写入接收FIFO内的写数据量,写数据量不超过接收FIFO的可用空间所能存储的数据量。示例性的,写数据量为接收FIFO的可用空间所能存储的数据量。Further, the amount of write data received and written into the receive FIFO is determined according to the available space of the receive FIFO, and the amount of write data does not exceed the amount of data that can be stored in the available space of the receive FIFO. Exemplarily, the amount of write data is the amount of data that can be stored in the available space of the receiving FIFO.
示例性的,在一些实施例中,若写数据量受接收缓冲器空间的影响,则该所述方法还包括:确定所述接收缓冲器的已用空间;相应的,所述基于所述接收FIFO的可用空间,确定所述写数据量,包括:从所述接收FIFO的可用空间和所述接收缓冲器的已用空间中确定最小空间;将所述最小空间对应的数据容量作为所述写数据量。这里,写数据量的表达式可以为写数据量=Min[接收FIFO可用空间,接收缓冲器已用空间]。Exemplarily, in some embodiments, if the amount of written data is affected by the space of the receiving buffer, the method further includes: determining the used space of the receiving buffer; The available space of the FIFO, and determining the write data volume includes: determining a minimum space from the available space of the receiving FIFO and the used space of the receiving buffer; taking the data capacity corresponding to the minimum space as the write data capacity The amount of data. Here, the expression of the write data amount may be the write data amount=Min [receive FIFO free space, receive buffer used space].
步骤503:基于所述写数据量,将所述接收缓冲器中的数据通过第二总线写入所述接收FIFO中,以供所述第一处理模块通过第一总线从所述接收FIFO中读取所述第二处理模块的数据。Step 503: Based on the write data volume, write the data in the receive buffer into the receive FIFO through the second bus for the first processing module to read from the receive FIFO through the first bus Get the data of the second processing module.
示例性的,在一些实施例中,所述基于所述写数据量,将所述接收缓冲器中的数据通过第二总线写入所述接收FIFO中之后,所述方法还包括:更新所述接收控制寄存器中所述接收FIFO的所述写指针。Exemplarily, in some embodiments, after the data in the receive buffer is written into the receive FIFO through the second bus based on the amount of write data, the method further includes: updating the receive FIFO. receiving the write pointer of the receive FIFO in the control register.
示例性的,在一些实施例中,该方法还包括第一处理模块从接收FIFO中读数据。具体地,所述接收控制寄存器中所述空标志指示所述接收FIFO非空,基于所述接收FIFO的所述读指针和所述写指针,确定所述接收FIFO的已用空间;基于所述接收FIFO的已用空间,确定所述第一处理模块读取所述接收FIFO的读数据量;基于所述读数据量,控制所述第一处理模块通过第一总线从所述接收FIFO读取数据。具体地,接收FIFO的读指针和写指针相减得到接收FIFO的已用空间。Exemplarily, in some embodiments, the method further includes the first processing module reading data from the receive FIFO. Specifically, the empty flag in the receiving control register indicates that the receiving FIFO is not empty, and based on the read pointer and the write pointer of the receiving FIFO, the used space of the receiving FIFO is determined; based on the The used space of the receiving FIFO is determined, and the read data amount read by the first processing module from the receiving FIFO is determined; based on the read data amount, the first processing module is controlled to read from the receiving FIFO through the first bus data. Specifically, the used space of the receiving FIFO is obtained by subtracting the read pointer and the write pointer of the receiving FIFO.
这里,读数据量不超过接收FIFO的已用空间存储的数据量。示例性的,在一些实施例中,所述基于所述读数据量,控制所述第一处理模块通过第一总线从所述接收FIFO读取数据,包括:将所述接收FIFO的已用空间存储的数据量和所述第一处理模块的允许接收数据量中的最小数据量,作为接收FIFO的读数据量。例如,允许接收数据量小于接收FIFO的已用空间存储的数据量,将允许接收数据量作为本次读数据量,允许接收数据量大于等于接收FIFO的已用空间存储的数据量,将已用空间存储的数据量作为读数据量。Here, the amount of read data does not exceed the amount of data stored in the used space of the receive FIFO. Exemplarily, in some embodiments, the controlling the first processing module to read data from the receiving FIFO through the first bus based on the amount of read data includes: changing the used space of the receiving FIFO to The amount of stored data and the minimum amount of data allowed to be received by the first processing module is taken as the amount of read data of the receiving FIFO. For example, if the amount of data allowed to be received is less than the amount of data stored in the used space of the receiving FIFO, the amount of data allowed to be received will be taken as the amount of data read this time, and the amount of data allowed to be received is greater than or equal to the amount of data stored in the used space of the receiving FIFO, and the amount of data that is allowed to be received will be used The amount of data stored in the space is used as the amount of read data.
示例性的,在一些实施例中,所述基于所述读数据量,控制所述第一处理模块通过第一总线从所述接收FIFO读取数据之后,所述方法还包括:更新所述接收控制寄存器中所述接收FIFO的所述读指针。Exemplarily, in some embodiments, after the first processing module is controlled to read data from the receiving FIFO through the first bus based on the amount of read data, the method further includes: updating the receiving FIFO the read pointer of the receive FIFO in the control register.
实际应用中,第一处理模块和第二处理模块可以为同一电子设备中的不同模块,也可以是不同电子设备中的不同模块。In practical applications, the first processing module and the second processing module may be different modules in the same electronic device, or may be different modules in different electronic devices.
示例性的,在一些实施例中,所述第一处理模块为软件模块,所述第二处理模块为硬件模块。这里,硬件模块采用通用的FIFO接口(即接收缓冲器的接口)与接收缓冲器相连,将发送给软件模块的数据写入接收缓冲器,再将接收缓冲器中的数据通过第二总线写入接收FIFO,软件模块通过第一总线与接收FIFO相连,用于从接收FIFO读数据,使得硬件模块不需要更改原有的FIFO接口,即采用通用FIFO接口访问接收FIFO,使得软件模块采用总线接口访问接收FIFO,从而实现跨模块间的缓冲数据交换,有很好的通用性。Exemplarily, in some embodiments, the first processing module is a software module, and the second processing module is a hardware module. Here, the hardware module uses a general FIFO interface (that is, the interface of the receiving buffer) to connect with the receiving buffer, writes the data sent to the software module into the receiving buffer, and then writes the data in the receiving buffer through the second bus. Receiving FIFO, the software module is connected to the receiving FIFO through the first bus, and is used to read data from the receiving FIFO, so that the hardware module does not need to change the original FIFO interface, that is, the general FIFO interface is used to access the receiving FIFO, so that the software module uses the bus interface to access Receive FIFO, so as to realize the exchange of buffered data across modules, which has good versatility.
本申请实施例提供的数据发送方法由数据接收装置实现,图6为本申请实施例中数据接收系统的组成结构示意图,如图6所示,数据接收系统包括软件模块、接收FIFO、数据接收装置和硬件模块,其中,数据接收装置包括如下组成结构:The data sending method provided by the embodiment of the present application is implemented by a data receiving device. FIG. 6 is a schematic diagram of the composition and structure of the data receiving system in the embodiment of the present application. As shown in FIG. 6 , the data receiving system includes a software module, a receiving FIFO, and a data receiving device. And the hardware module, wherein, the data receiving device includes the following composition structure:
1.接收控制寄存器:用于设置接收FIFO的控制参数,具体包括接收FIFO所在内存空间的基地址(tx_fifo_base_addr)和深度(tx_depth),发送FIFO的读写指针(tx_rd_ptr(hw write)和tx_wr_ptr(sw write)),以及空满信息(tx_full和tx_empty)。1. Receive control register: used to set the control parameters of the receive FIFO, including the base address (tx_fifo_base_addr) and depth (tx_depth) of the memory space where the receive FIFO is located, and the read and write pointers of the transmit FIFO (tx_rd_ptr (hw write) and tx_wr_ptr (sw write)), and empty full information (tx_full and tx_empty).
2.接收控制器:用于控制从接收缓冲器预取的数据量,通过第二总线向接收FIFO发出写请求,并更新写完成后的写指针。2. Receive controller: used to control the amount of data prefetched from the receive buffer, send a write request to the receive FIFO through the second bus, and update the write pointer after the write is completed.
3.接收缓冲器:用于对接第二处理模块和接收控制器,并缓冲从第二模块预取的数据。3. Receive buffer: used to interface with the second processing module and the receiving controller, and buffer the data prefetched from the second module.
其中,硬件模块通过通用接口与接收缓冲器连接,接收控制器与接收控制寄存器和接收缓冲器连接,接收控制器通过第二总线和接收FIFO连接,用于将接收缓冲器中的数据写入接收FIFO中,软件模块通过第一总线与接收FIFO连接,用于从接收FIFO读数据。The hardware module is connected with the receiving buffer through a general interface, the receiving controller is connected with the receiving control register and the receiving buffer, and the receiving controller is connected with the receiving FIFO through the second bus, which is used to write the data in the receiving buffer into the receiving buffer. In the FIFO, the software module is connected to the receiving FIFO through the first bus, and is used for reading data from the receiving FIFO.
图7为本申请实施例中第二处理模块向接收FIFO写数据的流程示意图,如图7所示,接收控制器的工作流程如下:FIG. 7 is a schematic flowchart of the second processing module writing data to the receiving FIFO in the embodiment of the application. As shown in FIG. 7 , the working process of the receiving controller is as follows:
S1:等待接收缓冲器非空,且接收FIFO非满。S1: Wait until the receive buffer is not empty and the receive FIFO is not full.
这里,利用接收控制寄存器的满标记指示接收FIFO是否非满。Here, whether the receive FIFO is not full is indicated by the full flag of the receive control register.
S2:根据当前读写指针计算出接收FIFO可用空间,再根据如下公式计算出本次能向接收FIFO写数据量;S2: Calculate the available space of the receiving FIFO according to the current read and write pointer, and then calculate the amount of data that can be written to the receiving FIFO this time according to the following formula;
写数据量=Min[接收FIFO可用空间,接收缓冲器已用空间]Amount of write data = Min[free space of receive FIFO, used space of receive buffer]
S3:接收控制器通过第二总线读取S2计算出写数据量的数据写入接收FIFO。S3: The receiving controller reads the data with the amount of write data calculated by S2 through the second bus and writes it into the receiving FIFO.
S4:更新接收FIFO的写指针,之后跳转至S1继续下一次接收FIFO的写操作。S4: Update the write pointer of the receiving FIFO, and then jump to S1 to continue the writing operation of the next receiving FIFO.
图8为本申请实施例中第一处理模块从接收FIFO读数据的流程示意图,如图8所示,第一处理模块从接收FIFO读数据操作具体步骤如下:FIG. 8 is a schematic flowchart of the first processing module reading data from the receiving FIFO in the embodiment of the application. As shown in FIG. 8 , the specific steps of the first processing module reading data from the receiving FIFO are as follows:
S1:等待接收FIFO接收新的数据。S1: Wait for the receive FIFO to receive new data.
S2:读取接收控制寄存器,获得当前接收FIFO的空标记,写指针和读指针。S2: Read the receive control register to obtain the empty flag, write pointer and read pointer of the current receive FIFO.
S3:软件判断当前接收FIFO是否为空状态;如为非空状态,则跳至S5;如为空状态,则跳至S4等待状态。S3: The software judges whether the current receiving FIFO is empty; if it is not empty, it will jump to S5; if it is empty, it will jump to S4 waiting state.
S4:等待接收FIFO非空再跳至S5。S4: Wait until the receive FIFO is not empty and then jump to S5.
S5:根据当前读写指针计算出接收FIFO已用空间,再根据如下公式计算出本次能读取接收FIFO的读数据量。S5: Calculate the used space of the receiving FIFO according to the current read/write pointer, and then calculate the amount of read data that can be read from the receiving FIFO this time according to the following formula.
读数据量=Min[接收FIFO已用空间,第一处理模块允许接收数据量]Amount of read data=Min[used space in receiving FIFO, amount of data allowed to be received by the first processing module]
S6:根据S5的计算结果从接收FIFO的读指针开始,依次读对应数量的数据。S6: Start from the read pointer of the receiving FIFO according to the calculation result of S5, and sequentially read the corresponding amount of data.
S7:根据S5的计算结果更新接收控制寄存器的读指针,之后跳转至S1继续下一次接收FIFO的读操作。S7: Update the read pointer of the receiving control register according to the calculation result of S5, and then jump to S1 to continue the read operation of the next receiving FIFO.
采用上述技术方案,第二处理模块通过缓冲器通用接口与接收缓冲器相连,通过接收缓冲器向接收FIFO写数据,第一处理模块通过第一总线从接收FIFO读数据,实现了一种接口友好的跨模块之间的数据交换,减少了总线负担。进一步地,该方法通过设置寄存器中的控制参数,实现了FIFO深度可变的高灵活性跨模块之间的数据交换功能。By adopting the above technical solution, the second processing module is connected to the receiving buffer through the buffer universal interface, writes data to the receiving FIFO through the receiving buffer, and the first processing module reads data from the receiving FIFO through the first bus, thereby realizing a friendly interface. The cross-module data exchange reduces the bus burden. Further, by setting the control parameters in the register, the method realizes the function of high flexibility cross-module data exchange with variable FIFO depth.
在上述实施例的基础上对本申请实施例提供的数据发送和接收方法进行进一步地举例说明,实际应用上,发送控制寄存器和接收控制寄存器为同一个寄存器组,发送FIFO和接收FIFO可以为同一个FIFO,通过时钟控制发送和接收过程,避免读写冲突。On the basis of the above embodiments, the data sending and receiving methods provided by the embodiments of the present application are further illustrated. In practical applications, the sending control register and the receiving control register are the same register group, and the sending FIFO and the receiving FIFO may be the same FIFO, which controls the sending and receiving process through the clock to avoid read and write conflicts.
图9为本申请实施例中数据发送和接收系统的组成结构示意图,如图9所示,数据发送和接收系统包括软件模块、发送FIFO、数据发送和接收装置、硬件模块,其中数据发送和接收装置用于实现软件模块和硬件模块之间的数据交互,软件模块初始化发送和接收FIFO的操作与上述初始化发送FIFO和接收FIFO的方法相同,即初始化FIFO所在内存空间的基地址和深度;发送控制器的工作流程与上述数据发送装置中的发送控制器的工作流程相同;接收控制器的工作流程与上述数据接收装置中的接收控制器的工作流程相同。FIG. 9 is a schematic structural diagram of a data sending and receiving system in an embodiment of the application. As shown in FIG. 9 , the data sending and receiving system includes a software module, a sending FIFO, a data sending and receiving device, and a hardware module, wherein the data sending and receiving The device is used to realize the data interaction between the software module and the hardware module. The operation of the software module to initialize the sending and receiving FIFO is the same as the above-mentioned method of initializing the sending FIFO and the receiving FIFO, that is, the base address and depth of the memory space where the FIFO is located; the sending control The work flow of the receiver is the same as that of the transmitting controller in the above data transmitting apparatus; the work flow of the receiving controller is the same as that of the receiving controller in the above data receiving apparatus.
软件模块在发送数据时更新发送和接收FIFO的写指针(fifo_wr_ptr),硬件模块1在接收数据时更新发送和接收FIFO的读指针(fifo_rd_ptr)。硬件模块2在发送数据时更新发送和接收FIFO的写指针(fifo_wr_ptr),软件模块在接收数据时更新发送和接收FIFO的读指针(fifo_rd_ptr)。软件模块和硬件模块2不会同时更新写指针,软件模块和硬件模块1不会同时更新读指针,从而避免更新读写指针的冲突问题。The software module updates the write pointer (fifo_wr_ptr) of the transmit and receive FIFO when sending data, and the
图9中以软件模块为基准数据流包括发送方向和接收方向,实际应用中软件模块和硬件模块只更新读写指针中的一个,软硬件模块不会同时更新同一个指针,避免带来的一致性问题。In Figure 9, the software module is used as the reference data flow, including the sending direction and the receiving direction. In practical applications, the software module and the hardware module only update one of the read and write pointers, and the software and hardware modules will not update the same pointer at the same time, to avoid the consistency caused by Sexual issues.
在一些实施例中,可以由一个控制器分时实现接收控制器和发送控制器功能,由一个缓冲器分时实现接收缓冲器和发送缓冲器功能。In some embodiments, the functions of the receive controller and the transmit controller may be implemented in a time-sharing manner by one controller, and the functions of the receive buffer and the transmit buffer may be implemented by a buffer in time-division.
为实现本申请实施例的数据发送方法,基于同一发明构思本申请实施例还提供了一种数据发送装置,如图10所示,数据发送装置100包括:发送控制寄存器1001、发送控制器1002和发送缓冲器1003;In order to realize the data sending method of the embodiment of the present application, based on the same inventive concept, the embodiment of the present application also provides a data sending device. As shown in FIG. 10, the
所述发送控制寄存器1001,用于存储发送FIFO的控制参数;其中,第一处理模块通过第一总线将发送数据写入所述发送FIFO中;The
所述发送控制器1002,用于基于发送控制寄存器中的发送FIFO的控制参数确定所述发送FIFO的读数据量;基于所述读数据量,通过第二总线从所述发送FIFO中读取数据到发送缓冲器1003中;The transmit controller 1002 is configured to determine the read data volume of the transmit FIFO based on the control parameter of the transmit FIFO in the transmit control register; based on the read data volume, read data from the transmit FIFO through the second bus into the send buffer 1003;
所述发送控制器1002,还用于控制所述发送缓冲器将所述第一处理模块的数据发送给所述第二处理模块。The sending controller 1002 is further configured to control the sending buffer to send the data of the first processing module to the second processing module.
示例性的,在一些实施例中,所述发送FIFO的控制参数包括:所述发送FIFO所在内存空间的基地址和深度,所述发送FIFO的写指针,读指针,满标志和空标志。Exemplarily, in some embodiments, the control parameters of the transmit FIFO include: a base address and depth of a memory space where the transmit FIFO is located, a write pointer, a read pointer, a full flag and an empty flag of the transmit FIFO.
示例性的,在一些实施例中,发送控制器1002,用于所述发送控制寄存器中所述空标志指示所述发送FIFO非空,且所述发送缓冲器非满,基于所述发送FIFO的所述读指针和所述写指针,确定所述发送FIFO的已用空间;基于所述发送FIFO的已用空间,确定所述读数据量。Exemplarily, in some embodiments, the sending controller 1002 is configured to use the empty flag in the sending control register to indicate that the sending FIFO is not empty and the sending buffer is not full, based on the value of the sending FIFO. The read pointer and the write pointer determine the used space of the transmit FIFO; and the read data amount is determined based on the used space of the transmit FIFO.
示例性的,在一些实施例中,发送控制器1002,用于确定所述发送缓冲器的可用空间;从所述发送FIFO的已用空间和所述发送缓冲器的可用空间中确定最小空间;将所述最小空间对应的数据容量作为所述读数据量。Exemplarily, in some embodiments, the sending controller 1002 is configured to determine the available space of the sending buffer; determine the minimum space from the used space of the sending FIFO and the available space of the sending buffer; The data capacity corresponding to the minimum space is used as the read data amount.
示例性的,在一些实施例中,发送控制器1002,用于配置所述发送控制寄存器中所述发送FIFO所在内存空间的基地址和深度。Exemplarily, in some embodiments, the transmit controller 1002 is configured to configure the base address and depth of the memory space where the transmit FIFO is located in the transmit control register.
示例性的,在一些实施例中,发送控制器1002,用于所述基于所述读数据量,通过第二总线从所述发送FIFO中读取数据到发送缓冲器中之后,更新所述发送控制寄存器中所述发送FIFO的所述读指针。Exemplarily, in some embodiments, the transmit controller 1002 is configured to update the transmit buffer after reading data from the transmit FIFO through the second bus to the transmit buffer based on the read data amount. the read pointer of the transmit FIFO in the control register.
示例性的,在一些实施例中,发送控制器1002,用于所述发送控制寄存器中所述满标志指示所述发送FIFO非满,基于所述发送FIFO的所述读指针和所述写指针,确定所述发送FIFO的可用空间;基于所述发送FIFO的可用空间,确定所述第一处理模块写入所述发送FIFO的写数据量;基于所述写数据量,控制所述第一处理模块通过所述第一总线将发送数据写入所述发送FIFO中。Exemplarily, in some embodiments, the transmit controller 1002 is configured to use the full flag in the transmit control register to indicate that the transmit FIFO is not full, based on the read pointer and the write pointer of the transmit FIFO. , determine the available space of the transmit FIFO; based on the available space of the transmit FIFO, determine the amount of write data written into the transmit FIFO by the first processing module; based on the amount of write data, control the first processing The module writes the transmit data into the transmit FIFO through the first bus.
示例性的,在一些实施例中,发送控制器1002,用于所述基于所述写数据量,控制所述第一处理模块通过所述第一总线将发送数据写入所述发送FIFO中之后,更新所述发送控制寄存器中所述发送FIFO的所述写指针。Exemplarily, in some embodiments, the sending controller 1002 is configured to, based on the write data amount, control the first processing module to write the sending data into the sending FIFO through the first bus after the , and update the write pointer of the transmit FIFO in the transmit control register.
示例性的,在一些实施例中,所述第一处理模块为软件模块,所述第二处理模块为硬件模块。这样,硬件模块无需通过总线访问发送FIFO,使得硬件模块不需要更改原有的FIFO接口,即采用通用FIFO接口访问发送FIFO,使得软件模块采用总线接口访问发送FIFO,从而实现跨模块间的缓冲数据交换,有很好的通用性。Exemplarily, in some embodiments, the first processing module is a software module, and the second processing module is a hardware module. In this way, the hardware module does not need to access the sending FIFO through the bus, so that the hardware module does not need to change the original FIFO interface, that is, the general FIFO interface is used to access the sending FIFO, so that the software module uses the bus interface to access the sending FIFO, so as to realize the buffered data between the modules. Swap, has good versatility.
为实现本申请实施例的数据接收方法,基于同一发明构思本申请实施例还提供了一种数据接收装置,如图11所示,数据接收装置110包括:接收控制寄存器1101、接收控制器1102和接收缓冲器1103;In order to realize the data receiving method of the embodiment of the present application, based on the same inventive concept, the embodiment of the present application also provides a data receiving apparatus. As shown in FIG. 11 , the
所述接收缓冲器1103,用于接收第二处理模块的数据;The receiving buffer 1103 is used for receiving data of the second processing module;
所述接收控制寄存器1101,用于存储接收FIFO的控制参数;The receiving
所述接收控制器1102,用于基于接收控制寄存器中的接收FIFO的控制参数确定所述接收FIFO的写数据量;基于所述写数据量,将所述接收缓冲器中的数据通过第二总线写入所述接收FIFO中,以供所述第一处理模块通过第一总线从所述接收FIFO中读取所述第二处理模块的数据。The receiving controller 1102 is configured to determine the write data volume of the receive FIFO based on the control parameter of the receive FIFO in the receive control register; based on the write data volume, send the data in the receive buffer through the second bus The data is written into the receiving FIFO for the first processing module to read the data of the second processing module from the receiving FIFO through the first bus.
示例性的,在一些实施例中,所述接收FIFO的控制参数包括:所述接收FIFO所在内存空间的基地址和深度,所述发送FIFO的写指针,读指针,满标志和空标志。Exemplarily, in some embodiments, the control parameters of the receiving FIFO include: a base address and depth of the memory space where the receiving FIFO is located, a write pointer, a read pointer, a full flag and an empty flag of the sending FIFO.
示例性的,在一些实施例中,接收控制器1102,用于所述接收控制寄存器中所述满标志指示所述接收FIFO非满,且所述接收缓冲器非空,基于所述接收FIFO的所述读指针和所述写指针,确定所述接收FIFO的可用空间;基于所述接收FIFO的可用空间,确定所述写数据量。Exemplarily, in some embodiments, the receive controller 1102 is configured to use the full flag in the receive control register to indicate that the receive FIFO is not full and the receive buffer is not empty, based on the receive FIFO The read pointer and the write pointer determine the available space of the receiving FIFO; and based on the available space of the receiving FIFO, the write data amount is determined.
示例性的,在一些实施例中,接收控制器1102,用于确定所述接收缓冲器的已用空间;从所述接收FIFO的可用空间和所述接收缓冲器的已用空间中确定最小空间;将所述最小空间对应的数据容量作为所述写数据量。Exemplarily, in some embodiments, the receive controller 1102 is configured to determine the used space of the receive buffer; determine the minimum space from the available space of the receive FIFO and the used space of the receive buffer ; Take the data capacity corresponding to the minimum space as the write data amount.
示例性的,在一些实施例中,接收控制器1102,用于配置所述接收控制寄存器中所述接收FIFO所在内存空间的基地址和深度。Exemplarily, in some embodiments, the receiving controller 1102 is configured to configure the base address and depth of the memory space where the receiving FIFO in the receiving control register is located.
示例性的,在一些实施例中,接收控制器1102,用于所述基于所述写数据量,将所述接收缓冲器中的数据通过第二总线写入所述接收FIFO中之后,更新所述接收控制寄存器中所述接收FIFO的所述写指针。Exemplarily, in some embodiments, the receiving controller 1102 is configured to, after the data in the receiving buffer is written into the receiving FIFO through the second bus based on the amount of written data, update the received FIFO. the write pointer of the receive FIFO in the receive control register.
示例性的,在一些实施例中,接收控制器1102,用于所述接收控制寄存器中所述空标志指示所述接收FIFO非空,基于所述接收FIFO的所述读指针和所述写指针,确定所述接收FIFO的已用空间;基于所述接收FIFO的已用空间,确定所述第一处理模块读取所述接收FIFO的读数据量;基于所述读数据量,控制所述第一处理模块通过第一总线从所述接收FIFO读取数据。Exemplarily, in some embodiments, the receiving controller 1102 is configured to use the empty flag in the receiving control register to indicate that the receiving FIFO is not empty, based on the read pointer and the write pointer of the receiving FIFO , determine the used space of the receiving FIFO; based on the used space of the receiving FIFO, determine the read data volume of the receiving FIFO read by the first processing module; based on the read data volume, control the first processing module A processing module reads data from the receive FIFO through the first bus.
示例性的,在一些实施例中,接收控制器1102,用于所述基于所述读数据量,控制所述第一处理模块通过第一总线从所述接收FIFO读取数据之后,更新所述接收控制寄存器中所述接收FIFO的所述读指针。Exemplarily, in some embodiments, the receiving controller 1102 is configured to update the receiving FIFO after controlling the first processing module to read data from the receiving FIFO through the first bus based on the amount of read data. receiving the read pointer of the receive FIFO in the control register.
示例性的,在一些实施例中,所述第一处理模块为软件模块,所述第二处理模块为硬件模块。这样,硬件模块无需通过总线访问接收FIFO,使得硬件模块不需要更改原有的FIFO接口,即采用通用FIFO接口访问接收FIFO,使得软件模块采用总线接口访问接收FIFO,从而实现跨模块间的缓冲数据交换,有很好的通用性。Exemplarily, in some embodiments, the first processing module is a software module, and the second processing module is a hardware module. In this way, the hardware module does not need to access the receiving FIFO through the bus, so that the hardware module does not need to change the original FIFO interface, that is, the general FIFO interface is used to access the receiving FIFO, so that the software module uses the bus interface to access the receiving FIFO, so as to realize cross-module buffer data Swap, has good versatility.
基于上述数据发送和接收装置中各单元的硬件实现,本申请实施例还提供了一种电子设备,如图12所示,该电子设备120包括:处理器1201和配置为存储能够在处理器上运行的计算机程序的存储器1202;Based on the hardware implementation of each unit in the above data sending and receiving apparatus, the embodiment of the present application further provides an electronic device. As shown in FIG. 12 , the
其中,处理器1201配置为运行计算机程序时,执行前述实施例中的数据发送方法步骤,或者执行前述实施例中的数据接收方法步骤。Wherein, the
当然,实际应用时,如图12所示,该电子设备中的各个组件通过总线系统1203耦合在一起。可理解,总线系统1203用于实现这些组件之间的连接通信。总线系统1203除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图中将各种总线都标为总线系统1203。Of course, in practical application, as shown in FIG. 12 , various components in the electronic device are coupled together through a
在实际应用中,上述处理器可以为特定用途集成电路(ASIC,ApplicationSpecific Integrated Circuit)、数字信号处理装置(DSPD,Digital Signal ProcessingDevice)、可编程逻辑装置(PLD,Programmable Logic Device)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、控制器、微控制器、微处理器中的至少一种。可以理解地,对于不同的设备,用于实现上述处理器功能的电子器件还可以为其它,本申请实施例不作具体限定。In practical applications, the above-mentioned processor may be an application specific integrated circuit (ASIC, Application Specific Integrated Circuit), a digital signal processing device (DSPD, Digital Signal Processing Device), a programmable logic device (PLD, Programmable Logic Device), a field programmable gate At least one of an array (Field-Programmable Gate Array, FPGA), a controller, a microcontroller, and a microprocessor. It can be understood that, for different devices, the electronic device used to implement the above processor function may also be other, which is not specifically limited in the embodiment of the present application.
上述存储器可以是易失性存储器(volatile memory),例如随机存取存储器(RAM,Random-Access Memory);或者非易失性存储器(non-volatile memory),例如只读存储器(ROM,Read-Only Memory),快闪存储器(flash memory),硬盘(HDD,Hard Disk Drive)或固态硬盘(SSD,Solid-State Drive);或者上述种类的存储器的组合,并向处理器提供指令和数据。The above-mentioned memory can be a volatile memory (volatile memory), such as a random access memory (RAM, Random-Access Memory); or a non-volatile memory (non-volatile memory), such as a read-only memory (ROM, Read-Only Memory) Memory), flash memory (flash memory), hard disk (HDD, Hard Disk Drive) or solid-state drive (SSD, Solid-State Drive); or a combination of the above types of memory, and provide instructions and data to the processor.
实际应用中,上述数据发送装置和数据接收装置可以是电子设备,也可以是应用于电子设备中的芯片。在本申请中,该数据发送装置和数据接收装置可以通过或软件、或硬件、或软件与硬件相结合的方式,实现多个单元的功能,使该数据发送装置可以执行如上述任一实施例所提供的数据发送方法和数据接收方法,数据发送装置的各技术方案的技术效果可以参考数据发送方法中相应的技术方案的技术效果,数据接收装置的各技术方案的技术效果可以参考数据接收方法中相应的技术方案的技术效果,本申请对此不再一一赘述。In practical applications, the above-mentioned data sending apparatus and data receiving apparatus may be electronic equipment, and may also be chips applied in electronic equipment. In this application, the data sending device and the data receiving device can implement the functions of multiple units through software, or hardware, or a combination of software and hardware, so that the data sending device can execute any of the above-mentioned embodiments. For the provided data sending method and data receiving method, the technical effect of each technical solution of the data sending device can refer to the technical effect of the corresponding technical solution in the data sending method, and the technical effect of each technical solution of the data receiving device can refer to the data receiving method. The technical effects of the corresponding technical solutions in this application will not be repeated in this application.
在示例性实施例中,本申请实施例还提供了一种计算机可读存储介质,例如包括计算机程序的存储器,计算机程序可由电子设备的处理器执行,以完成前述方法的步骤。In an exemplary embodiment, an embodiment of the present application further provides a computer-readable storage medium, such as a memory including a computer program, and the computer program can be executed by a processor of an electronic device to complete the steps of the foregoing method.
本申请实施例还提供了一种计算机程序产品,包括计算机程序指令。Embodiments of the present application also provide a computer program product, including computer program instructions.
可选的,该计算机程序产品可应用于本申请实施例中的电子设备,并且该计算机程序指令使得计算机执行本申请实施例的各个方法中由电子设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program product can be applied to the electronic device in the embodiments of the present application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the electronic device in the various methods of the embodiments of the present application. Repeat.
本申请实施例还提供了一种计算机程序。The embodiments of the present application also provide a computer program.
可选的,该计算机程序可应用于本申请实施例中的电子设备,当该计算机程序在计算机上运行时,使得计算机执行本申请实施例的各个方法中由电子设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program can be applied to the electronic device in the embodiments of the present application. When the computer program runs on the computer, the computer executes the corresponding processes implemented by the electronic device in the various methods of the embodiments of the present application. For the sake of brevity. , and will not be repeated here.
应当理解,在本申请使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。本申请中表述“具有”、“可以具有”、“包括”和“包含”、或者“可以包括”和“可以包含”在本文中可以用于指示存在对应的特征(例如,诸如数值、功能、操作或组件等元素),但不排除附加特征的存在。It should be understood that the terminology used in the present application is for the purpose of describing particular embodiments only, and is not intended to limit the present application. As used in this application and the appended claims, the singular forms "a," "the," and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It will also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items. The expressions "having", "may have", "including" and "including", or "may include" and "may include" in this application may be used herein to indicate the presence of a corresponding feature (eg, such as a value, function, elements such as operations or components), but does not preclude the presence of additional features.
应当理解,尽管在本申请可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开,不必用于描述特定的顺序或先后次序。例如,在不脱离本发明范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited by these terms. These terms are only used to distinguish the same type of information from one another, and are not necessarily used to describe a particular order or sequence. For example, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information, without departing from the scope of the present invention.
本申请实施例所记载的技术方案之间,在不冲突的情况下,可以任意组合。The technical solutions described in the embodiments of the present application may be combined arbitrarily if there is no conflict.
在本申请所提供的几个实施例中,应该理解到,所揭露的方法、装置和设备,可以通过其它的方式实现。以上所描述的实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。In the several embodiments provided in this application, it should be understood that the disclosed method, apparatus and device may be implemented in other manners. The above-described embodiments are only illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined, or may be integrated into Another system, or some features can be ignored, or not implemented. In addition, the coupling, or direct coupling, or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical or other forms. of.
上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The unit described above as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may all be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above integration The unit can be implemented either in the form of hardware or in the form of hardware plus software functional units.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application.
Claims (22)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210130230.4A CN114546907B (en) | 2022-02-11 | 2022-02-11 | Data sending and receiving method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210130230.4A CN114546907B (en) | 2022-02-11 | 2022-02-11 | Data sending and receiving method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114546907A true CN114546907A (en) | 2022-05-27 |
CN114546907B CN114546907B (en) | 2024-05-28 |
Family
ID=81673815
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210130230.4A Active CN114546907B (en) | 2022-02-11 | 2022-02-11 | Data sending and receiving method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114546907B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107153412A (en) * | 2017-06-16 | 2017-09-12 | 北方电子研究院安徽有限公司 | It is a kind of that there is the CAN controller circuit for sending FIFO |
CN113468097A (en) * | 2021-07-01 | 2021-10-01 | 中国科学技术大学先进技术研究院 | Data exchange method based on system on chip |
-
2022
- 2022-02-11 CN CN202210130230.4A patent/CN114546907B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107153412A (en) * | 2017-06-16 | 2017-09-12 | 北方电子研究院安徽有限公司 | It is a kind of that there is the CAN controller circuit for sending FIFO |
CN113468097A (en) * | 2021-07-01 | 2021-10-01 | 中国科学技术大学先进技术研究院 | Data exchange method based on system on chip |
Also Published As
Publication number | Publication date |
---|---|
CN114546907B (en) | 2024-05-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP1573559B1 (en) | Method, system, and program for handling input/output commands | |
US7272676B2 (en) | Data transmission controller that restarts data transmission when reconstruction is completed | |
US7433977B2 (en) | DMAC to handle transfers of unknown lengths | |
US5919254A (en) | Method and apparatus for switching between source-synchronous and common clock data transfer modes in a multiple processing system | |
KR102471219B1 (en) | Data reading method, device and system based on NVMe | |
WO1999036858A1 (en) | Data transferring in source-synchronous and common clock protocols | |
KR101695336B1 (en) | Memory management system offering direct as well as managed access to local storage memory | |
JP6602579B2 (en) | Semiconductor device and system | |
CN113900974B (en) | Storage device, data storage method and related equipment | |
JP4696199B2 (en) | USB host controller with transfer descriptor memory | |
US20030167368A1 (en) | Transmission control circuit, reception control circuit, communications control circuit, and communications control unit | |
JP2009502072A (en) | FlexRay communication module, FlexRay communication control device, and method for transmitting a message between a FlexRay communication connection and a FlexRay subscriber device | |
CN104123173A (en) | Method and device for achieving communication between virtual machines | |
US8756356B2 (en) | Pipe arbitration using an arbitration circuit to select a control circuit among a plurality of control circuits and by updating state information with a data transfer of a predetermined size | |
CN114546907A (en) | Data sending and receiving method, device, equipment and storage medium | |
CN116340217A (en) | Data processing method and related device | |
CN116610601A (en) | Data transmission device, control method and device thereof, and medium | |
KR100633742B1 (en) | Direct memory access control device and method for automatically updating data transfer size from peripheral device | |
US8296481B2 (en) | Device and method for improving transfer efficiency of odd number of data blocks | |
US7577560B2 (en) | Microcomputer logic development device | |
TWI416336B (en) | Nic with sharing buffer and method thereof | |
CN116226021B (en) | Data receiving and transmitting method and device and graphics processor | |
CN110399322B (en) | A data transmission method and ping-pong DMA architecture | |
CN102195783B (en) | Network interface card capable of sharing buffer and buffer sharing method | |
CN119938565A (en) | Data transmission method, device, equipment and medium based on DMA controller |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |