CN101739370B - Bus system and its method of operation - Google Patents
Bus system and its method of operation Download PDFInfo
- Publication number
- CN101739370B CN101739370B CN 200810174827 CN200810174827A CN101739370B CN 101739370 B CN101739370 B CN 101739370B CN 200810174827 CN200810174827 CN 200810174827 CN 200810174827 A CN200810174827 A CN 200810174827A CN 101739370 B CN101739370 B CN 101739370B
- Authority
- CN
- China
- Prior art keywords
- instruction
- link
- dependent
- initial
- new
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 35
- 230000001419 dependent effect Effects 0.000 claims abstract description 96
- 230000000977 initiatory effect Effects 0.000 claims 4
- 239000013589 supplement Substances 0.000 claims 1
- 230000001502 supplementing effect Effects 0.000 claims 1
- 238000012545 processing Methods 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 5
- 230000004044 response Effects 0.000 description 5
- 239000003550 marker Substances 0.000 description 4
- 238000011017 operating method Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 101100135890 Caenorhabditis elegans pdi-6 gene Proteins 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Landscapes
- Advance Control (AREA)
Abstract
一种应用于非依序执行的总线系统的操作方法,包含有:依据相依限制条件将使用总线系统的指令链接成具有先后顺序的相依链接;以及依据各相依链接对该些指令进行先后顺序的处理。
An operation method for a bus system used for non-sequential execution includes: linking instructions using the bus system into dependent links with a sequence according to dependent restriction conditions; and processing the instructions in sequence according to each dependent link.
Description
技术领域 technical field
本发明是关于非依序(out-of-order)执行的总线系统的操作方法,且尤其是关于在非依序执行的总线系统中依据相依限制条件建立相依链接的方法。The present invention relates to an operation method of an out-of-order bus system, and more particularly to a method for establishing a dependent link according to a dependency constraint in the out-of-order bus system.
背景技术 Background technique
传统的总线协议均以依序(in-order)的方式执行,例如先进高效能总线(AHB,Advanced High performance BUS),即依据各指令的先后顺序来依序执行。然而,这样的执行方式会有个缺点,就是当有一笔较大的数据交易(transaction)时会延误后续许多笔数据交易,而当系统越来越庞大时,依序执行的总线架构将不敷使用。因此,目前大型的系统转而采用非依序(out-of-order)执行的总线系统,例如先进延伸接口(AXI,AdvancedeXtensible Interface)与开放核心协议(OCP,Open Core Protocol)总线系统。这些非依序执行的总线系统可以使总线上的主控装置(master)与从属装置(slave)能有更多的空间去处理传送自总线的指令。在非依序执行的总线系统中,数据的顺序并非依序排列,例如通过总线系统的指令通道(commandchannel)传送的指令,与通过总线系统的写入数据通道(write-data channel)传送而相应于该指令的写入数据并非依序进入从属装置中,因此,线程识别码(threadID)或标签识别码(tagID)便经常被用来处理这些非依序进入而又互相关联的指令。然而,当这些线程识别码或标签识别码不依序地在总线上传送时,将无法使相关的指令被依序执行,因而容易产生错误。Traditional bus protocols are executed in an in-order manner, such as Advanced High Performance Bus (AHB, Advanced High Performance BUS), which executes sequentially according to the order of each instruction. However, such an execution method has a disadvantage, that is, when there is a large data transaction (transaction), many subsequent data transactions will be delayed, and when the system becomes larger and larger, the bus architecture for sequential execution will not be sufficient use. Therefore, the current large-scale systems turn to out-of-order bus systems, such as Advanced Extended Interface (AXI, AdvancedeXtensible Interface) and Open Core Protocol (OCP, Open Core Protocol) bus systems. These non-sequential execution bus systems can enable the master and slave devices on the bus to have more space to process instructions transmitted from the bus. In a non-sequentially executed bus system, the order of data is not in order. For example, the command transmitted through the command channel of the bus system corresponds to the transmission through the write-data channel of the bus system. The data written in this command is not sequentially entered into the slave device, therefore, thread ID (threadID) or tag ID (tagID) is often used to process these non-sequentially entered but interrelated commands. However, when these thread IDs or tag IDs are transmitted out of order on the bus, related instructions cannot be executed sequentially, and errors are likely to occur.
美国公开专利第2007/0067549号案(此后简称为549号专利案)中曾提出相关的解决方法,其采用传统的先进先出概念解决。为了避免未完成(outstanding)的写入指令与其后的读取指令可能发生数据危障(datahazard),549号专利案将该未完成的写入指令的相关信息暂存在先进先出存储器中,当检查出其后续的读取操作会有数据危障发生时,则暂停该读取操作,直到该未完成写入指令已被完成后再执行暂停中的读取操作,以避免数据危障发生。此方法仍存在一些问题,例如当该读取操作暂停时,该读取操作之后的所有读取操作亦暂停执行,即便先执行它们亦不会发生数据危障。从而,可得知若采用549号专利的方法将使系统整体的效能降低。A related solution has been proposed in US Patent Publication No. 2007/0067549 (hereinafter referred to as Patent No. 549), which adopts the traditional first-in-first-out concept. In order to avoid possible data hazard (data hazard) between the outstanding write command and the subsequent read command, the '549 patent temporarily stores the relevant information of the outstanding write command in the first-in-first-out memory. When it is detected that there will be a data hazard in the subsequent read operation, the read operation is suspended until the unfinished write command is completed before the suspended read operation is executed to avoid data hazards. There are still some problems with this method, for example, when the read operation is suspended, all the read operations after the read operation are also suspended, even if they are executed first, data corruption will not occur. Therefore, it can be seen that if the method of the '549 patent is adopted, the overall performance of the system will be reduced.
发明内容 Contents of the invention
为解决上述问题,本发明提出一种应用于非依序(out-of-order)执行的总线系统的操作方法,以提升系统的整体效能、避免数据危障。该方法包括:依据相依限制条件将使用总线系统的指令链接成具有先后顺序的相依链接;以及依据各相依链接对该些指令进行先后顺序的处理。In order to solve the above problems, the present invention proposes an operation method applied to an out-of-order bus system, so as to improve the overall performance of the system and avoid data corruption. The method includes: linking the instructions using the bus system into dependent links with a sequence according to the dependent constraints; and processing the instructions in sequence according to the dependent links.
本发明还提出一种总线系统,包括:指令暂存器,接收并暂存新进指令,其中该新进指令至少包括一链接标记;以及相依链接产生器,耦接至该指令暂存器,依据该新进指令N个链接标记的相依限制条件产生N个相依链接,且N为任意正整数;其中,该新进指令所包括的每一链接标记皆是用以表示该新进指令与多个先前尚未执行的新进指令之间的先后顺序的链接关系。The present invention also proposes a bus system, comprising: a command register for receiving and temporarily storing a new incoming command, wherein the new incoming command includes at least a link flag; and a dependency link generator coupled to the command register, Generate N dependent links according to the dependency constraints of the N link tags of the new instruction, and N is any positive integer; wherein, each link tag included in the new instruction is used to indicate that the new instruction is related to multiple The sequential link relationship between the previously unexecuted incoming instructions.
附图说明 Description of drawings
图1是依据本发明的一实施例的总线系统的操作方法的流程图。FIG. 1 is a flowchart of an operating method of a bus system according to an embodiment of the present invention.
图2是依据本发明的一实施例的存储器调度器的方块图。FIG. 2 is a block diagram of a memory scheduler according to an embodiment of the invention.
图3是显示利用单一相依限制条件所建立的相依指令链接中一指令的结构。FIG. 3 shows the structure of an instruction in a chain of dependent instructions established using a single dependency constraint.
图4是说明存储器调度器在不同时间接收到的各指令之间的链接关系。FIG. 4 is a diagram illustrating the link relationship between instructions received by the memory scheduler at different times.
图5是显示利用单一相依限制条件所建立的相依指令链接中一指令的另一结构。FIG. 5 shows another structure of an instruction in a chain of dependent instructions established using a single dependency constraint.
图6是显示利用单一相依限制条件所建立的相依指令链接中一指令的又另一结构。FIG. 6 shows yet another structure of an instruction in a chain of dependent instructions established using a single dependency constraint.
图7是显示利用两个相依限制条件所建立的相依指令链接中各指令的结构。FIG. 7 shows the structure of each instruction in the dependent instruction chain established by using two dependent constraints.
图8是说明存储器调度器200在不同时间接收到的各指令之间的链接关系。FIG. 8 illustrates the link relationship between instructions received by the
图9是依据本发明的一实施例来对总线上传输的数据进行追踪除错的示意图。FIG. 9 is a schematic diagram of tracking and debugging data transmitted on the bus according to an embodiment of the present invention.
[主要元件标号说明][Description of main component labels]
具体实施方式 Detailed ways
图1是依据本发明的一实施例的总线系统的操作方法的流程图。总线系统的操作方法100包含下列步骤:FIG. 1 is a flowchart of an operating method of a bus system according to an embodiment of the present invention. The
步骤110:依据至少一相依限制条件将使用该总线系统的多个指令链接成具有先后顺序的至少一相依链接;Step 110: Link the multiple instructions using the bus system into at least one dependent link with sequence according to at least one dependent constraint condition;
步骤120:依据每一相依链接对该些指令进行该先后顺序的处理;以及Step 120: Process the instructions in the sequence according to each dependent link; and
步骤130:依据相关链接标记重设已执行的指令所属的相依链接。Step 130: Reset the dependent link to which the executed instruction belongs according to the related link flag.
总线系统的操作方法100将搭配以下各图与各实施例详细说明如下。The
图2是依据本发明的一实施例的存储器调度器的方块图。存储器调度器200包含指令暂存器(request queue)210、相依链接产生器220、指令选择器230以及链接关系移除器240。其中,相依链接产生器220是耦接至指令暂存器210,指令选择器230是耦接至指令暂存器210,而链接关系移除器240是耦接至指令暂存器210与指令选择器230。存储器调度器200是耦接至非依序执行总线(未显示于图2),依据至少一相依限制条件将使用该总线系统的多个指令彼此链接成具有先后顺序的至少一个相依链接,再依据各相依链接选出有资格被执行(serve)的指令,以使得可依据该先后顺序对该些指令进行处理。FIG. 2 is a block diagram of a memory scheduler according to an embodiment of the invention. The
总线上的指令是非依序地被传递,为了避免发生数据危障等错误,一些有相依性(dependency)的指令应依序地被执行,而各指令彼此之间是否有相依性,得从各指令的线程识别码(threadID)、存储器页码(memory pagenumber)等消息来判断。例如,根据总线协议(bus protocol),具有相同线程识别码(例如线程识别码均为0)的各指令具有相依性,又如存取同一存储器页码的各指令间亦有相依性,此规定可避免数据危障的发生。因此,得以根据线程识别码或存储器页码作为相依限制条件以建立相依链接,请注意到,上述仅作为范例说明之用,而本领域技术人员当得以采用其它相依限制条件以判断各指令间的相依性。The instructions on the bus are transmitted non-sequentially. In order to avoid errors such as data hazards, some instructions with dependencies should be executed sequentially. Instruction thread identification code (threadID), memory page number (memory page number) and other information to judge. For example, according to the bus protocol, instructions with the same thread identification code (for example, the thread identification codes are all 0) have dependencies, and there are also dependencies between instructions that access the same memory page number. Avoid data hazards. Therefore, the dependency link can be established according to the thread identification code or the memory page number as the dependency restriction condition. Please note that the above is only used as an example, and those skilled in the art can use other dependency restriction conditions to determine the dependency between instructions. sex.
指令暂存器210自总线上接收并储存指令R。图3是显示利用单一相依限制条件所建立的相依指令链接中一指令的结构。储存在指令暂存器210的指令300具有多个字段,分别用以记录末端标记310、指令内容320与链接标记330,请注意到图3所示的指令300的各字段顺序仅为说明之用,不应视为本发明的限制。末端标记310用以说明该指令是否为所属相依链接的末端,指令内容320储存该指令欲执行的内容,链接标记330用以指示该指令与储存在指令暂存器210的多个先前尚未执行的指令之间的依先后顺序的链接关系,在一实施例中,当链接标记330显示指令300与其它指令皆无链接关系时,则指令300是至少一相依链接的起始端。The
图4是说明存储器调度器200在不同时间接收到的各指令之间的链接关系。假设在时间T5时,指令暂存器210中已经储存了线程识别码为0且分别在时间T0、T1、T3收到的指令R0(0)、R1(0)、R3(0),以及储存了线程识别码为1且分别在时间T2、T4收到的指令R2(1)、R4(1),其中指令R0(0)的链接标记是说明其并不向前链接至任何指令,换言之,其为线程识别码为0的相依链接(简称为第一链接)的起始端,R1(0)的链接标记是说明其是链接在指令R0(0)之后,R3(0)的链接标记是说明其是链接在指令R1(0)之后,而R3(0)的末端标记是说明其是其为第一链接的末端;此外,指令R2(1)的链接标记是说明其并不向前链接至任何指令,亦即,其为线程识别码为1的相依链接(简称为第二链接)的起始端,R4(1)的链接标记是说明其是链接在指令R2(1)之后,而R2(1)的末端标记是说明其是其为第二链接的末端。在时间T5时,存储器调度器200又接收到线程识别码为0的新进指令R5,并将其储存在指令暂存器210之中。依据相依限制条件(如线程识别码0、1),相依链接产生器220寻找线程识别码为0的链接的末端,即指令R3(0),使新进指令R5链接于第一链接的末端,设定指令R5的链接标记为链接至指令R3(0)(如步骤110),并设定其末端标记为第一链接的末端,且更改指令R3(0)的末端标记使其不再为第一链接的末端。请注意到,若指令R5的线程识别码为1,则相依链接产生器220以类似于上述的方法将其链接至第二链接的末端;若指令暂存器210中并无任何指令与指令R5的线程识别码相同,即新进指令R5不符任一相依限制条件时,相依链接产生器220设定指令R5的链接标记使其成为新建链接的起始端,并设定指令R5的末端标记使其同时成为新建链接的末端。FIG. 4 illustrates the link relationship between instructions received by the
至于执行指令方面,指令选择器230依据储存在指令暂存器210中尚未被执行的各指令与相应的相依链接选出有资格被执行的指令,指令选择器230必须从各个链接的起始指令当中,挑选出一个予以执行,如指令R0(0),指令选择器230输出有资格被执行的指令R0(0),代表指令R0(0)已得以被执行(如步骤120),而链接关系移除器240则依据各指令的链接标记寻找链接至指令R0(0)的指令R1(0),如指令R1(0)的链接标记是指出其是链接在指令R(0)之后,则链接关系移除器240移除指令R1(0)并重设指令R1(0)的链接标记,使其取代指令选择器230已执行的指令R0(0)而递补成为第一链接的起始指令(如步骤130)。当指令选择器230再次挑选得被执行的指令时,则指令选择器230得依据指令R1(0)的链接标记将指令R1(0)选为得被执行的指令,并输出指令R1(0)以供执行。As for the execution instructions, the
图5是显示利用单一相依限制条件所建立的相依指令链接中一指令的另一结构。储存在指令暂存器210的指令500具有多个字段,分别记录起始标记510、指令内容520与链接标记530,请注意到,图5所示的指令500的各字段顺序仅为说明之用,不应视为本发明的限制。起始标记510是用以说明该指令是否为相依链接的起始指令,指令内容520则储存该指令欲执行的内容,而链接标记530是用以指示该指令与储存在指令暂存器210的其它指令的链接关系,例如总线系统中有第一指令与第二指令,而该第一指令的链接标记是指出该第一指令是链接在该第二指令之前。本领域技术人员当可在前述指令300的相依链接建立与选择执行指令的相关说明的教导之下,以指令500形式的指令进行相依链接建立与选择执行指令,因此为求简洁起见,于此将不再赘述。FIG. 5 shows another structure of an instruction in a chain of dependent instructions established using a single dependency constraint. The
图6是显示利用单一相依限制条件所建立的相依指令链接中一指令的又另一结构。储存在指令暂存器210的指令600具有多个字段,分别记录优先权标记610与指令内容620,请注意到图6所示的指令600的各字段顺序仅为说明之用,不应视为本发明的限制。优先权标记610是用以说明该指令在所属的任一相依链接中的该先后顺序,而指令内容620为该指令欲执行的内容。本领域技术人员当可在前述指令300的相依链接建立与选择执行指令的相关说明的教导之下,以具有指令600形式的指令进行相依链接建立与选择执行指令,因此为求简洁起见,于此将不再赘述。FIG. 6 shows yet another structure of an instruction in a chain of dependent instructions established using a single dependency constraint. The
除了使用单一个相依限制条件建立使用总线系统的各指令间的相依性之外,亦可使用多个相依限制条件来建立相依性,例如一并依据线程识别码与存储器页码来建立相依性。图7是显示利用两个相依限制条件所建立的相依指令链接中各指令的结构。储存在指令暂存器210的指令700具有多个字段,分别记录第一末端标记710、第二末端标记720、指令内容730、第一链接标记740与第二链接标记750,请注意到,图7所示的指令700的各字段顺序仅为说明之用,不应视为本发明的限制。第一末端标记710是用以说明该指令是否为依据第一相依限制条件(例如线程识别码)而建立的第一相依链接的第一末端指令,第二末端标记720是用以说明该指令是否为依据第二相依限制条件(例如存储器页码)而建立的第二相依链接的第二末端指令,指令内容730是储存该指令欲执行的内容,第一链接标记740是用以说明该指令与储存在指令暂存器210的其它指令的在第一相依限制条件方面的链接关系,以及第二链接标记750是用以说明该指令与储存在指令暂存器210的其它指令的在第二相依限制条件方面的链接关系。In addition to using a single dependency constraint to establish dependencies between instructions using the bus system, multiple dependency constraints can also be used to establish dependencies, for example, to establish dependencies based on thread IDs and memory page numbers. FIG. 7 shows the structure of each instruction in the dependent instruction chain established by using two dependent constraints. The
图8是说明存储器调度器200在不同时间接收到的各指令之间的链接关系。假设在时间T3时,指令暂存器210中已经储存了分别在时间T0、T1、T2收到的指令R0(0)P0、R1(0)P1、R2(1)P0。指令R0(0)P0、R1(0)P1的线程识别码为0,指令R0(0)P1、R2(1)P1的存储器页码为0,而指令R1(0)P1的存储器页码为1,其中指令R0(0)P0的第一链接标记是说明其先前并无链接任何线程识别码为0的指令,故其为线程识别码为0的相依链接(简称为第一链接)的起始指令,而指令R0(0)P0的第二链接标记说明其先前并无链接任何存储器页码为0的指令,其为存储器页码为0的相依链接(简称为第二链接)的起始指令。FIG. 8 illustrates the link relationship between instructions received by the
指令R1(0)P1的第一链接标记指出,在线程识别码的相依限制条件方面,其是链接在指令R0(0)P0之后,而指令R1(0)P1的第一末端标记说明其亦为第一链接的末端指令;而指令R1(0)P1的第二链接标记指出,在存储器页码的相依限制条件方面,其先前并无链接任何存储器页码为1的指令,其为存储器页码为1的相依链接(简称为第三链接)的起始指令,而指令R1(0)P1的第二末端标记说明其亦为第三链接的末端指令。The first link label of instruction R1(0)P1 indicates that it is chained after instruction R0(0)P0 in terms of the dependency constraints of the thread ID, and the first end label of instruction R1(0)P1 indicates that it is also chained after instruction R0(0)P0. is the end instruction of the first link; and the second link tag of instruction R1(0)P1 indicates that it has not previously linked any instruction with a memory page number of 1 in terms of memory page dependency constraints, which is a memory page number of 1 The start instruction of the dependent link (referred to as the third link for short), and the second end tag of the instruction R1(0)P1 indicates that it is also the end instruction of the third link.
指令R2(1)P0的第一链接标记是说明其先前并无链接任何线程识别码为1的指令,故其为线程识别码为1的相依链接(简称为第四链接)的起始指令,而指令R2(1)P0的第一末端标记说明其亦为第四链接的末端指令。而指令R2(1)P0的第二链接标记说明在存储器页码的相依限制条件方面,其是链接在指令R0(0)P0之后,而指令R2(1)P2的第二末端标记说明其亦为第二链接的末端指令。The first link mark of instruction R2(1)P0 is to explain that it has not linked any instruction whose thread identification code is 1 before, so it is the initial instruction of the dependent link (abbreviated as the fourth link) whose thread identification code is 1, The first end tag of instruction R2(1)P0 indicates that it is also the end instruction of the fourth chain. And the second link mark of instruction R2(1)P0 shows that it is chained after instruction R0(0)P0 in terms of the dependency constraints of the memory page number, and the second end mark of instruction R2(1)P2 shows that it is also End directive for the second link.
第一、二、三、四链接是相依链接产生器220依据新进指令链接标记的相依限制条件所产生的四个相依链接,请注意到,相依链接产生器220得依据新进指令N个链接标记的相依限制条件产生N个相依链接,且N为任意正整数,而相依链接产生器220更得依据该新进指令所包括的N个末端标记来表示该新进指令为该N个相依链接的末端指令,以下将以新进指令详细说明之。The first, second, third, and fourth links are the four dependent links generated by the
在时间T3时,存储器调度器200又接收到线程识别码为0且存储器页码为0的指令R3(0)P0,并将其储存在指令暂存器210之中。依据各相依限制条件(如线程识别码0、1),相依链接产生器220寻找线程识别码为0的链接的末端指令,即指令R1(0)P1,使新进指令R3(0)P0链接于第一链接的末端,设定指令R3(0)P0的第一链接标记为链接至指令R1(0)P1,并设定其第一末端标记为第一链接的末端指令,且更改指令R1(0)P1的第一末端标记使其不再为第一链接的末端指令。依据各相依限制条件(如存储器页码0、1),相依链接产生器220寻找存储器页码为0的链接的末端指令,即指令R2(1)P0,使新进指令R3(0)P0链接于第二链接的末端,设定指令R3(0)P0第二链接标记为链接至指令R2(1)P0,并设定其第二末端标记为第二链接的末端指令,且更改指令R2(1)P2的第二末端标记使其不再为第二链接的末端指令。At time T3 , the
请注意到,若指令暂存器210中并无任何指令与新进指令的线程识别码相同,即该新进指令不符任一相依限制条件时,则相依链接产生器220设定新进指令的第一链接标记以使其在线程识别码的相依限制条件方面成为新建链接的起始端,并设定新进指令的第一末端标记以使其成为该新建链接的末端;若指令暂存器210中并无任何指令与新进指令的存储器页码相同,则相依链接产生器220设定新进指令的第二链接标记使其在存储器页码的相依限制条件方面成为新建链接的起始端,并设定新进指令的第二末端标记使其成为该新建链接的末端。Please note that if there is no instruction in the
至于执行指令方面,指令选择器230依据储存在指令暂存器210中尚未被执行的各指令与多个相依链接选出有资格被执行的指令,指令选择器230判读多个(如N个)相依链接所包含的N个链接标记,根据所属的链接标记判断该指令是否为起始指令,并找出N个相依链接起始端的M个起始指令,并挑选出其中之一予以执行,其中M个起始指令皆至少包含一链接标记表示其为已可被执行的起始指令,且M、N为正整数,M小于N。例如,指令R0(0)P0在各相依限制条件方面(线程识别码与存储器页码)的链接标记均指出其为起始指令,则指令R0(0)P0即为有资格被执行的指令,而指令R1(0)P1在存储器页码方面则为起始指令,但是在线程识别码方面并非是起始指令,故指令R1(0)P1不是有资格被执行的指令。在另一实施例中,若指令R1(0)P1在各相依限制条件方面的链接标记有多数指出其为起始指令,则指令R0(0)P0亦为有资格被执行的指令。在又一实施例中,若指令R1(0)P1在各相依限制条件方面的链接标记至少一个链接标记指出其为起始指令,则指令R0(0)P0亦为有资格被执行的指令。假设指令选择器230输出有资格被执行的指令R0(0)P0,而链接关系移除器240则依据各指令的各链接标记寻找在各相依限制条件方面链接在指令R0(0)P0后的指令,在线程识别码方面,指令R1(0)P1的第一链接标记是指出其是链接在指令R0(0)P0之后,链接关系移除器240重设指令R1(0)P1的第一链接标记,使其取代已执行的指令R0(0)P0成为第一链接的起始指令;在存储器页码方面,指令R2(1)P0的第二链接标记是指出其是链接在指令R0(0)P0之后,链接关系移除器240重设指令R2(1)P0的第二链接标记,使其取代已执行的指令R0(0)P0成为第二链接的起始指令。As for the execution instructions, the
此外,指令700得具有类似于指令500的形式,即具有对应多个相依限制条件的多个起始标记以及对应多个相依限制条件的多个链接标记,而其中的链接标记是说明该指令是链接在哪些指令之前,本领域技术人员当可在前述实施例的教导之下,轻易地了解此种形式的指令要如何建立相依链接与执行,因此为求简洁起见,于此将不再赘述。In addition,
再者,指令700得具有类似于指令600的形式,即具有对应多个相依限制条件的多个优先权标记,而其中的优先权标记是说明该指令在各相依限制条件方面所建立的相依链接中的先后顺序,本领域技术人员当可在前述实施例的教导之下,轻易地了解此种形式的指令要如何建立相依链接与执行,因此为求简洁起见,于此将不再赘述。Furthermore, the
要在多线程且非依序执行的总线上进行传输对齐(transfer alignment)也是一项很困难的工作,然而,若欲对总线上传输的数据进行除错追踪(debugtracing),又非得进行传输对齐不可。本发明的一实施例是利用建立指令间相依性的技术来对总线上传输的数据进行除错追踪。图9是依据本发明的一实施例对总线上传输的数据进行除错追踪的示意图。如图所示,总线具有指令通道(command channel)CC、写入数据通道(write data channel)WC与响应通道(response channel)DC。在指令通道CC上,从时间T0到T5分别出现了指令R0到R5,其中指令R0(0)、R5(0)的线程识别码均为0,指令R1(1)、R2(1)、R4(1)的线程识别码均为1,以及指令R3(2)的线程识别码为2。线程识别码相同的指令必须依序执行,因而将线程识别码作为相依限制条件,在时间T2时,除错追踪模块(未显示于图9)发现总线上的指令R2(1)与指令R1(1)有相同的线程识别码,故在其指令暂存器(未显示于图9)中设定指令R2(1)的链接标记以说明其是链接至指令R1(1),设定R2(1)的末端标记以说明其是线程识别码为1的相依链接(简称为第一链接)的末端指令,并重设指令R1(1)的末端标记以说明其不再是第一链接的末端指令;在时间T4时,除错追踪模块发现总线上的指令R4(1)与指令R1(1)、指令R2(1)的线程识别码均为1,便根据上述的类似操作来使指令R4(1)成为第一链接的末端指令,并修改第一链接的链接关系。It is also very difficult to perform transfer alignment on a multi-threaded and non-sequentially executed bus. However, if you want to debug and trace the data transferred on the bus, you must perform transfer alignment. No. An embodiment of the present invention utilizes the technique of establishing inter-command dependencies to debug and trace the data transmitted on the bus. FIG. 9 is a schematic diagram of debugging and tracking data transmitted on the bus according to an embodiment of the present invention. As shown in the figure, the bus has a command channel (command channel) CC, a write data channel (write data channel) WC, and a response channel (response channel) DC. On the instruction channel CC, instructions R0 to R5 appear from time T0 to T5 respectively, among which the thread identification codes of instructions R0(0) and R5(0) are both 0, and instructions R1(1), R2(1), and R4 The thread identification codes of (1) are all 1, and the thread identification code of instruction R3(2) is 2. Instructions with the same thread identification code must be executed in sequence, so the thread identification code is used as a dependent constraint condition. At time T2, the debug tracking module (not shown in FIG. 9 ) finds that instruction R2(1) and instruction R1( 1) have the same thread ID, so set the link flag of instruction R2(1) in its instruction register (not shown in Figure 9) to illustrate that it is linked to instruction R1(1), set R2( 1) to indicate that it is the end instruction of a dependent link with thread ID 1 (abbreviated as the first link), and reset the end label of instruction R1(1) to indicate that it is no longer the end instruction of the first link ; At time T4, the debugging tracking module finds that the thread identification codes of instruction R4(1), instruction R1(1) and instruction R2(1) on the bus are both 1, and then make instruction R4( 1) Become the end command of the first link, and modify the link relationship of the first link.
在时间T5时,响应通道DC出现一笔响应数据D1(1),其线程识别码为1,且总线中未完成(outstanding)的指令R1(1)、指令R2(1)、指令R4(1)的线程识别码均为1,而依据前述关于利用末端标记与链接标记的方法得以判定出这三个指令中只得执行起始指令R1(1),因此可以判定指令R1(1)与响应数据D1(1)为同一笔交易,故通过上述方法即可完成追踪并记录总线的数据交易。请注意到,本领域技术人员当可在前述各实施例的教导下,利用多个相依限制条件对总线进行除错追踪,或者利用有关起始标记、链接标记、优先权标记等方法对总线进行除错追踪,于此不再赘述。At time T5, a piece of response data D1(1) appears in the response channel DC, its thread identification code is 1, and there are outstanding commands R1(1), R2(1), R4(1) in the bus )’s thread identification codes are all 1, and according to the above-mentioned method of using the end mark and the link mark, it can be determined that only the start command R1(1) can be executed among the three commands, so it can be determined that the command R1(1) and the response data D1(1) is the same transaction, so the data transaction of the bus can be tracked and recorded by the above method. Please note that those skilled in the art can, under the teachings of the above-mentioned embodiments, use multiple dependent constraints to debug and track the bus, or use methods such as start flags, link flags, and priority flags to trace the bus. Debugging and tracking will not be repeated here.
综上所述,本发明的实施例提供了利用至少一相依限制条件在非依序执行的多线程总线系统中建立各指令间相依性的方法,从而在对各指令进行相关处理时,得以依据各指令间的相依性进行,以减少数据危障发生的机率。To sum up, the embodiments of the present invention provide a method for establishing dependencies between instructions in a non-sequentially executed multithreaded bus system by using at least one dependency constraint, so that when performing related processing on each instruction, it can be based on The dependencies among the commands are implemented to reduce the probability of data hazards.
以上所述仅为本发明的较佳实施例,凡依本发明权利要求范围所做的均等变化与修饰,皆应属本发明的涵盖范围。The above descriptions are only preferred embodiments of the present invention, and all equivalent changes and modifications made according to the claims of the present invention shall fall within the scope of the present invention.
Claims (18)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200810174827 CN101739370B (en) | 2008-11-05 | 2008-11-05 | Bus system and its method of operation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200810174827 CN101739370B (en) | 2008-11-05 | 2008-11-05 | Bus system and its method of operation |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101739370A CN101739370A (en) | 2010-06-16 |
CN101739370B true CN101739370B (en) | 2013-04-24 |
Family
ID=42462873
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 200810174827 Active CN101739370B (en) | 2008-11-05 | 2008-11-05 | Bus system and its method of operation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101739370B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109725245B (en) * | 2017-10-30 | 2021-10-08 | 瑞昱半导体股份有限公司 | Integrated circuit testing device |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7320100B2 (en) * | 2003-05-20 | 2008-01-15 | Cray Inc. | Apparatus and method for memory with bit swapping on the fly and testing |
-
2008
- 2008-11-05 CN CN 200810174827 patent/CN101739370B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7320100B2 (en) * | 2003-05-20 | 2008-01-15 | Cray Inc. | Apparatus and method for memory with bit swapping on the fly and testing |
Also Published As
Publication number | Publication date |
---|---|
CN101739370A (en) | 2010-06-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10552163B2 (en) | Method and apparatus for efficient scheduling for asymmetrical execution units | |
CN100538736C (en) | Method and apparatus for storing and restoring state context in a graphics processing unit | |
CN100435172C (en) | Method for processing multiple programs by interruptible graphics processing unit and graphics processing unit | |
US8578216B2 (en) | Execution history tracing method | |
CN111611120B (en) | On-chip multi-core processor Cache consistency protocol verification method, system and medium | |
US8856706B2 (en) | System and method for metastability verification of circuits of an integrated circuit | |
TWI294573B (en) | Apparatus and method for controlling establishing command order in an out of order dma command queue, and computer readable medium recording with related instructions | |
US20140281409A1 (en) | Method and apparatus for nearest potential store tagging | |
US11868780B2 (en) | Central processor-coprocessor synchronization | |
CN101281460B (en) | Method and system for procesing multi threads | |
CN110888727A (en) | Method, device and storage medium for realizing concurrent lock-free queue | |
CN102103482B (en) | Adaptive optimized compare-exchange operation | |
TW200910096A (en) | Reordering data responses | |
WO2023093334A1 (en) | System for executing atomic operation, and atomic operation method and apparatus | |
TWI385529B (en) | Bus system and operation method thereof | |
CN101739370B (en) | Bus system and its method of operation | |
CN117806706B (en) | Storage order violation processing method, storage order violation processing device, electronic equipment and medium | |
CN116841614A (en) | Sequential vector scheduling method under disordered access mechanism | |
CN105068877B (en) | Data consistency transmission method between a kind of multipriority task | |
CN105242905B (en) | The treating method and apparatus that data false appearance is closed | |
CN112685191B (en) | Message processing method and device | |
CN120029674A (en) | A GPGPU instruction pre-analysis out-of-order scheduling method, system, device, and medium | |
CN106777503A (en) | Higher synthesis optimization method based on code conversion | |
CN119512626A (en) | Command processing method, controller and computer system | |
CN118363916A (en) | Computing cluster message processing method, device and electronic device based on instruction set |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |