Simulation task processing method and device and medium
By automating the analysis of available resources and managing task queues within the hardware simulation platform, the problem of task failures caused by resource allocation conflicts is resolved, achieving efficient resource utilization and smooth task execution, thereby improving user experience and the operational efficiency of the simulation platform.
Patent Information
- Application Number
- CN202511075111.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-11-04
AI Technical Summary
The problem of task submission failure caused by resource allocation conflicts in the hardware simulation platform forces users to repeatedly and manually modify resource configurations, resulting in low efficiency.
By automating the analysis of available resources in the hardware simulation platform, generating a queue of tasks to be executed, and automatically allocating resources to simulation tasks when available resources exist, including user authentication, priority management, and resource binding mechanisms, the efficient utilization of resources and the smooth execution of tasks are ensured.
This avoids resource allocation conflicts, improves user work efficiency, reduces the time and effort required for manual configuration, and ensures efficient resource utilization and successful execution of simulation tasks.
Smart Images

Figure CN120892205A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of simulation technology, and in particular to a simulation task processing method, device and medium. Background Technology
[0002] As chip design becomes increasingly complex, such as SoC (System-on-Chip) design, traditional software simulation is gradually failing to meet the testing and verification needs of chip design. In contrast, hardware simulation platforms, through dedicated hardware architectures, execute design simulations in parallel, significantly shortening testing and verification time. They also provide rich debugging tools, enabling simultaneous testing and verification of driver and hardware designs, thus meeting the testing and verification requirements of complex chip designs. However, despite the powerful performance of hardware simulation platforms, their resources are limited. Often, when users interact with these platforms, resource access conflicts arise. Multiple users specifying resource configurations will frequently encounter the same configuration, leading to task submission failures. In such cases, users need to repeatedly manually modify the resource configurations and resubmit the task, a time-consuming and inefficient process.
[0003] It is evident that effectively resolving issues such as task submission failures caused by resource allocation conflicts in hardware simulation platforms is a problem that needs to be addressed by those skilled in the art. Summary of the Invention
[0004] The purpose of this invention is to provide a simulation task processing method, device, and medium that can solve problems such as task submission failure caused by resource allocation conflicts in hardware simulation platforms.
[0005] To address the aforementioned technical problems, embodiments of the present invention provide a simulation task processing method applied to a hardware simulation platform, comprising:
[0006] Determine if the hardware simulation platform has available resources;
[0007] If no available resources are available on the hardware simulation platform, and a simulation task is received, the queuing attribute of the user corresponding to the received simulation task is obtained.
[0008] If the queuing attribute is set to accept queuing, the received simulation tasks will be added to the queue to be executed.
[0009] If there are available resources on the hardware simulation platform, and if there are simulation tasks to be executed or a simulation task has been received in the queue to be executed, then the first simulation task in the queue to be executed or the received simulation task is determined as the current simulation task.
[0010] Determine the target resources to allocate to the current simulation task from the available resources based on the resource requirements of the current simulation task;
[0011] Bind the target resource and the current simulation task to execute the current simulation task based on the target resource.
[0012] Optional, also includes:
[0013] If a simulation task is received, obtain the user information of the user corresponding to the simulation task;
[0014] User authentication is performed based on user information;
[0015] If the user's identity is successfully authenticated, the user information will be stored in the preset user authentication table.
[0016] Optionally, after storing user information in a preset user authentication table, the method further includes:
[0017] Generate the user's authentication validity period;
[0018] A randomly generated authenticated string with an expiration date equal to the authentication validity period is used to identify the user;
[0019] Upon receiving a simulation task, check whether the user corresponding to the simulation task carries an authentication string;
[0020] If so, the user's identity authentication is deemed successful.
[0021] Optionally, obtain the queuing attributes of the user corresponding to the received simulation task, including:
[0022] If no available resources are available on the hardware simulation platform, and a simulation task is received, an inquiry command is sent to the user corresponding to the received simulation task; the inquiry command is configured to ask the user whether to accept the queue.
[0023] The queuing attribute of the user corresponding to the received simulation task is determined based on the user's response to the query command.
[0024] Optional, also includes:
[0025] Set priority tags for received simulation tasks based on the permission priority of the subject to which the received simulation task belongs.
[0026] If there are simulation tasks to be executed in the queue or a simulation task has been received, before determining the first simulation task in the queue or the received simulation task as the current simulation task, the following steps are also included:
[0027] Add all received simulation tasks to the execution queue and adjust the queue order of each simulation task in the execution queue according to the priority label.
[0028] Optionally, after binding the target resource and the current simulation task, it also includes:
[0029] While executing the current simulation task, record the resource usage of the current simulation task.
[0030] After completing the current simulation task, the binding between the target resource and the current simulation task is released, so that the target resource can be made available.
[0031] Optionally, determine whether the hardware simulation platform has available resources, including:
[0032] The system configuration file of the hardware simulation platform is used to generate the first set of resource units of the hardware simulation platform and the second set of module units corresponding to each resource unit.
[0033] Determine the Cartesian product set of the first set and the second set, and define the Cartesian product set as the total resource set of the hardware simulation platform;
[0034] Get the current occupancy status of resource units and module units, and generate the set of used resources corresponding to the current occupancy status;
[0035] The difference between the total set of resources and the set of used resources is used to determine the set of available resources.
[0036] If the set of available resources is not empty, then the hardware simulation platform is determined to have available resources.
[0037] If the set of available resources is empty, it is determined that there are no available resources on the hardware simulation platform.
[0038] Optionally, determine whether the hardware simulation platform has available resources, including:
[0039] Configure resource identifiers for each element in the overall resource set;
[0040] The system polls and probes each element in the overall resource set according to a preset cycle.
[0041] If available resources are detected in the total resource set, the process jumps to the step where, if there is a simulation task to be executed in the queue or a simulation task has been received, the first simulation task in the queue or the received simulation task is determined as the current simulation task.
[0042] Determine the target resources to allocate to the current simulation task from the available resources based on the resource requirements of the current simulation task, including:
[0043] Randomly select several resource modules from the available resources and set occupancy tags for the selected resource modules; wherein the idle resources of the selected resource modules are greater than or equal to the resources required by the current simulation task; a resource module includes at least one resource unit and at least one module unit corresponding to the resource unit;
[0044] Bind the target resource and the current simulation task, including:
[0045] The resource identifier corresponding to the idle resource of the resource module carrying the occupied tag is filled into the resource usage variable of the user corresponding to the current simulation task in the preset user authentication table to complete the binding between the target resource and the current simulation task.
[0046] To address the aforementioned technical problems, embodiments of the present invention also provide an electronic device, comprising:
[0047] Memory, used to store computer programs;
[0048] A processor is used to execute computer programs to implement the steps of the simulation task processing method described above.
[0049] To address the aforementioned technical problems, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the simulation task processing method described above.
[0050] As can be seen from the above technical solution, the hardware simulation platform automatically analyzes whether it has available resources. If no resources are available, it generates a queue of tasks to be executed based on user preferences. If resources are available, it automatically allocates them to simulation tasks waiting to be executed in the queue or to newly submitted simulation tasks, promptly allocating and binding available resources to the simulation tasks that need to be executed. The beneficial effect of this invention is that by setting up an automatic resource allocation and binding process in the hardware simulation platform, it achieves automated resource management, thereby avoiding resource allocation conflicts and task submission failures caused by user configuration. Simultaneously, users do not need to repeatedly manually modify resource configurations and submit tasks, saving time and effort, improving user efficiency and user experience, and effectively ensuring efficient resource utilization and improving the execution efficiency of simulation tasks. Attached Figure Description
[0051] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 A flowchart illustrating a simulation task processing method provided in an embodiment of the present invention;
[0053] Figure 2 A flowchart illustrating another simulation task processing method provided in an embodiment of the present invention;
[0054] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0055] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0056] The terms "comprising" and "having," and any variations thereof, in the specification and accompanying drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may include steps or units not listed.
[0057] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0058] Next, a simulation task processing method provided by an embodiment of the present invention will be described in detail, applied to a hardware simulation platform. See also... Figure 1 As shown, Figure 1 This is a flowchart illustrating a simulation task processing method provided in an embodiment of the present invention; the simulation task processing method includes:
[0059] S11: Determine if there are available resources on the hardware simulation platform;
[0060] It is easy to understand that, to avoid resource configuration conflicts arising from users manually modifying resource configurations, this application provides a simulation task processing method applied in a hardware simulation platform. This method automates resource configuration for simulation tasks submitted by each user. To achieve resource optimization and sharing, hardware simulation platforms typically serve multiple users. However, the physical hardware resources of the hardware simulation platform are limited. Therefore, when automatically allocating resources for simulation tasks, it is necessary to first determine whether the hardware simulation platform has available resources. Available resources refer to the various hardware and software resources that the hardware simulation platform can currently provide to users; that is, resources that are currently not occupied within the hardware simulation platform.
[0061] It should be noted that the core objective of a hardware simulation platform is to reproduce the physical characteristics, electrical behavior, and timing logic of hardware entities, ultimately verifying whether the hardware itself can function properly or whether the software runs as expected on the hardware. This requires a dedicated hardware architecture to achieve reproduction and simulation through hardware logic. Therefore, for a hardware simulation platform, its resources mainly refer to the hardware resources within the platform. Hardware resources are the sum of physical hardware components used to implement the simulation of the design to be verified, i.e., the dedicated hardware architecture upon which the simulation depends, and are the supporting physical resources of the hardware simulation platform itself. The hardware simulation platform needs to allocate appropriate hardware resources for each simulation task to support the simulation operation of the corresponding task. This application does not specifically limit the specific type and implementation method of the hardware simulation platform. Furthermore, a hardware simulation acceleration platform can be implemented by adding dedicated acceleration hardware modules on top of the dedicated hardware architecture to further shorten the simulation time. This application does not impose any particular restrictions on the specific type and implementation method of the dedicated hardware architecture. It can be implemented using FPGA (Field Programmable Gate Array), ASIC (Application Specific Integrated Circuit), etc. For example, an FPGA cluster or processor array can be used to implement the dedicated hardware architecture of the hardware simulation platform. The detection of available resources in the hardware simulation platform can be performed each time a new simulation task is received, or it can be implemented by polling at a specific period. This application does not impose any particular restrictions on the detection frequency and specific detection method of available resources.
[0062] S12: If no available resources are available on the hardware simulation platform, and a simulation task is received, obtain the queuing attribute of the user corresponding to the received simulation task.
[0063] Understandably, if the hardware simulation platform does not have available resources when it receives a simulation task submitted by a user, it means that the hardware simulation platform cannot immediately execute the simulation task. In this case, it is necessary to further determine whether the user accepts the simulation task and queues it. Therefore, it is necessary to obtain the queuing attribute of the user corresponding to the received simulation task. The queuing attribute includes accepting the queue and not accepting the queue. This application does not make any special restrictions on the specific type and implementation method of the queuing attribute. The queuing attribute can be configured not only for a single user, such as user 1 accepting the queue and user 2 not accepting the queue, but also for a single simulation task, such as user 1 accepting the queue for task 1 and user 1 not accepting the queue for task 2. The queuing attribute can be configured in advance according to the user's actual application scenario and the different types of simulation tasks, or the user can determine whether to accept the queue based on the actual situation when submitting the simulation task and then configure it.
[0064] It should be noted that simulation tasks refer to user tasks submitted to the hardware simulation platform for simulation verification. Simulation tasks mainly include the Design Under Test (DUT) that the user needs to verify. This application does not specifically limit the specific type or implementation method of the DUT, which can be a chip, FPGA logic, complex circuit, etc. This application also does not specifically limit the specific implementation method of the simulation task or the specific method by which the user submits the simulation task; the user can directly submit the task through corresponding commands.
[0065] S13: If the queuing attribute is to accept queuing, then add the received simulation task to the queue to be executed;
[0066] It is easy to understand that if the received simulation task or its corresponding user accepts the queue, then the simulation task can be added to the execution queue and can continue execution once the hardware simulation platform has available resources. This application does not specifically limit the specific type or implementation method of the execution queue.
[0067] S14: If there are available resources on the hardware simulation platform, and if there are simulation tasks to be executed or a simulation task has been received in the queue to be executed, then the first simulation task in the queue to be executed or the received simulation task is determined as the current simulation task.
[0068] It should be noted that once the hardware simulation platform has available resources, it will extract simulation tasks from the execution queue for execution, or directly execute new simulation tasks upon receiving them. To ensure the fairness of resource allocation and maintain the orderliness of task processing, when the hardware simulation platform has available resources, it will first determine whether there are any simulation tasks to be executed in the execution queue. If there are simulation tasks to be executed in the execution queue, they will be executed sequentially according to the order of the queue. Therefore, if the hardware simulation platform receives a new simulation task while there are simulation tasks to be executed in the execution queue, the available resources will be prioritized for allocation to the simulation tasks to be executed. That is, the simulation tasks to be executed in the execution queue will be prioritized as the current simulation task, which refers to the simulation task currently undergoing resource allocation. If all simulation tasks to be executed have completed resource allocation and the hardware simulation platform still has available resources, they will continue to be allocated to the newly received simulation tasks. If all available resources are occupied and there are still simulation tasks to be executed in the execution queue, then it is necessary to determine the queuing attribute of this new simulation task and repeat steps S12 and S13.
[0069] S15: Determine the target resources to be allocated to the current simulation task from the available resources based on the resource requirements of the current simulation task;
[0070] It is understandable that, after determining the current simulation task, resources can be automatically allocated to the current simulation task based on available resources. During allocation, the actual resource requirements of the current simulation task are considered, and suitable target resources are assigned to the current simulation task. Required resources refer to the sum of all types of hardware and software resources, environment configurations, and parameter conditions necessary to complete the simulation task. In this application, it mainly refers to the type and specifications (including the size) of the hardware resources required by the simulation task. This application does not specifically limit the method for determining the required resources or the specific implementation method.
[0071] S16: Bind the target resource and the current simulation task to execute the current simulation task based on the target resource.
[0072] It is easy to understand that once the target resources to be allocated to the current simulation task are determined, the target resources can be bound together with the current simulation task, thereby achieving automatic resource allocation for the current simulation task. Subsequently, the hardware simulation platform will execute each simulation task based on the binding relationship between resources and simulation tasks. This application does not impose any special limitations on the specific binding method between target resources and the current simulation task.
[0073] Furthermore, this invention proposes a method for user authentication, automated resource allocation, and priority management of user-submitted simulation tasks within a hardware simulation acceleration platform. See also... Figure 2 As shown, Figure 2 This is a flowchart illustrating another simulation task processing method provided by an embodiment of the present invention. The simulation task processing method provided by the present invention not only designs an automated resource allocation process, but also further designs a processing method for the entire lifecycle of a simulation task from submission to completion. The entire simulation task processing method is implemented through several automated configuration modules: a user authentication module, a priority setting module, a resource unit acquisition module, a priority judgment module, a polling random detection module, and a task execution tracking module. These modules are all software functional modules integrated in the hardware simulation platform, used to implement different processes in the simulation task processing method. The following section combines... Figure 2 The entire simulation task processing method will be further explained.
[0074] First, the user submits a simulation task to the hardware simulation platform, along with their user information. The first step involves the hardware simulation platform receiving the submitted task in real-time. The second step involves the user authentication module verifying the user's identity using the information carried in the simulation task. Only after successful authentication can subsequent steps proceed. The third step involves the priority setting module assigning priorities to authenticated users and simulation tasks, tackling them with appropriate priority labels, before proceeding to the next step. The fourth step involves the resource unit acquisition module determining the available resource set of the hardware simulation platform in real-time based on the total resource set and currently occupied resources. It then checks if the available resource set is empty. If empty, it indicates that all resource units in the hardware simulation platform are currently used up, and the process proceeds to the fifth step; otherwise, it proceeds to the seventh step. Step 5: If available resources are exhausted, the hardware simulation platform confirms whether the user or simulation task accepts queuing. If queuing is not accepted, the simulation task is canceled from the queue and exited. If queuing is accepted, the simulation task is added to the execution queue and the process continues to Step 6. Step 6: The priority judgment module dynamically adjusts the task order in the execution queue using the priority tags set for each simulation task in Step 3, forming an immediate sequential queue, and then proceeds to Step 7. Step 7: The polling random probe module polls the total resource set from Step 4 at specific intervals to determine in real-time whether the hardware simulation platform has available resources. Once idle resources become available, a random probe is performed on the available resource set, and resource units that can meet the simulation task's requirements are tagged with the corresponding occupied tag, then proceeds to Step 8. Step 8: The resource unit setting module combines the adjusted execution queue order from Step 6 and the occupied tags from Step 7 to allocate hardware resources from the simulation platform to the simulation task in real-time. Simultaneously, during the simulation task execution, the hardware simulation platform continuously records resource usage and performs tracking operations on each simulation task. Finally, when the simulation task is completed, the hardware resources bound to the simulation task will be released synchronously, completing a whole task execution cycle.
[0075] Throughout the task flow, the user authentication module verifies the identity of the user submitting the task, and the priority setting module assigns priority tags to the task. The resource unit acquisition module generates a set of available resources and, in conjunction with the polling random probe module, dynamically calculates and probes for idle available resources. The resource unit setting module binds the simulation task to hardware resources, generating exclusive resource locks to prevent resource conflicts. The task execution tracking module monitors resource usage in real time and releases resources after the simulation task is completed. Ultimately, through the collaborative work of these modules, efficient scheduling of simulation tasks and secure allocation of resources are achieved, ensuring that high-priority tasks are executed first, avoiding resource abuse and task blocking issues, resolving user task conflict failures, and addressing the problem of inefficient resource utilization in the hardware simulation acceleration platform. Addressing the needs of client user authentication and authorization, matching task priorities with user priorities, and automated resource acquisition, a systematic automated simulation task processing method is proposed. This method closely integrates with the actual needs of user tasks, efficiently and automatically completing user authentication and authorization, task priority configuration, and automated resource unit acquisition. Ultimately, it ensures that each user can securely and efficiently obtain the required resources after task submission, thereby improving the resource utilization and operational efficiency of the hardware simulation platform.
[0076] This invention provides a method for processing simulation tasks, implementing a systematic automated approach in a hardware simulation platform. This method efficiently authenticates and authorizes client users, improves priority configuration for simulation tasks or users, and automates resource acquisition. It ensures that simulation tasks can securely and efficiently acquire the necessary resources, preventing task failures due to resource configuration conflicts. This optimizes the user's task submission experience, improves resource utilization and operational efficiency of the hardware simulation platform, and achieves efficient resource utilization. The hardware simulation platform incorporates user authentication, priority management, automated resource allocation, and dynamic scheduling mechanisms. Through automated operations, it achieves automated verification, correct allocation, and priority management of the limited resources used by user tasks within the hardware simulation platform. This improves the security and resource utilization of the hardware simulation platform, providing users with a more efficient and reliable simulation environment.
[0077] As an optional embodiment, it also includes:
[0078] If a simulation task is received, obtain the user information of the user corresponding to the simulation task;
[0079] User authentication is performed based on user information;
[0080] If the user's identity is successfully authenticated, the user information will be stored in the preset user authentication table.
[0081] Understandably, upon receiving a new simulation task, the hardware simulation platform will first obtain the user information corresponding to the simulation task for user authentication. The user corresponding to the simulation task refers to the user who submitted the simulation task. User information refers to the identity configuration information that can identify the user, including but not limited to user ID (Identifier), username, or other types of identity identifiers. This application does not make any special restrictions on the specific type and implementation method of user information. This application does not make any special restrictions on the specific method of user authentication. It can be implemented by information verification and other methods. User identity authentication is achieved by verifying the validity of user information. Generally, rules or criteria for judging whether user information is validly authorized are configured in advance in the hardware simulation platform. Various types of encryption algorithms can also be used to implement user authentication.
[0082] As a specific implementation example, taking asymmetric encryption algorithms for user authentication, if a user submits a simulation task for the first time, that user is unauthenticated and requires identity verification. When submitting a simulation task, any user must simultaneously carry or directly add their corresponding public key to the simulation task. To ensure the consistency of the user information submitted during authentication, after obtaining user information (e.g., the user's public key), the hardware simulation platform integrates the user information into a standard format using a key-value dictionary structure. Specifically, this standard format user information can be user variable dictionary configuration information, which centrally manages a set of variable parameters, attributes, or configuration items related to the user using a key-value dictionary structure. Then, the hardware simulation platform authenticates the user based on this standard format user information. For example, when the user information includes the user's public key, the hardware simulation platform decrypts the user's public key using a pre-set private key and then compares the decrypted information with the pre-saved valid user information. If they match, the user authentication is successful.
[0083] It should be noted that the hardware simulation platform can pre-set a system table containing all valid user information. Upon receiving user information, it directly compares it with the valid user information in the pre-set system table, achieving authentication through this information verification process. After authentication, the user information can be encrypted and stored in the pre-set user authentication table, allowing the hardware simulation platform to manage simulation tasks accordingly. If authentication fails, it indicates that the user is anonymous to the hardware simulation platform, and the simulation task is terminated. This application does not specifically limit the encryption method for authenticated user information, nor does it impose any particular restrictions on the implementation of the pre-set system table.
[0084] Specifically, user authentication and encrypted storage mechanisms for user information are used to ensure that only authorized users can effectively submit simulation tasks and use the hardware resources of the hardware simulation platform, thereby effectively preventing unauthorized access and avoiding potential security risks. Based on user authentication, the limited resources in the hardware simulation platform are allocated accurately and controllably, further optimizing resource allocation and ensuring resource security.
[0085] As an optional embodiment, after storing user information in a preset user authentication table, the method further includes:
[0086] Generate the user's authentication validity period;
[0087] A randomly generated authenticated string with an expiration date equal to the authentication validity period is used to identify the user;
[0088] Upon receiving a simulation task, check whether the user corresponding to the simulation task carries an authentication string;
[0089] If so, the user's identity authentication is deemed successful.
[0090] Considering that a single user typically submits multiple simulation tasks to the hardware simulation platform, to facilitate subsequent authentication, after a user has been authenticated, the hardware simulation platform randomly generates a string to identify the authenticated user. Simultaneously, an authentication validity period is set for each authenticated user. Within this validity period, the generated string remains valid. When an authenticated user submits a simulation task subsequently, they can simply include this string. Upon detecting a valid string, the hardware simulation platform can directly begin processing the simulation task without requiring repeated user authentication. This application does not impose specific limitations on the specific type and implementation method of the authentication string; other marking methods can also be used to identify authenticated users. The string can be configured to automatically expire after the authentication validity period, or the validity period can be determined based on the session record after receiving the string. This application does not impose specific limitations on the specific setting method for the authentication validity period. By setting the authentication validity period, the hardware simulation platform will retain the user's session record for a period of time, awaiting the user's next task submission.
[0091] It should be further explained that the preset user authentication table can also be used to manage the authentication validity period of authenticated users. The preset user authentication table stores user information and the corresponding authentication validity period, so that the hardware simulation platform can generate an authentication string based on the preset user authentication table and determine how long each user's session record should be retained. After a user's authentication validity period expires, the corresponding authentication string will also become invalid, and the user will need to re-authenticate when submitting simulation tasks in the future.
[0092] Specifically, by adding a mechanism to store random strings for authenticated users, users within their authentication validity period can submit tasks multiple times without repeated authentication, saving time on resource allocation and further improving the resource utilization and overall operational efficiency of the hardware simulation platform. Furthermore, through encrypted storage of user information, setting authentication validity periods, and a random string generation mechanism, the security and efficiency of the user authentication process are ensured, the lifecycle of each user is clearly defined, and timeliness control of each user is achieved, thereby improving the security and reliability of the entire hardware simulation platform.
[0093] As an optional embodiment, obtaining the queuing attributes of the user corresponding to the received simulation task includes:
[0094] If no available resources are available on the hardware simulation platform, and a simulation task is received, an inquiry command is sent to the user corresponding to the received simulation task; the inquiry command is configured to ask the user whether to accept the queue.
[0095] The queuing attribute of the user corresponding to the received simulation task is determined based on the user's response to the query command.
[0096] It is easy to understand that there are multiple options for determining the queuing attribute corresponding to a simulation task. One approach is to interact with the user of the simulation task by sending an inquiry command to determine whether the user and the simulation task can currently accept queuing. Alternatively, the user can inform the hardware simulation platform of the queuing attribute (whether the simulation task should be queued by default) through a specific variable when submitting the simulation task. For example, a preset user authentication table can simultaneously store the user's corresponding user variable dictionary configuration information. Then, the value corresponding to the key "queue_up" in dictionary s can be read. If the value corresponding to this key is true, it means that the simulation task continues to queue by default; if the value corresponding to this key is false, it means that the simulation task does not queue. This application does not specifically limit the specific method of obtaining the queuing attribute, nor is it limited to the implementation method of this embodiment. Similarly, this application does not specifically limit the specific implementation method of the inquiry command.
[0097] Specifically, by issuing query commands to users to obtain their current queuing intentions or those of simulation tasks, and proactively informing users of the current queuing status, the user experience is improved. By determining queuing attributes, users who are unwilling to wait are filtered out to avoid occupying queuing slots in the execution queue, thus optimizing resource allocation and reducing management costs. This approach protects users' right to choose and their experience while helping the hardware simulation platform allocate resources more efficiently and reduce potential conflicts.
[0098] As an optional embodiment, it also includes:
[0099] Set priority tags for received simulation tasks based on the permission priority of the subject to which the received simulation task belongs.
[0100] If there are simulation tasks to be executed in the queue or a simulation task has been received, before determining the first simulation task in the queue or the received simulation task as the current simulation task, the following steps are also included:
[0101] Add all received simulation tasks to the execution queue and adjust the queue order of each simulation task in the execution queue according to the priority label.
[0102] Understandably, to further improve the efficiency of the hardware simulation platform in processing tasks, priority tags can be set for each received simulation task. After a simulation task is added to the execution queue, the hardware simulation platform will quickly sort the simulation tasks in the queue according to the priority tags, with higher-priority simulation tasks appearing first and lower-priority tasks appearing last. This ensures that when available resources exist, the hardware simulation platform can prioritize processing important or urgent simulation tasks. This application does not specifically limit the specific method of setting priority tags. For the hardware simulation platform, the entity to which a simulation task belongs refers to the product line to which the simulation task belongs. When submitting a simulation task, the user can also include relevant information about the product line to which the simulation task belongs (including permission priority). The hardware simulation platform then refers to the permission priority of each product line to set the priority tags for each simulation task. Generally speaking, the higher the permission and priority of a product line, the higher the priority of the simulation task. Priority tags can also be set according to the queuing strategy set by the user.
[0103] It should be noted that the hardware simulation platform can configure a custom timer for the queue to be executed. This custom timer is used to set a preset time interval, and at these intervals, the order of tasks in the queue will be dynamically adjusted to ensure the accurate sorting of simulation tasks. When the hardware simulation platform has available resources, it will allocate resources according to the current order in the queue. This application does not impose any specific limitations on the frequency of updating the queue order or the specific implementation method.
[0104] Specifically, when available resources are exhausted, the hardware simulation platform dynamically adjusts the order of simulation tasks to be executed based on the set priorities. By combining the permission priorities of the product line, priority tags are assigned to each simulation task to ensure that high-priority tasks are executed first. Priority configuration avoids resource conflicts and communication processing order problems caused by disordered sorting, thereby improving user work efficiency and the user experience of the hardware simulation platform. It meets the priority requirements of different resource scheduling for each product line, significantly improves the task scheduling efficiency of the hardware simulation platform, and provides a clear allocation order for the subsequent automated configuration of resources.
[0105] As an optional embodiment, after binding the target resource and the current simulation task, it also includes:
[0106] While executing the current simulation task, record the resource usage of the current simulation task.
[0107] After completing the current simulation task, the binding between the target resource and the current simulation task is released, so that the target resource can be made available.
[0108] It is easy to understand that during the execution of simulation tasks, the hardware simulation platform can continuously record the resource usage of each simulation task and each user. This resource usage includes, but is not limited to, the exit time of the simulation task and resource usage details. It can also generate a resource usage log for the entire hardware simulation platform, enabling resource statistics and subsequent user analysis. Furthermore, upon detecting the completion of a simulation task, the binding between the target resource and the current simulation task is quickly released, making it available for allocation to another simulation task. This application does not specifically limit the particular methods for recording and obtaining the target resource's usage.
[0109] Specifically, by recording the occupancy of target resources in real time, the hardware simulation platform can allocate resources according to the resource occupancy status. It also facilitates subsequent resource statistics and user analysis, allowing for adjustments to the hardware simulation platform design based on the results of resource statistics or user analysis. For example, if the occupancy rate of a certain hardware resource remains high for an extended period, subsequent designs may consider increasing the configuration of this hardware resource.
[0110] As an optional embodiment, determining whether the hardware emulation platform has available resources includes:
[0111] The system configuration file of the hardware simulation platform is used to generate the first set of resource units of the hardware simulation platform and the second set of module units corresponding to each resource unit.
[0112] Determine the Cartesian product set of the first set and the second set, and define the Cartesian product set as the total resource set of the hardware simulation platform;
[0113] Get the current occupancy status of resource units and module units, and generate the set of used resources corresponding to the current occupancy status;
[0114] The difference between the total set of resources and the set of used resources is used to determine the set of available resources.
[0115] If the set of available resources is not empty, then the hardware simulation platform is determined to have available resources.
[0116] If the set of available resources is empty, it is determined that there are no available resources on the hardware simulation platform.
[0117] Understandably, to achieve flexible allocation and full utilization of resources, the hardware simulation platform allocates resources in units of resource units and module units. A resource unit refers to a basic resource entity within the hardware simulation platform that can be called, allocated, or consumed; it is the basic computing unit used to execute simulation tasks. Each resource unit contains a certain number of logic gates, memory units, and clock resources, and can be allocated to different simulation tasks. A module unit refers to an independent component encapsulated to implement a specific function; it is the basic unit of functional implementation within the hardware simulation platform. Therefore, when determining available resources, all resource units and module units in the hardware simulation platform are first determined based on the platform's system configuration file. The system configuration file includes the correspondence between the platform's dedicated hardware architecture and resource units. Assume the first set of resource units is A = {UNa, UNb, UNc}, and the second set of module units is B = {MNa, MNb}. Then, the Cartesian product of the two sets is used to determine all resources of the hardware simulation platform. The Cartesian product set of resource unit UN and module unit MN is A × B = {(x, y) | x∈A ∧ y∈B}. Simultaneously, the hardware simulation platform determines the set C of resources currently in use within the platform based on actual resource usage. The available resource set is obtained by calculating A×BC using the difference set. The method for determining used resources can be based on real-time resource usage logs, etc., and this application does not impose any specific limitations here. Then, by checking whether the available resource set is empty, the existence of any remaining available resources can be determined.
[0118] It should be noted that the Cartesian product set of UN (Unit of Resource) and MN (Module of Node) represents the ordered set of all possible combinations of the two. Its core function is to describe the mapping relationship between resource allocation and functional modules, clarifying which resource units can support which module units. During resource allocation, a corresponding resource unit and module unit are simultaneously allocated to a simulation task. For example, the target resource for a simulation task might be UNa_MNb. To facilitate subsequent resource allocation, a primary key can be assigned to each resource module as a resource identifier (Module_key), as shown in Table 1. Table 1 represents the set of all available resource modules in the hardware simulation platform. Each resource module corresponds to one resource unit and one module unit, and can be allocated as a basic resource unit to a simulation task.
[0119] Table 1 Resource Collection Table
[0120]
[0121] Specifically, a set approach can be used to enumerate all resources in the hardware simulation platform. At the same time, the difference calculation in the set can be used to determine the set of available resources, thereby sorting out the available resources in the hardware simulation platform, improving the efficiency of resource management in the hardware simulation platform, and achieving clear and reliable resource management. Furthermore, by combining the polling and probing of the set, the dynamic detection of idle available resources in the hardware simulation platform can be effectively realized.
[0122] As an optional embodiment, determining whether the hardware emulation platform has available resources includes:
[0123] Configure resource identifiers for each element in the overall resource set;
[0124] The system polls and probes each element in the overall resource set according to a preset cycle.
[0125] If available resources are detected in the total resource set, the process jumps to the step where, if there is a simulation task to be executed in the queue or a simulation task has been received, the first simulation task in the queue or the received simulation task is determined as the current simulation task.
[0126] Determine the target resources to allocate to the current simulation task from the available resources based on the resource requirements of the current simulation task, including:
[0127] Randomly select several resource modules from the available resources and set occupancy tags for the selected resource modules; wherein the idle resources of the selected resource modules are greater than or equal to the resources required by the current simulation task; a resource module includes at least one resource unit and at least one module unit corresponding to the resource unit;
[0128] Bind the target resource and the current simulation task, including:
[0129] The resource identifier corresponding to the idle resource of the resource module carrying the occupied tag is filled into the resource usage variable of the user corresponding to the current simulation task in the preset user authentication table to complete the binding between the target resource and the current simulation task.
[0130] It's easy to understand that after determining all the resources of the hardware simulation platform, resource identifiers can be configured by referring to the elements in the overall resource set shown in Table 1, i.e., the various resource modules of the hardware simulation platform. Simultaneously, the hardware simulation platform will poll each resource module to determine if any resource module is available. If available, it can be allocated to the next simulation task to be executed. During resource allocation, the resource requirements of the current simulation task are considered, and a resource module with a size not less than the required resource is allocated. Generally, a resource module includes a resource unit and a corresponding module unit. For example, a resource module can be denoted as UNa_MNb, which includes a resource unit UNa and a module unit MNb. After confirming the target resource for allocation, an occupancy tag is set to indicate that the current resource module is already occupied, avoiding conflicts with other allocation processes. Meanwhile, the hardware simulation platform also has a preset user authentication table. This preset user authentication table can also be used to store the configuration mapping relationship between each user and each simulation task and the target resource. Therefore, a resource usage variable can be set in the preset user authentication table as the foreign key corresponding to the primary key of the resource identifier. The resource binding can be achieved by filling the corresponding resource usage variable in the preset user authentication table. The resource identifier is directly filled into the resource usage variable corresponding to the current simulation task to achieve the binding between the target resource and the current simulation task.
[0131] It should be noted that this application does not specifically limit the specific method of polling detection. The hardware simulation platform can be configured with a preset auxiliary clock or other types of clock modules, which can periodically poll the total resource set according to the period specified by the auxiliary clock until an idle available resource appears. If the available resource set is not empty at this point, random probing can then be performed on the generated available resource set. The random probing selects a resource module that meets the requirements and marks it as occupied. Let's assume the resource module marked as occupied is UNa_MNb. Then, resources can be allocated to the simulation task in real time according to the task order in the execution queue and the resource module marked as occupied. This application does not specifically limit the specific implementation methods of the occupied label, resource identifier, and resource usage variable. Taking the resource identifier as shown in Table 1 as an example, simultaneously, fk_UM is set as a resource usage variable in the preset user authentication table. Setting the value of fk_UM in the preset user authentication table to Module_key "2" corresponding to resource module UNa_MNb signifies that the resource module binding is complete.
[0132] Furthermore, a counter can be set in the hardware simulation platform to count the number of polling probes of the total resource set. The initial value of the polling count is 0. Each time the total resource set is polled, the polling count is incremented by 1. If the polling count reaches a preset threshold, the user corresponding to the simulation task in the execution queue is queued again to see if they want to continue queuing. If they want to continue queuing, the order of the simulation task in the execution queue is maintained. If they want to stop queuing, the corresponding simulation task is canceled, and the polling count is reset to zero before restarting the polling probe. Once an available resource is detected, the polling count is reset to zero. By setting a counter to detect the duration for which the hardware simulation platform has no available resources, and by queuing the user again when the hardware simulation platform has no available resources for a long time, the user can know the status of the simulation task based on the periodic queries when they do not receive a response indicating that the simulation task has been completed. This further improves the user experience and allows users to adjust the queuing status of simulation tasks in a timely manner according to the application situation.
[0133] Specifically, automatic resource allocation is achieved through polling and random selection, and automatic binding of target resources is achieved through variable configuration. The process of repeatedly resubmitting tasks manually is replaced with automated resource configuration, avoiding the tedious task submission process for users. The hardware simulation platform incorporates proactive analysis of computational resources and user verification operations. Combined with a queue sorting mechanism when resources are exhausted and effective utilization of resource set verification comparison methods, task failures due to conflicts in limited resource settings are avoided. Random selection from the available resource set during resource module allocation ensures fairness in resource allocation. Dynamic resource detection and allocation within the hardware simulation platform ensure efficient resource utilization and improve the execution speed of simulation tasks.
[0134] See Figure 3 As shown, Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. To solve the above-mentioned technical problems, an embodiment of the present invention also provides an electronic device, comprising:
[0135] Memory 60 is used to store computer programs;
[0136] Processor 61 is used to execute computer programs to implement the steps of the simulation task processing method described above.
[0137] The processor 61 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 61 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 61 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 61 may also include an Artificial Intelligence (AI) processor, which handles computational operations related to machine learning.
[0138] The memory 60 may include one or more computer-readable storage media, which may be non-transitory. The memory 60 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 60 is used to store at least the following computer program 601, which, after being loaded and executed by the processor 61, can implement the relevant steps of the simulation task processing method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. The operating system 602 may include Windows, Unix, Linux, etc. The data 603 may include, but is not limited to, data in the simulation task processing method.
[0139] In some embodiments, the electronic device may further include a display screen 62, an input / output interface 63, a communication interface 64, a power supply 65, and a communication bus 66.
[0140] Those skilled in the art will understand that Figure 3 The structures shown do not constitute a limitation on electronic devices and may include more or fewer components than those shown.
[0141] For a description of the features in the electronic device provided in the embodiments of the present invention, please refer to the relevant description of the embodiments of the simulation task processing method, which will not be repeated here.
[0142] It is understood that if the simulation task processing method in the above embodiments is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the current technology, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods in the various embodiments of the present invention. The aforementioned storage medium includes: USB flash drive, mobile hard drive, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk, and other media capable of storing program code.
[0143] To address the aforementioned technical problems, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the simulation task processing method described above.
[0144] For a description of the features in the computer-readable storage medium provided in the embodiments of the present invention, please refer to the relevant description of the embodiments of the simulation task processing method, which will not be repeated here.
[0145] This invention also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the simulation task processing method described above.
[0146] For a description of the features in the computer program product provided in the embodiments of the present invention, please refer to the relevant description of the embodiments of the simulation task processing method, which will not be repeated here.
[0147] The foregoing has provided a detailed description of a simulation task processing method, device, and medium provided by embodiments of the present invention. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0148] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0149] The simulation task processing method, device, and medium provided by this invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this invention. It should be noted that those skilled in the art can make several improvements and modifications to this invention without departing from the principles of this invention, and these improvements and modifications also fall within the protection scope of this invention.
Claims
1. A simulation task processing method, characterized in that, Applications in hardware simulation platforms include: Determine if the hardware simulation platform has available resources; If no available resources are available on the hardware simulation platform, and a simulation task is received, the queuing attribute of the user corresponding to the received simulation task is obtained. If the queuing attribute is to accept queuing, then the received simulation task will be added to the queue to be executed. If the hardware simulation platform has available resources, and if the queue to be executed contains simulation tasks to be executed or receives a simulation task, then the first simulation task in the queue to be executed or the received simulation task is determined as the current simulation task. Determine the target resources to be allocated to the current simulation task from the available resources based on the resource requirements of the current simulation task; Bind the target resource and the current simulation task to execute the current simulation task based on the target resource.
2. The simulation task processing method according to claim 1, characterized in that, Also includes: If a simulation task is received, obtain the user information of the user corresponding to the simulation task; The user is authenticated based on the user information; If the user's identity is successfully authenticated, the user information is stored in a preset user authentication table.
3. The simulation task processing method according to claim 2, characterized in that, After storing the user information in a preset user authentication table, the method further includes: Generate the authentication validity period for the user; A randomly generated authenticated string with an expiration date equal to the authentication expiration date is used to mark the user; Upon receiving a simulation task, it is detected whether the user corresponding to the simulation task carries an authentication string; If so, the user's identity authentication is directly determined to be successful.
4. The simulation task processing method according to claim 1, characterized in that, Obtain the queuing attributes of the user corresponding to the received simulation task, including: If no available resources are available on the hardware simulation platform, and a simulation task is received, an inquiry instruction is sent to the user corresponding to the received simulation task; wherein, the inquiry instruction is configured to ask the user whether to accept queuing. The queuing attribute of the user corresponding to the received simulation task is determined based on the user's response to the query command.
5. The simulation task processing method according to claim 1, characterized in that, Also includes: Set priority tags for received simulation tasks based on the permission priority of the subject to which the received simulation task belongs. If the queue to be executed contains simulation tasks to be executed or a simulation task has been received, before determining the first simulation task in the queue to be executed or the received simulation task as the current simulation task, the method further includes: All received simulation tasks are added to the execution queue, and the queue order of each simulation task in the execution queue is adjusted according to the priority label.
6. The simulation task processing method according to claim 1, characterized in that, After binding the target resource and the current simulation task, the process also includes: While executing the current simulation task, record the resource usage of the current simulation task on the target resource; After the current simulation task is completed, the binding between the target resource and the current simulation task is released, so that the target resource can be released as a usable resource.
7. The simulation task processing method according to any one of claims 1 to 6, characterized in that, Determining whether the hardware simulation platform has available resources includes: The system configuration file of the hardware simulation platform generates a first set of resource units and a second set of module units corresponding to each resource unit. Determine the Cartesian product set of the first set and the second set, and determine the Cartesian product set as the total resource set of the hardware simulation platform; Obtain the current occupancy status of the resource unit and the module unit, and generate a set of used resources corresponding to the current occupancy status; The difference between the total set of resources and the set of used resources is determined as the set of available resources; If the set of available resources is not empty, then it is determined that the hardware simulation platform has available resources; If the set of available resources is empty, then it is determined that there are no available resources on the hardware simulation platform.
8. The simulation task processing method according to claim 7, characterized in that, Determining whether the hardware simulation platform has available resources includes: Configure resource identifiers for each element in the overall resource set; The elements in the total resource set are polled and probed according to a preset period; If available resources are detected in the total resource set, then proceed to the step of determining the first simulation task in the queue to be executed or the received simulation task as the current simulation task if there is a simulation task to be executed in the queue to be executed or a simulation task is received. Determining the target resources to be allocated to the current simulation task from the available resources based on the resource requirements of the current simulation task includes: Randomly select several resource modules from the available resources and set occupancy tags for the selected resource modules; wherein the idle resources of the several resource modules are greater than or equal to the resources required by the current simulation task; the resource module includes at least one resource unit and at least one module unit corresponding to the resource unit; Binding the target resource and the current simulation task includes: The resource identifier corresponding to the idle resource of the resource module carrying the occupied tag is filled into the resource usage variable of the user corresponding to the current simulation task in the preset user authentication table to complete the binding between the target resource and the current simulation task.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the simulation task processing method as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the simulation task processing method as described in any one of claims 1 to 8.