JP3822852B2 - Memory access device - Google Patents
Memory access device Download PDFInfo
- Publication number
- JP3822852B2 JP3822852B2 JP2002272964A JP2002272964A JP3822852B2 JP 3822852 B2 JP3822852 B2 JP 3822852B2 JP 2002272964 A JP2002272964 A JP 2002272964A JP 2002272964 A JP2002272964 A JP 2002272964A JP 3822852 B2 JP3822852 B2 JP 3822852B2
- Authority
- JP
- Japan
- Prior art keywords
- memory
- remaining capacity
- cpu
- exclusive control
- capacity counter
- 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
Links
Images
Description
【0001】
【発明の属する技術分野】
この発明は、複数の中央処理装置(以下、CPUという)が共有メモリをアクセスするときの排他制御を行うメモリアクセス装置に関するものである。
【0002】
【従来の技術】
図11は、従来のメモリアクセス装置の構成を示すブロック図である(例えば,特許文献1参照)。
図11において、1はメモリアクセス装置、2a、2bはそれぞれ同一のバスやメモリ等の資源を共有するCPUである。3はCPU2a、2bによって共有されるメモリ、4はメモリマップI/Oである。5は共有資源を誰も使用していないことを示すフリー値と、使用者を示す識別子を持つ排他制御フラグである。メモリアクセス装置1は、排他制御フラグ5を基本構成としている。
【0003】
次に、動作について説明する。
メモリ3を獲得したいCPU2aは、排他制御フラグ5を読み出す。排他制御フラグ5がフリーを示す値ならば、CPU2aはメモリ3を獲得し、排他制御フラグ5は、ハードウェア的にフリー値からメモリ3を獲得したCPU2aの識別子へ変化する。メモリ3を獲得したCPU2a(使用中のCPU)がメモリ3を開放する際に、排他制御フラグ5にフリー値を書込む。
CPU2aが、排他制御フラグ5を読み出した時、フリー値以外ならば、他のCPUがメモリ3を使用していると判断し、排他制御フラグ5がフリー値になるのを読み出し続けて待つ。
【0004】
【特許文献1】
特開平9−325893号公報
【0005】
【発明が解決しようとする課題】
従来のメモリアクセス装置は、このように構成されているため、一方のCPU2aがメモリ3にアクセスしている間、他方のCPU2bは、排他制御フラグ5を読み出し続けることになり、その都度、バスを専有するために、CPUの処理の一部または全部が停止するという問題点があった。
【0006】
この発明は、上記のような課題を解決するためになされたものであり、効率的に排他制御を行うことが可能なメモリアクセス装置を得ることを目的にしている。
【0007】
【課題を解決するための手段】
この発明に係わるメモリアクセス装置においては、メモリを共有する複数のCPUがメモリをアクセスするときの排他制御を行うメモリアクセス装置において、CPUの一つによりメモリが使用されているか否かを示す値が書き込まれた排他制御フラグ、メモリを使用中のCPUによって読み書きされるデータ量の残容量を示す残容量カウンタ、この残容量カウンタが停止検出時間の間停止することにより、残容量カウンタの停止を検出すると共に停止検出時間をCPUの処理内容に応じて可変にする停止検出回路を備え、メモリを使用中でない他のCPUは、残容量カウンタを参照して、残容量カウンタの残容量に応じた時間経過後に排他制御フラグを読み出すことにより、メモリの使用の可否を判定すると共に、停止検出回路により、残容量カウンタの停止が検出されたときには、排他制御フラグは、使用中を示す値から使用中でない値に書き換えられるものである。
【0008】
また、メモリを共有する複数のCPUがメモリをアクセスするときの排他制御を行うメモリアクセス装置において、CPUの一つによりメモリが使用されているか否かを示す値が書き込まれた排他制御フラグ、メモリを使用中のCPUによって読み書きされるデータ量の残容量を示す残容量カウンタ、この残容量カウンタが停止検出時間の間停止することにより、残容量カウンタの停止を検出すると共に停止検出時間をCPUの処理内容に応じて可変にする停止検出回路を備え、排他制御フラグと残容量カウンタは、一回の読み出しで同時に読み出されるように統合され、メモリを使用中でない他のCPUは、排他制御フラグの値により、メモリの使用の可否を判定すると共に、排他制御フラグの値により、メモリの使用が不可の場合は、読み出された残容量カウンタの残容量に応じた時間経過後に再度統合された排他制御フラグ及び残容量カウンタを読み出し、判定を行い、停止検出回路により、残容量カウンタの停止が検出されたときには、排他制御フラグは、使用中を示す値から使用中でない値に書き換えられるものである。
【0009】
また、メモリを共有する複数のCPUがメモリをアクセスするときの排他制御を行うメモリアクセス装置において、CPUの一つによりメモリが使用されているか否かを示す値が書き込まれた排他制御フラグ、メモリを使用中のCPUによって読み書きされるデータ量の残容量を示す残容量カウンタ、この残容量カウンタの残容量と待ち時間の関係を示す待ち時間テーブル、残容量カウンタの残容量に基づき待ち時間テーブルにより得られる待ち時間を格納する待ち時間レジスタ、残容量カウンタが停止検出時間の間停止することにより、残容量カウンタの停止を検出すると共に停止検出時間をCPUの処理内容に応じて可変にする停止検出回路を備え、メモリを使用中でない他のCPUは、待ち時間レジスタを参照して、待ち時間レジスタの待ち時間経過後に排他制御フラグを読み出すことにより、メモリの使用の可否を判定すると共に、停止検出回路により、残容量カウンタの停止が検出されたときには、排他制御フラグは、使用中を示す値から使用中でない値に書き換えられるものである。
【0013】
【発明の実施の形態】
実施の形態1.
以下、この発明の実施の形態1について図を用いて説明する。
図1は、この発明の実施の形態1によるメモリアクセス装置の構成を示すブロック図である。
図1において、1はメモリアクセス装置、2a、2bは同一のバスやメモリ等の資源を共有するCPUである。3はCPU2a、2bによって共有されるメモリ、4はメモリマップI/Oである。5はメモリ3を獲得しているCPUの有無を示す値を有する排他制御フラグである。6はメモリ3を獲得したCPUが読み書きするデータ量の残容量を示す残容量カウンタ、7は残容量カウンタ6が0になったことを検出する0比較回路である。メモリアクセス装置1は、排他制御フラグ5と残容量カウンタ6と0比較回路7によって構成されている。
【0014】
次に、上記のように構成されたメモリアクセス装置の動作について説明する。
メモリ3を獲得したいCPU2aは、排他制御フラグ5を読み出す。
排他制御フラグ5が、メモリ3を獲得しているCPUが無いことを示す値(この場での説明では0とする)ならば、CPU2aはメモリ3を獲得できる。また、この時、排他制御フラグ5はハードウェア的に0からメモリ3を獲得しているCPU2aが存在することを示す値(この場での説明では1とする)へ変化する。CPU2aが排他制御フラグ5を読み出したとき、1ならば、CPU2aはメモリ3を獲得できず、排他制御フラグ5に変化はない。
【0015】
メモリ3を獲得したCPU2a(使用中のCPU)は、メモリ3を読み書きするデータ量を残容量カウンタ6に書き込み、読み書きの処理を開始する。
残容量カウンタ6は、メモリ3が読み書きされる度に、ハードウェア的に減算される。
【0016】
使用中のCPU以外のCPUが、メモリ3を獲得したいときには、残容量カウンタ6を参照する。各CPUには、あらかじめ内部に残容量と時間の関係を示す待ち時間テーブルを持たせることによって、後どれ位の時間、メモリ3が専有され続けるかを知ることができる。他のCPUにメモリ3を専有されている場合でも、この専有時間後に排他制御フラグ5を参照すればよく、連続的に排他制御フラグ5を読み出す必要はない。
残容量カウンタ6が0になると、0比較回路7により、排他制御フラグ5はハードウェア的に1から0に変化する。
【0017】
このように、実施の形態1によれば、使用中のCPU以外のCPUが、残容量カウンタ6を参照することにより、使用中のCPU以外のCPUの待ち時間を解消できる効果が得られる。また、メモリを専有しているCPUの処理速度の影響を解消できる効果がある。
【0018】
実施の形態2.
以下、この発明の実施の形態2について説明する。
図2は、この発明の実施の形態2によるメモリアクセス装置の構成を示すブロック図である。
図2において、1〜7は図1におけるものと同一のものである。
図2の実施の形態1との違いは、残容量カウンタ6を排他制御フラグ5と統合したことである。その他の構成は、実施の形態1と同じである。
【0019】
次に、動作について説明する。
実施の形態1では、メモリ3が専有されている場合、1回目に排他制御フラグ5を、2回目に残容量カウンタ6をというように、2度読み出しの処理が必要であるが、実施の形態2では、残容量カウンタ6を排他制御フラグ5と統合したことにより、1度の読み出しで、残容量カウンタ6と排他制御フラグ5の両方を読み出し、その情報を参照することができる。
ただし、メモリの使用が不可の場合は、読み出された残容量カウンタの値に応じた時間経過後に再度、排他制御フラグ及び残容量カウンタの値を読み出して判定を行うようにする。
【0020】
このように、実施の形態2によれば、使用中のCPU以外のCPUは、1度の読み出しで、残容量カウンタ6と排他制御フラグ5の両方の情報が参照できるので、CPUの待ち時間を解消できる効果が得られる。
【0021】
実施の形態3.
以下、この発明の実施の形態3について説明する。
図3は、この発明の実施の形態3によるメモリアクセス装置の構成を示すブロック図である。
図3において、1〜7は図1におけるものと同一のものである。8は残容量カウンタ6の残容量と時間の関係を示す待ち時間テーブル、9は待ち時間テーブル8によって得られる待ち時間を格納する待ち時間レジスタであり、8、9はメモリアクセス装置1内に設けられている。
【0022】
次に、動作について説明する。
実施の形態1では、CPU毎に待ち時間テーブルを用意していたが、実施の形態3は、待ち時間テーブル8及び待ち時間レジスタ9をメモリアクセス装置1内に設けている。この場合、使用中のCPU以外のCPUは、待ち時間レジスタ9を参照することにより、待ち時間を知ることができる。
【0023】
このように、実施の形態3によれば、待ち時間テーブル8をメモリアクセス装置内に1つ用意すればよく、システム全体のコストを削減する効果が得られる。
【0024】
実施の形態4.
以下、この発明の実施の形態4について説明する。
図4は、この発明の実施の形態4によるメモリアクセス装置の構成を示すブロック図である。
図4において、1〜5は図1におけるものと同一のものである。10は書き込み残容量を示す書き込み残容量カウンタである。
図4は、実施の形態1の残容量カウンタ6及び0比較回路7に代えて、メモリアクセス装置1内に、書き込み残容量カウンタ10を有している。
【0025】
次に、動作について説明する。
メモリ3を獲得したCPU2aが、書き込み残容量カウンタ10にメモリ3に書き込むデータ量を格納して、処理を開始する。書き込み残容量カウンタ10は、ハードウェア的にメモリ3に使用中のCPUからの書き込みがある度に減算され、書き込み残容量をカウントする。使用中のCPU以外のCPUは、書き込み残容量カウンタ10を参照することと、あらかじめCPU内部に待ち時間テーブルを持つことで、あとどれ位の時間メモリ3が使用中のCPUの書き込みに専有され続けるかを知ることができる。
書き込み残容量カウンタ10が0になれば、排他制御フラグ5が0にならなくても、読み出しだけは可能となり、使用中のCPU以外のCPUは、メモリ3からの読み出しを行え、処理が進む。使用中のCPUは読み出し処理を終了後、排他制御フラグ5に0を書き込む。
【0026】
このように、実施の形態4によれば、排他制御フラグ5が0にならなくても、使用中のCPUのメモリ3への書き込みが全て終了した時点で、使用中のCPU以外のCPUがメモリ3からの読み出しを行えるので、CPUの待ち時間を解消できる効果が得られる。
【0027】
実施の形態5.
以下、この発明の実施の形態5について説明する。
図5は、この発明の実施の形態5によるメモリアクセス装置の構成を示すブロック図である。
図5において、1〜5、10は図4におけるものと同一のものである。11は読み出し許可フラグである。
図5は、実施の形態4のメモリアクセス装置1内に、読み出し許可フラグ11を追加したものである。その他の構成は、実施の形態4と同一である。
【0028】
次に、動作について説明する。
実施の形態5は、メモリアクセス装置1内に読み出し許可フラグ11を追加したことにより、使用中のCPU以外からのメモリ3への読み書きのうち、読み出しの許可を可能とする。こうすることで、使用中のCPU以外のCPUも処理を続けることが可能となる。ただし、使用中のCPU以外のCPUが大容量のデータをメモリ3から読み出すと、使用中のCPUのメモリ3への読み書き速度が低下するため、その場合には、使用中のCPUは、読み出しの許可を行わないことで、読み書き速度の低下を防ぐ。
【0029】
このように、実施の形態5によれば、メモリ3への書き込みの排他制御は行いつつ、メモリ3からの読み出しは通常開放することで、全CPUの作業効率が向上する効果が得られる。
【0030】
実施の形態6.
以下、この発明の実施の形態6について説明する。
【0031】
図6は、この発明の実施の形態6によるメモリアクセス装置の構成を示すブロック図である。
図6において、1〜7は図1におけるものと同一のものである。12はメモリアクセス装置1内に設けられ、残容量カウンタ6が停止検出時間の間停止することにより、残容量カウンタ6の停止を検出する停止検出回路である。
図6の構成は、実施の形態1のメモリアクセス装置1内に、停止検出回路12を追加したものである。その他の構成は、実施の形態1と同一である。
【0032】
次に、動作について説明する。
実施の形態1の動作で、残容量カウンタ6が一定時間停止していることを、停止検出回路12によって検出した場合、使用中のCPUが停止したと見なし、排他制御フラグ5をハードウェア的に0に戻す。
【0033】
このように、実施の形態6によれば、CPU停止対策として、メモリ3を使用中のCPUが取りっぱなしになってシステム停止になることを防止する効果が得られる。
【0034】
実施の形態7.
以下、この発明の実施の形態7について説明する。
図7は、この発明の実施の形態7によるメモリアクセス装置の構成を示すブロック図である。
図7において、1〜7、12は図6におけるものと同一のものである。13はメモリアクセス装置1内に設けられ、CPUの処理内容と処理時間の関係を示す処理時間テーブルである。
図7は、実施の形態6のメモリアクセス装置1内に、処理時間テーブル13を追加した構成である。その他の構成は、実施の形態6と同一である。
【0035】
次に、動作について説明する。
実施の形態6の動作に加えて、CPUの処理内容と処理時間の関係を示す処理時間テーブル13を、メモリアクセス装置1内に持つことにより、使用中のCPUの処理内容によって、停止検出回路12の停止検出時間を可変にできるようにした。
【0036】
このように、実施の形態7によれば、使用中のCPUの停止検出時間を可変とすることにより、システム停止時間を短縮する効果が得られる。
【0037】
実施の形態8.
以下、この発明の実施の形態8について説明する。
図8は、この発明の実施の形態8によるメモリアクセス装置の構成を示すブロック図である。
図8において、1〜5、10は図4におけるものと同一のものである。12はメモリアクセス装置1内に設けられ、書き込み残容量カウンタ10の停止を検出する停止検出回路である。
図8の構成は、実施の形態4のメモリアクセス装置1内に、停止検出回路12を追加した構成である。その他の構成は、実施の形態4と同一である。
【0038】
次に、動作について説明する。
停止検出回路12により、書き込み残容量カウンタ10が0になった後、一定時間(所定時間)排他制御フラグ5が0にならない場合を検出したとき、使用中のCPUが停止したと見なし、排他制御フラグ5をハードウェア的に0に戻す。
【0039】
このように、実施の形態8によれば、CPU停止対策として、メモリ3を使用中のCPUが取りっぱなしになってシステム停止になることを防止する効果が得られる。
【0040】
実施の形態9.
以下、この発明の実施の形態9について説明する。
図9は、この発明の実施の形態9によるメモリアクセス装置の構成を示すブロック図である。
図9において、1〜6は図1におけるものと同一のものである。7a、7bは0比較回路、14はメモリへのアクセス予約が登録されたアクセス予約FIFO、15はアクセス予約FIFO14に登録された順にアクセス許可を与える許可レジスタである。
図9は、実施の形態1のメモリアクセス装置1内に、アクセス予約FIFO14と許可レジスタ15を追加し、0比較回路を2個に増やした構成である。その他の構成は、実施の形態1と同一である。
【0041】
次に、動作について説明する。
実施の形態1の動作で、使用中のCPUがメモリ3を専有している間に、使用中のCPU以外のCPUは、あらかじめCPU内に用意している自分の識別IDを、アクセス予約FIFO14に登録しておく。使用中のCPUがメモリ3を開放した時、排他制御フラグ5の0が0比較回路7bによって確認されると、アクセス予約FIFO14に登録されているCPUの順番に優先してメモリ3の獲得件が与えられる。アクセス予約FIFO14には同一のCPUの識別IDを複数個登録することはできない。
【0042】
このように、実施の形態9によれば、メモリ3のアクセス予約ができ、同一CPUの連続書き込みを防止する効果が得られる。
【0043】
実施の形態10.
以下、この発明の実施の形態10について説明する。
図10は、この発明の実施の形態10によるメモリアクセス装置の構成を示すブロック図である。
図10において、1〜7b、14、15は図9におけるものと同一のものである。16はメモリアクセス装置1内に設けられたタイマである。
図10は、実施の形態9のメモリアクセス装置1内に、タイマ16を追加した構成である。その他の構成は、実施の形態9と同一である。
【0044】
次に、動作について説明する。
実施の形態9の動作で、メモリ3の獲得権を与えられたCPUが、タイマ16による一定時間、メモリ3にアクセスしようとしない場合、アクセス予約FIFO14に登録されている、次の順番のCPUにアクセス権が与えられる。
【0045】
このように、実施の形態10によれば、メモリ3のアクセス権を与えられたCPUがアクセス権を取りっぱなしになってシステム停止になることを防止する効果が得られる。
また、残容量カウンタ6が0になったときに、使用中のCPU以外のCPUが、排他制御フラグ5を読み込むことが集中するのを防ぐ効果が得られる。
【0046】
【発明の効果】
この発明は、以上説明したように構成されているので、以下に示すような効果を奏する。
メモリを共有する複数のCPUがメモリをアクセスするときの排他制御を行うメモリアクセス装置において、CPUの一つによりメモリが使用されているか否かを示す値が書き込まれた排他制御フラグ、メモリを使用中のCPUによって読み書きされるデータ量の残容量を示す残容量カウンタ、この残容量カウンタが停止検出時間の間停止することにより、残容量カウンタの停止を検出すると共に停止検出時間をCPUの処理内容に応じて可変にする停止検出回路を備え、メモリを使用中でない他のCPUは、残容量カウンタを参照して、残容量カウンタの残容量に応じた時間経過後に排他制御フラグを読み出すことにより、メモリの使用の可否を判定すると共に、停止検出回路により、残容量カウンタの停止が検出されたときには、排他制御フラグは、使用中を示す値から使用中でない値に書き換えられるので、使用中でない他のCPUが、残容量カウンタを参照することにより、使用中でない他のCPUの待ち時間を解消することができ、メモリを使用中のCPUの処理速度への影響を解消することができると共に、メモリを使用中のCPUの停止によるメモリの専有及びシステム停止になることを防止し、さらに、停止検出回路を弾力的に運用して、無駄なシステム停止を防ぐことができる。
【0047】
また、メモリを共有する複数のCPUがメモリをアクセスするときの排他制御を行うメモリアクセス装置において、CPUの一つによりメモリが使用されているか否かを示す値が書き込まれた排他制御フラグ、メモリを使用中のCPUによって読み書きされるデータ量の残容量を示す残容量カウンタ、この残容量カウンタが停止検出時間の間停止することにより、残容量カウンタの停止を検出すると共に停止検出時間をCPUの処理内容に応じて可変にする停止検出回路を備え、排他制御フラグと残容量カウンタは、一回の読み出しで同時に読み出されるように統合され、メモリを使用中でない他のCPUは、排他制御フラグの値により、メモリの使用の可否を判定すると共に、排他制御フラグの値により、メモリの使用が不可の場合は、読み出された残容量カウンタの残容量に応じた時間経過後に再度統合された排他制御フラグ及び残容量カウンタを読み出し、判定を行い、停止検出回路により、残容量カウンタの停止が検出されたときには、排他制御フラグは、使用中を示す値から使用中でない値に書き換えられるので、使用中でない他のCPUは、一度の読み出しで、残容量カウンタと排他制御フラグの両方の情報を参照でき、使用中でない他のCPUの待ち時間を解消することができ、メモリを使用中のCPUの処理速度への影響を解消することができると共に、メモリを使用中のCPUの停止によるメモリの専有及びシステム停止になることを防止し、さらに、停止検出回路を弾力的に運用して、無駄なシステム停止を防ぐことができる。
【0048】
また、メモリを共有する複数のCPUがメモリをアクセスするときの排他制御を行うメモリアクセス装置において、CPUの一つによりメモリが使用されているか否かを示す値が書き込まれた排他制御フラグ、メモリを使用中のCPUによって読み書きされるデータ量の残容量を示す残容量カウンタ、この残容量カウンタの残容量と待ち時間の関係を示す待ち時間テーブル、残容量カウンタの残容量に基づき待ち時間テーブルにより得られる待ち時間を格納する待ち時間レジスタ、残容量カウンタが停止検出時間の間停止することにより、残容量カウンタの停止を検出すると共に停止検出時間をCPUの処理内容に応じて可変にする停止検出回路を備え、メモリを使用中でない他のCPUは、待ち時間レジスタを参照して、待ち時間レジスタの待ち時間経過後に排他制御フラグを読み出すことにより、メモリの使用の可否を判定すると共に、停止検出回路により、残容量カウンタの停止が検出されたときには、排他制御フラグは、使用中を示す値から使用中でない値に書き換えられるので、待ち時間レジスタをメモリアクセス装置内に1つ用意すればよく、システム全体のコストを削減し、使用中でない他のCPUの待ち時間を解消することができると共に、メモリを使用中のCPUの停止によるメモリの専有及びシステム停止になることを防止し、さらに、停止検出回路を弾力的に運用して、無駄なシステム停止を防ぐことができる。
【図面の簡単な説明】
【図1】 この発明の実施の形態1によるメモリアクセス装置の構成を示すブロック図である。
【図2】 この発明の実施の形態2によるメモリアクセス装置の構成を示すブロック図である。
【図3】 この発明の実施の形態3によるメモリアクセス装置の構成を示すブロック図である。
【図4】 この発明の実施の形態4によるメモリアクセス装置の構成を示すブロック図である。
【図5】 この発明の実施の形態5によるメモリアクセス装置の構成を示すブロック図である。
【図6】 この発明の実施の形態6によるメモリアクセス装置の構成を示すブロック図である。
【図7】 この発明の実施の形態7によるメモリアクセス装置の構成を示すブロック図である。
【図8】 この発明の実施の形態8によるメモリアクセス装置の構成を示すブロック図である。
【図9】 この発明の実施の形態9によるメモリアクセス装置の構成を示すブロック図である。
【図10】 この発明の実施の形態10によるメモリアクセス装置の構成を示すブロック図である。
【図11】 従来のメモリアクセス装置の構成を示すブロック図である。
【符号の説明】
1 メモリアクセス装置、2a、2b CPU、3 メモリ、
4 メモリマップI/O、5 排他制御フラグ、6 残容量カウンタ、
7 0比較回路、8 待ち時間テーブル、9 待ち時間レジスタ、
10 書き込み残容量カウンタ、11 読み出し許可フラグ、
12 停止検出回路、13 処理時間テーブル、
14 アクセス予約FIFO、15 許可レジスタ、16 タイマ。[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a memory access device that performs exclusive control when a plurality of central processing units (hereinafter referred to as CPUs) access a shared memory.
[0002]
[Prior art]
FIG. 11 is a block diagram showing a configuration of a conventional memory access device (see, for example, Patent Document 1).
In FIG. 11, 1 is a memory access device, and 2a and 2b are CPUs that share resources such as the same bus and memory. 3 is a memory shared by the
[0003]
Next, the operation will be described.
The
When the
[0004]
[Patent Document 1]
JP-A-9-325893
[Problems to be solved by the invention]
Since the conventional memory access device is configured in this way, while one
[0006]
The present invention has been made to solve the above-described problems, and an object thereof is to obtain a memory access device capable of performing exclusive control efficiently.
[0007]
[Means for Solving the Problems]
In the memory access device according to the present invention, in the memory access device that performs exclusive control when a plurality of CPUs sharing the memory access the memory, a value indicating whether or not the memory is used by one of the CPUs. The written exclusive control flag, the remaining capacity counter indicating the remaining capacity of the amount of data read and written by the CPU using the memory, and the remaining capacity counter is stopped during the stop detection time, thereby detecting the remaining capacity counter stop. And a stop detection circuit that makes the stop detection time variable according to the processing contents of the CPU, and other CPUs that are not using the memory refer to the remaining capacity counter to determine the time corresponding to the remaining capacity of the remaining capacity counter. by reading the exclusive control flag after elapse, the determining whether to use the memory, the stop detection circuit, the remaining When the stop of the amount counter is detected, the exclusive control flag is to be rewritten is not in use from the value indicating that the use value.
[0008]
In addition, in a memory access device that performs exclusive control when a plurality of CPUs sharing the memory access the memory, an exclusive control flag in which a value indicating whether the memory is used by one of the CPUs is written, the memory A remaining capacity counter indicating the remaining capacity of the amount of data read and written by the CPU using the CPU , and the remaining capacity counter is stopped during the stop detection time, thereby detecting the stop of the remaining capacity counter and the stop detection time of the CPU. It is equipped with a stop detection circuit that can be changed according to the processing contents, and the exclusive control flag and the remaining capacity counter are integrated so that they can be read simultaneously by one reading, and other CPUs not using the memory can The value determines whether the memory can be used. If the memory cannot be used due to the value of the exclusive control flag, read Issued read the remaining capacity counter exclusive control flag and the remaining capacity counter is integrated again after a lapse of time corresponding to the remaining capacity of, have rows determination, by the stop detection circuit, when the stop of the remaining capacity counter is detected, The exclusive control flag is rewritten from a value indicating in use to a value not in use .
[0009]
In addition, in a memory access device that performs exclusive control when a plurality of CPUs sharing the memory access the memory, an exclusive control flag in which a value indicating whether the memory is used by one of the CPUs is written, the memory The remaining capacity counter indicating the remaining capacity of the amount of data read and written by the CPU using the CPU, the waiting time table indicating the relationship between the remaining capacity of the remaining capacity counter and the waiting time, and the waiting time table based on the remaining capacity of the remaining capacity counter Stop detection that makes the remaining capacity counter variable according to the processing contents of the CPU while detecting the stop of the remaining capacity counter by the waiting time register that stores the obtained waiting time and the remaining capacity counter stopping for the stop detection time comprising a circuit, other CPU is not in use the memory refers to the waiting time register, waiting time register By reading the waiting time after the exclusive control flag, used with determining whether to use the memory, the stop detection circuit, when the stop of the remaining capacity counter is detected, the exclusive control flag from the value indicating that the use It can be rewritten to a value that is not medium .
[0013]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 is a block diagram showing a configuration of a memory access apparatus according to
In FIG. 1, 1 is a memory access device, and 2a and 2b are CPUs that share resources such as the same bus and memory. 3 is a memory shared by the
[0014]
Next, the operation of the memory access device configured as described above will be described.
The
If the
[0015]
The
The
[0016]
When a CPU other than the CPU being used wants to acquire the
When the
[0017]
As described above, according to the first embodiment, the CPU other than the CPU being used refers to the
[0018]
The second embodiment of the present invention will be described below.
FIG. 2 is a block diagram showing a configuration of a memory access apparatus according to
In FIG. 2, 1 to 7 are the same as those in FIG.
The difference from the first embodiment shown in FIG. 2 is that the remaining
[0019]
Next, the operation will be described.
In the first embodiment, when the
However, if the memory cannot be used, the determination is made by reading the exclusive control flag and the value of the remaining capacity counter again after the time corresponding to the value of the read remaining capacity counter has elapsed.
[0020]
As described above, according to the second embodiment, CPUs other than the CPU in use can refer to the information of both the remaining
[0021]
The third embodiment of the present invention will be described below.
FIG. 3 is a block diagram showing a configuration of a memory access apparatus according to
In FIG. 3, 1 to 7 are the same as those in FIG. 8 is a waiting time table indicating the relationship between the remaining capacity of the remaining
[0022]
Next, the operation will be described.
In the first embodiment, a waiting time table is prepared for each CPU. In the third embodiment, the waiting time table 8 and the waiting time register 9 are provided in the
[0023]
Thus, according to the third embodiment, it is sufficient to prepare one waiting time table 8 in the memory access device, and the effect of reducing the cost of the entire system can be obtained.
[0024]
The fourth embodiment of the present invention will be described below.
4 is a block diagram showing a configuration of a memory access apparatus according to
In FIG. 4, 1 to 5 are the same as those in FIG.
FIG. 4 includes a write remaining
[0025]
Next, the operation will be described.
The
When the remaining
[0026]
As described above, according to the fourth embodiment, even when the
[0027]
The fifth embodiment of the present invention will be described below.
FIG. 5 is a block diagram showing a configuration of a memory access apparatus according to
In FIG. 5, 1 to 5 and 10 are the same as those in FIG.
FIG. 5 is obtained by adding a read
[0028]
Next, the operation will be described.
In the fifth embodiment, by adding a read
[0029]
As described above, according to the fifth embodiment, the exclusive control of the writing to the
[0030]
The sixth embodiment of the present invention will be described below.
[0031]
FIG. 6 is a block diagram showing a configuration of a memory access apparatus according to
In FIG. 6, 1 to 7 are the same as those in FIG. A
The configuration of FIG. 6 is obtained by adding a
[0032]
Next, the operation will be described.
In the operation of the first embodiment, when the
[0033]
As described above, according to the sixth embodiment, as a measure for stopping the CPU, it is possible to obtain an effect of preventing the CPU that is using the
[0034]
The seventh embodiment of the present invention will be described below.
FIG. 7 is a block diagram showing a configuration of a memory access apparatus according to
In FIG. 7, 1 to 7 and 12 are the same as those in FIG.
FIG. 7 shows a configuration in which a processing time table 13 is added to the
[0035]
Next, the operation will be described.
In addition to the operation of the sixth embodiment, the
[0036]
As described above, according to the seventh embodiment, an effect of shortening the system stop time can be obtained by making the stop detection time of the CPU in use variable.
[0037]
The eighth embodiment of the present invention will be described below.
FIG. 8 is a block diagram showing a configuration of a memory access apparatus according to
8, 1 to 5 and 10 are the same as those in FIG. A
The configuration of FIG. 8 is a configuration in which a
[0038]
Next, the operation will be described.
When it is detected by the
[0039]
As described above, according to the eighth embodiment, as a measure for stopping the CPU, it is possible to obtain an effect of preventing the CPU that is using the
[0040]
Embodiment 9 FIG.
The ninth embodiment of the present invention will be described below.
FIG. 9 is a block diagram showing the structure of a memory access device according to Embodiment 9 of the present invention.
9, 1 to 6 are the same as those in FIG.
FIG. 9 shows a configuration in which an access reservation FIFO 14 and a permission register 15 are added to the
[0041]
Next, the operation will be described.
In the operation of the first embodiment, while the CPU in use occupies the
[0042]
As described above, according to the ninth embodiment, the access reservation of the
[0043]
The tenth embodiment of the present invention will be described below.
FIG. 10 is a block diagram showing a configuration of a memory access apparatus according to
10, 1-7b, 14, and 15 are the same as those in FIG. Reference numeral 16 denotes a timer provided in the
FIG. 10 shows a configuration in which a timer 16 is added to the
[0044]
Next, the operation will be described.
In the operation of the ninth embodiment, if the CPU given the right to acquire the
[0045]
As described above, according to the tenth embodiment, it is possible to obtain an effect of preventing the CPU given the access right to the
Further, when the remaining
[0046]
【The invention's effect】
Since the present invention is configured as described above, the following effects can be obtained.
In a memory access device that performs exclusive control when a plurality of CPUs sharing the memory access the memory, an exclusive control flag in which a value indicating whether or not the memory is used is written by one of the CPUs is used. The remaining capacity counter indicating the remaining capacity of the amount of data read and written by the CPU in the inside, and when the remaining capacity counter is stopped during the stop detection time, the stop of the remaining capacity counter is detected and the stop detection time is set as the processing contents of the CPU. The other CPUs that are not using the memory are provided with a stop detection circuit that is variable according to the reference to the remaining capacity counter, and by reading the exclusive control flag after elapse of the time corresponding to the remaining capacity of the remaining capacity counter, with determining whether to use the memory, the stop detection circuit, when the stop of the remaining capacity counter is detected, the exclusive system Flag, since rewritten in not in use from the value indicating that the use value, another CPU not in use, by reference to the remaining capacity counter, it is possible to eliminate the waiting time of another CPU is not in use In addition to eliminating the impact on the processing speed of the CPU that is using the memory, it is possible to prevent the exclusive use of the memory and the system from being stopped due to the stop of the CPU that is using the memory. System operation can prevent unnecessary system stoppage.
[0047]
Also, in a memory access device that performs exclusive control when a plurality of CPUs sharing the memory access the memory, an exclusive control flag in which a value indicating whether or not the memory is used by one of the CPUs is written, the memory A remaining capacity counter indicating the remaining capacity of the amount of data read and written by the CPU using the CPU , and the remaining capacity counter is stopped during the stop detection time, thereby detecting the stop of the remaining capacity counter and the stop detection time of the CPU. It is equipped with a stop detection circuit that can be changed according to the processing contents, and the exclusive control flag and the remaining capacity counter are integrated so that they can be read simultaneously by one reading, and other CPUs not using the memory can The value determines whether the memory can be used. If the memory cannot be used due to the value of the exclusive control flag, read Issued read the remaining capacity counter exclusive control flag and the remaining capacity counter is integrated again after a lapse of time corresponding to the remaining capacity of, have rows determination, by the stop detection circuit, when the stop of the remaining capacity counter is detected, Since the exclusive control flag is rewritten from a value indicating in-use to a value not in use, other CPUs that are not in use can refer to information of both the remaining capacity counter and the exclusive control flag by one-time reading. It is possible to eliminate the waiting time of other CPUs that are not, can eliminate the influence on the processing speed of the CPU that is using the memory, and occupy the memory and stop the system by stopping the CPU that is using the memory. In addition, the stop detection circuit can be operated flexibly to prevent useless system stop.
[0048]
In addition, in a memory access device that performs exclusive control when a plurality of CPUs sharing the memory access the memory, an exclusive control flag in which a value indicating whether the memory is used by one of the CPUs is written, the memory The remaining capacity counter indicating the remaining capacity of the amount of data read and written by the CPU using the CPU, the waiting time table indicating the relationship between the remaining capacity of the remaining capacity counter and the waiting time, and the waiting time table based on the remaining capacity of the remaining capacity counter Stop detection that makes the remaining capacity counter variable according to the processing contents of the CPU while detecting the stop of the remaining capacity counter by the waiting time register that stores the obtained waiting time and the remaining capacity counter stopping for the stop detection time comprising a circuit, other CPU is not in use the memory refers to the waiting time register, waiting time register By reading the waiting time after the exclusive control flag, used with determining whether to use the memory, the stop detection circuit, when the stop of the remaining capacity counter is detected, the exclusive control flag from the value indicating that the use Since it can be rewritten to a value that is not in the middle, it is only necessary to prepare one waiting time register in the memory access device, which can reduce the cost of the entire system, eliminate the waiting time of other CPUs that are not in use , and memory It is possible to prevent the exclusive use of the memory and the system stop due to the stop of the CPU that is using the system, and further, the stop detection circuit can be operated flexibly to prevent the unnecessary system stop.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a memory access device according to a first embodiment of the present invention.
FIG. 2 is a block diagram showing a configuration of a memory access device according to a second embodiment of the present invention.
FIG. 3 is a block diagram showing a configuration of a memory access device according to a third embodiment of the present invention.
FIG. 4 is a block diagram showing a configuration of a memory access device according to a fourth embodiment of the present invention.
FIG. 5 is a block diagram showing a configuration of a memory access device according to a fifth embodiment of the present invention.
FIG. 6 is a block diagram showing a configuration of a memory access device according to a sixth embodiment of the present invention.
FIG. 7 is a block diagram showing a configuration of a memory access device according to a seventh embodiment of the present invention.
FIG. 8 is a block diagram showing a configuration of a memory access apparatus according to an eighth embodiment of the present invention.
FIG. 9 is a block diagram showing a configuration of a memory access device according to a ninth embodiment of the present invention.
FIG. 10 is a block diagram showing a configuration of a memory access device according to a tenth embodiment of the present invention.
FIG. 11 is a block diagram showing a configuration of a conventional memory access device.
[Explanation of symbols]
1 memory access device, 2a, 2b CPU, 3 memory,
4 memory map I / O, 5 exclusive control flag, 6 remaining capacity counter,
7 0 comparison circuit, 8 wait time table, 9 wait time register,
10 write remaining capacity counter, 11 read permission flag,
12 stop detection circuit, 13 processing time table,
14 Access reservation FIFO, 15 permission register, 16 timer.
Claims (3)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002272964A JP3822852B2 (en) | 2002-09-19 | 2002-09-19 | Memory access device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2002272964A JP3822852B2 (en) | 2002-09-19 | 2002-09-19 | Memory access device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2004110484A JP2004110484A (en) | 2004-04-08 |
JP3822852B2 true JP3822852B2 (en) | 2006-09-20 |
Family
ID=32269850
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2002272964A Expired - Fee Related JP3822852B2 (en) | 2002-09-19 | 2002-09-19 | Memory access device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3822852B2 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7300045B2 (en) | 2004-09-28 | 2007-11-27 | Toshiba Tec Kabushiki Kaisha | Waiting tray for sheet processing tray |
JP2006099214A (en) * | 2004-09-28 | 2006-04-13 | Toshiba Tec Corp | Shared memory access control device |
US20100017560A1 (en) * | 2006-09-13 | 2010-01-21 | Panasonic Corporation | Memory controller, nonvolatile memory device, access device, and nonvolatile memory system |
JP4920567B2 (en) * | 2007-12-12 | 2012-04-18 | 三菱電機株式会社 | Equipment network system and data access control method |
JP6090492B1 (en) | 2016-03-18 | 2017-03-08 | 日本電気株式会社 | MEMORY ACCESS CONTROL DEVICE, INFORMATION PROCESSING SYSTEM, MEMORY ACCESS CONTROL METHOD, AND PROGRAM |
-
2002
- 2002-09-19 JP JP2002272964A patent/JP3822852B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2004110484A (en) | 2004-04-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP0543560B1 (en) | Arbitrating multiprocessor accesses to shared resources | |
JP3634932B2 (en) | Spin buffer and method for maintaining data integrity | |
US6976109B2 (en) | Multi-level and multi-resolution bus arbitration | |
JPS5812611B2 (en) | Data Tensou Seigiyohoushiki | |
US4979099A (en) | Quasi-fair arbitration scheme with default owner speedup | |
KR101050019B1 (en) | Memory interface for systems with multiple processors and one memory system | |
US20080288687A1 (en) | Information processing device and processor | |
US6839811B2 (en) | Semaphore management circuit | |
GB2287159A (en) | Initialization mechanism for symmetric arbitration agents | |
US5894562A (en) | Method and apparatus for controlling bus arbitration in a data processing system | |
JP3822852B2 (en) | Memory access device | |
US6279066B1 (en) | System for negotiating access to a shared resource by arbitration logic in a shared resource negotiator | |
JP2005293596A (en) | Arbitration of data request | |
US6263425B1 (en) | Circuit that implements semaphores in a multiprocessor environment without reliance on atomic test and set operations of the processor cores | |
US20030051103A1 (en) | Shared memory system including hardware memory protection | |
US6708240B1 (en) | Managing resources in a bus bridge | |
US6502150B1 (en) | Method and apparatus for resource sharing in a multi-processor system | |
US7313642B2 (en) | Bus bridge arbitration method | |
JP2004062910A (en) | Method for realizing semaphore to multi-core processor and controlling access to common resource | |
JP2005165508A (en) | Direct memory access controller | |
JP2010092101A (en) | Information processor | |
JP3236459B2 (en) | Error handling device in common bus data transfer | |
US20010005870A1 (en) | External bus control system | |
JP3517987B2 (en) | Circuit for preventing double setting of direct memory access | |
JP2856761B2 (en) | Resource lock management device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20040108 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20060125 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20060131 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20060403 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20060425 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20060530 |
|
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: 20060620 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20060623 |
|
LAPS | Cancellation because of no payment of annual fees |