Multi-core controller function deployment system
Through the multi-core controller function deployment system, the runnable threads and dependencies of the multi-core controller are extracted and optimized to achieve balanced distribution of multi-cores, solve the problems of high load and uneven usage, and improve software development efficiency and resource utilization.
Patent Information
- Application Number
- CN202410586370.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-13
- Publication Date
- 2024-09-03
AI Technical Summary
The multi-core controller has a high load and uneven load usage, resulting in low software development efficiency and increased resource consumption. The existing technology lacks effective multi-core allocation methods and tools.
A multi-core controller function deployment system is designed, including a deployment object extraction module, a dependency model building module, a performance testing module and a multi-core balanced deployment module. By extracting runnable threads and dependencies, performance testing and optimization target settings, multi-core Load balancing distribution of controllers.
By optimizing the resource allocation of multi-core controllers, resource consumption is reduced, performance indicators are improved, load balancing of each core is achieved, dependence on commercial testing tools is reduced, and material costs are reduced.
Smart Images

Figure CN118584932A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multi-core resource control, and in particular to a multi-core controller function deployment system. Background Art
[0002] As the electronic and electrical architecture shifts to a regionalized centralized architecture, the car is divided into a few zones, each of which is controlled by a zonal control unit (ZCU) to perform the functions of the zone. However, with the increase in integrated functions, the number of modules designed on the controller, the number of interface interactions between modules, the frequency of data exchange, the amount of code development, etc. have also increased sharply. At the same time, due to the lack of experience in multi-core parallel design, most software developers directly migrate to the serial development mode on single-core control, which leads to high load and uneven load usage problems on multi-core controllers. Summary of the invention
[0003] In view of the above-mentioned shortcomings of the prior art, an object of the present invention is to provide a novel multi-core controller function deployment system, the main purpose of which is to solve the problems of high load and uneven load usage in multi-core controllers.
[0004] To achieve the above objectives and other related objectives, the present invention provides a multi-core controller function deployment system, including:
[0005] Deployment object extraction module, used to extract runnable threads and corresponding dependencies from architecture configuration files;
[0006] A dependency model building module, used to generate a dependency model according to the executable threads and the dependency relationships;
[0007] A performance testing module, used to perform a performance test based on the executable thread to obtain the execution time of the executable thread and the multi-core utilization rate corresponding to the multi-core controller;
[0008] The multi-core balanced deployment module is used to generate a sequence of executable thread clusters according to the dependency model and the execution time of the executable threads, and to evenly allocate the multi-core controllers according to the sequence of executable thread clusters and the multi-core utilization.
[0009] In an optional embodiment of the present invention, the dependency model construction module includes an extraction submodule, an interface dependency graph construction submodule and a pruning submodule:
[0010] The extraction submodule is used to generate graph nodes and directed edges according to the executable threads and the dependency relationships;
[0011] The interface dependency graph construction submodule is used to construct an interface dependency graph according to the graph nodes and the directed edges;
[0012] The pruning submodule is used to prune the interface dependency graph to obtain a dependency relationship model.
[0013] In an optional embodiment of the present invention, the performance testing module includes a task analysis tool and an operational analysis tool:
[0014] The task analysis tool is used to measure the execution time of each task in the multi-core controller and the multi-core utilization rate corresponding to the multi-core controller;
[0015] The executable analysis tool is used to measure the execution time and memory access performance of each executable thread in the multi-core controller.
[0016] In an optional embodiment of the present invention, the task analysis tool includes a time analysis unit and a utilization statistics unit:
[0017] The time analysis unit is used to call the timer interface of the multi-core controller to obtain the time before and after the execution of each task, and calculate the execution time of each task according to the time before and after the execution;
[0018] The utilization rate statistics unit is used to calculate the multi-core utilization rate corresponding to the multi-core controller according to the execution time of each task.
[0019] In an optional embodiment of the present invention, the executable analysis tool includes a time analysis unit and a memory analysis unit:
[0020] The time analysis unit is used to call the timer interface of the multi-core controller to obtain the time before and after the execution of each executable thread, and calculate the execution time of each executable thread according to the time before and after the execution;
[0021] The memory analysis unit is used to call the CPU performance counter of the multi-core controller to obtain the number of instruction memory pauses and the number of data memory pauses.
[0022] In an optional embodiment of the present invention, a software architecture optimization module is further included, and the software architecture optimization module is used to reorder instructions of the execution logic of the executable thread.
[0023] In an optional embodiment of the present invention, the software architecture optimization module includes an instruction identification submodule, a logic reorganization submodule and a logic reordering submodule:
[0024] The instruction recognition submodule is used to identify the type of instruction operation in the execution logic;
[0025] The logic reorganization submodule is used to reorganize the execution logic according to the type of the instruction operation;
[0026] The logic rearrangement submodule is used to rearrange the reorganized execution logic according to the bus width of the CPU.
[0027] In an optional embodiment of the present invention, the multi-core balanced deployment module includes an optimization target setting module, an executable thread cluster allocation module and a multi-core controller allocation module:
[0028] The optimization target setting module is used to generate the optimization target;
[0029] The executable thread cluster allocation module is used to generate an executable thread cluster sequence according to the optimization target, the dependency model and the execution time of the executable thread;
[0030] The multi-core controller allocation module is used to evenly allocate the multi-core controllers according to the optimization target, the executable thread cluster sequence and the multi-core utilization.
[0031] In an optional embodiment of the present invention, the executable thread cluster allocation module includes a to-be-allocated sequence generation submodule and a thread cluster sequence generation submodule:
[0032] The to-be-allocated sequence generation submodule is used to generate a to-be-allocated sequence of executable threads according to the optimization target and the execution time of the executable threads;
[0033] The thread cluster sequence generation submodule is used to divide the executable thread to-be-allocated sequence according to the dependency model to obtain an executable thread cluster sequence.
[0034] In an optional embodiment of the present invention, the multi-core controller allocation module includes a target core selection submodule and an executable thread cluster allocation submodule:
[0035] The target core selection submodule is used to select a target core from the multi-core controller according to the optimization target;
[0036] The executable thread cluster allocation submodule is used to allocate the target cores one by one according to the executable thread cluster sequence, obtain the allocated multi-core controller, and return to the step of selecting the target core from the multi-core controller until the executable thread clusters in the executable thread cluster sequence are completely allocated.
[0037] The multi-core controller function deployment system of the present invention can test the resource occupancy of key functions in the project and the indicators that characterize excellent performance, optimize components and reduce resource consumption through test data; it can extract the dependencies between modules in existing software engineering to discover modules that can be executed in parallel, and then map these modules to corresponding cores based on the multi-core balanced allocation algorithm of the multi-core balanced deployment module to optimize the execution time of each core and achieve load balancing of each core. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 Shown is a functional module schematic diagram of a multi-core controller function deployment system according to an embodiment of the present invention.
[0039] Figure 2 Shown is a structural schematic diagram of the relationship between software components in an embodiment of the present invention.
[0040] Figure 3 Shown is a dependency diagram between executable threads according to an embodiment of the present invention.
[0041] Figure 4 Shown is a functional module schematic diagram of a performance testing module according to an embodiment of the present invention.
[0042] Figure 5 It is a schematic diagram showing the comparison of CPU bus bit width before and after instruction reordering according to an embodiment of the present invention.
[0043] Figure 6 Shown is a schematic diagram of the structure of multi-core allocation according to an embodiment of the present invention.
[0044] In the figure: 100, multi-core controller function deployment system; 101, deployment object extraction module; 102, dependency model construction module; 103, performance testing module; 104, multi-core balanced deployment module; 1041, task analysis tool; 1042, executable analysis tool; 1043, time analysis unit; 1044, utilization statistics unit; 1045, memory analysis unit. DETAILED DESCRIPTION
[0045] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention.
[0046] It should be noted that the illustrations provided in this embodiment are only used to illustrate the basic concept of the present invention in a schematic manner. Therefore, the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0047] First, the technical background of this embodiment is introduced. In the actual application scenario of automotive software development engineering, the project has completed multiple rounds of function development and test verification. At this time, if it is found that the load rate of a core exceeds the limit, the software developer needs to adjust the resource usage of each function based on development experience, which consumes a lot of time.
[0048] In the prior art, there are no methods, processes, or tools for quantifying software design performance indicators and guiding multi-core allocation of software components. Based on the frequent multi-core problems, the present invention designs a technical solution for the entire link from component design to multi-core balanced allocation of components, and can output a tool for multi-core deployment solutions for embedded multi-core controller system functions.
[0049] like Figure 1 As shown, an embodiment of the present invention provides a multi-core controller function deployment system 100, which mainly includes a deployment object extraction module 101, a dependency model construction module 102, a performance testing module 103, a multi-core balanced deployment module 104 and other functional modules.
[0050] The deployment object extraction module 101 is used to extract executable threads and corresponding dependencies from the software architecture configuration file.
[0051] In detail, there are multiple subsystems in the software system corresponding to a software architecture configuration file, and each subsystem is constructed by multiple logic sub-functions, control sub-functions, and computing sub-functions. In AUTOSAR (AUTomotive Open System Architecture), the specific implementation of these sub-functions is composed of a certain number of SWCs (Software Components), and each SWC contains multiple minimum units that can be scheduled by various types of tasks in the operating system, namely Runnable threads.
[0052] It should be noted that the multi-core controller function deployment system 100 of the present invention can be used in fields such as AUTOSAR CP (complex device driver / complex device handler software component) and AP (application software component), and can be used in software architectures containing MicroSAR or NeuSAR or VOS, and software projects containing MCU chips such as IFX or RENESAS.
[0053] This embodiment is based on the software design concept of "high cohesion and low coupling". There are a large number of independent functions in the software system, and the independent functions can run based on the task parallel mode.
[0054] Taking the regional power distribution function and regional unlocking function of the automobile as an example, in the regional power distribution function, the central control unit sends an opening instruction to the regional power distribution function module. In the regional power distribution function module, the instruction receiving and instruction arbitration functions are executed based on the opening instruction. After the arbitration, a signal to pull down the load is sent to the battery management system. The battery management system updates the battery status based on the signal. The status management function in the regional power distribution function module can obtain the power distribution status from the battery management system to realize regional power distribution control;
[0055] In the regional unlocking function, the central control unit sends an opening instruction to the regional unlocking function module. In the regional unlocking function, the command receiving and command arbitration functions are executed based on the opening instruction. After the arbitration is completed, a signal of pulling down the load is sent to the door lock controller. The door lock controller updates the door lock state based on the signal. The state management function in the regional unlocking function module can obtain the door lock state from the door lock controller to realize unlocking control;
[0056] The processes and sub-functions of the above two functions are roughly the same, but the execution process of the two functions can be completely independent, so these independent tasks are the parallel objects in the task parallel mode. In multi-core software design, parallel objects refer to software areas that can be executed independently at a certain moment, without data interdependence and no specific execution order requirements; from the perspective of the software structure, some software modules can be executed in parallel even if they are structurally related.
[0057] See also Figure 2As shown in the figure, the structural diagram of the software component relationship maps the realization of software functions to the software design level. Each Function represents a function, among which SWC1, SWC2, and SWC3 inside Function0 can form a SWC cluster that realizes a sub-logic of Function0, and this SWC cluster is independent of other SWC clusters. At the same time, each SWC cluster contains multiple closely interacting Runnables (circular nodes in the figure), and each Runnable is responsible for realizing a specific algorithm of Function0, such as signal processing, logic arbitration, etc.
[0058] The dependency relationship between SWC1, SWC2, and SWC3 is as follows: SWC 2 and SWC 3 in Function 0 are both dependent on SWC1, and they can be executed in parallel after obtaining the execution conditions given by SWC 1. Similarly, there are many related Runnables in the SWC hierarchy with similar parallel structures and dependencies, and these parallelisms are highly hidden and have small parallel granularity.
[0059] The present invention fully explores the parallel software areas in the software architecture, takes the entity Runnable clusters with smaller granularity as the objects of multi-core allocation based on the division of software levels, and allocates the parallel Runnable clusters to multiple computing units, thereby achieving more efficient utilization of multi-core resources.
[0060] In the embodiment of the present invention, the deployment object extraction module 101 includes parsing the software engineering architecture configuration file, for example, parsing the Project.arxml file; the vehicle controller software engineering usually uses documents such as XML format to store its architecture design information, including the running entity information of the software component, interface information, dependency information between components, data transfer information between components, etc. Further, the deployment object extraction module 101 can be used to extract the design information of all SWCs and Runnables in the entire software engineering in the software architecture configuration file, as well as the interface dependency between SWCs and the interface dependency between Runnables, and store the above information in a predefined data structure.
[0061] It should be noted that the software engineering file format of the software architecture configuration file includes but is not limited to XML format files.
[0062] In the embodiment of the present invention, the dependency model building module 102 is used to generate a dependency model according to the executable threads and the dependency relationships. The software engineering on the vehicle controller is very complex. The implementation of a version of software engineering may require the design of up to hundreds of Runnables, which also makes the dependency relationships between Runnables complicated.
[0063] See also Figure 3 As shown in the figure, the interdependencies between Runnables executed in different cycles contained in 15 SWCs in a project (the nodes in the figure represent Runnables, and the edges with arrows represent the data transfer between Runnables); as can be seen from the figure, the dependencies between Runnables are very complex: one Runnable may depend on the data or timing of multiple other Runnables; one Runnable may need to provide data for multiple Runnables; the timing and data between Runnables in different scheduling cycles are interdependent.
[0064] Specifically, the dependency model construction module 102 includes an extraction submodule, an interface dependency graph construction submodule and a pruning submodule: the extraction submodule is used to generate graph nodes and directed edges according to the executable threads and the dependencies; the interface dependency graph construction submodule is used to construct an interface dependency graph according to the graph nodes and the directed edges; the pruning submodule is used to prune the interface dependency graph to obtain a dependency model.
[0065] According to the architecture information extracted by the deployment object extraction module 101, the interface dependency graph between Runnables is constructed with the Runnables in the architecture information as the nodes of the graph and the interface data transmission flow as the directed edges of the graph. After obtaining the original complex Runnable interface dependency graph, it is pruned according to the pruning principle to obtain a dependency model without loops, that is, a Directed Acyclic Graph (DAG) model of Runnable.
[0066] Specifically, the interface dependency between Runnables can be divided into strong dependency and weak dependency, and the pruning principle is based on the "strong dependency and weak dependency" relationship between Runnables. Among them, strong dependency means that Runnable B must be executed after Runnable A, and the interface data read by Runnable B is the data updated by Runnable A in this cycle; weak dependency means that Runnable B is allowed to read the data updated by Runnable A in the previous cycle. The present invention prunes the directed edges in the interface dependency graph based on the "strong dependency and weak dependency" relationship between Runnables, that is, obtains a DAG model.
[0067] It should be noted that the method used in the present invention to construct component dependency relationships includes but is not limited to a DAG modeling method.
[0068] In the embodiment of the present invention, the performance testing module 103 is used to perform a performance test based on the executable thread to obtain the execution time of the executable thread and the multi-core utilization rate corresponding to the multi-core controller.
[0069] See also Figure 4 As shown, it is a functional module diagram of the performance testing module. The performance testing module 103 includes a task analysis tool 1041 and an executable analysis tool 1042. The task analysis tool 1041 is used to measure the execution time of each task in the multi-core controller and the multi-core utilization corresponding to the multi-core controller. The executable analysis tool 1042 is used to measure the execution time of each executable thread in the multi-core controller and the memory access performance.
[0070] Furthermore, the task analysis tool 1041 includes a time analysis unit 1043 and a utilization statistics unit 1044. The time analysis unit 1043 is used to call the timer interface of the multi-core controller to obtain the time before and after the execution of each task, and calculate the execution time of each task based on the time before and after the execution; the utilization statistics unit 1044 is used to calculate the multi-core utilization corresponding to the multi-core controller based on the execution time of each task.
[0071] The executable analysis tool 1042 includes a time analysis unit 1043 and a memory analysis unit 1045. The time analysis unit 1043 is used to call the timer interface of the multi-core controller to obtain the time before and after the execution of each executable thread, and calculate the execution time of each executable thread based on the time before and after the execution; the memory analysis unit 1045 is used to call the CPU performance counter of the multi-core controller to obtain the number of instruction memory pauses and the number of data memory pauses.
[0072] It should be noted that the worst execution time WCET of the runnable thread Runnable can be obtained by calling the operating system timer interface. The worst execution time WCET of Runnable will be used as a parameter for multi-core balanced deployment. The number of instruction memory stalls PMEM_STALL (Programming Memory Stall) and the number of data memory stalls DMEM_STALL (Data Memory Stall) can be used as standards for optimizing the Runnable architecture design.
[0073] In an embodiment of the present invention, access delay and bus occupancy can be reduced by optimizing memory access and bus operations, that is, the execution order of programs in the software can be adjusted to maximize the use of the operating system's ability to process data during execution without affecting the operation of system functions.
[0074] In the embodiment of the present invention, the multi-core controller function deployment system 100 further includes a software architecture optimization module, and the software architecture optimization module is used to reorder instructions of the execution logic of the executable threads.
[0075] Furthermore, the software architecture optimization module includes an instruction recognition submodule, a logic reorganization submodule and a logic reordering submodule: the instruction recognition submodule is used to identify the type of instruction operation in the execution logic; the logic reorganization submodule is used to reorganize the execution logic according to the type of instruction operation; the logic reordering submodule is used to reorder the reorganized execution logic according to the bus width of the CPU.
[0076] In an actual application scenario of the present invention, when there are a large number of variables that are read and written alternately, the memory will be overly busy, and these two parameters will increase accordingly. Therefore, when the above situation exists in software engineering, the memory access efficiency can be optimized in the following ways: adjust the program execution order to meet the data length of a single operation equal to the bus width to reduce the delay of memory access; adjust the memory address continuity of the accessed data to reduce the scattered storage of data in the memory and accelerate the batch reading or batch writing of data.
[0077] See also Figure 5 As shown, taking the memory interleaved reading and writing method as an example, the execution logic is to read variable a, write variable a', read variable b, write variable b', read variable c, write variable c', read variable d, and write variable d'. Four operation instructions will be generated here to process the read operation of the four variables abcd, and four operation instructions will be generated to process the write operation of the four variables a'b'c'd'. This will waste a lot of data bus bits for a data of less than 32 bits. It should be noted that the above variables abcd and a'b'c'd' are the execution logic in Runnable.
[0078] The present invention can design data read instructions together and data write instructions together, that is, merge instructions or reorder instructions. By merging data processing operations according to the bus width of the CPU, multiple data execution operations smaller than the bus width are merged into one operation, which can fully utilize the bus width of the CPU and reduce unnecessary memory access cycles.
[0079] At the same time, according to the type of instruction operation, when there are multiple read operations and write operations executed alternately, they are reorganized into batch read operations and batch write operations for processing, which can not only execute the read operation or write operation at one time, but also reduce the switching between read and write operations and improve the efficiency of memory access. Therefore, by merging instruction operations, the number of times the high-speed CPU waits for low-speed memory access and the delay and conflict between operation instructions can be reduced. In addition, if the data is not stored continuously in the memory, it will also cause the CPU to access the memory performance to decline. Therefore, in order to make full use of the CPU processing power, the operated data needs to be stored continuously in the memory.
[0080] In an embodiment of the present invention, the multi-core balanced deployment module 104 includes an optimization target setting module, an executable thread cluster allocation module and a multi-core controller allocation module; wherein the optimization target setting module is used to generate an optimization target, the executable thread cluster allocation module is used to generate an executable thread cluster sequence according to the optimization target, the dependency model and the execution time of the executable thread, and the multi-core controller allocation module is used to evenly allocate the multi-core controller according to the optimization target, the executable thread cluster sequence and the multi-core utilization.
[0081] Specifically, in the multi-core controller system, it is not only necessary to reasonably distribute the Runnable to multiple cores to reduce the utilization of a single chip processor (Central Processing Unit, CPU), but also necessary to minimize the utilization of the highest core to achieve a balanced distribution of multi-core utilization. Therefore, the following optimization objective can be given, where U represents the utilization of each core: objective = min{max{U1,U2,...,Un}}. The solution of this optimization objective without any constraints is U1 = U2 =... = Un, that is, the utilization of each core is the same.
[0082] See also Figure 6 As shown, the executable thread cluster allocation module includes a to-be-allocated sequence generation submodule and a thread cluster sequence generation submodule: the to-be-allocated sequence generation submodule is used to generate an executable thread to-be-allocated sequence according to the optimization target and the execution time of the executable thread; the thread cluster sequence generation submodule is used to divide the executable thread to-be-allocated sequence according to the dependency model to obtain an executable thread cluster sequence.
[0083] The sequence may be generated in descending order of the execution time of the runnable threads, that is, the objects to be allocated may be stored in the queue in descending order of utilization.
[0084] Furthermore, the multi-core controller allocation module includes a target core selection submodule and an executable thread cluster allocation submodule: the target core selection submodule is used to select a target core from the multi-core controller according to the optimization target; the executable thread cluster allocation submodule is used to allocate the target cores one by one according to the executable thread cluster sequence, obtain the allocated multi-core controller, and return to the step of selecting the target core from the multi-core controller until the executable thread clusters in the executable thread cluster sequence are completely allocated.
[0085] Among them, the core with the lowest utilization in the multi-core controller can be used as the target core. When allocating, the runnable thread cluster with high utilization in the runnable thread cluster sequence is allocated to the target core with the lowest utilization at present. After each allocation, the utilization of all cores is updated to the value after adding the utilization of the allocated Runnable cluster, and then the allocation process is repeated until all Runnable clusters are allocated.
[0086] In an embodiment of the present invention, the multi-core balanced deployment module 104, on the one hand, sets the utilization value of each core according to the project resource usage requirements in the early stage of multi-core allocation to reserve certain core resources for use in subsequent stages of the project; on the other hand, when it is necessary to perform multi-core allocation on a newly added Runnable cluster in a software project, in order to fix the last multi-core allocation result to reduce the investment in functional verification, utilization testing and multi-core deployment can be performed on only the newly added Runnable cluster after parsing the Runnable dependency relationship of the latest software project.
[0087] It should be noted that the multi-core allocation algorithm for performing balanced allocation on the multi-core controller in the present invention includes but is not limited to an algorithm based on a greedy idea.
[0088] In summary, the present invention can test the resource occupancy of key functions in a project and indicators that characterize excellent performance, optimize components and reduce resource consumption through test data; it can extract the dependencies between modules in existing software projects to discover modules that can be executed in parallel, and then design a multi-core balanced allocation algorithm to map these modules to corresponding cores to optimize the execution time of each core; it can reserve core resources in advance, and set the resource usage of components in advance, so as to estimate the resource usage of the entire software project based on experience and the resource usage of existing components at the beginning of the project, so as to meet the needs of the later stage of the project and estimate the use of core resources to avoid the problem of tight core resources in the later stage of the project; and, by reducing the load and achieving load balancing through the system, it is possible to reduce material costs such as chip selection and reduce dependence on commercial testing tools.
[0089] In the description herein, many specific details, such as examples of components and / or methods, are provided to provide a complete understanding of embodiments of the present invention. However, those skilled in the art will recognize that embodiments of the present invention may be practiced without one or more of the specific details or with other devices, systems, components, methods, components, materials, parts, etc. In other cases, well-known structures, materials, or operations are not specifically shown or described in detail to avoid obscuring aspects of embodiments of the present invention.
[0090] The above description of the illustrated embodiments of the present invention (including the contents described in the Abstract) is not intended to be an exhaustive list or to limit the present invention to the precise form disclosed herein. Although specific embodiments of the present invention and examples of the present invention are described herein for illustrative purposes only, various equivalent modifications are possible within the spirit and scope of the present invention as will be recognized and appreciated by those skilled in the art. As noted, these modifications may be made to the present invention in accordance with the above description of the embodiments described in the present invention, and these modifications will be within the spirit and scope of the present invention.
Claims
1. A multi-core controller function deployment system, characterized in that: include: Deployment object extraction module, used to extract runnable threads and corresponding dependencies from architecture configuration files; A dependency model building module, used to generate a dependency model according to the executable threads and the dependency relationships; A performance testing module, used to perform a performance test based on the executable thread to obtain the execution time of the executable thread and the multi-core utilization rate corresponding to the multi-core controller; The multi-core balanced deployment module is used to generate a sequence of executable thread clusters according to the dependency model and the execution time of the executable threads, and to evenly allocate the multi-core controllers according to the sequence of executable thread clusters and the multi-core utilization.
2. The multi-core controller function deployment system according to claim 1, characterized in that: The dependency model building module includes an extraction submodule, an interface dependency graph building submodule, and a pruning submodule: The extraction submodule is used to generate graph nodes and directed edges according to the executable threads and the dependency relationships; The interface dependency graph construction submodule is used to construct an interface dependency graph according to the graph nodes and the directed edges; The pruning submodule is used to prune the interface dependency graph to obtain a dependency relationship model.
3. The multi-core controller function deployment system according to claim 1, characterized in that: The performance testing module includes a task analysis tool and an operational analysis tool: The task analysis tool is used to measure the multi-core utilization corresponding to the multi-core controller; The executable analysis tool is used to measure the execution time of each executable thread in the multi-core controller.
4. The multi-core controller function deployment system according to claim 3, characterized in that: The task analysis tool includes a time analysis unit and a utilization statistics unit: The time analysis unit is used to call the timer interface of the multi-core controller to obtain the time before and after the execution of each task, and calculate the execution time of each task according to the time before and after the execution; The utilization rate statistics unit is used to calculate the multi-core utilization rate corresponding to the multi-core controller according to the execution time of each task.
5. The multi-core controller function deployment system according to claim 3, characterized in that: The executable analysis tool includes a time analysis unit: The time analysis unit is used to call the timer interface of the multi-core controller to obtain the time before and after the execution of each executable thread, and calculate the execution time of each executable thread according to the time before and after the execution.
6. The multi-core controller function deployment system according to claim 3, characterized in that: The executable analysis tool also includes a memory analysis unit: The memory analysis unit is used to call the CPU performance counter of the multi-core controller to obtain the number of instruction memory pauses and the number of data memory pauses.
7. The multi-core controller function deployment system according to claim 1, characterized in that: It also includes a software architecture optimization module, which is used to reorder instructions on the execution logic of the executable thread.
8. The multi-core controller function deployment system according to claim 7, characterized in that: The software architecture optimization module includes an instruction recognition submodule, a logic reorganization submodule, and a logic reordering submodule: The instruction recognition submodule is used to identify the type of instruction operation in the execution logic; The logic reorganization submodule is used to reorganize the execution logic according to the type of the instruction operation; The logic rearrangement submodule is used to rearrange the reorganized execution logic according to the bus width of the CPU.
9. The multi-core controller function deployment system according to claim 1, characterized in that: The multi-core balanced deployment module includes an optimization target setting module, an executable thread cluster allocation module and a multi-core controller allocation module: The optimization target setting module is used to generate the optimization target; The executable thread cluster allocation module is used to generate an executable thread cluster sequence according to the optimization target, the dependency model and the execution time of the executable thread; The multi-core controller allocation module is used to evenly allocate the multi-core controllers according to the optimization target, the executable thread cluster sequence and the multi-core utilization.
10. The multi-core controller function deployment system according to claim 9, characterized in that: The executable thread cluster allocation module includes a to-be-allocated sequence generation submodule and a thread cluster sequence generation submodule: The to-be-allocated sequence generation submodule is used to generate a to-be-allocated sequence of executable threads according to the optimization target and the execution time of the executable threads; The thread cluster sequence generation submodule is used to divide the executable thread to-be-allocated sequence according to the dependency model to obtain an executable thread cluster sequence.
11. The multi-core controller function deployment system according to claim 9, characterized in that: The multi-core controller allocation module includes a target core selection submodule and an executable thread cluster allocation submodule: The target core selection submodule is used to select a target core from the multi-core controller according to the optimization target; The executable thread cluster allocation submodule is used to allocate the target cores one by one according to the executable thread cluster sequence, obtain the allocated multi-core controller, and return to the step of selecting the target core from the multi-core controller until the executable thread clusters in the executable thread cluster sequence are completely allocated.
Citation Information
Cited By
Method and device for allocating kernel timers of multi-core system
CN119046020A
