Inter-core communication method, multi-chip system, chip and storage medium
By realizing inter-core communication in a multi-chip system, the problems of power consumption and area limitation of single chips are solved, and the information processing capacity and resource management of multi-core systems are improved, meeting the needs of future products for information processing capabilities.
Patent Information
- Application Number
- CN202310566910.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-18
- Publication Date
- 2024-11-22
AI Technical Summary
The limitations of power consumption, area and operating speed of a single chip make it difficult to add new functions to a single chip, making it difficult to improve the information processing capacity and speed of electronic systems.
By implementing inter-core communication methods in a multi-chip system, messages are allowed to be transmitted between multiple cores, including communication between the sending and receiving ends between the same chip or different chips, and messages are performed using the message source flag bits and communication service modules. Delivery and resource management.
It realizes inter-core communication in multi-core systems, thus solving the problem of large power consumption per chip area to a certain extent, meeting the needs of improving information processing capabilities, saving power consumption and rationalizing resource allocation.
Smart Images

Figure CN119003436A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to, but are not limited to, the field of detection technology, and in particular to an inter-core communication method and a multi-chip system, chip, and storage medium. Background Art
[0002] With the rapid development of science and technology, the speed of electronic product updates and iterations in the application market is accelerating, and their functions are becoming increasingly powerful. The corresponding integrated circuits in electronic systems are becoming more and more complex, and multi-core processor systems have become an inevitable development trend. However, the scale and speed requirements of electronic system information processing are still increasing. If new functions are still developed on a single chip, the number of transistors on the chip will also increase exponentially. The negative impact brought by the shortcomings of power consumption, area and operating speed of a single chip may violate the original intention of adding new functions. At this time, it is obviously not cost-effective to spend a lot of time to weigh speed and power consumption area from the design level. Summary of the invention
[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.
[0004] The embodiment of the present disclosure provides an inter-core communication method, which is applied to a multi-chip system, wherein the multi-chip system includes a plurality of chips, each chip includes at least one core, and the inter-core communication method includes:
[0005] A sending end sends an inter-core communication message to a receiving end, wherein the sending end is one core in the multi-chip system, the receiving end is another core in the multi-chip system, and the sending end and the receiving end are located in the same chip or in different chips;
[0006] The receiving end receives the inter-core communication message and sets a message source flag.
[0007] An embodiment of the present disclosure also provides a multi-chip system, comprising a memory; and a processor connected to the memory, wherein the memory is used to store instructions, and the processor is configured to execute the steps of the inter-core communication method as described in any embodiment of the present disclosure based on the instructions stored in the memory.
[0008] The present disclosure also provides an inter-core communication method, including:
[0009] The sender sends inter-core communication messages to the receiver;
[0010] The sending end detects whether the receiving end sets a message source flag.
[0011] Optionally, when the sending end detects that the receiving end has set the message source flag, the sending end notifies the receiving end to clear the message source flag.
[0012] The present disclosure also provides an inter-core communication method, including:
[0013] The receiving end receives the inter-core communication message;
[0014] The receiving end replies with a first response message to the communication service module of the chip to which the receiving end belongs, so that the communication service module of the chip to which the receiving end belongs sets a message source flag in a second data element of a second register corresponding to the receiving end.
[0015] Optionally, the receiving end receives a clear flag message.
[0016] Optionally, the receiving end replies with a second response message to the communication service module of the chip to which the receiving end belongs, so that the communication service module of the chip to which the receiving end belongs clears the message source flag in the second data element of the second register corresponding to the receiving end.
[0017] An embodiment of the present disclosure also provides a chip, comprising a memory; and a processor connected to the memory, wherein the memory is used to store instructions, and the processor is configured to execute the steps of the inter-core communication method described in any embodiment of the present disclosure based on the instructions stored in the memory.
[0018] An embodiment of the present disclosure further provides a storage medium on which a computer program is stored. When the program is executed by a processor, the method for inter-core communication described in any embodiment of the present disclosure is implemented.
[0019] The inter-core communication method and multi-chip system, chip, and storage medium of the embodiments of the present invention transmit inter-core communication messages from a transmitting end to a receiving end, and the receiving end receives the inter-core communication messages and sets its message source flag, thereby realizing communication between multiple cores in a multi-chip system, thereby solving the limitations of large power consumption and difficult performance improvement of a single chip area to a certain extent, and solving the demand for large-scale information processing capabilities of future products. It can jump from inter-core communication within a chip to inter-core communication between chips, trigger inter-core enabling and resource preemption from a three-dimensional perspective, save power consumption, and rationalize and improve resource allocation effects.
[0020] Other aspects will become apparent upon reading and understanding the drawings and detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings are used to provide a further understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure. The shapes and sizes of the components in the accompanying drawings do not reflect the actual proportions and are only intended to illustrate the contents of the present disclosure.
[0022] Figure 1 A flowchart of a method for inter-core communication provided for an exemplary embodiment of the present disclosure;
[0023] Figure 2A and Figure 2B Structural schematic diagrams of two multi-chip systems provided for exemplary embodiments of the present disclosure;
[0024] Figure 3A and Figure 3B A schematic diagram of a transmission method for inter-chip and inter-core communication provided for an exemplary embodiment of the present disclosure;
[0025] Figure 4A and Figure 4B A schematic diagram of a communication process between two chips provided for an exemplary embodiment of the present disclosure;
[0026] Figure 5A and Figure 5B Schematic diagrams of two register configuration message formats provided for exemplary embodiments of the present disclosure;
[0027] Figure 6 A schematic diagram of the structure of another multi-chip system provided for an exemplary embodiment of the present disclosure;
[0028] Figure 7 and Figure 8 Schematic diagram of the structures of two chips provided for exemplary embodiments of the present disclosure. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features in the embodiments of the present disclosure can be combined with each other arbitrarily without conflict.
[0030] Unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprising" and similar words mean that the elements or objects before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects.
[0031] like Figure 1 As shown, an embodiment of the present disclosure provides an inter-core communication method, which is applied to a multi-chip system. The multi-chip system includes multiple chips, each chip includes at least one core, and the inter-core communication method includes:
[0032] Step 101: A sending end sends an inter-core communication message to a receiving end. For example, the sending end is a core in a multi-chip system, and the receiving end is another core in the multi-chip system. The sending end and the receiving end may be located in the same chip or in different chips.
[0033] Step 102: The receiving end receives the inter-core communication message and sets the message source flag.
[0034] In a multi-chip system, there is communication between multiple cores between chips, and there is communication between multiple cores within a chip. In the disclosed embodiment, when the sender and the receiver are located in the same chip, the inter-core communication process between the sender and the receiver is the inter-core communication behavior within the chip; when the sender and the receiver are located in different chips, the inter-core communication process between the sender and the receiver is the inter-core communication behavior between chips. The inter-core communication behavior, whether within a chip or between chips, can be regarded as a closed-loop process in which the sender sends information to the receiver and the receiver feeds back information to the sender. When the receiver receives the inter-core communication message from the sender, the receiver sets its message source flag as a response to successful communication.
[0035] The inter-core communication method of the disclosed embodiment sends an inter-core communication message from a sending end to a receiving end. The receiving end receives the inter-core communication message and sets its message source flag. The sending end detects whether the receiving end sets its message source flag, thereby realizing communication between multiple cores in a multi-chip system. This solves the problem of large power consumption and difficulty in improving performance of a single chip to a certain extent, and meets the demand of future products for large-scale information processing capabilities, thereby realizing inter-core communication between chips, triggering inter-core enabling and resource preemption from a three-dimensional perspective, saving power consumption and rationalizing and improving resource allocation effects.
[0036] In the disclosed embodiment, inter-core enabling and resource preemption are triggered from a three-dimensional perspective, which means that, for the sending end, the chip needs to record the core number of the current chip sending the message, the core number of the received message, and the chip number of the received message; for the receiving end, the chip needs to record the core number of the current chip receiving the message, the core number of the sent message, and the chip number of the sent message.
[0037] In the embodiment of the present disclosure, when the sending end and the receiving end are located in the same chip, the sending end sends an inter-core communication message to the receiving end, which can be considered as the sending end transmitting the inter-core communication message to the receiving end.
[0038] In some exemplary embodiments, after the receiving end receives the inter-core communication message, setting the message source flag bit may be setting the status flag bit of the data element of the corresponding register from 0 to 1, or may be setting the status flag bit of the data element of the corresponding register from 1 to 0, and the embodiments of the present disclosure are not limited to this. In the embodiments of the present disclosure, the data element in the register refers to a storage location in the register. For example, assuming that the register is a 16-bit register, the number of bits of the data element may be x bits, where x is an integer greater than or equal to 1 and less than or equal to 16.
[0039] In some exemplary embodiments, after step 102, the method further includes:
[0040] Step 103: The sending end detects whether the receiving end sets the message source flag;
[0041] Step 104: When the sending end detects that the receiving end has set the message source flag, the sending end notifies the receiving end to clear the message source flag.
[0042] In the disclosed embodiment, after sending the inter-core communication message, the sending end will keep checking whether the message source flag of the receiving end is set. If it is successfully set, the receiving end is notified to clear the message source flag, thereby indicating the completion of one communication.
[0043] In some exemplary embodiments, when the sending end does not detect that the receiving end sets the message source flag, the sending end returns to continue detection until the preset maximum number of detections is reached. If the sending end still does not detect that the receiving end sets the message source flag after the preset maximum number of detections, the sending end performs an error reporting process.
[0044] In some exemplary embodiments, when the sending end needs to send an inter-core communication message to multiple receiving ends, before step 101, the inter-core communication method further includes:
[0045] The sending end arranges the priority of the messages received by the receiving end according to the current processing capability of the receiving end.
[0046] In some exemplary embodiments, the sending end sends an inter-core communication message to the receiving end, including:
[0047] The sending end sends inter-core communication messages to the receiving end according to the priority order of the messages received by the receiving end.
[0048] The inter-core communication method of the embodiment of the present disclosure can speed up the communication response and shorten the interaction time by polling the processing capacity of the receiving end to determine the priority arrangement order of the messages received by the receiving end. Exemplarily, the processing capacity can include whether the receiving end is idle at the current moment, whether the number of unprocessed messages currently processed by the receiving end is less than a preset message number threshold, etc. In the embodiment of the present disclosure, the sending end can define the priority arrangement method of receiving messages by different receiving ends through software, and the embodiment of the present disclosure does not limit this.
[0049] In some exemplary embodiments, the multi-chip system includes N chips cascaded in sequence, the N chips cascaded in sequence are the zeroth chip to the (N-1)th chip, wherein the i-th chip is the upstream chip directly connected to the (i-1)th chip, the (i-1)th chip is the downstream chip directly connected to the i-th chip, the zeroth chip is the upstream chip directly connected to the (N-1)th chip, the (N-1)th chip is the downstream chip directly connected to the zeroth chip, the downstream chip sends inter-core communication messages and clear flag messages to the directly connected upstream chip or sends inter-core communication messages and clear flag messages to the non-directly connected upstream chip through the intermediate chip, the upstream chip replies with a response message to the directly connected downstream chip or replies with a response message to the non-directly connected downstream chip through the intermediate chip, wherein (N-1)≥i≥1.
[0050] For example, Figure 2A As shown ( Figure 2A Taking four chips cascaded as an example, however, the embodiment of the present disclosure does not limit the number of chips in the multi-chip system), the four chips are the zeroth chip Chip_0, the first chip Chip_1, the second chip Chip_2 and the third chip Chip_3, wherein the first chip Chip_1 is the upstream chip directly connected to the zeroth chip Chip_0, the second chip Chip_2 is the upstream chip directly connected to the first chip Chip_1, the third chip Chip_3 is the upstream chip directly connected to the second chip Chip_2, and the zeroth chip Chip_0 is the upstream chip directly connected to the third chip Chip_3; conversely, the zeroth chip Chip_0 is the downstream chip directly connected to the first chip Chip_1, the first chip Chip_1 is the downstream chip directly connected to the second chip Chip_2, the second chip Chip_2 is the downstream chip directly connected to the third chip Chip_3, and the third chip Chip_3 is the downstream chip directly connected to the zeroth chip Chip_0.
[0051] In the disclosed embodiment, the communication behavior between chips can be divided into two types: sending messages (or sending commands, which can be inter-core communication messages or clearing flag messages) and replying responses (or returning data, which can be the first response message or the second response message mentioned later). For example, the zeroth chip Chip_0 can send a first message to the first chip Chip_1 (the first message can be an inter-core communication message or a clearing flag message), the first chip Chip_1 can send a second message to the second chip Chip_2 (the second message can be an inter-core communication message or a clearing flag message), the second chip Chip_2 can send a third message to the third chip Chip_3 (the third message can be an inter-core communication message or a clearing flag message), and the third chip Chip_3 can send a fourth message to the zeroth chip Chip_0 (the third message can be an inter-core communication message or a clearing flag message); conversely ...). The first chip Chip_1 can reply a first response to the zeroth chip Chip_0 (the first response can be the first response message or the second response message in the following text), the second chip Chip_2 can reply a second response to the first chip Chip_1 (the second response can be the first response message or the second response message in the following text), the third chip Chip_3 can reply a third response to the second chip Chip_2 (the third response can be the first response message or the second response message in the following text), the zeroth chip Chip_0 can reply a fourth response to the third chip Chip_3 (the fourth response can be the first response message or the second response message in the following text). The first message, the second message, the third message and the fourth message can be the same or different. For example, in Figure 2A In the example, when the zeroth chip Chip_0 needs to send an inter-core communication message to the second chip Chip_2, the zeroth chip Chip_0 first sends the inter-core communication message to be sent to the first chip Chip_1 (that is, the zeroth chip Chip_0 sends the first message to the first chip Chip_1), and the first chip Chip_1 then sends the received message of the zeroth chip Chip_0 to the second chip Chip_2 (that is, the first chip Chip_1 sends the second message to the second chip Chip_2). At this time, the first message and the second message may be the same. In another example, when the zeroth chip Chip_0 needs to send an inter-core communication message (that is, the first message) to the first chip Chip_1 and the first chip Chip_1 needs to send an inter-core communication message (that is, the second message) to the second chip Chip_2, the first message and the second message may be different. Similarly, the first response, the second response, the third response, and the fourth response may be the same or different.
[0052] The multi-chip system of the embodiment of the present disclosure may adopt a cascade chip architecture, in which there is no real master chip (master chip) and other controlled chips (slave chips), and there is only an upstream and downstream transmission relationship. Moreover, in the cascade chip architecture, each chip may include at least one core. For example, in Figure 2A In the cascade system shown, when Chip_0 and Chip_2 are both multi-core chips, when a core in Chip_0 wants to send an inter-core communication message or a clear mark message to a core in Chip_2, the data flow direction of the inter-chip inter-core communication is that Chip_0 sends a first message to Chip_1, and Chip_1 continues to send a second message to Chip_2 (the second message is the same as the first message). After Chip_2 receives the second message, Chip_2 replies a second response to Chip_1, and Chip_1 continues to reply the first response to Chip_0 (the second response is the same as the first response). In one embodiment, due to the sequential nature of the commands at the sending end, the feedback response at the receiving end is returned along the original path, and it is not possible for Chip_0 to send an inter-core communication message or a clear mark message to Chip_2 via Chip_1, and Chip_2 replies a response message to Chip_0 via Chip_3 (the response message can be the first response message or the second response message in the following text).
[0053] In some exemplary embodiments, in the multi-chip system, any two directly connected upstream chips and downstream chips are connected via at least one of the following interfaces:
[0054] Universal Asynchronous Receiver Transmitter (UART) interface;
[0055] Serial Peripheral Interface (SPI);
[0056] Inter-Integrated Circuit (IIC) interface;
[0057] Chip-to-Chip (C2C) data exchange interface.
[0058] In the disclosed embodiments, the communication methods between upstream and downstream chips are all derived from the physical channels of chip interconnection. The physical channels include but are not limited to standard communication protocols such as UART, SPI, IIC or C2C methods between chips, etc. Among them, the cascade method using standard communication protocols such as UART and SPI needs to define the underlying functions and call related interfaces at the software implementation level, which increases software overhead; while using the C2C method, information can be directly transmitted between chips, reducing some software overhead.
[0059] In some exemplary embodiments, the multi-chip system has at least two directly connected upstream chips and downstream chips connected via a first interface, and at least two directly connected upstream chips and downstream chips connected via a second interface. The upstream and downstream chips connected by the first interface are different from the upstream and downstream chips connected by the second interface, and the first interface and the second interface use different protocols.
[0060] In the multi-chip system of the embodiment of the present disclosure, in the chip cascade architecture, not only one cascade mode can be used, but multiple cascade modes can be used in combination. For example, when there is a large amount of communication between individual chips and a small amount of communication between other chips, for example, Figure 2A As shown, assuming that there are more information exchanges between Chip_0 and Chip_1, and less information exchanges between Chip_2 / Chip_3 and Chip_0 / Chip_1, it is possible to select a C2C interface connection between Chip_0 and Chip_1, and a UART or SPI interface connection between Chip_1 and Chip_2, Chip_2 and Chip_3, and Chip_3 and Chip_0 (UART or SPI interface is slower but cheaper than C2C interface). In addition, by selecting UART / SPI cascade between some upstream chips and downstream chips, the order of message transmission can be made more flexible. For example, since Chip_3 and Chip_0 are connected by UART or SPI interface, which is a bidirectional communication interface, Chip_0 and Chip_3 can be upstream devices and downstream devices to each other, and Chip_0 can directly send inter-core communication messages or clear flag messages to Chip_3, and no longer need to be forwarded through Chip_1 and Chip_2.
[0061] The multi-chip system of the disclosed embodiment can reduce chip cost and increase the flexibility of message transmission order by using a variety of cascading methods in a mixed manner (for example, C2C interface and UART or SPI interface) when the amount of information communicated between chips is small and the information transmission speed requirement is not high. In actual use, which cascading method is used between chips needs to be selected according to the specific application requirement scenario.
[0062] In some exemplary embodiments, the multi-chip system has at least two directly connected chips that are connected through the third interface and the fourth interface at the same time, and the upstream chip directly connected to the third interface is the downstream chip directly connected to the fourth interface, and the downstream chip directly connected to the third interface is the upstream chip directly connected to the fourth interface, and the third interface and the fourth interface use the same protocol. Exemplarily, the third interface and the fourth interface can both be C2C interfaces.
[0063] like Figure 2A As shown in the figure, when multiple cascaded chips are interconnected, when a downstream chip wants to access an upstream chip that is not directly connected and is far away, the message transmission needs to pass through all the cascaded chips in the middle, resulting in a large message delay. For example, suppose a core of Chip_0 needs to send an inter-core communication message or a clear flag message to a core of Chip_3. Figure 2A In the case shown, Chip_3 can only be the upstream chip of Chip_2. Due to the sequential nature of the cascaded chips, the core of Chip_0 needs to pass through Chip_1 and Chip_2 to send inter-core communication messages or clear flag messages to the core of Chip_3. At this time, the bus delay is large, and the time required to send inter-core communication messages or clear flag messages and the time required to reply to response messages are both long.
[0064] like Figure 2B As shown, the adjustability of the upstream and downstream relationship can be increased by increasing the upstream and downstream interconnection interfaces of a single chip. For example, Chip_3 adds a set of interconnection master (Master) interfaces, and Chip_0 adds a set of interconnection slave (Slave) interfaces, then Chip_3 can be used as the upstream chip of Chip_0 and Chip_2 at the same time, and Chip_0 can directly send inter-core communication messages or clear flag messages to Chip_3 without passing through Chip_1 and Chip_2. At this time, the bus delay is small, and the time required to send inter-core communication messages or clear flag messages and the time to reply to response messages are both short.
[0065] In actual use, the software layer can construct an appropriate algorithm based on the actual chip interconnection topology. However, increasing the interconnection interface also means an increase in hardware circuits, and accordingly, the chip area and cost will also increase. Therefore, in actual use, a trade-off can be made between improving the message transmission speed and reducing the hardware circuit area / overhead.
[0066] In some exemplary embodiments, Figure 3AAs shown, each chip includes a communication service module, which is used for communication between cores within the chip and between cores between chips. The communication service module can be based on a service-oriented architecture and implemented as a specific communication service process, which can be implemented by a computer program and loaded on a kernel for execution. The underlying implementation of the communication service module can be based on shared memory and inter-core interrupts. Among them, the specific implementation methods of shared memory and inter-core interrupts are known to those skilled in the art and are not limited in this disclosure.
[0067] In the embodiments of the present disclosure, the service is a function provided by the core in the chip, which is presented with a good interface. The sending end realizes inter-core communication by calling the interface provided by the service in the receiving end. The present disclosure uses a service-oriented architecture in inter-chip communication, so that the inter-chip communication has many advantages of a service-oriented architecture, such as coarse granularity, loose coupling, interoperability and service governance.
[0068] In some exemplary embodiments, the communication service module of the chip to which the sending end belongs records the message sending behavior according to the core number of the sending end, the core number of the receiving end, and the chip number of the receiving end, and the communication service module of the chip to which the receiving end belongs records the message receiving behavior according to the core number of the receiving end, the core number of the sending end, and the chip number of the sending end.
[0069] In the embodiments of the present disclosure, the communication service module in each chip can simultaneously process messages sent by the sender and messages received by the receiver. In some exemplary embodiments, the communication service module may include a sending submodule and a receiving submodule, wherein the sending submodule is used to process messages sent by the sender, and the receiving submodule is used to process messages received by the receiver. In other exemplary embodiments, the communication service module can process messages sent by the sender and messages received by the receiver by time-sharing, which is not limited by the embodiments of the present disclosure.
[0070] Figure 3B A schematic diagram of a transmission structure of inter-chip and inter-core communication provided by an exemplary embodiment of the present disclosure. Figure 3B As shown in the figure, taking the example of Core2 of Chip_0 sending an inter-core communication message to Core5 of Chip_2, Core5 of Chip_2 receives the inter-core communication message from Core2 of Chip_0 and sets its message source flag. After Core2 of Chip_0 detects that Core5 of Chip_2 sets the message source flag, it notifies Core5 of Chip_2 to clear its message source flag, and the communication ends. Figure 3BThe solid cube in represents the communication service module of each chip. For the sending end, Core_X is the core number of the current chip sending the message, Core_Y is the core number of the receiving message, and Chip_N is the chip number of the receiving message. For the receiving end, Core_X is the core number of the current chip receiving the message, Core_Y is the core number of the sending message, and Chip_N is the chip number of the sending message. Therefore, the message transmission structure is expressed in coordinates as (2, 5, 2) -> (5, 2, 0) (that is, the coordinates of the dashed cube at the sending end in Figure 3 are (2, 5, 2), and the coordinates of the dashed cube at the receiving end are (5, 2, 0)), where the coordinate axis order corresponding to each coordinate is (Core_X, Core_Y, Chip_N), and the Core_X and Core_Y coordinates at both ends of the sending and receiving are symmetrical structures.
[0071] In some exemplary embodiments, the communication service module of the i-th chip includes a i first register of the first data element and having at least N i A second register for a second data element, where N i is the number of cores included in the i-th chip, each core corresponds to the first data element of the first register and the second data element of the second register, (N-1)≥i≥1, the first data element is used to indicate the inter-core communication message sent by the sender to the receiver, and the second data element is used to indicate the source flag of the inter-core communication message. In the embodiment of the present disclosure, the bit widths of the first data element, the second data element, and the third data element can be set as needed.
[0072] In the embodiment of the present disclosure, the first data element refers to a storage location in the first register. By way of example, assuming that the first register is a y1-bit register, the number of bits of the first data element may be x1 bits, where x1 is an integer greater than or equal to 1 and less than or equal to y1, and y1 is an integer greater than or equal to 1.
[0073] The second data element refers to a storage location in the second register. For example, assuming that the second register is a y2-bit register, the number of bits of the second data element may be x2 bits, where x2 is an integer greater than or equal to 1 and less than or equal to y2, and y2 is an integer greater than or equal to 1.
[0074] The third data element refers to a storage location in the third register. For example, assuming that the third register is a y3-bit register, the number of bits of the third data element may be x3 bits, where x3 is an integer greater than or equal to 1 and less than or equal to y3, and y3 is an integer greater than or equal to 1.
[0075] In some exemplary embodiments, the sending end sends an inter-core communication message to the receiving end, including:
[0076] The sending end sends the inter-core communication message to the communication service module of the chip to which the sending end belongs;
[0077] The communication service module of the chip to which the sending end belongs stores the inter-core communication message in the first data element of the first register corresponding to the sending end.
[0078] In some exemplary embodiments, when the communication service module of the chip to which the transmitting end belongs receives inter-core communication messages sent by multiple transmitting ends and the receiving ends corresponding to the multiple inter-core communication messages are different (because the communication service module of the chip to which the transmitting end belongs and the transmitting end are located in the same chip, the communication service module of the chip to which the transmitting end belongs receives the inter-core communication messages sent by multiple transmitting ends, which can be considered as the communication service module of the chip to which the transmitting end belongs receiving the inter-core communication messages transmitted by multiple transmitting ends), the inter-core communication method further includes:
[0079] The communication service module of the chip to which the transmitting end belongs arranges the priority of the messages received by the receiving end according to the processing capabilities of the multiple receiving ends;
[0080] The communication service module of the chip to which the sending end belongs sends the inter-core communication message to the receiving end according to the priority order of the messages received by the receiving end.
[0081] In the disclosed embodiment, each core periodically reports its own resource usage to the communication service module of the chip to which it belongs, and the communication service module of each chip periodically reports the resource usage of each core in its own chip to the communication service modules of other chips. Therefore, when the communication service module of each chip receives inter-core communication messages sent by multiple senders and the multiple inter-core communication messages correspond to different receiving ends, the priority order of the messages received by the receiving end can be determined according to the processing capabilities of each receiving end, thereby speeding up the communication response and shortening the interaction time.
[0082] Optionally, each core includes a status service, and each core periodically reports its own resource usage to the communication service module through the status service.
[0083] In some exemplary embodiments, the receiving end receives the inter-core communication message and sets the message source flag, including:
[0084] The receiving end receives the inter-core communication message and replies a first response message to the communication service module of the chip to which the receiving end belongs;
[0085] The communication service module of the chip to which the receiving end belongs sets its message source flag in the second data element of the second register corresponding to the receiving end.
[0086] In some exemplary embodiments, the communication service module of the i-th chip includes at least N i A third register for a third data element, where N i is the number of cores contained in the i-th chip, each core also corresponds to the third data element of the third register, (N-1)≥i≥1, the third data element is used to indicate the clear flag message sent by the sending end to the receiving end, and the clear flag message is used to notify the receiving end to clear the message source flag.
[0087] In some exemplary embodiments, the sending end notifies the receiving end to clear the message source flag, including:
[0088] The sending end sends a clear flag message to the communication service module of the chip to which the sending end belongs, wherein the clear flag message is used to notify the receiving end to clear the message source flag;
[0089] The communication service module of the chip to which the transmitting end belongs stores the clearing flag message in the third data element of the third register corresponding to the transmitting end;
[0090] The receiving end receives the clear flag message and replies a second response message to the communication service module of the chip to which the receiving end belongs;
[0091] The communication service module of the chip to which the receiving end belongs clears the message source flag in the second data element of the second register corresponding to the receiving end.
[0092] For example, Figure 4A and Figure 4B The following is a schematic diagram of the communication process between two chips provided by an exemplary embodiment of the present disclosure. Still taking the example of Core 2 of Chip_0 sending an inter-core communication message to Core_5 of Chip_2, as shown in FIG. Figure 4A As shown, the corresponding hardware level is to configure the first data element of the first register corresponding to Core2 in the communication service module of Chip_0, send the inter-core communication message to Chip_2 through the cascade interface via Chip_1, and complete the reception of the inter-core communication message in Chip_2. The corresponding hardware level is to set the second data element of the second register corresponding to Core_5 in the communication service module of Chip_2, and feed back the setting information to Chip_0 through the cascade interface via Chip_1.
[0093] After Chip_0 receives the second register setting information, it will continue to issue the operation of clearing the flag bit, such as Figure 4BAs shown, similar to the behavior of sending inter-core communication messages, the corresponding hardware level is to configure the third data element of the third register corresponding to Core2 in the communication service module of Chip_0, and send the clear flag message to Chip_2 through the cascade interface via Chip_1, and the reception of the clear flag message is completed in Chip_2. The corresponding hardware level is to clear the second data element of the second register corresponding to Core_5 in the communication service module of Chip_2, and feed the clear information back to Chip_0 through the cascade interface via Chip_1.
[0094] In some exemplary embodiments, the inter-core communication message sent by the sending end to the receiving end includes at least: a chip number field, a first message field, and a second message field, wherein the chip number field is used to indicate the number of the chip receiving the inter-core communication message, the first message field and the second message field represent different message types, and the first message field includes k*N max bits, the second message field includes m*N max bits, k and m are both natural numbers greater than or equal to 1, N max The number of cores included in the chip with the largest number of cores among the N chips. The disclosed embodiment meets the inter-core communication requirements within a chip and between chips by setting the format of the inter-core communication message, and crosses from two-dimensional communication within a chip to three-dimensional communication between chips, which can save power consumption and rationalize and improve resource allocation effects.
[0095] Figure 5A A schematic diagram of a format of an inter-core communication message according to an exemplary embodiment of the present disclosure is shown in FIG. Figure 5A As shown, in some exemplary embodiments, the inter-core communication message may include the following fields: the chip number Chip_Number receiving the message, the reserved field Reserved, the first message message_0 and the second message message_1, wherein the first message message_0 and the second message message_1 may represent different types of communication information. Figure 5A The message format of the 32-bit inter-core communication message shown in the figure represents the chip number through the high 2 bits. The first data element can be understood as a 32-bit space for storing the inter-core communication message. For example, when the 30-31 bits are 00, it represents chip 0; when the 30-31 bits are 01, it represents chip 1; when the 30-31 bits are 10, it represents chip 2; when the 30-31 bits are 11, it represents chip 3. The message can be stored in the first register, that is, the aforementioned y1 is greater than or equal to 32, and x1 is equal to 32. This is only an example. The embodiment of the present application does not limit the length of the message in the message format and the data indicating the chip bit width.
[0096] In some exemplary embodiments, the length of the inter-core communication message is 32 bits (32 bits), wherein the chip number Chip_Number of the receiving message occupies 2 bits, the reserved field Reserved occupies 6 bits, the first message message_0 occupies 8 bits, and the second message message_1 occupies 16 bits. However, the embodiment of the present disclosure does not limit the length of the inter-core communication message and the length of each field. For example, if the number of chip cascades is large, the bit width of the chip number Chip_Number can be appropriately widened. Since there are many types of inter-core communication messages, including but not limited to inter-core interrupt triggering, chip resource preemption, and inter-core enabling, the number of defined inter-core communication message types and the bit width corresponding to each type of inter-core communication message can be appropriately widened or reduced as needed. For example, three message type fields message_0, message_1, and message_2 can be set, and the bit widths occupied by message_0, message_1, and message_2 can be set as needed.
[0097] In the embodiment of the present disclosure, the clear flag message sent by the sending end to the receiving end and the first response message and the second response message sent by the receiving end to the sending end can adopt a message format similar to the above-mentioned inter-core communication message. However, since the clear flag message, the first response message and the second response message do not include a variety of different message types, Figure 5B As shown, the three messages, namely the clear flag message, the first response message and the second response message, only need to include a chip number field Chip_Number and a message field message (the reserved field Reserved can be set as needed), and the bit width occupied by the message field message can be set according to the number of cores on the chip.
[0098] In some exemplary embodiments, when a communication service module is ready to send multiple inter-core communication messages to the same receiving core in the same chip, the communication service module may integrate the multiple inter-core communication messages into one inter-core communication message.
[0099] In the disclosed embodiment, under the given chip cascading conditions, considering the efficiency of communication, when a large amount of data is sent during the inter-chip communication process, if the cores of different chips need to send inter-core communication messages to the core of another chip, for example, the core of Chip_0 and the core of Chip_1 both need to send inter-core communication messages to the core of Chip_2, and the efficiency is low when packets are sent in sequence for separate processing. Specifically, the core of Chip_0 needs to send two information packets to send an inter-core communication message to the core of Chip_2 (one from Chip_0 to Chip_1, and another from Chip_1 to Chip_2), and the core of Chip_1 needs to send one information packet to send an inter-core communication message to the core of Chip_2, and a total of 3 information packets are sent. At the software level, information packets with the same core address to the destination chip (i.e., inter-core communication messages with the same destination address) can be integrated on the cascade chip path passed through and sent to the receiving core of the destination chip. After the information packets are integrated, the core of Chip_0 still needs to send two information packets to send an inter-core communication message to the core of Chip_2 (one from Chip_0 to Chip_1, and another from Chip_1 to Chip_2), but the inter-core communication message sent by the core of Chip_1 to the core of Chip_2 can be integrated into one with the previous information packet sent from Chip_1 to Chip_2, so a total of 2 information packets need to be sent. Although in this example, the number of information packets sent before and after the information packet integration is only one, the number of information packets saved cannot be ignored when a large amount of information is transmitted. Therefore, the embodiment of the present disclosure can reduce the number of information packets and improve the resource utilization of the system by integrating information packets.
[0100] Similarly, when a communication service module is ready to send multiple clear flag messages to the same receiving core in the same chip, the communication service module can integrate the multiple clear flag messages into one clear flag message. When a communication service module is ready to send multiple first response messages to the same receiving core in the same chip, the communication service module can integrate the multiple first response messages into one first response message. When a communication service module is ready to send multiple second response messages to the same receiving core in the same chip, the communication service module can integrate the multiple second response messages into one second response message.
[0101] The following uses several actual application scenarios to illustrate the register configuration process during inter-chip and inter-core communication.
[0102] In the embodiment of the present disclosure, each core in each chip has its own corresponding register. Assuming that each chip has 8 cores (in other examples, the number of cores on different chips may also be different, and the embodiment of the present disclosure does not limit this), the communication service module of each chip will include a first register with at least 8 first data elements, a second register with at least 8 second data elements, and a third register with at least 8 third data elements. Each first data element and third data element respectively corresponds to the core number of the corresponding sending end. Similarly, each second data element serves as a status flag to indicate the status information of other cores acting on the core. The receiving end uses the second data element of the second register to represent the current state. Since the first data element is used to indicate the inter-core communication message sent by the sending end to the receiving end, the data structure of the first data element is as follows. Figure 5A As shown (the length of each field can be adjusted as needed); the second data element is used to indicate the message source flag, and the third data element is used to indicate the clear flag message sent by the sending end to the receiving end. Therefore, the data structure of the second data element and the third data element is as follows Figure 5B As shown (the length of each field can be adjusted as needed).
[0103] Assumptions Figure 5A In the example, message_0 is the inter-core interrupt trigger information, message_1 is the inter-core enable information (it can be the inter-chip inter-core enable information or the inter-chip core enable information), and each chip has 8 cores. The 7th to 0th bits of message_0 (message_0 bit width 1 bit) and the 7th to 0th bits of message_1 (message_1 bit width 2 bits) represent Core_7 to Core_0 respectively, and Core_7 to Core_0 correspond to the core numbers of the corresponding chip number configured Chip_Number.
[0104] Application scenario 1: one-to-one sending
[0105] Assume that Core 2 of Chip_0 sends an inter-core interrupt trigger message to Core_5 of Chip_2. Then, in Chip_0, the Chip_Number of the second first data element of the first register is set to 10, corresponding to Figure 3B The Chip_N coordinate of the sending end on the left side, and the second first data element itself represents Core_2, corresponding to the Core_X coordinate, and the fifth bit of message_0 of the second first data element is configured to 1, corresponding to the Core_Y coordinate.
[0106] After receiving the message at the receiving end, the Chip_Number of the fifth second data element of the second register in Chip_2 is set to 00, corresponding to Figure 3B The Chip_N coordinate of the receiving end on the right side of the middle, and the fifth second data element itself represents Core_5, corresponding to the Core_X coordinate, and the second position of the message_0 of the fifth second data element is set to 1, corresponding to the Core_Y coordinate.
[0107] Application scenario 2: one-to-many sending
[0108] Assume that the current Core_2 of Chip_0 sends an inter-core enable message to Core_5 of Chip_1 and sends an inter-core interrupt trigger message to Core_5 of Chip_2. Then the first register needs to be configured twice. For the configuration process of sending the inter-core interrupt trigger message to Core_5 of Chip_2, please refer to Application Scenario 1, which will not be repeated here. For sending the inter-core enable message to Core_5 of Chip_1, it is similar to Application Scenario 1, except that the Chip_Number of the second first data element of the first register is configured to 01, corresponding to Figure 3B In the Chip_N coordinate of the sending end on the left, the fifth bit of the message_1 of the second first data element is configured to 1, and the second first data element itself represents Core_2, corresponding to the Core_X coordinate, and the fifth bit of the message_1 of the second first data element is configured to 1, corresponding to the Core_Y coordinate.
[0109] Application scenario 3: Many-to-one sending
[0110] Assume that currently Core_2 of Chip_0 and Core_2 of Chip_1 both send inter-core interrupt trigger information to Core_5 of Chip_2. The register configuration method is similar to that of application scenario 2, and the first register is also configured twice. However, the inter-core communication method of the disclosed embodiment can consider a route simplification solution at the software implementation level, that is, the transmitted information packets can be merged, and when the destination is the same, the previous transparent transmission can be upgraded to integrated transmission, which can appropriately reduce the number of information packets.
[0111] In some exemplary embodiments, wireless communication between chips may be used to replace the physical channel interconnection of actual chip pins, thereby reducing the impact of physical factors such as glitches and high resistance that may exist in the physical connection between cascaded chips.
[0112] An embodiment of the present disclosure also provides a multi-chip system, comprising a memory; and a processor connected to the memory, wherein the memory is used to store instructions, and the processor is configured to execute the steps of the inter-core communication method as described in any embodiment of the present disclosure based on the instructions stored in the memory.
[0113] like Figure 6 As shown, in one example, the multi-chip system may include: a first processor 610, a first memory 620 and a first bus system 630, wherein the first processor 610 and the first memory 620 are connected via the first bus system 630, the first memory 620 is used to store instructions, and the first processor 610 is used to execute the instructions stored in the first memory 620, so that a sending end sends an inter-core communication message to a receiving end, the sending end is a core in the multi-chip system, the receiving end is another core in the multi-chip system, the sending end and the receiving end are located in the same chip or in different chips; the receiving end receives the inter-core communication message and sets a message source flag.
[0114] It should be understood that the first processor 610 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0115] The first memory 620 may include a read-only memory and a random access memory, and provides instructions and data to the first processor 610. A portion of the first memory 620 may also include a nonvolatile random access memory. For example, the first memory 620 may also store information on the device type.
[0116] The first bus system 630 may include a power bus, a control bus, a status signal bus, etc. in addition to the data bus. Figure 6 In the figure, various buses are labeled as a first bus system 630 .
[0117] In the implementation process, the processing performed by the processing device can be completed by the hardware integrated logic circuit in the first processor 610 or the instructions in the form of software. That is, the method steps of the embodiment of the present disclosure can be embodied as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the first memory 620, and the first processor 610 reads the information in the first memory 620 and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
[0118] The embodiment of the present disclosure also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the method of inter-core communication as described in any embodiment of the present disclosure is implemented. The method of driving inter-core communication by executing executable instructions is basically the same as the method of inter-core communication provided in the above embodiment of the present disclosure, and will not be repeated here.
[0119] The present disclosure also provides an inter-core communication method, including:
[0120] The sender sends inter-core communication messages to the receiver;
[0121] The sending end detects whether the receiving end sets a message source flag.
[0122] In some exemplary embodiments, the method further comprises:
[0123] When the sending end detects that the receiving end has set the message source flag, the sending end notifies the receiving end to clear the message source flag.
[0124] In some exemplary embodiments, when the transmitting end sends an inter-core communication message to a plurality of the receiving ends, the method further comprises: the transmitting end arranges the priority of receiving messages by the receiving end according to the processing capability of each of the receiving ends;
[0125] The sending end sends the inter-core communication message to the receiving end, including: the sending end sends the inter-core communication message to the receiving end according to the priority arrangement order of the messages received by the receiving end.
[0126] In some exemplary embodiments, each chip includes a communication service module, the communication service module is used for communication between cores within the chip and communication between cores between the chips;
[0127] The communication service module of the chip to which the sending end belongs records the message sending behavior according to the core number of the sending end, the core number of the receiving end and the chip number of the receiving end.
[0128] In some exemplary embodiments, the multi-chip system includes N chips, wherein the communication service module of the i-th chip includes a first register, a second register, and a third register, with at least N i a first register of the first data element having at least N i a second register of the second data element and having at least N i A third register for a third data element, where N i is the number of cores included in the i-th chip, each core corresponds to the first data element of the first register, the second data element of the second register and the third data element of the third register, (N-1)≥i≥1. The first data element is used to indicate the inter-core communication message sent by the sending end to the receiving end, the second data element is used to indicate the source flag of the message, and the third data element is used to indicate the clear flag message sent by the sending end to the receiving end, and the clear flag message is used to notify the receiving end to clear the source flag of the message.
[0129] In some exemplary embodiments, the sending end sends an inter-core communication message to the receiving end, including:
[0130] The sending end sends the inter-core communication message to the communication service module of the chip to which the sending end belongs;
[0131] The communication service module of the chip to which the sending end belongs stores the inter-core communication message in the first data element of the first register corresponding to the sending end.
[0132] In some exemplary embodiments, the sending end notifies the receiving end to clear the message source flag, including:
[0133] The sending end sends a clear flag message to the communication service module of the chip to which the sending end belongs, wherein the clear flag message is used to notify the receiving end to clear the message source flag;
[0134] The communication service module of the chip to which the transmitting end belongs stores the clearing flag message in the third data element of the third register corresponding to the transmitting end.
[0135] An embodiment of the present disclosure also provides a chip, comprising a memory; and a processor connected to the memory, wherein the memory is used to store instructions, and the processor is configured to execute the steps of the inter-core communication method as described in any embodiment of the present disclosure based on the instructions stored in the memory.
[0136] like Figure 7As shown, in one example, the chip may include: a second processor 710, a second memory 720 and a second bus system 730, wherein the second processor 710 and the second memory 720 are connected via the second bus system 730, the second memory 720 is used to store instructions, and the second processor 710 is used to execute the instructions stored in the second memory 720 so that the sending end sends an inter-core communication message to the receiving end; the sending end detects whether the receiving end sets a message source flag.
[0137] It should be understood that the second processor 710 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0138] The second memory 720 may include a read-only memory and a random access memory, and provide instructions and data to the second processor 710. A portion of the second memory 720 may also include a nonvolatile random access memory. For example, the second memory 720 may also store information on the device type.
[0139] In addition to the data bus, the second bus system 730 may also include a power bus, a control bus, and a status signal bus. Figure 7 In the figure, various buses are labeled as a second bus system 730.
[0140] In the implementation process, the processing performed by the processing device can be completed by the hardware integrated logic circuit in the second processor 710 or the instructions in the form of software. That is, the method steps of the embodiment of the present disclosure can be embodied as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the second memory 720, and the second processor 710 reads the information in the second memory 720 and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
[0141] An embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the inter-core communication method as described in any embodiment of the present disclosure is implemented.
[0142] The present disclosure also provides an inter-core communication method, including:
[0143] The receiving end receives the inter-core communication message;
[0144] The receiving end replies with a first response message to the communication service module of the chip to which the receiving end belongs, so that the communication service module of the chip to which the receiving end belongs sets a message source flag in a second data element of a second register corresponding to the receiving end.
[0145] In some exemplary embodiments, the method further comprises:
[0146] The receiving end receives a clear flag message;
[0147] The receiving end replies with a second response message to the communication service module of the chip to which the receiving end belongs, so that the communication service module of the chip to which the receiving end belongs clears the message source flag in the second data element of the second register corresponding to the receiving end.
[0148] An embodiment of the present disclosure also provides a chip, comprising a memory; and a processor connected to the memory, wherein the memory is used to store instructions, and the processor is configured to execute the steps of the inter-core communication method as described in any embodiment of the present disclosure based on the instructions stored in the memory.
[0149] like Figure 8 As shown, in one example, the chip may include: a third processor 810, a third memory 820 and a third bus system 830, wherein the third processor 810 and the third memory 820 are connected via the third bus system 830, the third memory 820 is used to store instructions, and the third processor 810 is used to execute the instructions stored in the third memory 820, so that the receiving end receives inter-core communication messages; the receiving end replies with a first response message to the communication service module of the chip to which the receiving end belongs, so that the communication service module of the chip to which the receiving end belongs sets a message source flag in the second data element of the second register corresponding to the receiving end.
[0150] It should be understood that the third processor 810 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0151] The third memory 820 may include a read-only memory and a random access memory, and provide instructions and data to the third processor 810. A portion of the third memory 820 may also include a nonvolatile random access memory. For example, the third memory 820 may also store information on the device type.
[0152] The third bus system 830 may include a power bus, a control bus, a status signal bus, etc. in addition to the data bus. Figure 8 Various buses are labeled as a third bus system 830 .
[0153] In the implementation process, the processing performed by the processing device can be completed by the hardware integrated logic circuit in the third processor 810 or the instruction in the form of software. That is, the method steps of the embodiment of the present disclosure can be embodied as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the third memory 820, and the third processor 810 reads the information in the third memory 820 and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
[0154] An embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the inter-core communication method as described in any embodiment of the present disclosure is implemented.
[0155] In some possible implementations, various aspects of the inter-core communication method provided in the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of the inter-core communication method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the inter-core communication method recorded in the embodiments of the present application.
[0156] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0157] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0158] Although the embodiments disclosed in the present disclosure are as above, the contents described are only embodiments adopted to facilitate understanding of the present disclosure and are not intended to limit the present invention. Any technician in the relevant field can make any modifications and changes in the form and details of implementation without departing from the spirit and scope disclosed in the present disclosure, but the patent protection scope of the present invention shall still be subject to the scope defined by the attached claims.
Claims
1. A method for inter-core communication, characterized in that: Applied to a multi-chip system, the multi-chip system includes a plurality of chips, each chip includes at least one core, and the inter-core communication method includes: A sending end sends an inter-core communication message to a receiving end, wherein the sending end is a core in the multi-chip system, the receiving end is another core in the multi-chip system, and the sending end and the receiving end are located in the same chip or in different chips; The receiving end receives the inter-core communication message and sets a message source flag.
2. The inter-core communication method according to claim 1, characterized in that: Each of the chips comprises a communication service module, wherein the communication service module is used for communication between cores within the chip and / or communication between cores between the chips; The communication service module of the chip to which the sending end belongs records the message sending behavior according to the core number of the sending end, the core number of the receiving end and the chip number of the receiving end, The communication service module of the chip to which the receiving end belongs records the message receiving behavior according to the core number of the receiving end, the core number of the sending end and the chip number of the sending end.
3. The inter-core communication method according to claim 2, characterized in that: The multi-chip system includes N chips; The communication service module of the i-th chip includes at least N i first register of the first data element and having at least N i A second register for a second data element, where N i is the number of cores contained in the i-th chip, each core corresponds to the first data element of the first register and the second data element of the second register, (N-1)≥i≥1, the first data element is used to indicate the inter-core communication message sent by the sending end to the receiving end, and the second data element is used to indicate the source flag of the inter-core communication message.
4. The inter-core communication method according to claim 3, characterized in that: The sending end sends an inter-core communication message to the receiving end, including: The sending end sends the inter-core communication message to the communication service module of the chip to which the sending end belongs; The communication service module of the chip to which the sending end belongs stores the inter-core communication message in the first data element of the first register corresponding to the sending end.
5. The inter-core communication method according to claim 4, characterized in that: In the case where the communication service module of the chip to which the sending end belongs receives inter-core communication messages sent by multiple sending ends and the receiving ends corresponding to the multiple inter-core communication messages are different, the method further includes: The communication service module of the chip to which the transmitting end belongs arranges the priorities of the messages received by the receiving ends according to the processing capabilities of the multiple receiving ends; The communication service module of the chip to which the sending end belongs sends the inter-core communication message to the receiving end according to the priority arrangement order of the messages received by the receiving end.
6. The inter-core communication method according to claim 1, characterized in that: After the receiving end receives the inter-core communication message and sets a message source flag, the method further includes: The sending end detects whether the receiving end sets the message source flag; When the sending end detects that the receiving end has set the message source flag, the sending end notifies the receiving end to clear the message source flag.
7. The inter-core communication method according to claim 6, characterized in that: The method further comprises: The communication service module of the i-th chip includes at least N i A third register for a third data element, where N i is the number of cores contained in the i-th chip, each core also corresponds to the third data element of the third register, (N-1)≥i≥1, and the third data element is used to indicate the clearing flag message sent by the sending end to the receiving end, and the clearing flag message is used to notify the receiving end to clear the message source flag.
8. The inter-core communication method according to claim 6, characterized in that: The receiving end receives the inter-core communication message and sets a message source flag, including: The receiving end receives the inter-core communication message and replies a first response message to the communication service module of the chip to which the receiving end belongs; The communication service module of the chip to which the receiving end belongs sets a message source flag in a second data element of a second register corresponding to the receiving end.
9. The inter-core communication method according to claim 6, characterized in that: The sending end notifying the receiving end to clear the message source flag bit includes: The sending end clearing flag message is sent to the communication service module of the chip to which the sending end belongs, wherein the clearing flag message is used to notify the receiving end to clear the message source flag; The communication service module of the chip to which the transmitting end belongs stores the clearing flag message in the third data element of the third register corresponding to the transmitting end; The receiving end receives the clearing mark message, and replies a second response message to the communication service module of the chip to which the receiving end belongs; The communication service module of the chip to which the receiving end belongs clears the message source flag in the second data element of the second register corresponding to the receiving end.
10. The inter-core communication method according to claim 3, characterized in that: The inter-core communication message sent by the sending end to the receiving end includes at least: A chip number field, a first message field, and a second message field, wherein the chip number field is used to indicate the number of the chip receiving the inter-core communication message, the first message field and the second message field represent different types of inter-core communication messages, and the first message field includes k*N max bits, the second message field includes m*N max bits, k and m are both natural numbers greater than or equal to 1, N max is the number of cores included in the chip with the largest number of cores among the N chips.
11. A multi-chip system, characterized in that: It comprises a memory; and a processor connected to the memory, the memory being used to store instructions, the processor being configured to execute the steps of the method for inter-core communication as described in any one of claims 1 to 10 based on the instructions stored in the memory.
12. The multi-chip system according to claim 11, characterized in that: The multi-chip system includes N chips cascaded in sequence, and the N chips cascaded in sequence include the zeroth chip to the (N-1)th chip, wherein the i-th chip is the upstream chip directly connected to the (i-1)th chip, the (i-1)th chip is the downstream chip directly connected to the i-th chip, the zeroth chip is the upstream chip directly connected to the (N-1)th chip, and the (N-1)th chip is the downstream chip directly connected to the zeroth chip, the downstream chip sends inter-core communication messages and clear flag messages to the directly connected upstream chip or sends inter-core communication messages and clear flag messages to the non-directly connected upstream chip through the intermediate chip, the upstream chip replies with a response message to the directly connected downstream chip or replies with a response message to the non-directly connected downstream chip through the intermediate chip, wherein (N-1)≥i≥1.
13. The multi-chip system according to claim 12, characterized in that: In the multi-chip system, any two directly connected upstream chips and downstream chips are connected via at least one of the following interfaces: a universal asynchronous receiver-transmitter interface, a serial peripheral interface, an integrated circuit bus interface, and a chip-to-chip data exchange interface.
14. The multi-chip system according to claim 12, characterized in that: In the multi-chip system, there are at least two directly connected upstream chips and downstream chips connected via a first interface, and there are at least two directly connected upstream chips and downstream chips connected via a second interface. The upstream and downstream chips connected by the first interface are different from the upstream and downstream chips connected by the second interface, and the first interface and the second interface use different protocols.
15. The multi-chip system according to claim 12, characterized in that: In the multi-chip system, at least two directly connected chips are connected via a third interface and a fourth interface at the same time, and the third interface and the fourth interface use the same protocol.
16. An inter-core communication method, characterized in that: include: The sender sends inter-core communication messages to the receiver; The sending end detects whether the receiving end sets a message source flag.
17. A chip, characterized in that: It comprises a memory; and a processor connected to the memory, the memory being used to store instructions, the processor being configured to execute the steps of the inter-core communication method as claimed in claim 16 based on the instructions stored in the memory.
18. An inter-core communication method, characterized in that: include: The receiving end receives the inter-core communication message; The receiving end replies with a first response message to the communication service module of the chip to which the receiving end belongs, so that the communication service module of the chip to which the receiving end belongs sets a message source flag in a second data element of a second register corresponding to the receiving end.
19. A chip, characterized in that: It comprises a memory; and a processor connected to the memory, the memory being used to store instructions, the processor being configured to execute the steps of the method for inter-core communication as claimed in claim 18 based on the instructions stored in the memory.
20. A storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, the method for inter-core communication as claimed in any one of claims 1 to 10, 16 or 18 is implemented.
