Anti-locking method and device for network on chip based on special slot and chip
Patent Information
- Application Number
- CN202611501106.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-24
- Publication Date
- 2026-10-30
AI Technical Summary
两类死锁的实质均是跨Ring Flit之间形成资源循环等待,任何一方均无法率先获得可用的Slot
[0019]相较于现有技术,本申请实施例不通过增加环站主通路缓存、增设虚拟通道或引入复杂仲裁逻辑来打破跨环流控单元之间的循环等待,而是在每条环形总线的每个传输方向上保留一个准入受限的特殊空槽。由于目的节点为桥接端口的流控单元被禁止占用特殊空槽,占用特殊空槽的流控单元的目的节点均位于本环内,在有限拍次内即可下环,特殊空槽由此在有限时间内恢复空闲状态。桥接端口的发送缓存中的流控单元不受特殊空槽的准入限制,能够占用恢复空闲的特殊空槽上环,发送缓存随之释放出空闲表项,可以接收相邻环形总线经桥接端口转发的跨环流控单元,相邻环形总线的接收缓存也随之释放出表项。沿总线互联环的桥接方向逐条环形总线重复上述过程,两条环形总线彼此对向发送形成的对冲死锁与多条环形总线同向流动形成的环路死锁均被逐段打通,全部流控单元在有限时间内到达各自的目的节点,既不需要整体复位,也不丢弃流控单元。并且,每条环形总线每个传输方向上受到准入限制的空槽仅为一个或少量,本环内访问的流控单元以及目的节点不是桥接端口的流控单元仍可占用特殊空槽,因此正常工作时的带宽与访问延迟基本不受影响。标记特殊空槽仅需在空槽上增加随空槽流动的标志位,上环判断仅需在原有的空槽空闲判断基础上增加标志位比较、目的节点比较及两者的逻辑与运算,硬件面积与时序开销较小,便于在无缓存环形总线的既有流控逻辑上实现。
Smart Images

Figure CN123011805A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the semiconductor field, and more specifically to an on-chip network anti-deadlock method, apparatus, and chip based on a special empty slot. Background Technology
[0002] With the development of chiplet and multi-die architectures, on-chip systems (SoCs) often employ Network on Chip (NoC) interconnects to achieve interconnection between functional modules. The ring bus is a common NoC topology, connecting multiple ring stops (RS) nodes via ring links. It strikes a trade-off between routing complexity and access latency, and is commonly used as the bus interconnect network for medium-sized systems. In a multi-die architecture, each die can use an independent ring bus, which is then bridged end-to-end via bridge ports on the ring stops through die-to-die (D2D) interconnects, forming an interconnect ring composed of multiple ring buses.
[0003] In a bufferless Ring bus architecture, the main path of the ring station is not buffered; temporary buffers are only set up in the transmitting and receiving directions. Flow control units (Flits) transmitted on the ring are passed forward one frame at a time using slots. When a Flit reaches its destination node but that node cannot receive it in the current frame, the Flit continues to travel forward along the ring (i.e., deflects). Due to the high degree of slot sharing on the ring, once a slot is occupied by a certain type of Flit for a long period, the transmitting side Flit cannot be added to the ring, thus creating a deadlock risk. When multiple Ring buses are connected to form an interconnected ring via a Bridge Port, there are two types of deadlock risks for Flits accessed across Rings: First, when any two Ring buses transmit to each other in opposite directions, their cross-Ring Flits occupy the slots of their respective Rings, forming a cross-Ring offset deadlock. Second, when multiple Ring buses flow in the same direction to form a loop, the cross-Ring Flits of each Ring sequentially occupy the slots of the corresponding Ring, forming a loop deadlock with the beginning and end connected. Both types of deadlock essentially involve a circular wait for resources between Ring Flits, where neither party can acquire a usable slot first. Current methods for addressing these deadlocks typically break the circular wait by increasing the main path cache, adding virtual channels, or introducing complex arbitration logic. However, this introduces significant hardware footprint and logical overhead, and may cause bandwidth and latency losses during normal operation. Relying on a complete reset or discarding of Flits, on the other hand, impacts system availability and data integrity.
[0004] In summary, how to resolve NoC deadlock in multi-ring interconnects with minimal hardware cost, while avoiding loss of Flit and impact on normal operating performance, is a pressing technical problem that needs to be solved. Summary of the Invention
[0005] This application provides an on-chip network anti-deadlock method, device, and chip based on special empty slots. It is used to reserve special empty slots in each transmission direction of the ring bus, which can only be occupied by flow control units whose destination node is not a bridge port. This allows the transmit buffer of the bridge port to obtain the opportunity to join the ring within a limited time. Without increasing the main path buffer and virtual channel of the ring station, it can eliminate cross-ring offset deadlock and loop deadlock in the bus interconnection ring formed by bridging the beginning and end of multiple ring buses through the bridge port.
[0006] In a first aspect, embodiments of this application provide an on-chip network deadlock prevention method based on a special empty slot. The method is applied to a bus interconnect ring formed by bridging multiple ring buses end-to-end through bridging ports. The method includes: In each transmission direction of each of the aforementioned ring buses, at least one empty slot used for temporary flow control units is marked as a special empty slot, such that the flag bit identifying the special empty slot flows with the empty slot on the ring bus; the special empty slot allows flow control units of destination nodes that do not belong to the bridge port to occupy it; Obtain the destination node identifier of the flow control unit to be connected to the ring. Based on the correspondence between the destination node identifier and each ring station node connected to the current ring bus, determine the next node of the flow control unit on the current ring bus. If the next node is the bridge port, determine the destination node of the flow control unit as the bridge port. Read the flag bit of the empty slot that passes through the loop station node where the flow control unit is located, and determine whether the current empty slot is the special empty slot based on the flag bit; If the current empty slot is the special empty slot and the destination node of the flow control unit is the bridge port, the flow control unit is prohibited from occupying the current empty slot, and the flow control unit waits in the transmission buffer until the empty slot passed is a non-special empty slot or the destination node is not the bridge port. When the special empty slot is in an idle state, the flow control unit in the transmit buffer of the bridge port is injected into the special empty slot, so that the transmit buffer of the bridge port releases the idle table entry, and receives the cross-ring flow control unit forwarded by the adjacent ring bus through the bridge port through the idle table entry, thereby releasing the resource circular wait between each ring bus. The resource circular wait includes cross-ring offset deadlock and loop deadlock.
[0007] In one implementation, determining that the destination node of the flow control unit is a bridging port includes: Parse the message header of the flow control unit and obtain the destination node identifier from the message header; Compare the destination node identifier with the range of node identifiers in the current ring bus; If the destination node identifier belongs to the range of the current node identifier, the destination node of the flow control unit is determined to be a ring station node within the current ring, and the next node of the flow control unit on the current ring bus is a ring station node within the current ring. If the destination node identifier does not fall within the range of the current node identifier, the flow control unit is determined to be a cross-ring flow control unit, the next node of the cross-ring flow control unit on the current ring bus is determined to be the bridge port, and the destination node of the cross-ring flow control unit is determined to be the bridge port; wherein, the range of the current node identifier is composed of the node identifiers of each ring station node connected to the current ring bus.
[0008] In one implementation, preventing the flow control unit from occupying the currently empty slot includes: Determine whether the loop station node where the flow control unit to be looped is located is a loop station node connected to the bridge port; If the loop station node is not a loop station node connected to the bridge port, perform a logical AND operation between the first condition that the current empty slot is the special empty slot and the second condition that the destination node of the flow control unit is the bridge port. If both the first and second conditions are met, the flow control unit is prohibited from occupying the current special empty slot. When the loop station node is a loop station node connected to the bridge port, it is not determined whether the current empty slot is the special empty slot. When the current empty slot is in an idle state, the flow control unit is allowed to occupy the current empty slot and connect to the loop.
[0009] In one embodiment, marking at least one empty slot for temporary storage of the flow control unit as a special empty slot includes: Determine the location of the ring station node currently connected to the bridge port on the ring bus; In the first transmission direction of the current ring bus, select an empty slot that is a preset number of hops away from the ring station node connected to the bridge port as the target empty slot, and mark the target empty slot as valid; In the second transmission direction of the current ring bus, a target empty slot is determined according to the principle that it is opposite to the position of the special empty slot marked in the first transmission direction on the ring bus, and the mark position of the target empty slot is set to be valid, so that the bridging port of the first transmission direction and the bridging port of the second transmission direction have a uniform loop-on opportunity in time, wherein the second transmission direction is opposite to the first transmission direction, and the preset number of hops is set according to the distribution of empty slots on the ring bus.
[0010] In one embodiment, causing the flag bit identifying the special empty slot to flow along with the empty slot on the ring bus includes: During the reset or initialization phase of the on-chip network, the position information of the special empty slot on the ring bus is written through the configuration register, or the position information is determined according to the preset rules fixed in the hardware. Based on the location information, before the flow control unit begins to transmit on the ring bus, the flag position of the empty slot at the corresponding location is set to valid; In each transmission cycle of the ring bus, the flag bit is synchronously transmitted forward to one ring station node along with the empty slot, and the flag bit is provided to the currently passed ring station node as input for the ring station node to perform ring connection judgment; After the on-chip network is reset again, the position information is reacquired and the flag of the empty slot at the corresponding position is reactivated. The flag is represented by a single valid bit.
[0011] In one implementation, the process of resolving resource circular waits between the ring buses includes: When all non-special empty slots on each of the aforementioned ring buses are occupied by cross-ring flow control units, the cross-ring flow control units are prevented from occupying special empty slots in the same ring because their destination node is a bridge port of the same ring. This keeps the special empty slots in the same ring idle or only carries flow control units whose destination node is a ring station node within the same ring. Wherein, the destination node of the flow control unit occupying the special empty slot in the same ring is located within the same ring, and it goes off the ring within a limited number of cycles, so that the special empty slot in the same ring is restored to an idle state within a limited time. After the flow control unit carried by the special empty slot of this ring is removed from the ring, the flow control unit at the head of the queue in the transmit buffer of the bridge port of this ring is injected into the special empty slot of this ring, so that the transmit buffer of the bridge port of this ring releases the idle entries. The idle entry is received by the cross-ring flow control unit forwarded by the adjacent ring bus through the bridge port, so that the receive buffer of the adjacent ring bus releases the idle entry and the cross-ring flow control unit on the adjacent ring bus goes off the ring. Along the bridging direction of the bus interconnection ring, the injection and reception are repeated for each of the ring buses until the cross-ring flow control units on each of the ring buses reach their respective destination nodes.
[0012] In one embodiment, after determining that the destination node of the flow control unit is the bridging port when the next node is the bridging port, the method further includes: The number of waiting times of the flow control unit in the transmit buffer of the bridge port, and the proportion of empty slots occupied by the cross-ring flow control unit in the current transmission direction of the current ring bus are counted. If the number of waiting times is greater than the first threshold or the empty slot ratio is greater than the second threshold, increase the number of empty slots marked as special empty slots in the current transmission direction; When the number of waiting times is less than the third threshold and the empty slot ratio is less than the fourth threshold, the number of empty slots marked as special empty slots in the current transmission direction is reduced, and the number of empty slots marked as special empty slots in the current transmission direction is not less than one. Update the flag of the corresponding empty slot according to the adjusted number of empty slots.
[0013] In one embodiment, the bus interconnection ring is formed by bridging three ring buses end-to-end through three bridging ports, with two bridging ports connected to each ring bus; determining the destination node of the flow control unit as the bridging port includes: Determine the number of bridge ports currently connected to the ring bus and the ring station node where each bridge port is located; If the next node of the flow control unit is either of the two bridging ports, the destination node of the flow control unit is determined to be the bridging port, and the flow control unit is prohibited from occupying the special empty slot on the current ring bus.
[0014] Secondly, embodiments of this application provide an on-chip network anti-deadlock device based on a special empty slot, which has the function of implementing the method corresponding to the first aspect described above. The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above function, and the module can be software and / or hardware.
[0015] In one embodiment, the on-chip network anti-deadlock device based on a special slot includes: A marking module is used to mark at least one empty slot for temporary flow control units as a special empty slot in each transmission direction of each of the ring buses, and to make a flag bit identifying the special empty slot flow with the empty slot on the ring bus; the special empty slot allows the destination node to be occupied by a flow control unit that does not belong to the bridge port. The determination module is used to obtain the destination node identifier of the flow control unit to be connected to the ring, and determine the next node of the flow control unit on the current ring bus according to the correspondence between the destination node identifier and each ring station node connected to the current ring bus. If the next node is the bridge port, the destination node of the flow control unit is determined to be the bridge port. The identification module is used to read the flag bit of the empty slot passing through the loop station node where the flow control unit is located, and determine whether the current empty slot is the special empty slot based on the flag bit; The injection control module is used to prevent the flow control unit from occupying the current empty slot and to make the flow control unit wait in the transmit buffer when the current empty slot is the special empty slot and the destination node of the flow control unit is the bridge port; and when the special empty slot is in an idle state, to inject the flow control unit in the transmit buffer of the bridge port into the special empty slot, so that the transmit buffer of the bridge port releases the idle table entry, and receives the cross-ring flow control unit forwarded by the bridge port through the adjacent ring bus through the idle table entry, thereby releasing the resource circular wait between each ring bus, the resource circular wait including cross-ring offset deadlock and loop deadlock.
[0016] Thirdly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a computing device, cause the computing device to perform the on-chip network deadlock prevention method based on a special empty slot as described in the first aspect.
[0017] Fourthly, embodiments of this application provide a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the on-chip network deadlock prevention method based on special empty slots described in the first aspect.
[0018] Fifthly, embodiments of this application provide a chip, the chip including multiple ring buses, multiple ring station nodes disposed on each of the ring buses, and bridging ports that bridge the beginning and end of adjacent ring buses, the multiple ring buses forming a bus interconnection ring through the bridging ports; Each of the aforementioned ring buses has at least one slot marked as a special slot in each transmission direction, and the flag bit identifying the special slot flows along the slot on the ring bus. The loop node is used to prevent the flow control unit from occupying the current empty slot when the currently traversed empty slot is the special empty slot and the destination node of the flow control unit to be looped is the bridge port, so that the special empty slot remains available for the flow control unit in the transmission buffer of the bridge port to occupy. The chip is configured to perform the on-chip network deadlock prevention method based on special empty slots as described in the first aspect.
[0019] Compared to existing technologies, this application's embodiments do not break the circular waiting between cross-ring flow control units by adding ring station main path buffers, adding virtual channels, or introducing complex arbitration logic. Instead, it reserves a special empty slot with restricted access in each transmission direction of each ring bus. Since flow control units whose destination node is a bridge port are prohibited from occupying the special empty slot, the destination nodes of flow control units occupying special empty slots are all located within the same ring and can leave the ring within a limited number of cycles, thus restoring the special empty slot to an idle state within a limited time. Flow control units in the transmit buffer of the bridge port are not subject to the access restrictions of the special empty slot and can occupy the restored idle special empty slot to enter the ring. The transmit buffer then releases idle entries and can receive cross-ring flow control units forwarded by adjacent ring buses via the bridge port. The receive buffers of adjacent ring buses also release entries accordingly. The above process is repeated for each ring bus along the bridging direction of the bus interconnection ring. The anti-lockdown caused by two ring buses sending data in opposite directions and the loop lockout caused by multiple ring buses flowing in the same direction are gradually broken. All flow control units reach their respective destination nodes within a finite time, without requiring a complete reset or discarding flow control units. Furthermore, each ring bus has only one or a few empty slots subject to admission restrictions in each transmission direction. Flow control units accessing within the same ring and flow control units whose destination nodes are not bridge ports can still occupy special empty slots. Therefore, bandwidth and access latency during normal operation are essentially unaffected. Marking special empty slots only requires adding a flag bit that flows with the empty slot. Ring entry judgment only requires adding flag bit comparison, destination node comparison, and a logical AND operation between the two to the original empty slot idle judgment. This results in smaller hardware area and timing overhead, making it easy to implement on existing flow control logic of unbuffered ring buses. Attached Figure Description
[0020] The objectives, features, and advantages of the embodiments of this application will become readily understood by referring to the accompanying drawings and the detailed description of the embodiments. Wherein: Figure 1 This is a schematic diagram illustrating a cross-ring hedging scenario provided in an embodiment of this application. Figure 2 A schematic diagram illustrating a deadlock scenario in a three-ring interconnected loop provided in this application embodiment; Figure 3 This is a schematic diagram illustrating an example of a ring bus topology provided in an embodiment of this application; Figure 4 This is a schematic diagram illustrating an example of a ring station node structure provided in an embodiment of this application; Figure 5 A flowchart illustrating an on-chip network deadlock prevention method based on a special empty slot, provided in an embodiment of this application; Figure 6 A flowchart illustrating another on-chip network deadlock prevention method based on a special empty slot provided in this application embodiment; Figure 7 This is a schematic diagram of the structure of the on-chip network anti-deadlock device based on a special empty slot according to an embodiment of this application. Detailed Implementation
[0021] This application embodiment applies to a bus interconnection ring formed by bridging multiple ring buses end-to-end through bridging ports. The main path of the ring bus does not have a buffer; buffers are only set in the transmitting and receiving directions of the ring station nodes. Flow control units advance step-by-step using empty slots. When a flow control unit reaches a destination node but the destination node cannot receive the data in that step, the flow control unit continues to move forward along the ring. In a bus interconnection ring formed by bridging multiple ring buses end-to-end through bridging ports, cross-ring flow control units occupying empty slots on the ring for extended periods can prevent flow control units in the transmitting buffer of the bridging port from joining the ring, creating a resource loop and resulting in deadlock.
[0022] The aforementioned deadlocks can include two categories: cross-ring hedging deadlocks and loop deadlocks. Figure 1 This application provides an example of a cross-ring hedging scenario, in which any two ring buses send flow control units to each other. The cross-ring flow control units of both sides fill the empty slots of their respective ring buses, so that the flow control units in the transmit buffers of the bridge ports of both sides cannot be uploaded to the ring. The two ring buses are mutually dependent, forming a resource loop waiting. Figure 2 This application provides an example of a three-ring interconnected loop deadlock scenario, in which three ring buses flow in the same direction to form a loop. The cross-ring flow control units on each ring bus fill the empty slots of the corresponding ring bus in sequence along the ring, so that the flow control units in the transmit buffer of each bridge port cannot enter the ring, forming a circular dependency with the beginning and end connected, and no ring bus can break through first.
[0023] Taking two opposing ring buses as an example, the flow control units of the first ring bus all send to the second ring bus, and the flow control units of the second ring bus all send to the first ring bus. The flow control units from the first ring bus to the second ring bus occupy all the empty slots on the first ring bus, preventing flow control units in the transmit buffer of the first ring bus bridge port from being injected into the first ring bus. Simultaneously, all the empty slots on the second ring bus are occupied by flow control units sent to the first ring bus, preventing flow control units in the transmit buffer of the second ring bus bridge port from being injected into the second ring bus. The flow control units of the first ring bus rely on the second ring bus to free up slots, and the flow control units of the second ring bus rely on the first ring bus to free up slots; both are mutually dependent, forming a resource loop of waiting.
[0024] Reference Figure 1 , Figure 1 The upper part is a diagram showing the flow control unit from the first ring bus to the second ring bus and the flow control unit from the second ring bus to the first ring bus. Figure 1 The lower left side is the first ring bus, and the right side is the second ring bus. The two ring buses are connected via a bridging port and an inter-die interconnect. Flow control units on the first ring bus send data to the second ring bus. The flow control units sent to the second ring bus fill all the empty slots on the first ring bus, preventing flow control units in the transmit buffer of the first ring bus's bridging port from being injected into the first ring bus. Similarly, flow control units on the second ring bus send data to the first ring bus. The flow control units sent to the first ring bus fill all the empty slots on the second ring bus, preventing flow control units in the transmit buffer of the second ring bus's bridging port from being injected into the second ring bus. The transmission of data from the first ring bus depends on the second ring bus freeing up slots, and the transmission of data from the second ring bus also depends on the first ring bus freeing up slots. Both are mutually dependent, creating a resource loop and resulting in a cross-ring hedging deadlock.
[0025] Reference Figure 2 , Figure 2 The upper part is a diagram showing the flow control unit from the first ring bus to the second ring bus, the flow control unit from the second ring bus to the third ring bus, the flow control unit from the third ring bus to the first ring bus, and the empty slots or cached empty entries. Figure 2 The lower section shows three ring buses. Flow control units on the first ring bus all send to the second ring bus, filling all empty slots on the first ring bus and preventing flow control units in the transmit buffer of the first ring bus bridge port from being injected into the first ring bus. Similarly, flow control units on the second ring bus all send to the third ring bus, filling all empty slots on the second ring bus and preventing flow control units in the transmit buffer of the second ring bus bridge port from being injected into the second ring bus. Likewise, flow control units on the third ring bus all send to the first ring bus, filling all empty slots on the third ring bus and preventing flow control units in the transmit buffer of the third ring bus bridge port from being injected into the third ring bus. The transmission of the first ring bus depends on the second ring bus freeing up slots, the transmission of the second ring bus depends on the third ring bus freeing up slots, and the transmission of the third ring bus in turn depends on the first ring bus freeing up slots, forming a circular dependency along the interconnect ring direction. No single ring bus can break through this dependency first, thus creating a deadlock.
[0026] In this embodiment, at least one special empty slot is reserved in each transmission direction of each ring bus, which can only be occupied by flow control units whose destination node is not a bridge port. This allows the special empty slot to be restored to an idle state within a limited time. The flow control units in the transmit buffer of the bridge port thus obtain the opportunity to join the ring, thereby resolving the deadlock without increasing the main path buffer of the ring station, without adding virtual channels, without requiring a complete reset, and without discarding flow control units.
[0027] For ease of understanding, some terms involved in the embodiments of this application will be explained below. Figure 3 An example of a ring bus topology provided in this application includes a single ring, a double ring, and a combination of a single ring and a double ring. Figure 4 This application provides an example of a ring station node structure.
[0028] A ring bus is a ring topology bus composed of multiple ring stops connected end-to-end via ring links. A ring stop (RS) is the basic node on a ring bus, used to connect devices and participate in the construction of the ring links. For example... Figure 4 As shown, a ring station node can include ports for connecting devices, ports for connecting ring links, and transmit and receive buffers. A flow control unit (Flit) is the smallest data unit on the interconnect bus, and its header carries a destination node identifier. An empty slot is a transmission medium on the ring bus used to temporarily store flow control units, which are passed forward frame by frame on the ring. A special empty slot is a slot marked in each transmission direction of the ring bus, which can only be occupied by flow control units whose destination node is not a bridge port. A flag bit is a marking information that flows with the empty slot on the ring bus to identify whether the current empty slot is a special empty slot; it can be represented by a single valid bit. A bridge port is a port on a ring station node used to connect inter-chip interconnect paths or directly connect to other on-chip networks. Cross-ring flow control units exit the ring at the ring station node where this port is located. The exit point is the ring station node through which the flow control unit leaves the current ring bus. The transmit buffer and receive buffer are storage structures set by the ring station node in the transmit and receive directions, used to temporarily buffer the flow control unit before it is put on the ring and after it is taken off the ring.
[0029] Reference Figure 4 , Figure 4 This is a schematic diagram illustrating an example of a ring station node structure provided in an embodiment of this application. Figure 4In this system, each ring station node includes an uplink port (UP), a downlink port (DOWN), a leftward port (LEFT), and a rightward port (RIGHT). The uplink and downlink ports are used to connect devices in the system, while the leftward and rightward ports are used to connect adjacent ring station nodes to form a loop. Each ring station node includes a transmit buffer (TxBuf), a receive buffer (RxBuf), a multiplexer (MUX), and a register (DFF). Flow control units sent by devices via the downlink port first enter the transmit buffer, are selected by the multiplexer, and then injected into the ring bus via the upper ring path (Inject path). When a flow control unit on the ring bus reaches its destination node, it enters the receive buffer via the lower ring path (Eject path) and then reaches the device via the downlink port. If a flow control unit on the ring bus reaches its destination node but the destination node cannot receive it in a given time, the flow control unit does not enter the receive buffer but continues to travel forward along the ring via the deflect path. Flow control units that have not reached their destination node are passed along the ring clockwise via the register, hopping forward one ring station node per transmission clockwise. Therefore, the ring station node adopts a bufferless structure. The main path is not buffered, and only the uplink and downlink ports are buffered for transmitting and receiving. The flow control unit is transmitted in registers on the main path.
[0030] In some embodiments, the multiple dies involved in this application can be integrated within the same chip or distributed across different chips, with the dies connected via inter-die interconnects. Each ring bus is located within its corresponding die and is bridged end-to-end with the inter-die interconnects via bridging ports, forming a bus interconnect ring. Figure 3 As shown, a three-ring interconnection ring is formed by combining single and double rings. Each of the three ring buses is bridged with the adjacent ring bus through two bridging ports. Each ring bus has a special slot in each transmission direction.
[0031] Reference Figure 3 , Figure 3 This is a schematic diagram illustrating an example of a ring bus topology provided in an embodiment of this application. From left to right, the diagram shows a single ring, a double ring, and a combination of a single ring and a double ring. Figure 3In the diagram, each ring node is identified by RS. The leftmost ring is a single ring, consisting of a single ring link. Multiple ring nodes are sequentially connected to this ring link to form a loop. Since there is only one ring link, the distance between the first and last nodes is the longest. A single ring is typically used as an on-chip network for input / output dies. The middle ring is a double ring, consisting of two independent ring links. Multiple ring nodes are sequentially connected to each ring link. The two ring links can transmit flow control units in parallel, doubling the bandwidth compared to a single ring. A double ring is typically used as an on-chip network for computing dies. The rightmost ring is a combination of single and double rings, consisting of a single ring link and a double ring link. The single and double ring parts communicate through inter-die interconnects, typically used as a combination of input / output dies and computing dies. In this embodiment, the bus interconnect ring can be formed by bridging three ring buses (single and double rings) at the beginning and end via bridging ports. Figure 3 This is only used to illustrate the topology of the ring bus and the positional relationship of special empty slots in the bus interconnection ring, and does not limit the number of ring buses, the number of ring station nodes, or the connection method of bridge ports.
[0032] In this embodiment, a bus interconnection ring is formed by bridging multiple ring buses end-to-end through bridging ports. Each ring bus consists of multiple ring station nodes connected end-to-end via ring links, and is located within the corresponding die. Each ring station node is equipped with a bridging port, which is used to connect inter-die interconnection paths or directly connect to other on-chip networks. The bridging ports of adjacent ring buses are connected via inter-die interconnection paths, bridging multiple ring buses end-to-end to form a ring topology, i.e., a bus interconnection ring.
[0033] In the Chiplet and multi-die architecture, the aforementioned ring buses can be configured within dies with different functions. For example, a ring bus can be used to connect the processor, cache, and memory controller within the Compute Die (CDIE), and a ring bus can be used to connect peripheral controllers within the I / O Die (IDIE). The ring buses of each die are bridged end-to-end with the die-to-die (D2D) interconnect via a bridging port, allowing cross-die access to be transmitted between the ring buses via the bridging port and the D2D interconnect. Thus, the flow control unit can either transmit within the ring along its own ring or exit the ring within the ring via the bridging port and enter the D2D interconnect before injecting into the adjacent ring bus, forming cross-ring access. After multiple ring buses are bridged end-to-end to form a ring, the flow control unit for cross-ring access needs to exit the ring within the same ring via the bridging port. This is the structural basis for the special empty slot used in this application embodiment to resolve cross-ring deadlock.
[0034] Optionally, the empty slots marked as special empty slots carry a flag indicating their valid status, which is transmitted forward on the ring bus frame by frame along with the empty slots. When the ring station node performs a ring-up judgment on the flow control unit, it reads the flag of the currently traversed empty slot, determines whether the current empty slot is a special empty slot based on the flag, and decides whether to allow the flow control unit to occupy the current empty slot by combining this flag with whether the destination node of the flow control unit is a bridge port.
[0035] The following is combined Figure 5 This application describes an on-chip network deadlock prevention method based on a special empty slot, as provided in an embodiment of the present application. The method is executed by the deadlock prevention device provided in this embodiment, which can be integrated into the flow control logic of each ring station node. The method includes steps 101 to 105.
[0036] Step 101: In each transmission direction of each of the ring buses, at least one empty slot used for temporary flow control units is marked as a special empty slot, and the flag bit identifying the special empty slot flows with the empty slot on the ring bus; the special empty slot allows flow control units of destination nodes that do not belong to the bridge port to occupy it.
[0037] Special empty slots are slots on the ring bus with access restrictions imposed, allowing only flow control units whose destination node is not a bridge port to occupy them. Special empty slots are set up in each transmission direction of the ring bus to reserve at least one slot in each direction that will not be occupied long-term by a flow control unit whose destination node is a bridge port, thus reserving an up-ring channel for flow control units in the bridge port's transmit buffer. Special empty slots are marked by setting flag bits, which move along the ring bus with the slots. This allows each ring station node to determine whether a slot is a special empty slot based solely on the flag bit carried by the currently passing slot, without needing to record the absolute position of the special empty slot. This avoids additional configuration for each ring station node when the position of a special empty slot changes.
[0038] In one embodiment, marking at least one empty slot for temporary flow control unit as a special empty slot includes: determining the position of the ring station node connected to the bridge port on the current ring bus; in the first transmission direction of the current ring bus, selecting an empty slot separated from the ring station node connected to the bridge port by a preset number of hops as a target empty slot, and marking the target empty slot as valid; in the second transmission direction of the current ring bus, determining a target empty slot according to the principle that it is opposite to the position of the special empty slot marked in the first transmission direction on the ring bus, and marking the target empty slot as valid, so that the bridge port in the first transmission direction and the bridge port in the second transmission direction have a uniform opportunity to join the ring in time, wherein the second transmission direction is opposite to the first transmission direction, and the preset number of hops is set according to the distribution of empty slots on the ring bus.
[0039] In this embodiment, the first transmission direction and the second transmission direction are two opposite transmission directions on the ring bus, for example, corresponding to clockwise and counterclockwise directions respectively. The position of the special empty slot can be determined based on the position of the ring station node that connects the bridge port: first, determine the position of the ring station node that connects the bridge port; then, select an empty slot in the first transmission direction that is separated from the ring station node by a preset number of hops as the target empty slot and set its flag; then, select an empty slot in the second transmission direction that is opposite to the special empty slot in the first transmission direction on the ring bus as the target empty slot and set its flag. By arranging the special empty slots in the two transmission directions opposite to each other, the opportunities for the bridge ports corresponding to the two transmission directions to join the ring are made more even in time, avoiding the bridge ports in one transmission direction from not having a chance to join the ring for a long time. The preset number of hops can be set according to the distribution of empty slots on the ring bus and does not constitute a limitation on the embodiment of this application.
[0040] In one embodiment, the step of causing the flag bit identifying the special empty slot to flow along with the empty slot on the ring bus includes: during the reset or initialization phase of the on-chip network, writing the position information of the special empty slot on the ring bus through a configuration register, or determining the position information according to a hardware-defined preset rule; based on the position information, before the ring bus starts transmitting the flow control unit, setting the flag bit of the empty slot at the corresponding position to valid; in each transmission cycle of the ring bus, causing the flag bit and the empty slot to be synchronously transmitted forward by one ring station node, and providing the flag bit to the currently passed ring station node as input for the ring station node to perform ring connection judgment; after the on-chip network is reset again, re-acquiring the position information and re-setting the flag bit of the empty slot at the corresponding position to valid, wherein the flag bit is represented by a single valid state.
[0041] In this embodiment, the generation, flow, and consumption of the flag bit form a complete link. The location information of the special empty slot can be written to the software configuration register during the reset or initialization phase of the on-chip network, or it can be determined according to a preset rule fixed in the hardware. Before the flow control unit starts transmitting on the ring bus, the flag bit of the empty slot at the corresponding position is set to valid based on the location information. In each transmission cycle, the flag bit and the empty slot are synchronously transmitted forward to one ring station node and provided to the currently passed ring station node as input for the ring station node to perform ring entry judgment. After the on-chip network is reset again, the location information is reacquired and the flag bit is reset. By making the flag bit flow with the empty slot, the ring station node only needs to read the flag bit when the empty slot passes to complete the judgment, without having to maintain the absolute location information of the special empty slot.
[0042] Step 102: Obtain the destination node identifier of the flow control unit to be connected to the ring. Based on the correspondence between the destination node identifier and each ring station node connected to the current ring bus, determine the next ring node of the flow control unit on the current ring bus. If the next ring node is the bridge port, determine the destination node of the flow control unit as the bridge port.
[0043] The destination node identifier is used to characterize the node that the flow control unit ultimately needs to reach. Before the flow control unit joins the ring, the ring station node obtains the destination node identifier of the flow control unit and determines the next ring point of the flow control unit on the current ring bus based on the correspondence between the destination node identifier and each ring station node connected to the current ring bus. The next ring point is the ring station node that the flow control unit passes through when leaving the current ring bus. When the destination node of the flow control unit is located within the same ring, the next ring point is the ring station node corresponding to the destination node. When the destination node of the flow control unit is located on another ring bus, the flow control unit needs to leave the ring via the bridging port of the current ring to enter the inter-die interconnect path. In this case, the next ring point is the bridging port, and the destination node of the flow control unit is thus determined to be the bridging port. Therefore, whether the destination node of the flow control unit is a bridging port can be determined before joining the ring by determining the next ring point.
[0044] In one embodiment, determining that the destination node of the flow control unit is a bridge port includes: parsing the message header of the flow control unit and obtaining the destination node identifier from the message header; comparing the destination node identifier with the range of node identifiers in the current ring bus; if the destination node identifier belongs to the range of node identifiers in the current ring, determining that the destination node of the flow control unit is a ring station node in the current ring, and the next node of the flow control unit on the current ring bus is a ring station node in the current ring; if the destination node identifier does not belong to the range of node identifiers in the current ring, determining that the flow control unit is a cross-ring flow control unit, determining the next node of the cross-ring flow control unit on the current ring bus as the bridge port, and determining that the destination node of the cross-ring flow control unit is a bridge port; wherein, the range of node identifiers in the current ring is composed of the node identifiers of each ring station node connected to the current ring bus.
[0045] In this embodiment, the destination node identifier can be obtained from the message header of the flow control unit. The range of this node identifier consists of the node identifiers of each ring station node connected to the current ring bus. The destination node identifier is compared with the range of this node identifier: when the destination node identifier belongs to the range of this node identifier, the destination node of the flow control unit is a ring station node within the current ring, and its next node is the ring station node corresponding to the destination node. In this case, the flow control unit does not need to transmit across rings; when the destination node identifier does not belong to the range of this node identifier, the flow control unit is a cross-ring flow control unit and needs to exit the ring via a bridging port on the current ring bus. Therefore, its next node is determined as the bridging port, and its destination node is determined as the bridging port. The above determination only requires comparing the destination node identifier with the range of this node identifier, providing a basis for the admission determination in the subsequent step 104.
[0046] Step 103: Read the flag bit of the empty slot passing through the loop station node where the flow control unit is located, and determine whether the current empty slot is the special empty slot based on the flag bit.
[0047] In this system, a flag bit flows along the ring bus with the empty slot. The ring station node reads the flag bit during the current cycle when the empty slot passes through its node. If the flag bit is valid, the current empty slot is determined to be a special empty slot. If the flag bit is invalid, the current empty slot is determined not to be a special empty slot. Therefore, the ring station node can determine whether the current empty slot is subject to special empty slot access restrictions before the flow control unit connects to the ring.
[0048] Step 104: If the current empty slot is the special empty slot and the destination node of the flow control unit is the bridge port, the flow control unit is prohibited from occupying the current empty slot, and the flow control unit waits in the transmission buffer until the empty slot passed is a non-special empty slot or the destination node is not the bridge port.
[0049] In step 104, an admission judgment is performed based on two results: whether the destination node of the flow control unit is a bridging port (obtained in step 102) and whether the current empty slot is a special empty slot (obtained in step 103). The flow control unit is prohibited from occupying the current empty slot only if both conditions are met: the current empty slot is a special empty slot and the destination node of the flow control unit is a bridging port. The flow control unit remains in the transmission buffer and continues to wait until the traversed empty slot is a non-special empty slot or the destination node is not a bridging port. Therefore, flow control units whose destination node is a bridging port cannot occupy special empty slots, and special empty slots are reserved for flow control units whose destination node is not a bridging port, as well as flow control units in the transmission buffer of bridging ports.
[0050] In one implementation, prohibiting the flow control unit from occupying the current empty slot includes: determining whether the ring station node where the flow control unit to be connected to the ring is located is a ring station node connected to the bridging port; if the ring station node is not a ring station node connected to the bridging port, performing a logical AND operation between the first condition that the current empty slot is the special empty slot and the second condition that the destination node of the flow control unit is the bridging port, and prohibiting the flow control unit from occupying the current special empty slot if both the first and second conditions are met; if the ring station node is a ring station node connected to the bridging port, not determining whether the current empty slot is the special empty slot, and allowing the flow control unit to occupy the current empty slot and connect to the ring if the current empty slot is in an idle state.
[0051] In this embodiment, the admission judgment distinguishes between the source nodes of the flow control units. For flow control units from non-bridge port ring station nodes, a logical AND operation is performed between the condition that the current empty slot is a special empty slot and the condition that the destination node is a bridge port. Occupancy of the current empty slot is prohibited only when both conditions are met. For flow control units from bridge port ring station nodes, since their destination node is a ring station node within the same ring, the condition that the destination node is a bridge port is not met. Therefore, in implementation, it is not necessary to judge whether the current empty slot is a special empty slot. Occupancy and ring entry are allowed when the current empty slot is idle. This is equivalent to flow control units sent by bridge port ring station nodes not being subject to special empty slot admission restrictions. The above judgment only adds flag comparison, destination node comparison, and a logical AND operation between the two, resulting in low hardware overhead and ease of implementation on existing flow control logic of unbuffered ring buses.
[0052] Step 105: When the special empty slot is in an idle state, inject the flow control unit in the transmit buffer of the bridge port into the special empty slot, so that the transmit buffer of the bridge port releases the idle table entry, and receives the cross-ring flow control unit forwarded by the adjacent ring bus through the bridge port through the idle table entry, thereby releasing the resource circular wait between each ring bus. The resource circular wait includes cross-ring offset deadlock and loop deadlock.
[0053] In this process, once a special empty slot returns to an idle state within a limited time, the flow control unit in the transmit buffer of the bridge port can occupy the special empty slot and move onto the ring. The transmit buffer then releases its idle entries, which are used to receive cross-ring flow control units forwarded by adjacent ring buses via the bridge port. After the receive buffers of adjacent ring buses release their idle entries, the cross-ring flow control units on those adjacent ring buses can move off the ring. Thus, the resource circular waiting between ring buses is gradually resolved, and all cross-ring flow control units eventually reach their respective destination nodes without requiring a complete reset or discarding flow control units.
[0054] In one implementation, the process of resolving resource loop waiting between ring buses includes: when all non-special empty slots on each ring bus are occupied by cross-ring flow control units, preventing the cross-ring flow control units from occupying special empty slots in the current ring due to the destination node being a bridge port of the current ring, thus keeping the special empty slots in the current ring idle or only carrying flow control units whose destination node is an inner ring station node of the current ring; wherein, the destination node of the flow control unit occupying the special empty slot in the current ring is located within the current ring, and it exits the ring within a limited number of cycles, allowing the special empty slot in the current ring to return to an idle state within a limited time; the special empty slot in the current ring carrying... After the flow control unit leaves the ring, the flow control unit at the head of the queue in the transmit buffer of the bridge port of this ring is injected into a special empty slot of this ring, so that the transmit buffer of the bridge port of this ring releases an idle entry; the cross-ring flow control unit forwarded by the bridge port of the adjacent ring bus is received through the idle entry, so that the receive buffer of the adjacent ring bus releases an idle entry, and the cross-ring flow control unit on the adjacent ring bus leaves the ring; along the bridging direction of the bus interconnect ring, the injection and reception are repeated for each ring bus until the cross-ring flow control unit on each ring bus reaches its respective destination node.
[0055] In this embodiment, when all non-special empty slots on each ring bus are occupied by cross-ring flow control units, since the destination node of the cross-ring flow control unit is the bridge port of this ring, it cannot occupy the special empty slots of this ring. The special empty slots of this ring remain idle or only carry flow control units whose destination node is an inner ring station node of this ring. After the flow control unit carried by the special empty slot of this ring leaves the ring, the flow control unit at the head of the queue in the transmit buffer of the bridge port of this ring is injected into the special empty slot of this ring, and the transmit buffer of the bridge port of this ring releases the idle entries. Cross-ring flow control units forwarded by the bridge port of the adjacent ring bus are received through the idle entries, the receive buffer of the adjacent ring bus releases the idle entries, and the cross-ring flow control units on the adjacent ring bus leave the ring. The above injection and reception are repeated for each ring bus along the bridging direction of the bus interconnection ring until the cross-ring flow control units on each ring bus reach their respective destination nodes. Thus, Figure 1 The cross-loop hedging deadlock shown Figure 2 The loop deadlocks shown were broken segment by segment, and all flow control units reached their respective destination nodes within a finite time.
[0056] In one implementation, after determining that the destination node of the flow control unit is the bridge port when the next node is the bridge port, the method further includes: counting the waiting times of the flow control unit in the transmit buffer of the bridge port, and the proportion of empty slots occupied by the cross-ring flow control unit in the current transmission direction of the current ring bus. If the waiting times are greater than a first threshold or the proportion of empty slots is greater than a second threshold, the number of empty slots marked as special empty slots in the current transmission direction is increased. If the waiting times are less than a third threshold and the proportion of empty slots is less than a fourth threshold, the number of empty slots marked as special empty slots in the current transmission direction is decreased, ensuring that the number of empty slots marked as special empty slots in the current transmission direction is not less than one. The flag bit of the corresponding empty slot is updated according to the adjusted number of empty slots.
[0057] The waiting time reflects the waiting duration of the flow control unit in the transmit buffer of the bridge port, and the empty slot ratio reflects the degree of occupancy of empty slots in the current transmission direction by the cross-ring flow control unit. When the waiting time exceeds the first threshold or the empty slot ratio exceeds the second threshold, it indicates that the cross-ring flow control unit is continuously accumulating on the ring bus. In this case, increasing the number of special empty slots in the current transmission direction provides more opportunities for the flow control unit in the transmit buffer of the bridge port to join the ring, accelerating the release of resource loop waiting between different ring buses. When the waiting time is less than the third threshold and the empty slot ratio is less than the fourth threshold, it indicates that there are few cross-ring flow control units. In this case, reducing the number of special empty slots in the current transmission direction restores more empty slots to ordinary empty slots for cross-ring flow control units to occupy, reducing the impact on normal transmission. The adjusted number of special empty slots is not less than one, ensuring that at least one special empty slot is always reserved in each transmission direction to maintain deadlock prevention capability. The first, second, third, and fourth thresholds can be set according to the size and load of the ring bus, and are only used for illustrative purposes and do not constitute a limitation on the embodiments of this application.
[0058] In one embodiment, the bus interconnect ring is formed by bridging three ring buses end-to-end through three bridging ports, with two bridging ports connected to each ring bus. Determining the destination node of the flow control unit as a bridging port includes: determining the number of bridging ports currently connected to the ring bus and the ring station node where each bridging port is located. If the next node of the flow control unit is either of the two bridging ports, the destination node of the flow control unit is determined to be a bridging port, and the flow control unit is prohibited from occupying special empty slots on the current ring bus.
[0059] The three ring buses are connected end-to-end via three bridging ports to form a bus interconnection loop. Each ring bus has two bridging ports, which are used to bridge the two adjacent ring buses respectively. Figure 2 Taking the loop deadlock scenario shown as an example, when three ring buses flow in the same direction, the cross-ring flow control units on each ring bus sequentially fill the empty slots of the corresponding ring bus, forming a circular dependency with the beginning and end connected. First, determine the number of bridge ports connected to the current ring bus and the ring station node where each bridge port is located. If the next node of the flow control unit is either of the two bridge ports, determine that the destination node of the flow control unit is the bridge port, and prohibit the flow control unit from occupying the special empty slots on the current ring bus. This ensures that special empty slots for flow control units in the transmit buffer of the bridge port are reserved in each transmission direction of the three ring buses. Injection and reception are repeatedly performed on each ring bus along the bridging direction of the bus interconnection ring, and the loop deadlock can be resolved segment by segment. The above topology of the three ring buses is only for illustrative purposes and does not constitute a limitation on the embodiments of this application.
[0060] Reference Figure 6 , Figure 6 This is a flowchart illustrating another on-chip network deadlock prevention method based on special empty slots provided in this application embodiment. Taking a dual-ring offset scenario as an example, the process of ensuring normal mutual access between the two rings by special empty slots is shown in chronological order. Figure 6 The upper part is a diagram showing the flow control unit from the first ring bus to the second ring bus, the flow control unit from the second ring bus to the first ring bus, the flow control unit of this ring, the empty slots or cached empty entries, and special empty slots. Figure 6 The middle section shows six scenarios in chronological order. In Scenario 1, the two rings begin to offset each other, and the special empty slot cannot be used by the cross-ring flow control unit whose destination node is not a bridge port, thus the special empty slot is reserved. In Scenario 2, the local ring flow control unit Flit A joins the ring, while the cross-ring flow control unit Flit 1 cannot join the ring because the empty slot it passes through already has a flow control unit, and remains in the transmission buffer waiting. In Scenario 3, the cross-ring flow control unit Flit B performs cross-ring transmission. The destination node of the flow control unit Flit X, which occupies the special empty slot, is a ring station node of the second ring bus, so it will definitely be able to leave the ring within a limited time, allowing the special empty slot to become idle again within a limited time. In Scenario 4, after the special empty slot is emptied, the cross-ring flow control unit Flit 1 joins the ring. In Scenario 5, the cross-ring flow control unit Flit 2 performs cross-ring transmission. In Scenario 6, the destination node of the flow control unit occupying the special empty slot is a node within the local ring, and it will leave the ring within a limited time, thus ensuring normal communication between the two rings. Figure 6 The process shown is the same as Figure 5 The process shown corresponds to the one described. Figure 5 It focuses on the execution order of method steps. Figure 6 The focus is on the specific process of gradually emptying special slots and releasing deadlock in a double-ring hedging scenario.
[0061] The above describes the on-chip network anti-deadlock method based on special empty slots provided in the embodiments of this application. The following describes the apparatus for performing the above method.
[0062] This application also provides an on-chip network anti-deadlock device based on a special empty slot. This device is applied to a bus interconnection ring formed by bridging multiple ring buses end-to-end via bridging ports. The device can be integrated into the flow control logic of each ring station node. The device includes a marking module, a determination module, an identification module, and an injection control module.
[0063] A marking module is configured to mark at least one empty slot for temporary flow control units as a special empty slot in each transmission direction of each of the ring buses, and to cause a flag bit identifying the special empty slot to flow along with the empty slot on the ring bus; the special empty slot allows flow control units of destination nodes that do not belong to the bridge port to occupy it.
[0064] The determination module is used to obtain the destination node identifier of the flow control unit to be connected to the ring, determine the next node of the flow control unit on the current ring bus according to the correspondence between the destination node identifier and each ring station node connected to the current ring bus, and determine the destination node of the flow control unit as the bridge port if the next node is the bridge port.
[0065] The identification module is used to read the flag bit of the empty slot passing through the loop station node where the flow control unit is located, and determine whether the current empty slot is the special empty slot based on the flag bit.
[0066] The injection control module is used to prevent the flow control unit from occupying the current empty slot and to make the flow control unit wait in the transmit buffer when the current empty slot is the special empty slot and the destination node of the flow control unit is the bridge port; and when the special empty slot is in an idle state, to inject the flow control unit in the transmit buffer of the bridge port into the special empty slot, so that the transmit buffer of the bridge port releases the idle table entry, and receives the cross-ring flow control unit forwarded by the bridge port through the adjacent ring bus through the idle table entry, thereby releasing the resource circular wait between each ring bus, the resource circular wait including cross-ring offset deadlock and loop deadlock.
[0067] In some implementations, the determining module is specifically used for: parsing the message header of the flow control unit and obtaining the destination node identifier from the message header; comparing the destination node identifier with the range of node identifiers in the current ring bus; if the destination node identifier belongs to the range of node identifiers in the current ring, determining that the destination node of the flow control unit is a ring station node in the current ring, and the next node of the flow control unit on the current ring bus is a ring station node in the current ring; if the destination node identifier does not belong to the range of node identifiers in the current ring, determining that the flow control unit is a cross-ring flow control unit, determining the next node of the cross-ring flow control unit on the current ring bus as the bridging port, and determining that the destination node of the cross-ring flow control unit is the bridging port. The above processing can be implemented with reference to the aforementioned step 102.
[0068] In some implementations, the injection control module is specifically used to: determine whether the loop station node where the flow control unit to be looped is located is a loop station node connected to the bridging port; if the loop station node is not a loop station node connected to the bridging port, perform a logical AND operation between the first condition that the current empty slot is the special empty slot and the second condition that the destination node of the flow control unit is the bridging port, and prohibit the flow control unit from occupying the current special empty slot if both the first and second conditions are met; if the loop station node is a loop station node connected to the bridging port, do not determine whether the current empty slot is the special empty slot, and allow the flow control unit to occupy the current empty slot and loop if the current empty slot is in an idle state. The above processing can be implemented with reference to the aforementioned step 104.
[0069] In some implementations, the marking module is specifically used for: determining the position of the ring station node connected to the bridge port on the current ring bus; selecting an empty slot separated from the ring station node connected to the bridge port by a preset number of hops as the target empty slot in the first transmission direction of the current ring bus, and marking the target empty slot as valid; determining the target empty slot in the second transmission direction of the current ring bus according to the principle that it is opposite to the position of the special empty slot marked in the first transmission direction on the ring bus, and marking the target empty slot as valid. The above processing can be implemented with reference to the aforementioned step 101.
[0070] In some implementations, the marking module is specifically used for: during the reset or initialization phase of the on-chip network, writing the position information of the special empty slot on the ring bus through a configuration register, or determining the position information according to a hardware-defined preset rule; based on the position information, before the ring bus begins transmitting the flow control unit, setting the flag of the empty slot at the corresponding position to valid; and in each transmission cycle of the ring bus, synchronously transmitting the flag bit and the empty slot forward by one ring station node, and providing the flag bit to the currently passed ring station node as input for the ring station node to perform ring connection judgment. The above processing can be implemented with reference to the aforementioned step 101.
[0071] In some embodiments, the injection control module is further configured to: when all non-special empty slots on each of the ring buses are occupied by cross-ring flow control units, prevent the cross-ring flow control units from occupying special empty slots in the ring because their destination node is a bridge port of the ring; wherein, the destination node of the flow control unit occupying the special empty slot in the ring is located within the ring, and it goes off the ring within a limited number of cycles, so that the special empty slot in the ring is restored to an idle state within a limited time; after the flow control unit carried by the special empty slot in the ring goes off the ring, inject the flow control unit at the head of the queue in the transmit buffer of the bridge port of the ring into the special empty slot of the ring; receive cross-ring flow control units forwarded by adjacent ring buses through the bridge port through the idle entry; and repeat the injection and reception along the bridging direction of the bus interconnection ring, one ring bus at a time, until all cross-ring flow control units on each ring bus reach their respective destination nodes. The above processing can be implemented with reference to the aforementioned step 105.
[0072] The marking module, determining module, identifying module, and injection control module can be implemented in hardware or by executing corresponding software within hardware. These modules can be integrated into the flow control logic of the ring station node. For example, the marking module can be implemented using a configuration register and a flag generation circuit; the determining module can be implemented using a destination node identifier parsing circuit and a local node identifier range comparison circuit; the identifying module can be implemented using a flag reading circuit; and the injection control module can be implemented using a comparison circuit and logic gates. The specific working process of these modules can be referred to the corresponding steps in the foregoing method embodiments, and will not be repeated here.
[0073] This application embodiment also provides a chip, which includes multiple ring buses, multiple ring station nodes disposed on each of the ring buses, and bridging ports bridging the beginning and end of adjacent ring buses. The multiple ring buses form a bus interconnection ring through the bridging ports. Each ring bus has at least one empty slot marked as a special empty slot in each transmission direction. A flag bit identifying the special empty slot flows along the empty slot on the ring bus. The ring station node is used to prevent the flow control unit from occupying the current empty slot when the currently traversed empty slot is the special empty slot and the destination node of the flow control unit to be connected to the ring is the bridging port, so that the special empty slot remains available for the flow control unit in the transmit buffer of the bridging port to occupy. The chip is used to execute the technical solution provided in the foregoing method embodiment. The flow control logic of the ring station node in the chip can be implemented using the foregoing comparison circuit, logic gate circuit, and configuration register.
[0074] This application also provides a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the on-chip network deadlock prevention method based on a special empty slot as described in the foregoing method embodiments. The computing device can be used to carry out a configuration process of writing the location information of the special empty slot through a configuration register.
[0075] This application also provides a computer-readable storage medium including instructions that, when executed on a computing device, cause the computing device to perform the on-chip network deadlock prevention method based on a special empty slot as described in the foregoing method embodiments.
[0076] This application also provides a chip system comprising multiple chip nodes and inter-die interconnects connecting each chip node. Each chip node includes a die or a chip. A ring bus within each chip node is bridged end-to-end through the inter-die interconnects via bridging ports to form a bus interconnect ring, used to implement the functions involved in the aforementioned method embodiments, such as marking the special empty slot and controlling the flow control unit to join the ring. In one possible design, the chip system further includes a configuration register, which is connected to the flow control logic of the ring bus via a circuit structure, used to store the position information of the special empty slot on the ring bus.
[0077] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, and the division of modules is only a logical functional division. In actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. The integrated modules described above can be implemented in hardware or as software functional modules.
[0078] The technical solutions provided in the embodiments of this application have been described in detail above. Specific examples have been used in the embodiments of this application to illustrate the principles and implementation methods of the embodiments of this application. The description of the above embodiments is only for the purpose of helping to understand the methods and core ideas of the embodiments of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the embodiments of this application. Therefore, the content of this specification should not be construed as a limitation on the embodiments of this application.
Claims
1. A method for preventing deadlock in on-chip networks based on special empty slots, characterized in that, The method is applied to a bus interconnection ring formed by bridging multiple ring buses end-to-end through bridging ports. The method includes: In each transmission direction of each of the aforementioned ring buses, at least one empty slot used for temporary flow control units is marked as a special empty slot, such that the flag bit identifying the special empty slot flows with the empty slot on the ring bus; the special empty slot allows flow control units of destination nodes that do not belong to the bridge port to occupy it; Obtain the destination node identifier of the flow control unit to be connected to the ring. Based on the correspondence between the destination node identifier and each ring station node connected to the current ring bus, determine the next node of the flow control unit on the current ring bus. If the next node is the bridge port, determine the destination node of the flow control unit as the bridge port. Read the flag bit of the empty slot that passes through the loop station node where the flow control unit is located, and determine whether the current empty slot is the special empty slot based on the flag bit; If the current empty slot is the special empty slot and the destination node of the flow control unit is the bridge port, the flow control unit is prohibited from occupying the current empty slot, and the flow control unit waits in the transmission buffer until the empty slot passed is a non-special empty slot or the destination node is not the bridge port. When the special empty slot is in an idle state, the flow control unit in the transmit buffer of the bridge port is injected into the special empty slot, so that the transmit buffer of the bridge port releases the idle table entry, and receives the cross-ring flow control unit forwarded by the adjacent ring bus through the bridge port through the idle table entry, thereby releasing the resource circular wait between each ring bus. The resource circular wait includes cross-ring offset deadlock and loop deadlock.
2. The method according to claim 1, characterized in that, The step of determining the destination node of the flow control unit as a bridge port includes: Parse the message header of the flow control unit and obtain the destination node identifier from the message header; Compare the destination node identifier with the range of node identifiers in the current ring bus; If the destination node identifier belongs to the range of the current node identifier, the destination node of the flow control unit is determined to be a ring station node within the current ring, and the next node of the flow control unit on the current ring bus is a ring station node within the current ring. If the destination node identifier does not fall within the range of the current node identifier, the flow control unit is determined to be a cross-ring flow control unit, the next node of the cross-ring flow control unit on the current ring bus is determined to be the bridge port, and the destination node of the cross-ring flow control unit is determined to be the bridge port; wherein, the range of the current node identifier is composed of the node identifiers of each ring station node connected to the current ring bus.
3. The method according to claim 1, characterized in that, The prohibition of the flow control unit from occupying the currently empty slot includes: Determine whether the loop station node where the flow control unit to be looped is located is a loop station node connected to the bridge port; If the loop station node is not a loop station node connected to the bridge port, perform a logical AND operation between the first condition that the current empty slot is the special empty slot and the second condition that the destination node of the flow control unit is the bridge port. If both the first and second conditions are met, the flow control unit is prohibited from occupying the current special empty slot. When the loop station node is a loop station node connected to the bridge port, it is not determined whether the current empty slot is the special empty slot. When the current empty slot is in an idle state, the flow control unit is allowed to occupy the current empty slot and connect to the loop.
4. The method according to claim 1, characterized in that, The step of marking at least one empty slot used for temporary storage of flow control units as a special empty slot includes: Determine the location of the ring station node currently connected to the bridge port on the ring bus; In the first transmission direction of the current ring bus, select an empty slot that is a preset number of hops away from the ring station node connected to the bridge port as the target empty slot, and mark the target empty slot as valid; In the second transmission direction of the current ring bus, a target empty slot is determined according to the principle that it is opposite to the position of the special empty slot marked in the first transmission direction on the ring bus, and the mark position of the target empty slot is set to be valid, so that the bridging port of the first transmission direction and the bridging port of the second transmission direction have a uniform loop-on opportunity in time, wherein the second transmission direction is opposite to the first transmission direction, and the preset number of hops is set according to the distribution of empty slots on the ring bus.
5. The method according to claim 1, characterized in that, The step of causing the flag bit identifying the special empty slot to flow along with the empty slot on the ring bus includes: During the reset or initialization phase of the on-chip network, the position information of the special empty slot on the ring bus is written through the configuration register, or the position information is determined according to the preset rules fixed in the hardware. Based on the location information, before the flow control unit begins to transmit on the ring bus, the flag position of the empty slot at the corresponding location is set to valid; In each transmission cycle of the ring bus, the flag bit is synchronously transmitted forward to one ring station node along with the empty slot, and the flag bit is provided to the currently passed ring station node as input for the ring station node to perform ring connection judgment; After the on-chip network is reset again, the position information is reacquired and the flag of the empty slot at the corresponding position is reactivated. The flag is represented by a single valid bit.
6. The method according to claim 1, characterized in that, The process of resolving resource circular waits between ring buses includes: When all non-special empty slots on each of the aforementioned ring buses are occupied by cross-ring flow control units, the cross-ring flow control units are prevented from occupying special empty slots in the same ring because their destination node is a bridge port of the same ring. This keeps the special empty slots in the same ring idle or only carries flow control units whose destination node is a ring station node within the same ring. Wherein, the destination node of the flow control unit occupying the special empty slot in the same ring is located within the same ring, and it goes off the ring within a limited number of cycles, so that the special empty slot in the same ring is restored to an idle state within a limited time. After the flow control unit carried by the special empty slot of this ring is removed from the ring, the flow control unit at the head of the queue in the transmit buffer of the bridge port of this ring is injected into the special empty slot of this ring, so that the transmit buffer of the bridge port of this ring releases the idle entries. The idle entry is received by the cross-ring flow control unit forwarded by the adjacent ring bus through the bridge port, so that the receive buffer of the adjacent ring bus releases the idle entry and the cross-ring flow control unit on the adjacent ring bus goes off the ring. Along the bridging direction of the bus interconnection ring, the injection and reception are repeated for each of the ring buses until the cross-ring flow control units on each of the ring buses reach their respective destination nodes.
7. The method according to claim 1, characterized in that, When the downstream node is the bridging port, after determining that the destination node of the flow control unit is the bridging port, the method further includes: The number of waiting times of the flow control unit in the transmit buffer of the bridge port, and the proportion of empty slots occupied by the cross-ring flow control unit in the current transmission direction of the current ring bus are counted. If the number of waiting times is greater than the first threshold or the empty slot ratio is greater than the second threshold, increase the number of empty slots marked as special empty slots in the current transmission direction; When the number of waiting times is less than the third threshold and the empty slot ratio is less than the fourth threshold, the number of empty slots marked as special empty slots in the current transmission direction is reduced, and the number of empty slots marked as special empty slots in the current transmission direction is not less than one. Update the flag of the corresponding empty slot according to the adjusted number of empty slots.
8. The method according to claim 1, characterized in that, The bus interconnection ring is formed by bridging three ring buses end to end through three bridge ports, with two bridge ports connected to each ring bus; The step of determining the destination node of the flow control unit as a bridge port includes: Determine the number of bridge ports currently connected to the ring bus and the ring station node where each bridge port is located; If the next node of the flow control unit is either of the two bridging ports, the destination node of the flow control unit is determined to be the bridging port, and the flow control unit is prohibited from occupying the special empty slot on the current ring bus.
9. A deadlock prevention device for on-chip networks based on a special slot, characterized in that, The device is applied to a bus interconnection ring formed by bridging multiple ring buses end-to-end through a bridging port. The device includes: A marking module is used to mark at least one empty slot for temporary flow control units as a special empty slot in each transmission direction of each of the ring buses, and to make a flag bit identifying the special empty slot flow with the empty slot on the ring bus; the special empty slot allows the destination node to be occupied by a flow control unit that does not belong to the bridge port. The determination module is used to obtain the destination node identifier of the flow control unit to be connected to the ring, and determine the next node of the flow control unit on the current ring bus according to the correspondence between the destination node identifier and each ring station node connected to the current ring bus. If the next node is the bridge port, the destination node of the flow control unit is determined to be the bridge port. The identification module is used to read the flag bit of the empty slot passing through the loop station node where the flow control unit is located, and determine whether the current empty slot is the special empty slot based on the flag bit; The injection control module is used to prevent the flow control unit from occupying the current empty slot and to make the flow control unit wait in the transmit buffer when the current empty slot is the special empty slot and the destination node of the flow control unit is the bridge port; and when the special empty slot is in an idle state, to inject the flow control unit in the transmit buffer of the bridge port into the special empty slot, so that the transmit buffer of the bridge port releases the idle table entry, and receives the cross-ring flow control unit forwarded by the bridge port through the adjacent ring bus through the idle table entry, thereby releasing the resource circular wait between each ring bus, the resource circular wait including cross-ring offset deadlock and loop deadlock.
10. A chip, characterized in that, It includes multiple ring buses, multiple ring station nodes set on each of the ring buses, and bridging ports that bridge the beginning and end of adjacent ring buses, wherein the multiple ring buses form a bus interconnection ring through the bridging ports; Each of the aforementioned ring buses has at least one slot marked as a special slot in each transmission direction, and the flag bit identifying the special slot flows along the slot on the ring bus. The loop node is used to prevent the flow control unit from occupying the current empty slot when the currently traversed empty slot is the special empty slot and the destination node of the flow control unit to be looped is the bridge port, so that the special empty slot remains available for the flow control unit in the transmission buffer of the bridge port to occupy. The chip is configured to perform the method of any one of claims 1 to 8.
