JPH04235636A - Microprocessor - Google Patents

Microprocessor

Info

Publication number
JPH04235636A
JPH04235636A JP1395991A JP1395991A JPH04235636A JP H04235636 A JPH04235636 A JP H04235636A JP 1395991 A JP1395991 A JP 1395991A JP 1395991 A JP1395991 A JP 1395991A JP H04235636 A JPH04235636 A JP H04235636A
Authority
JP
Japan
Prior art keywords
data
instruction
state
address
instructions
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.)
Granted
Application number
JP1395991A
Other languages
Japanese (ja)
Other versions
JP2968060B2 (en
Inventor
Nobufumi Komori
伸史 小守
Hirono Tsubota
浩乃 坪田
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 JP1395991A priority Critical patent/JP2968060B2/en
Priority to US07/819,164 priority patent/US5404553A/en
Publication of JPH04235636A publication Critical patent/JPH04235636A/en
Priority to US08/330,880 priority patent/US5666535A/en
Application granted granted Critical
Publication of JP2968060B2 publication Critical patent/JP2968060B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)

Abstract

PURPOSE:To obtain a microprocessor capable of executing the exclusive control only by combining a small number of simple instructions. CONSTITUTION:A data storage part of the microprocessor is provided with an SR flip-flop 403 stored that whether a memory 200 is locked or not. Thus it is possible to prevent such a case where the same resources are simultaneously locked owing to the conflict of test-and-lock instructions which are produced in plural processes since the flip-flop 403 stores a fact whether the memory 200 is kept in a lock state or not. Then a test-and-set instruction is divided into simple instructions and can be executed.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】この発明は、マイクロプロセッサ
の構成に関するものであり、より詳しくは、そのデータ
記憶部の構成に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to the structure of a microprocessor, and more particularly to the structure of its data storage section.

【0002】0002

【従来の技術】VLSI技術の進展にともなって、マイ
クロプロセッサの価格が低下し、信頼性が向上したため
に、多数のマイクロプロセッサを連結して高速にデータ
処理を行う並列処理が盛んになってきている。ところが
、多数のマイクロプロセッサに分割された処理を、まっ
たく独立に処理した場合、不都合が生じる場合がある。 特に、記憶装置などに代表される共有の資源を複数の処
理(以後、プロセスという)が同時に使用する場合、同
時に使用できるプロセスを一つに制限し排他的に実行さ
せなければ、処理の整合性が保証されない場合が多い。
[Background Art] With the advancement of VLSI technology, the price of microprocessors has decreased and their reliability has improved, so parallel processing in which multiple microprocessors are connected to perform high-speed data processing has become popular. There is. However, if the processes divided among a large number of microprocessors are processed completely independently, problems may occur. In particular, when multiple processes (hereinafter referred to as processes) use a shared resource, such as a storage device, at the same time, it is important to limit the number of processes that can be used at the same time to one and run them exclusively. is often not guaranteed.

【0003】このような問題を解決するために、従来型
のマイクロプロセッサでは、例えばテスト・アンド・セ
ット命令によってプロセッサの資源管理を行ってきた。
In order to solve these problems, conventional microprocessors have managed processor resources using, for example, test-and-set instructions.

【0004】例えば、三菱電機(株)発行の「三菱M3
2ファミリMPU  M32/100M33210  
ユーザーズマニュアル」の222ページから223ペー
ジには、排他制御を実現するためのBSETI命令につ
いて記載されている。BSETI命令の機能は、セット
  ビット  ウィズ  インターロック(setbi
t with interlock)であり、指定され
たビットの値を反転したものをZ フラグ(Z fla
g)にコピーし、その後そのビットがセットされる。こ
のとき、この2つの操作はバスをロックして行われる。
[0004] For example, "Mitsubishi M3" published by Mitsubishi Electric Co., Ltd.
2 family MPU M32/100M33210
Pages 222 to 223 of "User's Manual" describes the BSETI command for realizing exclusive control. The function of the BSETI instruction is to set bits with interlocks (setbi
t with interlock), and the inverted value of the specified bit is set as the Z flag (Z flag).
g), then that bit is set. At this time, these two operations are performed with the bus locked.

【0005】また、プレンティス  ホール社(Pre
ntice−Hall Inc.(Englewood
 Cliffs,NJ 07632)) 発行の ”シ
リーズ 32000  プログラマーズ  リファレン
ス  マニュアル(Series 32000 Pro
grammer’s Reference Manua
l)” の6−185 ページから6−187 ページ
にもほぼ同様の記述があり、SBITI命令によりメモ
リまたはレジスタの内容がプロセッサステータスレジス
タ(PSR)のFフラグにコピーされた後、内容が1に
セットされ、この間CPUのインターロック  オペレ
ーション(Interlocked Operatio
n) 出力ピンがアクティブ状態となり、セマフォービ
ットに対するアクセスがインターロック(連結)される
ことが述べられている。
[0005] Also, Prentice Hall Co.
ntice-Hall Inc. (Englewood
Series 32000 Programmer's Reference Manual (Series 32000 Pro) published by Cliffs, NJ 07632)
Grammer's Reference Manua
There is a similar description on pages 6-185 to 6-187 of ``l)'', which states that after the contents of memory or registers are copied to the F flag of the processor status register (PSR) by the SBITI instruction, the contents are set to 1. During this time, the CPU's Interlocked Operation
n) It is stated that the output pin is in the active state and access to the semaphore bits is interlocked.

【0006】上述の従来例は、いわゆるCISC(Co
mplex Instruction Set Com
puter) 型に属するマイクロプロセッサであり、
BSETI、SBITIなどのマクロ命令を、複数ステ
ップのマイクロプログラムの実行によって実現している
。これらの命令実行中に、他のプロセッサからの割り込
みによって処理が中断し、命令実行の一貫性が保証され
なくなることを防止するために、バスをロックしたり、
連結操作信号をアクティブにしたりしている。
The above-mentioned conventional example is a so-called CISC (Co
complex Instruction Set Com
It is a microprocessor belonging to the type putter),
Macro instructions such as BSETI and SBITI are realized by executing a multi-step microprogram. To prevent processing from being interrupted by interrupts from other processors during the execution of these instructions, and to prevent the consistency of instruction execution from being guaranteed, the bus is locked,
Activating the connection operation signal.

【0007】ところが、このような方式をとると、命令
フェッチ、データフェッチ、実行、結果の格納などを流
れ処理的に行うパイプライン処理構造をもつ一般的なプ
ロセッサの場合、命令実行のパイプライン段における実
行サイクル数が増加するために、当該パイプライン段に
続く段が空になり、また、先行する段のデータの移動が
停止するため、パイプラインの詰まり(パイプラインス
トール)が発生し、処理効率が低下することとなる。
However, if such a method is adopted, in the case of a general processor with a pipeline processing structure that performs instruction fetch, data fetch, execution, result storage, etc. in a flow processing manner, the pipeline stages of instruction execution are As the number of execution cycles increases, the stage following the pipeline stage becomes empty, and data movement in the preceding stage stops, resulting in pipeline blockage (pipeline stall) and decreasing processing efficiency. will decrease.

【0008】このような問題を解決するために、一つの
命令を原則的には1マシンサイクルで実行することを特
徴とする、いわゆるRISC(ReducedInst
ruction Set Computer) 型のプ
ロセッサが提唱され、RISCアーキテクチャに基づく
商用マイクロプロセッサが既に販売されている。
[0008] In order to solve this problem, so-called RISC (Reduced Inst.
A RISC architecture-based processor has been proposed, and commercial microprocessors based on the RISC architecture are already on the market.

【0009】代表的なRISCマイクロプロセッサとし
て知られているAm29000の命令セットが、日経B
P社発行の「日経データプロ・マイクロプロセッサ」の
MC1−303−151 ページからMC1−303−
163 ページに開示されている。命令を1クロックサ
イクルで実行するAm29000の場合、テスト・アン
ド・セットのように複雑な手順の実行が必要となる命令
はサポートされていない。 上記公知資料によると、スーパバイザ・モードと呼ばれ
る特権モードでのみアクセス可能な専用レジスタ(現行
プロセッサ・ステータス・レジスタ)の第9ビットをア
クティブにすることによって、プロセッサのLOCKピ
ンがアクティブになり、他のプロセッサからBREQ信
号によるバス解放要求が入力されてもバスを解放しない
ように制御される。そしてこの機能により、処理の一貫
性を保つことができる。
The instruction set of the Am29000, known as a typical RISC microprocessor, was published by Nikkei B.
MC1-303- from page MC1-303-151 of “Nikkei Data Pro Microprocessor” published by Company P
It is disclosed on page 163. In the case of the Am29000, which executes instructions in one clock cycle, instructions that require the execution of complex procedures such as test and set are not supported. According to the above-mentioned publicly known document, by activating the 9th bit of a dedicated register (current processor status register) that can only be accessed in a privileged mode called supervisor mode, the LOCK pin of the processor becomes active and other The bus is controlled not to be released even if a bus release request by the BREQ signal is input from the processor. This feature allows you to maintain consistency in processing.

【0010】0010

【発明が解決しようとする課題】以上述べたように、従
来のCISCプロセッサの場合、テスト・アンド・セッ
トのような複雑な命令を実行すると、パイプライン処理
効率が低下するという問題点がある。逆に、1命令を1
クロックサイクルで実行するRISCプロセッサの場合
、テスト・アンド・セットのように複雑な命令をハード
ウェアで実現できないという問題点がある。
As described above, conventional CISC processors have a problem in that pipeline processing efficiency decreases when complex instructions such as test-and-set are executed. Conversely, 1 instruction is 1
In the case of a RISC processor that executes in clock cycles, there is a problem in that complex instructions such as test and set cannot be implemented in hardware.

【0011】上述のAm29000の場合、排他制御を
実現しようとすると、まず、スーパバイザ・モードの設
定を行い、専用レジスタに書き込みを行いLOCK信号
ピンをアクティブ状態にしてバスを占有し、排他制御を
行うべき資源を代表するメモリアドレスの読み出しを行
い、読み出し結果の判定を行い、例えば読み出し結果が
「0」であった場合、同一アドレスに対して「1」を書
き込み、その後専用レジスタに再書き込みを行いLOC
K信号ピンを非アクティブ状態とし、バスを他のプロセ
ッサに解放するという手順をソフトウェアで実行する必
要がある。このように、複雑な手続きを実行しなければ
ならないので、プログラム実行効率がきわめて悪い上に
、この間、バスを占有し続けるために他のプロセスの実
行を妨げる可能性が強い。
In the case of the above-mentioned Am29000, when attempting to realize exclusive control, first set the supervisor mode, write to the dedicated register, activate the LOCK signal pin, occupy the bus, and perform exclusive control. Read the memory address that represents the resource to be used, and judge the read result. For example, if the read result is "0", write "1" to the same address, and then rewrite to the dedicated register. LOC
Software must take steps to deactivate the K signal pin and release the bus to other processors. As described above, since a complicated procedure must be executed, the efficiency of program execution is extremely low, and there is a strong possibility that the execution of other processes will be hindered because the bus will continue to be occupied during this time.

【0012】本発明は、以上のような問題点を解決する
ためになされたものであり、簡単な命令の少数の組み合
わせによって、排他制御が実現できるマイクロプロセッ
サを提供することを目的としている。
The present invention has been made to solve the above-mentioned problems, and it is an object of the present invention to provide a microprocessor that can realize exclusive control by combining a small number of simple instructions.

【0013】[0013]

【課題を解決するための手段】この発明に係るマイクロ
プロセッサは、排他制御を実現するために用いられる一
連の命令が実行中であることを記憶する手段を導入する
ことにより、同種の命令の実行を遅延させるデータ記憶
装置をマイクロプロセッサに付与したものである。
[Means for Solving the Problems] A microprocessor according to the present invention is capable of executing a series of instructions of the same type by introducing means for storing information that a series of instructions used to realize exclusive control is being executed. A microprocessor is provided with a data storage device that delays the process.

【0014】[0014]

【作用】この発明においては、例えばテスト・アンド・
ロック命令が与えられたとき、このデータ記憶装置がロ
ック状態ではなく、かつ、同時に与えられたアドレスに
したがってメモリを読み出した結果データが「0」であ
った場合のみマイクロプロセッサに付与されたデータ記
憶装置をロック状態(第2の状態)とし、かつ条件コー
ドとして「0」を出力し、この結果の条件コードが「0
」であることに従って、セット・アンド・アンロック命
令が与えられたとき、上記アドレスに「1」を書き込む
と同時にデータメモリのロック状態を解除し非ロック状
態(第1の状態)とする。
[Operation] In this invention, for example, test and
Data storage that is granted to the microprocessor only when this data storage device is not in the locked state when a lock command is given, and the data is "0" as a result of reading the memory according to the address given at the same time. Puts the device in the locked state (second state) and outputs "0" as the condition code, and the resulting condition code is "0".
Accordingly, when a set and unlock command is given, "1" is written to the above address and at the same time the data memory is unlocked and brought into an unlocked state (first state).

【0015】[0015]

【実施例】以下、この発明の実施例を図に従って説明す
る。
[Embodiments] Hereinafter, embodiments of the present invention will be explained with reference to the drawings.

【0016】図1はこの発明に係るマイクロプロセッサ
のデータ記憶部を示しており、図において、1はデータ
記憶部、100は入力ラッチであり、101,102,
103はその制御ビットラッチ部,アドレスラッチ部,
入力データラッチである。200はアドレス指定型、即
ちアドレスを指定することによりデータの読出し,書き
込みが可能な、第1の記憶手段としてのメモリ部、30
0は出力ラッチ部であり、301,302はその条件コ
ードラッチ部,出力データラッチ部,303はロック状
態ラッチ部である。また、401はNANDゲート、4
02はハードウェアリセット時に、非ロック状態(第1
の状態)に初期設定するためのANDゲート、403は
第2の記憶手段としてのセット・リセット・フリップフ
ロップ、404,406,408はインバータ、405
はANDゲート、407はNORゲートである。
FIG. 1 shows a data storage section of a microprocessor according to the present invention. In the figure, 1 is a data storage section, 100 is an input latch, 101, 102,
103 is its control bit latch section, address latch section,
This is an input data latch. Reference numeral 200 denotes a memory section 30 as a first storage means of an addressing type, that is, data can be read and written by specifying an address.
0 is an output latch section, 301 and 302 are its condition code latch section, output data latch section, and 303 is a lock state latch section. Also, 401 is a NAND gate, 4
02 is in the unlocked state (first
403 is a set/reset flip-flop as a second storage means; 404, 406, 408 are inverters; 405
is an AND gate, and 407 is a NOR gate.

【0017】次に動作について説明する。パイプライン
制御に従って、制御情報、アドレス、およびデータを有
する情報がデータメモリ部1に到着したとき、入力ラッ
チ100のコントロールビット部101には図示されて
いない命令デコーダによってデコードされた結果の制御
信号(R/バーW、T&L、S&U)が、アドレス部1
02には排他制御の対象となる資源を代表するデータを
指し示すメモリアドレスが、またデータ部103には、
メモリに書き込むべきデータが、タイミング信号φの立
ち上がりに従ってそれぞれラッチされる。
Next, the operation will be explained. When information having control information, an address, and data arrives at the data memory section 1 according to pipeline control, the control bit section 101 of the input latch 100 receives a control signal (( R/bar W, T&L, S&U) is address part 1
02 contains a memory address pointing to data representing the resource subject to exclusive control, and the data section 103 contains:
Data to be written into the memory is latched in accordance with the rising edge of the timing signal φ.

【0018】マイクロプロセッサの命令セットのうち、
テスト・アンド・ロック命令が与えられたときには、コ
ントロールビット部101の制御ビットはR/バーW=
1、T&L=1、S&U=0となる。このとき、メモリ
200から読み出したデータの最下位ビットがインバー
タ406によって反転されてNANDゲート401の第
2の入力として入力される。NANDゲート401の他
の2入力はT&Lビットと、ロック状態ラッチ303出
力の反転出力であり、これらの入力がすべて「1」とな
ったとき、NANDゲート401の出力が「0」となり
、SRフリップフロップ403(以下、SRFFという
)がセットされ、メモリがロック状態であることを記憶
する。すなわち、テスト・アンド・ロック命令が与えら
れ、この命令に付随するアドレスの示すデータの内容が
「0」であり、かつメモリが非ロック状態であるとき、
ロック状態に遷移させるべく制御される。
Of the instruction set of a microprocessor,
When a test and lock command is given, the control bit of the control bit section 101 is R/W=
1, T&L=1, S&U=0. At this time, the least significant bit of the data read from memory 200 is inverted by inverter 406 and input as the second input of NAND gate 401. The other two inputs of the NAND gate 401 are the T&L bit and the inverted output of the locked state latch 303 output. When all these inputs become "1", the output of the NAND gate 401 becomes "0" and the SR flip-flop 403 (hereinafter referred to as SRFF) is set to store that the memory is in a locked state. That is, when a test and lock instruction is given, the content of the data indicated by the address accompanying this instruction is "0", and the memory is in an unlocked state,
Controlled to transition to the locked state.

【0019】また、テスト・アンド・ロック命令が与え
られても、すでに当該アドレスがセットされている場合
(ロック不可能状態1という)、またはすでに先行する
テスト・アンド・ロック命令によってメモリがロックさ
れている場合(ロック不可能状態2という)には、OR
ゲート407の出力が「1」となるため、ANDゲート
405の出力が「1」となり、出力ラッチ300の条件
コード部301に「1」がラッチされ、テスト・アンド
・ロック命令の実行が不成功であったことを記憶する。 また、このときSRFF403に対してはセットもリセ
ットもされないので、ロック状態ラッチ部303にはも
との状態が保存される。
Furthermore, even if a test-and-lock instruction is given, if the address has already been set (referred to as lock-unable state 1), or if the memory has already been locked by a preceding test-and-lock instruction. (referred to as unlockable state 2), OR
Since the output of the gate 407 becomes "1", the output of the AND gate 405 becomes "1", "1" is latched in the condition code section 301 of the output latch 300, and the execution of the test and lock instruction is unsuccessful. I remember that it was. Further, at this time, the SRFF 403 is neither set nor reset, so the original state is saved in the lock state latch section 303.

【0020】テスト・アンド・ロック命令を実行した結
果、条件コードが「0」となり、実行が成功した場合、
次にセット・アンド・アンロック命令が発行される。セ
ット・アンド・アンロック命令は、これと対をなすテス
ト・アンド・ロック命令実行時に用いたメモリアドレス
と、データ「1」を伴っている。また、コントロールビ
ット部101の制御ビットはR/バーW=0、T&L=
0、S&U=1となっている。このとき、入力ラッチ1
00にラッチされているデータ「1」が、当該アドレス
に書き込まれて排他制御対象の資源を占有中であること
を示す。また、S&U信号がインバータ404で反転さ
れ、さらにANDゲート402を介してSRFF403
に与えられ、SRFFをリセットしてロック状態を解除
する。
[0020] As a result of executing the test and lock instruction, if the condition code becomes "0" and the execution is successful,
A set and unlock instruction is then issued. The set-and-unlock instruction is accompanied by the memory address and data "1" used when executing the paired test-and-lock instruction. Further, the control bits of the control bit section 101 are R/W=0, T&L=
0, S&U=1. At this time, input latch 1
Data "1" latched at 00 is written to the address to indicate that the resource to be exclusively controlled is being occupied. Further, the S&U signal is inverted by an inverter 404 and further passed through an AND gate 402 to an SRFF 403.
is given to reset SRFF and release the locked state.

【0021】以上の説明から明らかなように、本実施例
でいうところの「ロック」は、ロック期間中における新
たなテスト・アンド・ロック命令の実行禁止を意味して
おり、従来のマイクロプロセッサのようにバス獲得要求
を全面的に禁止し、他のプロセスの実行を阻害する類の
ものではない。
As is clear from the above explanation, "lock" in this embodiment means prohibition of execution of new test-and-lock instructions during the lock period, and is different from conventional microprocessors. It completely prohibits bus acquisition requests and does not inhibit the execution of other processes.

【0022】次に、セット・アンド・アンロック命令の
実行後、排他的に割り当てられる資源を使用する処理が
実行される。排他的な処理を実行した後、上記アドレス
に「0」を書き込み、当該資源を他のプロセスに対して
解放する。
Next, after the set-and-unlock instruction is executed, processing using exclusively allocated resources is executed. After executing exclusive processing, "0" is written to the above address to release the resource to other processes.

【0023】排他的なプロセス実行を行うための以上の
手順を、図2のフローチャートに示す。
The above procedure for exclusive process execution is shown in the flowchart of FIG.

【0024】図2において、ステップS1においてテス
ト・アンド・ロック命令を実行し、ステップS2におい
て、条件コードCCが1であるか否かを判定する。その
判定結果が1であればステップS1に戻り、その判定結
果が1以外であればステップS3に進む。ステップS3
において、セット・アンド・アンロック命令を実行し、
ステップS4において、排他実行部の実行が行なわれる
。そして、ステップS5において、リセットのためのゼ
ロ書き込み命令が実行される。なお、ステップS2にお
いて、ステップS1に戻るテスト・アンド・セット命令
の遅延動作は実際にはソフトウエアで行なわれる。
In FIG. 2, a test and lock instruction is executed in step S1, and it is determined in step S2 whether the condition code CC is 1 or not. If the determination result is 1, the process returns to step S1, and if the determination result is other than 1, the process proceeds to step S3. Step S3
, execute a set and unlock instruction,
In step S4, the exclusive execution section is executed. Then, in step S5, a zero write instruction for resetting is executed. Note that in step S2, the delay operation of the test-and-set instruction that returns to step S1 is actually performed by software.

【0025】なお、この図2において、〔A〕は対象と
するアドレスがA番地であること、また〔A,0〕はア
ドレスがA番地、データ値が「0」であることを示して
いる。
[0025] In Fig. 2, [A] indicates that the target address is address A, and [A, 0] indicates that the address is address A and the data value is "0". .

【0026】このように、上記実施例では、データ記憶
部に、ロック状態であるか否かを記憶するフリップフロ
ップを設け、ロック状態においては新たにロックを要求
する命令の実行を遅延させることにより次のような効果
が得られる。
As described above, in the above embodiment, the data storage section is provided with a flip-flop for storing whether or not it is in a locked state, and in the locked state, execution of a new instruction requesting a lock is delayed. The following effects can be obtained.

【0027】即ち、テスト・アンド・セット命令のよう
に、処理に要するクロックサイクル数が多く、かつ処理
の一貫性(他のプロセスの影響を受けず、常に正しい結
果を出力する)を保証する必要のある命令の実行中には
、フリップフロップがデータ記憶部はロック状態である
旨を示すので、ロックを要求する命令が同時に実行され
るのを防止でき、処理の一貫性を要求する命令を複数の
単純な命令に分割して実行することができ、パイプライ
ン実行効率を向上させることができる。
In other words, the number of clock cycles required for processing is large, such as the test and set instruction, and it is necessary to guarantee processing consistency (always outputting correct results without being affected by other processes). During the execution of an instruction, a flip-flop indicates that the data storage is locked, which prevents instructions that require a lock from being executed at the same time, and allows multiple instructions that require processing consistency to be executed simultaneously. can be divided into simple instructions and executed, improving pipeline execution efficiency.

【0028】また、分割された命令の実行中は、データ
記憶部はロック状態となっているが、他のプロセスに属
する命令の実行を混合して行うことは可能であり、プロ
セス間で共有されている資源を使用し分割された命令実
行の一貫性を乱す命令の実行のみが自動的に遅延される
ので、特段の制御なしに排他的実行部分を含むマルチプ
ロセスの並列実行を実現することができる。
Furthermore, while the divided instructions are being executed, the data storage unit is in a locked state, but it is possible to mix the execution of instructions belonging to other processes, and the data storage unit is shared between processes. Since only the execution of instructions that disturb the consistency of the divided instruction execution using resources is automatically delayed, it is possible to realize parallel execution of multi-processes including exclusive execution parts without special control. can.

【0029】従って、図6に示すような、データ依存性
に従って命令実行順序が動的に決定され、かつ、マルチ
プロセスの並列実行を命令レベル並列で実現するデータ
駆動形(データフロー)マイクロプロセッサに適用した
場合に特に効果が大きい。なお、この図6の中で、60
1は入力制御部、602は待ち合せメモリ部、603は
データ記憶部、604は演算処理部、605はプログラ
ム記憶部、606は出力制御部である。
Therefore, as shown in FIG. 6, a data-driven (data flow) microprocessor in which the instruction execution order is dynamically determined according to data dependencies and which realizes parallel execution of multiple processes at the instruction level parallelism is required. It is especially effective when applied. In addition, in this Figure 6, 60
1 is an input control section, 602 is a queue memory section, 603 is a data storage section, 604 is an arithmetic processing section, 605 is a program storage section, and 606 is an output control section.

【0030】また、上記実施例では、当該アドレスに格
納されているデータの判断とロック状態の設定を1命令
(テスト・アンド・ロック)とし、また、当該アドレス
のデータ値の書き換えとロック状態の解除をそれぞれ単
一の命令(セット・アンド・アンロック)としているた
め、全体として命令数が削減されており、従来型のRI
SCプロセッサと比較しても効率的な処理が可能となっ
ている。
Furthermore, in the above embodiment, one instruction (test and lock) determines the data stored at the address and sets the lock state, and also rewrites the data value at the address and sets the lock state. Since each release is a single instruction (set and unlock), the overall number of instructions is reduced, compared to conventional RI.
Even compared to SC processors, more efficient processing is possible.

【0031】なお、上記実施例では、デコードされた信
号(R/バーW,T&L、S&U)のみを示しており、
命令デコーダを示していないが、命令デコーダを本メモ
リ部にもってもよい。また、命令デコーダなしで、各々
の制御信号が直接与えられてもよい。
In the above embodiment, only the decoded signals (R/W, T&L, S&U) are shown.
Although the instruction decoder is not shown, the instruction decoder may be included in this memory section. Also, each control signal may be directly applied without an instruction decoder.

【0032】また、上記実施例では、出力ラッチのデー
タ部302にはメモリから読み出したデータが入力され
ているが、図3に示すように入力データとメモリ読み出
し結果の何れかを選択的にラッチするように構成しても
よく、上記実施例と同様の効果を奏する。なお、図3の
中で、409は出力トライステート制御付きのデータバ
ッファ、410はインバータである。
In the above embodiment, the data read from the memory is input to the data section 302 of the output latch, but as shown in FIG. 3, either the input data or the memory read result can be selectively latched. Alternatively, the same effect as in the above embodiment can be obtained. In FIG. 3, 409 is a data buffer with output tri-state control, and 410 is an inverter.

【0033】さらに、上記実施例では、クロック信号φ
によってラッチが制御されているが、図4に示すように
、2つの入力信号の一致,不一致を検出するC素子から
なるハンドシェイク回路500,501によってラッチ
信号を発生してもよい。なおこのC素子の回路構成例と
動作については、本件出願人による特開昭63−204
355号公報に詳述されており、図5にこの公報より抜
粋したその回路構成例を示している。図において、10
13(1014)はC素子であり、R−Sフリップフロ
ップ1015,1016(1017,1018)および
4入力NANDゲート1131(1141)、インバー
タバッファ1134,1135,1139(1144,
1145,1149)、2入力NANDゲート1138
(1148)から構成されている。なお、1011(1
012)は40ビット分のデータラッチであり、1ビッ
トのラッチ1110(1120)はインバータバッファ
1111,1112,1113(1121,1122,
1123)およびトランスファゲート1114,111
5(1124,1125)により構成されている。
Furthermore, in the above embodiment, the clock signal φ
However, as shown in FIG. 4, the latch signal may be generated by handshake circuits 500 and 501 made up of C elements that detect coincidence or mismatch between two input signals. Regarding the circuit configuration example and operation of this C element, please refer to Japanese Unexamined Patent Application Publication No. 63-204 by the present applicant.
The circuit configuration is described in detail in Japanese Patent No. 355, and FIG. 5 shows an example of the circuit configuration extracted from this publication. In the figure, 10
13 (1014) is a C element, R-S flip-flops 1015, 1016 (1017, 1018), 4-input NAND gate 1131 (1141), inverter buffers 1134, 1135, 1139 (1144,
1145, 1149), 2-input NAND gate 1138
(1148). In addition, 1011 (1
012) is a 40-bit data latch, and the 1-bit latch 1110 (1120) is the inverter buffer 1111, 1112, 1113 (1121, 1122,
1123) and transfer gates 1114, 111
5 (1124, 1125).

【0034】また図7は図5に示すC素子を用いた一般
的なデータ処理装置の構成を示しており、図において、
図5と同一符号は同一のものを示す。図において、11
01はメモリ、1102は組合せ論理回路である。
FIG. 7 shows the configuration of a general data processing device using the C element shown in FIG.
The same reference numerals as in FIG. 5 indicate the same parts. In the figure, 11
01 is a memory, and 1102 is a combinational logic circuit.

【0035】また、上記実施例では、1ビットの条件コ
ードを出力しているが、テスト・アンド・ロック命令が
不成功に終わった場合に、条件コードによって上記「ロ
ック不可能状態1」によるものであるか、「ロック不可
能状態2」によるものであるかを識別するために条件コ
ードを複数ビットとしてもよい。
Further, in the above embodiment, a 1-bit condition code is output, but if the test and lock instruction ends in failure, the condition code indicates that the condition is caused by the above-mentioned "unlockable state 1". The condition code may be made of multiple bits in order to identify whether the condition is due to the lock condition or the “unlockable state 2”.

【0036】また、上記実施例では、データ記憶装置が
外部メモリであるか、内部メモリであるか、レジスタで
あるかについては明示していないが、本発明がこれらの
何れの記憶装置に対しても適用可能であることはいうま
でもない。
Furthermore, in the above embodiments, it is not specified whether the data storage device is an external memory, an internal memory, or a register, but the present invention applies to any of these storage devices. Needless to say, it is also applicable.

【0037】また、上記実施例では、1ビットの比較を
行うテスト・アンド・セット命令のみについて説明した
が、複数ビットの比較を伴うコンペア・アンド・セット
命令のように複合命令の実行の一貫性を保証しなければ
ならない場合に広く適用可能である。
Furthermore, in the above embodiment, only the test-and-set instruction that compares one bit has been explained, but consistency in execution of compound instructions such as the compare-and-set instruction that involves comparison of multiple bits is important. It is widely applicable in cases where the

【0038】[0038]

【発明の効果】以上述べたように、本発明に係るマイク
ロプロセッサにおいては、データ記憶部に、該データ記
憶部がロック状態であるか否かを記憶するフリップフロ
ップを設け、ロック状態においては新たにロックを要求
する命令の実行を遅延させるようにしたので、テスト・
アンド・セットの命令のように、処理に要するクロック
サイクル数が多く、かつ処理の一貫性(他のプロセスの
影響を受けず、常に正しい結果を出力する)を保証する
必要のある命令を複数の単純な命令に分割して実行する
ことができ、パイプライン実行効率を向上させることが
できる。
As described above, in the microprocessor according to the present invention, the data storage section is provided with a flip-flop for storing whether or not the data storage section is in the locked state, and when the data storage section is in the locked state, a new Since the execution of instructions that request a lock is delayed, the test
Multiple instructions, such as AND and set instructions, that require a large number of clock cycles to process and that must guarantee processing consistency (always outputting the correct result without being affected by other processes) It can be divided into simple instructions and executed, improving pipeline execution efficiency.

【0039】また、分割された命令の実行中は、データ
記憶部はロック状態となっているが、他のプロセスに属
する命令の実行を混合して行うことは可能であり、プロ
セス間で共有されている資源を使用し分割された命令実
行の一貫性を乱す命令の実行のみが自動的に遅延される
ので、特段の制御なしに排他的実行部分を含むマルチプ
ロセスの並列実行を実現することができ、今後並列処理
分野において、共有資源の排他的な使用を実現するにあ
たって有効な技術を提供できる効果がある。
Furthermore, while the divided instructions are being executed, the data storage unit is in a locked state, but it is possible to mix the execution of instructions belonging to other processes, and the data storage unit is shared between processes. Since only the execution of instructions that disturb the consistency of the divided instruction execution using resources is automatically delayed, it is possible to realize parallel execution of multi-processes including exclusive execution parts without special control. This will have the effect of providing an effective technique for realizing exclusive use of shared resources in the parallel processing field in the future.

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

【図1】本発明に係るマイクロプロセッサのデータ記憶
部の一構成例を示すブロック図である。
FIG. 1 is a block diagram showing an example of the configuration of a data storage section of a microprocessor according to the present invention.

【図2】テスト・アンド・セットを、テスト・アンド・
ロック命令、セット・アンド・アンロック命令、比較命
令、メモリ書き込み命令に分割して実行する場合のフロ
ーチャート図である。
[Figure 2] Test and set, test and set
FIG. 12 is a flowchart when a lock instruction, a set-and-unlock instruction, a comparison instruction, and a memory write instruction are divided and executed.

【図3】図1の構成のデータ記憶部において、入力デー
タを保存して出力する経路を付加したデータ記憶部の一
構成例を示すブロック図である。
FIG. 3 is a block diagram illustrating an example of the configuration of the data storage unit having the configuration shown in FIG. 1, in which a path for storing and outputting input data is added.

【図4】図1の構成のデータ記憶部において、入出力ラ
ッチの制御信号としてクロック信号φではなく、ハンド
シェイク制御回路(C素子)の出力を用いた例を示す図
である。
4 is a diagram showing an example in which the output of a handshake control circuit (C element) is used as a control signal for an input/output latch instead of a clock signal φ in the data storage section having the configuration shown in FIG. 1;

【図5】C素子の回路構成例及び、C素子を用いたデー
タラッチ制御を示す論理回路図である。
FIG. 5 is a logic circuit diagram showing an example of a circuit configuration of a C element and data latch control using the C element.

【図6】本発明を適用可能なデータ駆動形マイクロプロ
セッサの一構成例を示すブロック図である。
FIG. 6 is a block diagram showing a configuration example of a data-driven microprocessor to which the present invention can be applied.

【図7】図5に示すC素子を用いた一般的なデータ処理
装置の構成を示すブロック図である。
7 is a block diagram showing the configuration of a general data processing device using the C element shown in FIG. 5. FIG.

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

100    入力ラッチ 101    制御ビットラッチ部 102    アドレスラッチ部 103    入力データラッチ部 200    メモリ部 300    出力ラッチ部 301    条件コードラッチ部 302    出力データラッチ部 303    ロック状態ラッチ部 401    NANDゲート 402    ANDゲート 403    セット・リセット・フリップフロップ4
04    インバータ 405    ANDゲート 406    インバータ 407    NORゲート 408    インバータ 409    出力トライステート制御付きのデータバ
ッファ 410    インバータ 500    C素子 501    C素子
100 Input latch 101 Control bit latch section 102 Address latch section 103 Input data latch section 200 Memory section 300 Output latch section 301 Condition code latch section 302 Output data latch section 303 Lock state latch section 401 NAND gate 402 AND gate 403 Set/reset/ flip flop 4
04 Inverter 405 AND gate 406 Inverter 407 NOR gate 408 Inverter 409 Data buffer with output tristate control 410 Inverter 500 C element 501 C element

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】  アドレス指定型の第1の記憶手段と、
該第1の記憶手段の状態を記憶する第2の記憶手段と、
該第1の記憶手段に対するアドレスを伴った第1の命令
に呼応して当該アドレスに格納されているデータの値が
第1の状態であるとき上記第2の記憶手段の状態を第2
の状態に設定し、上記第1の記憶手段に対するアドレス
を伴った第2の命令に呼応して当該アドレスに格納され
ているデータの値を第2の状態に設定するとともに上記
第2の記憶手段の状態を第1の状態に設定し、上記第1
の記憶手段に対するアドレスとデータを伴った書き込み
命令に呼応して当該データを当該アドレスに書き込むべ
く制御する制御手段とを有するデータ記憶部を備えたこ
とを特徴とするマイクロプロセッサ。
Claim 1: Addressable first storage means;
a second storage means for storing the state of the first storage means;
In response to a first instruction accompanied by an address for the first storage means, when the value of data stored at the address is in the first state, the state of the second storage means is changed to a second state.
, and in response to a second instruction accompanied by an address for the first storage means, sets the value of the data stored at the address to the second state, and the second storage means set the state to the first state, and set the state to the first state.
1. A microprocessor comprising: a data storage section having an address for the storage means; and control means for controlling the writing of data to the address in response to a write command accompanied by data.
JP1395991A 1991-01-09 1991-01-09 Microprocessor Expired - Lifetime JP2968060B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP1395991A JP2968060B2 (en) 1991-01-09 1991-01-09 Microprocessor
US07/819,164 US5404553A (en) 1991-01-09 1992-01-02 Microprocessor and data flow microprocessor having vector operation function
US08/330,880 US5666535A (en) 1991-01-09 1994-10-28 Microprocessor and data flow microprocessor having vector operation function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1395991A JP2968060B2 (en) 1991-01-09 1991-01-09 Microprocessor

Publications (2)

Publication Number Publication Date
JPH04235636A true JPH04235636A (en) 1992-08-24
JP2968060B2 JP2968060B2 (en) 1999-10-25

Family

ID=11847753

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1395991A Expired - Lifetime JP2968060B2 (en) 1991-01-09 1991-01-09 Microprocessor

Country Status (1)

Country Link
JP (1) JP2968060B2 (en)

Also Published As

Publication number Publication date
JP2968060B2 (en) 1999-10-25

Similar Documents

Publication Publication Date Title
US3728692A (en) Instruction selection in a two-program counter instruction unit
EP0399762B1 (en) Multiple instruction issue computer architecture
JP2810068B2 (en) Processor system, computer system, and instruction processing method
US5404552A (en) Pipeline risc processing unit with improved efficiency when handling data dependency
US4621318A (en) Multiprocessor system having mutual exclusion control function
JP4759273B2 (en) Data processing apparatus and shared resource access control method
US4484274A (en) Computer system with improved process switch routine
US5832258A (en) Digital signal processor and associated method for conditional data operation with no condition code update
EP0535820A2 (en) Method and apparatus for a register providing atomic access to set and clear individual bits of shared registers without software interlock
JPH04309131A (en) Microcode generating apparatus for instruction group and combining apparatus in computer
US5041968A (en) Reduced instruction set computer (RISC) type microprocessor executing instruction functions indicating data location for arithmetic operations and result location
US4348720A (en) Microcomputer arranged for direct memory access
US5761467A (en) System for committing execution results when branch conditions coincide with predetermined commit conditions specified in the instruction field
KR100210205B1 (en) Apparatus and method for providing a stall cache
JPH02227730A (en) Data processing system
US20070260857A1 (en) Electronic Circuit
JPH0511977A (en) Data transfer method between registers in micro computer
JPH05342084A (en) Device and method for storing data
JPH04127237A (en) Control system for delay branch instruction
JPS6112288B2 (en)
JPH08221273A (en) Controlling method for parallel processing of instruction level and processor
US5761492A (en) Method and apparatus for uniform and efficient handling of multiple precise events in a processor by including event commands in the instruction set
JP2968060B2 (en) Microprocessor
EP0284327B1 (en) Shared micro-ram with micro-rom linking
US5058007A (en) Next microinstruction generator in a microprogram control unit

Legal Events

Date Code Title Description
S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080820

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080820

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090820

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100820

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110820

Year of fee payment: 12