Bus Devices, Embedded Systems, and System-on-Chip
By introducing the write command buffer, address redirection unit and arbitration unit into the bus device, the interlocking problem in the cascade structure of the bus device in the complex on-chip system is solved, ensuring the sequential execution of write transactions and avoiding system bus interlocking. Improved system stability.
Patent Information
- Application Number
- CN202010568121.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-06-19
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-06-19
AI Technical Summary
In complex on-chip systems, interlocking problems are prone to occur in the cascade structure of bus devices, causing the system to fail to work properly. This is especially difficult to detect and solve in a timely manner during the complex design and later stability testing stages.
Design a bus device, including a write command buffer, an address redirection unit and an arbitration unit. By caching and redirecting the write address sent by the master device, it ensures that write transactions of the same slave device are executed first and avoids bus interlocking. After the write transaction is completed, the arbitration unit notifies the write command buffer to continue processing the next write address, and controls the effective level duration period of the write address signal and the ready signal to ensure that the write transactions are executed in sequence.
It effectively avoids bus interlock problems, ensures that the system will not interlock when processing multiple write transactions, and improves the stability and normal operation capabilities of the system.
Smart Images

Figure CN113821470B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of chips, and in particular to a bus device, an embedded system and a system on chip. Background Art
[0002] As the size of the system on chip (SoC) continues to grow, the bus structure and hierarchy become increasingly complex. The cascading of bus devices is inevitable in large-scale SoC designs. Bus interlocking problems can occur when the design is not well thought out or the behavior of the bus devices does not match the behavior of the devices. Figure 1 As shown in the figure, master device 1 sends a read / write request to slave device 1 through path 1 of bus device 1, which is forwarded to bus device 0 through path 2 and then goes back to bus device 1 through path 3. At this time, path 2 and path 3 form a loop, which makes the system unable to complete the read / write request of master device 1 to slave device 1. Similarly, master device 0 sends a read / write request to slave device 0 through the path of bus device 0, and similar problems will occur. In this way, the entire system will not be able to continue to work normally.
[0003] Usually, the bus protocol only defines the basic read and write transfer behaviors. In actual use, hardware system engineers need to ensure that there is no bus interlocking problem between bus devices. Figure 1 The typical interlocking problems shown are relatively easy to find and correct in the early stages of design. However, as the bus device architecture becomes more complex, it becomes more difficult to find bus interlocking problems. Often, in the very late stage of a project, large-scale stability testing is required, and interlocking problems in the bus device architecture can only be discovered with a small probability based on very random stress testing. Summary of the invention
[0004] The present disclosure provides a bus device and an embedded system and a system on chip including the bus device, which can solve the interlocking problem in the cascade structure of the bus device.
[0005] In a first aspect, according to an embodiment of the present disclosure, a bus device is provided, including:
[0006] A write command buffer, used for caching a plurality of write addresses sent by the master device, and transmitting consecutive write addresses for the same slave device among the plurality of write addresses to the address redirection unit according to the notification of the arbitration unit;
[0007] An address redirection unit, used for redirecting the write address to the same slave device to the address space of the same slave device;
[0008] The arbitration unit is used to notify the write command buffer to transmit a write address subsequent to the write address for the same slave device after the write transaction of the write address for the same slave device is completed.
[0009] Optionally, the arbitration unit controls the duration period of the valid level of any one of the write address valid signal and the write address ready signal between the master device and the same slave device to be at least the number of consecutive write addresses to the same slave device.
[0010] Optionally, the controlling the duration period of the valid level of any one of the write address valid signal and the write address ready signal between the master device and the same slave device to be at least the number of write addresses to the same slave device comprises:
[0011] Keeping the write address valid signal between the master device and the same slave device at a valid level;
[0012] The effective level duration period of the write address ready signal between the master device and the same slave device is made equal to the number of the continuous write addresses to the same slave device.
[0013] Optionally, the controlling the duration period of the valid level of any one of the write address valid signal and the write address ready signal between the master device and the same slave device to be at least the number of write addresses to the same slave device comprises:
[0014] Make the effective level duration period of the write address effective signal between the master device and the same slave device equal to the number of the continuous write addresses to the same slave device;
[0015] The write address ready signal between the master device and the same slave device is maintained at a valid level.
[0016] Optionally, the controlling of the duration of the valid level of any one of the write address valid signal and the write address ready signal between the master device and the same slave device to be at least the number of consecutive write addresses to the same slave device comprises:
[0017] The write address valid signal and the write address ready signal between the master device and the same slave device are changed simultaneously, and the effective level duration periods of both are equal to the number of the continuous write addresses to the same slave device.
[0018] Optionally, the arbitration unit controls the write data valid signal and the write data ready signal between the master device and the same slave device to be at a valid level after the duration period of the valid level of at least one of the write address valid signal and the write address ready signal between the master device and the same slave device is at least the number of consecutive write addresses to the same slave device.
[0019] Optionally, the completion of the write transaction to the write address of the same slave device is determined by the arbitration unit through a write response signal received from the same slave device.
[0020] Optionally, the arbitration unit further controls at least one of a write data valid signal and a write data ready signal between the master device and the same slave device to change from a valid level to an invalid level after the write transaction to the write address of the same slave device is completed.
[0021] Optionally, the bus device is an AXI bus device.
[0022] Optionally, the number of write addresses for the same slave device is less than or equal to the maximum number of in-transit transactions of the bus device.
[0023] In a second aspect, an embodiment of the present disclosure provides an embedded system, comprising: a bus device as described in any one of the above items; a plurality of master devices connected to the bus device; and a plurality of slave devices connected to the bus device.
[0024] Optionally, the master device is a processing unit, and the slave device is a storage controller or a random access memory.
[0025] Optionally, the plurality of processing units are embedded processors and acceleration units, the plurality of slave devices are storage controllers and random access memories, the embedded processor controls the storage controller to read data from an external memory and store the data in the random access memory, and the acceleration unit reads data from the random access memory for calculation.
[0026] In a third aspect, an embodiment of the present disclosure provides a system on chip, comprising: a bus device as described in any one of the above items; a plurality of master devices connected to the bus device; and a plurality of slave devices connected to the bus device.
[0027] In the prior art, after a bus device receives a write address of a write transaction from a master device to multiple slave devices, it may simultaneously perform write transactions for at least two slave devices. In this way, due to transmission delays and other reasons, the write transactions for the at least two slave devices may cause bus interlocking. In the embodiment of the present disclosure, if the bus device receives multiple write addresses sent by the master device for write transactions to at least two slave devices, only the continuous write addresses for the same slave device among the multiple write addresses are transmitted to the address redirection unit, so that the write transactions for the write addresses of the same slave device are executed first, and after the execution is completed, the write transactions for the subsequent write addresses are executed. In this way, the write transactions executed in the same batch are all for the write address of the same slave device, so the bus interlocking problem will not occur. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The above and other objects, features and advantages of the present disclosure will become more apparent through the description of the embodiments of the present disclosure with reference to the following drawings, in which:
[0029] Figure 1 Used to illustrate a typical bus interlock problem;
[0030] Figure 2 It is a schematic diagram of the principle structure of writing transactions;
[0031] Figure 3 It is the signal timing diagram of write transaction;
[0032] Figure 4 It is the dependency of handshake signals in write transactions;
[0033] Figure 5 It is an embedded system with cascaded secondary bus devices;
[0034] Figure 6 yes Figure 5 The signal timing diagram of the embedded system shown;
[0035] Figure 7 is a schematic diagram of an exemplary bus device structure;
[0036] Figure 8 It is a signal timing diagram obtained according to the solution of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0037] The present disclosure is described below based on embodiments, but the present disclosure is not limited to these embodiments. In the detailed description of the present disclosure below, some specific details are described in detail. It is possible for a person skilled in the art to fully understand the present disclosure without the description of these details. In order to avoid confusing the essence of the present disclosure, well-known methods, processes, and procedures are not described in detail. In addition, the drawings are not necessarily drawn to scale.
[0038] The following terms are used in this article.
[0039] SoC, System on Chip, is a chip solution that implements the entire application system on a single chip.
[0040] AXI, Advanced Extensible Interface, is an advanced extensible bus device and the current mainstream large-scale SoC chip bus device.
[0041] Lock, the AXI bus device is interlocked and the bus device cannot continue to work normally.
[0042] Outstanding: During transmission, the Master can initiate the next read / write transaction before the previous read / write transaction is completed, thereby effectively improving transmission efficiency.
[0043] Maximum number of in-transit transactions: refers to the maximum number of in-transit read or write transactions that the outstanding feature of the bus device can support. The number of read or write transactions that the bus device has not yet completed must be less than or equal to the maximum number of in-transit transactions.
[0044] DDRC, Double Data Rate Controller, double data rate memory controller, SoC chip external memory controller.
[0045] SRAM, Static Random Access Memory, static random access memory, the internal storage unit of SoC chip.
[0046] Before introducing the various embodiments of the present disclosure, it is necessary to first understand various aspects of the bus. The most widely used bus at present is the AIX bus. The AXI bus is the most important part of the AMBA (Advanced Microcontroller Bus Architecture) 3.0 and above protocols proposed by ARM. It is an on-chip bus for high performance, high bandwidth, and low latency. The AIX bus separates the address / control and data phases, supports unaligned data transmission, and supports burst transmission and out-of-order transmission, thus meeting the requirements of ultra-high performance and complex on-chip system design.
[0047] Figure 2 The schematic diagram of the structure of the write transaction principle. The write transaction includes a whole set of operations. As shown in the figure, the initiator of the write transaction is the master device 20, and the receiver is the slave device 30.
[0048] The write transaction includes data transmission in three channels, namely the write address channel 201, the write data channel 202, and the write response channel 203. The write address channel 201 is used to transmit the write address and control information, and the control information is used to describe the properties of the data being transmitted. The write data channel 202 is used to transmit write data. The write response channel 203 is used to transmit response information. The arrows indicate the channel direction. As shown in the figure, each channel is unidirectional.
[0049] Each channel includes a dual-channel VALID and READY handshake mechanism. The master device 20 uses the VALID signal to indicate when the write address and control information in the channel are valid. The slave device 30 uses the READY signal to indicate when it can receive data. Specifically, the write address signal transmitted by channel 201 includes a write address valid signal (AWVALID) and a write address ready signal (AWREADY). When the AWVALID signal is 1, it indicates that the write address and control information are valid. When it is 0, it indicates that the write address and control information are invalid. This signal is controlled by the master device 20. When the AWREADY signal is 1, it indicates that the device is ready. When it is 0, it indicates that the device is not ready. This signal is controlled by the slave device 30; the write data signal transmitted by channel 202 includes a write data valid signal (WVALID) and a write data ready signal (WREADY). When the WVALID signal is 1, It indicates that the write data is valid. When it is 0, it indicates that the write data is invalid. The signal is controlled by the master device 20. When the WREADY signal is 1, it indicates that the device is ready. When it is 0, it indicates that the device is not ready. The signal is controlled by the slave device 30. The write response signal transmitted by channel 203 includes a write response valid signal (BVALID) and a write response ready signal (BREADY). When the BVALID signal is 1, it indicates that the write response is valid. When it is 0, it indicates that the write response is invalid. The signal is controlled by the slave device 30. When the BREADY signal is 1, it indicates that the device is ready. When it is 0, it indicates that the device is not ready. The signal is controlled by the slave device 20.
[0050] It should be understood that there is no order requirement for writing data between the write address channel 201 and the write data channel 202. For example, the write address can be written to the write address channel 201 first, and then the write data can be written to the write data channel 202, or the write data can be written to the write data channel 202 first, and then the write address can be written to the address channel 201. However, the write address signal and the write data signal need to correspond. For example, the AXI3.0 specification stipulates that the write address signal and the write data signal each have a label, and this label can correspond the write address signal and the write data signal. However, in the AXI4.0 specification, the label in the write data signal is omitted, so the order of the write data signal must be consistent with the order of the write address signal.
[0051] Figure 3 This is the signal timing diagram of the write transaction. CLK is the clock signal, AWADDR transmits address information, WDATA transmits data information, WLAST is the data end signal, which is sent in the write data channel, indicating that the write data information has been sent, BRESP transmits response information, and the other signals have been introduced above, so they will not be repeated here.
[0052] At the beginning of a write transaction, the master device 20 sends a signal AWADDR to the write address channel 201 for carrying the write address, and sets AWVALID to a high level. When the slave device 30 is ready, it sets AWREADY to a high level. At T2 (the clock signal is a rising edge), AWVALID and AWREADY shake hands successfully, and the write address transmission in the write address channel begins. The master device 20 sends a signal WDATA to carry the write data D(A0), D(A1), D(A2), and D(A3) to the write data channel, and sets WVALID to a high level according to the data. The slave device 30 sets WREADY to a high level accordingly. The handshake is successful at T4, T6, T8, and T9, and the write data is transmitted. When the master device 20 finishes writing data, it sets WLAST to a high level, and the write data transmission ends at T9. Subsequently, the master device 20 sets the signal BVALID to a high level and sends a response message OKAY to the write response channel 203. At time T10, BVALID and BREADY are both high level, and the response information OKAY is transmitted.
[0053] Figure 4 It is the dependency relationship of the handshake signals in the write transaction. Among them, the signal pointed by the single arrow can be enabled after the signal pointed to it is not enabled or enabled, that is, the single arrow indicates that there is no dependency relationship between the two signals; the signal pointed by the double arrow must be enabled after all the signals pointed to it are enabled, that is, the double arrow indicates that there is a dependency relationship between the two signals. From the figure, it can be concluded that in the write transaction, only the BVALID signal can be enabled after the signals AWVALID, AWREADY, WVALID and WREADY are all enabled, and there is no dependency relationship between the other signals.
[0054] After understanding various aspects of the bus, the following Figure 5 The embedded system with cascaded secondary bus devices is taken as an example to describe the bus interlocking problem to be solved by the embodiments of the present disclosure and the corresponding solution.
[0055] As shown in the figure, in order to meet the requirements of the system in terms of speed, volume and power consumption, embedded systems usually do not use large-capacity and slow storage media such as disks to save data and program instructions, but mostly use random access memory 508 or flash memory (Flash Memory) (not shown in the figure), and can be connected to external memory 602 through storage controller 507 to obtain more storage capacity. Through storage controller 507, data and program instructions stored in external memory 602 can be transferred to random access memory 508 or flash memory at any time. Random access memory 508 can be static random access memory or dynamic random access memory, and storage controller 507 can be, for example, static random access memory controller or double rate memory controller. If storage controller 507 is a static random access memory controller, external memory 602 is correspondingly a static random access memory.
[0056] Secondly, in the system, A / D (analog / digital conversion) interfaces 503 and 603 are needed for measurement and control, which are rarely used in general-purpose computers. A / D interfaces 503 and 603 mainly complete the conversion of analog signals to digital signals and the conversion of digital signals to analog signals required in the test. Embedded systems often need to be tested when applied to industrial production. Since the single-chip microcomputer generates digital signals, they need to be converted into analog signals for testing during testing. Therefore, unlike general-purpose computers, A / D (analog / digital conversion) interfaces are required to complete the relevant conversions. In addition, in order to test the internal circuits of embedded systems, processor chips generally use boundary scan test technology. In order to adapt to this test, debug interfaces 506 and 606 can also be used in the system. Bus devices Bus0 and Bus1 are used for the transmission of instructions and data between the processing unit 501 and other parts of the system (such as random access memory 508, serial interface 502, etc.).
[0057] Again, the system 500 needs to communicate with devices and other systems outside the chip, so a connection interface is required. One or more of the following interface types can be provided on the system: USB (Universal Serial Bus, abbreviation of universal serial bus device) interface (not shown), serial interface 502, 602, SPI (Serial Peripheral Interface, serial peripheral interface) interface (not shown), UART (communication transceiver, not shown), I2C bus device interface (not shown). Of course, the interface types applicable to the system are not limited to the above-mentioned interface types. General-purpose computers will also have the same or similar interfaces, but the system generally has fewer interface types. In addition, the structure and function of the processing unit 501 are relatively simple compared to the processing unit in a general-purpose computer. For example, the instruction set architecture supports fewer instructions.
[0058] As shown in the figure, a part of the master devices or slave devices of the system 500 are connected to a single bus device, and the other part of the master devices or slave devices are connected to two bus devices at the same time. Specifically, the master device connected only through the bus device Bus0 is the processing unit 501, and the slave devices connected only through the bus device Bus0 include the serial interface 502, the A / D interface 503, and the debugging interface 506. The master device connected only through the bus device Bus1 is the processing unit 601, and the slave devices include the serial interface 602, the A / D interface 603, and the debugging interface 606. The slave devices connected to the bus devices Bus0 and Bus1 at the same time include: random access memory 508, storage controller 507, and general I / O interface 510. The physical port connecting the bus device Bus0 with the random access memory 508 and the storage controller 507 is marked as S0, and the physical port connecting the bus device S1 with the random access memory 508 and the storage controller 507 is marked as S1.
[0059] In addition, with the rapid development of very large scale integrated circuits (VLSI) and semiconductor processes, the above-mentioned embedded system can also be implemented on a silicon chip, that is, an embedded system on chip (SoC).
[0060] As can be seen from the figure, when the processing unit 501 performs a write transaction on the storage controller 507, the random access memory 508 and the general I / O interface 510, it needs to pass through the bus device Bus0, and when the processing unit 601 performs a write transaction on the storage controller 507, the random access memory 508 and the general I / O interface 510, it needs to pass through the bus device Bus1.
[0061] Combination Figure 2As shown, the write transaction involving the bus device is explained by taking the processing unit 501 performing a write transaction on the storage controller 507 as an example. The processing unit 501 and the bus device Bus0 form three channels for the write transaction, and the bus device Bus0 and the storage controller 507 form three channels for the write transaction. The channels, signals and handshake mechanisms are the same as described above. Here, the bus device Bus0 controls data transmission through the channels between the processing unit 501 and the memory 507. For the bus devices Bus0 and Bus1, the simplest processing method is to complete a write transaction before processing the next write transaction. Although the processing efficiency is low, there will be no bus interlocking problem. When the bus devices Bus0 and Bus1 process multiple write transactions at the same time, the bus interlocking problem may occur. The so-called parallel processing of multiple write transactions means that the bus device does not need to wait for a write transaction to be completed before processing the next write transaction. Parallel processing of multiple write transactions is one of the bus device characteristics of AXI, called the outstanding characteristic, which can be represented by the maximum number of in-transit transactions. For example, the maximum number of in-transit transactions of the bus device is 4, which means that no more than 4 write transactions are processed in parallel in real time. If there are currently 4 write transactions being processed, the bus device will no longer obtain new write transactions. When one of the write transactions is completed, the bus device continues to obtain new write transactions.
[0062] Figure 6 Show Figure 5 The signal timing diagram of the embedded system shown below. Figure 5 Combination Figure 6 Take the example to illustrate the generation process of bus interlocking problem. In this example, the maximum number of in-transit transactions of bus device Bus0 and bus device Bus1 is 4. The specific meanings of signals such as CLK, AWADDR, AWREADY, WVALID, etc. in the figure are the same as those described above, and will not be repeated here. In addition, the signal names in the figure use the master device or slave device name as a prefix. For example, 501.AWADDR represents the write address signal transmitted in the write address channel between the processing unit 501 and the bus device Bus0, and 507.s0.WREADY represents the write data ready signal transmitted in the write data channel between the bus device Bus0 and the storage controller 507. It has the same meaning and function as WREADY in the above text.
[0063] First, from time T0, the processing unit 501 writes write addresses addr1-addr4 to the write address channel, where addr1 and addr2 are the write addresses of the continuous write transactions initiated by the processing unit 501 to the storage controller 507, and addr3-addr4 are the write addresses of the continuous write transactions initiated by the processing unit 501 to the random access memory 508. Similarly, from time T0, the processing unit 601 writes write addresses addr3-addr4 and addr1-addr2 to the write address channel, where addr3-addr4 are the write addresses of the continuous write transactions initiated by the processing unit 601 to the random access memory 508, and addr1-addr2 are the write addresses of the continuous write transactions initiated by the processing unit 601 to the storage controller 507. Continuous write transactions refer to the behavior of writing data in consecutive clock cycles, such as Figure 6 In the example, addr1 and addr2 are written in two adjacent clock cycles.
[0064] At time T0, bus device Bus1 sets 601.AWREADY to a high level. In this article, a high level indicates a valid level, and a low level indicates an invalid level.
[0065] At time T1, bus device Bus0 sets 501.AWREADY to a high level.
[0066] At time T2, the transmission of the write address between the processing unit 501 and Bus0, between Bus0 and the storage controller 507, and the random access memory 508, and between the processing unit 601 and Bus1, and between Bus1 and the storage controller 507 and the random access memory 508 has been completed, and the write address phase ends. As can be seen from the figure, the duration of the high level of 501.AWREADY is 4 clock cycles. The bus device Bus0 can control the duration of the high level of 501.AWREADY according to the number of write transactions currently in transit. For example, if the number of write transactions currently in transit is 2, the bus device Bus0 can maintain the high level of 501.AWREADY for 2 clock cycles to read two write addresses. In addition, for the convenience of explanation, the timing diagram of the signal AWVALID is omitted in the figure.
[0067] At time T3, due to different transmission delays, signal 508.s0.WREADY becomes a high level, indicating that the write data channel of the random access memory 508 responds to the processing unit 501 first, waiting to receive data from the processing unit 501; at the same time, 507.s1.WREADY becomes a high level, indicating that the write data channel of the storage controller 507 responds to the processing unit 601 first, waiting to receive data from the processing unit 601.
[0068] At time T4, since the storage controller 507 follows the write order preservation principle and does not respond to the write data from the processing unit 501, 507.s0.WREADY remains in a low level state until the write data of 507.s1 is completed; the random access memory 508 is a serial design inside and does not respond to the write data from the processing unit 601. 508.s1.WREADY remains in a low level state until the write data of 508.s0 is completed.
[0069] Therefore, at time T4, WVALID and WREADY cannot form a handshake mechanism, resulting in the inability to complete the transmission and causing a bus interlock problem.
[0070] It can be understood from the above example that, based on the outstanding characteristics of the AXI bus, when the bus device receives multiple write transactions continuously issued by the processing units 501 and 601 and simultaneously including multiple write transactions to the storage controller 507 and the random access memory 508, a bus interlocking problem occurs due to transmission delays and other reasons.
[0071] As an optional implementation for the above bus interlocking problem, bus devices Bus0 and Bus1 always keep the maximum number of in-transit transactions of the bus devices at 1.
[0072] by Figure 7 The bus device 70 shown is used as an example. Figure 7 As shown, the bus device 70 includes an arbitration unit 701 and an address redirection unit 702, a write data buffer 704 and a write response buffer 705 coupled to the arbitration unit 701. The bus device 70 also includes a write command buffer 703 coupled to the address redirection unit 702. The write command buffer 703 is used to receive a write address and control information from a write address channel of a master device and transmit the information to the address redirection unit 702. The address redirection unit 702 is used to redirect the write address to the address space of the slave device to achieve addressing. The write data buffer 704 is used to receive write data from the write data channel of the master device. The write response buffer 705 is used to receive response data from the slave device via the arbitration unit 701. The arbitration unit 701 is used to perform various arbitration operations.
[0073] In order to achieve the purpose of maintaining the maximum number of in-transit transactions of bus devices Bus0 and Bus1 at 1, the write command buffer 703 can only cache one write address, and will cache the next write address only after the write transaction corresponding to the write address is executed. Alternatively, although the write command buffer 703 can cache multiple write addresses, the write command buffer 703 will only transmit a write address to the address redirection unit 702 after receiving the notification from the arbitration unit 701. After determining that the write transaction corresponding to the write address is executed, the arbitration unit 701 notifies the write command buffer 703 to transmit a write address after the write address to the address redirection unit 702.
[0074] As another optional implementation, the write command buffer 703 can cache multiple write addresses, but only transmits consecutive write addresses for the same slave device among the multiple write addresses to the address redirection unit 702 after receiving the notification from the arbitration unit 701. After the arbitration unit 701 completes the execution of the write transactions corresponding to the consecutive write addresses for the same slave device, it notifies the write command buffer 703 to transmit the write address after the consecutive write addresses for the same slave device among the multiple write addresses.
[0075] For example, as shown in the figure, the write command buffer 703 receives the write address addr1-addr4 from the master device 20, addr1 and addr2 are the write addresses for the slave device 30, and addr3-addr4 are the write addresses for the slave device 31. The write command buffer 703 will first transmit addr1-addr2 to the address redirection unit 702, and the address redirection unit 702 will direct addr1 and addr2 to the address space of the slave device 30. At the same time, the master device 20 sends the data corresponding to addr1 and addr2 to the write data buffer 704, and then sends the data to the address space of the slave device 30 via the arbitration unit 701. The arbitration unit 701 receives the write response signal from the slave device 30 and writes it to the write response buffer 705, and then provides it to the master device 20. Thus, the arbitration unit 701 can determine that the write transaction corresponding to addr1-addr2 has been executed after receiving the write response signal or writing the write response signal to the write response buffer 705, and then notify the write command buffer 703 to transmit addr3-addr4 to the address redirection unit 702, and so on.
[0076] It should be emphasized that the number of consecutive write addresses to the same slave device among the multiple write addresses mentioned in this embodiment is less than or equal to the maximum number of in-transit transactions of the bus device. In other words, if the number of consecutive write addresses to the same slave device among the multiple write addresses is greater than the maximum number of in-transit transactions of the bus device, the write command buffer 703 should transmit the write address to the address redirection unit 702 according to a number not exceeding the maximum number of in-transit transactions of the bus device.
[0077] In addition, although the present embodiment specifies that the write command buffer transmits consecutive write addresses for the same slave device from a plurality of write addresses to the address redirection unit according to the notification of the arbitration unit, the operation of this part in the time product may also be implemented by the address redirection unit 702, that is, the address redirection unit 702 only takes out consecutive write addresses for the same slave device from a plurality of write addresses for redirection each time, so that the write transactions executed in the same batch are all for the write addresses of the same slave device.
[0078] In addition, in engineering practice, R&D personnel can also use the combination of software and bus devices to solve the bus interlocking problem. For example, by first prohibiting the processing unit from cross-accessing different memories through software, and at the same time reducing the maximum number of in-transit transactions of the bus device to 2, the bus interlocking problem can basically be solved. Cross-accessing different memories refers to, for example, two consecutive write addresses, the first write address accesses the first memory, and the second write address accesses the second memory.
[0079] Figure 8 yes Figure 7 The signal timing diagram obtained by the system shown.
[0080] As shown in the figure, first, from time T0, the processing unit 501 writes write addresses addr1-addr4 to the write address channel, where addr1 and addr2 are the write addresses of the write transaction initiated by the processing unit 501 to the storage controller 507, and addr3-addr4 are the write addresses of two write transactions initiated by the processing unit 501 to the random access memory 508. Similarly, from time T0, the processing unit 601 writes write addresses addr3-addr4 and addr1-addr2 to the write address channel, where addr3-addr4 are the write addresses of the write transaction initiated by the processing unit 601 to the random access memory 508, and addr1-addr2 are the write addresses of two write transactions initiated by the processing unit 601 to the storage controller 507.
[0081] At time T0, bus device Bus1 sets 601.AWREADY to a high level.
[0082] At time T1, bus device Bus0 sets 501.AWREADY to a high level.
[0083] Therefore, at time T2, the write address transmission between the processing unit 501 and Bus0, between Bus0 and the storage controller 507, and the random access memory 508, and the write address transmission between the processing unit 601 and Bus1, and between Bus1 and the storage controller 507 and the random access memory 508 have been completed, and by controlling the duration of the high level of AWREADY and AWVALID, only the write addresses addr1 and addr2 are transmitted. In order to achieve this purpose, the duration of any high level of AWREADY and AWVALID is at least two clock cycles, that is, the number of consecutive write addresses to the same slave device in addr1-addr4 includes: 1) AWREADY is always kept at a high level, and AWVALID is kept at a high level for two clock cycles; 2) AWVALID is always kept at a high level, and AWREADY is kept at a high level for two clock cycles; 3) AWREADY and AWVALID change synchronously, and the duration of the high level is equal to two clock cycles.
[0084] At time T3, 501.WVALID and 501.WREADY become high levels, indicating that the processing unit 501 is ready to write data, and 507.s0.WVALID and 507.s0.WREADY become high levels, so that starting at time T3, the processing unit 501 writes the data of addr1 and addr2 to the memory controller 507. Similarly, at time T3, 601.WVALID and 601.WREADY become high levels, indicating that the processing unit 601 is ready to receive data, and 508.s1.WVALID and 508.s1.WREADY become high levels, so that starting at time T4, the processing unit 601 writes the data of addr3 and addr4 to 508.
[0085] At time T4, 501.AWADDR becomes high level, and since the maximum number of in-transit transactions is 2, write addresses addr3 and addr4 are transmitted during this period.
[0086] At time T5, 501.WVALID and 501.WREADY become high levels, 508.s1.WVALID and 508.s0.WREADY become high levels, so that starting from time T5, processing unit 501 writes the data of addr3 and addr4 to 508. Similarly, at time T5, 601.WVALID and 601.WREADY become high levels, 507.s1.WVALID and 507.s0.WREADY become high levels, so that starting from time T5, processing unit 601 writes the data of addr1 and addr2 to 507.
[0087] It can be understood from the above timing diagram that when the processing unit 501 or 601 continuously issues multiple write transactions to the storage controller 507 and the random access memory 508 at the same time, the write transaction of the same memory is executed after the execution is completed, and then the subsequent write transaction of the same memory is processed, and so on. This can ensure that there will be no bus interlocking problems.
[0088] It should be understood that although the above-mentioned embodiments are described using an embedded system with a two-level bus device cascade as an example, the embedded system can also be a three-level or higher bus device cascade, and the bus interlocking problem and corresponding solution to be solved by the embodiments of the present disclosure can also be applied to an embedded system with a three-level or higher bus device cascade.
[0089] In addition, although in the above embodiments, the write transaction of the processing unit to the memory is used as an example for explanation, this does not mean that the write transaction will not occur between other components. For example, if the embedded system includes a security chip, the security chip can also access the memory as a slave device as a master device. Therefore, the solution to the bus interlocking problem provided by the embodiments of the present disclosure can be scalably applied between any master device and slave device that adopts a bus-based device connection.
[0090] In addition, the embedded system provided by the present disclosure also has a variety of usage scenarios. For example, the embedded system can be used as an edge computing device to collect audio or video data and perform model calculations at the edge of cloud computing. For another example, the embedded system can be used as a distributed computing device to collect data from multiple nodes and use multiple internal processing units to perform distributed parallel computing to improve computing efficiency.
[0091] The commercial value of the disclosed embodiments
[0092] The bus device provided in the embodiment of the present disclosure can be applied to various embedded devices to ensure that bus interlocking problems do not occur. Embedded systems have many usage scenarios, so the bus device provided in the embodiment of the present disclosure also has great application value and market prospects.
[0093] Those skilled in the art will appreciate that the present disclosure may be implemented as systems, methods, and computer program products. Therefore, the present disclosure may be specifically implemented in the following forms, namely complete hardware, complete software (including firmware, resident software, microcode), and may also be implemented in the form of a combination of software and hardware. In addition, in some embodiments, the present disclosure may also be implemented in the form of a computer program product in one or more computer-readable media, which contains computer-readable program code.
[0094] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example but not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or device, or any combination thereof. More specific examples of computer-readable storage media include: an electrical connection of one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this article, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by a processing unit, a device or a device, or used in combination with the program.
[0095] Computer readable signal media may include data signals propagated in baseband or as part of a chopped wave, which carry computer readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any other suitable combination. Computer readable signal media may also be any computer readable medium other than a computer readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction system, apparatus, or device.
[0096] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., and any suitable combination of the foregoing.
[0097] The computer program code for executing the disclosed embodiments may be written in one or more programming languages or combinations. The programming languages include object-oriented programming languages, such as JAVA, C++, and may also include conventional procedural programming languages, such as C. The program code may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet).
[0098] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. An embedded system, comprising: Multiple bus devices; A plurality of master devices, each of which is connected to only one bus device among the plurality of bus devices; A plurality of slave devices, each slave device being connected to at least two bus devices among the plurality of bus devices, wherein the bus devices include: A write command buffer, used for caching a plurality of write addresses sent by the master device, and transmitting consecutive write addresses for the same slave device among the plurality of write addresses to the address redirection unit according to the notification of the arbitration unit; An address redirection unit, used for redirecting the write address to the same slave device to the address space of the same slave device; The arbitration unit is used to notify the write command buffer to transmit a write address subsequent to the write address to the same slave device after the write transaction of the write address to the same slave device is completed.
2. The embedded system according to claim 1, wherein: The arbitration unit controls the duration of the valid level of any one of the write address valid signal and the write address ready signal between the master device and the same slave device to be at least the number of the consecutive write addresses to the same slave device.
3. The embedded system according to claim 2, wherein: The controlling of the duration period of the effective level of any one of the write address valid signal and the write address ready signal between the master device and the same slave device to be at least the number of the write addresses to the same slave device comprises: Keeping the write address valid signal between the master device and the same slave device at a valid level; The effective level duration period of the write address ready signal between the master device and the same slave device is made equal to the number of the continuous write addresses to the same slave device.
4. The embedded system according to claim 2, wherein: The controlling of the duration period of the effective level of any one of the write address valid signal and the write address ready signal between the master device and the same slave device to be at least the number of the write addresses to the same slave device comprises: Make the effective level duration period of the write address effective signal between the master device and the same slave device equal to the number of the continuous write addresses to the same slave device; The write address ready signal between the master device and the same slave device is maintained at a valid level.
5. The embedded system according to claim 2, wherein: The controlling of the duration period of the effective level of any one of the write address valid signal and the write address ready signal between the master device and the same slave device is at least the number of the continuous write addresses to the same slave device comprises: The write address valid signal and the write address ready signal between the master device and the same slave device are changed simultaneously, and the effective level duration periods of both are equal to the number of the continuous write addresses to the same slave device.
6. The embedded system according to claim 2, wherein: The arbitration unit controls the write data valid signal and the write data ready signal between the master device and the same slave device to be at a valid level after the duration period of the valid level of at least one of the write address valid signal and the write address ready signal between the master device and the same slave device is at least the number of consecutive write addresses to the same slave device.
7. The embedded system according to claim 1, wherein: The completion of the write transaction to the write address of the same slave device is determined by the arbitration unit through a write response signal received from the same slave device.
8. The embedded system according to claim 6, wherein: The arbitration unit also controls at least one of a write data valid signal and a write data ready signal between the master device and the same slave device to change from a valid level to an invalid level after the write transaction to the write address of the same slave device is completed.
9. The embedded system according to any one of claims 1 to 8, wherein: The bus device is an AXI bus device.
10. The embedded system according to any one of claims 1 to 8, wherein: The number of write addresses for the same slave device is less than or equal to the maximum number of in-transit transactions of the bus device.
11. The embedded system according to claim 1, wherein: The master device is a processing unit, and the slave device is a storage controller or a random access memory.
12. The embedded system according to claim 1, wherein: The multiple master devices are embedded processors and acceleration units, and the multiple slave devices are storage controllers and random access memories. The embedded processor controls the storage controller to read data from an external memory and store it in the random access memory, and the acceleration unit reads data from the random access memory for calculation.
13. A system on chip, comprising: Multiple bus devices; A plurality of master devices, each of which is connected to one of the plurality of bus devices; A plurality of slave devices, each slave device being connected to at least two bus devices among the plurality of bus devices, wherein the bus devices include: A write command buffer, used for caching a plurality of write addresses sent by the master device, and transmitting consecutive write addresses for the same slave device among the plurality of write addresses to the address redirection unit according to the notification of the arbitration unit; An address redirection unit, used for redirecting the write address to the same slave device to the address space of the same slave device; The arbitration unit is used to notify the write command buffer to transmit a write address subsequent to the write address to the same slave device after the write transaction of the write address to the same slave device is completed.
