CN113868157A - Arbitration method and device for AHB system bus, AHB system bus and medium - Google Patents
Arbitration method and device for AHB system bus, AHB system bus and medium Download PDFInfo
- Publication number
- CN113868157A CN113868157A CN202110962618.6A CN202110962618A CN113868157A CN 113868157 A CN113868157 A CN 113868157A CN 202110962618 A CN202110962618 A CN 202110962618A CN 113868157 A CN113868157 A CN 113868157A
- Authority
- CN
- China
- Prior art keywords
- data
- data channel
- weight
- arbitration
- channel
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000012544 monitoring process Methods 0.000 claims abstract description 97
- 238000004590 computer program Methods 0.000 claims description 10
- 238000012545 processing Methods 0.000 claims description 10
- 238000001514 detection method Methods 0.000 claims description 4
- 238000004364 calculation method Methods 0.000 description 8
- 230000005540 biological transmission Effects 0.000 description 7
- DRHKJLXJIQTDTD-OAHLLOKOSA-N Tamsulosine Chemical compound CCOC1=CC=CC=C1OCCN[C@H](C)CC1=CC=C(OC)C(S(N)(=O)=O)=C1 DRHKJLXJIQTDTD-OAHLLOKOSA-N 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 230000002159 abnormal effect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 101100412394 Drosophila melanogaster Reg-2 gene Proteins 0.000 description 1
- 230000005856 abnormality Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/10—Program control for peripheral devices
- G06F13/12—Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor
- G06F13/124—Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine
- G06F13/126—Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware is a sequential transfer control unit, e.g. microprocessor, peripheral processor or state-machine and has means for transferring I/O instructions and statuses between control unit and main processor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/16—Handling requests for interconnection or transfer for access to memory bus
- G06F13/1605—Handling requests for interconnection or transfer for access to memory bus based on arbitration
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Microelectronics & Electronic Packaging (AREA)
- Bus Control (AREA)
Abstract
The application discloses an arbitration method and device for an AHB system bus, the AHB system bus and a medium, comprising: monitoring the data flow of each data channel in real time in a preset monitoring period to obtain a first data flow corresponding to each data channel; determining the actual arbitration weight of each data channel by using the first data flow at the end of each preset monitoring period; and dividing a time slice corresponding to each data channel in the next preset monitoring period based on the actual arbitration weight so that each data channel utilizes an AHB system bus to transmit data in the corresponding time slice. The AHB system bus utilization rate can be improved, and the performance of the SOC chip is further improved.
Description
Technical Field
The present disclosure relates to the field of chip design technologies, and in particular, to an AHB system bus arbitration method, an AHB system bus arbitration device, an AHB system bus, and a medium.
Background
With the continuous development of integrated circuits, the requirement for the processing speed performance of SOC (System on Chip) chips is higher and higher. The system bus, which is a backbone bridge connecting the modules, has a significant impact on the performance of the SOC system, particularly in a system of multiple masters and multiple slaves. The arbitration mechanism of the system bus affects the read-write efficiency of the multi-channel data, and further affects the performance of the SOC chip. An AHB (Advanced High Performance Bus) is a High-speed Bus in an AMBA (Advanced Microcontroller Bus Architecture) Bus system, operates on a clock edge jump, supports continuous transmission and segmented transmission, can be connected with a plurality of main devices, supports Bus width configurability, and supports transmission of byte, half word, and word. A typical AHB system consists of a number of master-slave devices and buses. The master device is generally operated by devices such as a CPU (Central Processing Unit), a DMA (Direct Memory Access), a DSP (Digital Signal Processing), and the like, and the slave device is generally operated by various Memory controllers, such as an internal RAM (Random Access Memory ) such as a Sram (Static Random Access Memory) controller, a Flash Memory controller, and an external Memory interface such as an AHB-APB (Advanced Peripheral Bus) bridge, and other Peripheral devices.
Currently, the arbitration mechanism of the AHB system bus usually presets the weight parameter of each data channel, so that when the AHB system actually operates, there is a problem that the utilization rate of the AHB system bus is low.
Disclosure of Invention
In view of this, an object of the present application is to provide an AHB system bus arbitration method, an AHB system bus arbitration device, an AHB system bus and a medium, which can improve the utilization rate of the AHB system bus and further improve the performance of an SOC chip. The specific scheme is as follows:
in a first aspect, the present application discloses an arbitration method for an AHB system bus, including:
monitoring the data flow of each data channel in real time in a preset monitoring period to obtain a first data flow corresponding to each data channel;
determining the actual arbitration weight of each data channel by using the first data flow at the end of each preset monitoring period;
and dividing a time slice corresponding to each data channel in the next preset monitoring period based on the actual arbitration weight so that each data channel utilizes an AHB system bus to transmit data in the corresponding time slice.
Optionally, the monitoring, in real time, the data traffic of each data channel in a preset monitoring period to obtain a first data traffic corresponding to each data channel includes:
monitoring the data traffic of each instruction corresponding to each data channel in real time in a preset monitoring period to obtain second data traffic corresponding to each instruction;
and for any data channel, calculating the sum of the second data flows of all instructions corresponding to the data channel in each preset monitoring period to obtain the first data flow of the data channel in each preset detection period.
Optionally, the monitoring the data traffic of each instruction corresponding to each data channel includes:
and calculating the data flow of each instruction corresponding to each data channel by using the data bit width of each instruction operation and the actual data burst length of each instruction operation.
Optionally, the determining an actual arbitration weight for each data channel by using each first data traffic includes:
calculating the sum of the first data flow to obtain the total data flow of each data channel;
calculating a basic arbitration weight corresponding to each data channel by using a preset weight total, the first data traffic of each data channel and the total data traffic;
determining an actual arbitration weight for each of the data channels based on the base arbitration weights.
Optionally, the determining an actual arbitration weight for each data channel based on the base arbitration weight includes:
determining a maximum basic arbitration weight from each of the basic arbitration weights;
for the non-maximum basic arbitration weight, if the integer part is 0, determining a preset value as the actual arbitration weight of the corresponding data channel, otherwise, determining the integer part as the actual arbitration weight of the corresponding data channel;
determining the sum of actual arbitration weights corresponding to the non-maximum basic arbitration weights to obtain a weight sum;
and taking the difference value between the total preset weight and the weight sum as the actual arbitration weight of the data channel corresponding to the maximum basic arbitration weight.
Optionally, before calculating a basic arbitration weight corresponding to each data channel by using a preset total weight, the first data traffic of each data channel, and the total data traffic, the method further includes:
and judging whether channel abnormity exists or not by utilizing the total data flow and the bus data bit width, if so, determining the actual arbitration weight of each data channel as the same preset weight value, otherwise, triggering the step of calculating the basic arbitration weight corresponding to each data channel by utilizing the total preset weight, the first data flow of each data channel and the total data flow.
Optionally, the method further includes:
determining a monitoring period coefficient by using the average length of the data packet, the utilization rate of the data bandwidth, the number of the master devices connected with the AHB system bus and the number of the slave devices;
and determining the preset monitoring period by using the monitoring period coefficient and the clock period of the AHB system.
In a second aspect, the present application discloses an arbitration device for an AHB system bus, comprising:
the channel flow monitoring module is used for monitoring the data flow of each data channel in real time in a preset monitoring period to obtain a first data flow corresponding to each data channel;
an arbitration weight determination module, configured to determine an actual arbitration weight of each data channel by using each first data traffic when each preset monitoring period ends;
and the time slice dividing module is used for dividing the time slice corresponding to each data channel in the next preset monitoring period based on the actual arbitration weight so that each data channel can transmit data in the corresponding time slice by using an AHB system bus.
In a third aspect, the present application discloses an AHB system bus, comprising:
a storage unit for storing a computer program;
and the processing unit is used for executing the computer program to realize the arbitration method of the AHB system bus.
In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program which, when executed by a processing unit, implements the aforementioned arbitration method for an AHB system bus.
Therefore, the data flow of each data channel is monitored in real time in a preset monitoring period, and a first data flow corresponding to each data channel is obtained; determining the actual arbitration weight of each data channel by using the first data flow at the end of each preset monitoring period; and dividing a time slice corresponding to each data channel in the next preset monitoring period based on the actual arbitration weight so that each data channel utilizes an AHB system bus to transmit data in the corresponding time slice. That is, the data traffic of each data channel is monitored in real time according to a preset period, the actual arbitration weight of each channel is determined according to the real-time traffic data of each data channel, and the time slice division is performed on the next preset monitoring period according to the actual arbitration weight, so that the time for each data channel to own the bus is determined, the time for the data channel with large real-time data traffic to own the bus is longer, and the time for the data channel with small real-time data traffic to own the bus is relatively shorter, that is, the high-speed high-bandwidth read-write request obtains the corresponding high priority, the low-speed low-bandwidth read-write request obtains the corresponding low priority, the utilization rate of the AHB system bus can be improved, and the performance of the SOC chip can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart of an arbitration method for an AHB system bus disclosed in the present application;
FIG. 2 is a schematic diagram of a specific AHB system configuration disclosed herein;
FIG. 3 is a flow chart of an arbitration method for an AHB system bus according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a specific time slice division disclosed herein;
fig. 5 is a schematic structural diagram of an arbitration device for an AHB system bus according to the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Currently, the arbitration mechanism of the AHB system bus usually presets the weight parameter of each data channel, so that when the AHB system actually operates, there is a problem that the utilization rate of the AHB system bus is low. Therefore, the arbitration scheme of the AHB system bus can improve the utilization rate of the AHB system bus and further improve the performance of the SOC chip.
Referring to fig. 1, an embodiment of the present application discloses an arbitration method for an AHB system bus, including:
step S11: and monitoring the data flow of each data channel in real time in a preset monitoring period to obtain a first data flow corresponding to each data channel.
In a specific implementation manner, a monitoring period coefficient may be determined by using an average packet length, a data bandwidth utilization rate, the number of master devices connected to an AHB system bus, and the number of slave devices of a slave device; and determining the preset monitoring period by using the monitoring period coefficient and the clock period of the AHB system.
Specifically, each monitoring time point can be generated according to a system clock, each Tc time is subjected to statistical analysis once, and an enable signal for each Tc monitoring is generated in a system clock counting manner, that is, the preset monitoring period is Tc. Specifically, it can be determined by the following formula:
tc ═ K × T; wherein, T is 1/fsys, T is the clock period of the AHB system, fsys is the clock frequency of the AHB system, and K is the monitoring period coefficient.
And, K ═ longthave · MS · BW · 16;
wherein, MS is Master _ num × 2+ Slave _ num;
master _ num is the number of main devices, Slave _ num is the number of Slave devices, Length is the average length of a data packet, MS is the equivalent value of the number of devices, BW is the utilization rate of data bandwidth, and is the estimated value in the process of project development.
The average length of the data packet is a predefined value, the value is defined according to the performance of the master device and the slave device and the application scene, and the data bandwidth utilization rate is an estimated value obtained by estimation according to the actual application scene.
It should be noted that if the preset monitoring period is too long, the monitoring is not real-time enough, and is too short, which may not reflect the actual data traffic condition of each channel in the system, for example, only one device sends data to another device in the period. According to the embodiment of the application, the optimal value is obtained by considering the data bandwidth utilization rate, the average length of the data packets, the number of devices and the like. For example, K may be 10000, that is, TC is 10000 times of the system clock cycle, which is an optimal value in consideration of the data bandwidth utilization rate, the average packet length, and the like in a certain application scenario.
Further, in a specific implementation manner, the embodiment monitors the data traffic of each instruction corresponding to each data channel in real time in a preset monitoring period to obtain a second data traffic corresponding to each instruction; and for any data channel, calculating the sum of the second data flows of all instructions corresponding to the data channel in each preset monitoring period to obtain the first data flow of the data channel in each preset detection period.
In a specific embodiment, the data bit width of each instruction operation and the actual data burst length of each instruction operation may be used to calculate the data traffic of each instruction corresponding to each data channel.
It should be noted that the AHB bus system is generally constructed by basic devices such as a Master, a Slave, an Arbiter, and a Decoder, and is a multi-Master and multi-Slave structure. The embodiment of the application mainly considers an arbitrator part and carries out arbitration by monitoring the flow data of each data channel in real time. For example, referring to fig. 2, an embodiment of the present application discloses a specific AHB system structure schematic diagram, which includes a master device 0, a master device 1, a master device 2, and a master device 3, a slave device 0, a slave device 1, and a slave device 3, and a bus. The arbitration scheme of the AHB system bus provided in the present application is described below by taking fig. 2 as an example, but the scheme provided in the present application is not limited to the structure of 4 masters and 3 slaves in fig. 2.
Specifically, the channels are marked according to the number of Master devices, that is, the number of Slave devices is not considered, and for example, the channels may be marked as follows:
channel _0 read/write data Channel from MASTER _0 (Master 0)
Channel _1 read/write data Channel from MASTER _1 (Master 1)
Channel _2 read and write data Channel from MASTER _2 (Master 2)
Channel _3 read/write data Channel from MASTER _3 (Master 3)
The flow rate of each channel is calculated in the same manner, and the flow rate of one channel is taken as an example below,
firstly, the data flow of a single instruction is calculated, the read or write instructions are not distinguished, and the calculation is combined:
wr_Flow_0=(wr_burst_size x wr_burst_len);
wherein wr _ Flow _0 is the data Flow of a single instruction; wr _ burst _ size: data bit width for single instruction operations; wr _ burst _ len is the actual data burst length of a single instruction operation.
And wr _ burst _ size 2hsizeHsize is a transport byte flag signal in the AHB protocol; HBURST is a burst type signal in AHB protocol; the corresponding relationship between wr _ burst _ len and HBURST is shown in the first table:
watch 1
HBURST[2:0] | Type (B) | Description of the invention | wr_burst_len |
000 | SINGLE | Single transmission | 1 |
001 | INCR | Incremental burst of unspecified length | x |
010 | WRAP4 | 4 beat loop burst | 4 |
011 | INCR4 | 4 beat incremental burst | 4 |
100 | WRAP8 | 8 beat loop burst | 8 |
101 | INCR8 | 8 beat incremental burst | 8 |
110 | WRAP16 | 16 beat loop burst | 16 |
111 | INCR16 | 16 beat incremental burst | 16 |
When HBURST [2:0] is 001, the burst mode is an indefinite length burst mode, wr _ burst _ len needs to be calculated according to actually transmitted data, and the calculation mode is as follows:
when hready signal is detected high and htrans is 2(NONSEQ: discontinuous state) or 3(SEQ: continuous state), counting is performed plus one,
Cnt_incr=Cnt_incr+1;
when the instruction operation is completed, namely htrans is about to become 0, the htrans is given to wr _ burst _ len;
wr_burst_len=Cnt_incr;
wherein Cnt _ incr is an intermediate variable in the calculation process, hready is a signal for completing one-time transmission in the AHB protocol, and htrans is a signal for the current transmission type in the AHB protocol.
In the same monitoring period, the flow of each instruction is accumulated to obtain the data flow of the data channel in the period:
wr_Flow_sum=wr_Flow_0+wr_Flow_1+wr_Flow_2+……wr_Flow_N;
wherein, w _ Flow _ sum is the sum of the data Flow of all instructions in the same cycle, wr _ Flow _0 is the data Flow of the 0 th instruction, wr _ Flow _1 is the data Flow of the 1 st instruction, wr _ Flow _2 is the data Flow of the 2 nd instruction, wr _ Flow _ N is the data Flow of the nth instruction,
when the monitoring time point is reached, that is, when the preset monitoring period is ended, the monitoring time point is registered, wr _ Flow _ sum _ reg is wr _ Flow _ sum, wr _ Flow _ sum _ reg is a registered value of the data Flow sum of the current period, and wr _ Flow _ sum is cleared to zero in the next system clock period to be 0.
Step S12: and determining the actual arbitration weight of each data channel by using the first data flow at the end of each preset monitoring period.
Step S13: and dividing a time slice corresponding to each data channel in the next preset monitoring period based on the actual arbitration weight so that each data channel utilizes an AHB system bus to transmit data in the corresponding time slice.
Therefore, the data traffic of each data channel is monitored in real time in a preset monitoring period in the embodiment of the application, and the first data traffic corresponding to each data channel is obtained; determining the actual arbitration weight of each data channel by using the first data flow at the end of each preset monitoring period; and dividing a time slice corresponding to each data channel in the next preset monitoring period based on the actual arbitration weight so that each data channel utilizes an AHB system bus to transmit data in the corresponding time slice. That is, the data traffic of each data channel is monitored in real time according to a preset period, the actual arbitration weight of each channel is determined according to the real-time traffic data of each data channel, and the time slice division is performed on the next preset monitoring period according to the actual arbitration weight, so that the time for each data channel to own the bus is determined, the time for the data channel with large real-time data traffic to own the bus is longer, and the time for the data channel with small real-time data traffic to own the bus is relatively shorter, that is, the high-speed high-bandwidth read-write request obtains the corresponding high priority, the low-speed low-bandwidth read-write request obtains the corresponding low priority, the utilization rate of the AHB system bus can be improved, and the performance of the SOC chip can be improved.
Referring to fig. 3, an embodiment of the present application discloses a specific AHB system bus arbitration method, including:
step S21: and monitoring the data flow of each data channel in real time in a preset monitoring period to obtain a first data flow corresponding to each data channel.
For the specific implementation of the step S21, reference may be made to the disclosure of the foregoing embodiments, and further description is omitted here.
Step S22: and when each preset monitoring period is finished, calculating the sum of the first data flow to obtain the total data flow of each data channel.
Step S23: and calculating the basic arbitration weight corresponding to each data channel by using the total preset weight, the first data traffic of each data channel and the total data traffic.
In a specific embodiment, the bandwidth demand proportion of each channel is calculated and scaled to the basic arbitration weight of each channel, for the convenience of calculation, the total weight is set to 128, taking the structure in fig. 2 as an example, the sum of the traffic of each data channel is first calculated to obtain the total data traffic:
wr_Flow_sum_all_chan=wr_Flow_sum_reg_0+wr_Flow_sum_reg_1+wr_Flow_sum_reg_2+wr_Flow_sum_reg_3;
wherein wr _ Flow _ sum _ all _ chan is the sum of data flows of all data channels; wr _ Flow _ sum _ reg _0 is Channel _0 Channel data traffic, wr _ Flow _ sum _ reg _1 is Channel _1 Channel data traffic, wr _ Flow _ sum _ reg _2 is Channel _2 Channel data traffic, and r _ Flow _ sum _ reg _3 is Channel _3 Channel data traffic.
Then, the basic arbitration weights for each channel are calculated:
wr_weight_0=128*wr_Flow_sum_reg_0/wr_Flow_sum_all_chan;
wr_weight_1=128*wr_Flow_sum_reg_1/wr_Flow_sum_all_chan;
wr_weight_2=128*wr_Flow_sum_reg_2/wr_Flow_sum_all_chan;
wr_weight_3=128*wr_Flow_sum_reg_3/wr_Flow_sum_all_chan;
wherein, wr _ weight _0 is Channel _0 Channel basic arbitration weight, wr _ weight _1 is Channel _1 Channel basic arbitration weight, wr _ weight _2 is Channel _2 Channel basic arbitration weight, and wr _ weight _3 is Channel _3 Channel basic arbitration weight.
Step S24: determining an actual arbitration weight for each of the data channels based on the base arbitration weights.
In a specific embodiment, a maximum basic arbitration weight is determined from each of the basic arbitration weights; for the non-maximum basic arbitration weight, if the integer part is 0, determining a preset value as the actual arbitration weight of the corresponding data channel, otherwise, determining the integer part as the actual arbitration weight of the corresponding data channel; determining the sum of actual arbitration weights corresponding to the non-maximum basic arbitration weights to obtain a weight sum; and taking the difference value between the total preset weight and the weight sum as the actual arbitration weight of the data channel corresponding to the maximum basic arbitration weight.
It should be noted that, if the integer part is 0, the preset value is determined as the actual arbitration weight of the corresponding data channel, so that each channel can be divided into corresponding time slices in the next cycle, and the system abnormality caused by the fact that the corresponding channel can not obtain the weight forever is avoided.
That is, in the embodiment of the present application, the actual arbitration weight of each channel is calculated according to the basic arbitration weight, where the basic arbitration weight generally includes an integer part and a decimal part, and according to the comparison, the channel with the largest basic weight is found, and the actual arbitration weight is finally calculated, which is not the largest basic arbitration weight, where the integer part is 0 and the actual arbitration weight is 1; the integer part is not 0, the actual arbitration weight is equal to its integer part, the channel with the largest base weight, and its actual arbitration weight is equal to 128 minus the other actual arbitration weights.
In addition, before the calculating a sum of the first data traffic and obtaining a total data traffic of each data channel, the method further includes: before the calculating a basic arbitration weight corresponding to each data channel by using a preset total weight, the first data traffic of each data channel, and the total data traffic, the method further includes:
and judging whether channel abnormity exists or not by utilizing the total data flow and the bus data bit width, if so, determining the actual arbitration weight of each data channel as the same preset weight value, otherwise, triggering the step of calculating the basic arbitration weight corresponding to each data channel by utilizing the total preset weight, the first data flow of each data channel and the total data flow.
That is, in the embodiment of the present application, in the process of calculating the bandwidth requirement of each channel according to the monitoring result of the traffic of each channel and calculating the weight of each channel during arbitration, it is determined whether the channel is abnormal or not.
Firstly, multiplying the clock frequency of an AHB system by the bit width of bus data to obtain the maximum bandwidth of a channel:
Flow_max=fsys*data_width;
wherein, Flow _ max is the maximum bandwidth of the channel, fsys is the clock frequency of the AHB system, and data _ width is the data bit width of the bus.
The total data traffic is compared with the maximum bandwidth of the channel, the unit of the maximum bandwidth is s (seconds), and the traffic statistic period is Tc, so conversion is needed in the comparison. And if the total data flow is greater than the ratio of the maximum bandwidth of the channel to the preset monitoring period, determining that the channel is abnormal.
When wr _ Flow _ sum _ all _ chan > Flow _ max/Tc, and a channel exception exists at this time, each channel is arbitrated according to the same weight. When wr _ Flow _ sum _ all _ chan < Flow _ max/Tc or wr _ Flow _ sum _ all _ chan ═ Flow _ max/Tc, the step of calculating the basic arbitration weight corresponding to each data channel by using the preset total weight, the first data traffic of each data channel and the total data traffic is triggered.
Step S25: and dividing a time slice corresponding to each data channel in the next preset monitoring period based on the actual arbitration weight so that each data channel utilizes an AHB system bus to transmit data in the corresponding time slice.
For example, a complete monitoring cycle is divided into 128 pieces by a clock counting manner, and the monitoring cycle is divided into different time slices according to the actual arbitration weights, as shown in fig. 4, an embodiment of the present application discloses a specific time slice division schematic diagram, and in the next monitoring cycle, channel 0, channel 1, channel 2, and channel 3 respectively correspond to different time slices. In the next cycle, when the time of the bus owned by one channel reaches the size of the corresponding time slice, the time slice ownership is switched, and when the cycle is ended, the arbitration weight is updated.
Therefore, the flow monitoring of the AHB bus and the dynamic arbitration based on the flow can be carried out, the flow of data can be monitored in real time, the automatic arbitration weight calculation can be carried out in real time according to the flow information of each channel, and the flow can be automatically updated in the next monitoring and adjusting period. By the method, the port of the high-speed high-bandwidth read-write request can obtain corresponding high priority, and the low-speed low-bandwidth read-write request can obtain corresponding low priority in the actual running process of the SOC, so that the utilization rate of a system bus can be improved, and the performance, the usability and the reliability of the whole SOC chip can be improved.
Referring to fig. 5, an embodiment of the present application discloses an arbitration device for an AHB system bus, including:
the channel flow monitoring module 11 is configured to monitor data flow of each data channel in real time in a preset monitoring period to obtain a first data flow corresponding to each data channel;
an arbitration weight determining module 12, configured to determine an actual arbitration weight of each data channel by using each first data traffic when each preset monitoring period ends;
a time slice dividing module 13, configured to divide a time slice corresponding to each data channel in a next preset monitoring period based on the actual arbitration weight, so that each data channel performs data transmission in the corresponding time slice by using an AHB system bus.
Therefore, the data traffic of each data channel is monitored in real time in a preset monitoring period in the embodiment of the application, and the first data traffic corresponding to each data channel is obtained; determining the actual arbitration weight of each data channel by using the first data flow at the end of each preset monitoring period; and dividing a time slice corresponding to each data channel in the next preset monitoring period based on the actual arbitration weight so that each data channel utilizes an AHB system bus to transmit data in the corresponding time slice. That is, the data traffic of each data channel is monitored in real time according to a preset period, the actual arbitration weight of each channel is determined according to the real-time traffic data of each data channel, and the time slice division is performed on the next preset monitoring period according to the actual arbitration weight, so that the time for each data channel to own the bus is determined, the time for the data channel with large real-time data traffic to own the bus is longer, and the time for the data channel with small real-time data traffic to own the bus is relatively shorter, that is, the high-speed high-bandwidth read-write request obtains the corresponding high priority, the low-speed low-bandwidth read-write request obtains the corresponding low priority, the utilization rate of the AHB system bus can be improved, and the performance of the SOC chip can be improved.
The channel flow monitoring module 11 includes:
the instruction data flow monitoring submodule is used for monitoring the data flow of each instruction corresponding to each data channel in real time in a preset monitoring period to obtain a second data flow corresponding to each instruction;
and the channel data flow calculation submodule is used for calculating the sum value of the second data flows of all instructions corresponding to the data channel in each preset monitoring period for any data channel to obtain the first data flow of the data channel in each preset detection period.
The instruction data flow monitoring submodule is specifically configured to calculate the data flow of each instruction corresponding to each data channel by using the data bit width of each instruction operation and the actual data burst length of each instruction operation.
The arbitration weight determination module 12 specifically includes:
a total data traffic calculation submodule, configured to calculate a sum of the first data traffic to obtain total data traffic of each data channel;
a basic arbitration weight calculation submodule, configured to calculate a basic arbitration weight corresponding to each data channel by using a preset total weight, the first data traffic of each data channel, and the total data traffic;
an actual arbitration weight determination sub-module to determine an actual arbitration weight for each of the data channels based on the base arbitration weights.
Further, the actual arbitration weight determining submodule is specifically configured to determine a maximum basic arbitration weight from each of the basic arbitration weights; for the non-maximum basic arbitration weight, if the integer part is 0, determining a preset value as the actual arbitration weight of the corresponding data channel, otherwise, determining the integer part as the actual arbitration weight of the corresponding data channel; determining the sum of actual arbitration weights corresponding to the non-maximum basic arbitration weights to obtain a weight sum; and taking the difference value between the total preset weight and the weight sum as the actual arbitration weight of the data channel corresponding to the maximum basic arbitration weight.
The device also comprises a channel abnormity judging module which is used for judging whether channel abnormity exists by utilizing the total data flow and the bus data bit width, if yes, the actual arbitration weight of each data channel is determined to be the same preset weight value, otherwise, a basic arbitration weight calculating submodule is started.
The device also comprises a preset monitoring period determining module, which is used for determining a monitoring period coefficient by utilizing the average length of the data packets, the utilization rate of the data bandwidth, the number of the master devices connected with the AHB system bus and the number of the slave devices; and determining the preset monitoring period by using the monitoring period coefficient and the clock period of the AHB system.
The embodiment of the application discloses an AHB system bus, which comprises a processing unit and a storage unit; wherein, the storage unit is used for saving computer programs; the processing unit is configured to execute the computer program to implement the arbitration method for the AHB system bus disclosed in the foregoing embodiment.
For the specific process of the arbitration method for the AHB system bus, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated herein.
Further, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program, where the computer program is executed by a processing unit to implement the arbitration method for the AHB system bus disclosed in the foregoing embodiment.
For the specific process of the arbitration method for the AHB system bus, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and details are not repeated herein.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The method and the device for arbitrating the AHB system bus, the AHB system bus and the medium provided by the present application are introduced in detail, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiment is only used to help understanding the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Claims (10)
1. An arbitration method for an AHB system bus, comprising:
monitoring the data flow of each data channel in real time in a preset monitoring period to obtain a first data flow corresponding to each data channel;
determining the actual arbitration weight of each data channel by using the first data flow at the end of each preset monitoring period;
and dividing a time slice corresponding to each data channel in the next preset monitoring period based on the actual arbitration weight so that each data channel utilizes an AHB system bus to transmit data in the corresponding time slice.
2. The method of claim 1, wherein the monitoring the data traffic of each data channel in real time in a preset monitoring period to obtain the first data traffic corresponding to each data channel comprises:
monitoring the data traffic of each instruction corresponding to each data channel in real time in a preset monitoring period to obtain second data traffic corresponding to each instruction;
and for any data channel, calculating the sum of the second data flows of all instructions corresponding to the data channel in each preset monitoring period to obtain the first data flow of the data channel in each preset detection period.
3. The method of claim 1, wherein the monitoring the data traffic of each command corresponding to each data channel comprises:
and calculating the data flow of each instruction corresponding to each data channel by using the data bit width of each instruction operation and the actual data burst length of each instruction operation.
4. The method of claim 1, wherein said determining an actual arbitration weight for each of said data channels using said first data traffic comprises:
calculating the sum of the first data flow to obtain the total data flow of each data channel;
calculating a basic arbitration weight corresponding to each data channel by using a preset weight total, the first data traffic of each data channel and the total data traffic;
determining an actual arbitration weight for each of the data channels based on the base arbitration weights.
5. The method of claim 4, wherein said determining an actual arbitration weight for each of said data channels based on said base arbitration weight comprises:
determining a maximum basic arbitration weight from each of the basic arbitration weights;
for the non-maximum basic arbitration weight, if the integer part is 0, determining a preset value as the actual arbitration weight of the corresponding data channel, otherwise, determining the integer part as the actual arbitration weight of the corresponding data channel;
determining the sum of actual arbitration weights corresponding to the non-maximum basic arbitration weights to obtain a weight sum;
and taking the difference value between the total preset weight and the weight sum as the actual arbitration weight of the data channel corresponding to the maximum basic arbitration weight.
6. The method of claim 4, wherein before calculating the basic arbitration weight corresponding to each data channel by using the total number of the preset weights, the first data traffic of each data channel, and the total data traffic, the method further comprises:
and judging whether channel abnormity exists or not by utilizing the total data flow and the bus data bit width, if so, determining the actual arbitration weight of each data channel as the same preset weight value, otherwise, triggering the step of calculating the basic arbitration weight corresponding to each data channel by utilizing the total preset weight, the first data flow of each data channel and the total data flow.
7. The method for arbitrating the AHB system bus of any one of claims 1 to 6, further comprising:
determining a monitoring period coefficient by using the average length of the data packet, the utilization rate of the data bandwidth, the number of the master devices connected with the AHB system bus and the number of the slave devices;
and determining the preset monitoring period by using the monitoring period coefficient and the clock period of the AHB system.
8. An arbitration device for an AHB system bus, comprising:
the channel flow monitoring module is used for monitoring the data flow of each data channel in real time in a preset monitoring period to obtain a first data flow corresponding to each data channel;
an arbitration weight determination module, configured to determine an actual arbitration weight of each data channel by using each first data traffic when each preset monitoring period ends;
and the time slice dividing module is used for dividing the time slice corresponding to each data channel in the next preset monitoring period based on the actual arbitration weight so that each data channel can transmit data in the corresponding time slice by using an AHB system bus.
9. An AHB system bus, comprising:
a storage unit for storing a computer program;
a processing unit for executing the computer program to implement the arbitration method for the AHB system bus according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program which, when executed by a processing unit, implements the arbitration method for the AHB system bus according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110962618.6A CN113868157B (en) | 2021-08-20 | 2021-08-20 | Arbitration method and device for AHB system bus, AHB system bus and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110962618.6A CN113868157B (en) | 2021-08-20 | 2021-08-20 | Arbitration method and device for AHB system bus, AHB system bus and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113868157A true CN113868157A (en) | 2021-12-31 |
CN113868157B CN113868157B (en) | 2024-06-28 |
Family
ID=78988032
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110962618.6A Active CN113868157B (en) | 2021-08-20 | 2021-08-20 | Arbitration method and device for AHB system bus, AHB system bus and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113868157B (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000148670A (en) * | 1998-11-06 | 2000-05-30 | Nec Corp | Bus access arbitration system |
JP2005210567A (en) * | 2004-01-26 | 2005-08-04 | Sony Corp | Bus control method and bus control apparatus |
US20070264938A1 (en) * | 2006-05-10 | 2007-11-15 | Bhaskar Srinivasan | Method and system for adaptive link monitoring in wireless sensor networks |
JP2009043089A (en) * | 2007-08-09 | 2009-02-26 | Ricoh Co Ltd | Bus control device and bus control method |
CN101676890A (en) * | 2008-08-15 | 2010-03-24 | 北京北大众志微系统科技有限责任公司 | Bus arbitration method for dynamically adjusting bandwidth allocation and arbitrator thereof |
CN110932989A (en) * | 2019-11-20 | 2020-03-27 | 华南理工大学 | Elephant flow path monitoring and scheduling method based on SDN data center network |
CN112306939A (en) * | 2020-10-29 | 2021-02-02 | 山东云海国创云计算装备产业创新中心有限公司 | Bus calling method, device, equipment and storage medium |
US11055243B1 (en) * | 2020-04-19 | 2021-07-06 | Nuvoton Technology Corporation | Hierarchical bandwidth allocation bus arbiter |
CN113467938A (en) * | 2021-06-18 | 2021-10-01 | 山东云海国创云计算装备产业创新中心有限公司 | Bus resource allocation method, device and related equipment |
-
2021
- 2021-08-20 CN CN202110962618.6A patent/CN113868157B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000148670A (en) * | 1998-11-06 | 2000-05-30 | Nec Corp | Bus access arbitration system |
JP2005210567A (en) * | 2004-01-26 | 2005-08-04 | Sony Corp | Bus control method and bus control apparatus |
US20070264938A1 (en) * | 2006-05-10 | 2007-11-15 | Bhaskar Srinivasan | Method and system for adaptive link monitoring in wireless sensor networks |
JP2009043089A (en) * | 2007-08-09 | 2009-02-26 | Ricoh Co Ltd | Bus control device and bus control method |
CN101676890A (en) * | 2008-08-15 | 2010-03-24 | 北京北大众志微系统科技有限责任公司 | Bus arbitration method for dynamically adjusting bandwidth allocation and arbitrator thereof |
CN110932989A (en) * | 2019-11-20 | 2020-03-27 | 华南理工大学 | Elephant flow path monitoring and scheduling method based on SDN data center network |
US11055243B1 (en) * | 2020-04-19 | 2021-07-06 | Nuvoton Technology Corporation | Hierarchical bandwidth allocation bus arbiter |
CN112306939A (en) * | 2020-10-29 | 2021-02-02 | 山东云海国创云计算装备产业创新中心有限公司 | Bus calling method, device, equipment and storage medium |
CN113467938A (en) * | 2021-06-18 | 2021-10-01 | 山东云海国创云计算装备产业创新中心有限公司 | Bus resource allocation method, device and related equipment |
Also Published As
Publication number | Publication date |
---|---|
CN113868157B (en) | 2024-06-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110471872B (en) | System and method for realizing M-LVDS bus data interaction based on ZYNQ chip | |
US7624221B1 (en) | Control device for data stream optimizations in a link interface | |
US20120042105A1 (en) | Bus arbitration apparatus | |
US6304911B1 (en) | Information packet reception indicator for reducing the utilization of a host system processor unit | |
TWI470439B (en) | Sharing bandwidth of a single port sram between at least one dma peripheral and a cpu operating with a quadrature clock | |
US20070067527A1 (en) | Data transfer bus system connecting a plurality of bus masters | |
US20060265532A1 (en) | System and method for generating bus requests in advance based on speculation states | |
US7330921B2 (en) | Communication control circuit and communication control method | |
CN113868157A (en) | Arbitration method and device for AHB system bus, AHB system bus and medium | |
Steinberg et al. | An empirical analysis of the IEEE-1394 serial bus protocol | |
CN100445973C (en) | Bus control right arbitration method and arbiter | |
CN116431558B (en) | AXI protocol-based request response method, device, system and medium | |
CN114185835A (en) | System-on-Chip and Method of Regulating Voltage and Frequency | |
KR20170024876A (en) | Scheduling method of system on chip including real-time shared interface | |
CN117221037A (en) | Message sending method and device, electronic equipment and storage medium | |
WO2022116901A1 (en) | Iis bus decoding method and apparatus, oscilloscope and computer-readable storage medium | |
CN111625486B (en) | Universal serial bus device and data transmission method thereof | |
CN110928698B (en) | Data receiving and transmitting control method and device, computing equipment and storage medium | |
JP2001331329A (en) | Interrupt control device and its method | |
JP2011076584A (en) | Semiconductor integrated circuit device | |
JP4504737B2 (en) | Performance monitor circuit | |
KR20180074197A (en) | Bus traffic control apparatus and bus system having the same | |
JP7226084B2 (en) | Information processing equipment | |
CN115454909A (en) | AHB bus matrix arbitration device, system, method and storage medium | |
CN104243359A (en) | Synergic arbitration method and device for obtaining shared resources |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |