JPH05224989A - Microprocessor containing cache memory and its trace analyzer - Google Patents
Microprocessor containing cache memory and its trace analyzerInfo
- Publication number
- JPH05224989A JPH05224989A JP4233199A JP23319992A JPH05224989A JP H05224989 A JPH05224989 A JP H05224989A JP 4233199 A JP4233199 A JP 4233199A JP 23319992 A JP23319992 A JP 23319992A JP H05224989 A JPH05224989 A JP H05224989A
- Authority
- JP
- Japan
- Prior art keywords
- microprocessor
- cache memory
- trace
- analyzer
- memory
- 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.)
- Granted
Links
- 230000004044 response Effects 0.000 claims abstract description 3
- 230000007246 mechanism Effects 0.000 claims description 14
- 238000001514 detection method Methods 0.000 claims description 8
- 238000000034 method Methods 0.000 claims description 8
- 238000010200 validation analysis Methods 0.000 claims description 5
- 230000004913 activation Effects 0.000 claims description 4
- 230000003068 static effect Effects 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 4
- XUIMIQQOPSSXEZ-UHFFFAOYSA-N Silicon Chemical compound [Si] XUIMIQQOPSSXEZ-UHFFFAOYSA-N 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 229910052710 silicon Inorganic materials 0.000 description 1
- 239000010703 silicon Substances 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は、キャッシュメモリを内
蔵したマイクロプロセッサとその動作履歴を解析するト
レースアナライザに関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microprocessor having a cache memory and a trace analyzer for analyzing the operation history of the microprocessor.
【0002】[0002]
【従来の技術】1970年代初頭において実用化された
マイクロプロセッサは、命令を解読して演算・制御動作
を実行する演算装置であり、シリコンチップ上に実現さ
れる。その後のLSI技術の発展および市場ニーズの広
範化・高度化に伴い、高性能化の一途を辿り、今日では
語長が32ビットの機種が商品化されている。また、レ
ジスタ,演算回路および制御回路等必須の構成要素の他
に、キャッシュメモリを内蔵したものも少なくない。キ
ャッシュメモリは、周知のようにコンピュータの内部メ
モリに対する高速度と大容量という二律背反的な要求を
満たすため、中央処理装置の内部に設けられた高速小容
量のメモリである。2. Description of the Related Art A microprocessor put into practical use in the early 1970s is an arithmetic unit that decodes instructions and executes arithmetic / control operations, and is realized on a silicon chip. With the subsequent development of LSI technology and the broadening and sophistication of market needs, the performance has been increasing, and today, a model having a word length of 32 bits has been commercialized. In addition to the essential components such as registers, arithmetic circuits, and control circuits, there are quite a few that have a cache memory built-in. As is well known, the cache memory is a high-speed small-capacity memory provided inside the central processing unit in order to satisfy the trade-off requirements of high speed and large capacity for the internal memory of the computer.
【0003】このように、マイクロプロセッサといえど
も、ここまで複雑化してくると、それらのデバッグが問
題化してくる。この種のデバッグのための手法として
は、トレース,トラップ,シングルステップ等が知られ
ているが、総体的なデバッグにはトレースが適してい
る。トレースは周知のように、デバッグ対象となるプロ
グラムを実行する中央処理装置あるいはプロセッサの外
部にトレースアナライザとトレースメモリを設けて行
う。トレースアナライザは、マイクロプロセッサが実行
する命令のアドレスを逐一トレースメモリに記憶してい
き、後にその記憶内容を解析することによりデバッグを
可能化する。As described above, even in the case of a microprocessor, if the complexity is increased up to this point, debugging of them becomes a problem. Trace, trap, single step and the like are known as techniques for this kind of debugging, but trace is suitable for general debugging. As is well known, tracing is performed by providing a trace analyzer and a trace memory outside a central processing unit or a processor that executes a program to be debugged. The trace analyzer stores the addresses of the instructions executed by the microprocessor in the trace memory one by one, and later analyzes the stored contents to enable debugging.
【0004】しかしながら、格別の手段を講じなければ
キャッシュメモリが動作中は、メモリアクセスはマイク
ロプロセッサの内部に留まるため、トレースアナライザ
はトレースに必要なデータを直接検知できない。したが
って、従来は、通常、キャッシュメモリを無効化してト
レースを行なうことが多かった。However, unless special measures are taken, the memory access stays inside the microprocessor while the cache memory is operating, so the trace analyzer cannot directly detect the data required for the trace. Therefore, conventionally, the cache memory is usually invalidated for tracing.
【0005】ところが、キャッシュメモリを無効化した
場合には、有効である場合に比べて、命令実行クロッ
ク,命令実行タイミング等の点でマイクロプロセッサの
動作が大きく異なっており、正確なデバッグが実現でき
ないという問題点がある。However, in the case where the cache memory is invalidated, the operation of the microprocessor is largely different from that in the case where the cache memory is valid in terms of instruction execution clock, instruction execution timing, etc., and accurate debugging cannot be realized. There is a problem.
【0006】そこで、キャッシュメモリを有効な状態に
保ったままトレースを可能にするため、従来のキャッシ
ュメモリ内蔵型のマイクロプロセッサは、命令の実行開
始,分岐命令の発生および分岐先のアドレスが静的に指
定可能か否かをそれぞれ外部に表示する端子を備えてい
る。そして、従来のトレースアナライザは、予めプログ
ラムを静的に解析した実行フローを保持しており、上述
の各端子から供給される信号を手掛りに実行フローに基
づき動的な命令処理順序を組み立てる構成になってい
る。Therefore, in order to enable tracing while keeping the cache memory in an effective state, in the conventional microprocessor with a built-in cache memory, the execution start of an instruction, the generation of a branch instruction and the address of the branch destination are static. Each has a terminal for externally displaying whether or not it can be designated. In addition, the conventional trace analyzer holds an execution flow in which a program is statically analyzed in advance, and a signal that is supplied from each of the above-mentioned terminals is used as a clue to construct a dynamic instruction processing sequence based on the execution flow. Is becoming
【0007】以上のような構成を採用すれば、従来のキ
ャッシュメモリ内蔵型のマイクロプロセッサは、キャッ
シュメモリが無効あるいは有効の状態に固定されている
場合のトレースは実現できる。しかし、近年、マイクロ
プロセッサの導入が活発化したロボット制御やゲームの
分野におけるように、キャッシュメモリを動的に有効化
又は無効化するプログラムに対しては、プログラム実行
状態の解析方法を動的に切り替えなければならない。By adopting the above configuration, the conventional microprocessor with a built-in cache memory can realize the trace when the cache memory is fixed in the invalid or valid state. However, for programs that dynamically enable or disable the cache memory, as in the field of robot control and games in which the introduction of microprocessors has become active in recent years, the method of analyzing the program execution state is dynamically changed. I have to switch.
【0008】このため、従来のキャッシュメモリ内蔵型
のマイクロプロセッサの多くは、キャッシュメモリの有
効化又は無効化を外部から設定するための端子と、命令
実行結果又はマイクロプロセッサ内部の状態によってキ
ャッシュメモリの有効化又は無効化をセットできる内部
レジスタとを設け、両者の複合条件でキャッシュメモリ
の有効化を定めるようにしている。For this reason, most of the conventional microprocessors with a built-in cache memory have a terminal for externally setting the validity or invalidity of the cache memory and the cache memory depending on the instruction execution result or the internal state of the microprocessor. An internal register capable of setting validation or invalidation is provided, and the validation of the cache memory is determined by the combined condition of both.
【0009】かかるマイクロプロセッサの動作履歴を解
析するための従来のトレースアナライザは、上述の内部
レジスタをソフトウェアによって読み出し、この値と外
部からの設定信号とから、キャッシュメモリが有効化さ
れているか否かを判定するためのハードウェアを必要と
する。A conventional trace analyzer for analyzing the operation history of such a microprocessor reads out the above-mentioned internal register by software, and based on this value and a setting signal from the outside, whether the cache memory is valid or not. Requires hardware to determine.
【0010】[0010]
【発明が解決しようとする課題】上述した従来のマイク
ロプロセッサ及びそのトレースアナライザは、内部レジ
スタを読んで、キャッシュメモリが有効化されているか
否かを判定するためのハードウェアを必要とするが、こ
のようなハードウェアは大規模なものになるとともに、
上記動作履歴の解析のリアルタイム性を保証できず、し
たがってこのようなリアルタイム性を生命とするような
装置におけるプログラムのトレースには不向きという問
題点がある。本発明の目的は、キャッシュメモリの有効
化と無効化の別を即時に判定し、それによってリアルタ
イム性が要求されるプログラムの正確なデバッグを容易
に実現するトレースアナライザを提供することにある。The conventional microprocessor and its trace analyzer described above require hardware for reading the internal register to determine whether the cache memory is enabled or not. This kind of hardware will become huge,
There is a problem in that the real-time property of the analysis of the operation history cannot be guaranteed, and thus it is not suitable for the trace of the program in the device that makes such real-time property a life. An object of the present invention is to provide a trace analyzer that immediately determines whether the cache memory is valid or invalid, and thereby easily realizes accurate debugging of a program that requires real-time processing.
【0011】[0011]
【課題を解決するための手段】本発明のキャッシュメモ
リ内蔵型マイクロプロセッサは、キャッシュメモリが有
効化されているか否かを外部に表示するモード表示端子
を備える。この端子の信号はキャッシュメモリが有効化
されているか否かを検出するモード検出機構によって導
かれる。モード検出機構は、キャッシュメモリ有効化端
子を介して外部から設定され、また命令実行結果やマイ
クロプロセッサ内部の状態によって設定される。好まし
くは、本発明のキャッシュメモリ内蔵型マイクロプロセ
ッサは、上述の構成要素に加えて、更に、命令の実行開
始,分岐の発生及び分岐先アドレスが静的に決定可能か
否かをそれぞれ外部に表示する端子を有している。ま
た、本発明のトレースアナライザは、キャッシュメモリ
が有効化されているか否かに即応してマイクロプロセッ
サのトレース方法を変更することを特徴とする。好まし
くは、本発明のトレースアナライザは、予めプログラム
を静的に解析した実行フローを保持しており、キャッシ
ュメモリが有効化されると、マイクロプロセッサからの
命令の実行開始,分岐発生及び分岐先のアドレスが静的
に決定可能か否かをそれぞれ示す信号を手掛りにして実
行フローに基づき命令実行順序を動的に組み立ててトレ
ースする。また、分岐先アドレスが静的に決定できない
分岐の場合には、マイクロプロセッサに割込みを発生す
る。さらに好ましくは、本発明のトレースアナライザ
は、キャッシュメモリが有効化されるとトレースを中止
する。Means order to solve the problem cache memory-based microprocessor of the present invention includes a mode display terminal for displaying whether the cache memory is enabled to the outside. The signal at this terminal is guided by a mode detection mechanism which detects whether the cache memory is enabled. The mode detection mechanism is externally set via the cache memory enable terminal, and is set by the instruction execution result and the internal state of the microprocessor. Preferably, the microprocessor with a built-in cache memory according to the present invention, in addition to the above-mentioned components, further externally displays whether execution start of an instruction, occurrence of a branch, and whether or not a branch destination address can be statically determined. It has a terminal to do. Further, the trace analyzer of the present invention is characterized in that the trace method of the microprocessor is changed depending on whether or not the cache memory is valid. Preferably, the trace analyzer of the present invention holds an execution flow obtained by statically analyzing a program in advance, and when the cache memory is validated, execution start of an instruction from a microprocessor, branch occurrence, and branch destination A signal indicating whether or not an address can be statically determined is used as a clue to dynamically assemble and trace the instruction execution order based on the execution flow. In the case of a branch whose branch destination address cannot be statically determined, an interrupt is issued to the microprocessor. More preferably, the trace analyzer of the present invention stops tracing when cache memory is enabled.
【0012】[0012]
【実施例】図1に示した本発明の第1のトレースシステ
ムは、マイクロプロセッサ101,メインメモリ10
2,トレースアナライザ103及びトレースメモリ10
4から構成され、これがアドレスバス,データバス及び
ステータスバスで接続されている。また、マイクロプロ
セッサ101からトレースアナライザ103には、モー
ド表示信号105,命令実行開始信号106,分岐命令
発生信号107及び割込分岐発生信号108が供給され
ている。DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The first trace system of the present invention shown in FIG. 1 is a microprocessor 101 and a main memory 10.
2, trace analyzer 103 and trace memory 10
4, which are connected by an address bus, a data bus and a status bus. Further, a mode display signal 105, an instruction execution start signal 106, a branch instruction generation signal 107 and an interrupt branch generation signal 108 are supplied from the microprocessor 101 to the trace analyzer 103.
【0013】図2に示したマイクロプロセッサ201
は、図1のマイクロプロセッサ101の詳細を示し、命
令実行ユニット202,キャッシュメモリ203,内部
レジスタ204,モード検出機構205,キャッシュ有
効化端子206及びモード表示端子207を有する。The microprocessor 201 shown in FIG.
Shows the details of the microprocessor 101 of FIG. 1, and has an instruction execution unit 202, a cache memory 203, an internal register 204, a mode detection mechanism 205, a cache validation terminal 206 and a mode display terminal 207.
【0014】図1に示した命令実行開始信号106,分
岐命令発生信号107及び割込分岐発生信号108は、
図面の繁雑化を回避するために図2においては図示を省
略している。The instruction execution start signal 106, the branch instruction generation signal 107 and the interrupt branch generation signal 108 shown in FIG.
The illustration is omitted in FIG. 2 in order to avoid complication of the drawing.
【0015】メインメモリ102は、デバッグの対象と
なるプログラムを格納しており、メインメモリ102内
の一部のデータ(命令群)は、アドレスが連続した一定
領域(ブロック)単位にキャッシュメモリ203にロー
ドされている。キャッシュメモリ203の有効化の状態
において命令実行ユニット202がメモリアクセスを行
うときはキャッシュヒットすればキャッシュメモリ20
3,キャッシュミスヒットすればメインメモリ102を
それぞれアクセスする。そして、キャッシュミスヒット
時にメインメモリ102から読み出した命令を含む命令
群をキャッシュメモリ203にロードする。The main memory 102 stores a program to be debugged, and some data (instruction group) in the main memory 102 is stored in the cache memory 203 in a unit of a fixed area (block) having continuous addresses. Is loaded. When the instruction execution unit 202 makes a memory access in the enabled state of the cache memory 203, if a cache hit occurs, the cache memory 20
3. If there is a cache miss, the main memory 102 is accessed. Then, an instruction group including the instruction read from the main memory 102 at the time of a cache miss is loaded into the cache memory 203.
【0016】命令実行ユニット202は、読み出してき
た命令を実行し、その結果によって内部レジスタ204
にキャッスメモリ203の有効化又は無効化をセットす
る。もっとも、内部レジスタ204は、マイクロプロセ
ッサ202の他の内部状態によってもキャッシュメモリ
203の有効化又は無効化がセットされ得る。The instruction execution unit 202 executes the read instruction and, as a result, the internal register 204.
The cache memory 203 is set to enable or disable. However, the internal register 204 may be set to enable or disable the cache memory 203 according to another internal state of the microprocessor 202.
【0017】内部レジスタ204の出力はモード検出機
構205に導かれている。モード検出機構205には、
キャッシュ活性化端子206から供給される外部からの
キャッシュメモリ203に対する有効化又は無効化化の
指示も入力している。モード検出機構205の出力はキ
ャッシュメモリ203及びモード表示端子207に導か
れ、直ちに外部に表示される。モード表示端子207上
の信号は、キャッシュメモリ203が有効化されている
か否かを示すモード表示信号105としてトレースアナ
ライザ103に供給されている。トレースアナライザ1
03は、モード表示信号105に応答してトレース方法
を決定し、プログラムの実行履歴をトレースメモリ10
4に記録していく。The output of the internal register 204 is guided to the mode detection mechanism 205. The mode detection mechanism 205 includes
An instruction to validate or invalidate the cache memory 203 from the outside, which is supplied from the cache activation terminal 206, is also input. The output of the mode detection mechanism 205 is guided to the cache memory 203 and the mode display terminal 207 and immediately displayed outside. The signal on the mode display terminal 207 is supplied to the trace analyzer 103 as a mode display signal 105 indicating whether or not the cache memory 203 is enabled. Trace analyzer 1
03 determines the tracing method in response to the mode display signal 105 and displays the execution history of the program in the trace memory 10.
Record in 4.
【0018】デバッグの開始に先立って、トレースアナ
ライザ103はメインメモリ102内のプログラムを読
み込んで解析し、プログラムの静的な実行フローを得て
保持しておく。この実行フローは、具体的にはプログラ
ムカウンタの値に対応するメインメモリ102のアドレ
スや、分岐時の分岐先アドレスから成るが、命令実行の
結果により分岐先アドレスが決るような動的な分岐命令
にまで対処できるものではない。Prior to the start of debugging, the trace analyzer 103 reads and analyzes the program in the main memory 102 to obtain and retain a static execution flow of the program. This execution flow is specifically composed of the address of the main memory 102 corresponding to the value of the program counter and the branch destination address at the time of branch, but a dynamic branch instruction in which the branch destination address is determined by the result of instruction execution. It is not something that can be dealt with.
【0019】図1に示したトレースアナライザ103の
トレース動作を示すフローチャートである図3を参照し
て、本実施例の動作を説明する。The operation of this embodiment will be described with reference to FIG. 3, which is a flow chart showing the trace operation of the trace analyzer 103 shown in FIG.
【0020】(1)キャッシュメモリが有効でない場合 マイクロプロセッサ101はプログラムに従って命令を
実行するときに、その命令のアドレスとステータス信号
をそれぞれアドレスバスとステータス信号に出力し、メ
インメモリ102はこのアドレスバス上のアドレスに対
応するデータ(命令)をデータバスに出力する。マイク
ロプロセッサ101はこのデータバス上のデータを読み
込んで命令を実行する。(1) When the cache memory is not valid When the microprocessor 101 executes an instruction according to a program, it outputs the address and status signal of the instruction to the address bus and the status signal, respectively, and the main memory 102 uses this address bus. The data (instruction) corresponding to the above address is output to the data bus. The microprocessor 101 reads the data on this data bus and executes the instruction.
【0021】トレースアナライザ103は、モード表示
信号105がキャッシュメモリ203の有効を表示して
いないので(図3のステップ301)、バスサイクルで
あり(ステップ302)、かつステータス信号が命令フ
ェッチである(ステップ303)ことを検知すると、ア
ドレスバス上のアドレスを観測し(ステップ304)、
トレースメモリ104に書き込む(ステップ305)こ
とにより命令のトレースを行なう。In the trace analyzer 103, since the mode display signal 105 does not display the validity of the cache memory 203 (step 301 in FIG. 3), it is a bus cycle (step 302), and the status signal is an instruction fetch ( When the step 303) is detected, the address on the address bus is observed (step 304),
The instruction is traced by writing it in the trace memory 104 (step 305).
【0022】(2)キャッシュメモリが有効である場合 この場合には、キャッシュヒットが発生すると、マイク
ロプロセッサ101はメインメモリ102にアクセスし
ないため、トレースアナライザ103はバスを観測する
ことによって命令処理の進行を示す情報を知ることがで
きない。また、キャッシュミスヒットが発生してメイン
メモリ102にアクセスしても、マイクロプロセッサ1
01はメインメモリ102からデータバスに読み出した
命令を直ちに実行するとは限らない。従って、トレース
アナライザ103は、以下のように、命令の種類に応じ
て、内蔵のプログラムカウンタ,前述の事前に得ている
実行フロー及び割込機構を使い分けることにより命令の
トレース方法を変更する。(2) When the cache memory is valid In this case, when a cache hit occurs, the microprocessor 101 does not access the main memory 102. Therefore, the trace analyzer 103 observes the bus to advance the instruction processing. Can not know the information that indicates. Further, even if the cache mishit occurs and the main memory 102 is accessed, the microprocessor 1
01 does not always immediately execute the instruction read from the main memory 102 to the data bus. Therefore, the trace analyzer 103 changes the instruction tracing method by properly using the built-in program counter, the previously-obtained execution flow, and the interrupt mechanism according to the type of instruction as follows.
【0023】(2.1)命令が分岐しない場合 命令実行ユニット202は、内蔵のプログラムカウンタ
の値に従ってキャッシュメモリ203を順次に読み出
し、命令を実行していく。プログラムカウンタの値に対
応するメインメモリ102のアドレスは、事前に得てい
るっ実行フローから知ることができる。このプログラム
カウンタの値は、命令実行ユニット202内のプログラ
ムカウンタの値と同一に保たれていることは勿論であ
る。(2.1) When the Instruction Does Not Branch The instruction execution unit 202 sequentially reads the cache memory 203 according to the value of the built-in program counter and executes the instructions. The address of the main memory 102 corresponding to the value of the program counter can be known from the execution flow obtained in advance. The value of this program counter is, of course, kept the same as the value of the program counter in the instruction execution unit 202.
【0024】トレースアナライザ103は、モード表示
信号105と命令実行開始信号106が真(ステップ3
06)で、かつ分岐命令発生信号107が偽である(ス
テップ307)ことを検知すると、プログラムカウンタ
をインクリメント(ステップ308)し、上述のように
して得たアドレスをトレースメモリ104に書き込む
(ステップ309)ことにより命令のトレースを行なう
ことができる。In the trace analyzer 103, the mode display signal 105 and the instruction execution start signal 106 are true (step 3
06) and when it is detected that the branch instruction generation signal 107 is false (step 307), the program counter is incremented (step 308) and the address obtained as described above is written in the trace memory 104 (step 309). ) Can be used to trace instructions.
【0025】(2.2)命令が静的に決定できるアドレ
スに分岐する場合 命令が静的に決定できるとは、プログラムの解析による
その実行前に決定できることをいう。このようなアドレ
スにプログラムが分岐すると、処理の進行はそれまでの
プログラムカウンタの値とはかけ離れた値により行われ
る。従って、トレースアナライザ103は割込分岐発生
信号108が偽であることを検知すると(ステップ31
0)、前述した事前に得ている実行フロー中の分岐先ア
ドレスをプログラムカウンタに移送し(ステップ31
1)、トレースメモリ104に書き込む(ステップ31
2)ことにより命令のトレースを行なうことができる。(2.2) When an instruction branches to an address that can be statically determined That an instruction can be statically determined means that it can be determined before its execution by program analysis. When the program branches to such an address, the processing progresses with a value far from the value of the program counter up to that point. Therefore, when the trace analyzer 103 detects that the interrupt branch occurrence signal 108 is false (step 31
0), the branch destination address in the previously obtained execution flow is transferred to the program counter (step 31).
1), write to the trace memory 104 (step 31)
By 2), the instruction can be traced.
【0026】(2.3)命令が静的に決定できないアド
レスに分岐する場合 この場合には、トレースアナライザ103の内部には、
トレースすべきデータが存在しない。何故なら、事前に
得ている実行フローは、静的、すなわち予め分岐先アド
レスの判明している分岐命令にしか対応しないものであ
るからである。(2.3) When an instruction branches to an address that cannot be statically determined In this case, the inside of the trace analyzer 103 is:
There is no data to trace. This is because the execution flow obtained in advance corresponds only to the static, that is, the branch instruction whose branch destination address is known in advance.
【0027】トレースアナライザ103は、割込分岐発
生信号108が真であることを検知すると(ステップ3
10)、内蔵の割込機構によりマイクロプロセッサ10
1に割込みを発生する(ステップ313)。そして、マ
イクロプロセッサ101内のプログラムカウンタの値
を、自らのプログラムカウンタにストアし(ステップ3
14)、これに対応するメインメモリ102のアドレス
をトレースメモリ104に書き込む(ステップ315)
ことにより命令をトレースできる。この理解のために
は、割込分岐が発生すると、マイクロプロセッサ101
のプログラムカウンタには、割込み先アドレスが設定さ
れていることを想起すべきである。When the trace analyzer 103 detects that the interrupt branch occurrence signal 108 is true (step 3
10), microprocessor 10 with built-in interrupt mechanism
An interrupt is generated at 1 (step 313). Then, the value of the program counter in the microprocessor 101 is stored in its own program counter (step 3
14), write the corresponding address of the main memory 102 to the trace memory 104 (step 315)
This allows you to trace instructions. To understand this, when an interrupt branch occurs, the microprocessor 101
It should be recalled that the program counter of 1 has an interrupt destination address set.
【0028】以上に説明した4つの場合の各最終ステッ
プ305,309,312及び315は、すてべフロー
チャートの先頭であるステップ301に回帰しているこ
とに留意する必要がある。すなわち、ステップ301に
おいて改めてキャッシュメモリ102が有効か否かが問
われているので、トレースの方法が動的に変更され得る
という特徴を有する。It should be noted that each of the final steps 305, 309, 312 and 315 in the four cases described above have all returned to step 301, the beginning of the flowchart. That is, since it is again asked in step 301 whether or not the cache memory 102 is valid, there is a feature that the tracing method can be dynamically changed.
【0029】図4に示した本発明の第2のトレースシス
テムは、図1に示した第1のトレースシステムにおける
命令実行開始信号106,分岐命令発生信号107及び
割込分岐発生信号108を除去した構成となっている。
この結果、トレースアナライザ403は、キャッシュメ
モリの有効化が表示されたときにはトレースを中止する
ことになる。何故なら、トレースアナライザ403は、
キャッシュメモリが有効化されている場合のトレースに
必要な手掛となる情報を得られないからである。The second trace system of the present invention shown in FIG. 4 eliminates the instruction execution start signal 106, the branch instruction generation signal 107 and the interrupt branch generation signal 108 in the first trace system shown in FIG. It is composed.
As a result, the trace analyzer 403 will stop the trace when the validation of the cache memory is displayed. Because the trace analyzer 403
This is because the information necessary for tracing when the cache memory is enabled cannot be obtained.
【0030】従って、トレースアナライザ403はより
簡単な構成でよいことになり、トレースアナライザ10
3が有していたようなプログラムの事前解析機能等は不
要であり、図3のフローチャーもステップ301におい
て“Y” ならばステップ301に戻る。また、マイク
ロプロセッサ401のブロック図は、図2に示したもの
と共通である。Therefore, the trace analyzer 403 has a simpler structure, and the trace analyzer 10
3 does not require a program pre-analysis function and the like, and the flowchart of FIG. 3 also returns to step 301 if "Y" in step 301. Further, the block diagram of the microprocessor 401 is common to that shown in FIG.
【0031】本実施例において、キャッシュメモリが有
効化されていない場合の動作は第1の実施例の動作と何
ら変るところがない。In this embodiment, the operation when the cache memory is not activated is no different from the operation of the first embodiment.
【0032】キャッシュメモリが有効化されると、トレ
ースは中止され、有効化されなくなると再びトレースが
開始される。つまり、キャッシュメモリが有効化である
間のトレースを中断することにより、トレースアナライ
ザ403の簡単化を図るのである。When the cache memory is activated, the trace is stopped, and when it is not activated, the trace is restarted. That is, the trace analyzer 403 is simplified by interrupting the trace while the cache memory is valid.
【0033】トレースを中断しても、中断の原因は明確
であるから、それから先のデバッグは比較的容易であ
る。これには、前述のトラップやシングルステップとい
った技法を用いてもよい。Even if the trace is interrupted, the cause of the interrupt is clear, so that the debugging thereafter is relatively easy. Techniques such as the traps and single steps described above may be used for this.
【0034】[0034]
【発明の効果】上述のとおり、本発明によると、マイク
ロプロセッサとトレースアナライザの僅かな変更のみ
で、マイクロプロセッサで実行されるリアルタイム性の
あるプログラムの正確なデバッグが容易に行なえるとい
う効果がある。As described above, according to the present invention, it is possible to easily perform accurate debugging of a real-time program executed by the microprocessor with only a slight change in the microprocessor and the trace analyzer. ..
【図1】キャッシュメモリ内蔵型マイクロプロセッサと
本発明の第1の実施例のトレースアナライザとで構成す
る第1のトレースシステムのブロック図である。FIG. 1 is a block diagram of a first trace system including a microprocessor with a cache memory and a trace analyzer according to a first embodiment of the present invention.
【図2】図1に示したマイクロプロセッサのブロック図
である。2 is a block diagram of the microprocessor shown in FIG. 1. FIG.
【図3】図1に示したトレースアナライザの動作を説明
するフローチャートである。FIG. 3 is a flowchart illustrating an operation of the trace analyzer shown in FIG.
【図4】キャッシュメモリ内蔵型マイクロプロセッサと
本発明の第2の実施例のトレースアナライザとで構成さ
れる第2のトレースシステムのブロック図である。FIG. 4 is a block diagram of a second trace system including a microprocessor with a cache memory and a trace analyzer according to the second embodiment of the present invention.
101,201,401 マイクロプロセッサ 102,402 メインメモリ 103,403 トレースアナライザ 104,404 トレースメモリ 202 命令実行ユニット 203 キャッシュメモリ 204 内部レジスタ 205 モード検出機構 206 キャッシュ活性化端子 207 モード表示端子 101, 201, 401 Microprocessor 102, 402 Main memory 103, 403 Trace analyzer 104, 404 Trace memory 202 Instruction execution unit 203 Cache memory 204 Internal register 205 Mode detection mechanism 206 Cache activation terminal 207 Mode display terminal
Claims (6)
するキャッシュメモリの有効化又は無効化が設定される
内部レジスタと、前記内部レジスタの保持内容により前
記キャッシュメモリが有効化されているか否かを検出す
るモード検出機構と、該モード検出機構の出力を外部に
表示するモード表示端子とを有することを特徴とするキ
ャッシュメモリ内蔵型マイクロプロセッサ。1. An internal register for enabling or disabling a built-in cache memory according to an instruction execution result or an internal state, and whether or not the cache memory is enabled by a content held in the internal register. A cache memory built-in microprocessor having a mode detecting mechanism for detecting and a mode display terminal for displaying an output of the mode detecting mechanism to the outside.
前記キャッシュメモリの有効化又は無効化を指示するた
めのキャッシュ有効化端子を設けたことを特徴とする請
求項1記載のキャッシュメモリ内蔵型マイクロプロセッ
サ。2. The cache memory built-in type according to claim 1, further comprising a cache validation terminal for externally instructing the mode detection mechanism to validate or invalidate the cache memory. Microprocessor.
アドレスが静的に決定可能か否かをそれぞれ外部に表示
するための複数の端子を備えることを特徴とする請求項
1記載のキャッシュメモリ内蔵型マイクロプロセッサ。3. The cache according to claim 1, further comprising a plurality of terminals for externally displaying whether instruction execution start, branch occurrence, and whether or not a branch destination address can be statically determined. Microprocessor with built-in memory.
前記マイクロプロセッサのトレースの方法を変更するこ
とを特徴とする請求項1記載のマイクロプロセッサに対
するトレースアナライザ。4. The trace analyzer for a microprocessor according to claim 1, wherein the trace method of the microprocessor is changed in response to a signal on the mode display terminal.
ローと、前記分岐先アドレスが静的に決定できない分岐
の場合に割込みを発生する機構とを有し、前記モード表
示端子上の信号が前記キャッシュメモリの有効化を表示
すると前記命令の実行開始,分岐の発生及び分岐先アド
レスが静的に決定可能か否かの表示を手掛りにして前記
実行フローに基づき、又は前記割込み機構により、命令
実行順序を動的に組み立てて前記マイクロプロセッサの
トレースを行うことを特徴とする請求項3記載のマイク
ロプロセッサに対する請求項4記載のトレースアナライ
ザ。5. An execution flow obtained by statically analyzing a program in advance, and a mechanism for generating an interrupt when the branch destination address cannot be statically determined, and a signal on the mode display terminal is When the activation of the cache memory is displayed, the execution of the instruction is started, the occurrence of the branch and the indication of whether or not the branch destination address can be statically determined based on the execution flow or by the interrupt mechanism. 5. A trace analyzer as claimed in claim 4 for a microprocessor as claimed in claim 3 wherein the order is dynamically assembled to provide traces of the microprocessor.
ッシュメモリの有効化を表示すると、前記マイクロプロ
セッサのトレースを中止することを特徴とする請求項1
記載のマイクロプロセッサに対する請求項4記載のトレ
ースアナライザ。6. The trace of the microprocessor is stopped when the signal on the mode display terminal indicates the activation of the cache memory.
Trace analyzer according to claim 4, for the described microprocessor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP4233199A JP2760228B2 (en) | 1991-09-04 | 1992-09-01 | Microprocessor with built-in cache memory and its trace analyzer |
Applications Claiming Priority (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP22324791 | 1991-09-04 | ||
JP3-223247 | 1991-09-04 | ||
JP4233199A JP2760228B2 (en) | 1991-09-04 | 1992-09-01 | Microprocessor with built-in cache memory and its trace analyzer |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH05224989A true JPH05224989A (en) | 1993-09-03 |
JP2760228B2 JP2760228B2 (en) | 1998-05-28 |
Family
ID=26525349
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP4233199A Expired - Lifetime JP2760228B2 (en) | 1991-09-04 | 1992-09-01 | Microprocessor with built-in cache memory and its trace analyzer |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2760228B2 (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6145099A (en) * | 1996-08-13 | 2000-11-07 | Nec Corporation | Debugging system |
ES2167190A1 (en) * | 1999-12-20 | 2002-05-01 | Univ Catalunya Politecnica | Trace construction unit. |
US9032255B2 (en) | 2011-12-14 | 2015-05-12 | Renesas Electronics Corporation | Semiconductor device and control method thereof |
-
1992
- 1992-09-01 JP JP4233199A patent/JP2760228B2/en not_active Expired - Lifetime
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6145099A (en) * | 1996-08-13 | 2000-11-07 | Nec Corporation | Debugging system |
ES2167190A1 (en) * | 1999-12-20 | 2002-05-01 | Univ Catalunya Politecnica | Trace construction unit. |
US9032255B2 (en) | 2011-12-14 | 2015-05-12 | Renesas Electronics Corporation | Semiconductor device and control method thereof |
Also Published As
Publication number | Publication date |
---|---|
JP2760228B2 (en) | 1998-05-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5751942A (en) | Trace event detection during trace enable transitions | |
US5345580A (en) | Microprocessor device and emulator device thereof | |
US7533302B2 (en) | Trace and debug method and system for a processor | |
JP5905911B2 (en) | Diagnostic code using single-step execution | |
US5689694A (en) | Data processing apparatus providing bus attribute information for system debugging | |
EP0530816A2 (en) | Microprocessor with cache memory and trace analyzer therefor | |
KR940003318B1 (en) | Processor having cache memory | |
KR970011214B1 (en) | Microcomputer Development Support Device | |
JP2760228B2 (en) | Microprocessor with built-in cache memory and its trace analyzer | |
JP2563708B2 (en) | Microprocessor device and emulator device using the same | |
JPH0528002A (en) | Microprocessor | |
KR950001057B1 (en) | MICRO PROCESSOR | |
JPH07152598A (en) | Incircuit emulator | |
JPH0581087A (en) | Processor monitoring system | |
JP3068578B2 (en) | In-circuit emulator and saturation calculation processing method | |
JP2666737B2 (en) | Microprocessor with built-in trace memory and trace method | |
JPH06202907A (en) | Debug support device | |
JPH087713B2 (en) | Microprocessor | |
JP3590289B2 (en) | Event detection circuit | |
JPS6358552A (en) | Microprocessor | |
JPH0795288B2 (en) | Microcomputer | |
JPH03175539A (en) | Debugging microprocessor | |
JPH02207345A (en) | Method for sampling instruction under execution process of microprocessor | |
JPS63282533A (en) | In-circuit emulator | |
JPH05189267A (en) | Operation control system for microprocessor and emulator |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 19980217 |