JPH0439097B2 - - Google Patents

Info

Publication number
JPH0439097B2
JPH0439097B2 JP60283711A JP28371185A JPH0439097B2 JP H0439097 B2 JPH0439097 B2 JP H0439097B2 JP 60283711 A JP60283711 A JP 60283711A JP 28371185 A JP28371185 A JP 28371185A JP H0439097 B2 JPH0439097 B2 JP H0439097B2
Authority
JP
Japan
Prior art keywords
branch
address
instruction
output
source
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP60283711A
Other languages
Japanese (ja)
Other versions
JPS62143143A (en
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 filed Critical
Priority to JP60283711A priority Critical patent/JPS62143143A/en
Publication of JPS62143143A publication Critical patent/JPS62143143A/en
Publication of JPH0439097B2 publication Critical patent/JPH0439097B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Description

【発明の詳細な説明】 〔概要〕 主としてデバツギングおよび診断等の目的に用
いるブランチトレースの制御において、分岐元ア
ドレスおよび分岐先アドレスが予め設定した上限
アドレスと下限アドレスの範囲内にあるか否かの
チエツクを既存の演算回路により行うよう構成し
たもので、これによりハードウエア量を削減する
ことができる。
[Detailed Description of the Invention] [Summary] In branch trace control mainly used for debugging and diagnostic purposes, it is possible to check whether a branch source address and a branch destination address are within a preset upper and lower limit address range. The check is performed using an existing arithmetic circuit, thereby reducing the amount of hardware required.

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

本発明は、主としてデバツギングおよび診断等
の目的に使用するため、分岐条件が成立したとき
分岐元と分岐先の命令アドレスを主記憶上に格納
するブランチトレースのための制御方式に関す
る。
The present invention relates to a control method for branch tracing in which instruction addresses of a branch source and a branch destination are stored in main memory when a branch condition is satisfied, mainly for use in debugging, diagnosis, and the like.

〔従来の技術〕[Conventional technology]

ブランチトレース制御においては、分岐元およ
び分岐先のアドレスに特定のアドレス範囲を設け
ることが多く、これを行う場合には、分岐命令に
より分岐したときの分岐元および分岐先のアドレ
スを、設定したアドレス範囲の上限アドレスおよ
び下限アドレスと比較する必要がある。
In branch trace control, a specific address range is often set for the branch source and branch destination addresses, and when this is done, the branch source and branch destination addresses when branching by a branch instruction are set to the set address. Must be compared to the upper and lower addresses of the range.

第6図は、ブランチトレース制御の従来例の示
すブロツク図である。
FIG. 6 is a block diagram showing a conventional example of branch trace control.

第6図はブランチトレースに関係ある部分のみ
を取り出して示している。図において、1は算術
論理演算機構(ALU)であり、2はAレジスタ
(AR)、3はBレジスタ(BR)であり、4は命
令アドレスレジスタ(iAR)であり、6はZレジ
スタ(ZR)であつて、それぞれ中央処理装置の
主要構成要素の一つである。
FIG. 6 shows only the portions related to branch tracing. In the figure, 1 is the arithmetic and logic unit (ALU), 2 is the A register (AR), 3 is the B register (BR), 4 is the instruction address register (iAR), and 6 is the Z register (ZR ), each of which is one of the main components of the central processing unit.

51および52は、主記憶(MS)5の一部領
域を示し、51はローカルストレージ(LS)と
呼ばれる領域であり、52は分岐先および分岐元
のアドレスを書き込むテーブル(以下、BTデー
ブルと称す)を書き込む領域である。
51 and 52 indicate partial areas of the main memory (MS) 5, 51 is an area called local storage (LS), and 52 is a table (hereinafter referred to as BT table) in which branch destination and branch source addresses are written. ) is the area to write.

81,82,83および84は、ブランチトレ
ースのために設けたレジスタおよび比較回路であ
る。
81, 82, 83 and 84 are registers and comparison circuits provided for branch tracing.

81は下限アドレスをセツトするレジスタ(L
−LMT−REG)であり、82は上限アドレスを
セツトするレジスタ(U−LMT−REG)であ
る。
81 is a register (L) for setting the lower limit address.
-LMT-REG), and 82 is a register (U-LMT-REG) for setting the upper limit address.

83は比較回路1であり、命令アドレスレジス
タ(iAR)4の内容とL−LMT−REG81の内
容とを比較する。84は比較回路2であり、命令
アドレスレジスタ(iAR)4の内容とU−LMT
−REG82の内容とを比較する。
A comparison circuit 1 83 compares the contents of the instruction address register (iAR) 4 and the contents of the L-LMT-REG 81 . 84 is a comparison circuit 2, which compares the contents of the instruction address register (iAR) 4 and U-LMT.
-Compare with the contents of REG82.

85はANDゲートであり、比較回路1,83
および比較回路2,84の出力のAND条件を取
る。
85 is an AND gate, and comparison circuits 1 and 83
AND conditions of the outputs of the comparison circuits 2 and 84 are taken.

86は遅延AND回路であり、ANDゲート85
の2回の出力のAND条件を求める。
86 is a delay AND circuit, and AND gate 85
Find the AND condition for the two outputs.

10はBT制御部であり、ブランチトレースの
ための制御を行う。
10 is a BT control unit that performs control for branch tracing.

中央処理装置において一般命令が実行されてい
る通常の運用状態では、命令アドレスレジスタ
(iAR)4の示すアドレスで主記憶5(プログラ
ム領域は図示省略)から命令を図示省略の命令レ
ジスタに読み出し、これが解読されて命令の示す
データがAレジスタ2およびBレジスタ3に読み
出され、ALU1によつて命令の示す演算が行わ
れ、Zレジスタ6に結果が読み出される。iAR4
の内容は図示省略のカウントアツプ機構により+
1され次々と命令が実行される。
In a normal operating state when a general instruction is executed in the central processing unit, an instruction is read from the main memory 5 (program area is not shown) at the address indicated by the instruction address register (iAR) 4 to an instruction register (not shown). The decoded data indicated by the instruction is read into the A register 2 and the B register 3, the ALU 1 performs the operation indicated by the instruction, and the result is read into the Z register 6. iAR4
The contents of + are determined by a count-up mechanism (not shown).
1 and the instructions are executed one after another.

分岐条件演算の命令が実行され、条件が満足さ
れると、分岐命令が上記命令レジシタに読み出さ
れ、iAR4には分岐先のアドレスがセツトされ
る。このiAR4の示すアドレスの命令が読み出さ
れて分岐先の命令が実行される。
When the branch condition calculation instruction is executed and the condition is satisfied, the branch instruction is read into the instruction register, and the address of the branch destination is set in iAR4. The instruction at the address indicated by this iAR4 is read and the branch destination instruction is executed.

デバツキングまたは診断のため、ブランチトレ
ースを行うに当たつては、まず主記憶のLS領域
51内に、分岐先アドレスおよび分岐元アドレス
を記憶させておくBTテーブル52上の先頭アド
レスを示すポインタと、BTテーブルの残り領域
を示すバイトカウントを書き込み、分岐元および
分岐先アドレスの下限アドレスをL−LMT−
REG81に、上限アドレスをU−LMT−REG8
2にセツトする。
When performing branch tracing for debugging or diagnosis, first, a pointer indicating the start address on the BT table 52 in which the branch destination address and branch source address are stored is stored in the LS area 51 of the main memory. Write the byte count indicating the remaining area of the BT table, and set the lower limit address of the branch source and branch destination address to L-LMT-
In REG81, set the upper limit address to U-LMT-REG8
Set to 2.

BTイネーブル(+BT−ENB)信号は、操作
者が任意にセツトできる信号であつて、ブランチ
トレースさせたいときは“1”にセツトしてお
く。
The BT enable (+BT-ENB) signal is a signal that can be set arbitrarily by the operator, and is set to "1" when branch tracing is desired.

分岐命令が命令レジスタに読み出され、BTイ
ネーブル信号が“1”であると、BT制御部10
が活性化されて、BT制御部10の制御が優先さ
れ、分岐先命令のフエツチは休止さる。
When the branch instruction is read into the instruction register and the BT enable signal is “1”, the BT control unit 10
is activated, the control of the BT control unit 10 is prioritized, and fetching of the branch destination instruction is suspended.

iAR4の内容(分岐元命令アドレス)は、比較
回路1,83で下限アドレス以上であるかをチエ
ツクされ、比較回路2,84は上限アドレス以下
であるかをチエツクされて、その両方とも成立し
たときは、ANDゲート85が開かれる。次いで
iAR4には分岐先メモリアドレスがセツトされ、
同様な比較が比較回路1,83および比較回路
2,84で行われ、両方とも成立したときは
ANDゲート85が開かれる。ANDゲート85の
2回の出力は遅延AND回路86に入れられ2回
とも成立の場合には、BTオーケー(+BT−
OK)が“1”となる。
The content of iAR4 (branch source instruction address) is checked by comparison circuits 1 and 83 to see if it is greater than or equal to the lower limit address, and by comparison circuits 2 and 84 to see if it is less than or equal to the upper limit address, and when both are true. , AND gate 85 is opened. then
The branch destination memory address is set in iAR4,
Similar comparisons are made in comparison circuits 1 and 83 and comparison circuits 2 and 84, and when both are established,
AND gate 85 is opened. The two outputs of the AND gate 85 are input to a delay AND circuit 86, and if both times are true, BT OK (+BT-
OK) becomes “1”.

BTイネーブルが“1”にセツトしてあり、
BTオーケーが“1”となれば、ANDゲート7
が開かれ、LS51中のポインタの示すBTテーブ
ルアドレスに分岐元および分岐先アドレスが書き
込まれ、書込みデータのバイト数だけポインタが
加算され、バイトカウントはバイト数だけ減算さ
れて、次の先頭アドレスおよび残りのバイト数を
示すように更新される。これらの動作は全てBT
制御部10の制御により行われる。
BT enable is set to “1”,
If BT OK is “1”, AND gate 7
is opened, the branch source and branch destination addresses are written to the BT table address indicated by the pointer in LS51, the pointer is added by the number of bytes of write data, the byte count is subtracted by the number of bytes, and the next start address and Updated to indicate the number of bytes remaining. All these operations are BT
This is performed under the control of the control section 10.

このように、従来方式ではブランチトレースの
ために専用のレジスタL−LMT−REGおよびU
−LMT−REG、ならびに比較回路1,2を必要
とする。
In this way, in the conventional method, dedicated registers L-LMT-REG and U are used for branch tracing.
-LMT-REG and comparison circuits 1 and 2 are required.

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

上記のように、従来方式ではブランチトレース
のために専用のレジスタおよび比較回路を必要と
するものであつた。
As mentioned above, the conventional method requires a dedicated register and comparison circuit for branch tracing.

本発明は、このような専用のレジスタおよび比
較回路を必要とせず、ハードウエア量を削減した
新規なブランチトレース制御方式を提供しようと
するものである。
The present invention aims to provide a novel branch trace control method that does not require such dedicated registers and comparison circuits and reduces the amount of hardware.

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

第1図は本発明のブランチトレース制御方式の
原理ブロツク図を示す。
FIG. 1 shows a principle block diagram of the branch trace control method of the present invention.

第1図において、ALU1、Aレジスタ2、B
レジスタ3、iAR4、主記憶5、LS51、BTテ
ーブル52およびANDゲート7は第6図と同一
の対象物を示す。
In Figure 1, ALU1, A register 2, B
The register 3, iAR 4, main memory 5, LS 51, BT table 52 and AND gate 7 represent the same objects as in FIG.

9は桁上げ及びゼロ出力検査回路であり、演算
回路(ALU)1が本来備えている桁上げ出力
(演算結果がマイナスのとき“1”となる)およ
びゼロ出力(演算結果がゼロのとき“1”とな
る)を入力とし、所定の演算により条件検査を行
う。
Reference numeral 9 is a carry and zero output check circuit, which outputs a carry output (which becomes "1" when the operation result is negative) and a zero output (which becomes "1" when the operation result is zero) which the arithmetic circuit (ALU) 1 originally has. 1'') is input, and the condition is checked by a predetermined calculation.

10はBT制御手段であり、主記憶LS領域から
の読出し、Aレジスタ2、Bレジスタ3および
ALU1を使用しての演算を制御する。
10 is a BT control means, which controls reading from the main memory LS area, A register 2, B register 3 and
Controls calculations using ALU1.

ブランチトレースを行うに当たつては、まず主
記憶のLS領域51に、ポインタおよびバイトカ
ウントの外に、分岐元および分岐先アドレスの上
限アドレスならびに下限アドレスを格納してお
く。これらの動作は、通常いわゆるサービスプロ
セツサのような補助プロセツサにより実行させ
る。
When performing a branch trace, first, in addition to a pointer and a byte count, upper and lower limit addresses of branch source and destination addresses are stored in the LS area 51 of the main memory. These operations are usually performed by an auxiliary processor, such as a so-called service processor.

中央処理装置においてプログラムが走行し、分
岐条件が成立し分岐が行われると、BT制御手段
10が活性化され、BT制御手段10がBT実行
要求を出し、これに優先権が与えられているの
で、分岐先命令のフエツチは休止され、BT制御
手段10によるブランチトレース制御が開始され
る。
When the program runs in the central processing unit and the branch condition is satisfied and a branch is executed, the BT control means 10 is activated, and the BT control means 10 issues a BT execution request, which is given priority. , fetching of the branch destination instruction is suspended, and branch trace control by the BT control means 10 is started.

BT制御手段10の制御が開始され、演算回路
(ALU)1の一方の入力に分岐アドレス、次いで
分岐先アドレスをセツトし、他方の入力に主記憶
のLS領域51に格納してある上限アドレスおよ
び下限アドレスを取り出してセツトして、 (下限アドレス)−(分岐元アドレス)、 (上限アドレス)−(分岐元アドレス)、 (下限アドレス)−(分岐先アドレス)、 (上限アドレス)−(分岐先アドレス)、 の4回の演算を実行させる。
The control of the BT control means 10 is started, and the branch address and then the branch destination address are set to one input of the arithmetic unit (ALU) 1, and the upper limit address and the upper limit address stored in the LS area 51 of the main memory are set to the other input. Fetch the lower limit address and set it, (lower limit address) - (branch source address), (upper limit address) - (branch source address), (lower limit address) - (branch destination address), (upper limit address) - (branch destination) address), and execute four operations.

ALU1における4回の演算結果の桁上げ出力
およびゼロ出力は、桁上げ及びゼロ出力検査回路
9に入れられ、ここで次の検査が行われる。
The carry output and zero output of the four operation results in the ALU 1 are input to the carry and zero output test circuit 9, where the next test is performed.

即ち、およびの演算結果で桁上げ出力が
“1”であるか又はゼロ出力が“1”であり、且
つおよびの演算結果で桁上げ出力が“0”で
あるか又はゼロ出力が“1”である条件が全て満
足されたとき、BTオーケー信号を“1”とす
る。
That is, the carry output is "1" or the zero output is "1" in the operation results of and, and the carry output is "0" or the zero output is "1" in the operation results of and. When all the conditions are satisfied, the BT OK signal is set to "1".

BTイネーブルが“1”にセツトしてあり、
BTオーケーが“1”となれば、ANDゲート7
が開かれ、LS51中にポインタの示すBTテーブ
ルアドレスに分岐元アドレスおよび分岐先アドレ
スが書き込まれる。また、書込みポインタが読み
出されデータのバイト数だけ加算されて書き込ま
れ、バイトカウントはバイト数だけ減算されて、
次の先頭アドレスおよび残りのバイト数を示すよ
うに更新されることは従来例と同様である。
BT enable is set to “1”,
If BT OK is “1”, AND gate 7
is opened, and the branch source address and branch destination address are written into the BT table address indicated by the pointer in the LS51. Also, the write pointer is read, the number of bytes of data is added and written, the byte count is subtracted by the number of bytes, and
As in the conventional example, the information is updated to indicate the next start address and the number of remaining bytes.

第2図は、命令とブランチトレースの実行シー
ケンスを示す図である。
FIG. 2 is a diagram showing an instruction and branch trace execution sequence.

図において、横軸は時間を示し各縦線は中央処
理装置のマシンサイクルを示す。中央処理装置に
おいて命令が走行中は各命令毎にALU使用要求
が出され、これより高い優先度の要求がないとき
その命令がALUを使用して命令を実行する。
ALUの使用要求の優先順位は次のようになつて
いる。
In the figure, the horizontal axis indicates time, and each vertical line indicates a machine cycle of the central processing unit. While an instruction is running in the central processing unit, an ALU use request is issued for each instruction, and when there is no request with a higher priority, that instruction uses the ALU to execute the instruction.
The priority order of ALU usage requests is as follows.

第1位 ブランチトレース要求 第2位 命令フエツチ要求 第3位 命令実行要求 サイクルで一つの一般命令の命令実行要求が
出され、ALU使用権を得てサイクル,で命
令が実行される。サイクルの終わりで次の命令
(分岐命令)の実行要求が出され、ALU使用権を
得てサイクル,で命令が実行される。これが
分岐命令であるためBT制御手段が活性化され、
サイクルの終わりでトレース要求を出す。分岐
命令の実行から分岐先の命令フエツチ要求が出さ
れる。トレース要求が命令フエツチ要求より優先
度が高いため、トレース要求がALU使用権を得
てブランチトレースが実行される。
1st place: Branch trace request 2nd place: Instruction fetch request 3rd place: Instruction execution request An instruction execution request for one general instruction is issued in a cycle, the ALU usage right is obtained, and the instruction is executed in the cycle. At the end of the cycle, a request to execute the next instruction (branch instruction) is issued, the right to use the ALU is obtained, and the instruction is executed in the cycle. Since this is a branch instruction, the BT control means is activated,
Issue a trace request at the end of the cycle. A request to fetch the branch destination instruction is issued from execution of the branch instruction. Since the trace request has higher priority than the instruction fetch request, the trace request obtains the right to use the ALU and branch trace is executed.

サイクルでブランチトレース実行が終了し、
トレース要求は無くなるので命令フエツチ要求が
ALU使用権を得て分岐先命令がフエツチされ、
サイクルの終わりで命令実行要求が出されサイ
クル,で分岐先の命令が実行される。
The branch trace execution ends in a cycle,
Since the trace request disappears, the instruction fetch request becomes
The right to use the ALU is obtained and the branch destination instruction is fetched.
At the end of the cycle, an instruction execution request is issued, and the branch destination instruction is executed at the end of the cycle.

〔作用〕[Effect]

上記構成により、分岐元および分岐先アドレス
が、セツトされている上限および下限アドレス内
にあるか否かの検査ができることを、つぎに説明
する。
Next, it will be explained that with the above configuration, it is possible to check whether the branch source and branch destination addresses are within the set upper and lower limit addresses.

分岐元(分岐先についても同様)アドレス(x
とする)は、下限および上限アドレス(L−
LMT,U−LMT)に対して、第3図aに示すよ
うに次の5つの場合がある。
Branch source (same as branch destination) address (x
) are the lower and upper limit addresses (L-
LMT, U-LMT), there are the following five cases as shown in Figure 3a.

(a) x<L−LMT、 (b) x=L−LMT、 (c) L−LMT<x<U−LMT、 (d) x=U−LMT、 (e) U−LMT<x、 上記5つの各々の場合に対する(L−LMT)−
xおよび(U−LMT)−xの演算結果に対する桁
上げ出力およびゼロ出力は、第3図bに示すよう
になる。
(a) x<L-LMT, (b) x=L-LMT, (c) L-LMT<x<U-LMT, (d) x=U-LMT, (e) U-LMT<x, above (L-LMT) for each of the five cases -
The carry output and zero output for the operation results of x and (U-LMT)-x are as shown in FIG. 3b.

従つて、分岐元または分岐先アドレスxが、上
限および下限アドレス内にあるとき、即ち(b),
(c),(d)にあるときの、(L−LMT)−xおよび
(U−LMT)−xの演算結果に対する桁上げ出力
およびゼロ出力の共通のオーケー条件は、第3図
bの最下欄の通りであり、4つの演算でこれが満
足されれば、BTオーケーとなる。
Therefore, when the branch source or branch destination address x is within the upper and lower limit addresses, that is, (b),
The common OK conditions for carry output and zero output for the operation results of (L-LMT)-x and (U-LMT)-x in cases (c) and (d) are as shown in Figure 3b. As shown in the column below, if this is satisfied with the four operations, BT is OK.

上記のようにして、既存の演算回路を使用して
比較演算を行うことにより、第6の従来例におい
て81〜84で示した4バイト程度の専用のレジ
スタおよび比較回路を必要とせず、9で示した1
ビツトの極めて小さな回路で済み、ハードウエア
量を大いに削減できる。
By performing comparison operations using existing arithmetic circuits as described above, there is no need for the 4-byte dedicated registers and comparison circuits shown at 81 to 84 in the sixth conventional example, and Shown 1
It requires only an extremely small circuit of bits, and the amount of hardware can be greatly reduced.

〔実施例〕〔Example〕

以下第4図および第5図に示す実施例により、
本発明をさらに具体的に説明する。
According to the embodiments shown in FIGS. 4 and 5 below,
The present invention will be explained in more detail.

第4図は本発明の実施例のブロツク図である。 FIG. 4 is a block diagram of an embodiment of the present invention.

第5図は本発明の実施例のタイムチヤートであ
る。
FIG. 5 is a time chart of an embodiment of the present invention.

第4図において、第5図と同一の符号は同一の
対象物を示す。
In FIG. 4, the same reference numerals as in FIG. 5 indicate the same objects.

第4図に示す91〜95は、第1図に示した桁
上げ及びゼロ出力検査回路9の内容の実施例回路
である。
Reference numerals 91 to 95 shown in FIG. 4 are embodiment circuits of the contents of the carry and zero output test circuit 9 shown in FIG.

91は排他的論理和回路(EOR)であり、演
算回路(ALU)1の桁上げ出力と、サイクルカ
ウント92の出力を入力としている。
91 is an exclusive OR circuit (EOR), which receives the carry output of the arithmetic unit (ALU) 1 and the output of the cycle count 92 as inputs.

サイクルカウント92は、クロツクで+1カウ
ントし、自己出力で“0”にリセツトする回路で
あり、従つて第5図のタイムチヤートで示すよう
に、サイクル毎に“0”,“1”を繰り返す。
The cycle counter 92 is a circuit that counts +1 by a clock and resets it to "0" by its own output. Therefore, as shown in the time chart of FIG. 5, "0" and "1" are repeated every cycle.

93はORゲートであり、EOR91の出力と演
算回路(ALU)1のゼロ出力を入力とする。
93 is an OR gate, which inputs the output of EOR 91 and the zero output of arithmetic unit (ALU) 1.

94はANDゲートであり、ORゲート93の出
力と回路95の出力を入力とする。
94 is an AND gate, which receives the output of the OR gate 93 and the output of the circuit 95 as inputs.

回路95は、ORゲート93の出力により
“1”にリセツトされ、次のサイクルで“0”に
なる回路である。
The circuit 95 is a circuit that is reset to "1" by the output of the OR gate 93 and becomes "0" in the next cycle.

最初のサイクルで、サイクルカウント92が
“0”であり、桁上げ出力が“1”であるとする
と、EOR91の出力は“1”となる。
In the first cycle, if the cycle count 92 is "0" and the carry output is "1", the output of the EOR 91 is "1".

EOR91の出力が“1”となると、ゼロ出力
の値に関係なく、ORゲート93の出力は“1”
となり、回路95は初期状態で“1”であるか
ら、ANDゲート94の出力は“1”となり、回
路95は“1”にリセツトされる。
When the output of EOR91 becomes "1", the output of OR gate 93 becomes "1" regardless of the value of zero output.
Since the circuit 95 is "1" in the initial state, the output of the AND gate 94 becomes "1" and the circuit 95 is reset to "1".

次のサイクルでは、サイクルカウント92は
“1”となり、桁上げ出力が“0”であれば、
EOR91の出力は“1”となる。従つて、AND
ゲート94の出力は“1”となり、回路95は
“1”にリセツトされる。
In the next cycle, the cycle count 92 becomes "1", and if the carry output is "0",
The output of EOR91 becomes "1". Therefore, AND
The output of gate 94 becomes "1" and circuit 95 is reset to "1".

次のサイクルでは、サイクルカウント92は
再び“0”となり、サイクルと同様なことが行
われる。
In the next cycle, the cycle count 92 becomes "0" again and the same cycle occurs.

次のサイクルでは、サイクルカウント92は
再び“1”となり、サイクルと同様なことが行
われ、ANDゲート94からはBT−OK“1”と
して出力される。
In the next cycle, the cycle count 92 becomes "1" again, the same thing as the cycle is performed, and the AND gate 94 outputs BT-OK "1".

このように、以上の各サイクルで、ゼロ出力が
“1”となれば、EOR91の出力が“0”であつ
てもANDゲート94の出力は“1”となる。
In this way, in each of the above cycles, if the zero output becomes "1", the output of the AND gate 94 becomes "1" even if the output of the EOR 91 is "0".

以上の,,,の4回のサイクルのう
ち、1回でもORゲート93の出力が“0”のサ
イクルがあると、ANDゲート94の出力は“0”
となり、回路95は“1”にリセツトされず、
ANDゲート94の出力は“0”となつてしまう。
If there is even one cycle in which the output of the OR gate 93 is "0" among the above four cycles, the output of the AND gate 94 is "0".
Therefore, the circuit 95 is not reset to "1",
The output of the AND gate 94 becomes "0".

第4図の回路において分岐条件が成立し分岐が
行われるとき、ブランチトレースが実行される状
況は第5図のタイムチヤートに示す通り、次のよ
うになる。
When a branch condition is satisfied and a branch is taken in the circuit of FIG. 4, the situation in which branch tracing is executed is as follows, as shown in the time chart of FIG.

(1) Aレジスタ(AR)2にLS51からL−
LMTがセツトされ、Bレジスタ(BR)3に
は分岐元アドレスがセツトされる。このときの
サイクルカウントは“0”である。
(1) L- from LS51 to A register (AR) 2
LMT is set, and the branch source address is set in B register (BR) 3. The cycle count at this time is "0".

(2) 次のサイクルで、ALU1において、AR−
BRの演算が行われ、その演算結果の桁上げお
よびゼロ出力が91〜95の回路で検査され
る。
(2) In the next cycle, AR−
The BR calculation is performed, and the carry and zero output of the calculation result is checked by circuits 91 to 95.

(3) AR2にはLS51からU−LMTがセツトさ
れる。サイクルカウント92は“1”となる。
(3) U-LMT is set to AR2 from LS51. The cycle count 92 becomes "1".

(4) 次のサイクルで、ALU1において、AR−
BRの演算が行われ、その演算結果の桁上げお
よびゼロ出力が91〜95の回路で検査され
る。
(4) In the next cycle, AR−
The BR calculation is performed, and the carry and zero output of the calculation result is checked by circuits 91 to 95.

(5) BR3には命令アドレスレジスタ(iAR)4
から分岐先アドレスがセツトされ、AR2には
LS51からL−LMTがセツトされる。サイク
ルカウントは“0”となる。
(5) BR3 has instruction address register (iAR) 4
The branch destination address is set from AR2.
L-LMT is set from LS51. The cycle count becomes "0".

(6) 次のサイクルで、ALU1において、AR−
BRの演算が行われ、その演算結果の桁上げお
よびゼロ出力が91〜95の回路で検査され
る。
(6) In the next cycle, AR−
The BR calculation is performed, and the carry and zero output of the calculation result is checked by circuits 91 to 95.

(7) AR2にはLS51からU−LMTがセツトさ
れる。サイクルカウントは“1”となる。
(7) U-LMT is set to AR2 from LS51. The cycle count becomes "1".

(8) 次のサイクルで、ALU1において、AR−
BRの演算が行われ、その演算結果の桁上げお
よびゼロ出力が91〜95の回路で検査され
る。
(8) In the next cycle, in ALU1, AR−
The BR calculation is performed, and the carry and zero output of the calculation result is checked by circuits 91 to 95.

(9) ANDゲート94の出力、即ちBT−OKが
“1”であれば、Zレジスタ(ZR)にある分岐
元アドレスおよびBR3にある分岐先アドレス
がBTテーブル52に書き込まれる。
(9) If the output of the AND gate 94, ie, BT-OK, is “1”, the branch source address in the Z register (ZR) and the branch destination address in BR3 are written to the BT table 52.

(10) AR2にはLS51からバイトカウントがカセ
ツトされ、BR3には、“8”がセツトされる。
“8”の値はBTテーブル52に書き込まれる
分岐元および分岐先アドレスデータが8バイト
であるからである。
(10) The byte count is cassetted from LS51 to AR2, and "8" is set to BR3.
The value “8” is because the branch source and branch destination address data written in the BT table 52 is 8 bytes.

(11) 次のサイクルで、ALU1において、AR
−BRの演算が行われ、その結果によつてLS5
1内のバイトカウントの値を更新する。
(11) In the next cycle, AR
−BR calculation is performed, and the result is LS5
Update the byte count value in 1.

(12) AR2にはLS51からポインタがセツト
される。
(12) A pointer is set in AR2 from LS51.

(13) 次のサイクルで、ALU1において、AR
+BRの演算が行われ、その結果によつてLS5
1内のポインタの値を更新する。
(13) In the next cycle, AR
+BR calculation is performed, and depending on the result, LS5
Update the value of the pointer in 1.

以上で1回のブランチトレースが終わり、次の
ブランチトレースの準備が整つたことになり、
BT制御部10は命令実行要求を止め、ALU1の
使用権はプログラム命令に移され分岐先命令がフ
エツチされ、次々と実行される。
This completes one branch trace and prepares for the next branch trace.
The BT control unit 10 stops the instruction execution request, the right to use the ALU 1 is transferred to the program instructions, the branch destination instructions are fetched, and the instructions are executed one after another.

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

以上説明のように本発明によれば、既存の演算
回路を利用してアドレス比較を行うため、ハード
ウエア量を削減することができ、その実用上の効
果はきわめて大である。
As described above, according to the present invention, since address comparison is performed using existing arithmetic circuits, the amount of hardware can be reduced, and the practical effects thereof are extremely large.

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

第1図は本発明の原理ブロツク図、第2図はブ
ランチトレース実行時のタイムチヤート、第3図
はBTオーケー条件を示す図、第4図は本発明の
実施例のブロツク図、第5図は本発明の実施例の
タイムチヤート、第6図は従来例のブロツク図で
ある。 図面において、1は演算回路(ALU)、2はA
レジスタ(AR)、3はBレジスタ(BR)、4は
命令アドレスレジスタ(iAR)、5は主記憶、6
はZレジスタ(ZR)、7はANDゲート、9は桁
上げ及びゼロ主検査回路、10はBT制御部(手
段)、51はLS領域、52はBTテーブル領域、
81,82はレジスタ、83,84は比較回路、
85はANDゲート、86は遅延AND回路、91
は排他的論理和回路(EOR)、92はサイクルカ
ウント、93はORゲート、94はANDゲート、
95はリセツト1回路、それぞれ示す。
Figure 1 is a block diagram of the principle of the present invention, Figure 2 is a time chart during branch trace execution, Figure 3 is a diagram showing BT OK conditions, Figure 4 is a block diagram of an embodiment of the present invention, and Figure 5. 6 is a time chart of an embodiment of the present invention, and FIG. 6 is a block diagram of a conventional example. In the drawing, 1 is an arithmetic unit (ALU), 2 is A
Register (AR), 3 is B register (BR), 4 is instruction address register (iAR), 5 is main memory, 6
is a Z register (ZR), 7 is an AND gate, 9 is a carry and zero main check circuit, 10 is a BT control unit (means), 51 is an LS area, 52 is a BT table area,
81 and 82 are registers, 83 and 84 are comparison circuits,
85 is an AND gate, 86 is a delay AND circuit, 91
is an exclusive OR circuit (EOR), 92 is a cycle count, 93 is an OR gate, 94 is an AND gate,
Reference numeral 95 indicates a reset 1 circuit.

Claims (1)

【特許請求の範囲】 1 分岐条件が成立したとき分岐元および分岐先
の命令アドレスを主記憶装置の特定領域上に格納
するブランチトレース処理を行うデータ処理装置
において、 分岐条件が成立したとき活性化され、前記デー
タ処理装置の備える演算回路の一方の入力に分岐
元アドレス、次いで分岐先アドレスをセツトし、
その各々に対して他方の入力に予め特定領域に格
納した上限アドレスと下限アドレスとを取り出し
セツトして、4回の差演算を実行させるBT制御
手段と、 前記演算回路による差演算の結果が負であると
き“1”となる桁上げ出力と差演算の結果がゼロ
であるとき“1”となるゼロ出力とを入力とし、
前記各演算の結果における前記桁上げ出力ならび
にゼロ出力を検査し、前記各回の演算結果総てが
所定の条件を満足したときブランチトレースを許
容する信号を出力する、桁上げおよびゼロ出力検
査回路とを備え、 ブランチトレースを行う場合にはプログラム走
行前に、前記分岐元および分岐先アドレスの上限
値および下限値を主記憶の特定領域に格納してお
き、プログラムが走行し分岐条件が成立したとき
は前記BT制御手段が活性化され、前記演算回路
の使用権を得て、分岐元および分岐先アドレスの
上限値および下限値との比較演算を前記データ処
理装置の演算回路により行うよう構成したことを
特徴とするブランチトレース制御方式。
[Scope of Claims] 1. In a data processing device that performs branch trace processing in which instruction addresses of a branch source and a branch destination are stored in a specific area of a main storage device when a branch condition is met, the method is activated when a branch condition is met. and setting a branch source address and then a branch destination address to one input of an arithmetic circuit included in the data processing device,
BT control means extracts and sets an upper limit address and a lower limit address stored in a specific area in advance to the other input for each of them, and executes four difference calculations; Input the carry output which becomes "1" when , and the zero output which becomes "1" when the result of the difference operation is zero,
a carry and zero output inspection circuit that inspects the carry output and zero output in the results of each operation, and outputs a signal allowing branch tracing when all of the operation results of each operation satisfy a predetermined condition; When performing branch tracing, store the upper and lower limits of the branch source and branch destination addresses in a specific area of the main memory before running the program, and when the program runs and the branch condition is met. The BT control means is activated and obtains the right to use the arithmetic circuit, and the arithmetic circuit of the data processing device is configured to perform a comparison operation of the branch source and branch destination addresses with upper and lower limit values. A branch trace control method featuring:
JP60283711A 1985-12-17 1985-12-17 Branch trace control system Granted JPS62143143A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP60283711A JPS62143143A (en) 1985-12-17 1985-12-17 Branch trace control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP60283711A JPS62143143A (en) 1985-12-17 1985-12-17 Branch trace control system

Publications (2)

Publication Number Publication Date
JPS62143143A JPS62143143A (en) 1987-06-26
JPH0439097B2 true JPH0439097B2 (en) 1992-06-26

Family

ID=17669090

Family Applications (1)

Application Number Title Priority Date Filing Date
JP60283711A Granted JPS62143143A (en) 1985-12-17 1985-12-17 Branch trace control system

Country Status (1)

Country Link
JP (1) JPS62143143A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5323244A (en) * 1976-08-16 1978-03-03 Hitachi Ltd Information processing unit
JPS5694449A (en) * 1979-12-27 1981-07-30 Toshiba Corp Trace system in computer

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5323244A (en) * 1976-08-16 1978-03-03 Hitachi Ltd Information processing unit
JPS5694449A (en) * 1979-12-27 1981-07-30 Toshiba Corp Trace system in computer

Also Published As

Publication number Publication date
JPS62143143A (en) 1987-06-26

Similar Documents

Publication Publication Date Title
JP2005317023A (en) Breakpoint logic unit, debug logic, and breakpoint method for data processing apparatus
EP0523758B1 (en) A method and apparatus for coordinating execution of an instruction by a coprocessor
JPS59231652A (en) Detection system for memory access overlap
JP2583525B2 (en) Data processing device
JPS5826584B2 (en) data processing equipment
JPH0439097B2 (en)
JPH0377137A (en) Information processor
JPH02123442A (en) Accelerated memory
JPS62156738A (en) Program controller
JPH01231126A (en) Information processor
JPS61131047A (en) Pipeline controlling system
JPH06202907A (en) Debug support device
JPS63120336A (en) Switching system for memory access mode
JPS6232509B2 (en)
JPS60122442A (en) Memory processing unit
JPS58195255A (en) Data processing device
JPS61100836A (en) System for processing comparison and instruction of moving instruction logic
JPS59211149A (en) Comparison stopping system
JPH02254541A (en) Control system for conditional branch instruction
JPH02297225A (en) Microprocessor
JPH0564373B2 (en)
JPH0340075A (en) Microcomputer
JPH0399338A (en) Microprocessor
JPH01193943A (en) Micro computer
JPH0419575B2 (en)