A network-on-chip credit starvation control device
By introducing a credit hunger control device into the on-chip network, the starvation problem of source nodes due to lack of credit under the dynamic credit mechanism is solved, efficient and fair message transmission is achieved, hardware overhead and implementation difficulty are reduced, and it has good adaptability and scalability.
Patent Information
- Application Number
- CN202111437511.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-11-24
- Filing Date
- 2021-11-30
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-11-30
AI Technical Summary
In an on-chip network, during message transmission based on a dynamic credit mechanism, the source node may suffer from starvation problems due to lack of credit, resulting in reduced network transmission efficiency and performance problems.
Design a credit starvation control device, including a credit starvation sorting device and a credit starvation delivery device. The sorting device sorts the source nodes according to the time sequence of credit loss, and delivers message packets through the delivery device to ensure that the source nodes with high priority are obtained first. The credit of the target node.
It effectively avoids the credit starvation problem, improves transmission efficiency, is fair, reduces hardware overhead and physical implementation difficulty, and has good adaptability and scalability.
Smart Images

Figure CN114185841B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network on chip, and in particular to a network on chip credit starvation control device. Background Art
[0002] With the advancement of semiconductor technology and the continuous improvement of System On Chip (SoC) technology, the number of processor cores, on-chip caches, storage controllers and various I / O interfaces integrated on a single chip is increasing. The design complexity of the Network On Chip (NoC) connecting these modules is increasing, and new challenges are faced in many aspects such as correctness verification, back-end physical implementation and frequency improvement.
[0003] The design of NoC includes several aspects such as topology, routing algorithm, quality of service and congestion control. Since NoC is implemented on a chip, it is limited by area and power consumption. When implementing it, we should try to choose a simple and efficient topology and routing algorithm while meeting performance requirements, and consider issues such as quality of service and congestion control on this basis.
[0004] Among them, the routing algorithm is crucial to correctness and must meet the following requirements when designing:
[0005] 1) The routing algorithm must be able to correctly send the message to the destination, that is, the algorithm must be free of deadlock and livelock;
[0006] 2) The routing algorithm should treat all nodes in the NoC fairly to prevent starvation.
[0007] The routing algorithm of NoC generally chooses deterministic routing, which is implemented by querying the routing table or setting a finite state machine. The routing algorithm provides a unique message transmission path between a given source and target node, and it is usually the shortest path. In NoC, the delay of message transmission is critical to the performance of the chip, and a non-blocking transmission mechanism is usually used. A simple and easy dynamic credit transmission mechanism is as follows:
[0008] 1) Using the source routing mechanism, each node formulates a routing table according to the shortest path algorithm, clearly indicating which intermediate nodes a message needs to pass through from the source node to the target node, and determining the transmission step distance.
[0009] 2) Each node in the on-chip network can be a source node, an intermediate node, or a target node. As a source node, it can send messages to other nodes, which is equivalent to inserting new messages into the on-chip network (referred to as inserting messages); as a target node, it needs to land and process messages, which is equivalent to deleting existing messages from the on-chip network (referred to as landing messages); as an intermediate node, it needs to transmit messages according to a fixed routing algorithm, which is equivalent to forwarding existing messages in the on-chip network (referred to as forwarding messages).
[0010] 3) Each node in the on-chip network has two buffers: a landing buffer and a forwarding buffer. The landing buffer is used to temporarily store messages that need to be landed and processed at the node, and the forwarding buffer is used to temporarily store messages that need to be forwarded at the node and the inserted messages that the node is about to send. Generally speaking, there are multiple landing buffers, but only one forwarding buffer.
[0011] 4) Each node in the on-chip network must ensure that forwarding messages have absolute priority over inserting messages: Since forwarding messages and inserting messages share the forwarding buffer, in order to ensure unblocked transmission in the network, forwarding messages received from other nodes must absolutely take precedence over inserting messages that this node is about to send to enter the forwarding buffer.
[0012] 5) Each node in the on-chip network must ensure that the landing message can definitely land: As the target node, in order to ensure unblocked transmission in the network, the landing message must be able to enter the landing buffer unconditionally. Before sending an insert message, the source node must ensure that there are free entries in the landing buffer of the target node to accept the message. To this end, a credit mechanism is adopted to inform the source node of the number of free entries in the landing buffer of the target node as credit. The source node must have the credit of the target node to send the message to the on-chip network.
[0013] 6) When multiple source nodes in the on-chip network send messages to the same target node, all messages need to share the landing buffer of the target node: In order to improve the resource utilization of the buffer, a dynamic credit mechanism is usually used for transmission management. Initially, all source nodes that share the same target node landing buffer each have a certain number of credits, and the sum of the credits on all source nodes and the credits being transmitted is equal to the number of entries in the target node landing buffer. In order to ensure the fairness of transmission, the initial number of credits owned by each source node is basically the same. After the on-chip network starts running, each time a source node sends a message to a target node, it occupies one credit; each time the target node reads and processes a message from the landing buffer, it releases one credit. The credits released by the target node must be notified to the source node through an independent network. After the message transmission in the on-chip network is completely completed, the landing buffer of the target node must be empty, and the sum of the credits on all source nodes and the credits being transmitted remains unchanged, and is still equal to the number of entries in the target node landing buffer.
[0014] In a network-on-chip that uses a dynamic credit mechanism for transmission, it is extremely important to distribute the credit of the target node to each source node relatively fairly. Once the distribution is uneven, it may lead to a decrease in network transmission efficiency and cause serious performance problems. In extreme cases, some source nodes may starve to death due to the inability to obtain credit. Summary of the invention
[0015] The technical problem to be solved by the present invention is to provide a credit starvation control device, which can completely solve the starvation problem that a source node may be unable to send messages due to lack of credit in an on-chip network that transmits messages based on a dynamic credit mechanism.
[0016] The technical solution adopted by the present invention to solve its technical problem is: to provide an on-chip network credit starvation control device, including multiple credit starvation sorting devices and a credit starvation transmission device; the credit starvation sorting device is set on each node in the on-chip network, and the credit starvation transmission device is used to connect the credit starvation sorting devices on all nodes together; when one or more source nodes on the on-chip network cannot transmit messages to the same target node due to lack of credit, the credit starvation sorting device will sort these source nodes approximately in the order of the time of credit loss and transmit them through the credit starvation transmission device, so that the source node with a high priority will obtain the credit of the target node first.
[0017] The credit starvation transmission device includes multiple starvation message packets and a ring-shaped starvation message network; the starvation message packets are cyclically transmitted on the starvation message network, and the credit starvation sorting device on each node broadcasts the status of the node to other nodes through the starvation message packets, and also obtains the status of other nodes through the starvation message packets.
[0018] The starvation message packet defines four fields, namely: valid bit, credit starvation mark bit, credit starvation source node number and credit starvation target node number; when the valid bit is "1" and the credit starvation mark bit is "0", it indicates that it is a markable starvation message packet; when the valid bit is "1" and the credit starvation mark bit is "1", it indicates that it is a marked starvation message packet.
[0019] The hunger message network adopts a unidirectional ring network structure, and its total number of nodes is the same as the total number of nodes of the message network; the number of hunger message packets is less than or equal to the total number of nodes of the message network; initially, all the hunger message packets have a valid bit of "1" and a credit hunger mark bit of "0", and transmission starts at different nodes.
[0020] The credit starvation sorting device includes a sorting state machine and a sorting node number, the sorting node number is bound to the sorting state machine, and the sorting state machine includes three states, namely: normal transmission, credit deficiency, and credit starvation; when the sorting state machine is in the normal transmission state, it means that the node has all target node credits and can send messages to any target node; when the sorting state machine is in the credit deficiency state, it means that the node has a message to send to the node corresponding to the sorting node number, but currently has no credit and needs to wait for other nodes to obtain credit first; when the sorting state machine is in the credit starvation state, it means that the node has a message to send to the node corresponding to the sorting node number, but currently has no credit, but has the right to obtain credit first.
[0021] The credit starvation sorting device also includes multiple state identification counters, and the number of state identification counters corresponds one-to-one to the target nodes; for the state identification counter corresponding to the target node k, the value "1" indicates that one or more other nodes have the priority to obtain the credit of the target node k; initially, all state identification counters have the value "0", and a saturation minus one operation is performed in each clock cycle thereafter.
[0022] The sorting state machine performs state transitions according to the following conditions:
[0023] For a certain source node j, when its sorting state machine is in a normal transmission state: if it has the credit of all target nodes, the sorting state machine maintains a normal transmission state; if there is no credit of the target node k and the state identification counter value of the corresponding node k is not "0", or there is no credit of the target node k and the state identification counter value of the corresponding node k is "0" and there is no marked hunger message packet landing on the hunger message network, then the sorting state machine enters a credit missing state and sets the sorting node number to k; if there is no credit of the target node k and the state identification counter value of the corresponding node k is "0" and there is a markable hunger message packet on the hunger message network, then the sorting state machine enters a credit starvation state, sets the sorting node number to k, sets the valid bit of the hunger message packet to "1", sets the credit hunger mark bit to "1", the hunger source node number to j, and the hunger target node number to k;
[0024] For a certain source node j, when its sorting state machine is in a credit-deficient state and the sorting node number is k: if the state identification counter value of the corresponding target node k is "0" and the credit of the target node k is received, the sorting state machine enters a normal transmission state; if the state identification counter value of the corresponding target node k is not "0", or the state identification counter value of the corresponding target node k is "0" and the credit of the target node k is not received and there is no starvation message packet that can be marked on the starvation message network, the sorting state machine maintains a credit-deficient state; if the state identification counter value of the corresponding target node k is "0" and the credit of the target node k is not received and there is a starvation message packet that can be marked on the starvation message network, the sorting state machine enters a credit-starved state, sets the valid bit of the starvation message packet to "1", sets the credit starvation mark bit to "1", the starvation source node number is j, and the starvation target node number is k;
[0025] For a certain source node j, when its sorting state machine is in a credit starvation state and the sorting node number is k: if the credit of the target node k is received, the sorting state machine enters a normal transmission state; otherwise, it continues to maintain a credit starvation state.
[0026] The principle of whether the credit starvation sorting device can obtain the target node credit is as follows:
[0027] If the credit of the target node h is received, the sorting state machine is in the normal transmission state or the sorting state machine is in the credit missing state, if the state identification counter value corresponding to the target node h is "0", the credit can be obtained; if the state identification counter value corresponding to the target node h is not "0", the credit cannot be obtained;
[0028] If the credit of the target node h is received, the sorting state machine is in a credit starvation state and the sorting node number is k. If k is equal to h, the credit can be obtained; if k is not equal to h and the state identification counter value corresponding to the target node h is "0", the credit can be obtained; if k is not equal to h and the state identification counter value corresponding to the target node h is not "0", the credit cannot be obtained.
[0029] The principle of the credit starvation sorting device processing the starvation message packet is as follows:
[0030] When the sorting state machine is in a normal transmission state or a credit loss state, if the starvation message packet marked by the node is received, the mark is cancelled and the credit starvation mark bit in the starvation message packet is set to "0"; if the starvation message packet marked by other nodes is received, the starvation message packet is directly forwarded;
[0031] When the sorting state machine is in a credit starvation state and the sorting node number is k, if a starvation message packet marked by this node is received and the credit of the target node k is received, the mark is canceled and the credit starvation mark in the starvation message packet is set to "0"; if the starvation message packet marked by this node is received and the credit of the target node k is not received, or the starvation message packet marked by other nodes is received, the starvation message packet is directly forwarded.
[0032] Beneficial Effects
[0033] Due to the adoption of the above technical solution, the present invention has the following advantages and positive effects compared with the prior art:
[0034] The credit starvation sorting device on each node in the credit starvation control device of the present invention grasps the credit starvation status of all nodes to all target nodes, so that multiple source nodes with credit deficiency to the same target node can be sorted as much as possible in the order of credit deficiency, which can ensure transmission efficiency and fairness, and fundamentally avoid the credit starvation problem;
[0035] The credit starvation control device of the present invention has low hardware overhead and low physical implementation difficulty. The credit starvation sorting device on each node only uses a small number of registers to implement the sorting state machine, sorting node number and state identification counter, and the related control logic is also very simple; the credit starvation transmission device connecting all nodes adopts a ring network structure with few connections, which is very conducive to layout and wiring in the chip;
[0036] The credit starvation control device of the present invention has high efficiency and short delay in processing credit starvation. Each source node uses the status of other nodes stored locally to perform distributed arbitration according to the target nodes, which achieves the effect of centralized arbitration and reduces the delay overhead that may be caused by centralized arbitration;
[0037] The credit starvation control device of the present invention has good adaptability and scalability. The starvation message network of the credit starvation transmission device is independent of the on-chip network structure, and is applicable to both the ring network structure and the non-ring network structure, and has good adaptability. When the number of nodes in the on-chip network increases, it is only necessary to increase the number of sets of credit starvation sorting devices, the number of state identification counters in each set of credit starvation sorting devices, and the number of hops of the starvation message network in the credit starvation transmission device accordingly, and has good scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 It is a structural schematic diagram of an embodiment of the present invention;
[0039] Figure 2 is a schematic diagram of state transition of a sorting state machine in an embodiment of the present invention;
[0040] Figure 3 This is a schematic diagram of the definition of a hunger message packet in an embodiment of the present invention;
[0041] Figure 4 It is a schematic diagram of the ring network structure and credit starvation control device in an example of the present invention. DETAILED DESCRIPTION
[0042] The present invention will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall within the scope limited by the appended claims of the application equally.
[0043] The embodiment of the present invention relates to a network-on-chip credit starvation control device, which can completely solve the starvation problem that a source node may be unable to send messages due to lack of credit in a network-on-chip that transmits messages based on a dynamic credit mechanism. The applicable scenarios are as follows:
[0044] (1) For on-chip networks with high transmission delay requirements, arbitrary topology, and multiple source nodes sending messages to the same target node;
[0045] (2) Message transmission adopts a dynamic credit transmission mechanism, that is, multiple source nodes dynamically share the credit of the same target node;
[0046] (3) There is an independent credit transmission network for the target node to transfer credit to the source node. The target node can release credit to the credit transmission network, and the source node can obtain credit from the credit transmission network.
[0047] The design idea is to sort all the source nodes that have credit loss for the same target in the order of the time when the credit loss occurred, and the source node that first had credit loss has priority to obtain the credit of the target node. On the one hand, only the source nodes with credit loss are eligible to participate in arbitration, which basically realizes the principle of credit allocation on demand and ensures the transmission efficiency of the on-chip network; on the other hand, all source nodes arbitrate in the order of credit loss, which can absolutely avoid a source node from being unable to obtain the target node for a long time and starving. Since the source nodes are scattered in different places in the on-chip network, it is difficult to see the time when all source nodes have credit loss in time. For this reason, a device is set up to record and transmit the status of all nodes in the message network. It is agreed that all source nodes must be sorted into the credit starvation state before they can obtain the credit of the target node. When a source node enters the credit starvation state, it must be broadcast to other source nodes. Each source node locally records whether other source nodes have entered the credit starvation state for a certain target node, and uses this to determine whether it has the right to enter the credit starvation state for the same target node and obtain credit. Since there is a certain delay in the source node broadcasting the credit starvation state to all other nodes, this device only realizes an approximate sorting in the order of credit loss.
[0048] like Figure 1 As shown, the credit starvation control device of this embodiment includes multiple credit starvation sorting devices and a credit starvation transmission device; one credit starvation sorting device is set on each node in the on-chip network, and the credit starvation transmission device is used to connect the credit starvation sorting devices on all nodes together; when one or more nodes on the on-chip network cannot transmit messages to the same target node due to lack of credit, the credit starvation sorting device will sort these nodes approximately in the order of the time of credit loss and transmit them through the credit starvation transmission device, so that the node with high priority will obtain the credit of the target node first. The credit starvation control device fundamentally solves the fairness problem of the source node dynamically obtaining credit, and can avoid the phenomenon of message transmission starvation of a source node due to long-term inability to obtain credit.
[0049] The credit starvation transmission device includes a certain number of starvation message packets and a ring-shaped starvation message network. The starvation message packets are transmitted cyclically on the starvation message network. The credit starvation sorting device on each node can broadcast the status of the node to other nodes by marking the starvation message packet, and can also learn the status of other nodes by identifying a marked starvation message packet.
[0050] like Figure 3 As shown, the starvation message packet in the credit starvation delivery device defines four fields:
[0051] (1) Valid bit: "1" indicates that the starvation message packet is valid;
[0052] (2) Credit starvation flag: "1" indicates that the starvation message packet has been marked by a credit starvation sorting device of a source node;
[0053] (3) Credit starvation source node number: It is meaningful when the valid bit is "1" and the credit starvation mark bit is "1", indicating the source node number of the starvation message packet;
[0054] (4) Credit starvation target node number: It is meaningful when the valid bit is "1" and the credit starvation mark bit is "1", indicating that the source node marking this starvation message packet has caused a credit shortage to the target node.
[0055] The valid bit is "1" and the credit starvation mark bit is "0", indicating that it is a markable starvation message packet; the valid bit is "1" and the credit starvation mark bit is "1", indicating that it is a marked starvation message packet, which means that the node corresponding to the credit starvation source node number cannot send messages to the node corresponding to the credit starvation target node number due to lack of credit, and the sorting state machine on the node corresponding to the credit starvation source node number has entered the credit starvation state and can obtain the credit released by the node corresponding to the credit starvation target node number first.
[0056] The hunger message network in the hunger transmission device adopts a unidirectional ring network structure, and its scale (total number of nodes) is the same as the scale (total number of nodes) of the message network, but the connection relationship and transmission direction between nodes are independent of the message network and need to be set independently. The number of hunger message packets transmitted on the hunger message network can be less than or equal to the number of nodes. The more the number, the higher the transmission efficiency. It can be determined according to demand. Once selected, the number of hunger message packets remains unchanged during the transmission process. Initially, all hunger message packets have a valid bit of "1" and a credit hunger mark bit of "0", and they are transmitted at different nodes respectively. When the credit hunger sorting device of a node receives a markable hunger message packet, it can mark the hunger message packet as needed, set the valid bit to "1", set the credit hunger mark bit to "1", write the node number and sorting node number, and then pass it to the next node through the hunger message network. When the credit hunger sorting device of a node receives a marked hunger message packet, it can change the credit hunger sorting device state of the node according to the hunger source node number and hunger target node number information in the hunger message packet, and modify the information in the hunger message packet as needed, and pass it to the next node through the hunger message network. If the network size is n, and the delay of a starvation message packet passing through each node is x beats, then a starvation message packet can be delivered to all other nodes on the network within (n-1)*x beats.
[0057] Each credit starvation sorting device includes a sorting state machine, a sorting node number, and multiple state identification counters, where the sorting node number is bound to the sorting state machine, and the state identification counter is independent of the sorting state machine. The sorting state machine in the credit starvation sorting device includes three states: normal transmission, credit loss, and credit starvation. The specific state definitions are as follows:
[0058] (1) Normal transmission state: indicates that the node has the credit of all target nodes and can send messages to any target node;
[0059] (2) Credit loss state: indicates that the node has a message to send to the node corresponding to the sorting node number, but currently has no credit and needs to wait for other nodes to obtain credit first;
[0060] (3) Credit starvation state: This means that the node has a message to send to the node corresponding to the sorting node number, but currently has no credit and only has the right to obtain credit first.
[0061] The sorting node number is only meaningful when the sorting state machine is in the credit-deficient state and the credit-starved state.
[0062] The state identification counter is set one by one according to the target node, that is, the number of state identification counters is equal to the number of target nodes to which the message of this node can be sent. For the state identification counter corresponding to the target node i, the value of "1" indicates that one or more other nodes have the priority to obtain the credit of the target node i, that is, the sorting state machine on one or more other nodes is in the credit starvation state and the sorting node number is equal to i. Initially, the value of all state identification counters is "0", and the saturation minus one operation is performed in each clock cycle thereafter. If the network scale is n, when each node receives a marked starvation message packet (the credit starvation source node number is j, and the credit starvation target node number is k) from the starvation message network: if it is a packet marked by other nodes, the state identification counter of the corresponding target node k of this node is set to (n-1)*x, where x is the delay of the message packet passing through a single node; if it is a packet sent by this node, the state identification counter value of this node remains unchanged.
[0063] The state definitions and transitions of the sorting state machine on the credit starvation sorting device are as follows: Figure 2 As shown, the specific state transition conditions are as follows:
[0064] (1) For a certain source node j, when its sorting state machine is in the normal transmission state: if there is credit, the sorting state machine maintains the normal transmission state: if there is no credit of the target node k and the state identification counter value of the corresponding node k is not "0", or if there is no credit of the target node k and the state identification counter value of the corresponding node k is "0" and there is no marked hunger message packet on the hunger message network, then the sorting state machine enters the credit missing state and sets the sorting node number to k; if there is no credit of the target node k and the state identification counter value of the corresponding node k is "0" and there is a markable hunger message packet on the hunger message network, then the sorting state machine enters the credit starvation state, sets the sorting node number to k, sets the credit hunger flag bit in the hunger message packet to "1", the hunger source node number to j, and the hunger target node number to k.
[0065] (2) For a source node j, when its sorting state machine is in a credit-deficient state and the sorting node number is k: if the state identification counter value of the corresponding target node k is "0" and the credit of the target node k is received, the sorting state machine enters a normal transmission state; if the state identification counter value of the corresponding target node k is not "0", or the state identification counter value of the corresponding target node k is "0" and the credit of the target node k is not received and there is no starvation message packet that can be marked on the starvation message network, the sorting state machine maintains a credit-deficient state; if the state identification counter value of the corresponding target node k is "0" and the credit of the target node k is not received and there is a starvation message packet that can be marked on the starvation message network, the sorting state machine enters a credit-starved state, sets the credit starvation flag in the starvation message packet to "1", sets the starvation source node number to j, and sets the starvation target node number to k.
[0066] (3) For a source node j, when its sorting state machine is in a credit starvation state and the sorting node number is k: if it receives credit from the target node k, the sorting state machine enters a normal transmission state; otherwise, it continues to maintain a credit starvation state.
[0067] If the credit of the target node h is received, the sorting state machine is in the normal transmission state or the sorting state machine is in the credit missing state: if the state identification counter value of the corresponding target node h is "0", the credit can be obtained; if the state identification counter value of the corresponding target node h is not "0", the credit cannot be obtained. If the credit of the target node h is received, the sorting state machine is in the credit starvation state and the sorting node number is k: if k is equal to h, the credit can be obtained; if k is not equal to h and the state identification counter value of the corresponding target node h is "0", the credit can be obtained; if k is not equal to h and the state identification counter value of the corresponding target node h is not "0", the credit cannot be obtained.
[0068] When the sorting state machine is in the normal transmission state or the credit loss state: if a starvation message packet marked by this node is received, the mark is canceled and the credit starvation mark in the starvation message packet is set to "0"; if a starvation message packet marked by other nodes is received, the starvation message packet is directly forwarded. When the sorting state machine is in the credit starvation state and the sorting node number is k: if a starvation message packet marked by this node is received and the credit of the target node k is received, the mark is canceled and the credit starvation mark in the starvation message packet is set to "0"; if a starvation message packet marked by this node is received and the credit of the target node k is not received, or a starvation message packet marked by other nodes is received, the starvation message packet is directly forwarded.
[0069] The state transition conditions of the credit starvation state machine and their corresponding operations are as follows:
[0070]
[0071] The credit hunger control device is set for a certain type of virtual channel on the on-chip network. When there are multiple virtual channels sharing the same physical network, a credit hunger control device must be set up independently for each virtual channel. To save hardware overhead, the credit hunger control devices of different virtual channels can share a set of hunger message networks, but the credit hunger sorting device and the hunger message packets need to be independent of each other.
[0072] In the credit starvation control device, the meaning of the source node having no credit (or credit loss) may be that there is a message to be sent to a certain target node, but the credit of the target node is "0" or lower than a certain threshold, which can be determined according to the efficiency requirements of message transmission. The credit starvation control device is activated when the credit is lower than a certain threshold, so that the source node can prepare the required credit in advance, avoid network transmission interruption, and help shorten transmission delay and improve transmission efficiency.
[0073] The present invention is further illustrated by a specific embodiment below.
[0074] like Figure 4 As shown, the message network in this embodiment adopts a bidirectional ring network structure with 6 nodes. Only one type of message is transmitted on the network. Each source node can send messages to the other 5 nodes. The transmission delay of a message passing through a node is 1 beat. The ring network adopts a dynamic credit mechanism to achieve non-blocking transmission. The source node must have the credit of the target node to send a message, and all source nodes sending to the same target node dynamically share the credit of the target node. In addition, there is also a unidirectional credit ring network, which is used for the target node to transfer credit to the source node. The target node can release credit to the credit ring network, and the source node can obtain credit from the credit ring network.
[0075] Assume that the initial credit value of each target node is 48, the initial credit obtained by each source node for each target node is 8, a total of 40 credits are allocated to 5 source nodes, and there are 8 credits circulating in the credit ring network to make up for the performance loss caused by the delay between the source node consuming credits and the target node releasing credits. When the credit of a source node for a certain target node is less than 2, it is considered that there is no credit, and the credit starvation control device is started in advance to realize credit pre-application to improve the information transmission efficiency.
[0076] The credit starvation control device applied to this ring network structure includes 6 sets of credit starvation sorting devices and a starvation status transmission device, and the starvation status transmission device is connected to 6 sets of credit starvation sorting devices. Each set of credit starvation sorting devices contains the following:
[0077] (1) A sorting state machine: SortState[1:0], with a value of "0" indicating the normal transmission state, a value of "1" indicating the credit missing state, a value of "2" indicating the credit starvation state; a value of "3" indicating the illegal state;
[0078] (2) A sorting node number: SortNum[2:0], when the value of SortState is non-"0", SortNum is meaningful, indicating that this node lacks the credit of node SortNum;
[0079] (3) 5 state recognition counters: StateRecord[4:0][2:0], if the node number of this node is j, then StateRecord[i][2:0] represents the state of the credit starvation sorting device on node i (i < j), and StateRecord[i - 1][2:0] represents the state of the credit starvation sorting device on node i (i > j);
[0080] The credit starvation network in the starvation status transmission device adopts a unidirectional ring structure and includes 6 nodes. 3 credit starvation packets are circulated on the credit starvation network, and each credit starvation packet contains the following:
[0081] (1) Valid bit: Valid;
[0082] (2) Credit starvation flag bit: HungryFlag;
[0083] (3) Credit starvation source node number: HungrySrcNum[2:0];
[0084] (4) Credit starvation target node number: HungryDstNum[2:0].
[0085] When Valid is "1" and HungryFlag is "0", it indicates that it is a markable credit starvation package; when Valid is "1" and HungryFlag is "1", it indicates that it is a marked credit starvation package, the node HungrySrcNum[2:0] lacks the credit of the node HungryDstNum[2:0] and has entered the credit starvation state, and can obtain the credit of the node HungryDstNum[2:0] first.
[0086] Initially, the SortState in the six credit hunger sorting devices is "0", StateRecord[4:0] is "0", and the even-numbered nodes in the hunger state transmission device send a credit hunger packet to the credit hunger network, and the Valid in the three credit hunger packets is "1" and the HungryFlag is "0". After startup, each credit hunger sorting device performs state conversion based on the credit status of the node and the credit status of the same target node by other nodes, and exchanges information through the hunger state transmission device.
[0087] In order to facilitate the description of the working principle of the credit starvation control device, the internal states of each credit starvation sorting device and starvation state transmission device at different beats in several typical scenarios are listed below. In each scenario, the state description in multiple consecutive beats is in the form of a table, where SortState is simplified to SS, SortNum is simplified to SN, and StateRecord is simplified to SR. In order to simplify the branches of state transitions, it is assumed that every time a node needs to mark a starvation message packet, there is a starvation message packet that can be marked on the starvation message network.
[0088] Scenario 1: Two nodes have no credit for the same target node successively, and the latter node has no credit after seeing the starvation message packet of the former node, and the former node receives credit within 6 beats: Assuming that nodes 0 and 1 are both sending messages to target node 5, at beat T, node 0 runs out of credit for node 5; at beat T+1, node 1 also runs out of credit for node 5; at beat T+2, node 0 receives credit from node 5, then the state changes of each part of the credit starvation control device are shown in the following table:
[0089] Scenario 1: Credit Hunger Control Device Status Change Table
[0090]
[0091]
[0092]
[0093]
[0094] It can be seen from this that:
[0095] (1) When a node has no credit for a target node, if it has seen that other nodes are already in a credit starvation state for the same target node, it can only enter a credit starvation state after the other nodes exit the credit starvation state and have priority in obtaining credit;
[0096] (2) When a source node enters a credit starvation state, it can cause other nodes to be blocked for six cycles in turn, making it impossible to obtain credit.
[0097] Scenario 2: Two nodes lose credit to the same target node successively, and the latter node loses credit only after seeing the starvation message packet of the former node, and the former node has not received credit within 6 beats: Assume that nodes 0 and 1 are both sending messages to the target node 5. At beat T, node 0 runs out of credit to node 5 and there happens to be a starvation message packet that can be marked on the starvation message network; at beat T+1, node 1 also runs out of credit to node 5; at beat T+7, node 0 receives credit from node 5; at beat T+15, node 1 receives credit from node 5:
[0098] Scenario 2: Credit Hunger Control Device Status Change Table
[0099]
[0100]
[0101]
[0102]
[0103] It can be seen from this that when a source node enters a credit starvation state, if the credit starvation packet marked by this node has been transmitted on the credit starvation network for a circle, and this node has not received the credit of the target node, it needs to mark the credit starvation packet and transmit it on the starvation network again.
[0104] Scenario 3: Two nodes have no credit for the same target node at the same time, or one node has no credit before seeing the starvation message packet of the other node: Assuming that nodes 0 and 2 are both sending messages to the target node 5, at beat T, node 0’s internal credit for node 5 is used up; at beat T+1, node 2’s credit for node 5 is also used up; at beat T+3, node 2 receives the credit of node 5, and at beat T+5, node 0 receives the credit of node 5. The state changes of each part of the credit starvation control device are shown in the following table:
[0105] Scenario 3: Credit Hunger Control Device Status Change Table
[0106]
[0107]
[0108]
[0109]
[0110] It can be seen that due to the delay in the transmission of the credit starvation state, multiple nodes may be in the credit starvation state at the same time. At this time, these nodes have the right to obtain credit, and whoever sees the credit first will get the credit first.
[0111] Scenario 4: Two nodes lose credit to the same target node successively, and one of the nodes loses credit to the same target node again shortly after obtaining credit: Assuming that nodes 0 and 2 are both sending messages to target node 5, at beat T, node 0 runs out of credit to node 5; at beat T+1, node 2 also runs out of credit to node 5; at beat T+3, node 0 receives credit from node 5, and at beat T+4, node 2 receives credit from node 5; at beat T+5, node 0 runs out of credit to node 5 and there happens to be a starvation message packet that can be marked on the starvation message network, then the state changes of each part of the credit starvation control device are shown in the following table:
[0112] Scenario 4: Credit Hunger Control Device Status Change Table
[0113]
[0114]
[0115] It can be seen from this that when a node has no credit for a target node twice, it needs to re-participate in the sorting the second time, and can only re-enter the credit-starved state after the node that entered the credit-starved state earlier than this node obtains credit.
Claims
1. A network-on-chip credit starvation control device, characterized in that: It includes a plurality of credit starvation sorting devices and a credit starvation transmission device; one credit starvation sorting device is set on each node in the on-chip network, and the credit starvation transmission device is used to connect the credit starvation sorting devices on all nodes together; when one or more source nodes on the on-chip network cannot transmit messages to the same target node due to lack of credit, the credit starvation sorting device will sort these source nodes approximately in the order of credit loss time and transmit them through the credit starvation transmission device, so that the source node with high priority will obtain the credit of the target node first; The credit starvation transmission device includes a plurality of starvation message packets and a ring-shaped starvation message network; the starvation message packets are cyclically transmitted on the starvation message network, and the credit starvation sorting device on each node broadcasts the status of the node to other nodes through the starvation message packets, and also obtains the status of other nodes through the starvation message packets; the credit starvation sorting device includes a sorting state machine and a sorting node number, the sorting node number is bound to the sorting state machine, and the sorting state machine includes three states, namely: normal transmission, credit loss, and credit starvation; when the sorting state machine is in the normal transmission state, it means that the node has all the target node credits and can send messages to any target node; When the sorting state machine is in a credit-deficient state, it means that the node has a message to send to the node corresponding to the sorting node number, but currently has no credit and needs to wait for other nodes to obtain credit first; when the sorting state machine is in a credit-starved state, it means that the node has a message to send to the node corresponding to the sorting node number, but currently has no credit, but has the right to obtain credit first; The credit starvation sorting device further comprises a plurality of state identification counters, the number of which corresponds to the target node one by one; for the state identification counter corresponding to the target node k, a value of "1" indicates that one or more other nodes have the priority to obtain the credit of the target node k; initially, the values of all state identification counters are "0", and a saturation minus one operation is performed in each clock cycle thereafter; The principle of whether the credit starvation sorting device can obtain the target node credit is as follows: If the credit of the target node h is received, the sorting state machine is in a normal transmission state or the sorting state machine is in a credit missing state, and if the state identification counter value corresponding to the target node h is "0", the credit can be obtained; If the state identification counter value corresponding to the target node h is not "0", the credit cannot be obtained; If the credit of the target node h is received, the sorting state machine is in a credit starvation state and the sorting node number is k. If k is equal to h, the credit can be obtained; if k is not equal to h and the state identification counter value corresponding to the target node h is "0", the credit can be obtained; if k is not equal to h and the state identification counter value corresponding to the target node h is not "0", the credit cannot be obtained.
2. The on-chip network credit starvation control device according to claim 1, characterized in that: The starvation message packet defines four fields, namely: valid bit, credit starvation mark bit, credit starvation source node number and credit starvation target node number; when the valid bit is "1" and the credit starvation mark bit is "0", it indicates that it is a markable starvation message packet; when the valid bit is "1" and the credit starvation mark bit is "1", it indicates that it is a marked starvation message packet.
3. The on-chip network credit starvation control device according to claim 2, characterized in that: The hunger message network adopts a unidirectional ring network structure, and its total number of nodes is the same as the total number of nodes of the message network; the number of hunger message packets is less than or equal to the total number of nodes of the message network; initially, all the hunger message packets have a valid bit of "1" and a credit hunger mark bit of "0", and transmission starts at different nodes.
4. The on-chip network credit starvation control device according to claim 1, characterized in that: The sorting state machine performs state transitions according to the following conditions: For a certain source node j, when its sorting state machine is in the normal transmission state: if it has the credit of all target nodes, the sorting state machine maintains the normal transmission state; if it has no credit of target node k and the state identification counter value of the corresponding node k is not "0", or if it has no credit of target node k and the state identification counter value of the corresponding node k is "0" and no marked hunger message packet has landed on the hunger message network, the sorting state machine enters the credit loss state and sets the sorting node number to k; If there is no credit of the target node k and the state identification counter value of the corresponding node k is "0" and there is a starvation message packet that can be marked on the starvation message network, the sorting state machine enters the credit starvation state, sets the sorting node number to k, sets the valid bit of the starvation message packet to "1", the credit starvation mark bit to "1", the starvation source node number to j, and the starvation target node number to k; For a certain source node j, when its sorting state machine is in a credit-deficient state and the sorting node number is k: if the state identification counter value of the corresponding target node k is "0" and the credit of the target node k is received, the sorting state machine enters a normal transmission state; if the state identification counter value of the corresponding target node k is not "0", or the state identification counter value of the corresponding target node k is "0" and the credit of the target node k is not received and there is no starvation message packet that can be marked on the starvation message network, the sorting state machine maintains a credit-deficient state; if the state identification counter value of the corresponding target node k is "0" and the credit of the target node k is not received and there is a starvation message packet that can be marked on the starvation message network, the sorting state machine enters a credit-starved state, sets the valid bit of the starvation message packet to "1", sets the credit starvation mark bit to "1", the starvation source node number is j, and the starvation target node number is k; For a certain source node j, when its sorting state machine is in a credit starvation state and the sorting node number is k: if the credit of the target node k is received, the sorting state machine enters a normal transmission state; otherwise, it continues to maintain a credit starvation state.
5. The on-chip network credit starvation control device according to claim 1, characterized in that: The principle of the credit starvation sorting device processing the starvation message packet is as follows: When the sorting state machine is in a normal transmission state or a credit loss state, if the starvation message packet marked by the node is received, the mark is cancelled and the credit starvation mark bit in the starvation message packet is set to "0"; if the starvation message packet marked by other nodes is received, the starvation message packet is directly forwarded; When the sorting state machine is in a credit starvation state and the sorting node number is k, if a starvation message packet marked by this node is received and the credit of the target node k is received, the mark is canceled and the credit starvation mark in the starvation message packet is set to "0"; if the starvation message packet marked by this node is received and the credit of the target node k is not received, or the starvation message packet marked by other nodes is received, the starvation message packet is directly forwarded.
