JPH06295252A - Computer - Google Patents

Computer

Info

Publication number
JPH06295252A
JPH06295252A JP5082938A JP8293893A JPH06295252A JP H06295252 A JPH06295252 A JP H06295252A JP 5082938 A JP5082938 A JP 5082938A JP 8293893 A JP8293893 A JP 8293893A JP H06295252 A JPH06295252 A JP H06295252A
Authority
JP
Japan
Prior art keywords
branch
instruction
execution
interrupt
computer
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
JP5082938A
Other languages
Japanese (ja)
Inventor
Yutaka Enko
豊 円光
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP5082938A priority Critical patent/JPH06295252A/en
Publication of JPH06295252A publication Critical patent/JPH06295252A/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)
  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To dispense with the execution of an instruction in a display slot again, and to reduce a burden of a software by executing a branch interrupting operation after a delay instruction is executed. CONSTITUTION:A branch interruption is executed before the execution of a branch destination instruction is started after an instruction in a delay slot is executed. That is, a series of branching operations including a branch interrupting operation are executed in order of (1) execution of a delay instruction, (2) generation of a branch interruption, (3) return to an interruption, and (4) branching. To put it concretely, a branch unit 110 executes control of a branch interruption detecting unit 113 through a branch flag queue 121-1, therefore, the execution of the branch execution unit 110 is delayed and transferred while the branch flag queue 121-1 is shifted, and the branch interruption is generated after the delay slot is executed. Accordingly, the computer at the time when the branch interruption is generated executes already the instruction in the delay unit, therefore, a state in this case is used as state information of the computer at the time branching.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は遅延分岐を行う計算機に
関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a computer that performs delay branching.

【0002】[0002]

【従来の技術】近年、パイプラインを用いて命令を実行
する計算機のなかには、遅延分岐とよばれる手法により
分岐を行うものがある。遅延分岐とは、計算機が命令列
を実行する場合、通常、分岐命令の直後のアドレスの命
令はすでにメモリから計算機内部に取り込み(フェッ
チ)が完了しているか、あるいはさらに実行可能な状態
にあるため、計算機内部のパイプラインの有効な活用の
ために、分岐命令実行後さらに一つまたは複数個の命令
を実行した後に分岐(実行の対象となる命令のアドレス
の変更)を行うものである。
2. Description of the Related Art In recent years, some computers that execute instructions by using a pipeline branch by a method called a delayed branch. Delayed branching means that when a computer executes a sequence of instructions, usually the instruction at the address immediately after the branch instruction has already been fetched from memory into the computer, or is ready to be executed. In order to effectively utilize the pipeline inside the computer, after executing a branch instruction, one or more instructions are executed and then a branch (change of the address of the instruction to be executed) is performed.

【0003】また、デバッグ/トレース(ここでは、計
算機の使用者が要求する時点における計算機の状態情報
を収集することをデバッグ/トレースと呼び、そのため
に用いられるソフトウェアをトレーサ/デバッガと呼
ぶ。以下同じ)を支援するために分岐割り込み機能を有
する計算機がある(特開平1−111236 号公報)。分岐割
り込み機能とは、分岐の実行にともない割り込みを発生
する機能である。この分岐割り込み機能は、分岐時に割
り込みを発生させ、トレーサ/デバッガを起動し、トレ
ーサ/デバッガに分岐時の計算機の状態をトレース/デ
バッグ情報として収集させる目的に主に用いられる。
Debug / trace (collecting the state information of the computer at the time when the computer user requests it is called debug / trace, and the software used therefor is called tracer / debugger. The same applies hereinafter. ), There is a computer having a branch interrupt function (JP-A-1-111236). The branch interrupt function is a function that generates an interrupt when a branch is executed. This branch interrupt function is mainly used for the purpose of generating an interrupt at the time of branch, starting the tracer / debugger, and causing the tracer / debugger to collect the state of the computer at the time of branch as trace / debug information.

【0004】しかし、遅延分岐を行うプロセッサにおい
て、従来の技術による分岐割り込みは、分岐命令実行
後、遅延スロット内の命令(分岐命令実行後から分岐ま
での間に実行される一つまたは複数の命令。以下同
じ。)の実行までの間に行っている。
However, in a processor that performs delayed branching, a branch interrupt according to the conventional technique is such that an instruction in a delay slot after execution of a branch instruction (one or a plurality of instructions executed between execution of a branch instruction and branching). The same applies hereinafter) until the execution of.

【0005】[0005]

【発明が解決しようとする課題】遅延分岐を行うプロセ
ッサにおいて、従来のように、分岐割り込み動作を分岐
命令のサイクル内で行う場合、(あるいは、分岐命令の
次の命令の実行サイクルの先頭で行う場合も同様)一連
の動作は、(1)分岐割り込み発生、(2)割り込み復帰、
(3)遅延命令を実行、(4)分岐、の順序となる。いいか
えると、分岐割り込みが発生したプロセッサの状態は遅
延スロット内の命令の実行前であり、分岐時(遅延スロ
ット内の命令実行を終了し、分岐先命令の実行を開始す
るまで)の状態ではない(図6)。
In a processor that performs delayed branching, when a branch interrupt operation is performed within the cycle of a branch instruction as in the conventional case (or at the beginning of the execution cycle of the instruction next to the branch instruction). The same applies to the case) (1) Branch interrupt occurrence, (2) Interrupt return,
The order is (3) delay instruction execution, and (4) branch. In other words, the state of the processor in which the branch interrupt occurred is before the execution of the instruction in the delay slot, not the state at the time of branching (until the execution of the instruction in the delay slot ends and the execution of the branch destination instruction begins). (Fig. 6).

【0006】そのため、このようなプロセッサで、トレ
ーサ/デバッガが分岐時のプロセッサ状態情報を収集し
ようとした場合、分岐割り込み時のプロセッサ状態はま
だ遅延スロット内の命令を実行していないので、これを
分岐時のプロセッサ状態情報として用いることができな
い。トレーサ/デバッガが分岐時の情報を得ようとする
ならば、さらにトレーサ/デバッガが遅延スロット内に
ある命令を実行する等の方法によりプロセッサを分岐時
の状態にした後、改めて情報収集をしなければならな
い。そのため、ソフトウェアの負担が増し、プログラマ
の負担が増大する。また、トレーサのオーバーヘッドが
増し、非効率的なデバッグ/トレースの原因となるなど
の問題が生じる。
Therefore, in such a processor, when the tracer / debugger tries to collect the processor state information at the time of branch, the processor state at the time of branch interrupt has not executed the instruction in the delay slot. It cannot be used as processor state information at branch. If the tracer / debugger wants to obtain information at the time of branching, the tracer / debugger must put the processor into the state at the time of branching by a method such as executing an instruction in the delay slot, and then collect information again. I have to. Therefore, the burden on the software increases and the burden on the programmer also increases. In addition, the overhead of the tracer increases, causing problems such as inefficient debug / trace.

【0007】[0007]

【課題を解決するための手段】上記問題の解決手段とし
て、本発明による計算機は、分岐割り込みを遅延スロッ
ト内の命令の実行後から分岐先命令の実行開始までの間
に行う。即ち、分岐割り込み動作を含む一連の分岐動作
を、(1)遅延命令を実行、(2)分岐割り込み発生、(3)
割り込み復帰、(4)分岐、の順序で行う(図5)。いい
かえると、分岐割り込みが発生した計算機の状態が遅延
スロット内の命令の実行後の状態であり、割り込み発生
時の状態をそのまま分岐時の計算機の状態情報として用
いることができるような割り込みを発生させる。
As a means for solving the above problems, the computer according to the present invention performs a branch interrupt between the execution of an instruction in a delay slot and the start of execution of a branch destination instruction. That is, a series of branch operations including a branch interrupt operation are performed: (1) execute a delay instruction, (2) generate a branch interrupt, (3)
Interrupt recovery and (4) branch are performed in this order (Fig. 5). In other words, the state of the computer where the branch interrupt occurred is the state after the execution of the instruction in the delay slot, and the state when the interrupt occurred can be used as it is as the state information of the computer when the branch occurs. .

【0008】[0008]

【作用】上記手段を用いた計算機で、トレーサ/デバッ
ガが分岐時のプロセッサ状態情報を収集しようとした場
合、分岐割り込みが発生した時の計算機は、遅延スロッ
ト内の命令をすでに実行しているので、このときの状態
を分岐時の計算機の状態情報として用いる。トレーサ/
デバッガが分岐時の情報を得ようとするとき、割り込み
時に退避された計算機の状態情報をもとに分岐時の情報
を収集する。トレーサ/デバッガは情報を収集した後、
割り込み復帰によりトレース対象のプログラムの実行を
再開する。
In the computer using the above means, when the tracer / debugger tries to collect the processor state information at the time of branch, the computer at the time of the branch interrupt has already executed the instruction in the delay slot. , The state at this time is used as the state information of the computer at the time of branching. Tracer /
When the debugger tries to obtain branch-time information, it collects branch-time information based on the computer state information saved at the time of interrupt. After the tracer / debugger has collected the information,
When the interrupt returns, the execution of the traced program is resumed.

【0009】[0009]

【実施例】本発明の方法による計算機の実施例を図1に
示す。さらに同実施例における命令実行サイクル(分岐
割り込みに関する部分)を図3に示す。
FIG. 1 shows an embodiment of a computer according to the method of the present invention. Further, FIG. 3 shows an instruction execution cycle (a portion related to a branch interrupt) in the same embodiment.

【0010】以下、本発明の方式による計算機の実施例
の構成,動作を説明する。
The configuration and operation of a computer according to the present invention will be described below.

【0011】この計算機は実行ユニット110,インス
トラクションユニット120及びアドレスバス/データ
バス・インターフェイスユニット130その他のユニッ
トにより構成される。
This computer is composed of an execution unit 110, an instruction unit 120, an address bus / data bus interface unit 130 and other units.

【0012】インストラクションユニットは、インスト
ラクションキュー121、及びインストラクションフェ
ッチャ123を含む。さらにインストラクションユニッ
トは、1命令実行毎にインストラクションキューを先頭
方向に1命令分シフトする機能を備える。
The instruction unit includes an instruction queue 121 and an instruction fetcher 123. Further, the instruction unit has a function of shifting the instruction queue by one instruction in the head direction each time one instruction is executed.

【0013】実行ユニットは、デコーダ111,分岐命
令実行ユニット112,分岐割り込み検出ユニット11
3及び、その他命令の実行に必要なユニット(PSW(計
算機の状態を表す状態語:Processor Status Word)11
4,レジスタ115,ALU116)を含む。デコーダはインス
トラクションキューの先頭要素から命令コードを取り出
す。レジスタは計算に必要な情報を記憶するために用い
られる。ALUはレジスタからの情報をもとに演算を行
い、結果をレジスタ,メモリに格納する。
The execution unit includes a decoder 111, a branch instruction execution unit 112, a branch interrupt detection unit 11
3 and other units necessary for executing instructions (PSW (Processor Status Word) 11
4, register 115, ALU 116). The decoder extracts the instruction code from the head element of the instruction queue. Registers are used to store information needed for calculations. The ALU performs an operation based on the information from the register and stores the result in the register and memory.

【0014】インストラクションキュー121は要素数
が7(本実施例の場合。)の配列で、分岐フラグキュー
121−1,プログラムカウンタキュー121−2およ
びインストラクションレジスタキュー121−3により
構成される。
The instruction queue 121 has an array of 7 elements (in the case of this embodiment) and is composed of a branch flag queue 121-1, a program counter queue 121-2 and an instruction register queue 121-3.

【0015】インストラクションフェッチャ123は、
命令のフェッチ(計算機が実行すべき命令をメモリから
プロセッサ内にロードすること)を行う。すなわちイン
ストラクションレジスタキュー121−3のなかから未
フェッチ状態のものを見つけ、メモリ上から命令コード
をアドレスバス/データバス・インターフェイスユニッ
ト130を通して読みだし、ロードする。
The instruction fetcher 123 is
Fetching an instruction (loading the instruction to be executed by the computer from the memory into the processor). That is, an unfetched state is found from the instruction register queue 121-3, the instruction code is read from the memory through the address bus / data bus interface unit 130, and loaded.

【0016】アドレスバス/データバス・インターフェ
イスユニット130は、実行ユニット110及び命令ユ
ニット120に代わり、外部バスとの情報のやりとりを
行う。
The address bus / data bus interface unit 130 exchanges information with an external bus in place of the execution unit 110 and the instruction unit 120.

【0017】実行ユニット110はインストラクション
レジスタキュー121−1の先頭121−11に命令コ
ードがすでにフェッチされていれば、デコーダ111に
より命令コードを取り出しこれをデコードする。実行ユ
ニット110はデコードされた命令により動作する(ス
テップ304,305)。
If the instruction code has already been fetched into the head 121-11 of the instruction register queue 121-1, the execution unit 110 takes out the instruction code by the decoder 111 and decodes it. The execution unit 110 operates according to the decoded instruction (steps 304 and 305).

【0018】分岐命令実行時、あるいは条件付き分岐命
令実行時において分岐条件成立の時の動作を説明する。
分岐命令実行ユニットはプログラムカウンタの特定の要
素121−23に分岐先アドレスの設定を行い、これと
ともに、分岐フラグ121−13を1にセットする。
The operation when the branch condition is satisfied when the branch instruction is executed or when the conditional branch instruction is executed will be described.
The branch instruction execution unit sets the branch destination address in the specific element 121-23 of the program counter, and sets the branch flag 121-13 to 1.

【0019】分岐命令以外の実行時、あるいは条件付き
分岐命令実行時において分岐条件不成立の時、分岐命令
実行ユニットはプログラムカウンタ及び分岐フラグには
何もしない。このとき、プログラムカウンタにはプログ
ラムカウンタの一つ前のキュー要素の1命令長分インク
リメントされたアドレスを設定し、分岐フラグにはデフ
ォルト値0をセットする。
When a branch condition is not satisfied during execution of a branch instruction other than a branch instruction or when a conditional branch instruction is executed, the branch instruction execution unit does nothing to the program counter and the branch flag. At this time, an address incremented by one instruction length of the queue element immediately before the program counter is set in the program counter, and a default value 0 is set in the branch flag.

【0020】1命令実行毎にインストラクションユニッ
トは、インストラクションキューを先頭方向に1命令分
シフトする。
Each time one instruction is executed, the instruction unit shifts the instruction queue by one instruction toward the head.

【0021】分岐割り込み制御に係る動作を次に説明す
る。分岐割り込み検出ユニットは分岐フラグキューの先
頭要素121−11によって分岐を検査する。要素が1
であれば、計算機内のユニットに分岐割り込み動作を要
求する。
The operation related to the branch interrupt control will be described below. The branch interrupt detection unit checks the branch by the head element 121-11 of the branch flag queue. Element 1
If so, a branch interrupt operation is requested to the unit in the computer.

【0022】分岐実行ユニットは、分岐割り込み検出ユ
ニットの制御を、分岐フラグキューを介して行ってい
る。このため、分岐実行ユニットの実行が、分岐フラグ
キューがシフトされる間、すなわち、遅延スロットの命
令実行の間遅れて伝達される。すなわち分岐割り込みが
遅延スロットの実行後に発生する。
The branch execution unit controls the branch interrupt detection unit via the branch flag queue. Therefore, the execution of the branch execution unit is delayed while the branch flag queue is shifted, that is, during the instruction execution of the delay slot. That is, a branch interrupt occurs after execution of the delay slot.

【0023】本実施例において、分岐命令を実行すると
き、分岐命令実行ユニット112は、インストラクショ
ンキュー121の先頭から3番目の分岐フラグ121−
13に1を設定し、プログラムカウンタ121−23に
分岐先アドレスを設定し(ステップ307)、先頭から
3番目以降のインストラクションレジスタキュー121−
33をすべて未フェッチとする。キューの先頭要素は現
在実行中の命令であり、分岐命令の実行にともなう分岐
先アドレス及び分岐フラグの設定を先頭から3番目のキ
ュー要素に行っている。このため、遅延スロット内の命
令(遅延命令)は先頭から2番目の要素であり、その命
令数は1である。
In this embodiment, when executing a branch instruction, the branch instruction execution unit 112 has the third branch flag 121- from the head of the instruction queue 121.
13 is set to 1 and a branch destination address is set to the program counter 121-23 (step 307).
All 33 are unfetched. The head element of the queue is the instruction currently being executed, and the branch destination address and the branch flag associated with the execution of the branch instruction are set in the third queue element from the head. Therefore, the instruction (delayed instruction) in the delay slot is the second element from the beginning, and the number of instructions is one.

【0024】分岐の検出は分岐割り込み検出ユニット1
13が行う。分岐割り込みの発生/非発生は、PSW114の
Tビット(分岐割り込み発生制御ビット)により制御可
能になっており、Tビットが1のときにのみ分岐割り込
みが発生する(ステップ301)。分岐割り込み検出ユニッ
ト113は、PSW114のTビットが1の時、かつ、分岐フ
ラグキューの先頭要素121−11が1のとき分岐の発
生条件の成立を検出する(ステップ302)。この時、
分岐割り込み検出ユニット113はプロセッサ状態退避
手段140と割り込みアドレス生成ユニット150へ信
号を送出し、分岐割り込み動作の実行を指示する(割り
込み復帰後の動作を保障するために、割り込み動作時に
は、命令アドレスおよび分岐フラグの先頭2要素を、割
り込み時のプロセッサ状態として退避する必要があ
る。)。
Branch detection is performed by the branch interrupt detection unit 1
13 does. Generation / non-occurrence of a branch interrupt can be controlled by the T bit (branch interrupt generation control bit) of PSW114, and a branch interrupt is generated only when the T bit is 1 (step 301). The branch interrupt detection unit 113 detects that the branch occurrence condition is met when the T bit of the PSW 114 is 1 and the head element 121-11 of the branch flag queue is 1. (Step 302). At this time,
The branch interrupt detection unit 113 sends a signal to the processor state saving unit 140 and the interrupt address generation unit 150 to instruct the execution of the branch interrupt operation (in order to guarantee the operation after the interrupt return, the instruction address and It is necessary to save the first two elements of the branch flag as the processor state at the time of interruption.)

【0025】次に、分岐命令のフェッチ,実行から分岐
割り込み発生までの過程を説明する。
Next, the process from fetching and executing a branch instruction to the generation of a branch interrupt will be described.

【0026】インストラクションフェッチャ123によ
りメモリからフェッチされた命令は一旦、インストラク
ションレジスタ121−3にロードされる。デコーダは
インストラクションレジスタキュー130の先頭121
−31から命令を取り出しデコードする。
The instruction fetched from the memory by the instruction fetcher 123 is temporarily loaded into the instruction register 121-3. The decoder is the head 121 of the instruction register queue 130.
The instruction is fetched from -31 and decoded.

【0027】実行ユニットはデコードされた命令により
動作する(ステップ304,305)。分岐命令の実行時
は、分岐命令実行ユニットがプログラムカウンタ121
−2の先頭から3番目の要素121−23に分岐先アド
レスの設定を行い、かつ、分岐フラグキュー110の先
頭から3番目の要素を1にセットする(ステップ307)。
図1中のインストラクションキュー121は、プロセッ
サが、番地 0x0100のbranch 0x0200命令(0x0200
への分岐命令)の実行中の状態をあらわしている。ここ
では、分岐命令実行ユニット112が分岐フラグに1
(分岐先であることを示すフラグ)をセットし121−
13、分岐先アドレスをセット112−23)してい
る。0x0104番地のload x1,x2 命令は遅延スロット
内の命令であり、この命令の実行後、0x0200番地への分
岐を行う。
The execution unit operates according to the decoded instruction (steps 304 and 305). When executing a branch instruction, the branch instruction execution unit is set to the program counter 121.
-2, the branch destination address is set to the third element 121-23 from the head, and the third element from the head of the branch flag queue 110 is set to 1 (step 307).
In the instruction queue 121 in FIG. 1, the processor has a branch 0x0200 instruction (0x0200 at address 0x0100).
(Branch instruction to) is being executed. Here, the branch instruction execution unit 112 sets the branch flag to 1
(Flag indicating branching destination) is set 121-
13, the branch destination address is set 112-23). The load x1, x2 instruction at the address 0x0104 is an instruction in the delay slot, and after execution of this instruction, the branch to the address 0x0200 is performed.

【0028】分岐命令以外の実行時、あるいは条件付き
分岐命令実行時において分岐条件不成立の時、分岐命令
実行ユニット112はインストラクションキューの変更
は行わない。このとき、プログラムカウンタキュー12
1−2の各要素には、プログラムカウンタより1命令手
前のアドレスに1命令長分インクリメントしたアドレス
が設定され、分岐フラグにはデフォルト値0がセットさ
れる。
The branch instruction execution unit 112 does not change the instruction queue when a branch condition is not satisfied when a branch instruction other than the branch instruction is executed or when a conditional branch instruction is executed. At this time, the program counter queue 12
An address obtained by incrementing the address one instruction before the program counter by one instruction length is set in each element 1-2, and a default value 0 is set in the branch flag.

【0029】インストラクションユニットは1命令実行
サイクル毎に、インストラクションキュー121)のシ
フト(キューの各要素を一要素分先頭方向へ移動させ
る。先頭要素は捨てる。)を行う(ステップ308)。
The instruction unit shifts the instruction queue 121) (moves each element of the queue by one element in the head direction, discards the head element) for each instruction execution cycle (step 308).

【0030】分岐命令実行後、さらに命令実行のため、
2回目のキューシフトが行われたとき、さきに分岐命令
実行ユニット112によりセットされた分岐フラグの値
1が分岐フラグキューの先頭要素となる。分岐割り込み
検出ユニット113は分岐フラグキューの先頭要素12
1−11によって分岐を検査するが、このときの先頭要
素が1であるため、計算機内の割り込みアドレス生成ユ
ニット140およびプロセッサ状態退避手段150に分
岐割り込み動作を要求する信号を送出する。
After executing the branch instruction, for further instruction execution,
When the second queue shift is performed, the value 1 of the branch flag previously set by the branch instruction execution unit 112 becomes the head element of the branch flag queue. The branch interrupt detection unit 113 is the head element 12 of the branch flag queue.
The branch is inspected by 1-11. However, since the head element at this time is 1, a signal requesting a branch interrupt operation is sent to the interrupt address generation unit 140 and the processor state saving means 150 in the computer.

【0031】さらに、図2は従来例の計算機を、図4に
同従来例における命令実行サイクル(分岐割り込みに関
する部分)を、図6に従来技術による分岐割り込みの動
作順序を示す。
Further, FIG. 2 shows a conventional computer, FIG. 4 shows an instruction execution cycle (a part relating to a branch interrupt) in the conventional example, and FIG. 6 shows an operation sequence of a conventional branch interrupt.

【0032】本従来例では、分岐命令の実行(条件付き
分岐の場合は分岐条件の成立した時)にともなう分岐命
令実行ユニット212からの指示により、分岐割り込み
検出ユニット213が分岐の検出を行っている。(ただ
し、通常の計算機においては、分岐割り込みはPSW214内
の分岐割り込み発生制御フラグTの値が1である場合に
のみ発生する。このため、上述の検出もこの時にのみ行
われるのが一般的である。)分岐割り込み検出ユニット
213による分岐の検出は分岐命令の実行と同一サイク
ル内で行い、計算機は遅延命令の実行を待たずに、分岐
割り込みを行う。
In this conventional example, the branch interrupt detection unit 213 detects a branch according to an instruction from the branch instruction execution unit 212 accompanying the execution of a branch instruction (when a branch condition is satisfied in the case of a conditional branch). There is. (However, in an ordinary computer, a branch interrupt occurs only when the value of the branch interrupt generation control flag T in PSW214 is 1. Therefore, the above-mentioned detection is generally performed only at this time. The branch interrupt detection unit 213 detects a branch in the same cycle as the execution of the branch instruction, and the computer executes the branch interrupt without waiting for the execution of the delay instruction.

【0033】このため、このような計算機により分岐命
令を含む命令列の実行順序を図6を用いて説明すると、
分岐命令601実行,割り込み動作602,割り込み復
帰後に遅延命令603,分岐先命令604の実行順序と
なる。
Therefore, the execution sequence of the instruction sequence including the branch instruction by such a computer will be described with reference to FIG.
After the branch instruction 601 is executed, the interrupt operation 602, and the interrupt return, the delay instruction 603 and the branch destination instruction 604 are in the execution order.

【0034】次に、本発明による計算機において分岐ト
レースを行うソフトウェア(以下、トレーサ)について
説明する。
Next, the software (hereinafter, tracer) for performing the branch trace in the computer according to the present invention will be described.

【0035】トレーサはトレースの開始を、PSW114のT
ビットを1にセットし、割り込みアドレス生成ユニット
140にトレーサのエントリアドレスを、分岐割り込み
の発生により実行が開始される命令アドレスとして設定
することにより行う。
The tracer starts the trace at T of PSW114.
This is done by setting the bit to 1 and setting the entry address of the tracer in the interrupt address generation unit 140 as the instruction address at which execution is started when a branch interrupt occurs.

【0036】分岐割り込みが発生すると、トレーサは分
岐割り込み処理ルーチンとして実行開始される。トレー
サは割り込み発生時に退避されたプロセッサ状態情報
を、分岐実行時のプロセッサ状態情報として収集し、こ
の情報よりトレースレコードを生成し、磁気ディスク,
磁気テープ等の記録媒体に出力する。
When a branch interrupt occurs, the tracer starts executing as a branch interrupt processing routine. The tracer collects the processor state information saved when the interrupt occurs as the processor state information at the time of branch execution, generates a trace record from this information,
Output to a recording medium such as a magnetic tape.

【0037】その後、トレーサはプロセッサを割り込み
発生の直前の状態に復元し、割り込み復帰命令により計
算機を割り込み前の状態に戻す。
After that, the tracer restores the processor to the state immediately before the occurrence of the interrupt, and returns the computer to the state before the interrupt by the interrupt return instruction.

【0038】[0038]

【発明の効果】本発明により、プロセッサでトレーサ/
デバッガが分岐時のプロセッサ情報を収集する場合、分
岐割り込みによって起動されたトレーサ/デバッガが、
分岐割り込み発生時のプロセッサ状態を、分岐時のプロ
セッサ状態として収集することができる。
According to the present invention, the tracer /
When the debugger collects processor information at the time of branch, the tracer / debugger activated by the branch interrupt
The processor state at the time of occurrence of a branch interrupt can be collected as the processor state at the time of branch.

【0039】すなわち、従来の分岐割り込み発生方法に
比べ、遅延スロット内の命令を改めて実行する必要がな
いため、ソフトウェアの負担が軽減する。
That is, as compared with the conventional branch interrupt generation method, it is not necessary to re-execute the instruction in the delay slot, so that the load on the software is reduced.

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

【図1】本発明の計算機の実施例を示したブロック図。FIG. 1 is a block diagram showing an embodiment of a computer of the present invention.

【図2】従来例を示したブロック図。FIG. 2 is a block diagram showing a conventional example.

【図3】本発明の計算機の実施例における命令実行サイ
クルを示したフローチャート。
FIG. 3 is a flow chart showing an instruction execution cycle in the embodiment of the computer of the present invention.

【図4】従来例における命令実行サイクルを示したフロ
ーチャート。
FIG. 4 is a flowchart showing an instruction execution cycle in a conventional example.

【図5】本発明の計算機による分岐割り込みの動作順序
を示した説明図。
FIG. 5 is an explanatory diagram showing an operation sequence of branch interrupts by the computer of the present invention.

【図6】従来技術による分岐割り込みの動作順序を示し
た説明図。
FIG. 6 is an explanatory diagram showing an operation sequence of a branch interrupt according to a conventional technique.

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

121…インストラクションキュー、121−1…分岐
フラグキュー、121−11…分岐フラグ、121−1
3…分岐フラグ、121−2…プログラムカウンタキュ
ー、121−21…プログラムカウンタ、121−23
…プログラムカウンタ、121−3…インストラクショ
ンレジスタキュー、121−33…インストラクション
レジスタ。
121 ... Instruction queue, 121-1 ... Branch flag queue, 121-11 ... Branch flag, 121-1
3 ... Branch flag, 121-2 ... Program counter queue, 121-21 ... Program counter, 121-23
... program counter, 121-3 ... instruction register queue, 121-33 ... instruction register.

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】分岐命令による分岐成立を原因とした割り
込みを発生させる機能をもち、かつ、分岐割り込み動作
を遅延命令の実行後に行うことを特徴とする計算機。
1. A computer having a function of generating an interrupt due to a branch taken by a branch instruction, and performing a branch interrupt operation after execution of a delay instruction.
【請求項2】プログラムカウンタに記憶されるアドレス
が分岐先アドレスであるか否かを記憶する記憶手段をプ
ログラムカウンタと同数個備えたことを特徴とする計算
機。
2. A computer comprising the same number of storage means as the program counter for storing whether or not the address stored in the program counter is a branch destination address.
【請求項3】分岐割り込み検出ユニットを備え、前記分
岐割り込み検出ユニットが、分岐フラグの先頭要素によ
り分岐検出を行うことを特徴とする計算機。
3. A computer comprising a branch interrupt detection unit, wherein the branch interrupt detection unit detects a branch by a head element of a branch flag.
JP5082938A 1993-04-09 1993-04-09 Computer Pending JPH06295252A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5082938A JPH06295252A (en) 1993-04-09 1993-04-09 Computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5082938A JPH06295252A (en) 1993-04-09 1993-04-09 Computer

Publications (1)

Publication Number Publication Date
JPH06295252A true JPH06295252A (en) 1994-10-21

Family

ID=13788171

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5082938A Pending JPH06295252A (en) 1993-04-09 1993-04-09 Computer

Country Status (1)

Country Link
JP (1) JPH06295252A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007188527A (en) * 2007-03-19 2007-07-26 Ricoh Co Ltd Interruption processing method for information processor

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007188527A (en) * 2007-03-19 2007-07-26 Ricoh Co Ltd Interruption processing method for information processor
JP4564025B2 (en) * 2007-03-19 2010-10-20 株式会社リコー Interrupt processing method in information processing apparatus

Similar Documents

Publication Publication Date Title
EP0297893B1 (en) Apparatus and method for recovering from page faults in vector data processing operations
US5003462A (en) Apparatus and method for implementing precise interrupts on a pipelined processor with multiple functional units with separate address translation interrupt means
JPH0727462B2 (en) Method for restarting page fault execution in data processing device
US5146569A (en) System for storing restart address of microprogram, determining the validity, and using valid restart address to resume execution upon removal of suspension
JPH07120338B2 (en) Method for a data processor to coordinate the execution of instructions by a coprocessor and the data processor
JPH1196006A (en) Information processor
JPH06295252A (en) Computer
IE79236B1 (en) Apparatus and method for recovering from page faults in vector data processing operations
JP2783285B2 (en) Information processing device
JP2671160B2 (en) Exception handling method
US5787276A (en) Microprocessor including circuit for generating signal used for tracing executed instruction stream
JP2562838B2 (en) Processor and store buffer control method
JP2793386B2 (en) Computer error information storage device for computer
JPH06324861A (en) System and method for controlling cpu
JP2793396B2 (en) Computer status holding device
JP2765831B2 (en) Data processing device
JP3112861B2 (en) Microprocessor
JP2666737B2 (en) Microprocessor with built-in trace memory and trace method
JPH1055289A (en) Debugging information generating circuit and information processor using the same
JPH0364903B2 (en)
JPH0795288B2 (en) Microcomputer
JPS6149695B2 (en)
JPS63214856A (en) Data protection control system for data processing unit
JPH05250161A (en) Microcomputer device
JPS6232507B2 (en)