DSP (Digital Signal Processor) inter-core communication method
By introducing a mutually exclusive signal light module in the multi-core DSP system, the problem of instability of IPC interrupt notification is solved, the stable timing and information integrity of inter-core communication is achieved, and the normal operation of multi-core parallel processing is ensured.
Patent Information
- Application Number
- CN202411352749.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2024-12-06
AI Technical Summary
In multi-core DSP systems, traditional IPC interrupt notification methods are prone to interrupt loss, affecting processing timing and results. Especially on domestic Feiteng 6678N chips, the lack of hardware queues leads to instability of inter-core communication.
The mutually exclusive signal light module is introduced, and through the coordinated use of IPC interrupts and signal lights, it ensures that interrupts are triggered in sequence in a stable timing, preventing conflicts and loss, and achieving stability of inter-core communication.
Through the signal light locking and unlocking mechanism, the sequence and integrity of interrupt information are ensured, interrupt loss is avoided, the stability of inter-core communication and information carrying capacity are improved, and multi-core parallel processing is supported.
Smart Images

Figure CN119088749A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and in particular relates to a DSP inter-core communication method. Background Art
[0002] In the field of embedded high-performance computing, multi-core DSPs are widely used. When multiple tasks or functions are independently and massively executed in parallel on different cores within a chip, how to efficiently perform on-chip scheduling and inter-core communication determines the performance of the system. A common application scenario is to divide the chip into a master core and several slave cores. The master core puts the data to be processed in the multi-core shared storage space, notifies other slave cores to process part of the data in parallel, and then notifies the master core after the slave core has completed the processing.
[0003] The multi-core TMS320C6678 chip of Texas Instruments (TI) is widely used in the field of domestic embedded high-performance computing. It can use the hardware queue function to realize inter-core data communication and inter-core interrupt functions, and its application is relatively mature. In recent years, the domestic multi-core DSP Feiteng 6678N chip with comparable performance has also been gradually applied. It has 8 cores and can process multiple tasks in parallel. However, this chip does not have a hardware queue and only provides IPC interrupts for inter-core notification functions. The traditional method is that multiple slave cores operate different bits of the same IPC trigger register. After the main core generates an interrupt, the main core polls all bits and confirms the number of times the interrupt should be triggered based on the number of bits set. In actual applications, it is found that when multiple slave cores complete processing and notify the main core, interrupt loss is prone to occur, resulting in the inability of the application to run according to the normal parallel processing process, affecting the processing sequence and results. Summary of the invention
[0004] In order to solve the above problems, the present application provides a DSP inter-core communication method, which is applied to the communication between a single master core and multiple slave cores. The DSP inter-core communication method includes:
[0005] Step 1: The master core schedules the slave cores in turn through the IPC interrupt. After receiving the IPC interrupt, the slave core extracts data from the data area to be processed for processing;
[0006] Step 2: When multiple slave cores have completed processing and need to notify the master core, all slave cores initiate a request to obtain the semaphore;
[0007] Step 3: The first slave core to obtain the semaphore locks the semaphore to prevent other slave cores from obtaining it;
[0008] Step 4: The slave core that obtains the signal light establishes communication with the master core. After the communication is completed, the signal light is unlocked;
[0009] Step 5: The other slave cores that have not obtained the semaphore repeat steps 3 and 4 until all slave cores have completed communication with the master core.
[0010] Preferably, before the master core schedules the slave cores in sequence through IPC interrupts, the IPC interrupt modules in the master core and the slave core are initialized.
[0011] Preferably, the initialization includes: IPC interrupt mounting and interrupt enabling, and binding and mounting the interrupt service program and the interrupt event to a specified interrupt vector.
[0012] Preferably, before the master core sequentially schedules the slave cores through IPC interruption, the semaphore is initialized, shared resources are set for multi-core mutual exclusion, and a semaphore is applied for as a basic setting for inter-core communication.
[0013] Preferably, the communication step between the slave core that obtains the semaphore in step 4 and the main core includes: the slave core that obtains the semaphore confirms whether the last interruption was exited, and after confirming the exit, generates interrupt information and sends an IPC interruption to the main core, and after the main core obtains the IPC interruption, enters the interrupt service program, executes the corresponding user program and clears the interruption.
[0014] Preferably, the interrupt information needs to be formed by combining interrupt source indication bits, and the combined interrupt source indication bits can set multiple indication bits at the same time, so that the information carried by the IPC interrupt becomes more.
[0015] Advantages of this application include:
[0016] 1) The present invention introduces a mutually exclusive signal light module, so that the inter-core interrupt has a stable timing when it is sent, and the interrupts are triggered in sequence according to the order of obtaining the same signal light.
[0017] 2) In the present invention, each interrupt source indication bit of the interrupt trigger register can be set at the same time, so that the amount of information carried is increased, and a maximum of 28 bits of data can be carried.
[0018] 3) Before sending an interrupt, confirm that the previous interrupt has been processed, so that the sending process of the entire inter-core communication is after the processing process, with stable timing, no conflict, and thus the interrupt will not be lost.
[0019] The present invention can be applied to radar processing systems using the Feiteng 6678N chip, and can also be extended to related fields such as aviation, aerospace, shipping, communications, electronic warfare, etc. using this chip. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 This is an application scenario of an embodiment of the present invention.
[0021] Figure 2This is the inter-core communication initialization process of an embodiment of the present invention.
[0022] Figure 3 This is the inter-core communication interrupt sending process of an embodiment of the present invention.
[0023] Figure 4 This is the inter-core communication interrupt processing flow of an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to make the technical solution and advantages of the present application clearer, the technical solution of the present application will be further described in detail in detail and in detail in conjunction with the accompanying drawings. It can be understood that the specific embodiments described here are only partial embodiments of the present application, which are only used to explain the present application, not to limit the present application. It should be noted that, for the convenience of description, only the parts related to the present application are shown in the accompanying drawings, and other related parts can refer to the general design. In the absence of conflict, the embodiments in the present application and the technical features in the embodiments can be combined with each other to obtain new embodiments.
[0025] The present application provides a DSP inter-core communication method, which is applied to the communication between a single master core and multiple slave cores. The DSP inter-core communication method includes:
[0026] Step 1: The master core schedules the slave cores in turn through the IPC interrupt. After receiving the IPC interrupt, the slave core extracts data from the data area to be processed for processing;
[0027] Step 2: When multiple slave cores have completed processing and need to notify the master core, all slave cores initiate a request to obtain the semaphore;
[0028] Step 3: The first slave core to obtain the semaphore locks the semaphore to prevent other slave cores from obtaining it;
[0029] Step 4: The slave core that obtains the signal light establishes communication with the master core. After the communication is completed, the signal light is unlocked;
[0030] Step 5: The other slave cores that have not obtained the semaphore repeat steps 3 and 4 until all slave cores have completed communication with the master core.
[0031] In some optional implementations, before the master core schedules the slave cores in sequence through the IPC interrupt, the IPC interrupt modules in the master core and the slave core are initialized.
[0032] In some optional implementations, the initialization includes: IPC interrupt mounting and interrupt enabling, binding the interrupt service routine and the interrupt event and mounting them to a specified interrupt vector.
[0033] In some optional implementations, before the master core sequentially schedules the slave cores through IPC interrupts, the semaphore is initialized, shared resources are set for multi-core mutual exclusion, and a semaphore is applied for as a basic setting for inter-core communication.
[0034] In some optional embodiments, the communication step between the slave core that obtains the semaphore in step 4 and the main core includes: the slave core that obtains the semaphore confirms whether the last interruption was exited, and after confirming the exit, generates interrupt information and sends an IPC interruption to the main core; after the main core obtains the IPC interruption, it enters the interrupt service program, executes the corresponding user program and clears the interruption.
[0035] In some optional implementations, the interrupt information needs to be formed by combining interrupt source indication bits, and the combined interrupt source indication bits can set multiple indication bits at the same time, so that the IPC interrupt carries more information.
[0036] In order to describe the present invention in more detail, the technical solution of the present invention is described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0037] like Figure 1 The figure shows a specific application scenario of the embodiment. The multi-cores inside the chip are divided into a master core and several slave cores by the user. The master core schedules the slave cores in sequence through IPC interrupts. After receiving the interrupt, the slave core extracts data from the data area to be processed for processing, and notifies the master core after the processing is completed.
[0038] like Figure 2 , Figure 3 and Figure 4 As shown in the figure, this is the workflow diagram related to this method, and the specific working process is as follows:
[0039] 1) First, initialize the IPC interrupt module, including IPC interrupt mounting and interrupt enabling, bind the interrupt service routine and interrupt event, and mount it to the specified interrupt vector.
[0040] 2) Initialize the semaphore module, set up shared resources, and apply for semaphores as the basic settings for subsequent interrupt sending.
[0041] 3) When multiple slave cores have completed processing and need to notify the master core, all slave cores initiate a request to obtain the semaphore.
[0042] 4) The first slave core to obtain the semaphore locks the semaphore to prevent other slave cores from obtaining it.
[0043] 5) After locking, enter the inter-core communication interrupt sending process. First, confirm whether the last interrupt has exited. After confirming the exit, combine the interrupt source indication bits, form the interrupt information and send the IPC interrupt. Then unlock the semaphore for other cores to use and exit the sending process.
[0044] 6) The main core triggers the IPC interrupt, enters the interrupt service routine, obtains the interrupt information, executes the corresponding user program and clears the interrupt.
[0045] 7) Other slave cores repeat steps 4 and 5 until all slave cores complete the inter-core interrupt transmission and the master core completes the response to all slave cores.
[0046] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application 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 DSP inter-core communication method, characterized in that: Applied to communication between a single master core and multiple slave cores, the DSP inter-core communication method includes: Step 1: The master core schedules the slave cores in sequence through IPC interrupts. After receiving the IPC interrupt, the slave core extracts data from the data area to be processed for processing; Step 2: When multiple slave cores have completed processing and need to notify the master core, all slave cores initiate a request to obtain the semaphore; Step 3: The first slave core to obtain the semaphore locks the semaphore to prevent other slave cores from obtaining it; Step 4: The slave core that obtains the semaphore establishes communication with the master core. After the communication is completed, the semaphore is unlocked. Step 5: The other slave cores that have not obtained the semaphore repeat steps 3 and 4 until all slave cores have completed communication with the master core.
2. The DSP inter-core communication method according to claim 1, wherein: Before the master core schedules the slave cores in sequence through the IPC interrupt, the IPC interrupt modules in the master core and the slave core are initialized.
3. The DSP inter-core communication method according to claim 2, wherein: The initialization includes: IPC interrupt mounting and interrupt enabling, binding the interrupt service program and the interrupt event and mounting them on the specified interrupt vector.
4. The DSP inter-core communication method according to claim 1, wherein: Before the master core schedules the slave cores in sequence through IPC interrupts, the semaphore is initialized, shared resources are set for multi-core mutual exclusion, and a semaphore is applied as the basic setting for inter-core communication.
5. The DSP inter-core communication method according to claim 1, wherein: The communication steps between the slave core that obtains the semaphore in step 4 and the master core include: the slave core that obtains the semaphore confirms whether the last interrupt has exited, and after confirming the exit, generates interrupt information and sends an IPC interrupt to the master core. After the master core obtains the IPC interrupt, it enters the interrupt service program, executes the corresponding user program and clears the interrupt.
6. The DSP inter-core communication method according to claim 1, wherein: The interrupt source indication bits need to be combined to form the interrupt information. The combined interrupt source indication bits can set multiple indication bits at the same time, so that the information carried by the IPC interrupt becomes more.
