AHB2AHB transfer bridge system

By introducing the AHB2AHB adapter bridge system into the AHB bus, and using FIFO cache for instructions and data forwarding, the problem of upstream and downstream equipment not responding in a timely manner is solved, and the transmission efficiency of the AHB bus and the execution efficiency of the equipment are improved.

CN118760646BActive Publication Date: 2024-12-06WUXI GUOXINWEI HIGH-TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411237544.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2024-12-06
Estimated Expiration
2044-09-05

AI Technical Summary

Technical Problem

The upstream and downstream equipment in the AHB bus fails to respond to the relevant signals in a timely manner to the drag on execution efficiency and the reduction in utilization.

Method used

Design an AHB2AHB forwarding bridge system, which caches and forwards instructions and data between upstream and downstream through FIFO cache, ensures that upstream and downstream devices can transmit data without affecting efficiency, and realizes asynchronous communication between upstream and downstream devices. .

Benefits of technology

The transmission efficiency of the AHB bus is improved, the operation continuity and correctness of upstream and downstream equipment is ensured, and the efficiency reduction caused by response delay is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760646B_ABST
    Figure CN118760646B_ABST
Patent Text Reader

Abstract

The present application discloses an AHB2AHB transfer bridge system, which relates to the field of AHB bus. The system includes upstream and downstream controllers, an instruction FIFO, a write data FIFO and a read data FIFO connected between the upstream and downstream controllers; the upstream controller controls the instruction FIFO to store read / write request parameters, controls the write data FIFO to write data of the upstream device, and reads the data in the read data FIFO to the upstream target device according to the handshake request with the upstream device; the downstream controller controls the write data FIFO to write the stored data to the downstream target device and reads the data in the downstream target device to the read data FIFO according to the handshake request with the downstream target device. The scheme can form respective master-slave device communication relationships in the AHB2AHB transfer bridge, improve the utilization rate of the AHB bus, and thus improve the overall transmission efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of AHB bus, and in particular to an AHB2AHB transfer bridge system. Background Art

[0002] Advanced High Performance Bus (AHB) is a system bus designed for connections between high-performance modules, such as CPU, DMA, and DSP. This bus is designed to improve system performance and efficiency by optimizing data transfer and reducing latency. AHB supports a variety of features, including single clock edge operation, non-tri-state implementation, support for burst transfers and segmented transfers, which enable AHB to provide stable and efficient data transfer in high-performance systems.

[0003] In the AHB bus, there is a scenario where the upstream Master device has extremely high performance requirements for read and write speeds when accessing the downstream Slave device module, and does not care about the HRESP signal. Under this requirement, the AHB protocol itself must wait for the HREADY handshake after HTRANS is initiated, which restricts the access efficiency. For example, when the upstream initiates a write operation, if the downstream cannot return the HREADY signal in time, it will drag down the upstream execution efficiency. After the upstream initiates a BURST read operation, if the downstream has returned the HREADY signal, but the upstream cannot respond to the HREADYIN signal in time, or maintain the continuity of HTRANS=3, it will drag down the downstream execution efficiency. These factors will lead to the utilization efficiency of the AHB bus in the entire system. Summary of the invention

[0004] The embodiment of the present application provides an AHB2AHB transfer bridge system to solve the problem that the AHB bus reduces the execution efficiency of the other end and reduces the utilization rate of the entire AHB bus because the upstream and downstream devices fail to respond to relevant signals in time.

[0005] In this solution, at least one device is connected to the upstream and downstream of the system respectively; the system includes an upstream controller connected to the upstream device and a downstream controller connected to the downstream device; a FIFO buffer is connected between the upstream controller and the downstream controller; the FIFO buffer is respectively connected to the upstream device, the downstream device, the upstream controller and the downstream controller through an AHB bus;

[0006] The FIFO cache includes an instruction FIFO, a write data FIFO and a read data FIFO; the upstream controller controls the instruction FIFO to store read / write request parameters, controls the write data FIFO to write data of the upstream device, and reads data in the read data FIFO to the upstream target device according to the handshake status with the upstream device;

[0007] The downstream controller reads and parses the contents of the instruction FIFO and sends them to the downstream target device according to the handshake status with the downstream target device, controls the write data FIFO to write the stored data to the downstream target device, and reads the data in the downstream target device to the read data FIFO.

[0008] Specifically, when the upstream device stores read / write request parameters in the instruction FIFO, writes data in the write data FIFO, or reads data in the read data FIFO, the upstream device is determined as the master device Master of the AHB2AHB transfer bridge, and the upstream controller is determined as the slave device Slave of the AHB2AHB transfer bridge;

[0009] When the downstream controller controls the read data FIFO to read data in the downstream device and controls the write data FIFO to write data to the downstream device, the downstream controller is determined as the Master of the AHB2AHB transfer bridge, and the downstream device is determined as the Slave of the AHB2AHB transfer bridge.

[0010] Specifically, when the upstream controller receives a read / write request from the upstream target device, it obtains a cache status signal of the instruction FIFO through the AHB bus;

[0011] When the cache status signal of the instruction FIFO indicates that it is in a non-full state, the upstream controller sends a PUSH instruction to the instruction FIFO to store the write / read request parameters into the instruction FIFO;

[0012] When the buffer status signal of the instruction FIFO indicates that it is in a full state, a status signal indicating that it is not ready to receive the read / write request parameter is fed back to the upstream target device.

[0013] Specifically, when the upstream target device writes data, the upstream controller obtains the cache status signal of the write data FIFO through the AHB bus;

[0014] When the cache status signal of the write data FIFO indicates that it is not full, the upstream controller sends a PUSH instruction to the write data FIFO, and feeds back a status signal of preparing to receive data to the upstream target device, receives the data sent by the upstream target device in the next beat, and writes the data to the write data FIFO.

[0015] Specifically, when the downstream controller sends a read / write request to the downstream target device, the cache status signal of the instruction FIFO is obtained through the AHB bus;

[0016] When the cache status signal of the instruction FIFO indicates that it is in a non-empty state, the downstream controller sends a POP instruction to the instruction FIFO, extracts the read / write request to the downstream controller, and forwards it to the downstream target device;

[0017] When the cache status signal of the instruction FIFO indicates that it is in an empty state, no POP instruction is sent.

[0018] Specifically, when the downstream controller writes data to the downstream target device, the cache status signal of the write data FIFO is obtained through the AHB bus;

[0019] When the cache status signal of the write data FIFO indicates that it is in a non-empty state, the downstream controller sends a POP instruction to the write data FIFO to control the write data FIFO to write data into the downstream target device in the next beat;

[0020] When the buffer status signal of the write data FIFO indicates that it is in an empty state, no POP instruction is sent;

[0021] In response to the downstream controller receiving a status signal indicating that data reception is completed from the downstream target device, the write request process is terminated.

[0022] Specifically, when the downstream controller reads data from the downstream target device, it obtains the cache status signal of the read data FIFO through the AHB bus;

[0023] When the cache status signal of the read data FIFO indicates that it is not full and receives a status signal from the downstream target device indicating that it is ready to receive data, the downstream controller sends a PUSH instruction to the read data FIFO to control the read data FIFO to read data from the downstream target device and store it in the read data FIFO in the next beat.

[0024] Specifically, when the upstream controller reads out data, it obtains the cache status signal of the read data FIFO through the AHB bus;

[0025] When the buffer status signal of the read data FIFO indicates that it is not empty, the upstream controller sends a POP instruction to the read data FIFO, and feeds back a status signal of being ready to receive data to the upstream target device, and controls the read data FIFO to fetch the data and send it to the upstream target device in the next beat;

[0026] When the buffer status signal of the read data FIFO indicates that it is in an empty state, no POP instruction is sent.

[0027] Specifically, the handshake request between the upstream target device and the upstream controller includes the chip select signal, transmission type and read / write type of the downstream target device; the handshake request between the downstream controller and the downstream target device includes the chip select signal, transmission type and read / write type of the upstream target device.

[0028] Specifically, when the downstream controller sends a read / write request to the downstream target device and the instruction extracted from the instruction FIFO is a BURST type instruction, the downstream controller takes over the downstream AHB bus and continuously sends read / write request instructions to the downstream target device until the BURST ends.

[0029] Specifically, when the upstream clock and the downstream clock frequencies are asynchronous, in the write request phase, when both the command FIFO and the write data FIFO are in a non-full state, the upstream controller writes the write request parameters and data into the command FIFO and the write data FIFO; when both the command FIFO and the write data FIFO are in a non-empty state, the downstream controller writes the data and the write request parameters into the downstream target device;

[0030] In the read request phase, when the instruction FIFO is in a not empty state and the read data FIFO is in a not full state, the downstream controller sends a read request parameter to the downstream target device.

[0031] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least: when the system issues a read / write request at the upstream, the upstream control module replaces the real downstream device Slave, and after storing the relevant instruction parameters and data, the upstream AHB bus can be released, so that the upstream can execute the next command, and at the same time it plays a caching role. All information of the upstream operation is recorded and delivered to the downstream in the order of receipt, which improves the overall transmission efficiency while ensuring the correct execution of the operation. When the downstream performs related operations based on the read / write request, the downstream control module replaces the real upstream device Master, sends a read operation request to the downstream and performs related read / write data operations, which ensures the continuity of the downstream execution operation, avoids the efficiency reduction caused by cavitation, and improves the overall transmission efficiency while ensuring the correct execution of the operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a schematic diagram of the structure of a conventional AHB bus system in the related art;

[0033] Figure 2 is a schematic diagram of the system structure of the AHB2AHB transfer bridge system provided in an embodiment of the present application;

[0034] Figure 3 is a detailed structural diagram of the AHB2AHB transfer bridge system in this embodiment;

[0035] Figure 4 This is a flow chart of an upstream device writing data to a downstream device provided by an embodiment of the present application;

[0036] Figure 5 This is a flowchart of an upstream device reading data from a downstream device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0038] The "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects before and after are in an "or" relationship. For the convenience of writing and memorization, this application uses English abbreviations to replace the Chinese meanings of some terms and nouns, as described in Table 1 below.

[0039] Table 1 AHB protocol signal comparison table

[0040]

[0041] The power of the AHB bus lies in that it can connect the microcontroller CPU, high-bandwidth on-chip RAM, high-bandwidth external memory interface, DMA bus master, and various controllers with AHB interfaces to form an independent complete SOC system. Figure 1 The conventional AHB bus system structure diagram shown in FIG. 1 includes at least one master device Master (instruction / data sender), one slave device Slave (instruction / data receiver) and related gating circuits, which are controlled by arbiters and decoders. The master device can initiate read and write operations by providing addresses and information. At any time, only one bus master device is allowed to be in a valid state and use the AHB bus. The slave device responds to read and write operations within a given address space range, and the bus slave device returns a signal of success, failure, or waiting for data transmission to the valid master device. Figure 1 In the example, three Masters and four Slaves form a complete SOC system. Any Master can interact with any Slave through the signal control of the write data bus HWDATA, the read data bus HRDATA and the address control bus HADDR. The specific Address control mux address selector, Write data mux write data selector and Readdata mux read data selector are respectively selected according to the control signal output to realize the interconnection communication between the master device and the slave device.

[0042] In a traditional AHB bus system, for example, in a SOC design, the CPU core is the upstream, connected to the downstream SDRAM controller (peripheral) through the AHB bus, and indirectly accesses the off-chip SDRAM storage unit. In this application, the following situations may occur:

[0043] 1. The CPU bus clock and SDRAM operating clock are asynchronous and need to be processed synchronously;

[0044] 2. The CPU bus clock and SDRAM operating clock have the same source, but the operating frequencies are different;

[0045] 3. The SDRAM controller needs several clock cycles to access the SDRAM to successfully read the data;

[0046] 4. The SDRAM controller may not be able to respond immediately during the precharge or row and column selection switching process;

[0047] 5. The SDRAM read process is continuous. If it is interrupted in the middle, the controller needs to re-initiate the read operation.

[0048] In the above application scheme, the first four points will cause the SDRAM to be unable to return the HREADY signal in time. The combination of points 1, 2, and 5 will cause the CPU to be unable to respond to HREADY in time and maintain the continuity of HTRANS during the BURST read operation.

[0049] If the SDRAM controller fails to return HREADY in time during a write operation, the CPU will be paused. Even if the CPU has already delivered all the information required for this write operation to the SDRAM controller, it cannot get out of it to execute the next instruction, which reduces operating efficiency.

[0050] If during a BURST read operation, the CPU fails to send an HREADY response to the SDRAM controller in time, or the continuity of HTRANS=3 is interrupted and HTRANS=1 appears, the SDRAM controller's SDRAM reading process will be interrupted, and the process of re-initiating the read operation will consume extra time, reducing the efficiency of the entire transmission process.

[0051] Figure 2 is a schematic diagram of the system structure of the AHB2AHB transfer bridge system provided in the embodiment of the present application. Figure 1 The structural diagram of the AHB bus system in the embodiment is improved, and several upstream devices and downstream devices are connected to the upstream and downstream of the system respectively. Figure 2The left part in the middle represents the upstream device (CPU or other processing core), and the right part represents the downstream device (peripheral device). The two sides of the system can be one-to-one, one-to-many, many-to-one, or many-to-many connection mode, which is not limited in this application.

[0052] exist Figure 2 In the system, the system specifically includes an upstream controller (S_CTRL) connected to an upstream device, a downstream controller (M_CTRL) connected to a downstream device, and a FIFO buffer connected between the upstream controller and the downstream controller. The upstream and downstream devices, the upstream and downstream controllers, and the FIFO buffer are connected through an AHB bus.

[0053] FIFO buffer is mainly used for intermediate instruction and data buffer setting, specifically can be a single FIFO device split or multiple FIFOs together. The embodiment of the present application is divided into three parts according to function, namely instruction FIFO (TXCMD_FIFO), write data FIFO (TXDATA_FIFO) and read data FIFO (TXDATA_FIFO). The import and export ends of write data FIFO and read data FIFO are connected to the upstream device and the downstream device respectively, and the data is transported at both ends according to the first-in-first-out principle. The instruction FIFO is connected to the upstream device, specifically to connect the two ends to the upstream device and the downstream controller respectively, because the control instruction sent from the upstream device needs to be sent to the downstream device after parameter conversion, otherwise the relevant instruction operation cannot be correctly executed.

[0054] The upstream controller needs to perform independent AHB bus communication and transmission with the upstream device, and the downstream controller also needs to perform independent AHB bus communication and transmission with the downstream device. Based on this, an upstream AHB handshake protocol needs to be established between the upstream device and the upstream controller, and a downstream AHB handshake protocol needs to be established between the downstream device and the downstream controller. Based on the upstream AHB handshake established with the upstream device, the upstream controller controls the instruction FIFO to store the read / write request parameters, controls the write data FIFO to write the data of the upstream device, and reads the data in the read data FIFO to the upstream target device. The downstream controller extracts the instructions in the instruction FIFO according to the downstream AHB handshake with the downstream target device, converts it and sends it to the downstream target device (the downstream target device performs related operations based on the operation instructions), controls the write data FIFO to write the stored data to the downstream target device, and reads the data in the downstream target device to the read data FIFO.

[0055] In the above scheme, when the upstream device stores read / write request parameters in the instruction FIFO, writes data to the write data FIFO, or reads data in the read data FIFO, the system determines the upstream device as the master device Master of the AHB2AHB transfer bridge and the upstream controller as the slave device Slave of the AHB2AHB transfer bridge. When the downstream controller controls the read data FIFO to read data from the downstream device and controls the write data FIFO to write data to the downstream device, the system determines the downstream controller as the Master of the AHB2AHB transfer bridge and the downstream device as the slave device Slave of the AHB2AHB transfer bridge.

[0056] For any upstream device, when it needs to communicate and interact with a downstream device, it only needs to establish an AHB handshake with the upstream controller first, without considering the situation of the downstream device. The downstream controller will continue to handshake and transmit data with the downstream device. Assuming that the upstream needs to write data to the downstream, it first wakes up the AHB handshake with the upstream controller, sends the AHB request parameters to the instruction FIFO, and then sends the AHB write data to the write data FIFO. At this time, the upstream AHB handshake comes to an end and the downstream (taking the peripheral as an example) AHB handshake is executed. Next, the downstream controller establishes a downstream AHB handshake protocol with the corresponding downstream device, extracts the request parameters temporarily stored in the instruction FIFO, and sends them to the downstream peripheral. The downstream peripheral writes or reads data according to the request parameters. When executing write data, the downstream controller cooperates to write the AHB write data temporarily stored in the write data FIFO to the peripheral.

[0057] When executing read data, the peripheral reads the AHB read data according to the request parameters and sends the data to the read data FIFO. Correspondingly, the upstream controller takes over the AHB bus again and sends the AHB read data uploaded to the read data FIFO to the upstream device (CPU).

[0058] In summary, when the system issues a read / write request from the upstream, the upstream control module replaces the real downstream device Slave, and after storing the relevant instruction parameters and data, it can release the upstream AHB bus, allowing the upstream to execute the next command, and at the same time act as a cache. All information of the upstream operation is recorded and delivered to the downstream in the order of receipt, which improves the overall transmission efficiency while ensuring the correct execution of the operation. When the downstream performs related operations based on the read / write request, the downstream control module replaces the real upstream device Master, sends a read operation request to the downstream and performs related read / write data operations, ensuring the continuity of the downstream execution operation, avoiding the efficiency reduction caused by cavitation, and improving the overall transmission efficiency while ensuring the correct execution of the operation.

[0059] Figure 3This is a detailed structural diagram of the AHB2AHB transfer bridge system in this embodiment. The system needs to consider the cache status of the corresponding FIFO during all instruction reading and writing and data reading and writing processes. The system can only ensure the flow of the system when the conditions of cache and read operations are met. The following example takes the upstream and downstream read and write requests as an example.

[0060] When the upstream controller receives a read / write request from the upstream target device, it obtains the cache status signal of the instruction FIFO through the AHB bus. The read / write request here includes the HTRANS signal, the HWRITE signal, and the HREADY signal. The HTRANS signal is used to indicate the type and status of the transmission, the HWRITE signal is used to indicate whether the current operation is a write operation or a read operation, and the HREADY signal is used to inquire whether the receiver has completed the previous transmission process and execute the current transmission according to the feedback signal from the receiver. Special note: Because the system of this application includes two interactions between Master and Slave, in order to facilitate the distinction between upstream and downstream, the signal prefixes between upstream and downstream are distinguished by "S" and "M", see for details. Figure 3 The signal in represents. The handshake request between the upstream device and the upstream controller includes the SHTRANS signal, SHWRITE signal, and SHREADY signal. Because both the upstream and downstream may contain many devices, when an upstream device needs to interact with a specific downstream device, the handshake also needs to send the chip select SHSEL signal to facilitate the subsequent handshake and transmission to select the direction. Correspondingly, the downstream interaction process is the MHSEL signal, MHTRANS signal, MHWRITE signal, and MHREADY signal.

[0061] In order to ensure that instructions and data can be successfully written into the corresponding FIFO, the upstream controller needs to obtain the cache status of each FIFO, so S_CTRL will obtain the cache status signal from the instruction FIFO. When the cache status signal of the instruction FIFO indicates that it is not full, S_CTRL will send a PUSH instruction to the instruction FIFO to store the read / write request parameters into the instruction FIFO. The PUSH instruction and the POP instruction correspond to the instruction operations for controlling the storage and pop-up of data in the FIFO. Figure 3 In the process, the CPU sends SHWRITE signal, SHADDR signal and SHSIZE signal to the instruction FIFO. The SHADDR signal indicates the instruction / data address information, and the SHSIZE signal indicates the size of the instruction / data. In some cases, the request parameter may also include a SHBURST signal, which is a burst signal, indicating that the receiving party continuously extracts instructions of a certain length or quantity without POPing the instructions one by one, thereby improving execution efficiency.

[0062] On the contrary, when the cache status signal of the instruction FIFO indicates that it is full (FULL), S_CTRL needs to feedback the status signal (SHREADY_OUT) that it is not ready to receive the read / write request parameters to the upstream target device. In the case of full, S_CTRL can control the upstream to pause one or more beats and wait for the instruction FIFO to take out a certain number of instructions during the downstream handshake before executing.

[0063] Taking the upstream write request operation as an example, when the instruction FIFO stores the write instruction, the corresponding work is the write data FIFO. That is, when the upstream target device writes data, S_CTRL obtains the cache status signal of the write data FIFO through the AHB bus. When the cache status signal of the write data FIFO indicates that it is not full, S_CTRL sends a PUSH instruction to the write data FIFO and feeds back a status signal (SHREADY_OUT) ready to receive data to the upstream target device. The write data FIFO will receive the data SHWDATA sent by the upstream target device (CPU) in the next beat and write the data to the write data FIFO.

[0064] Correspondingly, for the written instructions and data, when M_CTRL sends a read / write request to the downstream target device (peripheral), the downstream controller obtains the cache status signal of the instruction FIFO through the AHB bus. When the cache status signal of the instruction FIFO indicates that it is not empty, M_CTRL will send a POP instruction to the instruction FIFO, pop the read / write request (POP_DATA) and extract it to its internal for appropriate adjustment, and then forward it to the downstream peripheral for handshake. If the handshake instruction is a BURST operation, it will record the parameters of the request entering the BURST, enter the BURST process, and automatically execute MHADDR self-increment, MHTRANS[0] = 1 or 3, etc., until the request from the upstream completes the BURST operation. In particular, when the upstream and downstream clocks are not synchronized, especially when the downstream clock frequency is higher than the upstream clock frequency, the downstream instruction reading speed is higher than the upstream instruction access speed, which may be the case where the downstream instruction is empty. When the cache status signal of the instruction FIFO indicates that it is empty (EMPTY), M_CTRL does not send a POP instruction.

[0065] When M_CTRL writes data to the downstream target device, it obtains the cache status signal of the write data FIFO through the AHB bus. When the cache status signal of the write data FIFO indicates that it is not empty, M_CTRL sends a POP instruction to the write data FIFO, and controls the write data FIFO to write the data MHWDATA to the downstream target device in the next beat. Correspondingly, when the write frequencies on the upper and lower sides are inconsistent and the cache status signal of the write data FIFO indicates that it is empty (EMPTY), the POP instruction is not sent. Specifically, it can be controlled to read again when the next beat or data arrives.

[0066] When MHWDATA is successfully written to the peripheral device, it will automatically feedback the status signal MHREADY_OUT to M_CTRL after receiving the status signal MHWDATA received from the downstream target device, informing M_CTRL to end the write request process.

[0067] Based on the above introduction, let's take the complete timing of writing data from upstream to downstream as an example. Figure 4 This is a flowchart of an upstream device writing data to a downstream device provided by an embodiment of the present application, including the following steps:

[0068] Step 410, the upstream target device sends a write request to S_CTRL;

[0069] Step 420 , when S_CTRL detects that the command is not full, it stores the configuration of the write request into TXCMD_FIFO and returns a SHREADY_OUT signal to the upstream.

[0070] Step 430: When S_CTRL detects that the write data is not full, it stores the upstream write data into TXDATA_FIFO.

[0071] Step 440, M_CTRL takes out the write request configuration from TXCMD_FIFO and sends a write request to the downstream;

[0072] In this step, if the write request is a BURST operation, M_CTRL completely takes over the downstream bus and automatically and continuously sends write requests to the downstream until the BURST ends.

[0073] Step 450: The downstream returns SHREADY_OUT, and the write request is completed.

[0074] The above scheme is described in terms of continuous and complete timing, and step 430 and step 440 can be detected and performed synchronously, or performed in a sequential order, which is not limited in this application. The parsing logic of BURST in M_CTRL is designed in accordance with the AHB protocol standard, supports various BURST lengths of HBURST, and supports two address self-increment methods, INCR and WRAP, in combination with MHSIZE.

[0075] When M_CTRL executes a command from a downstream target device (with Figure 3 When reading data, after sending the read request parameters to the peripheral, the MHREADY_OUT signal will be fed back. Then M_CTRL needs to obtain the cache status signal of the read data FIFO through the AHB bus. At this stage, the margin in the read data FIFO also needs to be considered. When the cache status signal of the read data FIFO indicates that it is not full, and the downstream peripheral feedback status signal (MHREADY_OUT) indicating that it is ready to receive data is received, M_CTRL sends a PUSH instruction to the read data FIFO to control the read data FIFO to read data from the downstream peripheral and store it in the read data FIFO in the next beat.

[0076] Based on the above process, when S_CTRL reads out data, it first obtains the cache status signal of the read data FIFO through the AHB bus. When the cache status signal of the read data FIFO indicates that it is not empty, S_CTRL sends a POP instruction to the read data FIFO, and feeds back a status signal (SHREADY_OUT) to the upstream target device (taking the CPU as an example) indicating that it is ready to receive data, and controls the read data FIFO to pop out the data in the next beat and send it to the upstream target device. In particular, when the cache status signal of the read data FIFO indicates that it is empty (EMPTY), the POP instruction is not sent. The situation where the cache status signal of the read data FIFO indicates that it is empty mainly exists in the case where the upstream clock frequency is higher than the downstream clock frequency. It can be understood that the downstream has not completely stored the MHRDATA in the read data FIFO. At this time, the upstream cannot extract SHRDATA and needs to operate in subsequent beats.

[0077] Based on the above introduction, the complete timing of reading data from upstream to downstream is used as an example to illustrate. Figure 5 This is a flowchart of an upstream device reading data from a downstream device provided in an embodiment of the present application, including the following steps:

[0078] Step 510, the upstream target device sends a read request to S_CTRL;

[0079] Step 520, when S_CTRL detects that the command is not full, it stores the configuration of the read request into TXCMD_FIFO;

[0080] Step 530, M_CTRL takes out the read request configuration from TXCMD_FIFO and sends a read request to the downstream;

[0081] If it is a BURST operation, M_CTRL takes over the downstream bus and automatically and continuously sends read requests to the downstream until the BURST ends.

[0082] Step 540, the downstream returns read data MHRDATA and MHREADY_OUT;

[0083] Step 550, M_CTRL stores the read data into RXDATA_FIFO;

[0084] Step 560 , S_CTRL takes out the read data SHRDATA from RXDATA_FIFO and returns MHREADY_OUT upstream, and the read request is completed.

[0085] Note that the MHRDATA in step 540 and the SHRDATA in step 560 represent the same data, indicating that they are in different links and are represented separately. In particular, in the read operation request, although the process of receiving the upstream read request and sending the read request to the downstream will query whether the TXCMD_FIFO is not full or empty, the SHREADY_OUT signal at this time is not affected by the non-full control, and the corresponding MHREADY_OUT signal is not affected by the non-empty control. The above scheme is described based on a continuous and complete timing. When the read request is a BURST read request and is in the middle of the process, the TXCMD_FIFO will automatically execute POP, and will no longer care about the content of POP_DATA until the number of POPs is equal to the number required by the BURST.

[0086] In order to adapt to the AHB protocol, the PUSH_DATA / POP_DATA of RXDATA_FIFO is effective after one beat of the PUSH / POP command. The width of each FIFO is fixed according to the AHB protocol, and the depth is determined according to the actual application requirements. By changing the properties of the FIFO, it can be compatible with a variety of different upstream and downstream clock scenarios. In particular, when executing write / read instructions and writing / reading data in the above scheme, it is necessary to first determine whether the FIFO is full or empty. This is designed to take into account the asynchronous and clock asynchronous situations.

[0087] In some embodiments, when the upstream and downstream clocks are asynchronous, the three FIFOs are asynchronous FIFOs. During the write operation, it is necessary to ensure that both TXCMD_FIFO and TXDATA_FIFO are not empty before POP can be performed to ensure the integrity of the AHB protocol. When the upstream clock and the downstream clock frequency are asynchronous, for the write request operation, in order to improve the access and write efficiency, S_CTRL can simultaneously obtain the cache status of the instruction FIFO and the write data FIFO. Only when the two FIFOs return a non-full status signal at the same time, the steps of writing instruction parameters and writing data SHWADA are synchronously executed. Equivalently, in the downstream write phase, only when M_CTRL obtains the returned non-full status signal at the same time, the steps of POP instruction parameters and writing data SHWADA are synchronously executed. In the read request phase, when the instruction FIFO is not empty and the read data FIFO is not full, the downstream controller sends the read request parameters to the downstream target device.

[0088] For the case of upstream and downstream clock synchronization and frequency ratio of 1:1, the three FIFOs are synchronous FIFOs, and all support the PUSH command to directly POP out data without entering the FIFO when the FIFO is empty, so as to achieve the fastest response speed. When the upstream and downstream clocks are synchronized and the frequency ratio is n:1 or 1:n, that is, the upstream and downstream access speeds are unequal, and it is also the case that the cache status of each FIFO is judged separately or synchronously. At this time, the three FIFOs are equivalent to synchronous FIFOs, and all support the PUSH command to directly POP out data without entering the FIFO when the FIFO is empty, so as to achieve the fastest response speed. To solve this inequality problem, the processing logic for dealing with the frequency increase and decrease from upstream to downstream can be set inside TXCMD_FIFO and TXDATA_FIFO, and the processing logic for dealing with the frequency increase and decrease from downstream to upstream can be set inside RXDATA_FIFO.

[0089] To sum up, the present application uses the SOC on-chip bus design built with the AHB2AHB transfer bridge system. Both the sender and the receiver do not need to consider the corresponding situation of the other party. They only need to establish a handshake protocol and transmit instruction data with the AHB2AHB transfer bridge system. After the handshake and transmission of instructions and data, they can switch to other tasks without consuming too much delay waiting for a response and affecting the efficiency of the entire transmission process. Therefore, connecting this AHB2AHB bridge can optimize the AHB transmission process, eliminate constraints, and improve transmission efficiency.

[0090] This specific embodiment is merely an explanation of the present invention and is not a limitation of the present invention. After reading this specification, those skilled in the art may make non-creative modifications to the present embodiment as needed. However, as long as they are within the scope of the claims of the present invention, they are protected by the patent law.

Claims

1. An AHB2AHB transfer bridge system, characterized in that: The upstream and downstream of the system are respectively connected to at least one device; the system comprises an upstream controller connected to the upstream device and a downstream controller connected to the downstream device; a FIFO buffer is connected between the upstream controller and the downstream controller; the FIFO buffer is respectively connected to the upstream device, the downstream device, the upstream controller and the downstream controller through an AHB bus; The FIFO cache includes an instruction FIFO, a write data FIFO and a read data FIFO; the upstream controller controls the instruction FIFO to store read / write request parameters, controls the write data FIFO to write data of the upstream device, and reads the data in the read data FIFO to the upstream target device according to the handshake status with the upstream device; the handshake request between the upstream target device and the upstream controller includes the chip select signal, transmission type and read / write type of the downstream target device; The handshake request between the downstream controller and the downstream target device includes the chip select signal, transfer type and read / write type of the upstream target device; The downstream controller reads out the contents of the instruction FIFO, parses them and sends them to the downstream target device according to the handshake status with the downstream target device, controls the write data FIFO to write the stored data to the downstream target device, and reads the data in the downstream target device to the read data FIFO; When the upstream device stores read / write request parameters in the instruction FIFO, writes data in the write data FIFO, or reads data in the read data FIFO, the upstream device is determined as the master device Master of the AHB2AHB transfer bridge, and the upstream controller is determined as the slave device Slave of the AHB2AHB transfer bridge; When the downstream controller controls the read data FIFO to read data from the downstream device and controls the write data FIFO to write data to the downstream device, the downstream controller is determined as the Master of the AHB2AHB bridge, and the downstream device is determined as the Slave of the AHB2AHB bridge; when the downstream controller sends a read / write request to the downstream target device and a BURST type instruction is extracted from the instruction FIFO, the downstream controller takes over the downstream AHB bus and continuously sends read / write request instructions to the downstream target device until the BURST ends.

2. The AHB2AHB transfer bridge system according to claim 1, characterized in that: When the upstream controller receives a read / write request from an upstream target device, it obtains a cache status signal of the instruction FIFO via the AHB bus; When the cache status signal of the instruction FIFO indicates that it is in a non-full state, the upstream controller sends a PUSH instruction to the instruction FIFO to store the write / read request parameters into the instruction FIFO; When the buffer status signal of the instruction FIFO indicates that it is in a full state, a status signal indicating that it is not ready to receive the read / write request parameter is fed back to the upstream target device.

3. The AHB2AHB transfer bridge system according to claim 2, characterized in that: When the upstream target device writes data, the upstream controller obtains the cache status signal of the write data FIFO through the AHB bus; When the cache status signal of the write data FIFO indicates that it is not full, the upstream controller sends a PUSH instruction to the write data FIFO, and feeds back a status signal of preparing to receive data to the upstream target device, receives the data sent by the upstream target device in the next beat, and writes the data to the write data FIFO.

4. The AHB2AHB transfer bridge system according to claim 1, characterized in that: When the downstream controller sends a read / write request to the downstream target device, it obtains the cache status signal of the instruction FIFO through the AHB bus; When the cache status signal of the instruction FIFO indicates that it is in a non-empty state, the downstream controller sends a POP instruction to the instruction FIFO, extracts the read / write request to the downstream controller, and forwards it to the downstream target device; When the cache status signal of the instruction FIFO indicates that it is in an empty state, no POP instruction is sent.

5. The AHB2AHB transfer bridge system according to claim 4, characterized in that: When the downstream controller writes data to the downstream target device, it obtains the cache status signal of the write data FIFO through the AHB bus; When the cache status signal of the write data FIFO indicates that it is in a non-empty state, the downstream controller sends a POP instruction to the write data FIFO to control the write data FIFO to write data into the downstream target device in the next beat; When the buffer status signal of the write data FIFO indicates that it is in an empty state, no POP instruction is sent; In response to the downstream controller receiving a status signal indicating that data reception is completed from the downstream target device, the write request process is terminated.

6. The AHB2AHB transfer bridge system according to claim 4, characterized in that: When the downstream controller reads data from the downstream target device, it obtains the cache status signal of the read data FIFO through the AHB bus; When the cache status signal of the read data FIFO indicates that it is not full and receives a status signal from the downstream target device indicating that it is ready to receive data, the downstream controller sends a PUSH instruction to the read data FIFO to control the read data FIFO to read data from the downstream target device and store it in the read data FIFO in the next beat.

7. The AHB2AHB transfer bridge system according to claim 2, characterized in that: When the upstream controller reads out data, it obtains the cache status signal of the read data FIFO through the AHB bus; When the buffer status signal of the read data FIFO indicates that it is not empty, the upstream controller sends a POP instruction to the read data FIFO, and feeds back a status signal of being ready to receive data to the upstream target device, and controls the read data FIFO to fetch the data and send it to the upstream target device in the next beat; When the buffer status signal of the read data FIFO indicates that it is in an empty state, no POP instruction is sent.

8. The AHB2AHB transfer bridge system according to any one of claims 1 to 7, characterized in that: When the upstream clock and the downstream clock frequencies are asynchronous, in the write request phase, when both the command FIFO and the write data FIFO are in a non-full state, the upstream controller writes the write request parameters and data into the command FIFO and the write data FIFO; when both the command FIFO and the write data FIFO are in a non-empty state, the downstream controller writes the data and the write request parameters into the downstream target device; In the read request phase, when the instruction FIFO is in a not empty state and the read data FIFO is in a not full state, the downstream controller sends a read request parameter to the downstream target device.

9. The AHB2AHB transfer bridge system according to any one of claims 1 to 7, characterized in that: When the upstream clock and downstream clock frequencies are synchronized, and when the instruction FIFO, read data FIFO, and write data FIFO are not empty, the upstream controller does not store instruction parameters / data into the FIFO through the PUSH instruction, and the downstream controller directly takes them out through the POP instruction.