Data processing method, device and electronic equipment
By generating and distributing codes in many-core chips and dynamically updating the priority order of data sources, it solves the problem of priority and delay imbalance among multiple data sources, and achieves data transmission efficiency improvement and delay balance.
Patent Information
- Application Number
- CN201911252455.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-09
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2039-12-09
AI Technical Summary
In many-core chip design, how to efficiently determine the data source for priority transmission among multiple data sources and dynamically adjust the priority order of data to improve the communication efficiency of the on-chip network and the balance of arbitration delay.
By determining the number of data sources, generating codes, and assigning them to data sources in a set order, the priority order is dynamically updated to ensure that data sources can alternately arbitrate according to codes during arbitration, thereby achieving a balance between priority and delay.
It effectively solves the problem of uneven data transmission delay, ensures the priority balance and arbitration delay balance between data sources, and improves the communication efficiency of the on-chip network.
Smart Images

Figure CN113032109B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to a data processing method, device and electronic device. Background Art
[0002] With the development of artificial intelligence technology, users have higher and higher requirements for chip processing capabilities. Since the processing power of single-core chips is limited, many-core chips are increasingly used. In the design of many-core chips, networks on chip (NOC) are used to achieve communication between cores. Therefore, the performance of NOC is the key to the performance of many-core chips. Cores communicate with each other through data channels, and the performance of NOC is improved through arbitration of data channels, that is, the communication efficiency of NOC is improved.
[0003] Therefore, when implementing multi-level arbitration, how to efficiently determine the data source with priority transmission among multiple data sources and dynamically adjust the priority order of data is a problem that needs to be solved at present. Summary of the invention
[0004] In view of this, the embodiments of the present disclosure provide a data processing method, device and electronic device for solving the problem in the prior art of how to efficiently determine a data source for priority transmission among multiple data sources and dynamically adjust the priority order of data.
[0005] According to a first aspect of an embodiment of the present disclosure, a method for data processing is provided, including: determining the number of data sources at any level of arbitration; generating codes according to a set coding method based on the number of data sources; assigning the codes to the data sources according to a set order; determining a target code corresponding to the data source; arbitrating the data source corresponding to the target code according to the target code and the priority order corresponding to the target code, and updating the priority order.
[0006] Through the above method, when the arbitrator of any level of arbitration receives data from the data sources corresponding to two data channels respectively, the codes can be assigned to the data sources according to the set order, so that the data sources corresponding to the two data channels are arbitrated alternately according to the codes, thereby ensuring the balance of arbitration delay.
[0007] In one embodiment, generating codes according to a set coding method based on the number of data sources specifically includes: generating codes according to a binary method based on the number of data sources, and the number of codes is equal to the number of data sources.
[0008] By this method, the code is generated in a binary manner, which can help to interchange the coding bits of the code to generate an interchanged code.
[0009] In one embodiment, a plurality of data source groups are included, each data source group includes at least one data source.
[0010] The step of allocating the codes to the data sources in a set order includes:
[0011] Determine the code corresponding to each data source group according to the order of the codes and the number of data sources in each data source group;
[0012] The codes corresponding to the data source group are assigned to the data sources of the data source group one by one.
[0013] Through the above method, the data source can quickly obtain its own corresponding code by allocating them one by one in the order of codes.
[0014] In one embodiment, determining the target code corresponding to the data source specifically includes: swapping the coding bits of the code assigned to the data source to generate an interchange code; and determining the interchange code as the target code of the data source.
[0015] Through the above method, the data source obtains the target code after the coding bits are swapped, and arbitration can be performed through the target code.
[0016] In one embodiment, a plurality of data source groups are included, each data source group includes at least one data source, and the method further includes: interchanging the encoding bits of the encodings to generate interchange codes corresponding to the encodings;
[0017] The allocating the codes to the data sources according to a set order comprises:
[0018] Determine the interchange code corresponding to each data source group according to the order of the codes, the number of data sources in each data source group, and the interchange code corresponding to each code;
[0019] Allocating the interchange codes corresponding to the data source group one by one to the data sources of the data source group;
[0020] Determining the target code corresponding to the data source includes:
[0021] The interchange encoding is determined as the target encoding of the data source.
[0022] Through the above method, the codes are first interchanged to generate interchange codes, and then the interchange codes are assigned to the data sources one by one, and the data sources can directly obtain the target codes after the interchange.
[0023] In one embodiment, the arbitrating the data source corresponding to the target code according to the code and updating the priority order specifically includes: arbitrating the data source corresponding to the target code according to the target code and the priority order corresponding to the target code, determining the data source that obtains the right to use the channel, and reducing the priority of the target code of the data source that obtains the right to use the channel to the last bit in the priority order.
[0024] By using the above method, the priority of the code of the data source that obtains the channel use right is reduced to the last one in the priority sequence, so that the priority balance between the data sources can be achieved.
[0025] According to a second aspect of an embodiment of the present disclosure, a data processing device is provided, comprising: a determination unit, for determining the number of data sources at any level of arbitration; a generation unit, for generating codes according to a set coding method based on the number of data sources; an allocation unit, for allocating the codes to the data sources according to a set order; the determination unit is also used to determine a target code corresponding to the data source; a processing unit, for arbitrating the data source corresponding to the target code according to the target code and the priority order corresponding to the target code, and updating the priority order.
[0026] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a plurality of processing cores; and an on-chip network configured to exchange data between the plurality of processing cores and external data; instructions are stored in the plurality of processing cores, and according to the instructions the electronic device executes a method as described in the first aspect or any possible method of the first aspect.
[0027] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method as described in the first aspect or any possible method of the first aspect is implemented.
[0028] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided. When the computer program product is run on a computer, the computer is caused to execute the method as described in the first aspect or any possible method of the first aspect.
[0029] The disclosed embodiment determines the number of data sources at any level of arbitration; generates codes according to the number of data sources in accordance with a set coding method; assigns the codes to the data sources in a set order; determines the target codes corresponding to the data sources; arbitrates the data sources corresponding to the target codes according to the target codes and the priority order corresponding to the target codes, and updates the priority order. Through the above method, when the arbitrator of any level of arbitration receives data from the data sources corresponding to two data channels respectively, the codes can be assigned to the data sources in a set order, so that the data sources corresponding to the two data channels are alternately arbitrated according to the codes, thereby ensuring the balance of arbitration delay. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0031] Figure 1 It is a data transmission schematic diagram provided in the prior art;
[0032] Figure 2 is a flow chart of a data processing method provided by an embodiment of the present disclosure;
[0033] Figure 3 is a schematic diagram of a data processing device provided by an embodiment of the present disclosure;
[0034] Figure 4 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0035] The present disclosure is described below based on embodiments, but the present disclosure is not limited to these embodiments. In the detailed description of the present disclosure below, some specific details are described in detail. It is possible for a person skilled in the art to fully understand the present disclosure without the description of these details. In order to avoid confusing the essence of the present disclosure, known methods, processes, flows, components and circuits are not described in detail.
[0036] In addition, persons of ordinary skill in the art will appreciate that the drawings provided herein are for illustration purposes and are not necessarily drawn to scale.
[0037] Unless the context clearly requires otherwise, words such as “include”, “including” and the like in the specification should be interpreted as including rather than being exclusive or exhaustive; that is, as meaning “including but not limited to”.
[0038] In the description of the present disclosure, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present disclosure, unless otherwise specified, the meaning of "plurality" is two or more.
[0039] Generally, in the prior art, arbitration schemes for NOC data channels include a fixed priority arbitration scheme and a flat round-robin priority arbitration scheme. The arbitration of the data channel is to determine the priority of the data according to arbitration, and then obtain the right to use the data channel.
[0040] Case 1: Fixed priority arbitration scheme. The priority of the data source is fixed. It is suitable for arbitration with a specific priority order, but it cannot realize dynamic adjustment of the priority. For example, Figure 1As shown, it is assumed that there are 8 data sources, namely data (date) 0 data source, date 1 data source, date 2 data source, date 3 data source, date 4 data source, date 5 data source, date 6 data source and date 7 data source. The above 8 data sources are transmitted to the destination after three levels of arbitration. Due to the limited data channels, multiple data need to compete for the use of data channels. For example, date 0 and date 1 judge the priority according to the arbiter (ARB) 1 of the first-level arbitration, and compete for the priority use right of channel 1; date 2 and date 3 judge the priority according to the ARB2 of the first-level arbitration, and compete for the priority use right of channel 2; date 4 and date 5 judge the priority according to the ARB3 of the first-level arbitration, and compete for the priority use right of channel 3; date 6 and date 7 judge the priority according to the ARB4 of the first-level arbitration, and compete for the priority use right of channel 4; the output data of channel 1 needs to continue to communicate with ch The output data of annel2 judges the priority through ARB5 of the second-level arbitration, and competes for the priority use right of channel5, that is, the ones competing for the priority use right of channel5 include date0, date1, date2 and date3; the output data of Channel3 needs to continue to judge the priority with the output data of channel4 through ARB6 of the second-level arbitration, and compete for the priority use right of channel6, that is, the ones competing for the priority use right of channel6 include date4, date5, date6 and date7; the output data of Channel5 needs to continue to judge the priority with the output data of channel6 through ARB7 of the third-level arbitration, and compete for the priority use right of channel7, that is, the ones competing for the priority use right of channel7 include date0, date1, date2, date3, date4, date5, date6 and date7; and so on, which will not be elaborated in the embodiment of the present disclosure until the data is transmitted to the destination. The fixed priority arbitration scheme can be used to pre-set the priority of the data source corresponding to each data. Assume that the priority of the data of the date0 data source is set higher than the priority of the data of the date1 data source in arbitrator 1. When the data of the date0 data source and the data of the date1 data source are transmitted at the same time, the data of the date0 data source obtains priority use of channel 1, and the priority cannot be changed.
[0041] Case 2: The equal rights round-robin priority arbitration scheme can achieve dynamic adjustment of data priority, but it cannot alleviate the imbalance of data transmission delay. Figure 1It can be seen that the data sources date0 to date7 are encoded according to the encoding sequence shown in Table 1. The length of the encoding of each data source in Table 1 is 3 bits, as follows:
[0042] Table 1
[0043] Data Source coding date0 000 date1 001 date2 010 date3 011 date4 100 date5 101 date6 110 date7 111
[0044] Table 1 above is the encoding of the data source. The initial priority order of the data source is date0>date1>date2>date3>date4>date5>date6>date7, that is, the corresponding encoding priority order is 000>001>010>011>100>101>110>111. Equal rights rotation priority arbitration is performed based on the above initial priority order. Assume that, taking the third-level arbitration as an example, the data input from channel5 by ARB7 may come from data sources date0, date1, date2, and date3, and the data input from channel6 may come from date4, date5, date6, and date7. According to the equal rights polling arbitration scheme, the specific arbitration process is as follows: 1. The first data arbitration: Assume that data0 competes with data4 for the priority use right of channel7. According to the initial priority order, data0 is determined to obtain the priority use right. Due to the equal rights rotation, the priority of data0 becomes the lowest in the next arbitration, that is, the priority order of the data source is date1>date2>date3>date4>date5>date6>date7>date0. In other words, the corresponding The priority order of the codes is 001>010>011>100>101>110>111>000; 2. Second data arbitration: Assume that data1 continues to compete with data4 for the priority right to use channel7. Similarly, data1 obtains the priority right. Due to the equal rights rotation, the priority of data1 becomes the lowest in the next arbitration. That is, the priority order of the data source is date2>date3>date4>date5>date6>date7>date0>date1, which means that the corresponding priority order of the codes is 010>011>100. >101>110>111>000>001; 3. The third data arbitration: Assume that data2 continues to compete with data4 for the priority right to use channel7. Similarly, data2 obtains the priority right. Due to the equal rights rotation, the priority of data2 becomes the lowest in the next arbitration. That is, the priority order of the data source is date3>date4>date5>date6>date7>date0>date1>date2. In other words, the corresponding encoding priority order is 011>100>101>110>111>000>001>010;4. The fourth data arbitration: Assuming that data3 continues to compete with data4 for the priority right to use channel7, similarly, data3 obtains the priority right. Due to the equal rights rotation, the priority of data3 becomes the lowest in the next arbitration, that is, the priority order of the data source is date4>date5>date6>date7>date0>date1>date2>date3, that is, the corresponding encoding priority order is 100>101>110>111>000>001>010>011; 5. The fifth data arbitration: Assuming that data0 continues to compete with data4 for the priority right to use channel7, similarly, dat a4 obtains the priority right to use. Due to the equal rights rotation, the priority of data4 becomes the lowest in the next arbitration, that is, the priority order of the data source is date5>date6>date7>date0>date1>date2>date3>date4, that is, the corresponding encoding priority order is 101>110>111>000>001>010>011>100; 6. The sixth data arbitration: Assume that data0 continues to compete with data5 for the priority right to use channel7. Similarly, data5 obtains the priority right to use. Due to the equal rights rotation, the priority of data5 becomes the lowest in the next arbitration, that is, the priority order of the data source It is date6>date7>date0>date1>date2>date3>date4>date5, that is to say, the corresponding encoding priority order is 110>111>000>001>010>011>100>101; 7. The seventh data arbitration: Assume that data0 continues to compete with data6 for the priority right to use channel7. Similarly, data6 obtains the priority right. Due to the equal rights rotation, the priority of data5 becomes the lowest in the next arbitration. That is, the priority order of the data source is date7>date0>date1>date2>date3>date4>date5>date6 , that is to say, the priority order of the corresponding codes is 111>000>001>010>011>100>101>110; 8. The eighth data arbitration: Assume that data0 continues to compete with data7 for the priority right to use channel7. Similarly, data7 obtains the priority right. Due to the equal rights rotation, the priority of data7 becomes the lowest in the next arbitration. That is, the priority order of the data source is date0>date1>date2>date3>date4>date5>date6>date7. That is to say, the priority order of the corresponding codes is 000>001>010>011>100>101>110>111;From the above scheme, it can be seen that during the first data arbitration to the fourth data arbitration, the output data date4, date5, date6 and date7 of channel6 are blocked, and during the fifth data arbitration to the eighth data arbitration, the output data date0, date1, date2 and date3 of channel5 are blocked, resulting in uneven data transmission delay. ;
[0045] In the embodiments of the present disclosure, the data channel may also be referred to as a transmission channel, which is not limited in the embodiments of the present disclosure.
[0046] The present disclosure provides a data processing method, such as Figure 2 As shown, including:
[0047] Step S200: Determine the number of data sources at any level of arbitration.
[0048] In a possible implementation manner, any one level of arbitration obtains data from data sources of two data channels, and the number of the data sources is at least two.
[0049] For example, Figure 1 As shown, the arbitrator 7 of the third-level arbitration obtains data from the data sources corresponding to channels 5 and 6, wherein the output data from channel 5 may be date0, date1, date2 and date3, and the output data from channel 6 may be date4, date5, date6 and date7, that is, the number of data sources for the third-level arbitration is 8.
[0050] Step S201: Generate a code according to the number of data sources and the set coding method.
[0051] In a possible implementation manner, a priority order of the codes is determined according to the codes.
[0052] In a possible implementation, codes are generated in a binary manner according to the number of the data sources, and the number of the codes is equal to the number of the data sources.
[0053] For example, since the number of data sources is 8, a 3-bit binary code can be used, and the specific codes may be 000, 001, 010, 011, 100, 101, 110 and 111, 8 binary codes; when the number of data sources is 16, a 4-bit binary code can be used, and the specific codes may be 0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110 and 1111; in the embodiment of the present disclosure, as the number of data sources increases, the number of bits in the binary code increases, which is determined according to actual conditions.
[0054] Step S202: assign the codes to the data sources according to a set order.
[0055] In the embodiment of the present disclosure, when the codes are assigned to the data sources in a set order, two methods may be included:
[0056] Method 1, including multiple data source groups, each data source group includes at least one data source, wherein the codes are assigned to the data sources in a set order, including: determining the codes corresponding to each data source group according to the order of the codes and the number of data sources in each data source group; and assigning the codes corresponding to the data source groups to the data sources of the data source groups one by one.
[0057] For example, the codes are sorted from small to large according to the corresponding numerical values of the codes, 000, 001, 010, 011, 100, 101, 110 and 111, and the data sources include date0, date1, date2, date3, date4, date5, date6 and date7. Date0, date1, date2 and date3 can be output from channel a, and date4, date5, date6 and date7 can be output from channel b. For example, according to the channel output by the data source, the above data sources are divided into two groups, the first group includes date0, date1, date2 and date3, and the second group includes date4, date5, date6 and date7. According to the order of the codes and the number of data sources in each data source group, it is determined that the codes corresponding to the first group can be: 000, 001, 010, 011, and the codes corresponding to the second group can be: 100, 101, 110, 111. Then, the codes corresponding to the first group are assigned to the first group of date0, date1, date2 and date3 one by one, and the codes corresponding to the second group are assigned to the data sources of the second group one by one, and the following Table 2 is obtained:
[0058] Table 2
[0059]
[0060] It should be understood that when the codes are assigned to the data sources in a set order, the codes can also be assigned to each data source one by one in the order of the codes. When multiple data source groups are included, for example, when two data source groups are included, the codes can be assigned to each data source of the first group one by one from small to large in the order of the codes, and when the first group is all assigned with codes, the remaining codes are assigned to each data source of the second group one by one from small to large. The present disclosure does not limit the number of data source groups, the number of data sources in each data source group, and the way of assigning codes to data sources in a set order.
[0061] Method 2: The coding bits of the codes can be interchanged to generate interchange codes corresponding to each code; the codes are assigned to the data sources in a set order, including determining the interchange codes corresponding to each data source group according to the order of the codes, the number of data sources in each data source group and the interchange codes corresponding to each code; the interchange codes corresponding to the data source groups are assigned one by one to the data sources of the data source groups; and the determination of the target code corresponding to the data source includes: determining the interchange code as the target code of the data source.
[0062] In a possible implementation, the coding bits of the code are interchanged to generate an interchange code, and 000, 001, 010, 011, 100, 101, 110 and 111 are interchanged symmetrically in the base center to generate an interchange code, and the following Table 3 is obtained:
[0063] Table 3
[0064] coding 000 001 010 011 100 101 110 111 Interchange code 000 100 010 110 001 101 011 111
[0065] In a possible implementation, as mentioned above, the data sources are divided into two groups, the first group includes date0, date1, date2 and date3, and the second group includes date4, date5, date6 and date7. The interchange codes corresponding to each data source group can be determined according to the order of the codes, the number of data sources in each data source group, and the interchange codes corresponding to each code. For example, the interchange codes corresponding to the first group are determined to be: 000, 100, 010 and 110. The interchange codes corresponding to the second group are: 001, 101, 011 and 111. The interchange codes corresponding to the first group can be assigned one by one to the first group of date0, date1, date2 and date3, and the interchange codes corresponding to the second group can be assigned one by one to the data sources of the second group, to obtain the following Table 4:
[0066] Table 4
[0067]
[0068] Wherein, when the codes are assigned to the data sources in a set order, the interchange codes corresponding to the codes may be assigned to the data sources one by one in the order of the codes. When multiple data source groups are included, for example, two data source groups, the interchange codes corresponding to the codes may be assigned to the data sources of the first group one by one in the order of the codes, for example, from small to large. When the first group is all assigned with interchange codes, the interchange codes corresponding to the remaining codes may be assigned to the data sources of the second group one by one.
[0069] Step S203: Determine the target code corresponding to the data source.
[0070] In the embodiment of the present disclosure, corresponding to method 1 in step S202, step S203 may be to perform bit-by-bit swapping of the coding bits of the coding assigned to the data source to generate an interchange code; and determine the interchange code as the target code of the data source.
[0071] In a possible implementation, after 000, 001, 010, 011, 100, 101, 110 and 111 are assigned to the data source in the order of date0, date1, date2, date3, date4, date5, date6 and date7, the coding bits of the codes are interchanged to generate interchange codes, and the following Table 5 is obtained:
[0072] Table 5
[0073]
[0074] As can be seen from Table 5, the codes include: 000, 001, 010, 011, 100, 101, 110 and 111. The interchange codes obtained by bit swapping also include: 000, 001, 010, 011, 100, 101, 110 and 111. The codes of some data sources are the same as the interchange codes, while the codes of some data sources are different from the interchange codes.
[0075] Corresponding to the second method in step S202, step S203 specifically allocates the generated interchange codes to the data sources one by one in sequence.
[0076] In a possible implementation, the interchange codes are as shown in Table 3, and the generated interchange codes are assigned to the data sources one by one in sequence to obtain a table similar to Table 4.
[0077] Step S204: arbitrate the data source corresponding to the target code according to the target code and the priority order corresponding to the target code, and update the priority order.
[0078] In a possible implementation, the priority order corresponding to the target coding may be determined according to the priority order of the coding, or may be determined by itself, for example, according to the numerical order corresponding to the target coding, which is not limited in the embodiments of the present disclosure.
[0079] In one possible implementation, based on the target code and the priority order corresponding to the target code, the data source corresponding to the target code is arbitrated, the data source that obtains the right to use the channel is determined, and the priority of the target code of the data source that obtains the right to use the channel is reduced to the last one in the priority order.
[0080] For example, assuming that the initial priority order is 000>001>010>011>100>101>110>111, according to Table 4 or Table 5, the priority order of the data source is determined to be date0>date4>date2>date6>date1>date5>date3>date7, assuming that data0 and data4 arbitrate, data0 obtains data channel priority, and in the next arbitration, the priority of data0 becomes the lowest, and the priority order is updated to be date4>date2>date6>date1>date5>date3>date7>date0. And so on, the embodiments of the present disclosure will not be repeated.
[0081] The data transmission process is described below by using a specific embodiment. Figure 1For example, the arbitrator ARB7 in the arbitration channel 7 is coded in the order generated by the binary method as follows: the data0 data source is coded as 000, the data1 data source is coded as 001, the data2 data source is coded as 010, the data3 data source is coded as 011, the data source of channel 5 input ARB7 may be date0, date1, date2 or date3, the data4 data source is coded as 100, the data5 data source is coded as 101, the data6 data source is coded as 110, the data7 data source is coded as 111, and the channel 6 input ARB7 is coded as 111. The data source may be date4, date5, date6 or date7. The codes of each data source are interchanged center-symmetrically to determine that the interchange codes of each data source are: the code of data0 data source is 000, the code of data1 data source is 100, the code of data2 data source is 010, the code of data3 data source is 110, the code of data4 data source is 001, the code of data5 data source is 101, the code of data6 data source is 011, and the code of data7 data source is 111. The initial priority order is 000>001>010>011>100>101>110>111.
[0082] The first data arbitration is performed for the first time, specifically: assuming that channel5 inputs data source date0 and the target code is 000, assuming that channel6 inputs data source date4 and the target code is 001. Since the priority order is 000>001, it is determined that the priority of date0 is higher than that of date4. Therefore, the input data source of data0 obtains the right to use channel7, and the priority of date0 is reduced to the lowest. The update priority order is 001>010>011>100>101>110>111>000; then the second data arbitration is performed, specifically: assuming that channel5 inputs data source date1 and the target code is 100, assuming that c Channel 6 inputs data source date4, and the target code is 001. Since the priority order is 001>100, it is determined that the priority of date4 is higher than that of date1. Therefore, the input data source of data4 obtains the right to use channel 7, and the priority of date4 is reduced to the lowest. The update priority order is 010>011>100>101>110>111>000>001. Then the third data arbitration is carried out, specifically: assuming that channel 5 inputs data source date1, and the target code is 100; assuming that channel 6 inputs data source date5, and the target code is 101, since the priority order is 100>101, it is determined that date1 The priority of is higher than that of date5, so the input data source of data1 obtains the right to use channel7, and the priority of date1 is reduced to the lowest. The update priority order is 010>011>101>110>111>000>001>100; then the fourth data arbitration is carried out, specifically: assuming that the input data source of channel5 is date2, and the target code is 010, assuming that the input data source of channel6 is date5, and the target code is 101, since the priority order is 101>010, it is determined that the priority of date5 is higher than that of date2, so the input data source of data5 obtains the right to use channel7, and date5 The priority of channel 7 is reduced to the lowest, and the update priority order is 010>011>110>111>000>001>100>101; then the fifth data arbitration is carried out, specifically: assuming that channel 5 inputs data source date2 and the target code is 010, assuming that channel 6 inputs data source date6 and the target code is 011, since the priority order is 010>011, it is determined that the priority of date2 is higher than the priority of date6, so the input data source of data2 obtains the right to use channel 7, and the priority of date2 is reduced to the lowest, and the update priority order is>011>110>111>000>001>100>101>010;Then the sixth data arbitration is carried out, specifically: assuming that channel5 inputs data source date3, and the target code is 110, assuming that channel6 inputs data source date6, and the target code is 011, since the priority order is 110>011, it is determined that the priority of date6 is higher than the priority of date3, so the input data source of data6 obtains the right to use channel7, and the priority of date6 is reduced to the lowest, and the update priority order is 110>111>000>001>100>101>010>011; then the seventh data arbitration is carried out, specifically: assuming that channel5 inputs data source date3, and the target code is 110, assuming that channel6 inputs data source date7, and the target code is 111, since the priority order is 110>111, date3 is determined. The priority of is higher than that of date7, so the input data source of data3 obtains the right to use channel7, the priority of date3 is reduced to the lowest, and the update priority order is 111>000>001>100>101>010>011>110; then the eighth data arbitration is performed, specifically: assuming that the input data source of channel5 is date0, the target code is 000, assuming that the input data source of channel6 is date7, the target code is 111, because the priority order is 111>000, it is determined that the priority of date7 is higher than that of date0, so the input data source of data7 obtains the right to use channel7, the priority of date7 is reduced to the lowest, and the update priority order is 000>001>100>101>010>011>110>111. In the embodiment of the present disclosure, the subsequent data arbitration method is the same as the above, and it will not be described in detail. ;
[0083] Through the above solution, the data of channel 5 and channel 6 obtain the right to use channel 7 alternately, which solves the problem of unbalanced data transmission delay. Moreover, as the number of data sources of channel 5 and channel 6 increases, the effect of the balance of the data transmission delay can be more demonstrated.
[0084] In the embodiment of the present disclosure, the arbitrator may be a component module of the NOC.
[0085] Figure 3 Schematic diagram of a data processing device provided by an embodiment of the present disclosure. Figure 3As shown, the data processing device of this embodiment includes: a determination unit 301, a generation unit 302, an allocation unit 303 and a processing unit 304. The determination unit 301 is used to determine the number of data sources at any level of arbitration; the generation unit 302 is used to generate codes according to the number of data sources in accordance with a set coding method; the allocation unit 303 is used to allocate the codes to the data sources in a set order; the determination unit 301 is also used to determine the target code corresponding to the data source; the processing unit 304 is used to arbitrate the data source corresponding to the target code according to the target code and the priority order corresponding to the target code, and update the priority order.
[0086] In one embodiment, the generating unit 302 is specifically configured to generate codes in a binary manner according to the number of the data sources, and the number of the codes is equal to the number of the data sources.
[0087] In one embodiment, multiple data source groups are included, each data source group includes at least one data source, and the allocation unit 303 is specifically used to allocate the codes to the data sources according to a set order, including: determining the codes corresponding to each data source group according to the order of the codes and the number of data sources in each data source group; and allocating the codes corresponding to the data source groups to the data sources of the data source groups one by one.
[0088] In one embodiment, the determining unit 301 is further configured to perform bit-by-bit swapping of the coding bits of the coding allocated to the data source to generate a swapped coding; and determine the swapped coding as the target coding of the data source.
[0089] In one embodiment, multiple data source groups are included, each data source group includes at least one data source, and the processing unit 304 is further used to: bit-interchange the coding bits of the coding to generate interchange codes corresponding to each coding; the allocation unit 303 is specifically used to: determine the interchange codes corresponding to each data source group according to the order of the coding, the number of data sources in each data source group and the interchange codes corresponding to each coding; allocate the interchange codes corresponding to the data source groups to the data sources of the data source groups one by one; the determination unit 301 is specifically used to: determine the interchange codes as the target codes of the data sources.
[0090] In one embodiment, the processing unit 304 is specifically used to: arbitrate the data source corresponding to the target code according to the target code and the priority order corresponding to the target code, determine the data source that obtains the right to use the channel, and reduce the priority of the target code of the data source that obtains the right to use the channel to the last one in the priority order.
[0091] Figure 4Schematic diagram of the structure of the electronic device according to the embodiment of the present disclosure. Figure 4 As shown, the electronic device of this embodiment includes processing cores 11-1N and an on-chip network 14. The processing cores 11-1N are all connected to the on-chip network 14. The on-chip network 14 is used to exchange data between the N processing cores and external data. The N processing cores store instructions, and the electronic device performs the following operations according to the instructions: determine the number of data sources at any level of arbitration; generate codes according to the set coding method according to the number of data sources; assign the codes to the data sources according to the set order; determine the target code corresponding to the data source; arbitrate the data source corresponding to the target code according to the target code and the priority order corresponding to the target code, and update the priority order.
[0092] As will be appreciated by those skilled in the art, various aspects of the disclosed embodiments may be implemented as systems, methods, or computer program products. Therefore, various aspects of the disclosed embodiments may take the form of a complete hardware implementation, a complete software implementation (including firmware, resident software, microcode, etc.), or an implementation that combines software aspects with hardware aspects, which may generally be referred to herein as a "circuit," "module," or "system." In addition, various aspects of the disclosed embodiments may take the form of a computer program product implemented in one or more computer-readable media having a computer-readable program code implemented thereon.
[0093] Any combination of one or more computer-readable media can be utilized. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, (but not limited to) electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or apparatuses, or any suitable combination of the foregoing. More specific examples (non-exhaustive enumeration) of computer-readable storage media will include the following: an electrical connection with one or more wires, a portable computer floppy disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of the embodiments of the present disclosure, a computer-readable storage medium can be any tangible medium that can contain or store a program used by an instruction execution system, device or apparatus or a program used in conjunction with an instruction execution system, device or apparatus.
[0094] A computer readable signal medium may include a propagated data signal having a computer readable program code implemented therein, such as in baseband or as part of a carrier wave. Such propagated signals may take any of a variety of forms, including but not limited to electromagnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any of the following computer readable media: not a computer readable storage medium, and may communicate, propagate, or transmit a program used by or in conjunction with an instruction execution system, device, or apparatus.
[0095] Program code embodied on a computer readable medium may be transmitted using any appropriate medium including, but not limited to, wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0096] The computer program code for performing the operations for various aspects of the disclosed embodiments can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, Smalltalk, C++, etc., and conventional process programming languages such as "C" programming language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer as a stand-alone software package; partially on the user's computer and partially on a remote computer; or completely on a remote computer or server. In the latter case, the remote computer can be connected to the user's computer through any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., by using the Internet of an Internet service provider).
[0097] The flowchart legend and / or block diagram of the method, device (system) and computer program product according to the above-mentioned embodiment of the present disclosure describes various aspects of the embodiment of the present disclosure. It will be understood that each block of the flowchart legend and / or block diagram and the combination of blocks in the flowchart legend 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 or other programmable data processing device to produce a machine so that (via the processor of a computer or other programmable data processing device) instructions are created to implement the device for the function / action specified in the flowchart and / or block diagram block or block.
[0098] These computer program instructions may also be stored in a computer-readable medium that can direct a computer, other programmable data processing device, or other apparatus to operate in a particular manner, so that the instructions stored in the computer-readable medium produce an article of manufacture including instructions for implementing the functions / actions specified in the flowchart and / or block diagram blocks or blocks.
[0099] The computer program instructions may also be loaded onto a computer, other programmable data processing device or other apparatus so that a series of operable steps are performed on the computer, other programmable device or other apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide a process for implementing the functions / actions specified in the flowchart and / or block diagram block or blocks.
[0100] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for data processing, characterized in that: include: Determine the number of data sources at any level of arbitration; Generate codes according to the number of data sources in accordance with a set coding method, wherein the number of codes is equal to the number of data sources; assigning the codes to the data sources in a set order; Determine the target code corresponding to the data source; According to the target code and the priority order corresponding to the target code, the data source corresponding to the target code is arbitrated, and the priority order is updated after each arbitration is completed, and the priority of the target code of the data source that obtains the channel use right is reduced to the last one in the priority order; The step of determining the target code corresponding to the data source specifically includes: Interchanging the code bits of the code assigned to the data source to generate an interchange code; The interchange encoding is determined as the target encoding of the data source.
2. The method according to claim 1, characterized in that The generating of the code according to the set coding mode according to the number of the data sources includes: The codes are generated in a binary manner according to the number of the data sources, and the number of the codes is equal to the number of the data sources.
3. The method according to claim 1, characterized in that comprising a plurality of data source groups, each data source group comprising at least one data source, The step of allocating the codes to the data sources in a set order includes: Determine the code corresponding to each data source group according to the order of the codes and the number of data sources in each data source group; The codes corresponding to the data source group are assigned to the data sources of the data source group one by one.
4. The method according to claim 1, characterized in that comprising a plurality of data source groups, each data source group comprising at least one data source, The method further comprises: interchanging the coding bits of the codes to generate interchanging codes corresponding to the codes; The allocating the codes to the data sources according to a set order comprises: Determine the interchange code corresponding to each data source group according to the order of the codes, the number of data sources in each data source group, and the interchange code corresponding to each code; Allocating the interchange codes corresponding to the data source group one by one to the data sources of the data source group; Determining the target code corresponding to the data source includes: The interchange encoding is determined as the target encoding of the data source.
5. The method according to any one of claims 1 to 4, characterized in that The arbitrating the data source corresponding to the target code according to the target code and the priority order corresponding to the target code, and updating the priority order, comprises: According to the target code and the priority order corresponding to the target code, the data source corresponding to the target code is arbitrated to determine the data source that obtains the right to use the channel, and the priority of the target code of the data source that obtains the right to use the channel is reduced to the last one in the priority order.
6. A data processing device, characterized in that: include: A determination unit, used to determine the number of data sources at any level of arbitration; A generating unit, configured to generate codes according to a set coding method based on the number of the data sources, wherein the number of the codes is equal to the number of the data sources; An allocating unit, configured to allocate the codes to the data sources according to a set order; The determining unit is further used to determine the target code corresponding to the data source; a processing unit, configured to arbitrate the data source corresponding to the target code according to the target code and the priority order corresponding to the target code, update the priority order after each arbitration, and reduce the priority of the target code of the data source that obtains the channel use right to the last one in the priority order; The determining unit is specifically used for: Interchanging the code bits of the code assigned to the data source to generate an interchange code; The interchange encoding is determined as the target encoding of the data source.
7. An electronic device, characterized in that: The electronic device comprises: multiple processing cores; and A network on chip configured as a communication structure for exchanging data between the plurality of processing cores and external data; Instructions are stored in the multiple processing cores, and the electronic device executes the method as described in any one of claims 1-5 according to the instructions.
8. A computer-readable storage medium storing computer program instructions, characterized in that: The computer program instructions implement the method according to any one of claims 1 to 5 when executed by a processor.
Citation Information
Patent Citations
Router and transmission method thereof on packet-circuit switching chip
CN101778049A
Method For Traffic Prioritization In Memory Device, Memory Device And Storage System
CN103914412A
Asynchronous fault-tolerant network-on-chip router design method
CN104065570A
Novel compact, efficient and fast on-chip network router based on network coding
CN105871730A
NoC arbitration method based on global node information in GPGPU
CN108199985A
