JP2005352559A - Data transfer method in multiprocessor system - Google Patents

Data transfer method in multiprocessor system Download PDF

Info

Publication number
JP2005352559A
JP2005352559A JP2004169805A JP2004169805A JP2005352559A JP 2005352559 A JP2005352559 A JP 2005352559A JP 2004169805 A JP2004169805 A JP 2004169805A JP 2004169805 A JP2004169805 A JP 2004169805A JP 2005352559 A JP2005352559 A JP 2005352559A
Authority
JP
Japan
Prior art keywords
processor
cpu
data
general
shared memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2004169805A
Other languages
Japanese (ja)
Inventor
Takenori Yonezu
武紀 米津
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2004169805A priority Critical patent/JP2005352559A/en
Publication of JP2005352559A publication Critical patent/JP2005352559A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To solve problems wherein transfer time is proportional to the volume of data in the case of data transfer between processors using a serial communication method, and complicated hardware is required for arbitration of memory access in the case of data transfer between processors via a shared memory. <P>SOLUTION: When transferring data between a CPU-A 102 and a CPU-B 103 via the shared memory 101, the CPU-A 102 makes the CPU-B 103 not access simultaneously by setting a versatile input and output terminal 105 connecting between an output terminal of the CPU-A 102 and an input terminal of the CPU-B 103 active when the CPU-A 102 accesses to the shared memory 101. The CPU-B 103 makes the CPU-A 102 not access simultaneously by setting a versatile input and output terminal 106 connecting between an output terminal of the CPU-B 103 and an input terminal of the CPU-A 102 active when the CPU-B 103 accesses to the shared memory 101. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、マルチプロセッサシステムにおけるデータ転送方法に関するものである。   The present invention relates to a data transfer method in a multiprocessor system.

従来のマルチプロセッサシステムでは、プロセッサ間のデータ転送方式にシリアル通信方式を用いているため、データ量に比例した転送時間を要していた(例えば、特許文献1または2参照。)。   In a conventional multiprocessor system, since a serial communication method is used as a data transfer method between processors, a transfer time proportional to the amount of data is required (for example, see Patent Document 1 or 2).

また、マルチプロセッサと同一のシステムバス上に配置された共有メモリを利用してプロセッサ間のデータを転送する場合、メモリへの書き込み、読み込みを調停する回路をハードウェアで構成する必要があった(例えば、特許文献3または4参照。)。
特開2001−268142号公報(図12、図18) 特開2002−152052号公報(図10〜10、図11〜14) 特開平11−102348号公報(図1) 特開平5−20278号公報(図1)
In addition, when data is transferred between processors using a shared memory arranged on the same system bus as the multiprocessor, it is necessary to configure a circuit for arbitrating writing to and reading from the memory by hardware ( For example, see Patent Document 3 or 4.)
JP 2001-268142 A (FIGS. 12 and 18) Japanese Patent Laid-Open No. 2002-152052 (FIGS. 10 to 10, FIGS. 11 to 14) JP-A-11-102348 (FIG. 1) Japanese Patent Laid-Open No. 5-20278 (FIG. 1)

シリアル通信方式では、データ量に比例して転送時間を必要とするため、システム機能を拡張するなどして、転送データ量が増すと転送スピードを考慮して設計しなおす必要があった。さらに信号線に重畳されるノイズなどの外乱で引き起こされるデータ破壊を対策するために、複数回のデータ一致確認や、パリティデータを付加するなど、転送データの誤り検出が必要であり、更にデータ転送に時間を要するという課題があった。   Since the serial communication method requires a transfer time in proportion to the data amount, it has been necessary to redesign the system considering the transfer speed when the transfer data amount is increased by expanding the system function. Furthermore, in order to prevent data destruction caused by disturbances such as noise superimposed on the signal line, it is necessary to detect errors in the transferred data, such as confirming data coincidence multiple times and adding parity data. There was a problem that it took time.

また、共有メモリを利用する場合は、各々のプロセッサからのメモリへのアクセスを調停する手段を複雑なハードウェアで構成する必要があり、さらに調停手段に応じたソフトウェア設計が必要であった。   Further, in the case of using a shared memory, it is necessary to configure the means for arbitrating access to the memory from each processor by complex hardware, and further, software design corresponding to the arbitration means is necessary.

本発明の目的は、プロセッサ間のデータ転送を短時間で実現できるとともに、複雑なハードウェアで構成されたメモリアクセスの調停手段を必要としないマルチプロセッサシステムにおけるデータ転送方法を提供することである。   An object of the present invention is to provide a data transfer method in a multiprocessor system that can realize data transfer between processors in a short time and does not require a memory access arbitration means constituted by complex hardware.

本発明のマルチプロセッサシステムにおけるデータ転送方法は、共有メモリを介して第1および第2のプロセッサ間でデータを転送するマルチプロセッサシステムにおけるデータ転送方法であって、第1のプロセッサは、データの転送のために共有メモリにアクセスしている間、第1のメモリアクセス禁止信号を第2のプロセッサへ出力し、第2のプロセッサは、第1のメモリアクセス禁止信号を入力している間、共有メモリへのアクセスを禁止するようにし、第2のプロセッサは、データの転送のために共有メモリにアクセスしている間、第2のメモリアクセス禁止信号を第1のプロセッサへ出力し、第1のプロセッサは、第2のメモリアクセス禁止信号を入力している間、共有メモリへのアクセスを禁止するようにしたことを特徴とする。   A data transfer method in a multiprocessor system according to the present invention is a data transfer method in a multiprocessor system in which data is transferred between a first processor and a second processor via a shared memory, wherein the first processor transfers data. A first memory access prohibition signal is output to the second processor while the shared memory is being accessed, and the second processor receives the first memory access prohibition signal while the shared memory is being input. The second processor outputs a second memory access prohibition signal to the first processor while accessing the shared memory for data transfer, and the second processor Is characterized in that access to the shared memory is prohibited while the second memory access prohibition signal is input.

本発明によれば、共有メモリを介してプロセッサ間のデータ転送を行い、かつ、プロセッサ間で互いにメモリアクセス禁止信号を授受するという簡単な構成により、メモリアクセスの調停を行うことができる。したがって、データ転送を短時間で実現できるとともに、メモリアクセスの調停手段を複雑なハードウェアで構成する必要もない。   According to the present invention, it is possible to perform memory access arbitration with a simple configuration in which data is transferred between processors via a shared memory and a memory access prohibition signal is exchanged between the processors. Therefore, data transfer can be realized in a short time, and it is not necessary to configure the memory access arbitration means with complex hardware.

また、本発明において、第1および第2のプロセッサの各々は、データ送信側のプロセッサになる場合、実際に転送すべきデータを含む転送用データを共有メモリに書き込むとともに、転送用データのうち実際に転送すべきデータを指定するための転送データ指定情報を共有メモリに格納し、データ受信側のプロセッサになる場合、共有メモリに格納された転送データ指定情報に基づいて共有メモリから実際に転送すべきデータを読み出すようにしてもよい。   Further, in the present invention, when each of the first and second processors becomes a data transmission side processor, the transfer data including the data to be actually transferred is written in the shared memory, and the transfer data is actually When the transfer data specification information for specifying the data to be transferred is stored in the shared memory and becomes a processor on the data receiving side, the data is actually transferred from the shared memory based on the transfer data specification information stored in the shared memory. The power data may be read out.

このように、転送データ指定情報(例えば、実際に転送すべきデータの先頭アドレスとデータサイズの情報)を用いることで、転送開始位置や転送データ量が指定できるようになり、変更されたデータのみや、優先度の高いデータから転送するなどの制御が可能となり、転送を効率化することができる。   In this way, by using transfer data designation information (for example, information on the start address and data size of data to be actually transferred), the transfer start position and the transfer data amount can be designated, and only changed data can be designated. In addition, it is possible to control the transfer from data with high priority, and the transfer can be made efficient.

また、本発明において、第1のプロセッサの汎用出力端子と第2のプロセッサの汎用入力端子とを接続し、第1のメモリアクセス禁止信号は第1のプロセッサの汎用出力端子から出力されて第2のプロセッサの汎用入力端子へ入力され、第2のプロセッサの汎用出力端子と第1のプロセッサの汎用入力端子とを接続し、第2のメモリアクセス禁止信号は第2のプロセッサの汎用出力端子から出力されて第1のプロセッサの汎用入力端子へ入力されるようにしてもよい。   In the present invention, the general-purpose output terminal of the first processor is connected to the general-purpose input terminal of the second processor, and the first memory access prohibition signal is output from the general-purpose output terminal of the first processor to the second The general-purpose input terminal of the second processor is connected to the general-purpose output terminal of the second processor and the general-purpose input terminal of the first processor, and the second memory access prohibition signal is output from the general-purpose output terminal of the second processor. Then, it may be inputted to the general-purpose input terminal of the first processor.

このように、各プロセッサ間の汎用入力端子と汎用出力端子を接続するという簡単な構成により、プロセッサ間でメモリアクセス禁止信号を授受することができる。   In this way, a memory access prohibition signal can be exchanged between processors with a simple configuration in which a general-purpose input terminal and a general-purpose output terminal are connected between processors.

さらにこの場合、第1のメモリアクセス禁止信号が入力される第2のプロセッサの汎用入力端子、および第2のメモリアクセス禁止信号が入力される第1のプロセッサの汎用入力端子の少なくとも一方が割込み入力端子であることが好ましい。   Further, in this case, at least one of the general-purpose input terminal of the second processor to which the first memory access prohibition signal is input and the general-purpose input terminal of the first processor to which the second memory access prohibition signal is input is an interrupt input. A terminal is preferred.

このように、各々のプロセッサのメモリアクセス禁止信号の入力側に割込み端子を使用し、割り込みハンドラで処理を行なうことによって、制御タイミングにおける応答性能を向上させることができる。   As described above, by using the interrupt terminal on the input side of the memory access prohibition signal of each processor and performing processing by the interrupt handler, the response performance at the control timing can be improved.

また、第1および第2のプロセッサのいずれか一方のプロセッサは、共有メモリにアクセスする直前にメモリアクセス禁止信号の他方のプロセッサへの出力を開始し、その出力を開始してから所定時間内に他方のプロセッサからのメモリアクセス禁止信号を入力した場合、他方のプロセッサへのメモリアクセス禁止信号の出力を停止するとともに共有メモリへのアクセスを中止するようにしてもよい。   Further, one of the first and second processors starts outputting the memory access prohibition signal to the other processor immediately before accessing the shared memory, and within a predetermined time after starting the output. When the memory access prohibition signal from the other processor is input, the output of the memory access prohibition signal to the other processor may be stopped and the access to the shared memory may be stopped.

これにより、ほぼ同時に第1および第2のプロセッサが共有メモリにアクセスしようとした場合に、一方のプロセッサのアクセスを中止させて他方のプロセッサを優先的にアクセスさせることができるため、第1および第2のプロセッサが共有メモリに同時にアクセスすることを回避でき、マルチマスタシステムが可能となる。   Thus, when the first and second processors try to access the shared memory almost simultaneously, the access of one processor can be stopped and the other processor can be preferentially accessed. Simultaneous access to the shared memory by the two processors can be avoided, and a multi-master system becomes possible.

また、本発明において、第1および第2のプロセッサは、共有メモリを共有し直列接続された3つ以上のプロセッサのうちの任意の2つのプロセッサであり、第1のプロセッサの指示によって第1および第2のプロセッサ間でデータ転送を行う場合、第1のプロセッサから出力される第1のメモリアクセス禁止信号は、プロセッサ間の接続によって第1のプロセッサ以外の全てのプロセッサへ入力され、第1のメモリアクセス禁止信号を入力しているプロセッサは、共有メモリへのアクセスを禁止するようにし、第2のプロセッサから出力される第2のメモリアクセス禁止信号は、プロセッサ間の接続によって第2のプロセッサと第1のプロセッサとの間に接続されたプロセッサおよび第1のプロセッサへ入力され、第2のメモリアクセス禁止信号を入力しているプロセッサは、共有メモリへのアクセスを禁止するようにし、第2のメモリアクセス禁止信号は、第2のプロセッサと第1のプロセッサとの間に接続されたプロセッサおよび第2のプロセッサへの第1のメモリアクセス禁止信号が解除されているときに第2のプロセッサから出力されるようにしてもよい。   In the present invention, the first and second processors are any two of the three or more processors that share the shared memory and are connected in series, and the first and second processors are in accordance with instructions from the first processor. When data is transferred between the second processors, the first memory access prohibition signal output from the first processor is input to all the processors other than the first processor through the connection between the processors, and the first processor The processor receiving the memory access prohibition signal prohibits access to the shared memory, and the second memory access prohibition signal output from the second processor is connected to the second processor by connection between the processors. Input to the processor connected to the first processor and the first processor, and second memory access prohibited The processor that is inputting the signal prohibits access to the shared memory, and the second memory access prohibition signal is generated when the second processor and the second processor are connected between the second processor and the first processor. The signal may be output from the second processor when the first memory access prohibition signal to the processor is released.

これにより、直列接続された3つ以上のプロセッサのうち任意の2つのプロセッサ間で共有メモリを介してデータ転送を行い、かつ、プロセッサ間でメモリアクセス禁止信号を授受するという簡単な構成によりメモリアクセスの調停を行うことができ、データ転送を短時間で実現できるとともに、メモリアクセスの調停手段を複雑なハードウェアで構成する必要もない。   As a result, memory access is achieved with a simple configuration in which data is transferred between any two of three or more processors connected in series via a shared memory, and a memory access prohibition signal is exchanged between the processors. Arbitration can be performed, data transfer can be realized in a short time, and the memory access arbitration means does not need to be configured with complex hardware.

以上のように本発明によれば、安定したデータを効率的に転送でき、さらに複雑なハードウェアで構成されたメモリアクセスの調停手段が不要で、ハードウェアに依存しない汎用的なシステム構成を実現することができ、共有メモリを介してプロセッサ間のデータのやり取りを行なうマルチプロセッサシステムを簡単に、かつ安価に構成することができる。また、汎用的なシステム構成が可能であるため、ソフトウェアの再利用が可能であり、ソフトウェアの生産性を向上することが可能である。   As described above, according to the present invention, stable data can be transferred efficiently, and a memory access arbitration unit configured with complicated hardware is unnecessary, and a general system configuration independent of hardware is realized. In addition, a multiprocessor system that exchanges data between processors via a shared memory can be configured easily and inexpensively. In addition, since a general-purpose system configuration is possible, software can be reused, and software productivity can be improved.

以下、本発明の実施の形態を、図面を参照しながら説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

(実施の形態1)
図1は、本発明の実施の形態1に係るデータ転送方法の構成を示すブロック図である。実施の形態1に係るデータ転送方法は、共有メモリ101、CPU−A102、CPU−B103、アドレスおよびデータバス104、汎用入出力端子105、汎用入出力端子106を有して構成される。
(Embodiment 1)
FIG. 1 is a block diagram showing a configuration of a data transfer method according to Embodiment 1 of the present invention. The data transfer method according to the first embodiment includes a shared memory 101, a CPU-A 102, a CPU-B 103, an address and data bus 104, a general-purpose input / output terminal 105, and a general-purpose input / output terminal 106.

共有メモリ101は、転送するデータを保持もしくは、CPU−A102からCPU−B103または、CPU−B103からCPU−A102に対して転送データの書き込みおよび読み込みを要求するためのコマンドを保持するための領域である。   The shared memory 101 is an area for holding data to be transferred or holding commands for requesting writing and reading of transfer data from the CPU-A 102 to the CPU-B 103 or from the CPU-B 103 to the CPU-A 102. is there.

CPU−A102、CPU−B103は、プロセッサであり、共有メモリ101とアドレスおよびデータバス104によって接続され、お互いのデータを交換することができるようになる。   The CPU-A 102 and the CPU-B 103 are processors and are connected to the shared memory 101 via the address and data bus 104 so that they can exchange data with each other.

汎用入出力端子105は、CPU−A102の出力端子と、CPU−B103の入力端子とを接続し、CPU−A102がコマンド領域にコマンドを書き込む最中にCPU−A102が汎用入出力端子105をアクティブに設定することで、CPU−B103が、CPU−A102が書き込み中のコマンド領域を参照しないよう通知する、つまりCPU−A102が書き込むのと同じアドレスをCPU−B103が同時に読み出さないように通知するためのものである。   The general-purpose input / output terminal 105 connects the output terminal of the CPU-A 102 and the input terminal of the CPU-B 103, and the CPU-A 102 activates the general-purpose input / output terminal 105 while the CPU-A 102 writes a command in the command area. In order to notify the CPU-B 103 not to refer to the command area being written by the CPU-A 102, that is, to notify the CPU-B 103 not to simultaneously read the same address as the CPU-A 102 writes. belongs to.

汎用入出力端子106は、CPU−B103の出力端子と、CPU−A102の入力端子とを接続し、CPU−B103がコマンド領域にコマンドを書き込む最中にCPU−B103が汎用入出力端子106をアクティブに設定することで、CPU−A102が、CPU−B103が書き込み中のコマンド領域を参照しないよう通知する、つまりCPU−B103が書き込むのと同じアドレスをCPU−A102が同時に読み出さないように通知するためのものである。   The general-purpose input / output terminal 106 connects the output terminal of the CPU-B 103 and the input terminal of the CPU-A 102, and the CPU-B 103 activates the general-purpose input / output terminal 106 while the CPU-B 103 writes a command in the command area. In order to notify the CPU-A 102 not to refer to the command area being written by the CPU-B 103, that is, to notify the CPU-A 102 not to simultaneously read the same address as the CPU-B 103 writes. belongs to.

図2は、本発明の実施の形態1に係るデータ転送方法の共有メモリマッピングの一例を示す共有メモリのメモリマップ図である。   FIG. 2 is a memory map diagram of the shared memory showing an example of the shared memory mapping of the data transfer method according to the first embodiment of the present invention.

実施の形態1に係るデータ転送方法の共有メモリマッピングの一例は、送受信コマンド領域201、コマンドに対する制御状態を示すステータス状態領域202、CPU−A102がデータを書き込むためのCPU−A書き込み領域203、CPU−B103がデータを書き込むためのCPU−B書き込み領域204を有して構成される。   An example of shared memory mapping of the data transfer method according to the first embodiment includes a transmission / reception command area 201, a status state area 202 indicating a control state for a command, a CPU-A write area 203 for the CPU-A 102 to write data, and a CPU -B103 has a CPU-B write area 204 for writing data.

送受信コマンド領域201は、読み込みもしくは、書き込みを行なうかというコマンドをデータ転送相手のプロセッサに渡すための領域である。   The transmission / reception command area 201 is an area for passing a command for reading or writing to a data transfer partner processor.

ステータス状態領域202は、コマンドの受け手側となるプロセッサがコマンドを正常に処理できたことを示すステータス状態をコマンド送信側プロセッサに渡すための領域である。   The status state area 202 is an area for passing a status state indicating that the processor on the command receiving side has successfully processed the command to the command transmitting side processor.

エラー処理もしくはハンドシェイク処理を行なわない場合はステータス状態領域202を使用しなくてもよい。   When error processing or handshake processing is not performed, the status state area 202 may not be used.

CPU−A書き込み領域203は、CPU−Bに転送するデータを保持するためのものである。   The CPU-A writing area 203 is for holding data to be transferred to the CPU-B.

CPU−B書き込み領域204は、CPU−Aに転送するデータを保持するためのものである。   The CPU-B writing area 204 is for holding data to be transferred to the CPU-A.

次に、図3もしくは図4を用いて詳細にデータ転送手順を説明する。   Next, the data transfer procedure will be described in detail with reference to FIG. 3 or FIG.

図3は、本発明の実施の形態1に係るデータ転送方法のCPU−A102からCPU−B103へデータを転送する場合のタイミングチャートである。   FIG. 3 is a timing chart when transferring data from the CPU-A 102 to the CPU-B 103 in the data transfer method according to the first embodiment of the present invention.

図3に示す、実施の形態1に係るデータ転送方法のCPU−A102からCPU−B103へデータを転送する場合のタイミングチャートは、CPU−A102がメモリを制御する区間301もしくは303、CPU−B103がメモリを制御する区間302もしくは304を有し、これらの状態はCPU−A102もしくは、CPU−B103の内部状態によって区別できる。マスタ側となるCPU−A102の内部状態を示すモードは、データ転送中でない状態を示すIDLEモードと、コマンドもしくは、送信するデータを共有メモリ101へ書き込む状態を示すCMD_SETモードと、スレーブとなるCPU−B103がコマンドに応じた処理の完了を待つ状態を示すWIATモードと、スレーブとなるCPU−B103からのステータス情報を確認する状態を示すSTS_CHKモードで構成される。一方、スレーブ側となるCPU−B103の内部状態を示すモードは、データ転送中でない状態を示すIDLEモードと、マスタとなるCPU−A102からのコマンドを受理し、必要な処理を行う状態を示すCMD_GETモードで構成される。転送開始から終了まで、制御区間301、302、303、304で構成される一連の制御単位は、マスタ側であるCPU−A102の内部状態で管理できるため、CPU−B103の内部状態は、一連の制御単位の間であっても制御区間301、303で区別することなく、IDLEモードの状態で、制御することができる。   3 is a timing chart in the case of transferring data from the CPU-A 102 to the CPU-B 103 in the data transfer method according to the first embodiment. The timing chart 301 or 303 in which the CPU-A 102 controls the memory is shown in FIG. There are sections 302 or 304 for controlling the memory, and these states can be distinguished by the internal state of the CPU-A 102 or the CPU-B 103. The mode indicating the internal state of the CPU-A 102 on the master side includes an IDLE mode indicating a state in which data is not being transferred, a CMD_SET mode indicating a state in which a command or data to be transmitted is written to the shared memory 101, and a slave CPU- The WIAT mode indicates a state in which the B 103 waits for the completion of processing according to the command, and the STS_CHK mode indicates a state in which status information from the CPU-B 103 serving as a slave is confirmed. On the other hand, the mode indicating the internal state of the CPU-B 103 on the slave side includes an IDLE mode indicating a state where data transfer is not being performed, and a CMD_GET indicating a state where a command from the CPU-A 102 serving as the master is received and necessary processing is performed. Consists of modes. Since a series of control units composed of the control sections 301, 302, 303, and 304 can be managed from the internal state of the CPU-A 102 on the master side from the transfer start to the end, the internal state of the CPU-B 103 is a series of control units. Even between control units, control can be performed in the IDLE mode without distinguishing between the control sections 301 and 303.

制御区間301において、CPU−A102は、汎用出力端子105をアクティブに設定し、共有メモリ101へアクセス中であることをCPU−B103へ通知する。CPU−A102は、CPU−B103へ送信するデータをCPU−A書き込み領域203へ設定するとともに、CPU−B103に対してデータを受信するように、送受信コマンド領域201へ受信要求コマンドを設定し、汎用出力端子105をノン・アクティブに設定して完了する(CPU−A:CMD_SETモード)。   In the control section 301, the CPU-A 102 sets the general-purpose output terminal 105 to active, and notifies the CPU-B 103 that the shared memory 101 is being accessed. The CPU-A 102 sets data to be transmitted to the CPU-B 103 in the CPU-A write area 203 and sets a reception request command in the transmission / reception command area 201 so that the CPU-B 103 receives data. The setting is completed by setting the output terminal 105 to non-active (CPU-A: CMD_SET mode).

制御区間302において、CPU−B103は、汎用出力端子105がアクティブからノン・アクティブに変化したことを検出すると、汎用出力端子106をアクティブに設定し、送受信コマンド領域201に設定されたコマンドを参照して受信要求コマンドであることを確認する。CPU−B103はCPU−A書き込み領域203へ設定されたデータを取り込み、処理を完了すると転送ステータス状態領域202へ読み込み完了を設定する。なお、転送ステータス状態領域202は、コマンドを保持する必要が無い場合、送受信コマンド領域201と同一の領域でもよい。   In the control section 302, when detecting that the general-purpose output terminal 105 has changed from active to non-active, the CPU-B 103 sets the general-purpose output terminal 106 to active and refers to the command set in the transmission / reception command area 201. Confirm that the command is a reception request command. The CPU-B 103 fetches the set data into the CPU-A writing area 203 and sets the reading completion to the transfer status state area 202 when the processing is completed. Note that the transfer status state area 202 may be the same area as the transmission / reception command area 201 when there is no need to hold a command.

CPU−B103は汎用出力端子106をノン・アクティブに設定して完了する(CPU−A:WAITモード、CPU−B:CMD_GETモード)。   The CPU-B 103 completes by setting the general-purpose output terminal 106 to non-active (CPU-A: WAIT mode, CPU-B: CMD_GET mode).

制御区間303において、CPU−A102は、汎用出力端子106がアクティブからノン・アクティブに変化したことを検出すると、汎用出力端子105をアクティブに設定し、転送ステータス状態領域202に設定されたステータス状態を参照して読み込み完了であることを確認する。CPU−A102は送受信コマンド領域201へ設定されている受信要求コマンドを破棄し、汎用出力端子105をノン・アクティブに設定して完了する(CPU−A:STS_CHKモード)。   In the control section 303, when the CPU-A 102 detects that the general-purpose output terminal 106 has changed from active to non-active, the CPU-A 102 sets the general-purpose output terminal 105 to active, and sets the status state set in the transfer status state area 202. Refer to and confirm that the reading is complete. The CPU-A 102 discards the reception request command set in the transmission / reception command area 201, and sets the general-purpose output terminal 105 to non-active to complete (CPU-A: STS_CHK mode).

制御区間304において、CPU−B103は、汎用出力端子105がアクティブからノン・アクティブに変化したことを検出すると、汎用出力端子106をアクティブに設定し、送受信コマンド領域201に設定されたコマンドを参照する。コマンドが設定されていないことを確認すると、CPU−B103は汎用出力端子106をノン・アクティブに設定して完了する。この汎用出力端子106がアクティブからノン・アクティブに変化したことを検出してCPU−A102は、STS_CHKモードからIDLEモードへ遷移する。   In the control section 304, when detecting that the general-purpose output terminal 105 has changed from active to non-active, the CPU-B 103 sets the general-purpose output terminal 106 to active and refers to the command set in the transmission / reception command area 201. . If it is confirmed that the command is not set, the CPU-B 103 sets the general-purpose output terminal 106 to non-active and completes. Upon detecting that the general-purpose output terminal 106 has changed from active to non-active, the CPU-A 102 transitions from the STS_CHK mode to the IDLE mode.

また、CPU−B103が正しくデータを受信できない場合、転送ステータス状態領域202へ受信エラーを設定することで、CPU−A102へ通知することができる。   Further, when the CPU-B 103 cannot receive data correctly, the CPU-A 102 can be notified by setting a reception error in the transfer status state area 202.

このときCPU−A102は制御区間303において、受信が完了できていないことを確認すると、CPU−A102は送受信コマンド領域201へ設定されている受信要求コマンドを破棄せず、CPU−B103に対してデータを受信するように、送受信コマンド領域201へ受信要求コマンドを設定し、汎用出力端子105をノン・アクティブに設定して完了することで、以降、制御区間302からの処理を順次実施することができる。   At this time, when the CPU-A 102 confirms that the reception has not been completed in the control section 303, the CPU-A 102 does not discard the reception request command set in the transmission / reception command area 201, and sends data to the CPU-B 103. , The reception request command is set in the transmission / reception command area 201, the general-purpose output terminal 105 is set to non-active, and the processing from the control section 302 can be performed sequentially thereafter. .

図4は、本発明の実施の形態1に係るデータ転送方法のCPU−A102がCPU−B103からデータを受信する場合のタイミングチャートである。   FIG. 4 is a timing chart when the CPU-A 102 of the data transfer method according to the first embodiment of the present invention receives data from the CPU-B 103.

制御区間401において、CPU−A102は、汎用出力端子105をアクティブに設定し、共有メモリ101へアクセス中であることをCPU−B103へ通知する。CPU−A102は、CPU−B103に対してデータを送信するように、送受信コマンド領域201へ送信要求コマンドを設定し、汎用出力端子105をノン・アクティブに設定して完了する(CPU−A:CMD_SETモード)。   In the control section 401, the CPU-A 102 sets the general-purpose output terminal 105 to active and notifies the CPU-B 103 that the shared memory 101 is being accessed. The CPU-A 102 sets a transmission request command in the transmission / reception command area 201 so as to transmit data to the CPU-B 103, sets the general-purpose output terminal 105 to non-active, and completes (CPU-A: CMD_SET mode).

制御区間402において、CPU−B103は、汎用出力端子105がアクティブからノン・アクティブに変化したことを検出すると、汎用出力端子106をアクティブに設定し、送受信コマンド領域201に設定されたコマンドを参照して送信要求コマンドであることを確認する。CPU−B103はCPU−B書き込み領域204へ要求されたデータを書き込み、処理を完了すると転送ステータス状態領域202へ書き込み完了を設定する。なお、転送ステータス状態領域202は、コマンドを保持する必要が無い場合、送受信コマンド領域201と同一の領域でもよい。   In the control section 402, when detecting that the general-purpose output terminal 105 has changed from active to non-active, the CPU-B 103 sets the general-purpose output terminal 106 to active and refers to the command set in the transmission / reception command area 201. Confirm that it is a send request command. The CPU-B 103 writes the requested data in the CPU-B writing area 204, and when the processing is completed, the writing completion is set in the transfer status state area 202. Note that the transfer status state area 202 may be the same area as the transmission / reception command area 201 when there is no need to hold a command.

CPU−B103は汎用出力端子106をノン・アクティブに設定して完了する(CPU−A:WAITモード、CPU−B:CMD_GETモード)。   The CPU-B 103 completes by setting the general-purpose output terminal 106 to non-active (CPU-A: WAIT mode, CPU-B: CMD_GET mode).

制御区間403において、CPU−A102は、汎用出力端子106がアクティブからノン・アクティブに変化したことを検出すると、汎用出力端子105をアクティブに設定し、転送ステータス状態領域202に設定されたステータス状態を参照して書き込み完了であることを確認するとともにCPU−B103から受信したデータをCPU−B書き込み領域204から取り込む。CPU−A102は送受信コマンド領域201へ設定されている送信要求コマンドを破棄し、汎用出力端子105をノン・アクティブに設定して完了する(CPU−A:STS_CHKモード)。   In the control section 403, when the CPU-A 102 detects that the general-purpose output terminal 106 has changed from active to non-active, the CPU-A 102 sets the general-purpose output terminal 105 to active, and sets the status state set in the transfer status state area 202. With reference to confirming that the writing is completed, the data received from the CPU-B 103 is fetched from the CPU-B writing area 204. The CPU-A 102 discards the transmission request command set in the transmission / reception command area 201 and completes the general-purpose output terminal 105 by setting it to non-active (CPU-A: STS_CHK mode).

制御区間404において、CPU−B103は、汎用出力端子105がアクティブからノン・アクティブに変化したことを検出すると、汎用出力端子106をアクティブに設定し、送受信コマンド領域201に設定されたコマンドを参照する。コマンドが設定されていないことを確認すると、CPU−B103は汎用出力端子106をノン・アクティブに設定して完了する。この汎用出力端子106がアクティブからノン・アクティブに変化したことを検出してCPU−A102は、STS_CHKモードからIDLEモードへ遷移する。   In the control section 404, when detecting that the general-purpose output terminal 105 has changed from active to non-active, the CPU-B 103 sets the general-purpose output terminal 106 to active and refers to the command set in the transmission / reception command area 201. . If it is confirmed that the command is not set, the CPU-B 103 sets the general-purpose output terminal 106 to non-active and completes. Upon detecting that the general-purpose output terminal 106 has changed from active to non-active, the CPU-A 102 transitions from the STS_CHK mode to the IDLE mode.

また、CPU−B103が正しくデータを送信できない場合、転送ステータス状態領域202へ送信エラーを設定することで、CPU−A102へ通知することができる。   Further, when the CPU-B 103 cannot transmit data correctly, the CPU-A 102 can be notified by setting a transmission error in the transfer status state area 202.

このときCPU−A102は制御区間403において、書き込みが完了できていないことを確認すると、CPU−A102は送受信コマンド領域201へ設定されている送信要求コマンドを破棄せず、CPU−B103に対してデータを送信するように、送受信コマンド領域201へ送信要求コマンドを設定し、汎用出力端子105をノン・アクティブに設定して完了することで、以降、制御区間402からの処理を順次実施することができる。   At this time, if the CPU-A 102 confirms that the writing has not been completed in the control section 403, the CPU-A 102 does not discard the transmission request command set in the transmission / reception command area 201, and sends data to the CPU-B 103. Then, the transmission request command is set in the transmission / reception command area 201, the general-purpose output terminal 105 is set to non-active, and the processing from the control section 402 can be performed sequentially thereafter. .

さらに、共有メモリ101内に、送受信コマンド領域201、転送ステータス状態領域202に加え、CPU−A書き込み領域203、CPU−B書き込み領域204を制御するためのデータ先頭アドレス205、送受信データサイズ206を備えることで、転送開始位置および転送データ量が指定できるようになり、変更されたデータのみや、優先度の高いデータから転送するなどの制御が可能となり、転送を効率化することができる。   Further, in the shared memory 101, in addition to the transmission / reception command area 201 and the transfer status state area 202, a data head address 205 and a transmission / reception data size 206 for controlling the CPU-A writing area 203 and the CPU-B writing area 204 are provided. As a result, the transfer start position and the transfer data amount can be designated, and control such as transferring only changed data or data with high priority can be performed, and the transfer can be made efficient.

なお、汎用入出力端子105、および汎用入出力端子106において、各々の入力側に割込み端子を使用し、割り込みハンドラで処理を行なうことによって、図3もしくは図4に示す制御タイミングにおける応答性能を向上させることができる。   In addition, the general-purpose input / output terminal 105 and the general-purpose input / output terminal 106 use an interrupt terminal on each input side and perform processing by the interrupt handler, thereby improving the response performance at the control timing shown in FIG. Can be made.

以上のように実施の形態1によれば、安定したデータを効率的に転送でき、さらに複雑なハードウェアで構成されたメモリアクセスの調停手段が不要で、ハードウェアに依存しない汎用的なシステム構成を実現することができ、共有メモリ101を介してプロセッサ間のデータのやり取りを行なうマルチプロセッサシステムを簡単に、かつ安価に構成することができる。また、汎用的なシステム構成が可能であるため、ソフトウェアの再利用が可能であり、ソフトウェアの生産性を向上することが可能である。   As described above, according to the first embodiment, it is possible to efficiently transfer stable data, and there is no need for a memory access arbitration unit configured by complex hardware, and a general-purpose system configuration that does not depend on hardware. And a multiprocessor system for exchanging data between processors via the shared memory 101 can be configured easily and inexpensively. In addition, since a general-purpose system configuration is possible, software can be reused, and software productivity can be improved.

(実施の形態2)
次に、本発明の実施の形態2について説明する。実施の形態2において、データ転送方法の構成は、実施の形態1と同様に図1ないし図2に示される。また、実施の形態2における制御タイミングチャートは、実施の形態1の図3ないし図4とほぼ同じであるが、通信開始時の制御が異なる。図5は本発明の実施の形態2に係るデータ転送方法のタイミングチャートである。
(Embodiment 2)
Next, a second embodiment of the present invention will be described. In the second embodiment, the configuration of the data transfer method is shown in FIGS. 1 and 2 as in the first embodiment. The control timing chart in the second embodiment is almost the same as that in FIGS. 3 to 4 of the first embodiment, but the control at the start of communication is different. FIG. 5 is a timing chart of the data transfer method according to the second embodiment of the present invention.

実施の形態2では、CPU−A102およびCPU−B103を用いたマルチマスタシステムを可能とするため、共有メモリ101に同時アクセスが起こらないようにソフトウェアで対策を行なう方法について、図5を参照して説明する。   In the second embodiment, in order to enable a multi-master system using the CPU-A 102 and the CPU-B 103, a method for taking a countermeasure with software so that the shared memory 101 is not simultaneously accessed will be described with reference to FIG. explain.

図5は、CPU−A102およびCPU−B103の2つのプロセッサがマスタとなり得るシステムにおいて、通信を開始するタイミング305もしくは405(図3、図4)において、CPU−A102およびCPU−B103が同時に共有メモリ101にアクセス要求を出した場合に、CPU−A102側を優先とする一例を示したものである。なお、CPU−A出力端子504は、図1の汎用入出力端子105のうちのCPU−A102の出力端子を指し、CPU−B出力端子505は、図1の汎用入出力端子106のうちのCPU−B103の出力端子を指す。   FIG. 5 shows a system in which two processors of CPU-A 102 and CPU-B 103 can serve as a master. At timing 305 or 405 (FIGS. 3 and 4) at which communication is started, CPU-A 102 and CPU-B 103 are simultaneously shared memory. An example in which priority is given to the CPU-A 102 when an access request is issued to 101 is shown. The CPU-A output terminal 504 indicates the output terminal of the CPU-A 102 in the general-purpose input / output terminal 105 in FIG. 1, and the CPU-B output terminal 505 indicates the CPU in the general-purpose input / output terminal 106 in FIG. -Refers to the output terminal of B103.

まず、図5(a)の場合、制御区間501において、CPU−B103がバスアクセスを行なう際に、CPU−A出力端子504がノン・アクティブであることを確認した後、CPU−B出力端子505をアクティブに設定する。   First, in the case of FIG. 5A, when the CPU-B 103 performs bus access in the control section 501, after confirming that the CPU-A output terminal 504 is non-active, the CPU-B output terminal 505 Set to active.

制御区間502において、十分なウェイトを行なう。   In the control section 502, a sufficient wait is performed.

制御区間503において、ウェイトを完了した後に、再びCPU−B103は、CPU−A出力端子504を参照し、このときにCPU−A出力端子504がアクティブになっている場合、CPU−A102がほぼ同時にバスアクセスを開始したと判断し、CPU−B103はCPU−B出力端子505をノン・アクティブに設定し通信を中止する。   In the control section 503, after completing the wait, the CPU-B 103 again refers to the CPU-A output terminal 504. If the CPU-A output terminal 504 is active at this time, the CPU-A 102 is almost at the same time. The CPU-B 103 determines that the bus access has started, sets the CPU-B output terminal 505 to non-active, and stops communication.

CPU−A出力端子504がノン・アクティブであった場合は、CPU−B103がそのまま共有メモリへのアクセスを開始する。   When the CPU-A output terminal 504 is non-active, the CPU-B 103 starts accessing the shared memory as it is.

制御区間502におけるCPU−B103がウェイトする必要のある時間(TW)は、CPU−B103がCPU−B出力端子505をアクティブに設定してからCPU−A102がそれを認識できるまでの時間(Td1)、CPU−A102がCPU−A出力端子504をアクティブに設定してからCPU−B103がそれを認識できるまでの時間(Td2)から、
TW Td1 Td2 α・・・・ 式(1)
と示すことができる。
The time (T W ) that the CPU-B 103 needs to wait in the control section 502 is the time from when the CPU-B 103 sets the CPU-B output terminal 505 active until the CPU-A 102 can recognize it (T T). d1 ), from the time (T d2 ) from when the CPU-A 102 sets the CPU-A output terminal 504 to active until the CPU-B 103 can recognize it,
T W = T d1 + T d2 + α ··· Formula (1)
Can be shown.

なお、αは、波形のなまりなどを考慮した場合の猶予時間であり、あらかじめ考慮しておくことが望ましい。   In addition, α is a grace time when considering the rounding of the waveform, and it is desirable to consider in advance.

なお、図5(b)に示すように、CPU−A102が先にCPU−A出力端子504をアクティブに設定する場合も同様である。   As shown in FIG. 5B, the same applies when the CPU-A 102 first sets the CPU-A output terminal 504 to active.

次に、実施の形態2において、CPU−A102およびCPU−B103が同時に共有メモリ101にアクセス要求を出した場合に、CPU−A102側を優先とする一例について、CPU−A102、CPU−B103の制御方法を、図6ないしは、図7を用いて説明する。図6は本発明の実施の形態2に係るCPU−A(高優先度側)とCPU−B(低優先度側)それぞれの制御のフローチャートである。図7は、図6における制御フローチャートにもとづく、タイミングチャートである。   Next, in the second embodiment, when the CPU-A 102 and the CPU-B 103 issue an access request to the shared memory 101 at the same time, the CPU-A 102 and the CPU-B 103 are controlled with respect to an example in which the CPU-A 102 side is given priority. The method will be described with reference to FIGS. FIG. 6 is a flowchart of control of each of CPU-A (high priority side) and CPU-B (low priority side) according to Embodiment 2 of the present invention. FIG. 7 is a timing chart based on the control flowchart in FIG.

CPU−A102かつ、CPU−B103の通信開始条件が整い、通信開始タイミング1005において、図6に示す制御区間1001の送信処理が実行される。図6において、CPU−B103は、前述の式(1)で表されるCPU−B103がウェイトする必要のある時間(Tw)を待った後、CPU−A出力端子504がアクティブであることを検出すると、CPU−B出力端子505をノン・アクティブに設定して処理を終了する。   The communication start conditions of the CPU-A 102 and the CPU-B 103 are set, and the transmission processing of the control section 1001 shown in FIG. 6 is executed at the communication start timing 1005. In FIG. 6, the CPU-B 103 detects that the CPU-A output terminal 504 is active after waiting for a time (Tw) that the CPU-B 103 represented by the above formula (1) needs to wait. Then, the CPU-B output terminal 505 is set to non-active and the process is terminated.

なお、CPU−A102がCPU−B出力端子505の入力に割込み端子を使用する場合、本例においてCPU−B103がアクティブであったCPU−B出力端子505をノン・アクティブに設定し通信を中止するタイミングで、CPU−A102が割り込みを検知するが、CPU−A102がCPU−A出力端子504をアクティブに設定している間の状態(CPU−A:CMD_SETモード)であることをCPU−A102の割り込みハンドラなどで判定することによって、CPU−A102はダミー割り込みとして処理することができる。   When the CPU-A 102 uses an interrupt terminal for input to the CPU-B output terminal 505, the CPU-B output terminal 505 in which the CPU-B 103 is active in this example is set to non-active and communication is stopped. The CPU-A 102 detects the interrupt at the timing, but the CPU-A 102 indicates that the CPU-A 102 is in a state (CPU-A: CMD_SET mode) while the CPU-A output terminal 504 is set to active. By determining with a handler or the like, the CPU-A 102 can process it as a dummy interrupt.

CPU−A102は、コマンド設定処理などを完了すると、WAITモードへ遷移した後にCPU−A出力端子504をノン・アクティブに設定する。次に図6に示す制御区間1002の処理が実行される。制御区間1002に示されるCPU−B103のコマンド参照状態(CMD_GETモード)以後、図3を用いた本発明の実施の形態1に係るデータ転送方法のCPU−A102からCPU−B103へデータを転送する場合の一例で説明した処理ステップと同じ処理を行う。   When completing the command setting process and the like, the CPU-A 102 sets the CPU-A output terminal 504 to non-active after transitioning to the WAIT mode. Next, the process of the control section 1002 shown in FIG. 6 is executed. When data is transferred from the CPU-A 102 to the CPU-B 103 in the data transfer method according to the first embodiment of the present invention using FIG. 3 after the command reference state (CMD_GET mode) of the CPU-B 103 indicated in the control section 1002 The same processing as that described in the example is performed.

(実施の形態3)
次に、本発明の実施の形態3について説明する。図8は本発明の実施の形態3に係るデータ転送方法の構成を示すブロック図である。実施の形態3に係るデータ転送方法は、共有メモリ601、複数のプロセッサ602〜607、各々のプロセッサ間を直列に接続する汎用入出力端子608〜617、アドレスおよびデータバス618、を有して構成される。
(Embodiment 3)
Next, a third embodiment of the present invention will be described. FIG. 8 is a block diagram showing the configuration of the data transfer method according to the third embodiment of the present invention. The data transfer method according to the third embodiment includes a shared memory 601, a plurality of processors 602 to 607, general-purpose input / output terminals 608 to 617 that connect the processors in series, and an address and data bus 618. Is done.

図9は、本発明の実施の形態3に係るデータ転送方法の共有メモリマッピングの一例を示す共有メモリのメモリマップ図である。   FIG. 9 is a memory map diagram of the shared memory showing an example of the shared memory mapping of the data transfer method according to the third embodiment of the present invention.

実施の形態3に係るデータ転送方法の共有メモリマッピングの一例は、図2に示す例に加え、コマンド発行CPU ID領域701、コマンド送信先CPU ID領域702を有して構成される。   An example of shared memory mapping of the data transfer method according to the third embodiment includes a command issue CPU ID area 701 and a command transmission destination CPU ID area 702 in addition to the example shown in FIG.

コマンド発行CPU ID領域701は、送受信コマンド領域201に読み込みもしくは、書き込みを行なうかというコマンドを設定するプロセッサのCPU IDである。   The command issuing CPU ID area 701 is a CPU ID of a processor that sets a command for reading or writing to the transmission / reception command area 201.

コマンド送信先CPU ID領域702は、コマンドの受け手側となるプロセッサを指定するためのCPU IDである。   The command transmission destination CPU ID area 702 is a CPU ID for designating a processor on the command receiver side.

次に、図10を用いて詳細にデータ転送手順を説明する。   Next, the data transfer procedure will be described in detail with reference to FIG.

図10は、本発明の実施の形態3に係るデータ転送方法のCPU−C604からCPU−E606へデータを転送する場合を一例とした場合の制御フローチャートである。   FIG. 10 is a control flowchart in a case where data is transferred from the CPU-C 604 to the CPU-E 606 in the data transfer method according to the third embodiment of the present invention.

CPU−C604からみて、CPU−B603、CPU−A602の方向へ順に、上位方向、CPU−C604からみて、CPU−D605、CPU−E606の方向へ順に、下位方向、と呼ぶこととし、コマンドを発行するプロセッサは、コマンド発行先のプロセッサが、自身に比べて上位もしくは下位に順位することをあらかじめ解っているものとする。   From the CPU-C 604, the CPU-B 603 and the CPU-A 602 are sequentially called the upper direction, and from the CPU-C 604, the CPU-D 605 and the CPU-E 606 are called the lower direction, and the command is issued. Assume that the processor to which the command is issued knows in advance that the processor to which the command is issued ranks higher or lower than itself.

まず、CPU−C604は、汎用出力端子610、614をアクティブに設定し、共有メモリへアクセス中であることを他のプロセッサ(CPU−B603、CPU−D605)へ通知する。CPU−B603、CPU−D605は汎用端子がアクティブに設定されたことを受けて、共有メモリへアクセス中であることをそれぞれ他のプロセッサ(CPU−A602、CPU−E606)へ同様にして通知する。接続される全てのプロセッサに通知が渡るよう同様に通知制御を行なう。   First, the CPU-C 604 sets the general-purpose output terminals 610 and 614 to be active, and notifies the other processors (CPU-B 603 and CPU-D 605) that the shared memory is being accessed. In response to the fact that the general-purpose terminal is set to active, the CPU-B 603 and CPU-D 605 respectively notify the other processors (CPU-A 602 and CPU-E 606) that the shared memory is being accessed. Notification control is performed in the same manner so that notifications are passed to all connected processors.

CPU−C604は、CPU−E606へ送信するデータをコマンド発行側CPUデータ書き込み領域703へ設定するとともに、CPU−E606に対してデータを受信するように、送受信コマンド領域201へ受信要求コマンドを、コマンド発行CPU ID領域701にCPU−C604であることを示すことのできるIDを、コマンド送信先CPU ID領域702にCPU−E606であることを示すことのできるIDを、設定し、汎用出力端子610をノン・アクティブに設定して完了する。   The CPU-C 604 sets the data to be transmitted to the CPU-E 606 in the command issuing side CPU data writing area 703 and sends a reception request command to the transmission / reception command area 201 so that the CPU-E 606 receives the data. An ID that can indicate the CPU-C604 is set in the issuing CPU ID area 701, and an ID that can indicate the CPU-E606 is set in the command transmission destination CPU ID area 702, and the general-purpose output terminal 610 is set. Set to non-active and complete.

CPU−D605は、汎用出力端子610がアクティブからノン・アクティブに変化したことを検出すると、コマンド送信先CPU ID領域702に設定されたIDを参照して自分宛の通知でないことを判断し、汎用出力端子611をノン・アクティブに設定して完了する。   When detecting that the general-purpose output terminal 610 has changed from active to non-active, the CPU-D 605 refers to the ID set in the command transmission destination CPU ID area 702 and determines that the notification is not addressed to itself. The setting is completed by setting the output terminal 611 to non-active.

CPU−E606は、汎用出力端子611がアクティブからノン・アクティブに変化したことを検出すると、コマンド送信先CPU ID領域702に設定されたIDを参照して自分宛の通知であることを判断し、汎用出力端子616をアクティブに設定し、送受信コマンド領域201に設定されたコマンドを参照して受信要求コマンドであることを確認する。CPU−E606はコマンド発行側CPUデータ書き込み領域703へ設定されたデータを取り込み、処理を完了すると転送ステータス状態領域202へ読み込み完了を設定する。   When detecting that the general-purpose output terminal 611 has changed from active to non-active, the CPU-E 606 refers to the ID set in the command transmission destination CPU ID area 702 and determines that the notification is addressed to itself. The general-purpose output terminal 616 is set to active, and the command set in the transmission / reception command area 201 is referenced to confirm that it is a reception request command. The CPU-E 606 fetches the set data into the command issuing side CPU data writing area 703 and sets the reading completion to the transfer status state area 202 when the processing is completed.

CPU−E606は汎用出力端子616をノン・アクティブに設定して完了する。   The CPU-E 606 sets the general-purpose output terminal 616 to non-active and completes.

CPU−D605は、汎用出力端子615がアクティブからノン・アクティブに変化したことを検出すると、コマンド送信先CPU ID領域702に設定されたIDを参照して自分宛の通知でないことを判断し、汎用出力端子615をノン・アクティブに設定して完了する。   When the CPU-D 605 detects that the general-purpose output terminal 615 has changed from active to non-active, the CPU-D 605 determines that the notification is not addressed to itself by referring to the ID set in the command transmission destination CPU ID area 702. The setting is completed by setting the output terminal 615 to non-active.

CPU−C604は、汎用出力端子615がアクティブからノン・アクティブに変化したことを検出すると、汎用出力端子610をアクティブに設定し、転送ステータス状態領域202に設定されたステータス状態を参照して読み込み完了であることを確認する。CPU−C604は、送受信コマンド領域201へ設定されている受信要求コマンドを破棄し、コマンド発行CPU ID領域701に設定されているCPU−C604であることを示すことのできるIDと、コマンド送信先CPU ID領域702に設定されているCPU−E606であることを示すことのできるIDとを破棄し、汎用出力端子610、614をノン・アクティブに設定して完了する。   When the CPU-C 604 detects that the general-purpose output terminal 615 has changed from active to non-active, the CPU-C 604 sets the general-purpose output terminal 610 to active and completes reading with reference to the status state set in the transfer status state area 202 Make sure that The CPU-C 604 discards the reception request command set in the transmission / reception command area 201 and indicates the CPU-C 604 set in the command issue CPU ID area 701 and the command transmission destination CPU. The ID that can indicate the CPU-E 606 set in the ID area 702 is discarded, and the general-purpose output terminals 610 and 614 are set to non-active to complete the process.

CPU−B603、CPU−D605は、汎用端子614、610がノン・アクティブに設定されたことを受けて、実施の形態1と同様の手順で送受信コマンド領域201に設定されたコマンドを参照する。もしくは、コマンド送信先CPU ID領域702に設定されたIDを参照してもよい。コマンドもしくは、送信先IDが設定されていないことを確認すると、順次、汎用出力端子をノン・アクティブに設定して完了する。接続される全てのプロセッサに通知が渡るよう同様に通知制御を行なう。   The CPU-B 603 and CPU-D 605 refer to the command set in the transmission / reception command area 201 in the same procedure as in the first embodiment in response to the general-purpose terminals 614 and 610 being set to non-active. Alternatively, an ID set in the command transmission destination CPU ID area 702 may be referred to. If it is confirmed that the command or the transmission destination ID is not set, the general-purpose output terminal is sequentially set to non-active and the process is completed. Notification control is performed in the same manner so that notifications are passed to all connected processors.

以上に説明した方式によって、直列に接続された複数のプロセッサのうち、任意の2つのプロセッサ間において、データの転送が可能である。   With the method described above, data can be transferred between any two processors among a plurality of processors connected in series.

本発明にかかるマルチプロセッサシステムにおけるデータ転送方法は、複雑なハードウェアで構成されたメモリアクセスの調停手段が不要であり、小規模で容易なソフトウェア制御が可能であることから、調停手段を持たない汎用マイコンでも安定した且つ、効率的なデータ転送が可能となり、汎用マイコンを用いたマルチプロセッサシステム等に有用である。   The data transfer method in the multiprocessor system according to the present invention does not require a memory access arbitration unit composed of complex hardware, and does not have an arbitration unit because small-scale and easy software control is possible. Stable and efficient data transfer is possible even with a general-purpose microcomputer, which is useful for a multiprocessor system using a general-purpose microcomputer.

本発明の実施の形態1に係るデータ転送方法の構成を示すブロック図The block diagram which shows the structure of the data transfer method which concerns on Embodiment 1 of this invention. 本発明の実施の形態1に係るデータ転送方法の共有メモリマッピングの一例を示す共有メモリのメモリマップ図The memory map figure of a shared memory which shows an example of the shared memory mapping of the data transfer method which concerns on Embodiment 1 of this invention 本発明のCPU−Aをマスタとした場合の一例のマスタ送信タイミングチャートMaster transmission timing chart of an example when CPU-A of the present invention is a master 本発明のCPU−Aをマスタとした場合の一例のマスタ受信タイミングチャートMaster reception timing chart of an example when CPU-A of the present invention is used as a master 本発明の実施の形態2に係るデータ転送方法のタイミングチャートTiming chart of data transfer method according to embodiment 2 of the present invention 本発明の実施の形態2に係るデータ転送方法の制御フローチャートControl flow chart of data transfer method according to embodiment 2 of the present invention 本発明の実施の形態2に係るデータ転送方法の制御タイミングチャートControl timing chart of data transfer method according to embodiment 2 of the present invention 本発明の実施の形態3に係るデータ転送方法の構成を示すブロック図The block diagram which shows the structure of the data transfer method which concerns on Embodiment 3 of this invention. 本発明の実施の形態3に係るデータ転送方法の共有メモリマッピングの一例を示す共有メモリのメモリマップ図The memory map figure of the shared memory which shows an example of the shared memory mapping of the data transfer method concerning Embodiment 3 of this invention 本発明の実施の形態3に係るデータ転送方法のCPU−Cをマスタ、CPU−Eをスレーブとした場合を一例とした制御フローチャートControl flow chart illustrating an example in which CPU-C is a master and CPU-E is a slave in the data transfer method according to the third embodiment of the present invention.

符号の説明Explanation of symbols

101、601 共有メモリ
102、103、602〜607 プロセッサ(CPU−AからCPU−F)
104、618 アドレスおよびデータバス
105、106、608〜617 汎用入出力端子
201 送受信コマンド領域
202 転送ステータス状態領域
203、703 コマンド発行側CPU データ書き込み領域
204、704 コマンド送信先CPU データ書き込み領域
205 データ先頭アドレス
206 送受信データサイズ
305、405、1005 通信開始タイミング
504 CPU−A出力端子
505 CPU−B出力端子
701 コマンド発行CPU ID領域
702 コマンド送信先CPU ID領域
1001、1002、1003、1004 制御区間
901、902、903、904 割込みエッジ
101, 601 Shared memory 102, 103, 602-607 Processor (CPU-A to CPU-F)
104, 618 Address and data bus 105, 106, 608 to 617 General-purpose input / output terminals 201 Transmission / reception command area 202 Transfer status status area 203, 703 Command issuing side CPU data writing area 204, 704 Command transmission destination CPU data writing area 205 Data head Address 206 Transmission / reception data size 305, 405, 1005 Communication start timing 504 CPU-A output terminal 505 CPU-B output terminal 701 Command issuing CPU ID area 702 Command transmission destination CPU ID area 1001, 1002, 1003, 1004 Control section 901, 902 , 903, 904 Interrupt edge

Claims (6)

共有メモリを介して第1および第2のプロセッサ間でデータを転送するマルチプロセッサシステムにおけるデータ転送方法であって、
前記第1のプロセッサは、前記データの転送のために前記共有メモリにアクセスしている間、第1のメモリアクセス禁止信号を前記第2のプロセッサへ出力し、前記第2のプロセッサは、前記第1のメモリアクセス禁止信号を入力している間、前記共有メモリへのアクセスを禁止するようにし、
前記第2のプロセッサは、前記データの転送のために前記共有メモリにアクセスしている間、第2のメモリアクセス禁止信号を前記第1のプロセッサへ出力し、前記第1のプロセッサは、前記第2のメモリアクセス禁止信号を入力している間、前記共有メモリへのアクセスを禁止するようにしたことを特徴とするマルチプロセッサシステムにおけるデータ転送方法。
A data transfer method in a multiprocessor system for transferring data between a first processor and a second processor via a shared memory,
While the first processor is accessing the shared memory for transferring the data, the first processor outputs a first memory access prohibition signal to the second processor, and the second processor While the memory access prohibition signal of 1 is being input, access to the shared memory is prohibited,
The second processor outputs a second memory access prohibition signal to the first processor while accessing the shared memory for the data transfer, and the first processor 2. A data transfer method in a multiprocessor system, wherein access to the shared memory is prohibited while two memory access prohibition signals are input.
前記第1および第2のプロセッサの各々は、
データ送信側のプロセッサになる場合、実際に転送すべきデータを含む転送用データを前記共有メモリに書き込むとともに、前記転送用データのうち前記実際に転送すべきデータを指定するための転送データ指定情報を前記共有メモリに格納し、
データ受信側のプロセッサになる場合、前記共有メモリに格納された前記転送データ指定情報に基づいて前記共有メモリから前記実際に転送すべきデータを読み出すことを特徴とする請求項1記載のマルチプロセッサシステムにおけるデータ転送方法。
Each of the first and second processors includes:
When becoming a processor on the data transmission side, transfer data specifying data for writing the transfer data including the data to be actually transferred to the shared memory and specifying the data to be actually transferred among the transfer data Is stored in the shared memory,
2. The multiprocessor system according to claim 1, wherein when the processor is a data receiving side processor, the data to be actually transferred is read from the shared memory based on the transfer data designation information stored in the shared memory. Data transfer method.
前記第1のプロセッサの汎用出力端子と前記第2のプロセッサの汎用入力端子とを接続し、前記第1のメモリアクセス禁止信号は前記第1のプロセッサの汎用出力端子から出力されて前記第2のプロセッサの汎用入力端子へ入力され、
前記第2のプロセッサの汎用出力端子と前記第1のプロセッサの汎用入力端子とを接続し、前記第2のメモリアクセス禁止信号は前記第2のプロセッサの汎用出力端子から出力されて前記第1のプロセッサの汎用入力端子へ入力されることを特徴とする請求項1記載のマルチプロセッサシステムにおけるデータ転送方法。
The general-purpose output terminal of the first processor is connected to the general-purpose input terminal of the second processor, and the first memory access prohibition signal is output from the general-purpose output terminal of the first processor and the second processor Input to the general-purpose input terminal of the processor,
The general-purpose output terminal of the second processor is connected to the general-purpose input terminal of the first processor, and the second memory access prohibition signal is output from the general-purpose output terminal of the second processor and the first processor 2. The data transfer method in a multiprocessor system according to claim 1, wherein the data is input to a general-purpose input terminal of the processor.
前記第1のメモリアクセス禁止信号が入力される前記第2のプロセッサの汎用入力端子、および前記第2のメモリアクセス禁止信号が入力される前記第1のプロセッサの汎用入力端子の少なくとも一方が割込み入力端子であることを特徴とする請求項3記載のマルチプロセッサシステムにおけるデータ転送方法。   At least one of the general-purpose input terminal of the second processor to which the first memory access prohibition signal is input and the general-purpose input terminal of the first processor to which the second memory access prohibition signal is input is an interrupt input. 4. The data transfer method in a multiprocessor system according to claim 3, wherein the data transfer method is a terminal. 前記第1および第2のプロセッサのいずれか一方のプロセッサは、前記共有メモリにアクセスする直前にメモリアクセス禁止信号の他方のプロセッサへの出力を開始し、その出力を開始してから所定時間内に前記他方のプロセッサからのメモリアクセス禁止信号を入力した場合、前記他方のプロセッサへのメモリアクセス禁止信号の出力を停止するとともに前記共有メモリへのアクセスを中止することを特徴とする請求項3または4記載のマルチプロセッサシステムにおけるデータ転送方法。   Either one of the first and second processors starts outputting the memory access prohibition signal to the other processor immediately before accessing the shared memory, and within a predetermined time after starting the output. 5. The memory access prohibiting signal from the other processor is input, and the output of the memory access prohibiting signal to the other processor is stopped and the access to the shared memory is stopped. A data transfer method in the described multiprocessor system. 前記第1および第2のプロセッサは、前記共有メモリを共有し直列接続された3つ以上のプロセッサのうちの任意の2つのプロセッサであり、
前記第1のプロセッサの指示によって前記第1および第2のプロセッサ間でデータ転送を行う場合、
前記第1のプロセッサから出力される第1のメモリアクセス禁止信号は、プロセッサ間の接続によって前記第1のプロセッサ以外の全てのプロセッサへ入力され、前記第1のメモリアクセス禁止信号を入力しているプロセッサは、前記共有メモリへのアクセスを禁止するようにし、
前記第2のプロセッサから出力される第2のメモリアクセス禁止信号は、プロセッサ間の接続によって前記第2のプロセッサと前記第1のプロセッサとの間に接続されたプロセッサおよび前記第1のプロセッサへ入力され、前記第2のメモリアクセス禁止信号を入力しているプロセッサは、前記共有メモリへのアクセスを禁止するようにし、
前記第2のメモリアクセス禁止信号は、前記第2のプロセッサと前記第1のプロセッサとの間に接続されたプロセッサおよび前記第2のプロセッサへの前記第1のメモリアクセス禁止信号が解除されているときに前記第2のプロセッサから出力されることを特徴とする請求項1から5のいずれかに記載のマルチプロセッサシステムにおけるデータ転送方法。
The first and second processors are any two of the three or more processors that share the shared memory and are connected in series;
When performing data transfer between the first and second processors according to an instruction of the first processor,
The first memory access prohibition signal output from the first processor is input to all processors other than the first processor by connection between the processors, and the first memory access prohibition signal is input. The processor prohibits access to the shared memory;
The second memory access prohibition signal output from the second processor is input to the processor connected between the second processor and the first processor by connection between the processors and the first processor. And the processor receiving the second memory access prohibition signal prohibits access to the shared memory,
The second memory access prohibition signal is released from the first memory access prohibition signal to the processor connected between the second processor and the first processor and the second processor. 6. The data transfer method in the multiprocessor system according to claim 1, wherein the data is output from the second processor.
JP2004169805A 2004-06-08 2004-06-08 Data transfer method in multiprocessor system Pending JP2005352559A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004169805A JP2005352559A (en) 2004-06-08 2004-06-08 Data transfer method in multiprocessor system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004169805A JP2005352559A (en) 2004-06-08 2004-06-08 Data transfer method in multiprocessor system

Publications (1)

Publication Number Publication Date
JP2005352559A true JP2005352559A (en) 2005-12-22

Family

ID=35587021

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004169805A Pending JP2005352559A (en) 2004-06-08 2004-06-08 Data transfer method in multiprocessor system

Country Status (1)

Country Link
JP (1) JP2005352559A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9524266B2 (en) 2010-12-08 2016-12-20 Samsung Electronics Co., Ltd. Latency management system and method for multiprocessor system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9524266B2 (en) 2010-12-08 2016-12-20 Samsung Electronics Co., Ltd. Latency management system and method for multiprocessor system

Similar Documents

Publication Publication Date Title
JP3807250B2 (en) Cluster system, computer and program
KR100644596B1 (en) Bus system and bus arbitration method thereof
JPS62206658A (en) Memory controller
JP4874165B2 (en) Multiprocessor system and access right setting method in multiprocessor system
US5566345A (en) SCSI bus capacity expansion controller using gating circuits to arbitrate DMA requests from a plurality of disk drives
JP2008009817A (en) Semiconductor device and data transfer method
JP4642531B2 (en) Arbitration of data requests
JPS621057A (en) Transfer controller
US20080052429A1 (en) Off-board computational resources
JP2004133942A (en) Data bus system and inter-bus crossing accessing method
US7254667B2 (en) Data transfer between an external data source and a memory associated with a data processor
JPS63175962A (en) Direct memory access controller
US20080126472A1 (en) Computer communication
JP2005352559A (en) Data transfer method in multiprocessor system
JPH10307788A (en) Bus bridge
US6505276B1 (en) Processing-function-provided packet-type memory system and method for controlling the same
JPH11252150A (en) Network connection device and network connection control method
JP2006092077A (en) Bus system
JP2000155738A (en) Data processor
JPH03132857A (en) Inter-cpu data transfer circuit
JPH05250250A (en) Access control method for dual port ram
JPS5834858B2 (en) Data exchange control method
JPS61248153A (en) Memory access controlling system in multiprocessor system
JPH11316736A (en) Processor and data processor using the same
JP3219422B2 (en) Cache memory control method

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Effective date: 20060621

Free format text: JAPANESE INTERMEDIATE CODE: A7424