Message processing method and device, computer equipment and storage medium

By dynamically managing the printing redundancy level and system resource load, critical debugging information is output only when necessary, solving the problem of time-consuming printing operations in SoC verification and improving verification efficiency and reliability.

CN120994148APending Publication Date: 2025-11-21JINAN MAIWEI INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511071655.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-31
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

During SoC verification, the printing operation consumes a lot of simulation time, resulting in low verification efficiency. In particular, when there is no waveform available in regression testing, it is difficult to locate the problem, which increases costs.

Method used

By dynamically managing the printing redundancy level, key debugging information is output only when necessary. The printing processing strategy is dynamically adjusted in combination with the system resource load, so as to output key debugging information on demand and reduce the redundant printing time overhead in the simulation process.

Benefits of technology

It significantly reduces the time overhead introduced by redundant printing operations during simulation, quickly narrows down the problem scope, reduces verification cycle and cost, ensures the integrity of necessary printed information, and improves the overall efficiency and reliability of SoC verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994148A_ABST
    Figure CN120994148A_ABST
Patent Text Reader

Abstract

The invention discloses a message processing method and device, computer equipment and a storage medium, and relates to the technical field of communication, and the method comprises the steps: reading write data belonging to a current round based on a bus when it is monitored that a central processing unit executes a C language printing function; acquiring a data identifier corresponding to the write data, and querying a corresponding printing redundancy level by using the data identifier; comparing the printing redundancy level with the current set level of the verification environment to obtain a comparison result; and executing corresponding processing operation on the write data based on the printing processing strategy corresponding to the comparison result. According to the SoC verification method and device, the problem that the efficiency is low when the problem range needs to be narrowed through printing information of a log file and then a signal positioning problem is checked through a simulation waveform in the development process due to the fact that an SoC system scene is generally subjected to verification simulation in combination with a C use case and a UVM verification platform is solved, and the technical effect of improving the SoC verification efficiency is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and specifically to a message processing method, apparatus, computer equipment, and storage medium. Background Technology

[0002] As chips become larger and more complex, the system scenarios for Systems on a Chip (SoC) are also becoming more complex, simulation times are increasing, and debugging difficulties are rising. Typically, SoC system scenarios are verified and simulated using C test cases and a Universal Verification Methodology (UVM). During development, it's necessary to first narrow down the problem area by analyzing log file outputs, and then specifically examine the signal behavior through simulation waveforms to pinpoint the source of the problem.

[0003] However, printing also consumes simulation time. The simulation time for a complex system test case can differ by about one-third depending on whether printing is used or not. For example, simulating a system test case without any printing information might take 24 hours, but with printing information, it could take more than 30 hours. Without printing information, the test case ultimately fails during simulation, making troubleshooting much more difficult. This is especially true during regression testing, where there are no waveforms to query. An extra 6 hours for one test case, 10 test cases, or 100 test cases will significantly increase regression time, and the longer the regression time, the higher the cost of problem localization. Therefore, there is an urgent need to propose a method that can effectively manage the simulation time cost caused by printing operations while ensuring the output of necessary debugging information, thereby improving the efficiency of SoC verification. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a message processing method, apparatus, computer device, and storage medium to address the problem that SoC system scenarios typically involve verification simulations using C test cases and UVM verification platforms. During development, it is necessary to first narrow down the scope of the problem by checking the printed information in the log file, and then specifically examine the behavior of the signal through the simulation waveform to locate the source of the problem, which is inefficient.

[0005] In a first aspect, embodiments of the present invention provide a message processing method, the method comprising:

[0006] When the CPU executes a C language print function, it reads the write data belonging to the current cycle on the bus. When the CPU executes the C language print function, it will perform a write operation on a specific address through the bus.

[0007] Obtain the data identifier corresponding to the written data, and use the data identifier to query the corresponding printing redundancy level;

[0008] The comparison results are obtained by comparing the print redundancy level with the current setting level of the verification environment;

[0009] Based on the comparison results, the corresponding printing processing strategy is used to perform the corresponding processing operations on the written data.

[0010] The message processing method provided in this invention significantly reduces the time overhead introduced by redundant printing operations during simulation by dynamically managing the printing redundancy level and outputting key debugging information only when necessary. In regression testing scenarios, it avoids the problem of locating the issue when there is no waveform available, and can quickly narrow down the problem scope, thereby reducing the verification cycle and cost. At the same time, it ensures the integrity of necessary printing information, which facilitates accurate analysis of signal behavior in conjunction with log files, thereby improving the overall efficiency and reliability of SoC verification.

[0011] In one possible implementation, reading write data belonging to the current round on the bus includes:

[0012] Check if the bus address corresponding to the bus is the correct address;

[0013] If the bus address is correct, write data is read from the bus until a newline identifier is encountered, at which point the read write data is used as the write data for the current round.

[0014] In one possible implementation, the written data is processed according to the printing strategy corresponding to the comparison result, including:

[0015] If the print redundancy level is greater than the set level, the write data for the current round will not be processed.

[0016] In one possible implementation, the written data is processed according to the printing strategy corresponding to the comparison result, including:

[0017] If the print redundancy level is less than or equal to the set level, the print information corresponding to the data identifier is obtained from the identifier-information mapping table;

[0018] Perform the corresponding printing operation based on the printing information.

[0019] In one possible implementation, performing a corresponding printing operation based on the printing information includes:

[0020] Extract the array size from the printed information;

[0021] If the array size is 1, it is determined that there are no additional parameters, and the printing operation is performed on the printed information;

[0022] Alternatively, if the array size is greater than 1, then it is determined that there are additional parameters. In this case, the additional parameters are extracted according to the string terminator, and the printing operation is performed on the print information containing the additional parameters.

[0023] In one possible implementation, before comparing the print redundancy level with the current setting level of the verification environment to obtain the comparison result, the method further includes:

[0024] Obtain the CPU utilization, memory usage, and bus data transfer volume;

[0025] Calculate system load using utilization, memory usage, and data transfer volume;

[0026] Based on the mapping relationship between preset load values ​​and set levels, the set level corresponding to the system load value is determined, and the set level corresponding to the system load value is used as the current set level of the verification environment.

[0027] In one possible implementation, after performing the corresponding processing operation on the written data based on the printing processing strategy corresponding to the comparison result, the method further includes:

[0028] Monitor the frequency of occurrence of data identifiers corresponding to processed print messages within a preset time period; and query whether the priority corresponding to the data identifier is greater than the preset priority.

[0029] If the frequency of occurrence is greater than the preset frequency and the priority is greater than the preset priority, then the process association table is queried according to the data identifier to determine the corresponding associated process, and the resource adjustment parameters required for this type of message are obtained from the resource requirement configuration table.

[0030] The resource scheduling interface is invoked to dynamically allocate a corresponding proportion of CPU time slices to the associated processes, while the memory quota of the log storage buffer is adjusted according to the parameters.

[0031] Continuously monitor the processing latency from message capture to output. If the processing latency is less than the preset latency, maintain the current resource configuration. If it still exceeds the preset latency, trigger a tiered resource expansion until the processing latency drops to within the preset latency.

[0032] Secondly, embodiments of the present invention provide a message processing apparatus, including:

[0033] The read module is used to read the write data belonging to the current cycle on the bus when the central processing unit (CPU) executes the C language print function. When the CPU executes the C language print function, it will perform a write operation on a specific address through the bus.

[0034] The acquisition module is used to acquire the data identifier corresponding to the written data and use the data identifier to query the corresponding printing redundancy level;

[0035] The comparison module is used to compare the printing redundancy level with the set level of the current verification environment to obtain the comparison results;

[0036] The execution module is used to perform corresponding processing operations on the written data based on the printing processing strategy corresponding to the comparison results.

[0037] The message processing device provided in this embodiment of the invention, by dynamically managing the printing redundancy level, outputs key debugging information only when necessary, significantly reducing the time overhead introduced by redundant printing operations during simulation; in regression testing scenarios, it avoids the problem of localization when there is no waveform to check, and can quickly narrow down the problem scope, thereby reducing the verification cycle and cost; at the same time, it ensures the integrity of necessary printing information, which facilitates accurate analysis of signal behavior in combination with log files, and improves the overall efficiency and reliability of SoC verification.

[0038] Thirdly, embodiments of the present invention provide a computer device, including: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method described in the first aspect or any corresponding embodiment thereof.

[0039] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer instructions that cause a computer to perform the method described in the first aspect or any of its corresponding embodiments. Attached Figure Description

[0040] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0041] Figure 1 This is a flowchart illustrating a message processing method provided according to an embodiment of the present invention;

[0042] Figure 2 This is a flowchart illustrating another message processing method provided according to an embodiment of the present invention;

[0043] Figure 3 This is a structural block diagram of a message processing apparatus according to an embodiment of the present invention;

[0044] Figure 4 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation

[0045] 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, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0046] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0047] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0048] SoC front-end verification refers to the functional and performance verification of the designed circuit diagram and logic during the chip design phase to ensure that the design meets specifications. This process is a crucial step in ensuring the correctness of the chip design. Compared to IP verification, which primarily focuses on the functional correctness of modules (e.g., simple modules like I2C and UART, or complex modules like PCIe and DDR), SoC verification focuses on the overall functional correctness of the chip, including system-level interconnects, power management, multi-module collaboration, and system-level performance testing. SoC verification engineers need to ensure the entire chip operates as expected, involving the verification of a series of design transformations from RTL to netlist to layout structure.

[0049] SoCs typically include CPU cores, and SoC use cases are usually implemented in C to write test stimuli, simulate software behavior, and demonstrate interactions with the hardware. As chip design becomes increasingly complex, an efficient and debuggable platform becomes crucial. Adding print statements to C programs helps us trace program execution through textual information. Especially during debugging, printing information is very helpful in quickly locating problems.

[0050] However, in related technologies, SoC system scenarios are verified and simulated using C test cases and UVM verification platforms. During development, it's necessary to first narrow down the problem scope by checking the log file's output, and then specifically examine the signal behavior through simulation waveforms to accurately pinpoint the problem's origin. However, logging also consumes simulation time; the simulation time for a complex system test case can differ by about one-third compared to not logging. Without log information, the test case may ultimately fail during simulation, making problem localization extremely difficult. Especially during regression testing, without waveforms to query, the cost of locating the problem increases exponentially.

[0051] Based on this, this embodiment provides a message processing method, apparatus, computer device, and storage medium. By dynamically managing the printing redundancy level, key debugging information is output only when necessary, significantly reducing the time overhead introduced by redundant printing operations during simulation. In regression testing scenarios, it avoids the problem of locating the issue when there is no waveform available, and can quickly narrow down the problem scope, thereby reducing the verification cycle and cost. At the same time, it ensures the integrity of necessary printed information, which facilitates accurate analysis of signal behavior in conjunction with log files, improving the overall efficiency and reliability of SoC verification.

[0052] This embodiment provides a message processing method. Figure 1 This is a flowchart of a message processing method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:

[0053] Step 110: When the central processing unit is detected executing a C language print function, read the write data belonging to the current cycle on the bus.

[0054] When the central processing unit executes the C language print function, it will perform a write operation on a specific address through the bus.

[0055] In one possible implementation, when reading write data belonging to the current cycle on the bus, the bus address corresponding to the bus can be checked first to see if it is the correct address. If the bus address is the correct address, write data is read from the bus until a newline identifier is read, at which point the read write data is used as the write data for the current cycle.

[0056] Specifically, during bus operation, the bus address corresponding to the bus can be monitored in real time and matched with a preset valid address range to verify the correctness of the bus address. If an illegal address is detected, an interrupt signal is generated to suspend the data reading process. After the bus address verification is successful, write data is captured from the bus in byte order, and the input data stream is continuously scanned to identify newline identifiers (such as ASCII code 0x0A). Once a newline identifier is detected, a data packetization operation is immediately performed to integrate the accumulated write data into a complete message for the current round and output it to the print buffer queue. At the same time, if no newline identifier is detected within a preset time, the current round of data reading is forcibly terminated, and an error log is recorded to prevent system congestion.

[0057] As an example, the configurable valid address range is 0x1000 to 0x1FFF to cover the address space of common printing operations. During bus data transmission, if the bus address is detected to be outside this range, a high-priority interrupt signal is immediately generated to notify the system to handle the abnormal state and prevent invalid data from polluting the buffer queue. After address verification, write data is captured byte-by-byte from the bus interface, and the data stream is scanned in real time using a state machine. A comparator is used to identify newline identifiers (such as ASCII code 0x0A), with an identification accuracy of single-cycle latency. When a newline character is detected, the state machine triggers data packetization logic, integrating the accumulated data into a complete message frame and adding a timestamp and source address information to ensure message structure consistency. Subsequently, the message is output to the print buffer queue through the DMA channel, and can be accessed concurrently by multiple threads to improve throughput. If no newline character is detected within a preset timeout threshold (such as 10ms), the current round of reading is automatically terminated, the state machine is reset, and error events are recorded through the system log interface, including timestamps, bus addresses, and the length of captured data, to facilitate subsequent analysis of potential blocking sources.

[0058] Step 120: Obtain the data identifier corresponding to the written data, and use the data identifier to query the corresponding printing redundancy level.

[0059] The data identifier corresponding to the written data can be the first character of the written data. In this case, the first character of the written data can be used as the ID.

[0060] In one possible implementation, when obtaining the data identifier corresponding to the write data and using the data identifier to query the corresponding print redundancy level, the first character can be parsed in real time from the write data stream captured by the bus interface as the data identifier. Then, the corresponding identifier-information mapping table is queried through the data identifier. The identifier-information mapping table is stored in non-volatile memory and predefined with mapping relationships between different data identifiers and redundancy level values. During the query, hardware lookup logic is used to match entries based on the identifier and return the level value. If the match fails, an error interrupt is triggered, and an invalid identifier event is recorded in the system log. Subsequently, the data frame format of subsequent print buffers is dynamically adjusted based on the returned redundancy level to adapt to different redundancy requirements. The identifier-information mapping table is shown in Table 1.

[0061] Table 1 Identifier-Information Mapping Table

[0062]

[0063] Among them, UVM_NONE is the no-redundancy printing level, meaning no extra data frames are added during printing operations; similarly, UVM_LOW corresponds to low redundancy requirements, adding only basic error checks; UVM_MEDIUM introduces timestamps and sequence numbers; UVM_HIGH includes a full checksum and retransmission flag; UVM_FULL integrates advanced encryption and redundancy backup mechanisms; and UVM_DEBUG is used for debug mode, recording detailed logs. During device operation, based on the queried redundancy level, the message processing device adjusts the data frame format of the printing buffer in real time: for example, when matching UVM_MEDIUM, the current system time and an incrementing sequence number are inserted into the data frame header; if it is UVM_HIGH, a CRC checksum and a retransmission counter are added to ensure data integrity. In addition, after an error interruption is triggered, the device automatically switches to the default redundancy level UVM_NONE and generates an error report written to the system log; at the same time, the configuration table supports dynamic updates through external interfaces, allowing users to add or modify mapping relationships to accommodate new data types.

[0064] Step 130: Compare the print redundancy level with the current setting level of the verification environment to obtain the comparison results.

[0065] As shown above, by comparing the printed redundancy level with the current set level of the verification environment, a comparison result is obtained, which is then used to adjust the message processing strategy. If the comparison result shows that the current redundancy level is lower than the set level, the device automatically upgrades the data frame format to meet higher redundancy requirements, such as upgrading from UVM_LOW to UVM_MEDIUM or higher. Conversely, if the current redundancy level is higher than the set level, the data frame format is simplified to reduce resource consumption, such as downgrading from UVM_FULL to UVM_MEDIUM or lower. This dynamic adjustment mechanism ensures the efficiency and flexibility of message processing, effectively addressing redundancy requirements in different application scenarios.

[0066] In one possible implementation, before comparing the print redundancy level with the current setting level of the verification environment to obtain the comparison result, the CPU utilization, memory usage, and bus data transfer volume can be obtained; the system load value is calculated using the utilization, memory usage, and data transfer volume; based on the mapping relationship between the preset load value and the setting level, the setting level corresponding to the system load value is determined, and the setting level corresponding to the system load value is used as the current setting level of the verification environment.

[0067] As an example, the system obtains real-time data showing that the CPU utilization is 75%, memory usage is 60%, and bus data transfer rate is 80MB / s. Using a preset algorithm (e.g., weighted summation: CPU utilization × 0.4 + memory usage × 0.3 + bus transfer rate as a percentage of maximum bandwidth × 0.3), the system load value is calculated to be 70. The system then queries a preset load value and setting level mapping table (e.g., load value ≤ 30 corresponds to UVM_HIGH, 31-70 corresponds to UVM_MEDIUM, and 71-100 corresponds to UVM_LOW) to determine that the setting level corresponding to the load value 70 is UVM_MEDIUM. Therefore, the current setting level of the verification environment is updated to UVM_MEDIUM.

[0068] Furthermore, the system can automatically switch between different levels of redundancy when system load fluctuates. For example, when the load increases, the redundancy printing level can be reduced to prioritize core message processing performance, while when the load decreases, the redundancy printing level can be increased to enhance the integrity of log recording. Additionally, if anomalies occur during calculation or comparison, a predefined security level can be used by default to ensure the continuity and stability of message processing.

[0069] The message processing method provided in this embodiment of the invention obtains system resource indicators in real time, including CPU utilization, memory usage, and bus data transmission volume, comprehensively calculates the system load value, and dynamically adjusts the setting level of the verification environment based on a preset mapping relationship between the load value and the setting level; then, it compares the printing redundancy level with the setting level to generate a comparison result; and adaptively controls the redundancy printing level of the message according to the comparison result to reduce resource overhead and optimize message transmission efficiency.

[0070] In one possible implementation, after performing corresponding processing operations on the written data based on the printing processing strategy corresponding to the comparison results, the frequency of occurrence of the data identifier corresponding to the processed printing message within a preset time period can be monitored; and the priority corresponding to the data identifier can be queried to see if it is greater than the preset priority; if the frequency of occurrence is greater than the preset frequency and the priority is greater than the preset priority, the process association table is queried according to the data identifier to determine the corresponding associated process, and the resource adjustment parameters required for this type of message are obtained from the resource requirement configuration table; the resource scheduling interface is called to dynamically allocate a corresponding proportion of the central processing unit time slice to the associated process, and the memory quota of the log storage buffer is adjusted according to the parameters; the processing delay from message capture to output is continuously monitored, and if the processing delay is less than the preset delay, the current resource configuration is maintained; if it still exceeds the preset delay, a stepped resource expansion is triggered until the processing delay drops to within the preset delay.

[0071] As an example, the system has a preset time period of 10 seconds, a preset frequency of 5 times, a preset priority of UVM_MEDIUM, and a preset delay of 10ms. The system detects that the print message with data identifier ID=0x0A appears 7 times within 10 seconds (frequency > 5 times). A query reveals that the priority corresponding to this ID is UVM_HIGH (> UVM_MEDIUM). Therefore, based on ID=0x0A, the system queries the process association table to determine that the associated process is the data transmission process P3. The system then retrieves parameters from the resource requirement configuration table indicating that P3 needs an additional 20% CPU time slice and the log storage buffer needs to be expanded to 1.5 times its original size. Subsequently, the resource scheduling interface is called to complete the above resource adjustments. The system then continuously monitors the processing delay of the ID=0x0A message. The initial delay is 15ms (> 10ms). Following a tiered rule, P3 is given an additional 10% CPU time slice and its buffer is expanded by 20%. Further monitoring shows that the delay has decreased to 8ms (< 10ms). Therefore, the current resource configuration is maintained to ensure timely message processing.

[0072] The message processing method provided in this invention achieves intelligent resource scheduling by dynamically monitoring the frequency and priority of data identifiers and combining them with process association tables and resource requirement configuration tables. It continuously optimizes processing latency by dynamically allocating CPU time slices and adjusting the memory quota of the log storage buffer through resource scheduling interfaces. When the latency exceeds a preset threshold, a tiered resource expansion mechanism is triggered, gradually increasing the CPU time slice ratio and buffer size until the latency drops to an acceptable range. Simultaneously, the optimal resource configuration is maintained to ensure the real-time performance and stability of message processing.

[0073] Step 140: Perform corresponding processing operations on the written data based on the printing processing strategy corresponding to the comparison results.

[0074] If the comparison result indicates that the redundancy level of printing is greater than the set level, then the write data of the current round will not be processed.

[0075] Specifically, if the comparison results show that the print redundancy level is greater than the current setting level of the verification environment, it indicates that the current printed information contains high redundancy, while the verification environment has a low requirement for redundancy. Therefore, in order to save system resources and simulation time, it is possible to skip the current round of write data and directly skip this printing operation, avoiding unnecessary data processing and storage overhead and improving the overall processing efficiency of the message.

[0076] As an example, if the level is set to UVM_MEDIUM, the redundancy level will be printed as UVM_HIGH, UVM_FULL, or UVM_DEBUG. That is, when the data identifier ID = 4, 5, or 6, no information will be output.

[0077] The message processing method provided in this invention significantly reduces the time overhead introduced by redundant printing operations during simulation by dynamically managing the printing redundancy level and outputting key debugging information only when necessary. In regression testing scenarios, it avoids the problem of locating the issue when there is no waveform available, and can quickly narrow down the problem scope, thereby reducing the verification cycle and cost. At the same time, it ensures the integrity of necessary printing information, which facilitates accurate analysis of signal behavior in conjunction with log files, thereby improving the overall efficiency and reliability of SoC verification.

[0078] Figure 2 A flowchart of another embodiment of the message processing method of the present invention is shown. Figure 2 As shown, the method includes the following steps:

[0079] Step 210: When the central processing unit is detected executing a C language print function, read the write data belonging to the current cycle on the bus.

[0080] Please see details Figure 1Step 110 of the illustrated embodiment will not be described again here.

[0081] Step 220: Obtain the data identifier corresponding to the written data, and use the data identifier to query the corresponding printing redundancy level.

[0082] Please see details Figure 1 Step 120 of the illustrated embodiment will not be described again here.

[0083] Step 230: Compare the print redundancy level with the current setting level of the verification environment to obtain the comparison results.

[0084] Please see details Figure 1 Step 130 of the illustrated embodiment will not be described again here.

[0085] Step 240: Perform corresponding processing operations on the written data based on the printing processing strategy corresponding to the comparison results.

[0086] Specifically, step 240 includes:

[0087] Step 2401: If the printing redundancy level is less than or equal to the set level, then obtain the printing information corresponding to the data identifier from the identifier-information mapping table;

[0088] Step 2402: Perform the corresponding printing operation based on the printing information.

[0089] Specifically, if the comparison results show that the print redundancy level is less than or equal to the current set level of the verification environment, it indicates that the current print information is available. Therefore, the device is configured to retrieve the print information from the identifier-information mapping table and perform the corresponding print operation based on the print information.

[0090] As an example, if the level is set to UVM_MEDIUM, then the print redundancy level is UVM_NONE, UVM_LOW, or UVM_MEDIUM. That is, when the data identifier ID = 1, 2, 3, 7 or FF, the corresponding print information can perform the corresponding print operation.

[0091] Specifically, based on the data identifier ID corresponding to the written data, the print redundancy level corresponding to that data identifier ID is queried from the identifier-information mapping table. This print redundancy level is compared with the current verification environment's set level (e.g., UVM_MEDIUM): If the print redundancy level ≤ the set level: processing continues, preparing to print the message corresponding to that data identifier ID (e.g., ID = 1, 2, 3, 7, FF meets the UVM_MEDIUM level). If the print redundancy level > the set level: processing terminates, and the message is not printed (e.g., ID = 4, 5, 6 are filtered).

[0092] The message processing method provided in this invention achieves on-demand triggering and optimized resource configuration for printing operations by dynamically managing printing redundancy levels and matching them with system load status. This method not only effectively filters unnecessary printing information with excessive redundancy, reducing log file size and storage resource consumption, but also dynamically adjusts the system processing strategy through a load-aware mechanism, ensuring that critical messages still receive priority processing even when resources are limited. Furthermore, the dynamic resource allocation mechanism based on message frequency and priority significantly improves the processing timeliness of high-priority messages, avoiding processing delays caused by sudden surges in traffic. This refined resource scheduling strategy, combined with a tiered expansion mechanism, maximizes hardware resource utilization while ensuring system stability, providing a scalable and efficient log processing solution for large-scale SoC verification.

[0093] In one possible implementation, when performing the corresponding printing operation based on the printing information, the array size in the printing information can also be extracted; if the array size is 1, it is determined that there are no additional parameters, and then the printing operation is performed on the printing information; or, if the array size is greater than 1, it is determined that there are additional parameters, and then the additional parameters are extracted according to the string terminator, and the printing operation is performed on the printing information containing the additional parameters.

[0094] As an example, if the array size is 1, it means there are no additional parameters to read. If the array size is greater than 1, it means there are additional parameters to print. The size of the string is determined by checking the string terminator "0x00". Simultaneously, the newline character "0x0a" is used to determine if a print operation has been completed. In other words, if the array size is 1: there are no extra parameters, and the message content obtained from the lookup table is printed directly. If the array size is greater than 1: there are parameters, and further processing is required: the length and content of each parameter are determined by the string terminator 0x00.

[0095] As another example, when extracting additional parameters, the array structure in the printed information can be parsed first, identifying string terminators (such as the null character '\0') as separators. For instance, if the printed information array is ["Data Identifier ID:1","Additional Parameter 1","Additional Parameter 2","\0"], the array size is greater than 1, indicating the presence of multiple parameters. The system will scan the array segment by segment until it encounters a terminator, extracting all additional parameters (such as "Additional Parameter 1" and "Additional Parameter 2"). Subsequently, these parameters are embedded into a predefined message template, formatting the output of the complete printed information. If the array size is abnormal (such as 0 or a negative value), an error handling mechanism is triggered, skipping the printing operation and logging it, ensuring the robustness of the processing.

[0096] The message processing method provided in this invention reduces simulation time consumption caused by C printing by minimizing the content of C printing to a minimum, namely data identifiers and information content. Simultaneously, to avoid the need for recompilation before simulation due to UVM file modifications, an identifier-information mapping table is established. The SoC verification platform can display all the printed information corresponding to the corresponding data identifiers by parsing the file information. Users only need to edit the file each time they make a modification, without needing to edit the verification platform, thereby reducing the need for compilation, significantly saving verification engineers' time, shortening the iteration time, and indirectly reducing the cost of using verification tool licenses.

[0097] Furthermore, since users only need to maintain one print information table file and the simplest print information for each use case, the print information that originally needed to be entered into the C use case is split into the complete definition information of data identifier and identifier-information mapping table. That is, the identifier-information mapping table is defined as a file type, which is convenient to maintain, easy to understand, highly reusable, and supports arbitrary modification without consuming compilation time. It can also reduce the time required for verification regression, thereby shortening the verification cycle.

[0098] Figure 3 A schematic diagram of an embodiment of the message processing apparatus of the present invention is shown. Figure 3 As shown, the device includes:

[0099] The reading module 310 is used to read the write data belonging to the current round on the bus when the central processing unit executes the C language print function. When the central processing unit executes the C language print function, it will perform a write operation on a specific address through the bus.

[0100] The acquisition module 320 is used to acquire the data identifier corresponding to the written data and use the data identifier to query the corresponding printing redundancy level;

[0101] The comparison module 330 is used to compare the printing redundancy level with the set level of the current verification environment to obtain the comparison result;

[0102] The execution module 340 is used to perform corresponding processing operations on the written data based on the printing processing strategy corresponding to the comparison results.

[0103] In one possible implementation, the reading module 310 includes:

[0104] The address acquisition unit is used to determine whether the bus address corresponding to the bus is a correct address.

[0105] The data reading unit is used to read write data from the bus if the bus address is correct, until a newline identifier is read, at which point the read write data is used as the write data for the current round.

[0106] In one possible implementation, the execution module 340 includes:

[0107] The first execution unit is used to not process the write data of the current round if the printing redundancy level is greater than the set level.

[0108] In one possible implementation, the execution module 340 includes:

[0109] The information acquisition unit is used to retrieve the printing information corresponding to the data identifier from the identifier-information mapping table if the printing redundancy level is less than or equal to the set level.

[0110] The second execution unit is used to perform corresponding printing operations based on the printing information.

[0111] In one possible implementation, the second execution unit includes:

[0112] The array extraction sub-cell is used to extract the array size from the printed information;

[0113] The first execution subunit is used to perform a printing operation on the printed information if the array size is 1 and it is determined that there are no additional parameters.

[0114] Alternatively, the second execution subunit is used to extract additional parameters according to the string terminator if the array size is greater than 1, and then perform a printing operation on the print information containing the additional parameters.

[0115] In one possible implementation, the comparison module 330 includes:

[0116] The data acquisition unit is used to acquire the utilization rate of the central processing unit, the memory usage rate, and the data transfer volume of the bus;

[0117] The data transfer rate calculation unit is used to calculate the system load value using utilization rate, memory usage rate, and data transfer rate.

[0118] The setting level determination unit is used to determine the setting level corresponding to the system load value based on the mapping relationship between the preset load value and the setting level, and to use the setting level corresponding to the system load value as the current setting level of the verification environment.

[0119] In one possible implementation, the comparison module 330 includes:

[0120] The frequency monitoring unit is used to monitor the frequency of occurrence of data identifiers corresponding to processed print messages within a preset time period; and to query whether the priority corresponding to the data identifier is greater than the preset priority.

[0121] The process determination unit is used to query the process association table based on the data identifier if the frequency of occurrence is greater than the preset frequency and the priority is greater than the preset priority, determine the corresponding associated process, and obtain the resource adjustment parameters required for this type of message from the resource requirement configuration table.

[0122] The quota adjustment unit is used to call the resource scheduling interface to dynamically allocate a corresponding proportion of CPU time slices to the associated processes, and at the same time adjust the memory quota of the log storage buffer according to the parameters.

[0123] The data processing unit is used to continuously monitor the processing latency of messages from capture to output. If the processing latency is less than the preset latency, the current resource configuration is maintained. If it still exceeds the preset latency, the resource capacity is expanded in a step-by-step manner until the processing latency drops to within the preset latency.

[0124] The message processing device provided in this embodiment of the invention, by dynamically managing the printing redundancy level, outputs key debugging information only when necessary, significantly reducing the time overhead introduced by redundant printing operations during simulation; in regression testing scenarios, it avoids the problem of localization when there is no waveform to check, and can quickly narrow down the problem scope, thereby reducing the verification cycle and cost; at the same time, it ensures the integrity of necessary printing information, which facilitates accurate analysis of signal behavior in combination with log files, and improves the overall efficiency and reliability of SoC verification.

[0125] For a description of the features in the embodiment corresponding to the message processing apparatus of this application, please refer to the relevant description of the embodiment corresponding to the message processing method, which will not be repeated here.

[0126] Embodiments of this application also provide an electronic device, such as... Figure 4 As shown, it includes a memory 410 and a processor 420. The memory 410 stores a computer program, and the processor 420 is configured to run the computer program to perform the steps in any of the above-described message processing method embodiments.

[0127] The electronic device also includes a communication interface 430 for communicating with other devices or communication networks.

[0128] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described message processing method embodiments when it is run.

[0129] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0130] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described message processing method embodiments.

[0131] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described message processing method embodiments.

[0132] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0133] The foregoing has provided a detailed description of a message processing method, apparatus, electronic device, and storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A message processing method, characterized in that, The method includes: When the CPU executes a C language print function, it reads the write data belonging to the current cycle on the bus. When the CPU executes the C language print function, it performs a write operation on a specific address through the bus. Obtain the data identifier corresponding to the written data, and use the data identifier to query the corresponding print redundancy level; The comparison results are obtained by comparing the aforementioned print redundancy level with the current setting level of the verification environment; Based on the printing processing strategy corresponding to the comparison results, perform the corresponding processing operations on the written data.

2. The method according to claim 1, characterized in that, The process of reading write data belonging to the current round on the bus includes: Check whether the bus address corresponding to the bus is a correct address; If the bus address is correct, write data is read from the bus until a newline identifier is read, at which point the read write data is used as the write data for the current round.

3. The method according to claim 1, characterized in that, The step of performing corresponding processing operations on the written data based on the printing processing strategy corresponding to the comparison result includes: If the print redundancy level is greater than the set level, then the write data for the current round will not be processed.

4. The method according to claim 1, characterized in that, The step of performing corresponding processing operations on the written data based on the printing processing strategy corresponding to the comparison result includes: If the printing redundancy level is less than or equal to the set level, then the printing information corresponding to the data identifier is obtained from the identifier-information mapping table; Perform the corresponding printing operation based on the printed information.

5. The method according to claim 4, characterized in that, The step of performing the corresponding printing operation based on the printing information includes: Extract the array size from the printed information; If the array size is 1, then it is determined that there are no additional parameters, and a printing operation is performed on the printed information; or, If the array size is greater than 1, it is determined that there are additional parameters. The additional parameters are then extracted according to the string terminator, and the printing operation is performed on the printing information containing the additional parameters.

6. The method according to claim 1, characterized in that, Before comparing the print redundancy level with the current setting level of the verification environment to obtain the comparison result, the method further includes: Obtain the utilization rate of the central processing unit, the memory usage rate, and the data transfer volume of the bus; The system load value is calculated using the utilization rate, memory usage rate, and data transfer volume. Based on the mapping relationship between the preset load value and the set level, the set level corresponding to the system load value is determined, and the set level corresponding to the system load value is used as the current set level of the verification environment.

7. The method according to claim 1, characterized in that, After performing corresponding processing operations on the written data based on the printing processing strategy corresponding to the comparison result, the method further includes: Monitor the frequency of occurrence of data identifiers corresponding to processed print messages within a preset time period; and query whether the priority corresponding to the data identifier is greater than a preset priority; If the frequency of occurrence is greater than the preset frequency and the priority is greater than the preset priority, then the process association table is queried according to the data identifier to determine the corresponding associated process, and the resource adjustment parameters required for this type of message are obtained from the resource requirement configuration table. The resource scheduling interface is invoked to dynamically allocate a corresponding proportion of CPU time slices to the associated processes, while the memory quota of the log storage buffer is adjusted according to the parameters. Continuously monitor the processing latency from message capture to output. If the processing latency is less than the preset latency, maintain the current resource configuration. If it still exceeds the preset latency, trigger a tiered resource expansion until the processing latency drops to within the preset latency.

8. A message processing apparatus, characterized in that, include: The reading module is used to read the write data belonging to the current round on the bus when the central processing unit executes the C language print function. When the central processing unit executes the C language print function, it will perform a write operation on a specific address through the bus. The acquisition module is used to acquire the data identifier corresponding to the written data and use the data identifier to query the corresponding printing redundancy level; The comparison module is used to compare the printing redundancy level with the set level of the current verification environment to obtain the comparison result; The execution module is used to perform corresponding processing operations on the written data based on the printing processing strategy corresponding to the comparison result.

9. A computer device, characterized in that, include: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, the processor executing the computer instructions to perform the method of any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the method of any one of claims 1 to 7.

Citation Information

Cited By

  • Method and device for managing UVM case timeout by using counting module and medium

    CN122088404A

  • A method, apparatus, and medium for managing uvm use case timeouts with a counting module

    CN122088404B