Data processing method and device based on AXI bus
By assigning different IDs to the subcommands of write operations in the AXI bus, the problem of low efficiency when writing burst data across page boundaries in the AXI bus is solved, and more efficient write operation control is achieved.
Patent Information
- Application Number
- CN202410769019.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-10-15
AI Technical Summary
In the AXI bus, when the master device writes burst data across page boundaries, it needs to split the write command to achieve cross-page write operations. However, this control method requires a maximum number of outstanding cache units to store the splits of different IDs. identification, resulting in high control costs and low execution efficiency.
By obtaining the first address and burst transmission length of the write command, determine whether the write command needs to be split, and assign different IDs to the split subcommands, including the first ID and the second ID, where the first ID is a special ID. , the second ID is the same as the original ID, and the completion of the write operation is judged only based on these IDs.
It improves the execution efficiency of write operations, reduces dependence on cache units, reduces control costs, and improves the efficiency of write operations.
Smart Images

Figure CN118779264A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of chip design technology, and in particular to a data processing method and device based on an AXI bus. Background Art
[0002] The AXI bus (Advanced Extensible Interface) supports a transmission method based on write bursts, and can ensure that transactions with the same ID are completed in order by assigning IDs to multiple transactions, while transactions with different IDs can be completed out of order. Therefore, the AXI bus is an on-chip bus for high performance, high bandwidth, and low latency.
[0003] The AXI bus has a corresponding virtual address storage space. To facilitate memory management, the virtual address storage space can be divided into multiple pages, each of which contains a certain number of memory cells. In this way, the master device can access the virtual address in the page and read the data in the corresponding memory cell. However, when the master device writes burst data, the address range covered by the write operation will exceed the address range of the current page. At this time, the write command associated with the write operation needs to be split to implement a write burst operation across page boundaries.
[0004] In the process of splitting the write command, the same ID can be assigned to the two sub-commands after the split, and the split sub-commands can be sent based on the same ID. In the verification stage of the write operation, by receiving all the IDs returned from the device and saving the split identifiers of each ID, the ID of the second sub-command after the split command is returned to the master device, so that the master device can confirm that the write operation is completed. However, this control method requires a cache unit with a depth of the maximum outstanding number (the number of write commands that the master device can continuously issue without waiting for the write response channel to return information) to store different IDs, and N (N is the total number of different IDs) cache units with a depth of the maximum outstanding number to store the split identifiers of each ID, and the control cost is high. And all IDs returned from the slave device must be split to determine whether the ID is the ID of the second sub-command, and the execution efficiency is low. Summary of the invention
[0005] The present application provides a data processing method and device based on an AXI bus to solve the problem of low efficiency when a master device writes Burst data across page boundaries based on the AXI bus.
[0006] In a first aspect, the present application provides a data processing method based on an AXI bus, comprising:
[0007] When performing a write operation, obtaining write command information, the write command information including a first address of the write command, a burst transfer length, and an original ID; the burst transfer length is used to characterize a target memory space required for writing burst data associated with the write command;
[0008] If the target memory space spans the maximum memory space of the page, split the write command to obtain a first subcommand and a second subcommand; wherein the command ID of the first subcommand is a first ID, which is a non-original ID; the command ID of the second subcommand is a second ID, which is the same as the original ID of the write command;
[0009] Performing a write operation based on the first subcommand and the second subcommand, and receiving feedback information from a write response channel; the feedback information includes the first ID and the second ID;
[0010] Interrupt information is generated according to the feedback information, where the interrupt information is used to indicate that the current write operation is completed.
[0011] In some feasible embodiments, after obtaining the burst transfer length of the write command, the method further includes:
[0012] Calculating a target bit width of write data associated with a write command according to the data bit width of the AXI bus;
[0013] Calculating a maximum data transmission length within the offset range of the current page according to the page size bit width of the current page and the target bit width; the maximum data transmission length is a maximum memory space provided by the current page for the write burst data;
[0014] If the burst transmission length is greater than the maximum data transmission length, it is determined that the write command needs to be split.
[0015] In some feasible embodiments, if it is detected that the continuous transmission length crosses a page boundary, the write command is split to obtain a first sub-command and a second sub-command, including:
[0016] marking the maximum data transfer length as a first burst transfer length of a first write burst data associated with the first subcommand;
[0017] According to the first address of the write command, setting the first address of the first subcommand;
[0018] A first ID is set for the first subcommand.
[0019] In some feasible embodiments, it also includes:
[0020] Calculate the difference between the burst transfer length of the write command and the first burst transfer length of the first write burst data to obtain a second burst transfer length of the second write burst data associated with the second subcommand;
[0021] Calculating the page address of the current page according to the first address of the write command, and performing an addition operation on the page address of the current page to obtain the page address of the subsequent page;
[0022] Setting a second address of the second subcommand according to the page address of the subsequent page;
[0023] The original ID of the write command is set as the second ID of the second subcommand.
[0024] In some feasible embodiments, performing a write operation based on the first sub-command and the second sub-command includes:
[0025] Sending the first subcommand to the slave device based on the first ID, the first burst transfer length and the first address of the first write command;
[0026] Sending the second sub-command to the slave device based on the second ID, the second burst transfer length and the second address of the second write command;
[0027] Sending a first write burst data associated with the first subcommand to the slave device;
[0028] A second write burst data associated with the second subcommand is sent to the slave device.
[0029] In some feasible embodiments, receiving feedback information from a write response channel includes:
[0030] receiving feedback information, the feedback information including first feedback information based on the first sub-command feedback, or second feedback information based on the second sub-command feedback;
[0031] If the feedback ID in the feedback information is the first ID, ignore the first ID;
[0032] If the feedback ID in the feedback information is the second ID, the second ID is stored in a preset cache and sent to the master device.
[0033] In some feasible embodiments, it also includes:
[0034] Acquire interface status information of the AXI bus, wherein the interface status information includes write command channel transmission status information and write response channel transmission status information;
[0035] When the write command channel transmission status information indicates that the write command channel is transmitting data, a write command valid signal is obtained; or when the write response channel transmission status information indicates that the write response channel is transmitting data, the write response valid signal is obtained.
[0036] In some feasible embodiments, performing a write operation based on the first subcommand and the second subcommand, and receiving feedback information, further includes:
[0037] Set a counter, wherein the initial count value of the counter is 0;
[0038] If the write command valid signal is obtained, the count value of the counter is controlled to increase by 1;
[0039] If the write response valid signal is obtained, the count value of the counter is controlled to be reduced by 1.
[0040] In some feasible embodiments, generating interruption information according to the feedback information includes:
[0041] Obtaining a count value of the counter;
[0042] When the count value is not zero, or the write command valid signal is obtained, marking the AXI bus as a running state;
[0043] When the count value is zero and the write command valid signal is not obtained, marking the AXI bus as an idle state;
[0044] When the AXI bus is in an idle state and the number of IDs received by the master device reaches a threshold value, the intermediate
[0045] wherein the quantity threshold is the number of write burst transfers required when the write burst data associated with the write command is transmitted.
[0046] In some feasible embodiments, it also includes:
[0047] If the target memory space does not span the maximum memory space of the page, sending the write command to the slave device based on the original ID, the first address and the burst transfer length of the write command;
[0048] Sending write burst data associated with the write command to the slave device;
[0049] receiving write feedback information associated with the write command, wherein the write feedback information includes the original ID;
[0050] The original ID is stored in a preset buffer and sent to the main device.
[0051] In a second aspect, the present application provides a data processing device based on an AXI bus, characterized in that it includes: a control module, a splitting module, a write operation module and an interrupt module;
[0052] When executing a write operation, the control module obtains write command information, wherein the write command information includes a first address of the write command, a burst transfer length, and an original ID; the burst transfer length is used to characterize a target memory space required for writing the burst data;
[0053] The splitting module splits the write command to obtain a first subcommand and a second subcommand when the target memory space spans the maximum memory space of the page; wherein the command ID of the first subcommand is a first ID, which is a non-original ID; the command ID of the second subcommand is a second ID, which is the same as the original ID of the write command;
[0054] The write operation module performs a write operation based on the first subcommand and the second subcommand, and receives feedback information from a write response channel; the feedback information includes the first ID and the second ID;
[0055] The interrupt module generates interrupt information according to the feedback information, and the interrupt information is used to indicate that the current write operation is completed.
[0056] It can be seen from the above technical content that the present application provides a data processing method and device based on AXI bus. When executing a write operation, the method obtains the first address and burst transfer length of the write command to determine whether the write burst transfer crosses the page boundary. When the write burst transfer crosses the page boundary, the write command is split to obtain a first subcommand and a second subcommand. And different IDs are assigned to the first subcommand and the second subcommand, namely the first ID and the second ID. The first ID is a special ID, that is, an ID number that is different from all the original IDs. The second ID is the same as the original ID of the split write command. Therefore, when receiving feedback information from the device, it is possible to determine whether the current write operation is completed only based on the first ID and the second ID, which is conducive to improving the execution efficiency of the write operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0058] Figure 1 A schematic diagram of the interconnection structure of the master device and the slave device based on the AXI bus provided in the embodiment of the present application;
[0059] Figure 2A flow chart of a data processing method provided in an embodiment of the present application;
[0060] Figure 3 A schematic diagram of a state machine architecture provided for an embodiment of the present application;
[0061] Figure 4 A flowchart of whether a write operation needs to be split according to whether a write command needs to be executed according to an embodiment of the present application;
[0062] Figure 5 A flow chart of a state machine provided in an embodiment of the present application processing a command ID according to feedback information;
[0063] Figure 6 A flow chart of a state machine provided in an embodiment of the present application for determining whether a write operation is completed based on interface status information;
[0064] Figure 7 A schematic diagram of the counter principle provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] The following embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following embodiments do not represent all implementations consistent with the present application. They are only examples of systems and methods consistent with some aspects of the present application as detailed in the claims.
[0066] Figure 1 It is an interconnection structure based on AXI bus, such as Figure 1 As shown, the master device (master) can access the slave device (slave) by accessing the virtual address provided by the AXI bus, and interact with the slave device for data. The master device may refer to a device that obtains bus control, such as a central processing unit (CPU); the slave device may refer to a device accessed by the master device, such as a static random access memory (SRAM). The master device can also access the data and instructions stored in the memory by accessing the virtual address. Among them, the AXI bus can provide a virtual address space and store virtual addresses in the virtual address space. In order to facilitate memory management, the virtual address space can be divided into multiple pages. Each page includes multiple data units, and the data stored in the data unit has a mapping relationship with the data in the slave device. Therefore, the master device can access or modify the data stored in the data unit in each page by accessing the virtual address to achieve data interaction with the slave device.
[0067] Each virtual address stored in a page is used to describe a data unit, and the size of the data unit is related to the number of bits in the system. Taking a 32-bit system as an example, its virtual address space is 4GB, then the size of each page can be divided into 4KB, where the length of the data unit corresponding to the virtual address in each page is 4 bytes. Among them, when describing the virtual address, the upper 20 bits of the virtual address are used to represent the page number, and the virtual addresses with the same page number are in the same page; the lower 12 bits of the virtual address are used to represent the page offset. When the page offset is 0, the corresponding address is the page boundary, and the page boundary can also be called a 4K boundary.
[0068] However, in some application scenarios, when the master device issues a write command to perform a write burst operation, the memory space required will exceed the maximum memory space of the current page, that is, it crosses the page boundary. At this time, the write command can be split, and the burst length (continuous transmission length) of the write command must be aligned to 4K to ensure that the write operation is executed normally. When splitting the write command, the same ID can be assigned to the split sub-command with a split identifier. In this way, when the slave device returns a data packet for verifying the completion of the write operation, the ID can be extracted from the data packet, and the split identifier can be extracted from the ID. The extracted ID and split identifier can be stored in a preset cache, and the current ID can be confirmed based on the split identifier to confirm whether it is a split ID. If it is not a split ID, it is returned directly. If it is a split ID, the ID of the second sub-command is returned to the master device so that the master device can confirm that the write operation is complete.
[0069] The number of different IDs in the system is known and fixed. In the above verification process, a cache unit with a depth of the maximum outstanding number (the number of write commands that the master device can continuously issue without waiting for the write response channel to return information) is required to store different IDs, and N (N is the total number of different IDs) cache units with a depth of the maximum outstanding number are required to store the split identifiers of each ID. However, this method has a high control cost, and all IDs returned from the device must be split to determine whether the ID is a split ID, which reduces the verification efficiency.
[0070] In order to solve the above problems, the present application provides a data processing method based on AXI bus, such as Figure 2 As shown, the method includes:
[0071] S100: When executing a write operation, obtain write command information; the write command information includes a first address of the write command, a burst transfer length, and an original ID.
[0072] A write operation may refer to a write burst operation. It is understood that the write operation in the following text may also refer to a write burst operation. The burst transfer length of a write command refers to the target memory space required to write burst data in the current write operation. A write command is a command associated with a write operation. The master device can access the AXI bus based on the write command to perform a write operation.
[0073] In some embodiments, when performing a write operation, a state machine may be used to control the operation flow of the write operation. The state machine may determine whether the write command needs to be split according to the burst transfer length of the write burst data. That is, the state machine may compare the burst transfer length of the write burst data with the remaining maximum transfer length contained in each page to determine whether the current write operation crosses the page boundary.
[0074] In some embodiments, after the state machine obtains the burst transfer length of the write burst data, it may further perform the following steps:
[0075] According to the data bit width of the AXI bus, the target bit width of the write burst data associated with the write command is calculated. According to the page size bit width of the current page and the target bit width, the maximum data transmission length within the offset range of the current page is calculated; the maximum data transmission length is the maximum memory space that the current page can provide for the write burst data. If the burst transmission length is greater than the maximum data transmission length, it is determined that the write command needs to be split, and then the write burst data is transmitted to the slave device through multiple write burst transmissions.
[0076] The data width of the AXI bus is used to determine the amount of data that can be transmitted within one data transmission cycle. The target width (size width of write burst data) can be determined based on the data width of the AXI bus. For example, the data width of the AXI bus is recorded as DW, and the size width of the write data is recorded as WDATA_SIZE_W. Then, according to WDATA_SIZE_W=log2(DW / 8), WDATA_SIZE_W can be determined; for example, when DW=32 and WDATA_SIZE_W=2, 32 bits equal 4 bytes, and the number of bits used to represent the byte value of 4 bytes is 2, so WDATA_SIZE_W=2. That is, the size width of the write data is used to determine how many bits are needed to represent the size of the number of bytes in the current write operation. The maximum data transmission length is the maximum memory space provided by the current page for the write command.
[0077] In some embodiments, the maximum data transmission length is calculated by combining the page size bit width of the current page and the size bit width of the write burst data. The maximum data transmission length is recorded as AWLEN_MAX, and the page size bit width is recorded as PAGE_SIZE_W=12. According to AWLEN_MAX=~AWADDR[PAGE_SIZE_W-1:WDATA_SIZE_W], the maximum data transmission length AWLEN_MAX=~AWADDR[11:2] can be determined.
[0078] In this way, the state machine can compare the burst transfer length of the write burst data with the maximum data transfer length. If the burst transfer length is greater than the maximum data transfer length, it is determined that the target memory space required for writing the burst data exceeds the maximum memory space supported by the current page, and the write command needs to be split.
[0079] S200: If the target memory space spans the maximum memory space of the page, split the write command to obtain a first subcommand and a second subcommand;
[0080] When the target memory space required to write burst data exceeds the maximum memory space that the current page can provide, the write operation can be guaranteed by splitting the write command. Figure 3 As shown, the state machine can control the CMD_SPLIT module to perform split judgment and split operation on the write command.
[0081] In some embodiments, after splitting the write command, a first subcommand and a second subcommand are obtained, wherein the first subcommand includes a first ID, and the second subcommand includes a second ID, and the first ID is a special ID, that is, a non-original ID. The second ID is the original ID of the write command. It should be noted that the first ID is an ID that will not be used in any other transaction in the current application scenario, so that the write operation will not be interfered with by other tasks. The second ID can use the original ID of the write command, and it is different from the first ID, so that the master device can determine the completion of the write operation by identifying the second ID during the verification phase of the write operation.
[0082] It should be noted that after the command is split to obtain the first subcommand and the second subcommand, the burst transfer length, address and ID of the first subcommand and the second subcommand need to be set so that the first subcommand and the second subcommand can be sent normally. In some embodiments, the maximum data transfer length supported by the current page can be marked as the first burst transfer length of the first write burst data, and the first address of the write command is set to the first address of the first subcommand, and the first ID is set for the first subcommand.
[0083] The address bit width of the AXI bus can determine the addressable memory range supported by the current page. When the state machine uses the calculated maximum data transmission length as the first burst transmission length of the first write burst data, the first sub-command first address should also be assigned in combination with the first address of the write command and the address of the current page.
[0084] In some embodiments, the address of the current page may be recorded as AWADDR, the address width of the AXI bus may be recorded as AW, and when AW is 32, the address of the first subcommand is ADDR_ORIG[31:0]. In addition, the state machine may also set a first ID for the first subcommand to distinguish the first ID from IDs involved in other transactions.
[0085] It can be understood that when the first burst transmission length of the first write burst data is equal to the maximum data transmission length of the page, the second continuous transmission length of the second write burst data can be calculated according to the maximum data transmission length and the burst transmission length of the write command. In some embodiments, the difference between the burst transmission length of the write burst data and the first burst transmission length of the first write burst data can be calculated to obtain the second burst transmission length of the second write burst data. Then, the subsequent page is determined according to the address bit width of the AXI bus and the page size bit width of the current page. And the second address is set for the second subcommand based on the virtual address in the subsequent page, and the second ID is set for the second subcommand.
[0086] In some embodiments, the second burst transmission length may be recorded as AWLEN_2ND, where the AXI protocol stipulates that the burst transmission length is the actual transmission length minus 1, so it is necessary to additionally subtract 1 when calculating the second continuous length to meet the transmission requirements. It can be expressed as AWLEN_2ND=AWLEN_ORIG-AWLEN_MAX-1.
[0087] The second address can be recorded as AWADDR_2ND={page_addr_2nd,{PAGE_SIZE_W{1'b0}}}, where page_addr_2nd refers to the first address of the current page, page_addr_2nd=AWADDR[AW-1:PAGE_SIZE_W]+1. AWADDR refers to the first address of the first subcommand, PAGE_SIZE_W refers to the page size bit width, when AW is 32, PAGE_SIZE_W=12, page_addr_2nd=AWADDR_LAST[31:12]+1. In this way, page_addr_2nd can be set to the high 20 bits of the subsequent page, and the low 12 bits of the subsequent page are filled with 0 to obtain the first address of the second subcommand, that is, the second address.
[0088] The second ID may be the original ID of the write command, and the original ID may be recorded as AWID.
[0089] In this way, after allocating IDs and addresses for the first subcommand and the second subcommand and determining the continuous transmission length, the master device can send the first subcommand and the second subcommand based on the AXI bus to perform data interaction with the slave device.
[0090] S300: Execute a write operation based on the first subcommand and the second subcommand, and receive feedback information from a write response channel;
[0091] like Figure 4 As shown, in some embodiments, the step of performing a write operation based on the first sub-command and the second sub-command includes:
[0092] The first subcommand is sent to the slave device based on the first ID, the first address, and the first burst transfer length. The second subcommand is sent to the slave device based on the second ID, the second address, and the second burst transfer length. The first write burst data associated with the first subcommand is sent to the slave device, and the second write burst data associated with the second subcommand is sent to the slave device.
[0093] like Figure 3 As shown, the state machine can cache the write command of the master device through the CMD_FIFO module 4, and send the write command through the CMD_TX module. That is, the state machine can send the first subcommand and the second subcommand successively through CMD_TX.
[0094] After sending the first subcommand and the second subcommand, the state machine may send the first burst data and the second burst data to the slave device through the BURST_TX module. The first write burst data and the second write burst data may be cached in the WDATA_FIFO module. In this way, when the write burst operation crosses a page boundary, the state machine performs the write burst operation by splitting the write command.
[0095] like Figure 3 As shown, the state machine can also write a response channel to receive feedback information returned from the device and extract data from the feedback information so that the master device can determine whether the write operation is completed based on the feedback information, wherein the feedback information includes the first ID or the second ID. Figure 5 As shown, in some embodiments, the step of receiving feedback information from the write response channel further includes:
[0096] Receive feedback information, the feedback information including first feedback information based on the first subcommand feedback, or second feedback information based on the second subcommand feedback. If the feedback ID in the feedback information is the first ID, ignore the first ID. If the feedback ID in the feedback information is the second ID, store the second ID in a preset cache and send it to the master device.
[0097] In some embodiments, the state machine may receive first feedback information and second feedback information from the write response channel through the BID_CHECK module. The first feedback information and second feedback information may be returned by the slave device in the form of data packets, the first feedback information includes the first ID, and the second feedback information includes the second ID.
[0098] Taking the example of dividing the write command into two commands, namely the first subcommand and the second subcommand, because the first burst transmission length of the first write burst data associated with the first subcommand is equal to the maximum data transmission length of the current page, and the first ID of the first subcommand is an ID not involved in other transactions, there is no need to analyze the first ID in the first feedback information, that is, there is no need to cache the first ID. In this way, when the first feedback information is received and the first ID is extracted, the first ID can be ignored. At the same time, the second ID is the original ID of the write command. Therefore, in an embodiment of the present application, when the second feedback information is received and the second ID is extracted, it is started to determine whether the current write operation is completed. Therefore, it is necessary to cache the second ID so that the master device can determine whether the write operation associated with the second write command is executed normally based on the second ID.
[0099] S400: Generate interruption information according to the feedback information.
[0100] Based on the feature of the AXI protocol supporting out-of-order transmission, when sending the first subcommand and the second subcommand, the first subcommand is sent first and the second subcommand is sent later. Also, when sending the first write burst data and the second write burst data, the first write burst data is sent first and the second write burst data is sent later. The state machine may first receive the second feedback information of the second subcommand returned from the device through BID_CHECK. Therefore, it is not easy to accurately determine whether the current write operation is completed by simply determining whether the second feedback information is received and extracting the second ID from the second feedback information.
[0101] And because the first ID is ignored when the first feedback information is received and the first ID is extracted from the first feedback information, when the state machine receives the second feedback information and extracts the second ID, it can determine whether the current write operation is completed in combination with the interface status information of the AXI bus.
[0102] like Figure 3As shown in Figure 1, the interface status information of the AXI bus can be generated by BUSY_CHECK. Figure 6 As shown, in some embodiments, the validity of the write command can be determined in combination with the interface status information, and the steps include:
[0103] The interface status information of the AXI bus is obtained, wherein the interface status information includes write command channel transmission status information and write response channel transmission status information. When the write command channel transmission status information indicates that the write command channel is transmitting data, a write command valid signal is obtained; or when the write response channel transmission status information indicates that the write response channel is transmitting data, the write response valid signal is obtained.
[0104] The interface status information includes the write command channel transmission status and the write response channel transmission status. By acquiring the write command channel transmission status and the write response channel transmission status, the write command valid signal and the write response valid signal can be acquired. In this way, the counter change can be controlled according to the write command valid signal and the write response valid signal, so as to combine the count value of the counter with the write command channel status and the write response channel status to determine whether the current write command is completed.
[0105] It can be understood that when the write command channel transmission state is the transmission state, a write command valid signal can be obtained; when the write response channel transmission state is the transmission state, a write response valid signal can be obtained.
[0106] In some embodiments, Figure 7 As shown, the write command can be counted by handshaking between the CMD_TX module and the BID_CHECK (determining whether the handshake is performed based on the write command valid signal and the write response valid signal), so as to determine whether the write command is completed based on the count value. The steps include:
[0107] A counter is set, and an initial count value of the counter is 0. If the write command valid signal is obtained, the count value of the counter is controlled to increase by 1. If the write response valid signal is obtained, the count value of the counter is controlled to decrease by 1.
[0108] like Figure 7 As shown, when the state machine executes a write command through CMD_TX, the count value of the counter increases; when the state machine receives feedback information through BID_CHECK, the count value of the counter decreases. For example, when the state machine writes the first subcommand through CMD_TX, the count value of the counter increases from the initial value 0 to 1; when the state machine receives the first feedback information or the second feedback information through BID_CHECK, the count value of the counter decreases from 1 to 0.
[0109] Furthermore, it is also possible to determine whether to generate interrupt information according to the count value and whether there is a signal in the write command channel, and the steps include:
[0110] Obtaining a count value of the counter;
[0111] When the count value is not zero, or the write command valid signal is obtained, the AXI bus is marked as running. When the count value is zero and the write command valid signal is not obtained, the AXI bus is marked as idle; when the AXI bus is idle and the number of IDs received by the master device reaches the quantity threshold, the interrupt information is generated. Wherein, the quantity threshold is the number of write burst transfers required when the write data associated with the write command is transmitted. The total amount of data to be written in a frame can be calculated according to its configuration information, and the total number of write burst transfers can be calculated from the total amount of data to be written. Then, the BID returned to the master device is counted according to the total number of write burst transfers. When the BID returned to the master device is the last ID of the current frame, it indicates that data transmission and reception are completed. In this way, when the AXI bus is in an idle state and the last ID has been received, the interrupt information can be generated.
[0112] Take the case where the state machine sends only two commands through CMD_TX as an example. These two commands are obtained after splitting. The maximum count value of the counter can be 2, and after receiving the feedback information, it can be restored to 0. In this way, when the state machine receives the second feedback information, because the sending completion time of the write command is earlier than the receiving time of the feedback information, after receiving the second feedback information, if the count value is 0, it means that two handshakes have been performed between CMD_TX and BID_CHECK, that is, the slave device has returned the first feedback information associated with the first sub-command and the second feedback information associated with the second sub-command to the master device. It can be understood that at this time, the state machine obtains the count value of the counter as 0, that is, all current write command operations are completed, and then interrupt information can be generated through INT_GEN to indicate that the current write operation is completed.
[0113] In this way, when the master device receives all IDs, the counter designed based on the handshake of CMD_TX and BID_CHECK can avoid the early generation of interrupt information that may be caused by the AXI protocol supporting out-of-order transmission, so as to improve the stability of the AXI bus operation.
[0114] In some embodiments, the memory space required for the write command does not exceed the maximum memory space of the current page, such as Figure 4 As shown, a write command can be directly sent to the slave device based on the original ID of the write command, and the steps include:
[0115] If the virtual address range required by the write command does not exceed the page boundary, the write command is sent to the slave device based on the original ID of the write command. Write burst data associated with the write command is sent to the slave device, and write feedback information associated with the write command is received, wherein the write feedback information includes the original ID. Finally, the original ID is stored in a preset cache and returned to the master device.
[0116] In some embodiments, when the master device sends a write command, the state machine detects the memory space required for the write burst data associated with the write command through the CMD_SPLIT module, and determines whether splitting is required. When it is detected that the burst transmission length of the write burst data is less than or equal to the maximum data transmission length of the current page, it means that the memory space required for the write command is within the support range of the current page. Therefore, the state machine can directly send a write command to the slave device through the CMD_TX module, and directly send write data to the slave device through the BURST_TX module. And receive the write feedback information fed back by the slave device through the BID_CHECK module, and return the feedback ID (the original ID of the write command) in the write feedback information to the master device, so that the master device can determine whether the current write operation is executed normally.
[0117] In other embodiments, the present application provides a data processing device based on an AXI bus, including: a control module, a splitting module, a write operation module, and an interrupt module;
[0118] When executing a write operation, the control module obtains write command information, wherein the write command information includes a first address of the write command, a burst transfer length, and an original ID; the burst transfer length is used to characterize a target memory space required for write burst data associated with the write command;
[0119] The splitting module splits the write command to obtain a first subcommand and a second subcommand when the target memory space spans the maximum memory space of the page; wherein the command ID of the first subcommand is a first ID, which is a non-original ID; the command ID of the second subcommand is a second ID, which is the same as the original ID of the write command;
[0120] The write operation module performs a write operation based on the first subcommand and the second subcommand, and receives feedback information from a write response channel; the feedback information includes the first ID and the second ID;
[0121] The interrupt module generates interrupt information according to the feedback information, and the interrupt information is used to indicate that the current write operation is completed.
[0122] It can be seen from the above technical content that the present application provides a data processing method and device based on AXI bus. When executing a write operation, the method obtains the first address and burst transfer length of the write command to determine whether the write burst transfer crosses the page boundary. When the write burst transfer crosses the page boundary, the write command is split to obtain a first subcommand and a second subcommand. And different IDs are assigned to the first subcommand and the second subcommand, namely the first ID and the second ID. The first ID is a special ID, that is, an ID number that is different from all the original IDs. The second ID is the same as the original ID of the split write command. Therefore, when receiving feedback information from the device, it is possible to determine whether the current write operation is completed only based on the first ID and the second ID, which is conducive to improving the execution efficiency of the write operation.
[0123] Similar parts between the embodiments provided in this application can be referenced to each other. The specific implementation methods provided above are only a few examples under the general concept of this application and do not constitute a limitation on the protection scope of this application. For those skilled in the art, any other implementation methods expanded based on the scheme of this application without creative work belong to the protection scope of this application.
Claims
1. A data processing method based on AXI bus, characterized in that: include: When performing a write operation, obtaining write command information, the write command information including a first address of the write command, a burst transfer length, and an original ID; the burst transfer length is used to characterize a target memory space required for writing burst data associated with the write command; If the target memory space spans the maximum memory space of the page, split the write command to obtain a first subcommand and a second subcommand; wherein the command ID of the first subcommand is a first ID, which is a non-original ID; the command ID of the second subcommand is a second ID, which is the same as the original ID of the write command; Performing a write operation based on the first subcommand and the second subcommand, and receiving feedback information from a write response channel; the feedback information includes the first ID and the second ID; Interrupt information is generated according to the feedback information, where the interrupt information is used to indicate that the current write operation is completed.
2. The data processing method according to claim 1, characterized in that: After the burst transmission length of the write burst data is obtained, the method further includes: Calculating a target bit width of write data associated with a write command according to the data bit width of the AXI bus; Calculating a maximum data transmission length within the offset range of the current page according to the page size bit width of the current page and the target bit width; the maximum data transmission length is a maximum memory space provided by the current page for the write burst data; If the burst transmission length is greater than the maximum data transmission length, it is determined that the write command needs to be split.
3. The data processing method according to claim 2, characterized in that: If the target memory space spans the maximum memory space of the page, splitting the write command to obtain a first subcommand and a second subcommand includes: marking the maximum data transfer length as the first burst transfer length of the first write burst data associated with the first subcommand; According to the first address of the write command, setting the first address of the first subcommand; A first ID is set for the first subcommand.
4. The data processing method according to claim 3, characterized in that: Also includes: Calculate the difference between the burst transfer length of the write burst data and the first burst transfer length of the first write burst data to obtain a second burst transfer length of the second write burst data associated with the second subcommand; Calculating the page address of the current page according to the first address of the write command, and performing an addition operation on the page address of the current page to obtain the page address of the subsequent page; Setting a second address of the second subcommand according to the page address of the subsequent page; The original ID of the write command is set as the second ID of the second subcommand.
5. The data processing method according to claim 4, characterized in that: Performing a write operation based on the first sub-command and the second sub-command includes: Sending the first subcommand to the slave device based on the first ID, the first burst transfer length and the first address of the first write command; Sending the second sub-command to the slave device based on the second ID, the second burst transfer length and the second address of the second write command; Sending a first write burst data associated with the first subcommand to the slave device; A second write burst data associated with the second subcommand is sent to the slave device.
6. The data processing method according to claim 5, characterized in that: Receive feedback information from the write response channel, including: receiving feedback information, the feedback information including first feedback information based on the first sub-command feedback, or second feedback information based on the second sub-command feedback; If the feedback ID in the feedback information is the first ID, ignore the first ID; If the feedback ID in the feedback information is the second ID, the second ID is stored in a preset cache and sent to the master device.
7. The data processing method according to claim 6, characterized in that: Also includes: Acquire interface status information of the AXI bus, wherein the interface status information includes write command channel transmission status information and write response channel transmission status information; When the write command channel transmission status information indicates that the write command channel is transmitting data, a write command valid signal is obtained; or when the write response channel transmission status information indicates that the write response channel is transmitting data, the write response valid signal is obtained.
8. The data processing method according to claim 7, characterized in that: The performing a write operation based on the first sub-command and the second sub-command, and receiving feedback information, further includes: Set a counter, wherein the initial count value of the counter is 0; If the write command valid signal is obtained, the count value of the counter is controlled to increase by 1; If the write response valid signal is obtained, the count value of the counter is controlled to be reduced by 1.
9. The data processing method according to claim 8, characterized in that: Generating interrupt information according to the feedback information includes: Obtaining a count value of the counter; When the count value is not zero, or the write command valid signal is obtained, marking the AXI bus as a running state; When the count value is zero and the write command valid signal is not obtained, marking the AXI bus as an idle state; When the AXI bus is in an idle state and the number of IDs received by the master device reaches a quantity threshold, the interrupt information is generated; wherein the quantity threshold is the number of write burst transmissions required when the write burst data associated with the write command is transmitted.
10. The data processing method according to claim 1, characterized in that: Also includes: If the target memory space does not span the maximum memory space of the page, sending the write command to the slave device based on the original ID, the first address and the burst transfer length of the write command; Sending write burst data associated with the write command to the slave device; receiving write feedback information associated with the write command, wherein the write feedback information includes the original ID; The original ID is stored in a preset buffer and sent to the main device.
11. A data processing device based on an AXI bus, characterized in that: include: Control module, split module, write operation module and interrupt module; When executing a write operation, the control module obtains write command information, wherein the write command information includes a first address of the write command, a burst transfer length, and an original ID; the burst transfer length is used to characterize a target memory space required for writing burst data associated with the write command; The splitting module splits the write command to obtain a first subcommand and a second subcommand when the target memory space spans the maximum memory space of the page; wherein the command ID of the first subcommand is a first ID, which is a non-original ID; the command ID of the second subcommand is a second ID, which is the same as the original ID of the write command; The write operation module performs a write operation based on the first subcommand and the second subcommand, and receives feedback information from a write response channel; The feedback information includes the first ID and the second ID; The interrupt module generates interrupt information according to the feedback information, and the interrupt information is used to indicate that the current write operation is completed.
Citation Information
Cited By
Write transmission device and method for CHI bus protocol system and AXI4 equipment
CN120994590A
AXI-based controller design method for automatic identification and splitting of discontinuous data mask in write channel
WO2026143363A1
