JP4008196B2 - Register control device and multi-CPU system - Google Patents
Register control device and multi-CPU system Download PDFInfo
- Publication number
- JP4008196B2 JP4008196B2 JP2000321070A JP2000321070A JP4008196B2 JP 4008196 B2 JP4008196 B2 JP 4008196B2 JP 2000321070 A JP2000321070 A JP 2000321070A JP 2000321070 A JP2000321070 A JP 2000321070A JP 4008196 B2 JP4008196 B2 JP 4008196B2
- Authority
- JP
- Japan
- Prior art keywords
- register
- data
- cpu
- accessed
- read
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Multi Processors (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、複数のCPUによってアクセスされるレジスタのデータ値を制御するためのレジスタ制御装置、及びそのレジスタ制御装置を備えてなるマルチCPUシステムに関する。
【0002】
【従来の技術】
複数のCPUを備えて高度な機能を実現するように構成されるマルチCPUシステムにおいては、各CPUがリードサイクルやライトサイクルを実行しようとする場合、常に1つのCPUだけが排他的にバスを使用するように、アービタによってバスの使用権が調停されるようになっている。
【0003】
また、このようなシステムでは、コントロールレジスタ等の周辺回路を共用したり、セマフォの値をチェックした後セットを行う場合などに、CPUは、あるレジスタから読み出した(リード)データにビット操作を行い(モディファイ)、そのビット操作を行った結果のデータ値を同じレジスタに書き戻す(ライト)というリード・モディファイ・ライトサイクルを実行することがある。
【0004】
そして、CPUの種類によっては、リード・モディファイ・ライトサイクルを不可分な1つのサイクルとして、バスを占有し続けて実行するように各信号が出力されるものがある。しかし、そのような機能を有していないCPUを用いてマルチCPUシステムを構成することを想定すると、以下のような問題が生じることが考えられる。
【0005】
【発明が解決しようとする課題】
図3は、上記マルチCPUシステムの一構成例である。CPU1,2は、アドレスバス3及びデータバス4に接続されており、何れもレジスタ5に対してアクセスが可能となっている。データバス4のサイズは例えば8ビットであるとする。レジスタ5は、例えば、8チャネルのタイマによるタイマ割り込みについて、各々の割り込みの可否を設定するためのコントロールレジスタ(TIER:Timer Interruput Enable Register) であり、ビット0〜3はCPU1が設定を行い、ビット4〜7はCPU2が設定を行うようになっている。
【0006】
アドレスバス3に接続されているアドレスデコーダ6は、CPU1または2が出力するアドレスをデコードして、例えばTIERレジスタ5に対してアクセスが行われる場合のデコード信号TIERを、TIERレジスタ5に出力するようになっている。また、CPU1または2がバスサイクルを実施する場合には、上述のように、図示しないアービタによってバス3及び4の使用権が調停されるようになっている。
【0007】
TIERレジスタ5は、図4に示すCKA,CKBの二相クロック信号によってラッチ動作を行うダブルラッチ構成であり、マスタラッチ5M及びスレーブラッチ5Sを備えて構成されている。データバス4はマスタラッチ5Mの入力側に接続されており、マスタラッチ5Mの出力側はスレーブラッチ5Sの入力側に接続されている。そして、スレーブラッチ5Sの出力側は、出力バッファ7を介してデータバス4に接続されている。
【0008】
ANDゲート8は、デコード信号TIER,CPU1または2が出力するライト信号及びクロック信号CKBの論理積信号をマスタラッチ5Mにラッチ信号として出力するようになっている。スレーブラッチ5Sのラッチ信号には、クロック信号CKAが直接与えられている。そして、一方、ANDゲート9は、デコード信号TIER及びCPU1または2が出力するリード信号の論理積信号を出力バッファ7にイネーブル信号(レベル)として出力するようになっている。
【0009】
以上のマルチCPUシステムにおいて、図5に示すタイミングチャートに従ってTIERレジスタ5にアクセスが行われた場合を説明する。尚、CPU1及び2は、クロック信号CKAに同期して動作するようになっている。TIERレジスタ5の初期値が“00h(HEX)”であるとする。先ず、CPU1が時刻T1においてリード・モディファイ・ライトサイクル(以下、RMWサイクルと称す)を開始し、TIERレジスタ5(スレーブラッチ5S)のデータ値を読み出してビット操作(第0ビットを“1”にセット)を行い、その操作結果のデータ値“01h”を時刻T3においてTIERレジスタ5書き込むとする。すると、マスタラッチ5Mには時刻T3後のクロック信号CKBのタイミングでデータが書き込まれる。
【0010】
この時、もう1つのCPU2が時刻T2においてRMWサイクルを開始すると、CPU2は、時刻T2において、その時点ではCPU0によるビット操作結果が未だ反映されていないTIERレジスタ5のデータ値“00h”を読み出してビット操作(第4ビットを“1”にセット)を行い、その操作結果のデータ値“10h”を時刻T4においてTIERレジスタ5に書き込む。
【0011】
つまり、CPU2が時刻T4においてRMWサイクルを開始すれば、CPU1は、CPU1によるビット操作結果が反映されたTIERレジスタ5のデータ値“01h”を読み出してビット操作を行うことになり、その結果、TIERレジスタ5に書き込まれるデータ値は“11h”となるはずである。しかしながら、上記のようにCPU1によるRMWサイクルの実行途中においてCPU2がサイクルを実行すると、TIERレジスタ5のデータは期待値通りにならず、以降の制御に支障を来す結果となってしまう。
【0012】
本発明は上記事情に鑑みてなされたものであり、その目的は、複数のCPUが同一のレジスタに対してどのようなタイミングでリード・モディファイ・ライトサイクルを行った場合でも、そのレジスタのデータ値が期待値通りになるように制御できるレジスタ制御装置、及びそのレジスタ制御装置を備えてなるマルチCPUシステムを提供することにある。
【0013】
【課題を解決するための手段】
請求項1記載のレジスタ制御装置によれば、例えば、何れかのCPUがビット操作命令を実行し、レジスタの任意のビットのデータ値を“0”にセットする場合は、先ず、リード・モディファイ・ライトサイクル(RMWサイクル)前半のリードサイクルにおいて、“0”セット用レジスタをアクセスして全ビット“1”のデータ値(以下、オール“1”データと称す)を読み出す。そして、読み出したオール“1”データの内、変更対象ビットのデータ値を“0”にしてから、“0”セット用レジスタのアドレスでライトサイクルを行う。すると、マルチプレクサは、レジスタに対して、CPUによりデータ値が“0”に変更されたビットについてはそのデータ値“0”を出力し、それ以外のビットについては当該レジスタの保持データを出力するように選択する。
【0014】
また、何れかのCPUがレジスタの任意のビットのデータ値を“1”にセットする場合は、RMWサイクル前半のリードサイクルにおいて、“1”セット用レジスタをアクセスして全ビット“0”のデータ値(以下、オール“0”データと称す)を読み出す。そして、読み出したオール“0”データの内、変更対象ビットのデータ値を“1”にしてから、“1”セット用レジスタのアドレスでライトサイクルを行う。すると、マルチプレクサは、レジスタに対して、CPUによりデータ値が“1”に変更されたビットについてはそのデータ値“1”を出力し、それ以外のビットについては当該レジスタの保持データを出力するように選択する。
【0015】
即ち、他のCPU(A)が行ったRMWサイクルが完了する前に前記CPU(B)がRMWサイクルを開始したとしても、CPU(B)による後半のライトサイクルが行われる時点ではCPU(A)によるRMWサイクルは完了しており、その変更後のデータがレジスタに保持されている。故に、CPU(B)によるライトサイクルでレジスタに書き込まれるデータは、CPU(B)が変更しなかったビットについてはCPU(A)によって変更されたデータとなる。従って、予めマルチCPUシステムに適用することを想定した設計が行われていない複数のCPUがレジスタをアクセスする場合でも、そのレジスタのデータ値が常に期待値通りとなるように制御することができる。
【0016】
そして、マルチプレクサが、レジスタに対して出力するデータにCPUの出力データを選択する条件に、
又は(デコード信号がレジスタ)
を加える。従って、CPUは、レジスタに対してビット操作により設定を行うだけでなく、レジスタに割り当てられているアドレスを出力して通常の書き込み(即ち、全ビットの同時書き込み)を行うこともできる。
【0017】
請求項2記載のマルチCPUシステムによれば、請求項1記載のレジスタ制御装置を備えることで、予めマルチCPUシステムに適用することを想定した設計が行われていないCPUを用いて、レジスタ等の周辺回路を共用するシステムを構成することが可能となる。
【0018】
【発明の実施の形態】
以下、本発明の一実施例について図1及び図2を参照して説明する。尚、図3と同一部分には同一符号を付して説明を省略し、以下異なる部分についてのみ説明する。本実施例では、2つのCPU1,2がCPU11,12に置き換わっている。また、アドレスバス3にはアドレスデコーダ6に代わるアドレスデコーダ13が接続されており、データバス4には、TIERレジスタ5に代わるTIERレジスタ14と、2つの読み出し専用レジスタであるTIER0Wレジスタ(“0”セット用レジスタ)15及びTIER1Wレジスタ(“1”セット用レジスタ)16が接続されている。
【0019】
これらのレジスタ15,16は、夫々TIERレジスタ14とは異なるアドレスが割り付けられている。そして、TIER0Wレジスタ15は、CPU11または12がTIERレジスタ14に対してビット操作命令を実行することでRMWサイクルを行い、8ビットの内何れかのビットに“0”をセットする場合にアクセスするように設定されており、その場合に、データバス4上にデータ値オール“1”を出力するように構成されている。
【0020】
また、TIER1Wレジスタ16は、CPU11または12がTIERレジスタ14に対して同様にRMWサイクルを行い、8ビットの内何れかのビットに“1”をセットする場合にアクセスするように設定されており、その場合に、データバス4上にデータ値オール“0”を出力するように構成されている。
【0021】
即ち、TIER0Wレジスタ15は、オール“1”のデータを出力するデータ出力部15a,そのデータをデータバス4上に出力するための出力バッファ15b,出力バッファ15bに対してイネーブル信号を出力するためのANDゲート15cを備えて構成されている。ANDゲート15cは、アドレスデコーダ13が出力するデコード信号TIER0Wと、CPU11または12がリードサイクルの実行時にアクティブ(ハイ)にするリード信号との論理積をとって、出力バッファ15bのイネーブル信号を出力するようになっている。
【0022】
また、TIER1Wレジスタ16も、TIER0Wレジスタ15と同様に、オール“0”のデータを出力するデータ出力部16a,そのデータをデータバス4上に出力するための出力バッファ16b,出力バッファ16bに対してイネーブル信号を出力するためのANDゲート16cを備えて構成されている。ANDゲート16cは、アドレスデコーダ13が出力するデコード信号TIER1Wと、CPU11または12のリード信号との論理積をとって、出力バッファ16bのイネーブル信号を出力するようになっている。
【0023】
図1において、TIERレジスタ14は、1ビット分(第iビット,i=0〜7)に対応する構成のビットセル14B(i)を1つだけ図示しており、実際には8個のビットセル14B(0)〜14B(7)によって構成されている。各ビットセル14Bは、データバス4側から、マルチプレクサ17のデータ選択部17a,マスタラッチ18,スレーブラッチ19及び出力バッファ20を直列に接続したものを中心として構成されている。出力バッファ20の出力端子はデータバス4のラインD(i)に接続されており、また、スレーブラッチ19の出力端子はデータ選択部17aの他の入力端子に接続されている。データ選択部17aは、選択信号生成回路17bより出力される選択信号に基づいて、2つの入力端子の内から1つを選択してマスタラッチ18に出力するように構成されている。
【0024】
選択信号生成回路17bには、アドレスデコーダ13が出力する3つのデコード信号TIER,TIER0W,TIER1Wとデータバス4の第iビットデータD(i)が与えられており、これらの入力信号に基づき、データ選択部17aが以下のように入力データを選択してマスタラッチ18に出力するように内部論理が構成されている。
上記以外の条件 ならば、(出力データ:スレーブラッチ19の保持データ)
選択信号生成回路17bは、データ選択部17aに例えば上記2つの条件に対応する選択信号(例えば、前者が成立している場合はハイレベル,後者が成立している場合はロウレベル)を出力し、データ選択部17aはその選択信号に応じて2つの入力端子の内の一方を選択するようになっている。
【0025】
マスタラッチ18のラッチ信号は、3入力のANDゲート21によって与えられるようになっている。ANDゲート21の入力端子には、CPU11または12がライトサイクルの実行時にアクティブ(ハイ)にするライト信号と、二相クロック信号のB相信号CKBと、ORゲート22の出力信号とが与えられている。3入力のORゲート22には、アドレスデコーダ13が出力する3つのデコード信号TIER,TIER0W,TIER1Wが夫々与えられている。
【0026】
また、スレーブラッチ19のラッチ信号には、二相クロック信号のA相信号CKAが直接与えられており、出力バッファ20には、ANDゲート23の出力信号がイネーブル信号として与えられている。ANDゲート23の入力端子には、アドレスデコーダ13が出力するデコード信号TIERと、CPU11または12のリード信号とが与えられている。
【0027】
尚、TIERレジスタ14は、レジスタ部(レジスタ)14aとレジスタ制御部14bとに分類される。レジスタ部14aは、マスタラッチ18,スレーブラッチ19,出力バッファ20,及びANDゲート21及び23からなる部分であり、レジスタ制御部14bは、マルチプレクサ17,ANDゲート21及びORゲート22からなる部分である。
【0028】
そして、レジスタ制御部14bに、アドレスデコーダ13,TIER0Wレジスタ15及びTIER1Wレジスタ16を加えたものが、レジスタ制御装置24を構成している。更に、レジスタ部14aとレジスタ制御装置24にCPU11及び12を加えたものが、マルチCPUシステム25を構成している。
【0029】
次に、本実施例の作用について図2をも参照して説明する。
▲1▼<ビット操作命令によってTIERレジスタ14に“1”をセットする場合>
例えば、CPU11が、TIERレジスタ14の第0ビットを“1”にセットするためのビット操作を実行するためRMWサイクルを行う場合には、TIERレジスタ14に対してではなく、TIER1Wレジスタ16に対してRMWサイクルを行うようにする。すると、時刻T1においてTIER1Wレジスタ16よりデータ00hが読み出される。CPU11は、読み出したデータの第0ビットのみを“1”にセットするように内部レジスタの操作を行うと、時刻T3において同じTIER1Wレジスタ16のアドレスを出力してデータ01hのライトサイクルを行う。
【0030】
この場合、読出し専用レジスタであるTIER1Wレジスタ16への書き込みは行われず、それに代えて、デコード信号TIER1Wが出力されてORゲート22の出力端子がハイレベルになることから、クロック信号CKBの立上がりタイミングでANDゲート21の出力端子もハイレベルとなって、TIERレジスタ14のマスタラッチ18にデータが書き込まれる。
【0031】
また、各ビットセル14B(0)〜14B(7)においては、デコード信号TIER1Wが出力されているので、データバス4上にデータ値“1”が出力されているビットセル14B(0)のデータ選択部17aは、選択信号生成回路17bが出力する選択信号(ハイレベル)に応じてマスタラッチ18にデータバス4(D(0))のデータ値“1”を選択して出力する。
【0032】
それ以外のビットセル14B(1)〜14B(7)においては、選択信号生成回路17bが選択信号をロウレベルにするので、データ選択部17aはマスタラッチ18にスレーブラッチ19の保持データを選択して出力する。この時点におけるスレーブラッチ19の保持データは、時刻T3におけるライトサイクルによって書き換えられる前のデータ00hである。
【0033】
即ち、CPU11のビット操作命令によって“1”がセットされるビット以外のビットデータは、CPU11がデータバス4上に出力しているデータにかかわらずスレーブラッチ19の保持データが選択されて書き込まれることになる。結果として、マスタラッチ18には、データ00hの第0ビットだけが“1”にセットされたデータ01hが書き込まれる。そして、スレーブラッチ19のデータは、時刻T3後のクロック信号CKAの立上がりタイミングで、マスタラッチ18に書きまれているデータと同じデータ01hに更新される。
【0034】
従って、図5に示した従来例と同様に、もう1つのCPU12が時刻T2においてRMWサイクルを開始したとすると、CPU12は、時刻T2においてTIER1Wレジスタ16のデータ値“00h”を読み出してビット操作(第4ビットを“1”にセット)を行い、その操作結果のデータ値“10h”を時刻T4においてTIER1Wレジスタ16のアドレスに書き込む。
【0035】
すると、上記と同様のプロセスによって、データバス4上にデータ値“1”が出力されているビットセル14B(4)のデータ選択部17aは、マスタラッチ18にデータ値“1”を選択して出力し、それ以外のビットセル14B(0)〜14B(3),14B(5)〜14B(7)のデータ選択部17aは、マスタラッチ18にスレーブラッチ19の保持データを選択して出力する。
【0036】
即ち、CPU12が時刻T4においてRMWサイクル後半のライトサイクルを行う時点では、CPU11によるRMWサイクルが完了している。従って、スレーブラッチ19の保持データは01hに更新されているので、TIERレジスタ14のマスタラッチ18(8ビット分)には、01hデータの第4ビットを“1”に変更したデータ11hが書き込まれることになる。
【0037】
▲2▼<ビット操作命令によってTIERレジスタ14に“0”をセットする場合>
また、例えば、TIERレジスタ14の初期値が77hである場合に、CPU11が、TIERレジスタ14の第0ビットを“0”にセットするためのビット操作を実行するためRMWサイクルを行う場合には、TIER0Wレジスタ15に対してRMWサイクルを行うようにする。すると、時刻T1においてTIER0Wレジスタ15よりデータFFhが読み出される。CPU11は、時刻T2でその第0ビットのみを“0”にセットすると、時刻T3において同じTIER1Wレジスタ16のアドレスを出力してデータFEhのライトサイクルを行う。
【0038】
この場合、デコード信号TIER0Wが出力されてORゲート22の出力端子がハイレベルになることから、クロック信号CKBの立上がりタイミングでANDゲート21の出力端子もハイレベルとなって、TIERレジスタ14のマスタラッチ18にデータが書き込まれる。
【0039】
また、各ビットセル14B(0)〜14B(7)においては、デコード信号TIER0Wが出力されているので、データバス4上にデータ値“0”が出力されているビットセル14B(0)のデータ選択部17aは、マスタラッチ18にデータバス4(D(0))のデータ値“0”を選択して出力し、それ以外のビットセル14B(1)〜14B(7)のデータ選択部17aは、マスタラッチ18にスレーブラッチ19の保持データを選択して出力する。
【0040】
従って、この場合も、CPU11のビット操作命令によって“0”がセットされるビット以外のビットデータは、CPU11がデータバス4上に出力しているデータにかかわらずスレーブラッチ19の保持データが選択されて書き込まれることになる。スレーブラッチ19の保持データは77hであるから、その第0ビットが“0”にセットされることによってTIERレジスタ14のマスタラッチ18に書き込まれるデータは76hとなる。
尚、上記のプロセスを、CPU11と12とのアクセス順序を入れ替えて行ったとしても、全く同様の結果になることは言うまでもない。
【0041】
▲3▼<リードサイクルによってTIERレジスタ14からデータを読み出す場合>
例えば、CPU11が、TIERレジスタ14のデータを単に読出す場合には、通常通りTIERレジスタ14に対してリードサイクルを行うようにする。すると、アドレスデコーダ13がデコード信号TIERを出力するのでANDゲート23の出力端子がハイレベルとなる。そして、出力バッファ20がイネーブルとなるので、スレーブラッチ19に保持されているデータがデータバス4上に出力される。
【0042】
▲4▼<ライトサイクルによってTIERレジスタ14に任意のデータを書込む場合>
例えば、CPU11が、TIERレジスタ14にデータ00hを書き込む場合には、通常通りTIERレジスタ14に対してライトサイクルを行うようにする。この場合も、アドレスデコーダ13がデコード信号TIERを出力するので、全てのビットセル14Bの選択信号生成回路17bがハイレベルの選択信号を出力する。従って、データ選択部17aは、CPU11が出力したデータバス4上のデータを選択してマスタラッチ18に出力する。
【0043】
そして、ORゲート22の出力端子がハイレベルになり、クロック信号CKBの立上がりタイミングでANDゲート21の出力端子もハイレベルとなるので、TIERレジスタ14のマスタラッチ18にデータ00hが書き込まれる。
【0044】
以上のように本実施例によれば、CPU11がビット操作命令を実行し、TIERレジスタ14の任意のビットのデータ値を“1”にセットする場合は、RMWサイクル前半のリードサイクルにおいてTIER1Wレジスタ16をアクセスしてデータを読み出し、変更対象ビットのデータ値を“1”にしてからTIER1Wレジスタ16のアドレスでライトサイクルを行うと、マルチプレクサ17は、TIERレジスタ14のマスタラッチ18に対して、データ値が“1”に変更されたビットについてはそのデータ値“1”を出力し、それ以外のビットについてはスレーブラッチ19の保持データを出力するように選択する。
【0045】
また、CPU11がTIERレジスタ14の任意のビットのデータ値を“0”にセットする場合は、RMWサイクル前半のリードサイクルにおいて、TIER0Wレジスタ15をアクセスしてデータを読み出し、変更対象ビットのデータ値を“0”にしてからTIER0Wレジスタ15のアドレスでライトサイクルを行うと、マルチプレクサ17は、マスタラッチ18に対してデータ値が“0”に変更されたビットについてはそのデータ値“0”を出力し、それ以外のビットについてはスレーブラッチ19の保持データを出力するように選択するようにした。
【0046】
即ち、CPU11が行ったRMWサイクルが完了する前に他のCPU12がRMWサイクルを開始したとしても、CPU12による後半のライトサイクルが行われる時点ではCPU11によるRMWサイクルは完了しているので、その変更後のデータがスレーブラッチ19に保持されている。従って、CPU12によるライトサイクルでマスタラッチ19に書き込まれるデータは、CPU12が変更しなかったビットについてはCPU11によって変更されたデータとなるので、複数のCPUによってアクセスされるTIERレジスタ14のデータ値が、常に期待値通りとなるように制御することができる。
【0047】
また、本実施例によれば、選択信号生成回路17bにおいて、データ選択部17aが出力データにデータD(i)を選択する条件に、“又は(デコード信号がレジスタ)”をも加えたので、CPU11または12は、TIERレジスタ14に対してビット操作により設定を行うだけでなく、TIERレジスタ14に割り当てられているアドレスを出力して通常の任意データの書き込み(全ビットの同時書き込み)を行うこともできる。
【0048】
そして、レジスタ制御装置24を備えたことで、予めマルチCPUシステムに適用することを想定した設計が行われていないCPU11,12を用いても、TIERレジスタ14等の周辺回路を共用するマルチCPUシステム25を構成することが可能となる。
【0049】
本発明は上記し且つ図面に記載した実施例にのみ限定されるものではなく、次のような変形または拡張が可能である。
単一ビットのビット操作に限ることなく、複数ビットのビット操作(所謂ビットフィールド操作)を行う場合でも、同様に適用することができる。
データバスサイズは8ビットに限ることなく,4ビット,16ビットや32ビットでも良い。
レジスタはコントロールレジスタに限らず、データレジスタでも良い。また、ダブルラッチ構成のTIERレジスタ14に限ることなく、CPUの動作クロックに同期して動作するDフリップフロップなどを用いてレジスタを構成しても良い。
リード信号とライト信号とを、例えばハイレベルの場合にリードサイクル,ロウレベルの場合にライトサイクルであることを示す1つの信号(リード/ライト信号)にしても良い。この場合、ANDゲート21の対応する入力端子には、インバータゲートを介してリード/ライト信号を与えたり、或いは、当該入力端子は負論理とすれば良い。
【0050】
CPUが3つ以上存在するシステムに適用しても良い。
マルチCPUシステム全体を、半導体基板上の集積回路装置として構成しても良いし、各個別のディスクリート素子をプリント基板に搭載した回路装置として構成しても良い。
【図面の簡単な説明】
【図1】本発明の一実施例であり、TIERレジスタを中心とする電気的構成を示す図
【図2】2つのCPUがリード・モディファイ・ライトサイクルを行う場合における、TIERレジスタのデータ値の変化を示すタイミングチャート
【図3】従来技術を示す図1相当図
【図4】二相クロック信号の波形を示す図
【図5】図2相当図
【符号の説明】
11,12はCPU、13はアドレスデコーダ、14はTIERレジスタ、14aはレジスタ部(レジスタ)、14bはレジスタ制御部、15はTIER0Wレジスタ(“0”セット用レジスタ)、16はTIER1Wレジスタ(“1”セット用レジスタ)、17はマルチプレクサ、18はマスタラッチ、19はスレーブラッチ、24はレジスタ制御装置、25はマルチCPUシステムを示す。[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a register control device for controlling data values of registers accessed by a plurality of CPUs, and a multi-CPU system including the register control device.
[0002]
[Prior art]
In a multi-CPU system configured to implement advanced functions with multiple CPUs, when each CPU attempts to execute a read cycle or a write cycle, only one CPU always uses the bus exclusively Thus, the right to use the bus is arbitrated by the arbiter.
[0003]
In such a system, when the peripheral circuit such as the control register is shared, or when setting is performed after checking the value of the semaphore, the CPU performs a bit operation on (read) data read from a certain register. (Modify), a read-modify-write cycle in which the data value resulting from the bit manipulation is written back to the same register (write) may be executed.
[0004]
Depending on the type of CPU, there is a type in which each signal is output so that the read / modify / write cycle is inseparably executed and the bus is continuously occupied. However, assuming that a multi-CPU system is configured using a CPU that does not have such a function, the following problems may occur.
[0005]
[Problems to be solved by the invention]
FIG. 3 is a configuration example of the multi-CPU system. The
[0006]
The address decoder 6 connected to the
[0007]
The
[0008]
The
[0009]
In the above multi-CPU system, a case where the
[0010]
At this time, when another
[0011]
That is, if the
[0012]
The present invention has been made in view of the above circumstances, and the purpose thereof is to determine the data value of a register regardless of the timing at which a plurality of CPUs perform a read-modify-write cycle on the same register. Is to provide a register control device that can be controlled so as to meet the expected value, and a multi-CPU system including the register control device.
[0013]
[Means for Solving the Problems]
According to the register control device of
[0014]
Also, when any CPU sets the data value of any bit in the register to “1”, the “1” set register is accessed in the read cycle of the first half of the RMW cycle, and the data of all the bits “0” is stored. A value (hereinafter referred to as all “0” data) is read. Then, the data value of the change target bit is set to “1” in the read all “0” data, and then the write cycle is performed with the address of the “1” setting register. Then, the multiplexer outputs the data value “1” for the bit whose data value has been changed to “1” by the CPU, and outputs the data held in the register for the other bits. Select
[0015]
That is, even if the CPU (B) starts the RMW cycle before the RMW cycle performed by the other CPU (A) is completed, the CPU (A) is still at the time when the latter write cycle is performed by the CPU (B). The RMW cycle is completed, and the data after the change is held in the register. Therefore, the data written to the register in the write cycle by the CPU (B) is the data changed by the CPU (A) for the bits that are not changed by the CPU (B). Therefore, even when a plurality of CPUs that are not designed to be applied to a multi-CPU system in advance access a register, it is possible to control the data value of the register to always be as expected.
[0016]
And In the condition that the multiplexer selects the output data of the CPU as the data to be output to the register,
Or (decode signal is a register)
Add Therefore, the CPU can perform not only setting by a bit operation on the register but also normal writing (that is, simultaneous writing of all bits) by outputting an address assigned to the register.
[0017]
[0018]
DETAILED DESCRIPTION OF THE INVENTION
An embodiment of the present invention will be described below with reference to FIGS. 3 that are the same as those in FIG. 3 are denoted by the same reference numerals, description thereof is omitted, and only different portions will be described below. In this embodiment, two
[0019]
These registers 15 and 16 are assigned addresses different from those of the
[0020]
The TIER1W register 16 is set so as to be accessed when the
[0021]
That is, the TIER0W register 15 outputs the enable signal to the data output unit 15a that outputs all “1” data, the
[0022]
Similarly to the TIER0W register 15, the TIER1W register 16 also has a
[0023]
In FIG. 1, the
[0024]
The selection signal generation circuit 17b is supplied with three decode signals TIER, TIER0W, TIER1W output from the
If the conditions are other than the above, (Output data: Data held in slave latch 19)
The selection signal generation circuit 17b outputs, for example, a selection signal corresponding to the above two conditions (for example, a high level when the former is established and a low level when the latter is established) to the data selection unit 17a, The data selection unit 17a selects one of the two input terminals according to the selection signal.
[0025]
The latch signal of the
[0026]
Further, the A-phase signal CKA of the two-phase clock signal is directly given to the latch signal of the
[0027]
The
[0028]
A register control unit 24 is configured by adding the
[0029]
Next, the operation of this embodiment will be described with reference to FIG.
<1><When"1" is set in the
For example, when the
[0030]
In this case, writing to the TIER1W register 16 that is a read-only register is not performed, and instead, the decode signal TIER1W is output and the output terminal of the
[0031]
In each of the bit cells 14B (0) to 14B (7), since the decode signal TIER1W is output, the data selection unit of the bit cell 14B (0) in which the data value “1” is output on the
[0032]
In the other bit cells 14B (1) to 14B (7), since the selection signal generation circuit 17b sets the selection signal to the low level, the data selection unit 17a selects and outputs the data held in the
[0033]
That is, the bit data other than the bit that is set to “1” by the bit operation instruction of the
[0034]
Therefore, similarly to the conventional example shown in FIG. 5, if another
[0035]
Then, the data selection unit 17a of the bit cell 14B (4) whose data value “1” is output on the
[0036]
That is, when the
[0037]
<2><When “0” is set in the
For example, when the initial value of the
[0038]
In this case, since the decode signal TIER0W is output and the output terminal of the
[0039]
In each of the bit cells 14B (0) to 14B (7), since the decode signal TIER0W is output, the data selection unit of the bit cell 14B (0) in which the data value “0” is output on the
[0040]
Therefore, also in this case, for the bit data other than the bit set to “0” by the bit operation instruction of the
Needless to say, even if the above-described process is performed by changing the access order of the
[0041]
(3) <When reading data from the
For example, when the
[0042]
(4) <When writing arbitrary data to the
For example, when the
[0043]
Then, the output terminal of the
[0044]
As described above, according to the present embodiment, when the
[0045]
When the
[0046]
That is, even if another
[0047]
In addition, according to the present embodiment, in the selection signal generation circuit 17b, “or (decode signal is a register)” is also added to the condition for the data selection unit 17a to select the data D (i) as the output data. The
[0048]
In addition, since the register control device 24 is provided, a multi-CPU system that shares peripheral circuits such as the
[0049]
The present invention is not limited to the embodiments described above and illustrated in the drawings, and the following modifications or expansions are possible.
The present invention is not limited to single-bit bit operations, and can be similarly applied to a case where a plurality of bit operations (so-called bit field operations) are performed.
The data bus size is not limited to 8 bits, but may be 4 bits, 16 bits, or 32 bits.
The register is not limited to the control register but may be a data register. Further, the register may be configured using a D flip-flop that operates in synchronization with the operation clock of the CPU, without being limited to the
For example, the read signal and the write signal may be a single signal (read / write signal) indicating a read cycle when it is at a high level and a write cycle when it is at a low level. In this case, a read / write signal may be given to the corresponding input terminal of the AND
[0050]
The present invention may be applied to a system having three or more CPUs.
Ma The entire multi-CPU system may be configured as an integrated circuit device on a semiconductor substrate, or may be configured as a circuit device in which each individual discrete element is mounted on a printed circuit board.
[Brief description of the drawings]
FIG. 1 is a diagram showing an electrical configuration centering on a TIER register according to an embodiment of the present invention.
FIG. 2 is a timing chart showing changes in the data value of the TIER register when two CPUs perform a read-modify-write cycle.
FIG. 3 is a diagram corresponding to FIG.
FIG. 4 is a diagram showing a waveform of a two-phase clock signal
FIG. 5 is a view corresponding to FIG.
[Explanation of symbols]
11 and 12 are CPUs, 13 is an address decoder, 14 is a TIER register, 14a is a register unit (register), 14b is a register control unit, 15 is a TIER0W register (register for “0”), and 16 is a TIER1W register (“1”) "Set register", 17 is a multiplexer, 18 is a master latch, 19 is a slave latch, 24 is a register controller, and 25 is a multi-CPU system.
Claims (2)
何れかのCPUが、リード操作時に前記アクセスされるレジスタの任意のビットのデータ値を“0”にセットする場合にアクセスされ、全ビットのデータ値“1”が読み出される“0”セット用レジスタと、
何れかのCPUが、リード操作時に前記アクセスされるレジスタの任意のビットのデータ値を“1”にセットする場合にアクセスされ、全ビットのデータ値“0”が読み出される“1”セット用レジスタと、
CPUが出力するアドレスをデコードしてデコード信号を出力するアドレスデコーダと、
前記アクセスされるレジスタの入力側に配置され、前記アドレスデコーダが出力するデコード信号及びCPUのリード・モディファイ・ライトサイクルのライト操作時の出力データに基づいて、ライト操作時に前記アクセスされるレジスタに対する各ビット毎の出力データを以下の条件に従って選択し出力するマルチプレクサとを備え、
{(デコード信号が前記アクセスされるレジスタ)}
又は{(デコード信号が“0”セット用レジスタ)
且つ(CPUの出力データが“0”)}
又は{(デコード信号が“1”セット用レジスタ)
且つ(CPUの出力データが“1”)}
ならば、(出力データはCPUの出力データ),
上記以外の条件 ならば、(出力データは前記アクセスされるレジスタの保持データ)
前記アクセスされるレジスタには、前記CPUが前記アクセスされるレジスタ、“0”セット用レジスタまたは“1”セット用レジスタの何れかのアドレスを出力してリード・モディファイ・ライトサイクルを行う場合のライト操作時に、データが書き込まれるように構成されていると共に、
前記マルチプレクサが、前記アクセスされるレジスタに対し、リード・モディファイ・ライトサイクル以外の場合にライト操作を行う際にCPUの出力データを選択して出力する条件に、
又は(デコード信号が前記アクセスされるレジスタ)
を加え、
前記アクセスされるレジスタは、前記CPUが前記アクセスされるレジスタのアドレスを出力して書き込みを行う場合も、データが書き込まれるように構成されていることを特徴とするレジスタ制御装置。 In a register controller for controlling the data value of a register accessed by a plurality of CPUs performing a read-modify-write cycle ,
“0” setting register that is accessed when any CPU sets the data value of any bit of the accessed register to “0” during a read operation, and the data value “1” of all bits is read When,
"1" set register that is accessed when any CPU sets the data value of any bit of the accessed register to "1" during a read operation, and the data value "0" of all bits is read When,
An address decoder that decodes an address output by the CPU and outputs a decode signal;
Each of the registers to be accessed at the time of a write operation is arranged on the input side of the register to be accessed, based on the decode signal output by the address decoder and the output data at the time of the write operation of the read / modify / write cycle of the CPU. A multiplexer that selects and outputs the output data for each bit according to the following conditions,
{(The register to which the decode signal is accessed)}
Or {(decode signal is a register for setting “0”)
(CPU output data is “0”)}
Or {(decode signal is a register for setting “1”)
And (CPU output data is “1”)}
Then, (output data is CPU output data),
If the conditions are other than the above, (Output data is the data held in the accessed register)
Write to the accessed register when the CPU outputs the address of the accessed register, “0” set register or “1” set register to perform a read-modify-write cycle It is configured to write data during operation ,
In the condition that the multiplexer selects and outputs the output data of the CPU when performing a write operation in a case other than the read-modify-write cycle for the accessed register,
Or (the register to which the decode signal is accessed )
Add
Register that is the access, even when writing by outputting the address of the register that the CPU is the access register control apparatus characterized by being configured so that data is written.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2000321070A JP4008196B2 (en) | 2000-10-20 | 2000-10-20 | Register control device and multi-CPU system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2000321070A JP4008196B2 (en) | 2000-10-20 | 2000-10-20 | Register control device and multi-CPU system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2002132744A JP2002132744A (en) | 2002-05-10 |
| JP4008196B2 true JP4008196B2 (en) | 2007-11-14 |
Family
ID=18799261
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2000321070A Expired - Fee Related JP4008196B2 (en) | 2000-10-20 | 2000-10-20 | Register control device and multi-CPU system |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4008196B2 (en) |
-
2000
- 2000-10-20 JP JP2000321070A patent/JP4008196B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2002132744A (en) | 2002-05-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107924375B (en) | Command arbitration for high-speed memory interface | |
| JP3304577B2 (en) | Semiconductor memory device and operation method thereof | |
| JP2023539737A (en) | Memory controller with multiple command subqueues and corresponding arbiters | |
| JPS5924462B2 (en) | Shared memory access control method | |
| JP3039557B2 (en) | Storage device | |
| JP2762138B2 (en) | Memory control unit | |
| US5317750A (en) | Microcontroller peripheral expansion bus for access to internal special function registers | |
| US8244994B1 (en) | Cooperating memory controllers that share data bus terminals for accessing wide external devices | |
| JP4008196B2 (en) | Register control device and multi-CPU system | |
| JP2002132579A (en) | Register control device | |
| JPS63226735A (en) | Register circuit | |
| JP3765452B2 (en) | Semiconductor memory device | |
| JP3077807B2 (en) | Microcomputer system | |
| US6493775B2 (en) | Control for timed access of devices to a system bus | |
| JPH09311812A (en) | Microcomputer | |
| US6219740B1 (en) | Information processing device | |
| JP2638484B2 (en) | Data processing device | |
| CN111625411A (en) | Semiconductor device and debug system | |
| JPS59116866A (en) | Storage device of computer system | |
| JP2000029508A (en) | Programmable controller | |
| JPS6014435B2 (en) | Storage device | |
| JP2000298664A (en) | Single chip microcomputer | |
| JPH09106359A (en) | Semiconductor integrated circuit | |
| JP2004185060A (en) | Microcomputer | |
| JP3006487B2 (en) | Emulation device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20041216 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20050111 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20050223 |
|
| A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20050726 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20070726 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20070829 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100907 Year of fee payment: 3 |
|
| R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100907 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110907 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110907 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120907 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120907 Year of fee payment: 5 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130907 Year of fee payment: 6 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| LAPS | Cancellation because of no payment of annual fees |
