Software and hardware hybrid simulation method and device, equipment, storage medium and program product

Through the mixed simulation method of software and hardware, the command buffer is used to obtain and disassemble tasks, and distributed to the physical chip and C prototype for processing. This solves the problems of slow running speed and scarcity of resources in traditional chip IP driver application development, and achieves faster simulation. Speed ​​and earlier software development activities.

CN118690579APending Publication Date: 2024-09-24GLENFLY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411013104.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

In the process of driver application development for traditional chip IP, especially in terms of Windows HLK test suite and Linux VAAPI driver support, the pre-silicon built test environment runs too slowly, and simulator resources are scarce, which limits the progress of chip design.

Method used

Provides a hybrid software and hardware simulation method that obtains the updated command group from the command buffer, disassembles the tasks and distributes them to the previous generation physical chip and C prototype for processing, using the unchanged characteristics of the physical chip to accelerate testing, and the new features pass Quickly reproduce and debug C prototypes.

Benefits of technology

It significantly improves the simulation speed, shortens the pre-silicon software stack development cycle, enables software development activities to start earlier, covers more application test and development scenarios with high performance requirements, and simplifies debugging of the local environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690579A
    Figure CN118690579A
Patent Text Reader

Abstract

The invention relates to a software and hardware hybrid simulation method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: acquiring an updated command group from a command buffer area, wherein the command group comprises parameter configuration; disassembling the task according to the parameter configuration in the updated command group to obtain a disassembled task; according to different request characteristics, the disassembled tasks are distributed to the last-generation physical chip and the C prototype to be processed, and the request characteristics comprise the characteristics which are not changed compared with the characteristics of the last-generation physical chip and the characteristics which are newly added compared with the characteristics of the last-generation physical chip. Therefore, the development cycle of the pre-silicon software stack can be remarkably shortened, the software development activity can be started earlier, the software development can cover more application test development scenes with high performance requirements by advancing along with the architecture C prototype, the software development can also be deployed to the local environment, and debugging is more convenient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of chip simulation technology, and in particular to a software-hardware hybrid simulation method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] With the development of software simulation technology, simulation technology for chip development process has emerged. In the process of chip design and development, the earlier the system driver and application development is involved, the faster the stable and reliable products can be released after the chip is returned.

[0003] In traditional technology, in the software support process of a certain generation of chip IP (Intellectual Property, generally refers to the design of circuit modules with independent functions. In integrated circuit design, it also refers to verified, reusable integrated circuit modules with specific functions), if you want to explore the functional simulation of starting the corresponding driver and application development one step earlier, there are two ways to build a simulation environment before silicon: C Model (C prototype) and Emulator (simulator).

[0004] However, both methods have unavoidable difficulties when applied to system-level driver and application development testing. In short, according to the scenarios that the current chip IP needs to cover in the driver application development process, it can include: 1) Windows HLK test suite (Hardware Lab Kit), 2) Linux VAAPI (VideoAcceleration API, abbreviated as VA-API, video acceleration application program interface) driver support, 3) customized applications. Among them, for Windows HLK test suite and Linux VAAPI driver support, currently only a C prototype-based test environment can be built before silicon, and its running speed is too slow. For customized applications, although development, debugging and verification can be performed in the simulator environment. However, in the early stage of IP development, simulator resources are very scarce and costly, and they need to wait until the RTL (Register Transfer Level) code design verification is relatively mature before they can be used, which to a certain extent limits the progress of chip design implementation. Summary of the invention

[0005] Based on this, it is necessary to provide a simulation environment that can build a mixed function of the previous generation of physical hardware and C prototype to address the above technical problems, and provide a software and hardware hybrid simulation method, device, computer equipment, computer-readable storage medium and computer program product that can significantly improve the simulation speed.

[0006] In a first aspect, the present application provides a software-hardware hybrid simulation method, comprising:

[0007] Obtaining an updated command group from a command buffer, the command group comprising: parameter configuration;

[0008] Decomposing the task according to the parameter configuration in the updated command group to obtain the decomposed task;

[0009] The disassembled tasks are distributed to the previous generation physical chip and the C prototype for processing according to different request characteristics, wherein the request characteristics include: characteristics that are unchanged compared to the previous generation physical chip, and characteristics that are newly added compared to the previous generation physical chip.

[0010] In one of the embodiments, before obtaining the updated command group from the command buffer, the method further includes:

[0011] Recording relevant information of the command buffer in a register of the graphics processor, the relevant information including: any one or more of the command buffer address, the command buffer size, the current first address pointer, and the current last address pointer;

[0012] Whenever the driver requests a hardware operation, a command group is written into the command buffer, and the tail pointer register is updated to trigger a hardware instruction fetch action.

[0013] In one embodiment, obtaining an updated command group from a command buffer includes:

[0014] Monitoring the update of the command buffer tail pointer register in real time;

[0015] When the command buffer tail pointer register is updated, the command buffer is intercepted and scanned to obtain an updated command group from the command buffer.

[0016] In one of the embodiments, the command group further includes: any one or more of a running instruction and a synchronization instruction;

[0017] When the command group is an operation instruction or a synchronization instruction, the method further includes:

[0018] The operation instruction or synchronization instruction is distributed to the C prototype for processing.

[0019] In one embodiment, decomposing the task according to the parameter configuration in the updated command group to obtain the decomposed task includes:

[0020] According to the parameters in the updated command group, the task is decomposed into an input task, a processing task, and an output task.

[0021] In one embodiment, the distributing the disassembled tasks to the previous generation physical chip and the C prototype for processing according to different request characteristics includes:

[0022] The input tasks, processing tasks, and output tasks are respectively distributed to the previous generation physical chip, and / or C prototype processing.

[0023] In one embodiment, the method further comprises:

[0024] After the task distribution is completed, the command group in the command buffer is modified.

[0025] In a second aspect, the present application also provides a software-hardware hybrid simulation device, comprising:

[0026] A command group acquisition module is used to acquire an updated command group from a command buffer, wherein the command group includes: parameter configuration;

[0027] A task disassembly module, used to disassemble the task according to the parameter configuration in the updated command group to obtain the disassembled task;

[0028] The task distribution module is used to distribute the disassembled tasks to the previous generation physical chip and C prototype for processing according to different request characteristics, wherein the request characteristics include: characteristics that are unchanged compared with the previous generation physical chip, and characteristics that are newly added compared with the previous generation physical chip.

[0029] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0030] Obtaining an updated command group from a command buffer, the command group comprising: parameter configuration;

[0031] Decomposing the task according to the parameter configuration in the updated command group to obtain the decomposed task;

[0032] The disassembled tasks are distributed to the previous generation physical chip and the C prototype for processing according to different request characteristics, wherein the request characteristics include: characteristics that are unchanged compared to the previous generation physical chip, and characteristics that are newly added compared to the previous generation physical chip.

[0033] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0034] Obtaining an updated command group from a command buffer, the command group comprising: parameter configuration;

[0035] Decomposing the task according to the parameter configuration in the updated command group to obtain the decomposed task;

[0036] The disassembled tasks are distributed to the previous generation physical chip and the C prototype for processing according to different request characteristics, wherein the request characteristics include: characteristics that are unchanged compared to the previous generation physical chip, and characteristics that are newly added compared to the previous generation physical chip.

[0037] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0038] Obtaining an updated command group from a command buffer, the command group comprising: parameter configuration;

[0039] Decomposing the task according to the parameter configuration in the updated command group to obtain the decomposed task;

[0040] The disassembled tasks are distributed to the previous generation physical chip and the C prototype for processing according to different request characteristics, wherein the request characteristics include: characteristics that are unchanged compared to the previous generation physical chip, and characteristics that are newly added compared to the previous generation physical chip.

[0041] The above-mentioned software and hardware hybrid simulation method, device, computer equipment, computer-readable storage medium and computer program product obtain an updated command group from the command buffer, and the command group includes: parameter configuration; so that the update of the command group can be monitored. The task is disassembled according to the parameter configuration in the updated command group to obtain the disassembled task; so that the task can be disassembled according to the updated command group, so as to facilitate the subsequent distribution and scheduling of the task and improve the speed of task execution. According to different request characteristics, the disassembled task is distributed to the previous generation physical chip and C prototype for processing, wherein the request characteristics include: characteristics that have not been changed compared to the previous generation physical chip, and new characteristics compared to the previous generation physical chip. Therefore, the previous generation physical chip can be fully utilized, and some of the unchanged characteristics can be transferred to the previous generation physical chip for operation, thereby improving the test speed. For the new characteristics, the C prototype can be used to process them, and the new characteristics can be quickly reproduced and debugged, so that the pre-silicon software stack development cycle can be significantly shortened, so that software development activities can start earlier, and advance with the architecture C prototype, which can cover more application test development scenarios with higher performance requirements, and can also be deployed to the local environment, which is more convenient for debugging. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions 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 related drawings can be obtained based on these drawings without paying creative work.

[0043] FIG1 is a schematic diagram of a chip design and development process in one embodiment;

[0044] FIG2 is a schematic diagram of a pre-silicon driver development environment in one embodiment;

[0045] FIG3 is a schematic diagram showing a principle of an implementation method of a simulation device in one embodiment;

[0046] FIG4 is a schematic diagram of a flow chart of a software-hardware hybrid simulation method in one embodiment;

[0047] FIG5 is a schematic diagram of the implementation principle of a command buffer in one embodiment;

[0048] FIG6 is a schematic diagram of the entire process of an image processing IP in one embodiment;

[0049] FIG7 is a schematic diagram of task decomposition for input formats in one embodiment;

[0050] FIG8 is a schematic diagram of task decomposition for image processing characteristics in one embodiment;

[0051] FIG9 is a schematic diagram 1 of task decomposition in one embodiment;

[0052] FIG10 is a second schematic diagram of task decomposition in one embodiment;

[0053] FIG11 is a schematic diagram of a flow chart of a software-hardware hybrid simulation method in another embodiment;

[0054] FIG12 is a schematic diagram of a flow chart of command scheduling in a simulation device module in one embodiment;

[0055] FIG13 is a block diagram of a software-hardware hybrid simulation device according to an embodiment;

[0056] FIG. 14 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0058] Generally speaking, in the chip design and development process, the earlier the software team intervenes in system driver and application development, the faster a stable and reliable product can be released after the chip is returned. However, usually before the chip is returned, software development activities are limited to the functional simulation environment and can only perform limited iterations. This also means that most system-level development and debugging work must wait until the chip is returned. In response to this problem, the hardware-software hybrid simulation method provided in the embodiment of the present application can push the software development process forward, that is, intervene in the modeling / implementation / verification / integration stage, for example, it is applied to the chip design and development process shown in Figure 1. If a complete system-level driver integration and application development are performed before silicon, the delivery cycle can be greatly shortened after the chip is returned.

[0059] Exemplarily, FIG2 shows a schematic diagram of a pre-silicon driver development environment. As shown in FIG2, the driver and application are run on a virtual machine, and all requests for virtual hardware are processed by the C prototype in the virtual machine process. In order to further illustrate the difference between the solution in this embodiment and the existing solution, the implementation method of the simulation device is shown in FIG3. As shown in FIG3, in the existing solution, the instruction forwarding module forwards all access requests of the operating system to the simulation device to the device C prototype to realize functional simulation, and the interrupt processing module realizes interrupt simulation. In the solution in the embodiment of the present application, a new instruction reorganization module is added, and the features that can be realized by the previous generation of physical hardware are forwarded to the physical hardware driver (GX) for implementation, and the new features of the current generation of chips are forwarded to the current C prototype (GY) for implementation, so as to achieve the purpose of acceleration. Wherein, GX represents the physical hardware driver of the Xth generation IP, GY represents the C prototype of the Yth generation IP, X, Y are positive integers, and X is a positive integer less than Y.

[0060] In an exemplary embodiment, as shown in FIG4 , a software-hardware hybrid simulation method is provided, and the method is applied to the development environment shown in FIG2 , wherein an instruction reorganization module is added to the virtual machine simulation device part, which may include the following steps:

[0061] Step 401: Get an updated command group from the command buffer.

[0062] The implementation principle of the command buffer in this embodiment is shown in Figure 5. First, the driver maintains a ring command buffer for recording command buffer related information in the GPU (Graphics Processing Unit) register. Therefore, the updated command group can be obtained from the command buffer.

[0063] Exemplarily, the update of the command buffer tail pointer register may be monitored in real time; when the command buffer tail pointer register is updated, the command buffer is intercepted and scanned to obtain an updated command group from the command buffer.

[0064] In an optional implementation, before implementing step 401, the relevant information of the command buffer may be recorded in a register of the graphics processor, wherein the relevant information includes: any one or more of the command buffer address, the command buffer size, the current first address pointer, and the current tail address pointer. Whenever the driver requests a hardware operation, a command group is written to the command buffer, and the tail pointer register is updated to trigger the hardware instruction fetching action. Each command group contains all the register configurations related to an operation, as well as synchronization information, etc.

[0065] In another optional implementation, the command group further includes: any one or more of an operation instruction and a synchronization instruction; when the command group is an operation instruction or a synchronization instruction, the method further includes: distributing the operation instruction or the synchronization instruction to the C prototype for processing. As shown in FIG3 and FIG5, the newly added instruction reorganization module only distributes algorithm tasks with high processor load, and the operation instruction, synchronization instruction, etc. are still executed by the C prototype, thereby effectively simplifying the processing process.

[0066] Step 402: Decompose the task according to the parameter configuration in the updated command group to obtain the decomposed task.

[0067] In this embodiment, the task may be decomposed into an input task, a processing task, and an output task according to the parameters in the updated command group.

[0068] For example, as shown in Figure 6, the entire process of image processing IP can be divided into three parts. In the figure, Load represents image loading, which is used to load input images and load image data into the internal buffer in a specified format; Store represents image output, which is used to save output images and write image data to the memory in a specified format; P0~PN represents image processing, that is, pixel processing modules, which can be turned on or off through the enable bit in the register configuration. Since P0~PN may contain multiple different image processing features, P0~PN can also be split, with part of them distributed to the previous generation physical chip for processing and part of them distributed to the C prototype for processing.

[0069] Exemplarily, for the input format, as shown in FIG7 , if the input format of the task is not a format supported by the previous generation physical chip, the C prototype first converts the format of the input image into a common intermediate image format (such as BGRA format), and then the previous generation physical chip performs the image loading operation. If the input format of the task is a format supported by the previous generation physical chip, there is no need for the C prototype to convert the format of the input image, and the image loading operation is performed directly by the previous generation physical chip. Referring to FIG7 , the C prototype first loads the image (Load*). Since only the input format is not supported, the C prototype performs the format conversion here (the actual image loading process is performed by the previous generation physical chip), and then stores it in the memory. All subsequent steps are performed by the physical chip (Load, P0~PN, Store).

[0070] For example, for image processing characteristics, as shown in Figure 8, the tasks are split and reorganized according to the C prototype design of the current generation chip and the support of the previous generation physical chip, and sent to the C prototype and physical chip for processing respectively; if the pixel processing modules are all in the transparent state, it will directly degenerate to only C prototype processing. Referring to Figure 8, the C prototype first loads the image and processes part of the image (Load, P0, P1*), stores the processing results in the memory, and all subsequent steps are executed by the physical chip (Load, P2~PN, Store).

[0071] It should be noted that for the specific characteristics of the P0~PN modules, it is also necessary to consider whether the execution order has dependencies and then split them reasonably.

[0072] Exemplarily, for the output format, the processing flow is similar to that of the input format. If the output format is not a format supported by the previous generation physical chip, the processing result is output to the target address through the C prototype. If the output format is a format supported by the previous generation physical chip, the image output operation is directly performed by the previous generation physical chip.

[0073] In an optional embodiment, if the input format and output format of the task are not formats supported by the previous generation physical chip, and the task contains image processing features that are not supported by the previous generation physical chip, the task is decomposed into a first subtask, a second subtask, and a third subtask. The first subtask is used to instruct the C prototype to convert the input format into a format supported by the previous generation physical chip, and then the previous generation physical chip performs an image loading operation; the second subtask is used to instruct the C prototype and the previous generation physical chip to perform image processing operations respectively; the third subtask is used to instruct the previous generation physical chip to perform an image output operation, and then the C prototype converts the output image into a format.

[0074] In this embodiment, all tasks can be decomposed into up to three subtasks according to the newly added features of the current generation IP design. For example, when the input and output of a task are both in formats not supported by the previous generation physical chip and contain image processing features not supported by the previous generation physical chip, the entire task needs to be split into three parts. As shown in Figure 9, the C prototype and the previous generation physical chip are involved in the three stages of image loading, image processing, and image output.

[0075] It should be noted that for this more complex situation, decisions can also be made based on the actual running scenario to determine whether the task should fall back to running entirely on the C prototype.

[0076] In another optional embodiment, if the input format of the task is a format supported by the previous generation physical chip, the output format of the task is not a format supported by the previous generation physical chip, and the task contains image processing features not supported by the previous generation physical chip, the task is decomposed into a fourth subtask and a third subtask; the fourth subtask is used to instruct the previous generation physical chip to perform image loading and image processing operations, and then the C prototype continues to perform image processing operations.

[0077] In another optional embodiment, if the input format of the task is not a format supported by the previous generation physical chip, the output format of the task is a format supported by the previous generation physical chip, and the task includes image processing features not supported by the previous generation physical chip, then the task is decomposed into a first subtask and a fifth subtask; the fifth subtask is used to instruct the previous generation physical chip to perform image output operations after the C prototype and the previous generation physical chip respectively perform image processing operations.

[0078] In this embodiment, if the input or output formats are formats supported by the previous generation of physical hardware, the two stages of input format and image processing can be merged, or the two stages of image processing and image output can be merged, thereby degenerating into a number of subtasks.

[0079] For example, as shown in FIG10 , in the fourth optional implementation, if the input format and output format of the task are both formats supported by the previous generation physical chip, and the task does not include image processing features that are not supported by the previous generation physical chip, the task is not disassembled and is directly used as the sixth subtask. It should be noted that the fourth optional implementation is the most common in actual applications.

[0080] Therefore, making full use of the previous generation of physical chips and disassembling the tasks of the current command group and distributing them to the previous generation of physical chips and / or C prototypes for processing can greatly improve the test speed.

[0081] Step 403, according to different request characteristics, the disassembled tasks are distributed to the previous generation physical chip and the C prototype for processing.

[0082] In this embodiment, the requested features can be roughly divided into two categories: one is the features that have not been changed compared to the previous generation of physical chips, and the other is the features that have been newly added compared to the previous generation of physical chips. Tasks containing unchanged features are distributed to the previous generation of physical chips for processing, and tasks containing newly added features are distributed to the C prototype for processing.

[0083] In combination with the optional embodiment in step 402, the input task, processing task, and output task can be distributed to the previous generation physical chip, and / or C prototype processing respectively (this embodiment does not limit the distribution order of each execution process in the task, and can be adjusted according to the actual scenario).

[0084] It should be noted that the embodiments of the present application do not limit the specific method and quantity of task splitting. When distributing tasks, the sub-tasks can be further decomposed (for example, phased splitting according to different execution objects) and then distributed to the previous generation of physical chips and contemporary C prototypes for processing.

[0085] In the above-mentioned software and hardware hybrid simulation method, by obtaining an updated command group from the command buffer, the command group includes: parameter configuration; so that the update of the command group can be monitored. According to the parameter configuration in the updated command group, the task is disassembled to obtain the disassembled task; so that the task can be disassembled according to the updated command group, so as to facilitate the subsequent distribution and scheduling of the task and improve the speed of task execution. According to different request characteristics, the disassembled task is distributed to the previous generation physical chip and C prototype for processing, wherein the request characteristics include: characteristics that have not been changed compared to the previous generation physical chip, and new characteristics compared to the previous generation physical chip. Therefore, the previous generation physical chip can be fully utilized, and the unchanged part of the characteristics can be transferred to the previous generation physical chip for operation, thereby improving the test speed. For the new characteristics, the C prototype can be used to process the new characteristics, so as to achieve rapid reproduction and debugging of the new characteristics, thereby significantly shortening the pre-silicon software stack development cycle, so that software development activities can start earlier, and advance with the architecture C prototype, which can cover more application test development scenarios with higher performance requirements, and can also be deployed to the local environment, which is more convenient for debugging.

[0086] In another exemplary embodiment, as shown in FIG11 , the following steps may be included:

[0087] Step 1101, obtaining an updated command group from the command buffer.

[0088] Step 1102, decompose the task according to the parameter configuration in the updated command group to obtain the decomposed task.

[0089] Step 1103, distribute the disassembled tasks to the previous generation physical chip and C prototype for processing according to different request characteristics.

[0090] In this embodiment, for the specific implementation process and technical effects of steps 1101 to 1103, please refer to the relevant descriptions of steps 401 to 403 in the embodiment shown in FIG. 4 , which will not be repeated here.

[0091] Step 1104: after the task distribution is completed, modify the command group in the command buffer.

[0092] In this embodiment, the task is reorganized according to the parameter configuration in the command group, and after analysis and disassembly, it is dispatched to the previous generation physical hardware and the current generation C prototype for processing. After completion, the result will be written back to the target address; at this time, the command group in the buffer is modified in situ (that is, the subtasks that have been unloaded to the previous generation physical chip or completed in the C prototype in the channel of this task are eliminated), and then the tail pointer register update action is sent to the instruction forwarding module. In this way, a loop can be realized, and the cache is released as soon as possible to facilitate the update of the next detection command group.

[0093] In another exemplary embodiment, as shown in FIG. 12 , a process of command scheduling in a simulation device module is shown, which may include the following steps:

[0094] Step 1201, access the register.

[0095] Step 1202, determine whether to write the tail pointer register, if so, execute step 1203, if not, execute step 1207.

[0096] Step 1203, scan the command group reorganization task.

[0097] Step 1204, task analysis and decomposition.

[0098] Step 1205, schedule the hardware driver to run.

[0099] Step 1206, hot update command group parameters.

[0100] Step 1207, forward to C prototype.

[0101] Step 1208, determine whether the interrupt needs to be returned, if so, execute step 1209, if not, execute step 1210.

[0102] Step 1209, interrupt response.

[0103] Step 1210, return.

[0104] In this embodiment, step 1201 to step 1210 is the process of command scheduling in the simulation device module. First, the register is accessed to determine whether there is an update to the tail pointer register (write a new tail pointer). If there is an update to the tail pointer register, the hardware instruction fetch action is triggered, and the command group is scanned to reorganize the task. The task is disassembled through the parameter configuration in the command group to obtain the disassembled task. Then, according to different request characteristics, the disassembled task is distributed to the previous generation physical chip and C prototype processing (that is, scheduling different hardware drivers). Finally, taking the task distributed to the C prototype processing as an example, the task containing the newly added features is forwarded to the C prototype. The subsequent processing flow of the C prototype is consistent with the existing C prototype processing flow, which will not be repeated here.

[0105] For example, in the current generation of chip design, the new features of IP include:

[0106] 1) New format support, including support for new input formats and new output formats:

[0107] The support for the newly added input formats is mainly used in some software decoding scenarios. After being converted from IP to BGRA, it is sent to the display module. For processing tasks with these input formats, the tasks can be split as follows:

[0108] a) For C prototype: input YV12 (new format example) frame, output BGRA frame (format conversion only);

[0109] b) For previous generation physical chips: input BGRA frames, enable other features requested by the driver, including scaling, color adjustment, etc., and then output BGRA frames.

[0110] Support for new output formats is mainly used in AI or customer-customized scenarios. For processing tasks with these output formats, the tasks can be split as follows:

[0111] a) For the previous generation of physical chips: input decoded video frames, enable all features requested by the driver, and output BGRA frames;

[0112] b) For C prototype: Input BGRA frame, output target format requested by the driver (format conversion only).

[0113] 2) Compression support: The current chip has added a new compression method for certain (Linear) formats, which can be processed according to the new format.

[0114] 3) Feature support: A new pixel processing module is added for some scenarios that require image sharpening and noise reduction. For tasks with these feature requests, the tasks can be split as follows:

[0115] a) For the previous generation of physical chips: input the decoded frame, enable the modules supported by the previous generation of physical hardware in all features requested by the driver, and output the BGRA frame;

[0116] b) For C prototype: C prototype: Input BGRA frame, enable unprocessed modules in all features requested by the driver, and output target format.

[0117] Exemplarily, the application effect of the method of the above embodiment of the present application in the above test environment is as follows:

[0118] For the Windows HLK test suite, it has not been implemented yet. According to the evaluation of the actual test content of HLK, most of them can be transferred to the previous generation of physical hardware to run, which can greatly reduce the test time. For new features, they can also be reproduced and debugged faster.

[0119] Regarding Linux VAAPI driver support, similar to Windows HLK, most content can be transferred to run on the previous generation of physical hardware. For support of new formats, the single-frame running time is also greatly reduced.

[0120] For some video frame processing applications with high CPU load (DI), the original C prototype-based test environment took minutes per frame (720x480). Now it can be completely transferred to physical hardware for processing, and the output results can be compared with the C prototype results of the current IP for "bit match", which provides good support for the subsequent construction of automated test tasks.

[0121] For customized applications, for example, one of the scenarios in the application currently being debugged is that a frame of 1080p video is scaled to 360p through IP. The running time on the C prototype is 14s, and after being disassembled and combined into the C prototype + physical hardware, the running time is 9s, and the running speed is significantly improved.

[0122] In summary, this embodiment can significantly shorten the pre-silicon software stack development cycle, so that software development activities can start earlier and advance along with the architecture C prototype. It can cover more application test development scenarios with higher performance requirements, and can also be deployed to the local environment for easier debugging.

[0123] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0124] Based on the same inventive concept, the embodiment of the present application also provides a software-hardware hybrid simulation device for implementing the software-hardware hybrid simulation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more software-hardware hybrid simulation device embodiments provided below can refer to the limitations of the software-hardware hybrid simulation method above, and will not be repeated here.

[0125] In an exemplary embodiment, as shown in FIG13 , a software-hardware hybrid simulation device is provided, including: a command group acquisition module 1301, a task decomposition module 1302 and a task distribution module 1303, wherein:

[0126] The command group acquisition module 1301 is used to acquire an updated command group from a command buffer, wherein the command group includes: parameter configuration;

[0127] The task decomposition module 1302 is used to decompose the task according to the parameter configuration in the updated command group to obtain the decomposed task;

[0128] The task distribution module 1303 is used to distribute the disassembled tasks to the previous generation physical chip and C prototype for processing according to different request characteristics, wherein the request characteristics include: characteristics that are unchanged compared to the previous generation physical chip, and characteristics that are newly added compared to the previous generation physical chip.

[0129] Exemplarily, the above-mentioned device may also include: a command buffer module 1204, which is used to record relevant information of the command buffer in a register of the graphics processor before obtaining an updated command group from the command buffer, and the relevant information includes: any one or more of the command buffer address, command buffer size, current first address pointer, and current tail address pointer; whenever the driver requests a hardware operation, a command group is written to the command buffer, and the tail pointer register is updated to trigger the hardware instruction fetching action.

[0130] Exemplarily, the command group acquisition module 1301 is specifically used to: monitor the update of the command buffer tail pointer register in real time; when the command buffer tail pointer register is updated, intercept and scan the command buffer to obtain the updated command group from the command buffer.

[0131] Exemplarily, the command group further includes: any one or more of an operation instruction and a synchronization instruction; when the command group is an operation instruction or a synchronization instruction, the task distribution module 1303 is further used to:

[0132] The operation instruction or synchronization instruction is distributed to the C prototype for processing.

[0133] Exemplarily, the task decomposition module 1302 is specifically used to decompose the task into an input task, a processing task, and an output task according to the parameters in the updated command group.

[0134] Exemplarily, the task distribution module 1303 is specifically used to distribute the input task, processing task, and output task to the previous generation physical chip, and / or C prototype processing respectively.

[0135] Exemplarily, the above-mentioned apparatus may further include: a modification module 1305, configured to modify the command group in the command buffer after the task distribution is completed.

[0136] Each module in the above-mentioned software-hardware hybrid simulation device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0137] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG14. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a software and hardware hybrid simulation method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0138] Those skilled in the art will understand that the structure shown in FIG. 14 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0139] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0140] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0141] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0142] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0143] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0144] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0145] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A software and hardware hybrid simulation method, It is characterized in that The method comprises: Obtaining an updated command group from a command buffer, the command group comprising: parameter configuration; Decomposing the task according to the parameter configuration in the updated command group to obtain the decomposed task; The disassembled tasks are distributed to the previous generation physical chip and the C prototype for processing according to different request characteristics, wherein the request characteristics include: characteristics that are unchanged compared to the previous generation physical chip, and characteristics that are newly added compared to the previous generation physical chip.

2. The method according to claim 1, It is characterized in that Before obtaining the updated command group from the command buffer, the method further includes: Recording relevant information of the command buffer in a register of the graphics processor, the relevant information including: any one or more of the command buffer address, the command buffer size, the current first address pointer, and the current last address pointer; Whenever the driver requests a hardware operation, a command group is written into the command buffer, and the tail pointer register is updated to trigger a hardware instruction fetch action.

3. The method according to claim 2, It is characterized in that The command group for obtaining an update from the command buffer includes: Monitoring the update of the command buffer tail pointer register in real time; When the command buffer tail pointer register is updated, the command buffer is intercepted and scanned to obtain an updated command group from the command buffer.

4. The method according to claim 1, It is characterized in that The command group also includes: any one or more of running instructions and synchronization instructions; When the command group is an operation instruction or a synchronization instruction, the method further includes: The operation instruction or synchronization instruction is distributed to the C prototype for processing.

5. The method according to claim 1, It is characterized in that The step of disassembling the task according to the parameter configuration in the updated command group to obtain the disassembled task includes: According to the parameters in the updated command group, the task is decomposed into an input task, a processing task, and an output task.

6. The method according to claim 5, It is characterized in that The distributing the disassembled tasks to the previous generation physical chip and the C prototype for processing according to different request characteristics includes: The input tasks, processing tasks, and output tasks are respectively distributed to the previous generation physical chip, and / or C prototype processing.

7. The method according to any one of claims 1 to 6, It is characterized in that The method further comprises: After the task distribution is completed, the command group in the command buffer is modified.

8. A software and hardware hybrid simulation device, It is characterized in that The device comprises: A command group acquisition module is used to acquire an updated command group from a command buffer, wherein the command group includes: parameter configuration; A task disassembly module, used to disassemble the task according to the parameter configuration in the updated command group to obtain the disassembled task; The task distribution module is used to distribute the disassembled tasks to the previous generation physical chip and C prototype for processing according to different request characteristics, wherein the request characteristics include: characteristics that are unchanged compared with the previous generation physical chip, and characteristics that are newly added compared with the previous generation physical chip.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.