JP3822852B2 - Memory access device - Google Patents

Memory access device Download PDF

Info

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
Application number
JP2002272964A
Other languages
Japanese (ja)
Other versions
JP2004110484A (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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2002272964A priority Critical patent/JP3822852B2/en
Publication of JP2004110484A publication Critical patent/JP2004110484A/en
Application granted granted Critical
Publication of JP3822852B2 publication Critical patent/JP3822852B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

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 CPUs 2a and 2b, and 4 is a memory map I / O. Reference numeral 5 denotes an exclusive control flag having a free value indicating that no one is using the shared resource and an identifier indicating the user. The memory access device 1 has an exclusive control flag 5 as a basic configuration.
[0003]
Next, the operation will be described.
The CPU 2 a that wants to acquire the memory 3 reads the exclusive control flag 5. If the exclusive control flag 5 is a value indicating free, the CPU 2a acquires the memory 3, and the exclusive control flag 5 changes from the free value in hardware to the identifier of the CPU 2a that acquired the memory 3. When the CPU 2 a (CPU in use) that has acquired the memory 3 releases the memory 3, a free value is written in the exclusive control flag 5.
When the CPU 2a reads the exclusive control flag 5, if it is not a free value, it determines that another CPU is using the memory 3, and waits until the exclusive control flag 5 becomes a free value.
[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 CPU 2a is accessing the memory 3, the other CPU 2b continues to read the exclusive control flag 5, and the bus is connected each time. Due to the exclusive use, there was a problem that part or all of the processing of the CPU stopped.
[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
Embodiment 1 FIG.
Embodiment 1 of the present invention will be described below with reference to the drawings.
FIG. 1 is a block diagram showing a configuration of a memory access apparatus according to Embodiment 1 of the present invention.
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 CPUs 2a and 2b, and 4 is a memory map I / O. Reference numeral 5 denotes an exclusive control flag having a value indicating the presence or absence of the CPU that has acquired the memory 3. Reference numeral 6 denotes a remaining capacity counter that indicates the remaining capacity of the amount of data read and written by the CPU that has acquired the memory 3, and 7 is a 0 comparison circuit that detects that the remaining capacity counter 6 has become zero. The memory access device 1 includes an exclusive control flag 5, a remaining capacity counter 6, and a 0 comparison circuit 7.
[0014]
Next, the operation of the memory access device configured as described above will be described.
The CPU 2 a that wants to acquire the memory 3 reads the exclusive control flag 5.
If the exclusive control flag 5 is a value indicating that there is no CPU that has acquired the memory 3 (0 in this description), the CPU 2 a can acquire the memory 3. At this time, the exclusive control flag 5 changes from 0 to a value indicating that the CPU 2a that has acquired the memory 3 is present (in this case, 1). When the CPU 2a reads the exclusive control flag 5, if it is 1, the CPU 2a cannot acquire the memory 3, and the exclusive control flag 5 does not change.
[0015]
The CPU 2a (the CPU in use) that has acquired the memory 3 writes the amount of data to be read / written to / from the memory 3 into the remaining capacity counter 6 and starts the read / write process.
The remaining capacity counter 6 is decremented by hardware every time the memory 3 is read or written.
[0016]
When a CPU other than the CPU being used wants to acquire the memory 3, the remaining capacity counter 6 is referred to. Each CPU is provided with a waiting time table indicating the relationship between the remaining capacity and time in advance, so that it is possible to know how long the memory 3 will be occupied later. Even when the memory 3 is exclusively used by another CPU, the exclusive control flag 5 may be referred to after the exclusive time, and it is not necessary to read the exclusive control flag 5 continuously.
When the remaining capacity counter 6 becomes 0, the exclusive control flag 5 is changed from 1 to 0 by hardware by the 0 comparison circuit 7.
[0017]
As described above, according to the first embodiment, the CPU other than the CPU being used refers to the remaining capacity counter 6, so that the waiting time of the CPU other than the CPU being used can be eliminated. Moreover, there is an effect that the influence of the processing speed of the CPU that exclusively uses the memory can be eliminated.
[0018]
Embodiment 2. FIG.
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 Embodiment 2 of the present invention.
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 capacity counter 6 is integrated with the exclusive control flag 5. Other configurations are the same as those in the first embodiment.
[0019]
Next, the operation will be described.
In the first embodiment, when the memory 3 is exclusively used, the read process is required twice, such as the exclusive control flag 5 for the first time and the remaining capacity counter 6 for the second time. 2, by integrating the remaining capacity counter 6 with the exclusive control flag 5, it is possible to read both the remaining capacity counter 6 and the exclusive control flag 5 and refer to the information by one reading.
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 capacity counter 6 and the exclusive control flag 5 by one reading. An effect that can be eliminated is obtained.
[0021]
Embodiment 3 FIG.
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 Embodiment 3 of the present invention.
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 capacity counter 6 and time, 9 is a waiting time register for storing the waiting time obtained by the waiting time table 8, and 8 and 9 are provided in the memory access device 1. It has been.
[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 memory access device 1. In this case, a CPU other than the CPU in use can know the waiting time by referring to the waiting time register 9.
[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]
Embodiment 4 FIG.
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 Embodiment 4 of the present invention.
In FIG. 4, 1 to 5 are the same as those in FIG. Reference numeral 10 denotes a remaining write capacity counter indicating the remaining write capacity.
FIG. 4 includes a write remaining capacity counter 10 in the memory access device 1 in place of the remaining capacity counter 6 and the 0 comparison circuit 7 of the first embodiment.
[0025]
Next, the operation will be described.
The CPU 2a that has acquired the memory 3 stores the amount of data to be written in the memory 3 in the remaining write capacity counter 10 and starts processing. The remaining write capacity counter 10 is subtracted every time there is a write from the CPU in use in the memory 3 in terms of hardware, and counts the remaining write capacity. CPUs other than the CPU being used refer to the remaining write capacity counter 10 and have a waiting time table in the CPU in advance, so that how much time memory 3 remains dedicated to the writing of the CPU being used. Can know.
When the remaining write capacity counter 10 becomes 0, even if the exclusive control flag 5 does not become 0, only reading is possible, and CPUs other than the CPU in use can read from the memory 3 and the process proceeds. The CPU in use writes 0 to the exclusive control flag 5 after completing the reading process.
[0026]
As described above, according to the fourth embodiment, even when the exclusive control flag 5 does not become 0, when all writing to the memory 3 of the CPU being used is completed, the CPU other than the CPU being used is in memory. Since reading from 3 can be performed, an effect of eliminating the waiting time of the CPU can be obtained.
[0027]
Embodiment 5 FIG.
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 Embodiment 5 of the present invention.
In FIG. 5, 1 to 5 and 10 are the same as those in FIG. Reference numeral 11 denotes a read permission flag.
FIG. 5 is obtained by adding a read permission flag 11 to the memory access device 1 according to the fourth embodiment. Other configurations are the same as those of the fourth embodiment.
[0028]
Next, the operation will be described.
In the fifth embodiment, by adding a read permission flag 11 in the memory access device 1, it is possible to permit reading out of reading and writing to the memory 3 from other than the CPU in use. By doing so, it becomes possible for CPUs other than the CPU in use to continue processing. However, when a CPU other than the CPU being used reads a large amount of data from the memory 3, the reading / writing speed of the CPU being used to the memory 3 is reduced. By not allowing permission, the reading and writing speed is prevented from decreasing.
[0029]
As described above, according to the fifth embodiment, the exclusive control of the writing to the memory 3 is performed, and the reading from the memory 3 is normally released, thereby obtaining the effect of improving the working efficiency of all the CPUs.
[0030]
Embodiment 6 FIG.
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 Embodiment 6 of the present invention.
In FIG. 6, 1 to 7 are the same as those in FIG. A stop detection circuit 12 is provided in the memory access device 1 and detects the stop of the remaining capacity counter 6 when the remaining capacity counter 6 stops during the stop detection time.
The configuration of FIG. 6 is obtained by adding a stop detection circuit 12 to the memory access device 1 of the first embodiment. Other configurations are the same as those of the first embodiment.
[0032]
Next, the operation will be described.
In the operation of the first embodiment, when the stop detection circuit 12 detects that the remaining capacity counter 6 has stopped for a certain period of time, it is considered that the CPU being used has stopped, and the exclusive control flag 5 is set in hardware. Return to zero.
[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 memory 3 from being left and stopping the system.
[0034]
Embodiment 7 FIG.
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 Embodiment 7 of the present invention.
In FIG. 7, 1 to 7 and 12 are the same as those in FIG. Reference numeral 13 denotes a processing time table provided in the memory access device 1 and showing the relationship between the processing contents of the CPU and the processing time.
FIG. 7 shows a configuration in which a processing time table 13 is added to the memory access device 1 of the sixth embodiment. Other configurations are the same as those of the sixth embodiment.
[0035]
Next, the operation will be described.
In addition to the operation of the sixth embodiment, the memory access device 1 has a processing time table 13 indicating the relationship between the processing contents of the CPU and the processing time, so that the stop detection circuit 12 can be selected according to the processing contents of the CPU being used. The stop detection time can be made variable.
[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]
Embodiment 8 FIG.
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 Embodiment 8 of the present invention.
8, 1 to 5 and 10 are the same as those in FIG. A stop detection circuit 12 is provided in the memory access device 1 and detects the stop of the remaining write capacity counter 10.
The configuration of FIG. 8 is a configuration in which a stop detection circuit 12 is added to the memory access device 1 of the fourth embodiment. Other configurations are the same as those of the fourth embodiment.
[0038]
Next, the operation will be described.
When it is detected by the stop detection circuit 12 that the exclusive control flag 5 does not become 0 for a certain period (predetermined time) after the remaining write capacity counter 10 becomes 0, it is considered that the CPU in use has stopped and exclusive control is performed. Return flag 5 to 0 in hardware.
[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 memory 3 from being left and stopping the system.
[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. Reference numerals 7a and 7b denote 0 comparison circuits, reference numeral 14 denotes an access reservation FIFO in which an access reservation to the memory is registered, and reference numeral 15 denotes an permission register for granting access permission in the order of registration in the access reservation FIFO 14.
FIG. 9 shows a configuration in which an access reservation FIFO 14 and a permission register 15 are added to the memory access device 1 of the first embodiment, and the number of 0 comparison circuits is increased to two. Other configurations are the same as those of the first embodiment.
[0041]
Next, the operation will be described.
In the operation of the first embodiment, while the CPU in use occupies the memory 3, the CPU other than the CPU in use assigns its identification ID prepared in advance to the access reservation FIFO 14 in advance. Register. When the CPU in use releases the memory 3, if the exclusive control flag 5 is confirmed to be 0 by the 0 comparison circuit 7b, the acquisition of the memory 3 is prioritized in the order of the CPUs registered in the access reservation FIFO 14. Given. A plurality of identical CPU identification IDs cannot be registered in the access reservation FIFO 14.
[0042]
As described above, according to the ninth embodiment, the access reservation of the memory 3 can be performed, and the effect of preventing continuous writing by the same CPU is obtained.
[0043]
Embodiment 10 FIG.
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 Embodiment 10 of the present invention.
10, 1-7b, 14, and 15 are the same as those in FIG. Reference numeral 16 denotes a timer provided in the memory access device 1.
FIG. 10 shows a configuration in which a timer 16 is added to the memory access device 1 of the ninth embodiment. Other configurations are the same as those of the ninth embodiment.
[0044]
Next, the operation will be described.
In the operation of the ninth embodiment, if the CPU given the right to acquire the memory 3 does not try to access the memory 3 for a certain period of time by the timer 16, the CPU in the next order registered in the access reservation FIFO 14 Access rights are granted.
[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 memory 3 from keeping the access right and stopping the system.
Further, when the remaining capacity counter 6 becomes 0, an effect of preventing the CPU other than the CPU being used from concentrating reading the exclusive control flag 5 can be obtained.
[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)

メモリを共有する複数の中央処理装置(以下CPUという)が上記メモリをアクセスするときの排他制御を行うメモリアクセス装置において、上記CPUの一つにより上記メモリが使用されているか否かを示す値が書き込まれた排他制御フラグ、上記メモリを使用中のCPUによって読み書きされるデータ量の残容量を示す残容量カウンタ、この残容量カウンタが停止検出時間の間停止することにより、残容量カウンタの停止を検出すると共に上記停止検出時間をCPUの処理内容に応じて可変にする停止検出回路を備え、上記メモリを使用中でない他のCPUは、上記残容量カウンタを参照して、上記残容量カウンタの残容量に応じた時間経過後に上記排他制御フラグを読み出すことにより、上記メモリの使用の可否を判定すると共に、上記停止検出回路により、上記残容量カウンタの停止が検出されたときには、上記排他制御フラグは、使用中を示す値から使用中でない値に書き換えられることを特徴とするメモリアクセス装置。  In a memory access device that performs exclusive control when a plurality of central processing units (hereinafter referred to as CPUs) sharing a 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 / written by the CPU using the memory, and the remaining capacity counter is stopped during the stop detection time, thereby stopping the remaining capacity counter. A stop detection circuit that detects and stops the stop detection time 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 remaining capacity counter. By reading the exclusive control flag after the time corresponding to the capacity has elapsed, it is determined whether or not the memory can be used. The stop detection circuit, when the stop of the remaining capacity counter is detected, the exclusive control flag memory access device, characterized by being rewritten not in use from the value indicating that the use value. メモリを共有する複数のCPUが上記メモリをアクセスするときの排他制御を行うメモリアクセス装置において、上記CPUの一つにより上記メモリが使用されているか否かを示す値が書き込まれた排他制御フラグ、上記メモリを使用中のCPUによって読み書きされるデータ量の残容量を示す残容量カウンタ、この残容量カウンタが停止検出時間の間停止することにより、残容量カウンタの停止を検出すると共に上記停止検出時間をCPUの処理内容に応じて可変にする停止検出回路を備え、上記排他制御フラグと上記残容量カウンタは、一回の読み出しで同時に読み出されるように統合され、上記メモリを使用中でない他のCPUは、上記排他制御フラグの値により、上記メモリの使用の可否を判定すると共に、上記排他制御フラグの値により、上記メモリの使用が不可の場合は、上記読み出された上記残容量カウンタの残容量に応じた時間経過後に再度統合された排他制御フラグ及び残容量カウンタを読み出し、上記判定を行い、上記停止検出回路により、上記残容量カウンタの停止が検出されたときには、上記排他制御フラグは、使用中を示す値から使用中でない値に書き換えられることを特徴とするメモリアクセス装置。  In a memory access device that performs exclusive control when a plurality of CPUs sharing a 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, A 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 stop of the remaining capacity counter and the stop detection time. The CPU includes a stop detection circuit that makes the CPU variable according to the processing contents of the CPU, and the exclusive control flag and the remaining capacity counter are integrated so as to be read simultaneously by one reading, and other CPUs not using the memory Determines whether or not the memory can be used based on the value of the exclusive control flag, and determines the value of the exclusive control flag. If the use of the memory is not possible, the exclusive control flag and the remaining capacity counter that are integrated again after a lapse of time according to the remaining capacity of the read remaining capacity counter are read, the determination is performed, and the The memory access device, wherein when the stop of the remaining capacity counter is detected by a stop detection circuit, the exclusive control flag is rewritten from a value indicating in use to a value not in use. メモリを共有する複数のCPUが上記メモリをアクセスするときの排他制御を行うメモリアクセス装置において、上記CPUの一つにより上記メモリが使用されているか否かを示す値が書き込まれた排他制御フラグ、上記メモリを使用中のCPUによって読み書きされるデータ量の残容量を示す残容量カウンタ、この残容量カウンタの残容量と待ち時間の関係を示す待ち時間テーブル、上記残容量カウンタの残容量に基づき上記待ち時間テーブルにより得られる待ち時間を格納する待ち時間レジスタ、上記残容量カウンタが停止検出時間の間停止することにより、残容量カウンタの停止を検出すると共に上記停止検出時間をCPUの処理内容に応じて可変にする停止検出回路を備え、上記メモリを使用中でない他のCPUは、上記待ち時間レジスタを参照して、上記待ち時間レジスタの待ち時間経過後に上記排他制御フラグを読み出すことにより、上記メモリの使用の可否を判定すると共に、上記停止検出回路により、上記残容量カウンタの停止が検出されたときには、上記排他制御フラグは、使用中を示す値から使用中でない値に書き換えられることを特徴とするメモリアクセス装置。 In a memory access device that performs exclusive control when a plurality of CPUs sharing a 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, Based on the remaining capacity counter indicating the remaining capacity of the amount of data read and written by the CPU using the memory, the waiting time table indicating the relationship between the remaining capacity and the waiting time of the remaining capacity counter, and the remaining capacity based on the remaining capacity of the remaining capacity counter A waiting time register for storing the waiting time obtained from the waiting time table, 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 according to the processing contents of the CPU. Other CPUs that are not using the memory are provided with a stop detection circuit that is variable. The exclusive control flag is read after the waiting time of the waiting time register has elapsed with reference to the star to determine whether or not the memory can be used, and the stop detection circuit detects the stop of the remaining capacity counter. when the can, the exclusive control flag memory access equipment, characterized by being rewritten not in use from the value indicating that the use value.
JP2002272964A 2002-09-19 2002-09-19 Memory access device Expired - Fee Related JP3822852B2 (en)

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)

* Cited by examiner, † Cited by third party
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

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