Data transmission method and device, electronic equipment and readable storage medium
By adopting NoC technology in an on-chip network, using routers to determine the transmission path based on the routing information of data packets, the problem that traditional interconnection architectures are difficult to meet the performance requirements of modern systems is solved, and efficient data transmission and performance improvement are achieved.
Patent Information
- Application Number
- CN202510255768.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-04-01
AI Technical Summary
Traditional bus-based centralized interconnect architectures are difficult to meet the performance requirements of modern multi-core processors and systems on chips, such as high throughput, low latency and good scalability.
Network-on-chip (NoC) technology is used to forward data packets from the source routing node to the destination routing node through the router, improving the efficiency of data transmission. The specific method includes determining the target routing node based on the routing information in the data packet, determining the routing operation result based on the connection relationship between the routing node and the target routing node, and transmitting the data packet to the target routing node through the determined transmission path.
It improves the efficiency of data transmission by routing nodes in the on-chip network, reduces the logic depth of path combination on the control path, and improves the performance and user experience of the system.
Smart Images

Figure CN119739671A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data transmission method, device, electronic device and readable storage medium. Background Art
[0002] With the rapid development of semiconductor process technology, the design of multi-core processors and system-on-chip (SoC) has become increasingly complex. The traditional bus-based centralized interconnection architecture can no longer meet the performance requirements of today's systems, such as high throughput, low latency, and good scalability. Therefore, Network on Chip (NoC) technology came into being.
[0003] In NoC, routers are key components of data communication. They are responsible for forwarding data packets from source routing nodes to destination routing nodes, and realize communication between different IP cores through multiple hops. The performance and efficiency of routers directly affect the performance of the entire NoC system. In many system-on-chip applications, users expect various operations to be responded to quickly. Therefore, it is necessary to improve the transmission performance of routers, speed up the speed of router data transmission, shorten the response time of applications, and improve user experience. Summary of the invention
[0004] Embodiments of the present invention provide a data transmission method, device, electronic device and readable storage medium, which can improve the efficiency of data transmission by routing nodes in an on-chip network.
[0005] In one aspect, an embodiment of the present invention discloses a data transmission method, the method comprising: The data module determines the target routing node for receiving the data packet according to the routing information in the data packet to be transmitted, and determines the routing operation result corresponding to the data packet based on the connection relationship between the routing node and the target routing node; The control module determines the transmission path of the data packet between the routing node and the target routing node according to the routing operation result; The data module transmits the data packet to the target routing node through the transmission path.
[0006] Optionally, determining the routing operation result corresponding to the data packet based on the connection relationship between the routing node and the target routing node includes: Determining a target output port of the data packet in the routing node based on a connection relationship between the routing node and the target routing node; Based on the target routing node and the target output port, generate the routing calculation result, and write the routing calculation result into the first cache queue; The control module determines the transmission path of the data packet between the routing node and the target routing node according to the routing operation result, including: The control module reads the routing calculation result from the first cache queue; The control module determines the transmission path corresponding to the data packet according to the read routing calculation result.
[0007] Optionally, before the data module transmits the data packet to the target routing node through the transmission path, the data module further includes: The data module writes the data packet into the second cache queue; The data module transmits the data packet to the target routing node through the transmission path, including: The data module initializes a read pointer according to a read start position of the second cache queue; The data module reads the data packet from the second cache queue through the read pointer, and transmits the read data packet to the target routing node through the corresponding transmission path.
[0008] Optionally, the data module reads the data packet from the second cache queue through a read pointer, including: The data module performs a logic AND operation on each bit of the read pointer and each data packet in the second cache queue to obtain a first operation result; The data module performs a logical OR operation on each first operation result to obtain a data packet corresponding to the read pointer.
[0009] Optionally, the first cache queue and the second cache queue have the same depth, the same read and write order, and the same read and write speed.
[0010] Optionally, the control module determines, according to the routing operation result, a transmission path of the data packet between the routing node and the target routing node, including: The control module determines, according to the routing operation result, a candidate path for the data packet between the routing node and the target routing node and a priority corresponding to the candidate path; The control module selects a transmission path corresponding to the data packet from the candidate paths according to the priorities corresponding to the candidate paths.
[0011] Optionally, the data module transmits the data packet to the target routing node through the transmission path, including: In the case that there are at least two data packets to be transmitted in the target output port, the data module obtains the transmission priority of the data packets determined by the control module; The data module transmits the data packet to the target routing node through the transmission path according to the corresponding transmission priority.
[0012] On the other hand, an embodiment of the present invention discloses a data transmission device, the device comprising: A data module, used to determine a target routing node for receiving the data packet according to routing information in the data packet to be transmitted, and to determine a routing operation result corresponding to the data packet based on a connection relationship between the routing node and the target routing node; A control module, configured to determine a transmission path of the data packet between the routing node and the target routing node according to the routing operation result; The data module is further used to transmit the data packet to the target routing node through the transmission path.
[0013] On the other hand, an embodiment of the present invention further discloses an electronic device, which includes a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the aforementioned data transmission method.
[0014] The embodiment of the present invention further discloses a readable storage medium. When instructions in the readable storage medium are executed by a processor of an electronic device, the electronic device can execute the aforementioned data transmission method.
[0015] The embodiments of the present invention include the following advantages: The data module determines the target routing node for receiving the data packet according to the routing information in the data packet to be transmitted, and determines the routing operation result corresponding to the data packet based on the connection relationship between the routing node and the target routing node; by transferring the operation of determining the target output port of the data packet in the routing node to the data path, the depth of the critical path combination logic on the control path is reduced, and the efficiency of the routing node in transmitting the data packet is improved; the control module determines the transmission path of the data packet between the routing node and the target routing node according to the target output port; the data module transmits the data packet to the target routing node through the transmission path, thereby improving the efficiency of data transmission in the on-chip network. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0017] Figure 1 is a flowchart of a data transmission method embodiment of the present invention; Figure 2 It is a schematic diagram of reading a routing operation result from a first cache queue according to the present invention; Figure 3 is a schematic diagram of reading a data packet from a second cache queue according to the present invention; Figure 4 It is a schematic diagram of a routing node transmitting a data packet to a target routing node of the present invention; Figure 5 It is a structural block diagram of a data transmission device of the present invention; Figure 6 It is a structural block diagram of an electronic device for data transmission provided by an example of the present invention. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0019] The terms "first", "second", etc. in the specification and claims of the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable when appropriate, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, the term "and / or" in the specification and claims is used to describe the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In the embodiments of the present invention, the term "multiple" refers to two or more, and other quantifiers are similar.
[0020] Method Embodiment Reference Figure 1 , shows a flow chart of a data transmission method embodiment of the present invention, the method may specifically include the following steps: Step 101: The data module determines a target routing node for receiving the data packet according to routing information in the data packet to be transmitted, and determines a routing operation result corresponding to the data packet based on a connection relationship between the routing node and the target routing node.
[0021] Step 102: The control module determines a transmission path of the data packet between the routing node and the target routing node according to the routing operation result.
[0022] Step 103: The data module transmits the data packet to the target routing node through the transmission path.
[0023] The data transmission method provided by the embodiment of the present invention can be applied to the routing node of the on-chip network. The routing node is the core component of the on-chip network and can be used to realize data transmission and communication between different functional modules. Specifically, when the source functional module needs to send data to the destination functional module, the source functional module will encapsulate the data into a data packet and transmit it to the routing node. The routing node receives the data packet from the source functional module through the input port and forwards the data packet to the network interface where the destination functional module is located. Each functional module is connected to the routing node through one or more network interfaces, and the network interface is used to encapsulate the data packet generated by the functional module into a format suitable for network transmission. Among them, the functional module refers to various hardware components that perform specific functions, such as processing cores, caches, I / O interfaces, etc. It should be noted that when the destination functional module is directly connected to the routing node, the routing node can directly transmit the data packet to the destination functional module through the output port; when the destination functional module and the routing node are not directly connected, the routing node cannot directly transmit the data packet to the destination functional module through its own output port, and the data packet needs to be transmitted to other routing nodes first, and the data packet is forwarded to the destination functional module through other routing nodes.
[0024] Among them, the routing node includes a data module and a control module, the data module includes a component connected to the data path, and the control module includes a component connected to the control path. Specifically, the routing node may include the following components: input port, output port, buffer, routing calculation unit, arbitration unit, cross switch and other units. The data path in the routing node is used to transmit data packets, the control path in the routing node is used to transmit control instructions, and the control instructions are used to coordinate the working status of each component. The buffer is used to store data such as data packets, and the routing calculation unit is used to perform routing calculation according to the routing information carried in the data packet, determine the transmission path between the data packet sent from the source function module to the destination data module; determine the next target routing node to receive the data packet according to the path information; determine the output port of the data packet in the current routing node according to the connection relationship between the target routing node and the current routing node. Exemplarily, the data module may include: routing calculation unit, buffer. The control module may include: arbitration unit, cross switch, and output signal generation unit.
[0025] Among them, the data packet is a data structure composed of binary values after being encapsulated by the network interface of the functional module. The data packet may include: routing information, data itself, and data check code. The routing information may include: source address, destination address, next-hop routing node address and other information. Among them, the source address refers to the network address of the source functional module, the destination address refers to the network address of the destination functional module, the destination address and the next-hop routing node address are different, and the destination address refers to the final destination of the data packet, for example, the network address of the computing core or the network address of the cache, which will not change during the transmission of the data packet. The next-hop routing address refers to the network address of the next routing node to receive the data packet after the data packet is output from the current routing node. It should be noted that even if the routing information can carry the next-hop routing node address, after receiving the data packet, the routing node does not necessarily send the data packet to the next-hop routing node address carried by the routing information, but can update the next-hop routing node address in the routing information through routing calculation. The data check code is used to determine the integrity and accuracy of the data packet during transmission.
[0026] Specifically, a data packet is received from an input port, and before the data packet is written into a buffer, a routing calculation unit on a data path performs routing calculation according to routing information in the data packet, determines the transmission path of the data packet from the source functional module to the destination data module; determines the next target routing node for receiving the data packet according to the path information; and determines the routing calculation result corresponding to the data packet according to the connection relationship between the target routing node and the current routing node. Among them, the routing calculation result refers to the transmission direction and path information of the data packet from the current routing node to the destination address. Specifically, the routing calculation result may include: the address of the target routing node, the identifier of the target routing node, the path information, and other related information. The path information may be the information of the complete path from the routing node to the destination address, or the information of a partial path, that is, only the information of the next hop is calculated on each node, and the complete path is gradually constructed. Other related information may be the hop count, that is, the number of routing nodes that the data packet needs to pass through to reach the destination address; and the congestion information, that is, the congestion status of the on-chip network. According to the load of the transmission path between each routing node, a suitable path is selected, and the routing calculation result is determined according to the target routing node that receives the data packet next in the path. Write the data packet into the buffer and read the data packet from the buffer at the appropriate time; the control module on the control path determines the transmission path according to the routing operation result, generates a control instruction indicating the transmission path, and sends the control instruction to the cross switch through the control path to instruct the cross switch to send the data packet read from the buffer to the target routing node through the transmission path.
[0027] It should be noted that routing calculation can include the following methods: deterministic routing, random routing, and adaptive routing. Deterministic routing means that the transmission path of the data packet in the on-chip network is uniquely determined by the source address and the destination address, and does not change with the network working state. Dimensional sorting routing means that the data packet moves in the on-chip network in a certain dimensional order. For example, XY routing means that the data packet is first transmitted in the horizontal direction and then in the vertical direction. Random routing means that there are multiple paths between the source address and the destination address of the data packet. Regardless of the network congestion, a path is randomly selected when sending the data packet; or before the data packet reaches the destination node, at least one intermediate routing node is randomly selected, and the data packet is forwarded to the destination address through the intermediate node. Adaptive routing means dynamically selecting a path based on the real-time network status (congestion information, buffer occupancy), and using local or global congestion information to adjust the next hop routing node in real time.
[0028] Exemplarily, routing calculation can be performed according to the network topology, network status, and routing information to determine the next target routing node for receiving the data packet. The network topology refers to the network structure composed of each routing node in the on-chip network, and the network status refers to the working status and communication status of each routing node and channel, for example, the load status of the routing node, the usage status of the channel, the congestion status of the network, and the fault status of the network. Specifically, the process of routing calculation may include: parsing the source address and the destination address from the routing information, searching for a matching routing entry in the routing table according to the destination address, and determining the target routing node and the target output port corresponding to the data packet according to the next hop address and the output port indicated by the routing entry. Among them, if there are at least two matching routing entries in the routing table, the best path from the current routing node to the destination address can be selected according to the routing algorithm and the network status. By selecting the best path, the data transmission speed is improved, the network delay is reduced, the network congestion is reduced, and the like.
[0029] Optionally, after the routing calculation is completed, the current routing node determines whether the data packet is valid based on the output signal. If the data packet is valid, the data packet is received and the transmission path corresponding to the data packet is determined based on the routing operation result. If the data packet is invalid, the data packet is not accepted. The output signal is an output signal. When the routing node successfully processes and prepares to send the data packet from the output port, the output signal corresponding to the output port is high. It should be noted that the current routing node receives the output signal sent by the upper-level routing node. After the current routing node receives the data packet, it re-determines the output signal corresponding to each output port in the current routing node. The next-level routing node determines whether the data received from the output port is valid based on the output signal of the current routing node. A high-level output signal indicates that the data packet is valid, and a low-level output signal indicates that the data packet is invalid.
[0030] In an embodiment of the present invention, a data module determines a target routing node for receiving a data packet according to routing information in a data packet to be transmitted, and determines a routing operation result corresponding to the data packet based on a connection relationship between the routing node and the target routing node; by transferring the operation of determining a target output port of a data packet in a routing node to a data path, the depth of the critical path combinational logic on the control path is reduced, and the efficiency of data packet transmission by the routing node is improved; the control module determines a transmission path of a data packet between a routing node and a target routing node according to the routing operation result; and the data module transmits the data packet to the target routing node through the transmission path, thereby improving the efficiency of data transmission in the on-chip network.
[0031] Optionally, in step 101, determining a routing operation result corresponding to the data packet based on a connection relationship between the routing node and the target routing node includes: Step S11: Based on the connection relationship between the routing node and the target routing node, determine the target output port of the data packet in the routing node.
[0032] Step S12: Generate a routing calculation result based on the target routing node and the target output port, and write the routing calculation result into a first cache queue.
[0033] The control module determines the transmission path of the data packet between the routing node and the target routing node according to the routing operation result, including: Step S21: The control module reads the routing calculation result from the first cache queue.
[0034] Step S22: The control module determines the transmission path corresponding to the data packet according to the read routing calculation result.
[0035] The first cache queue is used to cache the routing calculation results, implement flow control, and prevent network congestion and data loss. When the transmission channel in the downstream routing node or the current routing node is busy, the upstream routing node can store the routing calculation results in the first cache queue and wait for the right time to process them.
[0036] It should be noted that, based on the connection relationship between the current routing node and the target routing node, the candidate output port of the current routing node for connecting to the target routing node can be determined, and the target output port can be further selected based on the load conditions of each candidate output port, and then the data packet can be transmitted to the target routing node through the transmission path between the input port and the target output port.
[0037] The routing node and the target routing node may be connected through at least one pair of output ports and input ports. When the routing node and the target routing node are connected through a pair of output ports and input ports, the output port on the routing node used to connect to the target routing node is determined as the target output port of the data packet in the routing node; when the routing node and the target routing node are connected through at least two pairs of output ports and input ports, the target output port is selected from the candidate output ports according to the load conditions of each output port used by the routing node to connect to the target routing node.
[0038] It should be noted that the current routing node can receive at least one data packet at the same time, and the output ports corresponding to each data packet can be the same or different. After the target routing node is determined, the transmission path of the data packet between the current routing node and the target routing node can be determined according to the load conditions of each output port in the routing node. The transmission path refers to the connection channel between the input port and the output port corresponding to the data packet in the routing node. The first cache queue is used to cache the routing operation results, realize flow control, prevent network congestion and data loss, and improve the efficiency of data transmission in the on-chip network.
[0039] In the embodiment of the present invention, based on the connection relationship between the routing node and the target routing node, the target output port of the data packet in the routing node is determined; based on the target routing node and the target output port, a routing operation result is generated, and the routing operation result is written into the first cache queue. The control module reads the routing operation result from the first cache queue; and determines the transmission path corresponding to the data packet according to the read routing operation result.
[0040] Optionally, before the data module in step 103 transmits the data packet to the target routing node through the transmission path, the method further includes: The data module writes the data packet into the second cache queue.
[0041] The data module transmits the data packet to the target routing node through the transmission path, including: Step S31: The data module initializes a read pointer according to a read start position of the second cache queue.
[0042] Step S32: The data module reads the data packet from the second cache queue through the read pointer, and transmits the read data packet to the target routing node through the corresponding transmission path.
[0043] It should be noted that the read pointer is used to track the location of the current data packet being read. Through the read pointer, data packets can be read sequentially or selectively from the cache queue. This method can flexibly access the data in the queue without having to read from the beginning every time. According to the storage location pointed to by the read pointer, the data packet is obtained from the corresponding storage location in the cache queue. In the case where the second cache queue is an array or a similar data structure, the read pointer can be used as an index to access the elements in the array.
[0044] When reading the data packet in the second cache queue through the read pointer, the read pointer is first initialized, that is, before starting to read the data packet, the read pointer needs to be initialized to a specific value, and the specific value points to the starting position of the first data packet in the second cache queue.
[0045] In an embodiment of the present invention, a data packet is written into the second cache queue, and the reading method corresponding to the second cache queue is to read the data packet through a read pointer. The second cache queue uses a write pointer and a read pointer to control the reading and writing of the data packet. The data packet does not need to be moved when the data packet is read and written into the data packet, which reduces the power consumption of the routing node writing and reading data. In addition, in an embodiment of the present invention, the routing operation result is stored in the first cache queue, and the data packet is stored in the second cache queue. The transmission path is determined according to the routing operation result in the first cache queue, and the data packet is transmitted to the target routing node through the transmission path. According to the linkage of the two cache queues, the transmission of the data packet is realized.
[0046] Optionally, after step S32, the method further includes: Each time a data packet is read out through the read pointer, the read pointer is updated so that the read pointer points to a storage position of the next unread data packet in the second cache queue.
[0047] After reading a data packet, the read pointer needs to be updated to point to the position of the next data packet. Updating the read pointer means increasing the read pointer by a fixed step size. For example, for continuously stored data packets, the step size may be the size of a data packet. Before moving the read pointer, it is necessary to check whether the read pointer exceeds the boundary of the second cache queue. If the read pointer already points to the end of the second cache queue, the reading stops when the queue is empty.
[0048] In an embodiment of the present invention, after reading a data packet, the read pointer needs to be updated to point to the position of the next data packet, and the read pointer is updated to point to the next unread data packet to ensure that each data packet can be read in sequence in a first-in-first-out order.
[0049] Optionally, in step S32, the data module reads the data packet from the second cache queue through the read pointer, including: Step S41, the data module performs an AND operation on each bit of the read pointer and each data packet in the second cache queue to obtain a first operation result; wherein each bit corresponds to a data packet.
[0050] Step S42: The data module performs an OR operation on each of the first operation results to obtain a data packet corresponding to the read pointer.
[0051] It should be noted that in the embodiment of the invention, the read pointer is in the form of a one-hot code. One-hot code is a binary vector encoding method, and each possible value is represented by an independent binary bit. In the binary vector, only one bit is 1, and the rest are 0. The position where 1 is located indicates the position of the data packet to be read in the second cache queue.
[0052] Specifically, there is a cache queue or array of length N, and the length of the one-hot code should be the same as the length of the queue or array, that is, N. For the position i pointed to by the read pointer, the one-hot code is a vector of length N, where the i-th element is 1 and the rest are 0. Suppose there is a second cache queue of length 4, and the read pointer currently points to position 2 (index starts at 0). Read pointer position: 2, one-hot code representation: [0, 0, 1, 0].
[0053] like Figure 3 As shown, a schematic diagram of reading a data packet from the second cache queue is shown, where a data packet is read from the second cache queue through a read pointer, and a data packet is written to the second cache queue through a write pointer. The read pointer is in the form of a one-hot code, in which only one bit is 1, and the rest of the bits are 0. After performing an AND operation on each bit of the read pointer and the corresponding data packet in the second cache queue, the first operation results of the data packets corresponding to the rest of the bits in the read pointer are all 0, and the bits in the read pointer that are 1 can read the data packet at the corresponding position in the second cache queue as is. Performing an OR operation on each of the first operation results in sequence can obtain the data packet that the read pointer wants to read.
[0054] In the embodiment of the present invention, each bit of the read pointer and each data packet in the second cache queue are firstly ANDed to obtain a first operation result to determine the data packet corresponding to the read pointer; then each first operation result is ORed to obtain the data packet corresponding to the read pointer. When reading a data packet through the read pointer, it is not necessary to move the data packet, thereby reducing the power consumption of the routing node when reading data.
[0055] Optionally, the first cache queue and the second cache queue have the same depth, the same read and write order, and the same read and write speed.
[0056] Specifically, the depths of the two cache queues are determined according to the buffer turnaround time. The buffer turnaround time refers to the total time consumed by the upstream routing node sending a data packet to the current routing node, the current routing node receiving the data packet and sending the data packet to the target routing node, and the current routing node feeding back a credit signal to the upstream routing node. The depth of the cache queue is greater than or equal to the number of time units in the buffer turnaround time. For example, it takes 1 beat for the upstream routing node to send a data packet to the current routing node, 1 beat for the current routing node to receive the data packet and send the data packet to the target routing node, and 1 beat for the current routing node to feed back a credit signal to the upstream routing node. There are 3 time units in the buffer turnaround time. In order to ensure that the data transmission process is uninterrupted, the depth of the cache queue is greater than or equal to 3. Among them, the upstream routing node maintains and records the credit value counter corresponding to the current routing node. The credit value is used to reflect the available space in the cache queue of the current routing node. When the upstream routing node sends out a data packet and does not receive a credit signal, the credit value is reduced by one; when the upstream routing node receives a credit signal and does not send out a data packet, the credit value is increased by one. When the credit value is greater than 0, the upstream routing node sends a data packet to the current routing node.
[0057] In the embodiment of the present invention, the first cache queue is a queue of gravity FIFO structure, and the second cache queue is a pointer FIFO queue. Every time a routing operation result is dequeued from the head of the first cache queue, the available space of the first cache queue increases, and the corresponding credit value increases by one. A data packet is read from the second cache queue through the read pointer. When the second cache queue is full, the read data packet can be replaced by a new data packet through the write pointer. In essence, after the data packet in the second cache queue is read, the storage location of the read data packet is the available space, so the corresponding credit value of the second cache queue is also increased by one. When the depths of the two cache queues are greater than or equal to the buffer turnover time, the risk of overload and data congestion of the two cache queues is reduced.
[0058] like Figure 2As shown, a schematic diagram of reading the routing operation result from the first cache queue is shown. Among them, the first cache queue adopts a first-in-first-out method, and the routing operation result is added to the first cache queue through a write pointer, and the routing operation result is read from the head of the first cache queue. The routing operation result written to the first cache queue first will be read from the head of the first cache queue first. The first cache queue adopts a gravity first-in-first-out structure. After the routing operation result at the head of the first cache queue is read, the read routing operation result is removed from the first cache queue. After the routing operation result at the head of the queue is removed, the head position is an empty position, and the remaining routing operation results in the first cache queue are moved in the direction of dequeueing so that the head position is not an empty position. When reading the routing operation result in the first cache queue, it is only necessary to directly read the head of the first cache queue, and there is no need to perform the addressing logic of the read pointer to select the data packet. The gravity first-in-first-out structure draws on the gravity principle in the physical world to design a cache queue with natural and orderly data flow.
[0059] It should be noted that the length of the routing calculation results is consistent. After each routing calculation result is read, the remaining routing calculation results are shifted in the direction of the queue. The number of bits shifted is equal to the length of the routing calculation result. For example, if the length of the routing calculation result is 8 bits, after each routing calculation result is read, the remaining routing calculation results are shifted 8 bits in the direction of the queue.
[0060] In an embodiment of the present invention, a cache queue of a gravity first-in-first-out structure can be implemented by a shift register. A shift register is a register that can shift the stored data to the left or right according to a clock signal. A unidirectional shift register can be used, and the routing operation result is input from one end and output from the other end. A shift register with a preset number of bits is designed to store the required number of routing operation results. The input end of the shift register is connected to the routing operation result write port, and the output end is connected to the routing operation result read port, and the routing operation result read port is used to connect the control module on the control path. When a new routing operation result needs to be written into the first cache queue, the routing operation result is added to the input end of the shift register. With the triggering of the clock signal, it is written into the internal storage unit of the shift register in sequence. The control module always reads the routing operation result from the output end of the shift register. With the triggering of the clock signal, the data currently written earliest in the first cache queue is read through the read port and is shifted out of the shift register.
[0061] The read and write order of the second cache queue is the same as that of the first cache queue, and the second cache queue is also a first-in-first-out queue. Data packets are written to the second cache queue through the write pointer, and data packets are read from the second cache queue through the read pointer. The read pointer is initialized to point to the head position of the second cache queue. Each time a data packet is read from the second cache queue, the read pointer points to the next unread data packet in the order in which the data packets are written to the second cache queue.
[0062] The read and write speed of the first cache queue is the same as the read and write speed of the second cache queue, which means that the speed of dequeuing the routing calculation result from the head of the first cache queue is the same as the speed of reading the data packet through the read pointer in the second cache queue. In other words, the time consumed to dequeue the routing calculation result from the head of the first cache queue is the same as the time consumed to read the data packet through the read pointer in the second cache queue.
[0063] like Figure 4 As shown, a schematic diagram of the current routing node sending a data packet to the target routing node is shown. After receiving the data packet, the current routing node performs routing calculation according to the routing information in the data packet, obtains the routing calculation result, writes the routing calculation result into the first cache queue, and writes the data packet into the second cache queue. The control module determines the transmission path corresponding to the data packet according to the routing calculation result, and the data module transmits the data packet from the second cache queue to the target routing node through the transmission path.
[0064] In an embodiment of the present invention, the control module reads the routing operation result from the head of the first cache queue. After the routing operation result is read, the data module shifts the remaining routing operation results in the first cache queue along the data dequeue direction of the first cache queue according to the length of the routing operation result. The routing operation result is written into the first cache queue of the gravity first-in-first-out structure. When the control module reads the routing operation result, it only needs to read out the routing operation result stored in the head register of the first cache queue, without selecting the address according to the read pointer, which can save the addressing logic of the reading; in addition, since the first cache queue adopts the gravity first-in-first-out storage method, the number of bits of the stored routing operation result is small, which reduces the power consumption overhead. Moreover, in this embodiment, the routing operation result is stored in the first cache queue of the gravity first-in-first-out structure, and the data packet is stored in the second cache queue that is read and written through the pointer. Both cache queues are based on the first-in-first-out principle. The transmission path is determined by the routing operation result read from the first cache queue, the data packet is read from the second cache queue, and the data packet is transmitted to the target routing node through the transmission path. The transmission of the data packet is realized by the linkage of two cache queues with different structures.
[0065] Optionally, the control module determines, according to the routing operation result, a transmission path of the data packet between the routing node and the target routing node, including: Step S51: The control module determines, according to the routing calculation result, candidate paths for the data packet between the routing node and the target routing node and priorities corresponding to the candidate paths.
[0066] Step S52: The control module selects a transmission path corresponding to the data packet from the candidate paths according to the priorities corresponding to the candidate paths.
[0067] It should be noted that a connection has been established in advance between each input port and output port in the routing node, and there may be at least two transmission paths between each input port and each output port. Specifically, the length or load of each path can be indicated according to the routing operation result, and the corresponding priority can be set according to the path length. The shorter the path, the higher the priority. The highest priority is determined as the transmission path corresponding to the data packet. According to the load balancing algorithm, a path with a lower load is selected from multiple paths to avoid network congestion and improve network throughput and reliability. For example, by monitoring the traffic load on each path, a path whose load meets the preset conditions is dynamically selected, and a priority is set for each path according to the load level. The path with a lower load has a higher priority, and the path with the highest priority is determined as the transmission path corresponding to the data packet. For example, the advantages of path length and path load can be combined to dynamically select a routing path according to the actual situation of the network; when the path loads of two transmission paths are the same, the path with a shorter path length is selected as the transmission path; when the path lengths of two transmission paths are the same, the path with a lower load is selected as the transmission path.
[0068] Among them, in the routing node, the transmission path corresponding to the data packet is selected from the candidate paths through the cross switch, and the data packet is transmitted from the input port to the target output port, so that the data packet is output to the target routing node through the target output port. The cross switch is composed of the input port, output port and cross node in the routing node, and each cross node contains a switch for controlling the data packet from the input port to flow to the target output port.
[0069] In an embodiment of the present invention, for each data packet, a routing operation result is calculated according to the routing information in the data packet, and the routing operation result indicates the target output port corresponding to the data packet. Therefore, the target output port corresponding to the data packet can be determined according to the routing operation result. The routing operation result corresponding to the data packet is written into the first cache queue of the gravity first-in-first-out structure, and the data packet itself is written into the second cache queue that reads data through the read pointer. Since both cache queues are first-in-first-out principle, the linkage of the two cache queues can ensure that there is a one-to-one correspondence between the routing operation result and the data packet. The control module in the control path reads the routing operation result from the first cache queue, performs a series of processing on the routing operation result, determines the transmission path of the data packet in the routing node, and instructs the cross switch to select the transmission path by sending a control instruction. The data packet is transmitted to the cross switch through the data path in the second cache queue. The control path and the data path are independent of each other, and the execution progress is not affected by each other. Therefore, the time when the data packet and the control instruction reach the cross switch is not completely synchronized. However, when the data packet is transmitted to the target output port through the cross switch, it is necessary to wait for the control instruction to arrive at the cross switch. After receiving the control instruction, the cross switch outputs the data packet to the target output port according to the transmission path indicated by the control instruction, and outputs the data packet to the target routing node through the target output port.
[0070] In the embodiment of the present invention, a connection is pre-established between each input port and output port in the routing node. According to the routing operation result, the target output port corresponding to the data packet is determined, the input port and the target output port corresponding to the data packet are matched with the pre-established transmission path, the candidate path is determined, and the transmission path corresponding to the data packet is selected from the candidate paths. The transmission path corresponding to the data packet is selected from the first path through the cross switch, and the data packet is transmitted from the input port to the target output port, thereby improving the accuracy and efficiency of data packet transmission.
[0071] Optionally, in step 103, the data module transmits the data packet to the target routing node through the transmission path, including: Step S61: when there are at least two data packets to be transmitted in the transmission path, obtaining the transmission priority of the data packets determined by the control module; Step S62: The data module transmits the data packet to the target routing node through the transmission path according to the corresponding transmission priority.
[0072] In an embodiment of the present invention, a routing node has at least one input port and at least one output port. The routing node will receive at least two data packets simultaneously within a period of time. Each data packet corresponds to a respective transmission path. The transmission path refers to the connection channel between the input port and the output port of the routing node, that is, each data packet has a corresponding target output port. In the case where the transmission paths of at least two data packets are the same, that is, the target output ports corresponding to at least two data packets are consistent, it is necessary to determine the priority of each data packet when transmitting at the target output port based on the current load of the target output port, the arrival time of the two data packets and other information.
[0073] It should be noted that the priority of each data packet is calculated according to a predefined priority calculation rule. For example, a comprehensive calculation can be performed based on factors such as data packet size, arrival time, current network status, output port load, etc. The arbitration module establishes a corresponding priority queue for each output port, and puts the data packets arriving at the output port into the queue in order from high to low priority. Exemplarily, the earlier the arrival time, the higher the priority of the data packet, and the smaller the data packet size, the higher the priority. In the case where there are at least two data packets corresponding to the same target output port, a transmission decision is made according to the priority of the data packet, and the data packet with a high priority will be given priority to obtain a transmission opportunity. Among them, the arbitration module is a part of the data control module, which is used to determine the transmission priority of the data packet to be transmitted.
[0074] There are at least two data packets arriving at the routing node at the same time, and the routing node can receive and process each data packet in parallel. For each data packet, the routing operation result is calculated according to the routing information in the data packet, and the routing operation result indicates the target output port corresponding to the data packet. The priority corresponding to each data packet is determined by the arbitration module. After the priority of each data packet is determined, according to the routing operation result and the arbitration result, the arbitration result is the priority of the data packet, and a control instruction is generated. The control instruction indicates the target output port and priority corresponding to the data packet, and the control instruction is sent to the cross switch, indicating which path the cross switch selects as the transmission path corresponding to the data packet, and the cross switch outputs the data packet from the transmission path to the target routing node.
[0075] In the embodiment of the present invention, the routing node has at least one input port and at least one output port. The routing node will receive at least two data packets at the same time within a period of time, and each data packet has a corresponding target output port. When the target output ports corresponding to at least two data packets are consistent, it is necessary to determine the priority of each data packet when transmitting at the target output port according to the current load of the target output port, the arrival time of the two data packets and other information, so as to reduce the risk of network congestion.
[0076] In summary, an embodiment of the present invention provides a data transmission method, which is applied to a routing node. The routing node includes a data module and a control module. The data module includes a component connected to a data path, and the control module includes a component connected to a control path. The data module determines the target routing node for receiving the data packet according to the routing information in the data packet to be transmitted, and determines the routing operation result corresponding to the data packet based on the connection relationship between the routing node and the target routing node; the control module determines the transmission path of the data packet between the routing node and the target routing node according to the target output port. The data module transmits the data packet to the target routing node through the transmission path. By transferring the routing calculation operation to the data path, the depth of the path combination logic on the control path can be reduced, the combination logic of the critical path between the two routing nodes can be reduced, and the efficiency of the routing node in transmitting the data packet can be improved. The routing operation result and the data packet are stored in cache queues of different structures, the routing operation result occupying a small storage space is stored in the first cache queue of the gravity first-in-first-out structure, and the data packet occupying a large storage space is stored in the second cache queue of the pointer type. Since the two cache queues are based on the first-in-first-out principle, it is possible to achieve a one-to-one correspondence between the routing operation result and the data packet, and it is also possible to reduce the power consumption of the routing node when reading and writing the data packet.
[0077] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0078] Device Embodiment Reference Figure 5 , shows a structural block diagram of a data transmission device of the present invention, and the device may specifically include: The data module 510 is used to determine the target routing node for receiving the data packet according to the routing information in the data packet to be transmitted, and determine the routing operation result corresponding to the data packet based on the connection relationship between the routing node and the target routing node; A control module 520, configured to determine a transmission path of the data packet between the routing node and the target routing node according to the routing operation result; The data module is also used to transmit the data packet to the target routing node through the transmission path.
[0079] Optionally, the data module includes: A port determination module, configured to determine a target output port of the data packet in the routing node based on a connection relationship between the routing node and the target routing node; A first writing module, configured to generate a routing operation result based on the target routing node and the target output port, and write the routing operation result into a first cache queue; Optionally, the control module includes: A first reading module, configured to read the routing operation result from the first cache queue; The transmission path determination module is used to determine the transmission path corresponding to the data packet according to the routing operation result.
[0080] Optionally, the data module includes: The second writing module is used to write the data packet into the second cache queue.
[0081] Optionally, the data module includes An initialization module, used for initializing a read pointer according to a read start position of the second cache queue; The second reading module is used to read the data packet through the read pointer and transmit the read data packet from the corresponding transmission path to the target routing node.
[0082] Optionally, the data module includes: A first operation module, configured to perform an AND operation on each bit of the read pointer and each data packet in the second cache queue to obtain a first operation result; wherein each bit corresponds to a data packet; The second operation module is used to perform an OR operation on each of the first operation results to obtain a data packet corresponding to the read pointer.
[0083] Optionally, the first cache queue and the second cache queue have the same depth, the same read and write order, and the same read and write speed.
[0084] Optionally, the control module includes: A priority determination module, used for determining the candidate paths of the data packet between the routing node and the target routing node and the priorities corresponding to the candidate paths according to the routing operation result; The selection module is used to select a transmission path corresponding to the data packet from the candidate paths according to the priorities corresponding to the candidate paths.
[0085] Optionally, the data module includes: An acquisition module, configured to determine the transmission priority of the data packet when there are at least two data packets to be transmitted in the transmission path; The transmission module is used to transmit the data packet to the target routing node through the transmission path according to the corresponding transmission priority.
[0086] In summary, an embodiment of the present invention provides a data transmission device, which is applied to a routing node, and the routing node includes a data module and a control module. The data module includes a component connected to a data path, and the control module includes a component connected to a control path. The data module determines the target routing node for receiving the data packet according to the routing information in the data packet to be transmitted, and determines the routing operation result corresponding to the data packet based on the connection relationship between the routing node and the target routing node; the control module determines the transmission path of the data packet between the routing node and the target routing node according to the target output port. The data module transmits the data packet to the target routing node through the transmission path. By transferring the routing calculation operation to the data path, the depth of the path combination logic on the control path can be reduced, the combination logic of the critical path between the two routing nodes can be reduced, and the efficiency of the routing node in transmitting the data packet can be improved. The routing operation result and the data packet are stored in cache queues of different structures, the routing operation result occupying a small storage space is stored in the first cache queue of the gravity first-in-first-out structure, and the data packet occupying a large storage space is stored in the second cache queue of the pointer type. Since the two cache queues are based on the first-in-first-out principle, it is possible to achieve a one-to-one correspondence between the routing operation result and the data packet, and it is also possible to reduce the power consumption of the routing node when reading and writing the data packet.
[0087] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0088] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0089] Regarding the processor in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0090] Reference Figure 6 , is a structural block diagram of an electronic device for data transmission provided by an embodiment of the present invention. Figure 6 As shown, the electronic device includes: a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the data transmission method of the aforementioned embodiment.
[0091] The processor may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other editable devices, transistor logic devices, hardware components or any combination thereof. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0092] The communication bus may include a path for transmitting information between the memory and the communication interface. The communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 The fact that only one line is used in the diagram does not mean that there is only one bus or only one type of bus.
[0093] The memory may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0094] The embodiment of the present invention also provides a non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device (server or terminal), the processor can execute Figure 1 The data transmission method shown.
[0095] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0096] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, devices or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0097] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems) and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0098] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a predictable manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0099] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0100] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0101] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0102] The data transmission method, device, electronic device and readable storage medium provided by the present invention are introduced in detail above. The principles and implementation methods of the present invention are explained in this article using specific examples. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A data transmission method, characterized in that: A routing node applied to a network on chip, the routing node comprising a data module and a control module; the data module comprising a component connected to a data path, the control module comprising a component connected to a control path; the method comprising: The data module determines the target routing node for receiving the data packet according to the routing information in the data packet to be transmitted, and determines the routing operation result corresponding to the data packet based on the connection relationship between the routing node and the target routing node; The control module determines the transmission path of the data packet between the routing node and the target routing node according to the routing operation result; The data module transmits the data packet to the target routing node through the transmission path.
2. The method according to claim 1, characterized in that The determining, based on the connection relationship between the routing node and the target routing node, a routing operation result corresponding to the data packet includes: Determining a target output port of the data packet in the routing node based on a connection relationship between the routing node and the target routing node; Based on the target routing node and the target output port, generate the routing calculation result, and write the routing calculation result into the first cache queue; The control module determines the transmission path of the data packet between the routing node and the target routing node according to the routing operation result, including: The control module reads the routing calculation result from the first cache queue; The control module determines the transmission path corresponding to the data packet according to the read routing calculation result.
3. The method according to claim 2, characterized in that Before the data module transmits the data packet to the target routing node through the transmission path, the data module further includes: The data module writes the data packet into a second cache queue; The data module transmits the data packet to the target routing node through the transmission path, including: The data module initializes a read pointer according to a read start position of the second cache queue; The data module reads the data packet from the second cache queue through the read pointer, and transmits the read data packet to the target routing node through the corresponding transmission path.
4. The method according to claim 3, characterized in that The data module reads the data packet from the second cache queue through a read pointer, including: The data module performs a logic AND operation on each bit of the read pointer and each data packet in the second cache queue to obtain a first operation result; The data module performs a logical OR operation on each first operation result to obtain a data packet corresponding to the read pointer.
5. The method according to claim 3, characterized in that: The first cache queue and the second cache queue have the same depth, the same read and write order, and the same read and write speed.
6. The method according to claim 1, characterized in that The control module determines the transmission path of the data packet between the routing node and the target routing node according to the routing operation result, including: The control module determines, according to the routing operation result, a candidate path for the data packet between the routing node and the target routing node and a priority corresponding to the candidate path; The control module selects a transmission path corresponding to the data packet from the candidate paths according to the priorities corresponding to the candidate paths.
7. The method according to claim 1, characterized in that The data module transmits the data packet to the target routing node through the transmission path, including: In the case where there are at least two data packets to be transmitted in the transmission path, the data module obtains the transmission priority of the data packets determined by the control module; The data module transmits the data packet to the target routing node through the transmission path according to the corresponding transmission priority.
8. A data transmission device, characterized in that: The device comprises: A data module, used to determine a target routing node for receiving the data packet according to routing information in the data packet to be transmitted, and to determine a routing operation result corresponding to the data packet based on a connection relationship between the routing node and the target routing node; A control module, configured to determine a transmission path of the data packet between the routing node and the target routing node according to the routing operation result; The data module is further used to transmit the data packet to the target routing node through the transmission path.
9. An electronic device, characterized in that: The electronic device includes a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the data transmission method as described in any one of claims 1 to 7.
10. A readable storage medium, characterized in that: When the instructions in the readable storage medium are executed by a processor of an electronic device, the processor is enabled to execute the data transmission method as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for determining data transmission path of network-on-chip, and storage medium
CN111475457A
Network-on-chip structure, data transmission method, electronic equipment and storage medium
CN115665041A
Data packet routing method, computer device, storage medium, and program
CN118802710A
Data transmission method and device of network-on-chip, electronic equipment and storage medium
CN119396766A
Data transmission method and device of network-on-chip, electronic equipment and storage medium
CN119396767A