JPH0454552A - Access system for dual port memory - Google Patents

Access system for dual port memory

Info

Publication number
JPH0454552A
JPH0454552A JP16366090A JP16366090A JPH0454552A JP H0454552 A JPH0454552 A JP H0454552A JP 16366090 A JP16366090 A JP 16366090A JP 16366090 A JP16366090 A JP 16366090A JP H0454552 A JPH0454552 A JP H0454552A
Authority
JP
Japan
Prior art keywords
access
cpu
memory
flag
dual port
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
JP16366090A
Other languages
Japanese (ja)
Inventor
Yasuji Ishikawa
石川 靖二
Hideji Kanezashi
金指 秀司
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.)
Tamura Electric Works Ltd
Original Assignee
Tamura Electric Works Ltd
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 Tamura Electric Works Ltd filed Critical Tamura Electric Works Ltd
Priority to JP16366090A priority Critical patent/JPH0454552A/en
Publication of JPH0454552A publication Critical patent/JPH0454552A/en
Pending legal-status Critical Current

Links

Landscapes

  • Multi Processors (AREA)

Abstract

PURPOSE:To eliminate the change of the data stored in a dual port memory when these data are read out by always enabling the memory to have an access to a single CPU only. CONSTITUTION:A main CPU 1 and a sub-CPU 2 are connected to an arbitration circuit 3 via an address bus and a data bus respectively. The circuit 3 is connected to a common RAM 4 serving as a dual port memory via the address and data buses, and the RAM 4 is provided with an access flag which decides the access right to the RAM 4 between the CPU 1 or the CPU 2. Thus only the CPU 1 or 2 to which the access right is granted by the access flag can have an access to the dual port memory 4 and the other CPU is unable to have any access to the memory 4. As a result, the read-out data are never changed.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はデュアルポートメモリのアクセス方式〔従来の
技術〕 従来においては、2つのCPU間で共通のデュアルポー
トメモリを使用する場合、前記デュアルポートメモリに
対する各CPUのアクセスは、互いに何らの調整もなさ
れずに行われている。
[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a dual port memory access method [Prior Art] Conventionally, when a common dual port memory is used between two CPUs, the dual port Each CPU's access to memory is performed without any coordination with each other.

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

したがって、従来において2つのCPLIが共通のデュ
アルポートRAMをアクセスする場合には、一方のCP
UがデュアルポートRAMに書き込みを行っている時に
、他方のCPLIが前記一方のCPUが書き込み中の同
一番地を読み出そうとする事態が生し、この際読み出し
たデータが変化する恐れがあるという不都合があった。
Therefore, conventionally, when two CPLIs access a common dual port RAM, one CPLI
When U is writing to the dual-port RAM, a situation arises in which the other CPLI tries to read the same location that the one CPU is writing to, and there is a risk that the read data may change in this case. There was an inconvenience.

本発明は、このような不都合を解消したデュアルポート
メモリのアクセス方式を捷供することを目的とする。
An object of the present invention is to provide a dual-port memory access method that eliminates such inconveniences.

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

この目的を達成するために本発明は、デュアルポートメ
モリ内にアクセスフラグを設け、複数のCPUのうちこ
のアクセスフラグにアクセス権が設定されたCPUが前
記メモリをアクセスし得るようになし、アクセスした前
記CPUはアクセス終了後に前記アクセスフラグを他の
CPUにアクセス権があるように更新するよう構成した
ものである。また、この構成に加えて、調停回路を設け
、複数のCPUから同時に前記メモリの同一番地にアク
セスがなされた場合に、前記アクセスフラグにおけるア
クセス権の設定状態に関わりなく、前記調停回路によっ
てあらかじめ決められた優先権のあるCPU側のバスを
選択し、このバスを介して接続されている前記優先権の
あるCPUにアクセス権を与えるように構成してもよい
In order to achieve this object, the present invention provides an access flag in the dual port memory, and allows a CPU to which access rights are set to this access flag among a plurality of CPUs to access the memory. The CPU is configured to update the access flag after the access is completed so that other CPUs have access rights. In addition to this configuration, an arbitration circuit is provided, and when multiple CPUs access the same location of the memory at the same time, the arbitration circuit determines the The CPU may be configured to select a bus on the side of a CPU that has a priority right, and give access rights to the CPU that has a priority right and is connected via this bus.

〔作   用〕[For production]

アクセスフラグでアクセス権が与えられた一つのCPU
のみがデュアルポートメモリをアクセス可能であり、こ
のアクセス時には、他のCPUは前記メモリをアクセス
することができない。また、調停回路が設けられた場合
には、複数のCPUがら同時にメモリの同一番地にアク
セスがなされた場合に、前記調停回路があらかしめ決め
られた優先権のあるCPU側のバスを選択することによ
って、前記アクセスフラグにおけるアクセス権の設定状
態に関わりなく、前記優先権のあるCPUにアクセス権
が与えられる。このようにして、常に一つのCPLIだ
けがメモリに対してアクセスすることになる。そして、
前記CPUはアクセス終了後に、前記アクセスフラグを
他のCPUにアクセス権を設定するよう更新する。
One CPU granted access rights by access flag
Only one CPU can access the dual-port memory, and during this access, no other CPU can access the memory. Furthermore, in the case where an arbitration circuit is provided, when multiple CPUs simultaneously access the same location in the memory, the arbitration circuit selects the bus on the CPU side that has predetermined priority. Accordingly, the CPU with the priority right is given the access right regardless of the setting state of the access right in the access flag. In this way, only one CPLI will have access to memory at any given time. and,
After the CPU completes the access, the CPU updates the access flag to set access rights to other CPUs.

〔実 施 例〕〔Example〕

以下、本発明の好適な一実施例を添付図面に基づいて詳
細に説明する。ここにおいて、第1図は全体構成を示す
概略的なブロック図、第2図はメインCPUのアクセス
動作を示すフローチャート、第3図はサブCPUのアク
セス動作を示すフローチャートである。
Hereinafter, a preferred embodiment of the present invention will be described in detail based on the accompanying drawings. Here, FIG. 1 is a schematic block diagram showing the overall configuration, FIG. 2 is a flowchart showing the access operation of the main CPU, and FIG. 3 is a flowchart showing the access operation of the sub CPU.

第1図に示すように、メインCPU1とサブCPLI2
は、それぞれ調停回路3にアドレスバス及びデータバス
を介して接続されている。前記調停回路3はデュアルポ
ートメモリである共通RAM4にアドレスバス及びデー
タバスを介して接続され、また、図示してはいないが、
前記共通RAM4にはアクセスフラグが設けられている
。前記アクセスフラグは、前記メインCPUIと前記サ
ブCPL12のどちらに前記共通RAM4に対するアク
セス権があるかを設定するためのものである。
As shown in Figure 1, the main CPU1 and sub CPLI2
are connected to the arbitration circuit 3 via an address bus and a data bus, respectively. The arbitration circuit 3 is connected to a common RAM 4, which is a dual port memory, via an address bus and a data bus, and also includes:
The common RAM 4 is provided with an access flag. The access flag is used to set which of the main CPUI and the sub CPL 12 has the right to access the common RAM 4.

また、前記調停回路3は、前記メインCPUIと前記サ
ブCPU2から同時に前記共通RAM4の同一番地にア
クセスがなされた場合に、前記アクセスフラグにおける
アクセス権の設定状態、すなわち前記アクセスフラグに
いずれのCPUI、2のアクセス権が設定されているか
、に関わりなく、前記サブCPU2例のバスを選択して
これを有効とすることにより、前記シブCPU2の要求
を受付け、前記メインCPUIの要求をキャンセルする
よう構成されている。このように、本実施例ではサブC
PU2が優先権を有するものである。
Furthermore, when the main CPU 2 and the sub CPU 2 access the same location of the common RAM 4 at the same time, the arbitration circuit 3 determines the setting state of the access right in the access flag, that is, which CPU Regardless of whether the access right of the sub CPU 2 is set or not, by selecting the bus of the sub CPU 2 and making it valid, the request of the sub CPU 2 is accepted and the request of the main CPU 2 is canceled. has been done. In this way, in this embodiment, sub-C
PU2 has priority.

次に、第2図に基づいて、メインCPUIの共通RAM
4に対するアクセス動作を説明する。
Next, based on Figure 2, the common RAM of the main CPU
The access operation for 4 will be explained.

まず、共通RAM4のアクセスフラグにおけるアクセス
権の設定状態を読み出しくステップ1゜工)、メインC
PUIに前記共通RAM4のアクセス権があるかどうか
を判断する(ステップ1゜2)、ここで、アクセス権が
ないと判断すればステップ101に戻り、ステップ10
2でアクセス権があると判断するまで待機状態となる。
First, read the access right setting status in the access flag of the common RAM 4 (step 1), the main C
It is determined whether the PUI has the access right to the common RAM 4 (steps 1 and 2). If it is determined that the PUI does not have the access right, the process returns to step 101, and step 10
In step 2, the device is in a standby state until it is determined that it has access rights.

一方、前記ステップ102でアクセス権があると判断す
ると、ステップ103に進んで、メインCPL11は前
記共通RAM4をアクセスし、所定のデータの読み出し
、あるいは書き込みを行う、このメインCPUIによる
前記共通RAM4へのアクセスが終了すると、前記メイ
ンCPUIは、アクセスフラグにサブCPU2のアクセ
ス権を設定しくステップ104)、続いて前記アクセス
フラグのアクセス権の設定状態を読み出して(ステップ
105)、サブCPU2が共i11RAM4をアクセス
し得るかどうかの確認を行う (ステップ106)。
On the other hand, if it is determined in step 102 that there is an access right, the main CPL 11 proceeds to step 103 to access the common RAM 4 and read or write predetermined data. When the access is completed, the main CPU 2 sets the access right of the sub CPU 2 in the access flag (Step 104), and then reads out the setting state of the access right of the access flag (Step 105), and the sub CPU 2 sets the access right of the sub CPU 2 in the access flag (Step 105). It is checked whether access is possible (step 106).

ここで、前記CPU2にアクセス権がないと判断すれば
、ステップ104に戻って再び上述した動作を繰り返す
一方、前記ステップ106でサブCPU2にアクセス権
があると判断すれば、動作を終了する。
Here, if it is determined that the CPU 2 does not have the access right, the process returns to step 104 and the above-described operation is repeated again, while if it is determined in the step 106 that the sub CPU 2 has the access right, the operation ends.

続いて、第3図に基づきサブCPU2の共通RAM4に
対するアクセス動作を説明する。
Next, the access operation of the sub CPU 2 to the common RAM 4 will be explained based on FIG.

まず、共通RAM4のアクセスフラグにおけるアクセス
権の設定状態を読み出して(ステップ201)、サブC
PU2に前記共通RAM4のアクセス権があるかどうか
を判断する(ステップ202)、ここで、アクセス権が
ないと判断すればステップ201に戻り、ステップ20
2でアクセス権があると判断するまで待機状態となる。
First, the access right setting state in the access flag of the common RAM 4 is read out (step 201), and the sub C
It is determined whether the PU 2 has the access right to the common RAM 4 (step 202). If it is determined that the PU 2 does not have the access right, the process returns to step 201, and step 20
In step 2, the device is in a standby state until it is determined that it has access rights.

一方、前記ステップ202でアクセス権があると判断す
ると、ステップ203に進んで、サブCPL12は前記
共通RAM4をアクセスし、所定のデータの読み出し、
あるいは書き込みを行う、このサブCPU2による前記
共通RAM4へのアクセスが終了すると、前記サブCP
U2は、アクセスフラグにメインCPUIのアクセス権
を設定して(ステップ204)、動作を終了する。
On the other hand, if it is determined in step 202 that there is an access right, the process proceeds to step 203, where the sub CPL 12 accesses the common RAM 4, reads predetermined data,
Alternatively, when the sub CPU 2 finishes accessing the common RAM 4 for writing, the sub CPU 2
U2 sets the access right of the main CPUI in the access flag (step 204), and ends the operation.

ここで、メインCPLIIとサブCPU2から同時に共
通RAM4の同一番地にアクセスがなされた場合には、
アクセスフラグにおけるアクセス権の設定状態に関わり
なく、調停回路3により優先権を存する前記サブCPU
2例のバスが選択されて有効となり、前記サブCPU2
の要求が受付けられ、前記メインCPUIの要求はキャ
ンセルされる。そして、前記メインCPUIは前記サブ
CPU2のアクセスが終了して、前記共通RAM4のア
クセスフラグにメインCPUIのアクセス権が設定され
るまで、待機状態となる。
Here, if the same location of the common RAM 4 is accessed from the main CPL II and the sub CPU 2 at the same time,
Regardless of the setting state of the access right in the access flag, the sub-CPU that has priority rights according to the arbitration circuit 3
Two buses are selected and made valid, and the sub CPU2
The request from the main CPUI is accepted, and the request from the main CPUI is canceled. Then, the main CPUI enters a standby state until the access by the sub CPU 2 is completed and the access right of the main CPUI is set in the access flag of the common RAM 4.

このように、常にメインCPUIかサブCPU2かのい
ずれか一方のみが、共通RAM4をアクセスすることが
できる。
In this way, only either the main CPU I or the sub CPU 2 can access the common RAM 4 at any time.

なお、本発明は上述した実施例に限定されず、例えば、
共通RAM4の同一番地にメインCPU1とサブCPU
2から同時にアクセスがなされた場合の優先権は、前記
メインCPUIに与えてもよい、また、CPUは2つに
限らず3つ以上でもよいものである。
Note that the present invention is not limited to the above-mentioned embodiments, and for example,
Main CPU1 and sub CPU at the same location of common RAM4
When accesses are made from two CPUs at the same time, priority may be given to the main CPU, and the number of CPUs is not limited to two, but may be three or more.

〔効   果〕〔effect〕

以上説明したところで明らかなように、本発明によれば
、デュアルポートメモリに対して、常に一つのCPUの
みがアクセスできるように構成したので、一つのCPU
がメモリに書き込みを行っている際に他のCPUがこの
書き込みを行っている同一番地を読み出すことがなく、
メモリに格納しているデータが読み出しに際して変化す
る恐れがないという効果を奏する。
As is clear from the above explanation, according to the present invention, the dual port memory is configured so that only one CPU can access it at any time.
When a CPU is writing to memory, other CPUs will not read the same location that is being written to.
This has the effect that there is no fear that the data stored in the memory will change when read.

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

図は本発明の好適な一実施例を示し、第1図は全体構成
を示す概略的なブロック図、第2図はメインCPUのア
クセス動作を示すフローチャート、第3閏はサブCPU
のアクセス動作を示すフローチャートである。 l・・・メインCPU    2・・・サブCPU  
 3・・・調停回路   4・・・共通RM
The figures show a preferred embodiment of the present invention, in which Fig. 1 is a schematic block diagram showing the overall configuration, Fig. 2 is a flowchart showing the access operation of the main CPU, and the third leap is a sub-CPU.
3 is a flowchart showing the access operation of FIG. l...Main CPU 2...Sub CPU
3...Arbitration circuit 4...Common RM

Claims (2)

【特許請求の範囲】[Claims] (1)デュアルポートメモリ内にアクセスフラグを設け
、複数のCPUのうち前記アクセスフラグにアクセス権
が設定されたCPUが前記メモリをアクセスし得るよう
になし、アクセスした前記CPUはアクセス終了後に前
記アクセスフラグを他のCPUにアクセス権があるよう
に更新するよう構成したことを特徴とするデュアルポー
トメモリアクセス方式。
(1) An access flag is provided in the dual port memory, so that one of the plurality of CPUs for which access rights are set in the access flag can access the memory, and the CPU that has accessed the memory can access the memory after the access is completed. A dual port memory access method characterized in that a flag is updated so that other CPUs have access rights.
(2)デュアルポートメモリ内にアクセスフラグを設け
、複数のCPUのうち前記アクセスフラグにアクセス権
が設定されたCPUが前記メモリをアクセスし得るよう
になし、アクセスした前記CPUはアクセス終了後に前
記アクセスフラグを他のCPUにアクセス権があるよう
に更新するよう構成する一方、調停回路を設け、複数の
CPUから同時に前記メモリの同一番地にアクセスがな
された場合に、前記アクセスフラグにおけるアクセス権
の設定状態に関わりなく、前記調停回路によって、あら
かじめ決められた優先権のあるCPUにアクセス権を与
えるよう構成したことを特徴とするデュアルポートメモ
リアクセス方式。
(2) An access flag is provided in the dual port memory, so that a CPU among the plurality of CPUs for which access rights are set in the access flag can access the memory, and the CPU that has accessed the memory can access the memory after the access is completed. While the flag is updated so that other CPUs have access rights, an arbitration circuit is provided to set the access rights in the access flag when multiple CPUs access the same location of the memory at the same time. A dual port memory access system characterized in that the arbitration circuit is configured to give access rights to a CPU with predetermined priority regardless of the state.
JP16366090A 1990-06-21 1990-06-21 Access system for dual port memory Pending JPH0454552A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16366090A JPH0454552A (en) 1990-06-21 1990-06-21 Access system for dual port memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16366090A JPH0454552A (en) 1990-06-21 1990-06-21 Access system for dual port memory

Publications (1)

Publication Number Publication Date
JPH0454552A true JPH0454552A (en) 1992-02-21

Family

ID=15778164

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16366090A Pending JPH0454552A (en) 1990-06-21 1990-06-21 Access system for dual port memory

Country Status (1)

Country Link
JP (1) JPH0454552A (en)

Similar Documents

Publication Publication Date Title
JP2000047974A (en) Bus arbitrating method of bus controller, bus controller, and system of electronic equipment
KR950010529B1 (en) Memory sharing for communicaiton between processors
JP2591502B2 (en) Information processing system and its bus arbitration system
JPH05173985A (en) Programmable controller
US5627968A (en) Data transfer apparatus which allows data to be transferred between data devices without accessing a shared memory
EP0426111A2 (en) Memory control system
JPH0454552A (en) Access system for dual port memory
JPH0343804A (en) Sequence controller
JPS59116866A (en) Storage device of computer system
JPH01293456A (en) Shared memory
KR100362061B1 (en) Device for controlling local bus
JPH0355657A (en) Shared memory access method for multi-task/multi-processor system
JPH08249289A (en) Memory controller and its control method
JP2606824Y2 (en) Multiport memory device
JP2736352B2 (en) Cache memory control method in multiprocessor system
JPH0261749A (en) Data transfer device
JPH10134013A (en) Multi-cpu system
JPH05225147A (en) Multiprocessor type data processing system
JP2547329B2 (en) Lock data setting device
JPH03109660A (en) Memory access control system for dual bus system
JPS63236153A (en) Storage device
JPS6336346A (en) Bank switching circuit
JPH11102340A (en) Processor system and bus access method therefor
JP2001075826A (en) System for high-efficiency semaphore processing by parallel computer
JPH0877072A (en) Cache memory device