Method, apparatus and electronic device for detecting data transmission
By generating different types of IDs and writing them into the operation packet, the problem of the single data transmission verification method of Axi bus devices is solved, realizing comprehensive verification of Axi device data transmission and improving the verification effect.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- LOONGSON TECH CORP
- Filing Date
- 2021-12-17
- Publication Date
- 2026-06-02
AI Technical Summary
In existing technologies, the data transmission verification method of AXI bus devices is singular and cannot fully verify data transmission. The random excitation generation method for random verification is not flexible enough.
Various types of IDs are generated by using the configuration values in the ID configuration information and written into the operation package to achieve flexible, fast and accurate verification of data transmission to AXI devices.
It enables comprehensive verification of data transmission from AXI devices, improving the verification effect.
Smart Images

Figure CN116266163B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data transmission technology, and in particular to a method, apparatus and electronic device for detecting data transmission. Background Technology
[0002] With the increasing complexity of System-on-Chip (SoC) designs and the enhanced processing power of Central Processing Units (CPUs), the bandwidth requirements for buses are also increasing. The Advanced eXtensible Interface (AXI) bus, as a high-performance bus, offers smaller area, lower power consumption, and lower latency, better meeting the high-performance bus needs of existing SoC systems. When transmitting data via the AXI bus, out-of-order read or write operations are often required to ensure fast data transmission. This process necessitates verifying for errors during data transmission.
[0003] In the existing technology, the data transmission verification of Axi bus devices mainly adopts random verification. Random verification often uses random stimuli to achieve verification. The generation method of random stimuli is singular and inflexible, and cannot comprehensively verify the data transmission of Axi bus devices. Summary of the Invention
[0004] This application provides a data transmission detection method, apparatus, and electronic device to solve the problem that existing data transmission verification methods are singular and cannot comprehensively verify the data transmission of AXI bus devices.
[0005] In a first aspect, embodiments of this application provide a data transmission detection method, applied to a master device and a slave device communicating via an AXI bus, the method comprising:
[0006] The corresponding type of ID is generated based on the configuration value in the preset ID configuration information and stored in the target storage. Different configuration values correspond to different types of generated IDs.
[0007] When performing a target operation on the slave device, the target ID is selected from the target memory and written into the operation packet corresponding to the target operation;
[0008] When the slave device receives the operation packet corresponding to the target operation, the target ID is stored back to the target memory;
[0009] The detection result of data transmission is determined based on the number of IDs in the target memory.
[0010] In one possible design of the first aspect, generating an ID of the corresponding type based on the configuration value in the preset ID configuration information and storing it in the target memory includes:
[0011] Obtain a preset threshold from the ID configuration information and determine the target quantity, wherein the target quantity is used to indicate the total number of IDs of the corresponding type generated;
[0012] If the configuration value is the first value, then generate the target quantity of IDs with random values and store them in the target memory;
[0013] If the configuration value is the second value, then generate the target number of IDs with different values and store them in the target memory;
[0014] If the configuration value is third data, then generate the target number of IDs with the same value and store them in the target memory;
[0015] If the configuration value is the fourth value, then the target number of IDs that match the preset sequence are generated and stored in the target memory.
[0016] In another possible design of the first aspect, if the configuration value is a second value, then the step of performing a target operation on the slave device, selecting the target ID from the target memory and writing it into the operation packet corresponding to the target operation, includes:
[0017] When performing a target operation on the slave device, the number of target operation packets to be sent to the slave device within a preset operation period is determined.
[0018] Based on the number of target operation packages, select a number of target IDs from the target memory that have different values and are the same as the number of target operation packages, and write them to each target operation package.
[0019] In another possible design of the first aspect, the step of generating an ID of the corresponding type according to the configuration value in the preset ID configuration information and storing it in the target memory includes:
[0020] Obtain the read memory parameters and write memory parameters from the ID configuration information;
[0021] Configure the size of the read memory in the target memory according to the read memory parameters;
[0022] Configure the size of the write memory in the target memory according to the write memory parameters;
[0023] Based on the size of the read memory and the size of the write memory, the corresponding type of ID is stored in the read memory and the write memory respectively.
[0024] In another possible design of the first aspect, the step of selecting the target ID from the target memory and writing it into the operation packet corresponding to the target operation includes:
[0025] Determine whether the target operation performed on the slave device is a read operation or a write operation;
[0026] If a read operation is performed on the slave device, the target ID is selected from the read memory and written into the operation packet corresponding to the read operation;
[0027] If a write operation is performed on the slave device, the target ID is selected from the write memory and written into the operation packet corresponding to the write operation.
[0028] In yet another possible design of the first aspect, the method further includes:
[0029] Obtain the total number of operation packets sent to the slave device;
[0030] If the total number of packets sent is lower than the preset number, the target operation on the slave device continues until the total number of operation packets sent to the slave device is the same as the preset number.
[0031] In another possible design of the first aspect, storing the target ID back to the target memory when the slave device receives the operation packet corresponding to the target operation includes:
[0032] When the operation packet is received by the slave device, the target operation is determined to be a read operation / write operation;
[0033] If the target operation is a read operation, then the target ID is stored back to the read memory in the target memory;
[0034] If the target operation is a write operation, then the target ID is stored in the write memory of the target memory.
[0035] In another possible design of the first aspect, determining the detection result of data transmission based on the number of IDs in the target memory includes:
[0036] When the total number of operation packets sent to the slave device is the same as the preset number, the number of IDs in the read memory and the number of IDs in the write memory are obtained;
[0037] Based on the number of IDs in the read memory and the first target number, it is determined whether the read operation is complete. The first target number is the number of IDs of the corresponding type stored in the read memory.
[0038] The write operation is determined to be complete based on the number of IDs in the write memory and the second target number, where the second target number is the number of IDs of the corresponding type stored in the write memory.
[0039] Secondly, a data transmission detection device includes:
[0040] The generation module is used to generate IDs of the corresponding type according to the configuration values in the preset ID configuration information and store them in the target storage. Different configuration values correspond to different ID types.
[0041] The writing module is used to select the target ID from the target memory and write it into the operation packet corresponding to the target operation when performing a target operation on the slave device;
[0042] The save-back module is used to save the target ID back to the target memory when the slave device receives the operation packet corresponding to the target operation;
[0043] The determination module is used to determine the detection result of data transmission based on the number of IDs in the target memory.
[0044] Thirdly, embodiments of this application provide an electronic device, including at least one processor and a memory;
[0045] The processor stores computer-executed instructions;
[0046] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described above.
[0047] The data transmission detection method, apparatus, and electronic device provided in this application can generate various corresponding IDs through the configuration values in the ID configuration information and write them into the operation packet corresponding to the target operation. This enables flexible, fast, and accurate generation of various types of stimuli when verifying the correctness of data transmission of the Axi device, thereby achieving comprehensive verification of the correctness of data transmission of the Axi device. Attached Figure Description
[0048] Figure 1 This is a schematic diagram of a data transmission scenario provided in an embodiment of this application;
[0049] Figure 2 This is a schematic diagram of the data structure of the ID configuration structure provided in the embodiments of this application;
[0050] Figure 3 A flowchart illustrating an embodiment of the data transmission detection method provided in this application;
[0051] Figure 4This is a schematic flowchart of the operation packet sending method provided in the embodiments of this application;
[0052] Figure 5 A flowchart illustrating a second embodiment of the data transmission detection method provided in this application;
[0053] Figure 6 A flowchart illustrating Embodiment 3 of the data transmission detection method provided in this application;
[0054] Figure 7 A schematic diagram of the structure of the data transmission detection device provided in the embodiments of this application;
[0055] Figure 8 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0057] It should be understood that the terms "first," "second," "third," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate, for example, to allow implementation in orders other than those given in the embodiments illustrated or described in this application.
[0058] Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover but not exclusively include, for example, a product or device that includes a series of components is not necessarily limited to those that are explicitly listed, but may include other components that are not explicitly listed or that are inherent to such product or device.
[0059] As used in this application, the term "module" means any known or subsequently developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code capable of performing the functions associated with that element.
[0060] As computer processing speeds increase, the bandwidth requirements for buses also rise. When various functional components within a computer exchange and transmit data, the bus serves as the transmission channel. Based on the type of information transmitted, the computer bus can be divided into a data bus, an address bus, and a control bus, used to transmit data, data addresses, and control signals, respectively. Various internal computer components are connected via the bus, and external devices can also connect to the bus through corresponding interface circuits, forming a hardware system. The AXI bus is a high-speed on-chip bus that achieves superior performance with a smaller area, lower power consumption, and lower latency, meeting the needs of current high-performance computer systems. However, when transmitting data via the AXI bus, out-of-order read or write operations are often required to improve data transmission efficiency and reduce latency. Therefore, verifying the correctness of AXI device data transmission is crucial. Current technologies typically use random verification, but the random stimuli generated during random verification cannot comprehensively and accurately verify the correctness of AXI device data transmission.
[0061] To address the aforementioned issues, embodiments of this application provide a data transmission detection method, apparatus, and electronic device. By generating various corresponding IDs through configuration values in ID configuration information and writing them into an operation packet, it is possible to flexibly, quickly, and accurately generate various types of stimuli (i.e., corresponding IDs). Different types of stimuli correspond to different expected results. Ultimately, by using these various expected results and the IDs returned to the target memory, comprehensive verification of AXI device data transmission can be achieved, improving the verification effect of AXI device data transmission.
[0062] Before introducing the data transmission detection method of this application, the specific application scenarios to which this application is applicable will be described in detail.
[0063] The data transmission detection method provided in this application can be applied to various devices that need to transmit data, such as between components inside a computer, between components inside a computer and external devices, etc.
[0064] Figure 1 This is a schematic diagram of a data transmission scenario provided in an embodiment of this application, such as... Figure 1As shown, the master device 10 and slave device 12 are connected via an AXI bus 11. The master device 10 performs read and write operations via the AXI bus 11 to achieve data transmission with the slave device 12. During a read operation, the master device 10 needs to send a read operation packet to the slave device 12 via the AXI bus 11; during a write operation, the master device 10 needs to send a write operation packet to the slave device 12 via the AXI bus 11. The master device 10 can send multiple read or write operation packets to the slave device 12 out of order within one operation cycle. During this data transmission, it is necessary to determine whether the read and write operations are completed correctly. If they are completed correctly, it indicates that the AXI bus is normal; if they are not completed correctly, an error will be reported.
[0065] in, Figure 1 The master device 10 and slave device 12 involved can be virtual devices, such as virtual devices obtained through software simulation modeling, or they can be real physical devices.
[0066] For example, a detection device can be obtained through software simulation modeling in the main device 10. This detection device may include a random read / write operation generator, a read / write operation driver, a read / write operation monitor, a read / write operation correctness checker, and an ID configuration structure related to the random read / write operation generator. Specifically, the random read / write operation generator is responsible for generating read and write operation packets for the AXI protocol; the read / write operation driver is responsible for parsing the generated read and write operation packets and driving them onto the AXI bus; the read / write operation monitor is responsible for collecting read and write signals to obtain the read and write operation packets and sending them to the read / write operation correctness checker; and the read / write operation correctness checker will determine whether the data in the received read and write operation packets is correct.
[0067] in, Figure 2 This is a schematic diagram of the data structure of the ID configuration structure provided in the embodiments of this application, such as... Figure 2 As shown, the ID configuration structure includes configuration quantity, write memory information, read memory information, counter information, and dynamic configurator information; write memory information is used to indicate write memory, read memory information is used to indicate read memory, counter information is used to indicate the data counted by the counter, and dynamic configurator information is used to indicate the dynamic configurator.
[0068] The configuration quantity can be set according to actual conditions. The configuration quantity determines the number of IDs generated. After reading the configuration quantity, the ID configuration structure generates the corresponding number of IDs based on the configuration quantity value and stores these generated IDs in the write memory and read memory. For example, the configuration quantity value can be a preset threshold.
[0069] To facilitate the differentiation of these IDs, the IDs stored in the write memory will be called write IDs, while the IDs stored in the read memory will be called read IDs. The storage capacity of the write memory and read memory can also be determined according to the number of configured IDs.
[0070] The counter is used for counting. It is incremented once when the master device sends an operation packet and decremented once when the slave device receives an operation packet. This ensures that the completion status of the operation packet transmission is recorded.
[0071] Users can configure the configuration values in the dynamic configurator, inputting different configuration values as ID configuration information. The dynamic configurator can select different ID generation methods to generate a certain number of IDs based on different configuration values.
[0072] For example, IDs can be generated in random or sequential order, etc.
[0073] Figure 3 A flowchart illustrating an embodiment of the data transmission detection method provided in this application is shown below. Figure 3 As shown, the method includes the following steps:
[0074] S301. Generate an ID of the corresponding type according to the configuration value in the preset ID configuration information and store it in the target memory.
[0075] The configuration value indicates how the ID is generated; different configuration values correspond to different ID types.
[0076] In this embodiment, the aforementioned ID configuration structure can be set in the main device, and the ID configuration information can be pre-stored. The configuration value of the ID configuration information in the ID configuration structure can be read first to determine the ID generation method, then the configuration quantity can be read to further determine the number of IDs to be generated, and finally, the configured number of IDs can be generated based on the generation method and the generation quantity.
[0077] The target memory includes a read memory and a write memory. The generated ID will be stored in the read memory and also in the write memory. For example, the ID stored in the read memory and the write memory can be the same or different.
[0078] For example, the configuration value can be 0-4, with different configuration values corresponding to different ID generation methods. For instance, when the configuration value is 0, the IDs are generated randomly in random order, but the number of generated IDs cannot exceed the configured limit. Taking a configuration limit of 10 and a configuration value of 0 as an example, 10 IDs are generated randomly in random order, and then these 10 IDs are stored in the read memory and the write memory. Because they are generated randomly, the order of these 10 IDs is disordered, and the values may be repeated; for example, the 10 IDs might be 1, 3, 5, 2, 4, 8, 9, 6, 7, 10. In this embodiment, it is necessary to find the corresponding ID generation method based on the configuration value to generate the IDs.
[0079] In this embodiment of the application, the configuration quantity can also be pre-stored in the ID configuration structure. The configuration quantity can be n, where n is a positive integer and the value of n is not greater than the ID storage capacity of the read memory and write memory.
[0080] For example, the number of configurations is equal to the number of IDs that the read memory ID can store and the number of IDs that the write memory ID can store.
[0081] S302. When performing a target operation on a slave device, the target ID is selected from the target memory and written into the operation packet corresponding to the target operation.
[0082] The target operation is divided into a read operation or a write operation, and the operation packet is divided into a read operation packet corresponding to a read operation and a write operation packet corresponding to a write operation. When data is transmitted between the master device and the slave device via the AXI bus, the master device sends a read operation packet or a write operation packet via the AXI bus to perform the read operation or write operation. When the master device detects the operation packet being sent via the AXI bus, it selects the ID from the read memory or write memory and sends the operation packet carrying the ID to the slave device.
[0083] In this embodiment of the application, the operation packets sent by the AXI bus can be multiple or a single. When the operation packet sent is a single read operation packet, a read ID is retrieved from the read memory and added to the operation packet, and then the operation packet carrying the read ID is sent out. When the operation packet sent is multiple read operation packets, the corresponding number of read IDs are retrieved from the read memory, packaged into the corresponding read operation packets, and then these read operation packets carrying the corresponding read IDs are sent out.
[0084] Similarly, when the sent operation packet is a single write operation packet or multiple write operation packets, the corresponding number of write IDs are retrieved from the write memory and added to the write operation packet, which will not be elaborated here.
[0085] It should be noted that when a read ID is selected from the read memory, the read memory does not store or retain the read ID; the read ID will temporarily disappear from the read memory. Similarly, when a write ID is selected from the write memory, the write memory does not store or retain the write ID; the write ID will temporarily disappear from the write memory.
[0086] S303. When the device receives operation packets corresponding to each target operation and the target IDs of each operation packet are different, the target IDs are stored back to the target memory.
[0087] In this embodiment of the application, if two operation packets write the same target ID after the operation packet is sent out, the target ID will not be stored back in the target memory and will be determined as a failed operation packet by the slave device.
[0088] For example, when the master device performs a target operation, it can send an operation packet to the slave device. The slave device can receive multiple operation packets. If these operation packets have the same target ID written in them (for example, the target ID written in the first operation packet is 1, and the target ID written in the second operation packet is also 1), they will be determined as invalid operation packets. The target ID in the invalid operation packet will not be stored back in the target memory.
[0089] The master device can detect whether the sent operation packets have been received by the slave device. Specifically, a transmission synchronizer can be set in the ID structure configuration body, which can be understood as a receiving queue for operation packets, responsible for storing AXI operation packets received from the AXI bus. By checking the transmission synchronizer, it can be determined whether a read or write operation has been completed. For example, if a read operation is completed, it means that the slave device has received the read operation packet corresponding to the read operation. When a read operation packet carrying a read ID is received by the slave device, if the slave device finds that there is no read operation packet with the same read ID, it will retrieve the read ID, that is, store the read ID back in the read memory. If a read operation packet is sent subsequently, the read ID can be retrieved from the read memory again. Similarly, when a write operation packet carrying a write ID is received by the slave device, if there is no write operation packet with the same write ID, it will retrieve the write ID and store the write ID back in the write memory. If a write operation packet is sent subsequently, the write ID can be retrieved from the write memory again.
[0090] In this embodiment of the application, the selected ID can be a read ID or a write ID, depending on the type of operation packet.
[0091] For example, when a read ID is selected, the read ID is stored back into the read memory; when a write ID is selected, the write ID is stored back into the write memory.
[0092] S304. Determine the detection result of data transmission based on the number of IDs in the target memory.
[0093] The test results specifically include read operation packet transmission correct, read operation packet transmission error, write operation packet transmission correct, and write operation packet transmission error.
[0094] In this embodiment, the number of operation packet transmissions can be counted using the counter information in the ID configuration structure. After the number of transmitted operation packets reaches a preset number (the preset number refers to the total number of operation packets to be transmitted in this data transmission, which can be set by the user), a waiting period can be set to wait for the read or write operation to complete. Then, the number of read IDs in the read memory is counted. If the number of read IDs is different from the initially configured number, it means that some read IDs were selected but not stored back in the read memory. At this time, the tester can determine whether the read operation packet transmission is incomplete or invalid based on the configuration value. For example, if the tester sees a configuration value of 1, it means that all generated read IDs are different. At this time, all read IDs should be stored back in the read memory. If any read IDs are not stored back in the memory, it means that the AXI device data transmission has failed, and the read operation packet transmission is incorrect. If the number of read IDs is the same as the initially configured number, it means that all selected read IDs have been stored back in the read memory, that is, the read operation packet transmission is correct.
[0095] Furthermore, when the configuration value is 2, it means that all generated read IDs are the same. In this case, none of the read IDs should be stored back in the read memory. If a read ID is found to be stored back in the read memory, it means that the AXI device data transmission has failed and the read operation packet transmission has failed.
[0096] Furthermore, when the configuration value is 0, it indicates that the generated read IDs may contain some identical and some different ones. In this case, testers need to determine the detection result based on the number of identical read IDs, the number of different read IDs, and the number of read IDs ultimately stored back in the read memory. For example, if the number of identical read IDs is X and the number of different read IDs is Y, the final number of read IDs stored back in the read memory should be Y. If the final number of read IDs in the read memory is not Y, it indicates that the AXI device data transmission has failed, and the read operation packet transmission is incorrect.
[0097] Similarly, the number of write IDs stored in the write memory and the configuration value can be used to determine whether the write operation packet has been transmitted successfully, which will not be elaborated here.
[0098] For example, when a read operation packet is sent, the counter information in the ID configuration structure can be incremented once. When a write operation packet is sent, the counter is incremented once. Finally, the total number of read operation packets and write operation packets sent is obtained. When a read operation is completed, the read ID in the read operation packet corresponding to the read operation is returned to the read memory, and the counter is decremented once. When a write operation is completed, the write ID in the write operation packet corresponding to the write operation is returned to the write memory, and the counter is also decremented once.
[0099] For example, the value of a counter can be used to determine whether all read and write operations are completed. When the counter's final value is 0, it means that both read and write operations have been completed. When the counter's final value is not 0, it means that some read / write operations have not been completed.
[0100] Optionally, in other embodiments, when the total number of operation packets sent by the AXI bus does not reach the preset number, steps S302 to S303 are repeated until the total number of operation packets sent reaches the preset number.
[0101] This application embodiment can generate various corresponding IDs by using the configuration values in the ID configuration information and write them into the operation packet corresponding to the target operation. This enables the flexible, fast, and accurate generation of various types of stimuli when verifying the correctness of data transmission on the Axi device, thereby achieving comprehensive verification of the correctness of data transmission on the Axi device.
[0102] Optionally, in some embodiments, the step S301 above, "generating an ID of the corresponding type based on the configuration value in the ID configuration information," can be implemented through the following steps:
[0103] Obtain the preset threshold from the ID configuration information to determine the target quantity;
[0104] If the configuration value is the first value, then generate the target number of IDs with random values and store them in the target storage.
[0105] If the configuration value is the second value, then generate the target number of IDs with different values and store them in the target memory;
[0106] If the configuration value is third data, then generate the target number of IDs with the same value and store them in the target storage;
[0107] If the configuration value is the fourth value, then the target number of IDs that match the preset sequence will be generated and stored in the target memory.
[0108] The preset threshold is as described above. Figure 2The configuration quantity and target quantity indicate the total number of IDs of the corresponding type to be generated.
[0109] The configuration value can be any one of the first, second, third, and fourth values. The ID configuration structure selects different ID generation methods based on the different configuration values obtained, generating the target number of IDs.
[0110] In this embodiment, "0" can represent the first value, "1" the second value, "2" the third value, and "3" the fourth value. The generated IDs can be represented by numbers. When the ID configuration structure obtains a configuration value of "0", a target number of IDs (the target number can be equal to a preset threshold, and can be n, where n is a positive integer) are generated. The values of the n IDs are between 0 and n-1, and are completely random. When the configuration value is "1", n IDs are also generated, and the values of the n IDs are all different and can be in order from 0 to n-1. When the configuration value is "2", n identical IDs will be generated, for example, n 2s. When the configuration value is "3", n IDs that meet the preset sequence requirements will be generated, for example, in descending order, the first ID is n-1, the second is n-2, and so on, with the nth ID being 0.
[0111] For example, the format of the ID configuration structure can be as follows:
[0112] max_outstd_num wid_free_queue rid_free_queue outstd_cnt sel_unique_id
[0113] Among them, max_outstd_num represents the configuration quantity, wid_free_queue represents the write memory, rid_free_queue represents the read memory, outstd_cnt represents the counter, and sel_unique_id represents the ID configuration information. The value of sel_unique_id can be preset by the user. For example, the preset value of sel_unique_id is "0", "1", "2" or "3". The ID configuration structure can determine the corresponding ID generation method based on the value of sel_unique_id.
[0114] For example, if sel_unique_id is 0, i.e., by default, the index starts from 0 and goes up to the maximum index max_outstd_num-1, for a total of max_outstd_num entries, generating a completely random ID. If sel_unique_id is 1, the index starts from 0 and goes up to the maximum index max_outstd_num-1, for a total of max_outstd_num entries (preset threshold), where the 0th entry is initialized to 0, the 1st entry is initialized to 1, and so on until the maximum index max_outstd_num-1 is reached, ensuring that the generated IDs are not duplicated. If sel_unique_id is 2, a random ID is generated, and the index starts from 0 and goes up to the maximum index max_outstd_num-1, for a total of max_outstd_num entries, all of which are initialized to the randomly generated ID.
[0115] This application embodiment, by setting the configuration value, can generate various types of target IDs based on the configuration value and write them into the operation packet. This enables flexible, fast, and accurate generation of various types of stimuli when verifying the correctness of data transmission of the Axi device, thereby achieving comprehensive verification of the correctness of data transmission of the Axi device.
[0116] Furthermore, in some embodiments, if the configuration value is a second value, then the above step S302 can be implemented through the following steps:
[0117] When performing a target operation on a slave device, determine the number of target operation packets to be sent to the slave device within a preset operation cycle;
[0118] Based on the number of target operation packets, select a number of distinct target IDs from the target memory that are the same as the number of target operation packets, and write them to each target operation packet.
[0119] In this embodiment, if the configuration value is the second value, the generated ID will be a unique ID. The preset operation period can be a test period, for example, the tester sets how many target operation packets to send to the slave device within this test period, and the IDs written in these target operation packets are all different.
[0120] In some implementations, after generating the operation package, if the configuration value is the second value, i.e. "1", it means that the generated ID should be unique within the range of max_outstd_num. In this case, it is necessary to check the ID stored in the read memory and write memory to ensure that the ID in the read memory and write memory is unique.
[0121] This application embodiment generates operation packets with different IDs within a preset operation cycle, which can quickly verify the correctness of data transmission of the AXI device. Testers only need to compare the number of returned IDs with the number of IDs originally stored in the target memory to quickly determine whether the AXI device has encountered errors during the transmission of operation packets, thus improving testing efficiency.
[0122] In some embodiments, refer to the above Figure 2 In the ID configuration structure, write memory parameters and read memory parameters can be configured. The read memory parameters indicate the size of the master device's read memory, and the write memory parameters indicate the size of the master device's write memory. Step S301 above can be implemented through the following steps:
[0123] Retrieve the read memory parameters and write memory parameters from the ID configuration information;
[0124] Configure the size of the read memory in the target memory according to the read memory parameters;
[0125] Configure the size of the write memory in the target memory according to the write memory parameters;
[0126] Based on the size of the read memory and the size of the write memory, the corresponding IDs are stored in the read memory and write memory respectively.
[0127] The target memory includes a read memory and a write memory. The size of the read memory refers to the upper limit of the number of IDs that can be stored, and the size of the write memory refers to the upper limit of the number of IDs that can be stored.
[0128] For example, the read memory and write memory can be the same size, meaning that the maximum number of IDs that the read memory and write memory can store can be the same.
[0129] In this embodiment, by using the write memory parameters and read memory parameters configured in the ID configuration structure, the size of the read memory and write memory can be directly configured to determine the upper limit of the number of IDs that can be stored, ensuring that different ID generation methods can be used to generate various IDs in the future, thereby improving the flexibility of ID generation.
[0130] In some embodiments, the above method may further include the following steps:
[0131] Get the total number of operation packets sent to the slave device;
[0132] If the total number of packets sent is lower than the preset number, the target operation will continue to be performed on the slave device until the total number of operation packets sent is the same as the preset number.
[0133] In this embodiment, the preset quantity is the total number of read and write operations to be performed in this data transmission, that is, the total number of operation packets to be sent. If the total number of operation packets sent is not equal to the preset quantity, it means that the data transmission process is not complete and operation packets need to be generated and sent again.
[0134] This application embodiment can monitor the operation packet sending process by detecting the total number of operation packets sent to the slave device, avoiding errors in subsequent data transmission detection caused by sending too many or too few operation packets, and ensuring the accuracy of data transmission detection.
[0135] Figure 4 This is a schematic diagram of the operation packet sending method provided in the embodiments of this application, such as... Figure 4 As shown, the method includes:
[0136] S401. Determine whether the target operation to be performed on the slave device is a read operation or a write operation;
[0137] S402. If a read operation is performed on the slave device, the target ID is selected from the read memory and written to the operation packet corresponding to the read operation.
[0138] In this embodiment of the application, when performing a read operation on the slave device, a read operation packet needs to be sent to the slave device via the AXI bus. At this time, a read ID is selected from the read memory and sent to the read operation packet, and then the read operation packet carrying the read ID is sent out.
[0139] For example, an ID can be selected from the read memory in order of its numerical value, or an ID can be selected randomly from the read memory.
[0140] S403. If a write operation is performed on the slave device, the target ID is selected from the write memory and written to the operation packet corresponding to the write operation.
[0141] In this embodiment of the application, when performing a write operation on the slave device, a write operation packet needs to be sent to the slave device via the AXI bus. At this time, a write ID is selected from the write memory and added to the write operation packet, and then the write operation packet carrying the write ID is sent out.
[0142] For example, IDs can be selected from the write memory in numerical order, or IDs can be selected randomly from the write memory.
[0143] This application embodiment can distinguish between read and write operations by selecting an ID from the read memory or write memory and adding it to the operation packet corresponding to the read or write operation. When performing a comprehensive verification of the AXI bus device, it can determine whether the error occurred in the transmission of the read operation packet or the write operation packet, thus obtaining a more accurate detection result.
[0144] In some embodiments, the method for detecting the above-described data transmission may further include the following steps:
[0145] When the number of IDs selected from the read memory or write memory equals a preset threshold, a wait instruction is output. This wait instruction instructs the master device to wait for the read or write operation to complete.
[0146] In this embodiment, when the number of IDs selected from the read memory or write memory is equal to a preset threshold, it means that all read IDs in the read memory or write IDs in the write memory have been retrieved. If a read operation packet or write operation packet is sent again, it will be unable to select IDs from the read memory or write memory and send them out with the IDs. Therefore, it is necessary to wait for the read operation or write operation to complete and return the IDs in the read operation packet corresponding to the read operation to the read memory or return the IDs in the write operation packet corresponding to the write operation to the write memory so that there are IDs available for retrieval again in the read memory and write memory.
[0147] In this embodiment, the wait instruction is used to control the operation packet to pause transmission. When the transmitted operation packet is received by the device and the corresponding ID is stored back in the read memory or write memory, the wait is completed and the operation packet continues to be transmitted.
[0148] In some embodiments, Figure 5 A flowchart illustrating Embodiment 2 of the data transmission detection method provided in this application is shown below. Figure 5 As shown, step S304 above can be implemented through the following steps:
[0149] S501. When the operation packet is received from the device, determine that the target operation is a read operation / write operation;
[0150] S502. If the target operation is a read operation, then determine whether the received operation packet is an invalid operation packet or a valid operation packet.
[0151] S503: Store the target ID in the valid operation packet back to the read memory in the target memory;
[0152] S504. If the target operation is a write operation, then determine whether the received operation packet is an invalid operation packet or a valid operation packet.
[0153] S505. Store the target ID in the valid operation packet to the write memory in the target memory.
[0154] Among them, the target IDs in the failed operation packets are the same, while the target IDs in the valid operation packets are different.
[0155] In this embodiment, a transmission synchronizer can be set in the ID structure configuration body. This synchronizer can be understood as a receive queue for operation packets, responsible for storing AXI operation packets received from the AXI bus. By checking the transmission synchronizer, it can be determined whether a read or write operation has been completed. If a read operation is completed, it means that the device has received the corresponding read operation packet. At this point, it can be determined whether there are operation packets with the same ID among the operation packets received from the device. If so, these operation packets with the same ID are determined to be invalid operation packets, and operation packets with different IDs are determined to be valid operation packets.
[0156] This application embodiment can verify the validity of read and write operation packets issued by the master device by storing the target ID back to the read memory or the write memory. The ID in the invalid operation packet will not be stored back to the read memory or the write memory, thereby making it convenient for testers to use various corresponding IDs to perform comprehensive verification of the data transmission of the AXI device.
[0157] Figure 6 A flowchart illustrating Embodiment 3 of the data transmission detection method provided in this application is shown below. Figure 6 As shown, step S304 above can be implemented through the following steps:
[0158] S601. When the total number of operation packets sent to the slave device is the same as the preset number, obtain the number of IDs in the read memory and the number of IDs in the write memory;
[0159] S602. Determine whether the read operation on the slave device is complete based on the number of IDs in the read memory and the number of the first target.
[0160] S603. Determine whether the write operation to the slave device is complete based on the number of IDs in the write memory and the number of the second target.
[0161] The first target number is the number of different IDs stored in the read memory, and the second target number is the number of different IDs stored in the write memory.
[0162] In this embodiment, the size of the read memory refers to the upper limit of the number of IDs that can be stored, and the size of the write memory refers to the upper limit of the number of IDs that can be stored. For example, assuming the size of the read memory is K, that is, it can store a maximum of K IDs, and the size of the write memory is L, that is, it can store a maximum of L IDs, then the first target number is less than or equal to K, and the second target number is less than or equal to L.
[0163] Specifically, once the total number of operation packets sent by the master device reaches a preset number, it checks whether the number of IDs in the read memory is equal to the first target number. If they are equal, it means that all valid read operation packets have been correctly transmitted and the AXI device has not encountered any errors. If they are not equal, it means that some valid read operation packets have not been correctly transmitted, and the AXI device has encountered a transmission error. It then checks whether the number of IDs in the write memory is equal to the second target number. If they are equal, it means that all valid write operation packets have been successfully transmitted. If they are not equal, it means that some valid write operation packets have not been successfully transmitted, and an error can be reported.
[0164] This application embodiment checks the relationship between the number of IDs and the target number. When verifying the correctness of data transmission of the Axi device, it can use various types of IDs to achieve a comprehensive verification of the correctness of data transmission of the Axi device, and accurately determine whether the error occurred in the transmission of read operation packets or write operation packets.
[0165] In some implementations, a checkpoint can be set during the generation and transmission of operation packets to check whether the transmitted read operation packets have been received within a set time range. If not, it is assumed that there is a problem with the data transmission process, and a prompt can be output.
[0166] Corresponding to the data transmission detection method in the above embodiments, Figure 7 This is a schematic diagram of the data transmission detection device provided in an embodiment of this application. For ease of explanation, only the parts related to the embodiment of this application are shown. Figure 7 As shown, the data transmission detection device 70 includes a generation module 71, a writing module 72, a storage module 73, and a determination module 75.
[0167] The generation module 71 generates IDs of the corresponding type based on the configuration values in the preset ID configuration information and stores them in the target memory. The writing module 72 selects the target ID from the target memory and writes it into the operation packet corresponding to the target operation when a target operation is performed on the slave device. The save-back module 73 saves the target IDs back to the target memory when the slave device receives operation packets corresponding to each target operation and the target IDs of each operation packet are different. The determination module 74 determines the detection result of data transmission based on the number of IDs in the target memory.
[0168] The configuration value indicates how the ID is generated; different configuration values correspond to different ID types.
[0169] Optionally, in some embodiments, the generation module 71 may specifically be used for:
[0170] Obtain the preset threshold from the ID configuration information to determine the target quantity;
[0171] If the configuration value is the first value, then generate the target number of IDs with random values and store them in the target storage.
[0172] If the configuration value is the second value, then generate the target number of IDs with different values and store them in the target memory;
[0173] If the configuration value is third data, then generate the target number of IDs with the same value and store them in the target storage;
[0174] If the configuration value is the fourth value, then the target number of IDs that match the preset sequence will be generated and stored in the target memory.
[0175] The target number indicates the total number of IDs of the corresponding type generated.
[0176] In some embodiments, if the configuration value is a second value, the above-mentioned writing module 72 can be implemented through the following steps:
[0177] Optionally, in some embodiments, the generation module 71 described above can be specifically used for:
[0178] Retrieve the coarse memory parameters and write memory parameters from the ID configuration information;
[0179] Configure the size of the read memory in the target memory according to the read memory parameters;
[0180] Configure the size of the write memory in the target memory according to the write memory parameters;
[0181] Based on the size of the read memory and the size of the write memory, the corresponding IDs are stored in the read memory and write memory respectively.
[0182] In some embodiments, the generation module 71 described above can be specifically used for:
[0183] Retrieve the read memory parameters and write memory parameters from the ID configuration information;
[0184] Configure the size of the read memory in the target memory according to the read memory parameters;
[0185] Configure the size of the write memory in the target memory according to the write memory parameters;
[0186] Based on the size of the read memory and the size of the write memory, the corresponding IDs are stored in the read memory and write memory respectively.
[0187] In some embodiments, the writing module 72 described above can be specifically used for:
[0188] Determine whether the target operation to be performed on the slave device is a read operation or a write operation;
[0189] If a read operation is performed on a slave device, the target ID is selected from the read memory and written into the operation packet corresponding to the read operation;
[0190] If a write operation is performed on a slave device, the target ID is selected from the write memory and written into the operation packet corresponding to the write operation.
[0191] In some embodiments, the detection device for the above-described data transmission may further include a comparison module, used for:
[0192] Get the total number of operation packets sent to the slave device;
[0193] If the total number of packets sent is lower than the preset number, the target operation will continue to be performed on the slave device until the total number of operation packets sent is the same as the preset number.
[0194] In some embodiments, the save-back module 73 described above can be specifically used for:
[0195] When the operation packet is received from the device, the target operation is determined to be a read operation or a write operation;
[0196] If the target operation is a read operation, then the received operation packet is determined to be either a failed operation packet or a valid operation packet. The target IDs in the failed operation packets are the same, while the target IDs in the valid operation packets are different.
[0197] Store the target ID from the valid operation packet back to the read memory in the target memory;
[0198] If the target operation is a write operation, then determine whether the received operation packet is an invalid operation packet or a valid operation packet;
[0199] Store the target ID from the valid operation packet into the write memory of the target memory.
[0200] In some embodiments, the determining module 74 described above can be specifically used for:
[0201] When the total number of operation packets sent to the slave device is the same as the preset number, obtain the number of IDs in the read memory and the number of IDs in the write memory;
[0202] The correctness of the read operation is determined based on the number of IDs in the read memory and the first target number, where the first target number is the number of different IDs stored in the read memory.
[0203] The correctness of the write operation is determined by the number of IDs in the write memory and the second target number, which is the number of different IDs stored in the write memory.
[0204] Specific limitations regarding the aforementioned data transmission detection device can be found in the limitations of the data transmission detection method described above, and will not be repeated here. Each module in the aforementioned data transmission detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the processor in the display device, or stored in software in the memory of the display device, so that the processor can call and execute the operations corresponding to each module.
[0205] Figure 8 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application, such as... Figure 8 As shown, the electronic device 80 includes at least one processor 801 and a memory 802; wherein
[0206] The 802 memory stores instructions executed by the computer;
[0207] At least one processor 801 executes computer execution instructions stored in memory 802, causing at least one processor 801 to perform the data transmission detection method as described above.
[0208] Optionally, the memory 802 can be either standalone or integrated with the processor 801.
[0209] This embodiment also provides a readable storage medium storing computer instructions. When at least one processor of the electronic device executes the computer instructions, the electronic device performs the data transmission detection method provided in the various embodiments described above.
[0210] This embodiment also provides a program product including computer instructions stored in a readable storage medium. At least one processor of an electronic device can read the computer instructions from the readable storage medium, and the at least one processor executes the computer instructions to cause the electronic device to implement the data transmission detection method provided in the various embodiments described above.
[0211] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates an "or" relationship between the preceding and following related objects; in formulas, the character " / " indicates a "division" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0212] It is understood that the various numerical designations used in the embodiments of this application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of this application. In the embodiments of this application, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0213] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for detecting data transmission, characterized in that, Applied to master and slave devices communicating via an AXI bus, the method includes: The corresponding type of ID is generated based on the configuration value in the preset ID configuration information and stored in the target storage. Different configuration values correspond to different types of generated IDs. When performing a target operation on the slave device, the target ID is selected from the target memory and written into the operation packet corresponding to the target operation; When the device receives operation packets corresponding to each target operation and the target IDs of each operation packet are different, the target IDs are stored back to the target memory; The detection result of data transmission is determined based on the number of IDs in the target memory.
2. The method according to claim 1, characterized in that, The step of generating an ID of the corresponding type according to the configuration value in the preset ID configuration information and storing it in the target memory includes: Obtain a preset threshold from the ID configuration information and determine the target quantity, wherein the target quantity is used to indicate the total number of IDs of the corresponding type generated; If the configuration value is the first value, then generate the target quantity of IDs with random values and store them in the target memory; If the configuration value is the second value, then generate the target number of IDs with different values and store them in the target memory; If the configuration value is third data, then generate the target number of IDs with the same value and store them in the target memory; If the configuration value is the fourth value, then the target number of IDs that match the preset sequence are generated and stored in the target memory.
3. The method according to claim 2, characterized in that, If the configuration value is the second value, then when performing a target operation on the slave device, selecting the target ID from the target memory and writing it into the operation packet corresponding to the target operation includes: When performing a target operation on the slave device, the number of target operation packets to be sent to the slave device within a preset operation period is determined. Based on the number of target operation packages, select a number of distinct target IDs from the target memory that are the same as the number of target operation packages, and write them to the corresponding target operation packages.
4. The method according to claim 1, characterized in that, The step of generating an ID of the corresponding type according to the configuration value in the preset ID configuration information and storing it in the target memory includes: Obtain the read memory parameters and write memory parameters from the ID configuration information; Configure the size of the read memory in the target memory according to the read memory parameters; Configure the size of the write memory in the target memory according to the write memory parameters; Based on the size of the read memory and the size of the write memory, the corresponding type of ID is stored in the read memory and the write memory respectively.
5. The method according to claim 4, characterized in that, The step of selecting the target ID from the target memory and writing it into the operation packet corresponding to the target operation includes: Determine whether the target operation performed on the slave device is a read operation or a write operation; If a read operation is performed on the slave device, the target ID is selected from the read memory and written into the operation packet corresponding to the read operation; If a write operation is performed on the slave device, the target ID is selected from the write memory and written into the operation packet corresponding to the write operation.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: Obtain the total number of operation packets sent to the slave device; If the total number of packets sent is lower than the preset number, the target operation on the slave device continues until the total number of operation packets sent to the slave device is the same as the preset number.
7. The method according to any one of claims 1-5, characterized in that, The step of storing the target ID back to the target memory when the slave device receives operation packets corresponding to each target operation and the target IDs of each operation packet are different includes: When the operation packet is received by the slave device, the target operation is determined to be a read operation / write operation; If the target operation is a read operation, then the received operation packet is determined to be either a failed operation packet or a valid operation packet. The target IDs in the failed operation packets are the same, while the target IDs in the valid operation packets are different. Store the target ID in the valid operation packet back to the read memory in the target memory; If the target operation is a write operation, then the received operation packet is determined to be either a failed operation packet or a valid operation packet; The target ID in the valid operation packet is stored in the write memory of the target memory.
8. The method according to claim 7, characterized in that, The step of determining the detection result of data transmission based on the number of IDs in the target memory includes: When the total number of operation packets sent to the slave device is the same as the preset number, the number of IDs in the read memory and the number of IDs in the write memory are obtained; The correctness of the read operation is determined based on the number of IDs in the read memory and the first target number, where the first target number is the number of different IDs stored in the read memory. The correctness of the write operation is determined based on the number of IDs in the write memory and the second target number, where the second target number is the number of different IDs stored in the write memory.
9. A data transmission detection device, characterized in that, include: The generation module is used to generate IDs of the corresponding type according to the configuration values in the preset ID configuration information and store them in the target storage. Different configuration values correspond to different ID types. The writing module is used to select the target ID from the target memory and write it into the operation packet corresponding to the target operation when performing a target operation on the slave device; The save-back module is used to save the target ID back to the target memory when the slave device receives operation packets corresponding to each target operation and the target IDs of each operation packet are different; The determination module is used to determine the detection result of data transmission based on the number of IDs in the target memory.
10. An electronic device, characterized in that, Includes at least one processor and memory; The processor stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any one of claims 1-8.