JPH02288929A - Shared memory access adjustment control method - Google Patents

Shared memory access adjustment control method

Info

Publication number
JPH02288929A
JPH02288929A JP3624189A JP3624189A JPH02288929A JP H02288929 A JPH02288929 A JP H02288929A JP 3624189 A JP3624189 A JP 3624189A JP 3624189 A JP3624189 A JP 3624189A JP H02288929 A JPH02288929 A JP H02288929A
Authority
JP
Japan
Prior art keywords
access
shared memory
cpu
output
flip
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
JP3624189A
Other languages
Japanese (ja)
Inventor
Masaki Fujiwara
正木 藤原
Tsuneo Kaneko
金子 恒男
Yukio Yamamoto
幸夫 山本
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.)
Shinko Seisakusho KK
Original Assignee
Shinko Seisakusho KK
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 Shinko Seisakusho KK filed Critical Shinko Seisakusho KK
Priority to JP3624189A priority Critical patent/JPH02288929A/en
Publication of JPH02288929A publication Critical patent/JPH02288929A/en
Pending legal-status Critical Current

Links

Landscapes

  • Multi Processors (AREA)

Abstract

PURPOSE:To resolve the impossibility of accurate data transfer by judging whether the access to a shared memory is possible or not by output states of first and second access possibility/impossibility reporting means and enabling a CPU which judges the possibility of access to access the shared memory. CONSTITUTION:When both of a first CPU 1 and a second CPU 2 will execute the access to a shared memory 3, they request the access to a shared memory adjusting circuit 5 by program instructions and inquire whether the access is permitted or not. They fetch the output states of first and second access possibility/impossibility reporting means 11 and 12 as data values and judge whether the access to the shared memory 3 is permitted or not by these data values, and the CPU which judges that the access is permitted accesses the shared memory 3. Thus, trouble that accurate one-word data cannot be transferred is resolved.

Description

【発明の詳細な説明】 〈産業上の利用分野〉 本発明は、ビット数の異なるCPUの共有メモリに対す
るアクセスの競合を回避するために各CPUのアクセス
の可否を調停する共有メモリのアクセス調整制御方法に
関する。
Detailed Description of the Invention <Industrial Application Field> The present invention provides shared memory access adjustment control that arbitrates whether or not each CPU can access the shared memory in order to avoid contention in access to the shared memory by CPUs with different bit numbers. Regarding the method.

〈従来の技術〉 最近、ビット数の異なる2つのCPUがデュアルポート
RAMによる共有メモリをアクセスする方法が行われて
いる。このような共有メモリに対し2つのCPU、例え
ば一方が8ビツトで他方か16ビツトのCPUの場合、
共有メモリに対するメモリ空間は第3図に示す例のよう
に設定されている。
<Prior Art> Recently, a method has been used in which two CPUs having different bit numbers access a shared memory using a dual port RAM. For such a shared memory, if there are two CPUs, say one is 8 bits and the other is 16 bits, then
The memory space for the shared memory is set as in the example shown in FIG.

即ち、共有メモリの同じメモリ空間を、例えば、8ビツ
トCPUでは100H1IOII(番地というように8
ビツト(1バイト)単位に設定し、16ビツトCPUで
は1000 f−(,1001H番地というように16
ビツト(1ワード)単位に設定している。このような同
じメモリ空間を読出しくリ−1・)する場合、8ビツト
CPUは、100I−T番地をリードすると下位データ
065Hを得、101H番地をリートすると上位データ
087Hを得、この2回のアクセスでデータ08765
 Hを得ることができる。これに対し、16ビツトCp
uは、1ワ一ド単位に100IH番地を1回でリードし
、データ08765Hを得ることかできく発明か解決し
ようとする課題7〉 しかるに、共有メモリに対してどちらかのCPUがアク
セスをしている場合は問題がないが、第4図に示した例
のように、あるタイミンク′で共有メモリの同じメモリ
空間に双方のCP Uがアクセスした場合に問題が発生
する。
In other words, the same memory space of the shared memory is, for example, 100H1IOII (address 8) on an 8-bit CPU.
It is set in units of bits (1 byte), and for a 16-bit CPU, it is set in 16 bits (1000 f-(, 1001H address)
It is set in bit (1 word) units. When reading the same memory space like this, the 8-bit CPU obtains lower data 065H when it reads address 100IT, obtains upper data 087H when it reads address 101H, and reads these two times. Access data 08765
H can be obtained. On the other hand, 16-bit Cp
u can read the 100IH address in units of 1 word at once and obtain data 08765H.Problem to be solved by invention 7> However, if either CPU accesses the shared memory, However, as in the example shown in FIG. 4, a problem occurs when both CPUs access the same memory space in the shared memory at a certain timing.

具体的には、8ピッl−CP Uが100H番地をリー
ドした後に16ビツl−CP Uが同じメモリ空間の1
001. I(番地にアクセスしデータo1234Hを
書き込むと、101 I(番地のデータが書き換えられ
、8ビツトCP Uか本来得られる08765Hが01
265 I(となり、8ビツトCPUは誤ったデータを
得ることになる。
Specifically, after the 8-bit l-CPU reads address 100H, the 16-bit l-CPU reads address 1 of the same memory space.
001. When accessing address I (and writing data o1234H, the data at address 101 I
265 I (and the 8-bit CPU will obtain incorrect data.

即ち、このように1バイトアクセスのCl) Uと1ワ
ードアクセスのCPUが共有メモリ上でそのアドレスを
競合させ、1バイトアクセスのCP Uが1アクセスし
、■ワードアクセスCPUが1アクセスした場合、■ワ
ードデータの上位バイトデタが不定のままアクセスされ
ることになり、正確な1ワードデータを転送することが
できないという不具合が生じることになる。
In other words, in this way, when Cl)U with 1-byte access and CPU with 1-word access compete for their addresses on the shared memory, the CPU with 1-byte access makes 1 access, and the word-access CPU makes 1 access. (2) The upper byte data of the word data will be accessed in an undefined state, resulting in a problem that one word of accurate data cannot be transferred.

く課題を解決するための手段及び作用〉上記課題を解決
するため、あるビット数の第1CPUに共有メモリのア
クセスの可否を知らせる第1アクセス可否報知手段と、
第1. CP Uとは異なるビット数の第2CPUに共
有メモリのアクセス可否を知らせる第2アクセス可否報
知手段と、第1及び第2の両CPUのプログラム命令を
第1及び第2の画策2アクセス可否報知手段にクロック
入力するだめのクロック供給手段とを設は且つ、第1及
び第2の両アクセス可否報知手段のそれぞれの出力を第
1及び第2の両CPUのデータバスのそれぞれに接続す
ることにより共有メモリ調整回路を構成し、そして第1
及び第2の両CPUが共有メモリに対しアクセスを実行
しようとする時、この両CPUが、それぞれのプログラ
ム命令により共有メモリ調整回路にアクセスの要求をす
ると共にアクセスの可否を問い、第1及び第2の両アク
セス司占報知手段の出力状態をデータ値とじて取り込み
、このデータ値により共有メモリのアクセスの可否を判
断し、アクセス町と判断したC■〕Uが共有メモリをア
クセスするようにした。そしてさらに1、共有メモリア
クセス調整回路のクロックを第1及び第2の両CPUの
プログラム命令による信号を入ツJするために各CPU
の基本クロックより周波数の高いクロックとし、第1ア
クセス可否報知手段のクロック入力と第2アクセス可否
報知手段のクロック入力との位相をずらして入ノJする
ように構成した。
Means and operation for solving the above problems> In order to solve the above problems, a first access notification means for notifying a first CPU having a certain number of bits as to whether access to the shared memory is possible;
1st. a second access notification means for informing a second CPU having a bit number different from that of the CPU whether or not the shared memory can be accessed; A clock supply means for inputting a clock to the CPU is provided, and the respective outputs of the first and second access notification means are connected to the data buses of the first and second CPUs, respectively. a memory adjustment circuit, and a first
When both the first and second CPUs attempt to access the shared memory, both CPUs request access to the shared memory adjustment circuit by their respective program instructions and inquire as to whether access is possible. The output states of both access controller notification means in 2 are taken in as data values, and based on these data values, it is determined whether or not the shared memory can be accessed, and C■]U, which has been determined to be the access town, is allowed to access the shared memory. . and 1. In order to input the clock of the shared memory access adjustment circuit to each CPU in accordance with the program instructions of both the first and second CPUs.
The clock has a higher frequency than the basic clock of , and the clock input of the first access notification means and the clock input of the second access permission notification means are shifted in phase.

より具体的には、第1アクセス可否報知手段の入力条件
として第2アクセス可否報知手段の出力を、また第2ア
クセス可否報知手段の入力条件として第1アクセス可否
報知手段の出力をそれぞれ条件としている。
More specifically, the input condition for the first access notification means is the output of the second access notification means, and the input condition for the second access notification means is the output of the first access notification means. .

このため、第1CPUか共有メモリをアクセス中に、第
2CPUが共有メモリをアクセスしようとして第2アク
セス可否報知手段に対しプログラム命令によりアクセス
をかけても、第1cPUが共有メモリをアクセス中であ
るため第1アクセス可否報知手段の出力が反転しており
、第2アクセス可否報知手段の出力は反転しないでリセ
ット時の論理のままである。したがって、第2アクセス
可否報知手段の正転出力は第2CPUのデータバスに論
理“H”を出力する。そして、これにより第2CPUは
、任意のビットを論理“H”として、例えばデータ値F
FH(データバスのどの信号線に接続されてもFFH)
を取り込み、共有メモリのアクセスの不可を知る。
Therefore, even if the second CPU tries to access the shared memory and uses a program command to access the second access notification means while the first CPU is accessing the shared memory, the first cPU is accessing the shared memory. The output of the first access notification means is inverted, and the output of the second access permission notification means is not inverted and remains at the logic at reset. Therefore, the normal output of the second access notification means outputs logic "H" to the data bus of the second CPU. As a result, the second CPU sets any bit to logic "H", for example, the data value F.
FH (FFH regardless of which signal line of the data bus is connected)
and learn whether shared memory is inaccessible.

第1CPUは、共有メモリのアクセスが終了すると、第
1アクセス可否報知手段をリセットして他の動作に移る
。この状態において、他の所定の動作をしながら随時、
第2CPUが共有メモリをアクセスしようとして第2ア
クセス可否報知手段にプログラム命令によりアクセスを
かけると、今度は第1アクセス可否報知手段の出力を入
力条件としている第2アクセス可否報知手段の出力が第
2CPUのプログラム命令により反転する。このため第
2アクセス可否報知手段の反転出力は第2CPUのデー
タバスに論理“L”を出力する。そして、これにより第
2CPUは、任意のビットを論理“L”としたデータ値
、例えばデータバスのり、信号線に接続されている場合
は、例えばデータ値FEHを取り込み、共有メモリのア
クセスの可を知る。
When the first CPU finishes accessing the shared memory, it resets the first access notification means and moves on to other operations. In this state, from time to time while performing other prescribed actions,
When the second CPU attempts to access the shared memory and accesses the second access notification means by a program command, the output of the second access notification means, which uses the output of the first access notification means as an input condition, is transmitted to the second CPU. It is reversed by the program instruction. Therefore, the inverted output of the second access notification means outputs a logic "L" to the data bus of the second CPU. Then, the second CPU takes in a data value with an arbitrary bit set to logic "L", for example, a data value FEH when connected to a data bus or signal line, and enables access to the shared memory. know.

共有メモリへのアクセスし終了した第2CPUは、第1
CPUと同様に、第2アクセス可否報知手段をリセット
として他の動作に移る。
The second CPU, which has finished accessing the shared memory,
Similar to the CPU, the second access notification means is reset and the process proceeds to other operations.

以上述べてきたことは両CPUの条件を逆にしても全く
同じである。
What has been described above is exactly the same even if the conditions for both CPUs are reversed.

次に、第1及び第2の両アクセス可否報知手段がリセッ
ト中に各CPUが各アクセス可否報知手段にアクセスを
同時にかける場合であるが、この場合には、第1及び第
2の両アクセス可否報知手段のクロック入力が位相を反
転させて入力されているため、どちらかのアクセス可否
報知手段の出力が先に確定固定され、両アクセス可否報
知手段が同時に出力を反転することがなく、必ず一方の
CPUだけが共有メモリをアクセス可能となる。
Next, while both the first and second access notification means are being reset, each CPU accesses each access permission notification means at the same time. Since the clock input of the notifying means is inputted with the phase inverted, the output of one of the access notifying means is determined and fixed first, and both access notifying means do not invert their outputs at the same time. Only the CPUs in the shared memory can access the shared memory.

く実 施 例〉 以下、本発明の実施例を図面に基づいて説明する。Example of implementation Embodiments of the present invention will be described below based on the drawings.

第1図は本発明の一実施例に用いる回路の回路図である
FIG. 1 is a circuit diagram of a circuit used in an embodiment of the present invention.

この第1図から分かるように、第1CPUI、即ち1バ
イトアクセスの8ビツトCPU1と第2CPU2、即ち
1ワードアクセスの16ビツトCPU2とは、デュアル
ポートRAMである共有メモリ3にそれぞれアドレス・
データバス1a12aで接続されており、共有メモリ3
をアクセスするようにされている。
As can be seen from FIG. 1, the first CPU, ie, the 8-bit CPU 1 with 1-byte access, and the second CPU 2, ie, the 16-bit CPU 2 with 1-word access, each have an address and an address in the shared memory 3, which is a dual-port RAM.
Connected by data bus 1a12a, shared memory 3
has been accessed.

両CPUI、2の共有メモリ3に対するアクセスの可否
を調整する調整回路5は、第1CPUIにより制御され
第1CPU1に共有メモリ3のアクセスの可否を知らせ
る「第1アクセス可否報知手段」としてのフリップフロ
ップ11と、第20PU2により制御され第2CPU2
に共有メモリ3のアクセスの可否を知らせる「第2アク
セス可否報知手段」としての第2フリツプフロツプ12
と、その周辺回路とより構成されている。
The adjustment circuit 5 that adjusts whether or not both CPUs 2 can access the shared memory 3 includes a flip-flop 11 that is controlled by the first CPUI and serves as a "first access notification means" that notifies the first CPU 1 whether or not the shared memory 3 can be accessed. The second CPU 2 is controlled by the 20th PU2.
A second flip-flop 12 serves as a "second access notification means" that informs the user whether access to the shared memory 3 is permitted or not.
and its peripheral circuits.

具体的には、第1フリツプフロツプ11の入力端子(J
)はNORゲート回路13の出力に接続され、他の入力
端子(K)は接地されている。そして、NORゲート1
3の二つの入力は、それぞれ、第2フリツプフロツプ1
2の正転出力端子(Q)からの出力と第1CPU1のプ
ログラム命令でデコーダ回路4aから出力される信号線
INlとに接続され、また第1フリツプフロツプ11の
リセット端子(CL R)はデコーダ回路4aから出力
される信号線○UTIに接続されており、第1フリツプ
フロツプ11は第1CPUIのプログラム命令によりリ
セットされるようになっている。そしてさらに、第1フ
リツプフロツプ11の反転出力端子(互)は、信号線I
NLの信号によりゲートが開けられ出力が得られる非反
転出力の出力制御付3ステートバツフア15の入力に接
続され、3ステートバツフア15の出力は第1CPU1
のアドレス・データバス1aのデータバスの信号線の一
つであるり。信号線に接続されている。
Specifically, the input terminal (J
) is connected to the output of the NOR gate circuit 13, and the other input terminal (K) is grounded. And NOR gate 1
The two inputs of 3 are connected to the second flip-flop 1, respectively.
The output from the normal rotation output terminal (Q) of the first flip-flop 11 is connected to the signal line INl outputted from the decoder circuit 4a according to the program command of the first CPU 1, and the reset terminal (CL R) of the first flip-flop 11 is The first flip-flop 11 is connected to a signal line ○UTI outputted from the first CPUI, and the first flip-flop 11 is reset by a program command from the first CPUI. Furthermore, the inverting output terminals (mutual) of the first flip-flop 11 are connected to the signal line I
It is connected to the input of a 3-state buffer 15 with output control and a non-inverted output whose gate is opened by the NL signal to obtain an output, and the output of the 3-state buffer 15 is connected to the first CPU 1.
It is one of the signal lines of the data bus of the address/data bus 1a. Connected to the signal line.

同様に、第2フリツプフロツプ12の入力端子(J )
はNORゲート回路14の出ノJに接続され、他の入力
端子(K)は接地されている。そして、NORゲート1
4の二つの入力は、それぞれ、第1フリツプフロツプ1
■の正転出力端子(Q)からの出力と第2CPU2のプ
ログラム命令でデコーダ回路4bから出ノJされる信号
線IN2とに接続され、また第2フリツプフロツプ12
のリセット端子(CLR)はデコーダ回路4bから出力
される信号線0UT2に接続されており、第2フリツプ
フロツプ12は第2CPU2のプログラム命令によりリ
セットされるようになっている。そしてさらに、第2フ
リツプフロツプ12の反転出力端子(Q)は信号線IN
2の信号によりゲートが開けられ出力が得られる非反転
出力の出力制御付3ステートバツフア16の入力に接続
され、3ステートバッファ16の出力は第2CPU2の
アドレス・データバス2aのデータバスの信号線の一つ
であるり。信号線に接続されている。
Similarly, the input terminal (J) of the second flip-flop 12
is connected to the output J of the NOR gate circuit 14, and the other input terminal (K) is grounded. And NOR gate 1
The two inputs of 4 are connected to the first flip-flop 1, respectively.
The output from the normal rotation output terminal (Q) of (2) is connected to the signal line IN2 which is output from the decoder circuit 4b according to the program command of the second CPU2, and the second flip-flop 12
The reset terminal (CLR) of the second flip-flop 12 is connected to the signal line 0UT2 outputted from the decoder circuit 4b, and the second flip-flop 12 is reset by a program command from the second CPU2. Furthermore, the inverting output terminal (Q) of the second flip-flop 12 is connected to the signal line IN
The output of the 3-state buffer 16 is connected to the input of the 3-state buffer 16 with output control, which has a non-inverted output and whose gate is opened by the signal of 2 to obtain an output. It's one of the lines. Connected to the signal line.

また、発振器17は、N ORゲート13.14の出力
、特に第1CPUIと第2CPU2よりのプログラム命
令を伝える信嬬線INI、IN2の信号に応答するため
、第]、 CP U lと第2CPU2の基本クロック
X1、X2より周波数の高い発振器とされている。
The oscillator 17 is also responsive to the output of the NOR gate 13.14, in particular to signals on the input lines INI, IN2 which carry program instructions from the first CPUI and the second CPU2. The oscillator has a higher frequency than the basic clocks X1 and X2.

そして、この発振器17の出力は、第1フリツプフロツ
プ11のクロック入力端子(i” )に入力され、イン
バータ回路18で反転されて第2フリツプフロツプ■2
のクロック入力端子(i” )に入力されている。これ
は第1CPUIと第2 CP U2が同時に第1フリツ
プフロツプ11と第2フリツプフロツプ12に制御をか
けた場合の各フリップフロップの同時動作を回避するた
めである。
The output of this oscillator 17 is input to the clock input terminal (i'') of the first flip-flop 11, inverted by the inverter circuit 18, and output to the second flip-flop 2.
This is to avoid simultaneous operation of each flip-flop when the first CPU 2 and the second CPU 2 control the first flip-flop 11 and the second flip-flop 12 at the same time. It's for a reason.

次に、両CPU1.2が共有メモリ3に対しアクセスを
実行する場合の調整と制御力法について述べる。
Next, the coordination and control method when both CPUs 1.2 access the shared memory 3 will be described.

第1フリツプフロツプ11と第2フリツプフロツプ12
とは、イニシャル時、第]、 CP U ]と第2CP
U2の所定のプログラム命令によりリセットされ、その
正転出力Qと反転出力Qはそれぞれ論理゛′■7”と゛
′Hパになっている。ここで、第1CPU1が共有メモ
リ3のアクセスを実行したい場合、第1CPUIは、共
有メモリ調整制御回路5に問い合わせて第1フリツプフ
ロツプ11の出力の状態をデータ値として取り込み、そ
れにより共有メモリ3のアクセスの可否を知り、アクセ
ス可と判断したとき共有メモリ3をアクセスする。
First flip-flop 11 and second flip-flop 12
At the initial time, CP U ] and 2nd CP
It is reset by a predetermined program command of U2, and its normal output Q and inverted output Q are logics ``7'' and ``H'', respectively.Here, the first CPU 1 wants to access the shared memory 3. In this case, the first CPU inquires of the shared memory adjustment control circuit 5 and takes in the state of the output of the first flip-flop 11 as a data value, thereby knowing whether or not the shared memory 3 can be accessed. access.

詳細には、第+−CP U 1がプログラム命令〔1N
  0AI()lなる命令を発生させると、デコーダ回
路4aより信号線INIに論理”L”が出力され、2人
力のN ORゲート13の一方に入力される。
Specifically, the +-th CPU 1 executes the program command [1N
When the command 0AI()l is generated, a logic "L" is output from the decoder circuit 4a to the signal line INI, and is input to one of the two NOR gates 13.

ここで、NORゲート13の他方の入力線は第2フリツ
プフロツプ12の正転出力Qに接続されており、第2フ
リツプフロツプ12がリセットされているので、第2フ
リツプフロツプ12の正転出力Qは論理“L”である。
Here, the other input line of the NOR gate 13 is connected to the non-inverting output Q of the second flip-flop 12, and since the second flip-flop 12 is reset, the non-inverting output Q of the second flip-flop 12 is logic " It is "L".

そして、この論理″■7”状態のときはN ORケト1
3のゲートが開けられ、これによりニーつの人力が論理
“L”となり、したがってNORゲート13の出力は、
論理”II”となって、第1フリツプフロツプ11の入
力端子、Jに入力される。
Then, when this logic "■7" state is established, N OR keto 1
The gate of NOR gate 13 is opened, which causes the input voltage of the knee to become logic "L", so the output of NOR gate 13 is
The logic becomes "II" and is input to the input terminal J of the first flip-flop 11.

この結果、第1フリツプフロツプ11の入力端子J、、
には論理“H”、“L”となり、この論理″■]”、■
、”が、発振器17から第1フリツプフロツプ11のク
ロック人力Tに供給されるクロックCLK、1の立下が
りエツジにより、確定し、第1フリツプフロツプ11の
正転出力Qは論理“L”から論理“H“°に変わる。と
同時に、第1フリツプフロツプ11の反転出力Qが論理
″”TI”から論理“L”に変わる。
As a result, the input terminals J of the first flip-flop 11,
The logic is “H”, “L”, and this logic “■]”,■
,'' is determined by the falling edge of the clock CLK1 supplied from the oscillator 17 to the clock T of the first flip-flop 11, and the normal output Q of the first flip-flop 11 changes from logic "L" to logic "H". At the same time, the inverted output Q of the first flip-flop 11 changes from logic "TI" to logic "L".

ここで、反転出力Qは非反転出力の出力制御イー、]3
ステートバッファ15に接続され、その出力は第1 C
PU1のアドレス・データバスのデータ)<ス線り。に
接続されているので、前述の信号線IN1の論理″′L
”により3ステートバツフア15の出力制御が解除され
、出力に論理″■7”が出力される。
Here, the inverted output Q is the output control of the non-inverted output, ]3
connected to the state buffer 15, whose output is the first C
PU1 address/data bus data)<S line. Since the signal line IN1 is connected to
``, the output control of the 3-state buffer 15 is released, and the logic ``■7'' is outputted.

そして、第1CPUIは、データバス上のり。The first CPUI is connected to the data bus.

が論理”L’“になったことにより、これを例えばデー
タ値F E Hとして取り込み、共有メモリ3のアクセ
ス可を知る。
Since it becomes logic "L'", this is taken in as a data value F E H, and it is known that the shared memory 3 can be accessed.

第1CPUIが共有メモリ3に対しアクセス中は、第1
フリツプフロツプ11の出ノEQ、Qはそれぞれ論理“
H”、“L″のままである。
While the first CPUI is accessing the shared memory 3, the first
The outputs EQ and Q of the flip-flop 11 are logic "
It remains at "H" and "L".

共有メモリ3へのアクセスを終了すると、第1CPUI
はプログラム命令[:OUT  IAH)なる命令を発
生させ、これによりデコーダ回路4aより信号線0UT
1に論理“L”が発生する。すると、信号線0UTIが
第1フリツプフロツプ11のリセット端子CLRに接続
されているので、第1フリツプフロツプ11は強制的に
リセットされ、その出力Q、Qは問い合わせ待ちの論理
“L”、“H′になる。そしてその後、第1 CPU1
は所定の実行動作に移る。
When access to shared memory 3 is finished, the first CPU
generates a program command [:OUT IAH), which causes the signal line 0UT to be output from the decoder circuit 4a.
Logic "L" is generated at 1. Then, since the signal line 0UTI is connected to the reset terminal CLR of the first flip-flop 11, the first flip-flop 11 is forcibly reset, and its outputs Q and Q become logic "L" and "H" waiting for an inquiry. Then, after that, the first CPU1
moves to a predetermined execution operation.

第1CPUIが共有メモリ3に対しアクセス中、即ち第
1フリツプフロツプ11の出力Q、Qが論理”H”、“
L”状態のとき、第2CPU2が共有メモリ3ヘアクセ
スする必要が発生すると、第2CPU2は同じく共有メ
モリアクセス調整回路5の第2フリツプフロツプ12に
アクセスの可否を問いかけ、第2フリツプフロツプ12
の出力の状態をデータ値として取り込み、それにより共
有メモリ3のアクセスの可否を知り、アクセス可と判断
したとき共有メモリ3をアクセスする。
The first CPUI is accessing the shared memory 3, that is, the outputs Q and Q of the first flip-flop 11 are at logic "H" or "
When the second CPU 2 needs to access the shared memory 3 in the "L" state, the second CPU 2 similarly asks the second flip-flop 12 of the shared memory access adjustment circuit 5 whether access is possible or not, and the second flip-flop 12
The state of the output is taken in as a data value, thereby knowing whether or not the shared memory 3 can be accessed, and when it is determined that the shared memory 3 can be accessed, the shared memory 3 is accessed.

詳細には、第2CPU2がプログラム命令〔IN  0
BH)なる命令を発生させると、デコーダ回路4bより
IN2の信号線に論理“L”が出力され、2人力のNO
Rゲート14の一方に入力される。
Specifically, the second CPU 2 receives the program command [IN 0
When the command BH) is generated, the decoder circuit 4b outputs logic "L" to the IN2 signal line, and the two-man NO
It is input to one side of the R gate 14.

ここで、NORゲー1−14の他方の入力線が第1フリ
ツプフロツプ11の正転出力Qに接続されており、第1
CPU1が共有メモリ3をアクセス中なので第1フリツ
プフロツプ11の正転出力Qは論理“H”である。した
がって、NORゲート14はこれによりゲートが閉じら
れ、NORゲート14の出力は論理“L”となる。
Here, the other input line of the NOR gate 1-14 is connected to the normal output Q of the first flip-flop 11.
Since the CPU 1 is accessing the shared memory 3, the normal output Q of the first flip-flop 11 is at logic "H". Therefore, the NOR gate 14 is closed, and the output of the NOR gate 14 becomes logic "L".

そして、この論理“L”出力が第1フリツプフロツプ1
1の入力端子Jに入力され、その結果、第1フリツプフ
ロツプ11の入力端子J、には論理“L”、”L”とな
り、この論理“L”、L”は、発振器■7からインバー
タ回路18により反転されて第2フリツプフロツプ12
のクロック人力Tに供給されるクロックCLK2の立下
がりエツジにより、確定するが、第2フリツプフロツプ
12の出力は前の状態と変わらず、正転出力Qの論理は
前の状態の″L”である。同時に反転比ツノ◇の論理も
変わらず“H”である。
Then, this logic "L" output is output from the first flip-flop 1.
As a result, the logic "L", "L" is input to the input terminal J of the first flip-flop 11, and this logic "L", "L" is transmitted from the oscillator 7 to the inverter circuit 18. is inverted by the second flip-flop 12
However, the output of the second flip-flop 12 remains unchanged from the previous state, and the logic of the normal output Q is "L" as in the previous state. . At the same time, the logic of the inversion ratio horn ◇ remains "H".

ここで、反転比力負は非反転出力の出力制御付3ステー
トバツフア1Gに接続され、その出力は第2CPU2の
アドレス・データバスのデータバス線り。に接続されて
いるので、前述の信号線1N2の論理”L”により3ス
テートバツフア16の出力制御が解除され、出力に論理
“H”が出力される。
Here, the inverted specific power negative is connected to a 3-state buffer 1G with output control of a non-inverted output, and its output is the data bus line of the address/data bus of the second CPU 2. Therefore, the output control of the 3-state buffer 16 is canceled by the logic "L" of the signal line 1N2, and the logic "H" is outputted.

そして、第2CPU2はデータバス上のり。が論理II
 HI+になったことにより、これを例えばデータ値F
 F Hとして取り込み、共有メモリ3のアクセスの不
可を知る。
Then, the second CPU 2 is connected to the data bus. is logic II
By becoming HI+, for example, the data value F
FH, and know whether the shared memory 3 cannot be accessed.

第1CPUIが共有メモリ3に対しアクセス中であるこ
とを知った第2CPU2は、他の所定の動作をしながら
随時共有メモリアクセス調整回路5に問い合わせ、アク
セス可を知るまでこれを繰り返す。その後は前述のごと
く第1CPU1と同じ動作を行い終了する。
When the second CPU 2 learns that the first CPUI is accessing the shared memory 3, it queries the shared memory access adjustment circuit 5 from time to time while performing other predetermined operations, and repeats this until it learns that access is possible. Thereafter, as described above, it performs the same operations as the first CPU 1 and ends.

以上の説明では第tcputが共有メモリ3に対しアク
セス中である場合における第2CPU2の制御を例に採
ったが、第1CPUIと第2CPU2の状態が逆の場合
も全く同様であり、共有メモリ3へのアクセス可のとき
はデータ値FEH、アクセス不可のときはデータ値F 
F Hとしてアクセス可否を知る。
In the above explanation, we have taken as an example the control of the second CPU 2 when the tcput is accessing the shared memory 3, but the same applies when the states of the first CPU and the second CPU 2 are reversed. Data value FEH when access is possible, data value F when access is not possible.
Find out whether access is possible as FH.

次いで、第1CPUIと第2CPU2か共有メモリアク
セス調整回路5の第1フリツプフロツプ11と第2フリ
ツプフロツプ12とに同時に問い合わせた場合について
説明する。
Next, a case will be described in which the first CPU I and the second CPU 2 simultaneously inquire of the first flip-flop 11 and the second flip-flop 12 of the shared memory access adjustment circuit 5.

第2図は共有メモリアクセス調整回路5における第1フ
リツプフロツプ11と第2フリツプフロツプ12の同時
動作の回避を説明するためのタイムチャートである。こ
の図における信号名は第1図と同様である。この第2図
から分かるように、クロックCLK1とCL K 2は
、位相かずれており、信号波形がそれぞれ反転している
FIG. 2 is a time chart for explaining avoidance of simultaneous operation of the first flip-flop 11 and the second flip-flop 12 in the shared memory access adjustment circuit 5. The signal names in this figure are the same as in FIG. As can be seen from FIG. 2, the clocks CLK1 and CLK2 are out of phase and have inverted signal waveforms.

両CPU1.2が共有メモリアクセス調整回路5を同時
にアクセスする場合は、クロックCLK1について見る
と、CLKlの立上がりのエツジの部分を含む論理“H
”の部分(第2図のA)と立下がりのエツジの部分を含
む論理“1.”の部分(第2図のB)の信号線INIと
IN2が同時に論理”L”になる場合である。
When both CPUs 1.2 access the shared memory access adjustment circuit 5 at the same time, when looking at the clock CLK1, the logic “H” including the rising edge of CLK1 is
” part (A in FIG. 2) and the falling edge part. This is a case where the signal lines INI and IN2 in the section ``(B in FIG. 2) become logic ``L'' at the same time.

第2図における■はAの部分で信号線INIと信号線I
N2とが同時に論理″■7”になった場合の同時動作の
回避のタイムチャー1・である。Aの部分にINIとI
N2とが同時に論理“L″である状態か発生すると、第
1及び第2の両フリップフロップ11.12はいずれも
リセッI・されているので、両NORゲート13.14
はいずれもゲートか開いており、それぞれの出力はいず
れも論理“H″になり、両フリップフロップ11.12
はクロックCL K 1とCT、、 K 2の入力待ち
となる。
In Fig. 2, ■ indicates the part A, which is the signal line INI and the signal line I.
This is a time chart 1 for avoiding simultaneous operations when N2 and N2 become logic "7" at the same time. INI and I in part A
When N2 is at logic "L" at the same time, both the first and second flip-flops 11.12 are reset, so both NOR gates 13.14
The gates of both flip-flops 11 and 12 are open, and their respective outputs become logic "H".
waits for the input of clocks CLK1, CT, and K2.

しかしCLKlの立下がりエツジが時間的に先になるの
で、この立下がりエツジにより第1フリツプフロツプ1
1の出力(Q)は論理“1−■“になる。これによりN
ORゲート14はゲートが閉じられてその出力は論理“
L”に戻り、続<、CI、K2の立下がりエツジが来て
も第2フリツプフロツプ12の出力は論理″■7”のま
まで出力は変わらない。したがってこの場合、第1 C
P U 1は共有メモリ3のアクセス可と判断し、他方
箱2CPU2はアクセス不可と判断し、両者が同時にア
クセス可となることはない。
However, since the falling edge of CLKl comes first in time, this falling edge causes the first flip-flop 1
The output (Q) of 1 becomes logic "1-■". This results in N
The OR gate 14 is closed and its output is a logic “
Even if the falling edge of continuation <, CI, and K2 comes, the output of the second flip-flop 12 remains at the logic "■7" and the output does not change. Therefore, in this case, the output of the first C
P U 1 determines that the shared memory 3 can be accessed, and the other box 2 CPU 2 determines that it cannot be accessed, so that both of them will not be able to access it at the same time.

第2図における■は■3の部分で(U帰線INIとIN
2が同時に論理″L“になった場合の同時動作の回避の
タイムチャー1・である。この場合はへの部分での動作
とほぼ同じであるが異なるのはクロックCL K 2の
立下がりが時間的に先になることである。このため今度
は第2フリツプフロツプ12の出力(Q)は論理“′H
”になる。そして、これによりNORゲー1へ13はゲ
ートが閉じられてその出力は論理“■7”に戻り、続<
 CL K Iの立下がりエツジが来ても第1フリツプ
フロツプ11の出力は論理”L”のままで出力は変わら
ない。
■ in Figure 2 is the part of ■3 (U return line INI and IN
This is a time chart 1 for avoiding simultaneous operations when the signals 2 and 2 become logic "L" at the same time. In this case, the operation is almost the same as in the part before, but the difference is that the clock CL K 2 falls first in time. Therefore, the output (Q) of the second flip-flop 12 is at logic "'H".
”. Then, as a result, the gate of NOR gate 1 13 is closed and its output returns to the logic “■7”, continuing <
Even when the falling edge of CLKI comes, the output of the first flip-flop 11 remains at logic "L" and the output does not change.

したがってこの場合、第2CPU2は共有メモリ3のア
クセス可と判断し、第1CPUIはアクセス不可と判断
し、両者が同時にアクセス可となることはない。
Therefore, in this case, the second CPU 2 determines that the shared memory 3 can be accessed, and the first CPU 2 determines that the shared memory 3 cannot be accessed, so that both of them will not be able to access the shared memory 3 at the same time.

以上のようにして第1CPUIと第2CPU2とが共有
メモリに対し同時にアクセスすることが回避される。
In this manner, simultaneous access by the first CPUI and the second CPU 2 to the shared memory is avoided.

尚、以上の実施例では、第1CPU1が8ピッ1−CP
U、第2CPU2が16ビツトCPUであったが、この
発明がその他のビット数のCPUに対しても適用できる
ことは言うまでもない。また、この実施例では、第1フ
リツプフロツプ11と第2フリツプフロツプ12の出力
を各CPUのデータバスのり。信号線に接続したか、デ
ータバスの他の信号線に接続できることも勿論である。
In the above embodiment, the first CPU 1 has 8 pins 1-CP.
Although the second CPU 2 is a 16-bit CPU, it goes without saying that the present invention can also be applied to CPUs with other bit numbers. Further, in this embodiment, the outputs of the first flip-flop 11 and the second flip-flop 12 are connected to the data bus of each CPU. Of course, it can also be connected to the signal line or to other signal lines of the data bus.

さらに、共有メモリアクセス調整回路5を構成する各回
路素子を同等の機能を持つ他の回路素子に置き換えても
実施できる。
Furthermore, the present invention can also be implemented by replacing each circuit element constituting the shared memory access adjustment circuit 5 with another circuit element having an equivalent function.

〈発明の効果〉 このように、本発明に係る共有メモリアクセス調整制御
方法によれば、第1及び第2の両アクセス可否報知手段
を含む簡単な回路構成の共有メモリアクセス調整回路を
設け、異なるビ・ソト数を有する第1及び第2の両CP
Uが共有メモリのアクセスを実行しようとする時、この
両CPUが、それぞれのプログラム命令により共有メモ
リ調整回路に対しアクセスを行い、第1及び第2の両ア
クセス可否報知手段の出力状態をデータ値として取り込
み、このデータ値により共有メモリのアクセスの可否を
判断し、アクセス可と判断したC )) Uが共有メモ
リをアクセスできるようにし、両CI)Uが共有メモリ
に対し同時にアクセスすることを回避するようにしてい
るので、」二連した従来技術における正確なデータの転
送ができなくなるという不具合が解消されるとい・う効
果があり、また共有メモリへのアクセスが不可となった
CPUはシステムの他のモジュールへアクセスすること
かできCPUの処理効率を向−1−することができると
いう効果がある。
<Effects of the Invention> As described above, according to the shared memory access adjustment control method according to the present invention, a shared memory access adjustment circuit with a simple circuit configuration including both the first and second access permission reporting means is provided, and different Both the first and second CPs have bi-soto numbers.
When U attempts to access the shared memory, both CPUs access the shared memory adjustment circuit according to their respective program instructions, and use the output states of both the first and second access notification means as data values. This data value is used to determine whether the shared memory can be accessed, allowing C)) U to access the shared memory, and preventing both CIs) U from accessing the shared memory at the same time. This has the effect of resolving the problem of not being able to transfer accurate data in the conventional technology, and also makes it possible for the CPU that cannot access the shared memory to This has the effect that it is possible to access other modules, thereby improving the processing efficiency of the CPU.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の実施例に用いる回路の回路図、第2図
は共有メモリアクセス調整回路における第1フリツプフ
ロツプと第2フリツプフロツプの同時動作の回避を説明
するためのタイムチャート図、 第3図は一方が1バイト(8ビツト)アクセスのCPU
で他方が1ワード(16ビツト)アクセスのCPUの場
合における共有メモリに対するメモリ空間の一例を示す
図、そして 第4図は1バイトアクセスのCPUと1ワードアクセス
のCPUが共有メモリ上でそのアドレスを競合させた場
合の一例を示す図である。 ■・−−−−−一第1CPU L a 、  2 a −−−−−−アドレス・データ
バス2−・°°“第2CPU 3−−−−一共有メモリ 4a、4 b−一一一一デコーダ回路 5−−−−−共有メモリアクセス調整回路11−−−一
第1フリップフロップ (第1アクセス可否報知手段) 12−−−−一一第2フリップフロップ(第2アクセス
可否報知手段) 13.14−−−2人力NORゲート 15.16−−−−−−3ステートバッファ、17−・
−・−・−発振器 18・・・−インバータ回路。 吠 (ト) 、木1(、k 廿 綜
FIG. 1 is a circuit diagram of a circuit used in an embodiment of the present invention, FIG. 2 is a time chart diagram for explaining avoidance of simultaneous operation of the first flip-flop and the second flip-flop in the shared memory access adjustment circuit, and FIG. is a CPU with 1-byte (8-bit) access on one side.
Figure 4 shows an example of the memory space for a shared memory when the other CPU is a 1-word (16-bit) access CPU, and Figure 4 shows how a 1-byte access CPU and a 1-word access CPU write their addresses on the shared memory. FIG. 7 is a diagram illustrating an example of a case of competition. ■・-----1st CPU La, 2a ---------Address/data bus 2-・°°"2nd CPU 3-----1 Shared memory 4a, 4b-1111 Decoder circuit 5 --- Shared memory access adjustment circuit 11 ----1st flip-flop (first access notification means) 12 ---11 second flip-flop (second access notification device) 13 .14---2-manpower NOR gate 15.16---3-state buffer, 17-・
----Oscillator 18...--Inverter circuit.忿綜 (to), wood 1 (, k

Claims (2)

【特許請求の範囲】[Claims] (1)ビット数の異なる第1CPUと第2CPUとが共
有メモリをアクセスする場合の共有メモリアクセス調整
制御方法であって、 第1CPUへ共有メモリに対するアクセスの可否を知ら
せる第1アクセス可否報知手段と、第2CPUへ共有メ
モリに対するアクセス可否を知らせる第2アクセス可否
報知手段と、第1及び第2の両CPUのプログラム命令
を第1及び第2の両アクセス可否報知手段にクロック入
力とするためのクロック供給手段とを備え、そして第1
及び第2の両アクセス可否報知手段のそれぞれの出力が
第1及び第2の両CPUそれぞれのデータバスに接続さ
れた共有メモリ調整回路を用い、 第1及び第2の両CPUが共有メモリのアクセスを実行
しようとする時、この両CPUが、それぞれのプログラ
ム命令により共有メモリ調整回路に対しアクセスを行い
、第1及び第2の両アクセス可否報知手段の出力状態を
データ値として取り込み、このデータ値により共有メモ
リのアクセスの可否を判断し、アクセス可と判断したC
PUが共有メモリをアクセスできるようにしたことを特
徴とする共有メモリアクセス調整制御方法。
(1) A shared memory access adjustment control method when a first CPU and a second CPU having different numbers of bits access a shared memory, the method comprising: a first access permission notification means that notifies the first CPU whether or not access to the shared memory is permitted; a second access notification means that informs the second CPU whether or not it can access the shared memory; and a clock supply for inputting program instructions of both the first and second CPUs to the first and second access notification means. means, and a first
and a shared memory adjustment circuit in which the respective outputs of the second both access notification means are connected to the respective data buses of both the first and second CPUs, so that both the first and second CPUs can access the shared memory. When attempting to execute , both CPUs access the shared memory adjustment circuit according to their respective program instructions, take in the output states of both the first and second access notification means as data values, and read this data value. Determine whether the shared memory can be accessed by
A shared memory access adjustment control method characterized by allowing a PU to access shared memory.
(2)共有メモリアクセス調整回路のクロックが第1及
び第2の両CPUの基本クロックより周波数の高いクロ
ックであり、第1アクセス可否報知手段のクロック入力
と第2アクセス可否報知手段のクロック入力とは位相が
ずらされて入力されることを特徴とする請求項(1)記
載の共有メモリアクセス調整制御方法。
(2) The clock of the shared memory access adjustment circuit is a clock having a higher frequency than the basic clock of both the first and second CPUs, and the clock input of the first access notification means and the clock input of the second access notification means are 2. The shared memory access adjustment control method according to claim 1, wherein the input signals are shifted in phase.
JP3624189A 1989-02-17 1989-02-17 Shared memory access adjustment control method Pending JPH02288929A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3624189A JPH02288929A (en) 1989-02-17 1989-02-17 Shared memory access adjustment control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3624189A JPH02288929A (en) 1989-02-17 1989-02-17 Shared memory access adjustment control method

Publications (1)

Publication Number Publication Date
JPH02288929A true JPH02288929A (en) 1990-11-28

Family

ID=12464276

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3624189A Pending JPH02288929A (en) 1989-02-17 1989-02-17 Shared memory access adjustment control method

Country Status (1)

Country Link
JP (1) JPH02288929A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60229156A (en) * 1984-04-25 1985-11-14 Nec Corp Common memory device
JPS60245063A (en) * 1984-05-21 1985-12-04 Fujitsu Ltd Access system for shared memory
JPS615363A (en) * 1984-06-19 1986-01-11 Matsushita Electric Ind Co Ltd Controller of shared memory

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60229156A (en) * 1984-04-25 1985-11-14 Nec Corp Common memory device
JPS60245063A (en) * 1984-05-21 1985-12-04 Fujitsu Ltd Access system for shared memory
JPS615363A (en) * 1984-06-19 1986-01-11 Matsushita Electric Ind Co Ltd Controller of shared memory

Similar Documents

Publication Publication Date Title
US4112490A (en) Data transfer control apparatus and method
US4870562A (en) Microcomputer capable of accessing internal memory at a desired variable access time
JPS61156358A (en) Bus converter
JPS6151243A (en) Register type operation processor
US4853847A (en) Data processor with wait control allowing high speed access
JPS5844558A (en) N-channel mos semiconductor processor
JP2661222B2 (en) Pulse output device
JPS6217783B2 (en)
JPH05324348A (en) Single chip microcomputer
JPS6111872A (en) Semiconductor integrated circuit
JP3593348B2 (en) Integrated circuit
JPH02288929A (en) Shared memory access adjustment control method
JP3737144B2 (en) Interrupt request circuit and interrupt request processing method
US5179678A (en) Address/control signal input circuit for a cache controller which clamps the address/control signals to predetermined logic level clamp signal is received
JP2693598B2 (en) Program execution controller for digital signal processor
JPS6383844A (en) Microprocessor system
JP2569534B2 (en) Microcomputer
JP2004185060A (en) Microcomputer
JP2539064B2 (en) Microprocessor
JP2668215B2 (en) Micro computer
JPH06301641A (en) Electronic computer
JPH0330899B2 (en)
JPH01121965A (en) Microprocessor
JPS61288243A (en) Processing system for compare and swap instruction
JPH01200438A (en) Interruption control circuit