[go: up one dir, main page]

JPH05158734A - Microprocessor - Google Patents

Microprocessor

Info

Publication number
JPH05158734A
JPH05158734A JP3324405A JP32440591A JPH05158734A JP H05158734 A JPH05158734 A JP H05158734A JP 3324405 A JP3324405 A JP 3324405A JP 32440591 A JP32440591 A JP 32440591A JP H05158734 A JPH05158734 A JP H05158734A
Authority
JP
Japan
Prior art keywords
instruction
branch
address
signal
execution
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
JP3324405A
Other languages
Japanese (ja)
Inventor
Takahiro Watabe
隆弘 渡部
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 JP3324405A priority Critical patent/JPH05158734A/en
Publication of JPH05158734A publication Critical patent/JPH05158734A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To reduce the quantity of information necessary for tracing an instruction or to prevent the deterioration of performance of a microprocessor by providing a bus control part to input a branch signal and to output the contents of the 1st and 2nd registers to the terminals respectively. CONSTITUTION:An instruction prefetch pert 10 is provided together with an instruction cache part 20, an instruction decoder 30, an address calculation part 40, an instruction executing part 50, a bus interface control pert 60, a branch address register 70, an execution instruction counter 80, a branch address 41, a branch signal 51, an instruction end signal 52, an address bus 61, the bus access information 62, and the instruction execution information 63. The counter 80 inputs both signals 51 and 52 and counts the number of instructions carried out among the branch instructions. Meanwhile, the instruction address of a branch destination is stored in the register 70, and the contents of the counter 80 are outputted to the information 63. Then, the contents of the register 70 are outputted to the bus 61.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、マイクロプロセッサの
実行状態をマイクロプロセッサ外部に出力する装置に関
し、特に、コンピュータの処理の高速化技術の一つであ
る命令用キャッシュメモリ装置を内蔵するマイクロプロ
セッサに関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a device for outputting the execution state of a microprocessor to the outside of the microprocessor, and more particularly to a microprocessor incorporating an instruction cache memory device which is one of the techniques for speeding up computer processing. It is about.

【0002】[0002]

【従来の技術】近年、マイクロプロセッサは、処理速度
の高速化のためにパイプライン処理やキャッシュメモリ
装置などの技術を導入すると共に、マイクロプロセッサ
を用いた回路やプログラムの開発時にその開発効率を高
めるために必要となるマイクロプロセッサの実行状態を
示す情報をマイクロプロセッサの外部に出力するための
機構が利用されている。命令用のキャッシュを内蔵する
場合、内蔵キャッシュがヒットしている場合命令の実行
状況がマイクロプロセッサの外部に出力されず、マイク
ロプロセッサのアドレスバスおよびデータバスの情報を
記録するだけでは、マイクロプロセッサの実行する命令
をトレースすることはできない。
2. Description of the Related Art In recent years, microprocessors have introduced technologies such as pipeline processing and cache memory devices in order to speed up the processing speed, and increase the development efficiency when developing circuits and programs using the microprocessor. A mechanism for outputting information indicating the execution state of the microprocessor, which is necessary for this purpose, to the outside of the microprocessor is used. When the instruction cache is built-in, if the built-in cache is hit, the instruction execution status is not output to the outside of the microprocessor, and if the microprocessor's address bus and data bus information are only recorded, It is not possible to trace the instruction to be executed.

【0003】以下図面を参照しながら、上記した従来の
マイクロプロセッサの一例について説明する。
An example of the conventional microprocessor described above will be described below with reference to the drawings.

【0004】図3は従来のマイクロプロセッサの実行状
態を示す情報をマイクロプロセッサの外部に出力するた
めの装置の構成を示すものである。図3において、10
1はフェッチアドレスレジスタ、102は実行アドレス
レジスタで、各々命令フェッチアドレス及びマイクロプ
ロセッサの実行している命令のアドレスを保持する。1
03はバス制御部、104は出力バス、106はラッ
チ、107はバッファ、125はアドレスバス、127
はフェッチアドレスストローブ信号、128は実行アド
レスストローブ信号である。
FIG. 3 shows the structure of a device for outputting information indicating the execution state of a conventional microprocessor to the outside of the microprocessor. In FIG. 3, 10
Reference numeral 1 is a fetch address register, and 102 is an execution address register, which holds an instruction fetch address and an address of an instruction being executed by the microprocessor. 1
Reference numeral 03 is a bus control unit, 104 is an output bus, 106 is a latch, 107 is a buffer, 125 is an address bus, 127
Is a fetch address strobe signal, and 128 is an execution address strobe signal.

【0005】以上のように構成されたマイクロプロセッ
サについて、以下その動作について説明する。まず、マ
イクロプロセッサは、フェッチサイクルおよび実行サイ
クルにおいて、それぞれ命令フェッチアドレスレジスタ
101と実行アドレスレジスタ102に対応するアドレ
スを格納する。バス制御部103は、フェッチアドレス
レジスタ101にアドレスが格納された場合は出力バス
104にフェッチアドレスレジスタ101の内容を出力
するよう制御すると共に、ラッチ106に格納しバッフ
ァ107によってアドレスバス125へ出力する。バス
制御部103は、さらにフェッチアドレスストローブ信
号127によりアドレスバス125上にフェッチアドレ
スが出力されていることを示す。
The operation of the microprocessor configured as described above will be described below. First, the microprocessor stores the addresses corresponding to the instruction fetch address register 101 and the execution address register 102 in the fetch cycle and the execution cycle, respectively. When the address is stored in the fetch address register 101, the bus control unit 103 controls to output the content of the fetch address register 101 to the output bus 104, and stores it in the latch 106 and outputs it to the address bus 125 by the buffer 107. .. The bus control unit 103 further indicates that the fetch address strobe signal 127 outputs the fetch address on the address bus 125.

【0006】実行アドレスレジスタ102にアドレスが
格納された場合は、バス制御部はそのサイクルにおいて
フェッチアドレスレジスタ101にアドレスが格納され
ない場合はそのサイクルにおいて、同一サイクルにおい
てフェッチアドレスが格納された場合は次サイクルにお
いて実行アドレスレジスタ102の内容を出力バス10
4に出力させ、ラッチ106に格納すると共に、バッフ
ァ107によりアドレスバス125へ出力する。さら
に、実行アドレスストローブ128により実行アドレス
がアドレスバス125上に出力されているをこと示す。
(例えば、特開平1ー154255号公報)。
When an address is stored in the execution address register 102, the bus control unit next time when an address is not stored in the fetch address register 101 in that cycle, and when the fetch address is stored in the same cycle in the following cycle. Output the contents of the execution address register 102 in the cycle
4 and outputs it to the latch 106 and outputs it to the address bus 125 by the buffer 107. Further, the execution address strobe 128 indicates that the execution address is output on the address bus 125.
(For example, JP-A-1-154255).

【0007】[0007]

【発明が解決しようとする課題】しかしながら上記のよ
うな構成では、マイクロプロセッサが出力する情報に基
づいて、マイクロプロセッサの実行命令のトレースを行
う場合、マイクロプロセッサが実行する全ての命令のア
ドレスを記録する必要があり容量の大きい記憶装置を必
要とするという問題点を有していた。また、マイクロプ
ロセッサの高速化に伴い、常にマイクロプロセッサの実
行情報をプロセッサの外部に出力することによって、バ
スの競合が発生しマイクロプロセッサの性能の低下を招
く。さらに、マイクロプロセッサの実行する命令のトレ
ースを行う場合のみマイクロプロセッサの実行情報を出
力する方法もあるが、トレースを行う場合とそうでない
場合の実行環境が大きく変化し、正確な情報を得る事が
困難である。
However, in the above configuration, when tracing the execution instructions of the microprocessor based on the information output by the microprocessor, the addresses of all the instructions executed by the microprocessor are recorded. However, there is a problem in that a storage device having a large capacity is required. Further, as the microprocessor speeds up, the execution information of the microprocessor is always output to the outside of the processor, which causes bus contention and reduces the performance of the microprocessor. Furthermore, there is a method of outputting the execution information of the microprocessor only when tracing the instructions executed by the microprocessor, but the execution environment when tracing is different from that when it is not, and accurate information can be obtained. Have difficulty.

【0008】本発明は上記問題点に鑑み、多大な記憶装
置を必要とすることなく、また、マイクロプロセッサの
実行する命令をトレースする際にマイクロプロセッサの
性能の低下を抑えるマイクロプロセッサの実行トレース
を行う事が可能なマイクロプロセッサを提供することを
目的とする。
In view of the above problems, the present invention provides an execution trace of a microprocessor which does not require a large storage device and which suppresses deterioration of the performance of the microprocessor when tracing an instruction executed by the microprocessor. It is an object to provide a microprocessor that can perform.

【0009】[0009]

【課題を解決するための手段】上記問題点を解決するた
めに本発明のマイクロプロセッサは、命令の実行の終了
を示す命令終了信号と、分岐命令実行時に分岐条件が成
立し、あるいは無条件に分岐を行うことを示す分岐信号
と、前記命令終了信号を入力し実行した命令数をカウン
トし前記分岐信号を入力することにより内容をリセット
する命令実行カウンタと、前記命令実行カウンタより命
令実行数を入力し保持する第一のレジスタと、分岐先の
命令のアドレスを計算し出力するアドレス計算部と、前
記アドレス計算部が出力する分岐先アドレスを入力し保
持する第二のレジスタと、前記分岐信号を入力し前記第
一及び第二のレジスタの内容をそれぞれ端子に出力する
バス制御部とを備えたものである。
In order to solve the above problems, a microprocessor according to the present invention uses an instruction end signal indicating the end of instruction execution and a branch condition is satisfied when a branch instruction is executed, or unconditionally. A branch signal indicating that a branch is to be performed, an instruction execution counter that inputs the instruction end signal, counts the number of executed instructions, and resets the contents by inputting the branch signal, and an instruction execution number from the instruction execution counter. A first register for inputting and holding, an address calculating unit for calculating and outputting an address of a branch destination instruction, a second register for inputting and holding a branch destination address output by the address calculating unit, and the branch signal And a bus controller for inputting the contents of the first and second registers to the respective terminals.

【0010】さらに、計算される分岐先の命令のアドレ
スが、メモリまたはレジスタの内容を参照する場合にの
み出力される間接分岐信号を備えたものである。
Further, the address of the branch destination instruction to be calculated is provided with an indirect branch signal which is output only when referring to the contents of the memory or the register.

【0011】[0011]

【作用】本発明は上記した構成によって、キャッシュを
使用中にマイクロプロセッサが分岐命令を実行する毎に
実行を終了した命令の個数と、分岐先の命令のアドレス
を出力する。命令のトレースの開始アドレスは既知であ
るため、分岐命令が実行されない場合はメモリ上の命令
列よりマイクロプロセッサの実行トレースを行うことが
可能である。分岐命令をマイクロプロセッサが実行した
場合は、その分岐先がマイクロプロセッサにより示され
る。従って、命令の実行トレースを行うために、トレー
スの開始アドレス、または分岐命令による分岐先のアド
レスから実行の終了した命令の個数とにより分岐を行な
った命令を決定できる。従って、マイクロプロセッサの
外部に設ける命令のトレース用装置は、マイクロプロセ
ッサが分岐を行なった場合に分岐先の命令のアドレスと
そのアドレスへ分岐するまでに実行された命令の個数を
マイクロプロセッサの実行情報として保持すればよい。
従って、容量の少ない記憶装置を用いて効率よくトレ
ースが行えることとなる。また、分岐命令によって分岐
する場合のみマイクロプロセッサの実行情報をアドレス
バスを用いて出力する為、マイクロプロセッサの性能の
低下を低減する。
With the above-described structure, the present invention outputs the number of executed instructions and the address of the branch destination instruction each time the microprocessor executes a branch instruction while using the cache. Since the start address of the instruction trace is known, the execution trace of the microprocessor can be performed from the instruction string on the memory when the branch instruction is not executed. When the microprocessor executes the branch instruction, the branch destination is indicated by the microprocessor. Therefore, in order to execute the execution trace of the instruction, the instruction that has branched can be determined by the start address of the trace or the address of the branch destination of the branch instruction and the number of instructions that have finished executing. Therefore, the instruction tracing device provided outside the microprocessor determines the address of the instruction at the branch destination and the number of instructions executed until branching to the address when the microprocessor performs a branch. You can keep it as.
Therefore, the trace can be efficiently performed using the storage device having a small capacity. Further, since the execution information of the microprocessor is output using the address bus only when branching by the branch instruction, the deterioration of the performance of the microprocessor is reduced.

【0012】さらに、メモリまたはレジスタの内容を参
照する場合にのみ分岐先の命令のアドレス出力される間
接分岐信号を備えることにより、メモリ上の命令からは
分岐先の命令のアドレスを決定できない場合のみ分岐先
命令のアドレスを出力することが可能となる。即ち、分
岐命令によって分岐する分岐先が絶対アドレッシング等
で示される場合はメモリ上の命令列より実行トレースが
可能であり、分岐先がレジスタやメモリ上のデータによ
り示される場合にのみ分岐先の命令のアドレスとその分
岐命令を実行するまでに実行した命令の個数を実行情報
として出力し、他のアドレッシングモードで分岐先の命
令アドレスが決定される場合はその分岐命令までに実行
された命令の個数のみを出力することで、マイクロプロ
セッサの実行環境に与える影響を抑え、性能の低下を少
なくし、さらに、命令のトレースに必要な情報をさらに
減少させることとなる。
Further, by providing an indirect branch signal for outputting the address of the branch destination instruction only when referring to the contents of the memory or the register, only when the address of the branch destination instruction cannot be determined from the instruction on the memory. It becomes possible to output the address of the branch destination instruction. That is, when the branch destination branched by the branch instruction is indicated by absolute addressing or the like, the execution trace can be performed from the instruction sequence on the memory, and the instruction of the branch destination can be executed only when the branch destination is indicated by the register or the data on the memory. Address and the number of instructions executed up to the execution of that branch instruction are output as execution information. If the branch destination instruction address is determined in another addressing mode, the number of instructions executed up to that branch instruction. By outputting only, the influence on the execution environment of the microprocessor is suppressed, the deterioration in performance is reduced, and further, the information required for instruction tracing is further reduced.

【0013】[0013]

【実施例】以下本発明の一実施例のマイクロプロセッサ
について、図面を参照しながら説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A microprocessor according to an embodiment of the present invention will be described below with reference to the drawings.

【0014】図1は本発明の実施例におけるマイクロプ
ロセッサの構成例を示すものである。図1において、1
0は命令プリフェッチ部、20は命令キャッシュ、30
は命令デコーダ、40はアドレス計算部、50は命令実
行部、60はバスインタフェース制御部、70は分岐ア
ドレスレジスタ、80は実行命令カウンタで、41は分
岐アドレス、51は分岐信号、52は命令終了信号、6
1はアドレスバス、62はバスアクセス情報、63は命
令実行情報である。
FIG. 1 shows an example of the configuration of a microprocessor according to an embodiment of the present invention. In FIG. 1, 1
0 is an instruction prefetch unit, 20 is an instruction cache, 30
Is an instruction decoder, 40 is an address calculation unit, 50 is an instruction execution unit, 60 is a bus interface control unit, 70 is a branch address register, 80 is an execution instruction counter, 41 is a branch address, 51 is a branch signal, and 52 is an instruction end. Signal, 6
Reference numeral 1 is an address bus, 62 is bus access information, and 63 is instruction execution information.

【0015】以上のように構成されたマイクロプロセッ
サについて、以下、図1を用いてその動作を説明する。
キャッシュイネーブル信号12により命令キャッシュ2
0の使用が許可されている場合、命令プリフェッチ部1
0において次サイクルにおいて実行する命令のアドレス
が計算され(分岐が発生しない場合)、命令キュッシュ
10内にある命令が読みだされ、読みだされた命令は命
令デコーダ30においてデコードされる。命令デコーダ
30のデコード結果に基づき命令実行部50は命令の実
行を行う。命令実行部50は命令デコーダ30により指
示された命令の実行を終了するサイクルにおいて命令実
行終了信号52を出力する。さらに、命令実行カウンタ
80は命令実行終了信号52が出力される毎にその内容
を1づつ加算し、命令実行部50において実行の終了し
た命令の数をカウントする。なお、この命令実行カウン
タ80は図1には示していないが、マイクロプロセッサ
のリセット時に同時に0にリセットされる。
The operation of the microprocessor configured as described above will be described below with reference to FIG.
Instruction cache 2 by cache enable signal 12
If the use of 0 is permitted, the instruction prefetch unit 1
At 0, the address of the instruction to be executed in the next cycle is calculated (when no branch occurs), the instruction in the instruction cache 10 is read, and the read instruction is decoded by the instruction decoder 30. The instruction executing section 50 executes the instruction based on the decoding result of the instruction decoder 30. The instruction execution unit 50 outputs the instruction execution end signal 52 in the cycle in which the execution of the instruction instructed by the instruction decoder 30 ends. Furthermore, the instruction execution counter 80 increments the content by one each time the instruction execution end signal 52 is output, and counts the number of instructions that have been executed in the instruction execution unit 50. Although not shown in FIG. 1, the instruction execution counter 80 is reset to 0 at the same time when the microprocessor is reset.

【0016】命令デコーダ30においてデコードされた
命令が分岐命令で合った場合、命令実行部50は分岐先
命令のアドレスをアドレス計算部40において求め、そ
の結果を分岐アドレスバス41へ出力すると共に、分岐
条件が成立し、あるいは無条件に分岐が行なわれる事を
示すために分岐命令信号51を出力する。バス制御部6
0は、ユニット内の分岐アドレスレジスタ70に分岐先
アドレスバス41に分岐アドレスが出力される毎に分岐
アドレスを取り込み格納する。また、命令プリフェッチ
部10は分岐先アドレスを分岐アドレスバス41より取
り込み命令キャッシュ20内に分岐先の命令が格納され
ているかどうか検索を行う。さらに、分岐信号51が出
力されると命令実行カウンタ80は、そのカウンタ内に
保持している内容をラッチ85に出力すると共にカウン
タの内容を0にクリアする。バス制御部60は、キャッ
シュイネーブル信号12が出力されている場合は、分岐
命令信号51が出力される毎に分岐アドレスレジスタ7
0の内容をセレクタ65により選択しアドレスバス61
に出力すると共に、バスアクセス情報62によりアドレ
スバス61上に分岐アドレスが出力されていることを示
す。さらに、バス制御部は同時にラッチ85の内容を命
令実行情報63に出力する。
When the instruction decoded by the instruction decoder 30 matches a branch instruction, the instruction executing section 50 obtains the address of the branch destination instruction in the address calculating section 40, outputs the result to the branch address bus 41, and branches. A branch instruction signal 51 is output to indicate that the condition is satisfied or the branch is unconditionally performed. Bus control unit 6
0 captures and stores the branch address each time the branch address is output to the branch destination address bus 41 to the branch address register 70 in the unit. Further, the instruction prefetch unit 10 fetches the branch destination address from the branch address bus 41 and searches whether or not the branch destination instruction is stored in the instruction cache 20. Further, when the branch signal 51 is output, the instruction execution counter 80 outputs the content held in the counter to the latch 85 and clears the content of the counter to zero. When the cache enable signal 12 is output, the bus control unit 60 outputs the branch address register 7 every time the branch instruction signal 51 is output.
The content of 0 is selected by the selector 65 and the address bus 61 is selected.
And the branch address is output on the address bus 61 by the bus access information 62. Further, the bus control unit simultaneously outputs the contents of the latch 85 to the instruction execution information 63.

【0017】本図には図示していないが、本マイクロプ
ロセッサに接続されている実行状況をトレースする装置
によりアドレスバス61、バスアクセス情報62、およ
び命令実行情報63がトレースされており、バスアクセ
ス情報により分岐命令に関する情報がアドレスバス61
および命令実行情報63に出力が確認された場合のみそ
れらの内容をトレース装置は格納する。アドレスバス6
1および命令実行情報63により、分岐先命令のアドレ
スが得られ、前回の分岐命令のアドレスから実行された
命令の数が確認できる。したがって、命令のトレースは
メモリ上の前回の分岐命令から連続する命令実行情報6
3により示される命令数を逆アセンブラ等により求める
事が可能である。
Although not shown in the figure, the address bus 61, the bus access information 62, and the instruction execution information 63 are traced by a device for tracing the execution status connected to the present microprocessor. Depending on the information, the information about the branch instruction is sent to the address bus 61.
And only when the output is confirmed in the instruction execution information 63, the trace device stores those contents. Address bus 6
From 1 and the instruction execution information 63, the address of the branch destination instruction can be obtained, and the number of executed instructions can be confirmed from the address of the previous branch instruction. Therefore, the instruction trace is the instruction execution information 6 that continues from the previous branch instruction on the memory.
The number of instructions indicated by 3 can be obtained by a disassembler or the like.

【0018】以上のように本実施例のよれば、命令の実
行の終了を示すための命令終了信号52と、分岐命令実
行時に分岐を行うことを示す分岐信号51と、前記命令
終了信号を入力し実行した命令の数をカウントし前記分
岐信号を入力することにより内容をリセットする命令実
行カウンタ80と、前記命令実行カウンタより入力し保
持するラッチ85と、アドレス計算部40が出力する分
岐先アドレス41を入力し保持するレジスタ70と、端
子としてアドレスバス61、バスアクセス情報62およ
び命令実行情報63とを設けることにより、命令のトレ
ースを命令キャッシュの使用中においても、プロセッサ
外部で多くの情報を保持することなくマイクロプロセッ
サの実行する命令のトレースを行うことができる。
As described above, according to the present embodiment, the instruction end signal 52 for indicating the end of the execution of the instruction, the branch signal 51 for performing the branch when the branch instruction is executed, and the instruction end signal are input. The instruction execution counter 80 that counts the number of executed instructions and resets the contents by inputting the branch signal, the latch 85 that is input and held by the instruction execution counter, and the branch destination address output by the address calculator 40 By providing a register 70 for inputting and holding 41 and an address bus 61, bus access information 62 and instruction execution information 63 as terminals, a lot of information can be stored outside the processor even when the instruction trace is used in the instruction cache. The trace of the instruction executed by the microprocessor can be performed without holding.

【0019】以下本発明の第2の実施例について図面を
参照しながら説明する。図2は本発明の第2の実施例を
示すマイクロプロセッサの構成図である。10は命令プ
リフェッチ部、20は命令キャッシュ、30は命令デコ
ーダ、40はアドレス計算部、50は命令実行部、60
はバスインタフェース制御部、70は分岐アドレスレジ
スタである。以上は図1の構成と同様なものである。図
1と異なるのは間接分岐信号53を設けた点である。
A second embodiment of the present invention will be described below with reference to the drawings. FIG. 2 is a block diagram of a microprocessor showing a second embodiment of the present invention. 10 is an instruction prefetch unit, 20 is an instruction cache, 30 is an instruction decoder, 40 is an address calculation unit, 50 is an instruction execution unit, 60
Is a bus interface control unit, and 70 is a branch address register. The above is the same as the configuration of FIG. The difference from FIG. 1 is that an indirect branch signal 53 is provided.

【0020】以上のように構成されたマイクロプロセッ
サについて、 以下その動作を説明する。命令実行部5
0において実行される分岐命令にって分岐する先の命令
のアドレスが、レジスタ又はメモリ上の値を用いて決定
される場合に間接分岐信号53が出力される。また、こ
の間接分岐信号53は分岐命令のアドレスと分岐命令内
にあるディスプレースメント情報即ち偏差により指定さ
れる場合は出力されない。バス制御部60は、分岐命令
信号51および間接分岐信号53が出力された場合の
み、アドレスバス61に分岐先の命令のアドレスを出力
し、さらにバスアクセス情報62および命令実行情報6
3を出力する。間接分岐信号53が出力されず分岐命令
信号51のみが出力された場合は、バス制御部60は、
命令実行情報63のみを出力する。即ち、間接分岐命令
を実行した場合はその命令の実行により分岐するアドレ
スとバスアクセス情報を、命令実行情報即ち前回の分岐
から今回の分岐までに実行した命令数とともに出力し、
他の方法により分岐先が決定され分岐が実行された場合
は、命令実行情報のみを出力する。
The operation of the microprocessor configured as described above will be described below. Instruction execution unit 5
The indirect branch signal 53 is output when the address of the instruction to branch to in the branch instruction executed at 0 is determined by using the value in the register or the memory. The indirect branch signal 53 is not output when it is specified by the address of the branch instruction and the displacement information, that is, the deviation in the branch instruction. The bus control unit 60 outputs the address of the branch destination instruction to the address bus 61 only when the branch instruction signal 51 and the indirect branch signal 53 are output, and further, the bus access information 62 and the instruction execution information 6
3 is output. When the indirect branch signal 53 is not output and only the branch instruction signal 51 is output, the bus control unit 60
Only the instruction execution information 63 is output. That is, when an indirect branch instruction is executed, the address and the bus access information branching by the execution of the instruction are output together with the instruction execution information, that is, the number of instructions executed from the previous branch to the current branch,
When the branch destination is determined by another method and the branch is executed, only the instruction execution information is output.

【0021】以上のように、間接分岐命令を実行する際
に出力される間接分岐信号53を設けることにより、マ
イクロプロセッサの実行する命令のトレースを行う場合
に記録する情報を減少できるとともに、分岐アドレスを
アドレスバスに出力する回数を減少でき、マイクロプロ
セッサの実行環境および性能に与える影響を減おさえる
ことができる。
As described above, by providing the indirect branch signal 53 output when the indirect branch instruction is executed, the information recorded when tracing the instruction executed by the microprocessor can be reduced and the branch address can be reduced. Can be output to the address bus less frequently, and the influence on the execution environment and performance of the microprocessor can be reduced.

【0022】[0022]

【発明の効果】以上のように本発明は、キャッシュの使
用を有効にするキャッシュ有効信号と、命令の実行の終
了を示す命令終了信号と、分岐命令実行時に分岐を行う
ことを示す分岐信号とを出力する実行部と、前記命令終
了信号を入力する毎に保持している内容をカウントアッ
プすることで実行した命令の数をカウントし前記分岐信
号を入力することにより内容をリセットする命令実行カ
ウンタと、前記命令実行カウンタより実行命令数を入力
し保持する第一のレジスタと、分岐先の命令のアドレス
を計算し出力するアドレス計算部と、前記アドレス計算
部が出力する分岐先アドレスを入力し保持する第二のレ
ジスタと、前記キャッシュ有効信号と前記分岐信号を入
力し前記第一及び第二のレジスタの内容をそれぞれ出力
するバス制御部を設けることにより、マイクロプロセッ
サの外部に大規模なトレース装置を設けることなく少な
い容量の記憶装置によりマイクロプロセッサの実行した
命令のトレースを行うことができる。
As described above, according to the present invention, the cache valid signal for validating the use of the cache, the instruction end signal for indicating the end of the execution of the instruction, and the branch signal for indicating the branch at the execution of the branch instruction are provided. And an instruction execution counter that counts the number of executed instructions by counting up the contents held each time the instruction end signal is input and resets the contents by inputting the branch signal. A first register for inputting and holding the number of execution instructions from the instruction execution counter; an address calculation unit for calculating and outputting the address of the branch destination instruction; and a branch destination address output by the address calculation unit. A second register that holds the bus, and a bus control unit that inputs the cache valid signal and the branch signal and outputs the contents of the first and second registers, respectively. By kicking it, it is possible to trace instructions executed in the microprocessor by a storage device smaller volume without providing a large tracing device external to the microprocessor.

【0023】また、間接分岐命令を実行する際に出力さ
れる間接分岐信号を設けることにより、分岐先アドレス
を出力する回数を減らすことができ、よりマイクロプロ
セッサの実行環境への影響および性能の低下を招くこと
なくマイクロプロセッサの実行した命令のトレースを行
うことができる。
By providing an indirect branch signal that is output when an indirect branch instruction is executed, the number of times the branch destination address is output can be reduced, which further affects the execution environment of the microprocessor and lowers the performance. The instruction executed by the microprocessor can be traced without incurring.

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

【図1】本発明の第1の実施例におけるマイクロプロセ
ッサの構成図である。
FIG. 1 is a configuration diagram of a microprocessor according to a first embodiment of the present invention.

【図2】本発明の第2の実施例におけるマイクロプロセ
ッサの構成図である。
FIG. 2 is a configuration diagram of a microprocessor according to a second embodiment of the present invention.

【図3】従来のマイクロプロセッサの実行状態を示す情
報をマイクロプロセッサの外部に出力する装置の構成図
である。
FIG. 3 is a configuration diagram of a device that outputs information indicating the execution state of a conventional microprocessor to the outside of the microprocessor.

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

10 命令プリフェッチ部 20 命令キャッシュ 30 命令レコーダ 40 アドレス計算部 50 命令実行部 60 バス制御部 70 分岐アドレスレジスタ 80 命令実行カウンタ 10 instruction prefetch unit 20 instruction cache 30 instruction recorder 40 address calculation unit 50 instruction execution unit 60 bus control unit 70 branch address register 80 instruction execution counter

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 命令用のキャッシュと、 前記キャッシュの使用を有効にするキャッシュ有効信号
と、命令を入力しデコードおよび実行を行うとともに命
令の実行の終了するサイクルにおいて命令の終了を示す
命令終了信号と分岐命令実行時に分岐を行うことを示す
分岐信号とを出力する実行部と、 前記命令終了信号を入力する毎に保持している内容をカ
ウントアップすることで実行した命令の数をカウントし
前記分岐信号を入力することにより内容をリセットする
命令実行カウンタと、 前記命令実行カウンタより実行命令数を入力し保持する
第一のレジスタと、 分岐先の命令のアドレスを計算し出力するアドレス計算
部と、 前記アドレス計算部が出力する分岐先アドレスを入力し
保持する第二のレジスタと、 前記キャッシュ有効信号と前記分岐信号を入力し前記第
一及び第二のレジスタの内容をそれぞれ端子に出力する
バス制御部を備えたことを特徴とするマイクロプロセッ
サ。
1. A cache for instructions, a cache valid signal for validating the use of the cache, and an instruction end signal for indicating the end of an instruction in a cycle in which the instruction is input, decoded and executed, and the execution of the instruction ends. And an execution unit that outputs a branch signal indicating that a branch is to be executed when the branch instruction is executed, and the number of executed instructions is counted by counting up the content held each time the instruction end signal is input. An instruction execution counter that resets the contents by inputting a branch signal, a first register that inputs and holds the number of executed instructions from the instruction execution counter, and an address calculation unit that calculates and outputs the address of the branch destination instruction A second register for inputting and holding a branch destination address output from the address calculator, the cache valid signal, and A microprocessor comprising a bus control unit which inputs a branch signal and outputs the contents of the first and second registers to terminals.
【請求項2】 命令用のキャッシュと、 前記キャッシュの使用を有効にするキャッシュ有効信号
と、命令を入力しデコードおよび実行を行うとともに命
令の実行の終了するサイクルにおいて命令の終了を示す
命令終了信号と分岐命令実行時に分岐を行うことを示す
分岐信号と前記アドレス計算部において計算される分岐
先の命令のアドレスがメモリまたはレジスタの内容に基
づいて決定される場合にのみ間接分岐信号を出力する命
令実行部と、 前記命令終了信号を入力する毎に保持している内容をカ
ウントアップすることで実行した命令の数をカウントし
前記分岐信号を入力することにより内容をリセットする
命令実行カウンタと、 前記命令実行カウンタより実行命令数を入力し保持する
第一のレジスタと、 分岐先の命令のアドレスを計算し出力するアドレス計算
部と、 前記アドレス計算部が出力する分岐先アドレスを入力し
保持する第二のレジスタと、 前記間接分岐信号を入力し前記間接分岐信号と前記分岐
信号とが入力された場合に前記第一および第二のレジス
タの内容を出力し前記分岐信号のみが入力された場合に
は前記第一のレジスタの内容のみを出力するバス制御部
とを備えたことを特徴とするマイクロプロセッサ。
2. A cache for instructions, a cache valid signal that enables the use of the cache, and an instruction end signal that indicates the end of the instruction in the cycle in which the instruction is input, decoded and executed, and the execution of the instruction ends. And a branch signal indicating that a branch is to be executed when the branch instruction is executed, and an instruction that outputs an indirect branch signal only when the address of the branch destination instruction calculated by the address calculator is determined based on the contents of the memory or register. An execution unit; an instruction execution counter for counting the number of executed instructions by counting up the content held each time the instruction end signal is input and resetting the content by inputting the branch signal; Calculates the first register that holds the number of executed instructions from the instruction execution counter and the address of the branch destination instruction An address calculator that outputs, a second register that inputs and holds a branch destination address that the address calculator outputs, and a case where the indirect branch signal is input and the indirect branch signal and the branch signal are input. A bus controller that outputs the contents of the first and second registers and outputs only the contents of the first register when only the branch signal is input.
JP3324405A 1991-12-09 1991-12-09 Microprocessor Pending JPH05158734A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3324405A JPH05158734A (en) 1991-12-09 1991-12-09 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3324405A JPH05158734A (en) 1991-12-09 1991-12-09 Microprocessor

Publications (1)

Publication Number Publication Date
JPH05158734A true JPH05158734A (en) 1993-06-25

Family

ID=18165435

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3324405A Pending JPH05158734A (en) 1991-12-09 1991-12-09 Microprocessor

Country Status (1)

Country Link
JP (1) JPH05158734A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6594782B1 (en) 1998-12-28 2003-07-15 Fujitsu Limited Information processing apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6594782B1 (en) 1998-12-28 2003-07-15 Fujitsu Limited Information processing apparatus

Similar Documents

Publication Publication Date Title
KR920006275B1 (en) Data processing apparatus
US4827402A (en) Branch advanced control apparatus for advanced control of a branch instruction in a data processing system
JPH03282958A (en) Electronic computer
US5502827A (en) Pipelined data processor for floating point and integer operation with exception handling
US5689694A (en) Data processing apparatus providing bus attribute information for system debugging
EP0378415A2 (en) Multiple instruction dispatch mechanism
US8578135B2 (en) Apparatus for calculating and prefetching a branch target address
US20030074543A1 (en) A processor with apparatus for verifying instruction parallelism
US5615375A (en) Interrupt control circuit
US4028670A (en) Fetch instruction for operand address calculation
JPH02287626A (en) Pipeline system branch instruction controller
JPS62115542A (en) Information processor
EP0447101B1 (en) Processor with data format-independent instructions
US6832334B2 (en) Computer register watch
US5237664A (en) Pipeline circuit
JP3490005B2 (en) Instruction control apparatus and method
JPH05158734A (en) Microprocessor
EP0415351A2 (en) Data processor for processing instruction after conditional branch instruction at high speed
JP2581565B2 (en) Data processing device that executes guarded instructions
JPS59183434A (en) Prefetch control system of instruction
JPS60164842A (en) Instruction prefetching device
JP2511063B2 (en) Pipeline control method
JP2917384B2 (en) Information processing device
JP2987281B2 (en) Processor
JP3523407B2 (en) Information processing equipment