A communication scheduling method for control core MCU and computing core MPU
By establishing an on-chip high-speed bus and on-chip cache between the MCU core and the MPU core of an intelligent connected vehicle, and setting up a CP proxy and AP proxy to control communication between CP application and AP application, the failure in the prior art is solved. At the same time, the real-time communication and bandwidth issues are guaranteed, and efficient and reliable communication is achieved.
Patent Information
- Application Number
- CN202111422991.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2041-11-26
AI Technical Summary
In the prior art, communication between MPU and MCU based on CAN or Ethernet cannot guarantee the real-time communication and communication bandwidth at the same time.
By establishing an on-chip high-speed bus and on-chip cache between the MCU core and the MPU core, the CP proxy and AP proxy are set to control communication between the CP application and the AP application, and schedule communications according to the concurrent access priority.
It realizes the communication bandwidth and communication reliability between intelligent connected vehicle CP applications and AP applications, while reducing communication delay and communication load of vehicle body network.
Smart Images

Figure CN114201416B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of multi-core chip control technology, and in particular to a communication scheduling method for a control core MCU and a computing core MPU. Background Art
[0002] The SoC chip of the intelligent connected car integrates both the control core MCU (Mirco Controller Unit) and the computing core MPU (Micro Processor Unit). Both MCU and MPU can be single-core or multi-core. The real-time system runs on the MCU to process the CP (Classic AUTOSAR) application function business; the POSIX (Portable Operating System Interface of UNIX) system runs on the MPU, mainly processing the AP (Adaptive AUTOSAR) application function business with large computing and data volumes.
[0003] At present, the CP application and AP application of intelligent networked vehicles are usually implemented on independent processors respectively. The MPU and MCU communicate with each other through the CAN bus, or by adding a set of CAN to Ethernet equipment. The communication control method adopted is mainly based on the CAN protocol or the Ethernet protocol, such as remote procedure call. However, with the increasing requirements for the intelligence of intelligent networked vehicles, the communication volume and latency requirements between CP applications and AP applications are getting higher and higher. The existing communication based on the CAN network can no longer meet the requirements of communication bandwidth, and the communication based on Ethernet cannot effectively guarantee real-time performance. Summary of the invention
[0004] The main purpose of this application is to provide a control core and a computing core scheduling method, which aims to solve the technical problem in the prior art that communication between MPU and MCU based on CAN or Ethernet cannot simultaneously guarantee communication real-time and communication bandwidth.
[0005] In a first aspect, the present application provides a communication scheduling method for a control core MCU and a computing core MPU, the method comprising the following steps:
[0006] The control core MCU and the computing core MPU perform the following scheduling through the on-chip high-speed bus and on-chip cache:
[0007] A CP agent is connected to the MCU core, and an AP agent is connected to the MPU core to control the communication between the CP application on the MCU core and the AP application on the MPU core;
[0008] Setting a concurrent access priority of the CP application and the AP application to the on-chip cache, and setting a concurrent access priority of the CP agent and the AP agent to the on-chip cache according to the concurrent access priority of the CP application and the AP application;
[0009] The CP agent and the AP agent are used to monitor, cache and forward the service requests and service results generated by the CP application and the AP application.
[0010] In some embodiments, if the communication between the AP application and the CP application is the CP application requesting to communicate with the AP application in synchronization mode, the method includes the following steps:
[0011] The CP agent forwards the CP service request sent by the CP application to the AP agent, and after monitoring the CP service request, the AP agent queries whether the service ID of the CP service request exists;
[0012] If the service ID does not exist, the AP agent returns a service failure result to the CP agent, and the CP agent forwards the service failure result to the CP application;
[0013] If the service ID is found to exist, the AP agent forwards the CP service request to the corresponding AP application, the AP application outputs an AP service result, and the AP agent and the CP agent forward the AP service result to the CP application.
[0014] In some embodiments, the AP application outputs the AP service result, and the AP agent and the CP agent forward the AP service result to the CP, including:
[0015] If the AP application determines to output the AP service result within a time slice, the AP application starts a synchronous mode service, and the synchronous mode service includes the following steps:
[0016] The AP agent feeds back to the CP agent that the service is in progress, and the CP agent waits for the AP service result;
[0017] The AP application outputs the AP service result to the AP agent, and the AP agent determines whether the data volume of the AP service result exceeds a first preset threshold;
[0018] If the data volume of the AP service result exceeds the first preset threshold, the AP agent writes the AP service result into the on-chip cache, notifies the CP agent to prepare to receive the AP service result, and after the CP agent is ready, starts the producer consumer mode to return the AP service result to the CP agent;
[0019] If the data volume of the AP service result does not exceed the first preset threshold, the AP agent directly returns the AP service result to the CP agent;
[0020] After receiving the AP service result, the CP agent forwards the AP service result to the CP application.
[0021] In some embodiments, the AP application outputs the AP service result, and the AP agent and the CP agent forward the AP service result to the CP, including:
[0022] If the AP application determines to output the AP service result within multiple time slices, the AP application starts the asynchronous mode service, and the starting of the asynchronous mode service includes the following steps:
[0023] The AP agent returns a service ready message to the CP agent, and the CP agent returns the service ready message to the CP application, and the CP application switches to process the next process;
[0024] After the AP application generates the AP service result, it returns the AP service result to the CP application according to the synchronous mode service.
[0025] In some embodiments, if the communication between the AP application and the CP application is the CP application requesting to communicate with the AP application in an asynchronous mode, the following steps are included:
[0026] The CP application sends the CP service request with a deadline to the CP agent, and the CP agent writes the CP service request into the on-chip cache;
[0027] If the CP service request cache queue is empty before the CP service request is written into the on-chip cache, the AP agent scans the unprocessed CP service request in the CP service request cache queue after the periodic sleep ends, and forwards it to the AP application;
[0028] If there are other CP service requests in the CP service request cache queue before the CP service request is written into the on-chip cache, the AP proxy sequentially forwards the CP service request with the latest request deadline to the corresponding AP application, and the AP proxy enters the periodic sleep after forwarding all CP service requests in the CP service request cache queue;
[0029] The AP application receives the CP service request and outputs an AP service result, and the AP agent and the CP agent forward the AP service result to the CP application according to the deadline.
[0030] In some embodiments, the AP application receives the CP service request and outputs an AP service result, and the AP agent and the CP agent forward the AP service result to the CP application according to the deadline, including the following steps:
[0031] The AP application outputs the AP service result with a timestamp to the AP agent, and checks the deadline of the CP service request;
[0032] If the deadline exceeds a polling cycle of the CP agent, the AP agent writes the AP service result into the on-chip cache and waits for the CP agent to read it;
[0033] If the deadline is less than one polling cycle of the CP agent, the AP agent wakes up the CP agent and forwards the AP service result to the CP agent;
[0034] After receiving the AP service result, the CP agent forwards the AP service result to the CP application.
[0035] In some embodiments, if the communication between the AP application and the CP application is the AP application requesting to communicate with the CP application, the steps include:
[0036] The AP application sends an AP service request to the AP agent, and the AP agent determines whether the data volume of the AP service request exceeds a second preset threshold;
[0037] If the data volume of the AP service request exceeds the second preset threshold, the AP agent writes the AP service request into the on-chip cache and waits for the CP agent to read it; if the data volume of the AP service request does not exceed the second preset threshold, the AP agent forwards the AP service request to the CP agent;
[0038] After receiving the AP service request, the CP agent returns a confirmation signal to the AP agent and forwards the service instruction to the CP application;
[0039] The CP application outputs a CP service result or a rejection response result to the CP agent according to its own status;
[0040] The CP agent and the AP agent forward the CP service result or the rejection response result to the AP application in sequence.
[0041] In some embodiments, the step of accessing a CP agent on the MCU core and accessing an AP agent on the MPU core includes:
[0042] Each MCU sub-core of each MCU core is respectively connected to a different CP agent, and a mutually exclusive access control program is set for the CP agent;
[0043] All the MPU sub-cores of each of the MPU cores are connected to the same AP agent, and the AP agent is set to have the highest priority except the init0 process.
[0044] In some embodiments, the setting of the concurrent access priority of the CP application and the AP application to the on-chip cache, and setting the concurrent access priority of the CP agent and the AP agent according to the concurrent access priority of the CP application and the AP application, comprises:
[0045] When the CP application and the AP application simultaneously perform a read operation in the on-chip cache, the priority of the CP application is the same as the priority of the AP application;
[0046] When the CP application performs a read operation and the AP application performs a write operation, the CP application has a higher priority than the AP application;
[0047] When the CP application performs a write operation and the AP application performs a read operation, if the producer consumer mode is adopted, the priority of the CP application is higher than that of the AP application; if the producer consumer mode is not adopted, the priority of the AP application is higher than that of the CP application;
[0048] When the CP application and the AP application perform a write operation at the same time, the CP application has a higher priority than the AP application;
[0049] The concurrent access priority of the CP agent is the same as the priority of the CP application;
[0050] The concurrent access priority of the AP agent adopts a FIFO model, and the AP agent performs concurrent access after preparing data.
[0051] In a second aspect, the chip of the present application includes an MCU core, an MPU core, an on-chip high-speed bus and an on-chip high-speed cache, which can be configured to implement the scheduling method of the control core and the computing core as described in the first aspect above.
[0052] The present application provides a scheduling method for a control core MCU and a computing core MPU, which executes communication between the control core MCU and the computing core MPU through the on-chip high-speed bus and on-chip cache of the SOC chip, and accesses the CP agent on the MCU core and the AP agent on the MPU core to control the communication between the CP application on the MCU core and the AP application on the MPU core; sets the concurrent access priority of the CP application and the AP application to the on-chip cache, and sets the concurrent access priority of the CP agent and the AP agent according to the concurrent access priority of the CP application and the AP application; wherein the CP agent and the AP agent are used to monitor, cache and forward the service requests and service results generated by the CP application and the AP application in scheduling. It realizes the improvement of the communication bandwidth and communication reliability between the CP application and the AP application of the intelligent connected vehicle, while reducing the communication load in the existing vehicle body network and reducing the communication delay. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0054] Figure 1 This is a schematic diagram of the SOC chip structure that integrates the control core MCU and the computing core MPU;
[0055] Figure 2 Schematic diagram of the internal communication structure between multi-core MCU and multi-core MPU
[0056] Figure 3 A flowchart of a scheduling method for a control core MCU and a computing core MPU provided in an embodiment of the present application;
[0057] Figure 4 It is a schematic diagram of the MCU core and the MPU core access agent;
[0058] Figure 5 The scheduling process for CP application to request communication with AP application;
[0059] Figure 6 The scheduling process for the AP application to request communication with the CP application.
[0060] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0061] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0062] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0063] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0064] like Figure 1 and Figure 2 As shown, Figure 1 It is a SOC chip that integrates the control core MCU and the computing core MPU, wherein the chip includes the MCU core and the MPU core, the MCU core and the MPU core are connected to the on-chip high-speed bus, and the on-chip high-speed cache can be used to cache data when the MCU core and the MPU core communicate. Figure 2 Each MCU core includes M MCU sub-cores, each MCU sub-core is connected to the cross-interconnect bus in the core, and each MCU sub-core runs a CP application. Each MPU core has N MPU sub-cores, which access the L2 cache in the core, and each MCU sub-core runs a CP application.
[0065] In the communication between the MCU core and the MPU core, there are several working conditions: communication between each MCU sub-core inside the MCU core, communication between each MPU sub-core inside the MPU core, communication between the MCU core and the MPU core, and concurrent access of the MCU core and the MPU core to the on-chip high-speed bus. Because the MCU sub-core communicates through the CP application and the MPU sub-core communicates through the AP application, the above communication conditions between the MCU core and the MPU core can also be considered as the communication conditions between the CP application and the AP application, specifically: communication between CP applications, communication between AP applications, communication between CP applications and AP applications, and concurrent access of CP applications and AP applications to the on-chip high-speed cache.
[0066] Specifically, Figure 2As shown, the communication scheduling between each CP application on the MCU core specifically includes: setting the priority of mutual access between MCU sub-cores and MCU sub-cores for each MCU sub-core, and the CP applications on the MCU sub-cores have the same priority as the MCU sub-cores. When the CP applications access each other without conflict, they communicate through the cross bus in the MCU core. If an access conflict occurs, the cross bus performs bus arbitration according to the priority of the MCU core, allowing the CP application on the MCU core with a high priority to communicate first. For example, it can be stipulated that MCU_Core.1 has the highest priority, and MCU_Core.M has the lowest priority according to the core sequence number. The CP application on the MCU core with a large sequence number must allow the CP application on the MCU core with a small sequence number to communicate first. When the same CP application needs to perform read and write operations at the same time, the priority of the read operation is higher than the write operation, and when the CP application on the MCU core with a low priority has generated an operation, in order to ensure atomicity, the CP application on the MCU core with a high priority must allow the CP application on the MCU core with a low priority to communicate first to ensure that the operation is not interrupted.
[0067] Further, such as Figure 2 As shown, when the AP applications on the MPU core communicate with each other, the AP applications on the MPU core need to process a large amount of data. When the amount of data does not exceed the cache block allocated to the AP application, the data is exchanged through the on-chip secondary cache. When the amount of data exceeds the cache block allocated to the AP application, the data is exchanged through the memory. When mutual access conflicts occur, they are managed through the MPU core priority and data locks. The priority between MPU cores can also be specified as MPU_Core.1 with the highest priority, and MPU_Core.M has the lowest priority according to the core number. If the low-priority MPU core has started a write operation, the high-priority MPU core needs to wait for the low-priority MPU core to complete the operation before operating to ensure that the operation is not interrupted.
[0068] When the MCU core and the MPU core are communicating, the communication conditions are: communication between the CP application and the AP application and concurrent access of the CP application and the AP application to the on-chip cache.
[0069] The SoC chip includes an on-chip high-speed bus, and the SoC chip has an on-chip cache feature. In this application, the communication between the MCU core and the MPU core is carried out using the on-chip high-speed bus and the on-chip cache. Compared with the prior art that communicates through the CAN bus and Ethernet interconnection, the speed of read and write operations and the speed of information transmission are improved from a physical level, and the communication delay between the MCU core and the MPU core is reduced. The communication scheduling method between the MCU core and the MPU core is specifically introduced below.
[0070] Figure 3A flowchart of a scheduling method for a control core MCU and a computing core MPU is provided in an embodiment of the present application.
[0071] like Figure 3 As shown, the method includes steps S1 to S3.
[0072] Step S1, a CP agent is connected to the MCU core, and an AP agent is connected to the MPU core to control the communication between the CP application on the MCU core and the AP application on the MPU core.
[0073] Step S2: setting the concurrent access priority of the CP application and the AP application to the on-chip cache, and setting the concurrent access priority of the CP agent and the AP agent according to the concurrent access priority of the CP application and the AP application.
[0074] It is worth noting that the CP proxy and the AP proxy are used to monitor, cache and forward service requests and service results generated by the CP application and the AP application.
[0075] Because the communication between the MCU core and the MPU core is essentially the communication between the CP application on the core and the AP application, the following description uses the CP application to the AP application.
[0076] As a preferred implementation mode, Figure 4 As shown in the figure, when the CP agent is connected to the MCU core, the CP agent is connected to each MCU sub-core, and the mutual exclusive access control management is set for the CP agent program bottom layer to prevent multiple CP agents from writing to a cache data at the same time, but multiple CP agents can read at the same time. And the MCU sub-core, the CP application on the MCU sub-core has the same priority as the CP agent. When the AP agent is connected to the MPU core, all MPU sub-cores are connected to the same AP agent, and the AP agent has the highest priority on the MPU except the init0 process, that is, the shutdown process.
[0077] In some embodiments, Figure 5As shown, when the communication between the CP application and the AP application is a CP application request and an AP application synchronous mode communication, this communication mode appears when the CP application on the MCU urgently needs the MPU to provide relevant data to meet the needs of further execution. The specific communication steps include: the CP application generates a data request, that is, a CP service request (1 service request), the CP agent forwards the CP service request issued by the CP application to the AP agent (1.1 forward request), and the AP agent monitors the CP service request and queries whether the service ID of the CP service request exists (1.2 service ID query). If the query finds that the service ID does not exist, the AP agent returns a service failure result to the CP agent (1.2.1 return service failure), and the CP agent forwards the service failure result to the CP application (1.2.1.1 return service failure); if the query finds that the service ID exists, the AP agent forwards the CP service request to the corresponding AP application (1.2.2 forward service request to the target AP application), the AP application outputs the AP service result according to the CP service request, and the AP agent and the CP agent forward the AP service result to the CP application.
[0078] Furthermore, when the AP application outputs the AP service result according to the CP service request, it also includes that the AP application determines whether the AP service result can be output within a time slice according to the CP service request. If the AP service result can be output within a time slice, the AP application starts the synchronous mode service. The AP agent feeds back to the CP agent that the service is in process (1.2.2.1 request processing), the CP agent waits for the AP service result (1.2.2.2 waiting), the AP application outputs the AP service result to the AP agent (1.3 synchronous service return result), and the AP agent determines whether the data volume of the AP service result exceeds the first preset threshold. If the data volume of the AP service result exceeds the first preset threshold, the data volume is large at this time, and the AP service result cannot be directly returned to the CP agent, so a cache feature is required. The AP agent writes the AP service result into the on-chip cache and notifies the CP agent to prepare to receive the AP service result. After the CP agent is ready, the producer consumer mode is turned on to return the AP service result to the CP agent (1.3.1 synchronous service return result). If the data volume of the AP service result does not exceed the first preset threshold, the data volume is small at this time, and the AP agent can directly return the AP service result to the CP agent (1.3.1 Synchronous service return result). After receiving the AP service result, the CP agent forwards the AP service result to the CP application (1.3.1.1 Return result), and the CP application successfully obtains the required data from the AP application quickly. Among them, even if the CP application requires synchronous communication, it does not mean that the AP application can monopolize the processor to respond to the CP application, but the CP application is waiting synchronously, that is, the AP application may respond to the service asynchronously.
[0079] Furthermore, the AP application cannot output the AP service result within a time slice, and the AP application starts the asynchronous mode service and returns the AP service result to the CP application. The AP agent returns the service ready to the CP agent (1.3.2 Asynchronous service service ready), and the CP agent returns the service ready to the CP application (1.3.2.1 Return service ready), and the CP application switches to process the next process. The CP application does not need to wait for a long time, but switches to process other services, effectively reducing the CP application's occupation of the CP request and improving the work efficiency of the CP application. After the AP application generates the AP service result, it returns the service result to the AP agent (1.4 Asynchronous service return result), and the AP agent sends the AP service result to the CP agent (1.4.1 Asynchronous service return result) according to the method of judging whether the data volume exceeds the first preset threshold in the synchronous mode service, and the CP agent forwards the AP service result to the CP application (1.4.1.1 Asynchronous service return result).
[0080] As a preferred implementation, when the communication between the CP application and the AP application is an asynchronous mode communication between the CP application request and the AP application, in this case, the CP application on the MCU does not wait for the MPU to process the data, and communicates with the AP application on the MPU in an asynchronous manner. Since the CP application and the AP application are asynchronous, in order to avoid occupying the bus, all service requests and service results, regardless of the amount of data, are performed by storing them in the on-chip cache. The specific steps include: the CP application sends a CP service request with a deadline to the CP agent, and the CP agent writes the CP service request into the on-chip cache. If the CP service request is written into the on-chip cache, the CP service request cache queue is empty, and the AP agent scans the unprocessed CP service requests in the CP service request cache queue after the periodic sleep ends, and forwards them to the AP. If there are other CP service requests in the CP service request cache queue before the CP service request is written into the on-chip cache, the AP agent forwards the CP service request with the closest request deadline to the corresponding AP application in sequence, and the AP agent enters periodic sleep after forwarding all CP service requests in the CP service request cache queue. The AP application receives the CP service request and outputs the AP service result, and the AP agent and the CP agent forward the AP service result to the CP application according to the deadline.
[0081] Furthermore, after the AP agent scans the CP service request, before the CP service request is sent to the AP application, the AP agent also includes: after the AP agent monitors the CP service request, it queries whether the service ID of the CP service request exists. If the service ID does not exist, the AP agent returns a service failure result to the CP agent, and the CP agent forwards the service failure result to the CP application. If the service ID exists, the AP agent forwards the CP service request to the corresponding AP application.
[0082] Furthermore, the AP application receives the CP service request and outputs the AP service result, and the AP agent and the CP agent forward the AP service result to the CP application according to the deadline, which specifically includes: the AP application outputs the AP service result (1.4 Asynchronous communication return result) after responding to the CP service request, and adds the current timestamp to the AP service result. The AP agent receives the AP service result with a timestamp and checks the deadline of the CP service request. If the deadline exceeds one polling cycle of the CP agent, the AP agent writes the AP service result to the on-chip cache and waits for the CP agent to read it. The subsequent processing method is the same as the AP application starting the asynchronous mode service in the synchronous mode communication (1.4 Asynchronous service return result), and returns the AP service result to the CP application. If the deadline is less than one polling cycle of the CP agent, the AP agent wakes up the CP agent and forwards the AP service result to the CP agent. After receiving the AP service result, the CP agent forwards the AP service result to the CP application.
[0083] As a preferred embodiment, Figure 6 As shown, the AP application needs the underlying status information of the car to make decisions or send instructions to the execution device, that is, the CP application. For the underlying status information, each CP application will periodically write the latest data into the shared data area for display by the instrument application. The AP application only needs to read the data in the designated shared data area, but the AP only has read permission and does not need to be operated through the proxy AP agent. According to the above scenario, the communication between the CP application and the AP application is that the AP application requests and the CP application communicate in asynchronous mode, and the AP application can only request and communicate with the CP application asynchronously, and asynchronously wait for the CP application to return the CP service result. The specific steps of the AP application request and the CP application communicating in asynchronous mode include: the AP application sends an AP service request to the AP agent (2 service request), and the AP agent determines whether the data volume of the AP service request exceeds the second preset threshold; if the data volume of the AP service request exceeds the second preset threshold, the AP agent writes the AP service request to the on-chip cache and waits for the CP agent to read it; if the data volume of the AP service request does not exceed the second preset threshold, the AP agent forwards the AP service request to the CP agent (2.1 forwarding service request); after receiving the AP service request, the CP agent returns a confirmation signal to the AP agent (2.1.1 returning confirmation signal), and forwards the service instruction to the CP application (2.1.2 forwarding service request).
[0084] Furthermore, after receiving the AP service request, the CP application outputs the CP service result or the rejection response result to the CP agent according to its own status (2.2 Reject or respond to request, return result), and then the CP agent forwards the CP service result or the rejection response result to the AP agent (2.3 Return result) and the AP agent forwards the CP service result or the rejection response result to the AP application (2.4 Return result).
[0085] The concurrent access priority of the CP application and the AP application to the on-chip cache is set, and the concurrent access priority of the CP agent and the AP agent is set according to the concurrent access priority of the CP application and the AP application.
[0086] As a preferred implementation, when the CP application and the AP application concurrently access the on-chip cache, the concurrent access to the on-chip cache is controlled by setting the priority of the CP application and the AP application. The access priority of the CP application and the AP application is specifically set as follows: when the CP application and the AP application simultaneously perform a read operation on the on-chip cache, the priority of the CP application is the same as that of the AP application; when the CP application performs a read operation and the AP application performs a write operation, the priority of the CP application is higher than that of the AP application; when the CP application performs a write operation and the AP application performs a read operation, if the producer-consumer mode is adopted, the priority of the CP application is higher than that of the AP application, and if the producer-consumer mode is not adopted, the priority of the AP application is higher than that of the CP application; when the CP application and the AP application simultaneously perform a write operation, the priority of the CP application is higher than that of the AP application.
[0087] Furthermore, according to the concurrent access priority of the CP application and the AP application to the on-chip cache, the concurrent access priority of the CP agent and the AP agent to the on-chip cache is set, wherein the priority of the CP agent is the same as the priority of the CP application, and the priority of the AP agent adopts the first-in-first-out model FIFO (First Input First Output), and data must be prepared before writing to the on-chip cache.
[0088] The above embodiment provides a data communication scheduling method for a multi-core SoC chip that integrates a control core MCU and a computing core MPU. For the application of the domain control platform of intelligent networked vehicles, by customizing the cache access control and communication process management strategies of software and hardware adaptation, the problem that the real-time performance and communication bandwidth of the traditional CAN bus and ETH bus communication cannot be guaranteed at the same time is solved, and the interaction efficiency of the CP application on the MCU core and the AP application on the MPU core in the intelligent networked vehicle is improved, the communication delay and jitter between the MCU and the MPU are reduced, and the communication bandwidth and communication reliability between the CP application and the AP application of the intelligent networked vehicle are guaranteed, while reducing the communication load in the existing vehicle body network.
[0089] like Figure 1 As shown, an embodiment of the present application also provides a chip, which includes an MCU core, an MPU core, an on-chip high-speed bus and an on-chip high-speed cache, and can be configured to implement a scheduling method for the control core MCU and the computing core MPU as in any of the above embodiments.
[0090] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0091] The serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments. The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A communication scheduling method for a control core MCU and a computing core MPU, characterized in that: include: The control core MCU and the computing core MPU perform the following scheduling through the on-chip high-speed bus and on-chip cache: A CP agent is connected to the control core MCU, and an AP agent is connected to the computing core MPU to control the communication between the CP application on the control core MCU and the AP application on the computing core MPU; Setting a concurrent access priority of the CP application and the AP application to the on-chip cache, and setting a concurrent access priority of the CP agent and the AP agent to the on-chip cache according to the concurrent access priority of the CP application and the AP application; The CP proxy and the AP proxy are used to monitor, cache and forward service requests and service results generated by the CP application and the AP application; If the communication between the AP application and the CP application is a synchronous mode communication between the CP application requesting the AP application, the following steps are included: The CP agent forwards the CP service request sent by the CP application to the AP agent, and after monitoring the CP service request, the AP agent queries whether the service ID of the CP service request exists; If the service ID does not exist, the AP agent returns a service failure result to the CP agent, and the CP agent forwards the service failure result to the CP application; If the service ID is found to exist, the AP agent forwards the CP service request to the corresponding AP application, the AP application outputs the AP service result, and the AP agent and the CP agent forward the AP service result to the CP application; The AP application outputs the AP service result, and the AP agent and the CP agent forward the AP service result to the CP application, including: If the AP application determines to output the AP service result within a time slice, the AP application starts the synchronous mode service, and the starting of the synchronous mode service includes the following steps: The AP agent feeds back to the CP agent that the service is in progress, and the CP agent waits for the AP service result; The AP application outputs the AP service result to the AP agent, and the AP agent determines whether the data volume of the AP service result exceeds a first preset threshold; If the data volume of the AP service result exceeds the first preset threshold, the AP agent writes the AP service result into the on-chip cache, notifies the CP agent to prepare to receive the AP service result, and after the CP agent is ready, starts the producer consumer mode to return the AP service result to the CP agent; If the data volume of the AP service result does not exceed the first preset threshold, the AP agent directly returns the AP service result to the CP agent; After receiving the AP service result, the CP agent forwards the AP service result to the CP application.
2. The communication scheduling method for the control core MCU and the computing core MPU according to claim 1 is characterized in that: The AP application outputs the AP service result, and the AP agent and the CP agent forward the AP service result to the CP application, including: If the AP application determines to output the AP service result within multiple time slices, the AP application starts the asynchronous mode service, and the starting of the asynchronous mode service includes the following steps: The AP agent returns a service ready message to the CP agent, and the CP agent returns the service ready message to the CP application, and the CP application switches to process the next process; After the AP application generates the AP service result, the AP service result is returned to the CP application according to the step of the AP application starting the synchronous mode service.
3. The communication scheduling method for the control core MCU and the computing core MPU according to claim 1 is characterized in that: If the communication between the AP application and the CP application is that the CP application requests to communicate with the AP application in an asynchronous mode, the following steps are included: The CP application sends a CP service request with a deadline to the CP agent, and the CP agent writes the CP service request into the on-chip cache; If the CP service request cache queue is empty before the CP service request is written into the on-chip cache, the AP agent scans the unprocessed CP service request in the CP service request cache queue after the periodic sleep ends, and forwards it to the AP application; If there are other CP service requests in the CP service request cache queue before the CP service request is written into the on-chip cache, the AP proxy sequentially forwards the CP service request with the latest request deadline to the corresponding AP application, and the AP proxy enters the periodic sleep after forwarding all CP service requests in the CP service request cache queue; The AP application receives the CP service request and outputs an AP service result, and the AP agent and the CP agent forward the AP service result to the CP application according to the deadline.
4. The communication scheduling method for the control core MCU and the computing core MPU according to claim 3 is characterized in that: The AP application receives the CP service request and outputs an AP service result, and the AP agent and the CP agent forward the AP service result to the CP application according to the deadline, including the following steps: The AP application outputs the AP service result with a timestamp to the AP agent, and checks the deadline of the CP service request; If the deadline exceeds a polling cycle of the CP agent, the AP agent writes the AP service result into the on-chip cache and waits for the CP agent to read it; If the deadline is less than one polling cycle of the CP agent, the AP agent wakes up the CP agent and forwards the AP service result to the CP agent; After receiving the AP service result, the CP agent forwards the AP service result to the CP application.
5. The communication scheduling method for the control core MCU and the computing core MPU according to claim 1 is characterized in that: If the communication between the AP application and the CP application is that the AP application requests to communicate with the CP application, the following steps are included: The AP application sends an AP service request to the AP agent, and the AP agent determines whether the data volume of the AP service request exceeds a second preset threshold; If the data volume of the AP service request exceeds the second preset threshold, the AP agent writes the AP service request into the on-chip cache and waits for the CP agent to read it; if the data volume of the AP service request does not exceed the second preset threshold, the AP agent forwards the AP service request to the CP agent; After receiving the AP service request, the CP agent returns a confirmation signal to the AP agent and forwards the service instruction to the CP application; The CP application outputs a CP service result or a rejection response result to the CP agent according to its own status; The CP agent and the AP agent forward the CP service result or the rejection response result to the AP application in sequence.
6. The communication scheduling method for the control core MCU and the computing core MPU according to claim 1, characterized in that: The step of accessing a CP agent on the control core MCU and an AP agent on the computing core MPU includes: Each MCU sub-core of each control core MCU is respectively connected to different CP agents, and a mutually exclusive access control program is set for the CP agents; All the MPU sub-cores of each computing core MPU are connected to the same AP agent, and the AP agent is set to have the highest priority except the init0 process.
7. The communication scheduling method for the control core MCU and the computing core MPU according to claim 1, characterized in that: The setting of the concurrent access priority of the CP application and the AP application to the on-chip cache, and setting the concurrent access priority of the CP agent and the AP agent to the on-chip cache according to the concurrent access priority of the CP application and the AP application, comprises: When the CP application and the AP application simultaneously perform a read operation in the on-chip cache, the priority of the CP application is the same as the priority of the AP application; When the CP application performs a read operation and the AP application performs a write operation, the CP application has a higher priority than the AP application; When the CP application performs a write operation and the AP application performs a read operation, if the producer consumer mode is adopted, the priority of the CP application is higher than that of the AP application; if the producer consumer mode is not adopted, the priority of the AP application is higher than that of the CP application; When the CP application and the AP application perform a write operation at the same time, the CP application has a higher priority than the AP application; The concurrent access priority of the CP agent is the same as the priority of the CP application; The concurrent access priority of the AP agent adopts a FIFO model, and the AP agent performs concurrent access after preparing data.
8. A chip, characterized in that: The chip includes a control core MCU, a computing core MPU, an on-chip high-speed bus and an on-chip high-speed cache, and can be configured to implement a communication scheduling method for the control core MCU and the computing core MPU as described in any one of claims 1-7.
Citation Information
Patent Citations
Communication scheduling system and method among cores of isomerization multi-core processor
CN101354693A
Cache replacing method and apparatus, heterogeneous multi-core system and cache managing method
US20200004692A1