Descriptor automatic generation method based on DMA protocol
The automatic descriptor generation method addresses the inefficiencies and errors in manual DMA descriptor construction by using a parameter table and table reading library to enhance flexibility and adaptability in SoC design.
Patent Information
- Application Number
- CN202411223789.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2024-12-20
AI Technical Summary
The current manual construction of DMA descriptors is labor-intensive, error-prone, and lacks flexibility, making it difficult to meet the complex and dynamic requirements of modern SoC design for efficient, flexible, and reliable data transmission.
An automatic descriptor generation method based on a DMA protocol using a descriptor parameter table and a table reading library to dynamically adjust the working mode, generate descriptors, and enforce constraints, reducing manual operations and improving efficiency and accuracy.
The method enhances descriptor construction efficiency, reduces human errors, and increases system design flexibility and adaptability by automating the descriptor generation process.
Smart Images

Figure CN119166155A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of function verification in the field of computer application, and in particular to a method for automatically generating a descriptor based on a DMA protocol. Background Art
[0002] With the rapid development of very large scale integrated circuit (VLSI) technology, the design complexity of system-on-chip (SoC) is also increasing. As a highly integrated chip that integrates multiple functional modules including processors, memory, peripherals, interfaces and analog circuits, SoC has been widely used in modern electronic devices. In order to cope with complex SoC design, designers gradually introduced the concept of IP core (Intellectual Property Core). As a reusable modular design unit, IP core can significantly reduce design costs, shorten design cycles, and improve design reliability and maintainability. Therefore, IP core reuse has become an indispensable part of SoC design.
[0003] However, as the scale and complexity of SoC design increase, the efficiency and quality of IP core functional verification are receiving more and more attention. Functional verification is one of the key links in the SoC design process, which is directly related to whether the final function of the chip can be correctly implemented. In order to meet the increasingly complex design requirements and the market's urgent requirements for product time to market, verification methodology is also constantly evolving, forming a series of new verification strategies and tools, among which automated verification, model-based verification and formal verification technologies have been widely used.
[0004] Among the many IP cores of SoC, DMA (Direct Memory Access) IP core has become a widely used type of IP core due to its unique advantages in improving data transmission efficiency and reducing CPU burden. DMA is a technology that allows direct data transmission between peripherals and memory without the need for byte-by-byte data transfer through the CPU. Through DMA technology, the efficiency of data transmission can be greatly improved, especially in application scenarios that process large amounts of data or have high bandwidth requirements. DMA IP cores are widely used in various situations that require efficient data transmission, such as data transmission between network interfaces and memory, stream processing of audio and video data, and large-scale data acquisition in embedded systems.
[0005] In DMA, DMA descriptors are key data structures used to configure and manage DMA transmissions. They specify the source address, destination address, transmission size, and control information of data transmissions. The current DMA descriptor construction process is relatively simple. Designers need to manually write the field content of each descriptor and repeatedly check its correctness. For some complex application scenarios, such as multi-segment transmission tasks that require processing of large amounts of data, the writing and management of descriptors is labor-intensive and error-prone, especially when chained descriptors are used. The order and content of each descriptor in the chain need to be precisely controlled. Once an error occurs, data transmission may fail and even affect the normal operation of the entire system. At the same time, the existing DMA descriptor construction method lacks flexibility in responding to different application requirements and cannot be quickly adjusted according to the special requirements of specific application scenarios. This manual descriptor writing method is not only inefficient, but also easily leads to insufficient flexibility and scalability of system design, making it difficult to meet the requirements of modern SoC design for efficient, flexible, and reliable data transmission control.
[0006] Therefore, how to improve the efficiency of descriptor construction, reduce the occurrence of human errors, and enhance the flexibility and adaptability of system design has become a technical problem that needs to be solved urgently. Summary of the invention
[0007] The main purpose of the present invention is to provide a method for automatically generating descriptors based on the DMA protocol, aiming to improve the efficiency of constructing descriptors, reduce the occurrence of human errors, and enhance the flexibility and adaptability of system design.
[0008] In order to achieve the above object, the present invention proposes a method for automatically generating a descriptor based on a DMA protocol, comprising the following steps: Build descriptor parameter table; A descriptor generator with a table reading library is constructed. The descriptor generator reads the mode parameters in the descriptor parameter table for controlling the working mode of the descriptor generator through the table reading library, adjusts the working mode of the current descriptor generator according to the mode parameters, and after the adjustment is completed, obtains the control parameters in the descriptor parameter table for controlling the number and type of descriptors and the constraints for limiting the random rules of the predetermined fields of the descriptors, generates descriptors according to the control parameters and the constraints, and sends the generated descriptors to the verification environment for response to DMA requests.
[0009] In one embodiment of the present application, the mode parameters include at least one of: a normal mode for generating a fixed number of descriptors according to a preset value, a pre-stored mode for building a descriptor pool of a predetermined size, and an endless mode for generating a corresponding number of descriptors in real time according to a response.
[0010] In one embodiment of the present application, the number of descriptor pools corresponding to the descriptor is 256.
[0011] In one embodiment of the present application, the descriptor generator is generated by compiling and editing perl language code.
[0012] In one embodiment of the present application, the constraint condition includes at least one of setting the corresponding field of the descriptor to a fixed value, setting the corresponding field of the descriptor to a range value, and setting the corresponding field of the descriptor to a variable value according to a preset condition.
[0013] In an embodiment of the present application, the descriptor parameter table includes a plurality of sub-tables, and the operating mode parameters, control parameters and constraint conditions are located in different sub-tables.
[0014] In one embodiment of the present application, when the working mode and / or control parameters and constraint conditions are filled in incorrectly, a prompt message is generated, and the prompt message is used to prompt that the data is filled in incorrectly.
[0015] By adopting the above technical solution, the descriptor information is written into the table to achieve overall management without repeatedly checking the specific content of the descriptor or repeatedly calculating the position of each descriptor field in the descriptor. The rules for constructing existing descriptions can be intuitively reflected in the table. By reading the mode parameters in the descriptor parameter table, the descriptor generator can dynamically adjust the working mode. This enables the descriptor generator to adapt to different needs and scenarios without making major modifications to the code. The descriptor generator can automatically read control parameters and constraints and generate descriptors based on these parameters and conditions. The need for manual operation is reduced, and the efficiency and accuracy of generating descriptors are improved. Since the system is based on parameter tables and table reading libraries, if new control parameters or constraints need to be added in the future, it is only necessary to update the parameter table without making major modifications to the core logic of the descriptor generator. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The present invention is described in detail below with reference to specific embodiments and accompanying drawings, wherein: Figure 1 This is a schematic diagram of the process structure of the first embodiment of the present invention. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention is described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the following specific embodiments are only used to explain the present invention and do not constitute a limitation to the present invention.
[0018] like Figure 1As shown, in order to achieve the above purpose, the present invention proposes a method for automatically generating a descriptor based on a DMA protocol, comprising the following steps: Build descriptor parameter table; A descriptor generator with a table reading library is constructed. The descriptor generator reads the mode parameters in the descriptor parameter table for controlling the working mode of the descriptor generator through the table reading library, adjusts the working mode of the current descriptor generator according to the mode parameters, and after the adjustment is completed, obtains the control parameters in the descriptor parameter table for controlling the number and type of descriptors and the constraints for limiting the random rules of the predetermined fields of the descriptors, generates descriptors according to the control parameters and the constraints, and sends the generated descriptors to the verification environment for response to DMA requests.
[0019] Specifically, a descriptor automatic generation method based on DMA (direct memory access) protocol is provided. The method mainly includes constructing a descriptor parameter table, constructing a descriptor generator with a table reading library, adjusting the generator's working mode according to the descriptor parameter table, obtaining control parameters and constraints, generating descriptors and sending them to the verification environment for response to DMA requests.
[0020] First, design and construct a descriptor parameter table. The descriptor parameter table contains the mode parameters that control the working mode of the descriptor generator, the control parameters that control the number and type of descriptors, and the constraints that describe the operation rules of the controller. It can adopt the format commonly used in Excel tables. After constructing the table structure, fill in the mode parameters, control parameters and constraints in the table to ensure its accuracy and completeness.
[0021] Write the core code of the descriptor generator to ensure that it can generate descriptors based on the input parameters. The descriptor generator integrates a table reading library to ensure that the generator can successfully read the data in the descriptor parameter table. Read the mode parameters and adjust the internal state and workflow of the descriptor generator based on these parameters. Ensure that the generator can work properly according to the selected mode parameters. After the mode is determined, read the control parameters to determine the number and type of descriptors to be generated. Read the constraints to ensure that the generated descriptors meet specific operating rules. Determine the basic properties of the descriptors, such as quantity and type, based on the control parameters. Adjust the specific content of the descriptors based on the constraints to ensure that they meet the operating rules. Package the generated descriptors and send them to the specified verification environment for response to DMA requests.
[0022] By adopting the above technical solution, the descriptor information is written into the table to achieve overall management without repeatedly checking the specific content of the descriptor or repeatedly calculating the position of each descriptor field in the descriptor. The rules for constructing existing descriptions can be intuitively reflected in the table. By reading the mode parameters in the descriptor parameter table, the descriptor generator can dynamically adjust the working mode. This enables the descriptor generator to adapt to different needs and scenarios without making major modifications to the code. The descriptor generator can automatically read control parameters and constraints and generate descriptors based on these parameters and conditions. The need for manual operation is reduced, and the efficiency and accuracy of generating descriptors are improved. Since the system is based on parameter tables and table reading libraries, if new control parameters or constraints need to be added in the future, it is only necessary to update the parameter table without making major modifications to the core logic of the descriptor generator.
[0023] In one embodiment of the present application, the mode parameters include at least one of: a normal mode for generating a fixed number of descriptors according to a preset value, a pre-stored mode for building a descriptor pool of a predetermined size, and an endless mode for generating a corresponding number of descriptors in real time according to a response.
[0024] Specifically, in normal mode, the program will generate a fixed number of descriptors according to the number specified in the parameter. In this mode, you only need to specify the number, and the program will generate the corresponding number of descriptors, which is simple to operate. Users can accurately control the number of generated descriptors, which is convenient for management and use.
[0025] In the pre-store mode, the number of descriptors will generate 256 descriptors in the cache. After the next descriptor request, the number of descriptors consistent with the consumed number will be supplemented. Among them, the address can be set to continue the previous descriptor or not.
[0026] In this mode, since the descriptors are pre-stored in the cache, requests can be responded to quickly and latency can be reduced. You can choose whether to continue with the previous descriptors to adapt to different application scenarios. After the descriptors are consumed, you only need to replenish the corresponding number of descriptors, reducing the computational burden of each request.
[0027] In endless mode, the number of DMA request descriptors will be set in advance, and the corresponding number of descriptors that meet the constraint rules will be generated and responded in real time. There is no need to calculate the specific number of descriptors required, and endless response can be achieved. The previously generated descriptors will affect the content of the descriptors to be generated later. As long as the generation rules are met, they can be generated continuously.
[0028] This mode can continuously generate descriptors based on demand, which is suitable for scenarios that require a large number of descriptors. It can respond to requests in real time and flexibly cope with changing needs. Previously generated descriptors will affect subsequent descriptors, and descriptors that better meet demand can be generated based on historical data.
[0029] In one embodiment of the present application, the number of descriptor pools corresponding to the descriptor is 256.
[0030] With the above technical solution, 256 descriptors are a moderate number, which does not take up too much storage space, but can also meet the needs of most application scenarios and provide efficient performance. The descriptor pool pre-stores 256 descriptors, which can quickly respond to requests and reduce the delay caused by real-time generation of descriptors.
[0031] In one embodiment of the present application, the descriptor generator is generated by compiling and editing perl language code.
[0032] With the above technical solution, the descriptor generator is generated by compiling the Perl language code, which can efficiently process strings and regular expressions. The code can be quickly written and modified to meet different generation requirements.
[0033] In one embodiment of the present application, the constraint condition includes at least one of: setting the corresponding field of the descriptor to a fixed value, setting the corresponding field of the descriptor to a range value, and setting the corresponding field of the descriptor to a variable value according to a preset condition.
[0034] Specifically, the corresponding field of the descriptor is set to a fixed value. This constraint is to set a field of the descriptor to a fixed, unchanging value. The value of this field is the same under any circumstances. The use of a fixed value ensures the consistency of the field and facilitates data management and processing. Fixed values reduce the errors that may be introduced by value changes.
[0035] Set the corresponding field of the descriptor to a range value. This constraint sets a field of the descriptor to a random value within a range. The value of the field will vary within the specified range, but will not exceed this range. Range values provide a certain degree of flexibility and are suitable for scenarios that require a certain degree of randomness but must be controlled within a specific range. By setting a range, you can ensure that the value does not deviate from the expected range and maintain a certain degree of control.
[0036] The corresponding field of the descriptor is set as a variable value according to the preset conditions. This constraint condition is to change a field of the descriptor according to the preset conditions or rules. The value of this field will change according to specific rules or algorithms. Variable values allow fields to change dynamically according to actual needs and are suitable for complex application scenarios. By presetting conditions, the system can better adapt to different environments and needs.
[0037] In an embodiment of the present application, the descriptor parameter table includes a plurality of sub-tables, and the operating mode parameters, control parameters and constraint conditions are located in different sub-tables.
[0038] Using the above technical solution, different types of parameters are separated, which makes the table clearer, easier to read and understand. Separating different types of parameters helps to better organize data and avoid confusion and errors. Each parameter has its own specific subtable, making management and maintenance more convenient. Different subtables can be updated and modified independently without affecting the content in other subtables. This flexibility allows for more efficient adjustments when parameters change.
[0039] In one embodiment of the present application, when the working mode and / or control parameters and constraint conditions are filled in incorrectly, a prompt message is generated, and the prompt message is used to prompt that the data is filled in incorrectly.
[0040] Specifically, when the working mode and / or control parameters and constraint conditions are filled in incorrectly, a prompt message is generated. The prompt message can be a real-time reminder, a prompt when the form is submitted, an error log record, etc.
[0041] When real-time reminders are used, when users make input errors, error prompts are immediately displayed on the interface, such as red marks, pop-up boxes, or bubble prompts. Through real-time reminders, users can immediately know the errors and make corrections, improving the accuracy of input. This reduces the trouble of users making changes after submission and improves operational efficiency.
[0042] When using prompts on form submission, validation is performed when the user submits the form. If errors are found, submission is blocked and error prompts are displayed. Ensure that all data is validated before submission to avoid submitting invalid data. List all errors at once so that users can correct them together.
[0043] When error logging is used, the error information is recorded in the log file and a simple prompt is displayed on the interface. Detailed error information can be obtained by viewing the log. This facilitates subsequent troubleshooting and repair of problems, especially in complex systems. Avoid frequent pop-up prompts that disturb user operations.
[0044] With the above technical solution, immediate error prompts help users quickly correct errors, reduce operational frustration, and improve the overall user experience. It also reduces the subsequent processing and correction work caused by erroneous data, saving time and labor costs.
[0045] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent structural changes made by using the contents of the present invention specification and drawings under the inventive concept of the present invention, or directly / indirectly applied in other related technical fields are included in the patent protection scope of the present invention.
Claims
1. A method for automatically generating a descriptor based on a DMA protocol, characterized in that: The following steps are involved: Build descriptor parameter table; A descriptor generator with a table reading library is constructed. The descriptor generator reads the mode parameters in the descriptor parameter table for controlling the working mode of the descriptor generator through the table reading library, adjusts the working mode of the current descriptor generator according to the mode parameters, and after the adjustment is completed, obtains the control parameters in the descriptor parameter table for controlling the number and type of descriptors and the constraints for limiting the random rules of the predetermined fields of the descriptors, generates descriptors according to the control parameters and the constraints, and sends the generated descriptors to the verification environment for response to DMA requests.
2. The method for automatically generating a descriptor based on a DMA protocol as claimed in claim 1, characterized in that: The mode parameters include at least one of a normal mode for generating a fixed number of descriptors according to a preset value, a pre-stored mode for building a descriptor pool of a predetermined size, and an endless mode for generating a corresponding number of descriptors in real time according to a response.
3. The method for automatically generating a descriptor based on a DMA protocol as claimed in claim 2, characterized in that: The number of descriptor pools corresponding to this is 256.
4. The method for automatically generating a descriptor based on a DMA protocol as claimed in claim 1, characterized in that: The descriptor generator is generated by compiling the perl language code.
5. The method for automatically generating a descriptor based on a DMA protocol as claimed in claim 1, characterized in that: The constraint condition includes at least one of: setting a field corresponding to the descriptor to a fixed value, setting a field corresponding to the descriptor to a range value, and setting a field corresponding to the descriptor to a variable value according to a preset condition.
6. The method for automatically generating a descriptor based on a DMA protocol as claimed in claim 1, characterized in that: The descriptor parameter table includes a plurality of sub-tables, and the working mode parameters, control parameters and constraint conditions are located in different sub-tables.
7. The method for automatically generating a descriptor based on a DMA protocol as claimed in claim 6, characterized in that: When the working mode and / or control parameters and constraint conditions are filled in incorrectly, a prompt message is generated, and the prompt message is used to prompt that the data is filled in incorrectly.
