Ahb bus matrix arbitration device, system, method, and storage medium

By dynamically adjusting the weight factors and priorities of the AHB bus matrix, the problem of low bus utilization in existing technologies is solved, thereby improving the performance and reliability of SOC chips.

CN115454909BActive Publication Date: 2026-05-01CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHONGQING CHANGAN AUTOMOBILE CO LTD
Filing Date
2022-09-14
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

The existing arbitration mechanism of the AHB bus matrix cannot adjust the priority in real time according to the actual needs of data transmission, resulting in low bus utilization and affecting the performance of the SOC chip.

Method used

The system employs an initial weight confirmation module, a weight factor measurement module, an arbitration weight determination module, and a priority division module. By monitoring the bus usage frequency of the master device, it dynamically adjusts the weight factor and priority to achieve dynamic arbitration.

Benefits of technology

This improves the utilization of the AHB bus and enhances the performance and reliability of the SOC chip.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115454909B_ABST
    Figure CN115454909B_ABST
Patent Text Reader

Abstract

This invention discloses an AHB bus matrix arbitration device, system, method, and storage medium, comprising: an initial weight confirmation module, used to determine the priority of each master device connected to the AHB bus based on the master device's serial number in the initial state after device reset or power-on; a weight factor measurement module, used to monitor the frequency of bus use by each master device connected to the AHB bus, and automatically increment the corresponding master device's weight factor by 1 each time the AHB bus is detected to be used; an arbitration weight determination module, used to determine the actual arbitration weight of each master device using the weight factors of each master device at the end of each bus use; and a priority division module, used to divide the priority order of the next bus use right based on the arbitration weight determined by the arbitration weight determination module. This invention can improve the utilization rate of the AHB bus matrix, while improving the transmission efficiency of the AHB bus and enhancing chip performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of digital chip technology, specifically relating to an AHB bus matrix arbitration device, system, method, and storage medium. Background Technology

[0002] As integrated circuit chips become increasingly larger and more complex, the demands on the processing speed and performance of System-on-Chip (SoC) chips are rising. The system bus, as the central bridge connecting various modules, significantly impacts the performance of the SoC system, especially in systems with multiple master and slave devices. The arbitration mechanism of the system bus severely affects its transmission efficiency, thus impacting the performance of the SoC chip. The Advanced High Performance Bus (AHB) is a high-speed bus within the Advanced Microcontroller Bus Architecture (AMBA). It operates on the clock edge, supports continuous and segmented transmission, can connect multiple master devices, supports configurable bus width, and supports byte, half-word, and word transmission. A typical AHB bus matrix consists of multiple master devices, multiple slave devices, and the bus itself. Master devices typically include CPU (Central Processing Unit), DMA (Direct Memory Access), and USB (Universal Serial Bus) devices, while slave devices typically include SRAM (Static Random Access Memory) controllers, Flash controllers, AHB to APB (Advanced Peripheral Bus) bridges, and other peripheral devices.

[0003] For example, patent document CN113868157A discloses a method for dividing arbitration weights by detecting data channel traffic, and then dividing the time period of channel occupancy on the bus. However, this method cannot solve the problem of bus idleness when channels are not in use. Another example is a method for interruptible fixed-priority arbitration disclosed in patent document CN11376805A, which can improve bus efficiency in certain fixed scenarios. However, it cannot improve the overall bus utilization rate.

[0004] Currently, the arbitration mechanisms of AHB bus matrices are typically of three types: fixed priority, interruptible fixed priority, and cyclic priority. As a result, when the AHB bus matrix is ​​running, it is impossible to adjust the priority in real time according to the actual needs of data transmission, leading to the problem of low AHB bus utilization.

[0005] Therefore, it is necessary to develop a new AHB bus matrix arbitration device, system, method, and storage medium. Summary of the Invention

[0006] The purpose of this invention is to provide an AHB bus matrix arbitration device, system, method, and storage medium that can solve the problem of low AHB bus matrix utilization caused by existing arbitration mechanisms, and can effectively improve AHB bus transmission efficiency and enhance chip performance.

[0007] In a first aspect, the AHB bus matrix arbitration device of the present invention includes:

[0008] The initial weight confirmation module is used to determine the priority of each master device connected to the AHB bus by the master device number in the initial state after device reset or power-on.

[0009] The weight factor metering module is used to monitor the frequency of each master device connected to the AHB bus using the bus. Every time a master device is detected to use the AHB bus, the weight factor of the corresponding master device is automatically incremented by 1.

[0010] The arbitration weight determination module is used to determine whether the weight factor of each master device is equal to the preset maximum weight value when receiving a bus usage request from more than one master device. If the weight factor of any master device is equal to the preset maximum weight value, the weight factor of each master device is assigned to 1 / a of the original weight factor, and only the integer part is retained, where a is greater than 1. The weight factors of each master device participating in the bus usage request are compared and sorted according to the size of the weight factors. If the weight factors of all master devices are less than the preset maximum weight value, the weight factors of each master device participating in the bus usage request are directly compared and sorted according to the size of the weight factors. After sorting, if there is only one master device with the largest weight factor, the bus usage right is given to the master device with the largest weight factor participating in the request. If there are two or more master devices with the largest weight factors, the serial numbers of each master device with the largest and equal weight factors are compared, and the bus usage right is given to the master device with the highest priority corresponding to the serial number. This arbitration weight determination module is connected to the initial weight confirmation module and the weight factor measurement module respectively.

[0011] The priority allocation module, which is connected to the arbitration weight determination module, allocates the priority order of the next bus usage right based on the arbitration weight determined by the arbitration weight determination module.

[0012] In this embodiment, the value of 'a' is 2.

[0013] In this embodiment, the bus usage priority of each master device connected to the AHB bus is set to W0>W1>...>W i ...>W n , where n represents the total number of master devices.

[0014] Secondly, the AHB bus matrix arbitration system of the present invention includes an AHB bus matrix, multiple master devices and multiple slave devices respectively connected to the AHB bus matrix, wherein the AHB bus matrix includes an AHB bus and an AHB bus matrix arbitration device; the AHB bus matrix arbitration device adopts the AHB bus matrix arbitration device as described in the present invention.

[0015] Thirdly, the AHB bus matrix arbitration method of the present invention employs the AHB bus matrix arbitration system as described in the present invention, and the method includes the following steps:

[0016] Step 1: In the initial state after system reset or power-on, the priority is determined by the serial number of the master device;

[0017] Step 2: When the AHB bus matrix receives multiple requests from master devices to use the bus, arbitration is initiated, and the process proceeds to Step 3.

[0018] Step 3: Determine whether the weight factor of each master device is equal to the preset maximum weight value. If the weight factor of any master device is equal to the preset maximum weight value, then assign the weight factor of each master device to 1 / a of the original weight factor, and keep only the integer value, and then proceed to step 4; if the weight factors of all master devices are less than the preset maximum weight value, then proceed to step 4.

[0019] Step 4: Compare the weight factors of each master device participating in the request to use the bus, and sort them according to the size of the weight factors. If there is only one master device with the largest weight factor, proceed to Step 5; if there are multiple master devices with the largest weight factor, proceed to Step 6.

[0020] Step 5: Grant bus usage rights to the master device with the largest weight factor among the participating requesters, and proceed to Step 7;

[0021] Step 6: Compare the serial numbers of the master devices with the largest and equal weight factors, assign the bus usage right to the master device with the highest priority corresponding to the serial number, and proceed to Step 7.

[0022] Step 7: Increment the weight factor of the master device that has been granted bus access by 1. This arbitration ends, and the process returns to Step 2.

[0023] Fourthly, the present invention provides a storage medium storing a computer-readable program, which, when invoked, can execute the steps of the AHB bus matrix arbitration method as described in the present invention.

[0024] This invention has the following advantages: By measuring and monitoring the master device weight factor on the AHB bus and using dynamic arbitration based on the weight factor and master device serial number, this invention can monitor the frequency of master device bus usage in real time, calculate the master device weight factor in real time, and automatically update it in the next bus usage cycle. Through this invention, during the actual operation of the SOC system, ports with high-frequency read / write requests in the recent time period are given corresponding high priority, and ports with low-frequency read / write requests in the recent time period are given corresponding low priority, thereby improving the utilization rate of the system bus and thus improving the performance, usability, and reliability of the entire SOC chip. Attached Figure Description

[0025] Figure 1 This is a schematic diagram of the AHB bus matrix arbitration system in this embodiment;

[0026] Figure 2 This is a flowchart of the AHB bus matrix arbitration method in this embodiment;

[0027] Figure 3 This is a schematic diagram of the AHB bus matrix arbitration device in this embodiment;

[0028] In the diagram: 1a - Initial weight confirmation module, 1b - Weight factor measurement module, 1c - Arbitration weight determination module, 1d - Priority division module. Detailed Implementation

[0029] The present invention will now be described in detail with reference to the accompanying drawings.

[0030] like Figure 3 As shown in this embodiment, an AHB bus matrix arbitration device includes an initial weight confirmation module 1a, a weight factor measurement module 1b, an arbitration weight determination module 1c, and a priority division module 1d.

[0031] In this embodiment, the initial weight confirmation module 1a is used to determine the priority of each master device connected to the AHB bus by the master device number in the initial state after the device is reset or powered on.

[0032] In this embodiment, the weight factor measurement module 1b is used to monitor the frequency of each master device connected to the AHB bus using the bus. When the master device is detected to use the AHB bus once, the weight factor of the corresponding master device is automatically incremented by 1. The weight factor measurement module 1b can obtain the weight factor data of each master device using the bus in real time.

[0033] In this embodiment, the arbitration weight determination module 1c is used to determine whether the weight factor of each master device is equal to the preset maximum weight value when receiving a request to use the bus from more than one master device. If the weight factor of any master device is equal to the preset maximum weight value, the weight factor of each master device is assigned to 1 / a of the original weight factor, and only the integer part is retained, where a is greater than 1. The weight factors of each master device participating in the request to use the bus are compared and sorted according to the size of the weight factors. If the weight factors of all master devices are less than the preset maximum weight value, the weight factors of each master device participating in the request to use the bus are directly compared and sorted according to the size of the weight factors. After sorting, if there is only one master device with the largest weight factor, the bus use right is given to the master device with the largest weight factor participating in the request. If there are two or more master devices with the largest weight factors, the serial numbers of each master device with the largest and equal weight factors are compared and the bus use right is given to the master device with the highest priority corresponding to the serial number. The arbitration weight determination module 1c is connected to the initial weight confirmation module 1a and the weight factor measurement module 1b respectively.

[0034] Priority allocation module 1d, based on the arbitration weight determined by arbitration weight determination module 1c, allocates the priority order of the next bus usage right. Priority allocation module 1d is connected to arbitration weight determination module 1c. This ensures that when the master device experiences bus usage right contention, it uses the AHB bus according to the bus usage right priority.

[0035] like Figure 1 As shown in this embodiment, an AHB bus matrix system includes an AHB bus matrix, multiple master devices and multiple slave devices respectively connected to the AHB bus matrix, wherein the AHB bus matrix includes an AHB bus and an AHB bus matrix arbitration device; the AHB bus matrix arbitration device adopts the AHB bus matrix arbitration device as described in this embodiment.

[0036] like Figure 1 As shown, in this embodiment, the master device actively initiates read / write operations using the bus, and the slave device passively responds to the read / write operations. The AHB bus matrix arbitration device allows a specific master device to use the bus at a given time. This embodiment shows 5 master devices and 6 slave devices connected, but the system can be expanded or reduced; 5 master devices are shown for ease of understanding.

[0037] like Figure 2 As shown in this embodiment, an AHB bus matrix arbitration method employs the AHB bus matrix system described in this embodiment, and its steps are as follows:

[0038] Step 1: In the initial state after system reset or power-on, the priority is determined by the master device's serial number. In this embodiment, the bus usage priority of each master device is set as W0>W1>...>W i ...>W n , where n represents the total number of master devices.

[0039] Step 2: When the AHB bus matrix receives multiple requests from master devices to use the bus, arbitration is initiated, and then proceed to Step 3.

[0040] Step 3: Determine whether the weight factor of each master device is equal to the preset maximum weight value. If the weight factor of any master device is equal to the preset maximum weight value, then assign the weight factor of each master device to half of the original weight factor and keep only the integer value, and then proceed to step 4; if the weight factors of all master devices are less than the preset maximum weight value, then proceed to step 4.

[0041] Step 4: Compare the weight factors of each master device participating in the request to use the bus, and sort them according to the size of the weight factors. If there is only one master device with the largest weight factor, proceed to Step 5; if there are multiple master devices with the largest weight factor, proceed to Step 6.

[0042] Step 5: Grant bus usage rights to the master device with the largest weight factor among the participating requesters, and proceed to Step 7.

[0043] Step 6: Compare the serial numbers of the master devices with the largest and equal weight factors, and assign the bus usage right to the master device with the highest priority corresponding to the serial number (i.e., the master device with the smallest serial number), and proceed to Step 7.

[0044] Step 7: Increment the weight factor of the master device that has been granted bus access by 1. This arbitration ends, and the process returns to Step 2.

[0045] By measuring and monitoring the master device weight factor on the AHB bus, and through dynamic arbitration based on the weight factor and master device sequence number, the frequency of master device bus usage can be monitored in real time, the master device weight factor can be calculated in real time, and it can be automatically updated in the next bus usage cycle. This method ensures that ports with high-frequency read / write requests in the recent time period receive high priority, while those with low-frequency read / write requests receive low priority, thus improving the utilization of the system bus and consequently enhancing the performance, usability, and reliability of the entire SOC chip.

[0046] The above embodiments are preferred implementations of the method of the present invention, but the implementation of the method of the present invention is not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.

Claims

1. An AHB bus matrix arbitration device, characterized in that, include: The initial weight confirmation module (1a) is used to determine the priority of each master device connected to the AHB bus by the master device number in the initial state after device reset or power-on. The weight factor measurement module (1b) is used to monitor the frequency of each master device connected to the AHB bus using the bus. When a master device is detected to use the AHB bus once, the weight factor of the corresponding master device is automatically incremented by 1. The arbitration weight determination module (1c) is used to determine whether the weight factor of each master device is equal to the preset maximum weight value when receiving a request to use the bus from more than one master device. If the weight factor of any master device is equal to the preset maximum weight value, the weight factor of each master device is assigned to 1 / a of the original weight factor, and only the integer part is retained, where a is greater than 1. The weight factors of each master device participating in the request to use the bus are compared and sorted according to the size of the weight factors. If the weight factors of all master devices are less than the preset maximum weight value, the weight factors of each master device participating in the request to use the bus are directly compared and sorted according to the size of the weight factors. After sorting, if there is only one master device with the largest weight factor, the right to use the bus is given to the master device with the largest weight factor participating in the request. If there are two or more master devices with the largest weight factors, the serial numbers of each master device with the largest and equal weight factors are compared and the right to use the bus is given to the master device with the highest priority corresponding to the serial number. The arbitration weight determination module (1c) is connected to the initial weight confirmation module (1a) and the weight factor measurement module (1b) respectively. The priority division module (1d) divides the priority order of the next bus usage right based on the arbitration weight determined by the arbitration weight determination module (1c). The priority division module (1d) is connected to the arbitration weight determination module (1c).

2. The AHB bus matrix arbitration device according to claim 1, characterized in that: The value of 'a' is 2.

3. The AHB bus matrix arbitration device according to claim 1 or 2, characterized in that: The priority of bus access rights for each master device connected to the AHB bus is set to W0>W1>...>W i ...>W n , where n represents the total number of master devices.

4. An AHB bus matrix arbitration system, comprising an AHB bus matrix, multiple master devices and multiple slave devices respectively connected to the AHB bus matrix, characterized in that... The AHB bus matrix includes an AHB bus and an AHB bus matrix arbitration device; The AHB bus matrix arbitration device is the AHB bus matrix arbitration device as described in any one of claims 1 to 3.

5. An AHB bus matrix arbitration method, characterized in that: The method of using the AHB bus matrix arbitration system as described in claim 4 includes the following steps: Step 1: In the initial state after system reset or power-on, the priority is determined by the serial number of the master device; Step 2: When the AHB bus matrix receives multiple requests from master devices to use the bus, arbitration is initiated, and the process proceeds to Step 3. Step 3: Determine whether the weight factor of each master device is equal to the preset maximum weight value. If the weight factor of any master device is equal to the preset maximum weight value, then assign the weight factor of each master device to 1 / a of the original weight factor, and keep only the integer part, and proceed to step 4; if the weight factors of all master devices are less than the preset maximum weight value, then proceed to step 4. Step 4: Compare the weight factors of each master device participating in the request to use the bus, and sort them according to the size of the weight factors. If there is only one master device with the largest weight factor, proceed to Step 5; if there are multiple master devices with the largest weight factor, proceed to Step 6. Step 5: Grant bus usage rights to the master device with the largest weight factor among the participating requesters, and proceed to Step 7; Step 6: Compare the serial numbers of the master devices with the largest and equal weight factors, assign the bus usage right to the master device with the highest priority corresponding to the serial number, and proceed to Step 7. Step 7: Increment the weight factor of the master device that has been granted bus access by 1. This arbitration ends, and the process returns to Step 2.

6. A storage medium, characterized in that: It contains a computer-readable program that, when invoked, performs the steps of the AHB bus matrix arbitration method as described in claim 5.

Citation Information

Patent Citations

  • Arbitration method and device of AHB system bus, AHB system bus and medium

    CN113868157A

  • Bus monitor-based system chip bus priority dynamic configuration device

    CN102012881A

  • AMBA (Advanced Microcontroller Bus Architecture) bus based self-adaption real-time weighting prior arbitration method and arbitrator

    CN103077141A