Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JPH0746350B2 - Vector calculator - Google Patents
[go: Go Back, main page]

JPH0746350B2 - Vector calculator - Google Patents

Vector calculator

Info

Publication number
JPH0746350B2
JPH0746350B2 JP63030877A JP3087788A JPH0746350B2 JP H0746350 B2 JPH0746350 B2 JP H0746350B2 JP 63030877 A JP63030877 A JP 63030877A JP 3087788 A JP3087788 A JP 3087788A JP H0746350 B2 JPH0746350 B2 JP H0746350B2
Authority
JP
Japan
Prior art keywords
memory
data
read
address
pipeline
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 - Lifetime
Application number
JP63030877A
Other languages
Japanese (ja)
Other versions
JPH01206462A (en
Inventor
俊彦 真鍋
智 橋本
Original Assignee
工業技術院長
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 工業技術院長 filed Critical 工業技術院長
Priority to JP63030877A priority Critical patent/JPH0746350B2/en
Publication of JPH01206462A publication Critical patent/JPH01206462A/en
Publication of JPH0746350B2 publication Critical patent/JPH0746350B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Complex Calculations (AREA)

Description

【発明の詳細な説明】 [発明の目的] (産業上の利用分野) 本発明は、例えば科学技術計算等の高速処理を行なうべ
くパイプライン方式によるベクトル処理を行なうベクト
ル計算機に関する。
DETAILED DESCRIPTION OF THE INVENTION [Object of the Invention] (Field of Industrial Application) The present invention relates to a vector computer that performs vector processing by a pipeline system to perform high-speed processing such as scientific and technological calculation.

(従来の技術) メモリ上に規則的に配置されたベクトルデータに対し、
同一演算を繰返し実行させる演算をベクトル演算と呼
ぶ。Fortranを例にとると、第6図(a)に示すよう
に、ベクトルA,B,CにおけるBとCをオペランドとして
演算を行ない、その結果をディスティネーションAに代
入し、これをDOループによって添字Iを順次変化させな
がら繰返し行なうような演算がベクトル演算である。
(Prior Art) For vector data regularly arranged in memory,
An operation for repeatedly executing the same operation is called a vector operation. Taking Fortran as an example, as shown in Fig. 6 (a), B and C in the vectors A, B, and C are used as operands, the result is assigned to destination A, and this is assigned by the DO loop. A vector operation is an operation that is repeatedly performed while sequentially changing the subscript I.

このベクトル演算の高速化の手法として従来よりパイプ
ライン方式が知られている。このパイプライン方式によ
れば、第6図(a)の演算は、同図(b)のように行わ
れる。なお、この図は、パイプラインの段数をn=3に
設定した場合の例を示している。先ず、サイクル1でB
(1),C(1)でリード要求を出してオペランドを参照
し、演算を開始する。次のサイクル2では、サイクル1
で始まった演算の結果を待たずにB(2),C(2)を参
照し演算を始める。サイクル3では、サイクル1で開始
された演算の結果A(1)が求まるので、この結果を書
込むと同時にB(3),C(3)の参照を行ない演算を始
める。以後、同様にサイクルi+2ではサイクルiから
開始された演算の結果のA(i)が求まると同時にB
(i+2),C(i+2)による演算を始める。
A pipeline method has been conventionally known as a method for speeding up this vector operation. According to this pipeline method, the operation of FIG. 6 (a) is performed as shown in FIG. 6 (b). This figure shows an example in which the number of pipeline stages is set to n = 3. First, B in cycle 1
(1), C (1) issues a read request, refers to the operand, and starts the operation. Next cycle 2, cycle 1
The calculation is started by referring to B (2) and C (2) without waiting for the result of the calculation started at. In cycle 3, since the result A (1) of the operation started in cycle 1 is obtained, the operation is started by writing this result and referring to B (3) and C (3) at the same time. Thereafter, similarly, in cycle i + 2, A (i) as the result of the operation started from cycle i is obtained and at the same time B
The calculation by (i + 2), C (i + 2) is started.

このように、繰返しによる演算を一つの演算の結果を待
たずに連続的に処理するベクトル化処理では、上記の例
のように演算の2サイクルを要する場合でも、最初の演
算結果A(1)が求まるまでに2サイクルの遅れはある
ものの、それ以後は演算結果が毎サイクル求まるという
利点がある。
In this way, in the vectorization process in which the iterative operation is continuously processed without waiting for the result of one operation, even if two operation cycles are required as in the above example, the first operation result A (1) Although there is a delay of 2 cycles before the calculation of, there is an advantage that the calculation result is calculated every cycle thereafter.

また、例えば第7図(a)に示すように、オペランド
(A(1))とディスティネーション(A(I+3))
のベクトルが同じである回帰的データ参照の場合も、デ
ィスティネーションのベクトルAの添字とオペランドの
ベクトルAの添字との差(3)がパイプラインの段数n
(=3)以上であれば、第7図(b)に示すように、サ
イクル1で開始されたA(1)+C(1)なる演算の結
果A(4)がサイクル3で終了するので、サイクル4で
はA(4),C(4)を参照可能である。したがって、こ
の演算はベクトル化することができる。
Further, as shown in FIG. 7A, for example, the operand (A (1)) and the destination (A (I + 3))
In the case of recursive data reference in which the vectors of the same are the same, the difference (3) between the subscript of the destination vector A and the subscript of the operand vector A is (3)
If (= 3) or more, the result A (4) of the operation A (1) + C (1) started in cycle 1 ends in cycle 3, as shown in FIG. In cycle 4, A (4) and C (4) can be referenced. Therefore, this operation can be vectorized.

しかしながら、このような回帰的データ参照において、
例えば第8図(a)に示すように、ディスティネーショ
ンのベクトルAの添字とオペランドのベクトルAの添字
との差(1)がパイプラインの段数n(=3)未満であ
ると、サイクル1で開始されたA(1)+C(1)の演
算結果A(2)がサイクル2では未だ求まっていないた
め、A(2),C(2)の参照はこの演算が終了するサイ
クル4でないと行なえない。従って、この場合には演算
をベクトル化することはできない。
However, in such recursive data reference,
For example, as shown in FIG. 8A, when the difference (1) between the subscript of the destination vector A and the subscript of the operand vector A is less than the pipeline stage number n (= 3), the cycle 1 Since the calculation result A (2) of the started A (1) + C (1) has not yet been obtained in cycle 2, reference of A (2), C (2) can only be made in cycle 4 at which this calculation ends. Absent. Therefore, in this case, the operation cannot be vectorized.

このように、パイプライン方式を採用していても、ディ
スティネーションとオぺランドのベクトルの添字の差が
パイプラインの段数n未満のときには、ベクトル化は不
可能である。
As described above, even if the pipeline method is adopted, vectorization is not possible when the difference between the subscripts of the destination and operand vectors is less than the number of pipeline stages n.

そこで、回帰的データ参照が起こる場合には、コンパイ
ラに予めパイプラインの段数nを覚えさせておき、コン
パイル時に上記添字の差がパイプライン段数nより大き
いかどうかを判定し、この判定結果に応じてベクトル化
するかどうかを決定することも考えられる。しかし、こ
の場合にはパイプライン段数を増やした場合、コンパイ
ラを新しいパイプライン段数に合せて作り直さなければ
ならない。また、同一アーキテクチャの計算機で、パイ
プラインの段数だけが違っている場合には、各計算機毎
にその計算機のパイプライン段数に合わせたコンパイラ
を用意しなければならずコンパイラの作成が非常に面倒
になるという問題があった。
Therefore, when recursive data reference occurs, the compiler is made to remember the pipeline stage number n in advance, and at the time of compilation, it is determined whether or not the difference between the above subscripts is greater than the pipeline stage number n. It is also possible to decide whether or not to vectorize. However, in this case, when the number of pipeline stages is increased, the compiler has to be rebuilt according to the new number of pipeline stages. In addition, if the number of pipeline stages is different for computers with the same architecture, it is necessary to prepare a compiler for each computer according to the number of pipeline stages of the computer. There was a problem of becoming.

また、第9図に示すように、ディスティネーションの添
字に変数kが含まれている場合、この変数kはコンパイ
ル時には定まらず、実行時に定まるため、たとえ実行時
にk≧nとなってもベクトル化することは不可能とな
る。
Further, as shown in FIG. 9, when a variable k is included in the destination subscript, this variable k is not determined at compile time but is determined at run time. Therefore, even if k ≧ n at run time, vectorization is performed. It becomes impossible to do.

更に、第10図(a)のようなサブルーチンでは文番号10
のディスティネーションとオペランドとが表面上は同一
でないが、サブルーチンの呼び元で第10図(b)に示す
ように第1引数と第2引数とを同一の引数として呼出す
と、上記と同様の回帰的データ参照の問題が生じる。こ
の場合、上記第1引数と第2引数とに同一の変数を割当
てない等の制限を付して上記の問題を回避することも考
えられるが、このようにすると、サブルーチンの汎用性
という特長が損われ、プログラムの移植性が低下する。
Furthermore, in the subroutine shown in FIG.
Although the destination and the operand of are not the same on the surface, if the first argument and the second argument are called with the same argument at the caller of the subroutine as shown in FIG. 10 (b), the same regression as above is performed. The problem of dynamic data reference arises. In this case, it is conceivable that the above problem can be avoided by applying a restriction such as not assigning the same variable to the first argument and the second argument, but in this case, the versatility of the subroutine is characteristic. Damaged and less portable of the program.

更には、第11図に示すように、隣接する演算において、
メモリの一部が重なって定義されている場合にも同様の
問題が生じる。即ち、この例は、1ワード2バイトでメ
モリのアドレスがバイト単位で付されている例で、BYTE
は1バイトの整数をINTEGERは2バイトの整数を宣言す
る宣言文である。ここでは、EQUIVALENCE(D,A)で第12
図に示すように、DとAの領域を重ねて定義しているの
で、文1の計算結果の格納場所であるDの一部をなすA
(2)を次の文2で参照している。このため、文2の実
行は文1の実行が終了するまで行なうことができない。
Furthermore, as shown in FIG. 11, in adjacent operations,
A similar problem occurs when a part of the memory is defined overlappingly. That is, this example is an example in which the address of the memory is attached in byte units with 2 bytes for 1 word.
Is a 1-byte integer and INTEGER is a declaration statement that declares a 2-byte integer. Here, at EQUIVALENCE (D, A), the 12th
As shown in the figure, since the areas of D and A are defined by overlapping, A which is a part of the storage location of the calculation result of sentence 1 is A.
(2) is referred to in the following sentence 2. Therefore, the statement 2 cannot be executed until the execution of the statement 1 is completed.

以上のことから、従来のベクトル計算機では、回帰的デ
ータ参照が行われる可能性のある演算についてはベクト
ル化を断念している。このため、ベクトル化した場合に
比べて演算速度が数十倍も遅くなるという問題があっ
た。
From the above, in the conventional vector computer, vectorization is abandoned for operations that may perform recursive data reference. For this reason, there is a problem that the calculation speed is several tens of times slower than the case of vectorization.

(発明が解決しようとする問題点) このように、従来のベクトル計算機では、回帰的データ
参照が起こる場合にベクトル化を行なわないようにして
いるため、演算の実行速度を高めることができないとい
う問題があった。
(Problems to be Solved by the Invention) As described above, in the conventional vector computer, since the vectorization is not performed when the recursive data reference occurs, the execution speed of the operation cannot be increased. was there.

本発明は、かかる問題点を解決すべくなされたもので、
その目的とするところは、回帰的データ参照が生じる演
算についてもベクトル化できる部分は全てベクトル化す
ることができ、もって演算速度を大幅に高めることがで
きるベクトル計算機を提供することにある。
The present invention has been made to solve such problems.
It is an object of the present invention to provide a vector computer which can vectorize all operations that can be vectorized even for operations that cause recursive data reference, thereby significantly increasing the operation speed.

[発明の構成] (問題点を解決するための手段) 本発明は、ベクトルデータを格納し、ワード単位または
ハーフワード単位またはバイト単位の内の少なくとも2
通りのアクセスが可能であるメモリから演算処理部が順
次ベクトルデータを読み出して所定の段数のパイプライ
ン処理によるベクトル演算処理を行なうベクトル計算機
において、次の手段を備えたことを特徴としている。即
ち、本発明は、パイプラインの各ステージに保持されて
いる演算処理中のデータの書込みメモリアドレスと当該
演算処理中のデータが前記ワードであるかハーフワード
であるか若しくはバイトであるかを示すサイズとを前記
パイプラインの各ステージに対応させて格納するため
に、パイプラインの前記段数に対応して設定される段数
のレジスタでFIFOメモリ構成されるレジスタファイル
と、前記演算処理部から順次出力される演算結果を前記
レジスタファイルから順次読出した前記書込みメモリア
ドレスで指定される前記メモリの記憶場所に格納する格
納手段と、前記演算処理部が前記メモリから前記ベクト
ルデータを読出す際に、その読出しメモリアドレス及び
読出すデータの前記サイズと前記レジスタファイル内に
格納されているメモリアドレス及びデータの前記サイズ
とに基づいて前記メモリの前記両メモリアドレスで指定
される書込み領域と読出し領域の重複の有無を検査する
検査手段と、この検査手段で重複が検出された場合には
前記演算処理部が前記メモリからデータを読出すのを禁
止し、重複が検出されない場合には前記演算処理部が前
記メモリからデータを読出すのを許可する手段とを具備
している。
[Structure of the Invention] (Means for Solving Problems) The present invention stores vector data, and at least two of word units, halfword units, or byte units are stored.
A vector computer in which an arithmetic processing unit sequentially reads vector data from a memory that can be accessed in various ways and performs vector arithmetic processing by pipeline processing of a predetermined number of stages is characterized by including the following means. That is, the present invention indicates the write memory address of the data being processed held in each stage of the pipeline and whether the data being processed is the word, the halfword, or the byte. In order to store the size in correspondence with each stage of the pipeline, a register file composed of a FIFO memory with registers of the number of stages set corresponding to the number of stages of the pipeline, and sequentially output from the arithmetic processing unit Storage means for storing the calculated operation result in a storage location of the memory designated by the write memory address sequentially read from the register file, and when the operation processing section reads the vector data from the memory, Read memory address and the size of the data to be read and the memory stored in the register file Inspecting means for inspecting whether or not the writing area and the reading area specified by the both memory addresses of the memory are overlapped based on the address and the size of the data, and when the inspection means detects the duplication, the inspection means And means for prohibiting the arithmetic processing unit from reading data from the memory and permitting the arithmetic processing unit to read data from the memory when no duplication is detected.

(作用) 本発明では、パイプラインの各ステージに格納されたデ
ータと対応させて該データの書込みメモリアドレスとそ
のデータがワードであるかハーフワードであるか若しく
はバイトであるかを示すサイズとをレジスタファイルに
格納するようにしているので、レジスタファイルに格納
されたメモリアドレスとこのサイズとを参照すれば、そ
のメモリアドレスに書込まれるべきデータが現在演算処
理中であること及びそのデータがメモリのどの程度の領
域を書替えるかが分かる。そこで、演算処理部がメモリ
からベクトルデータを読出そうとしたとき、その読出し
メモリアドレス及び読出すデータのサイズとレジスタフ
ァイルに格納された現在処理中のデーアのメモリアドレ
ス及びサイズとから、検査手段で、読み出そうとしてい
るメモリの領域と現在処理中でその後に書込まれるメモ
リの領域との重複を検査し、もし重複が検出された場合
には前記演算処理部が前記メモリからデータを読出すの
を禁止してメモリからの読出しを待たせるようにしてい
る。従って、演算処理部は、このような待機指示がなさ
れない限り、メモリからベクトルデータを順次読み出
し、パイプラインに乗せることができるため、ベクトル
化できる部分は全てベクトル化されることになる。
(Operation) In the present invention, the write memory address of the data and the size indicating whether the data is a word, a halfword, or a byte are associated with the data stored in each stage of the pipeline. Since the data is stored in the register file, if the memory address stored in the register file and this size are referred to, the data to be written at that memory address is currently undergoing arithmetic processing and that data is stored in the memory. You can see how much of the area to rewrite. Therefore, when the arithmetic processing unit attempts to read the vector data from the memory, the checking means determines the read memory address, the size of the data to be read, and the memory address and size of the data currently stored in the register file. Checking the overlap between the area of the memory to be read and the area of the memory currently being processed and subsequently written, and if the overlap is detected, the arithmetic processing unit reads the data from the memory. Is prohibited and the reading from the memory is made to wait. Therefore, the arithmetic processing unit can sequentially read the vector data from the memory and put it on the pipeline unless such a standby instruction is issued, so that all the vectorizable portions are vectorized.

このように、本発明によれば、回帰的データ参照が起こ
る場合でも、メモリに対する読み出し禁止指令が出ない
限り、ベクトル化可能なものとして処理を進めるので、
ベクトル化できる部分は全てベクトル化されベクトル演
算を大幅にスピードアップすることができる。
As described above, according to the present invention, even if recursive data reference occurs, the process proceeds as vectorizable unless a read prohibition command for the memory is issued.
All the parts that can be vectorized are vectorized, which can significantly speed up vector operations.

(実施例) 以下、図面に示した実施例に基づいて本発明の詳細を説
明する。
(Example) Hereinafter, the details of the present invention will be described based on an example shown in the drawings.

第2図は本発明の一実施例に係るベクトル計算機の概略
構成を示す図である。
FIG. 2 is a diagram showing a schematic configuration of a vector computer according to an embodiment of the present invention.

ベクトル計算機は、ベクトルデータを格納するメモリ11
と、このメモリ11からベクトルデータを順次読み出し
て、パイプライン方式に基づくベクトル処理を行ない、
その演算結果をメモリ11に格納する演算処理部12と、こ
の演算処理部12がメモリ11からデータを読み出すのを許
可するためのパイプライン制御部13とで構成されてい
る。
The vector calculator has a memory 11 for storing vector data.
And sequentially read vector data from the memory 11 to perform vector processing based on the pipeline system,
The operation processing unit 12 stores the operation result in the memory 11, and the pipeline control unit 13 for permitting the operation processing unit 12 to read data from the memory 11.

メモリ11は、1ワード2バイト構成のメモリで、8ビッ
トのアドレス空間を持ち、ワード単位とバイト単位の二
通りのアクセスが可能なものとなっている。
The memory 11 is a memory of 1 word and 2 bytes, has an address space of 8 bits, and can be accessed in two ways, word unit and byte unit.

演算処理部12は、3段のパイプライン処理を行なうもの
となっている。
The arithmetic processing unit 12 performs three-stage pipeline processing.

パイプライン制御部13は、具体的には、第1図に示すよ
うに構成されている。
The pipeline control unit 13 is specifically configured as shown in FIG.

即ち、書込み情報レジスタ(以下、「Wレジスタ」と呼
ぶ)21は、演算処理部12からアドレスバスABを介して与
えられる書込みメモリアドレス(以下、単に書込みアド
レスという)WAと、DS線を介して与えられるデータサイ
ズWDSと、VB線を介して与えられるバリッドビットWVBと
を書込み情報として格納する。
That is, the write information register (hereinafter, referred to as “W register”) 21 is provided with the write memory address (hereinafter, simply referred to as write address) WA given from the arithmetic processing unit 12 via the address bus AB and the DS line. The given data size WDS and the valid bit WVB given via the VB line are stored as write information.

レジスタファイル22は、縦続接続されたシフトレジスタ
構成の3段のレジスタ23,24,25からなり、Wレジスタ21
に格納された書込み情報を順次格納し、格納した順に出
力するFIFO(First in First out)メモリを構成するも
のである。このレジスタファイル22の段数(3段)は演
算処理部13におけるパイプラインの段数に対応してい
る。このレジスタファイル22の各レジスタ23〜25には、
現在パイプラインのステージにある演算途中のデータの
書込みアドレスWAi(i=1,2,3)とデータサイズDSiと
データの有効性を示すバリッドビットVBiとが格納され
る。
The register file 22 is composed of three stages of registers 23, 24, 25 in a shift register configuration connected in cascade.
The writing information stored in the memory is sequentially stored and a first-in-first-out (FIFO) memory that outputs the information in the order stored is configured. The number of stages (three stages) of the register file 22 corresponds to the number of stages of the pipeline in the arithmetic processing unit 13. In each register 23 to 25 of this register file 22,
The write address WAi (i = 1, 2, 3) of the data in the middle of the operation currently in the pipeline stage, the data size DSi, and the valid bit VBi indicating the validity of the data are stored.

読出し情報レジスタ(以下、「Rレジスタ」と呼ぶ)26
は、演算処理部12からアドレスバスABを介して与えられ
る読出しメモリアドレス(以下、単に読出しアドレスと
いう)RAと、DS線を介して与えられるデータサイズRDS
と、VB線を介して与えられるバリッドビットRVBとを読
出し情報として格納する。両レジスタ21,26への書込み
タイミングは、例えば演算処理部11から出力されるライ
ト信号Wによって与えられる。
Read information register (hereinafter referred to as "R register") 26
Is a read memory address (hereinafter simply referred to as read address) RA given from the arithmetic processing unit 12 via the address bus AB, and a data size RDS given via the DS line.
And the valid bit RVB provided via the VB line are stored as read information. The write timing to both the registers 21 and 26 is given by the write signal W output from the arithmetic processing unit 11, for example.

これら書込み情報及び読出し情報は、10ビットのデータ
であり、第3図に示すように、下位8ビットにアドレス
情報が配置され、上位2ビット目にサイズビットが配置
され、最上位ビット(msb)にバリッドビットが配置さ
れたものとなっている。サイズビットは、“0"のときに
書込み又は読出しされるデータのサイズがワードである
ことを示し、“1"のときに読出し又は書込みされるデー
タのサイズがバイトであることを示している。また、バ
リッドビットは、“1"のときにそのアドレスが有効であ
ることを示し、“0"のときにそのアドレスが無効である
ことを示している。
These write information and read information are 10-bit data, and as shown in FIG. 3, address information is arranged in lower 8 bits, size bit is arranged in upper 2 bits, and most significant bit (msb). The valid bit is placed in. The size bit indicates that the size of data to be written or read is a word when it is "0", and that the size of data to be read or written is a byte when it is "1". When the valid bit is "1", it indicates that the address is valid, and when the valid bit is "0", it indicates that the address is invalid.

レジスタファイル22の各レジスタ23〜25に格納された書
込み情報と、Rレジスタ26に格納された読出し情報とは
コンパレータ27,28,29にそれぞれ与えられている。コン
パレータ27〜29は、各レジスタ23〜25に格納された書込
み情報と上記読出し情報とから、メモリ12の書込み領域
及び読出し領域の重複を検査し、その結果、重複が検出
された場合には、“0"を出力し、重複が検出されなかっ
たら“1"を出力する。これらコンパレータ27〜29からの
検査結果は、アンドゲート30に与えられている。アンド
ゲート30は、いずれか一つのコンパレータ27〜29で重複
が検出されたら、REQ信号を“0"にして演算処理部11が
メモリ12からデータを読出すのを禁止し、いずれのコン
パレータ27〜29からも重複が検出されなかったら、REQ
信号を“1"にして演算処理部11がメモリ12からデータを
読出すのを許可する。
The write information stored in the respective registers 23 to 25 of the register file 22 and the read information stored in the R register 26 are given to the comparators 27, 28 and 29, respectively. Comparators 27 to 29, from the write information and the read information stored in each of the registers 23 to 25, to check the overlap of the write area and the read area of the memory 12, as a result, if the overlap is detected, Outputs "0", and outputs "1" if no duplication is detected. The inspection results from these comparators 27 to 29 are given to the AND gate 30. When the duplication is detected by any one of the comparators 27 to 29, the AND gate 30 sets the REQ signal to “0” to prohibit the arithmetic processing unit 11 from reading the data from the memory 12, and the comparator 27 to 29 If no duplicates are detected from 29, REQ
The signal is set to "1" to allow the arithmetic processing unit 11 to read data from the memory 12.

第4図はコンパレータ27の更に詳細な構成を示した図で
ある。なお、コンパレータ28,29もこれと同様な構成を
有しているので、これらの説明は省略する。
FIG. 4 is a diagram showing a more detailed configuration of the comparator 27. Since the comparators 28 and 29 also have the same configuration as this, the description thereof will be omitted.

8つのXORゲート31〜38は、レジスタファイル22内の1
段目のレジスタ23上の8ビットの書込みアドレスWA1と
Rレジスタ26上の8ビットの読出しアドレスRAの各対応
するビットを比較するためのもので、ビットが一致した
場合に、“0"を出力する。アドレスのLSBを比較するXOR
ゲート31の出力は、アンドゲート40の一つの入力として
与えられている。このアンドゲート40の他の2つの入力
には、レジスタファイル22の1段目のレジスタ23に格納
されたサイズビットWDSと、Rレジスタ26に格納された
サイズビットRDSとが入力されている。このアンドゲー
ト40は、読出すデータ或はパイプラインの1段目で処理
されているデータのサイズがワードを示したとき、つま
りRDS、WDS1のいずれか一方が“0"を示したときに、ア
ドレスLSBの一致、不一致に拘らずその出力を“0"にす
るためのものである。このアンドゲート40の出力及びXO
Rゲート32〜38の出力は、NORゲート41に入力されてい
る。NORゲート41は、レジスタファイル22の1段目のレ
ジスタ23に格納された書込みアドレスWA1とRレジスタ2
6に格納された読出しアドレスRAとが一致若しくは一部
重複した場合に、“1"を出力する。このNORゲート41の
出力は、NANDゲート42の一方の入力に与えられている。
NANDゲート42の他方の入力には、レジスタファイル22の
1段目のレジスタ23に格納されたバリッドビットWVB1が
入力されている。また、このNANDゲート42の出力は、AN
Dゲート43に入力されており、更にこのANDゲート43の他
方の入力には、Rレジスタ26上のバリッドビットRVBが
入力されている。これらNANDゲート42及びANDゲート43
は、バリッドビットWVB1、RVBによってアドレス比較の
結果を補正するために設けられている。この二つのゲー
トにより、Rレジスタ26上のアドレスが無効、即ちRVB
が“0"のときには、アドレスの領域が重なっていなくて
も読出しアドレスが無効であるから、メモリからのデー
タの読出しを行なわないようにコンパレータからは“0"
が出力され、またRレジスタ26上のアドレスが有効で、
かつレジスタフィル22内のアドレスが無効のとき、即ち
WVB1が“0"のときには、読出しアドレスと書込みアドレ
スの重複が検出された場合でも、比較したアドレスの1
つが無効であることから、コンパレータからは“1"が出
力される。
Eight XOR gates 31-38 are 1 in register file 22
This is for comparing the corresponding bits of the 8-bit write address WA1 on the register 23 in the second stage and the 8-bit read address RA on the R register 26, and outputs "0" when the bits match. To do. XOR comparing the LSB of the address
The output of gate 31 is provided as one input of AND gate 40. The size bit WDS stored in the register 23 at the first stage of the register file 22 and the size bit RDS stored in the R register 26 are input to the other two inputs of the AND gate 40. This AND gate 40 is provided when the size of the data to be read or the data processed in the first stage of the pipeline indicates a word, that is, when either RDS or WDS1 indicates "0", This is to make the output "0" regardless of whether the address LSBs match or mismatch. The output of this AND gate 40 and XO
The outputs of the R gates 32 to 38 are input to the NOR gate 41. The NOR gate 41 has a write address WA1 stored in the register 23 of the first stage of the register file 22 and an R register 2
When the read address RA stored in 6 matches or partially overlaps, "1" is output. The output of the NOR gate 41 is given to one input of the NAND gate 42.
The valid bit WVB1 stored in the register 23 in the first stage of the register file 22 is input to the other input of the NAND gate 42. The output of this NAND gate 42 is AN
It is input to the D gate 43, and the valid bit RVB on the R register 26 is input to the other input of the AND gate 43. These NAND gate 42 and AND gate 43
Are provided to correct the result of the address comparison with the valid bits WVB1 and RVB. These two gates make the address on the R register 26 invalid, that is, RVB
When is "0", the read address is invalid even if the address areas do not overlap. Therefore, the comparator reads "0" so that data is not read from memory.
Is output, and the address on the R register 26 is valid,
And when the address in the register fill 22 is invalid, that is,
When WVB1 is "0", even if duplicate read address and write address are detected, the comparison address is 1
Since one is invalid, the comparator outputs "1".

次に以上のように構成された本実施例に係るベクトル計
算機の作用について説明する。
Next, the operation of the vector computer according to the present embodiment configured as described above will be described.

まず、第1のサイクルC1でレジスタファイル22の1段目
のレジスタ23にアドレス“10H"、サイズ“ワード”の書
込み情報が格納され、またRレジスタ26にアドレス“11
H"、サイズ“バイト”の読出し情報が格納されたとす
る。これら両情報は有効であるので、バリッドビットWV
B1、RVBは、いずれも“1"となっている。なお、Wレジ
スタ21には、Rレジスタ26で示されたメモリ内のデータ
による演算の結果が格納されるべきアドレスが記憶され
ている。サイクルC1では、コンパレータ27によりアドレ
ス“10H"とアドレス“11H"との比較が行われるが、両者
の比較結果は一致し、どちらのアドレスも有効なのでコ
ンパレータ27の出力は“0"となり、REQ信号が“0"とな
ってアドレス“11H"によるデータの読出しは行われず、
アドレス“11H"はRレジスタ26の上に有効なまま残る。
同時に、アドレス“10H"はレジスタファイル22の2段目
に移る。
First, in the first cycle C1, the write information of the address "10H" and the size "word" is stored in the register 23 of the first stage of the register file 22, and the address "11" is stored in the R register 26.
It is assumed that read information of "H" and size "byte" is stored. Since both of these information are valid, valid bit WV
B1 and RVB are both "1". It should be noted that the W register 21 stores the address at which the result of the operation based on the data in the memory indicated by the R register 26 should be stored. In cycle C1, the comparator 27 compares the address “10H” with the address “11H”, but the comparison result of both is the same, and since both addresses are valid, the output of the comparator 27 becomes “0” and the REQ signal Becomes "0" and data is not read at address "11H".
Address "11H" remains valid on R register 26.
At the same time, the address “10H” moves to the second stage of the register file 22.

第2のサイクルC2では、2つのアドレスの比較が、コン
パレータ28により行われ、同様に“0"が出力され、アド
レス“11H"はRレジスタ26の上に残り、アドレス“10H"
は3段目に移る。
In the second cycle C2, the two addresses are compared by the comparator 28, "0" is similarly output, the address "11H" remains on the R register 26, and the address "10H".
Moves to the third stage.

次の第3のサイクルC3では、コンパレータ29により両ア
ドレスの比較が行われ、同様に“0"が出力され、アドレ
ス“11H"はRレジスタ26に残る。
In the next third cycle C3, the two addresses are compared by the comparator 29, "0" is similarly output, and the address "11H" remains in the R register 26.

サイクルC1からC3の間はANDゲート30の出力は0なの
で、Wレジスタ21からレジスタファイル22へのアドレス
やサイズの移動は行われない。そのため、同一の演算の
読出し用のアドレスと書込み用のアドレスとを比較する
ことはない。なお、サイクルC3では、アドレス“10H"に
よるデータの書込みが行われ、アドレス“10H"がレジス
タファイル22から消える。このことにより、次の第4の
サイクルC4ではアドレス“11H"によるデータの読出しが
行われ、Wレジスタ21上のアドレスとサイズとがレジス
タファイル22に入り、Rレジスタ26とWレジスタ21とに
は、次の演算のデータのアドレスとサイズとが格納され
る。
Since the output of the AND gate 30 is 0 during the cycles C1 to C3, the address and size are not moved from the W register 21 to the register file 22. Therefore, the read address and the write address of the same operation are not compared. In cycle C3, data is written by the address “10H”, and the address “10H” disappears from the register file 22. As a result, in the next fourth cycle C4, the data is read by the address "11H", the address and size on the W register 21 are stored in the register file 22, and the R register 26 and the W register 21 are stored. , The address and size of the data for the next operation are stored.

もし、アドレス“10H"のサイズがバイトであったなら
ば、アドレスの全ビットによる比較が行われるため、ア
ドレス“11H"の領域とは重なっていないと判定され、サ
イクルC1でアドレス“11H"の読出しが行われる。
If the size of address "10H" is byte, it is determined that it does not overlap the area of address "11H" because all bits of the address are compared, and in cycle C1 the address "11H" Read-out is performed.

このように、この実施例によれば、書込みが行われる予
定のアドレスの領域と重なるデータの読出しは、書込み
が行われるまで待たされ、データの定義、参照順序が逐
次処理の場合と逆転することはない。また、重なってい
なければ読出しを待たせることはないように正確にメモ
リアドレスの領域の重なりの判定を行なう。そして、こ
のことにより、コンパイル時にパイプライン処理が可能
か否かの判定を行なわなくてすみ、パイプライン処理の
性能を十分に引出せるようになる。
As described above, according to this embodiment, the reading of the data overlapping the area of the address where the writing is to be performed is delayed until the writing is performed, and the definition and reference order of the data are reversed from the case of the sequential processing. There is no. Further, if there is no overlap, the overlap of the memory address areas is accurately determined so that the reading is not delayed. As a result, it is not necessary to determine whether or not pipeline processing is possible at the time of compilation, and the performance of pipeline processing can be sufficiently brought out.

なお、本発明は上記実施例に限定されるものではない。
即ち、上記実施例では、読出し用のアドレスを1つだけ
設定したが、読出し用のアドレスを複数設定するように
しても良い。また、演算のパイプラインの段数は、演算
毎に異なっていても構わない。その場合は、FIFO構成の
レジスタファイルを用意すれば対応できる。更に、アク
セスの単位となるデータのサイズをワードとバイトの2
種類に限定しているが、この発明では4バイトのワード
に対する2バイトのハーフワード等、多様なアクセスの
サイズを許容できる。同様にこの実施例では読出し用か
書出し用のどちらかのデータの全領域がもう一方の領域
に重なっている場合だけを例にとったが、第5図に示す
ように、両方のデータの領域の一部だけが重なっている
場合でも本発明を適用可能である。
The present invention is not limited to the above embodiment.
That is, although only one read address is set in the above embodiment, a plurality of read addresses may be set. Further, the number of stages of the operation pipeline may be different for each operation. In that case, it is possible to prepare by preparing the register file of the FIFO structure. Furthermore, the size of the data that is the unit of access is 2 for words and bytes.
Although limited to types, the present invention allows various access sizes such as 2-byte halfwords for 4-byte words. Similarly, in this embodiment, the case where the entire area of data for either reading or writing overlaps with the other area is taken as an example, but as shown in FIG. The present invention can be applied even in the case where only a part of each overlaps.

[発明の効果] 以上、説明したように、この発明によれば、実行時に読
出しと書込みのデータのワード領域の重なりを正確に判
定し、データの定義、参照の順番をプログラム文の順番
通りに行なえる。このことにより、コンパイル時にデー
タの領域の重なりを正確に判定できないような多くの演
算についてもパイプライン処理を実行できる。そして、
その際、実行結果の正しさは保証される。したがって、
パイプライン方式の計算機に対して、プログラム言語に
制限を加える必要はなくなる。また、データの定義、参
照関係を正確に判定しようとする複雑な処理を組込んだ
巨大なコンパイラ等の言語処理システムも作成せずに、
たとえそのようなコンパイラを組込んだ場合に比べて
も、パイプライン処理の性能を十分に引出せるようにな
る。さらに、これらの効果を実施例に示したように、簡
単な構成で実現できる。
[Effects of the Invention] As described above, according to the present invention, the overlap of the word areas of the read and write data is accurately determined at the time of execution, and the order of data definition and reference is set in the order of the program statement. I can do it. As a result, pipeline processing can be executed for many operations that cannot accurately determine the overlap of data areas during compilation. And
At that time, the correctness of the execution result is guaranteed. Therefore,
It is not necessary to limit the programming language to the pipeline type computer. In addition, without creating a language processing system such as a huge compiler that incorporates complicated processing that attempts to accurately determine the definition and reference relationship of data,
Even if such a compiler is incorporated, the performance of pipeline processing can be sufficiently brought out. Furthermore, these effects can be realized with a simple configuration as shown in the embodiment.

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

第1図乃至第4図は本発明の一実施例に係るベクトル計
算機を説明するための図で、第1図は要部構成を示すブ
ロック図、第2図は全体構成を示すブロック図、第3図
は各レジスタに格納される情報の構成を示す図、第4図
はコンパレータの詳細ブロック図、第5図は本発明の他
の実施例で検査されるメモリアドレスの重なりの態様を
示す図、第6図及び第7図は従来のパイプライン処理を
それぞれ説明するための図、第8図乃至第12図は従来パ
イプライン処理を実行できなかった例をそれぞれ示す図
である。 11……演算処理部、12……メモリ、13……パイプライン
制御部、21……書込み情報レジスタ(Wレジスタ)、22
……レジスタファイル、23〜25……レジスタ、26……読
出し情報レジスタ(Rレジスタ)、27〜29……コンパレ
ータ、30,40,43……ANDゲート、31〜38……XORゲート、
41……NORゲート、42……NANDゲート。
1 to 4 are diagrams for explaining a vector computer according to an embodiment of the present invention. FIG. 1 is a block diagram showing a main configuration, FIG. 2 is a block diagram showing an overall configuration, FIG. 3 is a diagram showing a structure of information stored in each register, FIG. 4 is a detailed block diagram of a comparator, and FIG. 5 is a diagram showing a manner of overlapping memory addresses inspected in another embodiment of the present invention. 6 and 7 are diagrams for explaining the conventional pipeline process, and FIGS. 8 to 12 are diagrams showing examples in which the conventional pipeline process cannot be executed. 11 ... Arithmetic processing unit, 12 ... Memory, 13 ... Pipeline control unit, 21 ... Write information register (W register), 22
...... Register file, 23 to 25 ...... Register, 26 ...... Read information register (R register), 27 to 29 ...... Comparator, 30,40,43 ...... AND gate, 31 to 38 ...... XOR gate,
41 …… NOR gate, 42 …… NAND gate.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】ベクトルデータを格納し、ワード単位また
はハーフワード単位またはバイト単位の内の少なくとも
2通りのアクセスが可能であるメモリと、 このメモリから順次ベクトルデータを読み出して所定の
段数のパイプライン処理によるベクトル演算処理を行な
い、その演算結果を前記メモリに格納する演算処理部
と、 パイプラインの各ステージに保持されている演算処理中
のデータの書込みメモリアドレスと当該演算処理中のデ
ータが前記ワードであるかハーフワードであるか若しく
はバイトであるかを示すサイズとを前記パイプラインの
各ステージに対応させて格納するために、パイプライン
の前記段数に対応して設定される段数のレジスタでFIFO
メモリ構成されるレジスタファイルと、 前記演算処理部から順次出力される演算結果を前記レジ
スタファイルから順次読出した前記書込みメモリアドレ
スで指定される前記メモリの記憶場所に格納する格納手
段と、 前記演算処理部が前記メモリから前記ベクトルデータを
読出す際に、その読出しメモリアドレス及び読出すデー
タの前記サイズと前記レジスタファイル内に格納されて
いるメモリアドレス及びデータの前記サイズとに基づい
て前記メモリの前記両メモリアドレスで指定される書込
み領域と読出し領域の重複の有無を検査する検査手段
と、 この検査手段で重複が検出された場合には前記演算処理
部が前記メモリからデータを読出すのを禁止し、重複が
検出されない場合には前記演算処理部が前記メモリから
データを読出すのを許可する手段と を具備したことを特徴とするベクトル計算機。
1. A memory that stores vector data and can be accessed in at least two ways in word units, halfword units, or byte units, and a pipeline having a predetermined number of stages by sequentially reading vector data from this memory. An arithmetic processing unit that performs vector arithmetic processing by processing and stores the arithmetic result in the memory, a write memory address of the arithmetic processing data held in each stage of the pipeline, and the arithmetic processing data In order to store the size indicating whether it is a word, a halfword, or a byte in correspondence with each stage of the pipeline, a register of the number of stages set corresponding to the number of stages of the pipeline. FIFO
A register file including a memory; a storage unit that stores the calculation result sequentially output from the calculation processing unit in a storage location of the memory designated by the write memory address sequentially read from the register file; When the unit reads the vector data from the memory, the memory of the memory is read based on the read memory address, the size of the data to be read, and the memory address and the size of the data stored in the register file. Inspection means for inspecting whether or not the write area and the read area specified by both memory addresses overlap each other, and prohibits the arithmetic processing unit from reading data from the memory when the overlap is detected by the inspection means. However, when the duplication is not detected, the arithmetic processing unit is allowed to read the data from the memory. Vector calculator, characterized by comprising a means for.
JP63030877A 1988-02-15 1988-02-15 Vector calculator Expired - Lifetime JPH0746350B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63030877A JPH0746350B2 (en) 1988-02-15 1988-02-15 Vector calculator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63030877A JPH0746350B2 (en) 1988-02-15 1988-02-15 Vector calculator

Publications (2)

Publication Number Publication Date
JPH01206462A JPH01206462A (en) 1989-08-18
JPH0746350B2 true JPH0746350B2 (en) 1995-05-17

Family

ID=12315965

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63030877A Expired - Lifetime JPH0746350B2 (en) 1988-02-15 1988-02-15 Vector calculator

Country Status (1)

Country Link
JP (1) JPH0746350B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5206385B2 (en) * 2008-12-12 2013-06-12 日本電気株式会社 Boundary execution control system, boundary execution control method, and boundary execution control program
CN114579083B (en) * 2022-05-09 2022-08-05 上海擎昆信息科技有限公司 Data processing device and method based on vector processor

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61170830A (en) * 1985-01-25 1986-08-01 Fujitsu Ltd Register reference control system
JPS62237573A (en) * 1986-04-09 1987-10-17 Hitachi Ltd Vector processing device with cyclic calculation control mechanism

Also Published As

Publication number Publication date
JPH01206462A (en) 1989-08-18

Similar Documents

Publication Publication Date Title
US6061783A (en) Method and apparatus for manipulation of bit fields directly in a memory source
US4858105A (en) Pipelined data processor capable of decoding and executing plural instructions in parallel
JPH0228173B2 (en)
US5097407A (en) Artificial intelligence processor
JPH0248931B2 (en)
JPS59213084A (en) Buffer store control system
US6070238A (en) Method and apparatus for detecting overlap condition between a storage instruction and previously executed storage reference instruction
JPS59231652A (en) Memory access overlap detection method
US7100029B2 (en) Performing repeat string operations
US4969117A (en) Chaining and hazard apparatus and method
JPH0746350B2 (en) Vector calculator
US5951676A (en) Apparatus and method for direct loading of offset register during pointer load operation
US5819081A (en) Method of executing a branch instruction of jumping to a subroutine in a pipeline control system
US4935849A (en) Chaining and hazard apparatus and method
US5396640A (en) Boosting method and apparatus in a parallel computer
JPS5826584B2 (en) data processing equipment
US5829049A (en) Simultaneous execution of two memory reference instructions with only one address calculation
KR950000088B1 (en) Data processing system
KR900002436B1 (en) Bypass control system for pipeline processing
JPS61110240A (en) Optimization compiler
JPH07191911A (en) Address converter and microprocessor computation method
JPH01187634A (en) information processing equipment
JPH07110769A (en) Vliw type computer
JPH07129409A (en) List operation method in pipeline computer
JPH05173778A (en) Data processing device

Legal Events

Date Code Title Description
EXPY Cancellation because of completion of term