Simulation method and simulation device for simulating integrated circuit chip

By detecting the task status of the integrated circuit chip core module group and maintaining the work pool and idle flag sequence, the software simulation process is optimized, the problem of long integrated circuit chip simulation time is solved, and a more efficient simulation process is achieved.

CN120508373BActive Publication Date: 2025-09-09SHANGHAI BIREN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510990593.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-18
Publication Date
2025-09-09
Estimated Expiration
2045-07-18

AI Technical Summary

Technical Problem

In the prior art, software simulation of integrated circuit chips takes a long time, mainly due to a large number of invalid calls.

Method used

By detecting the current task status of multiple kernel module groups, it is determined whether there is a kernel module group with assigned tasks that have not been completed before the next call to the front-end module group. If so, the call is executed; if not, the call of the kernel module group is skipped, and a work pool and idle flag sequence are maintained in memory to optimize the calling process.

Benefits of technology

It effectively shortens the software simulation time of integrated circuit chips, reduces invalid calls, and improves simulation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120508373B_ABST
    Figure CN120508373B_ABST
Patent Text Reader

Abstract

The present application relates to a simulation method and device for simulating an integrated circuit chip. Based on an embodiment of the present application, for an integrated circuit chip including a command processor and multiple core partitions, the current task status of multiple kernel module groups corresponding to the multiple kernel partitions in the multiple software modules can be detected by calling a front-end module group corresponding to the command processor in the multiple software modules. Thus, by calling the current task status of the multiple kernel module groups detected by the front-end module group, calls that may be initiated to the entire group of kernel modules that have no data to be processed can be directly skipped, thereby eliminating invalid calls to kernel modules that have no data to be processed at the kernel module group granularity. This helps to shorten the software simulation time of the integrated circuit chip by reducing invalid calls to software modules.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of integrated circuit chip design, and in particular to a simulation method for simulating an integrated circuit chip, and a simulation device for simulating an integrated circuit chip. Background Art

[0002] During the design phase of an integrated circuit (IC) chip, simulation is often required to evaluate its performance after tape-out. Unlike post-tapeout testing, which relies on actual IC chip operation, IC chip simulation can also be achieved through software simulation of the IC chip's operational process. This method of simulating the IC chip's operational process using software is referred to as software emulation.

[0003] Typically, software simulation of an integrated circuit chip can be implemented by a software thread calling multiple software modules, where the multiple software modules correspond to multiple hardware modules in the integrated circuit chip, and the software thread can periodically call the multiple software modules in a serial order.

[0004] When a software thread executes a call to any software module and detects that the module currently has no data to process, it terminates the current call to the module and jumps to the next module in the serial order. Therefore, the software thread's call to the module is considered an invalid call. A large number of invalid calls will cause the software simulation of the integrated circuit chip to take a long time.

[0005] Therefore, how to shorten the time consumption of software simulation of integrated circuit chips has become a technical problem to be solved in the prior art. Summary of the Invention

[0006] The embodiments of the present application provide a simulation method for simulating an integrated circuit chip and a simulation device for simulating an integrated circuit chip, which help to shorten the time consumed by software simulation of the integrated circuit chip.

[0007] In one embodiment of the present application, a simulation method for simulating an integrated circuit chip is provided, comprising:

[0008] The method comprises: detecting current task states of multiple kernel module groups among the multiple software module groups by calling a front-end module group among the multiple software module groups; wherein the integrated circuit chip includes a command processor and multiple kernel partitions, the command processor is used to dispatch tasks to the multiple kernel partitions, the multiple kernel partitions are used to update task states maintained in the command processor in response to completion of tasks, the front-end module group is used to simulate the command processor, and the multiple kernel module groups are used to simulate the multiple kernel partitions respectively, and the front-end module group and the multiple kernel module groups are serially called in each calling cycle of the multiple software module groups;

[0009] Based on the detection results of the current task states of the multiple kernel module groups, the calling states of the multiple kernel module groups before the next call to the front-end module group are determined; wherein, if the current task state of any kernel module group among the multiple kernel module groups is a non-empty state indicating that the dispatched tasks have not been fully completed, then the call to the kernel module group is executed in the serial calling process before the next call to the front-end module group; if the current task state of any kernel module group among the multiple kernel module groups is an empty state indicating that the dispatched tasks have been fully completed, then the call to the kernel module group is skipped in the serial calling process before the next call to the front-end module group.

[0010] In some examples, optionally, the simulation method further includes: maintaining a corresponding work pool in memory for each of the multiple kernel module groups, and the work pool corresponding to each of the multiple kernel module groups is used to save task records of assigned tasks that have been assigned to the kernel module group and have not yet been completed by the kernel module group; detecting the current task status of multiple kernel module groups in the multiple software module groups by calling the front-end module group in the multiple software module groups includes: detecting the work pools corresponding to the multiple kernel module groups respectively by calling the front-end module group; wherein the detection results of the work pools corresponding to the multiple kernel module groups respectively are used to characterize the current task status of the multiple kernel module groups.

[0011] In some examples, optionally, before detecting the working pools corresponding to the multiple kernel module groups, the simulation method further includes: refreshing the working pools corresponding to the multiple kernel module groups by calling the front-end module group; wherein, refreshing the working pools corresponding to the multiple kernel module groups includes: adding a task record assigned to the kernel module group through the current call to the front-end module group to the working pool corresponding to any kernel module group among the multiple kernel module groups; and deleting the corresponding task record in the working pool corresponding to the kernel module group based on the task completion information of any kernel module group among the multiple kernel module groups before the current call to the front-end module group.

[0012] In some examples, optionally, each kernel partition in the multiple kernel partitions includes multiple kernel clusters, each kernel module group in the multiple kernel module groups includes multiple kernel modules corresponding to the multiple kernel clusters respectively, and the multiple kernel modules in each kernel module group are used to be serially called during the calling period of the kernel module group; the process of executing a call to any kernel module group in the multiple kernel module groups includes: before executing a call to any kernel module in the multiple kernel modules of the kernel module group, detecting an idle flag sequence of the kernel module group; wherein: the idle flag sequence of each kernel module group includes the idle flag sequence corresponding to each kernel module in the multiple kernel modules of the kernel module group the idle flag of any kernel module among the multiple kernel modules of each kernel module group is set to valid, which is used to indicate that the pending data currently waiting for processing by the kernel module is empty; and the detection operation of the idle flag corresponding to any kernel module among the multiple kernel modules of each kernel module group is decoupled from the call of the multiple kernel modules of the kernel module group; if before executing the call to any kernel module, it is detected that the idle flag corresponding to the kernel module is currently invalid, the call to the kernel module is executed; if before executing the call to any kernel module, it is detected that the idle flag corresponding to the kernel module is currently valid, the call to the kernel module is skipped.

[0013] In some examples, optionally, the to-be-processed data of any kernel module among the multiple kernel modules of each kernel module group is stored in an interactive memory space, and the access operation to the interactive memory space is coupled with the call to the multiple kernel modules of the kernel module group; the idle flag sequence of each kernel module group is stored in an open memory space, the open memory space is independent of the interactive memory space, and the detection operation of the idle flag sequence of each kernel module group in the open memory space is decoupled from the call to the multiple kernel modules of the kernel module group.

[0014] In some examples, optionally, a setting operation of an idle flag corresponding to any kernel module among the multiple kernel modules of each kernel module group is associated with an access operation to the interactive memory space.

[0015] In some examples, optionally, the call executed on any kernel module among the multiple kernel modules of each kernel module group includes: calling an execution function corresponding to the kernel module; wherein, the execution function corresponding to any kernel module, when called, is used to: perform a read operation on the interactive memory space to obtain the to-be-processed data provided to the kernel module by the upstream kernel module located on the interactive upstream side of the kernel module; and, perform a write operation on the interactive memory space to provide the data processed by the kernel module as to-be-processed data for the downstream kernel module located on the interactive downstream side of the kernel module.

[0016] In some examples, optionally, the execution function corresponding to any kernel module is also used, when called, to: perform a set operation on the open memory space, wherein the set operation is used to invalidate the idle flag corresponding to the downstream kernel module.

[0017] In some examples, optionally, the call to any kernel module among the multiple kernel modules of each kernel module group also includes: in response to the completion of the call to the execution function corresponding to the kernel module, calling the idle function corresponding to the kernel module; wherein, the idle function corresponding to any kernel module is used when called to: detect the interactive memory space; if it is detected that the to-be-processed data of the kernel module in the interactive memory space is empty, performing a set operation on the open memory space, and the set operation is used to set the idle flag corresponding to the kernel module to valid.

[0018] In another embodiment of the present application, a simulation device for simulating an integrated circuit chip is provided, comprising:

[0019] a state detection unit, configured to detect current task states of multiple kernel module groups among the multiple software module groups by calling a front-end module group among the multiple software module groups; wherein the integrated circuit chip includes a command processor and multiple kernel partitions, the command processor is configured to dispatch tasks to the multiple kernel partitions, the multiple kernel partitions are configured to update task states maintained in the command processor in response to completion of tasks, the front-end module group is configured to simulate the command processor, the multiple kernel module groups are configured to simulate the multiple kernel partitions respectively, and the front-end module group and the multiple kernel module groups are serially called within each call cycle of the multiple software module groups;

[0020] A calling execution unit is used to determine the calling status of the multiple kernel module groups before the next call to the front-end module group based on the detection results of the current task status of the multiple kernel module groups; wherein, if the current task status of any kernel module group among the multiple kernel module groups is a non-empty state indicating that the dispatched tasks have not been fully completed, then the serial calling process before the next call to the front-end module group executes the call to the kernel module group; if the current task status of any kernel module group among the multiple kernel module groups is an empty state indicating that the dispatched tasks have been fully completed, then the call to the kernel module group is skipped in the serial calling process before the next call to the front-end module group.

[0021] In some examples, optionally, the status detection unit is also used to: maintain a corresponding work pool for each kernel module group in the multiple kernel module groups in the memory, and the work pool corresponding to each kernel module group in the multiple kernel module groups is used to save task records of assigned tasks that have been assigned to the kernel module group and have not yet been completed by the kernel module group; the status detection unit is specifically configured to detect the current task status of multiple kernel module groups in the multiple software module groups in the following manner: by calling the front-end module group, detecting the work pools corresponding to the multiple kernel module groups respectively; wherein, the detection results of the work pools corresponding to the multiple kernel module groups respectively are used to characterize the current task status of the multiple kernel module groups.

[0022] In some examples, optionally, the calling execution unit is also used to: before the status detection unit detects the working pools corresponding to the multiple kernel module groups, refresh the working pools corresponding to the multiple kernel module groups respectively by calling the front-end module group; wherein, refreshing the working pools corresponding to the multiple kernel module groups respectively includes: adding a task record assigned to the kernel module group through the current call to the front-end module group to the working pool corresponding to any kernel module group among the multiple kernel module groups; and, based on the task completion information of any kernel module group among the multiple kernel module groups before the current call to the front-end module group, deleting the corresponding task record in the working pool corresponding to the kernel module group.

[0023] In some examples, optionally, each kernel partition of the multiple kernel partitions includes multiple kernel clusters, each kernel module group of the multiple kernel module groups includes multiple kernel modules corresponding to the multiple kernel clusters respectively, and the multiple kernel modules of each kernel module group are used to be serially called during the call period of the kernel module group; the process of the call execution unit executing a call to any kernel module group of the multiple kernel module groups includes: before executing a call to any kernel module of the multiple kernel modules of the kernel module group, detecting the idle flag sequence of the kernel module group; wherein: the idle flag sequence of each kernel module group includes the idle flag sequence of each kernel module of the multiple kernel modules of the kernel module group The idle flag corresponding to the module; when the idle flag of any kernel module among the multiple kernel modules of each kernel module group is set to valid, it is used to indicate that the pending data currently waiting for processing by the kernel module is empty; and the detection operation of the idle flag corresponding to any kernel module among the multiple kernel modules of each kernel module group is decoupled from the call of the multiple kernel modules of the kernel module group; if before executing the call to any kernel module, it is detected that the idle flag corresponding to the kernel module is currently invalid, the call to the kernel module is executed; if before executing the call to any kernel module, it is detected that the idle flag corresponding to the kernel module is currently valid, the call to the kernel module is skipped.

[0024] In some examples, optionally, the to-be-processed data of any kernel module among the multiple kernel modules of each kernel module group is stored in an interactive memory space, and the access operation to the interactive memory space is coupled with the call to the multiple kernel modules of the kernel module group; the idle flag sequence of each kernel module group is stored in an open memory space, the open memory space is independent of the interactive memory space, and the detection operation of the idle flag sequence of each kernel module group in the open memory space is decoupled from the call to the multiple kernel modules of the kernel module group.

[0025] In some examples, optionally, a setting operation of an idle flag corresponding to any kernel module among the multiple kernel modules of each kernel module group is associated with an access operation to the interactive memory space.

[0026] In some examples, optionally, the call execution unit performs a call on any kernel module among the multiple kernel modules of each kernel module group, including: calling an execution function corresponding to the kernel module; wherein, the execution function corresponding to any kernel module is used when being called to: perform a read operation on the interactive memory space to obtain the to-be-processed data provided to the kernel module by the upstream kernel module located on the interactive upstream side of the kernel module; and, perform a write operation on the interactive memory space to provide the data processed by the kernel module as to-be-processed data for the downstream kernel module located on the interactive downstream side of the kernel module.

[0027] In some examples, optionally, the execution function corresponding to any kernel module is also used, when called, to: perform a set operation on the open memory space, wherein the set operation is used to invalidate the idle flag corresponding to the downstream kernel module.

[0028] In some examples, optionally, the call execution unit performs a call on any kernel module among the multiple kernel modules of each kernel module group, and further includes: in response to the completion of the call to the execution function corresponding to the kernel module, calling the idle function corresponding to the kernel module; wherein, the idle function corresponding to any kernel module is used, when called, to: detect the interactive memory space; if it is detected that the data to be processed by the kernel module in the interactive memory space is empty, performing a set operation on the open memory space, and the set operation is used to set the idle flag corresponding to the kernel module to valid.

[0029] In another embodiment of the present application, an electronic device is provided, including a processor, wherein the processor is configured to execute the simulation method as described in the above embodiment.

[0030] In another embodiment of the present application, a non-transitory computer-readable storage medium is provided. The non-transitory computer-readable storage medium stores instructions. When the instructions are executed by a processor, the processor implements the simulation method as described in the above embodiment.

[0031] In another embodiment of the present application, a computer program product is provided, comprising computer-executable instructions, which, when executed by a processor, implement the simulation method as described in the foregoing embodiment.

[0032] According to an embodiment of the present application, for an integrated circuit chip including a command processor and multiple core partitions, the current task status of multiple kernel module groups corresponding to the multiple kernel partitions in the multiple software modules can be detected by calling a front-end module group corresponding to the command processor in the multiple software modules. Thus, by calling the current task status of the multiple kernel module groups detected by the front-end module group, calls that may be initiated to the entire group of kernel modules that have no data to be processed can be directly skipped, thereby eliminating invalid calls to kernel modules that have no data to be processed at the kernel module group level. This helps shorten the software simulation time of the integrated circuit chip by reducing invalid calls to software modules. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The following drawings are only provided for schematic illustration and explanation of the present application and do not limit the scope of the present application:

[0034] Figure 1 is a schematic diagram of an exemplary structure of an integrated circuit chip used as a simulation object in an embodiment of the present application;

[0035] Figure 2 This is an exemplary schematic diagram of software modules corresponding to the configuration of the integrated circuit chip in an embodiment of the present application;

[0036] Figure 3 1 is a schematic diagram of an exemplary flow chart of a simulation method for simulating an integrated circuit chip in an embodiment of the present application;

[0037] Figure 4 A schematic diagram of a working pool for simulating an integrated circuit chip according to an embodiment of the present application;

[0038] Figure 5 A schematic diagram of the optimization principle of the simulation method for simulating an integrated circuit chip in an embodiment of the present application;

[0039] Figure 6 A schematic diagram illustrating an example of operating an idle flag bit in a simulation method for simulating an integrated circuit chip according to an embodiment of the present application. DETAILED DESCRIPTION

[0040] In order to make the objectives, technical solutions and advantages of this application more clear, the application is further described in detail below with reference to the accompanying drawings and examples.

[0041] For example, in an embodiment of the present application, the integrated circuit chip serving as the simulation object may be any processor chip such as a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), a TPU (Tensor Processing Unit), an NPU (Neural Network Processing Unit), a DPU (Deep Learning Processing Unit), an APU (Accelerated Processing Unit), and a GPGPU (General-Purpose computing on Graphics Processing Units).

[0042] For example, in an embodiment of the present application, the integrated circuit chip serving as the simulation target may be deployed in a heterogeneous architecture, and the integrated circuit chip may receive any type of tasks to be processed, such as computing tasks, from a host in the heterogeneous architecture. For example, the heterogeneous architecture may include a CPU serving as the host, and the CPU serving as the host may send tasks to the integrated circuit chip that require the integrated circuit chip to complete.

[0043] Figure 1 This is an exemplary structural diagram of the integrated circuit chip used as the simulation object in the embodiments of this application. Figure 1 In the embodiment of the present application, the integrated circuit chip used as the simulation object may include a command processor (CP) 10 and at least two core partitions (Partitions) 20 .

[0044] For example, in an embodiment of the present application, the command processor 10 may be located in the front-end circuit of an integrated circuit chip. The command processor 10 may be configured to receive tasks (e.g., computing tasks) sent by a host in a heterogeneous architecture in which the integrated circuit chip resides. Furthermore, the command processor 10 may be configured to dispatch tasks (e.g., computing tasks) to at least two core partitions 20. Specifically, the command processor 10 may be configured to dispatch received tasks (e.g., computing tasks) to at least two core partitions 20. The task dispatching implemented by the command processor 10 may be based on the granularity of a complete task sent by the host, or may be based on the granularity of sharded tasks obtained by slicing the complete task sent by the host.

[0045] Exemplarily, in an embodiment of the present application, each kernel partition 20 may include multiple kernel clusters, for example, multiple stream processor clusters (SPCs) for performing computing operations such as reduce operations using kernel functions. The multiple kernel clusters in each kernel partition 20 can share the tasks (e.g., computing tasks) assigned to the kernel partition 20 by the command processor 10, and the task processing results (e.g., the computing results of the computing tasks) obtained after each kernel partition 20 completes the tasks (e.g., computing tasks) can be used to return to the host in the heterogeneous architecture.

[0046] For example, in an embodiment of the present application, after completing a task assigned by the command processor 10, each core partition 20 may report task completion information to the command processor 10 so that the command processor 10 is aware of the completion status of the assigned task. That is, multiple core partitions 20 are used to update the task status maintained in the command processor 10 in response to the completion of the task. In this case, the command processor 10 may maintain a corresponding job pool for each core partition 20. That is, whenever the command processor 10 assigns a new task (e.g., a computing task) to any core partition 20, the command processor 10 may add a record of the newly assigned task to the job pool corresponding to the core partition 20; and whenever the command processor 10 receives task completion information reported by any core partition 20, the command processor 10 may delete the corresponding task record in the job pool corresponding to the core partition 20.

[0047] Illustratively, in an embodiment of the present application, the integrated circuit chip may further include other hardware modules not shown in the accompanying drawings, for example, at least one of an HBM (High Bandwidth Memory) module and a bus controller located in the front-end circuit of the integrated circuit chip.

[0048] For example, in an embodiment of the present application, if the integrated circuit chip further includes an HBM module and a bus controller, then, in addition to directly issuing tasks (e.g., computing tasks) to the command processor 10, the host in the heterogeneous architecture can also implement task issuance in another manner. That is, the host can first transfer the task (e.g., computing task) to the HBM module via the bus controller, and then the command processor 10 can obtain the task (e.g., computing task) from the HBM module. In this case, the task data (e.g., data to be calculated) corresponding to the task (e.g., computing task) can also be first transferred by the host to the HBM module via the bus controller, and then obtained from the HBM module by the multiple core partitions 20 based on the tasks assigned by the command processor 10. Furthermore, after the multiple core partitions 20 complete the task (e.g., computing task), the task processing results (e.g., the calculation results of the computing task) can be temporarily stored in the HBM module and then returned from the HBM module to the host via the bus controller.

[0049] For example, in an embodiment of the present application, the off-chip bus between the integrated circuit chip and the host in the heterogeneous architecture may include a PCIE (Peripheral Component Interconnect Express) bus. In this case, the bus controller that interacts with the host through the off-chip bus may be referred to as a PCIE controller.

[0050] For example, in an embodiment of the present application, the bus controller may access the physical memory of the host through an off-chip bus, and the bus controller may use a DMA (Direct Memory Access) method to access the physical memory.

[0051] Figure 2 This is an exemplary diagram of the software modules corresponding to the configuration of the integrated circuit chip in the embodiment of the present application. Figure 2 In an embodiment of the present application, multiple software modules can be divided into multiple software module groups, wherein the multiple software module groups can include a front-end module group corresponding to the command processor 10 and multiple kernel module groups corresponding to the multiple kernel partitions 20. The front-end module group is used to simulate the command processor 10, and the multiple kernel module groups can be used to simulate the multiple kernel partitions 20 respectively.

[0052] For example, in an embodiment of the present application, if the integrated circuit chip further includes an HBM module and a bus controller, the front-end module group can also be used to simulate the HBM module and the bus controller.

[0053] Illustratively, in an embodiment of the present application, one kernel module group corresponding to each kernel partition 20 among the multiple kernel module groups may include multiple kernel modules corresponding to the multiple kernel clusters in the kernel partition 20 , respectively.

[0054] Exemplarily, in an embodiment of the present application, multiple software modules can be periodically called by a software thread with the software module group as the granularity. In this case, the front-end module group and multiple kernel module groups can be serially called in each call cycle of the multiple software module groups.

[0055] For example, in the embodiments of the present application, whether the command processor 10 dispatches tasks based on the granularity of complete tasks issued by the host or based on the granularity of fragmented tasks obtained by slicing complete tasks, it is difficult to ensure that the task dispatching to multiple kernel partitions 20 is absolutely balanced. That is, for any task issued by the host, it is possible that some kernel partitions 20 will not be assigned a task. Accordingly, the tasks dispatched by the front-end module group (the front-end module group is used to implement the simulation of the command processor 10) to the kernel module group (the kernel module group is used to implement the simulation of the kernel partition 20) may also be uneven within any call cycle in which multiple software module groups are serially called. As a result, kernel module groups that are not assigned a task will not have any data to be processed within that call cycle. Therefore, if, within any call cycle in which multiple software module groups are serially called, invalid calls are executed one by one for all kernel modules in the kernel module group that do not have data to be processed, the software simulation of the integrated circuit chip will be inefficient and time-consuming.

[0056] Figure 3 This is a schematic diagram of an exemplary flow chart of a simulation method for simulating an integrated circuit chip in an embodiment of the present application. Figure 3 In an embodiment of the present application, a simulation method for simulating an integrated circuit chip may include:

[0057] S310: detecting current task states of multiple kernel module groups in the multiple software module groups by calling a front-end module group in the multiple software module groups;

[0058] S330: Based on the detection results of the current task states of the multiple kernel module groups, determine the calling states of the multiple kernel module groups before the next call to the front-end module group; wherein, if the current task state of any kernel module group among the multiple kernel module groups is a non-empty state indicating that the dispatched tasks have not been fully completed, then, the call to the kernel module group is executed in the serial calling process before the next call to the front-end module group; if the current task state of any kernel module group among the multiple kernel module groups is an empty state indicating that the dispatched tasks have been fully completed, then, the call to the kernel module group is skipped in the serial calling process before the next call to the front-end module group.

[0059] Exemplarily, in an embodiment of the present application, S330 may include a serial traversal of multiple kernel module groups, and, during the serial traversal of multiple kernel module groups, it is determined one by one based on the detection result of S310 whether to execute a call to the currently traversed kernel module group.

[0060] For example, in the embodiment of the present application, S310 and S330 may be executed periodically in a loop.

[0061] According to an embodiment of the present application, for an integrated circuit chip including a command processor 10 and multiple core partitions 20, a simulation method for simulating the integrated circuit chip can detect the current task states of multiple kernel module groups corresponding to the multiple kernel partitions 20 in the multiple software modules by calling a front-end module group corresponding to the command processor 10. Thus, by calling the current task states of the multiple kernel module groups detected by the front-end module group, the simulation method can directly skip calls that may be initiated to an entire group of kernel modules that have no data to be processed. Thus, invalid calls to kernel modules that have no data to be processed can be omitted at the kernel module group level. Furthermore, this method helps shorten the software simulation time of the integrated circuit chip by reducing invalid calls to software modules.

[0062] Figure 4 This is a schematic diagram of a working pool for simulating an integrated circuit chip in an embodiment of the present application. Figure 4 Taking p kernel module groups 1-p as an example, where p is a positive integer greater than 1, in an embodiment of the present application, the simulation method can maintain a corresponding work pool i in memory for each kernel module group i in the plurality of kernel module groups 1-p during the periodic loop execution of S310 and S330, where i is a positive integer greater than or equal to 1 and less than or equal to p. The work pool i corresponding to each kernel module group i in the plurality of kernel module groups 1-p can be used to store task records of assigned tasks that have been assigned to the kernel module group i by the front-end module group and have not yet been completed by the kernel module group i.

[0063] For example, in an embodiment of the present application, the simulation method for simulating an integrated circuit chip may further include, before periodically looping through S310 and S330, creating a plurality of working pools 1-p corresponding to the kernel module groups 1-p in the memory. Figure 3 S310 of the process shown may specifically include: by calling the front-end module group, detecting the work pools 1~p corresponding to the multiple kernel module groups 1~p; wherein the detection results of the work pools 1~p corresponding to the multiple kernel module groups 1~p are used to represent the current task status of the multiple kernel module groups 1~p. Figure 3 In S330 of the process shown, based on the detection results of the working pools 1-p corresponding to the multiple kernel module groups 1-p at one time in S310, it can sequentially determine whether to execute the call to the currently traversed kernel module group i or skip the call to the currently traversed kernel module group i.

[0064] Illustratively, in an embodiment of the present application, the working pools 1 - p corresponding to the plurality of kernel module groups 1 - p may be implemented in the form of a queue or a vector.

[0065] For example, in the embodiment of the present application, since the simulation process of the multiple kernel module groups 1~p on the multiple kernel partitions 20 is completed before each call of the front-end module group through S310, and the task completion information reported by the multiple kernel module groups 1~p during the simulation process of the multiple kernel partitions 20 can be cached in the memory, therefore, in order to make the detection result of each call of the front-end module group on the working pool 1~p through S310 accurately reflect the actual task completion status of the multiple kernel module groups 1~p, as shown in FIG. Figure 3 S310 of the illustrated process may further include: before detecting the working pools 1 - p respectively corresponding to the plurality of kernel module groups 1 - p, refreshing the working pools 1 - p respectively corresponding to the plurality of kernel module groups 1 - p by calling the front-end module group.

[0066] Exemplarily, in an embodiment of the present application, the process of refreshing the working pools 1~p corresponding to the multiple kernel module groups 1~p respectively by calling the front-end module group may include: adding the task record assigned to the kernel module group i through the current call to the front-end module group in the working pool i corresponding to any kernel module group i among the multiple kernel module groups 1~p; and, based on the task completion information generated by any kernel module group i among the multiple kernel module groups 1~p before the current call to the front-end module group, deleting the task record corresponding to the task completion information in the working pool i corresponding to the kernel module group i.

[0067] Exemplarily, in an embodiment of the present application, S330 determines to execute a call to any kernel module group among multiple kernel module groups, which may refer to determining to initiate a call serially to multiple kernel modules in the kernel module group, that is, multiple kernel modules of each kernel module group are used to be serially initiated to call during the call period of the kernel module group.

[0068] For example, in an embodiment of the present application, each time the command processor 10 of the integrated circuit chip assigns a task to any kernel partition 20, the task may be evenly divided among the multiple kernel clusters of the kernel partition 20, or may not be evenly divided among the multiple kernel clusters of the kernel partition 20. That is, the problem of unbalanced task assignment not only occurs between multiple kernel partitions 20, but may also occur between multiple kernel clusters in the same kernel partition 20. Accordingly, for any kernel module group whose assigned tasks have not yet been completed, the multiple kernel modules included therein may all have data to be processed, or only a portion of them may have data to be processed. If invalid calls to kernel modules that do not have data to be processed are omitted only at the kernel module group level, invalid calls to a small number of kernel modules that do not have data to be processed may be omitted.

[0069] For example, in an embodiment of the present application, for any kernel module group whose assigned tasks have not been fully completed, a detailed check with kernel modules as the granularity can be initiated to further reduce invalid calls to kernel modules that have no data to be processed, thereby further shortening the software simulation time of the integrated circuit chip.

[0070] Figure 5 Schematic diagram of the optimization principle of the simulation method for simulating an integrated circuit chip in an embodiment of the present application. Figure 5 In an embodiment of the present application, the simulation method for simulating an integrated circuit chip may further include, before periodically looping through S310 and S330, creating, in a memory, idle flag sequences 1-p corresponding to a plurality of kernel module groups 1-p, respectively. Each idle flag sequence i corresponding to each kernel module group i may include q idle flag bits, where q is the total number of kernel modules i_1-i_q included in kernel module group i, and q is a positive integer greater than 1. The idle flag bit i_j in the idle flag sequence i corresponds to the kernel module i_j in kernel module group i, and j is a positive integer greater than or equal to 1 and less than or equal to q.

[0071] For example, in the embodiment of the present application, when the idle flag bit i_j is set to valid "T", it is used to indicate that the data to be processed currently waiting for the kernel module i_j to process is empty; when the idle flag bit i_j is set to invalid "F", it is used to indicate that the data to be processed currently waiting for the kernel module i_j to process is not empty. In this case, if Figure 3In S330 of the process shown, when it is determined that a call is to be executed on any kernel module group i, before executing a call to any kernel module i_j among the multiple kernel modules i_1 to i_q of the kernel module group i, the idle flag sequence i of the kernel module group i is detected, that is, the idle flag bit i_j corresponding to the kernel module i_j currently to be called in the idle flag sequence i of the kernel module group i is detected.

[0072] Illustratively, in an embodiment of the present application, the detection operation of the idle flag i_j corresponding to any kernel module i_j among the multiple kernel modules i_1~i_q of each kernel module group i can be decoupled from the call of the multiple kernel modules i_1~i_q of the kernel module group i.

[0073] For example, in an embodiment of the present application, the data to be processed of any kernel module i_j among the multiple kernel modules i_1 to i_q in each kernel module group i can be stored in an interactive memory space. Furthermore, the interactive memory space can be configured to be accessible only by calling a kernel module. Therefore, access to the interactive memory space is coupled with the calling of the multiple kernel modules i_1 to i_q in any kernel module group i. Unlike the data to be processed, the idle flag sequence i of each kernel module group i can be stored in an open memory space. Furthermore, the open memory space can be independent of the interactive memory space. Therefore, the detection of the idle flag sequence i of any kernel module group i in the open memory space can be decoupled from the calling of the multiple kernel modules in that kernel module group i.

[0074] For example, in the embodiments of the present application, Figure 3 In S330 of the process shown, before calling any kernel module i_j among the multiple kernel modules i_1~i_q of the kernel module group i, if it is detected from the idle flag sequence i of the kernel module group i that the idle flag i_j corresponding to the kernel module i_j is currently invalid, the call to the kernel module i_j is executed; conversely, if it is detected from the idle flag sequence i of the kernel module group i that the idle flag i_j corresponding to the kernel module i_j is currently valid, the call to the kernel module is skipped.

[0075] Illustratively, in an embodiment of the present application, a setting operation of an idle flag i_j corresponding to any kernel module i_j among multiple kernel modules i_1 to i_q of each kernel module group i may be associated with an access operation to the interactive memory space.

[0076] Figure 6 This is a schematic diagram of an example of operating the idle flag bit in the simulation method for simulating an integrated circuit chip in an embodiment of the present application. Figure 6In the embodiments of the present application, Figure 3 In S330 of the illustrated process, the calling of any kernel module i_j among the multiple kernel modules i_1 to i_q of each kernel module group i may include calling an execution function corresponding to the kernel module i_j.

[0077] For example, in an embodiment of the present application, the execution function corresponding to any kernel module i_j, when called, can be used to: perform a read operation on the interactive memory space to obtain the data to be processed provided by the upstream kernel module i_j-1 located on the interactive upstream side of the kernel module i_j; and perform a write operation on the interactive memory space to provide the data processed by the kernel module i_j as the data to be processed by the downstream kernel module i_j+1 located on the interactive downstream side of the kernel module i_j. The downstream kernel modules i_j-1 and i_j+1 described herein can be considered as providers of data to be processed for any kernel module i_j, and recipients of the data to be processed using the task processing results (e.g., the computation results of a computational task) of the kernel module i_j. In this case, the operation of setting the idle flag i_j corresponding to any kernel module i_j among the multiple kernel modules i_1 to i_q in each kernel module group i can be performed by the execution function of the upstream kernel module i_j-1 on the upstream side of the interaction, based on the result of the access operation to the interaction memory space. Accordingly, when the execution function corresponding to any kernel module i_j is called, it can also be used to: when providing data processed by kernel module i_j as to-be-processed data to the downstream kernel module i_j+1 on the downstream side of the interaction with kernel module i_j, execute the operation of setting the idle flag i_j+1 corresponding to the downstream kernel module i_j+1 in the open memory space to invalidate.

[0078] For example, in the embodiments of the present application, Figure 3 The process shown in step S330 of calling any kernel module i_j among the multiple kernel modules i_1 to i_q in each kernel module group i may further include: in response to the completion of the call to the execution function corresponding to kernel module i_j, calling the idle function corresponding to kernel module i_j. The idle function corresponding to any kernel module i_j, when called, may be used to:

[0079] Detecting the interactive memory space, that is, detecting whether there is still data to be processed by the kernel module i_j in the interactive memory space;

[0080] If it is detected that the data to be processed of the kernel module i_ j in the interactive memory space is empty, then the idle flag i_ j corresponding to the kernel module i_ j is set to valid in the open memory space;

[0081] If it is detected that the data to be processed of the kernel module i_ j in the interactive memory space is not empty, then optionally, a set operation is performed on the open memory space to set the idle flag i_ j corresponding to the kernel module i_ j to invalid, even if the idle flag i_ j is in an invalid set state before calling the software module.

[0082] Another embodiment of the present application further provides a simulation device for simulating an integrated circuit chip, which may include a state detection unit and a call execution unit.

[0083] Exemplarily, in an embodiment of the present application, the status detection unit can be used to: detect the current task status of multiple kernel module groups in multiple software module groups by calling the front-end module group in multiple software module groups; wherein, the integrated circuit chip includes a command processor and multiple kernel partitions, the command processor is used to dispatch tasks to the multiple kernel partitions, the multiple kernel partitions are used to update the task status maintained in the command processor in response to the completion of the tasks, the front-end module group is used to simulate the command processor, the multiple kernel module groups are used to simulate the multiple kernel partitions respectively, and the front-end module group and the multiple kernel module groups are serially called in each calling cycle of the multiple software module groups.

[0084] Exemplarily, in an embodiment of the present application, the call execution unit can be used to: determine the call status of multiple kernel module groups before the next call to the front-end module group based on the detection results of the current task status of multiple kernel module groups; wherein, if the current task status of any kernel module group among the multiple kernel module groups is a non-empty state indicating that the dispatched tasks have not been fully completed, then, the serial call process before the next call to the front-end module group executes the call to the kernel module group; if the current task status of any kernel module group among the multiple kernel module groups is an empty state indicating that the dispatched tasks have been fully completed, then, the call to the kernel module group is skipped in the serial call process before the next call to the front-end module group.

[0085] Based on the embodiments of the present application, for an integrated circuit chip including a command processor and multiple core partitions, a simulation device for simulating the integrated circuit chip can detect the current task states of multiple kernel module groups corresponding to the multiple kernel partitions in the multiple software modules by calling a front-end module group corresponding to the command processor in the multiple software modules. Thus, by calling the current task states of the multiple kernel module groups detected by the front-end module group, the simulation device can directly skip calls that may be initiated to the entire group of kernel modules that have no data to be processed. Thus, invalid calls to kernel modules that have no data to be processed can be omitted at the kernel module group level. This, in turn, helps shorten the software simulation time of the integrated circuit chip by reducing invalid calls to software modules.

[0086] For example, in an embodiment of the present application, the state detection unit can also be used to: maintain a corresponding work pool for each kernel module group in the multiple kernel module groups in the memory, and the work pool corresponding to each kernel module group in the multiple kernel module groups is used to store task records of assigned tasks that have been assigned to the kernel module group and have not yet been completed by the kernel module group. In this case, the state detection unit can be specifically configured to detect the current task status of multiple kernel module groups in the multiple software module groups in the following manner: by calling the front-end module group, detecting the work pools corresponding to the multiple kernel module groups respectively; wherein the detection results of the work pools corresponding to the multiple kernel module groups respectively are used to represent the current task status of the multiple kernel module groups.

[0087] Illustratively, in an embodiment of the present application, the calling execution unit may further be configured to: before the status detection unit detects the working pools corresponding to the multiple kernel module groups, respectively, by calling the front-end module group to execute refreshing of the working pools corresponding to the multiple kernel module groups; wherein refreshing of the working pools corresponding to the multiple kernel module groups may include:

[0088] Adding a task record assigned to any kernel module group from among the plurality of kernel module groups by calling the front-end module group to a work pool corresponding to the kernel module group; and

[0089] According to the task completion information of any kernel module group among the multiple kernel module groups before the current call to the front-end module group, the corresponding task record in the working pool corresponding to the kernel module group is deleted.

[0090] For example, in an embodiment of the present application, if each of the multiple core partitions of the integrated circuit chip includes multiple core clusters, then each of the multiple core module groups may include multiple core modules corresponding to the multiple core clusters, and the multiple core modules in each core module group are configured to be serially invoked during the invocation of the core module group. In this case, the process of the call execution unit invoking any of the multiple core module groups may include: before invoking any of the multiple core modules in the core module group, detecting an idle flag sequence of the core module group.

[0091] For example, in an embodiment of the present application, the idle flag sequence of each kernel module group may include an idle flag corresponding to each kernel module in the multiple kernel modules of the kernel module group; when the idle flag of any kernel module in the multiple kernel modules of each kernel module group is set to valid, it is used to indicate that the pending data currently waiting to be processed by the kernel module is empty; and the detection operation of the idle flag corresponding to any kernel module in the multiple kernel modules of each kernel module group can be decoupled from the call to the multiple kernel modules of the kernel module group. In this case, if it is detected that the idle flag corresponding to any kernel module is currently invalid before the call is executed on any kernel module, the call to the kernel module is executed; if it is detected that the idle flag corresponding to the kernel module is currently valid before the call is executed on any kernel module, the call to the kernel module is skipped.

[0092] For example, in the embodiment of the present application, the further detailed working principle of calling the execution unit can be found in the above description of Figure 3 The description of S330 of the process shown is not repeated here.

[0093] Another embodiment of the present application further provides an electronic device, such as a server, which may include a processor (such as a CPU) that can be used to execute the simulation method in the aforementioned embodiment.

[0094] Another embodiment of the present application further provides a non-transitory computer-readable storage medium, which stores instructions. When these instructions are executed by a processor (eg, a CPU), the processor can implement the simulation method in the aforementioned embodiment.

[0095] Another embodiment of the present application further provides a computer program product, including computer-executable instructions, which implement the simulation method in the aforementioned embodiment when executed by a processor (such as a CPU).

[0096] It can be understood that, in the embodiments of the present application, the various parts of the content exemplified can be in an "and / or" relationship. In this article, the meaning of "and / or" refers to the context in which it is connected, which can be a common limiting relationship of "and", or can also be an alternative limiting relationship of "or". Therefore, the various parts of the content with an "and / or" relationship can be understood as including different combinations of situations in which "and / or" between each two parts of the content respectively represents a common limiting relationship of "and" or an alternative limiting relationship of "or", and this combination of different situations can be considered to be basically equivalent to the limiting scope of "at least one of the parts".

[0097] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A simulation method for simulating an integrated circuit chip, characterized in that: include: The method comprises: detecting current task states of multiple kernel module groups among the multiple software module groups by calling a front-end module group among the multiple software module groups; wherein the integrated circuit chip includes a command processor and multiple kernel partitions, the command processor is used to dispatch tasks to the multiple kernel partitions, the multiple kernel partitions are used to update task states maintained in the command processor in response to completion of tasks, the front-end module group is used to simulate the command processor, and the multiple kernel module groups are used to simulate the multiple kernel partitions respectively, and the front-end module group and the multiple kernel module groups are serially called in each calling cycle of the multiple software module groups; Based on the detection results of the current task states of the multiple kernel module groups, the calling states of the multiple kernel module groups before the next call to the front-end module group are determined; wherein, if the current task state of any kernel module group among the multiple kernel module groups is a non-empty state indicating that the dispatched tasks have not been fully completed, then the call to the kernel module group is executed in the serial calling process before the next call to the front-end module group; if the current task state of any kernel module group among the multiple kernel module groups is an empty state indicating that the dispatched tasks have been fully completed, then the call to the kernel module group is skipped in the serial calling process before the next call to the front-end module group.

2. The simulation method according to claim 1, wherein: The simulation method further includes: maintaining a corresponding work pool for each of the plurality of kernel module groups in a memory, and the work pool corresponding to each of the plurality of kernel module groups is used to store task records of assigned tasks that have been assigned to the kernel module group and have not yet been completed by the kernel module group; The detecting current task states of multiple kernel module groups in the multiple software module groups by calling the front-end module group in the multiple software module groups includes: By calling the front-end module group, the working pools corresponding to the multiple kernel module groups are detected; wherein the detection results of the working pools corresponding to the multiple kernel module groups are used to represent the current task status of the multiple kernel module groups.

3. The simulation method according to claim 2, wherein: Before detecting the working pools respectively corresponding to the plurality of kernel module groups, the simulation method further comprises: refreshing the working pools respectively corresponding to the plurality of kernel module groups by calling the front-end module group; The refreshing of the working pools corresponding to the plurality of kernel module groups includes: Adding a task record assigned to any kernel module group among the plurality of kernel module groups through the current call to the front-end module group to a work pool corresponding to the kernel module group; and According to the task completion information of any kernel module group among the multiple kernel module groups before the current call to the front-end module group, the corresponding task record in the working pool corresponding to the kernel module group is deleted.

4. The simulation method according to claim 1, wherein: Each kernel partition of the plurality of kernel partitions includes a plurality of kernel clusters, each kernel module group of the plurality of kernel module groups includes a plurality of kernel modules corresponding to the plurality of kernel clusters, and the plurality of kernel modules of each kernel module group are configured to be serially invoked during an invocation period of the kernel module group; The process of executing a call on any kernel module group among the plurality of kernel module groups includes: before executing a call on any kernel module among the plurality of kernel modules of the kernel module group, detecting an idle flag sequence of the kernel module group; in: An idle flag sequence of each kernel module group includes an idle flag bit corresponding to each kernel module in the plurality of kernel modules of the kernel module group; When the idle flag of any kernel module among the multiple kernel modules in each kernel module group is set to valid, it is used to indicate that the pending data currently waiting to be processed by the kernel module is empty; and the detection operation of the idle flag corresponding to any kernel module among the multiple kernel modules in each kernel module group is decoupled from the call of the multiple kernel modules in the kernel module group; If, before executing a call to any kernel module, it is detected that the idle flag corresponding to the kernel module is currently invalid, then executing the call to the kernel module; If, before calling any kernel module, it is detected that the idle flag corresponding to the kernel module is currently valid, the calling of the kernel module is skipped.

5. The simulation method according to claim 4, characterized in that: The to-be-processed data of any kernel module among the multiple kernel modules of each kernel module group is stored in an interactive memory space, and an access operation to the interactive memory space is coupled with a call to the multiple kernel modules of the kernel module group; The idle flag sequence of each kernel module group is stored in an open memory space, which is independent of the interactive memory space. In addition, the detection operation of the idle flag sequence of each kernel module group in the open memory space is decoupled from the call of the multiple kernel modules of the kernel module group.

6. The simulation method according to claim 5, characterized in that: The setting operation of the idle flag corresponding to any kernel module among the multiple kernel modules of each kernel module group is associated with the access operation to the interactive memory space.

7. The simulation method according to claim 6, characterized in that: The calling of any kernel module among the plurality of kernel modules of each kernel module group includes: calling an execution function corresponding to the kernel module; Wherein, the execution function corresponding to any kernel module is used to: Performing a read operation on the interactive memory space to obtain data to be processed provided by an upstream kernel module located at an interactive upstream side of the kernel module for the kernel module; and A write operation is performed on the interactive memory space to provide the data processed by the kernel module as data to be processed by a downstream kernel module on the interactive downstream side of the kernel module.

8. The simulation method according to claim 7, characterized in that: The execution function corresponding to any kernel module is also used when called to: A setting operation is performed on the open memory space, where the setting operation is used to set the idle flag corresponding to the downstream kernel module to be invalid.

9. The simulation method according to claim 7, characterized in that: The calling of any kernel module among the plurality of kernel modules of each kernel module group further comprises: in response to completion of the calling of the execution function corresponding to the kernel module, calling an idle function corresponding to the kernel module; Wherein, the idle function corresponding to any kernel module is used when called: detecting the interactive memory space; If it is detected that the data to be processed by the kernel module in the interactive memory space is empty, a setting operation is performed on the open memory space, and the setting operation is used to set the idle flag corresponding to the kernel module to be valid.

10. A simulation device for simulating an integrated circuit chip, characterized in that: include: a state detection unit, configured to detect current task states of multiple kernel module groups among the multiple software module groups by calling a front-end module group among the multiple software module groups; wherein the integrated circuit chip includes a command processor and multiple kernel partitions, the command processor is configured to dispatch tasks to the multiple kernel partitions, the multiple kernel partitions are configured to update task states maintained in the command processor in response to completion of tasks, the front-end module group is configured to simulate the command processor, the multiple kernel module groups are configured to simulate the multiple kernel partitions respectively, and the front-end module group and the multiple kernel module groups are serially called within each call cycle of the multiple software module groups; A calling execution unit is used to determine the calling status of the multiple kernel module groups before the next call to the front-end module group based on the detection results of the current task status of the multiple kernel module groups; wherein, if the current task status of any kernel module group among the multiple kernel module groups is a non-empty state indicating that the dispatched tasks have not been fully completed, then the serial calling process before the next call to the front-end module group executes the call to the kernel module group; if the current task status of any kernel module group among the multiple kernel module groups is an empty state indicating that the dispatched tasks have been fully completed, then the call to the kernel module group is skipped in the serial calling process before the next call to the front-end module group.

11. An electronic device, characterized in that: The method comprises a processor configured to execute the simulation method according to any one of claims 1 to 9.

12. A non-transitory computer-readable storage medium, characterized in that The non-transitory computer-readable storage medium stores instructions, which, when executed by a processor, cause the processor to implement the simulation method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Simulation test method and system of on-chip system

    CN101344899A

  • Software and hardware joint simulation platform for processor chip architecture verification

    CN119047401A