JP2002351658A - Arithmetic processor - Google Patents

Arithmetic processor

Info

Publication number
JP2002351658A
JP2002351658A JP2001159759A JP2001159759A JP2002351658A JP 2002351658 A JP2002351658 A JP 2002351658A JP 2001159759 A JP2001159759 A JP 2001159759A JP 2001159759 A JP2001159759 A JP 2001159759A JP 2002351658 A JP2002351658 A JP 2002351658A
Authority
JP
Japan
Prior art keywords
instruction
extended
read
cpu
extension
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
JP2001159759A
Other languages
Japanese (ja)
Inventor
Kosaku Shibata
耕作 柴田
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2001159759A priority Critical patent/JP2002351658A/en
Publication of JP2002351658A publication Critical patent/JP2002351658A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide an arithmetic processor which can suppress the increase of instruction code size and enhancing arithmetic efficiency by the instruction code in a CPU, which can be efficiently used by eliminating loss of time during arithmetic processing to the utmost and which can enhance the performance as an arithmetic processing system in an extended arithmetic unit. SOLUTION: When an arithmetic result of the extended arithmetic unit 22 is read into the CPU 21, a plurality of extension instructions 82 are continuously issued to the side of the extended arithmetic unit 22 without waiting completion of all arithmetic operations by specifying an extension instruction which must be completed in the extended arithmetic unit 22 corresponding to reading of the arithmetic result by a CPU 21, obtaining the information of arithmetic operation completion corresponding to reading in the extended arithmetic unit 22 and making possible reading of an exact arithmetic result to the reading from the CPU 21 even when the extension instructions 82 are issued from the CPU 21 to the extended arithmetic unit 22 prior to the reading of arithmetic result.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、CPUとCPUか
らの拡張命令に従って演算処理する拡張演算器とからな
る演算処理装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an arithmetic processing device comprising a CPU and an extended arithmetic unit for performing arithmetic processing in accordance with an extended instruction from the CPU.

【0002】[0002]

【従来の技術】近年、OA機器や産業機器等におけるコ
ンピュータシステムで扱われる情報量が大幅に増大し、
その情報処理の際に実行される演算処理のスピードアッ
プが強く要求されるようになっており、それに伴って、
上記のように演算処理を行う演算処理装置では、処理の
高速化のために、通常の演算を行うCPU以外にコプロ
セッサ等の拡張演算器を伴うものが多く開発されてい
る。
2. Description of the Related Art In recent years, the amount of information handled by computer systems in OA equipment, industrial equipment, and the like has increased significantly.
There has been a strong demand for speeding up the arithmetic processing performed during the information processing, and accordingly,
Many arithmetic processing devices that perform arithmetic processing as described above have been developed with an extended arithmetic unit such as a coprocessor in addition to a CPU that performs normal arithmetic, in order to speed up the processing.

【0003】このようなCPUとその拡張演算器を含む
演算処理装置のうちで、CPUから拡張演算器に対して
拡張命令を供給し、その拡張命令に従って、拡張演算器
がCPUと並列に演算を行う演算処理装置においては、
拡張演算器の演算結果をCPUが読み出す場合に、拡張
演算器の演算処理が全て完了していなければ、CPUに
対して期待する演算結果を読み出すことができないとい
う問題が発生する。
[0003] Among arithmetic processing devices including such a CPU and its extended operation unit, an extended instruction is supplied from the CPU to the extended operation unit, and the extended operation unit performs an operation in parallel with the CPU according to the extended instruction. In the processing unit to perform,
When the CPU reads the operation result of the extended operation unit, a problem occurs that the operation result expected from the CPU cannot be read unless all the operation processing of the extended operation unit is completed.

【0004】以上の問題に対する対処方法として、その
従来技術について、図面を参照しながら以下に説明す
る。図9は従来の演算処理システムの流れを示す概念図
であり、CPU(21)と拡張演算器(22)とでシス
テムが構成され、CPU(21)から拡張演算器(2
2)へ拡張命令が発行されるシステムである。図9にお
いて、拡張演算器(22)内に図示されているのは、C
PU(21)から拡張演算器(22)へ発行された命令
で、拡張命令α(165)と拡張命令β(166)とで
あり、拡張演算器(22)内で各命令に従う演算処理が
実行される拡張命令である。
[0004] As a method of coping with the above problem, a conventional technique will be described below with reference to the drawings. FIG. 9 is a conceptual diagram showing the flow of a conventional arithmetic processing system. The system is composed of a CPU (21) and an extended arithmetic unit (22).
This is a system in which an extension instruction is issued to 2). In FIG. 9, what is shown in the extended arithmetic unit (22) is C
Instructions issued from the PU (21) to the extended arithmetic unit (22), which are an extended instruction α (165) and an extended instruction β (166), and the arithmetic processing according to each instruction is executed in the extended arithmetic unit (22). Is an extended instruction to be executed.

【0005】また、CPU(21)内に図示されている
のは、CPU(21)に供給される命令で、拡張命令α
(165)を拡張演算器(22)に発行する拡張命令発
行命令A(161)と、拡張命令β(166)を拡張演
算器(22)に発行する拡張命令発行命令B(163)
と、拡張命令α(165)の演算結果を読み出す拡張命
令結果読み出し命令A(162)と、拡張命令β(16
6)の演算結果を読み出す拡張命令結果読み出し命令B
(164)とを含む。
Also, what is shown in the CPU (21) is an instruction supplied to the CPU (21), which is an extension instruction α.
(165) to the extended operation unit (22), and an extension instruction issue instruction B (163) to issue the extended instruction β (166) to the extended operation unit (22).
And an extended instruction result read instruction A (162) for reading the operation result of the extended instruction α (165), and an extended instruction β (16
Extended instruction result read instruction B for reading the operation result of 6)
(164).

【0006】ところで、一般的に、拡張演算器で実行さ
れる拡張命令は実行サイクル数が比較的長い。ここで
は、拡張演算器(22)が、拡張命令α(165)また
は拡張命令β(166)を実行するのに3サイクルかか
るとする。すなわち、拡張演算器(22)が命令を実行
していない状態で、CPU(21)が、拡張命令発行命
令A(161)または拡張命令発行命令B(163)を
実行してから、拡張演算器(22)による拡張命令α
(165)または拡張命令β(166)の演算結果を、
拡張命令結果読み出し命令A(162)または拡張命令
結果読み出し命令B(164)の実行により読み出せる
までに、3サイクルかかるものとする。
Generally, an extended instruction executed by an extended arithmetic unit has a relatively long number of execution cycles. Here, it is assumed that it takes three cycles for the extension operation unit (22) to execute the extension instruction α (165) or the extension instruction β (166). That is, in a state where the extended arithmetic unit (22) is not executing the instruction, the CPU (21) executes the extended instruction issuing instruction A (161) or the extended instruction issuing instruction B (163), and then executes the extended arithmetic unit. Extended instruction α by (22)
(165) or the operation result of the extension instruction β (166)
It takes three cycles to read the instruction by executing the extended instruction result read instruction A (162) or the extended instruction result read instruction B (164).

【0007】このように拡張演算器(22)の各演算処
理に要するサイクル数がわかっている場合、この従来技
術では、図9に示すように、CPU(21)において、
拡張命令結果読み出し命令(162、164)の前に、
NOP(実際に演算処理するものではなく次の命令実行
までのタイミングを取るために仮想的に用いる命令であ
り、通常1サイクル分のタイミングが取れる)命令、ま
たは演算結果に関係のない命令(例えば、ループ命令な
ど)を挿入し、CPU(21)に拡張演算器(22)に
よる演算の完了を待たせていた。
When the number of cycles required for each operation process of the extended operation unit (22) is known as described above, according to this prior art, as shown in FIG.
Before the extended instruction result read instruction (162, 164),
NOP (instruction that is not actually processed but is used virtually to take the timing until the next instruction is executed, and can usually take the timing of one cycle) or an instruction that is not related to the operation result (for example, , A loop instruction, etc.), causing the CPU (21) to wait for the completion of the operation by the extended operation unit (22).

【0008】また別の従来技術、例えば拡張演算器(2
2)の各演算処理にかかるサイクル数がわかっていない
場合には、拡張演算器(22)による演算完了を示すフ
ラグを用い、CPU(21)が、演算結果の読み出し時
にフラグの状態を参照して、拡張演算器(22)による
演算が完了したか否かを判断することにより、CPU
(21)に拡張演算器(22)による演算の完了を待た
せていた。
Another conventional technique, for example, an extended arithmetic unit (2
If the number of cycles required for each processing in 2) is not known, the CPU (21) uses the flag indicating the completion of the calculation by the extended calculator (22), and refers to the state of the flag when reading the calculation result. By judging whether or not the operation by the extended operation unit (22) is completed, the CPU
(21) waits for the completion of the operation by the extended operation unit (22).

【0009】[0009]

【発明が解決しようとする課題】しかしながら前述の図
9に示す演算処理システムのように、CPU(21)に
おいて、拡張命令結果読み出し命令(162、164)
の前にNOPを挿入する方法を用いると、NOPを挿入
する分だけ処理実行のための命令コードサイズが増加す
るという問題点と、演算にかかるサイクル数が動的に変
化する場合は、その最悪値を用いてCPU(21)に演
算を待たせるようにしなければならず、演算の際の処理
効率が更に低下し、システム全体のパフォーマンスを落
とすという問題点を有していた。
However, as in the above-described arithmetic processing system shown in FIG. 9, the CPU (21) executes an extended instruction result read instruction (162, 164).
If the method of inserting a NOP before the step is used, the size of the instruction code for executing the processing increases by the amount of the insertion of the NOP, and the worst case is that the number of cycles required for the operation dynamically changes. The value must be used to cause the CPU (21) to wait for the operation, which causes a problem that the processing efficiency in the operation is further reduced and the performance of the entire system is reduced.

【0010】また、前述の完了フラグを用いる場合で
も、CPU(21)から複数の拡張命令を先行的に連続
して拡張演算器(22)へ供給すると、どの拡張命令の
演算完了がフラグに反映しているかがわからなくなる。
そのため、CPU(21)から拡張演算器(22)への
拡張命令の供給が先行的に連続して行えず、次の拡張命
令の発行は、拡張演算器(22)が実行中の拡張命令に
よる演算処理の完了を待つことになる。これについて、
図10を用いて以下に説明する。
Even when the above-mentioned completion flag is used, when a plurality of extension instructions are successively supplied from the CPU (21) to the extension operation unit (22) in advance, the completion of the operation of any extension instruction is reflected in the flag. You do not know if you are doing.
Therefore, the supply of the extended instruction from the CPU (21) to the extended computing unit (22) cannot be continuously performed in advance, and the next extended instruction is issued by the extended instruction being executed by the extended computing unit (22). It will wait for the completion of the arithmetic processing. about this,
This will be described below with reference to FIG.

【0011】図10は従来の他の演算処理システムの流
れを示す概念図であり、CPU(21)と拡張演算器
(22)との各命令の実行状況を示している。この演算
処理システムでは、図10に示すように、拡張命令発行
命令A(161)により、CPU(21)が拡張演算器
(22)に拡張命令α(165)を発行し、CPU(2
1)は、演算完了フラグを参照しながら拡張演算器(2
2)における拡張命令α(165)による演算完了を待
ってから、拡張命令結果読み出し命令A(162)を実
行し、さらに拡張命令結果読み出し命令A(162)の
実行後、拡張命令発行命令B(163)により、CPU
(21)が拡張演算器(22)に拡張命令β(165)
を発行するようにしている。
FIG. 10 is a conceptual diagram showing the flow of another conventional arithmetic processing system, and shows the execution status of each instruction of the CPU (21) and the extended arithmetic unit (22). In this arithmetic processing system, as shown in FIG. 10, the CPU (21) issues an extended instruction α (165) to the extended arithmetic unit (22) by the extended instruction issuing instruction A (161), and the CPU (2)
1) refers to the extended operation unit (2) while referring to the operation completion flag.
After the completion of the operation by the extension instruction α (165) in 2), the extension instruction result read instruction A (162) is executed. After the execution of the extension instruction result read instruction A (162), the extension instruction issue instruction B ( 163), the CPU
(21) sends the extended instruction β (165) to the extended arithmetic unit (22).
Is issued.

【0012】図10を見て明らかなように、この従来技
術を用いると、CPU(21)から拡張命令を先行的に
連続して拡張演算器(22)に発行できないため、CP
U(21)および拡張演算器(22)ともに時間的ロス
が生じ、CPU(21)が効率的に拡張演算器を利用で
きず、この従来技術においても、システム全体のパフォ
ーマンスを落とすという問題点を有していた。
As is apparent from FIG. 10, if this conventional technique is used, the CPU (21) cannot successively issue an extended instruction to the extended arithmetic unit (22) in a continuous manner.
U (21) and the extended arithmetic unit (22) cause a time loss, and the CPU (21) cannot efficiently use the extended arithmetic unit. This conventional technique also has a problem that the performance of the entire system is reduced. Had.

【0013】本発明は、上記従来の問題点を解決するも
ので、CPUにおいて、拡張演算器による演算完了の待
ち状態をなくし、命令コードサイズの増加を抑え、かつ
その命令コードによる演算効率を向上することができる
とともに、拡張演算器において、演算処理中の時間的ロ
スを極力なくし効率的に利用することができ、演算処理
システムとしてのパフォーマンスを向上することができ
る演算処理装置を提供する。
SUMMARY OF THE INVENTION The present invention solves the above-mentioned conventional problems, and eliminates a waiting state for completion of an operation by an extended arithmetic unit in a CPU, suppresses an increase in instruction code size, and improves operation efficiency by the instruction code. The present invention provides an arithmetic processing device capable of efficiently using the extended arithmetic unit while minimizing the time loss during the arithmetic processing and improving the performance of the arithmetic processing system.

【0014】[0014]

【課題を解決するための手段】上記の課題を解決するた
めに本発明の演算処理装置は、CPUと前記CPUから
供給される拡張命令に従って前記CPUと並列に演算処
理する拡張演算器とからなる演算処理装置において、前
記CPUから前記拡張演算器に供給される前記拡張命令
にIDを付加する手段と、前記CPUから前記拡張演算
器における拡張命令による演算結果を参照するための読
み出し命令をデコードする時に、その読み出し命令に、
前記演算結果を得るための拡張命令を示す情報を付加す
る手段と、前記CPUによる前記読み出し命令の実行時
に、前記拡張命令に付加されたIDと前記読み出し命令
に付加された情報とを比較する手段と、前記CPUによ
る読み出し命令の実行を制御する手段とを備え、前記制
御手段を、前記読み出し命令の実行時における前記比較
の結果、前記拡張命令に付加されたIDと前記読み出し
命令に付加された情報とが一致するまで、前記読み出し
命令の実行を停止するよう構成したことを特徴とする。
According to another aspect of the present invention, there is provided an arithmetic processing apparatus comprising: a CPU; and an extended arithmetic unit that performs arithmetic processing in parallel with the CPU according to an extended instruction supplied from the CPU. In the arithmetic processing device, means for adding an ID to the extended instruction supplied from the CPU to the extended arithmetic unit, and decoding of a read instruction for referring to a result of the extended instruction in the extended arithmetic unit from the CPU. Sometimes, in the read instruction,
Means for adding information indicating an extension instruction for obtaining the operation result, and means for comparing the ID added to the extension instruction with the information added to the read instruction when the CPU executes the read instruction. And a means for controlling execution of a read instruction by the CPU, wherein the control means is provided with an ID added to the extension instruction and an ID added to the read instruction as a result of the comparison at the time of execution of the read instruction. The execution of the read command is stopped until the information matches.

【0015】以上により、CPU側に拡張演算器の演算
結果を読み出す際に、その読み出しに先行してCPU側
から拡張演算器に対して複数の拡張命令が発行されてい
たとしても、CPU側で、その読み出しに対応して拡張
演算器において完了していなければならない拡張命令を
特定して、拡張演算器における読み出し対応の演算の完
了情報を得て、CPU側からの読み出しに対して正しい
演算結果を読み出すことを可能とすることにより、全て
の演算の終了を待つことなく、複数の拡張命令を続けて
拡張演算器側に発行することができる。
As described above, even when a plurality of extension instructions are issued from the CPU to the extended computing unit prior to the reading when the computation result of the extended computing unit is read to the CPU, Specifying an extension instruction that must be completed in the extended arithmetic unit in response to the reading, obtaining completion information of the operation corresponding to the read in the extended arithmetic unit, and obtaining a correct operation result for reading from the CPU side. Can be read out, a plurality of extension instructions can be issued to the extension operation unit side continuously without waiting for the end of all the operations.

【0016】[0016]

【発明の実施の形態】本発明の請求項1に記載の演算処
理装置は、CPUと前記CPUから供給される拡張命令
に従って前記CPUと並列に演算処理する拡張演算器と
からなる演算処理装置において、前記CPUから前記拡
張演算器に供給される前記拡張命令にIDを付加する手
段と、前記CPUから前記拡張演算器における拡張命令
による演算結果を参照するための読み出し命令をデコー
ドする時に、その読み出し命令に、前記演算結果を得る
ための拡張命令を示す情報を付加する手段と、前記CP
Uによる前記読み出し命令の実行時に、前記拡張命令に
付加されたIDと前記読み出し命令に付加された情報と
を比較する手段と、前記CPUによる読み出し命令の実
行を制御する手段とを備え、前記制御手段を、前記読み
出し命令の実行時における前記比較の結果、前記拡張命
令に付加されたIDと前記読み出し命令に付加された情
報とが一致するまで、前記読み出し命令の実行を停止す
る構成とする。
An arithmetic processing device according to claim 1 of the present invention is an arithmetic processing device comprising a CPU and an extended arithmetic unit that performs arithmetic processing in parallel with the CPU according to an extended instruction supplied from the CPU. Means for adding an ID to the extended instruction supplied from the CPU to the extended arithmetic unit, and reading the read instruction when decoding a read instruction for referring to the operation result of the extended instruction in the extended arithmetic unit from the CPU. Means for adding information indicating an extended instruction for obtaining the operation result to the instruction;
A unit for comparing the ID added to the extension instruction with information added to the read instruction when the read instruction is executed by U; and a unit for controlling execution of the read instruction by the CPU. The means is configured to stop the execution of the read command until the ID added to the extension command matches the information added to the read command as a result of the comparison at the time of executing the read command.

【0017】請求項2に記載の演算処理装置は、請求項
1に記載の演算処理装置であって、読み出し命令の実行
時の実行順序を得るためのCPUの各種実行命令の配置
順序における読み出し命令を、対応する拡張命令とその
次の拡張命令との間に配置し、前記読み出し命令に付加
する情報として、その読み出し命令より前で最後に配置
された拡張命令のIDを付加する手段と、前記配置順序
における読み出し命令に、前記各種実行命令の命令数を
示すオペランドを付加し、前記読み出し命令の実行時
に、その実行順序を前記オペランドが示す命令数だけ繰
り下げて実行する手段とを備えた構成とする。
According to a second aspect of the present invention, there is provided the arithmetic processing unit according to the first aspect, wherein the read instruction in the arrangement order of various execution instructions of the CPU for obtaining the execution order at the time of executing the read instruction. Is disposed between the corresponding extended instruction and the next extended instruction, and as information to be added to the read instruction, means for adding the ID of the last extended instruction placed before the read instruction, Means for adding an operand indicating the number of instructions of the various execution instructions to the read instructions in the arrangement order, and executing the read instruction by executing the execution order by reducing the execution order by the number of instructions indicated by the operand. I do.

【0018】これらの構成によると、CPU側に拡張演
算器の演算結果を読み出す際に、その読み出しに先行し
てCPU側から拡張演算器に対して複数の拡張命令が発
行されていたとしても、CPU側で、その読み出しに対
応して拡張演算器において完了していなければならない
拡張命令を特定して、拡張演算器における読み出し対応
の演算の完了情報を得て、CPU側からの読み出しに対
して正しい演算結果を読み出すことを可能とすることに
より、全ての演算の終了を待つことなく、複数の拡張命
令を続けて拡張演算器側に発行する。
According to these configurations, when the operation result of the extended arithmetic unit is read out to the CPU side, even if a plurality of extension instructions are issued from the CPU side to the extended arithmetic unit prior to the reading, On the CPU side, an extension instruction that must be completed in the extended arithmetic unit in response to the read is specified, and completion information of the operation corresponding to the read in the extended arithmetic unit is obtained. By making it possible to read a correct operation result, a plurality of extension instructions are issued to the extension operation unit continuously without waiting for the end of all the operations.

【0019】請求項3に記載の演算処理装置は、請求項
2に記載の演算処理装置であって、読み出し命令の実行
時におけるIDの比較の結果、演算結果を更新する拡張
命令のIDが、実行された読み出し命令に付加されたI
Dよりも1大きい場合に、前記演算結果の更新を停止す
るよう構成する。
According to a third aspect of the present invention, in the arithmetic processing unit according to the second aspect, as a result of comparison of IDs at the time of execution of the read instruction, the ID of the extended instruction for updating the arithmetic result is: I added to the executed read instruction
When the value is larger than D by one, updating of the calculation result is stopped.

【0020】この構成によると、拡張演算器側の拡張命
令による演算結果がCPUに読み出されるか否かが、C
PU側からの読み出し命令の実行前に判明し、読み出し
対象の演算結果がその後の別の拡張命令により書き換え
られないことを保証することにより、例え、拡張演算器
に拡張命令を発行した後に、その拡張命令を実行し演算
結果の読み出し命令を実行するまでに、当該拡張命令に
時間のかかる演算処理が必要だったとしても、その処理
期間中に拡張演算器に対して先行的に続けて複数の命令
を発行する。
According to this configuration, it is determined whether or not the operation result by the extension instruction on the extension operation unit side is read out by the CPU.
It is known before the execution of the read instruction from the PU side, and by guaranteeing that the operation result to be read cannot be rewritten by another extended instruction thereafter, for example, after issuing an extended instruction to the extended arithmetic unit, Even if the extended instruction requires a time-consuming operation before the extended instruction is executed and the operation result read instruction is executed, a plurality of extended arithmetic units are successively preceded during the processing period. Issue an instruction.

【0021】以下、本発明の実施の形態を示す演算処理
装置について、図面を参照しながら具体的に説明する。
図8は本実施の形態の演算処理装置によるシステム構成
の概要を示すブロック図である。この演算処理装置のシ
ステム構成は、図8に示すように、メモリ(24)に配
置された命令やデータを読み込み、演算、各種データの
入出力、拡張演算器(22)への拡張命令の発行を行う
CPU(21)と、CPU(21)が各種処理を実行す
るための命令やデータを保持するメモリ(24)と、C
PU(21)とメモリ(24)とを接続するメインバス
(25)と、CPU(21)から発行された拡張命令に
基づき演算処理を実行する拡張演算器(22)と、CP
U(21)と拡張演算器(22)とを接続する拡張演算
器用バス(23)とで構成される。なおここでは、メモ
リ(24)に配置された命令には、拡張演算器(22)
用の拡張命令をCPU(21)から拡張演算器(22)
へ発行するための拡張命令発行命令と、拡張演算器(2
2)での拡張命令による演算結果をCPU(21)によ
り拡張演算器(22)から読み出すための拡張命令結果
読み出し命令とが含まれる。
Hereinafter, an arithmetic processing unit according to an embodiment of the present invention will be specifically described with reference to the drawings.
FIG. 8 is a block diagram illustrating an outline of a system configuration using the arithmetic processing device according to the present embodiment. As shown in FIG. 8, the system configuration of this arithmetic processing device reads instructions and data arranged in a memory (24), performs operations, inputs / outputs various data, and issues extended instructions to an extended arithmetic unit (22). A memory (24) for storing instructions and data for the CPU (21) to execute various processes;
A main bus (25) for connecting the PU (21) and the memory (24), an extended arithmetic unit (22) for executing arithmetic processing based on an extended instruction issued from the CPU (21),
An extended arithmetic unit bus (23) for connecting the U (21) and the extended arithmetic unit (22). Here, the instructions arranged in the memory (24) include the extended arithmetic unit (22)
Extended instruction for CPU from CPU (21) to extended arithmetic unit (22)
Instruction to issue to the extended arithmetic unit (2
An extended instruction result read instruction for reading the operation result of the extended instruction in 2) from the extended arithmetic unit (22) by the CPU (21) is included.

【0022】本実施の形態の演算処理装置において、拡
張命令結果読み出し命令として、その処理実行に遅延を
伴うものがあり、そのような拡張命令結果読み出し命令
に対する遅延動作について、図5を用いて以下に説明す
る。
In the arithmetic processing unit of the present embodiment, there is an extended instruction result read instruction that involves a delay in the execution of the processing, and a delay operation for such an extended instruction result read instruction will be described with reference to FIG. Will be described.

【0023】図5は本実施の形態の演算処理装置におけ
るCPU(21)側の拡張命令結果読み出し命令に対す
る遅延動作を示す概念図であり、遅延を伴う拡張命令結
果読み出し命令の配置順序と実行順序の一例を表したも
のである。
FIG. 5 is a conceptual diagram showing a delay operation for an extended instruction result read instruction on the CPU (21) side in the arithmetic processing unit according to the present embodiment. FIG.

【0024】exは拡張命令の発行命令であり、rea
dは拡張命令発行命令exにより発光された拡張命令に
よる演算結果を読み出す命令である。ex及びread
の第1オペランドであるAは命令の対象となるレジスタ
を示し、readの第2オペランドである3はread
を実行する際に実行順序を繰り下げる命令数を示してい
る。その他のA〜Dは任意の処理を実行するための当該
命令である。
Ex is an instruction to issue an extended instruction, and
“d” is an instruction for reading out the operation result of the extension instruction emitted by the extension instruction issuing instruction ex. ex and read
A, which is the first operand of the register, indicates a register to be subjected to the instruction, and 3 which is the second operand of the read,
Indicates the number of instructions that move down the execution order when executing. Other instructions A to D are instructions for executing an arbitrary process.

【0025】本実施の形態では、CPU(21)の実行
命令が、命令配置順序(141)のとおりの順序で図1
の命令バッファ(121)内に並んでいるとき、CPU
(21)による命令の実行順序は、命令実行順序(14
2)が示す順番で実行される。
In this embodiment, the execution instructions of the CPU (21) are arranged in the order shown in the instruction arrangement order (141).
CPU is in line with the instruction buffer (121)
The instruction execution order according to (21) is the instruction execution order (14
The operations are performed in the order shown in 2).

【0026】続いて、CPU(21)側で、図5の命令
実行順序(142)に従って命令が実行された場合の実
行結果を説明する。まずCPU(21)は、拡張命令発
行命令A(231)を実行し、第1の拡張命令を拡張演
算器(22)に発行する。拡張演算器(22)は、発行
された第1の拡張命令に基づいてその拡張命令に従う処
理実行を開始する。ただし、拡張演算器(22)による
拡張命令の実行は、CPU(21)の命令実行と並列し
て行われる。
Next, the execution result when the CPU (21) executes an instruction in accordance with the instruction execution order (142) of FIG. 5 will be described. First, the CPU (21) executes the extended instruction issuing instruction A (231) and issues the first extended instruction to the extended arithmetic unit (22). The extension operation unit (22) starts processing according to the issued first extension instruction based on the issued first extension instruction. However, the execution of the extension instruction by the extension arithmetic unit (22) is performed in parallel with the instruction execution of the CPU (21).

【0027】次に、CPU(21)は、メモリ(24)
から拡張命令結果読み出し命令A(232)を読み出す
が、オペランドで3命令の遅延を指定されているので、
拡張命令結果読み出し命令A(232)の実行を後に回
す。
Next, the CPU (21) has a memory (24)
Read the extended instruction result read instruction A (232) from, but since the delay of three instructions is specified by the operand,
Execution of the extended instruction result read instruction A (232) is postponed.

【0028】その後、図5の任意の命令Aと拡張命令発
行命令A(233)を実行する。ここで、さらに第2の
拡張命令が拡張演算器(22)に送られる。送られた第
2の拡張命令は、拡張演算器(22)が第2の拡張命令
を実行可能になり次第、拡張演算器(22)で実行を開
始する。
Thereafter, the arbitrary instruction A and the extended instruction issuing instruction A (233) shown in FIG. 5 are executed. Here, the second extension instruction is further sent to the extension arithmetic unit (22). The transmitted second extended instruction starts to be executed in the extended arithmetic unit (22) as soon as the extended arithmetic unit (22) becomes able to execute the second extended instruction.

【0029】次に、CPU(21)は、任意の命令Bを
実行し、その後、後に回された拡張命令結果読み出し命
令A(232)の実行を開始するが、その処理実行の完
了は、拡張演算器(22)において拡張命令発行命令
(231)により発行された第1の拡張命令による演算
処理の実行が完了されるまで待たされる。ただし、ここ
で言う「拡張命令結果読み出し命令(232)の実行完
了」とは、「拡張命令結果の読み出し」を指す。
Next, the CPU (21) executes an arbitrary instruction B, and thereafter starts execution of an extended instruction result read instruction A (232) which is later executed. The operation unit (22) waits until the execution of the arithmetic processing by the first extended instruction issued by the extended instruction issuing instruction (231) is completed. However, the “completion of execution of the extended instruction result read instruction (232)” here indicates “reading of the extended instruction result”.

【0030】これにより、拡張命令結果読み出し命令
(232)の第1のオペランドで指定されているレジス
タAには、第1の拡張命令による演算結果が入っている
ことが保証される。要するに、本実施の形態において、
CPUが、拡張命令結果読み出し命令A(232)の実
行を、それより前に配置されている命令の中で一番後ろ
に配置された拡張命令発行命令A(231)で発行され
る第1の拡張命令の実行完了まで待つことにより、拡張
命令発行命令A(231)で発行される拡張命令の結果
を読み出せることが保証される。
Thus, it is guaranteed that the register A specified by the first operand of the extended instruction result read instruction (232) contains the operation result of the first extended instruction. In short, in this embodiment,
The CPU executes the execution of the extended instruction result read instruction A (232) by the first extended instruction issuance instruction A (231) arranged last in the instructions arranged earlier. By waiting for the completion of the extension instruction, it is guaranteed that the result of the extension instruction issued by the extension instruction issue instruction A (231) can be read.

【0031】また、CPU(21)は、拡張命令結果読
み出し命令A(232)を遅延して実行することがで
き、そのように実行を遅延することにより、拡張命令結
果読み出し命令(232)以降に配置された拡張命令発
行命令A(233)を先に実行することができる。
The CPU (21) can execute the extended instruction result read instruction A (232) with a delay, and by delaying the execution in this manner, the CPU (21) can execute the extended instruction result read instruction (232) and thereafter. The placed extended instruction issuing instruction A (233) can be executed first.

【0032】これにより、CPU(21)は、拡張演算
器(22)に対して、拡張命令結果読み出し命令A(2
32)より先行的に拡張命令の複数発行が可能となり、
しいては拡張命令結果読み出し命令A(232)に対し
て先行的な拡張命令の複数発行があったとしても、拡張
命令結果の読み出し時に、正しい拡張命令結果を読み出
すことができる。
As a result, the CPU (21) sends the extended instruction result read instruction A (2) to the extended arithmetic unit (22).
32) Multiple extended instructions can be issued earlier than
Further, even when a plurality of extension instructions are issued prior to the extension instruction result read instruction A (232), a correct extension instruction result can be read when the extension instruction result is read.

【0033】ユーザーが本実施の形態の演算処理装置を
用いて、図5の命令配置順序(141)に示すようなプ
ログラムを作成する場合は、まず、ユーザーが図5の命
令実行順序(142)に従ってプログラムを組み、次に
コンパイラにより命令配置順序(141)に示すような
順序に命令を並び替えるとともに、拡張命令結果読み出
し命令A(232)の命令実行順序(142)における
配置に必要な遅延量を計算し、命令配置順序(141)
における拡張命令結果読み出し命令A(232)に対し
て、その第2オペランドの値を決定して付加する。
When the user creates a program as shown in the instruction arrangement order (141) of FIG. 5 using the arithmetic processing unit of the present embodiment, first, the user executes the instruction execution order (142) of FIG. Then, the compiler rearranges the instructions in the order shown in the instruction arrangement order (141) by the compiler, and delays necessary for the arrangement of the extended instruction result read instruction A (232) in the instruction execution order (142). And the instruction arrangement order (141)
, The value of the second operand is determined and added to the extended instruction result read instruction A (232).

【0034】続いて、本実施の形態の演算処理装置にお
ける各回路の構成と動作を説明する。以下、断りなく
「読み出し命令」とある場合、「拡張命令結果を読み出
す読み出し命令」を指すものとする。
Next, the configuration and operation of each circuit in the arithmetic processing unit according to the present embodiment will be described. Hereinafter, a “read command”, unless otherwise noted, refers to a “read command for reading the result of an extended command”.

【0035】図1は本実施の形態の演算処理装置の全体
構成を示すブロック図であり、図8におけるCPU(2
1)と拡張演算器(22)の実行部の概略構成を示すも
のである。ただし、簡略化のため、本発明の特徴に関す
る部分のみを図示してある。また、本実施の形態の演算
処理装置において、クロックに関しての記述はないが、
通常のクロック同期式の演算処理装置と同じように、ク
ロックと同期して動作するものとする。
FIG. 1 is a block diagram showing the overall configuration of the arithmetic processing unit according to the present embodiment.
1 shows a schematic configuration of an execution unit of the extension arithmetic unit (22). However, for the sake of simplicity, only parts relating to the features of the present invention are shown. Further, in the arithmetic processing device according to the present embodiment, there is no description regarding the clock,
It is assumed that it operates in synchronization with a clock in the same manner as a normal clock-synchronous arithmetic processing device.

【0036】CPU(21)は、メモリ(24)からフ
ェッチした命令を格納する命令バッファ(121)と、
読み出し命令バッファ(124)から読み出した遅延を
伴わない読み出し命令(134)か命令バッファ(12
1)から読み出した命令(131)のどちらかを選択
し、命令パイプライン(71)に送る命令セレクタ(1
22)と、命令セレクタ(122)から供給された命令
(132)のデコードや実行を行う命令パイプライン
(71)と、遅延を伴う読み出し命令(133)を一時
的に貯めておく読み出し命令バッファ(124)と、拡
張命令発行命令により発行された拡張命令(82)にI
Dを与え、ID付き拡張命令(201)を出力する拡張
命令ID付与回路(31)と、実行待ちの読み出し命令
のIDを保持する遅延完了IDバッファ(185)と、
読み出し命令ID(62)と拡張演算器で完了した命令
のIDである完了命令ID(54)を比較し、必要なら
ば命令パイプライン(71)を停止させるCPU側命令
ID比較器(35)とを備える。
The CPU (21) includes an instruction buffer (121) for storing instructions fetched from the memory (24),
The read instruction (134) without delay read from the read instruction buffer (124) or the instruction buffer (12).
The instruction selector (1) selects one of the instructions (131) read out from (1) and sends it to the instruction pipeline (71).
22), an instruction pipeline (71) for decoding and executing the instruction (132) supplied from the instruction selector (122), and a read instruction buffer (133) for temporarily storing a read instruction with a delay (133). 124) and the extended instruction (82) issued by the extended instruction
D, an extended instruction ID assigning circuit (31) for outputting an extended instruction with ID (201), a delay completion ID buffer (185) for holding an ID of a read instruction waiting to be executed,
The CPU-side instruction ID comparator (35) for comparing the read instruction ID (62) with the completed instruction ID (54) which is the ID of the instruction completed by the extended arithmetic unit, and stopping the instruction pipeline (71) if necessary. Is provided.

【0037】また、拡張演算器(22)は、拡張命令I
D付与回路(31)から出力されるID付き拡張命令を
格納する拡張命令バッファ(37)と、拡張命令バッフ
ァ(37)から拡張命令(85)を読み出し、拡張命令
(85)に従い演算を行う演算回路(73)と、演算回
路(73)の結果を保存し、また、演算に必要な値を供
給するレジスタファイル(74)と、最後にレジスタフ
ァイル(74)に値を書き込んだ拡張命令の拡張命令I
D(87)を保持する完了命令ID保持レジスタ(3
6)と、遅延完了IDバッファ(185)から出力され
る読み出し命令ID(62)と有効フラグ(151)、
および演算回路(73)から出力されるレジスタファイ
ルに演算結果を書き込む直前の拡張命令のIDである書
き込み拡張命令ID(112)の値により、必要ならば
演算回路(73)をロックする拡張演算器側命令ID比
較器(101)とを備える。
The extension operation unit (22) is provided with an extension instruction I
An extension instruction buffer (37) for storing an extension instruction with ID output from the D assignment circuit (31), and an operation for reading an extension instruction (85) from the extension instruction buffer (37) and performing an operation according to the extension instruction (85) A register file (74) that stores the result of the circuit (73), the arithmetic circuit (73), and supplies a value required for the operation; and an extension of the extension instruction that finally writes the value to the register file (74). Instruction I
D (87) holding a complete instruction ID holding register (3
6), a read command ID (62) output from the delay completion ID buffer (185) and a valid flag (151),
And an extension operation unit that locks the operation circuit (73) if necessary, based on the value of the write extension instruction ID (112), which is the ID of the extension instruction immediately before writing the operation result in the register file output from the operation circuit (73). Side instruction ID comparator (101).

【0038】図1のCPU(21)は、メモリ(24)
から供給された命令を命令デコードステージ(123)
でデコードした後、デコードされた命令が拡張演算器
(22)用の拡張命令であった場合、拡張命令発行通知
(81)と拡張命令(82)とを拡張命令ID付与回路
(31)に送る。
The CPU (21) in FIG.
The instruction supplied from the instruction decode stage (123)
If the decoded instruction is an extended instruction for the extended operation unit (22) after the decoding, the extended instruction issue notification (81) and the extended instruction (82) are sent to the extended instruction ID assigning circuit (31). .

【0039】拡張命令ID付与回路(31)は、図4に
示すように、拡張命令ID(53)を保持するための拡
張命令ID保持レジスタ(32)と、拡張命令発行通知
(81)があった場合に、拡張命令ID保持レジスタ
(32)の値をインクリメントした値を出力するALU
(191)と、拡張命令発行通知(81)がある場合に
はALU(191)の出力を選択し、拡張命令発行通知
(81)がない場合には拡張命令ID保持レジスタ(3
2)の値を選択するマルチプレクサ(192)とを備え
る。
As shown in FIG. 4, the extension instruction ID assigning circuit (31) has an extension instruction ID holding register (32) for holding the extension instruction ID (53) and an extension instruction issue notification (81). ALU that outputs a value obtained by incrementing the value of the extended instruction ID holding register (32)
(191) and the output of the ALU (191) is selected when there is an extension instruction issue notice (81), and when there is no extension instruction issue notice (81), the extension instruction ID holding register (3) is selected.
And a multiplexer (192) for selecting the value of 2).

【0040】拡張命令発行通知(81)を受けた拡張命
令ID付与回路(31)は、内部の拡張命令ID保持レ
ジスタ(32)の内容をインクリメントし、インクリメ
ントされた拡張命令ID(53)を読み出し命令バッフ
ァ(124)に伝達する。また、拡張命令発行通知(2
02)と、拡張命令ID(53)を拡張命令(82)に
付加したID付き拡張命令(201)を拡張命令バッフ
ァ(37)に送る。
Upon receiving the extension instruction issue notification (81), the extension instruction ID assigning circuit (31) increments the contents of the internal extension instruction ID holding register (32) and reads the incremented extension instruction ID (53). It is transmitted to the instruction buffer (124). In addition, the extension instruction issue notification (2
02) and an extended instruction with ID (201) obtained by adding the extended instruction ID (53) to the extended instruction (82) is sent to the extended instruction buffer (37).

【0041】拡張命令バッファ(37)に送られたID
付き拡張命令(201)は、図6に示すように、拡張命
令IDと拡張命令の両方をひとまとめとして拡張命令バ
ッファ(37)に格納され、拡張命令バッファ(37)
から、拡張命令IDが付加された拡張命令(85)が演
算回路(73)に供給される。
ID sent to extended instruction buffer (37)
As shown in FIG. 6, the extended instruction (201) with the extension is stored in the extended instruction buffer (37) together with both the extended instruction ID and the extended instruction.
Then, the extended instruction (85) to which the extended instruction ID is added is supplied to the arithmetic circuit (73).

【0042】演算回路(73)は、レジスタファイルア
クセスバス(86)を介し、レジスタファイル(74)
の内容を変更する演算を行う。レジスタファイル(7
4)を変更した拡張命令に付加されていた拡張命令ID
(87)は、完了命令ID保持レジスタ(36)に格納
される。
The arithmetic circuit (73) is connected to the register file (74) via the register file access bus (86).
Perform an operation to change the contents of Register file (7
Extended instruction ID added to extended instruction that changed 4)
(87) is stored in the completion instruction ID holding register (36).

【0043】図1の命令パイプライン(71)は、命令
デコードステージ(123)において命令セレクタ(1
22)から供給された命令(132)をデコードした
後、デコードされた命令(133)が、拡張演算器(2
2)用の拡張命令の結果を読み出すための遅延を伴う読
み出し命令であった場合、読み出し命令バッファ(12
4)に遅延を伴う読み出し命令及びその遅延量(13
3)を送り、デコードされた遅延を伴う読み出し命令は
無効とする。
The instruction pipeline (71) shown in FIG. 1 includes an instruction selector (1) at the instruction decode stage (123).
After decoding the instruction (132) supplied from (22), the decoded instruction (133) is added to the extended arithmetic unit (2).
If the read instruction involves a delay for reading the result of the extended instruction for 2), the read instruction buffer (12
4) Read command with delay and its delay amount (13
3) to invalidate the read instruction with the decoded delay.

【0044】読み出し命令バッファ(124)は先入れ
先出し方式のバッファであり、遅延を伴う読み出し命令
及び遅延量(133)が送られた読み出し命令バッファ
(124)は、図7に示すように、読み出し命令バッフ
ァ(124)内に遅延を伴う読み出し命令及び遅延量
(133)を格納する。
The read command buffer (124) is a first-in first-out buffer, and the read command buffer (124) to which the read command with delay and the delay amount (133) are sent is, as shown in FIG. The read command with delay and the delay amount (133) are stored in (124).

【0045】その際に、図1の拡張命令ID保持レジス
タ(32)を参照し、その拡張命令ID(53)を読み
出し命令に付加して格納することにより、読み出し命令
と、それより前に配置されている命令の中で一番後ろに
配置された拡張命令発行命令により発行された拡張命令
とを対応付けることができる。
At this time, the extended instruction ID (53) is added to the read instruction and stored by referring to the extended instruction ID holding register (32) in FIG. And the extended instruction issued by the extended instruction issuing instruction arranged at the end of the instructions.

【0046】読み出し命令バッファ(124)は、命令
セレクタ(122)から命令供給通知(137)を受け
ると、読み出し命令バッファ(124)内にバッファリ
ングされている遅延量全てをデクリメントする。デクリ
メントされた結果、先頭の読み出し命令の遅延量が0と
なった場合、先頭の読み出し命令を、遅延を伴わない読
み出し命令(134)として命令セレクタ(122)に
供給し、その命令に付加されていたIDを遅延完了命令
ID(135)として遅延完了IDバッファ(185)
に送る。遅延完了IDバッファ(185)は、先入れ先
出し方式のバッファで、読み出し命令バッファ(12
4)から送られた遅延完了命令ID(135)を格納す
る。
Upon receiving the instruction supply notification (137) from the instruction selector (122), the read instruction buffer (124) decrements all delay amounts buffered in the read instruction buffer (124). As a result of the decrement, when the delay amount of the first read instruction becomes 0, the first read instruction is supplied to the instruction selector (122) as a read instruction (134) without delay, and is added to the instruction. The completed ID is used as the delay completion instruction ID (135) and the delay completion ID buffer (185)
Send to The delay completion ID buffer (185) is a first-in first-out buffer, and is a read instruction buffer (12).
The delay completion command ID (135) sent from 4) is stored.

【0047】遅延完了IDバッファ(185)は、読み
出し命令ID保持レジスタ(34)を備え、格納してい
る最も古い遅延完了命令IDを読み出し命令ID(6
2)として、読み出し命令ID保持レジスタ(34)に
格納する。また、命令パイプライン(71)から送られ
た読み出し命令実行通知(139)を受けた場合、バッ
ファ内の最も古い遅延完了命令IDを消去し、残された
遅延完了命令IDの中で最も古い遅延完了命令IDの値
で、読み出し命令ID保持レジスタ(34)を更新す
る。
The delay completion ID buffer (185) includes a read instruction ID holding register (34), and reads out the stored oldest delay completion instruction ID from the stored instruction ID (6).
As 2), it is stored in the read command ID holding register (34). When the read instruction execution notification (139) sent from the instruction pipeline (71) is received, the oldest delayed completion instruction ID in the buffer is deleted, and the oldest delayed completed instruction ID among the remaining delayed completed instruction IDs is deleted. The read instruction ID holding register (34) is updated with the value of the completed instruction ID.

【0048】この遅延完了IDバッファ(185)によ
り、読み出し命令ID保持レジスタ(34)に保持され
た読み出し命令ID(62)は、CPU(21)の中で
次に実行される読み出し命令に付加されたIDとなる。
ただし、遅延完了IDバッファ(185)は、有効フラ
グ(151)を持ち、遅延完了IDバッファ(185)
が空の場合に有効フラグ(151)は0となり、読み出
し命令IDには無意味な値が入る。また、遅延完了ID
バッファ(185)が空でない場合は、有効フラグ(1
51)は1となる。
The read command ID (62) held in the read command ID holding register (34) by the delay completion ID buffer (185) is added to the next read command executed in the CPU (21). ID.
However, the delay completion ID buffer (185) has a valid flag (151) and the delay completion ID buffer (185).
Is empty, the valid flag (151) becomes 0, and a meaningless value enters the read command ID. Also, delay completion ID
If the buffer (185) is not empty, the valid flag (1
51) becomes 1.

【0049】図1のCPU側命令ID比較器(35)
は、図2に示すように、遅延完了IDバッファ(18
5)内の読み出し命令ID保持レジスタ(34)の内容
である読み出し命令ID(62)とおよび完了命令ID
保持レジスタ(36)の内容である完了命令ID(5
4)とを比較し、その両者が等しければ1を出力し、そ
うでなければ0を出力するALU(212)と、ALU
(212)の出力と遅延完了IDバッファ(185)内
の有効フラグ(151)との論理積をとるAND回路
(211)と、その値を保持する命令ID不一致フラグ
(84)を備える。
The instruction ID comparator (35) on the CPU side in FIG.
Is a delay completion ID buffer (18) as shown in FIG.
5) Read instruction ID (62), which is the content of read instruction ID holding register (34), and completion instruction ID
Completion instruction ID (5) which is the content of the holding register (36)
4) are compared, and if both are equal, 1 is output; otherwise, 0 is output.
An AND circuit (211) which takes the logical product of the output of (212) and the valid flag (151) in the delay completion ID buffer (185), and an instruction ID mismatch flag (84) holding the value.

【0050】CPU側命令ID比較器(35)内の命令
ID不一致フラグ(84)は、前述したALU(21
2)とAND回路(211)の機能により、有効フラグ
が1で且つCPU(21)で次に実行される読み出し命
令に付加されたIDである読み出し命令ID(62)と
拡張演算器(22)で最も新しく完了された拡張命令に
付加された完了命令IDとが一致した場合に1となり、
それ以外は0となる。
The instruction ID mismatch flag (84) in the instruction ID comparator (35) on the CPU side indicates that the ALU (21
Due to 2) and the function of the AND circuit (211), the read command ID (62), which is the ID added to the read command to be executed next by the CPU (21), and the extended arithmetic unit (22) Becomes 1 when the completed instruction ID added to the most recently completed extended instruction matches the completed instruction ID,
Otherwise, it is 0.

【0051】命令パイプライン(71)が、拡張命令の
計算結果を参照する読み出し命令を実行して拡張命令の
演算結果をレジスタファイル(74)から読み出す場
合、CPU側命令ID比較器(35)内の命令ID不一
致フラグ(84)を参照し、命令ID不一致フラグ(8
4)が1の場合は、命令パイプライン(71)をロック
し、読み出し命令の実行を、命令ID不一致フラグ(8
4)が0になるまで待たせる。
When the instruction pipeline (71) executes the read instruction referring to the calculation result of the extension instruction and reads the operation result of the extension instruction from the register file (74), the instruction ID comparator (35) in the CPU side. The instruction ID mismatch flag (8) is referred to by referring to the instruction ID mismatch flag (84).
If 4) is 1, the instruction pipeline (71) is locked, and the execution of the read instruction is stopped by the instruction ID mismatch flag (8).
4) Wait until the value becomes 0.

【0052】命令ID不一致フラグ(84)が0になる
まで読み出し命令の実行を待った後、または命令ID不
一致フラグ(84)がもともと0の場合、レジスタファ
イルアクセスバス(83)を介して、拡張命令の演算結
果を、レジスタファイル(74)から読み出し、読み出
し命令の実行を続ける。
After waiting for the execution of the read instruction until the instruction ID mismatch flag (84) becomes 0, or when the instruction ID mismatch flag (84) is originally 0, the extension instruction is sent via the register file access bus (83). Is read from the register file (74), and the execution of the read command is continued.

【0053】この動作により、読み出し命令実行時に、
対応付けられた拡張命令の完了が保証され、正しい拡張
命令の演算結果を得ることができる。続いて命令セレク
タ(122)の動作について説明する。
By this operation, when executing the read command,
Completion of the associated extended instruction is guaranteed, and the operation result of the correct extended instruction can be obtained. Next, the operation of the instruction selector (122) will be described.

【0054】図1の命令セレクタ(122)は、読み出
し命令バッファ(124)から遅延を伴わない読み出し
命令(134)が供給されていない場合、命令バッファ
(121)から通常の命令(131)を読み込み、命令
(132)として命令パイプライン(71)に供給し、
読み出し命令バッファ(124)から遅延を伴わない読
み出し命令(134)が供給されている場合は、遅延を
伴わない読み出し命令(134)を、命令(132)と
して命令パイプライン(71)に供給する。また、いず
れの場合も、命令(132)を命令パイプライン(7
1)に供給した場合、命令供給通知(137)を読み出
し命令バッファ(124)に送る。
The instruction selector (122) of FIG. 1 reads the normal instruction (131) from the instruction buffer (121) when the read instruction (134) without delay is not supplied from the read instruction buffer (124). , As an instruction (132) to the instruction pipeline (71),
When the read instruction (134) without delay is supplied from the read instruction buffer (124), the read instruction (134) without delay is supplied to the instruction pipeline (71) as the instruction (132). In each case, the instruction (132) is stored in the instruction pipeline (7).
When the instruction is supplied to 1), an instruction supply notification (137) is sent to the read instruction buffer (124).

【0055】この命令セレクタ(122)の動作によ
り、遅延された読み出し命令を、命令バッファ(12
1)から供給される命令(131)の間に割り込ませて
命令パイプライン(71)に送ることができる。
By the operation of the instruction selector (122), the delayed read instruction is transferred to the instruction buffer (12).
An instruction (131) supplied from 1) can be interrupted and sent to the instruction pipeline (71).

【0056】前述した命令セレクタ(122)、読み出
し命令バッファ(124)、命令パイプライン(71)
の動作により、読み出し命令の実行を遅延させることが
可能となり、読み出し命令の実行を遅延させることによ
り、読み出し命令とそれより前に配置されている命令の
中で一番後ろに配置された拡張命令発行命令を対応つけ
た後、読み出し命令実行前に、さらに別の拡張命令を発
行することができる。
The above-described instruction selector (122), read instruction buffer (124), instruction pipeline (71)
Operation, the execution of the read instruction can be delayed, and by delaying the execution of the read instruction, the read instruction and the extended instruction located at the rear end of the instructions located before the read instruction are delayed. After associating the issued instruction, another extended instruction can be issued before executing the read instruction.

【0057】次に読み出し命令によりCPU(21)が
拡張演算器(22)から演算結果を読み出す前に、その
演算結果が、対応する拡張命令とは異なる他の拡張命令
により変更されることを防ぐ方法を示す。
Next, before the CPU (21) reads the operation result from the extended operation unit (22) by the read instruction, the operation result is prevented from being changed by another extension instruction different from the corresponding extension instruction. Here's how.

【0058】演算回路(73)は、レジスタファイル
(74)に演算結果を書き込む直前の拡張命令のIDで
ある書き込み拡張命令ID(112)を、図3の拡張演
算器側命令ID比較器(101)に出力する。
The operation circuit (73) converts the write extension instruction ID (112), which is the ID of the extension instruction immediately before writing the operation result into the register file (74), into the extension operation unit side instruction ID comparator (101) of FIG. ).

【0059】この拡張演算器側命令ID比較器(10
1)は、図7に示す遅延完了IDバッファ(185)内
の読み出し命令ID保持レジスタ(34)の内容である
読み出し命令ID(62)と書き込み拡張命令ID(1
12)とを比較し、書き込み拡張命令ID(112)の
ほうが1大きい場合1を出力し、そうでなければ0を出
力するALU(214)と、ALU(214)の出力と
遅延完了IDバッファ(185)内の有効フラグ(15
1)との論理積をとるAND回路(213)と、その値
を保持する書込み禁止フラグ(113)を備える。
This extended operation unit side instruction ID comparator (10
1) are the read instruction ID (62) and the write extended instruction ID (1) which are the contents of the read instruction ID holding register (34) in the delay completion ID buffer (185) shown in FIG.
12), an ALU (214) that outputs 1 when the write extension instruction ID (112) is larger by 1 and otherwise outputs 0, an output of the ALU (214) and a delay completion ID buffer ( 185) (15)
An AND circuit (213) for performing a logical AND operation with 1) and a write inhibit flag (113) for holding the AND circuit are provided.

【0060】拡張演算器側命令ID比較器(101)内
の書き込み禁止フラグ(113)は、前述したALU
(214)とAND回路(213)の機能により、有効
フラグが1で且つレジスタファイル(74)に演算結果
を書き込む直前の拡張命令のIDである書き込み拡張命
令ID(112)が、CPU(21)で次に実行される
読み出し命令に付加されたIDである読み出し命令ID
(62)よりも1大きい場合に1となり、それ以外は0
となる。
The write inhibit flag (113) in the instruction ID comparator (101) on the extended computing unit side is
Due to (214) and the function of the AND circuit (213), the write extended instruction ID (112), which is the ID of the extended instruction immediately before the operation result is written into the register file (74) and the validity flag is 1, becomes the CPU (21). A read instruction ID which is an ID added to a read instruction executed next.
1 if greater than (62), 0 otherwise
Becomes

【0061】演算回路(73)が拡張命令による演算結
果をレジスタファイル(74)に格納する場合、書き込
み禁止フラグ(113)を参照し、書き込み禁止フラグ
(113)が1の場合は、演算回路(73)をロック
し、拡張命令の実行を書き込み禁止フラグ(113)が
0になるまで待たせる。書き込み禁止フラグ(113)
が0になるまで拡張命令の実行を待った後、または書き
込み禁止フラグ(113)がもともと0の場合は、レジ
スタファイルアクセスバス(86)を介して、拡張命令
の演算結果を、レジスタファイル(74)に書き込み、
拡張命令の実行を続ける。
When the operation circuit (73) stores the operation result of the extension command in the register file (74), the operation circuit (73) refers to the write inhibit flag (113). 73) is locked, and the execution of the extension instruction is made to wait until the write inhibit flag (113) becomes 0. Write inhibit flag (113)
After the execution of the extension instruction is waited until the value of the extension instruction becomes 0, or when the write inhibit flag (113) is originally 0, the operation result of the extension instruction is transferred to the register file (74) via the register file access bus (86). Write to
Continue execution of extension instructions.

【0062】この動作により、読み出し命令が演算結果
を読み出す前に、対応する拡張命令とは異なる拡張命令
により、演算結果が変更されることを防ぐことができ
る。
According to this operation, it is possible to prevent the operation result from being changed by an extension instruction different from the corresponding extension instruction before the read instruction reads the operation result.

【0063】[0063]

【発明の効果】以上のように本発明によれば、CPU側
に拡張演算器の演算結果を読み出す際に、その読み出し
に先行してCPU側から拡張演算器に対して複数の拡張
命令が発行されていたとしても、CPU側で、その読み
出しに対応して拡張演算器において完了していなければ
ならない拡張命令を特定して、拡張演算器における読み
出し対応の演算の完了情報を得て、CPU側からの読み
出しに対して正しい演算結果を読み出すことを可能とす
ることにより、全ての演算の終了を待つことなく、複数
の拡張命令を続けて拡張演算器側に発行することができ
る。
As described above, according to the present invention, when the operation result of the extended operation unit is read to the CPU, a plurality of extension instructions are issued from the CPU to the extended operation unit prior to the reading. Even if it has been performed, the CPU side specifies an extension instruction that must be completed in the extended arithmetic unit in response to the reading, obtains the completion information of the operation corresponding to the read in the extended arithmetic unit, and By reading the correct operation result in response to the read operation from the CPU, it is possible to continuously issue a plurality of extension instructions to the extension operation unit without waiting for the end of all the operations.

【0064】また、拡張演算器側の拡張命令による演算
結果がCPUに読み出されるか否かが、CPU側からの
読み出し命令の実行前に判明し、読み出し対象の演算結
果がその後の別の拡張命令により書き換えられないこと
を保証することにより、例え、拡張演算器に拡張命令を
発行した後に、その拡張命令を実行し演算結果の読み出
し命令を実行するまでに、当該拡張命令に時間のかかる
演算処理が必要だったとしても、その処理期間中に拡張
演算器に対して先行的に続けて複数の命令を発行するこ
とができる。
Further, it is known before the execution of the read instruction from the CPU whether or not the operation result by the extension instruction on the extension operation unit side is read out by the CPU, and the operation result to be read is obtained by another extension instruction after that. For example, after an extended instruction is issued to an extended arithmetic unit, it takes time to execute the extended instruction and execute an instruction to read out the operation result. Is required, a plurality of instructions can be issued successively to the extended arithmetic unit during the processing period.

【0065】以上のため、CPUにおいて、拡張演算器
による演算完了の待ち状態をなくし、命令コードサイズ
の増加を抑え、かつその命令コードによる演算効率を向
上することができるとともに、拡張演算器において、演
算処理中の時間的ロスを極力なくし効率的に利用するこ
とができ、演算処理システムとしてのパフォーマンスを
向上することができる。
As described above, in the CPU, the waiting state of the completion of the operation by the extended arithmetic unit can be eliminated, the increase in the instruction code size can be suppressed, and the operation efficiency by the instruction code can be improved. Time loss during arithmetic processing can be minimized, and the time can be efficiently used, and the performance of the arithmetic processing system can be improved.

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

【図1】本発明の実施の形態の演算処理装置の全体構成
を示すブロック図
FIG. 1 is a block diagram showing an overall configuration of an arithmetic processing device according to an embodiment of the present invention;

【図2】同実施の形態におけるCPU側命令ID比較器
の構成を示すブロック図
FIG. 2 is a block diagram showing a configuration of a CPU-side instruction ID comparator according to the embodiment;

【図3】同実施の形態における拡張演算器側命令ID比
較器の構成を示すブロック図
FIG. 3 is a block diagram showing a configuration of an extended operation unit-side instruction ID comparator according to the embodiment;

【図4】同実施の形態における拡張命令ID付与回路の
構成を示すブロック図
FIG. 4 is a block diagram showing a configuration of an extended instruction ID assigning circuit according to the embodiment;

【図5】同実施の形態における読み出し命令遅延動作を
示す概念図
FIG. 5 is a conceptual diagram showing a read command delay operation in the embodiment.

【図6】同実施の形態における拡張命令バッファの内容
構造を示す概念図
FIG. 6 is a conceptual diagram showing a content structure of an extended instruction buffer according to the embodiment;

【図7】同実施の形態における読み出し命令バッファと
遅延完了IDバッファとの関係を示す概念図
FIG. 7 is a conceptual diagram showing a relationship between a read instruction buffer and a delay completion ID buffer according to the embodiment;

【図8】同実施の形態の演算処理装置によるシステム構
成の概要を示すブロック図
FIG. 8 is a block diagram showing an outline of a system configuration of the arithmetic processing unit according to the embodiment;

【図9】従来の演算処理の流れを示す概念図FIG. 9 is a conceptual diagram showing a flow of a conventional arithmetic processing.

【図10】従来の他の演算処理の流れを示す概念図FIG. 10 is a conceptual diagram showing a flow of another conventional arithmetic processing.

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

21 CPU 22 拡張演算器 23 拡張演算器用バス 24 メモリ 25 メインバス 31 拡張命令ID付与回路 32 拡張命令ID保持レジスタ 34 読み出し命令ID保持レジスタ 35 CPU側命令ID比較器 36 完了命令ID保持レジスタ 37 拡張命令バッファ 53 拡張命令ID 54 完了命令ID 62 読み出し命令ID 71 命令パイプライン 73 演算回路 74 レジスタファイル 81 拡張命令発行通知 82 拡張命令 83 レジスタファイルアクセスバス 84 命令ID不一致フラグ 85 拡張命令 86 レジスタファイルアクセスバス 87 拡張命令ID 101 拡張演算器側命令ID比較器 112 書き込み拡張命令ID 113 書き込み禁止フラグ 121 命令バッファ 122 命令セレクタ 123 命令デコードステージ 124 読み出し命令バッファ 131 命令 132 命令 133 遅延を伴う読み出し命令及び遅延量 134 遅延を伴わない読み出し命令 135 遅延完了命令ID 137 命令供給通知 139 読み出し命令実行通知 141 命令配置順序 142 命令実行順序 151 有効フラグ 161 拡張命令発行命令A 162 拡張結果読み出し命令A 163 拡張命令発行命令B 164 拡張結果読み出し命令B 165 拡張命令α 166 拡張命令β 185 遅延完了IDバッファ 191 ALU 192 マルチプレクサ 201 ID付き拡張命令 202 拡張命令発行通知 211 AND回路 212 ALU 213 AND回路 214 ALU 231 拡張命令発行命令 232 拡張命令結果読み出し命令 233 拡張命令発行命令 21 CPU 22 Extended arithmetic unit 23 Extended arithmetic unit bus 24 Memory 25 Main bus 31 Extended instruction ID assignment circuit 32 Extended instruction ID holding register 34 Read instruction ID holding register 35 CPU side instruction ID comparator 36 Completed instruction ID holding register 37 Extended instruction Buffer 53 Extended instruction ID 54 Completion instruction ID 62 Read instruction ID 71 Instruction pipeline 73 Arithmetic circuit 74 Register file 81 Extended instruction issue notification 82 Extended instruction 83 Register file access bus 84 Instruction ID mismatch flag 85 Extended instruction 86 Register file access bus 87 Extended instruction ID 101 Extended operation unit side instruction ID comparator 112 Write extended instruction ID 113 Write inhibit flag 121 Instruction buffer 122 Instruction selector 123 Instruction decode stage 12 Read instruction buffer 131 Instruction 132 Instruction 133 Read instruction with delay and delay amount 134 Read instruction without delay 135 Delay complete instruction ID 137 Instruction supply notification 139 Read instruction execution notification 141 Instruction placement order 142 Instruction execution order 151 Valid flag 161 Extension Instruction issue instruction A 162 Extended result read instruction A 163 Extended instruction issue instruction B 164 Extended result read instruction B 165 Extended instruction α 166 Extended instruction β 185 Delay completion ID buffer 191 ALU 192 Multiplexer 201 Extended instruction with ID 202 Extended instruction issue notification 211 AND circuit 212 ALU 213 AND circuit 214 ALU 231 Extended instruction issue instruction 232 Extended instruction result read instruction 233 Extended instruction issue instruction

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 CPUと前記CPUから供給される拡張
命令に従って前記CPUと並列に演算処理する拡張演算
器とからなる演算処理装置において、前記CPUから前
記拡張演算器に供給される前記拡張命令にIDを付加す
る手段と、前記CPUから前記拡張演算器における拡張
命令による演算結果を参照するための読み出し命令をデ
コードする時に、その読み出し命令に、前記演算結果を
得るための拡張命令を示す情報を付加する手段と、前記
CPUによる前記読み出し命令の実行時に、前記拡張命
令に付加されたIDと前記読み出し命令に付加された情
報とを比較する手段と、前記CPUによる読み出し命令
の実行を制御する手段とを備え、前記制御手段を、前記
読み出し命令の実行時における前記比較の結果、前記拡
張命令に付加されたIDと前記読み出し命令に付加され
た情報とが一致するまで、前記読み出し命令の実行を停
止するよう構成したことを特徴とする演算処理装置。
1. An arithmetic processing device comprising a CPU and an extended arithmetic unit for performing arithmetic processing in parallel with the CPU in accordance with an extended instruction supplied from the CPU, wherein the extended instruction supplied from the CPU to the extended arithmetic unit is Means for adding an ID, and when decoding a read instruction for referring to an operation result by the extension instruction in the extension operation unit from the CPU, information indicating the extension instruction for obtaining the operation result is included in the read instruction. Means for adding, means for comparing the ID added to the extension instruction with the information added to the read instruction when the CPU executes the read instruction, and means for controlling the execution of the read instruction by the CPU. Wherein the control means is added to the extension instruction as a result of the comparison at the time of execution of the read instruction. An arithmetic processing device, wherein execution of the read command is stopped until an ID matches information added to the read command.
【請求項2】 読み出し命令の実行時の実行順序を得る
ためのCPUの各種実行命令の配置順序における読み出
し命令を、対応する拡張命令とその次の拡張命令との間
に配置し、前記読み出し命令に付加する情報として、そ
の読み出し命令より前で最後に配置された拡張命令のI
Dを付加する手段と、前記配置順序における読み出し命
令に、前記各種実行命令の命令数を示すオペランドを付
加し、前記読み出し命令の実行時に、その実行順序を前
記オペランドが示す命令数だけ繰り下げて実行する手段
とを備えたことを特徴とする請求項1に記載の演算処理
装置。
2. A read instruction in an arrangement order of various execution instructions of a CPU for obtaining an execution order at the time of execution of a read instruction is arranged between a corresponding extension instruction and a next extension instruction. Is added to the I of the last extended instruction placed before the read instruction.
A means for adding D and an operand indicating the number of instructions of the various execution instructions are added to the read instructions in the arrangement order, and when the read instruction is executed, the execution order is reduced by the number of instructions indicated by the operand and executed. 2. The arithmetic processing device according to claim 1, further comprising:
【請求項3】 読み出し命令の実行時におけるIDの比
較の結果、演算結果を更新する拡張命令のIDが、実行
された読み出し命令に付加されたIDよりも1大きい場
合に、前記演算結果の更新を停止するよう構成したこと
を特徴とする請求項2に記載の演算処理装置。
3. When the ID of an extended instruction for updating an operation result is larger than the ID added to the executed read instruction by a comparison of IDs at the time of execution of the read instruction, the operation result is updated. The arithmetic processing device according to claim 2, wherein the processing is stopped.
JP2001159759A 2001-05-29 2001-05-29 Arithmetic processor Pending JP2002351658A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001159759A JP2002351658A (en) 2001-05-29 2001-05-29 Arithmetic processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001159759A JP2002351658A (en) 2001-05-29 2001-05-29 Arithmetic processor

Publications (1)

Publication Number Publication Date
JP2002351658A true JP2002351658A (en) 2002-12-06

Family

ID=19003285

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001159759A Pending JP2002351658A (en) 2001-05-29 2001-05-29 Arithmetic processor

Country Status (1)

Country Link
JP (1) JP2002351658A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007200055A (en) * 2006-01-27 2007-08-09 Hitachi Ltd Iscsi communication control method and storage system using it
CN110245096A (en) * 2019-06-24 2019-09-17 苏州硅岛信息科技有限公司 A method of realizing that processor is directly connected to extension computing module

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007200055A (en) * 2006-01-27 2007-08-09 Hitachi Ltd Iscsi communication control method and storage system using it
CN110245096A (en) * 2019-06-24 2019-09-17 苏州硅岛信息科技有限公司 A method of realizing that processor is directly connected to extension computing module
CN110245096B (en) * 2019-06-24 2023-07-25 苏州暴雪电子科技有限公司 Method for realizing direct connection of processor with expansion calculation module

Similar Documents

Publication Publication Date Title
US5706459A (en) Processor having a variable number of stages in a pipeline
US6301655B1 (en) Exception processing in asynchronous processor
US5604878A (en) Method and apparatus for avoiding writeback conflicts between execution units sharing a common writeback path
US7600096B2 (en) Coprocessor extension architecture built using a novel split-instruction transaction model
JP2004127319A (en) Backup device
KR20040016829A (en) Exception handling in a pipelined processor
US20070260857A1 (en) Electronic Circuit
US6738837B1 (en) Digital system with split transaction memory access
US7155718B1 (en) Method and apparatus to suspend and resume on next instruction for a microcontroller
US20070028077A1 (en) Pipeline processor, and method for automatically designing a pipeline processor
EP2159690A1 (en) Information processing unit and method for controlling register
US7257698B2 (en) Instruction buffer and method of controlling the instruction buffer where buffer entries are issued in a predetermined order
US5737562A (en) CPU pipeline having queuing stage to facilitate branch instructions
JP2002351658A (en) Arithmetic processor
EP0573071A2 (en) A microprocessor
JP2001051845A (en) Out-of-order execution system
US20040128484A1 (en) Method and apparatus for transparent delayed write-back
JP3199035B2 (en) Processor and execution control method thereof
JP2668987B2 (en) Data processing device
US11314505B2 (en) Arithmetic processing device
US9135006B1 (en) Early execution of conditional branch instruction with pc operand at which point target is fetched
JP5185478B2 (en) Pipeline processing method and pipeline processing apparatus using the method
JP7137058B2 (en) Arithmetic processing device, information processing device, and control method for information processing device
JPH076037A (en) Instruction decoding device
JP3630904B2 (en) Calculation execution method and calculation execution apparatus