GPU instruction processing front-end simulation device, system and method and storage medium

By simplifying hardware design modeling and using functional concept modules, the problem of model complexity and coupling in front-end simulation of GPU instruction processing is solved, efficient and real-time simulation and feedback are achieved, and development efficiency and operating performance are improved.

CN118860495APending Publication Date: 2024-10-29MOORE THREADS TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410903211.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

In the existing technology, GPU instruction processing front-end simulation based on ESL modeling has problems such as high model complexity, low development and design efficiency, strong coupling between modules, and low operating efficiency, making it difficult to provide real-time feedback and efficient simulation for software developers.

Method used

A GPU instruction processing front-end simulation device is designed, including a startup processing module and an instruction processing module. By simplifying the hardware design modeling process, modules based on functional concepts are used to replace traditional hardware modules, eliminating synchronization dependencies between hardware modules and providing lightweight level model to achieve high cohesion and low coupling, and record and present key operational information in real time.

Benefits of technology

It significantly improves development efficiency and maintenance convenience, reduces debugging difficulty and time costs, improves simulation speed and operating efficiency, and provides efficient lightweight models and real-time feedback interfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118860495A_ABST
    Figure CN118860495A_ABST
Patent Text Reader

Abstract

The invention relates to a GPU instruction processing front-end simulation device, system and method and a storage medium. The device is characterized in that a start processing module obtains first information from a register simulation module under the condition that a start signal is detected, resets a rendering state table according to the first information, and sends second information which is generated according to the first information and has a preset structure to an instruction processing module; the instruction processing module obtains the target instructions from the GPU virtual video memory according to the second information, decodes the target instructions and then sequentially sends the target instructions to the GPU assembly line simulation module, so that the GPU assembly line simulation module sequentially executes the received instructions; the starting signal is used for indicating that the register simulation module has completed configuration, the first information comprises information related to execution of the target instruction, and the second information comprises storage information which is arranged according to a preset structure and related to execution of the target instruction. The device is high in operation efficiency, small in coupling degree between modules, and convenient to expand and update.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a GPU instruction processing front-end simulation device, system, method and storage medium. Background Art

[0002] In the early stages of graphics processing unit (GPU) design, software modeling is essential for verifying the functionality and performance of the GPU. This process not only allows for a preliminary evaluation of the potential performance of the GPU, but also provides software developers with an early development platform through a simulation environment. This approach promotes parallel development across multiple departments and accelerates the progress of the entire project. In the GPU modeling process, it is essential to provide a complete GPU model that meets design standards. This enables the parsing of compliant data passed through the PCIE interface in the virtual machine. In this process, accurate modeling of the entire GPU pipeline (including the instruction processing front end) is particularly critical. The simulation speed of the pipeline algorithm architecture (PipelineArchitecture) directly affects the progress of software development. This process is often referred to as "Electronic System Level (ESL) modeling".

[0003] The instruction processing front end of the GPU refers to the module that exchanges data between the GPU core and the firmware. It is mainly responsible for extracting instructions issued by the driver from the video memory, decoding, counting primitive information, and triggering pipeline processing. However, in related technologies, the method of simulating the instruction processing front end of the GPU based on ESL modeling has problems such as high model complexity, low development and design, and low operating efficiency. Summary of the invention

[0004] In view of this, the present disclosure proposes a GPU instruction processing front-end simulation device, system, method and storage medium.

[0005] According to one aspect of the present disclosure, a GPU instruction processing front-end simulation device is provided, the device comprising:

[0006] A startup processing module, configured to obtain first information from the register simulation module when a startup signal is detected, reset the rendering state table according to the first information, and send second information with a preset structure generated according to the first information to the instruction processing module;

[0007] An instruction processing module, used for acquiring each target instruction to be executed from the GPU virtual video memory according to the second information, and decoding each target instruction and sending it to the GPU pipeline simulation module in sequence, so that the GPU pipeline simulation module executes each received instruction in sequence;

[0008] The first information includes information related to the execution of the target instruction, the second information includes storage information related to the execution of the target instruction arranged according to the preset structure, and the start signal is used to indicate that the register simulation module has completed configuration.

[0009] In a possible implementation, the register simulation module includes a plurality of virtual registers.

[0010] The startup processing module is used to monitor a first virtual register among the multiple virtual registers, and determine that the startup signal is detected when it is determined that the first virtual register is written with a target value.

[0011] In a possible implementation, the startup processing module is used to obtain the first information from each of the virtual registers of the register simulation module;

[0012] Among them, the first information includes at least one state information for resetting the rendering state table, the first address information of the instruction cache space storing the target instruction in the GPU virtual video memory, the first length of the instruction cache space, the second address information of the primitive cache space storing the primitive information in the GPU virtual video memory, and the second length of the primitive cache space; the second information includes the first address information, the first length, the second address information, the second length and the third address information of the rendering state table.

[0013] In a possible implementation manner, the first address information and the second address information include a first address, and the third address information includes a pointer to the rendering status table.

[0014] In a possible implementation, the instruction processing module includes: an instruction decoding unit, an instruction pool, and a serialization output unit.

[0015] The instruction decoding unit is used to parse the received second information based on the preset structure, obtain the target instruction from the instruction cache space of the GPU virtual display memory based on the parsing result and store it in the instruction pool, and then sequentially obtain and decode each of the target instructions from the instruction pool, and send the decoded instructions to the serialization output unit and the log unit, and send the third address information in the parsing result to the serialization output unit;

[0016] The serialization output unit is used to send the third address information to the GPU pipeline simulation module, and to store the received decoded instructions in a serialization queue in sequence, and to send the decoded instructions in the serialization queue to the GPU pipeline simulation module in sequence when the GPU pipeline simulation module is in an idle state, so that the GPU pipeline simulation module obtains the rendering state table based on the third address information and executes the received decoded instructions based on the rendering state table.

[0017] In one possible implementation, the log unit is used to set a corresponding operator for each decoded instruction according to the instruction type and then connect to a log system, so that the log system can respond to user requests and print and display relevant information of the decoded instruction based on the operator overload function indicated by the operator of each decoded instruction. The operators corresponding to decoded instructions of different instruction types are different.

[0018] In a possible implementation, the instruction processing module further includes a primitive pool.

[0019] The instruction decoding unit is further configured to, when determining that the decoded instruction requires primitive information, obtain corresponding target primitive information from the primitive cache space of the GPU virtual display memory based on the offset address information of the required primitive information indicated by the decoded instruction and the second address information, mark the target primitive information with an identifier of the decoded instruction requiring the target primitive information, and store the marked target primitive information in the primitive pool;

[0020] The serialized output unit is also used to obtain corresponding target primitive information from the primitive pool according to the identifier of the decoded instruction when it is determined that the decoded instruction requires primitive information, so as to synchronously send the corresponding target primitive information when sending the decoded instruction to the GPU pipeline simulation module.

[0021] In a possible implementation manner, the device further includes: at least one module among the GPU virtual display memory, the register simulation module and the GPU pipeline simulation module.

[0022] According to another aspect of the present disclosure, a GPU instruction processing front-end simulation system is provided, the system comprising: a firmware simulation module, a GPU virtual display memory, a register simulation module, a GPU pipeline simulation module and a GPU instruction processing front-end simulation device, the GPU instruction processing front-end simulation device comprising a startup processing module and an instruction processing module;

[0023] The firmware simulation module is used to store the target instruction in the GPU virtual display memory and configure the register simulation module when receiving the target instruction;

[0024] The startup processing module is used to monitor the register simulation module and, when a startup signal is detected, obtain first information from the register simulation module, reset the rendering state table according to the first information, and send second information with a preset structure generated according to the first information to the instruction processing module;

[0025] The command processing module is used to obtain each target instruction to be executed from the GPU virtual video memory according to the second information, and decode each target instruction and send it to the GPU pipeline simulation module in sequence;

[0026] The GPU pipeline simulation module is used to execute the received instructions in sequence;

[0027] The first information includes information related to the execution of the target instruction, the second information includes storage information related to the execution of the target instruction arranged according to the preset structure, and the start signal is used to indicate that the register simulation module has completed configuration.

[0028] In a possible implementation, the register simulation module includes a plurality of virtual registers.

[0029] The firmware simulation module is further configured to write a target value into a first virtual register among the plurality of virtual registers after determining that the configuration of the register simulation module is completed;

[0030] The startup processing module is used to monitor a first virtual register among the multiple virtual registers, and determine that the startup signal is detected when it is determined that the first virtual register is written with a target value.

[0031] In a possible implementation, the startup processing module is used to obtain the first information from each of the virtual registers of the register simulation module;

[0032] Among them, the first information includes at least one state information for resetting the rendering state table, the first address information of the instruction cache space storing the target instruction in the GPU virtual video memory, the first length of the instruction cache space, the second address information of the primitive cache space storing the primitive information in the GPU virtual video memory, and the second length of the primitive cache space; the second information includes the first address information, the first length, the second address information, the second length and the third address information of the rendering state table.

[0033] In a possible implementation manner, the first address information and the second address information include a first address, and the third address information includes a pointer to the rendering status table.

[0034] In a possible implementation, the instruction processing module includes: an instruction decoding unit, an instruction pool, and a serialization output unit.

[0035] The instruction decoding unit is used to parse the received second information based on the preset structure, obtain the target instruction from the instruction cache space of the GPU virtual display memory based on the parsing result and store it in the instruction pool, and then sequentially obtain and decode each of the target instructions from the instruction pool, and send the decoded instructions to the serialization output unit and the log unit, and send the third address information in the parsing result to the serialization output unit;

[0036] The serialization output unit is used to send the third address information to the GPU pipeline simulation module, and to store the received decoded instructions in a serialization queue in sequence, and to send the decoded instructions in the serialization queue to the GPU pipeline simulation module in sequence when the GPU pipeline simulation module is in an idle state, so that the GPU pipeline simulation module obtains the rendering state table based on the third address information and executes the received decoded instructions based on the rendering state table.

[0037] In a possible implementation, the instruction processing module further includes:

[0038] The log unit is used to set a corresponding operator for each decoded instruction according to the different instruction types and then connect to the log system, so that the log system can respond to the user's request to print and display the relevant information of the decoded instruction based on the operator overload function indicated by the operator of each decoded instruction. The operators corresponding to decoded instructions of different instruction types are different.

[0039] In a possible implementation, the instruction processing module further includes a primitive pool.

[0040] The instruction decoding unit is further configured to, when determining that the decoded instruction requires primitive information, obtain corresponding target primitive information from the primitive cache space of the GPU virtual display memory based on the offset address information of the required primitive information indicated by the decoded instruction and the second address information, mark the target primitive information with an identifier of the decoded instruction requiring the target primitive information, and store the marked target primitive information in the primitive pool;

[0041] The serialized output unit is also used to obtain corresponding target primitive information from the primitive pool according to the identifier of the decoded instruction when it is determined that the decoded instruction requires primitive information, so as to synchronously send the corresponding target primitive information when sending the decoded instruction to the GPU pipeline simulation module.

[0042] According to another aspect of the present disclosure, a GPU instruction processing front-end simulation device is provided, comprising: a processor; a memory for storing processor executable instructions; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0043] According to another aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions implement the above method when executed by a processor.

[0044] According to another aspect of the present disclosure, a computer program product is provided, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0045] The GPU instruction processing front-end simulation device, system, method and storage medium provided by the embodiments of the present disclosure can simulate the GPU instruction processing front-end with high operating efficiency, low coupling between modules and easy expansion and updating.

[0046] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.

[0048] Figure 1 A block diagram of a GPU instruction processing front-end simulation device according to an embodiment of the present disclosure is shown.

[0049] Figure 2 A schematic diagram of the workflow of starting a processing module in a GPU instruction processing front-end simulation device according to an embodiment of the present disclosure is shown.

[0050] Figure 3 A block diagram of an instruction processing module in a GPU instruction processing front-end simulation device according to an embodiment of the present disclosure is shown.

[0051] Figure 4A schematic diagram showing the workflow of an instruction processing module in a GPU instruction processing front-end simulation device according to an embodiment of the present disclosure is shown.

[0052] Figure 5 A schematic diagram of the packaging of a GPU instruction processing front-end simulation system according to an embodiment of the present disclosure is shown.

[0053] Figure 6 It is a block diagram of a device 1900 for simulating a GPU instruction processing front-end according to an exemplary embodiment. DETAILED DESCRIPTION

[0054] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0055] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0056] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present disclosure.

[0057] In the GPU design process, it is necessary to perform software modeling on the GPU in the early stage of the project. On the one hand, the functions and performance of the GPU can be verified in advance, and on the other hand, a development platform can be provided to software developers in advance through a virtual machine to facilitate parallel development of multiple departments. In the GPU modeling process, it is necessary to provide software developers with a complete and designed GPU instruction processing front end so that they can extract instructions issued by the driver from the video memory, perform decoding, count primitive information, and trigger pipeline processing and other operations.

[0058] In the related art, the ESL modeling used for the instruction processing front-end simulation of the GPU is usually based on a C++ framework such as SystemC, and the partitioning of the hardware modules is simulated through a software model of transaction transmission.

[0059] However, the GPU instruction processing front-end architecture model in related technologies has the following technical limitations:

[0060] Complex hardware design requirements: Existing models are too complex in hardware design, involving extensive clock management, register configuration, and consistency assurance issues. This design increases the complexity of the model, thus affecting its maintainability.

[0061] High coupling intensity between hardware-level modules: In existing models, due to hardware-level limitations, a high degree of coupling between modules occurs during the modeling process, which poses an obstacle to the scalability and subsequent maintenance of the model.

[0062] Limitations of hardware details on software development feedback: During the collaborative development of software and hardware, the hardware-based GPU instruction processing front-end model often finds it difficult to provide appropriate feedback to software developers because it focuses on the details of hardware implementation and cannot meet the research needs of software developers.

[0063] Inefficient handling of hardware simulation details: Hardware-based models have inefficient operation of the entire model due to their complex hardware simulation details.

[0064] To solve the above problems, the embodiments of the present disclosure provide a GPU instruction processing front-end simulation device, system, method and storage medium, which have the following advantages:

[0065] Simplify the hardware design modeling process: By simplifying the hardware-based design modeling process, development efficiency and maintenance convenience are significantly improved. The start time of software development is greatly advanced during the GPU design phase, which helps to achieve parallel development between departments.

[0066] Reduced coupling between modules: Function-based modules are used to replace traditional hardware modules, eliminating synchronization dependencies between hardware modules and achieving high cohesion and low coupling of the model.

[0067] Provide real-time feedback for software development: The GPU instruction processing front-end architecture provided can record key operating information in real time and present it in the form of logs, effectively reducing the debugging difficulty and time cost during the software development process.

[0068] Lightweight model enables efficient simulation: By eliminating unnecessary hardware simulation details, an efficient lightweight model is constructed, which significantly improves the simulation speed.

[0069] Figure 1 FIG. 1 is a block diagram of a GPU instruction processing front-end simulation device according to an embodiment of the present disclosure. Figure 1As shown, the device 100 includes a startup processing module 11 and an instruction processing module 12. The GPU instruction processing front-end simulation device 100 can be set based on the instruction processing front-end function of the GPU that needs to be verified to form a lightweight model. This allows the GPU instruction processing front-end simulation device to only ensure the normal implementation of the GPU function, and no longer considers the hardware requirements such as the clock and storage configuration of the hardware circuit, thereby achieving simplification of the modeling process based on hardware design. In addition, since the startup processing module 11 and the instruction processing module 12 are used to replace the traditional hardware modules, the synchronization dependency between the hardware modules is eliminated, and the high cohesion and low coupling of the model are achieved. Due to the lightweight of the model, its operating efficiency is more efficient and the simulation speed is significantly improved. At the same time, the GPU instruction processing front-end simulation device has a high processing speed and low latency, and has high operating efficiency.

[0070] In some embodiments, Figure 1 As shown, the GPU instruction processing front-end simulation device 100 may further include at least one module among the firmware simulation module 21 , the GPU virtual video memory 23 , the register simulation module 22 and the GPU pipeline simulation module 24 .

[0071] The startup processing module 11 is used to obtain first information from the register simulation module 22 when a startup signal is detected, reset the rendering state table (RST) according to the first information, and send the second information with a preset structure generated according to the first information to the instruction processing module. The startup signal is used to indicate that the register simulation module 22 has completed the configuration, and the configuration is performed by the firmware simulation module 21 when the target instruction is received, and each target instruction in the GPU virtual video memory 23 is written by the firmware simulation module 21 after receiving each target instruction. The first information includes information related to the execution of the target instruction, and the content contained in the first information can be set according to the actual execution needs of different target instructions, and the present disclosure does not limit this. The second information includes storage information related to the execution of the target instruction arranged according to the preset structure. These storage information can indicate the storage location of the information required to execute the target instruction, and the content contained in the second information can be set according to the actual execution needs of the target execution, and the present disclosure does not limit this.

[0072] In this embodiment, the firmware simulation module 21 is responsible for receiving data sent by the driver software through PCIE, and these data include multiple target instructions to be processed, various primitive information required for the execution of multiple target instructions, etc., and the present disclosure does not limit this. Among them, the target instruction can be any instruction that the GPU can process, and the present disclosure does not limit this. After receiving the data, the firmware simulation module 21 will store the target instruction and primitive information in the GPU virtual display memory 23. In addition, the firmware simulation module 21 also needs to determine the first address information of the command buffer space (command buffer) storing the target instruction in the GPU virtual display memory 23 and the first length of the command buffer space, wherein the first address information can be information indicating the address of the command buffer space, such as the first address of the command buffer space (that is, the starting position and starting address of the command buffer space). The first length can indicate the length of the memory occupied by the command buffer space, so the first length can be the length of the command buffer space, or when the target instruction length is fixed and known, the first length can also be represented by the number of target instructions (when the instruction processing module 12 obtains the target instruction, it can obtain the "number indicated by the first length" target instructions based on the length of the target instruction). The firmware simulation module 21 also needs to determine the second address information of the primitive buffer space that stores primitive information in the GPU virtual video memory 23 and the second length of the primitive buffer space, wherein the second address information may be information indicating the address of the primitive buffer space, such as the first address of the primitive buffer space (that is, the starting position and starting address of the primitive buffer space), and the second length may refer to the length of the memory occupied by the primitive buffer space.

[0073] In this embodiment, the register simulation module 22 may include multiple virtual registers, and different virtual registers are used to store different information. The firmware simulation module 21 is also used to configure each virtual register in the register simulation module 22 based on the target instruction, and the configuration includes writing the first address information, the first length, the second address information and the second length in the corresponding virtual register, and writing each state information for resetting the rendering state table.

[0074] In some embodiments, the startup processing module 11 is used to monitor the first virtual register among the multiple virtual registers, and when it is determined that the first virtual register is written with the target value, it is determined that the startup signal is detected. The target value is written by the firmware simulation module 21 after completing the configuration of each virtual register. For example, the target value can be "1", then if the startup processing module 11 detects that the first virtual register is written with "1", it can be determined that each firmware simulation module 21 has completed the configuration of each virtual register. The first virtual register can be a fixed register among multiple virtual registers, then the startup processing module 11 can always monitor this fixed first virtual register. Alternatively, when executing different target instructions, a register is randomly or in a certain way selected from multiple virtual registers as the first virtual register, and then the startup processing module 11 is synchronized to the specific selected first virtual register, so that the startup processing module 11 can monitor the first virtual register.

[0075] In this embodiment, after determining that the start signal is detected, the startup processing module 11 first reads information from each virtual register in the register simulation module 22, and then obtains the first information. The first information may include at least one state information, first address information, first length, second address information, and second length for resetting the rendering state table. Then, the startup processing module 11 resets the rendering state table based on each state information in the first information, and arranges the first address information, first length, second address information, second length, and third address information of the rendering state table in the first information according to a preset structure to form the second information. The third address information may be information indicating the address of the storage location of the rendering state table, for example, the third address information may be a pointer to the rendering state table.

[0076] In this embodiment, the second information is structured to have a preset structure in order to ensure that the instruction processing module 12 can parse the second information according to the preset structure after receiving the second information and successfully obtain each information in the second information. The preset structure of the second information can be set according to actual needs, and the present disclosure does not impose any restrictions on this.

[0077] For example, the preset structure may be as shown in Table 1 below. The startup processing module 11 may be configured as follows: Figure 2 The step sequence shown first resets the rendering state table, then reads the state information used to reset the rendering state table from the corresponding virtual register and resets the rendering state table based on the state information, then reads the first address information, the first length, the second address information and the second length from the virtual register, combines the third address information of the rendering state table to form the second information with a preset structure, and finally sends the second information to the instruction processing module 12.

[0078] Table 1 Preset structure example

[0079] name type Remark Cmd_buffer_addr Uint64_t The starting address of the instruction cache space Cmd_buffer_size Size_t The number of target instructions in the instruction cache space Prim_buffer_addr Uint64_t The starting address of the primitive cache space Prim_buffer_size Size_t The length of the primitive cache space RST_addr RST* Pointer to the rendering state table

[0080] The instruction processing module 12 is used to obtain each target instruction to be executed from the GPU virtual video memory 23 according to the second information, and decode each target instruction and send it to the GPU pipeline simulation module 24 in sequence, so that the GPU pipeline simulation module 24 executes each received instruction in sequence.

[0081] In this embodiment, the instruction processing module 12 can monitor the working status of the GPU pipeline simulation module 24, and send a decoded target instruction to the GPU pipeline simulation module 24 when the GPU pipeline simulation module 24 is in an idle state. In this way, the instruction processing module 12 only sends one decoded target instruction to the GPU pipeline simulation module 24 in the idle state each time, and sends each decoded target instruction to the GPU pipeline simulation module 24 in sequence by sending it multiple times, which can avoid instruction backlog in the GPU pipeline simulation module 24.

[0082] In some embodiments, Figure 3 As shown, the instruction processing module 12 may include an instruction decoding unit 121, an instruction pool 122, a log unit 123 and a serialization output unit 124. Figure 3 , Figure 4 The working process and principle of the instruction processing module 12 are explained.

[0083] like Figure 3 , Figure 4 As shown, the instruction decoding unit 121 is used to receive the second information sent by the startup processing module 11, and parse the second information based on the preset structure to obtain each information in the second information, that is, to obtain the first address information, the first length, the second address information, the second length and the third address information in the second information. Then, based on the first address information and the first length obtained by parsing, the target instruction is obtained from the instruction cache space of the GPU virtual video memory 23 and the target instruction is stored in the instruction pool 122. The instruction pool 122 is used to store and manage the received target instructions. Among them, the instruction pool 122 can store the target instruction in a compressed queue. Then the instruction decoding unit 121 sequentially obtains and decodes each of the target instructions from the instruction pool 122, and sends the decoded instructions to the serialization output unit 124 and the log unit 123, and sends the parsed third address information to the serialization output unit 124.

[0084] like Figure 3 , Figure 4As shown, the serialization output unit 124 is used to send the third address information to the GPU pipeline simulation module 24, and store the received decoded instructions in sequence to the serialization queue. The serialization output unit 124 is also used to monitor the working state of the GPU pipeline simulation module 24, and when it is determined that the GPU pipeline simulation module 24 is in an idle state, the decoded instructions in the serialization queue are sent to the GPU pipeline simulation module 24 in sequence. When it is determined that the GPU pipeline simulation module 24 is in a busy state, the working state monitoring of the GPU pipeline simulation module 24 continues. In some embodiments, the serialization output unit 124 can directly and sequentially set the decoded instructions from the instruction decoding unit 121 at the end of the serialization queue, and then send the decoded instructions at the head of the serialization queue to the GPU pipeline simulation module 24 each time when it is determined that the GPU pipeline simulation module 24 is in an idle state.

[0085] Among them, after receiving the third address information, the GPU pipeline simulation module 24 can obtain the rendering state table based on the third address information, and after receiving the decoded instruction, it can execute the decoded instruction based on the rendering state table and the rendering state table to complete image rendering.

[0086] like Figure 3 , Figure 4 As shown, the log unit 123 is used to set the corresponding operator for each decoded instruction according to the different instruction types after receiving the decoded instruction, and then access the log system. The operators corresponding to the decoded instructions of different instruction types are different. After accessing the log system, the log system can print and display the relevant information of the decoded instruction based on the operator overload function indicated by the operator of each decoded instruction in response to the user request of the software developer. It enables software developers to monitor and verify the behavior of the GPU model in real time, debug the GPU model in time, effectively reduce the debugging difficulty and time cost in the software development process, and improve the efficiency and speed of the entire GPU development.

[0087] In some embodiments, the "relevant information of the decoded instruction" to be printed and displayed can be set according to actual needs, and the relevant information required to be printed and displayed for instructions of different instruction types may be different. The operator overload function indicated by the operator can be adjusted based on the relevant information that needs to be printed and displayed to meet the user's log printing needs. In some embodiments, the relevant information may include the information carried by the decoded instruction itself (i.e., the parsing result), the corresponding primitive information, etc., which is not limited by the present disclosure.

[0088] In some embodiments, Figure 3As shown, the instruction processing module 12 may further include a primitive pool 125 .

[0089] like Figure 3 , Figure 4 As shown, the instruction decoding unit 121 is also used to obtain the corresponding target primitive information from the primitive cache space of the GPU virtual display memory 23 based on the offset address information of the required primitive information indicated by the decoded instruction and the second address information after completing the decoding to obtain the decoded instruction. For example, when the second address information is the first address and the offset address information is the offset address, the address of the target primitive information is the first address + offset address, and the instruction decoding unit 121 can read the target primitive information based on the "first address + offset address". Then the instruction decoding unit 121 uses the identifier of the decoded instruction that requires the target primitive information (such as the ID of the instruction, which can distinguish different instructions, and the present disclosure is not limited to this) to mark the target primitive information, and store the marked target primitive information in the primitive pool 125. The target primitive information is marked by the identifier of the decoded instruction, so that the subsequent serialization output unit 124 can obtain the target primitive information corresponding to the decoded instruction that requires the primitive information from the primitive pool 125. The primitive pool 125 is used to store and manage the received marked target primitive information.

[0090] like Figure 3 , Figure 4 As shown, the serialization output unit 124 is also used to obtain the corresponding target primitive information from the primitive pool 125 according to the identifier of the decoded instruction when it is determined that the decoded instruction requires primitive information, so as to synchronously send the corresponding target primitive information when sending the decoded instruction to the GPU pipeline simulation module 24.

[0091] In some embodiments, the instruction type of the target instruction may include status and drawing, wherein the drawing instruction requires primitive information and the status instruction does not require primitive information.

[0092] The GPU instruction processing front-end simulation device provided by the embodiment of the present disclosure can bring the following beneficial effects:

[0093] High operating efficiency and interface availability: Since the GPU instruction processing front-end simulation device only guarantees the normal implementation of GPU functions, it no longer considers the hard requirements of the hardware circuit such as the clock and storage configuration, and builds an efficient lightweight model, which significantly improves the simulation speed. It also makes the GPU instruction processing front-end simulation device have high processing speed and low latency, and has high operating efficiency. The log unit provides a clear verification interface to software developers to display the parsing results and primitive information of the instructions in the GPU, with high practicality and user experience.

[0094] Low coupling between modules: The coupling between GPU hardware modules in the GPU instruction processing front-end simulation device is low. Each module in the GPU instruction processing front-end simulation device can work independently and each module can also be updated and maintained independently, which improves the flexibility and scalability of the overall maintenance and upgrade of the GPU instruction processing front-end simulation device.

[0095] Convenience of scalability and updating: The GPU instruction processing front-end simulation device no longer focuses on the details of the GPU hardware, making it easier to expand and update. It is suitable for the development and use of different GPUs. The GPU instruction processing front-end simulation device can also be expanded and updated accordingly according to the update and expansion of the GPU, thereby improving the speed and efficiency of GPU development.

[0096] The present disclosure also provides a GPU instruction processing front-end simulation method, which is applied to the GPU instruction processing front-end simulation device 100. The method includes:

[0097] Controlling the startup processing module to obtain first information from the register simulation module when a startup signal is detected, and reset the rendering state table according to the first information, as well as second information with a preset structure generated according to the first information;

[0098] Control the instruction processing module to obtain each target instruction to be executed from the GPU virtual video memory according to the second information, and decode each target instruction and send it to the GPU pipeline simulation module in sequence, so that the GPU pipeline simulation module executes each received instruction in sequence;

[0099] The first information includes information related to the execution of the target instruction, the second information includes storage information related to the execution of the target instruction arranged according to the preset structure, and the start signal is used to indicate that the register simulation module has completed configuration.

[0100] In a possible implementation, the register simulation module includes a plurality of virtual registers, and the method further includes:

[0101] The startup processing module is controlled to monitor a first virtual register among the plurality of virtual registers, and when it is determined that a target value is written into the first virtual register, it is determined that the startup signal is detected.

[0102] In a possible implementation, the method also includes: controlling the startup processing module to obtain first information from each of the virtual registers of the register simulation module; wherein the first information includes at least one state information for resetting the rendering state table, the first address information of the instruction cache space storing the target instruction in the GPU virtual video memory, the first length of the instruction cache space, the second address information of the primitive cache space storing primitive information in the GPU virtual video memory, and the second length of the primitive cache space; the second information includes the first address information, the first length, the second address information, the second length and the third address information of the rendering state table.

[0103] In a possible implementation manner, the first address information and the second address information include a first address, and the third address information includes a pointer to the rendering status table.

[0104] In a possible implementation, the instruction processing module includes: an instruction decoding unit, an instruction pool, and a serialization output unit, and the method further includes:

[0105] Control the instruction decoding unit to parse the received second information based on the preset structure, obtain the target instruction from the instruction cache space of the GPU virtual display memory based on the parsing result and store it in the instruction pool, then sequentially obtain and decode each of the target instructions from the instruction pool, send the decoded instructions to the serialization output unit and the log unit, and send the third address information in the parsing result to the serialization output unit;

[0106] Control the serialization output unit to send the third address information to the GPU pipeline simulation module, and store the received decoded instructions in a serialization queue in sequence, and send the decoded instructions in the serialization queue to the GPU pipeline simulation module in sequence when the GPU pipeline simulation module is in an idle state, so that the GPU pipeline simulation module obtains the rendering status table based on the third address information and executes the received decoded instructions based on the rendering status table.

[0107] In a possible implementation, the instruction processing module further includes a log unit. The method further includes: controlling the log unit to set a corresponding operator for each decoded instruction according to different instruction types and then accessing a log system, so that the log system can print and display relevant information of the decoded instruction based on the operator overload function indicated by the operator of each decoded instruction in response to a user request, and the decoded instructions of different instruction types have different corresponding operators.

[0108] In a possible implementation, the instruction processing module further includes a primitive pool. The method further includes:

[0109] Controlling the instruction decoding unit to obtain corresponding target primitive information from the primitive cache space of the GPU virtual display memory based on the offset address information of the required primitive information indicated by the decoded instruction and the second address information when determining that the decoded instruction requires primitive information, and marking the target primitive information with an identifier of the decoded instruction requiring the target primitive information, and storing the marked target primitive information in the primitive pool;

[0110] When determining that the decoded instruction requires primitive information, the serialized output unit is controlled to obtain the corresponding target primitive information from the primitive pool according to the identifier of the decoded instruction, so as to synchronously send the corresponding target primitive information when sending the decoded instruction to the GPU pipeline simulation module.

[0111] The disclosed embodiment also provides a GPU instruction processing front-end simulation system, which includes the above-mentioned GPU instruction processing front-end simulation device 100 including the startup processing module 11 and the instruction processing module 12, as well as a firmware simulation module, the GPU virtual video memory, the register simulation module and the GPU pipeline simulation module.

[0112] For the convenience of developers, such as Figure 5 As shown, the GPU instruction processing front-end simulation system can be encapsulated into a callable library, and the library can be further encapsulated into a virtual machine. Figure 5 The software simulation platform shown can use QEMU as a carrier, which is divided into a host side Host and a device side Device, Device is a virtual PCIE device simulated by QEMU, Host is an environment developed by software developers, and is also a development space provided by the present disclosure for software developers. In Device, it is necessary to access the packaged GPU model, which is mainly divided into 4 parts, a firmware simulation module (which can be a Firmware ESL simulation model built based on ESL), a GPU pipeline simulation module (which can be a GPU Pipeline ESL simulation model built based on ESL), a GPU instruction processing front-end simulation device 100 and virtual storage (including GPU virtual video memory), so that the GPU instruction processing front-end simulation device 100 can connect Firmware and GPU pipeline, realize the combination of software model and ESL model, and encapsulate the entire system into a strategy in a virtual machine, providing a simulation platform closer to the actual hardware environment for software developers, and providing a more accurate and practical simulation environment. It can also provide log services to developers at the Host end at the same time.

[0113] It should be noted that although the above embodiments are used as examples to introduce the GPU instruction processing front-end simulation device, system and method, those skilled in the art will understand that the present disclosure should not be limited thereto. In fact, users can flexibly set each module, unit and step according to personal preferences and / or actual application scenarios, as long as they comply with the technical solution of the present disclosure.

[0114] In some embodiments, the functions or modules included in the device or system provided in the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementations of the device, system and method can refer to each other and will not be repeated here for the sake of brevity.

[0115] The embodiment of the present disclosure also provides a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.

[0116] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0117] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0118] Figure 6 1 is a block diagram of a device 1900 for simulating a GPU instruction processing front-end according to an exemplary embodiment. For example, the device 1900 may be provided as a server or a terminal device. Figure 6 , the apparatus 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions, such as an application, that can be executed by the processing component 1922. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0119] The device 1900 may also include a power supply component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input / output interface 1958 (I / O interface). The device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server 2000.TM , MacOS X TM , Unix TM ,Linux TM , FreeBSD TM or similar.

[0120] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the device 1900 to perform the above method.

[0121] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0122] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0123] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0124] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0125] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0126] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0127] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0128] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0129] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A GPU instruction processing front-end simulation device, characterized in that: The device comprises: A startup processing module, configured to obtain first information from the register simulation module when a startup signal is detected, reset the rendering state table according to the first information, and send second information with a preset structure generated according to the first information to the instruction processing module; An instruction processing module, used for acquiring each target instruction to be executed from the GPU virtual video memory according to the second information, and decoding each target instruction and sending it to the GPU pipeline simulation module in sequence, so that the GPU pipeline simulation module executes each received instruction in sequence; The first information includes information related to the execution of the target instruction, the second information includes storage information related to the execution of the target instruction arranged according to the preset structure, and the start signal is used to indicate that the register simulation module has completed configuration.

2. The device according to claim 1, characterized in that The register simulation module includes a plurality of virtual registers. The startup processing module is used to monitor a first virtual register among the multiple virtual registers, and determine that the startup signal is detected when it is determined that the first virtual register is written with a target value.

3. The device according to claim 2, characterized in that The startup processing module is used to obtain first information from each virtual register of the register simulation module; Among them, the first information includes at least one state information for resetting the rendering state table, the first address information of the instruction cache space storing the target instruction in the GPU virtual video memory, the first length of the instruction cache space, the second address information of the primitive cache space storing the primitive information in the GPU virtual video memory, and the second length of the primitive cache space; the second information includes the first address information, the first length, the second address information, the second length and the third address information of the rendering state table.

4. The device according to claim 3, characterized in that The first address information and the second address information include a first address, and the third address information includes a pointer to the rendering status table.

5. The device according to claim 3, characterized in that The instruction processing module includes: an instruction decoding unit, an instruction pool and a serialization output unit. The instruction decoding unit is used to parse the received second information based on the preset structure, obtain the target instruction from the instruction cache space of the GPU virtual display memory based on the parsing result and store it in the instruction pool, and then sequentially obtain and decode each of the target instructions from the instruction pool, and send the decoded instructions to the serialization output unit and the log unit, and send the third address information in the parsing result to the serialization output unit; The serialization output unit is used to send the third address information to the GPU pipeline simulation module, and to store the received decoded instructions in a serialization queue in sequence, and to send the decoded instructions in the serialization queue to the GPU pipeline simulation module in sequence when the GPU pipeline simulation module is in an idle state, so that the GPU pipeline simulation module obtains the rendering state table based on the third address information and executes the received decoded instructions based on the rendering state table.

6. The device according to claim 5, characterized in that The instruction processing module also includes: The log unit is used to set a corresponding operator for each decoded instruction according to the different instruction types and then connect to the log system, so that the log system can respond to the user's request to print and display the relevant information of the decoded instruction based on the operator overload function indicated by the operator of each decoded instruction. The operators corresponding to decoded instructions of different instruction types are different.

7. The device according to claim 5, characterized in that The instruction processing module also includes a primitive pool, The instruction decoding unit is further configured to, when determining that the decoded instruction requires primitive information, obtain corresponding target primitive information from the primitive cache space of the GPU virtual display memory based on the offset address information of the required primitive information indicated by the decoded instruction and the second address information, mark the target primitive information with an identifier of the decoded instruction requiring the target primitive information, and store the marked target primitive information in the primitive pool; The serialized output unit is also used to obtain corresponding target primitive information from the primitive pool according to the identifier of the decoded instruction when it is determined that the decoded instruction requires primitive information, so as to synchronously send the corresponding target primitive information when sending the decoded instruction to the GPU pipeline simulation module.

8. The device according to claim 1, characterized in that The device further includes: at least one module among the GPU virtual display memory, the register simulation module and the GPU pipeline simulation module.

9. A GPU instruction processing front-end simulation system, characterized in that: The system comprises: a firmware simulation module, a GPU virtual display memory, a register simulation module, a GPU pipeline simulation module and a GPU instruction processing front-end simulation device, wherein the GPU instruction processing front-end simulation device comprises a startup processing module and an instruction processing module; The firmware simulation module is used to store the target instruction in the GPU virtual display memory and configure the register simulation module when receiving the target instruction; The startup processing module is used to monitor the register simulation module and, when a startup signal is detected, obtain first information from the register simulation module, reset the rendering state table according to the first information, and send second information with a preset structure generated according to the first information to the instruction processing module; The command processing module is used to obtain each target instruction to be executed from the GPU virtual video memory according to the second information, and decode each target instruction and send it to the GPU pipeline simulation module in sequence; The GPU pipeline simulation module is used to execute the received instructions in sequence; The first information includes information related to the execution of the target instruction, the second information includes storage information related to the execution of the target instruction arranged according to the preset structure, and the start signal is used to indicate that the register simulation module has completed configuration.

10. A GPU instruction processing front-end simulation method, characterized in that: Applied to a GPU instruction processing front-end simulation device, the GPU instruction processing front-end simulation device includes a startup processing module and an instruction processing module, and the method includes: Controlling the startup processing module to obtain first information from the register simulation module when a startup signal is detected, and reset the rendering state table according to the first information, as well as second information with a preset structure generated according to the first information; Control the instruction processing module to obtain each target instruction to be executed from the GPU virtual video memory according to the second information, and decode each target instruction and send it to the GPU pipeline simulation module in sequence, so that the GPU pipeline simulation module executes each received instruction in sequence; The first information includes information related to the execution of the target instruction, the second information includes storage information related to the execution of the target instruction arranged according to the preset structure, and the start signal is used to indicate that the register simulation module has completed configuration.

11. A GPU instruction processing front-end simulation device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to implement the method of claim 10 when executing the instructions stored in the memory.

12. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method of claim 10 is implemented.

Citation Information

Cited By

  • Parameter adjusting method, device and system

    CN119902806A

  • Task processing method and system, electronic equipment and storage medium

    CN122653690A