JPS61288243A - Processing system for compare and swap instruction - Google Patents

Processing system for compare and swap instruction

Info

Publication number
JPS61288243A
JPS61288243A JP13101785A JP13101785A JPS61288243A JP S61288243 A JPS61288243 A JP S61288243A JP 13101785 A JP13101785 A JP 13101785A JP 13101785 A JP13101785 A JP 13101785A JP S61288243 A JPS61288243 A JP S61288243A
Authority
JP
Japan
Prior art keywords
memory
circuit
data
read
compare
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
JP13101785A
Other languages
Japanese (ja)
Inventor
Takuya Sugiura
卓也 杉浦
Toshihiro Sakai
酒井 利弘
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP13101785A priority Critical patent/JPS61288243A/en
Publication of JPS61288243A publication Critical patent/JPS61288243A/en
Pending legal-status Critical Current

Links

Landscapes

  • Detection And Correction Of Errors (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

PURPOSE:To shorten the instruction execution time and to simplify a control circuit by providing an ECC circuit in a CPU and using the read modify write function of the ECC circuit to execute a compare and swap function in hardware. CONSTITUTION:Data is read out from a memory 20 and is set to a latch 10A. If an error exists in this data, it is corrected by a read data correcting circuit 10B; but otherwise, data is compared with data in a register REG(A) 27 by a comparing circuit 26 as it is. If this comparison results in coincidence, the contents of a register REG(B) are written in the memory 20 through a multiplexer MPX 30 and an aligner 10C. If the comparison does not result in coincidence, the data read from the memory 20 is written in the memory 20 through the latch 10A, the read data correcting circuit 10B, and the aligner 10C and is set to the register REG(A) 27.

Description

【発明の詳細な説明】 〔概要〕 メモリへのアクセス手段、例えばCPUにECC回路(
Error Checking And Correc
Lion)を設け、アクセス手段からメモリへアクセス
するコンペアアンドスワップ命令(以下、C8命令と略
称する)となったとき、ECC回路のリードモディファ
イライ) (RMW)機能を用いて前記CS命令の機能
を実現する。この技法により、CS命令の処理時間の短
縮化、メモリの使用効率の向上、制御回路の簡易化を達
成する。
[Detailed Description of the Invention] [Summary] Memory access means, for example, an ECC circuit (
Error Checking and Correcting
When a compare-and-swap instruction (hereinafter abbreviated as C8 instruction) accesses the memory from the access means, the read modify write (RMW) function of the ECC circuit is used to modify the function of the CS instruction. Realize. With this technique, it is possible to shorten the processing time of CS instructions, improve memory usage efficiency, and simplify the control circuit.

〔産業上の利用分野〕[Industrial application field]

本発明はコンペアアンドスワップ方式に関し、更に詳し
く言えば、従来ソフト的処理によって遂行していたコン
ペアアンドスワップ機能をハード的に遂行し得るように
したコンベアアンドスワンプ命令処理方式に関する。
The present invention relates to a compare-and-swap method, and more specifically, to a conveyor-and-swamp instruction processing method in which the compare-and-swap function, which was conventionally performed by software processing, can be performed by hardware.

電子計算機等のプログラム貯蔵形ディジタル処理装置は
そこへ予め与えられたプログラムの各命令を順次に実行
することによって、その装置に所望の処理を行なう□よ
うに構成されている。このようにプログラムは予め順序
立てられて組み合わされた一連の命令群から成るが、そ
の1つ1つの命令を実行する時間が短いことが装置性能
を決める大きな要素となるから、命令実行時間の短縮化
が望まれることになる。
A program storage type digital processing device such as an electronic computer is configured to perform desired processing by sequentially executing each command of a program given to the device in advance. In this way, a program consists of a series of instructions that have been ordered and combined in advance, and the short time it takes to execute each instruction is a major factor that determines device performance. It is hoped that this will become a reality.

又、上述のような命令の実行を行なうハードウェア乃至
ファームウェア形式の構成如何によってそのハード的難
易が生じ、これが又命令実行時間を左右するようになる
Further, the hardware difficulty arises depending on the configuration of the hardware or firmware format for executing the above-mentioned instructions, and this also influences the instruction execution time.

従って、命令の実行形態としては、その実行時間の短縮
化を図りつつそのハードウェア乃至ファームウェア形式
の簡易化が求められる。
Therefore, it is necessary to shorten the execution time and simplify the hardware or firmware format of the instructions.

〔従来の技術〕 従来のディジタル計算機等には各種の命令が用意されて
いる。それら命令のうちにはコンペアアンドスワップ命
令(C3命令)がある。この命令は第5図の命令処理フ
ローに示す如き処理を行なうものである。即ち、第6図
のタイミングチャートに示すように、この命令がメモリ
をアクセスしている間、Lock信号を発生して他のア
クセスユニットによるメモリへのアクセスを禁止しつつ
メモリよりデータを読み出し■、その読み出し内容Sと
レジスタREG (A)の内容とを比較し■、その比較
結果に従ってつまりYesの場合にはレジスタREG 
(B)の内容をメモリに書き込むがN。
[Prior Art] Conventional digital computers and the like are provided with various instructions. Among these instructions is a compare and swap instruction (C3 instruction). This command performs processing as shown in the command processing flow of FIG. That is, as shown in the timing chart of FIG. 6, while this instruction is accessing the memory, a Lock signal is generated and data is read from the memory while prohibiting other access units from accessing the memory. The read content S is compared with the content of the register REG (A), and according to the comparison result, if Yes, the register REG
Write the contents of (B) to memory, but N.

ならば読み出し内容SをレジスタREG (A)にセッ
トする■如き処理を行なう。
If so, a process such as (2) is performed in which the read content S is set in the register REG (A).

〔発明が解決しようとする問題点〕[Problem that the invention seeks to solve]

上述のように、C8命令の実行においては順次の3つの
ステップを要するため時間がかかる上、その時間の間他
のアクセスユニットによるアクセスはできず、待機又は
その他の処理を強いられる結果となり、性能低下となる
。又、上述のようなLock信号を発生しなければなら
ないから、その制御回路も複雑化せざるを得ない。
As mentioned above, executing the C8 instruction requires three steps in sequence, which takes time, and during that time, other access units cannot access it, forcing them to wait or perform other processing, which reduces performance. This will result in a decrease. Furthermore, since the above-mentioned Lock signal must be generated, the control circuit must also become complicated.

本発明は上述のような問題点に鑑みて創作されたもので
、命令実行時間を短縮化し得て制御回路の簡易化に寄与
するコンペアアンドスワップ命令処理方式を提供するこ
とをその目的とする。
The present invention was created in view of the above-mentioned problems, and an object of the present invention is to provide a compare-and-swap instruction processing method that can shorten instruction execution time and contribute to simplifying a control circuit.

〔問題点を解決するための手段〕[Means for solving problems]

第1図は本発明の原理ブロック図を示す。この図におい
て、lはメモリへのアクセス手段を有するシステムのア
クセス手段に設けられるECC回路で、この回路はリー
ドモディファイライト機能を有する。2はECC回路の
出力に接続されてセットされる内容を比較回路3に送る
第1のレジスタである。4はアクセス手段に接続されて
セットされる内容をECCCC回路縁してメモリへ送る
第2のレジスタである。5はメモリへのアクセスがコン
ペアアンドスワップ命令C3MDによって行なわれてお
り比較回路3からの出力があったことをECC回路1へ
示ずアンドゲートである。6゜7は比較回路3からは出
力がなかったが、メモリへのアクセスがコンペアアンド
スワップ命令C8MDによって行なわれていることをE
CC回路1へ示すインバータ、アンドゲートから成る回
路である。
FIG. 1 shows a block diagram of the principle of the present invention. In this figure, l is an ECC circuit provided in the access means of a system having memory access means, and this circuit has a read-modify-write function. A first register 2 is connected to the output of the ECC circuit and sends the set contents to the comparator circuit 3. A second register 4 is connected to the access means and sends the set contents to the memory via the ECCCC circuit. 5 is an AND gate that does not indicate to the ECC circuit 1 that the memory has been accessed by the compare and swap instruction C3MD and that there has been an output from the comparison circuit 3. Although there was no output from comparator circuit 3 at 6°7, E indicates that memory access is being performed by the compare and swap instruction C8MD.
This circuit consists of an inverter and an AND gate shown to the CC circuit 1.

〔作用〕[Effect]

アクセス手段によるメモリへのアクセスがコンペアアン
ドスワップ命令である場合に、比較回路3から出力があ
るつまりメモリから読み出された内容と第1のレジスタ
(REG (A))2の内容とが一致していると、その
ことを示す信号がECC回路1に与えられてこの信号の
制御の下に第2のレジスタ(REG (B))4の内容
がECCCC回路縁てメモリへ書き込まれる。
When the access to the memory by the access means is a compare-and-swap instruction, there is an output from the comparator circuit 3, that is, the contents read from the memory match the contents of the first register (REG (A)) 2. If so, a signal indicating this is given to the ECC circuit 1, and under the control of this signal, the contents of the second register (REG (B)) 4 are written to the memory by the ECCCC circuit.

コンペアアンドスワップ命令によるアクセスが生じてい
るが、比較回路3から出力が生じていない場合には、メ
モリから読み出された内容をECC回路1を介して第1
のレジスタ2及びメモリに書き込む。
If an access is occurring by a compare and swap instruction, but no output is generated from the comparison circuit 3, the contents read from the memory are transferred to the first memory via the ECC circuit 1.
Write to register 2 and memory of.

このように、従来のCS命令処理の如く段階を追って順
次に行なうのではなくハード的遅れのみを許容して一挙
的に行なうので、その処理を極めて短い時間内に行ない
得る。又、そのために従来の如きLock信号は必要と
しないから、制御回路の簡易化ともなる。
In this way, unlike the conventional CS instruction processing, the processing is not performed step by step, but is performed all at once, allowing only hardware delays, so that the processing can be performed within an extremely short period of time. Further, since the conventional lock signal is not required for this purpose, the control circuit can be simplified.

〔実施例〕〔Example〕

第2図は本発明の一実施例を示し、この実施例はアドレ
スバス、データバスを共通にしてリードモディファイラ
イト機能を構成しているECC回路10を利用した場合
のコンペアアンドスワップ方式を示す。ECC回路(1
0)は公知の形式のもので、ラッチ10A、読み出しデ
ータ訂正回路10B、アライナ10C,チェックピット
生成回路10Dから成る。ラッチIOAはドライバ21
を介してメモリ (SS)20へ接続されると共に、ア
ライナ10C及びチェックビット生成回路10Dはドラ
イバ22を介してメモリ20へ接続される。読み出しデ
ータ訂正回路10Bはドライバ23、バス24を介して
CPU25へ接続される。
FIG. 2 shows an embodiment of the present invention, and this embodiment shows a compare-and-swap method using an ECC circuit 10 that uses a common address bus and data bus to perform a read-modify-write function. ECC circuit (1
0) is of a known type and consists of a latch 10A, a read data correction circuit 10B, an aligner 10C, and a check pit generation circuit 10D. Latch IOA is driver 21
The aligner 10C and check bit generation circuit 10D are connected to the memory 20 via a driver 22. The read data correction circuit 10B is connected to the CPU 25 via a driver 23 and a bus 24.

バス24には、又比較回路26の一方の入力が接続され
、比較回路26の他方の入力は制御信号RGAWEの制
御の下にバス24に接続されるレジスタREG (A)
27の出力に接続される。又、バス24には制御信号R
GBWEの制御の下にレジスタREG (B)2Bが接
続され、その出力はバス24に接続されるドライバ29
の出力と共にマルチプレクサ30を介してアライナIO
Cへ接続される。アライナ10Cへの制御信号5ELE
CTI、5ELECT2、マルチプレクサ30への制御
信号5ELECT2、及び制御信号RGAWE、RGB
WEは第3図に示される回路から発生される。
Also connected to the bus 24 is one input of a comparison circuit 26, and the other input of the comparison circuit 26 is a register REG (A) connected to the bus 24 under the control of a control signal RGAWE.
27 output. The bus 24 also receives a control signal R.
A register REG (B) 2B is connected under the control of GBWE, and its output is connected to a driver 29 which is connected to the bus 24.
aligner IO via multiplexer 30 along with the output of
Connected to C. Control signal 5ELE to aligner 10C
CTI, 5ELECT2, control signal 5ELECT2 to multiplexer 30, and control signals RGAWE, RGB
WE is generated from the circuit shown in FIG.

第3図におけるCSMDはメモリ22へのアクセスがコ
ンペアアンドスワップ命令によって行なわれていること
を示す信号、EQAULは比較回路26からの一致出力
信号、*EQUALは比較回路26からの不一致出力信
号、RGASLはREG (A)選択信号、RGBSL
はREG (B)選択信号、RASG (REG  A
CCESS  5TAGE)信号はこの信号の間にRE
Gのリード。
In FIG. 3, CSMD is a signal indicating that access to the memory 22 is performed by a compare and swap instruction, EQAUL is a match output signal from the comparison circuit 26, *EQUAL is a mismatch output signal from the comparison circuit 26, RGASL is REG (A) selection signal, RGBSL
is REG (B) selection signal, RASG (REG A
CCESS 5TAGE) signal is
G's lead.

ライトを行ない、5TG5信号は第4図に示すリードモ
ディファイライト制御態様(アドレスバス。
Write is performed, and the 5TG5 signal is a read-modify-write control mode (address bus) shown in FIG.

データバスを共通にしたリードモディファイライト制御
態様)でのステージ5TG5を示す信号、CLKはクロ
ック信号である。
A signal CLK indicating stage 5TG5 in a read-modify-write control mode in which the data bus is shared is a clock signal.

上述のような構成の下におけるコンペアアンドスワップ
方式の動作態様を以下に説明する。説明の便宜上、アド
レスバス、データバスを共通にした場合のリードモディ
ファイライトの場合を例にとる。
The operation of the compare-and-swap method under the above configuration will be described below. For convenience of explanation, we will take as an example the case of read-modify-write when the address bus and data bus are shared.

リードモディファイライトの期間中のステージ5TGI
、5TG2の間にアドレスα(第4図参照)がメモリ2
0に供給されてそのアドレスαに対応するデータβ(第
2図のA点)がステージ5TG3に読み出され、そのス
テージ5TG3の後半にラッチIOAのイネーブル信号
が有効にされてランチIOAにセットされる。そして、
そのデータにエラーがなければそのデータがUeみ出し
データ訂正回路10’B、  ドライバ23を介して第
2図のB点に現れるが、データに1ビツトエラーがあれ
ばそれが読み出しデータ訂正回路10Bにて訂正されて
第2図のB点に現れる。そのB点のデータがレジスタR
EG (A)27のデータと比較回路26においてリー
ドモディファイライト期間のステージ5TG4で比較さ
れる。
Stage 5 TGI during Read Modify Write
, 5TG2, address α (see Figure 4) is stored in memory 2.
The data β (point A in FIG. 2) corresponding to the address α is read out to the stage 5TG3, and in the latter half of the stage 5TG3, the enable signal of the latch IOA is enabled and set to the launch IOA. Ru. and,
If there is no error in the data, the data will appear at point B in FIG. 2 via the Ue read data correction circuit 10'B and the driver 23, but if the data has a 1-bit error, it will be sent to the read data correction circuit 10B. It is corrected and appears at point B in Figure 2. The data at point B is in register R.
It is compared with the data of EG (A) 27 in the comparison circuit 26 at stage 5TG4 of the read-modify-write period.

その比較結果が一致している即ち双方が同じであるなら
ば、第3図のアンドゲート50から信号5ELECT2
が発生され、これにより、第2図のレジスタREG (
B)の内容がマルチプレクサ(MPX30)、そしてア
ライナIOCでモディファイされ、そのデータがライト
データ(第4図のγ)としてリードモディファイライト
期間中のステージ5TG5でメモリ20に書き込まれる
If the comparison results match, that is, both are the same, a signal 5ELECT2 is output from the AND gate 50 in FIG.
is generated, which causes the register REG (
The contents of B) are modified by the multiplexer (MPX30) and the aligner IOC, and the data is written to the memory 20 as write data (γ in FIG. 4) at stage 5TG5 during the read-modify-write period.

逆に、比較結果が一致していないならば、メモリ20か
ら読み出されたデータすべてがラッチ10A、読み出し
データ訂正回路10Bを経て、制御信号5ELECTI
  (第3図のアンドゲート51から発生)によって制
御されるアライナ10Cで選択されてドライバ22を介
してメモリ20に書き込まれると共に、第3図のアンド
ゲート52から信号RGAWEが発生され、この信号に
よって読み出されたデータすべてがレジスタ(REG(
A))27にセットされる。
Conversely, if the comparison results do not match, all the data read from the memory 20 passes through the latch 10A and the read data correction circuit 10B, and is output to the control signal 5ELECTI.
(generated from the AND gate 51 in FIG. 3) is selected by the aligner 10C and written into the memory 20 via the driver 22, and the signal RGAWE is generated from the AND gate 52 in FIG. All read data is stored in the register (REG(
A)) is set to 27.

なお、上記実施例はアクセス手段をCPUとする場合に
ついて説明したが、アクセス手段は他の手段例えばIl
oであってもよい。
Note that although the above embodiment has been described with reference to the case where the access means is the CPU, the access means may be other means such as Il.
It may be o.

〔発明の効果〕〔Effect of the invention〕

以上説明したように、本発明によれば従来のC8命令処
理の如く処理ステップ数が多くないから、その処理時間
を短縮化し得るし、制御回路も簡易化し得る。
As described above, according to the present invention, since the number of processing steps is not as large as in conventional C8 instruction processing, the processing time can be shortened and the control circuit can also be simplified.

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

第1図は本発明の原理ブロック図、 第2図は本発明の一実施例を示す図、 第3図は制御信号発生回路、 第4図はリードモディファイライトのタイミング例を示
す図、 第5図は従来のコンペアアンドスワップ命令の処理フロ
ーを示す図、 第6図は従来のコンペアアンドスワップ命令のタイミン
グチャートである。 第1図において、 1はECC回路、 2.4はレジスタ、 3は比較回路、 5.7はアンドゲート、 6はインバータである。 本奮明の屑U里ブロック図 第1図 第3図 リードモチにファイライトのタイミングf列第 4図 第5図 1のC3Qffのタイミングチャート 第6図
FIG. 1 is a block diagram of the principle of the present invention. FIG. 2 is a diagram showing an embodiment of the present invention. FIG. 3 is a control signal generation circuit. FIG. 4 is a diagram showing an example of read-modify-write timing. The figure shows a processing flow of a conventional compare and swap instruction, and FIG. 6 is a timing chart of a conventional compare and swap instruction. In FIG. 1, 1 is an ECC circuit, 2.4 is a register, 3 is a comparison circuit, 5.7 is an AND gate, and 6 is an inverter. Fig. 1 Fig. 3 Fig. 3 Timing of phyrite on lead mochi f column Fig. 4 Fig. 5 Timing chart of C3Qff of 1 Fig. 6

Claims (1)

【特許請求の範囲】[Claims] メモリをアクセスする複数のアクセスユニットの各々に
ECC回路を備えたデータ処理システムにおいて、前記
メモリから読み出したデータの一部の誤りを正しい値の
データに置き換え前記メモリに書くという一連のデータ
処理を一回のアクセスで実現可能な機能を有するECC
回路(1)と、第1及び第2のレジスタ(2)、(4)
と、前記ECC回路を経た前記メモリの内容と前記第1
のレジスタの内容とを比較する比較回路(3)とを設け
、前記メモリへのアクセスがコンペアアンドスワップ命
令であり前記比較回路から出力信号があるとき前記EC
C回路を介して前記第2のレジスタの内容を前記メモリ
へ書き込み、前記メモリへのアクセスがコンペアアンド
スワップ命令であり且つ前記比較回路から出力信号がな
いとき前記メモリから読み出された内容を前記ECC回
路を介して前記第1のレジスタ及び前記メモリに書き込
むことを特徴とするコンペアアンドスワップ命令処理方
式。
In a data processing system in which each of a plurality of access units that access memory is provided with an ECC circuit, a series of data processing in which errors in part of data read from the memory are replaced with data of correct value and written to the memory is performed. ECC with functions that can be achieved with one access
Circuit (1) and first and second registers (2) and (4)
and the contents of the memory that have passed through the ECC circuit and the first
a comparison circuit (3) that compares the contents of the register with the contents of the register, and when the access to the memory is a compare and swap instruction and there is an output signal from the comparison circuit, the EC
The contents of the second register are written to the memory through a C circuit, and when the memory is accessed by a compare-and-swap instruction and there is no output signal from the comparison circuit, the contents read from the memory are written to the memory. A compare-and-swap instruction processing method characterized by writing to the first register and the memory via an ECC circuit.
JP13101785A 1985-06-17 1985-06-17 Processing system for compare and swap instruction Pending JPS61288243A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP13101785A JPS61288243A (en) 1985-06-17 1985-06-17 Processing system for compare and swap instruction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP13101785A JPS61288243A (en) 1985-06-17 1985-06-17 Processing system for compare and swap instruction

Publications (1)

Publication Number Publication Date
JPS61288243A true JPS61288243A (en) 1986-12-18

Family

ID=15048044

Family Applications (1)

Application Number Title Priority Date Filing Date
JP13101785A Pending JPS61288243A (en) 1985-06-17 1985-06-17 Processing system for compare and swap instruction

Country Status (1)

Country Link
JP (1) JPS61288243A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5708800A (en) * 1994-09-27 1998-01-13 Mitsubishi Denki Kabushiki Kaisha High speed microprocessor for processing and transferring N-bits of M-bit data
CN105094749A (en) * 2009-12-22 2015-11-25 英特尔公司 Synchronizing simd vectors

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5708800A (en) * 1994-09-27 1998-01-13 Mitsubishi Denki Kabushiki Kaisha High speed microprocessor for processing and transferring N-bits of M-bit data
CN105094749A (en) * 2009-12-22 2015-11-25 英特尔公司 Synchronizing simd vectors

Similar Documents

Publication Publication Date Title
US7206891B2 (en) Multi-port memory controller having independent ECC encoders
US5377338A (en) Apparatus and methods for reducing numbers of read-modify-write cycles to a memory, and for improving DMA efficiency
EP3640944A1 (en) Non-sequential page continuous read
US20080034132A1 (en) Memory interface for controlling burst memory access, and method for controlling the same
US6874117B2 (en) Memory control device and method
JPS61288243A (en) Processing system for compare and swap instruction
US5274786A (en) Microprocessor memory bus interface for inhibiting relatching of row address portions upon subsequent accesses including a same row address portion
JPS60214043A (en) Pipeline control circuit
JP2587468B2 (en) Lock data setting device
JPS5834856B2 (en) Kiokuseigiyosouchi
JPH10312307A (en) Emulator for computer system
CN113836050A (en) Memory access control method, device, equipment and readable storage medium
JP2659886B2 (en) Processor system
JP2716284B2 (en) Semiconductor integrated circuit
JPH08314797A (en) Memory access system
JPH01297746A (en) Memory diagnosing system
JPH0474254A (en) Microprocessor diagnostic system
JPH0332823B2 (en)
JPH04245346A (en) Microcomputer system
JPH01166144A (en) Debugging system for firmware program
JPS60118961A (en) Common area access control system of memory
JPH06259334A (en) Memory write data check system
JPS61294556A (en) Detection system for program malfunction
JPH03116353A (en) Personal computer
JPS59211149A (en) Comparison stopping system