JPH02100165A - Method for making access to dual port memory - Google Patents

Method for making access to dual port memory

Info

Publication number
JPH02100165A
JPH02100165A JP63252572A JP25257288A JPH02100165A JP H02100165 A JPH02100165 A JP H02100165A JP 63252572 A JP63252572 A JP 63252572A JP 25257288 A JP25257288 A JP 25257288A JP H02100165 A JPH02100165 A JP H02100165A
Authority
JP
Japan
Prior art keywords
processor
flag
port memory
dual port
bit
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
JP63252572A
Other languages
Japanese (ja)
Inventor
Takeshi Imai
毅 今井
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 JP63252572A priority Critical patent/JPH02100165A/en
Publication of JPH02100165A publication Critical patent/JPH02100165A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To perform the contention control of memory access only by a software processing by establishing its own flag area at a flag area when no flag is established, and obtaining an access right to a memory area. CONSTITUTION:A processor which desires to obtain the access right of a dual port memory 1 out of two processors 2a and 2c reads out the flag area of the dual port memory 1. And the processor, after confirming whether or not the flag to request the access right is established from another processor, obtains the access right by establishing its own flag when no flag is confirmed. Furthermore, the establishment of the flag by another processor can be performed by releasing its own flag after completing access. In such a way, it is possible to perform the contention control of the dual port memory 1 between the two processors 2a and 2c via the flag area.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、デュアルポートメモリを介して2つのプロ
セッサがデータ通信を行う場合のデュアルポートメモリ
アクセス方法に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a dual port memory access method when two processors perform data communication via a dual port memory.

(従来の技術) 第4図は、HOLD機能を持つプロセッサを用いてデュ
アルポートメモリを介しデータ通信を行う従来のハード
ウェア構成を示す図であり5図において、(1)はデュ
アルポートメモリ、  (2a)。
(Prior Art) Fig. 4 is a diagram showing a conventional hardware configuration that performs data communication via a dual port memory using a processor with a HOLD function. In Fig. 5, (1) is a dual port memory, ( 2a).

(2b)はこのデュアルポートメモリ(1)に接続され
たHOLD機能を持つプロセッサ、(3a)はHOLD
機能を持つプロセッサ(2a)とデュアルポートメモリ
(1)の間でデータを通すデータバス、(3b)はHO
LD種機能持つプロセッサ(2b)と、デュアルポート
メモリ(1)の間でデータを通ずデータバス、(4a)
はHOLD機能を持つプロセッサ(2a)からデュアル
ポートメモリ(1)ヘアドレスを出すアドレスバス、(
4b)はHOLD機能を持つプロセッサ(2b)からデ
ュアルポートメモリ(1)ヘアドレスを出すアドレスバ
ス、 (5a)はHOLD機能を持つプロセッサ(2a
)からのライト信号をデュアルポートメモリ(1)へ出
すライト信分線、(5b)はHOLD機能を持つプロセ
ッサ(2b)からのライト信号をデュアルポートメモリ
(1)へ出すライトa分線、(6a)はHOLD機能を
持つプロセッサ(2a)からのリード信号をデュアルポ
ートメモリ(1)へ出すリード線、(6b)はHOLD
機能を持つプロセッサ(2b)からのリード信号をデュ
アルポートメモリ(1)へ出すリード線、(7a)はH
OLD機能を持つプロセッサ(2a)からチップセレク
ト信号をデュアルポートメモリ(1)へ出すチップセレ
ト信号線、(7b)はHOLD機能を持つプロセッサ(
2b)からチップセレクト信号をデュアルポートメモリ
(1)へ出すチップセレクト信号線、(8a)はデュア
ルポートメモリ(1)で各プロセッサ(2a) 、 (
2b)が同一アドレスをアクセスし、衝突が起きたこと
をプロセッサ(2a)に知らせるビジー信号線、(8b
)はデュアルポートメモリ(1)で各プロセッサ(2a
) 、 (2b)が同一アドレスをアクセスし、衝突が
起きたことをプロセッサ(2b)に知らせるビジー信号
線である。
(2b) is a processor with a HOLD function connected to this dual port memory (1), (3a) is a HOLD
A data bus (3b) is an HO bus that passes data between a functional processor (2a) and a dual port memory (1)
A data bus (4a) that passes data between the processor with LD type function (2b) and the dual port memory (1)
is an address bus that outputs an address from the processor (2a) with HOLD function to the dual port memory (1), (
4b) is an address bus that outputs the address from the processor with HOLD function (2b) to the dual port memory (1), and (5a) is the processor with HOLD function (2a).
) is the write signal branch line that sends the write signal from the processor (2b) to the dual port memory (1), (5b) is the write a line that sends the write signal from the processor (2b) with the HOLD function to the dual port memory (1), ( 6a) is a lead wire that outputs the read signal from the processor (2a) with HOLD function to the dual port memory (1), (6b) is the HOLD
The lead wire (7a) is H for sending the read signal from the functional processor (2b) to the dual port memory (1).
The chip select signal line (7b) outputs the chip select signal from the processor with OLD function (2a) to the dual port memory (1),
2b) is the chip select signal line that outputs the chip select signal to the dual port memory (1), (8a) is the dual port memory (1) and each processor (2a), (
2b) accesses the same address and a busy signal line (8b) informs the processor (2a) that a collision has occurred;
) is dual-port memory (1) for each processor (2a
) and (2b) are busy signal lines that notify the processor (2b) that the same address has been accessed and a collision has occurred.

次に動作について説明する。HOLDlil能を持つプ
ロセッサ(2a)からデュアルポートメモリ(1)中に
あるアドレスにデータを書き込むためには、プロセッサ
(2a)はまずアドレスバス(4a)を用いてデータを
書ぎ込みたいアドレスのアドレス信号をデュアルポート
メモリ(1)へ送ると共に、チップセレクト信号線(7
a)により、チップセレクト信号をデュアルポートメモ
リ(1)に出し、アドレスを確定させ、次にプロセッサ
(2a)はデータバス(3a)を用いて書き込みデータ
をデュアルポートメモリ(1)へ出し、ライト信号線(
5a)によりライト信号を出すことによりデュアルポー
トメモリ(1)の任意のアドレスにデータを書き込むこ
とができる。
Next, the operation will be explained. In order to write data from the processor (2a) with the HOLDlil function to an address in the dual port memory (1), the processor (2a) first uses the address bus (4a) to write the address to which the data is to be written. While sending the signal to the dual port memory (1), the chip select signal line (7
According to a), the chip select signal is sent to the dual port memory (1) to confirm the address, and then the processor (2a) uses the data bus (3a) to send the write data to the dual port memory (1), and the write Signal line(
5a), data can be written to any address of the dual port memory (1) by issuing a write signal.

又、プロセッサ(2a)からデュアルポートメモリ(1
)のあるアドレスのデータを読み出す場合プロセッサ(
2a)はまずアドレスバス(4a)を用いて読み出した
いデータが格納されているデュアルポートメモリ(1)
上のアドレスのアドレス信号をデュアルポートメモリ(
1)へ送ると共にチップセレクト信号線(7a)にチッ
プセレクト信号をデュアルポートメモリ(1)へ出し、
アドレスを確定したのちプロセッサ(2a)はリード信
号線(6a)にリード信号を出すことにより、デュアル
ポートメモリ(1)はアドレス信号で指定されたアドレ
スに格納されているデータをデータバス(3a)に出す
のでプロセッサ(2a)はこのデータを読み込む。
In addition, the dual port memory (1) is connected from the processor (2a).
), the processor (
2a) is the dual port memory (1) that stores the data to be read using the address bus (4a).
The address signal of the upper address is connected to the dual port memory (
1) and sends a chip select signal to the chip select signal line (7a) to the dual port memory (1),
After determining the address, the processor (2a) issues a read signal to the read signal line (6a), so that the dual port memory (1) transfers the data stored at the address specified by the address signal to the data bus (3a). The processor (2a) reads this data.

上記プロセッサ(2a)同様にプロセッサ(2b)から
デュアルポートメモリ(1) にデータを書き込む場合
にはプロセッサ(2b)はデータを書き込みたいアドレ
スのアドレス信号をアドレスバス(4b)で送出すると
共に、チップセレクト信号をチップセレクト信号線(7
b)に出し、次に書き込みたいデータをデータバス(3
b)に出しライト信号をライト信号線(5b)に出すこ
とにより、デュアルポートメモリ(1)の任意のアドレ
゛スにデータを書き込むことができる。又、プロセッサ
(2b)からデュアルポートメモリ(1)の任意のアド
レスに格納されているデータを読み出す場合、アドレス
信号をアドレスバス(4b)へ出すと共に、チップセレ
クト信号をチップセレクト信号線(7b)へ出し、アド
レスを確定させ、リード信号線(6b)にリード信号を
出すことによりデュアルポートメロモリ(1)の任意の
アドレスに格納されているデータを読み出すことができ
る。
Similarly to the processor (2a) above, when writing data from the processor (2b) to the dual port memory (1), the processor (2b) sends an address signal of the address to which data is to be written via the address bus (4b), and Connect the select signal to the chip select signal line (7
b), and then send the data you want to write to the data bus (3).
Data can be written to any address of the dual port memory (1) by outputting a write signal to the write signal line (5b). In addition, when reading data stored in an arbitrary address of the dual port memory (1) from the processor (2b), an address signal is sent to the address bus (4b), and a chip select signal is sent to the chip select signal line (7b). Data stored at any address in the dual port memory (1) can be read by outputting the data to the dual port memory (1), determining the address, and issuing a read signal to the read signal line (6b).

今、HOLD機能を持つプロセッサ(2a) 、 (2
b)から同時に同一アドレスに異なるデータを書と込も
うとした場合、データが保証できない為、優先度の低い
プロセッサを接続する側にデュアルポートメモリ(1)
はビジー信号を出す。ここでプロセッサ(2b)が優先
度の低いプロセッサとした場合、同時にプロセッサ(2
a) 、 (2b)からデータを書き込もうとすると、
デュアルポートメモリ(1)はビジー信号線(8b)に
ビジー信号を出し、プロセッサ(2b)のHOLD入力
にこの信号が入るとプロセッサ(2b)は書き込み動作
を中断することにより、デュアルポートメモリ(1)内
でデータの競合が発生しない。又、一方のプロセッサが
デュアルポートメモリ(1)のあるアドレスにデータを
書き込み動作中に他方のプロセッサが同一アドレスに読
み出し、あるいは書き込みを行なおうとすると、ビジー
信号が送出され、これをHOLD入力に接続しておくこ
とにより後から動作したプロセッサは動作を中断するこ
とにより、デュアルポートメモリ(1)内でデータの競
合が発生しないが、HOLD機能を持たないプロセッサ
をデュアルポートメモリ(1)に接続した場合、デュア
ルポートメモリ(1)がビジー信号を出力してもプロセ
ッサの動作を停止させることができないので読み出し、
書き込みデータの保証ができなくなる。
Now, processors with HOLD function (2a), (2
If you try to write different data to the same address at the same time from b), the data cannot be guaranteed, so use dual port memory (1) on the side to which a low priority processor is connected.
gives a busy signal. Here, if processor (2b) is a low-priority processor, then processor (2b) is
If you try to write data from a), (2b),
The dual port memory (1) outputs a busy signal to the busy signal line (8b), and when this signal is input to the HOLD input of the processor (2b), the processor (2b) interrupts the write operation. ), no data conflicts occur. Also, if one processor is writing data to a certain address in the dual port memory (1) and the other processor tries to read or write data to the same address, a busy signal is sent and this is sent to the HOLD input. By keeping the processor connected, the processor that started running later will suspend its operation, so data conflicts will not occur in the dual port memory (1), but if a processor that does not have a HOLD function is connected to the dual port memory (1) In this case, even if the dual port memory (1) outputs a busy signal, the processor operation cannot be stopped.
Write data cannot be guaranteed.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

従来のデュアルポートメモリを介したプロセッサ間のデ
ータ通信は以上の様な動作をするため、両プロセッサ間
でデュアルポートメモリのデータの競合が発生した際、
HOLD機能を有するプロセッサにおいては相手方プロ
セッサにビジー信号を出力し、その動作を中断できるが
、HOLD機能を有さないプロセッサに関してはビジー
信号は有効とならずデュアルポートメモリの読み出し、
書き込みデータの保証ができなくなる。そのため、)(
OLD機能を有しないプロセッサでデュアルポートメモ
リをアクセスする場合は、別のハードウェアを付加して
、両プロセッサが同一アドレスをアクセスしないように
保証することが必要であるなど、使用するプロセッサが
制限されてしまうといった問題点があった。
Data communication between processors via conventional dual-port memory operates as described above, so when a contention for dual-port memory data occurs between both processors,
A processor that has a HOLD function can output a busy signal to the other processor and interrupt its operation, but for a processor that does not have a HOLD function, the busy signal is not valid and it is possible to read dual port memory,
Write data cannot be guaranteed. Therefore,)(
When accessing dual-port memory with a processor that does not have the OLD function, it is necessary to add additional hardware to ensure that both processors do not access the same address, which limits the processor used. There was a problem that the

この発明は、上記のような問題点を解消するためになさ
れたもので、八−ドウエアを付加することなく、HOL
D種機能持たないプロセッサを用いてもデュアルポート
メモリを介して通信を行なうことのできるデュアルポー
トメモリのアクセス方法を可能とすることを目的とする
This invention was made in order to solve the above-mentioned problems.
It is an object of the present invention to provide a method for accessing a dual port memory that allows communication via the dual port memory even when using a processor that does not have a D type function.

〔課題を解決するための手段〕[Means to solve the problem]

この発明に係るデュアルポートメモリのアクセス方法は
、デュアルポートメモリを2つのプロセッサで相互にア
クセスし、バッファエリアを介して上記プロセッサ間で
データ通信を行なわせるものにおいて、上記デュアルポ
ートメモリに、各プロセッサ間でメモリエリアのアクセ
ス権を競合する際各プロセッサがメモリエリアのアクセ
ス権要求のためのフラグを立てるフラグエリアを設け、
各プロセッサが相互に相手方フラグの確立を監視し、フ
ラグ未確立時に自己のフラグをフラグエリアに確立し、
メモリエリアのアクセス権を得るようにしたものである
A dual port memory access method according to the present invention allows two processors to mutually access the dual port memory and perform data communication between the processors via a buffer area, wherein each processor A flag area is provided in which each processor sets a flag for requesting memory area access rights when competing for memory area access rights between processors.
Each processor mutually monitors the establishment of the other party's flag, and when the flag is not established, establishes its own flag in the flag area,
This allows access rights to the memory area to be obtained.

〔作用〕[Effect]

この発明によれば、2つのプロセッサの内デュアルポー
トメモリのアクセス権を取得しようとするプロセッサは
、デュアルポートメモリ中のフラグエリアを読み出し、
他プロセツサからアクセス権要求のためのフラグが確立
されていないかを確認し、フラグが確認されていなけれ
ば自己のフラグを確立してアクセス権を取得し、アクセ
ス完了後は自己フラグを解除して他プロセツサのフラグ
確立を可能とすることで、フラグエリアを通して双方の
プロセッサ間でデュアルポートメモリの競合制御が行な
われる。
According to this invention, a processor that wants to obtain access rights to the dual port memory of two processors reads the flag area in the dual port memory, and
Checks whether a flag for requesting access rights has been established from another processor, and if the flag is not confirmed, establishes its own flag to obtain access rights, and after the access is completed, clears the self flag. By allowing flags of other processors to be established, dual port memory contention control is performed between both processors through the flag area.

〔実施例〕〔Example〕

以下、この発明の一実施例を図について説明する。第1
図は第4図に対応するこの発明の一実施例によるデュア
ルポートメモリアクセス方式のハードウェア構成を示す
図であり、同図においてデュアルポートメモリ(1)は
第2図(a) (b)に示すようなメモリマツプに従フ
てアクセスされるものとする。また(2c) 、 (2
d)はHOLD機能を持たないプロセッサである。第2
図(a)のメモリマツプi’ (a)はDPM管理エリ
アのアクセス権を制御する為の占有フラグで、第2図(
b)に示す様に、プロセッサ(2c)に対応したMビッ
ト(9m)と、プロセッサ(2d)に対応したSビット
(9s)を定義する。
An embodiment of the present invention will be described below with reference to the drawings. 1st
The figure is a diagram showing the hardware configuration of a dual port memory access method according to an embodiment of the present invention corresponding to FIG. It is assumed that the memory is accessed according to the memory map shown below. Also (2c), (2
d) is a processor without a HOLD function. Second
The memory map i' (a) in Figure (a) is the occupancy flag for controlling access rights to the DPM management area, and the memory map i' (a) in Figure 2 (
As shown in b), an M bit (9m) corresponding to the processor (2c) and an S bit (9s) corresponding to the processor (2d) are defined.

(lla) 〜(lln)はプロセッサ(2c) 、 
(2d)間でデータ転送の為に使用するバッファエリア
である。
(lla) to (lln) are processors (2c),
(2d) This is a buffer area used for data transfer.

(lO)はバッファエリア(ila)〜(lln)の状
態を管理する為のバッファ管理エリアである。
(lO) is a buffer management area for managing the status of buffer areas (ila) to (lln).

次に動作について第3図(a)〜(b)に示すフローチ
ャートに基づき説明する。HOLD機能を持たないプロ
セッサ(2c) 、 (2d)は各々デュアルポートメ
モリのバッファをアクセスする場合、それぞれ第3図(
a) に示すフローチャートに従ってバッファをアクセ
スする。まず、プロセッサ(2c)の処理について述べ
る。プロセッサ(2C)はデュアルポートメモリ(1)
のバッファ(lla)〜(lln)にデータを書き込み
、又は読み出しを行う際、どのバッファが使用可能か知
る為、占有フラグ (9)をget  (確立)する(
ステップ5al)、この詳細は第3図(b)に示す、占
有フラグ (9)をgetする場合、まず一定周期内に
占有フラグを確立できるか否かを計測するカウンタなり
リアしくステップ5bl)、占有フラグ (9)を読む
(ステップ5b2)、 Sビット(9s)を判定しくス
テップ5b3)、Sビット(9S)が0である場合、M
ビット(9g+)を1にする(ステップ5b4)、そし
て再度占有フラグ (9)を読み(ステップ5b5)、
Mビット(9+a)が1であるか判定する(ステップ5
b6)、これはプロセッサ(2d)がバイト構成でSビ
ット(9s)に占有フラグを立てた場合、Mビット(9
m)が0になる可能性があるからである0Mビット(9
+a)が1である場合、Sビット(9S)が0であるこ
とを確認する(ステップ5b7) 。
Next, the operation will be explained based on the flowchart shown in FIGS. 3(a) to 3(b). When the processors (2c) and (2d) without the HOLD function each access the buffer of the dual port memory, the processors (2c) and (2d) each access the buffer of the dual port memory as shown in Fig. 3 (
a) Access the buffer according to the flowchart shown in . First, the processing of the processor (2c) will be described. Processor (2C) has dual port memory (1)
When writing or reading data to or from the buffers (lla) to (lln), get (establish) the occupancy flag (9) in order to know which buffers can be used.
Step 5al), the details of which are shown in FIG. 3(b). When getting the occupancy flag (9), first a counter is used to measure whether or not the occupancy flag can be established within a certain period. Read the occupancy flag (9) (step 5b2), determine the S bit (9s) (step 5b3), and if the S bit (9S) is 0, M
Set bit (9g+) to 1 (step 5b4), read the occupancy flag (9) again (step 5b5),
Determine whether M bit (9+a) is 1 (step 5
b6), which means that when the processor (2d) sets the occupied flag in the S bit (9s) in a byte configuration, the M bit (9s)
0M bits (9
If +a) is 1, confirm that the S bit (9S) is 0 (step 5b7).

Sビット(9S)が0であれば、占有フラグ (9)を
getできることになる。もし最初に占有フラグ(9)
を読み込みSビット(9s)を判定しくステップ5b3
)、0でない場合、カウンタに1を加算しくステップ5
b9) 、予め設定された値と比較しくステップ5bl
o) 、大きければカウントオーバとなりエラー終了と
する。
If the S bit (9S) is 0, the occupancy flag (9) can be obtained. If first occupied flag (9)
Read and judge the S bit (9s) Step 5b3
), if not 0, add 1 to the counter.Step 5
b9), compared with the preset value, step 5bl
o) If it is larger, the count is over and the process ends with an error.

もし、カウンタの値を判定しくステップ5blo)設定
値よりも小さいか等しければ、″再度占有フラグ (9
)を読み(ステップ5b2)、Sビット(9S)が0で
あるか判定する(ステップ5b3)、 Sビット(9s
)がOであり、Mビット(9m)を1にしくステップ5
b4)、占有フラグでMビット(9m)が1になってい
るか判定しくステップsb5〜5b6)、Mビット(9
m)が00場合、カウンタに1を加え(ステップ5b9
) 、カウンタを判定しくステップ5blO)カウント
オーバでなければ、再度Mビット(9m)を1にする処
理を行う(ステップsb2〜5b6)。Mビット(9+
++)を1にすることができた場合(ステップ5b9)
、Sビット(9S)が0であるか判定しくステップ5b
7)、0でない場合、プロセッサ(2d)も同時に占有
フラグ (9)をアクセスした可能性があるため、−旦
Mビット(9m)を0にしくステップ5b8)、再度M
ビットを1にする処理を行う(ステップsb9〜5bl
O1sb2〜5b7)、以上で占有フラグ (9)をg
et L/た後DPM管理エリア(10)を読み込みど
のバッファが使用可能か調べる(ステップ5a2) 、
そして今、バッファ(11a)が使用可能であることが
判明すると、占有フラグ (9)をput  (解除)
し、プロセッサ(2d)がDPM管理エリア(10)を
アクセス可能にする(ステップ5a3) 11プロセツ
サ(2c)が占有フラグをputする処理を第3図(C
)を用いて説明する。
If the value of the counter is determined and is smaller than or equal to the set value (step 5blo), then the ``re-occupancy flag (9
) (step 5b2), determine whether the S bit (9S) is 0 (step 5b3),
) is O, set M bit (9m) to 1 Step 5
b4), Steps sb5 to 5b6) to determine whether the M bit (9m) is set to 1 in the occupancy flag.
m) is 00, add 1 to the counter (step 5b9
), the counter is determined (step 5b1O), and if the count is not over, the process of setting the M bit (9m) to 1 is performed again (steps sb2 to 5b6). M bit (9+
++) can be set to 1 (step 5b9)
, determine whether the S bit (9S) is 0 or not in step 5b.
7), if it is not 0, there is a possibility that the processor (2d) also accessed the occupancy flag (9) at the same time, so set the M bit (9m) to 0, step 5b8), and re-enter the M bit (9m).
Perform processing to set the bit to 1 (steps sb9 to 5bl
O1sb2 to 5b7), the occupancy flag (9) is set to g
After reading the DPM management area (10) and checking which buffer can be used (step 5a2),
Now, when the buffer (11a) is found to be usable, the occupancy flag (9) is put (released).
Then, the processor (2d) makes the DPM management area (10) accessible (step 5a3). The 11 processor (2c) puts the occupancy flag as shown in FIG.
).

まず、プロセッサ(2c)はカウンタをOにしくステッ
プ5cl)、占有フラグ (9)を読み(ステップ5c
2)、Sビットを判定しくステップ5c3)、1である
場合、カウンタに1を加え(ステップ5c7) 、カウ
ンタがカウントオーバでなければ(ステップ5c8)、
再度占有フラグ (9)を読む(ステップ5c2)、も
しカウンタがカウントオーバであれはエラー終了とする
。占有フラグ (9)を読んで(ステップ5c2)、S
ビット(its)を判定しくステップ5c3)、 Oで
あれば、占有フラグ (9)のMビット(9m)を0に
する(ステップ5c4)eそして再度占有フラグ (9
)を読み(ステップ5c5)、Mビット(911)が0
であるか判定しくステップ5c6)、0でなければ再度
占有フラグ (9)のMビット(9IQ)を0にする処
理をくり返す(ステップsc7、sc8、sc2〜5c
6) 。
First, the processor (2c) sets the counter to O (step 5cl) and reads the occupancy flag (9) (step 5c).
2), determine the S bit (step 5c3); if it is 1, add 1 to the counter (step 5c7); if the counter does not count over (step 5c8),
The occupancy flag (9) is read again (step 5c2), and if the counter exceeds the count, the process ends with an error. Read the occupancy flag (9) (step 5c2),
If it is O, set the M bit (9m) of the occupancy flag (9) to 0 (step 5c4)e and re-occupy the flag (9).
) (step 5c5) and the M bit (911) is 0.
If it is not 0, repeat the process of setting the M bit (9IQ) of occupancy flag (9) to 0 (steps sc7, sc8, sc2 to 5c).
6).

もしMビット(9m)がOであれば(ステップ5c6)
占有フラグputさせたことになり(ステップ5a3)
、プロセッサ(2c)はバッファ(11,a)にデータ
を入出力する(ステップ5a4)。プロセッサ(2C)
は、バッファ(lla)  にデータを入出力・し終る
と、占有フラグを再度get L/ (ステップ5ad
)、DPM管理エリア(lG)にバッファ(11a)の
アクセス完了を示す情報を書き(ステップ5ad)%占
有フラグ(9)をputする(ステップ5a7)。
If M bit (9m) is O (step 5c6)
This means that the occupancy flag is put (step 5a3)
, the processor (2c) inputs and outputs data to the buffer (11,a) (step 5a4). Processor (2C)
After inputting/outputting data to/from the buffer (lla), gets the occupancy flag again L/ (Step 5ad
), writes information indicating completion of access to the buffer (11a) in the DPM management area (lG) (step 5ad) and puts the % occupancy flag (9) (step 5a7).

次にプロセッサ(2d)の処理について述べる。プロセ
ッサ(2d)は、デュアルポートメモリ(1)のバッフ
ァ(lla)〜(lln)にデータを書き込み、又は読
み出しを行う際、どのバッファが使用可能かを知る為、
占有フラグ (9)をgetする(ステップ5at)。
Next, the processing of the processor (2d) will be described. When the processor (2d) writes data to or reads data from the buffers (lla) to (lln) of the dual port memory (1), the processor (2d) knows which buffers can be used.
Get the occupancy flag (9) (step 5at).

この詳細は第3図(d)に示す。占有フラグ(9)をg
etする場合、まずカウンタをクリアしくステップ5d
i)、占有フラグ (9)を読む(ステッブ5d2)、
 Mビット(9m)を判定しくステップ5d3)、Mビ
ット(9m)が0である場合、Sビット(9S)を1に
する(ステップ5d4)、そして再度占有フラグ(9)
を読み(ステップ5d5)、Sビット(9S)が1であ
るか判定する(ステップ5d6)、 Sビット(9S)
が1である場合、Mビット(9m)が0であることを確
認する(ステップ5d7)。Mビット(9a+)がOで
あれば、占有フラグ (9)をgetできたことになる
。もし最初に占有フラグ (9)を読み込みMビット(
9■)を判定しくステップ5d3)、0でない場合、カ
ウンタに1を加算しくステップ5d9)、予め設定され
た値と比較しくステップ5dlO)、大きければカウン
トオーバとなり、エラー終了とする。
The details are shown in FIG. 3(d). Set the occupancy flag (9) to g
ET, first clear the counter in step 5d.
i), Read the occupancy flag (9) (step 5d2),
Determine the M bit (9m) (step 5d3), and if the M bit (9m) is 0, set the S bit (9S) to 1 (step 5d4), and set the occupancy flag (9) again.
(Step 5d5) and determine whether the S bit (9S) is 1 (Step 5d6).
If is 1, confirm that the M bit (9m) is 0 (step 5d7). If the M bit (9a+) is O, it means that the occupancy flag (9) has been obtained. If you first read the occupancy flag (9) and read the M bit (
If it is not 0, add 1 to the counter (step 5d9), and compare it with a preset value (step 5dlO); if it is larger, the count is over and the process ends with an error.

もし、カウンタの値を判定しくステップ5dlO)、設
定値よりも小さいか等しければ再度占有フラグ(9)を
読み(ステップ5d2)、Mビット(9m)がOである
か判定する(ステップ5d3)。Mビット(9+g)が
0であり、Sビット(9S)を1にしくステップ5d4
)、占有フラグでSビット(9S)が1になっているか
判定しくステップsd5〜5d6)、Sビット(9S)
が0の場合、カウンタに1を加え(ステップ5d9)、
カウンタを判定しくステップ5dlo) 、カウントオ
ーバでなければ、再度Sビット(9S)を1にする処理
を行う(ステップsd2〜5d8)、Sビット(9s)
を1にすることができた場合(ステップ5d6)、Mビ
ット(9m)が0であるか判定しくステップ(sd7)
 、Oでない場合、プロセッサ(2C)も同時に占有フ
ラグ (9)をアクセスした可能性があるため、−旦S
ビット(9S)を0にしくステップ5d8)、再度Sビ
ットを1にする処理を行う(ステップsd9〜5dlO
1sd2〜5d7)、以上で占有フラグ (9)をge
t L/た後DPM管理エリア(10)を読み込みどの
バッファが使用可能か調べる(ステップ5ad) eそ
して今バッフy (lla)が使用可能であることが判
明すると、占有フラグ (9)をput L/% プロ
セッサ(2C)がDPM管理エリア(lO)をアクセス
可能にする(ステップ5a3) 、プロセッサ(2d)
が占有フラグをputする処理を第3図(e)を用いて
説明する。
If the value of the counter is determined (step 5dlO), and it is smaller than or equal to the set value, the occupancy flag (9) is read again (step 5d2), and it is determined whether the M bit (9m) is O (step 5d3). M bit (9+g) is 0, set S bit (9S) to 1 Step 5d4
), determine whether the S bit (9S) is set to 1 in the occupancy flag (steps sd5 to 5d6), S bit (9S)
If is 0, add 1 to the counter (step 5d9),
Determine the counter (step 5dlo), and if the count is not over, perform processing to set the S bit (9S) to 1 again (steps sd2 to 5d8), S bit (9s)
If it can be set to 1 (step 5d6), determine whether the M bit (9m) is 0 or not (step sd7).
, O, there is a possibility that the processor (2C) also accessed the occupancy flag (9) at the same time.
The bit (9S) is set to 0 (step 5d8), and the S bit is set to 1 again (steps sd9 to 5dlO).
1sd2~5d7), ge the occupancy flag (9)
After t L/, read the DPM management area (10) and check which buffer is usable (step 5ad) eAnd if it turns out that buffer y (lla) is now available, put the occupancy flag (9) L /% Processor (2C) makes DPM management area (IO) accessible (step 5a3), Processor (2d)
The process of putting the occupancy flag will be explained using FIG. 3(e).

まずプロセッサ(2d)はカウンタを0にし (ステッ
プ5el)、占フラグ(9) を読み (ステップ5e
2)、Mビットを判定し (ステップ5e3) 1であ
る場合、カウンタに1加え (ステップ5e7)、カウ
ンタが、カウントオーバーでなければ (ステップ5e
8)が再度、占有フラグ(9)を読む (ステップ5e
2)。もし、カウンタがカウントオーバーであればエラ
ー終了とする。占有フラグ(9)を読んで(ステップ5
e2) Mビット(9m)を判定し (ステップ5e3
) Oであれば、占有フラグ(9)のSビット(9S)
を0にする (ステップ5e4)そして、再度占有フラ
グ(9)を読み (ステップ5es) Sビット(9S
)が0であるか判定し (ステップ5e6) Oでなけ
れば、再度、占有フラグ(9)のSビット(9S)を0
にする処理をくり返す (ステップse7、sea、s
e2〜5e6)、もし、Sビット(9S)が0であれば
 (ステップ5e6)占有フラグがputされたことに
なり (ステップ5a3)、プロセッサ(2d)はバッ
フf (llb)にデータを入出力する (ステップ5
a4)、プロセッサ(2d)は、バッファ(llb) 
にデータを入出力し終ると、占有フラグを再度get 
L/  (ステップ5a5)、DPM管理エリア(10
)にバッファ(lla)のアクセス完了を示す情報を書
き (ステップ5ad)、占有フラグ(9)をputす
る (ステップ5a7)。
First, the processor (2d) sets the counter to 0 (step 5el) and reads the divination flag (9) (step 5e).
2), determine the M bit (step 5e3), and if it is 1, add 1 to the counter (step 5e7), and if the counter does not exceed the count (step 5e
8) reads the occupancy flag (9) again (step 5e
2). If the counter exceeds the count, the process ends with an error. Read the occupancy flag (9) (step 5
e2) Determine M bit (9m) (Step 5e3
) If O, S bit (9S) of occupancy flag (9)
Set to 0 (Step 5e4), and read the occupancy flag (9) again (Step 5es).
) is 0 (step 5e6) If not, set the S bit (9S) of the occupancy flag (9) to 0 again.
(Steps se7, sea, s
e2 to 5e6), if the S bit (9S) is 0 (step 5e6), it means that the occupancy flag has been put (step 5a3), and the processor (2d) inputs and outputs data to the buffer f (llb). (Step 5
a4), the processor (2d) is a buffer (llb)
When you finish inputting and outputting data to , get the occupancy flag again.
L/ (step 5a5), DPM management area (10
) is written to indicate the completion of access to the buffer (lla) (step 5ad), and the occupancy flag (9) is put (step 5a7).

なお、上記実施例は、占有フラグをデュアルポートメモ
リ上で同一アドレスとしたが、別アドレスにしても良く
プロセッサは、HOLD機能が有るものでも、HOLD
機能を使わずに全く同様のアクセス方法が可能である。
In the above embodiment, the occupancy flag is set to the same address on the dual port memory, but it may be set to a different address.
Exactly the same access method is possible without using the function.

又、上記実施例のプロセッサは、プロセッサと周辺回路
を合わせたものでも良く、プロセッサ相当機能を有する
ものでも良い、デュアルポートメモリはメモリの競合を
検出でき、ビジー信号を出す機能を有しないものでも良
い。
Further, the processor in the above embodiment may be a combination of a processor and a peripheral circuit, or may have functions equivalent to a processor, and the dual port memory may be one that can detect memory conflicts and does not have the function of issuing a busy signal. good.

(発明の効果〕 以上のように、この発明によれば、デュアルポートメモ
リ中に2つのプロセッサによって交互に自己のフラグを
確立し得るフラグエリアを設け、双方のプロセッサは他
方のプロセッサがフラグを確立していないことを確認し
ながら自己のフラグを立てデュアルポートメモリのアク
セス権を取得できるように構成したのでソフトウェア処
理のみでメモリアクセスの競合制御が行なえるようにな
り、そのため各種プロセッサにとって汎用性の高いデュ
アルポートメモリのアクセス方法を提供できる効果があ
る。
(Effects of the Invention) As described above, according to the present invention, a flag area is provided in the dual port memory in which two processors can alternately establish their own flags, and both processors can establish their own flags by the other processor. The configuration is configured so that it can acquire dual-port memory access rights by setting a self-flag while confirming that no This has the effect of providing a high-performance dual-port memory access method.

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

第1図は、この発明の一実施例によるデュアルポートメ
モリアクセス方法のハードウェア構成図、第2図(a)
 (b)は、この発明で用いるデュアルポートメモリの
メモリマツプ、第3図 (a)〜(e)は、本実施例で
プロセッサがデュアルポートメモリのアクセス方法を示
すフローチャート、第4図は、従来のデュアルポートメ
モリアクセス方法によるハードウェア構成図である。 図において、(1)はデュアルポートメモリ、(2a)
 (2b)はHOLD機能のあるプロセッサ、(2C)
(2d)はHOLD機能の無いプロセッサ、(3a) 
(3b)はデータバス、(4a) (4b)はアドレス
バス、(9) は占有フラグ、(10)はDPM管理エ
リア、(lla) 〜(lln) はバッファエリア。
FIG. 1 is a hardware configuration diagram of a dual port memory access method according to an embodiment of the present invention, and FIG. 2(a)
(b) is a memory map of the dual port memory used in the present invention, FIG. 3 (a) to (e) are flowcharts showing how the processor accesses the dual port memory in this embodiment, and FIG. FIG. 2 is a hardware configuration diagram using a dual port memory access method. In the figure, (1) is dual port memory, (2a)
(2b) is a processor with HOLD function, (2C)
(2d) is a processor without HOLD function, (3a)
(3b) is a data bus, (4a) (4b) is an address bus, (9) is an occupancy flag, (10) is a DPM management area, and (lla) to (lln) are buffer areas.

Claims (1)

【特許請求の範囲】[Claims] デュアルポートメモリを2つのプロセッサで相互にアク
セスし、バッファエリアを介して上記プロセッサ間でデ
ータ通信を行なうデュアルポートメモリのアクセス方法
において、上記デュアルポートメモリに、各プロセッサ
間でメモリエリアのアクセス権を競合する際各プロセッ
サがメモリエリアのアクセス権要求のためのフラグを立
てるフラグエリアを設け、各プロセッサが相互に相手方
フラグの確立を監視し、フラグ未確立時に自己のフラグ
をフラグエリアに確立し、メモリエリアのアクセス権を
得ることを特徴とするデュアルポートメモリのアクセス
方法。
In a dual port memory access method in which two processors mutually access the dual port memory and data communication is performed between the processors via a buffer area, access rights to the memory area are granted between each processor to the dual port memory. A flag area is provided in which each processor sets a flag for requesting access rights to a memory area when competing, each processor mutually monitors the establishment of the other party's flag, and establishes its own flag in the flag area when the flag is not established. A dual port memory access method characterized by obtaining access rights to a memory area.
JP63252572A 1988-10-06 1988-10-06 Method for making access to dual port memory Pending JPH02100165A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63252572A JPH02100165A (en) 1988-10-06 1988-10-06 Method for making access to dual port memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63252572A JPH02100165A (en) 1988-10-06 1988-10-06 Method for making access to dual port memory

Publications (1)

Publication Number Publication Date
JPH02100165A true JPH02100165A (en) 1990-04-12

Family

ID=17239244

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63252572A Pending JPH02100165A (en) 1988-10-06 1988-10-06 Method for making access to dual port memory

Country Status (1)

Country Link
JP (1) JPH02100165A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002340406A (en) * 2001-05-18 2002-11-27 Noritz Corp Hot water supply piping structure
JP2012108886A (en) * 2010-11-16 2012-06-07 Micron Technology Inc Multi-channel memory with embedded channel selection

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002340406A (en) * 2001-05-18 2002-11-27 Noritz Corp Hot water supply piping structure
JP2012108886A (en) * 2010-11-16 2012-06-07 Micron Technology Inc Multi-channel memory with embedded channel selection

Similar Documents

Publication Publication Date Title
US8429355B2 (en) Information processor system
JP3513291B2 (en) Data transfer device
JP4198376B2 (en) Bus system and information processing system including bus system
US7058740B2 (en) Effective bus utilization using multiple buses and multiple bus controllers
JPH0792962A (en) Port-address input / output priority architecture
JPH02100165A (en) Method for making access to dual port memory
JPH08161254A (en) Information processing system and bus arbitration system therefor
US5408612A (en) Microprocessor system for selectively accessing a processor internal register when the processor has control of the bus and partial address identifying the register
JPS6184767A (en) Inter-system connecting method
JP2522412B2 (en) Communication method between programmable controller and input / output device
JP2000010608A (en) Communication equipment, plc unit and display unit
KR100382939B1 (en) Communication control method and apparatus for slave cpu
JPS6029139B2 (en) Connection method between processing units
JP2000029777A (en) Data transfer device
JP2001084182A (en) Bus connecting device, computer and recording medium
JPS61202396A (en) Dual port type dynamic random access memory
JPH02100746A (en) Multiprocessor bus
JPS6371760A (en) Memory system
JPH02162449A (en) Bus width adjusting device
JPS6367665A (en) Data processor
JPH07271655A (en) Memory access control unit
JPH06259315A (en) Information processor
JPS6086656A (en) Inter-processor interface circuit
JPH04177555A (en) Id designation control system
JPH01112452A (en) System for controlling disk cash