JPH06314232A - Memory switching control circuit - Google Patents

Memory switching control circuit

Info

Publication number
JPH06314232A
JPH06314232A JP10551793A JP10551793A JPH06314232A JP H06314232 A JPH06314232 A JP H06314232A JP 10551793 A JP10551793 A JP 10551793A JP 10551793 A JP10551793 A JP 10551793A JP H06314232 A JPH06314232 A JP H06314232A
Authority
JP
Japan
Prior art keywords
cpu
signal
lock
output
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP10551793A
Other languages
Japanese (ja)
Inventor
Kenjiro Ueno
健二郎 上野
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 JP10551793A priority Critical patent/JPH06314232A/en
Publication of JPH06314232A publication Critical patent/JPH06314232A/en
Pending legal-status Critical Current

Links

Abstract

(57)【要約】 【目的】 1つのメモリを2つのCPUからアクセスす
るシステムにおいてメモリの排他制御を行うことができ
るメモリ切替制御回路を提供する。 【構成】 CPU2からリクエスト信号R2及びロック
信号LOが出力されるとロック制御回路9は、F/F回
路10へ排他リクエスト信号R3を出力する。ロック信
号LOが出力されている間中この排他リクエスト信号R
3の出力は継続される。CPU1がメモリ8にアクセス
していない、すなわちF/F回路10の端子Sにアクセ
ス許可信号E1の入力がなければ、アクセス許可信号E
2が出力される。アクセス許可信号E2の出力中は、C
PU1のアクセスが禁止されてF/F回路3からアクセ
ス許可信号E1の出力は行われず、ロック信号の出力中
はこの排他制御が行われる。
(57) [Summary] [Object] To provide a memory switching control circuit capable of performing exclusive control of a memory in a system in which one memory is accessed by two CPUs. [Configuration] When the request signal R2 and the lock signal LO are output from the CPU 2, the lock control circuit 9 outputs an exclusive request signal R3 to the F / F circuit 10. While the lock signal LO is being output, this exclusive request signal R
The output of 3 is continued. If the CPU 1 is not accessing the memory 8, that is, if the access permission signal E1 is not input to the terminal S of the F / F circuit 10, the access permission signal E
2 is output. While the access permission signal E2 is being output, C
Access to the PU1 is prohibited, the access permission signal E1 is not output from the F / F circuit 3, and this exclusive control is performed during the output of the lock signal.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明はメモリ切替制御回路に関
し、特に1つのメモリを複数のCPUからアクセスする
システムにおいてアクセス中のCPU以外のアクセスを
禁止する排他制御を行うことができるメモリ切替制御回
路に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a memory switching control circuit, and more particularly to a memory switching control circuit capable of performing exclusive control for prohibiting access by CPUs other than the CPU currently being accessed in a system in which one memory is accessed by a plurality of CPUs. Regarding

【0002】[0002]

【従来の技術】従来より2つのCPUから1つのメモリ
をアクセスするためのメモリ制御を行うメモリ切替制御
回路が提案されている(特開昭58―86653)。図
5はこのような従来のメモリ切替制御回路のブロック図
である。21、22はCPU、23はメモリ制御部であ
り、CPU21、CPU22から出力されたアクセス要
求を示すリクエスト信号に基づいてCPU21、CPU
22のどちらがメモリにアクセスするかを決定し、後述
するゲート回路に制御信号を出力する。
2. Description of the Related Art Conventionally, there has been proposed a memory switching control circuit for performing memory control for accessing one memory from two CPUs (Japanese Patent Laid-Open No. 58-86653). FIG. 5 is a block diagram of such a conventional memory switching control circuit. Reference numerals 21 and 22 denote CPUs, and 23 denotes a memory control unit. The CPUs 21 and CPUs are based on request signals output from the CPUs 21 and 22 and indicating access requests.
It is determined which one of 22 accesses the memory and outputs a control signal to a gate circuit described later.

【0003】また、25、26はメモリ制御部23から
それぞれ制御信号が出力されるとCPU21から出力さ
れたコントロール信号、アドレスをメモリに出力するゲ
ート回路、26はメモリ制御部23から制御信号が出力
されると双方向のバッファとしてCPU21とメモリ間
のデータの入出力を行うゲート回路、28はメモリ、3
2、33はメモリ制御部23からそれぞれ制御信号が出
力されるとCPU22から出力されたコントロール信
号、アドレスをメモリ28に出力するゲート回路、34
はメモリ制御部23から制御信号が出力されると双方向
のバッファとしてCPU22とメモリ28間のデータの
入出力を行うゲート回路である。
Further, 25 and 26 are control signals output from the CPU 21 when the control signals are output from the memory control unit 23, a gate circuit for outputting an address to the memory, and 26 is a control signal output from the memory control unit 23. As a bidirectional buffer, a gate circuit for inputting / outputting data between the CPU 21 and the memory, 28 is a memory, 3
Reference numerals 2 and 33 denote gate circuits that output the control signal and the address output from the CPU 22 to the memory 28 when the control signals are output from the memory control unit 23, respectively.
Is a gate circuit that inputs and outputs data between the CPU 22 and the memory 28 as a bidirectional buffer when a control signal is output from the memory control unit 23.

【0004】また、A1、C1、R1はCPU21から
出力されるアドレス、コントロール信号、リクエスト信
号、D1はCPU21とメモリ28間でやり取りされる
データ、A2、C2、R2はCPU22から出力される
アドレス、コントロール信号、リクエスト信号、D2は
CPU22とメモリ28間でやり取りされるデータ、C
LKはクロック信号である。
A1, C1 and R1 are addresses output from the CPU 21, control signals and request signals, D1 is data exchanged between the CPU 21 and the memory 28, A2, C2 and R2 are addresses output from the CPU 22, Control signal, request signal, D2 is data exchanged between the CPU 22 and the memory 28, C
LK is a clock signal.

【0005】次に、このようなメモリ切替制御回路の動
作として、まずCPU21がメモリアクセスを行った場
合の動作を説明する。CPU21がアクセスを行う場合
は、CPU21からアクセス要求を示すリクエスト信号
R1が出力される。そして、メモリ制御部23は、現在
CPU22がメモリ28をアクセス中かどうかを判断
し、CPU22がアクセス中でなければCPU21のア
クセスを許可し、CPU22のアクセスを禁止する。ま
た、CPU22がアクセス中であればそのアクセスが終
了するのを待ってCPU21のアクセスを許可する。
Next, as an operation of such a memory switching control circuit, an operation when the CPU 21 makes a memory access will be described first. When the CPU 21 makes an access, the CPU 21 outputs a request signal R1 indicating an access request. Then, the memory control unit 23 determines whether or not the CPU 22 is currently accessing the memory 28. If the CPU 22 is not currently accessing the memory, the memory control unit 23 permits the access of the CPU 21 and prohibits the access of the CPU 22. If the CPU 22 is accessing, the CPU 21 waits until the access is completed and permits the CPU 21 to access.

【0006】CPU21のアクセスを許可する場合は、
メモリ制御部23は、ゲート回路25、26、27にそ
れぞれ所定のタイミングで制御信号を出力する。よっ
て、ゲート回路25、26、27がイネーブル状態とな
るので、CPU21から出力されたコントロール信号C
1、アドレスA1がゲート回路25、26を介してメモ
リ28に出力される。続いて、ゲート回路27を介して
CPU21とメモリ28の間でデータD1のやり取りが
行われる。
When permitting access of the CPU 21,
The memory control unit 23 outputs a control signal to the gate circuits 25, 26 and 27 at predetermined timings. Therefore, the gate circuits 25, 26, 27 are enabled, and the control signal C output from the CPU 21 is output.
1, the address A1 is output to the memory 28 via the gate circuits 25 and 26. Subsequently, the data D1 is exchanged between the CPU 21 and the memory 28 via the gate circuit 27.

【0007】また、CPU22からメモリ28のアクセ
スを行う場合も同様で、CPU22からリクエスト信号
R2が出力されてメモリ制御部23にてアクセスが許可
されると、ゲート回路32、33、34に制御信号が出
力される。そして、CPU22から出力されたコントロ
ール信号C2、アドレスA2がゲート回路32、33を
介してメモリ28に出力され、ゲート回路33を介して
CPU22とメモリ28の間でデータD2のやり取りが
行われる。
Similarly, when the CPU 22 accesses the memory 28, when the request signal R2 is output from the CPU 22 and the memory controller 23 permits the access, the control signals are sent to the gate circuits 32, 33 and 34. Is output. Then, the control signal C2 and the address A2 output from the CPU 22 are output to the memory 28 via the gate circuits 32 and 33, and the data D2 is exchanged between the CPU 22 and the memory 28 via the gate circuit 33.

【0008】このようなメモリ切替制御回路にてリクエ
スト信号R1、R2は、それぞれCPU21、22の1
サイクル(例えば、この例ではクロック信号CLKの4
クロック分)の間出力される。したがって、例えばCP
U22のアクセス中にCPU21からリクエスト信号R
1が出力されると、1サイクルの間はCPU21のアク
セスが禁止されていてCPU22のサイクルが終了した
後にCPU21のアクセスに切り替わる。また、通常は
数サイクルで1命令が構成されているので、CPU22
の1命令が終了するまでにCPU21のアクセスが何回
か行われていることになる。
In such a memory switching control circuit, the request signals R1 and R2 are sent to the CPU 21 and 22 respectively.
Cycle (for example, 4 times the clock signal CLK in this example)
Clock minutes). So, for example, CP
Request signal R from CPU 21 during U22 access
When 1 is output, the access of the CPU 21 is prohibited for one cycle and the access of the CPU 21 is switched to after the cycle of the CPU 22 is completed. Further, since one instruction is normally composed in several cycles, the CPU 22
That is, the CPU 21 has been accessed several times before the completion of one instruction.

【0009】[0009]

【発明が解決しようとする課題】従来のメモリ切替制御
回路は以上のように構成されているので、CPUの1命
令のアクセス中に別のCPUからアクセスが行われると
メモリに記憶されたデータが破壊されることがあり、1
命令のアクセス中に別のCPUのアクセスを禁止してこ
のようなデータの破壊を防ぐ排他制御ができないという
問題点があった。本発明は、上記課題を解決するため
に、1つのメモリを2つのCPUからアクセスするシス
テムにおいてメモリの排他制御を行うことができるメモ
リ切替制御回路を提供することを目的とする。
Since the conventional memory switching control circuit is configured as described above, if one CPU accesses one instruction while another CPU accesses it, the data stored in the memory will be lost. May be destroyed 1
There is a problem in that exclusive control for preventing such data destruction cannot be performed by prohibiting access of another CPU during access of an instruction. In order to solve the above problems, it is an object of the present invention to provide a memory switching control circuit capable of performing memory exclusive control in a system in which one memory is accessed by two CPUs.

【0010】[0010]

【課題を解決するための手段】本発明は、アクセス要求
を示すリクエスト信号及び命令期間を示すロック信号を
出力するCPUと、CPUからリクエスト信号及びロッ
ク信号が入力されるとロック信号の入力期間中は排他リ
クエスト信号を出力するロック制御回路と、ロック制御
回路から出力された排他リクエスト信号と別のCPUか
ら出力されたリクエスト信号に基づいてどのCPUがア
クセスするかを決定してメモリを制御し、CPUのアク
セス中で排他リクエスト信号が出力されている間は別の
CPUのアクセスを禁止するメモリ制御部とを有するも
のである。
According to the present invention, a CPU outputs a request signal indicating an access request and a lock signal indicating an instruction period, and when the request signal and the lock signal are input from the CPU, the lock signal is input during the input period. Controls the memory by determining which CPU to access based on the lock control circuit that outputs the exclusive request signal and the exclusive request signal output from the lock control circuit and the request signal output from another CPU, It has a memory control unit which prohibits access of another CPU while the CPU is accessing and the exclusive request signal is being output.

【0011】また、アクセス要求を示すリクエスト信号
及び命令期間を示すロック信号を出力し、ロック制御異
常信号が入力されたときはロック信号の出力を停止する
CPUと、CPUからロック信号が入力されたときはそ
の入力経過時間を計測して所定時間以上になるとロック
制御異常信号を出力するロック時間検出回路と、CPU
からリクエスト信号及びロック信号が入力されるとロッ
ク信号の入力期間中は排他リクエスト信号を出力するロ
ック制御回路と、ロック制御回路から出力された排他リ
クエスト信号と別のCPUから出力されたリクエスト信
号に基づいてどのCPUがアクセスするかを決定してメ
モリを制御し、CPUのアクセス中で排他リクエスト信
号が出力されている間は別のCPUのアクセスを禁止す
るメモリ制御部とを有するものである。
Also, a CPU outputs a request signal indicating an access request and a lock signal indicating an instruction period, and stops the output of the lock signal when the lock control abnormality signal is input, and the lock signal is input from the CPU. In this case, the lock time detection circuit that measures the input elapsed time and outputs the lock control abnormal signal when the time exceeds a predetermined time, and the CPU
When the request signal and the lock signal are input from the lock control circuit that outputs the exclusive request signal during the input period of the lock signal, and the exclusive request signal output from the lock control circuit and the request signal output from another CPU Based on which CPU is to be accessed, the memory is controlled to control the memory, and while the CPU is being accessed, the access of another CPU is prohibited while the exclusive request signal is output.

【0012】また、ロック時間検出回路の代わりにCP
Uからロック信号が入力されたときはCPUからのリク
エスト信号の出力回数を検出して所定の回数以上になる
とロック制御異常信号を出力するアクセス回数検出回路
を有するものである。
Further, instead of the lock time detection circuit, CP
When a lock signal is input from U, the number of times the request signal is output from the CPU is detected, and when the number of times is equal to or more than a predetermined number, a lock control abnormality signal is output and an access number detection circuit is provided.

【0013】また、ロック時間検出回路の代わりに別の
CPUからリセット要求信号が出力されたときはロック
信号を出力しているCPUにロック制御異常信号を出力
するリセット回路を有するものである。
Further, in place of the lock time detection circuit, when a reset request signal is output from another CPU, there is provided a reset circuit which outputs a lock control abnormal signal to the CPU which is outputting the lock signal.

【0014】[0014]

【作用】本発明によれば、CPUからリクエスト信号及
びロック信号が出力されると、ロック制御回路からロッ
ク信号の入力期間中排他リクエスト信号が出力される。
そして、メモリ制御部によってCPUのアクセスが許可
されると、排他リクエスト信号が出力されている間は別
のCPUのアクセスが禁止される。また、CPUからロ
ック信号が出力されるとロック時間検出回路によってそ
の経過時間が計測され、所定時間以上になるとロック制
御異常信号が出力される。そして、ロック制御異常信号
が入力されたCPUではロック信号の出力を停止して排
他制御が解除される。また、CPUからロック信号が出
力されるとアクセス回数検出回路によってCPUからの
リクエスト信号の出力回数が検出され、所定の回数以上
になるとロック制御異常信号が出力されて排他制御が解
除される。また、別のCPUからリセット要求信号が出
力されるとリセット回路からロック制御異常信号が出力
されて排他制御が解除される。
According to the present invention, when the CPU outputs the request signal and the lock signal, the lock control circuit outputs the exclusive request signal during the input period of the lock signal.
When the CPU of the memory controller permits the access of another CPU, the access of another CPU is prohibited while the exclusive request signal is output. When the lock signal is output from the CPU, the lock time detection circuit measures the elapsed time, and when the lock signal is output for a predetermined time or longer, the lock control abnormality signal is output. Then, in the CPU to which the lock control abnormality signal is input, the output of the lock signal is stopped and the exclusive control is released. Further, when the lock signal is output from the CPU, the number of times the request signal is output from the CPU is detected by the access number detection circuit, and when it exceeds the predetermined number, the lock control abnormality signal is output and the exclusive control is released. When a reset request signal is output from another CPU, a lock control abnormality signal is output from the reset circuit and the exclusive control is released.

【0015】[0015]

【実施例】図1は本発明の1実施例を示すメモリ切替制
御回路のブロック図である。1、2はCPU、3はCP
U1からのリクエスト信号R1及び後述するCPU2用
のフリップフロップ回路(以下、F/F回路と略する)
の出力に基づいてCPU1のアクセスを許可するかどう
かを決定し、アクセス許可信号を出力するF/F回路、
4はこのアクセス許可信号を遅延する遅延回路、5、6
はF/F回路3からアクセス許可信号が出力されるとC
PU1から出力されたコントロール信号C1、アドレス
A1をメモリに出力するゲート回路、7は遅延回路4か
ら信号が出力されるとCPU1とメモリ間のデータD1
の入出力を行うゲート回路、8はメモリである。
1 is a block diagram of a memory switching control circuit showing an embodiment of the present invention. 1, 2 is CPU, 3 is CP
A request signal R1 from U1 and a flip-flop circuit for CPU2 described later (hereinafter abbreviated as F / F circuit)
An F / F circuit that determines whether or not to permit access of the CPU 1 based on the output of the
4 is a delay circuit for delaying this access permission signal, 5, 6
Is C when the access permission signal is output from the F / F circuit 3.
A gate circuit which outputs the control signal C1 output from the PU1 and the address A1 to the memory, and 7 when the signal is output from the delay circuit 4, the data D1 between the CPU1 and the memory
Reference numeral 8 denotes a gate circuit for inputting and outputting.

【0016】また、9はCPU2からのリクエスト信号
R2及びCPU2の1命令中出力されるロック信号に基
づいてCPU2のアクセスを要求するための排他リクエ
スト信号を出力するロック制御回路、10はこのロック
制御回路9から出力された排他リクエスト信号及びF/
F回路3からのアクセス許可信号に基づいてCPU2の
アクセスを許可するかどうかを決定し、アクセス許可信
号を出力するF/F回路、11はこのアクセス許可信号
を遅延する遅延回路、12、13はF/F回路10から
アクセス許可信号が出力されるとCPU2から出力され
たコントロール信号C2、アドレスA2をメモリ8に出
力するゲート回路、14は遅延回路11から信号が出力
されるとCPU2とメモリ8間のデータD2の入出力を
行うゲート回路、15はインバータである。
Further, 9 is a lock control circuit for outputting an exclusive request signal for requesting access of the CPU 2 based on the request signal R2 from the CPU 2 and the lock signal output during one instruction of the CPU 2, and 10 is the lock control circuit. Exclusive request signal and F / output from the circuit 9
Based on the access permission signal from the F circuit 3, it is determined whether or not to permit the access of the CPU 2, and an F / F circuit that outputs the access permission signal, 11 is a delay circuit that delays this access permission signal, 12 and 13 are When the access permission signal is output from the F / F circuit 10, a gate circuit that outputs the control signal C2 and the address A2 output from the CPU 2 to the memory 8, and 14 is the CPU 2 and the memory 8 when the signal is output from the delay circuit 11. A gate circuit for inputting / outputting the data D2 between them, and 15 are inverters.

【0017】また、E1はCPU1のアクセスを許可し
てCPU2のアクセスを禁止するためにF/F回路3か
ら出力されるアクセス許可信号、E2はCPU2のアク
セスを許可してCPU1のアクセスを禁止するためにF
/F回路10から出力されるアクセス許可信号、LOは
ロック信号、R3はロック制御回路9から出力される排
他リクエスト信号である。そして、F/F回路3、10
と遅延回路4、11とインバータ15とが図5の例と同
様の動作をするメモリ制御部を構成している。
Further, E1 is an access permission signal output from the F / F circuit 3 for permitting access of the CPU 1 and inhibiting access of the CPU 2, and E2 permits access of the CPU 2 and inhibits access of the CPU 1. For F
An access permission signal output from the / F circuit 10, LO is a lock signal, and R3 is an exclusive request signal output from the lock control circuit 9. Then, the F / F circuits 3, 10
The delay circuits 4 and 11 and the inverter 15 constitute a memory control section that operates in the same manner as in the example of FIG.

【0018】次に、このようなメモリ切替制御回路の動
作を説明するが、ロック制御回路9による排他制御が行
われないときの動作は以下のように図5の例と同様にな
る。まずCPU1がアクセスを行う場合は、CPU1か
らリクエスト信号R1が出力される。そして、CPU2
がメモリ8にアクセスしていない、すなわちF/F回路
3の端子Sにアクセス許可信号E2の入力がなければ、
クロック信号CLKの立ち下がりでF/F回路3の端子
1からアクセス許可信号E1が出力され、端子0からア
クセスが完了したことを示すリプライ信号が出力され
る。
Next, the operation of such a memory switching control circuit will be described. The operation when the lock control circuit 9 does not perform the exclusive control is similar to the example of FIG. 5 as follows. First, when the CPU 1 makes an access, the CPU 1 outputs a request signal R1. And CPU2
Does not access the memory 8, that is, if the access permission signal E2 is not input to the terminal S of the F / F circuit 3,
At the falling edge of the clock signal CLK, the access permission signal E1 is output from the terminal 1 of the F / F circuit 3, and the reply signal indicating that the access is completed is output from the terminal 0.

【0019】また、CPU2がアクセス中であれば、そ
のアクセスが終了するのを待って次のクロック信号CL
Kの立ち下がりで同様な出力が行われる。アクセス許可
信号E1の出力中は、CPU2からリクエスト信号R2
が出力されてロック制御回路9から排他リクエスト信号
R3が出力されても、アクセスが競合しないようにCP
U2のアクセスが禁止されてF/F回路10からアクセ
ス許可信号E2が出力されないようになっている。
If the CPU 2 is accessing, it waits until the access is completed and waits for the next clock signal CL.
Similar output is performed at the falling edge of K. While the access permission signal E1 is being output, the request signal R2 is output from the CPU2.
Is output and the lock control circuit 9 outputs the exclusive request signal R3, the CP does not conflict with the access.
The access of U2 is prohibited so that the F / F circuit 10 does not output the access permission signal E2.

【0020】一方、アクセス許可信号E1が入力された
ゲート回路5、6はイネーブル状態となり、それぞれC
PU1から出力されたコントロール信号C1、アドレス
A1をメモリ8へ出力する。また、遅延回路4は、アク
セス許可信号E1が入力されるとこれを一定時間遅延し
てゲート回路7へ出力する。よって、ゲート回路7を介
してCPU1とメモリ8の間でデータD1のやり取りが
行われる。
On the other hand, the gate circuits 5 and 6 to which the access permission signal E1 is input are in the enable state, and C respectively.
The control signal C1 and address A1 output from PU1 are output to the memory 8. When the access permission signal E1 is input, the delay circuit 4 delays it and outputs it to the gate circuit 7 for a predetermined time. Therefore, the data D1 is exchanged between the CPU 1 and the memory 8 via the gate circuit 7.

【0021】CPU1は、リプライ信号がF/F回路3
から出力されてから1ウェイト(1クロック)後にサイ
クルを終了する。CPU2がアクセス中でなければ最小
サイクルの1ウェイトでサイクルを終了する。
The CPU 1 sends the reply signal to the F / F circuit 3
After 1 wait (1 clock) from the output from, the cycle is ended. If the CPU 2 is not accessing the cycle, the cycle is ended with one wait of the minimum cycle.

【0022】次に、CPU2がメモリアクセスを行う場
合もCPU1の場合と基本的に同様であって、CPU2
からロック信号LOが出力されないときのロック制御回
路9は、CPU2から出力されたリクエスト信号R2を
F/F回路10にそのまま排他リクエスト信号R3とし
て出力する。
Next, when the CPU 2 makes a memory access, it is basically similar to the case of the CPU 1, and the CPU 2
When the lock signal LO is not output from the lock control circuit 9, the lock control circuit 9 outputs the request signal R2 output from the CPU 2 to the F / F circuit 10 as the exclusive request signal R3.

【0023】そして、CPU1がメモリ8にアクセスし
ていない、すなわちF/F回路10の端子Sにアクセス
許可信号E1の入力がなければ、クロック信号CLKの
立ち上がりでF/F回路10の端子1からアクセス許可
信号E2が出力され、端子0からリプライ信号が出力さ
れる。また、CPU1がアクセス中であれば、そのアク
セスが終了するのを待って次のクロック信号CLKの立
ち上がりで同様な出力が行われる。F/F回路3と同様
にアクセス許可信号E2の出力中は、CPU1のアクセ
スが禁止されてF/F回路3からアクセス許可信号E1
の出力は行われない。
If the CPU 1 is not accessing the memory 8, that is, if the access permission signal E1 is not input to the terminal S of the F / F circuit 10, the terminal 1 of the F / F circuit 10 rises at the rising edge of the clock signal CLK. The access permission signal E2 is output, and the reply signal is output from the terminal 0. If the CPU 1 is accessing, the same output is performed at the next rising edge of the clock signal CLK after waiting for the access to end. Similarly to the F / F circuit 3, while the access permission signal E2 is being output, the access of the CPU 1 is prohibited and the F / F circuit 3 outputs the access permission signal E1.
Is not output.

【0024】また、アクセス許可信号E2が入力された
ゲート回路12、13はイネーブル状態となり、それぞ
れCPU2から出力されたコントロール信号C2、アド
レスA2をメモリ8へ出力する。また、遅延回路11
は、アクセス許可信号E2が入力されるとこれを一定時
間遅延してゲート回路14へ出力する。よって、ゲート
回路14を介してCPU2とメモリ8の間でデータD2
のやり取りが行われる。CPU2は、リプライ信号がF
/F回路10から出力されてから1ウェイト後にサイク
ルを終了する。
The gate circuits 12 and 13 to which the access permission signal E2 is input are enabled and output the control signal C2 and the address A2 output from the CPU 2 to the memory 8, respectively. In addition, the delay circuit 11
When the access permission signal E2 is input, the signal is delayed by a certain time and then output to the gate circuit 14. Therefore, the data D2 is transferred between the CPU 2 and the memory 8 via the gate circuit 14.
Are exchanged. The reply signal of CPU2 is F
The cycle is ended after one wait after the output from the / F circuit 10.

【0025】よって、CPU2からロック信号LOが出
力されないときは図5の例と同様の動作となる。次に、
CPU2からリクエスト信号R2及びロック信号LOが
出力されるとロック制御回路9は、F/F回路3からの
リプライ信号の出力終了後にF/F回路10へ排他リク
エスト信号R3を出力し、ロック信号LOが出力されて
いる間中この排他リクエスト信号R3の出力を継続す
る。排他リクエスト信号R3が出力されてから以後の動
作は上記と同様である。
Therefore, when the lock signal LO is not output from the CPU 2, the same operation as in the example of FIG. 5 is performed. next,
When the request signal R2 and the lock signal LO are output from the CPU 2, the lock control circuit 9 outputs the exclusive request signal R3 to the F / F circuit 10 after the output of the reply signal from the F / F circuit 3 is completed, and the lock signal LO is output. The output of the exclusive request signal R3 is continued while is output. The operation after the exclusion request signal R3 is output is the same as above.

【0026】したがって、リクエスト信号R2の出力が
1サイクルだけであっても、ロック信号LOは数サイク
ル続く1命令中出力されているので、その結果アクセス
許可信号E2も1命令中出力されることになり、CPU
2の1命令期間中CPU1のアクセスが禁止される排他
制御を行うことができる。
Therefore, even if the request signal R2 is output for only one cycle, the lock signal LO is output during one instruction that continues for several cycles, and as a result, the access permission signal E2 is also output during one instruction. Become CPU
It is possible to perform the exclusive control in which the access of the CPU 1 is prohibited during the period of 1 instruction of 2.

【0027】なお、本実施例では、CPU2側からのみ
排他制御ができるようにしているが、CPU1側にも同
様のロック制御回路を用いることにより、CPU1側か
らも排他制御を行うことができる。また、2つのCPU
でなく3つ以上のCPUでもこのような排他制御を行う
ことができる。
In this embodiment, the exclusive control can be performed only from the CPU 2 side, but the CPU 1 side can also perform the exclusive control by using a similar lock control circuit on the CPU 1 side. Also two CPUs
Alternatively, such exclusive control can be performed by three or more CPUs.

【0028】図2は本発明の他の実施例を示すメモリ切
替制御回路のブロック図であり、図1と同様の部分には
同一の符号を付してある。16はロック信号LOの出力
経過時間を計測して所定時間以上になるとCPU2にロ
ック制御異常信号を出力するロック時間検出回路であ
る。
FIG. 2 is a block diagram of a memory switching control circuit showing another embodiment of the present invention. The same parts as those in FIG. 1 are designated by the same reference numerals. Reference numeral 16 denotes a lock time detection circuit which measures the output elapsed time of the lock signal LO and outputs a lock control abnormality signal to the CPU 2 when the output time exceeds a predetermined time.

【0029】その基本的な動作は図1の例と同様である
が、ロック時間検出回路16は、CPU2からロック信
号LOが出力されてからの経過時間を計測しており、あ
る所定時間以上になるとCPU2にロック制御異常信号
を出力する。そして、ロック制御異常信号が出力される
と、CPU2はロック信号LOの出力を停止する。よっ
て、排他制御が解除されてCPU2がメモリ8へのアク
セスを占有することによるシステムの処理効率の低下を
防ぐことができる。
The basic operation is the same as in the example of FIG. 1, but the lock time detection circuit 16 measures the elapsed time after the lock signal LO is output from the CPU 2, and it is equal to or longer than a predetermined time. Then, a lock control abnormality signal is output to the CPU 2. Then, when the lock control abnormality signal is output, the CPU 2 stops the output of the lock signal LO. Therefore, it is possible to prevent a decrease in system processing efficiency due to the exclusive control being released and the CPU 2 occupying the access to the memory 8.

【0030】図3は本発明の他の実施例を示すメモリ切
替制御回路のブロック図であり、図1と同様の部分には
同一の符号を付してある。17はロック信号LOの出力
中のリクエスト信号R2の出力回数を検出して所定の回
数以上になるとロック制御異常信号を出力するアクセス
回数検出回路である。
FIG. 3 is a block diagram of a memory switching control circuit showing another embodiment of the present invention, and the same parts as those in FIG. 1 are designated by the same reference numerals. Reference numeral 17 denotes an access number detection circuit that detects the number of times the request signal R2 is output while the lock signal LO is being output, and outputs a lock control abnormality signal when the number of times exceeds a predetermined number.

【0031】その基本的な動作は図1の例と同様である
が、アクセス回数検出回路17は、CPU2からロック
信号LOが出力されてからのCPU2のアクセス回数を
リクエスト信号R2に基づいて検出し、このような排他
制御を伴ったアクセスが所定の回数以上続くとロック制
御異常信号を出力する。よって、図2の例と同様に排他
制御が解除されてシステムの処理効率の低下を防ぐこと
ができる。
The basic operation is the same as in the example of FIG. 1, but the access number detection circuit 17 detects the access number of the CPU 2 after the lock signal LO is output from the CPU 2 based on the request signal R2. If the access accompanied by such exclusive control continues for a predetermined number of times or more, a lock control abnormality signal is output. Therefore, like the example of FIG. 2, the exclusive control is released and it is possible to prevent a decrease in the processing efficiency of the system.

【0032】図4は本発明の他の実施例を示すメモリ切
替制御回路のブロック図であり、図1と同様の部分には
同一の符号を付してある。18はCPU1からリセット
要求信号が出力されるとCPU2にロック制御異常信号
を出力するリセット回路である。
FIG. 4 is a block diagram of a memory switching control circuit showing another embodiment of the present invention. The same parts as those in FIG. 1 are designated by the same reference numerals. A reset circuit 18 outputs a lock control abnormality signal to the CPU 2 when the reset request signal is output from the CPU 1.

【0033】その基本的な動作は図1の例と同様である
が、リセット回路18は、CPU1から緊急のアクセス
要求であるリセット要求信号が出力されるとCPU2に
ロック制御異常信号を出力する。よって、CPU1から
緊急にアクセスを行う場合は排他制御を解除してCPU
1からメモリアクセスを行うことができる。
The basic operation is the same as in the example of FIG. 1, but the reset circuit 18 outputs a lock control abnormal signal to the CPU 2 when the CPU 1 outputs a reset request signal which is an emergency access request. Therefore, in the case of emergency access from the CPU 1, the exclusive control is canceled and the CPU
Memory access can be performed from 1.

【0034】なお、図1〜4の例では1命令中出力され
るロック信号LOに基づいて排他制御を行うために最大
1命令分しか排他制御を行うことができない。そこで、
図2、3、4のロック時間検出回路16、アクセス回数
検出回路17、リセット回路18において、一度ロック
信号LOが入力されたらロック制御回路9に出力するロ
ック信号LOの出力を保持し、その出力の解除はそれぞ
れロック信号LOの出力継続時間、CPU2のアクセス
回数、CPU1からのリセット要求信号に基づいて解除
するようにすれば1命令以上の排他制御を行うこともで
きる。
In the examples of FIGS. 1 to 4, since exclusive control is performed based on the lock signal LO output during one instruction, exclusive control can be performed only for a maximum of one instruction. Therefore,
The lock time detection circuit 16, the access count detection circuit 17, and the reset circuit 18 shown in FIGS. 2, 3, and 4 hold the output of the lock signal LO output to the lock control circuit 9 once the lock signal LO is input, and output the lock signal LO. If the locks are released based on the output duration of the lock signal LO, the number of accesses of the CPU 2, and the reset request signal from the CPU 1, exclusive control of one or more instructions can be performed.

【0035】[0035]

【発明の効果】本発明によれば、ロック制御回路を用い
ることによってCPUの命令期間中は別のCPUのアク
セスを禁止する排他制御を行うことができる。
According to the present invention, by using the lock control circuit, it is possible to perform the exclusive control for prohibiting the access of another CPU during the instruction period of the CPU.

【0036】また、ロック時間検出回路又はアクセス回
数検出回路を用いることによってメモリアクセスの占有
によるシステムの処理効率の低下を防ぐことができ、メ
モリに対する排他制御を円滑に行うことができる。
Further, by using the lock time detecting circuit or the access number detecting circuit, it is possible to prevent the deterioration of the processing efficiency of the system due to the occupation of the memory access, and it is possible to smoothly perform the exclusive control on the memory.

【0037】また、リセット回路を用いることによって
別のCPUから緊急にアクセスを行う場合は排他制御を
解除して別のCPUからアクセスを行うことができる。
When an emergency access is made from another CPU by using the reset circuit, the exclusive control can be canceled and the access can be made from another CPU.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の1実施例を示すメモリ切替制御回路の
ブロック図である。
FIG. 1 is a block diagram of a memory switching control circuit showing an embodiment of the present invention.

【図2】本発明の他の実施例を示すメモリ切替制御回路
のブロック図である。
FIG. 2 is a block diagram of a memory switching control circuit showing another embodiment of the present invention.

【図3】本発明の他の実施例を示すメモリ切替制御回路
のブロック図である。
FIG. 3 is a block diagram of a memory switching control circuit showing another embodiment of the present invention.

【図4】本発明の他の実施例を示すメモリ切替制御回路
のブロック図である。
FIG. 4 is a block diagram of a memory switching control circuit showing another embodiment of the present invention.

【図5】従来のメモリ切替制御回路のブロック図であ
る。
FIG. 5 is a block diagram of a conventional memory switching control circuit.

【符号の説明】[Explanation of symbols]

1、2 CPU 3、10 F/F回路 4、11 遅延回路 5〜7 ゲート回路 8 メモリ 9 ロック制御回路 12〜14 ゲート回路 16 ロック時間検出回路 17 アクセス回数検出回路 18 リセット回路 1, 2 CPU 3, 10 F / F circuit 4, 11 Delay circuit 5-7 Gate circuit 8 Memory 9 Lock control circuit 12-14 Gate circuit 16 Lock time detection circuit 17 Access frequency detection circuit 18 Reset circuit

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 1つのメモリを複数のCPUからアクセ
スするためのメモリ切替制御回路において、 アクセス要求を示すリクエスト信号及び命令期間を示す
ロック信号を出力するCPUと、 前記CPUからリクエスト信号及びロック信号が入力さ
れると前記ロック信号の入力期間中は排他リクエスト信
号を出力するロック制御回路と、 前記ロック制御回路から出力された排他リクエスト信号
と別のCPUから出力されたリクエスト信号に基づいて
どのCPUがアクセスするかを決定してメモリを制御
し、前記CPUのアクセス中で排他リクエスト信号が出
力されている間は別のCPUのアクセスを禁止するメモ
リ制御部とを有することを特徴とするメモリ切替制御回
路。
1. A memory switching control circuit for accessing one memory from a plurality of CPUs, the CPU outputting a request signal indicating an access request and a lock signal indicating an instruction period, and the request signal and the lock signal from the CPU. A lock control circuit that outputs an exclusive request signal during the input period of the lock signal, and which CPU based on the exclusive request signal output from the lock control circuit and the request signal output from another CPU A memory control unit for controlling the memory by deciding whether or not to access, and for prohibiting access of another CPU while the exclusive request signal is being output during the access of the CPU. Control circuit.
【請求項2】 1つのメモリを複数のCPUからアクセ
スするためのメモリ切替制御回路において、 アクセス要求を示すリクエスト信号及び命令期間を示す
ロック信号を出力し、ロック制御異常信号が入力された
ときは前記ロック信号の出力を停止するCPUと、 前記CPUからロック信号が入力されたときはその入力
経過時間を計測して所定時間以上になると前記ロック制
御異常信号を出力するロック時間検出回路と、 前記CPUからリクエスト信号及びロック信号が入力さ
れると前記ロック信号の入力期間中は排他リクエスト信
号を出力するロック制御回路と、 前記ロック制御回路から出力された排他リクエスト信号
と別のCPUから出力されたリクエスト信号に基づいて
どのCPUがアクセスするかを決定してメモリを制御
し、前記CPUのアクセス中で排他リクエスト信号が出
力されている間は別のCPUのアクセスを禁止するメモ
リ制御部とを有することを特徴とするメモリ切替制御回
路。
2. A memory switching control circuit for accessing one memory from a plurality of CPUs outputs a request signal indicating an access request and a lock signal indicating a command period, and when a lock control abnormality signal is input. A CPU that stops the output of the lock signal; a lock time detection circuit that measures the input elapsed time when the lock signal is input from the CPU and outputs the lock control abnormality signal when the input elapsed time exceeds a predetermined time; When a request signal and a lock signal are input from the CPU, a lock control circuit that outputs an exclusive request signal during the input period of the lock signal, and an exclusive request signal that is output from the lock control circuit and that is output from another CPU Based on the request signal, determine which CPU to access to control the memory, Memory switching control circuit while the lock request signal in PU access is output, characterized in that it comprises a memory control unit to prohibit access another CPU.
【請求項3】 請求項2記載のメモリ切替制御回路にお
いて、 ロック時間検出回路の代わりにCPUからロック信号が
入力されたときは前記CPUからのリクエスト信号の出
力回数を検出して所定の回数以上になるとロック制御異
常信号を出力するアクセス回数検出回路を有することを
特徴とするメモリ切替制御回路。
3. The memory switching control circuit according to claim 2, wherein when a lock signal is input from the CPU instead of the lock time detection circuit, the number of output of the request signal from the CPU is detected and a predetermined number of times or more is detected. A memory switching control circuit having an access frequency detection circuit that outputs a lock control abnormality signal when
【請求項4】 請求項2記載のメモリ切替制御回路にお
いて、 ロック時間検出回路の代わりに別のCPUからリセット
要求信号が出力されたときはロック信号を出力している
CPUにロック制御異常信号を出力するリセット回路を
有することを特徴とするメモリ切替制御回路。
4. The memory switching control circuit according to claim 2, wherein when a reset request signal is output from another CPU instead of the lock time detection circuit, a lock control abnormality signal is output to the CPU that is outputting the lock signal. A memory switching control circuit having a reset circuit for outputting.
JP10551793A 1993-05-06 1993-05-06 Memory switching control circuit Pending JPH06314232A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10551793A JPH06314232A (en) 1993-05-06 1993-05-06 Memory switching control circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10551793A JPH06314232A (en) 1993-05-06 1993-05-06 Memory switching control circuit

Publications (1)

Publication Number Publication Date
JPH06314232A true JPH06314232A (en) 1994-11-08

Family

ID=14409800

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10551793A Pending JPH06314232A (en) 1993-05-06 1993-05-06 Memory switching control circuit

Country Status (1)

Country Link
JP (1) JPH06314232A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5844552A (en) * 1981-09-09 1983-03-15 Hitachi Ltd Equivalently decentralized information process system
JPS59195728A (en) * 1983-04-22 1984-11-06 Nec Corp Data processing device
JPS59223873A (en) * 1983-06-01 1984-12-15 Toshiba Corp Control method of multi-processor
JPS63128457A (en) * 1986-11-12 1988-06-01 インターナシヨナル・ビジネス・マシーンズ・コーポレーシヨン Controller and control of access to input/output device
JPS63174158A (en) * 1987-01-14 1988-07-18 Nissin Electric Co Ltd Multiprocessor system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5844552A (en) * 1981-09-09 1983-03-15 Hitachi Ltd Equivalently decentralized information process system
JPS59195728A (en) * 1983-04-22 1984-11-06 Nec Corp Data processing device
JPS59223873A (en) * 1983-06-01 1984-12-15 Toshiba Corp Control method of multi-processor
JPS63128457A (en) * 1986-11-12 1988-06-01 インターナシヨナル・ビジネス・マシーンズ・コーポレーシヨン Controller and control of access to input/output device
JPS63174158A (en) * 1987-01-14 1988-07-18 Nissin Electric Co Ltd Multiprocessor system

Similar Documents

Publication Publication Date Title
KR940001273B1 (en) Micro-system and method controlling bus-cycle
US5619661A (en) Dynamic arbitration system and method
US4000485A (en) Data processing system providing locked operation of shared resources
US3997896A (en) Data processing system providing split bus cycle operation
US4030075A (en) Data processing system having distributed priority network
US6839811B2 (en) Semaphore management circuit
KR19980024741A (en) Bus control method and apparatus using the method
JPH06314232A (en) Memory switching control circuit
US5544341A (en) Data access apparatus for preventing further cache access in case of an error during block data transfer
KR100246864B1 (en) Computer memory system with cache flush method and cache memory for second cache memory
JPH10320349A (en) Processor and data transfer system using the processor
JPH0728748A (en) Bus control mechanism and computer system
JPS59229662A (en) Common memory control circuit
JPS619747A (en) Bus controller
JP2837893B2 (en) Microcomputer device
JP4062478B2 (en) Device access method
JP2001005775A (en) Bus system
JP3022906B2 (en) Communication method of programmable controller
JPH0991246A (en) Bus control device and method thereof
JPH05120202A (en) Dma control system
JPH05127921A (en) Semiconductor integrated circuit
JPS61165172A (en) Memory access controlling system
JPS6224347A (en) bus controller
JPH0476152B2 (en)
JPS5930304B2 (en) Deadlock detection circuit