A bridge device, method and system on chip for AHB bus
By designing a bridge device in the AHB bus, allocating user registers and reducing combinational logic gates, the problem of increasing the number of logic gate levels in the existing technology is solved, data transmission efficiency is improved and costs are reduced.
Patent Information
- Application Number
- CN202311437599.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-31
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2043-10-31
AI Technical Summary
In the existing AHB bus protocol, additional combinational logic components increase the number of logic gate levels on the critical path of the bus, resulting in a reduction in the actual yield of the chip, an increase in cost, and a reduction in the maximum operating frequency, especially when the number of user registers in the peripheral module is large. .
Design a bridge device that reduces the number of additional combinational logic gates by allocating the first and second types of user registers to different address partitions and utilizing the first multiplexer, the second multiplexer and the two-to-one selector. , only add combinational logic gates to the first multiplexer and the two-selector, and integrate most of the combinational logic gates between the flip-flops.
It effectively reduces the number of combinational logic gates on the AHB bus, improves data transmission efficiency, reduces chip costs and increases operating frequency.
Smart Images

Figure CN117312213B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip technology, and in particular to a bridge device, method and system on chip for an AHB bus. Summary of the invention
[0002] System on Chip (SoC) is also called system on chip. As the name implies, it integrates a complete system on a single chip. It is mainly used in embedded systems, mobile devices, personal computers and other fields. AHB (Advanced Highperformance Bus) specification is part of AMBA (Advanced Microcontroller Bus Architecture) specification. It is used to connect the host (such as CPU) and slave (such as various peripheral modules) in SoC chip. It is a common bus protocol for SoC chip.
[0003] The AHB bus protocol stipulates that a data transmission is divided into an address phase and a data phase. If special circumstances such as inserting a delay wait state in the bus are not considered, the address phase and data phase of a data transmission only last for one clock cycle, and the data phase will be entered immediately after the address phase of a data transmission. In order to improve the efficiency of data transmission, the following are currently used: Figure 1 and Figure 2 Two technical solutions are shown.
[0004] exist Figure 1 In the technical solution shown, the host first sends an address signal in the address phase, and the read data of the user register of the peripheral module (slave) is generated by the multiplexer selection and stored in the trigger; in the next clock cycle (i.e., the data phase), the read data stored in the trigger will be output to the bus. This is the most widely used method in the prior art. However, this solution has the following defects: the combinational logic elements that constitute the multiplexer are connected to the bus address line, and the additional combinational logic elements may not only increase the number of logic gate levels on the critical path of the bus, but also increase the fan-out of the logic gates of the bus address part, which may eventually lead to a decrease in the actual yield of the chip, an increase in cost, and a decrease in the maximum operating frequency, which is particularly obvious when the number of user registers of the peripheral module is large.
[0005] exist Figure 2 In the technical solution shown, the read data of the user register is first stored in the trigger in the address phase, and then in the next clock cycle (i.e., the data phase), the user register read data is generated and output to the bus according to the address data stored in the trigger. In this design, the combinational logic elements that make up the multiplexer are connected to the bus read data line, which also increases the number of logic gates on the critical path of the bus. Summary of the invention
[0006] In view of the above-mentioned deficiencies in the prior art, an object of the present invention is to provide a bridge device, method and system on chip for an AHB bus, so as to reduce the number of additional logic gates connected to the AHB bus.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions:
[0008] In a first aspect, the present invention provides a bridge device for an AHB bus, comprising:
[0009] A first trigger, wherein an input end of the first trigger is connected to an address line of the AHB bus;
[0010] A first multiplexer, wherein a selection end of the first multiplexer is connected to an address line of the AHB bus, and a plurality of input ends of the first multiplexer are respectively connected to a plurality of first-class user registers in a one-to-one correspondence;
[0011] A second multiplexer, wherein a selection terminal of the second multiplexer is connected to the output terminal of the first trigger, and a plurality of input terminals of the second multiplexer are respectively connected to a plurality of second-type user registers in a one-to-one correspondence;
[0012] A two-to-one selector, wherein two input terminals of the two-to-one selector are respectively connected with the first multiplexer and the second multiplexer in a one-to-one correspondence;
[0013] A second trigger, wherein an input end of the second trigger is connected to an output end of the two-to-one selector, and an output end of the second trigger is connected to a read data line of the AHB bus;
[0014] The first type of user register is a user register that can support hardware write operations, and the second type of user register is a user register that only supports software write operations.
[0015] Furthermore, the type of user registers includes: an interrupt flag register, a result register, and / or a status flag register.
[0016] Furthermore, the second type of user registers includes: a configuration register, an input data register, and / or a threshold data register.
[0017] Furthermore, the ratio of the number of the first type of user registers to the number of the second type of user registers is less than 1:4.
[0018] In a second aspect, the present invention provides a bridging method based on the aforementioned bridging device, comprising:
[0019] The addresses corresponding to the first type of user registers are divided into a first address partition, and the addresses corresponding to the second type of user registers are divided into a second address partition;
[0020] When the target address transmitted by the address line of the AHB bus in the address phase belongs to the first address partition, a type of user register matching the target address is selected by the first multiplexer, and the value of the selected type of user register is saved in the second trigger by the two-to-one selector, so that the second trigger outputs the saved value to the read data line of the AHB bus in the data phase;
[0021] When the target address transmitted by the address line of the AHB bus in the address phase belongs to the second address partition, the target address is saved in the first trigger, and a waiting cycle is inserted in the data phase, so that the second type of user register matching the target address is selected by the second multiplexer during the waiting cycle, and then the value of the selected second type of user register is saved in the second trigger through the two-to-one selector, so that the second trigger outputs the saved value to the read data line of the AHB bus in the next cycle.
[0022] In a third aspect, the present invention provides a system on chip, comprising: an AHB bus, a slave, and a bridge device connected between the AHB bus and the slave, wherein the bridge device adopts the bridge device as described above, and the slave has the first type of user register and the second type of user register.
[0023] By adopting the above technical solution, the present invention has the following beneficial effects:
[0024] In the bridge device of the present invention, the number of combinational logic gates that affect the AHB bus is limited to the first multiplexer and the two-choice selector. Since the first type of user register is a user register that can support hardware write operations, it has the characteristics of a small number and frequent reading; and the second type of user register is a user register that only supports software write operations, it has the characteristics of a large number and a small number of readings, so the present invention actually integrates most of the combinational logic gates (i.e., the second multiplexer) between the first trigger and the second trigger. Compared with the prior art, the present invention greatly reduces the number of combinational logic gates that affect the AHB bus. The solution provided by the present invention reasonably allocates the number of user registers in the two address partitions, which can maximize the data transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a structural schematic diagram of a bridge device for an AHB bus in the prior art;
[0026] Figure 2It is a structural schematic diagram of another bridge device for AHB bus in the prior art;
[0027] Figure 3 It is a structural schematic diagram of a bridge device for AHB bus in the present invention. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0029] The terms used in the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure. The singular forms "a", "the" and "the" used in the present disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0030] A first aspect of the present invention provides a bridge device for an AHB bus, such as Figure 3 As shown, the bridge device includes a first trigger, a first multiplexer, a second multiplexer, a two-to-one selector and a second trigger.
[0031] In the present invention, the input end of the first trigger is connected to the address line of the AHB bus to receive and store the corresponding target address transmitted by the address line of the AHB bus. The first multiplexer has a selection end and multiple input ends, and its selection end is also connected to the address line of the AHB bus to receive the corresponding target address transmitted by the address line of the AHB bus; its multiple input ends are respectively connected to multiple first-class user registers in a one-to-one correspondence to select the corresponding first-class user register according to the target address received by its selection end. The second multiplexer also has a selection end and multiple input ends, and its selection end is connected to the output end of the first trigger to receive the corresponding target address stored by the first trigger; the multiple input ends of the second multiplexer are respectively connected to multiple second-class user registers in a one-to-one correspondence to select the corresponding second-class user register according to the target address received by its selection end. The two-to-one selector has two input ends, and its two input ends are respectively connected to the first multiplexer and the second multiplexer in a one-to-one correspondence to select one of the two. The input end of the second trigger is connected to the output end of the two-to-one selector, and the output end of the second trigger is connected to the read data line of the AHB bus to output the value of the corresponding user register selected by the first multiplexer or the second multiplexer to the read data line of the AHB bus to complete the read data operation through the AHB bus.
[0032] In the present invention, user registers are divided into Class I user registers and Class II user registers according to whether they can support hardware write operations. Since unreadable user registers will not participate in the process of reading data on the AHB bus, they are not within the scope of discussion and application of this article. Therefore, all user registers appearing in the full text of this application are readable by default.
[0033] Specifically, a class of user registers are user registers that can support hardware write operations and software write operations, such as interrupt flag registers, result registers, and / or status flag registers. In a system on chip, the host usually needs to frequently read the values of a class of user registers to obtain key data such as calculation results and working status of the slave. The number of class one user registers accounts for less than 20% of the total number of user registers of the peripheral module, that is, class one user registers have the characteristics of small number and frequent reading.
[0034] Class II user registers are user registers that only support software write operations, such as configuration registers, input data registers, and / or threshold data registers. The value of the Class II user register will always save the reset value or the value last written by the software under normal working conditions. Some Class II user registers may have software write restrictions. The software can confirm that the software write is successful by complying with the software write restrictions or reading the value of the register. In scenarios where there are strict requirements on the total operation time, in order to minimize the total time, the software usually does not consume extra clock cycles to read Class II user registers. In addition, the number of Class II user registers accounts for more than 80% of the total number of user registers of the peripheral module, that is, Class II user registers have the characteristics of large number and relatively few read times.
[0035] It can be seen that in the above-mentioned bridge device, the number of combinational logic gates that affect the AHB bus is limited to the first multiplexer and the two-choice selector. Since the first type of user register is a user register that can support hardware write operations, it has the characteristics of a small number and frequent reading; and the second type of user register is a user register that only supports software write operations, it has the characteristics of a large number and a small number of readings. The ratio of the number of first type user registers to the second type of user registers is generally less than 1:4. Therefore, the present invention actually integrates most combinational logic gates (i.e., the second multiplexer) between the first trigger and the second trigger. Compared with the prior art, the present invention greatly reduces the number of combinational logic gates that affect the AHB bus. The solution provided by the present invention reasonably allocates the number of user registers in the two address partitions, which can maximize the data transmission efficiency.
[0036] A second aspect of the present invention provides a bridging method based on the aforementioned bridging device, the method specifically comprising the following steps:
[0037] First, the addresses corresponding to the first-category user registers are divided into a first address partition, and the addresses corresponding to the second-category user registers are divided into a second address partition.
[0038] When the target address transmitted by the address line of the AHB bus in the address phase belongs to the first address partition, a type of user register matching the target address is selected by the first multiplexer, and the value of the selected type of user register is saved in the second trigger through the two-to-one selector, so that the second trigger outputs the saved value to the read data line of the AHB bus in the data phase, thereby completing the read data transmission process.
[0039] When the target address transmitted by the address line of the AHB bus in the address phase belongs to the second address partition, the target address is saved in the first trigger, and a wait cycle is inserted in the data phase (hready_resp outputs 0), so that the second type of user register matching the target address is selected through the second multiplexer during the wait cycle, and then the value of the selected second type of user register is saved in the second trigger through the two-to-one selector, so that the second trigger outputs the saved value to the read data line of the AHB bus in the next cycle, thereby completing the read data transmission process.
[0040] By properly allocating the number of user registers in the two address partitions through the above steps, the data transmission efficiency can be maximized.
[0041] A third aspect of the present invention provides a system on chip, such as Figure 3 As shown, the system on chip includes: an AHB bus, a slave, and a bridge device connected between the AHB bus and the slave, wherein the slave has the aforementioned first-class user register and second-class user register, and the bridge device adopts the bridge device as described above. Therefore, the specific details and beneficial effects of the aforementioned bridge device can be used in the system on chip, and will not be repeated here.
[0042] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that this is only for illustration and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.
Claims
1. A bridge device for an AHB bus, characterized in that: include: A first trigger, wherein an input end of the first trigger is connected to an address line of the AHB bus; A first multiplexer, wherein a selection end of the first multiplexer is connected to an address line of the AHB bus, and a plurality of input ends of the first multiplexer are respectively connected to a plurality of first-class user registers in a one-to-one correspondence; A second multiplexer, wherein a selection terminal of the second multiplexer is connected to an output terminal of the first trigger, and a plurality of input terminals of the second multiplexer are respectively connected to a plurality of second-type user registers in a one-to-one correspondence; A two-to-one selector, wherein two input terminals of the two-to-one selector are respectively connected with the first multiplexer and the second multiplexer in a one-to-one correspondence; A second trigger, wherein an input end of the second trigger is connected to an output end of the two-to-one selector, and an output end of the second trigger is connected to a read data line of the AHB bus; The first type of user register is a user register that can support hardware write operations, and the second type of user register is a user register that only supports software write operations.
2. The bridging device according to claim 1, characterized in that: The user registers include: interrupt flag registers, result registers, and / or status flag registers.
3. The bridging device according to claim 1, characterized in that: The second type of user registers include: configuration registers, input data registers, and / or threshold data registers.
4. The bridging device according to claim 1, characterized in that: The ratio of the number of the first type of user registers to the number of the second type of user registers is less than 1:
4.
5. A bridging method based on the bridging device according to any one of claims 1 to 4, characterized in that: include: The addresses corresponding to the first type of user registers are divided into a first address partition, and the addresses corresponding to the second type of user registers are divided into a second address partition; When the target address transmitted by the address line of the AHB bus in the address phase belongs to the first address partition, a type of user register matching the target address is selected by the first multiplexer, and the value of the selected type of user register is saved in the second trigger by the two-to-one selector, so that the second trigger outputs the saved value to the read data line of the AHB bus in the data phase; When the target address transmitted by the address line of the AHB bus in the address phase belongs to the second address partition, the target address is saved in the first trigger, and a waiting cycle is inserted in the data phase, so that the second type of user register matching the target address is selected by the second multiplexer during the waiting cycle, and then the value of the selected second type of user register is saved in the second trigger through the two-to-one selector, so that the second trigger outputs the saved value to the read data line of the AHB bus in the next cycle.
6. A system on chip, comprising an AHB bus, a slave, and a bridge device connected between the AHB bus and the slave, characterized in that: The bridge device is a bridge device as described in any one of claims 1 to 4, and the slave has the first type of user register and the second type of user register.
Citation Information
Patent Citations
High-speed bridge device for AHB (advanced high-performance bus) accessing on-chip SRAM (static random access memory) and operating method of high-speed bridge device
CN104679681A
AHB / APB expansion bus interface and system-on-chip
CN110765052A
Bus bridge, system and method from AHB bus to I2C bus
CN114564427A
Bridging a host bus to an external bus using a host-bus-to-processor protocol translator
US6571308B1
