On-chip network simulation models, dynamic path planning methods, devices, and multi-core chips
By establishing a connection characteristic table and a path status table, port information and occupancy status are dynamically recorded, solving the problems of high simulation complexity and high resource consumption in existing technologies. This enables efficient dynamic path planning for multi-core chips, improving chip design and compilation efficiency.
Patent Information
- Application Number
- CN202110402725.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-14
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2041-04-14
AI Technical Summary
Existing on-chip network simulation models suffer from high simulation complexity, high resource consumption, and inability to achieve dynamic path planning and optimization in multi-core chip design, resulting in inaccurate chip performance evaluation and low compilation efficiency.
Establish a connection characteristic table and a path status table to dynamically record the physical path information and occupancy status between ports. Determine the available paths and select the target path through calculation to achieve dynamic path planning.
It simplifies simulation calculations, reduces data congestion, improves routing efficiency, lowers hardware resource requirements, enhances chip design flexibility and performance evaluation efficiency, and reduces costs.
Smart Images

Figure CN115204086B_ABST
Abstract
Description
Technical Field
[0001] This disclosure belongs to the field of program compilation technology, specifically relating to an on-chip network simulation model and dynamic path planning method, device, and multi-core chip. Background Technology
[0002] Before designing multi-core chips for neural network computing, simulation models of each component module are typically built for functional verification and performance evaluation. Once the chip is manufactured and put into application, the efficiency of the neural network computing program needs to be evaluated in real-time during each compilation process to optimize the generated program. This necessitates the development of an accurate and efficient neural network chip simulator.
[0003] Generally, in multi-core chips, communication between cores and between a core and other modules is conducted through a Network on Chip (NoC). This involves establishing a NoC simulation model, and then selecting and optimizing data transmission paths—that is, routing methods—based on this model. Different NoC simulation models employ different routing methods, with significantly varying effectiveness.
[0004] The typical NoC simulation model and corresponding routing method are as follows:
[0005] I. Precise NoC Model for Software Analog Circuits:
[0006] This model prioritizes accuracy, representing the NoC circuit through software simulation to accurately evaluate its performance, including precise data delay. During path selection, a static routing table is created based on the actual circuit operation and its operating state to complete the path selection. However, this method results in complex software design, long simulation times, and high requirements for the machine running the simulation program.
[0007] II. A crude NoC model expressing functional modules:
[0008] This model prioritizes efficiency, treating the NoC as a functional module with certain behavioral characteristics. The simulation results only express the behavior of each interface of the NoC, thus enabling fast simulation and low requirements for the machine running the simulation program. However, because the simulation model is too coarse, it cannot represent the actual characteristics of the NoC, cannot obtain accurate timing information, and cannot simulate the congestion conditions of the NoC, so it is almost impossible to perform path selection and optimization.
[0009] In summary, for precise software-simulated circuit NoC models, only corresponding static routing tables can be established during routing planning simulation. It is impossible to update the planned path in real time based on the current path occupancy status. Furthermore, the simulation program is complex, slow, resource-intensive, and costly. For NoC models with coarse functional module representations, dynamic path selection and optimization are almost impossible, making it impossible to accurately evaluate chip performance and optimize the program. Summary of the Invention
[0010] This disclosure aims to address at least one of the problems existing in the prior art by providing an on-chip network simulation model and a dynamic path planning method, device, and multi-core chip.
[0011] One aspect of this disclosure provides a dynamic path planning method for an on-chip network simulation model, wherein the on-chip network includes multiple ports, and the method includes:
[0012] Establish a connection characteristic table for each port, wherein the connection characteristic table records the physical path direct connection information between any two ports.
[0013] Establish a path status table for the path status of each port, wherein the path status table dynamically records the occupancy information of the physical direct connection path between any two ports.
[0014] Based on the connection characteristic table, all possible paths from the data transmission start port to the data transmission end port are determined, wherein in each possible path, there is a physical direct connection path along the data transmission direction between any two adjacent ports.
[0015] Based on the path status table, determine all available paths that are in an idle state from all possible paths;
[0016] Select a target path from all the available paths according to a preset rule to serve as the transmission path from the data transmission start port to the data transmission end port.
[0017] In some implementations, establishing a connection characteristic table for each of the ports, wherein the connection characteristic table records direct physical path connection information between any two of the ports, includes:
[0018] If there is a physical direct connection path between any two ports, then the physical direct connection information of the two ports is set to the first preset value;
[0019] If there is no physical direct connection path between any two ports, then the physical direct connection information of the two ports is set to the second preset value.
[0020] In some implementations, the establishment of a path status table for each of the ports, wherein the path status table dynamically records the occupancy information of the physical direct connection path between any two ports, includes:
[0021] If there is no physical direct connection path between any two ports, or if there is a physical direct connection path but it is idle, then the physical direct connection path occupancy information of the two ports is set to the third preset value.
[0022] If there is a physical direct connection between any two ports and it is in use, then the physical direct connection occupancy information of the two ports is set to the fourth preset value.
[0023] In some implementations, all possible paths constitute a possible path table, and determining all available paths that are in an idle state from all possible paths according to the path status table includes:
[0024] Based on the path status table, a possible path status table is established, and the possible path status table corresponds to the possible path table;
[0025] Based on the possible path table and the possible path status table, all possible paths are determined.
[0026] In some implementations, determining all possible paths based on the possible path table and the possible path status table includes:
[0027] The first operation is performed on the corresponding items in the possible path table and the possible path status table to obtain the first operation result of each corresponding item, and the second operation is performed on each of the first operation results in the same possible path to obtain the second operation result, so as to determine all the optional paths according to the second operation result.
[0028] In some implementations, the first preset value and the fourth preset value are non-zero values, and the second preset value and the third preset value are zero values;
[0029] The step of performing a first operation on corresponding entries in the possible path table and the possible path status table to obtain a first operation result for each corresponding entry, and performing a second operation on each of the first operation results in the same possible path to obtain a second operation result, so as to determine all the optional paths based on the second operation result, includes:
[0030] The corresponding items in the possible path table and the possible path status table are multiplied to obtain the first operation result of each corresponding item, and the first operation results in the same possible path are accumulated to obtain the second operation result corresponding to each possible path;
[0031] The possible path where the result of the second operation is zero is selected as the optional path.
[0032] In some implementations, the preset rules include shortest path rules, random path selection rules, or sequential path selection rules.
[0033] Another aspect of this disclosure provides a path planning device for an on-chip network simulation model, the on-chip network including multiple ports, the device comprising:
[0034] The first establishment module is used to establish a connection characteristic table for the connection characteristics of each port, wherein the connection characteristic table records the physical path direct connection information between any two ports.
[0035] The second establishment module is used to establish a path status table for the path status of each port. The path status table dynamically records the physical direct connection path occupancy information between any two ports.
[0036] The first determining module is used to determine all possible paths from the data transmission start port to the data transmission end port according to the connection characteristic table, wherein in each possible path, there is a physical direct connection path along the data transmission direction between any two adjacent ports.
[0037] The second determining module is used to determine all available paths that are in an idle state from all possible paths based on the path status table;
[0038] The selection module is used to select a target path from all the available paths according to a preset rule, so as to serve as the transmission path from the data transmission start port to the data transmission end port.
[0039] In some implementations, the first establishment module is used to establish a connection characteristic table for each of the ports, the connection characteristic table recording the physical path direct connection information between any two of the ports, including:
[0040] The first establishment module is specifically used for:
[0041] If there is a physical direct connection path between any two ports, then the physical direct connection information of the two ports is set to the first preset value;
[0042] If there is no physical direct connection path between any two ports, then the physical direct connection information of the two ports is set to the second preset value.
[0043] In some embodiments, the second establishment module is used to establish a path status table for the path status of each of the ports, wherein the path status table dynamically records the occupancy information of the physical direct connection path between any two of the ports, including:
[0044] The second establishment module is specifically used for:
[0045] If there is no physical direct connection path between any two ports, or if there is a physical direct connection path but it is idle, then the physical direct connection path occupancy information of the two ports is set to the third preset value.
[0046] If there is a physical direct connection between any two ports and it is in use, then the physical direct connection occupancy information of the two ports is set to the fourth preset value.
[0047] In some implementations, the first determining module is further configured to form a possible path table from all possible paths, and the second determining module is configured to determine all available paths in an idle state from all possible paths according to the path status table, including:
[0048] The second determining module is used for:
[0049] Based on the path status table, a possible path status table is established, and the possible path status table corresponds to the possible path table;
[0050] Based on the possible path table and the possible path status table, all possible paths are determined.
[0051] In some implementations, the second determining module is configured to determine all possible paths based on the possible path table and the possible path status table, including:
[0052] The second determining module is used for:
[0053] The first operation is performed on the corresponding items in the possible path table and the possible path status table to obtain the first operation result of each corresponding item, and the second operation is performed on each of the first operation results in the same possible path to obtain the second operation result, so as to determine all the optional paths according to the second operation result.
[0054] In some implementations, the first establishing module is further configured to set the first preset value to a non-zero value and the second preset value to a zero value; the second establishing module is further configured to set the third preset value to a zero value and the fourth preset value to a non-zero value.
[0055] The second determining module is configured to perform a first operation on corresponding items in the possible path table and the possible path status table to obtain a first operation result for each corresponding item, and perform a second operation on each of the first operation results in the same possible path to obtain a second operation result, so as to determine all the optional paths based on the second operation result, including:
[0056] The second determining module is specifically used for:
[0057] The corresponding items in the possible path table and the possible path status table are multiplied to obtain the first operation result of each corresponding item, and the first operation results in the same possible path are accumulated to obtain the second operation result corresponding to each possible path;
[0058] The possible path where the result of the second operation is zero is selected as the optional path.
[0059] In some implementations, the selection module is configured to select a target path from all available paths according to a preset rule, as the transmission path from the data transmission start port to the data transmission end port, including:
[0060] The selection module is specifically used for:
[0061] Select a target path from all the available paths according to the shortest path rule, the random path selection rule, or the sequential path selection rule.
[0062] Another aspect of this disclosure provides an on-chip network simulation model, said on-chip network simulation model employing the method described above; or,
[0063] The on-chip network simulation model includes the device described above.
[0064] Another aspect of this disclosure provides a multi-core chip including at least one set of computing cores, the chip being configured to perform the methods described above; or,
[0065] The chip includes the device described above.
[0066] Another aspect of this disclosure provides an electronic device comprising:
[0067] One or more processors;
[0068] A storage unit for storing one or more programs that, when executed by one or more processors, enable the one or more processors to implement the method described above.
[0069] Another aspect of this disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, enables the implementation of the method described above.
[0070] The on-chip network simulation model, dynamic path planning method and device, and multi-core chip disclosed herein can achieve dynamic path planning simply and flexibly based on the established connection characteristic table and path state table, effectively utilizing NoC, reducing data congestion, and improving routing efficiency. The algorithm is simple to implement, with low simulation computation, greatly saving resources for routing planning and simulation. It can also avoid problems such as deadlock during data transmission, improving path reliability. In chip design, it can also quickly evaluate chip performance based on the designer's adjustments to NoC, provide timely feedback, guide chip design and performance optimization, improve the efficiency of chip program compilation, improve the efficiency of neural network compiler automatic program compilation, reduce hardware requirements for running simulation programs, and save costs. Attached Figure Description
[0071] Figure 1 This is a schematic block diagram illustrating the composition of an electronic device according to an embodiment of the present disclosure;
[0072] Figure 2 A flowchart of a dynamic path planning method for an on-chip network simulation model according to another embodiment of this disclosure;
[0073] Figure 3 This is a schematic diagram of a NoC simulation model according to another embodiment of the present disclosure;
[0074] Figure 4 This is a schematic diagram of a NoC simulation model according to another embodiment of the present disclosure;
[0075] Figure 5 This is a schematic diagram of a path planning device for an on-chip network simulation model according to another embodiment of the present disclosure. Detailed Implementation
[0076] To enable those skilled in the art to better understand the technical solutions of this disclosure, the disclosure will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0077] First, refer to Figure 1 This describes an example electronic device for implementing the apparatus and methods of the embodiments of this disclosure.
[0078] like Figure 1 As shown, the electronic device 200 includes one or more processors 210, one or more storage devices 220, one or more input devices 230, one or more output devices 240, etc., and these components are interconnected via a bus system 250 and / or other forms of connection mechanisms. It should be noted that... Figure 1 The components and structures of the electronic devices shown are merely exemplary and not limiting; other components and structures may be used as needed.
[0079] The processor 210 can be a neural network processor composed of chips with a multi-core architecture, or a single central processing unit (CPU), or a central processing unit plus a multi-core neural network processor array, or other forms of processing unit with data processing capabilities and / or instruction execution capabilities, and can control other components in the electronic device 200 to perform the desired functions.
[0080] Storage device 220 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, which a processor may execute to implement the client functions (implemented by the processor) in the embodiments of this disclosure described below, and / or other desired functions. Various applications and various data may also be stored in the computer-readable storage medium, such as various data used and / or generated by the applications.
[0081] The input device 230 may be a device used by a user to input commands, and may include one or more of a keyboard, mouse, microphone, and touch screen.
[0082] The output device 240 can output various information (such as images or sounds) to the outside (e.g., a user) and may include one or more of a display, a speaker, etc.
[0083] Below, we will refer to Figure 2 The present disclosure describes a dynamic path planning method for an on-chip network simulation model according to an embodiment of the present disclosure. The dynamic path planning method refers to selecting a target path as the final transmission path from several optional paths according to a certain preset rule based on the current busy status of each path during path planning.
[0084] For example, such as Figure 2 As shown, a dynamic path planning method S100 for an on-chip network simulation model, wherein the on-chip network includes multiple ports, and method S100 includes:
[0085] S110. Establish a connection characteristic table for each of the ports, wherein the connection characteristic table records the physical path direct connection information between any two of the ports.
[0086] For example, combined Figure 3In this step, the on-chip network includes N ports, namely port P1 to port P2. N Each port can simultaneously perform input and output. In a given transmission direction, there is either no direct physical connection between any two ports, or only one direct physical connection exists between them. However, there may be multiple indirect physical connection paths between any two ports; that is, there may be multiple connection paths between any two ports that pass through other ports. The on-chip network includes N ports P1 to P2. N At that time, a connection characteristic table is established to represent the connection characteristics of each port, as shown in Table 1.
[0087] As shown in Table 1, the connection characteristics table records any port P X To any other port P Y Physical path direct connection information L XY The physical path direct connection information L XY Indicates from port P X to port P Y Does a physical direct connection path exist? For example, L 12 Indicates whether there is a physical direct path from port P1 to port P2, L 21 Indicates whether there is a physical direct path from port P2 to port P1, L 1N This indicates the distance from port P1 to port P. N Does a physical direct connection path exist? L N1 Indicates from port P N Does a physical direct path exist to port P1, etc.
[0088] Table 1
[0089]
[0090] It should be noted that in the connection characteristic table, the physical path direct connection information from any port to other ports can be arranged by row or by column. Those skilled in the art can choose according to actual needs, and this embodiment does not limit this.
[0091] It should be noted that, based on the connection characteristic table, a corresponding static routing table can also be created to record the routing information between each port.
[0092] S120. Establish a path status table for the path status of each port. The path status table dynamically records the occupancy information of the physical direct connection path between any two ports.
[0093] For example, in this step, the on-chip network includes N ports P1 to P2. NEstablish a path status table that can represent the path status of each port, as shown in Table 2:
[0094] Table 2
[0095]
[0096] As shown in Table 2, the path status table dynamically records any port P. X To any other port P Y Physical direct path occupancy information S XY The physical direct connection path occupancy information S XY Indicates the current time from port P X to port P Y Is the physical direct connection path occupied? For example, S 12 This indicates whether the physical direct path from port P1 to port P2 is currently occupied. 21 This indicates whether the physical direct path from port P2 to port P1 is currently occupied. 1N This indicates the current time from port P1 to port P. N Is the physical direct connection path occupied? S N1 Indicates the current time from port P N Whether the physical direct path to port P1 is occupied, etc.
[0097] It should be noted that the path dynamic table is a dynamic table that updates its contents in real time based on the occupancy status of the physical direct connection path between any two ports. Furthermore, in the path dynamic table, the occupancy information of the physical direct connection path from any port to other ports can be arranged by row or column; those skilled in the art can choose according to their actual needs, and this embodiment does not limit this.
[0098] S130. Based on the connection characteristic table, determine all possible paths from the data transmission start port to the data transmission end port, wherein in each possible path, there is a physical direct connection path along the data transmission direction between any two adjacent ports.
[0099] Specifically, in this step, when the data transmission start port is port P X The data transmission termination port is port P. Y At that time, based on the connection characteristic table, determine the port P. X to port P Y All possible paths, in which there is a physical direct connection between any two adjacent ports along the data transmission direction. That is to say, all ports traversed by each possible path have a physical direct connection with their adjacent ports along the data transmission direction.
[0100] For example, when the data transmission starts at port P1 and ends at port P4, according to the connection characteristic table, all possible paths from port P1 to port P4 can be: P1→P3→P4, P1→P2→P3→P4, P1→P2→P4. Among these, there is a physical direct connection between port P1 and port P3, a physical direct connection between port P3 and port P4, a physical direct connection between port P1 and port P2, a physical direct connection between port P2 and port P3, and a physical direct connection between port P2 and port P4.
[0101] S140. Based on the path status table, determine all available paths that are in an idle state from all possible paths.
[0102] Specifically, in this step, since some of the possible paths may be currently occupied (i.e., busy), making the corresponding possible path unavailable, it is necessary to determine all currently available possible paths, i.e., all optional paths currently in an idle state, from all possible paths. When determining all optional paths in an idle state from all possible paths, the available optional paths for the physical direct connection between any two ports along the data transmission direction can be determined based on the occupancy information of the physical direct connection between any two adjacent ports currently recorded in the path status table.
[0103] For example, when all possible paths from the data transmission start port P1 to the data transmission end port P4 include P1→P3→P4, P1→P2→P3→P4, and P1→P2→P4, if, according to the physical direct path occupancy information between any two ports currently recorded in the path status table, only the physical direct path from port P2 to port P3 is occupied (i.e., in a busy state), while the physical direct paths from port P1 to port P3, from port P3 to port P4, from port P1 to port P2, and from port P2 to port P4 are all in an idle state, then all currently idle selectable paths are determined to be P1→P3→P4 and P1→P2→P4, respectively.
[0104] S150. Select a target path from all the available paths according to a preset rule, and use it as the transmission path from the data transmission start port to the data transmission end port.
[0105] Specifically, in this step, when the data transmission start port is port P XThe data transmission termination port is port P. Y At that time, from port P X to port P Y From all available paths, select a target path according to preset rules and use it as port P. X to port P Y The transmission path.
[0106] For example, when all possible paths from the data transmission start port P1 to the data transmission end port P4 include P1→P3→P4 and P1→P2→P4, a target path is selected from the possible paths P1→P3→P4 and P1→P2→P4 according to a preset rule as the transmission path from port P1 to port P3. The selected target path can be P1→P3→P4 or P1→P2→P4.
[0107] The dynamic path planning method of the on-chip network simulation model in this embodiment can easily and flexibly implement dynamic path planning based on the established connection characteristic table and path state table. It effectively utilizes NoC, reduces data congestion, and improves routing efficiency. The algorithm is simple to implement, with low simulation computation, greatly saving resources for routing planning and simulation. It can also avoid problems such as deadlock during data transmission, improving path reliability. In chip design, it can also quickly evaluate chip performance based on the designer's adjustments to NoC, provide timely feedback, guide chip design and performance optimization, improve the efficiency of chip program compilation, improve the efficiency of neural network compiler automatic program compilation, reduce hardware requirements for running simulation programs, and save costs.
[0108] For example, the connection characteristic table for establishing the connection characteristics of each port, wherein the connection characteristic table records the direct physical path connection information between any two ports, includes:
[0109] If a physical direct connection exists between any two ports, the physical path direct connection information of the two ports is set to a first preset value. This first preset value can be the number of clock cycles required for direct data transmission between the two ports, i.e., latency, or other values preset according to actual needs. Those skilled in the art can choose as needed, and this embodiment does not limit this. If no physical direct connection exists between any two ports, the physical path direct connection information of the two ports is set to a second preset value. This second preset value can be any value different from the first preset value, and those skilled in the art can set it as needed; this embodiment does not limit this.
[0110] Specifically, if from any port P X To any other port P YIf a physical direct connection path exists, then the corresponding physical path direct connection information L will be transferred. XY Set to the first preset value, indicating that from port P X to port P Y Direct communication is possible. If from any port P... X To any other port P Y If no physical direct connection path exists, then the corresponding physical path direct connection information L will be transferred. XY Set to the second preset value, indicating that from port P X to port P Y They cannot communicate directly; they need to communicate across other ports.
[0111] The dynamic path planning method of the on-chip network simulation model in this embodiment sets the corresponding physical path direct connection information in the connection characteristic table according to whether there is a physical direct connection between any two ports. This allows the existence of a physical direct connection between any two ports to be intuitively determined through the connection characteristic table, which facilitates subsequent path planning.
[0112] For example, the establishment of a path status table for each of the ports, wherein the path status table dynamically records the occupancy information of the physical direct connection path between any two ports, including:
[0113] If there is no direct physical connection between any two ports, or if a direct physical connection exists but is idle, the occupancy information of the direct physical connection between the two ports is set to a third preset value. If there is a direct physical connection between any two ports and it is occupied, the occupancy information of the direct physical connection between the two ports is set to a fourth preset value.
[0114] Specifically, if from any port P X To any other port P Y There is no physical direct path, or from any port P X To any other port P Y If a physical direct path exists but is currently idle, then the corresponding physical direct path occupancy information S will be transferred. XY Set to the third preset value, indicating that from port P X to port P Y There is no direct physical path, or there is a direct physical path but it is currently idle. If from any port P... X To any other port P Y If a physical direct connection exists and that physical direct connection is currently occupied, then the corresponding physical direct connection occupancy information S will be transferred. XY Set to the fourth preset value, indicating that from port P X to port PY Although direct communication is possible, the corresponding physical direct connection path is currently occupied.
[0115] The dynamic path planning method of the on-chip network simulation model in this embodiment sets the physical direct connection path occupancy information in the path status table according to whether there is a physical direct connection path between any two ports and whether the physical direct connection path is currently occupied. This allows the path status table to intuitively determine whether the physical direct connection path between any two ports can be used, which facilitates subsequent path planning.
[0116] For example, all the possible paths constitute a possible path table.
[0117] Specifically, the possible path table sequentially records all possible paths originating from the data transmission start port and ending at the data transmission end port. The ports can be arranged in rows or columns. If arranged in rows, several rows can be set up to record each possible path. The position corresponding to each port in each row records the direct physical path connection information of the corresponding possible path ending at that port. If arranged in columns, several columns can be set up to record each possible path. The position corresponding to each port in each column records the direct physical path connection information of the corresponding possible path ending at that port.
[0118] For example, determining all available paths that are in an idle state from all possible paths according to the path status table includes:
[0119] Based on the path status table, a possible path status table is established, and the possible path status table corresponds to the possible path table.
[0120] Specifically, in the possible path status table, the position of each port corresponds to the position of each port in the possible path table. That is, when the ports listed sequentially in the possible path table are arranged in rows, the ports listed sequentially in the possible path status table are also arranged in rows. Similarly, when the ports listed sequentially in the possible path table are arranged in columns, the ports listed sequentially in the possible path status table are also arranged in columns. In the possible path status table, if the ports are arranged in rows, several rows can be set up to record the current occupancy information of each physical direct path included in each possible path. The position corresponding to each port in each row is used to record the occupancy information of the physical direct path ending at that port in the corresponding possible path. If the ports are arranged in columns, several columns can be set up to record the current occupancy information of each physical direct path included in each possible path. The position corresponding to each port in each column is used to record the occupancy information of the physical direct path ending at that port in the corresponding possible path.
[0121] Based on the possible path table and the possible path status table, all possible paths are determined.
[0122] Specifically, based on the possible path table, the physical direct connection paths included in each possible path can be determined. Then, based on the possible path status table, the physical direct connection paths in the idle state among each physical direct connection path can be determined. From all possible paths, the path in which all physical direct connection paths are in the idle state can be determined, thus obtaining all selectable paths.
[0123] For example, determining all possible paths based on the possible path table and the possible path status table includes:
[0124] The first operation is performed on the corresponding items in the possible path table and the possible path status table to obtain the first operation result of each corresponding item, and the second operation is performed on each of the first operation results in the same possible path to obtain the second operation result, so as to determine all the optional paths according to the second operation result.
[0125] Specifically, the first operation can be performed on the corresponding items of each possible path in the possible path table and the possible path status table to obtain the first operation result of each corresponding item. Then, the first operation results in the same possible path can be performed on the second operation to obtain the second operation results corresponding to each possible path. From each possible path, the path whose corresponding second operation result meets the preset requirements can be determined to obtain all the selectable paths.
[0126] For example, the first preset value and the fourth preset value are non-zero values, and the second preset value and the third preset value are zero values.
[0127] Specifically, in the connection characteristics table, the physical path direct connection information L XY The first preset value can be non-zero, indicating that it is from port P X to port P Y A physical direct connection path exists. This non-zero value could indicate data flow from port P. X Direct transmission to port P Y The required number of clock cycles, or the non-zero value, can be any other non-zero value. Those skilled in the art can set this according to actual needs, and this embodiment does not limit this. In the connection characteristic table, the physical path direct connection information L... XY The second preset value can be zero, indicating that it is from port P. X to port P Y There is no physical direct path. In the path status table, the physical direct path occupancy information is S. XY The third preset value can be zero, indicating that it is from port P. X to port P Y There is no physical direct path, or, indicating from port P X to port P Y Although a physical direct path exists, it is currently idle. The physical direct path occupancy information S is displayed in the path status table. XY The fourth preset value can be a non-zero value, indicating that it is from port P X to port P Y There is a physical direct path, but it is currently in use.
[0128] For example, the step of performing a first operation on corresponding items in the possible path table and the possible path status table to obtain a first operation result for each corresponding item, and performing a second operation on each of the first operation results in the same possible path to obtain a second operation result, so as to determine all the optional paths according to the second operation result, includes:
[0129] The corresponding entries in the possible path table and the possible path status table are multiplied to obtain the first operation result for each corresponding entry. The first operation results for each possible path are then summed to obtain the second operation result for each possible path. The possible path whose second operation result is zero is selected as the optional path.
[0130] Specifically, when the first and fourth preset values are non-zero, and the second and third preset values are zero, the corresponding entries of each possible path in the possible path table and the possible path status table can be multiplied to obtain the first operation result for each corresponding entry. Each first operation result may be zero or non-zero. Then, the first operation results for each possible path are summed to obtain the second operation results for each possible path. Each second operation result may be zero or non-zero. By selecting the path whose second operation result is zero from all possible paths, all selectable paths can be obtained.
[0131] For example, the preset rules include the shortest path rule, the random path selection rule, or the sequential path selection rule.
[0132] Specifically, when selecting a target path from all available paths, the shortest path (i.e., the path with the shortest routing time for data transmission) can be selected as the target path. Alternatively, an available path can be randomly selected, or a path can be selected according to the order in which the available paths are arranged. When selecting a target path from all available paths according to the order selection rule, the first available path in sequence, the second available path in sequence, the third available path in sequence, and so on can be selected. Those skilled in the art can make the selection according to actual needs, and this embodiment does not limit this.
[0133] To illustrate the above process in detail, a specific example is provided below.
[0134] Take a NoC simulation model with 6 ports as an example.
[0135] like Figure 4 As shown, NoC includes 6 input / output ports, namely ports P1 to P6, and the connection relationship between each port is as follows: Figure 4 As shown in the diagram, the arrowed lines between any two ports indicate a direct physical connection between them along the direction of the arrow. For example, there are two direct physical connections between ports P1 and P2: one from port P1 to port P2, and the other from port P2 to port P1.
[0136] In a given direction, there is either no direct physical path between two ports, or at most one. However, there may be multiple indirect physical paths, meaning there may be multiple physical paths between two ports that pass through other ports. For example, the physical path from port P1 to port P3 could be a direct physical path from port P1 to port P3, or it could be an indirect physical path from port P1 to port P3 via port P2.
[0137] Establish such as Figure 4 The connection characteristics of the NoC simulation model are shown in Table 3:
[0138] Table 3
[0139]
[0140] In Table 3, 0 indicates that there is no direct physical path from the port corresponding to the row to the port corresponding to the column. A non-zero number indicates that there is a direct physical path from the port corresponding to the row to the port corresponding to the column. The number of clock cycles required for data to be transmitted directly from the port corresponding to the row to the port corresponding to the column is this non-zero number, which is also the length of the corresponding direct physical path. The position of 0 can also be represented in gray to indicate that the direct physical path between the port corresponding to the row and the port corresponding to the column is unavailable when selecting a path.
[0141] Establish as Figure 4 The path state table of the NoC simulation model is shown and initialized as shown in Table 4:
[0142] Table 4
[0143]
[0144] During initialization, the physical direct connection path between any two ports either does not exist or is in an idle state. Therefore, in Table 4, the occupancy information of each physical direct connection path is set to 0.
[0145] Taking a scenario where port P1 requests data transmission to port P6, but the physical direct path from port P2 to port P5 is currently occupied, the corresponding dynamic path planning process is as follows:
[0146] Based on the connection characteristic table, there are 3 possible paths from port P1 to port P6:
[0147] First possible path: P1→P2→P3→P4→P5→P6;
[0148] The second possible path: P1→P3→P4→P5→P6;
[0149] The third possible path: P1→P2→P5→P6.
[0150] These three possible paths form a possible path table, as shown in Table 5:
[0151] Table 5
[0152] Possible Routine Table
[0153] <![CDATA[P1]]> <![CDATA[P2]]> <![CDATA[P3]]> <![CDATA[P4]]> <![CDATA[P5]]> <![CDATA[P6]]> 0 2 2 2 2 2 0 0 3 2 2 2 0 2 0 0 4 2
[0154] In Table 5, except for the row containing each port (row 0), each row corresponds to one possible path. A value of 0 indicates that there is no physical direct path in the possible paths corresponding to that row that terminates at the port corresponding to that 0. A non-zero value indicates the length of the physical direct path in the possible paths corresponding to that row that terminates at the port corresponding to that non-zero value.
[0155] Based on the current path status table, a possible path status table corresponding to Table 5 is created, as shown in Table 6:
[0156] Table 6
[0157] State of PR Table
[0158] <![CDATA[P1]]> <![CDATA[P2]]> <![CDATA[P3]]> <![CDATA[P4]]> <![CDATA[P5]]> <![CDATA[P6]]> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
[0159] In Table 6, since only the physical direct path from port P2 to port P5 is currently occupied, only the row corresponding to the third possible path has a non-zero value at the corresponding position of port P5, which is 1.
[0160] For each possible path, the corresponding items in the possible path table 5 and the possible path status table 6 are multiplied to obtain the first operation result of each corresponding item, as shown in Table 7.
[0161] The first operation results in each row of Table 7 are summed to obtain the second operation results for each possible path. The second operation result for the first possible path P1→P2→P3→P4→P5→P6 is 0, the second operation result for the second possible path P1→P3→P4→P5→P6 is 0, and the second operation result for the third possible path P1→P2→P5→P6 is 4. This shows that all the physical direct connections included in the first and second possible paths P1→P2→P3→P4→P5→P6 are currently idle. Only the third possible path P1→P2→P5→P6 contains a currently occupied physical direct connection path P2→P5. Therefore, the third possible path cannot be considered as an option, and only the first and second possible paths can be selected.
[0162] Table 7
[0163] <![CDATA[P1]]> <![CDATA[P2]]> <![CDATA[P3]]> <![CDATA[P4]]> <![CDATA[P5]]> <![CDATA[P6]]> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0
[0164] All available paths can be combined to form an optional path table, as shown in Table 8:
[0165] Table 8
[0166] Optional Routine Table
[0167] <![CDATA[P1]]> <![CDATA[P2]]> <![CDATA[P3]]> <![CDATA[P4]]> <![CDATA[P5]]> <![CDATA[P6]]> 0 2 2 2 2 2 0 0 3 2 2 2
[0168] The optional path table corresponds to the possible path table, except that Table 8 only includes the first possible path P1→P2→P3→P4→P5→P6 and the second possible path P1→P3→P4→P5→P6, which are in an idle state.
[0169] Selecting a target path from the optional path table according to preset rules will serve as the transmission path from port P1 to port P6. When the preset rule is the shortest path rule, the selected target path is the second possible path, i.e., P1→P3→P4→P5→P6. When the preset rule is the random path selection rule, the selected target path can be either the first possible path, P1→P2→P3→P4→P5→P6, or the second possible path, P1→P3→P4→P5→P6. When the preset rule is the sequential path selection rule, the selected target path can be either the first optional path in sequence (i.e., the first possible path, P1→P2→P3→P4→P5→P6), the second optional path in sequence, or the last optional path in sequence (i.e., the second possible path, P1→P3→P4→P5→P6).
[0170] The selected target path can be stored in a dynamic routing table for later use.
[0171] Another aspect of this disclosure, such as Figure 5 As shown, a path planning device 100 for an on-chip network simulation model is provided. This device 100 can be applied to the methods described above. Specific details not mentioned in the following description can be found in the relevant preceding descriptions and will not be repeated here. The on-chip network includes multiple ports, and the device 100 includes:
[0172] The first establishment module 110 is used to establish a connection characteristic table for the connection characteristics of each port, wherein the connection characteristic table records the physical path direct connection information between any two ports.
[0173] The second establishment module 120 is used to establish a path status table for the path status of each port. The path status table dynamically records the physical direct connection path occupancy information between any two ports.
[0174] The first determining module 130 is used to determine all possible paths from the data transmission start port to the data transmission end port according to the connection characteristic table, wherein in each possible path, there is a physical direct connection path along the data transmission direction between any two adjacent ports.
[0175] The second determining module 140 is used to determine all available paths that are in an idle state from all possible paths according to the path status table;
[0176] The selection module 150 is used to select a target path from all the available paths according to a preset rule, as the transmission path from the data transmission start port to the data transmission end port.
[0177] The path planning device of the on-chip network simulation model in this embodiment can easily and flexibly realize dynamic path planning based on the established connection characteristic table and path state table. It effectively utilizes NoC, reduces data congestion, and improves routing efficiency. The algorithm is simple to implement and has a small simulation computation load, which greatly saves resources for routing planning and simulation. It can also avoid problems such as deadlock during data transmission and improve path reliability. In chip design, it can also quickly evaluate chip performance based on the designer's adjustment of NoC, provide timely feedback, guide chip design and performance optimization, improve the efficiency of chip program compilation, improve the efficiency of neural network compiler automatic program compilation, reduce hardware requirements for running simulation programs, and save costs.
[0178] For example, the first establishment module 110 is used to establish a connection characteristic table for each of the ports, the connection characteristic table recording the physical path direct connection information between any two of the ports, including:
[0179] The first module 110 is specifically used for:
[0180] If there is a physical direct connection path between any two ports, then the physical direct connection information of the two ports is set to the first preset value;
[0181] If there is no physical direct connection path between any two ports, then the physical direct connection information of the two ports is set to the second preset value.
[0182] For example, the second establishment module 120 is used to establish a path status table for the path status of each of the ports. The path status table dynamically records the occupancy information of the physical direct connection path between any two of the ports, including:
[0183] The second module 120 is specifically used for:
[0184] If there is no physical direct connection path between any two ports, or if there is a physical direct connection path but it is idle, then the physical direct connection path occupancy information of the two ports is set to the third preset value.
[0185] If there is a physical direct connection between any two ports and it is in use, then the physical direct connection occupancy information of the two ports is set to the fourth preset value.
[0186] For example, the first determining module 130 is further configured to form a possible path table from all possible paths, and the second determining module 140 is configured to determine all available paths in an idle state from all possible paths according to the path state table, including:
[0187] The second determining module 140 is used for:
[0188] Based on the path status table, a possible path status table is established, and the possible path status table corresponds to the possible path table;
[0189] Based on the possible path table and the possible path status table, all possible paths are determined.
[0190] For example, the second determining module 140 is configured to determine all possible paths based on the possible path table and the possible path status table, including:
[0191] The second determining module 140 is used for:
[0192] The first operation is performed on the corresponding items in the possible path table and the possible path status table to obtain the first operation result of each corresponding item, and the second operation is performed on each of the first operation results in the same possible path to obtain the second operation result, so as to determine all the optional paths according to the second operation result.
[0193] For example, the first establishment module 110 is further configured to set the first preset value to a non-zero value and the second preset value to a zero value; the second establishment module 120 is further configured to set the third preset value to a zero value and the fourth preset value to a non-zero value.
[0194] The second determining module 140 is used to perform a first operation on the corresponding items in the possible path table and the possible path status table to obtain a first operation result for each corresponding item, and to perform a second operation on each of the first operation results in the same possible path to obtain a second operation result, so as to determine all the optional paths according to the second operation result, including:
[0195] The second determining module 140 is specifically used for:
[0196] The corresponding items in the possible path table and the possible path status table are multiplied to obtain the first operation result of each corresponding item, and the first operation results in the same possible path are accumulated to obtain the second operation result corresponding to each possible path;
[0197] The possible path where the result of the second operation is zero is selected as the optional path.
[0198] For example, the selection module 150 is used to select a target path from all the optional paths according to a preset rule, as the transmission path from the data transmission start port to the data transmission end port, including:
[0199] Module 150 is specifically used for:
[0200] Select a target path from all the available paths according to the shortest path rule, the random path selection rule, or the sequential path selection rule.
[0201] Another aspect of this disclosure provides an on-chip network simulation model, said on-chip network simulation model employing the method described above; or,
[0202] The on-chip network simulation model includes the device described above.
[0203] Another aspect of this disclosure provides a multi-core chip including at least one set of computing cores, the chip being configured to perform the methods described above; or,
[0204] The chip includes the device described above.
[0205] Another aspect of this disclosure provides an electronic device comprising:
[0206] One or more processors;
[0207] A storage unit for storing one or more programs that, when executed by one or more processors, enable the one or more processors to implement the method described above.
[0208] Another aspect of this disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, enables the implementation of the method described above.
[0209] The computer-readable storage medium may be included in the apparatus or device disclosed herein, or it may exist independently.
[0210] The computer-readable storage medium can be any tangible medium that contains or stores a program, and can be an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device. More specific examples include, but are not limited to, connections having one or more wires, portable computer disks, hard disks, optical fibers, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0211] The computer-readable storage medium may also include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code, specific examples of which include, but are not limited to, electromagnetic signals, optical signals, or any suitable combination thereof.
[0212] It is understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of this disclosure, and this disclosure is not limited thereto. For those skilled in the art, various modifications and improvements can be made without departing from the spirit and substance of this disclosure, and these modifications and improvements are also considered to be within the scope of protection of this disclosure.
Claims
1. A dynamic path planning method for an on-chip network simulation model, wherein the on-chip network includes multiple ports, characterized in that, The method includes: Establish a connection characteristic table for each port, wherein the connection characteristic table records the physical path direct connection information between any two ports; the physical path direct connection information indicates whether there is a physical direct connection path between two ports; in a certain transmission direction, there is either no physical direct connection path between any two ports or there is only one physical direct connection path. A path status table is established for the path status of each port. The path status table dynamically records the occupancy information of the physical direct connection path between any two ports. The physical direct connection path occupancy information indicates whether the physical direct connection path between two ports is currently occupied. Based on the connection characteristic table, all possible paths from the data transmission start port to the data transmission end port are determined, wherein in each possible path, there is a physical direct connection path along the data transmission direction between any two adjacent ports. Based on the path status table, determine all available paths that are in an idle state from all possible paths; Select a target path from all the available paths according to a preset rule to serve as the transmission path from the data transmission start port to the data transmission end port.
2. The method according to claim 1, characterized in that, The connection characteristic table for establishing the connection characteristics of each port is described above. The connection characteristic table records the direct physical path connection information between any two ports, including: If there is a physical direct connection path between any two ports, then the physical direct connection information of the two ports is set to the first preset value; If there is no physical direct connection path between any two ports, then the physical direct connection information of the two ports is set to the second preset value.
3. The method according to claim 2, characterized in that, The establishment of a path status table for each of the ports, wherein the path status table dynamically records the occupancy information of the physical direct connection path between any two ports, including: If there is no physical direct connection path between any two ports, or if there is a physical direct connection path but it is idle, then the physical direct connection path occupancy information of the two ports is set to the third preset value. If there is a physical direct connection path between any two ports and it is in use, then the physical direct connection path occupancy information of the two ports is set to the fourth preset value.
4. The method according to claim 3, characterized in that, All possible paths form a possible path table. The step of determining all available paths in an idle state from all possible paths based on the path status table includes: Based on the path status table, a possible path status table is established, and the possible path status table corresponds to the possible path table; Based on the possible path table and the possible path status table, all possible paths are determined.
5. The method according to claim 4, characterized in that, The step of determining all possible paths based on the possible path table and the possible path status table includes: The first operation is performed on the corresponding items in the possible path table and the possible path status table to obtain the first operation result of each corresponding item, and the second operation is performed on each of the first operation results in the same possible path to obtain the second operation result, so as to determine all the optional paths according to the second operation result.
6. The method according to claim 5, characterized in that, The first preset value and the fourth preset value are non-zero values, and the second preset value and the third preset value are zero values; The step of performing a first operation on corresponding entries in the possible path table and the possible path status table to obtain a first operation result for each corresponding entry, and performing a second operation on each of the first operation results in the same possible path to obtain a second operation result, so as to determine all the optional paths based on the second operation result, includes: The corresponding items in the possible path table and the possible path status table are multiplied to obtain the first operation result of each corresponding item, and the first operation results in the same possible path are accumulated to obtain the second operation result corresponding to each possible path; The possible path where the result of the second operation is zero is selected as the optional path.
7. The method according to any one of claims 1 to 6, characterized in that, The preset rules include the shortest path rule, the random path selection rule, or the sequential path selection rule.
8. A path planning device for an on-chip network simulation model, wherein the on-chip network includes multiple ports, characterized in that, The device includes: The first establishment module is used to establish a connection characteristic table for the connection characteristics of each port. The connection characteristic table records the physical path direct connection information between any two ports. The physical path direct connection information indicates whether there is a physical direct connection path between two ports. In a certain transmission direction, there is either no physical direct connection path between any two ports or there is only one physical direct connection path. The second establishment module is used to establish a path status table for the path status of each port. The path status table dynamically records the physical direct connection path occupancy information between any two ports. The physical direct connection path occupancy information indicates whether the physical direct connection path between two ports is currently occupied. The first determining module is used to determine all possible paths from the data transmission start port to the data transmission end port according to the connection characteristic table, wherein in each possible path, there is a physical direct connection path along the data transmission direction between any two adjacent ports. The second determining module is used to determine all available paths that are in an idle state from all possible paths based on the path status table; The selection module is used to select a target path from all the available paths according to a preset rule, so as to serve as the transmission path from the data transmission start port to the data transmission end port.
9. An on-chip network simulation model, characterized in that, The on-chip network simulation model adopts the method described in any one of claims 1 to 7; or, The on-chip network simulation model includes the apparatus described in claim 8.
10. A multi-core chip, comprising at least one computing core group, characterized in that, The chip is used to perform the method according to any one of claims 1 to 7; or, The chip includes the device of claim 8.
Citation Information
Patent Citations
Fault-tolerant on-chip network system with global communication service management capability and method
CN103973482A
Network-on-chip congestion control method based on dynamic routing table
CN104202253A
