[go: up one dir, main page]

CN114595073A - A pipeline data transmission method and data pipeline device - Google Patents

A pipeline data transmission method and data pipeline device Download PDF

Info

Publication number
CN114595073A
CN114595073A CN202011406138.3A CN202011406138A CN114595073A CN 114595073 A CN114595073 A CN 114595073A CN 202011406138 A CN202011406138 A CN 202011406138A CN 114595073 A CN114595073 A CN 114595073A
Authority
CN
China
Prior art keywords
write
read
sequence
formula
round
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011406138.3A
Other languages
Chinese (zh)
Other versions
CN114595073B (en
Inventor
钱宏毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Realtek Singapore Pte Ltd
Original Assignee
Realtek Singapore Pte Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Realtek Singapore Pte Ltd filed Critical Realtek Singapore Pte Ltd
Priority to CN202011406138.3A priority Critical patent/CN114595073B/en
Priority claimed from CN202011406138.3A external-priority patent/CN114595073B/en
Publication of CN114595073A publication Critical patent/CN114595073A/en
Application granted granted Critical
Publication of CN114595073B publication Critical patent/CN114595073B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0866Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
    • G06F12/0873Mapping of cache memory to specific storage devices or parts thereof
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Image Processing (AREA)

Abstract

本发明提出一种管线式数据传输方法及数据管线装置。数据管线装置包含一前级模组、一后级模组及耦接于前级模组及后级模组之间的一缓冲区。缓冲区包含复数储存单元。管线式数据传输方法包含:执行复数写读回合;在每一写读回合中,前级模组按照一写入顺序依序分别对各储存单元执行一写入动作;及在每一写读回合中,后级模组按照一读取顺序依序分别对各储存单元执行一读取动作;其中,在连续两个写读回合中,在后的写读回合中的写入顺序与在前的写读回合中的读取顺序相同。

Figure 202011406138

The present invention provides a pipeline data transmission method and a data pipeline device. The data pipeline device includes a pre-stage module, a post-stage module, and a buffer area coupled between the pre-stage module and the post-stage module. The buffer contains complex storage units. The pipeline data transmission method includes: performing multiple write and read rounds; in each write and read round, the front-end module sequentially executes a write action to each storage unit according to a write sequence; and in each write and read round Among them, the post-stage module sequentially performs a read operation on each storage unit according to a read sequence; wherein, in two consecutive write and read rounds, the write sequence in the subsequent write and read rounds is the same as that of the previous one. The read order in the write and read rounds is the same.

Figure 202011406138

Description

一种管线式数据传输方法及数据管线装置A pipeline data transmission method and data pipeline device

技术领域technical field

本发明是关于一种数据传输技术,特别是指一种管线式数据传输方法及数据管线装置。The present invention relates to a data transmission technology, in particular to a pipeline data transmission method and a data pipeline device.

背景技术Background technique

为了避免频繁向存储器储存与读取造成功率消耗,两电子元件之间的数据传递,可在两者间串接缓冲区(Buffer)来供数据传送端存放要传递的数据,同时供数据接收端读取存放在缓冲区的数据。然而,两电子元件同时对同一缓冲区进行储存与读取,难免会产生数据遗失的问题。例如,缓冲区的某一区域写入了数据,该区域还没来得及被读取即被写入新的数据。特别是,当两电子元件对于缓冲区的存取顺序不同时,特别容易发生此问题。In order to avoid power consumption caused by frequent storage and reading to the memory, a buffer can be connected in series between the two electronic components for data transmission between the two for the data transmission end to store the data to be transmitted, and for the data reception end Read the data stored in the buffer. However, when the two electronic components store and read the same buffer at the same time, the problem of data loss will inevitably occur. For example, data is written to an area of the buffer, and new data is written before that area can be read. This problem is particularly prone to occur when the access sequence of the two electronic components to the buffer is different.

为了克服此问题,有一种使用两个缓冲区的方法,数据传送端交替对两缓冲区写入数据供数据读取端读取。如此,虽然可以解决数据丢失的问题,但需要两倍的缓冲区成本。In order to overcome this problem, there is a method of using two buffers, and the data transmitting end alternately writes data to the two buffers for the data reading end to read. In this way, although the problem of data loss can be solved, it requires twice the buffer cost.

发明内容SUMMARY OF THE INVENTION

鉴于上述问题,本发明提出一种管线式数据传输方法,应用于一数据管线装置。数据管线装置包含一前级模组、一后级模组及耦接于前级模组及后级模组之间的一缓冲区。缓冲区包含复数储存单元。管线式数据传输方法包含:执行复数写读回合;在每一写读回合中,前级模组按照一写入顺序依序分别对各储存单元执行一写入动作;及在每一写读回合中,后级模组按照一读取顺序依序分别对各储存单元执行一读取动作;其中,在连续两个写读回合中,在后的写读回合中的写入顺序与在前的写读回合中的读取顺序相同。In view of the above problems, the present invention provides a pipeline data transmission method, which is applied to a data pipeline device. The data pipeline device includes a pre-stage module, a post-stage module, and a buffer area coupled between the pre-stage module and the post-stage module. The buffer contains complex storage units. The pipelined data transmission method includes: performing multiple write-read rounds; in each write-read round, the front-end module sequentially executes a write operation to each storage unit according to a write-in sequence; and in each write-read round Among them, the post-stage module sequentially performs a read operation on each storage unit according to a read sequence; wherein, in two consecutive write and read rounds, the write sequence in the subsequent write and read rounds is the same as the previous one. The read order in the write and read rounds is the same.

本发明一实施例另提出一种数据管线装置,包含一前级模组、一后级模组及一缓冲区。缓冲区耦接于前级模组及后级模组之间,并包含复数储存单元。前级模组及后级模组执行复数写读回合。在每一写读回合中,前级模组按照一写入顺序依序分别对各储存单元执行一写入动作,后级模组按照一读取顺序依序分别对各储存单元执行一读取动作。在连续两个写读回合中,在后的写读回合中的写入顺序与在前的写读回合中的读取顺序相同。An embodiment of the present invention further provides a data pipeline device, which includes a pre-stage module, a post-stage module, and a buffer area. The buffer is coupled between the preceding module and the succeeding module, and includes a plurality of storage units. The front-level module and the rear-level module perform multiple write and read rounds. In each write-read round, the previous-level module sequentially performs a write operation on each storage unit according to a write sequence, and the subsequent-level module sequentially performs a read operation on each storage unit according to a read sequence action. In two consecutive write-read rounds, the write order in the latter write-read round is the same as the read order in the previous write-read round.

根据本发明实施例所提出的数据管线装置及管线式数据传输方法,在使用单一缓冲区的情形下,可供前级模组及后级模组各自使用其写入顺序与读取顺序来存取缓冲区,同时可避免未读取的数据被覆写所造成的数据丢失问题。According to the data pipeline device and the pipelined data transmission method proposed in the embodiments of the present invention, in the case of using a single buffer, the previous-level module and the subsequent-level module can each use their write sequence and read sequence to store the data. It can also avoid the problem of data loss caused by overwriting of unread data.

附图说明Description of drawings

下面,将结合附图对本发明的优选实施方式进行进一步详细的说明,其中:Below, the preferred embodiments of the present invention will be described in further detail in conjunction with the accompanying drawings, wherein:

图1为本发明一实施例的数据管线装置的架构示意图;FIG. 1 is a schematic structural diagram of a data pipeline device according to an embodiment of the present invention;

图2为本发明一实施例的管线式数据传输方法的流程图;2 is a flowchart of a pipeline data transmission method according to an embodiment of the present invention;

图3为本发明一实施例的对缓冲区执行写入动作的示意图;3 is a schematic diagram of performing a write operation to a buffer according to an embodiment of the present invention;

图4为本发明一实施例的对缓冲区执行读取动作的示意图;以及FIG. 4 is a schematic diagram of performing a read operation on a buffer according to an embodiment of the present invention; and

图5为本发明一实施例的管线式数据传输方法的细部流程图。FIG. 5 is a detailed flowchart of a pipeline data transmission method according to an embodiment of the present invention.

【符号说明】【Symbol Description】

100:数据管线装置100: Data pipeline device

110:前级模组110: Pre-Module

120:后级模组120: Power Module

130:缓冲区130:buffer

131:储存单元131: Storage unit

S210,S220,S230:步骤S210, S220, S230: Steps

S510,S520,S530,S540,S550,S560:步骤S510, S520, S530, S540, S550, S560: Steps

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments These are some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

在以下的详细描述中,可以参看作为本申请一部分用来说明本申请的特定实施例的各个说明书附图。在附图中,相似的附图标记在不同图式中描述大体上类似的组件。本申请的各个特定实施例在以下进行了足够详细的描述,使得具备本领域相关知识和技术的普通技术人员能够实施本申请的技术方案。应当理解,还可以利用其它实施例或者对本申请的实施例进行结构、逻辑或者电性的改变。In the following detailed description, reference may be made to the accompanying drawings, which are considered a part of this application to illustrate specific embodiments of the application. In the figures, like reference numerals describe substantially similar components in the different figures. Various specific embodiments of the present application are described in sufficient detail below to enable those of ordinary skill with relevant knowledge and technology in the art to implement the technical solutions of the present application. It should be understood that other embodiments may also be utilized or structural, logical or electrical changes may be made to the embodiments of the present application.

参照图1,为本发明一实施例的数据管线装置的架构示意图。数据管线装置100包含一前级模组110、一后级模组120及耦接于前级模组110及后级模组120之间的一缓冲区130。前级模组110与后级模组120分别为两个独立的电子器件。在一些实施例中,前级模组110为影像感测器,后级模组120为影像编码器,所传输的数据为影像数据。为便于说明,于后将以此应用场景为例进行说明,然而本发明并非以此应用场景为限。在一些实施例中,后级模组120为符合高效率视频编码(High Efficiency Video Coding,HEVC)架构的影像编码器。Referring to FIG. 1 , it is a schematic structural diagram of a data pipeline apparatus according to an embodiment of the present invention. The data pipeline device 100 includes a pre-stage module 110 , a post-stage module 120 , and a buffer area 130 coupled between the pre-stage module 110 and the post-stage module 120 . The pre-stage module 110 and the post-stage module 120 are respectively two independent electronic devices. In some embodiments, the pre-stage module 110 is an image sensor, the post-stage module 120 is an image encoder, and the transmitted data is image data. For convenience of description, the following application scenario will be used as an example for description, but the present invention is not limited to this application scenario. In some embodiments, the post-stage module 120 is an image encoder conforming to a High Efficiency Video Coding (HEVC) architecture.

参照图2,为本发明一实施例的管线式数据传输方法的流程图。所述管线式数据传输方法应用于前述数据管线装置100,使得前级模组110可将数据传输给后级模组120。Referring to FIG. 2 , it is a flowchart of a pipeline data transmission method according to an embodiment of the present invention. The pipeline data transmission method is applied to the aforementioned data pipeline device 100 , so that the front-end module 110 can transmit data to the latter-stage module 120 .

在步骤S210中,执行复数个写读回合。亦即,在完成一个写读回合之后,继续执行下一个写读回合。换言之,在完成一个写读回合之前,不会进入下一个写读回合。一个写读回合是指,前级模组110将一笔数据完整写入至缓冲区130,且后级模组120将该笔数据完整从缓冲区130读取出来。所述一笔数据,以影像数据为例,可例如是一张影像、一张影像的某一条带(Slice)等。在一些实施例中,在前级模组110写入数据的过程中(该数据尚未完整写入),后级模组120即开始读取该数据。在一些实施例中,在一个写/读回合内,读操作在写操作完成之后开始。在两个连续的写/读回合之间,下一个回合写操作可以在上一个回合读操作完成之前开始。In step S210, a plurality of write and read rounds are performed. That is, after completing one write-read round, continue to execute the next write-read round. In other words, until one write-read round is completed, the next write-read round is not entered. One write-read round means that the front-end module 110 completely writes a piece of data into the buffer 130 , and the latter-stage module 120 completely reads the data from the buffer 130 . The piece of data, taking image data as an example, may be, for example, an image, a certain slice (Slice) of an image, or the like. In some embodiments, during the process of writing data by the previous-stage module 110 (the data has not been completely written), the subsequent-stage module 120 starts to read the data. In some embodiments, within a write/read round, a read operation begins after a write operation completes. Between two consecutive write/read rounds, the next round of write operations can begin before the previous round of read operations has completed.

参照图3,为本发明一实施例的对缓冲区130执行写入动作的示意图。缓冲区130包含复数储存单元131。储存单元131是执行一次写入动作或读取动作的最小单位。储存单元131包含一个或多个储存单元(图未示)。所述储存单元为缓冲区130中的最小记忆单位。例如,一个储存单元的储存量为一个位元组,而一个储存单元131的储存量为四个位元组(即一个储存单元131具有四个储存单元)。为了方便说明,在此仅以缓冲区130具有20个储存单元131为例,但本发明不以此数量为限,应可包含更少或更多的储存单元131。在此,储存单元131是呈四行五列的二维排列方式。在一些实施例中,一列储存单元131的个数(在此为五个)与影像数据的跨距(Stride)呈正相关,具体来说,一列储存单元131能储存影像的复数列像素数据。在一些实施例中,一行储存单元131的个数(于此为四个)与影像数据的高呈正相关,亦即一行储存单元131能储存影像的复数行像素数据。在一些实施例中,一个储存单元131可以储存一个编码树单元(Coding Tree Unit,CTU)。Referring to FIG. 3 , it is a schematic diagram of performing a write operation to the buffer 130 according to an embodiment of the present invention. The buffer 130 includes a plurality of storage units 131 . The storage unit 131 is the smallest unit for performing one write operation or read operation. The storage unit 131 includes one or more storage units (not shown). The storage unit is the smallest memory unit in the buffer 130 . For example, the storage capacity of one storage unit is one byte, and the storage capacity of one storage unit 131 is four bytes (ie, one storage unit 131 has four storage units). For the convenience of description, only the buffer 130 has 20 storage units 131 as an example here, but the present invention is not limited to this number, and may include fewer or more storage units 131 . Here, the storage units 131 are two-dimensionally arranged in four rows and five columns. In some embodiments, the number of the storage units 131 in a row (here, five) is positively correlated with the stride of the image data. Specifically, the storage units 131 in a row can store a plurality of rows of pixel data of an image. In some embodiments, the number of one row of storage units 131 (here, four) is positively correlated with the height of the image data, that is, one row of storage units 131 can store multiple rows of pixel data of the image. In some embodiments, one storage unit 131 may store one Coding Tree Unit (CTU).

在步骤S220中,在每一个写读回合中,前级模组110会按照一写入顺序依序分别对各储存单元131执行一写入动作。如图3所示,储存单元131中所标注的数字为对于各储存单元131执行写入动作的序数。数字「1」表示第一个执行写入动作的储存单元131,数字「2」表示第二个执行写入动作的储存单元131,以此类推。在如图3所示的实施例中,是依次从左至右写入第一列的储存单元131后,再从左至右写入第二列的储存单元131,接着从左至右写入第三列的储存单元131,最后从左至右写入第四列的储存单元131,一般可称此种顺序为光栅顺序(Raster order)。In step S220 , in each write and read round, the preceding module 110 performs a write operation to each storage unit 131 in sequence according to a write sequence. As shown in FIG. 3 , the numbers marked in the storage units 131 are ordinal numbers of the write operations performed for each storage unit 131 . The number "1" represents the first storage unit 131 that performs the writing operation, the number "2" represents the second storage unit 131 that performs the writing operation, and so on. In the embodiment shown in FIG. 3 , after the storage units 131 in the first row are sequentially written from left to right, then the storage units 131 in the second row are written from left to right, and then written from left to right. The storage unit 131 in the third row is finally written to the storage unit 131 in the fourth row from left to right, and this order is generally referred to as a raster order.

在步骤S230中,在每一个写读回合中,后级模组120会按照一读取顺序依序分别对各储存单元131执行一读取动作。参照图4,为本发明一实施例的对缓冲区130执行读取动作的示意图。储存单元131中所标注的数字为对于各储存单元131执行读取动作的序数。数字「1」表示第一个执行读取动作的储存单元131,数字「2」表示第二个执行读取动作的储存单元131,以此类推。在如图4所示之例中,是依次从上至下读取左起第一行的储存单元131后,再从上至下读取左起第二行的储存单元131,接着从上至下读取左起第三行的储存单元131,续而从上至下读取左起第四行的储存单元131,最后从上至下读取左起第五行的储存单元131,一般可称此种顺序为块顺序(Tile order)。In step S230 , in each write and read round, the subsequent module 120 performs a read operation for each storage unit 131 in sequence according to a read sequence. Referring to FIG. 4 , it is a schematic diagram of performing a read operation on the buffer 130 according to an embodiment of the present invention. The numbers marked in the storage units 131 are the ordinal numbers of the read operations performed for each storage unit 131 . The number "1" represents the first storage unit 131 that performs the reading operation, the number "2" represents the second storage unit 131 that performs the reading operation, and so on. In the example shown in FIG. 4 , the storage cells 131 in the first row from the left are read sequentially from top to bottom, then the storage cells 131 in the second row from the left are read from top to bottom, and then the storage cells 131 in the second row from the left are read from top to bottom. The storage unit 131 in the third row from the left is read from the bottom, then the storage unit 131 in the fourth row from the left is read from the top to the bottom, and finally the storage unit 131 in the fifth row from the left is read from the top to the bottom. This order is the Tile order.

为了方便说明,下述实施例将储存单元131的位址定义为如图3所示的序数。也就是说,第一列第一行的储存单元131的位址为「1」,第一列第二行的储存单元131的位址为「2」,以此类推。前述写入顺序是指按照执行写入动作的次序排列对应各个储存单元131的位址而形成的序列。前述读取顺序是指按照执行读取动作的次序排列对应各个储存单元131的位址而形成的序列。For the convenience of description, the following embodiments define the address of the storage unit 131 as an ordinal number as shown in FIG. 3 . That is to say, the address of the storage unit 131 in the first column and the first row is "1", the address of the storage unit 131 in the first column and the second row is "2", and so on. The aforementioned writing sequence refers to a sequence formed by arranging the addresses corresponding to each storage unit 131 in the order in which the writing operations are performed. The aforementioned reading sequence refers to a sequence formed by arranging the addresses corresponding to the respective storage units 131 according to the sequence in which the reading operations are performed.

参照表1,是显示本发明一实施例的复数写读回合的写入顺序和读取顺序。可以看到,在连续两个写读回合中,在后的写读回合中的写入顺序与在前的写读回合中的读取顺序相同。例如,第二写读回合的写入顺序与第一写读回合的读取顺序相同,第三写读回合的写入顺序与第二写读回合的读取顺序相同。如此一来,在连续两个写读回合中,若在后的写读回合中的写入顺序的执行序数小于在前的写读回合中的读取顺序的执行序数,就不会让还没有读取的储存单元131被写入新的数据而造成数据遗失。例如,当读取顺序的执行序数为「5」时,写入顺序的执行序数可为「1」、「2」、「3」、「4」,但不可为「5」或其后的序数。所述执行序数是指当前要执行写入动作的储存单元131的位址其位于写入顺序中的序数。例如,在第二写读回合中的写入顺序中,若当前是要对位址为「16」的储存单元131执行写入动作,则执行序数为「4」。Referring to Table 1, the writing sequence and the reading sequence of the multiple write-read rounds according to an embodiment of the present invention are shown. It can be seen that in two consecutive write and read rounds, the write order in the latter write and read rounds is the same as the read order in the previous write and read rounds. For example, the write order of the second write-read round is the same as the read order of the first write-read round, and the write order of the third write-read round is the same as the read order of the second write-read round. In this way, in two consecutive write-read rounds, if the execution ordinal number of the write sequence in the subsequent write-read round is smaller than the execution ordinal number of the read sequence in the previous write-read round, it will not make the The read storage unit 131 is written with new data, resulting in data loss. For example, when the execution ordinal number of the read order is "5", the execution ordinal number of the write order can be "1", "2", "3", "4", but not "5" or the following ordinal number . The execution ordinal number refers to the ordinal number of the address of the storage unit 131 to which the writing operation is to be performed currently in the writing sequence. For example, in the write sequence in the second write-read round, if the current write operation is to be performed on the storage unit 131 whose address is "16", the execution sequence number is "4".

表1Table 1

Figure BDA0002814275090000061
Figure BDA0002814275090000061

参照表1,在同一个写读回合中的写入顺序和读取顺序不同。因此,可以让前级模组110与后级模组120分别按照其需求的方式来写入与读取。例如,作为影像感测器的前级模组110是分别逐列将影像数据写入缓冲区130,而作为影像编码器的后级模组120是需要逐块从缓冲区130读取出影像数据以进行编码。Referring to Table 1, the writing order and the reading order in the same write-read round are different. Therefore, the pre-stage module 110 and the post-stage module 120 can be respectively written and read according to their requirements. For example, the front-end module 110 as an image sensor writes image data into the buffer 130 column by column, while the post-module 120 as an image encoder needs to read the image data from the buffer 130 block by block. to encode.

参照表1,在同一个写读回合中的写入顺序和读取顺序之间具有一映射关系,并且各写读回合的映射关系为相同。也就是说,在同一写读回合中,写入顺序与读取顺序的同一序数的两位址之间具有一映射关系;在每一写读回合中,写入顺序中的位址映射到读取顺序中的位址是相同的。例如,在第一写读回合中,在写入顺序中序数为「2」的位址为「2」,在读取顺序中序数同样为「2」的位址为「6」,而在其他写读回合中,写入顺序中的位址「2」均映射至读取顺序中的位址「6」(例如第二写读回合中的序数「5」)。表2所示为本发明一实施例的写入顺序中的位址与读取顺序中的位址间的映射关系。Referring to Table 1, there is a mapping relationship between the writing sequence and the reading sequence in the same write-read round, and the mapping relationship of each write-read round is the same. That is to say, in the same write-read round, there is a mapping relationship between the two addresses of the same ordinal number in the write sequence and the read sequence; in each write-read round, the address in the write sequence is mapped to the read sequence The addresses in the fetch order are the same. For example, in the first write and read round, the address with the ordinal "2" in the write order is "2", the address with the same ordinal "2" in the read order is "6", and in the other In the write and read rounds, the address "2" in the write order is mapped to the address "6" in the read order (for example, the ordinal number "5" in the second write and read round). Table 2 shows the mapping relationship between addresses in the writing sequence and addresses in the reading sequence according to an embodiment of the present invention.

表2Table 2

Figure BDA0002814275090000071
Figure BDA0002814275090000071

参照图5,为本发明一实施例的管线式数据传输方法的细部流程图。首先,于步骤S510中,设定参数的初始值。所述参数为后述计算式所用到的参数,将于后说明。Referring to FIG. 5 , it is a detailed flowchart of a pipeline data transmission method according to an embodiment of the present invention. First, in step S510, the initial value of the parameter is set. The parameters are parameters used in the following calculation formula, which will be described later.

在步骤S520中,前级模组110对当前位址的储存单元131执行写入动作;后级模组120对当前位址的储存单元131执行动作。对前级模组110而言,当前位址为写入顺序中对应当前执行序数的位址;对后级模组120而言,当前位址为读取顺序中对应当前执行序数的位址。前级模组110的当前执行序数与后级模组120的当前执行序数可以是不同的。In step S520, the previous-level module 110 performs a write operation on the storage unit 131 at the current address; the subsequent-level module 120 performs an operation on the storage unit 131 at the current address. For the preceding module 110, the current address is the address corresponding to the current execution ordinal in the writing sequence; for the latter module 120, the current address is the address corresponding to the current execution ordinal in the reading sequence. The current execution ordinal number of the preceding-stage module 110 may be different from the current execution ordinal number of the subsequent-stage module 120 .

在完成步骤S520之后,进入步骤S530,取得下一个执行序数的位址,以供作为下一次执行写入或读取动作的当前位址,计算式如式(1)所示。Add(n)为当前序数的写入位址或读取位址,Add(n+1)为下一个序数的写入位址或读取位址。n为当前序数。p为当前位址与下一个位址的位移量。若经式(1)取得的Add(n+1)大于z,则依据式(2)更新Add(n+1)。z为储存单元131的数量。在此例中,z为20。n、p、z为正整数。在此补充说明前述步骤S510中,所设定的参数的初始值:n为1,Add(1)为1,前级模组110的p初始值为1,后级模组120的p初始值为5。After step S520 is completed, step S530 is entered, and the address of the next execution ordinal number is obtained as the current address of the next write or read operation. The calculation formula is shown in formula (1). Add(n) is the write address or read address of the current ordinal number, and Add(n+1) is the write address or read address of the next ordinal number. n is the current ordinal number. p is the displacement between the current address and the next address. If Add(n+1) obtained by Equation (1) is greater than z, then Add(n+1) is updated according to Equation (2). z is the number of storage units 131 . In this example, z is 20. n, p, and z are positive integers. In this supplementary description, in the aforementioned step S510, the initial values of the parameters set: n is 1, Add(1) is 1, the initial value of p of the previous module 110 is 1, and the initial value of p of the rear module 120 is 1. is 5.

Add(n+1)=Add(n)+p 式(1)Add(n+1)=Add(n)+p Formula (1)

Add(n+1)=Add(n+1)-z+1 式(2)Add(n+1)=Add(n+1)-z+1 Equation (2)

在步骤S540中,判断影像数据是否写入或读取完成。若是,则进入步骤S550;若否,则返回步骤S520,继续执行下一次写入或读取动作。In step S540, it is determined whether the writing or reading of the image data is completed. If yes, go to step S550; if no, go back to step S520 and continue to execute the next write or read action.

在步骤S550中,判断是否执行下一个写读回合(亦即判断本次写读回合的写入顺序或读取顺序是否完成)。若是,则进入步骤S560,以更新参数数值,计算式如式(3)所示;若否,则结束流程。式(3)为p与s的乘积除以z之后取其小于或等于的最大整数(或称[下取整」),再加上p与s的乘积除与z的余数后的结果,作为下一读写回合的p值。s为正整数。在此例中,s与影像数据的跨距呈正相关,具体来说,s为一列储存单元131的数量(于此为5),但本发明实施例不已此为限,s亦可设定为其他数值。各个写读回合中分别对应于写入顺序与读取顺序的p值详如表1所示。In step S550, it is determined whether to execute the next write-read round (ie, it is determined whether the write sequence or the read sequence of the current write-read round is completed). If yes, go to step S560 to update the parameter value, and the calculation formula is as shown in formula (3); if not, end the process. Formula (3) is the result of dividing the product of p and s by z and then taking the largest integer less than or equal to (or called "round down"), plus the result of dividing the product of p and s and the remainder of z, as p-value for the next read and write round. s is a positive integer. In this example, s is positively correlated with the span of image data. Specifically, s is the number of storage units 131 in a row (here, 5), but the embodiment of the present invention is not limited to this, and s can also be set as other values. The p-values corresponding to the write order and the read order in each write and read round are shown in Table 1.

Figure BDA0002814275090000091
Figure BDA0002814275090000091

在另一实施例中,不使用式(3),而是透过式(3-1)至式(3-3)来更新参数数值,可免除乘法与除法计算,可提升计算效能或降低硬体成本。在执行式(3-1)之前,执行p次式(3-2)来取得q值。在执行p次式(3-2)的过程中,检查每次执行式(3-2)后的结果,若计算得的q值大于z,则依据式(3-3)更新q值,再接续下一次的式(3-2)计算。最后,利用计算得的最终q值作为新的p值(即式(3-1)),并将q值重置为0。在此补充说明前述步骤S510中,所设定的参数的初始值还包括:q的初始值为0。In another embodiment, instead of using Equation (3), the parameter values are updated through Equation (3-1) to Equation (3-3), which can eliminate the need for multiplication and division calculations, which can improve computing performance or reduce hardware body cost. Before executing the formula (3-1), execute the p-order formula (3-2) to obtain the q value. In the process of executing the p-order formula (3-2), check the results after each execution of the formula (3-2), if the calculated q value is greater than z, update the q value according to the formula (3-3), and then Continue the calculation of the next formula (3-2). Finally, use the calculated final q value as the new p value (ie, equation (3-1)), and reset the q value to 0. In this supplementary description, in the aforementioned step S510, the initial value of the parameter set further includes: the initial value of q is 0.

p=q 式(3-1)p=q Formula (3-1)

q=q+s 式(3-2)q=q+s Formula (3-2)

q=q-z+1 式(3-3)q=q-z+1 Formula (3-3)

综上所述,根据本发明实施例所提出的数据管线装置100及管线式数据传输方法,在使用单一缓冲区130的情形下,可供前级模组110及后级模组120各自使用其写入顺序与读取顺序来存取缓冲区130,同时可避免未读取的数据被覆写所造成的数据丢失问题。To sum up, according to the data pipeline device 100 and the pipeline data transmission method proposed in the embodiments of the present invention, in the case of using a single buffer 130 , the front-end module 110 and the latter-stage module 120 can each use its buffer 130 . The buffer 130 is accessed in the order of writing and reading, and at the same time, the problem of data loss caused by overwriting of unread data can be avoided.

上述实施例仅供说明本发明之用,而并非是对本发明的限制,有关技术领域的普通技术人员,在不脱离本发明范围的情况下,还可以做出各种变化和变型,因此,所有等同的技术方案也应属于本发明公开的范畴。The above-mentioned embodiments are only for the purpose of illustrating the present invention, rather than limiting the present invention. Those of ordinary skill in the relevant technical field can also make various changes and modifications without departing from the scope of the present invention. Therefore, all Equivalent technical solutions should also belong to the scope of the disclosure of the present invention.

Claims (16)

1.一种管线式数据传输方法,应用于一数据管线装置,该数据管线装置包含一前级模组、一后级模组及耦接于该前级模组及该后级模组之间的一缓冲区,该缓冲区包含复数储存单元,该管线式数据传输方法包含:1. A pipeline data transmission method, applied to a data pipeline device, the data pipeline device comprises a front-stage module, a rear-stage module and is coupled between the front-stage module and the rear-stage module A buffer of the , the buffer includes a plurality of storage units, and the pipelined data transmission method includes: 执行复数写读回合;Execute multiple write and read rounds; 在每一该写读回合中,该前级模组按照一写入顺序依序分别对各该储存单元执行一写入动作;及In each of the write-read rounds, the front-end module sequentially executes a write operation to each of the storage units in sequence according to a write sequence; and 在每一该写读回合中,该后级模组按照一读取顺序依序分别对各该储存单元执行一读取动作;In each of the write-read rounds, the latter-stage module sequentially performs a read operation on each of the storage units in sequence according to a read sequence; 其中,在连续两个该些写读回合中,在后的该写读回合中的该写入顺序与在前的该写读回合中的该读取顺序相同。Wherein, in two consecutive writing and reading rounds, the writing sequence in the subsequent writing and reading round is the same as the reading order in the preceding writing and reading round. 2.如权利要求1所述的管线式数据传输方法,其中在同一个该写读回合中的该写入顺序和该读取顺序不同。2 . The pipelined data transmission method of claim 1 , wherein the write order and the read order in the same write-read round are different. 3 . 3.如权利要求2所述的管线式数据传输方法,其中在同一个该写读回合中的该写入顺序和该读取顺序之间具有一映射关系,各该写读回合的该映射关系为相同。3. The pipeline data transmission method of claim 2, wherein there is a mapping relationship between the writing sequence and the reading sequence in the same write-read round, and the mapping relationship of each write-read round for the same. 4.如权利要求1所述的管线式数据传输方法,其中在连续两个该写读回合中,在后的该写读回合中的该写入顺序的执行序数小于在前的该写读回合中的该读取顺序的执行序数。4. The pipeline data transmission method of claim 1, wherein in two consecutive write-read rounds, the execution sequence number of the write-in sequence in the later write-read round is smaller than the previous write-read round The execution ordinal of this read order in . 5.如权利要求1所述的管线式数据传输方法,其中该写入顺序与该读取顺序的至少其一为按照执行相关动作的次序排列对应各该储存单元的一位址而形成的序列,其表示为式(1),若经式(1)取得的Add(n+1)大于z,则依据式(2)更新Add(n+1),其中Add(n)为当前序数的写入位址,Add(n+1)为下一个序数的写入位址,z为该些储存单元的数量,n为当前序数,n、p、s、z为正整数;5. The pipeline data transmission method as claimed in claim 1, wherein at least one of the write sequence and the read sequence is a sequence formed by arranging an address corresponding to each of the storage units according to the sequence in which the related actions are performed , which is expressed as formula (1), if Add(n+1) obtained by formula (1) is greater than z, then update Add(n+1) according to formula (2), where Add(n) is the writing of the current ordinal number Input address, Add(n+1) is the write address of the next ordinal number, z is the number of these storage units, n is the current ordinal number, and n, p, s, and z are positive integers; Add(n+1)=Add(n)+p 式(1)Add(n+1)=Add(n)+p Formula (1) Add(n+1)=Add(n+1)-z+1 式(2)。Add(n+1)=Add(n+1)-z+1 Formula (2). 6.如权利要求1所述的管线式数据传输方法,其中该写读回合完成后,依据式(3)以更新p值;6. The pipeline data transmission method according to claim 1, wherein after the write and read rounds are completed, the p value is updated according to formula (3);
Figure FDA0002814275080000021
Figure FDA0002814275080000021
7.如权利要求5所述的管线式数据传输方法,其中当该写读回合完成后,依据式(3-1)以更新p值;7. The pipeline data transmission method as claimed in claim 5, wherein when the write and read rounds are completed, the p value is updated according to formula (3-1); p=q 式(3-1)p=q Formula (3-1) q=q+s 式(3-2)q=q+s Formula (3-2) q=q-z+1 式(3-3)q=q-z+1 Formula (3-3) 其中,在执行式(3-1)之前,执行p次式(3-2)来取得q值,其中每次执行式(3-2)后的q值若大于z,则依据式(3-3)更新q值,q为正整数。Among them, before executing the formula (3-1), execute the p-order formula (3-2) to obtain the q value, and if the q value after each execution of the formula (3-2) is greater than z, then according to the formula (3- 3) Update the q value, where q is a positive integer. 8.如权利要求5至7所述的管线式数据传输方法,其中每一该写读回合是写入一影像数据至该缓冲区及从该缓冲区读取该影像数据,其中s与该影像数据的跨距呈正相关。8. The pipelined data transmission method of claims 5-7, wherein each of the write and read rounds writes an image data to the buffer and reads the image data from the buffer, wherein s and the image The span of the data is positively correlated. 9.一种数据管线装置,包含:9. A data pipeline device, comprising: 一前级模组;A front-end module; 一后级模组;以及a post module; and 一缓冲区,耦接于该前级模组及该后级模组之间,并包含复数储存单元;a buffer, coupled between the front-end module and the back-end module, and including a plurality of storage units; 其中,该前级模组及该后级模组执行复数写读回合,在每一该写读回合中,该前级模组按照一写入顺序依序分别对各该储存单元执行一写入动作,该后级模组按照一读取顺序依序分别对各该储存单元执行一读取动作;Wherein, the previous-level module and the subsequent-level module perform multiple write-read rounds, and in each write-read round, the previous-level module sequentially executes a write to each of the storage units according to a write sequence an operation, the post-stage module sequentially performs a reading operation on each of the storage units in sequence according to a reading sequence; 其中,在连续两个该些写读回合中,在后的该写读回合中的该写入顺序与在前的该写读回合中的该读取顺序相同。Wherein, in two consecutive writing and reading rounds, the writing sequence in the subsequent writing and reading round is the same as the reading order in the preceding writing and reading round. 10.如权利要求9所述的数据管线装置,其中在同一个该写读回合中的该写入顺序和该读取顺序不同。10. The data pipeline apparatus of claim 9, wherein the write order and the read order in the same write-read round are different. 11.如权利要求10所述的数据管线装置,其中在同一个该写读回合中的该写入顺序和该读取顺序之间具有一映射关系,各该写读回合的该映射关系为相同。11. The data pipeline device of claim 10, wherein there is a mapping relationship between the writing sequence and the reading sequence in the same write-read round, and the mapping relationship of each write-read round is the same . 12.如权利要求9所述的数据管线装置,其中在连续两个该写读回合中,在后的该写读回合中的该写入顺序的执行序数小于在前的该写读回合中的该读取顺序的执行序数。12 . The data pipeline device of claim 9 , wherein in two consecutive write-read rounds, the execution ordinal number of the write sequence in the later write-read round is smaller than that in the previous write-read round. 13 . The execution ordinal of this read order. 13.如权利要求9所述的数据管线装置,其中该写入顺序与该读取顺序的至少其一为按照执行相关动作的次序排列对应各该储存单元的一位址而形成的序列,其表示为式(1),若经式(1)取得的Add(n+1)大于z,则依据式(2)更新Add(n+1),其中Add(n)为当前序数的写入位址,Add(n+1)为下一个序数的写入位址,z为该些储存单元的数量,n为当前序数,n、p、s、z为正整数;13. The data pipeline device of claim 9, wherein at least one of the write sequence and the read sequence is a sequence formed by arranging an address corresponding to each of the storage units according to the sequence in which the related actions are performed, wherein Expressed as formula (1), if Add(n+1) obtained by formula (1) is greater than z, then update Add(n+1) according to formula (2), where Add(n) is the write bit of the current ordinal number address, Add(n+1) is the write address of the next ordinal number, z is the number of these storage units, n is the current ordinal number, and n, p, s, and z are positive integers; Add(n+1)=Add(n)+p 式(1)Add(n+1)=Add(n)+p Formula (1) Add(n+1)=Add(n+1)-z+1 式(2)。Add(n+1)=Add(n+1)-z+1 Formula (2). 14.如权利要求13所述的数据管线装置,其中该写读回合完成后,依据式(3)以更新p值;14. The data pipeline device of claim 13, wherein after the write and read rounds are completed, the p value is updated according to equation (3);
Figure FDA0002814275080000031
Figure FDA0002814275080000031
15.如权利要求13所述的数据管线装置,其中当该写读回合完成后,依据式(3-1)以更新p值;15. The data pipeline device of claim 13, wherein when the write and read rounds are completed, the p value is updated according to equation (3-1); p=q 式(3-1)p=q Formula (3-1) q=q+s 式(3-2)q=q+s Formula (3-2) q=q-z+1 式(3-3)q=q-z+1 Formula (3-3) 其中,在执行式(3-1)之前,执行p次式(3-2)来取得q值,其中每次执行式(3-2)后的q值若大于z,则依据式(3-3)更新q值,q为正整数。Among them, before executing the formula (3-1), execute the p-order formula (3-2) to obtain the q value, and if the q value after each execution of the formula (3-2) is greater than z, then according to the formula (3- 3) Update the value of q, where q is a positive integer. 16.如权利要求13至15中任一项所述的数据管线装置,其中s与数据的跨距呈正相关。16. A data pipeline arrangement as claimed in any one of claims 13 to 15, wherein s is positively related to the stride of the data.
CN202011406138.3A 2020-12-03 A pipeline data transmission method and a data pipeline device Active CN114595073B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011406138.3A CN114595073B (en) 2020-12-03 A pipeline data transmission method and a data pipeline device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011406138.3A CN114595073B (en) 2020-12-03 A pipeline data transmission method and a data pipeline device

Publications (2)

Publication Number Publication Date
CN114595073A true CN114595073A (en) 2022-06-07
CN114595073B CN114595073B (en) 2025-04-15

Family

ID=

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5802586A (en) * 1995-02-27 1998-09-01 Motorola, Inc. Cache memory having a read-modify-write operation and simultaneous burst read and write operations and a method therefor
US6038619A (en) * 1997-05-29 2000-03-14 International Business Machines Corporation Disk drive initiated data transfers responsive to sequential or near sequential read or write requests
CN101359460A (en) * 2008-09-02 2009-02-04 北京中星微电子有限公司 Control method for rotating display of image and apparatus
CN101901193A (en) * 2009-05-27 2010-12-01 北京启明星辰信息技术股份有限公司 Data buffer method and service end
US8922573B1 (en) * 2009-07-14 2014-12-30 Imagination Technologies Limited Video non-buffered line memory
US20160063680A1 (en) * 2013-04-24 2016-03-03 St-Ericsson Sa Image Raster Rotation
TW201614509A (en) * 2014-10-13 2016-04-16 Realtek Semiconductor Corp Processor and method for accessing memory
US20190103146A1 (en) * 2017-09-29 2019-04-04 Seagate Technology Llc Cache access time mitigation
CN109845282A (en) * 2019-01-04 2019-06-04 京东方科技集团股份有限公司 Image processing method and transmitting device, image display method and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5802586A (en) * 1995-02-27 1998-09-01 Motorola, Inc. Cache memory having a read-modify-write operation and simultaneous burst read and write operations and a method therefor
US6038619A (en) * 1997-05-29 2000-03-14 International Business Machines Corporation Disk drive initiated data transfers responsive to sequential or near sequential read or write requests
CN101359460A (en) * 2008-09-02 2009-02-04 北京中星微电子有限公司 Control method for rotating display of image and apparatus
CN101901193A (en) * 2009-05-27 2010-12-01 北京启明星辰信息技术股份有限公司 Data buffer method and service end
US8922573B1 (en) * 2009-07-14 2014-12-30 Imagination Technologies Limited Video non-buffered line memory
US20160063680A1 (en) * 2013-04-24 2016-03-03 St-Ericsson Sa Image Raster Rotation
TW201614509A (en) * 2014-10-13 2016-04-16 Realtek Semiconductor Corp Processor and method for accessing memory
US20190103146A1 (en) * 2017-09-29 2019-04-04 Seagate Technology Llc Cache access time mitigation
CN109845282A (en) * 2019-01-04 2019-06-04 京东方科技集团股份有限公司 Image processing method and transmitting device, image display method and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SAWAN SINGH: "Regional Out-of-Order Writes in Total Store Order", PACT \'20: PROCEEDINGS OF THE ACM INTERNATIONAL CONFERENCE ON PARALLEL ARCHITECTURES AND COMPILATION TECHNIQUES, 30 September 2020 (2020-09-30), pages 205, XP058482342, DOI: 10.1145/3410463.3414645 *
孙志卓;张全新;李元章;谭毓安;刘靖宇;马忠梅;: "连续数据存储中面向RAID5的写操作优化设计", 计算机研究与发展, no. 08, 15 August 2013 (2013-08-15), pages 34 - 42 *

Similar Documents

Publication Publication Date Title
CN108681984B (en) Acceleration circuit of 3*3 convolution algorithm
CN106021182B (en) A kind of row transposition architecture design method based on Two-dimensional FFT processor
CN102208005B (en) A 2-D Convolver
WO2022037257A1 (en) Convolution calculation engine, artificial intelligence chip, and data processing method
CN101572552B (en) High-speed lossless data compression system based on content addressable memory
CN116010299B (en) A data processing method, device, equipment and readable storage medium
CN109858622B (en) Data handling circuit and method for deep learning neural network
CN103914404A (en) Configuration information cache device in coarseness reconfigurable system and compression method
CN116227599A (en) An optimization method, device, electronic equipment and storage medium for a reasoning model
WO2024087559A1 (en) Memory access method and system, and apparatus and electronic device
CN104952088A (en) Method for compressing and decompressing display data
CN101212680B (en) Memory access method and system for image data
CN116107959A (en) Caching method, image transmission method, electronic device and storage medium
CN114443513B (en) Video data reading and writing method and related device
CN105550979A (en) High-data-throughput texture cache hierarchy structure
CN113392963B (en) FPGA-based CNN hardware acceleration system design method
CN110515872B (en) Direct memory access method, device, special computing chip and heterogeneous computing system
CN114595073A (en) A pipeline data transmission method and data pipeline device
CN110490312B (en) Pooling calculation method and circuit
TWI765446B (en) Pipelining data transmission method and data pipeline device
CN114595073B (en) A pipeline data transmission method and a data pipeline device
CN108062289B (en) Fast Fourier Transform (FFT) address order changing method, signal processing method and device
CN112602096A (en) Operation method, device, equipment and storage medium of convolutional neural network
CN101930713A (en) Memory architecture of display device and reading method thereof
CN115495152A (en) Memory computing circuit with variable length input

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