JPH03127162A - How to access CPU shared memory - Google Patents
How to access CPU shared memoryInfo
- Publication number
- JPH03127162A JPH03127162A JP26746189A JP26746189A JPH03127162A JP H03127162 A JPH03127162 A JP H03127162A JP 26746189 A JP26746189 A JP 26746189A JP 26746189 A JP26746189 A JP 26746189A JP H03127162 A JPH03127162 A JP H03127162A
- Authority
- JP
- Japan
- Prior art keywords
- access
- shared memory
- cpu
- instruction
- wait
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Multi Processors (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は、共有メモリ方式のマルチCPUシステムにお
いて、ウェイト/ホールド機能を持たないCPUが共有
メモリをアクセスする場合のアクセス方法に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an access method when a CPU without a wait/hold function accesses a shared memory in a shared memory multi-CPU system.
従来のウェイト/ホールド機能を持たないCPUを使用
した場合の共有メモリのアクセス方法を第5図と第6図
に基づいて説明する。A shared memory access method when using a conventional CPU without a wait/hold function will be explained based on FIGS. 5 and 6.
第5図は従来の共有メモリ20とその周辺回路のブロッ
ク図である。図において、1はウェイト/ホールド機能
付CPU、2はウェイト/ホールド機能なしCPUであ
り、両者は共有メモリ20に共通にアクセス可能な構成
となっている。3^、 3Bは要求フラグ、4^、
4Bはアドレスバッファ、5^、 5Bはデータバッフ
ァ、6^、 6Bはコントロールゲート、7A、 7B
+*デコーダを示している。FIG. 5 is a block diagram of a conventional shared memory 20 and its peripheral circuits. In the figure, 1 is a CPU with a wait/hold function, and 2 is a CPU without a wait/hold function, both of which are configured to be able to access the shared memory 20 in common. 3^, 3B is the request flag, 4^,
4B is address buffer, 5^, 5B is data buffer, 6^, 6B is control gate, 7A, 7B
+*Indicates decoder.
第61!Iはウェイト/ホールド機能付CPUIに搭載
される共有メモリ20にアクセスするときに使用するプ
ログラムのフローチャートである。61st! I is a flowchart of a program used when accessing the shared memory 20 installed in the CPUI with wait/hold function.
ウェイト/ホールド機能なしCPU2に搭載されるプロ
グラムについても、第6図でCPU1゜CPU2をそt
LぞtLCPU2.CPUIと置き−換えることにより
実現することができる。Regarding the program installed in CPU2 without wait/hold function, CPU1°CPU2 is also removed in Figure 6.
LzotLCPU2. This can be realized by replacing the CPUI.
従来の例では、いずれかのCPUが共有メモリ20をア
クセスする場合、他方のCPUがすでに共有メモリ20
を使用していないか要求フラグ3A、 3Bをチエツク
し、使用していなければ要求フラグ3A3Bをセットす
ることにより、他方のCPUに共有メモリ20を使用す
ることを宣言し、他方のCPUが使用していれば使用し
終わるまで待つ。In the conventional example, when either CPU accesses the shared memory 20, the other CPU has already accessed the shared memory 20.
Check request flags 3A and 3B to see if they are being used, and if not, set request flag 3A3B to declare that the shared memory 20 will be used by the other CPU. If so, wait until it is finished using.
次に要求フラグ3A、 3Bをセットすると同時に他方
のCPUが要求フラグ3^、 3Bをセットしていない
かチエツクし、セットしていれば共有メモリ20のアク
セスが競合したと判断して、自分の要求フラグ3A、
3Bをクリアし、競合タイマをセットした後、タイムオ
ーバを待って再び要求フラグ3^、 3Bをチエツクす
る。他方のCPUが要求フラグ3A。Next, at the same time as request flags 3A and 3B are set, the other CPU checks whether the request flags 3^ and 3B are set. request flag 3A,
After clearing 3B and setting the contention timer, wait for timeout and check request flag 3^ and 3B again. The other CPU has the request flag 3A.
3Bをセットしていなければアクセスしていないと判断
して、共有メモリ20をアクセスした後、要求フラグ3
^、 3Bをクリアすることにより、他方のCPUが共
有メモリ20をアクセスできるようにしておく。If 3B is not set, it is determined that no access is being made, and after accessing the shared memory 20, the request flag 3 is set.
By clearing 3B, the other CPU can access the shared memory 20.
従来の技術では、たかだか1バイトの共有メモリ内のデ
ータをアクセスする場合にも第6図に示す多くのプログ
ラムを必要とするため、アクセスに時間がかかっていた
。In the conventional technology, even when accessing data in a shared memory of at most 1 byte, many programs as shown in FIG. 6 are required, so access takes time.
さらに、他方のCPUが共有メモリのアクセスをブロッ
ク単位(複数バイトからなる)で実行すると、相手のC
PUが使用し終わるまで待つための待ち時間が長くなり
、その結果さらにアクセスに時間ガかかることになって
いた。Furthermore, if the other CPU accesses the shared memory in block units (consisting of multiple bytes), the other CPU
The waiting time for waiting until the PU is finished being used increases, and as a result, access takes even more time.
そこで本発明は、アクセス時間の短縮を図ることを目的
とする。Therefore, an object of the present invention is to shorten the access time.
この目的を達成するため、本発明のCPUの共有メモリ
のアクセス方法は、ウェイト/ホールド機能を持たない
CPUの共有メモリのアクセス方法において、前記CP
Uが共有メモリをアクセスしようとした時、他方のCP
Uが共有メモリをアクセスしていない場合にはそのまま
続けてアクセスし、他方のCPUが共有メモリをアクセ
スしている場合にはこれから実行するアクセス命令を無
効とし、後続の命令を強制的にジャンプ命令に変更する
ことにより無効にされたアクセス命令を再実行させるこ
とを特徴とする。To achieve this object, the CPU shared memory access method of the present invention includes a CPU shared memory access method that does not have a wait/hold function.
When U attempts to access shared memory, the other CP
If U is not accessing the shared memory, it will continue to access it; if the other CPU is accessing the shared memory, it will invalidate the access instruction to be executed and force the subsequent instruction to jump. This feature is characterized in that an access command that has been invalidated is re-executed by changing it to .
上記手段により、ウェイ、ト/ホールド機能を持たない
CPUが共有メモリをアクセスしようとする場合、競合
を調停するためのソフトウェアは一切必要としないので
、ソフトウェアが簡単になるとともに、共有メモリをア
クセスするために要する時間が格段に短くなる。By the above means, when a CPU without a wait/hold function attempts to access shared memory, no software is required to arbitrate the conflict, which simplifies the software and makes it easier to access shared memory. The time required for this is significantly reduced.
以下、本発明の実施例を第1図〜第4図に示す実施例に
基づいて具体的に説明する。Embodiments of the present invention will be specifically described below based on the embodiments shown in FIGS. 1 to 4.
第1図は本発明による共有メモリとその周辺回路のブロ
ック図であり、ウェイト/ホールド機能付きCPU 1
とウェイト/ホールド機能なしのCPU2を含んでいる
。なお、第5図の従来例と対応する機能を有する要素に
ついては同一の符号を付して説明を省略する。第1図中
、8はアドレスバス、9はデータバスを示している。FIG. 1 is a block diagram of a shared memory and its peripheral circuits according to the present invention, and includes a CPU 1 with a wait/hold function.
and a CPU2 without a wait/hold function. Note that elements having functions corresponding to those of the conventional example shown in FIG. 5 are designated by the same reference numerals, and description thereof will be omitted. In FIG. 1, 8 represents an address bus, and 9 represents a data bus.
第1図の競合調停回路10は、CPU1から共有メモリ
20のアクセス要求信号15^が来た場合には、他方の
CPU2がアクセス中でなければウェイト信号16をオ
フすることにより、共有メモリ20のアクセスを許可し
、他方のCPU2がアクセス中であればウェイト信号1
6をオンすることにより、アクセス実行を待たせたまま
にしておき、他方のCPU2がアクセス動作を完了した
後、ウェイト信号16をオフすることによりアクセスを
許可する機能を持つ。一方CPU2から共有メモリ20
のアクセス要求信号15Bが来た場合には、他方のCP
U1がアクセス中でなければアクセス無効信号17をオ
フすることにより共有命令のアクセスを実行させ、他方
のCPUIがアクセス中であればアクセス無効信号17
をオンすることにより共有メモリ20のアクセスを禁止
させるとともに、命令シーケンス制御回路11に対して
命令シーケンスの変更を要求する機能を持つ。When the contention arbitration circuit 10 in FIG. 1 receives an access request signal 15^ for the shared memory 20 from the CPU 1, it turns off the wait signal 16 if the other CPU 2 is not accessing the shared memory 20. Access is permitted, and if the other CPU2 is accessing, wait signal 1
6 is turned on, the execution of the access is kept waiting, and after the other CPU 2 completes the access operation, the wait signal 16 is turned off to permit access. On the other hand, from CPU2 to shared memory 20
When the access request signal 15B of the other CP is received, the other CP
If U1 is not accessing, the access invalidation signal 17 is turned off to execute the shared instruction access, and if the other CPUI is accessing, the access invalidation signal 17 is turned off.
It has the function of prohibiting access to the shared memory 20 by turning on the switch and requesting the instruction sequence control circuit 11 to change the instruction sequence.
第1図の命令シーケンス制御回路11は、アクセス無効
信号17がオフであれば、命令ソースマルチプレクサ1
4の入力をプログラムメモリとすることにより、通常の
処理を実行するが、アクセス無効信号17がオンであれ
ば現在実行中のアクセス命令実行後、命令ソースマルチ
プレクサ14の人力をジャンプ命令発生回路13に切り
換えることにより、再度アクセス命令ヘジャンブさせる
機能を持つ。If the access invalidation signal 17 is off, the instruction sequence control circuit 11 in FIG.
4 is input to the program memory, normal processing is executed. However, if the access invalidation signal 17 is on, the human power of the instruction source multiplexer 14 is transferred to the jump instruction generation circuit 13 after executing the access instruction currently being executed. By switching, it has the function of jumping to the access command again.
次に実施例における動作について説明する。CPU2が
共有メモリ20をアクセスしようとしたとき、CPU1
が共有メモリ20をアクセスしていなかったなら、競合
調停回路10はアクセス無効信号17をオフするので、
CPU2のアドレスバッファ4Bとデータバッファ5B
とコントロールゲート6Bが開かれ、共有メモリ20の
アクセスが可能となる。Next, the operation in the embodiment will be explained. When CPU2 attempts to access shared memory 20, CPU1
is not accessing the shared memory 20, the contention arbitration circuit 10 turns off the access invalidation signal 17.
Address buffer 4B and data buffer 5B of CPU2
The control gate 6B is opened and the shared memory 20 can be accessed.
また、アクセス無効信号17がオフであるので、命令ソ
ースマルチプレクサ14もプログラムメモリ12を選択
し、通常のシーケンス通りにプログラムを実行する。Furthermore, since the access invalidation signal 17 is off, the instruction source multiplexer 14 also selects the program memory 12 and executes the program according to the normal sequence.
一方、CPU2が共有メモリ20をアクセスしようとし
たとき、既に(:PUlが共有メモリ20をアクセスし
ていたならば競合調停回路10はアクセス無効信号15
をオンにするので、CPU2のアドレスバッファ4日と
f−タバッフ75Bとコントロールゲート6Bは閉じた
ままとなり、共有メモリ20への書込みと読出しは正し
く実行されないで無効となる。またアクセス無効信号1
7がオンであるため、命令シーケンス制御回路11は共
有メモリ20への無効なアクセス命令を実行した後、命
令ソースマルチプレクサ14の入力を無効としたアクセ
ス命令が格納されているプログラムメモリ番地へジャン
プするジャンプ命令が格納されているジャンプ命令発生
回路13に切り換えることにより、ソフトウェアの介在
なしに共有メモリ20へのアクセスを再実行する。On the other hand, when the CPU 2 tries to access the shared memory 20, if the (:PUl) has already accessed the shared memory 20, the contention arbitration circuit 10 sends the access invalidation signal
is turned on, the address buffer 4, f-ta buffer 75B, and control gate 6B of the CPU 2 remain closed, and writing and reading to and from the shared memory 20 are not executed correctly and become invalid. Also, access invalid signal 1
7 is on, the instruction sequence control circuit 11 executes the invalid access instruction to the shared memory 20 and then jumps to the program memory address where the access instruction that invalidates the input of the instruction source multiplexer 14 is stored. By switching to the jump instruction generation circuit 13 in which the jump instruction is stored, access to the shared memory 20 is re-executed without software intervention.
この共有メモリ20へのアクセス再実行は共有メモリ2
0へのアクセスが正常に行われるまで繰り返されるが、
−殻内にはcptriの共有メモリアクセスは連続して
実行されることはないので、最大1回のアクセス再実行
により、CPU2は共有メモリ20にアクセスすること
ができる。This access to the shared memory 20 is re-executed by the shared memory 2
This is repeated until the access to 0 is performed normally, but
- Since cptri shared memory accesses are not executed continuously within the shell, the CPU 2 can access the shared memory 20 by re-executing the access once at most.
CPU2の共有メモリアクセスについて、1回で正常完
了する場合と、複数回のアクセス再実行により正常完了
する場合のタイムチャートを第2図及び第3図に示す。Regarding the shared memory access by the CPU 2, time charts are shown in FIGS. 2 and 3 for cases in which the access is normally completed once and when the access is normally completed by re-executing the access a plurality of times.
また、第4図に、ウェイト/ホールド機能を持たないC
PUとしてインテル社CP U3051を使用した場合
の、共有メモリから内部メモリへのlバイト転送の命令
実行動作をプログラムリストを使用して説明している。In addition, Fig. 4 shows C without a wait/hold function.
The instruction execution operation for transferring 1 byte from the shared memory to the internal memory when the Intel CPU 3051 is used as the PU is explained using a program list.
第4図において、30は内部メモリ、31は共有メモリ
、32は共有メモリからの読出し命令、33は強制ジャ
ンプ命令、34は内部メモリへの書込み命令を表してい
る。In FIG. 4, 30 represents an internal memory, 31 a shared memory, 32 a read command from the shared memory, 33 a forced jump command, and 34 a write command to the internal memory.
本実施例では、ウェイト信号による競合調停回路lOを
採用しているが、ホールド信号による競合調停回路も可
能である。In this embodiment, a contention arbitration circuit 10 using a wait signal is employed, but a contention arbitration circuit using a hold signal is also possible.
またCPU1はウェイト機能を持つCPUで説明してい
るが、ウェイト機能がないCPUであってもよく、その
場合、CPU2で使用した回路をそのまま使用すること
により、容易にウェイト機能がないCPUどうしのマル
チCPUシステムが可能である。Although CPU1 is described as having a wait function, it may also be a CPU without a wait function.In that case, by using the same circuit as CPU2, it is easy to connect CPUs without a wait function. Multi-CPU systems are possible.
以上に述べたように、本発明によれば、ウェイト/ホー
ルド機能を持たないCPUが共有メモリをアクセスしよ
うとした場合、他方のCPUが共有メモリをアクセス中
であれば、これから実行するアクセス動作を無効とさせ
、後続の命令をジャンプ命令に強制的に変更することに
より他方のCPUが使用中でなくなるまで、アクセス動
作を繰り返し実行するようにしているため、アクセスの
競合を調停するためのソフトウェアは一切必要なくなり
、ソフトウェアが簡単になるとともに共有メモリをアク
セスするために要する時間を短縮できるという効果を奏
する。As described above, according to the present invention, when a CPU that does not have a wait/hold function attempts to access shared memory, if the other CPU is accessing the shared memory, the access operation to be executed is executed. The software for arbitrating access conflicts is designed to repeat the access operation until the other CPU is no longer in use by invalidating it and forcibly changing the subsequent instruction to a jump instruction. There is no need for this at all, which has the effect of simplifying the software and shortening the time required to access the shared memory.
第1図は本発明のハードウェアの例を示すブロック図、
第2図及び第3図はそれぞれ本顔明による共有メモリア
クセスのタイムチャート、第4図はプログラムリストを
用いた共有メモリアクセス再実行の説明図、第5図は従
来の共有メモリ方式のハードウェアブロック図、第6図
は従来のハトウェアで必要なソフトウェア処理を示すフ
ロチャートである。
1:ウェイト/ホールド機能付CPU
2:ウェイト/ホールド機能なしCPU3A、3B:要
求フラグ
4A、 48ニアドレスバツフア
5A、5B:データバッファ
6^、6B=コントロールゲート
7^、7B:デコーダ
8ニアドレスバス
9:データパス
lO:競合調停回路
11:命令シーケンス制御回路
12ニブログラムメモリ
13:ジャンプ命令発生回路
14:命令ソースマルチプレクサ
15^、 158:アクセス要求信号
16二ウエイト信号
17:アクセス無効信号
0
:共有メモリFIG. 1 is a block diagram showing an example of hardware of the present invention,
Figures 2 and 3 are time charts of shared memory access according to the present invention, Figure 4 is an explanatory diagram of shared memory access re-execution using a program list, and Figure 5 is a diagram of conventional shared memory system hardware. The block diagram, FIG. 6, is a flowchart showing the software processing required in conventional Hatware. 1: CPU with wait/hold function 2: CPU without wait/hold function 3A, 3B: Request flag 4A, 48 nearest address buffer 5A, 5B: Data buffer 6^, 6B = control gate 7^, 7B: Decoder 8 nearest address Bus 9: Data path IO: Conflict arbitration circuit 11: Instruction sequence control circuit 12 Niprogram memory 13: Jump instruction generation circuit 14: Instruction source multiplexer 15^, 158: Access request signal 16 Two-wait signal 17: Access invalid signal 0 :shared memory
Claims (1)
モリのアクセス方法において、前記CPUが共有メモリ
をアクセスしようとした時、他方のCPUが共有メモリ
をアクセスしていない場合にはそのまま続けてアクセス
し、他方のCPUが共有メモリをアクセスしている場合
にはこれから実行するアクセス命令を無効とし、後続の
命令を強制的にジャンプ命令に変更することにより無効
にされたアクセス命令を再実行させることを特徴とする
CPUの共有メモリのアクセス方法。1. In a shared memory access method for a CPU that does not have a wait/hold function, when the CPU attempts to access the shared memory, if the other CPU is not accessing the shared memory, the CPU continues to access the shared memory, The feature is that when the other CPU is accessing the shared memory, the access instruction to be executed from now on is invalidated, and the subsequent instruction is forcibly changed to a jump instruction, thereby causing the invalidated access instruction to be re-executed. How to access the shared memory of the CPU.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP26746189A JPH03127162A (en) | 1989-10-12 | 1989-10-12 | How to access CPU shared memory |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP26746189A JPH03127162A (en) | 1989-10-12 | 1989-10-12 | How to access CPU shared memory |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH03127162A true JPH03127162A (en) | 1991-05-30 |
Family
ID=17445162
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP26746189A Pending JPH03127162A (en) | 1989-10-12 | 1989-10-12 | How to access CPU shared memory |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH03127162A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH0520212A (en) * | 1991-07-11 | 1993-01-29 | Shinko Seisakusho Co Ltd | Control circuit using dual port RAM |
| JPH0765134A (en) * | 1993-08-27 | 1995-03-10 | Tamura Electric Works Ltd | Data communication method |
-
1989
- 1989-10-12 JP JP26746189A patent/JPH03127162A/en active Pending
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH0520212A (en) * | 1991-07-11 | 1993-01-29 | Shinko Seisakusho Co Ltd | Control circuit using dual port RAM |
| JPH0765134A (en) * | 1993-08-27 | 1995-03-10 | Tamura Electric Works Ltd | Data communication method |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5737604A (en) | Method and apparatus for independently resetting processors and cache controllers in multiple processor systems | |
| US6463529B1 (en) | Processor based system with system wide reset and partial system reset capabilities | |
| US5870602A (en) | Multi-processor system with system wide reset and partial system reset capabilities | |
| US4949241A (en) | Microcomputer system including a master processor and a slave processor synchronized by three control lines | |
| KR20040023692A (en) | Mechanism for interrupt handling in computer systems that support concurrent execution of multiple threads | |
| JPH0258649B2 (en) | ||
| US6446149B1 (en) | Self-modifying synchronization memory address space and protocol for communication between multiple busmasters of a computer system | |
| JPH0696008A (en) | Information processor | |
| GB2216306A (en) | Load and synchronize computer architecture and process | |
| JP5999216B2 (en) | Data processing device | |
| JPH0232659B2 (en) | ||
| JPH03127162A (en) | How to access CPU shared memory | |
| JPS6319058A (en) | Memory device | |
| JP2813182B2 (en) | Multiprocessor computer multifunction device | |
| JPS63197232A (en) | Microprocessor | |
| US4628450A (en) | Data processing system having a local memory which does not use a directory device with distributed resident programs and a method therefor | |
| KR100246864B1 (en) | Computer memory system with cache flush method and cache memory for second cache memory | |
| JPH08249175A (en) | Method and apparatus for selective support of nonarchitectural instruction at inside of superscalar processor device | |
| JPH0573417A (en) | Data processing device | |
| US6751708B2 (en) | Method for ensuring that a line is present in an instruction cache | |
| JPH04140860A (en) | Method for controlling bus of multi-processor | |
| JPH04372030A (en) | Memory access system for processor | |
| JP2539064B2 (en) | Microprocessor | |
| JPH0784971A (en) | Computer system | |
| JPH10154124A (en) | Microprocessor and multiprocessor system |