Multiprocessor system with distributed mailbox structure and communication method thereof

文档序号:1397968 发布日期:2020-03-03 浏览:31次 中文

阅读说明:本技术 具有分布式信箱结构的多处理器系统及其沟通方法 (Multiprocessor system with distributed mailbox structure and communication method thereof ) 是由 李安邦 于 2019-02-14 设计创作,主要内容包括:一种具有分布式信箱结构的多处理器系统及其沟通方法。所述多处理器系统包括多个处理器,每一处理器被配置有相应的一专有信箱与一专有信道,且所述沟通方法包括如下步骤。当这些处理器的第一处理器要与第二处理器进行沟通时,第一处理器是通过公共总线来写入数据到第二处理器的专有信箱中,以及当该数据写入完成时,第二处理器的专有信箱是发出中断信号给第二处理器,收到中断信号后的第二处理器则通过相应的专有信道来读取其专有信箱内的该数据,因此,在第二处理器读取该数据时,它就不会占用到公共总线。(A multiprocessor system with a distributed mailbox structure and a communication method thereof are provided. The multiprocessor system comprises a plurality of processors, each processor is configured with a corresponding proprietary mailbox and a proprietary channel, and the communication method comprises the following steps. When the first processor of the processors is to communicate with the second processor, the first processor writes data into the private mailbox of the second processor through the public bus, when the data writing is completed, the private mailbox of the second processor sends an interrupt signal to the second processor, and the second processor after receiving the interrupt signal reads the data in the private mailbox through the corresponding private channel, so that the second processor does not occupy the public bus when reading the data.)

1. A multiprocessor system having a distributed mailbox structure, the multiprocessor system comprising:

a plurality of processors, each of the processors configured with a corresponding proprietary mailbox and a proprietary channel;

when a first processor of the processors is to communicate with a second processor, the first processor writes data into the proprietary mailbox of the second processor through a public bus; and

when the data writing is completed, the special mailbox of the second processor sends an interrupt signal to the second processor, and the second processor after receiving the interrupt signal reads the data in the special mailbox through the corresponding special channel.

2. The multiprocessor system of claim 1, wherein when the first processor is to communicate with the second processor, the first processor determines whether the proprietary mailbox of the second processor has sufficient memory to store the data, and if so, the first processor writes the data into the proprietary mailbox of the second processor via the common bus.

3. The multiprocessor system of claim 2, wherein each of the proprietary mailboxes is further configured to output a status signal indicating whether it has sufficient memory to store the data, and each of the proprietary mailboxes receives the status signals output from the other proprietary mailboxes.

4. The multiprocessor system of claim 3, wherein when the first processor determines whether the proprietary mailbox of the second processor has sufficient memory space to store the data, the first processor reads the status signal output by the proprietary mailbox of the second processor and determines whether the proprietary mailbox of the second processor has sufficient memory space to store the data based on the status signal.

5. The multiprocessor system of claim 4, wherein each of the proprietary mailboxes further comprises:

a control register for setting an interrupt condition of the proprietary mailbox; and

a mailbox controller for managing the storage space and generating the interrupt signal and the status signal.

6. A communication method implemented in a multiprocessor system, the multiprocessor system comprising a plurality of processors, each of the processors being configured with a respective dedicated mailbox and a respective dedicated channel, the communication method comprising:

when a first processor of the processors is to communicate with a second processor, the first processor writes data into the private mailbox of the second processor through a common bus; and

when the data writing is completed, the special mailbox of the second processor sends an interrupt signal to the second processor, and the second processor after receiving the interrupt signal reads the data in the special mailbox through the corresponding special channel.

7. The communication method as claimed in claim 6, wherein when the first processor communicates with the second processor, the first processor determines whether the proprietary mailbox of the second processor has enough memory space to store the data, and if so, the first processor writes the data into the proprietary mailbox of the second processor through the common bus.

8. The communication method of claim 7, wherein each of the proprietary mailboxes is further configured to output a status signal indicating whether it has enough memory space to store the data, and each of the proprietary mailboxes receives the status signals output from the other proprietary mailboxes.

9. The communication method of claim 8, wherein when the first processor determines whether the proprietary mailbox of the second processor has sufficient storage space to store the data, the first processor reads the status signal outputted from the proprietary mailbox of the second processor, and determines whether the proprietary mailbox of the second processor has sufficient storage space to store the data according to the status signal.

10. The communication method of claim 9, wherein each of the proprietary mailboxes further comprises:

a control register for setting an interrupt condition of the proprietary mailbox; and

a mailbox controller for managing the storage space and generating the interrupt signal and the status signal.

Technical Field

The present invention relates to a Multi-Processor (Multi-Processor) system, and more particularly, to a Multi-Processor system having a Distributed Mailbox (Distributed Mailbox) structure and a communication method thereof.

Background

In a conventional multiprocessor system, there is usually a shared Memory (Share Memory) as a communication scheme. For example, referring to FIG. 1, FIG. 1 is a functional block diagram of a conventional multiprocessor system. The multiprocessor system 1 includes a shared memory 110 and a plurality of processors, for example, processors CPU _0 to CPU _ N. However, since the shared memory 110 and each processor are coupled to the same common Bus (Public Bus), the multiprocessor system 1 needs to perform queuing (Queue) scheduling of the common Bus whenever more than one processor wants to read from or write to the shared memory 110, which causes the waiting of the common Bus and degrades the performance of the whole system.

Disclosure of Invention

In view of the above, embodiments of the present invention provide a multiprocessor system with a distributed mailbox structure and a communication method thereof. The multiprocessor system comprises a plurality of processors, each processor is configured with a corresponding proprietary mailbox and a proprietary channel, and the communication method comprises the following steps. When the first processor of the processors is to communicate with the second processor, the first processor writes data into the special mailbox of the second processor through the public bus, when the data writing is completed, the special mailbox of the second processor sends an interrupt signal to the second processor, and the second processor after receiving the interrupt signal reads the data in the special mailbox through the corresponding special channel.

In addition, the embodiment of the invention also provides a processor error checking method. The processor error checking method can be also executed in the multiprocessor system, and comprises the following steps. When a first processor of the processors is to communicate with a second processor, the first processor writes data into a private mailbox of the second processor through the public bus, and when the private mailbox of the second processor receives the data, the private mailbox of the second processor starts to time, and when the time-out result exceeds a threshold value, the private mailbox of the second processor sends a time-out signal to the second processor, and the second processor after receiving the time-out signal resets the first processor.

Other objects and advantages of the present invention will be further understood from the technical features disclosed in the present invention. In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.

Drawings

FIG. 1 is a functional block diagram of a conventional multiprocessor system;

FIG. 2 is a functional block diagram of a multiprocessor system having a distributed mailbox architecture according to an embodiment of the present invention;

fig. 3A is a schematic flowchart of a first processor in a communication method according to an embodiment of the invention;

FIG. 3B is a flowchart illustrating a second processor in the communication method according to the embodiment of the invention;

FIG. 4 is a functional block diagram of a proprietary mailbox in the multiprocessor system of FIG. 2;

FIG. 5 is a flowchart illustrating a method for checking processor errors according to an embodiment of the present invention.

Detailed Description

Hereinafter, the present invention will be described in detail by illustrating various embodiments of the present invention through the accompanying drawings. The inventive concept may, however, be embodied in many different forms and should not be construed as limited to the exemplary embodiments set forth herein. Moreover, in the drawings, like reference numerals may be used to designate similar components.

Referring to fig. 2, fig. 2 is a functional block diagram of a multiprocessor system with a distributed mailbox architecture according to an embodiment of the present invention. As shown in FIG. 2, the multiprocessor system 2 includes a plurality of processors, and each processor is configured with a corresponding dedicated mailbox and a dedicated channel. For example, processor CPU _0 is configured with a proprietary mailbox MB _0 and a proprietary channel 210, processor CPU _1 is configured with a proprietary mailbox MB _1 and a proprietary channel 211, and so on, and processor CPU _ N is configured with a proprietary mailbox MB _ N and a proprietary channel 21N. It is understood that N is any positive integer greater than 1, and each proprietary mailbox may be composed of any storage medium, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), but the invention is not limited thereto.

As shown in fig. 2, since all the processors and the proprietary mailbox are coupled to the same common bus, in the embodiment, when a first processor, for example, the processor CPU _0, of the processors writes data into a second processor, for example, the processor CPU _1, the first processor CPU _0 writes the data into the proprietary mailbox MB _1 of the second processor CPU _1 through the common bus, and the second processor CPU _1 reads the written data from the proprietary mailbox MB _1, so as to perform a communication method between the processors. It should be noted that, before the first processor CPU _0 writes data into the private mailbox MB _1 of the second processor CPU _1, the first processor CPU _0 may preferably determine whether the private mailbox MB _1 of the second processor CPU _1 has enough storage space to store the data, if so, the first processor CPU _0 may write the data into the private mailbox MB _1 of the second processor CPU _1 through the public bus, and when the data writing IS completed, the private mailbox MB _1 may preferably issue an interrupt signal IS to the second processor CPU _1, or set a register (not shown) of the second processor CPU _1 to notify the second processor CPU _1 that the data IS currently written into the private mailbox MB _ 1. Upon receiving the interrupt signal IS or reading the value of the register, the second processor CPU _1 reads the data in its private mailbox MB _1 via the corresponding private channel 211 and performs the relevant processing on the data again.

That is, each processor is configured with a corresponding proprietary mailbox, rather than multiple processors sharing the same mailbox or memory, the management of data stored in the proprietary mailbox can be much simplified. Moreover, since each processor accesses the data in its private mailbox through the corresponding private channel, when each processor reads its private mailbox, this embodiment does not need to go through the public bus, so that the resources of the public bus are not occupied, and the performance of the whole system is improved. In addition, when any processor is to write data to its private mailbox, the processor may write data to its private mailbox over the common bus in addition to writing data over the private channel to avoid tying up resources of the common bus.

It should BE noted that, since the multiprocessor system 2 of the present embodiment is preferably implemented by a data storage device, when a host (not shown) issues a host command to the multiprocessor system 2, a front-End (FE) processor of the multiprocessor system 2, such as the processor CPU _0, first processes the host command, such as fetching the host command from a transmission interface and sorting the host command, and writes the processed host command into a Back-End (BE) processor to BE communicated, such as the proprietary mailbox MB _1 of the processor CPU _1, so that the processor CPU _1 executes a specific function according to the host command processed by the front-End processor. That is, the term "data" refers to a host command processed by a front-end processor or simply a command transmitted between a plurality of processors, but the invention is not limited thereto.

Similarly, in this embodiment, each processor preferably performs data transmission on the common bus according to an advanced extensible Interface (AXI) protocol, for example, the first processor writes data into a proprietary mailbox of another processor, the common bus preferably has an arbiter (not shown) for handling write requests of all or most of the processors, and the write requests of the first processor are sequentially granted according to the write requests, a priority order among the processors, or a priority order of issuing the write requests, and a priority order among the processors. Therefore, the first processor having granted the write request can write data to the private mailbox of the other processor through the common bus, and the first processor having no granted write request can wait until the write request is granted before accessing the common bus.

In addition, each processor preferably reads data in its proprietary mailbox according to the Self-entry (Self Register) protocol. For example, when data IS written to the proprietary mailbox of the second processor, the proprietary mailbox issues an interrupt signal IS to the second processor. Then, the second processor can read the data in the proprietary mailbox according to the self-logging protocol, and after the data is completely read, the second processor can inform the proprietary mailbox to delete or invalidate the data according to the self-logging protocol, so that the proprietary mailbox can recycle the storage space occupied by the old data for storing the new data. In contrast, in the embodiment, the first processor preferably writes one or more data into the proprietary mailbox of the second processor, and the second processor preferably reads one or more data from the proprietary mailbox, but the invention is not limited thereto.

In addition, in this embodiment, each proprietary mailbox may further output a status signal to indicate whether it has enough memory space to store data, and each proprietary mailbox may preferably receive status signals output from other proprietary mailboxes. For example, the private mailbox MB _0 outputs the status signal ST _0, and the private mailbox MB _0 receives the status signals ST _1 to ST _ N outputted from the private mailboxes MB _1 to MB _ N, respectively. In contrast, the private mailbox MB _1 outputs the status signal ST _1, and the private mailbox MB _1 receives the status signals ST _0 and ST _2 to ST _ N outputted from the private mailbox MB _0 and the private mailbox MB _2 to the private mailbox MB _ N, respectively, and so on, the private mailbox MB _ N outputs the status signal ST _ N, and the private mailbox MB _ N receives the status signals ST _0 to ST _ N-1 outputted from the private mailbox MB _0 to the private mailbox MB _ N-1, respectively. Therefore, when the first processor, for example, the processor CPU _0, communicates with the second processor, for example, the processor CPU _1, the first processor CPU _0 can confirm whether the private mailbox MB _1 has enough storage space to store the data according to the status signal ST _1 received by the private mailbox MB _ 0. Alternatively, in other embodiments, the status signals of all proprietary mailboxes may also be output to each processor, so that the first processor CPU _0 can determine whether to write data into the proprietary mailbox MB _1 directly according to the received status signal ST _ 1.

For example, each status signal is preferably implemented by a bit value, and when the bit value is 0, the proprietary mailbox represented by the status signal has enough storage space to store data, and when the bit value is 1, the proprietary mailbox represented by the status signal does not have enough storage space to store data, but the invention is not limited thereto. Next, an implementation of the communication method of the embodiment will be further described with reference to fig. 3A and fig. 3B, where fig. 3A is a schematic flowchart of a first processor in the communication method according to the embodiment of the present invention, and fig. 3B is a schematic flowchart of a second processor in the communication method according to the embodiment of the present invention. Since the details are also as described above, further description is omitted here.

As shown in fig. 3A, when a first processor, for example, the processor CPU _0, is to communicate with a second processor, for example, the processor CPU _1, in step S110, the first processor CPU _0 reads the status signal ST _1 output from the private mailbox MB _1 from the private mailbox MB _0, and in step S120, determines whether the private mailbox MB _1 has enough storage space to store the data according to the status signal ST _ 1. If so, the process continues to step S130. If not, the process returns to step S110. That is, for example, if the private mailbox MB _1 has not enough memory space to store the data, i.e. the status signal ST _1 is 1, the first processor CPU _0 continues to loop through steps S110 and S120 until the status signal ST _1 is determined to be 0.

It should be noted that, in the present embodiment, each proprietary mailbox can determine to generate a status signal of 0 or 1 by checking whether its storage space is lower than a preset value, but the invention is not limited thereto. In summary, the present invention is not limited to the specific implementation manner of generating or outputting the status signal from each proprietary mailbox, and those skilled in the art should be able to design the status signal according to the actual needs or applications. Furthermore, it should be understood that the content format in the proprietary mailbox is preferably defined by Firmware (Firmware) of the multiprocessor system 2, so that the present embodiment can easily change the content format of the data, thereby providing the structural advantage of easy extension and flexibility. Then, in step S130, the first processor CPU _0 writes the data into the private mailbox MB _1 via the public bus, and when the data writing IS completed, the private mailbox MB _1 sends an interrupt signal IS to the second processor CPU _ 1.

In this embodiment, the interrupt signal IS may also be implemented by a one-bit value, for example, when the second processor CPU _1 receives and determines that the special mailbox MB _1 issues the interrupt signal IS of 1, the second processor CPU _1 can know that the special mailbox MB _1 has been successfully written with new data. Therefore, as shown in fig. 3B, the second processor CPU _1 waits for the special mailbox MB _1 to issue the interrupt signal IS in step S140, and determines whether the interrupt signal IS received in step S150. If so, the process continues to step S160. If not, the process returns to step S140. That IS, for example, before the data IS not written completely, i.e. the interrupt signal IS not 1, the second processor CPU _1 continues to execute the loop of step S140 and step S150 until receiving the interrupt signal IS of 1. Finally, in step S160, the second processor CPU _1 reads the data in the private mailbox MB _1 through the corresponding private channel 211.

In another aspect, the present invention further provides an embodiment of a proprietary mailbox. Referring also to FIG. 4, FIG. 4 is a functional block diagram of a proprietary mailbox in the multiprocessor system of FIG. 2. It should be noted that, for the convenience of the following description, the present embodiment will be described by taking the specific mailbox MB _1 of the processor CPU _1 as an example, but the present invention is not limited thereto. As shown in fig. 4, the private Mailbox MB _1 includes a storage space 410, a Control Register (Control Register)420, and a Mailbox Controller (Mailbox Controller) 430. It should be noted that the control register 420 and the mailbox controller 430 may be implemented by hardware circuits, or implemented by hardware circuits with firmware or software, but the invention is not limited thereto. In addition, the above components may be integrated or separately arranged, but the invention is not limited thereto. In summary, the invention is not limited to a specific implementation of the proprietary mailbox MB _ 1.

In the present embodiment, the storage space 410 is preferably an SRAM, and preferably stores (buffers) data in a first-in-first-out (FIFO) queuing manner. The size of the storage space 410 is, for example, 1KB, and under this setting, the storage space 410 can store 64 data with a size of 16B, or 32 data with a size of 32B, or 16 data with a size of 64B. The control register 420 stores the relevant settings of the proprietary mailbox MB _1, for example, the control register 420 can be used to set an interrupt condition of the proprietary mailbox MB _1, and when the interrupt condition IS satisfied, for example, when one or more data IS successfully written into the mailbox MB _1, the mailbox MB _1 sends an interrupt signal IS to the processor CPU _ 1. In addition, the mailbox controller 430 IS used to write setting values into the control memory 420, manage the storage space 410, and generate the interrupt signal IS and the status signal ST _ 1.

In this embodiment, the mailbox controller 430 preferably manages the size and amount of data in the storage space 410 according to the setting of the processor CPU _ 1. If the data size is set to 64B, the mailbox controller 430 generates a status signal ST _1 of 1 when the remaining available space of the storage space 410 is less than or equal to a predetermined value, such as 64B (i.e. the storage space 410 can only store one more data), so that all processors can no longer write data into the proprietary mailbox MB _ 1. Then, after the processor CPU _1 reads the data stored in the private mailbox MB _1, the private mailbox MB _1 reclaims the storage space of the read data, so that the remaining available space is increased to 128B, for example. At this time, since the remaining available space is greater than the preset value, the mailbox controller 430 generates a status signal ST _1 of 0, and when the status signal ST _1 is 0, the processor CPU _0 that wants to write data into the private mailbox MB _1 can make a write request to the public bus, and after the write request is granted, the processor CPU _0 can write data into the private mailbox MB _ 1.

That is, as shown in FIG. 4, when the processor CPU _0 wants to communicate with the processor CPU _1, the processor CPU _0 determines whether the special mailbox MB _1 has enough storage space 410 to store data according to the status signal ST _1 outputted from the special mailbox MB _ 1. If so, the processor CPU _0 writes the data to the memory space 410 of the proprietary mailbox MB _1 via the common bus. Then, when the data writing IS completed, the mailbox controller 430 of the proprietary mailbox MB _1 generates and sends an interrupt signal IS to the processor CPU _ 1. The processor CPU _1, having received the interrupt signal IS, accesses the data in the memory space 410 via the corresponding dedicated channel 211. Since the details are also as described above, further description is omitted here.

On the other hand, the proprietary mailbox provided in this embodiment can be used as a communication scheme between different processors, and can also be used to check whether the processor writing data has an error, and assist in resetting (Reset) the processor having the error, so as to prevent the processor from causing a Stuck (Stuck) of the entire multiprocessor system 2. Therefore, referring to fig. 5, fig. 5 is a flowchart illustrating a processor error checking method according to an embodiment of the invention. It should be noted that the processor error checking method of fig. 5 may be implemented in the multiprocessor system 2 of fig. 2, but the present invention also does not limit the processor error checking method of fig. 5 to be implemented only in the multiprocessor system 2 of fig. 2. In addition, the same flow steps in fig. 5 as those in fig. 4 are labeled with the same numerals, and thus the details thereof will not be described in further detail.

As shown in fig. 5, when a first processor, for example, the processor CPU _0, is to communicate with a second processor, for example, the processor CPU _1, the first processor CPU _0 reads a status signal ST _1 output from the exclusive mailbox MB _1 in step S110, and determines whether the exclusive mailbox MB _1 has a sufficient storage space to store data according to the status signal ST _1 in step S120. If so, the process continues to step S130. If not, the process returns to step S110. Next, in step S130, the first processor CPU _0 writes the data into the private mailbox MB _1 through the public bus, and when the private mailbox MB _1 receives the data, in step S510, the private mailbox MB _1 starts to count time, and in step S520, it is determined whether the data is received completely, that is, whether the data writing is completed. If not, execution continues with step S530. It should be noted that, since the operation principle of determining whether to complete the receiving according to the received data by the special mailbox MB _1 is well known to those skilled in the art, the details of the step S520 are not repeated herein.

Then, in step S530, the private mailbox MB _1 of the second processor CPU _1 determines whether the timing result exceeds a threshold. If not, the step S520 is executed in a return mode. If yes, go on to step S540 and step S550. In step S540, the special mailbox MB _1 sends a timeout signal TS to the second processor CPU _1 to notify the second processor CPU _1 that the first processor CPU _0 currently writing data is faulty, and in step S550, the second processor CPU _1 receives the timeout signal TS to reset the first processor CPU _0, for example, the second processor CPU _1 preferably sends a reset signal (not shown) to the first processor CPU _0, so that the first processor CPU _0 can be reset according to the reset signal, but the invention is not limited thereto.

That is, assume that the first processor CPU _0 is to write 64B data into the proprietary mailbox MB _1, and after the proprietary mailbox MB _1 receives the data from the first processor CPU _0 and starts to count, if the first processor CPU _0 stops writing only the data of 24B, this means that an internal error may occur in the first processor CPU _0, thereby causing the first processor CPU _0 to fail to complete the writing of the data in time, therefore, until the timing result exceeds the threshold, for example, 1000 ms, the private mailbox MB _1 generates the time-out signal TS to notify the second processor CPU _1, and the second processor CPU _1 further indicates the first processor CPU _0 according to the time-out signal TS, or determining the data source to be the first processor CPU _0 according to the request end information of the written data, so as to reset the first processor CPU _ 0. It should be noted that, the setting of the timing and various judgment functions is preferably realized by the mailbox controller 430 writing the setting values into the control register 420, and the mailbox controller 430 is preferably controlled by the corresponding processor CPU _ 1. Therefore, the mailbox controller 430 may be used to generate and output the time-out signal TS in addition to the interrupt signal IS and the status signal ST _ 1.

On the other hand, in step S520, if the proprietary mailbox MB _1 determines that the data is completely received, i.e. when the data is completely written into the proprietary mailbox MB _1, the embodiment continues to perform step S560, step S570 and step S160. In step S560, the private mailbox MB _1 stops and zeroes the timer, and in step S570, the private mailbox MB _1 issues an interrupt signal IS to the second processor CPU _ 1. Finally, in step S160, the second processor CPU _1 receiving the interrupt signal IS reads the data in the private mailbox MB _1 through the corresponding private channel 211. Since the details are also as described above, further description is omitted here.

In summary, the multiprocessor system with a distributed mailbox structure and the communication method thereof provided by the embodiments of the present invention may be designed to have a dedicated mailbox for each processor without a conventional shared memory, so that the communication scheme between different processors can write data into the dedicated mailbox of the corresponding processor through a common bus, and each processor accesses the data in the dedicated mailbox through a dedicated channel, so that the embodiments of the present invention do not affect the common bus when each processor reads the dedicated mailbox, thereby reducing the utilization rate of the common bus and improving the performance of the whole system. In addition, the processor error checking method provided by the embodiment of the invention can check whether the processor writing data has an error by using the proprietary mailboxes, and assist in resetting the processor with the error to avoid the processor from being jammed in the entire multiprocessor system.

The above description is only an example of the present invention, and is not intended to limit the scope of the present invention.

14页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:用于高带宽存储器的可缩放芯片上网络

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!