Method and device for verifying task arbitration dispatcher, server and storage medium
By generating test incentives and predicting virtual channels, real-time comparison of the verification process of the task arbitration distributor is solved, and the problem of difficult time discovery of hidden errors in traditional methods is achieved, achieving efficient and comprehensive verification and accurate parameter comparison.
Patent Information
- Application Number
- CN202411383570.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-02-11
AI Technical Summary
The traditional verification task arbitration distributor method relies on the actual results from memory to compare after the task is executed, which makes it difficult to detect hidden errors in time during the task parameter calculation process, extending the verification cycle and increasing the difficulty of problem positioning.
By generating test incentives, a predicted virtual channel is generated based on the test incentives, and the test incentives are sent to the arbitration distributor of the task to be verified, obtaining the arbitrated target virtual channel. Compare the target virtual channel and the predicted virtual channel. If the same is true, obtain the target task request, generate prediction parameters, and receive the target parameters generated by the task arbitration distributor to be verified one by one. Compare the prediction parameters and target parameters to determine the verification result.
It realizes efficient and comprehensive verification of the task arbitration distributor, shortens the verification cycle, improves verification accuracy, reduces debugging difficulty, and promptly detects parameter calculation errors during task processing.
Smart Images

Figure CN119415328A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of chip verification technology, and in particular to a method, device, server and storage medium for verifying a task arbitration distributor. Background Art
[0002] As the complexity of the system increases, the task arbitration distributor plays a key role in data communication and processing, responsible for efficiently coordinating the access of multiple virtual channels (VCs) to shared resources. In modern data processing systems, the task distribution part of the task arbitration distributor plays a vital role. It not only needs to parse tasks from different virtual channels and perform accurate parameter processing, but also needs to accurately distribute these tasks to the corresponding output channels. Verifying the accuracy of this process, especially ensuring the accuracy of task parameters and task execution results, is directly related to the reliability and stability of the entire task arbitration distributor.
[0003] However, traditional methods for verifying task arbitration distributors usually rely on capturing the actual results of task execution from memory after the task is completed, and comparing the captured actual results of task execution with the task execution results predicted by the reference model.
[0004] Although this verification method is intuitive, it has significant drawbacks: when there are hidden errors (such as data overflow, precision loss, etc.) in the calculation process of task parameters, these errors often do not appear in the early stage of task execution, but accumulate until the task is completed and the final result is produced. This not only leads to a significant extension of the verification cycle, but also increases the difficulty and complexity of problem location, and thus increases the difficulty of debugging the task arbitration distributor. Therefore, there is an urgent need for an efficient and comprehensive verification method to shorten the verification cycle, improve the verification accuracy, and thus reduce the difficulty of debugging the task arbitration distributor. Summary of the invention
[0005] Based on the above problems, the present application provides a method, device, server and storage medium for verifying a task arbitration distributor, with the purpose of achieving efficient and comprehensive verification of the task arbitration distributor, thereby shortening the verification cycle and improving the verification accuracy.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] A first aspect of the present application provides a method for verifying a task arbitration distributor, the method comprising:
[0008] Generate a test stimulus, the test stimulus including a plurality of task requests and numbers of a plurality of virtual channels to be arbitrated to which the plurality of task requests are respectively configured; the task request includes a task type identifier and required task parameters;
[0009] generating a predicted virtual channel based on the test stimulus;
[0010] Sending the test stimulus to the arbitration distributor of the task to be verified to obtain the target virtual channel arbitrated by the arbitration distributor of the task to be verified;
[0011] Comparing the target virtual channel with the predicted virtual channel, if the target virtual channel is the same as the predicted virtual channel, obtaining the target task request carried by the target virtual channel;
[0012] Generate a plurality of prediction parameters generated in the process of processing the target task request according to the target task request;
[0013] Receiving one by one a plurality of target parameters generated by the arbitration distributor of the task to be verified in the process of processing the target task request;
[0014] The target parameter and the predicted parameter are compared to determine a verification result.
[0015] In an optional implementation, the step of sending the test stimulus to an arbitration distributor of tasks to be verified to obtain a target virtual channel arbitrated by the arbitration distributor of tasks to be verified includes:
[0016] Obtain the number of input ports L of the arbitration distributor of the task to be verified, where L is a positive integer;
[0017] Obtain a total number N of virtual channels to be arbitrated in the test stimulus, where N is a positive integer; wherein N is less than or equal to L;
[0018] Obtain a maximum number M of virtual channels that can be arbitrated simultaneously by the arbitration distributor of the task to be verified, where M is a positive integer;
[0019] If N is greater than M, the N virtual channels to be arbitrated are divided into M groups of virtual channel groups to be arbitrated;
[0020] The M groups of virtual channels to be arbitrated are sent to the arbitration distributor for the task to be verified, and the target virtual channels arbitrated by the arbitration distributor for the task to be verified are obtained.
[0021] In an optional implementation, before generating the test stimulus, the method further includes:
[0022] Defining constraints on task parameters in the task request; the constraints include a threshold range of the task parameters;
[0023] Randomly generate a plurality of task requests based on the constraint condition; task parameters in the plurality of task requests are within the threshold range;
[0024] The multiple task requests are respectively configured into multiple virtual channels to be arbitrated.
[0025] In an optional implementation, the generating, according to the target task request, a plurality of prediction parameters generated in the process of processing the target task request includes:
[0026] Determining a calculation rule for the task parameters according to the task type identifier in the target task request and the required task parameters;
[0027] generating a prediction process for processing the target task request based on a calculation rule of the task parameter;
[0028] Generate prediction parameters generated when processing the prediction process.
[0029] In an optional implementation, the comparing the target parameter with the predicted parameter to determine a verification result includes:
[0030] If the target parameter is the same as the predicted parameter, the verification is successful;
[0031] If the target parameter and the predicted parameter are different, the validation fails.
[0032] In an optional implementation, the method further includes verifying that the verification fails if the target virtual channel is different from the predicted virtual channel.
[0033] A second aspect of the present application provides a device for verifying a task arbitration distributor, the device comprising:
[0034] A test stimulus generation module, used to generate a test stimulus, wherein the test stimulus includes a plurality of task requests and numbers of a plurality of virtual channels to be arbitrated to which the plurality of task requests are respectively configured; the task request includes a task type identifier and required task parameters;
[0035] A predicted virtual channel module, used for generating a predicted virtual channel based on the test stimulus;
[0036] A sending module, used for sending the test stimulus to the arbitration distributor of the task to be verified, and obtaining the target virtual channel arbitrated by the arbitration distributor of the task to be verified;
[0037] A first comparison module, configured to compare the target virtual channel with the predicted virtual channel, and if the target virtual channel is the same as the predicted virtual channel, obtain a target task request carried by the target virtual channel;
[0038] A prediction parameter module, used to generate a plurality of prediction parameters generated in the process of processing the target task request according to the target task request;
[0039] A receiving module, used for receiving one by one a plurality of target parameters generated by the arbitration distributor of the task to be verified in the process of processing the target task request;
[0040] The second comparison module is used to compare the target parameter with the predicted parameter to determine a verification result.
[0041] In an optional implementation, the sending module includes:
[0042] A first acquisition module is used to acquire the number L of input ports of the arbitration distributor of the task to be verified, where L is a positive integer;
[0043] A second acquisition module is used to acquire a total number N of virtual channels to be arbitrated in the test stimulus, where N is a positive integer; wherein N is less than or equal to L;
[0044] A third acquisition module is used to obtain a maximum number M of virtual channels that can be arbitrated simultaneously by the arbitration distributor of the task to be verified, where M is a positive integer;
[0045] A grouping module, configured to group the N virtual channels to be arbitrated into M groups of virtual channel groups to be arbitrated if the N is greater than the M;
[0046] The virtual channel group sending module is used to send the M groups of virtual channel groups to be arbitrated to the arbitration distributor of the task to be verified, and obtain the target virtual channel arbitrated by the arbitration distributor of the task to be verified.
[0047] A third aspect of the present application provides a server for a verification task arbitration distributor, the server comprising:
[0048] a memory having a computer program stored thereon;
[0049] A processor is used to execute the computer program in the memory to implement the steps of the method for verifying the task arbitration distributor introduced in any implementation manner of the first aspect.
[0050] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for verifying a task arbitration distributor introduced in any implementation manner of the first aspect.
[0051] Compared with the prior art, this application has the following beneficial effects:
[0052] In the technical solution of the present application, a test stimulus is first generated; a predicted virtual channel is generated based on the test stimulus; the test stimulus is sent to the arbitration distributor of the task to be verified again to obtain the target virtual channel arbitrated by the arbitration distributor of the task to be verified; then the target virtual channel is compared with the predicted virtual channel, and if the target virtual channel is the same as the predicted virtual channel, the target task request carried by the target virtual channel is obtained; then multiple prediction parameters generated in the process of processing the target task request are generated according to the target task request; then multiple target parameters generated by the arbitration distributor of the task to be verified in the process of processing the target task request are received one by one; finally, the target parameters and the predicted parameters are compared to determine the verification result. Compared with the prior art, which relies on the task execution to capture the actual result from the memory and compare it with the data predicted by the reference model, the technical solution of the present application adds the comparison of parameters in the task processing process, which can immediately find the parameter calculation errors generated in the task processing process, making the verification of the task arbitration distributor more comprehensive and greatly shortening the verification cycle. Through this verification method, once an error is found, the verification can be stopped immediately and the specific processing process can be located, which reduces the difficulty and complexity of problem location and makes the debugging process simpler. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0054] Figure 1 A flow chart of a method for verifying a task arbitration distributor provided by an embodiment of the present application;
[0055] Figure 2 A flowchart of another method for verifying a task arbitration distributor provided by an embodiment of the present application;
[0056] Figure 3 A schematic diagram of the structure of a verification task arbitration distributor device provided in an embodiment of the present application;
[0057] Figure 4 A scenario diagram of a verification task arbitration distributor provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] As described above, the current method of verifying the task arbitration distributor usually relies on grabbing the actual results of the task execution from the memory after the task is completed, and comparing the captured actual results of the task execution with the task execution results predicted by the reference model. This verification method cannot detect problems in time when problems occur during the task parameter calculation process, and it is difficult to locate the problem.
[0059] After research, the inventors have proposed a method, device, server and storage medium for verifying a task arbitration distributor.
[0060] First, a test stimulus is generated; second, a predicted virtual channel is generated based on the test stimulus; the test stimulus is sent to the arbitration distributor of the task to be verified again to obtain the target virtual channel arbitrated by the arbitration distributor of the task to be verified; then, the target virtual channel is compared with the predicted virtual channel, and if the target virtual channel is the same as the predicted virtual channel, the target task request carried by the target virtual channel is obtained; then, according to the target task request, a plurality of prediction parameters generated in the process of processing the target task request are generated; then, a plurality of target parameters generated by the arbitration distributor of the task to be verified in the process of processing the target task request are received one by one; finally, the target parameters are compared with the predicted parameters to determine the verification result.
[0061] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0062] The task arbitration distributor is used in data terminal equipment (DTE) or memory management unit (MMU), and is usually used to coordinate the access of multiple devices to shared resources (such as bus, memory, etc.). The task arbitration distributor includes an arbitration part and a distribution part. The arbitration part involves selecting the most suitable virtual channel from multiple virtual channels (VC) to perform the corresponding task. The distribution part involves judging the task operations (such as linear data movement, dimensional cutting, dimensional conversion, etc.) carried by multiple virtual channels, processing the parameters, and distributing them to multiple output channels (Thread). See Figure 1 , which is a flow chart of a method for verifying a task arbitration distributor provided by an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:
[0063] S101: Generate test stimulus.
[0064] The test stimulus includes a plurality of task requests and numbers of a plurality of virtual channels to be arbitrated to which the plurality of task requests are respectively configured; the task request includes a task type identifier and required task parameters.
[0065] In an embodiment of the present application, a task request includes a task type and required task parameters. For example, a task request involving data transfer includes a clear type identifier to indicate that this is a data transfer task, which can be identified using DATA_TRANSFER or a similar identifier; it includes a data source, which specifies the current location of the data, which can be a memory address, file path, or any other source from which data can be read; it includes a data target, which specifies the new location to which the data will be transferred, which can also be a memory address or file path, etc.; it can also include task parameters such as data size and number of concurrencies. These task requests simulate various tasks that may occur in actual applications, and are used to test the processing capabilities of the arbitration distributor of the task to be verified.
[0066] A virtual channel refers to a logical connection used in computer network communications that allows data to be transferred between two or more nodes in an abstract and flexible way. This connection is not physical but logical, meaning it does not rely on a specific physical path or connection.
[0067] Virtual channels to be arbitrated refer to those virtual channels that are ready to transmit task data but are currently waiting for the arbitration part of the task arbitration distributor to make a decision to determine which channel can preferentially use shared resources (such as processor time, memory bandwidth, etc.) to execute its corresponding task request.
[0068] In the test stimulus, each task request is configured to a virtual channel to be arbitrated. The numbers of these virtual channels to be arbitrated are used to identify different virtual channels so that the arbitration distributor of the task to be verified can identify and process task requests from different virtual channels.
[0069] S102: Generate a predicted virtual channel based on the test stimulus.
[0070] In the embodiment of the present application, based on the numbers of the multiple virtual channels to be arbitrated in the test stimulus, multiple virtual channels to be arbitrated corresponding to the numbers are obtained, and based on the multiple virtual channels to be arbitrated, a predicted arbitration result of the virtual channels to be arbitrated, i.e., a predicted virtual channel, is generated. The predicted virtual channel reflects the theoretical arbitration result of the system when it is not actually running.
[0071] In an example implementation, a simulated arbitration algorithm may be used or prediction may be made based on an arbitration strategy of the system (eg, priority queue, round-robin scheduling, etc.).
[0072] S103 , sending the test stimulus to the arbitration distributor of the task to be verified, and obtaining the target virtual channel arbitrated by the arbitration distributor of the task to be verified.
[0073] In an example implementation, each virtual channel is configured with its own Quality of Service (QoS) to indicate the priority of the virtual channel among the virtual channels; all virtual channels are provided with a counter (order_priority), and whenever a virtual channel carries a task but is not selected, the order_priority value corresponding to the virtual channel is incremented.
[0074] The arbitration of virtual channels by the task arbitration distributor will go through the following steps: The arbitration of virtual channels will give priority to judging the QoS of virtual channels. If the QoS are the same, the priority will be judged according to the order_priority value. If the QoS are the same, the larger the order_priority value of the virtual channel, the higher the priority; the smaller the order_priority value of the virtual channel, the lower the priority.
[0075] In addition, in addition to arbitrating according to the priority of the virtual channel, the task arbitration distributor also needs to determine the status of the output channel. If the output channel does not support the virtual channel, the virtual channel is excluded and the remaining virtual channels are arbitrated again according to the above rules.
[0076] In the embodiment of the present application, the test stimulus is sent to the arbitration distributor of the task to be verified, and the arbitration distributor of the task to be verified arbitrates the multiple virtual channels to be arbitrated corresponding to the numbers of the multiple virtual channels to be arbitrated in the test stimulus, and receives the arbitration result returned by the arbitration distributor, which is the target virtual channel.
[0077] Optionally, this process may send a test stimulus and receive an arbitration result by calling an interface of an arbitration distributor of tasks to be verified.
[0078] S104 , comparing the target virtual channel with the predicted virtual channel, and if the target virtual channel is the same as the predicted virtual channel, obtaining a target task request carried by the target virtual channel.
[0079] In the embodiment of the present application, the predicted virtual channel and the received target virtual channel are compared to verify whether the arbitration result of the arbitration distributor of the task to be verified meets expectations.
[0080] If the comparison finds that the target virtual channel is the same as the predicted virtual channel, the arbitration part of the arbitration distributor of the task to be verified is verified. Then the target task request carried by the target virtual channel is obtained to verify the distribution part.
[0081] S105 , generating a plurality of prediction parameters generated in the process of processing the target task request according to the target task request.
[0082] In the embodiment of the present application, according to the target task request, the prediction parameters that may be generated during the task processing are determined. These prediction parameters are related to the execution process of the task request. The prediction parameters at least include the intermediate variables generated during the execution of the task request and the final parameters after the execution is completed.
[0083] For example, the target task request carried by the target virtual channel is to move 100 data from a to b, which is required to be completed in 5 times. The prediction parameters include 5 predicted transfer batches; the predicted starting addresses a1, a2, a3, a4, and a5 of each data transfer, which respectively represent the predicted starting addresses of the data at the beginning of each transfer. Since the original data is at position a, it may be necessary to determine the specific starting point of each transfer based on the physical layout or logical grouping of the data; the predicted data volume for each transfer is 20 units (if the data can be evenly distributed); and the predicted final target address b of the transfer.
[0084] In one example implementation, the prediction parameters may be generated by a pre-established prediction model, which may be rule-based, statistical, machine-learned, or other types.
[0085] S106 , receiving multiple target parameters generated by the arbitration distributor of the task to be verified in the process of processing the target task request one by one.
[0086] In the embodiment of the present application, the arbitration distributor of the task to be verified generates multiple target parameters one by one as the task is processed during the process of processing the target task request. The target parameters at least include the intermediate variables generated during the processing and the final parameters after the processing is completed.
[0087] For example, the target task request carried by the target virtual channel is to move 100 data from a to b, which is required to be completed in 5 times. When the task arbitration distributor to be verified processes the task request, the target parameters include the target transfer batch, the target start address of each transfer data, the target data volume of each transfer, and the final target address of the target transfer. As the processing process proceeds, the multiple target parameters generated above are received one by one.
[0088] S107. Compare the target parameters and the predicted parameters to determine the verification results.
[0089] In the embodiment of the present application, the target parameters and the predicted parameters are compared to verify the correctness of the task execution and the parameter transfer function of the arbitration distributor of the task to be verified, and then determine the overall verification result of the arbitration distributor of the task to be verified.
[0090] In the embodiment of the present application, by adding the comparison of parameters in the task processing process, the error of parameter calculation generated in the task processing process can be immediately found, making the verification of the task arbitration distributor more comprehensive and greatly shortening the verification cycle. Through this verification method, once an error is found, the verification can be stopped immediately and the specific processing process can be located, which reduces the difficulty and complexity of problem location and makes the debugging process simpler.
[0091] Figure 2 A flowchart of another method of a verification task arbitration distributor provided in an embodiment of the present application. In the embodiment introduced by this figure, a more detailed description is provided for the implementation of the method of the verification task arbitration distributor.
[0092] like Figure 2 The method for verifying the task arbitration distributor shown includes the following steps:
[0093] S201. Define constraints on task parameters in a task request.
[0094] In the embodiment of the present application, the constraint condition includes a threshold range of the corresponding task parameter.
[0095] This step is to ensure that the task parameters generated in the test stimulus not only comply with basic data type constraints (such as 24-bit data should not exceed its representation range), but should also be able to be randomized within a reasonable area, especially within an area close to the boundary value, so as to more effectively discover potential boundary condition errors.
[0096] For example, a task request is to shrink the data. The specific operation is to multiply the data by 3 and then divide it by 4 before moving it. The data width is 40 bits. When the data is close to the bit width boundary, the data width after multiplication by 3 may reach 41 bits. Since the hardware bit width is only 40 bits, data overflow occurs, so the excess bit will be forcibly discarded, resulting in problems with the data after the shrinkage. Therefore, randomizing the task parameters in the area close to the boundary value can quickly discover such data boundary problems when facing big data testing.
[0097] In an exemplary implementation, the threshold range of each task parameter can be set based on the bit width of the data type. For example, the constraint condition of the 24-bit task parameter is set to 24'hFF_FFFF to 24'hFF_FFF0, which covers the upper boundary of the data.
[0098] S202: Randomly generate multiple task requests based on constraint conditions.
[0099] In the embodiment of the present application, the constraints defined in the previous step are parsed, and the task parameters in each task request are randomized based on the constraints. The randomized task parameters are combined into complete task requests, which contain task type identifiers and required task parameters.
[0100] Optionally, after the multiple task requests are generated, the multiple task requests may be validated to ensure that they meet all defined constraints.
[0101] Optionally, if there are task parameters in the task request that conflict with the constraint conditions, an error condition and the task parameters that conflict with the constraint conditions are reported.
[0102] S203: Allocate the multiple task requests to the multiple virtual channels to be arbitrated respectively.
[0103] In the embodiment of the present application, a plurality of virtual channels to be arbitrated are first defined, and these virtual channels are used to transmit different types of task requests. The number and type of the virtual channels to be arbitrated depend on the specific requirements and design of the system, and are not specifically limited here.
[0104] According to the types and other relevant attributes of the multiple task requests generated in the previous step, they are respectively configured into corresponding virtual channels to be arbitrated.
[0105] S204: Generate test stimulus.
[0106] Based on the multiple virtual channels to be arbitrated in the previous step, a test stimulus is generated.
[0107] S205: Generate a predicted virtual channel based on the test stimulus.
[0108] In the embodiment of the present application, based on the multiple virtual channels to be arbitrated corresponding to the numbers of the multiple virtual channels to be arbitrated in the test stimulus and the prior knowledge of the system, a predicted virtual channel arbitration result, i.e., a predicted virtual channel, is generated. The predicted virtual channel reflects the theoretical arbitration result of the system when it is not actually running.
[0109] In an example implementation, a simulated arbitration algorithm may be used or prediction may be made based on an arbitration strategy of the system (eg, priority queue, round-robin scheduling, etc.).
[0110] S206 , obtaining the number of input ports L of the arbitration distributor of the task to be verified, obtaining the total number N of virtual channels to be arbitrated in the test stimulus, and obtaining the maximum number M of virtual channels that can be arbitrated simultaneously by the arbitration distributor of the task to be verified.
[0111] In the embodiments of the present application, L, N and M are all positive integers.
[0112] The arbitration distributor of the task to be verified is designed with a fixed number of input ports L, which are used to receive data or requests from different virtual channels. Each input port is designed to be connected to a specific virtual channel, which determines the upper limit of the number of requests that the arbitration distributor of the task to be verified can receive. If the number of virtual channels to be arbitrated is greater than the number of ports of the arbitration distributor of the task to be verified, there will not be enough physical ports to receive the requests of all virtual channels to be arbitrated, which will cause design conflicts. Therefore, the total number of virtual channels to be arbitrated should be less than or equal to the number of ports of the arbitration distributor of the task to be verified, that is, N is less than or equal to L.
[0113] S207 , if N is greater than M, dividing the N virtual channels to be arbitrated into M groups of virtual channels to be arbitrated.
[0114] The number of virtual channels that the arbitration distributor for tasks to be verified can arbitrate simultaneously at the same time is limited. When the total number of virtual channels to be arbitrated exceeds this limit, the arbitration distributor for tasks to be verified cannot ensure that all virtual channels to be arbitrated can be effectively arbitrated, which will also slow down the verification process and reduce the verification efficiency.
[0115] Therefore, in an embodiment of the present application, when the total number N of virtual channels to be arbitrated is greater than the maximum number M of virtual channels that can be arbitrated simultaneously by the arbitration distributor of the task to be verified, the N virtual channels to be arbitrated are divided into M groups of virtual channel groups to be arbitrated, so that the arbitration distributor of the task to be verified can be verified later.
[0116] Optionally, each virtual channel group to be arbitrated is configured with an independent priority.
[0117] In an exemplary implementation, when the total number N of virtual channels to be arbitrated is less than or equal to the maximum number M of virtual channels that can be arbitrated simultaneously by the arbitration distributor of the task to be verified, grouping is not required.
[0118] S208 , sending the M groups of virtual channels to be arbitrated to the arbitration distributor of the tasks to be verified, and obtaining the target virtual channels arbitrated by the arbitration distributor of the tasks to be verified.
[0119] Optionally, arbitration of virtual channels can be achieved through the following steps: first, arbitration is performed according to the priority of the groups between the M groups of virtual channels to be arbitrated. When the priorities of all the groups are the same, the QoS of the virtual channels to be arbitrated in each group is determined. When the QoS is the same, the priority is determined according to the order_priority value. The larger the order_priority value, the higher the priority, and the smaller the order_priority value, the lower the priority.
[0120] In addition, the state of the output channel needs to be determined. If the output channel does not support the virtual channel, the virtual channel is excluded and the selection is performed again according to the above rules.
[0121] In the embodiment of the present application, M groups of virtual channels to be arbitrated are sent to the arbitration distributor for tasks to be verified, and the arbitration distributor for tasks to be verified arbitrates the M groups of virtual channels to be arbitrated and accepts the arbitration result returned by the arbitration distributor, which is the target virtual channel.
[0122] S209 , comparing the target virtual channel with the predicted virtual channel, and if the target virtual channel is the same as the predicted virtual channel, obtaining a target task request carried by the target virtual channel.
[0123] S210: Generate multiple prediction parameters generated in the process of processing the target task request according to the target task request.
[0124] S211 , receiving multiple target parameters generated by the to-be-verified task arbitration distributor in the process of processing the target task request one by one.
[0125] S212. Compare the target parameters and the predicted parameters to determine the verification results.
[0126] S209-S212 are implemented in substantially the same manner as S104-S107 in the method embodiment described above, and will not be elaborated here. For related technical implementations, reference may be made to the description of S104-S107 described above.
[0127] In the embodiment of the present application, by adding constraints on task parameters, the rationality and effectiveness of the test stimulus are ensured, so that the task parameters not only meet the basic data type constraints, but also are randomized in the area close to the boundary value, which can timely and effectively discover potential boundary condition problems. Combined with the comparative inspection of the parameters generated during the task processing, problems that occur in the task parameters during the calculation process can be discovered in advance, shortening the verification cycle and reducing debugging costs. At the same time, by dynamically grouping the virtual channels to be arbitrated, the verification of the arbitration distributors of the tasks to be verified with different requirements is realized, and the reusability of the verification environment is improved.
[0128] Optionally, step S210 includes determining a calculation rule for task parameters based on a task type identifier in the target task request and required task parameters; generating a prediction process for processing the target task request based on the calculation rule for task parameters; and generating prediction parameters generated when processing the prediction process.
[0129] The prediction process refers to a series of steps or operations constructed according to the calculation rules of task parameters, which are used to process or execute the target task request.
[0130] Optionally, step S212 includes if the target parameter and the predicted parameter are the same, the arbitration distributor of the task to be verified passes the verification; if the target parameter and the predicted parameter are different, there is an error in the task execution process of the arbitration distributor of the task to be verified, and the verification of the arbitration distributor of the task to be verified fails.
[0131] In an optional implementation of the technical solution of the present application, the method for verifying the task arbitration distributor further includes: if the target virtual channel is different from the predicted virtual channel, then there is an error in the arbitration part of the verification task arbitration distributor and the verification fails.
[0132] Optionally, after verification fails, inconsistent items and related information are recorded, and based on the recorded information, the cause of the error in the arbitration distributor of the task to be verified is analyzed.
[0133] During the verification of the task arbitration distributor, if the target parameters are inconsistent with the predicted parameters, or the target virtual channel is inconsistent with the predicted virtual channel, the verification will be judged as failed. Recording after verification failure is crucial for problem location and subsequent repair.
[0134] In the embodiment of the present application, the verification failure situation is divided into the following two scenarios.
[0135] Scenario 1: The target virtual channel is inconsistent with the predicted virtual channel.
[0136] For example, the predicted virtual channel is virtual channel A, and the target virtual channel is virtual channel B.
[0137] The inconsistent items are: the predicted virtual channel is virtual channel A, while the target virtual channel is virtual channel B.
[0138] The relevant information recorded includes:
[0139] Test stimulus details, including all virtual channels to be arbitrated and the task request information they carry;
[0140] The configuration of the task arbitration distributor to be verified, including the configuration that may affect the arbitration result;
[0141] System log: The system log of the arbitration distributor of the task to be verified when processing the test stimulus, containing detailed information about the arbitration process;
[0142] Timestamps, including the exact time when the validation failure occurred, can aid in subsequent analysis.
[0143] Scenario 2: The target parameters are inconsistent with the predicted parameters.
[0144] For example, the amount of data transferred in the target parameter is 20, and the amount of data transferred in the prediction parameter is 25.
[0145] The inconsistent items are: the amount of data moved in the prediction parameters is 25, while the amount of data moved in the target parameters is 20.
[0146] The relevant information recorded includes:
[0147] Task request details, including task type identifier and required task parameters;
[0148] The configuration of the task arbitration distributor to be verified, including the configuration that may affect the target parameters;
[0149] System log, the system log of the task arbitration distributor to be verified when executing the task request;
[0150] Timestamps, including the exact time when the validation failure occurred, can aid in subsequent analysis.
[0151] The reasons for verification failure may be algorithm logic errors, configuration problems, external dependency effects, etc. According to the analysis results, make corresponding code modifications, configuration adjustments, or external system optimizations. After the modification, re-execute the verification process to ensure that the problem has been resolved and the arbitration distributor of the task to be verified can work correctly.
[0152] In the technical solution of the present application, by adding constraints on task parameters, the rationality and effectiveness of the test stimulus are ensured, so that the task parameters not only meet the basic data type constraints, but also are randomized in the area close to the boundary value, which can timely and effectively discover potential boundary condition problems. By adding a comparative check on the parameters generated during the task processing, problems with the task parameters during the calculation process can be discovered in advance, shortening the verification cycle and reducing debugging costs. By dynamically grouping the virtual channels to be arbitrated, the verification of the arbitration distributors of the tasks to be verified with different requirements is realized, and the reusability of the verification environment is improved.
[0153] Based on the method for verifying a task arbitration distributor provided in the aforementioned embodiment, the present application also provides a device for verifying a task arbitration distributor. Figure 3 A schematic diagram of the structure of a verification task arbitration distributor provided by an embodiment of the present application. Figure 3As shown, the device of the verification task arbitration distributor includes:
[0154] The test stimulus generation module 301 is used to generate a test stimulus, wherein the test stimulus includes a plurality of task requests and numbers of a plurality of virtual channels to be arbitrated to which the plurality of task requests are respectively configured; the task request includes a task type identifier and required task parameters;
[0155] A predicted virtual channel module 302, configured to generate a predicted virtual channel based on the test stimulus;
[0156] The sending module 303 is used to send the test stimulus to the arbitration distributor of the task to be verified, and obtain the target virtual channel arbitrated by the arbitration distributor of the task to be verified;
[0157] A first comparison module 304 is used to compare the target virtual channel with the predicted virtual channel, and if the target virtual channel is the same as the predicted virtual channel, obtain a target task request carried by the target virtual channel;
[0158] A prediction parameter module 305, used to generate a plurality of prediction parameters generated in the process of processing the target task request according to the target task request;
[0159] A receiving module 306 is used to receive one by one a plurality of target parameters generated by the arbitration distributor of the task to be verified in the process of processing the target task request;
[0160] The second comparison module 307 is used to compare the target parameter with the predicted parameter to determine a verification result.
[0161] In the embodiment of the present application, the various modules in the device for verifying the task arbitration distributor work together to realize the comprehensive verification of the task arbitration distributor to be verified. Figure 4 Let’s explain this verification scenario in detail. Figure 4 A scenario diagram of a verification task arbitration distributor provided in an embodiment of the present application.
[0162] like Figure 4As shown, the device for verifying the task arbitration distributor first generates a test stimulus and sends it to the task arbitration distributor to be verified through a sending module. After receiving the test stimulus, the task arbitration distributor to be verified will select a target virtual channel according to its internal arbitration logic. The sending module receives the target virtual channel and compares it with the predicted virtual channel generated by the prediction virtual channel module through a first comparison module. When the target virtual channel is the same as the predicted virtual channel, the first comparison module obtains the task request on the virtual channel, and the task arbitration distributor to be verified processes the task request on the virtual channel. During the processing of the task request, the task arbitration distributor to be verified will generate a series of target parameters. The device for verifying the task arbitration distributor receives the target parameters generated by the task arbitration distributor to be verified one by one through the receiving module. At the same time, the prediction parameter module generates corresponding prediction parameters for comparison with the target parameters generated by the task arbitration distributor to be verified.
[0163] It can be seen that in the technical solution of this application, by adding the comparison of parameters in the task processing process, the parameter calculation errors generated in the task processing process can be immediately discovered, making the verification of the task arbitration distributor more comprehensive and greatly shortening the verification cycle. Through this verification method, once an error is found, the verification can be stopped immediately and the specific processing process can be located, which reduces the difficulty and complexity of problem location and makes the debugging process simpler.
[0164] Optionally, the sending module 303 includes:
[0165] A first acquisition module is used to acquire the number L of input ports of the arbitration distributor of the task to be verified, where L is a positive integer;
[0166] A second acquisition module is used to acquire a total number N of virtual channels to be arbitrated in the test stimulus, where N is a positive integer; wherein N is less than or equal to L;
[0167] A third acquisition module is used to obtain a maximum number M of virtual channels that can be arbitrated simultaneously by the arbitration distributor of the task to be verified, where M is a positive integer;
[0168] A grouping module, configured to group the N virtual channels to be arbitrated into M groups of virtual channel groups to be arbitrated if the N is greater than the M;
[0169] The virtual channel group sending module is used to send the M groups of virtual channel groups to be arbitrated to the arbitration distributor of the task to be verified, and obtain the target virtual channel arbitrated by the arbitration distributor of the task to be verified.
[0170] Optionally, the prediction parameter module 305 is specifically used to determine the calculation rules of the task parameters based on the task type identifier in the target task request and the required task parameters; generate a prediction process for processing the target task request based on the calculation rules of the task parameters; and generate prediction parameters generated when processing the prediction process.
[0171] Optionally, the second comparison module 307 is specifically used to compare the target parameter and the prediction parameter. If the target parameter and the prediction parameter are the same, the verification is successful; if the target parameter and the prediction parameter are different, the verification fails.
[0172] Optionally, the device for verifying the task arbitration distributor further includes:
[0173] A constraint module, used to define constraint conditions of task parameters in a task request; the constraint conditions include a threshold range of the task parameters;
[0174] A task request generation module, configured to randomly generate a plurality of task requests based on the constraint conditions; task parameters in the plurality of task requests are within the threshold range;
[0175] The configuration module is used to configure the multiple task requests to multiple virtual channels to be arbitrated respectively.
[0176] In addition, an embodiment of the present application also provides a server for verifying a task arbitration distributor, wherein the server includes a processor and a memory.
[0177] The memory is used to store computer program code and transmit the program code to the processor;
[0178] The processor is used to execute the steps of the method for verifying the task arbitration distributor introduced in any of the above method embodiments according to the instructions in the program code.
[0179] In addition, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the program is executed by a processor, the method of verifying the task arbitration distributor as described in any of the method embodiments is implemented.
[0180] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and server embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments. The device and server embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components indicated as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. A person of ordinary skill in the art can understand and implement it without paying creative labor.
[0181] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for verifying a task arbitration distributor, characterized in that: include: Generate a test stimulus, wherein the test stimulus includes a plurality of task requests and numbers of a plurality of virtual channels to be arbitrated to which the plurality of task requests are respectively configured; The task request includes a task type identifier and required task parameters; generating a predicted virtual channel based on the test stimulus; Sending the test stimulus to the arbitration distributor of the task to be verified to obtain the target virtual channel arbitrated by the arbitration distributor of the task to be verified; Comparing the target virtual channel with the predicted virtual channel, if the target virtual channel is the same as the predicted virtual channel, obtaining the target task request carried by the target virtual channel; Generate a plurality of prediction parameters generated in the process of processing the target task request according to the target task request; Receiving one by one a plurality of target parameters generated by the arbitration distributor of the task to be verified in the process of processing the target task request; The target parameter and the predicted parameter are compared to determine a verification result.
2. The method according to claim 1, characterized in that The step of sending the test stimulus to the arbitration distributor of the task to be verified to obtain the target virtual channel arbitrated by the arbitration distributor of the task to be verified includes: Obtain the number of input ports L of the arbitration distributor of the task to be verified, where L is a positive integer; Obtain a total number N of virtual channels to be arbitrated in the test stimulus, where N is a positive integer; wherein N is less than or equal to L; Obtain a maximum number M of virtual channels that can be arbitrated simultaneously by the arbitration distributor of the task to be verified, where M is a positive integer; If N is greater than M, the N virtual channels to be arbitrated are divided into M groups of virtual channel groups to be arbitrated; The M groups of virtual channels to be arbitrated are sent to the arbitration distributor for the task to be verified, and the target virtual channels arbitrated by the arbitration distributor for the task to be verified are obtained.
3. The method according to claim 1, characterized in that Before generating the test stimulus, the method further includes: Defining constraints on task parameters in the task request; the constraints include a threshold range of the task parameters; Randomly generate a plurality of task requests based on the constraint condition; task parameters in the plurality of task requests are within the threshold range; The multiple task requests are respectively configured into multiple virtual channels to be arbitrated.
4. The method according to claim 1, characterized in that: The generating, according to the target task request, a plurality of prediction parameters generated in the process of processing the target task request comprises: Determining a calculation rule for the task parameters according to the task type identifier in the target task request and the required task parameters; generating a prediction process for processing the target task request based on a calculation rule of the task parameter; Generate prediction parameters generated when processing the prediction process.
5. The method according to claim 1, characterized in that The comparing the target parameter with the predicted parameter to determine the verification result includes: If the target parameter is the same as the predicted parameter, the verification is successful; If the target parameter and the predicted parameter are different, the validation fails.
6. The method according to claim 1, characterized in that The method also includes failing verification if the target virtual channel is different from the predicted virtual channel.
7. A device for verifying a task arbitration distributor, characterized in that: include: A test stimulus generating module, used for generating a test stimulus, wherein the test stimulus includes a plurality of task requests and numbers of a plurality of virtual channels to be arbitrated to which the plurality of task requests are respectively configured; The task request includes a task type identifier and required task parameters; A predicted virtual channel module, used for generating a predicted virtual channel based on the test stimulus; A sending module, used for sending the test stimulus to the arbitration distributor of the task to be verified, and obtaining the target virtual channel arbitrated by the arbitration distributor of the task to be verified; A first comparison module, configured to compare the target virtual channel with the predicted virtual channel, and if the target virtual channel is the same as the predicted virtual channel, obtain a target task request carried by the target virtual channel; A prediction parameter module, used to generate a plurality of prediction parameters generated in the process of processing the target task request according to the target task request; A receiving module, used for receiving one by one a plurality of target parameters generated by the arbitration distributor of the task to be verified in the process of processing the target task request; The second comparison module is used to compare the target parameter with the predicted parameter to determine a verification result.
8. The device according to claim 7, characterized in that The sending module comprises: A first acquisition module is used to acquire the number L of input ports of the arbitration distributor of the task to be verified, where L is a positive integer; A second acquisition module is used to acquire a total number N of virtual channels to be arbitrated in the test stimulus, where N is a positive integer; wherein N is less than or equal to L; A third acquisition module is used to obtain a maximum number M of virtual channels that can be arbitrated simultaneously by the arbitration distributor of the task to be verified, where M is a positive integer; A grouping module, configured to group the N virtual channels to be arbitrated into M groups of virtual channel groups to be arbitrated if the N is greater than the M; The virtual channel group sending module is used to send the M groups of virtual channel groups to be arbitrated to the arbitration distributor of the task to be verified, and obtain the target virtual channel arbitrated by the arbitration distributor of the task to be verified.
9. A server for verifying a task arbitration distributor, characterized in that: The server comprises: a memory having a computer program stored thereon; A processor is used to execute the computer program in the memory to implement the steps of the method of the verification task arbitration distributor according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the verification task arbitration distributor method according to any one of claims 1 to 6 are implemented.