Communication method of multi-core system
By configuring inter-core interrupts and shared memory resources, combining Remoteproc, VirtIO and RPMsg modules, the communication problems of the same master processor and slave processor architecture but different operating systems in isomorphic multi-core systems are solved, and efficient data communication and control are achieved , reducing the communication cost of multi-core systems.
Patent Information
- Application Number
- CN202411047644.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-12-06
AI Technical Summary
In traditional isomorphic multi-core systems, the master processor and slave processor architecture are the same but when running different operating systems, it is difficult to achieve efficient communication and lack effective communication solutions.
By configuring inter-core interrupt resources and shared memory resources between cores, combining Remoteproc, VirtIO and RPMsg modules, data communication and interrupt delivery between the master processor and the slave processor are realized, and the master processor controls the operation of the slave processor. In scenarios where the master processor and slave processor architecture are the same but the operating system is different.
Data communication and control between the master processor and the slave processor are realized, and communication solutions for running different operating systems under the same architecture are provided, reducing the communication costs of multi-core systems.
Smart Images

Figure CN119088589A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of chip technology, and in particular to a communication method for a multi-core system. Background Art
[0002] With the development of computer technology, the improvement of chip design level and the increase of application demand, multi-core systems are increasingly widely used in products. Based on the hardware perspective, multi-core systems are divided into homogeneous multi-core systems and heterogeneous multi-core systems. Specifically, if the architecture of the master processor and the slave processor is the same, the system is called a homogeneous multi-core system. If the architecture of the master processor and the slave processor is different, the system is called a heterogeneous multi-core system.
[0003] In traditional homogeneous multi-core systems, the communication between the master processor and the slave processor is achieved by letting the master processor and the slave processor run the same operating system (for example, both the master processor and the slave processor run the Linux operating system) and using the SMP (Symmetric multiprocessing) architecture. However, with the development of computer technology, more users also hope that the master processor and the slave processor can run different operating systems when the architecture of the master processor and the slave processor are the same, for example, the master processor runs the Linux operating system and the slave processor runs a bare metal or some real-time operating system RTOS. Therefore, there is an urgent need for a solution that can achieve communication between the master processor and the slave processor when the architecture of the master processor and the slave processor are the same and the operating systems of the master processor and the slave processor are different. Summary of the invention
[0004] In view of the above problems, the present application provides a communication method for a multi-core system to solve the above technical problems.
[0005] In a first aspect, the present application provides a communication method for a multi-core system, which is applied to a main processor in a main processor and a slave processor, the main processor and the slave processor are processors of the same architecture, and the main processor runs a first operating system, and the communication method for the multi-core system includes:
[0006] Configure inter-core interrupt resources and inter-core shared memory resources, and configure the Remoteproc module, VirtIO module, and RPMsg module respectively;
[0007] Start the slave processor through the Remoteproc module;
[0008] Read the preset name service announcement sent from the processor from the inter-core shared memory through the VirtIO module to create an RPMsg communication channel;
[0009] Call the VirtIO module to write data to the inter-core shared memory and send an interrupt to the slave processor through the RPMsg communication channel; or receive the interrupt sent by the slave processor to the master processor through the RPMsg communication channel through the VirtIO module and read data from the inter-core shared memory.
[0010] In some embodiments, the interrupt resources include at least: software-triggered interrupts and serial peripheral interface interrupts, the master processor is used to send serial peripheral interface interrupts to the slave processor, and is used to receive software-triggered interrupts sent by the slave processor;
[0011] The inter-core shared memory resource includes at least: a first memory unit and a second memory unit. The master processor is used to write data to the first memory unit and to receive data written by the slave processor to the second memory unit.
[0012] In some embodiments, the step of calling the VirtIO module to write data to the inter-core shared memory and sending an interrupt to the slave processor through the RPMsg communication channel includes:
[0013] Obtaining a first buffer from a first memory unit;
[0014] Writing preset RPMsg header data and first payload data into the first buffer, where the first payload data is data sent by the master processor to the slave processor;
[0015] placing the first buffer into the second memory unit;
[0016] Sends a serial peripheral interface interrupt to the slave processor to notify the slave processor.
[0017] In some embodiments, the step of receiving, by the VirtIO module, an interrupt sent by the slave processor to the master processor via the RPMsg communication channel, and reading data from the inter-core shared memory includes:
[0018] Obtaining a second buffer placed from the processor into the first memory unit;
[0019] reading data in the second buffer in response to a software-triggered interrupt sent from the processor;
[0020] placing the second buffer into the second memory unit;
[0021] Send a serial peripheral interface interrupt to the slave processor to notify the slave processor.
[0022] In some embodiments, the first operating system is a Linux operating system.
[0023] In a second aspect, the present application provides a communication method for a multi-core system, which is applied to a slave processor in a master processor and a slave processor, wherein the master processor and the slave processor are processors of the same architecture, and the slave processor runs a first operating system, and the communication method for the multi-core system includes:
[0024] In response to the Remoteproc module of the main processor, the preset startup file is executed;
[0025] Configure inter-core interrupt resources and inter-core shared memory resources, as well as configure the RPMsg module and the VirtIO module;
[0026] Configure the libmetal module in the VirtIO module;
[0027] Call the libmetal module to write data to the inter-core shared memory and send an interrupt to the slave processor through the RPMsg communication channel; or receive the interrupt sent by the master processor to the slave processor through the RPMsg communication channel through the libmetal module and read data from the inter-core shared memory.
[0028] In some embodiments, the interrupt resources include at least: software-triggered interrupts and serial peripheral interface interrupts, the slave processor is used to send software-triggered interrupts to the master processor, and is used to receive serial peripheral interface interrupts sent by the master processor;
[0029] The inter-core shared memory resource comprises at least: a first memory unit and a second memory unit, the slave processor is used to write data to the second memory unit, and is used to receive data written by the master processor to the first memory unit.
[0030] In some embodiments, the step of calling the libmetal module to write data to the inter-core shared memory and sending an interrupt to the slave processor through the RPMsg communication channel includes:
[0031] Get a second buffer from a second memory unit;
[0032] Writing preset RPMsg header data and second payload data into the second buffer, where the second payload data is data sent from the slave processor to the master processor;
[0033] placing the second buffer into the first memory unit;
[0034] Send a software-triggered interrupt to the main processor to notify the main processor.
[0035] In some embodiments, the step of receiving, through the libmetal module, an interrupt sent by the master processor to the slave processor via the RPMsg communication channel, and reading data from the inter-core shared memory includes:
[0036] Obtain a first buffer placed into the second memory unit by the main processor;
[0037] Reading data in the first buffer according to a serial peripheral interface interrupt sent by the main processor;
[0038] placing the first buffer into the first memory unit;
[0039] Send a software-triggered interrupt to the main processor to notify the main processor.
[0040] In some embodiments, the second operating system is a bare metal or real-time operating system.
[0041] The present application provides a communication method for a multi-core system. When a master processor and a slave processor are processors of the same architecture, for the master processor, the communication method for the multi-core system includes: configuring inter-core interrupt resources and inter-core shared memory resources, and configuring a Remoteproc module, a VirtIO module, and an RPMsg module respectively; starting the slave processor through the Remoteproc module; reading a preset name service announcement sent by the slave processor from the inter-core shared memory through the VirtIO module to create an RPMsg communication channel; calling the VirtIO module to write data to the inter-core shared memory, and sending an interrupt to the slave processor through the RPMsg communication channel; or, receiving an interrupt sent by the slave processor to the master processor through the RPMsg communication channel through the VirtIO module, and reading data from the inter-core shared memory. For the slave processor, the communication method of the multi-core system includes: running a preset startup file in response to the Remoteproc module of the master processor; configuring inter-core interrupt resources and inter-core shared memory resources, and configuring the RPMsg module and the VirtIO module; configuring the libmetal module in the VirtIO module; calling the libmetal module to write data to the inter-core shared memory, and sending an interrupt to the slave processor through the RPMsg communication channel; or receiving the interrupt sent by the master processor to the slave processor through the RPMsg communication channel through the libmetal module, and reading data from the inter-core shared memory. The communication method of the multi-core system provided in the present application realizes data communication between the master processor and the slave processor based on the inter-core interrupt and inter-core shared memory functions through the above steps, and controls the operation of the slave processor through the master processor, providing a communication solution for the master processor and the slave processor to run different operating systems for a multi-core system with the same architecture.
[0042] These and other aspects of the present application will become more apparent from the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only 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.
[0044] Figure 1 A flow chart of a communication method for a multi-core system provided in an embodiment of the present application is shown.
[0045] Figure 2 A schematic diagram of a multi-core system provided in an embodiment of the present application is shown.
[0046] Figure 3 A communication flow chart of a main processor provided in an embodiment of the present application is shown.
[0047] Figure 4 Another communication flow chart of the main processor provided in an embodiment of the present application is shown.
[0048] Figure 5 Another flow chart of the communication method of the multi-core system provided in the embodiment of the present application is shown.
[0049] Figure 6 Another communication flow chart of the slave processor provided in an embodiment of the present application is shown.
[0050] Figure 7 Another communication flow chart of the main processor provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0051] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0052] In the embodiments of the present application, it should be noted that, in this article, relational terms such as first and second, etc. are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.
[0053] Moreover, the terms "comprises," "comprising," or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.
[0054] In addition, the "plurality" in the embodiments of the present application refers to two or more than two. In view of this, in the embodiments of the present application, "plurality" can also be understood as "at least two". "At least one" can be understood as one or more, for example, one, two or more. For example, including at least one means including one, two or more, and there is no limit on which ones are included. For example, including at least one of A, B and C, then A, B, C, A and B, A and C, B and C, or A, B and C can be included.
[0055] An embodiment of the present application provides a communication method for a multi-core system, which is applied to a scenario in which a master processor and a slave processor have the same architecture, the master processor runs a first operating system, and the slave processor runs a second operating system.
[0056] In some embodiments, the first operating system running on the master processor is a Linux operating system, and the second operating system running on the slave processor is a standalone or real-time operating system (RTOS, such as freeRTOS).
[0057] In some embodiments, Figure 1 A flow chart of a communication method for a multi-core system provided in an embodiment of the present application is shown. Figure 2 A schematic diagram of a multi-core system provided in an embodiment of the present application is shown. Figure 1 and Figure 2 As shown, in a main processor running a first operating system, the communication method of the multi-core system includes:
[0058] Configure inter-core interrupt resources and inter-core shared memory resources, and configure the Remoteproc module, the VirtIO module, and the RPMsg module respectively. Optionally, configuring the inter-core interrupt resources and the inter-core shared memory resources means that the master processor applies for an interrupt to its kernel and applies for the inter-core shared memory, and completes the memory mapping of the inter-core shared memory, wherein the location of the inter-core shared memory is located in the DDR memory connected to the master processor and the slave processor.
[0059] In some embodiments, the first operating system running on the main processor is a Linux operating system.
[0060] It can be understood that the Remoteproc (Remote processor) module is a framework for managing and controlling remote processors. It is a subsystem in the Linux kernel, which is used to manage and coordinate the start, stop and communication of multiple processors, and realize the life cycle management of slave processors; the VirtIO (Virtual Input Output) module is a standardized interface for providing high-performance I / O device virtualization in a virtualized environment, providing a set of general frameworks and standard interfaces or protocols to complete the interaction process between the two, reducing the compatibility issues caused by cross-platform. RPMsg (Remote processor messaging) module: The RPMSG protocol is built on virtIO (a universal virtualization device interface), and realizes two-way message transmission and data exchange by creating virtual devices and channels between the master processor and the slave processor, and defines the standard binary interface used for communication between cores. The configuration means of the above three modules are known technical means for processors, so this application will not be repeated here.
[0061] In some embodiments, Figure 1 As shown, configuring the Remoteproc module, the VirtIO module, and the RPMsg module includes configuring the devices and device drivers of Remoteproc, VirtIO, and RPMsg, respectively.
[0062] The slave processor is started through the Remoteproc module. Optionally, the second operating system running on the slave processor is a standalone or real-time operating system RTOS. When the slave processor is started, a preset startup file (.elf format file, usually called an executable file) must be run first, and the Remoteproc module is used to control the slave processor to run the startup file.
[0063] The preset name service announcement sent by the slave processor is read from the inter-core shared memory through the VirtIO module to create an RPMsg communication channel. Optionally, after the slave processor runs the startup file and executes the communication method of the multi-core system provided in the embodiment of the present application, it will send a preset name service announcement to the master processor to notify the master processor. After receiving the name service announcement, the master processor will create an RPMsg communication channel for performing data communication between the master and slave processors, wherein the VirtIO module is a virtual interface for communication between the master processor and the slave processor, and the master processor transmits information to the slave processor through the VirtIO module.
[0064] Call the VirtIO module to write data to the inter-core shared memory and send an interrupt to the slave processor through the RPMsg communication channel; or, receive the interrupt sent by the slave processor to the master processor through the RPMsg communication channel through the VirtIO module, and read data from the inter-core shared memory. Optionally, after the master processor writes the data to the inter-core shared memory, it sends an interrupt to the slave processor, which will generate a callback function to enable the slave processor to read data from the inter-core shared memory. The master processor receives the interrupt sent by the slave processor, and the callback function generated by the interrupt will also enable the master processor to read data from the inter-core shared memory.
[0065] In some embodiments, for the main processor, in the communication method of the multi-core system provided in the embodiments of the present application, the interrupt resources include at least: software triggered (Software Generated Interrupt, SGI) interrupt and serial peripheral interface (Serial Peripheral Interface Interrupt, SPI) interrupt, the main processor is used to send serial peripheral interface interrupt to the slave processor, and to receive software triggered interrupt sent by the slave processor.
[0066] The inter-core shared memory resource includes at least: a first memory unit and a second memory unit. The master processor is used to write data to the first memory unit and to receive data written by the slave processor to the second memory unit.
[0067] Alternatively, if Figure 2 As shown, in an embodiment of the present application, when the main processor writes data to the first memory unit, a serial peripheral interface interrupt will be sent to the slave processor to notify the slave processor, and when the slave processor writes data to the main processor, a software triggered interrupt will be sent to the main processor to notify the main processor.
[0068] The communication method for a multi-core system provided in an embodiment of the present application uses software-triggered interrupts and serial peripheral interface interrupts to perform communication between master and slave processors. Software-triggered interrupts and serial peripheral interface interrupts do not require the setting of hardware IP cores, thereby reducing the communication cost of the multi-core system.
[0069] In some embodiments, Figure 3 The communication flow chart of the main processor provided in the embodiment of the present application is shown as follows: Figure 3 As shown, for the master processor, in the communication method of the multi-core system provided in the embodiment of the present application, the steps of calling the VirtIO module to write data to the inter-core shared memory and sending an interrupt to the slave processor through the RPMsg communication channel specifically include:
[0070] A first buffer is obtained from a first memory unit.
[0071] Preset RPMsg header data and first payload data are written into the first buffer, where the first payload data is data sent from the master processor to the slave processor.
[0072] The first buffer is placed into the second memory location.
[0073] Sends a serial peripheral interface interrupt to the slave processor to notify the slave processor.
[0074] In some embodiments, Figure 4 Another communication flow chart of the main processor provided in the embodiment of the present application is shown as follows: Figure 4 As shown, for the main processor, in the communication method of the multi-core system provided in the embodiment of the present application, the steps of receiving the interrupt sent by the slave processor to the main processor through the RPMsg communication channel through the VirtIO module and reading data from the inter-core shared memory include:
[0075] A second buffer placed from the processor into the first memory unit is obtained.
[0076] The data in the second buffer is read according to a software triggered interrupt sent from the processor.
[0077] The second buffer is placed in the second memory location.
[0078] Send a serial peripheral interface interrupt to the slave processor to notify the slave processor.
[0079] It is understandable that the first buffer for storing the master processor data and the second buffer for storing the slave processor data are not limited to specific buffers in the first memory unit and the second memory unit, that is, the first buffer and the second buffer can be preset according to design requirements.
[0080] In some embodiments, Figure 5 Another flow chart of the communication method of the multi-core system provided in the embodiment of the present application is shown as follows: Figure 2 and Figure 5 As shown, in a slave processor running a second operating system, the communication method of the multi-core system includes:
[0081] In response to the Remoteproc module of the master processor running a preset startup file. Optionally, the slave processor is controlled by the Remoteproc module of the master processor to run the startup file, which is an executable file in .elf format.
[0082] Configure inter-core interrupt resources and inter-core shared memory resources, and configure the RPMsg module and the VirtIO module. Optionally, configuring the inter-core interrupt resources and inter-core shared memory resources is to apply for the interrupt of the slave processor and the inter-core shared memory for the slave processor, and complete the memory mapping of the inter-core shared memory, and the location of the inter-core shared memory is located in the DDR memory connected to the master processor and the slave processor. For the slave processor, the inter-core interrupt, inter-core shared memory, RPMsg module and VirtIO module in the slave processor are configured through a preset resource table, wherein the resource table contains the configuration content of the inter-core interrupt resources, inter-core shared memory resources, RPMsg module and VirtIO module.
[0083] The libmetal module is configured in the VirtIO module. Optionally, the slave processor runs a bare metal (standalone) or implements an operating system RTOS. For the slave processor, the libmetal module is configured in the VirtIO module through a preset resource table, wherein the slave processor communicates data with the master processor through the libmetal module.
[0084] It is understandable that the Libmetal module is an open source basic library for providing underlying hardware abstraction and device access interfaces, and provides a set of common APIs for accessing hardware resources such as device registers, memory mapping, and interrupts, so as to enable communication and memory resource sharing between heterogeneous processors. From the processor, the configuration methods of the RPMsg module, the VirtIO module, and the libmetal module are known technical methods for processors running bare metal / real-time operating systems, so this application will not be repeated here.
[0085] Call the libmetal module to write data to the inter-core shared memory and send an interrupt to the slave processor through the RPMsg communication channel; or receive the interrupt sent by the master processor to the slave processor through the libmetal module through the RPMsg communication channel, and read data from the inter-core shared memory. Optionally, after writing data to the inter-core shared memory, the slave processor sends an interrupt to the master processor, which will generate a callback function to enable the master processor to read data from the inter-core shared memory. The slave processor receives the interrupt sent by the master processor, and the callback function generated by the interrupt will also enable the slave processor to read data from the inter-core shared memory.
[0086] In some embodiments, Figure 2As shown, for the slave processor, in the communication method of the multi-core system provided in the embodiment of the present application, the interrupt resources include at least: software triggered (Software Generated Interrupt, SGI) interrupt and serial peripheral interface (Serial Peripheral Interface Interrupt, SPI) interrupt, the slave processor is used to send software triggered interrupt to the master processor, and to receive serial peripheral interface interrupt sent by the master processor.
[0087] The inter-core shared memory resource comprises at least: a first memory unit and a second memory unit, the slave processor is used to write data to the second memory unit, and is used to receive data written by the master processor to the first memory unit.
[0088] Alternatively, if Figure 2 As shown, in an embodiment of the present application, when the slave processor writes data to the second memory unit, a software triggered interface interrupt will be sent to the master processor to notify the master processor, and when the master processor writes data to the slave processor, a serial peripheral interface interrupt will be sent to the slave processor to notify the slave processor.
[0089] The communication method for a multi-core system provided in an embodiment of the present application uses software-triggered interrupts and serial peripheral interface interrupts to perform communication between master and slave processors. Software-triggered interrupts and serial peripheral interface interrupts do not require the setting of hardware IP cores, thereby reducing the communication cost of the multi-core system.
[0090] In some embodiments, Figure 6 FIG. 4 shows another communication flow chart of a slave processor provided in an embodiment of the present application, such as Figure 6 As shown, for the slave processor, in the communication method of the multi-core system provided in the embodiment of the present application, the steps of calling the libmetal module to write data to the inter-core shared memory and sending an interrupt to the slave processor through the RPMsg communication channel include:
[0091] A second buffer is obtained from the second memory unit.
[0092] The preset RPMsg header data and the second load data are written into the second buffer, where the second load data is the data sent from the processor to the main processor.
[0093] Place the second buffer into the first memory location.
[0094] Send a software-triggered interrupt to the main processor to notify the main processor.
[0095] In some embodiments, Figure 7 Another communication flow chart of the main processor provided in the embodiment of the present application is shown as follows: Figure 7As shown, for the slave processor, in the communication method of the multi-core system provided in the embodiment of the present application, the steps of receiving the interrupt sent by the master processor to the slave processor via the RPMsg communication channel through the libmetal module and reading data from the inter-core shared memory include:
[0096] Obtain a first buffer placed into the second memory unit by the main processor;
[0097] Reading data in the first buffer according to a serial peripheral interface interrupt sent by the main processor;
[0098] placing the first buffer into the first memory unit;
[0099] Send a software-triggered interrupt to the main processor to notify the main processor.
[0100] The communication method of a multi-core system provided in an embodiment of the present application, when a master processor and a slave processor are processors of the same architecture, for the master processor, the master processor runs a Linux operating system, and the communication method of the multi-core system includes: configuring inter-core interrupt resources and inter-core shared memory resources, and configuring a Remoteproc module, a VirtIO module, and an RPMsg module respectively; starting the slave processor through the Remoteproc module; reading a preset name service announcement sent by the slave processor from the inter-core shared memory through the VirtIO module to create an RPMsg communication channel; calling the VirtIO module to write data to the inter-core shared memory, and sending an interrupt to the slave processor through the RPMsg communication channel; or, receiving an interrupt sent by the slave processor to the master processor through the RPMsg communication channel through the VirtIO module, and reading data from the inter-core shared memory. For the slave processor, the slave processor runs a bare metal or real-time operating system, and the communication method of the multi-core system includes: responding to the Remoteproc module of the master processor to run a preset startup file; configuring inter-core interrupt resources and inter-core shared memory resources, and configuring the RPMsg module and the VirtIO module; configuring the libmetal module in the VirtIO module; calling the libmetal module to write data to the inter-core shared memory, and sending an interrupt to the slave processor through the RPMsg communication channel; or receiving the interrupt sent by the master processor to the slave processor through the RPMsg communication channel through the libmetal module, and reading data from the inter-core shared memory. The communication method of the multi-core system provided in the embodiment of the present application, through the above scheme, realizes data communication between the master processor and the slave processor based on the inter-core interrupt and inter-core shared memory functions, and controls the operation of the slave processor through the master processor. A communication solution is provided for a multi-core system with the same architecture as the master processor and the slave processor running different operating systems.
[0101] The above contents are further detailed descriptions of the present application in combination with specific implementation methods, and it cannot be determined that the specific implementation of the present application is limited to these descriptions. For ordinary technicians in the technical field to which the present application belongs, several simple deductions or substitutions can be made without departing from the concept of the present application, which should be regarded as the protection scope of the present application.
Claims
1. A communication method for a multi-core system, characterized in that: The main processor is applied to a main processor and a slave processor, the main processor and the slave processor are processors of the same architecture, and the main processor runs a first operating system, and the communication method of the multi-core system includes: Configure inter-core interrupt resources and inter-core shared memory resources, and configure the Remoteproc module, VirtIO module, and RPMsg module respectively; Starting the slave processor via the Remoteproc module; Reading the preset name service announcement sent by the slave processor from the inter-core shared memory through the VirtIO module to create an RPMsg communication channel; Call the VirtIO module to write data to the inter-core shared memory, and send an interrupt to the slave processor through the RPMsg communication channel; or receive an interrupt sent by the slave processor to the master processor through the RPMsg communication channel through the VirtIO module, and read data from the inter-core shared memory.
2. The communication method of a multi-core system as claimed in claim 1, characterized in that: The interruption resources at least include: software-triggered interruption and serial peripheral interface interruption, the master processor is used to send the serial peripheral interface interruption to the slave processor, and is used to receive the software-triggered interruption sent by the slave processor; The inter-core shared memory resource includes at least: a first memory unit and a second memory unit, the master processor is used to write data to the first memory unit, and is used to receive data written by the slave processor to the second memory unit.
3. The communication method of the multi-core system as claimed in claim 2 comprises: The step of calling the VirtIO module to write data to the inter-core shared memory and sending an interrupt to the slave processor through the RPMsg communication channel includes: Obtain a first buffer from the first memory unit; Writing preset RPMsg header data and first payload data into the first buffer, where the first payload data is data sent by the master processor to the slave processor; placing the first buffer into a second memory unit; The serial peripheral interface interrupt is sent to the slave processor to notify the slave processor.
4. The communication method of a multi-core system as claimed in claim 2, characterized in that: The step of receiving, through the VirtIO module, an interrupt sent by the slave processor to the master processor via the RPMsg communication channel, and reading data from the inter-core shared memory comprises: Obtaining a second buffer placed in the first memory unit from the processor; reading data in the second buffer according to the software-triggered interrupt sent by the slave processor; placing the second buffer into the second memory unit; The serial peripheral interface interrupt is sent to the slave processor to notify the slave processor.
5. The communication method of a multi-core system as claimed in claim 1, characterized in that: The first operating system is a Linux operating system.
6. A communication method for a multi-core system, characterized in that: The slave processor is applied to a master processor and a slave processor, the master processor and the slave processor are processors of the same architecture, and the slave processor runs a second operating system, and the communication method of the multi-core system includes: In response to the Remoteproc module of the main processor running a preset startup file; Configure inter-core interrupt resources and inter-core shared memory resources, as well as configure the RPMsg module and the VirtIO module; Configuring a libmetal module in the VirtIO module; Call the libmetal module to write data to the inter-core shared memory, and send an interrupt to the slave processor through the RPMsg communication channel created by the master processor; or receive the interrupt sent by the master processor to the slave processor through the RPMsg communication channel through the libmetal module, and read data from the inter-core shared memory.
7. The communication method of the multi-core system as claimed in claim 6 comprises: The interrupt resources at least include: software-triggered interrupts and serial peripheral interface interrupts, and the slave processor is used to send the software-triggered interrupts to the master processor, and to receive the serial peripheral interface interrupts sent by the master processor; The inter-core shared memory resource includes at least: a first memory unit and a second memory unit, and the slave processor is used to write data to the second memory unit and to receive data written by the master processor to the first memory unit.
8. The communication method of the multi-core system as claimed in claim 7 comprises: The step of calling the libmetal module to write data to the inter-core shared memory and sending an interrupt to the slave processor through the RPMsg communication channel created by the master processor includes: Obtain a second buffer from the second memory unit; Writing preset RPMsg header data and second payload data into the second buffer, where the second payload data is data sent by the slave processor to the master processor; placing the second buffer into the first memory unit; The software-triggered interrupt is sent to the main processor to notify the main processor.
9. The communication method of a multi-core system as claimed in claim 7, characterized in that: The step of receiving, through the libmetal module, an interrupt sent by the master processor to the slave processor via the RPMsg communication channel, and reading data from the inter-core shared memory comprises: Obtaining a first buffer placed by the main processor into the second memory unit; Reading data in the first buffer according to a serial peripheral interface interrupt sent by the main processor; placing the first buffer into the first memory unit; The software-triggered interrupt is sent to the main processor to notify the main processor.
10. The communication method of a multi-core system as claimed in claim 9, characterized in that: The second operating system is a bare metal or real-time operating system.
Citation Information
Cited By
Interrupt processing method and device, electronic equipment and storage medium
CN120743480A
Interrupt processing method and apparatus, electronic device, and storage medium
CN120743480B
