JP3868316B2 - Multiprocessor and control method thereof - Google Patents

Multiprocessor and control method thereof Download PDF

Info

Publication number
JP3868316B2
JP3868316B2 JP2002072563A JP2002072563A JP3868316B2 JP 3868316 B2 JP3868316 B2 JP 3868316B2 JP 2002072563 A JP2002072563 A JP 2002072563A JP 2002072563 A JP2002072563 A JP 2002072563A JP 3868316 B2 JP3868316 B2 JP 3868316B2
Authority
JP
Japan
Prior art keywords
memory
processor core
signal
flag signal
multiprocessor
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.)
Expired - Fee Related
Application number
JP2002072563A
Other languages
Japanese (ja)
Other versions
JP2003271573A (en
Inventor
信一 丸井
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 Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
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 Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP2002072563A priority Critical patent/JP3868316B2/en
Publication of JP2003271573A publication Critical patent/JP2003271573A/en
Application granted granted Critical
Publication of JP3868316B2 publication Critical patent/JP3868316B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、1チップ上に複数のプロセッサコアと、前記プロセッサコアからアクセス可能な共有メモリとからなるマルチプロセッサ、マルチプロセッサコア及びその制御方法に関する技術分野に属する。
【0002】
【従来の技術】
近年、プロセスの微細化が進んでいること及びLSIへの更なる高性能化の要求から、1チップ上に複数のプロセッサコアが搭載されたマルチプロセッサが多く開発されるようになっている。また、コストの面からも、従来複数のチップで構成していたシステムを1チップ上で実現できるマルチプロセッサが脚光を浴びている。
【0003】
このようなマルチプロセッサにおいて、それぞれのプロセッサが独立に動作できる場合は容易に最高性能を達成することが可能であるが、1チップ上のプロセッサコア間でデータのやり取りが必要な場合、一旦チップ外にデータを送出し、それを他方のプロセッサコアで受け取ろうとすると、同じ1チップ上に搭載されている効果が出せないことになる。すなわち、データの授受に関して従来の別チップ構成の場合と同等になってしまうからである。
【0004】
そこで、従来、例えば特開平7−105146号又は特開平5−210640号の各公報に示されるように、1チップ上に複数のプロセッサコアからアクセス可能な共有メモリを設けることで前記問題を解決することが提案されている。すなわち、あるプロセッサコアで作成されたデータを共有メモリに格納し、その後にこのデータを必要とするプロセッサコアが共有メモリにアクセスする。このようにすれば、一般に内蔵されるメモリは高速であるから、データ授受に関して従来に比べ飛躍的に転送効率を向上させることができる。
【0005】
【発明が解決しようとする課題】
しかし、前記従来のものでは、互いに独立に動くプロセッサコアからのアクセス要求を適切に行なうには、調停回路が別途必要とされ、又は複数のアクセスが許されるデュアルポートメモリを共有メモリとして使用する必要があるという問題があった。
【0006】
また、デュアルポートメモリ又は複雑な競合を回避する調停回路は大規模になりがちで、プロセッサコア間でのデータ授受が完全にランダムに発生する場合以外は却ってオーバースペックになっていると言う問題があった。
【0007】
さらに、既に開発しているプロセッサコアを複数搭載するという一般的な開発手法では、新たに調停回路等の設計追加が必須であり、設計期間が長くなるというがあった。
【0008】
本発明は斯かる諸点に鑑みてなされたものであり、従来のプロセッサコアをほぼそのまま用い、簡易な構成であるにも関わらず、共有メモリでの競合を生じないマルチプロセッサを提供することを目的とする。
【0009】
【課題を解決するための手段】
前記の目的を達成するために、請求項1の発明では、1チップ上に複数のプロセッサコアと、前記プロセッサコアからアクセス可能な共有メモリとを持つマルチプロセッサにおいて、プログラムによりライト可能なメモリ選択フラグ信号を格納する記憶手段と、前記記憶手段からのメモリ選択フラグ信号と外部フラグ信号とを切り替え出力する切り替え手段と、前記記憶手段をプログラムによりリードした場合に前記切り換え手段の出力をデータバスに送出する制御付きドライバと、前記切り替え手段の出力とメモリアクセスアドレスとを入力として外部へメモリアクセス信号を出力するメモリ制御部とを有し、前記データバスに接続され、前記外部フラグ信号と、前記切り替え手段を制御する選択信号とを外部から受け取る複数のプロセッサコアと、複数のメモリアクセス信号を入力し、前記メモリアクセス信号に関連して複数の前記データバスで接続される共有メモリとを備える。
【0010】
前記の構成によると、リセット直後は、プロセッサコア内のメモリ制御回路は共有メモリに対し、メモリアクセス信号を同時にはアクティブ状態にすることはなく、競合を避けることができる。従って、複数のプロセッサコアをチップ上で接続する際に、簡易に共有メモリへの排他制御を実現することができ、かつ各プロセッサコアは共有メモリへのアクセスが許可されているかどうかを内部プログラムで容易に知ることができる。
【0011】
請求項2の発明では、1チップ上に複数設けられ、共通メモリにアクセス可能なプロセッサコアであって、プログラムによりライト可能なメモリ選択フラグ信号を格納する記憶手段と、前記記憶手段からのメモリ選択フラグ信号と外部フラグ信号とを切り替え出力する切り替え手段と、前記記憶手段をプログラムによりリードした場合に前記切り換え手段の出力をデータバスに送出する制御付きドライバと、前記切り替え手段の出力とメモリアクセスアドレスとを入力として外部へメモリアクセス信号を出力するメモリ制御部とを有し、前記データバスに接続されて前記外部フラグ信号と、前記切り替え手段を制御する選択信号とを外部から受け取る一方、前記メモリ選択フラグ信号をプログラムによりリードした場合、前記メモリ選択フラグ信号を前記データバスに送出するようにする。
【0012】
前記の構成によると、プロセッサコアは1チップ上で複数接続される際に、簡易に共有メモリへの排他制御を実現することができ、かつ共有メモリへのアクセスが許可されているかどうかを内部プログラムで容易に知ることができる。
【0013】
請求項3の発明では、請求項2のマルチプロセッサコアを用いるマルチプロセッサであって、第1のプロセッサコアと第2のプロセッサコアとを搭載し、前記第1のプロセッサコアの選択信号を固定し、前記第1のプロセッサコアの切り替え手段出力信号を論理反転して前記第2のプロセッサコアの外部フラグ信号として印加し、前記第1のプロセッサコアのメモリアクセス信号を前記共有メモリに接続し、前記第1のプロセッサコアのデータバスを前記共有メモリに接続し、前記第1のプロセッサコアの外部フラグ信号を固定し、前記第2のプロセッサコアの選択信号を、前記第1のプロセッサコアの選択信号を論理反転した値で固定し、前記第2のプロセッサコアの切り替え手段出力信号をオープンとし、前記第2のプロセッサコアのメモリアクセス信号を前記共有メモリに接続し、前記第2のプロセッサコアのデータバスを前記共有メモリに接続するように構成する。
【0014】
前記の構成によると、リセット直後は、第2プロセッサコアから共有メモリにアクセスできる状態になっており、選択信号をリードすることで、プログラムによりマスタ側として動作しているか、又はスレーブ側として動作しているか判断することが可能である。また、通常動作時では、第1プロセッサコア側で共有メモリにアクセスする必要がある場合、データバスを通じて、メモリ制御回路をアクティブにする。同時に、第2プロセッサコア側では、メモリ制御回路はディスエーブルされる。従って、共有メモリは第1プロセッサコア側に接続されることになり、競合を避けることができる。また、内部レジスタをリードすることで、選択信号の値を知ることができ、さらにそれらがマスタ側なのか、又はスレーブ側なのかを知ることができる。同様に、内部レジスタをリードすることで、マルチプロセッサコアが自身で設定した又は他方の影響からのものかのいずれにしても、共有メモリにアクセスできるか否かを知ることが可能である。従って、わずかの論理回路を考慮することで、本発明の作用効果が有効に得られる好適なマルチプロセッサが得られる。
【0015】
請求項4の発明のマルチプロセッサ制御方法では、請求項3のマルチプロセッサを用いて、第1及び第2のプロセッサコアに同時に割り込みをかけ、前記共有メモリにアクセス権を持たないプロセッサコア側は割り込みルーチン中で前記共有メモリに対するアクセスを禁止し、他方のプロセッサコア側で記憶手段をプログラムにより切り替えることで前記共有メモリの接続先を変更するステップを含むようにする。また、請求項5の発明のマルチプロセッサ制御方法では、請求項3のマルチプロセッサを用いて、マルチプロセッサ上のプロセッサコアでメモリ選択フラグ信号を切り替え手段の出力とする方をマスタ側とし、前記マスタ側プロセッサコアで前記共有メモリをアクセスしようとするときのみ、プログラムによりメモリ選択フラグ信号を更新して前記共有メモリへのアクセスを制御するステップを含むようにする。
【0016】
前記の構成によると、第2プロセッサコアが共有メモリをアクセスしている最中に、第1プロセッサコアが記憶手段を書き換えて、共有メモリが第1プロセッサコア側に属しようとするのを避けることができる。
【0017】
【発明の実施の形態】
以下、本発明の実施形態を図面に基づいて説明する。図1は本発明の実施形態に係るマルチプロセッサ1の全体構成を示し、このマルチプロセッサ1中には1チップ上に全く同一の第1プロセッサコア100と第2プロセッサコア200とが設けられている。
【0018】
前記プロセッサコア100,200はそれぞれのデータバス110,210により、共有メモリ300に接続されている。尚、図示しないが、この他に実際にはアクセスアドレスや制御信号がそれぞれのプロセッサコア100,200から出力されている。
【0019】
前記共有メモリ300は、第1プロセッサコア100から来るメモリアクセス信号120がアクティブ(="1")の時に、前記データバス110を通じて第1プロセッサコア100とデータ転送を行なう。同様に、この共有メモリ300は、第2プロセッサコア200から来るメモリアクセス信号220がアクティブ(="1")の時に、データバス210を通じて第2プロセッサコア200とデータ転送を行なう。
【0020】
前記プロセッサコア100,200内の記憶回路130,230は、それぞれのプロセッサコア100,200内のプログラムによりライト可能なメモリ選択フラグ信号170,270を格納する記憶手段で、このメモリ選択フラグ信号170,270が"1"のとき、それぞれ共有メモリ300を選択する。
【0021】
前記プロセッサコア100,200内の切り替え手段140,240は、前記記憶回路130,230のメモリ選択フラグ信号170,270信号と、外部から入力される外部フラグ信号150,250とを切り換え出力する。そして、外部から前記切り替え手段140,240を制御する選択信号160,260を受け取り、この選択信号160が"1"の時、記憶回路130の出力をメモリ選択フラグ信号170として採用する一方、選択信号260が"1"の時、記憶回路230の出力をメモリ選択フラグ信号270として採用する。
【0022】
また、制御付き出力ドライバとしてのメモリ選択フラグバス出力ドライバ190,290は、プログラムによりメモリ選択フラグ信号170,270の値をリードする場合に、データをデータバス110,210に送出する。同時に同じく制御付き出力ドライバとしての選択信号バス出力ドライバ191,291は選択信号160,260の値をリードする場合にデータをデータバス110,210を通じて送出する。
【0023】
そして、メモリ制御部としてのメモリ制御回路180,280は、前記切り替え手段140,240の出力であるメモリ選択フラグ信号170,270とメモリアクセスアドレスとを入力として外部へメモリアクセス信号120,220を出力するメモリ制御部であって、前記メモリ選択フラグ信号170,270がアクティブ(="1")でかつメモリアクセスアドレスが共有メモリ300を指し示すアドレスである場合、メモリアクセス信号120,220を出力する。そして、前記共有メモリ300にこのメモリアクセス信号120,220が入力される。
【0024】
以上のように説明した前記プロセッサコア100,200を以下のように接続する。すなわち、第1プロセッサコア100の出力信号であるメモリ選択フラグ信号170を論理反転し、第2プロセッサコア200の外部フラグ信号250として入力する。
【0025】
また、前記第1プロセッサコア100の選択信号160は"1"に固定し、同様に第2プロセッサコア200の選択信号260は"0"に固定する。第1プロセッサコア100の外部フラグ信号150は外部で固定値にしておく。この信号は前記切り替え手段140で選択されないので、固定値であれば何でもよい。前記第2プロセッサコア200のメモリ選択フラグ信号270は外部でオープンにしておく。
【0026】
前記メモリ制御回路180,280は、メモリ選択フラグ信号170,270がアクティブ(="1")の時で、かつメモリアクセスアドレス(図示せず)が共有メモリ300を指し示す範囲である時、メモリアクセス信号120,220をアクティブ(="1")とする。
【0027】
前記共有メモリ300はプロセッサコア100,200から来るリード/ライト信号(図示せず)に応じて、データバス110,210を通じてデータ転送を行なう。尚、プロセッサコア100,200は通常のプロセッサコアが一般的に持つ、例外処理の機能等は備えているとする。
【0028】
以上のように構成された本発明の実施形態に係るマルチプロセッサ1の作動を説明する。プロセッサコア100,200のメモリ空間は例えば64Kワード空間とし、共有メモリ300はその中のE000番地からFFFF番地に割り当てられているとする。
【0029】
リセット直後では、記憶回路130は"0"に初期化される。選択信号160は固定(="1")なので、メモリ選択フラグ信号170は"0"となる。従って、第1プロセッサコア100でメモリ選択フラグ信号170をリードすると、メモリ選択フラグ信号170は"0"となり、共有メモリ300は選択できない。
【0030】
同様に第2プロセッサコア200でメモリ選択フラグ信号270をリードすると、選択信号260は固定(="0")なので、記憶回路230の値に関わらず、メモリ選択フラグ信号270の値は"1"となり、メモリアクセスとしてアクセスアドレスがE000番地からFFFF番地の間であると、共有メモリ300に対し、メモリ制御回路280はメモリアクセス信号220(="1")を出力する。
【0031】
すなわち、リセット直後は、第2プロセッサコア200から共有メモリ300にアクセスできる状態になっている。そして、選択信号160,260をリードすることで、プログラムにより、マスタ側として動作しているか、又はスレーブ側として動作しているか判断することが可能である。
【0032】
通常動作時では、第1プロセッサコア100側で共有メモリ300にアクセスする必要がある場合、データバス110を通じて、記憶回路130に対して"1"をライトする。選択信号160が"1"であるので、メモリ選択フラグ信号170は"1"となり、メモリ制御回路180をアクティブにする。同時に、第2プロセッサコア200側では、メモリ選択フラグ信号270が"0"となるので、メモリ制御回路280はディスエーブルされる。従って、共有メモリ300は第1プロセッサコア100側に接続されることになる。
【0033】
従って、本発明の実施形態に係るマルチプロセッサ1によると、プロセッサコア100,200内のメモリ制御回路180,280は共有メモリ300に対し、メモリアクセス信号120,220を同時にはアクティブ状態することはなく、競合を避けることができる。
【0034】
また、内部レジスタをリードすることで、選択信号160,260の値を知ることができ、さらにそれらがマスタ側なのか、又はスレーブ側なのかを知ることができる。同様に、内部レジスタをリードすることで、各プロセッサコア100,200が自身で設定した又は他方の影響からのものかのいずれにしても、共有メモリ300にアクセスできるか否かを知ることが可能である。
【0035】
尚、前記実施形態では、排他制御の原則を記述したが、実際的には、第2プロセッサコア200が共有メモリ300をアクセスしている最中に、第1プロセッサコア100が記憶回路130を書き換えてしまい、共有メモリ300が第1プロセッサコア100側に属してしまうことも考え得る。
【0036】
このような場合、図2に示すように、第1及び第2プロセッサコア100,200に同時に割り込みをかけ、前記共有メモリ300にアクセス権を持たない第2プロセッサコア200側は割り込みルーチン中で前記共有メモリ300に対するアクセスを禁止し、他方の第1プロセッサコア100側で記憶回路130をプログラムにより切り替えることで前記共有メモリ300の接続先を変更するステップを含むマルチプロセッサ制御方法をとればよい。
【0037】
又は、図3に示すように、マルチプロセッサ1上の記憶回路130へのライトアクセスが生じた時に、それを示す信号出力を出力とする第1プロセッサコア100をマスタ側とし、そのメモリ選択フラグ信号170を受けて、第2プロセッサコア200側をストールさせ、第1プロセッサコア100で共有メモリ300をアクセスしようとするときのみ、プログラムによりメモリ選択フラグ信号170を更新して前記共有メモリ300へのアクセスを制御するステップを含むマルチプロセッサ制御方法をとればよい。
【0038】
尚、本発明は、アクセスタイミングが調整できるようなシステムにおいては、ある程度タイミングを考慮することで、ランダムに2つのプロセッサコアからアクセスがある共有メモリに対しても十分に適用することが可能である。
【0039】
【発明の効果】
以上のように、本発明によれば、複数のプロセッサコアをチップ上で接続する際に、僅かの論理回路を考慮することで、簡易に共有メモリへの排他制御を実現することができ、かつ各プロセッサコアは共有メモリへのアクセスが許可されているかどうかを内部プログラムで容易に知ることができる。
【図面の簡単な説明】
【図1】本発明の実施形態に係るマルチプロセッサの全体構成を示す図である。
【図2】マルチプロセッサ上のプロセッサコアの制御流れを示す図である。
【図3】その他のマルチプロセッサ上のプロセッサコアの制御流れを示す図2相当図である。
【符号の説明】
1 マルチプロセッサ
100,200 プロセッサコア
110,210 データバス
120,220 メモリアクセス信号
130,230 記憶回路(記憶手段)
140,240 切り替え手段
150,250 外部フラグ信号
160,260 選択信号
170,270 メモリ選択フラグ信号
180,280 メモリ制御回路(メモリ制御部)
190,290 メモリ選択フラグバス出力ドライバ(制御付きドライバ)
191,291 選択信号バス出力ドライバ(制御付きドライバ)
300 共有メモリ
[0001]
BACKGROUND OF THE INVENTION
The present invention belongs to a technical field related to a multiprocessor, a multiprocessor core, and a control method thereof including a plurality of processor cores on one chip and a shared memory accessible from the processor core.
[0002]
[Prior art]
In recent years, with the progress of process miniaturization and the demand for higher performance of LSIs, many multiprocessors having a plurality of processor cores mounted on one chip have been developed. Also, from the viewpoint of cost, a multiprocessor capable of realizing a system constituted by a plurality of chips on one chip has been in the spotlight.
[0003]
In such a multiprocessor, when each processor can operate independently, it is possible to easily achieve the maximum performance. However, when it is necessary to exchange data between processor cores on one chip, it is temporarily out of the chip. If the other processor core attempts to send data to the other processor core, the effect mounted on the same chip cannot be obtained. In other words, the data transfer is equivalent to the case of the conventional separate chip configuration.
[0004]
Therefore, conventionally, for example, as disclosed in JP-A-7-105146 or JP-A-5-210640, the above-mentioned problem is solved by providing a shared memory accessible from a plurality of processor cores on one chip. It has been proposed. That is, data created by a certain processor core is stored in the shared memory, and then the processor core that needs this data accesses the shared memory. In this way, since the built-in memory is generally high-speed, it is possible to dramatically improve the transfer efficiency with respect to data transfer compared to the conventional case.
[0005]
[Problems to be solved by the invention]
However, in the conventional device, in order to appropriately perform access requests from processor cores that operate independently from each other, an arbitration circuit is separately required, or a dual-port memory that allows a plurality of accesses must be used as a shared memory. There was a problem that there was.
[0006]
In addition, the dual port memory or the arbitration circuit that avoids complicated contention tends to be large-scale, and there is a problem that it is overspecial except when data exchange between processor cores occurs completely at random. there were.
[0007]
Furthermore, in a general development method of mounting a plurality of processor cores that have already been developed, it is necessary to newly add a design such as an arbitration circuit, which increases the design period.
[0008]
The present invention has been made in view of such various points, and an object of the present invention is to provide a multiprocessor that uses a conventional processor core almost as it is and does not cause contention in a shared memory despite its simple configuration. And
[0009]
[Means for Solving the Problems]
To achieve the above object, according to the first aspect of the present invention, in a multiprocessor having a plurality of processor cores on one chip and a shared memory accessible from the processor core, a memory selection flag writable by a program. A storage means for storing a signal; a switching means for switching and outputting a memory selection flag signal and an external flag signal from the storage means; and when the storage means is read by a program, the output of the switching means is sent to a data bus A driver with control, and a memory control unit that outputs an output of the switching means and a memory access address and outputs a memory access signal to the outside, and is connected to the data bus, the external flag signal, and the switching A plurality of processors receiving an external selection signal for controlling the means; Comprising a core and enter the plurality of memory access signal, and a shared memory connected by a plurality of said data bus in relation to the memory access signal.
[0010]
According to the above configuration, immediately after resetting, the memory control circuit in the processor core does not simultaneously activate the memory access signals for the shared memory, and contention can be avoided. Therefore, when connecting multiple processor cores on a chip, it is possible to easily implement exclusive control to the shared memory, and whether each processor core is permitted to access the shared memory using an internal program. It is easy to know.
[0011]
According to a second aspect of the present invention, a plurality of processor cores provided on one chip and capable of accessing a common memory, storing a memory selection flag signal writable by a program, and memory selection from the storage means Switching means for switching and outputting a flag signal and an external flag signal, a driver with control for sending the output of the switching means to a data bus when the storage means is read by a program, an output of the switching means and a memory access address And a memory control unit that outputs a memory access signal to the outside, and is connected to the data bus and receives the external flag signal and a selection signal for controlling the switching means from the outside. When the selection flag signal is read by a program, the memory selection flag The signal to be transmitted to the data bus.
[0012]
According to the above configuration, when a plurality of processor cores are connected on one chip, it is possible to easily realize exclusive control to the shared memory and whether or not access to the shared memory is permitted. Can easily know.
[0013]
According to a third aspect of the present invention, there is provided a multiprocessor using the multiprocessor core according to the second aspect, wherein the first processor core and the second processor core are mounted, and the selection signal of the first processor core is fixed. The first processor core switching means output signal is logically inverted and applied as an external flag signal of the second processor core, the memory access signal of the first processor core is connected to the shared memory, and A data bus of a first processor core is connected to the shared memory, an external flag signal of the first processor core is fixed, and a selection signal of the second processor core is used as a selection signal of the first processor core. Is fixed with a logically inverted value, the switching means output signal of the second processor core is opened, and the second processor core Connect the re access signal to said shared memory, comprising the data bus of the second processor core to be connected to the shared memory.
[0014]
According to the above configuration, immediately after the reset, the shared memory can be accessed from the second processor core. By reading the selection signal, the program operates as the master side or as the slave side. It is possible to judge whether In the normal operation, when it is necessary to access the shared memory on the first processor core side, the memory control circuit is activated through the data bus. At the same time, the memory control circuit is disabled on the second processor core side. Therefore, the shared memory is connected to the first processor core side, and contention can be avoided. Further, by reading the internal register, it is possible to know the values of the selection signals, and further know whether they are the master side or the slave side. Similarly, by reading the internal register, it is possible to know whether or not the shared memory can be accessed regardless of whether the multiprocessor core is set by itself or due to the influence of the other. Therefore, by considering a few logic circuits, it is possible to obtain a suitable multiprocessor capable of effectively obtaining the effects of the present invention.
[0015]
In a multiprocessor control method according to a fourth aspect of the present invention, the first and second processor cores are simultaneously interrupted using the multiprocessor of the third aspect, and the processor core side having no access right to the shared memory is interrupted. In the routine, access to the shared memory is prohibited, and the other processor core side includes a step of changing the connection destination of the shared memory by switching the storage means by a program. According to a fifth aspect of the present invention, there is provided a multiprocessor control method according to the third aspect, wherein the processor core on the multiprocessor uses the multiprocessor of claim 3 to output the memory selection flag signal from the switching means as the master side. Only when the shared memory is to be accessed by the side processor core, the step of updating the memory selection flag signal by the program to control access to the shared memory is included.
[0016]
According to the above configuration, the first processor core rewrites the storage means while the second processor core is accessing the shared memory, so that the shared memory does not try to belong to the first processor core side. Can do.
[0017]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 shows the overall configuration of a multiprocessor 1 according to an embodiment of the present invention. In this multiprocessor 1, an identical first processor core 100 and second processor core 200 are provided on one chip. .
[0018]
The processor cores 100 and 200 are connected to the shared memory 300 by respective data buses 110 and 210. In addition, although not shown in the figure, access addresses and control signals are actually output from the respective processor cores 100 and 200.
[0019]
The shared memory 300 performs data transfer with the first processor core 100 through the data bus 110 when the memory access signal 120 coming from the first processor core 100 is active (= “1”). Similarly, the shared memory 300 performs data transfer with the second processor core 200 through the data bus 210 when the memory access signal 220 coming from the second processor core 200 is active (= “1”).
[0020]
The storage circuits 130 and 230 in the processor cores 100 and 200 are storage means for storing memory selection flag signals 170 and 270 that can be written by programs in the processor cores 100 and 200, respectively. When 270 is “1”, the shared memory 300 is selected.
[0021]
The switching means 140 and 240 in the processor cores 100 and 200 switch and output the memory selection flag signals 170 and 270 of the storage circuits 130 and 230 and the external flag signals 150 and 250 inputted from the outside. The selection signals 160 and 260 for controlling the switching means 140 and 240 are received from the outside. When the selection signal 160 is “1”, the output of the storage circuit 130 is adopted as the memory selection flag signal 170, while the selection signal When 260 is “1”, the output of the memory circuit 230 is adopted as the memory selection flag signal 270.
[0022]
Further, the memory selection flag bus output drivers 190 and 290 as output drivers with control send data to the data buses 110 and 210 when the values of the memory selection flag signals 170 and 270 are read by a program. At the same time, the selection signal bus output drivers 191 and 291 as output drivers with control similarly transmit data through the data buses 110 and 210 when reading the values of the selection signals 160 and 260.
[0023]
Then, the memory control circuits 180 and 280 as the memory control unit output the memory access signals 120 and 220 to the outside by inputting the memory selection flag signals 170 and 270 and the memory access address which are the outputs of the switching means 140 and 240, respectively. When the memory selection flag signals 170 and 270 are active (= “1”) and the memory access address is an address indicating the shared memory 300, the memory access signals 120 and 220 are output. The memory access signals 120 and 220 are input to the shared memory 300.
[0024]
The processor cores 100 and 200 described above are connected as follows. That is, the memory selection flag signal 170 that is the output signal of the first processor core 100 is logically inverted and input as the external flag signal 250 of the second processor core 200.
[0025]
The selection signal 160 of the first processor core 100 is fixed to “1”, and similarly, the selection signal 260 of the second processor core 200 is fixed to “0”. The external flag signal 150 of the first processor core 100 is set to a fixed value outside. Since this signal is not selected by the switching means 140, any value may be used as long as it is a fixed value. The memory selection flag signal 270 of the second processor core 200 is opened outside.
[0026]
The memory control circuits 180 and 280 perform memory access when the memory selection flag signals 170 and 270 are active (= “1”) and the memory access address (not shown) is in a range indicating the shared memory 300. The signals 120 and 220 are active (= “1”).
[0027]
The shared memory 300 performs data transfer through the data buses 110 and 210 in response to read / write signals (not shown) coming from the processor cores 100 and 200. It is assumed that the processor cores 100 and 200 have an exception processing function or the like generally possessed by a normal processor core.
[0028]
The operation of the multiprocessor 1 according to the embodiment of the present invention configured as described above will be described. Assume that the memory space of the processor cores 100 and 200 is, for example, a 64K word space, and the shared memory 300 is allocated from the address E000 to the address FFFF.
[0029]
Immediately after the reset, the memory circuit 130 is initialized to “0”. Since the selection signal 160 is fixed (= “1”), the memory selection flag signal 170 is “0”. Accordingly, when the first processor core 100 reads the memory selection flag signal 170, the memory selection flag signal 170 becomes “0”, and the shared memory 300 cannot be selected.
[0030]
Similarly, when the memory selection flag signal 270 is read by the second processor core 200, the selection signal 260 is fixed (= “0”), so the value of the memory selection flag signal 270 is “1” regardless of the value of the storage circuit 230. Thus, if the access address is between E000 and FFFF as memory access, the memory control circuit 280 outputs a memory access signal 220 (= “1”) to the shared memory 300.
[0031]
That is, immediately after the reset, the shared memory 300 can be accessed from the second processor core 200. Then, by reading the selection signals 160 and 260, it is possible to determine whether the program is operating as the master side or the slave side according to the program.
[0032]
During normal operation, when it is necessary to access the shared memory 300 on the first processor core 100 side, “1” is written to the storage circuit 130 through the data bus 110. Since the selection signal 160 is “1”, the memory selection flag signal 170 becomes “1”, and the memory control circuit 180 is activated. At the same time, since the memory selection flag signal 270 becomes “0” on the second processor core 200 side, the memory control circuit 280 is disabled. Therefore, the shared memory 300 is connected to the first processor core 100 side.
[0033]
Therefore, according to the multiprocessor 1 according to the embodiment of the present invention, the memory control circuits 180 and 280 in the processor cores 100 and 200 do not simultaneously activate the memory access signals 120 and 220 for the shared memory 300. Can avoid conflicts.
[0034]
Further, by reading the internal register, the values of the selection signals 160 and 260 can be known, and further, it can be known whether they are the master side or the slave side. Similarly, by reading the internal register, it is possible to know whether each of the processor cores 100 and 200 can access the shared memory 300 regardless of whether it is set by itself or from the other influence. It is.
[0035]
In the above-described embodiment, the principle of exclusive control has been described. In practice, the first processor core 100 rewrites the storage circuit 130 while the second processor core 200 is accessing the shared memory 300. Therefore, it can be considered that the shared memory 300 belongs to the first processor core 100 side.
[0036]
In such a case, as shown in FIG. 2, the first and second processor cores 100 and 200 are interrupted at the same time, and the second processor core 200 side having no access right to the shared memory 300 is in the interrupt routine. A multiprocessor control method including a step of prohibiting access to the shared memory 300 and changing the connection destination of the shared memory 300 by switching the storage circuit 130 by a program on the other first processor core 100 side may be adopted.
[0037]
Alternatively, as shown in FIG. 3, when a write access to the storage circuit 130 on the multiprocessor 1 occurs, the first processor core 100 that outputs a signal output indicating the same is set as the master side, and its memory selection flag signal 170, the second processor core 200 side is stalled, and only when the first processor core 100 tries to access the shared memory 300, the program updates the memory selection flag signal 170 to access the shared memory 300. A multiprocessor control method including the step of controlling
[0038]
In the system in which the access timing can be adjusted, the present invention can be sufficiently applied to a shared memory that is randomly accessed from two processor cores by considering the timing to some extent. .
[0039]
【The invention's effect】
As described above, according to the present invention, when a plurality of processor cores are connected on a chip, exclusive control to the shared memory can be easily realized by considering a few logic circuits, and Each processor core can easily know whether or not access to the shared memory is permitted by an internal program.
[Brief description of the drawings]
FIG. 1 is a diagram showing an overall configuration of a multiprocessor according to an embodiment of the present invention.
FIG. 2 is a diagram showing a control flow of a processor core on a multiprocessor.
FIG. 3 is a view corresponding to FIG. 2 showing a control flow of a processor core on another multiprocessor;
[Explanation of symbols]
1 Multiprocessor 100, 200 Processor core 110, 210 Data bus 120, 220 Memory access signal 130, 230 Storage circuit (storage means)
140, 240 Switching means 150, 250 External flag signal 160, 260 Selection signal 170, 270 Memory selection flag signal 180, 280 Memory control circuit (memory control unit)
190,290 Memory selection flag bus output driver (driver with control)
191,291 Selection signal bus output driver (driver with control)
300 shared memory

Claims (4)

1チップ上に複数のプロセッサコアと、前記複数のプロセッサコアからアクセス可能な共有メモリとを持つマルチプロセッサにおいて、
各々の前記プロセッサコアは、
プログラムによりライト可能なメモリ選択フラグ信号を格納するとともに、当該メモリ選択フラグ信号を外部へ出力する記憶手段と、
前記記憶手段からのメモリ選択フラグ信号と外部フラグ信号とを切り替え出力する切り替え手段と、
前記記憶手段をプログラムによりリードした場合に前記切り替え手段の出力をデータバスに送出する制御付きドライバと、
前記切り替え手段の出力とメモリアクセスアドレスとを入力として外部へメモリアクセス信号を出力するメモリ制御部と
を有し、
前記共有メモリは、複数のメモリアクセス信号を入力し、前記メモリアクセス信号に関連して複数の前記データバスで接続されており、
前記複数のプロセッサコアのうちの1つのプロセッサコアの前記記憶手段が出力した前記メモリ選択フラグ信号を、当該プロセッサコア以外の少なくとも1つのプロセッサコアが直接または論理回路を介して前記外部フラグ信号として入力することを特徴とするマルチプロセッサ。
In a multiprocessor having a plurality of processor cores on one chip and a shared memory accessible from the plurality of processor cores,
Each said processor core is
A memory means for storing a memory selection flag signal writable by a program, and outputting the memory selection flag signal to the outside;
Switching means for switching and outputting a memory selection flag signal and an external flag signal from the storage means;
A driver with control for sending the output of the switching means to a data bus when the storage means is read by a program;
A memory control unit that outputs an output of the switching means and a memory access address and outputs a memory access signal to the outside;
The shared memory inputs a plurality of memory access signals, and is connected by a plurality of the data buses in relation to the memory access signals ,
The memory selection flag signal output from the storage means of one processor core of the plurality of processor cores is input as the external flag signal directly or via a logic circuit by at least one processor core other than the processor core. A multiprocessor characterized by:
1チップ上に第1および第2のプロセッサコアと、前記第1および第2のプロセッサコアからアクセス可能な共有メモリとを持つマルチプロセッサにおいて、
前記第1および前記第2のプロセッサコアは、それぞれ、
プログラムによりライト可能なメモリ選択フラグ信号を格納するとともに、当該メモリ選択フラグ信号を外部へ出力する記憶手段と、
前記記憶手段からのメモリ選択フラグ信号と外部フラグ信号とを切り替え出力する切り替え手段と、
前記記憶手段をプログラムによりリードした場合に前記切り替え手段の出力をデータバスに送出する制御付きドライバと、
前記切り替え手段の出力とメモリアクセスアドレスとを入力として外部へメモリアクセス信号を出力するメモリ制御部とを有し、
前記データバスに接続されて前記外部フラグ信号と、前記切り替え手段を制御する選択信号とを外部から受け取る一方、
前記メモリ選択フラグ信号をプログラムによりリードした場合、前記メモリ選択フラグ信号を前記データバスに送出し、
前記第1のプロセッサコアの選択信号を固定し、
前記第1のプロセッサコアの切り替え手段出力信号を論理反転して前記第2のプロセッサコアの外部フラグ信号として印加し、
前記第1のプロセッサコアのメモリアクセス信号を前記共有メモリに接続し、
前記第1のプロセッサコアのデータバスを前記共有メモリに接続し、
前記第1のプロセッサコアの外部フラグ信号を固定し、
前記第2のプロセッサコアの選択信号を、前記第1のプロセッサコアの選択信号を論理反転した値で固定し、
前記第2のプロセッサコアの切り替え手段出力信号をオープンとし、
前記第2のプロセッサコアのメモリアクセス信号を前記共有メモリに接続し、
前記第2のプロセッサコアのデータバスを前記共有メモリに接続するように構成したことを特徴とするマルチプロセッサ。
In a multiprocessor having first and second processor cores on one chip and a shared memory accessible from the first and second processor cores,
The first and second processor cores are respectively
A memory means for storing a memory selection flag signal writable by a program, and outputting the memory selection flag signal to the outside;
Switching means for switching and outputting a memory selection flag signal and an external flag signal from the storage means;
A driver with control for sending the output of the switching means to a data bus when the storage means is read by a program;
A memory control unit for outputting a memory access signal to the outside with the output of the switching means and the memory access address as inputs;
While receiving the external flag signal connected to the data bus and a selection signal for controlling the switching means,
When the memory selection flag signal is read by a program, the memory selection flag signal is sent to the data bus ,
Fixing the selection signal of the first processor core;
The first processor core switching means output signal is logically inverted and applied as an external flag signal of the second processor core,
Connecting the memory access signal of the first processor core to the shared memory;
Connecting the data bus of the first processor core to the shared memory;
Fixing an external flag signal of the first processor core;
Fixing the selection signal of the second processor core to a value obtained by logically inverting the selection signal of the first processor core;
The switching means output signal of the second processor core is opened,
Connecting the memory access signal of the second processor core to the shared memory;
A multiprocessor, wherein the data bus of the second processor core is connected to the shared memory.
請求項のマルチプロセッサを用いて共有メモリでの競合を避けるマルチプロセッサ制御方法であって、
第1及び第2のプロセッサコアに同時に割り込みをかけ、
前記共有メモリにアクセス権を持たないプロセッサコア側は割り込みルーチン中で前記共有メモリに対するアクセスを禁止し、
他方のプロセッサコア側で記憶手段をプログラムにより切り替えることで前記共有メモリの接続先を変更するステップを含むマルチプロセッサ制御方法。
A multiprocessor control method using the multiprocessor of claim 2 to avoid contention in a shared memory,
Interrupt the first and second processor cores simultaneously,
The processor core side that does not have access rights to the shared memory prohibits access to the shared memory in an interrupt routine,
A multiprocessor control method including a step of changing a connection destination of the shared memory by switching a storage unit by a program on the other processor core side.
請求項のマルチプロセッサを用いて共有メモリでの競合を避けるマルチプロセッサ制御方法であって、
マルチプロセッサ上のプロセッサコアでメモリ選択フラグ信号を切り替え手段の出力とする側をマスタ側とし、
前記マスタ側プロセッサコアで前記共有メモリをアクセスしようとするときのみ、プログラムによりメモリ選択フラグ信号を更新して前記共有メモリへのアクセスを制御するステップを含むマルチプロセッサ制御方法。
A multiprocessor control method using the multiprocessor of claim 2 to avoid contention in a shared memory,
The side that uses the memory selection flag signal as the output of the switching means in the processor core on the multiprocessor is the master side,
A multiprocessor control method comprising a step of updating a memory selection flag signal by a program to control access to the shared memory only when the master processor core tries to access the shared memory.
JP2002072563A 2002-03-15 2002-03-15 Multiprocessor and control method thereof Expired - Fee Related JP3868316B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002072563A JP3868316B2 (en) 2002-03-15 2002-03-15 Multiprocessor and control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002072563A JP3868316B2 (en) 2002-03-15 2002-03-15 Multiprocessor and control method thereof

Publications (2)

Publication Number Publication Date
JP2003271573A JP2003271573A (en) 2003-09-26
JP3868316B2 true JP3868316B2 (en) 2007-01-17

Family

ID=29202524

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002072563A Expired - Fee Related JP3868316B2 (en) 2002-03-15 2002-03-15 Multiprocessor and control method thereof

Country Status (1)

Country Link
JP (1) JP3868316B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110187891B (en) * 2019-03-18 2023-03-03 杭州电子科技大学 Program development method and system for multi-core programmable controller

Also Published As

Publication number Publication date
JP2003271573A (en) 2003-09-26

Similar Documents

Publication Publication Date Title
US5548730A (en) Intelligent bus bridge for input/output subsystems in a computer system
US7007108B2 (en) System method for use of hardware semaphores for resource release notification wherein messages comprises read-modify-write operation and address
JP4737438B2 (en) Information processing apparatus that shares resources among multiple processing units
US6504785B1 (en) Multiprocessor system with integrated memory
US7114041B2 (en) AMBA modular memory controller
JP3790713B2 (en) Selective transaction destination for devices on shared bus
US20070168616A1 (en) Embedded dram cache memory and method having reduced latency
US6996659B2 (en) Generic bridge core
JP3807250B2 (en) Cluster system, computer and program
JP2504206B2 (en) Bus controller
US20120311266A1 (en) Multiprocessor and image processing system using the same
JP4226085B2 (en) Microprocessor and multiprocessor system
US6622210B2 (en) Microcontroller with improved access efficiency of instructions
JP3868316B2 (en) Multiprocessor and control method thereof
US20030172244A1 (en) Data processing apparatus, data processing system, and access area control method
JP3817327B2 (en) Method and apparatus for accessing a chip selectable device in a data processing system
US5793991A (en) Method of equalizing loads on a computer bus
WO2011030498A1 (en) Data processing device and data processing method
US5890196A (en) Method and apparatus for performing page mode accesses
JP2005107873A (en) Semiconductor integrated circuit
JP3077807B2 (en) Microcomputer system
JP3204157B2 (en) Computer data supply method
JP3006487B2 (en) Emulation device
JP3555856B2 (en) Mask processing circuit
JP2001273191A (en) Computer system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050303

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060317

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060328

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060529

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20060926

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20061010

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091020

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101020

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees