JPH11353205A - Processor built-in trace memory - Google Patents

Processor built-in trace memory

Info

Publication number
JPH11353205A
JPH11353205A JP10170528A JP17052898A JPH11353205A JP H11353205 A JPH11353205 A JP H11353205A JP 10170528 A JP10170528 A JP 10170528A JP 17052898 A JP17052898 A JP 17052898A JP H11353205 A JPH11353205 A JP H11353205A
Authority
JP
Japan
Prior art keywords
address
branch
trace memory
memory
trace
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
JP10170528A
Other languages
Japanese (ja)
Inventor
Yukio Kadowaki
門脇幸男
Sugitaka Otegi
樗木杉高
Keiji Nakamura
中村圭治
Takayasu Hirai
平井敬康
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.)
Ricoh Co Ltd
Original Assignee
Ricoh 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP10170528A priority Critical patent/JPH11353205A/en
Publication of JPH11353205A publication Critical patent/JPH11353205A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To trace a fast LSI in real time by dividing a branch destination address by the number of stages of a pipeline and storing the divided branch destination addresses and a specific bit representing branching in a trace memory in a pipeline hazard period. SOLUTION: The branch destination address is divided by the number of stages of the pipeline and the divided branch destination addresses are stored in the trace memory in the pipeline hazard period. A decision bit for discriminating a branch instruction and a sequential instruction is used in such a way that '0' is stored for the branch instruction and '1' for sequential instruction instead of storing a program address. With the said trace result, many execution histories can be stored by using small memory capacity. Further, a branch source address can easily be specified on an in-circuit emulator(ICE) side by counting the number of '1' of the branch destination address and decision bits.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、LSIに搭載されてい
るCPUやDSP等のプログラム実行やデータアクセス
等の動作履歴を格納する機能(トレースメモリ)を同L
SI内部に持たせる場合において、有効にトレースメモ
リを使用するための手段、方法に関するものであり、ト
レースメモリを最小限のメモリ容量で実現することがで
き、チップ面積を低減することができるものである。
The present invention relates to a function (trace memory) for storing an operation history such as execution of a program or data access of a CPU or DSP mounted on an LSI.
The present invention relates to a means and a method for effectively using a trace memory when it is provided inside an SI. The trace memory can be realized with a minimum memory capacity, and a chip area can be reduced. is there.

【0002】[0002]

【従来の技術】一般的にソフトウエアの開発支援装置で
あるインサーキット・エミュレータ(以下ICE)の機
能であるリアルタイムトレースは、ターゲットチップの
外部にトレース用メモリを持たせることにより実現して
いる。リアルタイムトレースは、ターゲットチップ内部
のCPUやDSPのアドレス、データ、ステータス等の
情報(以下、トレースデータ)をトレースしたい期間だ
け外部トレース用メモリに逐次書き込み保存する(当然
ながらトレース用メモリの書き込み制御信号もターゲッ
トチップから出力される)。トレース終了後そのデータ
を読み出し、パソコン等でソフト的に処理し、CRTに
出力することによりターゲットチップの動作履歴を確
認、解析することが可能となる。この場合、ターゲット
チップの外部にトレース用メモリがあるため、トレース
データのビット数分の端子が、ターゲットチップに必要
となる。例えば、アドレス32ビット、データ32ビッ
ト、ステータス8ビットであれば32ビット分の端子が
別途必要となってしまう。また、アドレス、データが数
系統ある様なCPU,DSPを使用している場合は非常
に多くの端子が必要となってしまい、チップ面積は実際
の回路規模ではなく端子数により決定されチップのコス
トが高くなってしまう問題がある。また、ターゲットチ
ップとトレース用メモリはICEボード上に実装されて
おり、動作速度が非常に高速なチップではボード上の配
線遅延、ノイズ、トレース用メモリの性能等によりトレ
ース用メモリへの書き込みが間に合わず、正常に書き込
むことができない場合があり、ターゲットチップとトレ
ース用メモリとのインターフェース部を精度よく設計し
ていても、実際にはボード実装後のデバッグ時間がかな
り必要となっているという問題がある。近年ではこれら
の問題から、ターゲットチップ内部にトレース用メモリ
を搭載することにより、ICE用端子の削減、ICEボ
ードのデバック時間の短縮、高速動作時でのリアルタイ
ムトレースが可能となっている。しかしながら、トレー
ス用メモリをターゲットチップ内に搭載する場合におい
て、例えば、実行プログラムのアドレスをトレース用メ
モリに格納する場合、実行プログラムアドレスのビット
長、任意の実行プログラムのステップ数をワード長とす
るメモリが必要となり、トレース用メモリによるコスト
増とリアルタイムトレース機能の確保とのトレードオフ
になる。そこで、分岐先アドレスと割り込み直前の実行
アドレスのみをトレースメモリに格納する方法が特開平
8−95945号公報に記載されている。この方法は、
マイクロプロセッサにトレ−スメモリを持たせ、プログ
ラムアドレスのトレ−スメモリヘの格納は分岐命令、割
り込み等に対して、実行終了命令のプログラムカウンタ
値、現在実行している命令のプログラムカウンタ値を選
択して格納するものであるが、分岐後のシーケンシャル
な命令実行についてのトレース結果については格納され
ておらず、ICE側でのトレース結果データの整理、表
示にあたり、分岐元アドレスを容易に特定することは困
難である。また、分岐元アドレスと分岐先アドレスのみ
をトレースメモリに格納した場合の例を図6に示すが、
この図のように1回の分岐でトレースメモリを2ワード
分消費することになるという欠点がある。
2. Description of the Related Art In general, real-time tracing as a function of an in-circuit emulator (hereinafter referred to as ICE), which is a software development support device, is realized by providing a tracing memory outside a target chip. In the real-time trace, information such as addresses, data, and status of the CPU and DSP inside the target chip (hereinafter referred to as trace data) is sequentially written and stored in the external trace memory for a period during which the trace is desired. Is also output from the target chip). After the end of the trace, the data is read out, processed in a software manner by a personal computer or the like, and output to a CRT, whereby the operation history of the target chip can be confirmed and analyzed. In this case, since there is a trace memory outside the target chip, terminals for the number of bits of the trace data are required for the target chip. For example, if the address is 32 bits, the data is 32 bits, and the status is 8 bits, a terminal for 32 bits is required separately. Also, when a CPU or DSP having several systems of addresses and data is used, a very large number of terminals are required, and the chip area is determined not by the actual circuit scale but by the number of terminals, and the cost of the chip is determined. There is a problem that becomes high. The target chip and the trace memory are mounted on an ICE board. For a chip with a very high operating speed, writing to the trace memory can be delayed due to wiring delay on the board, noise, the performance of the trace memory, etc. In some cases, it may not be possible to write correctly, and even if the interface between the target chip and the trace memory is designed with high accuracy, the debug time after mounting the board is actually required considerably. is there. In recent years, due to these problems, by mounting a trace memory inside the target chip, it is possible to reduce the number of ICE terminals, shorten the debugging time of the ICE board, and perform real-time tracing at high speed operation. However, when the trace memory is mounted in the target chip, for example, when the address of the execution program is stored in the trace memory, a memory in which the bit length of the execution program address and the number of steps of an arbitrary execution program are the word length Is required, and there is a trade-off between an increase in cost due to a trace memory and a secure real-time trace function. Therefore, a method of storing only a branch destination address and an execution address immediately before an interrupt in a trace memory is described in Japanese Patent Application Laid-Open No. Hei 8-95945. This method
A microprocessor is provided with a trace memory, and a program address is stored in the trace memory by selecting a program counter value of an execution end instruction and a program counter value of an instruction currently being executed in response to a branch instruction or an interrupt. Although it is stored, the trace result of sequential instruction execution after branching is not stored, and it is difficult to easily identify the branch source address when organizing and displaying trace result data on the ICE side. It is. FIG. 6 shows an example in which only the branch source address and the branch destination address are stored in the trace memory.
As shown in this figure, there is a disadvantage that the trace memory consumes two words for one branch.

【0003】[0003]

【本発明が解決しようとする課題】そこで本発明では、
上記の問題を解決するために、トレース用メモリをター
ゲットチップ内部に持たせる場合において、トレース用
メモリの小容量化を実現し、高速なLSIに対してのリ
アルタイムトレースを実現できるように、トレース用メ
モリへ記憶させるべきトレース情報の圧縮方法を工夫す
ることをその課題とするものである。
[Problems to be solved by the present invention]
In order to solve the above-mentioned problem, when a trace memory is provided in a target chip, the trace memory is reduced in size and the trace memory is implemented so that real-time tracing to a high-speed LSI can be realized. An object of the present invention is to devise a method of compressing trace information to be stored in a memory.

【0004】[0004]

【課題解決のために講じた手段】[Measures taken to solve the problem]

【解決手段1】トレースメモリ内蔵プロセッサについ
て、プログラムアドレスのトレースの際、アドレスのシ
ーケンシャルな動作または分岐動作の違いを特定ビット
で表し、これをアドレスの代わりにトレースメモリに記
憶し、分岐の際、パイプラインの段数だけ分岐先アドレ
スを分割し、パイプラインハザード期間にこの分割され
た分岐先アドレスと分岐を表す特定ビットをトレースメ
モリへ記憶させること。
For a processor with a built-in trace memory, when tracing a program address, a difference between a sequential operation or a branch operation of an address is represented by a specific bit, and this is stored in a trace memory instead of an address. Dividing the branch destination address by the number of stages in the pipeline, and storing the divided branch destination address and a specific bit representing the branch in the trace memory during the pipeline hazard period.

【作用】パイプラインの段数だけアドレスを分割し、パ
イプラインハザード期間に分割された分岐先アドレスを
トレースメモリに格納する。また分岐命令かシーケンシ
ャルな命令かの判別ビットを用いることで、分岐命令時
には「0」を、シーケンシャルな命令を実行している時
はプログラムアドレスを格納する代わりに「1」を格納
する。以上のトレース結果から少ないメモリ容量で、多
くの実行履歴を格納することが可能となる。またICE
側にとっては、分岐先アドレス、判定ビットの「1」の
数をカウントすることにより、分岐元アドレスを容易に
特定することが可能となる。
The address is divided by the number of stages of the pipeline, and the branch destination address divided during the pipeline hazard period is stored in the trace memory. By using a bit for determining whether the instruction is a branch instruction or a sequential instruction, "0" is stored at the time of a branch instruction, and "1" is stored at the time of executing a sequential instruction instead of storing a program address. From the above trace results, a large amount of execution history can be stored with a small memory capacity. Also ICE
The side can easily specify the branch source address by counting the number of “1” of the branch destination address and the determination bit.

【0005】[0005]

【解決手段2】トレースメモリ内蔵プロセッサについ
て、プログラムアドレスのトレースの際、アドレスのシ
ーケンシャルな変化の数をカウントするカウンタを有
し、アドレスの分岐が発生した場合は分岐先アドレスと
上記カウンタのカウンタ値をトレースメモリに記憶させ
ること。
A processor having a built-in trace memory has a counter for counting the number of sequential changes in an address when tracing a program address, and when an address branch occurs, a branch destination address and a counter value of the counter. In the trace memory.

【作用】シーケンシャルな命令をカウントする機能を持
たせ、トレースメモリに対しては、分岐先アドレスとシ
ーケンシャルな命令をカウントした値を格納する。以上
のトレース結果から少ないメモリ容量で、多くの実行履
歴を格納することが可能となる。またICE側にとって
は、分岐先アドレス、カウント値により、分岐元アドレ
スを容易に特定することが可能となる。
A function of counting sequential instructions is provided, and a branch destination address and a value obtained by counting the sequential instructions are stored in the trace memory. From the above trace results, a large amount of execution history can be stored with a small memory capacity. On the ICE side, the branch source address can be easily specified based on the branch destination address and the count value.

【0006】[0006]

【解決手段3】トレースメモリ内蔵プロセッサについ
て、プログラムアドレスのトレースの際、アドレスのシ
ーケンシャルな変化に対してはその変化毎に”1”(ま
たは“0”)を1ビットづつシフトさせながらレジスタ
に書き込むとともに、アドレスの分岐が発生した場合、
アドレスの先頭に”0”(または“1”)を付けた分岐
先アドレスをシフトさせながら、さらにレジスタに書き
込み、レジスタの全ての桁にデータが書き込まれたと
き、上記レジスタのデータをトレースメモリに記憶させ
ること。
In a trace memory built-in processor, when a program address is traced, a sequential change in an address is written into a register while shifting "1" (or "0") by one bit for each change. Together with an address branch,
While shifting the branch destination address with "0" (or "1") at the beginning of the address, the data is further written to the register. When data is written to all the digits of the register, the data of the register is written to the trace memory. Remember.

【作用】シーケンシャルな命令についてはその判別ビッ
トとして「1」を、分岐命令についてはその判別ビット
として「0」、および分岐先アドレスをトレースメモリ
に圧縮して格納する。以上のトレース結果から少ないメ
モリ容量で、多くの実行履歴を格納することが可能とな
る。またICE側にとっては、分岐先アドレス、判定ビ
ットの「1」の数をカウントすることにより、分岐元ア
ドレスを容易に特定することが可能となる。
In the case of a sequential instruction, "1" is discriminated as its discrimination bit, and in the case of a branch instruction, "0" is discriminated as its discrimination bit, and the branch destination address is compressed and stored in the trace memory. From the above trace results, a large amount of execution history can be stored with a small memory capacity. Further, the ICE side can easily specify the branch source address by counting the number of branch destination addresses and the number of decision bits “1”.

【0007】[0007]

【解決手段4】トレースメモリ内蔵プロセッサについ
て、プログラムアドレスのトレースの際、シーケンシャ
ルなアドレスの変化に対しては”1”(または“0”)
を1ビットづつシリアルアクセスメモリで構成したトレ
ースメモリにシフトさせながら書き込み、アドレスの分
岐が発生した場合、アドレスの先頭に”0”(または
“1”)を付けた分岐先アドレスを前のデータの後に引
き続いてシフトさせながら上記シリアルアクセスメモリ
で構成したアドレストレースメモリに書き込むことで、
アドレス情報をトレースメモリに記憶させること。
For a processor with a built-in trace memory, when tracing a program address, "1" (or "0") for a sequential address change.
Is written to the trace memory configured by the serial access memory while shifting the data one bit at a time. When an address branch occurs, the branch destination address with "0" (or "1") added to the beginning of the address is replaced with the previous data. By writing to the address trace memory composed of the serial access memory while shifting sequentially,
To store address information in trace memory.

【作用】シーケンシャルな命令についてはその判別ビッ
トとして「1」を、分岐命令についてはその判別ビット
として「0」、および分岐先アドレスをシリアルアクセ
スメモリで構成したトレースメモリに順次シフトさせな
がら圧縮して格納する。以上のようにシーケンシャルな
トレースメモリを用いてトレースさせることにより、レ
ジスタを用いることなく簡単な回路構成で高速に、しか
も少ないメモリ容量で、多くの実行履歴を格納すること
が可能となる。またICE側にとっては、分岐先アドレ
ス、判定ビットの「1」の数をカウントすることによ
り、分岐元アドレスを容易に特定することが可能とな
る。
In the case of a sequential instruction, "1" is determined as its determination bit, and in the case of a branch instruction, "0" is determined as its determination bit, and the branch destination address is compressed while being sequentially shifted to a trace memory composed of a serial access memory. Store. By tracing using a sequential trace memory as described above, a large number of execution histories can be stored at high speed with a small memory capacity without using a register and with a simple circuit configuration. Further, the ICE side can easily specify the branch source address by counting the number of branch destination addresses and the number of decision bits “1”.

【0008】[0008]

【実施例】本発明のトレースメモリ内蔵プロセッサを用
いてデバッグを行うためのシステムの概念的な構成を図
1に示している。デバッグ対象となるターゲットチップ
100には、機器の制御やディジタル信号処理等の演算
を行うためのCPU10とプログラム及びデータを格納
するためのメモリ11を搭載している。従来、これらC
PUとメモリ11は別々のチップで実現し、これらを基
板上に置き接続することでシステムを構成していた。し
かし近年半導体技術の進歩と共にチップの高速化と小面
積化が実現でき、システムの小型化と低コスト化、さら
に低消費電力化を図るために1チップにCPUとメモリ
等を一緒に搭載するケースが増えてきている。このよう
なシステムでプログラムやデータのデバッグを行うため
には、CPU10から出力されるメモリ11へのアドレ
ス20とCPU10とメモリ11間でやりとりされるデ
ータ21をリアルタイムに監視し、プログラムやデータ
の誤りを見つけ、修正することが必要である。このため
一般的には、ターゲットチップ外部のデバッガ16、す
なわちICE(インサーキット・エミュレータ)にター
ゲットチップ100内のアドレス20とデータ21を取
り出し、プログラムやデータの検証をとる方法が用いら
れる。しかし、高速に動作するシステムでは、ターゲッ
トチップ10からアドレス20やデータ21の信号を取
り出す際に波形がなまり、正確な信号が取り出せないと
いった問題やアドレスやデータ幅が大きい場合、例えば
32ビットプロセッサではアドレス32ビット、データ
32ビットでこれら両方の信号を取り出すには、ターゲ
ットチップ100に計64ビットの端子が新たに必要に
なり、高価な多ピンパッケージを使用せざるを得ないと
いった問題があった。またリアルタイムデバッグにおけ
る波形のなまりの問題を解決するため、ターゲットチッ
プ100内にトレースメモリを内蔵し、リアルタイムで
動作させる際、一旦アドレス20やデータ21をトレー
スメモリに格納し、後で比較的低速な動作で外部のデバ
ッガにアドレスやデータを取り出すということも行われ
ている。しかし、この場合でもある時間内のアドレスと
データを格納するには、容量の大きいトレースメモリが
必要であるといった問題があった。デバッグのために容
量の大きいトレースメモリを搭載してもデバッグが終わ
ったシステムでは、トレースメモリは不要であり、これ
があるためにチップ単価が高くなったり、またトレース
メモリを搭載したチップと搭載しないチップの2種類を
作成し、デバッグを行うときはトレースメモリを搭載し
たチップを使い、デバッグが終了し、実際の製品に組み
込む場合はトレースメモリを搭載しないチップを使用す
るという方法もあるが、このためには2種類のチップを
作成することになるためにコストがかかるという問題も
ある。
FIG. 1 shows a conceptual configuration of a system for debugging using a processor with a built-in trace memory according to the present invention. The target chip 100 to be debugged has a CPU 10 for performing operations such as device control and digital signal processing, and a memory 11 for storing programs and data. Conventionally, these C
The PU and the memory 11 are realized by separate chips, and these are placed on a board and connected to form a system. However, in recent years, with the advancement of semiconductor technology, high-speed and small-area chips can be realized, and in order to reduce the size, cost, and power consumption of the system, a CPU and a memory are mounted together on one chip. Is increasing. In order to debug a program or data in such a system, the address 20 to the memory 11 output from the CPU 10 and the data 21 exchanged between the CPU 10 and the memory 11 are monitored in real time, and errors in the program and data are monitored. Need to be found and corrected. Therefore, generally, a method is used in which the address 20 and the data 21 in the target chip 100 are taken out to a debugger 16 outside the target chip, that is, an ICE (in-circuit emulator), and a program or data is verified. However, in a system that operates at high speed, when the signal of the address 20 or the data 21 is extracted from the target chip 10, the waveform becomes blunted, and a problem that an accurate signal cannot be extracted or when the address or data width is large, for example, in a 32-bit processor To extract both of these signals with an address of 32 bits and data of 32 bits, a new 64-bit terminal is required in the target chip 100, and there is a problem that an expensive multi-pin package must be used. . Further, in order to solve the problem of waveform rounding in real-time debugging, a trace memory is built in the target chip 100, and when operating in real time, the address 20 and the data 21 are temporarily stored in the trace memory, and a relatively low-speed operation is performed later. The operation of extracting addresses and data to an external debugger is also performed. However, even in this case, there is a problem that a large-capacity trace memory is required to store addresses and data within a certain time. In systems where debugging has been completed even if a large amount of trace memory is installed for debugging, the trace memory is not required, which increases the cost per chip, and chips with and without trace memory There is a method that uses a chip with a trace memory when debugging and uses a chip without a trace memory when debugging is completed and incorporating it into an actual product. However, there is also a problem that the cost is increased because two types of chips are produced.

【0009】本発明は、以上の問題を極めて効果的に解
消したものであり、トレースメモリの容量をできるだけ
少なくしてデバッグ可能なターゲットチップを提供する
ことができるものである。本発明のトレースメモリ内蔵
プロセッサを用いてデバッグを行うためのシステムの概
念的な構成を示す図1において、特徴的な点はターゲッ
トチップ100内のアドレス用のトレースメモリ14の
入力側に符号化回路12を設けており、またデバッグ1
6の入力側に復号化回路15を設けていることである。
これによりトレースメモリ14にアドレスを格納する際
は、CPU10からメモり11へ出力されるアドレス2
0の変化を利用し、できるだけメモリ容量を削減できる
ようにアドレスの符号化を行い、この符号化データをト
レースメモリに格納する。また、デバッガ16に取り込
む際には、この符号化データを元に戻し(復号化)て検
証を行う。次にこの方法を具体的に示す。図2は、メモ
リアドレス20の変換方式の一例を示したものである。
t0〜t13は、サイクル0からサイクル13を示す。
ビットBは、分岐状態であるか否かを示し、‘1’のと
き分岐なし、‘0’のとき分岐ありを示す。一般的に分
岐ありの場合は、アドレスが‘1’ずつ増加されず、今
までと異なったアドレス値を示すことでこれを認識でき
る。従って、アドレス値が順に‘1’ずつ増加している
場合は、分岐は行われず、命令を順に実行していること
を示す。D7〜D0は、分岐先アドレスを格納するフィ
ールドで、図2では1サイクルに8ビットを格納できる
場合を示している。例えば、サイクルt5でBビットが
‘0’となり分岐したことを示しているが、この分岐先
アドレスは、サイクルt5〜t8のD7〜D0ビットで
表される。この例ではアドレスは32ビットで、サイク
ルt5における分岐先アドレスは2進数で、‘0110
1011,11000111,01101110,00
001100’であることを示している。ちなみにサイ
クルt5〜t8で分岐先アドレスを格納する場合は、最
も上位(左側)のビットから格納している。
The present invention has solved the above problem extremely effectively, and can provide a target chip which can be debugged with the trace memory capacity as small as possible. FIG. 1 shows a conceptual configuration of a system for performing debugging using a processor with a built-in trace memory according to the present invention. The characteristic feature of the system is that an encoding circuit is provided on the input side of the address trace memory 14 in the target chip 100. 12 and debug 1
6 is provided with a decoding circuit 15 on the input side.
Thus, when storing the address in the trace memory 14, the address 2 output from the CPU 10 to the memory 11 is stored.
Using the change of 0, the address is encoded so that the memory capacity can be reduced as much as possible, and the encoded data is stored in the trace memory. When the data is taken into the debugger 16, the encoded data is restored (decoded) to perform verification. Next, this method will be specifically described. FIG. 2 shows an example of a conversion method of the memory address 20.
t0 to t13 indicate cycles 0 to 13.
The bit B indicates whether or not a branch state is established. When "1", no branch is taken, and when "0", a branch is taken. In general, when there is a branch, the address is not incremented by “1”, and this can be recognized by indicating a different address value. Therefore, when the address value increases by '1' in order, it indicates that the branch is not performed and the instructions are executed in order. D7 to D0 are fields for storing branch destination addresses. FIG. 2 shows a case where 8 bits can be stored in one cycle. For example, the B bit becomes '0' at cycle t5, indicating that the branch has taken place. The branch destination address is represented by the D7 to D0 bits at cycles t5 to t8. In this example, the address is 32 bits, and the branch destination address in cycle t5 is a binary number, '0110
1011, 11000111, 01101110, 00
001100 '. Incidentally, when storing the branch destination address in the cycles t5 to t8, the data is stored from the most significant (left) bit.

【0010】以上を図5に示すタイミングチャートで説
明する。図5はプロセッサの実行過程が、命令フェッ
チ、デコード1(プリデコード)、デコード2、実行の
4段パイプライン動作の場合を示している。ここでアド
レス100はアドレス200への分岐命令であり、図2
のサイクルt5に対応している。このアドレス100の
分岐命令は実行ステップで分岐が決定するとすぐにアド
レス200の命令からフェッチを開始する。そしてその
間フエッチされたアドレス101,102,103の命
令は実行すべきでない命令であり、不要となる(パイプ
ラインハザード)。これは図2におけるサイクルt6〜
t8に対応する。このように分岐命令とその後のパイプ
ラインハザードのサイクルを利用して、従来、例えば3
2ビットで表される分岐先アドレスを8ビットずつに分
割して、これを4サイクルかけてメモリに格納すること
でメモリを効率良く使用することができる。図3は、別
の符号化方式を示したものである。これは、アドレスを
格納するフィールドを32ビット分用意し、分岐命令間
の一般命令の数も格納することで分岐命令の分岐先アド
レス及び分岐命令以外の通常命令がどれだけ実行したか
を格納できる。例えば図3の例では、通常命令を3命令
実行した後に分岐命令を実行しており、その分岐先アド
レスは、分岐アドレス1で示される。その後、通常命令
が6命令続いた後に、分岐命令が実行され、その分岐先
アドレスは分岐アドレス2で示される。このような手順
によりアドレスの変化をトレースメモリに蓄積すること
でトレースメモリの容量を削減することができる。
The above is described with reference to the timing chart shown in FIG. FIG. 5 shows a case where the execution process of the processor is a four-stage pipeline operation of instruction fetch, decode 1 (predecode), decode 2, and execution. Here, address 100 is a branch instruction to address 200, and FIG.
Cycle t5. The branch instruction at address 100 starts fetching from the instruction at address 200 as soon as the branch is determined in the execution step. The instructions at addresses 101, 102, and 103 that have been fetched during that time are instructions that should not be executed and are not needed (pipeline hazard). This corresponds to cycle t6 in FIG.
This corresponds to t8. By using the branch instruction and the subsequent pipeline hazard cycle as described above, conventionally, for example, 3
By dividing the branch destination address represented by 2 bits into 8 bits and storing the divided addresses in the memory over 4 cycles, the memory can be used efficiently. FIG. 3 shows another encoding method. This is because a 32-bit address storage field is prepared and the number of general instructions between branch instructions is also stored, so that it is possible to store the branch destination address of the branch instruction and how many normal instructions other than the branch instruction have been executed. . For example, in the example of FIG. 3, a branch instruction is executed after executing three normal instructions, and the branch destination address is indicated by a branch address 1. Thereafter, a branch instruction is executed after six consecutive normal instructions, and the branch destination address is indicated by branch address 2. By accumulating the change of the address in the trace memory by such a procedure, the capacity of the trace memory can be reduced.

【0011】図4は、別の実施例を示したもので、シリ
アルなビット列としてアドレス情報をトレースメモリに
格納する場合を示している。アドレス情報格納の開始
は、トレースメモリの左上となっており、ビット方向に
格納していき、ビット方向が全て埋まったらワード方向
に1行下がり、左から右へ格納するという手順を踏む。
シフタはビット方向に格納する際の位置合わせをするも
のであり、レジスタは一時的にデータを保持するための
もので、レジスタにビットが埋まったときにメモリに1
行分を書き込む。メモリ書き込み後はレジスタの値はリ
セットされ、次のアドレス情報が格納される。図4の例
では、スタートビットから右側に通常命令を示すビット
‘1’が5ビットあり、6ビット目に分岐命令を示すビ
ット‘0’がある。このことは通常命令を5命令実行し
た後に、分岐命令を実行しており、分岐命令の分岐先ア
ドレスは分岐命令を示すビット‘0’の後の決まった長
さで示される。図4の場合、分岐先アドレスが10ビッ
トの場合を示している。また、上記図4の実施例におい
て、トレースメモリとして、シリアルアクセスメモリで
構成したトレースメモリを用い、シーケンシャルな命令
についてはその判別ビットとして「1」を、分岐命令に
ついてはその判別ビットとして「0」、および分岐先ア
ドレスを上記シリアルアクセスメモリで構成したトレー
スメモリに順次シフトさせながら格納するようにすれ
ば、レジスタを用いることなく簡単な回路構成で高速
に、しかも少ないメモリ容量で、多くの実行履歴を格納
することが可能となる。以上により、トレースメモリを
有効かつ最小限のメモリ容量で実現でき、プログラムア
ドレスの推移の情報を格納することができる。
FIG. 4 shows another embodiment in which address information is stored in a trace memory as a serial bit string. The start of the address information storage is at the upper left of the trace memory, and the storage is performed in the bit direction. When all the bit directions are filled, the row is lowered by one row in the word direction and stored from left to right.
The shifter is for positioning when storing data in the bit direction, and the register is for temporarily storing data. When a bit is filled in the register, 1 is stored in the memory.
Write the line. After writing to the memory, the value of the register is reset and the next address information is stored. In the example of FIG. 4, there are five bits “1” indicating a normal instruction on the right side of the start bit, and a sixth bit “0” indicating a branch instruction. This means that the branch instruction is executed after executing five normal instructions, and the branch destination address of the branch instruction is indicated by a fixed length after bit “0” indicating the branch instruction. FIG. 4 shows a case where the branch destination address is 10 bits. In the embodiment of FIG. 4, a trace memory constituted by a serial access memory is used as a trace memory, and "1" is used as a determination bit for a sequential instruction, and "0" is used as a determination bit for a branch instruction. , And the branch destination address are sequentially shifted and stored in the trace memory constituted by the serial access memory, so that a large number of execution histories can be performed at a high speed with a simple circuit configuration without using registers, with a small memory capacity, and Can be stored. As described above, the trace memory can be realized with an effective and minimum memory capacity, and information on the transition of the program address can be stored.

【0012】[0012]

【効果】(1)解決手段1による発明(請求項1に係る
発明)について プログラムアドレスのトレースの際、アドレスがシーケ
ンシャルな動作をしているか、それ以外の動作をしてい
るかを特定ビットで表すことにより、すべてのアドレス
をトレースするときよりもメモリ容量を削減することが
可能となり、さらに、分岐先のアドレスをパイプライン
ハザード期間に分割してトレースメモリに記憶させるこ
とにより、分岐先のアドレスの全ビットを一括して記憶
させる場合よりも、メモリ容量を削減することも可能と
なり、チップ面積を縮小することができる。 (2)解決手段2による発明(請求項2に係る発明)に
ついて プログラムアドレスのトレースの際、アドレスがシーケ
ンシャルな動作をしている場合をカウントしたカウンタ
値と分岐先アドレスのみをアドレストレースメモリに記
憶させることにより、アドレスのメモリ容量を削減する
ことが可能となり、チップ面積を縮小することができ
る。 (3)解決手段3による発明(請求項3に係る発明)に
ついて プログラムアドレスのトレースの際、シーケンシャルな
動作をしているときのアドレス変化に対する情報“1
(または0)”と、分岐が発生した場合、アドレスの先
頭に“0(または1)”を付けた分岐先アドレスのみを
アドレストレースメモリに記憶させることにより、アド
レスのメモリ容量を削減することが可能となり、チップ
面積を縮小することができる。 (4)解決手段4による発明(請求項4に係る発明)に
ついて プログラムアドレスのトレースの際、シーケンシャルな
動作をしているときのアドレス変化に対する情報“1
(または0)”と、分岐が発生した場合、アドレスの先
頭に“0(または1)”を付けた分岐先アドレスのみを
シリアルアクセスメモリで構成したアドレストレースメ
モリに順次記憶させることにより、回路構成を簡素化で
き、高速化が可能で、かつアドレスのメモリ容量を削減
することが可能となり、チップ面積を縮小することがで
きる。
(1) Regarding the invention by the solution means 1 (the invention according to claim 1) When tracing a program address, a specific bit indicates whether the address is performing a sequential operation or not. This makes it possible to reduce the memory capacity as compared to when tracing all addresses, and furthermore, by dividing the branch destination address into a pipeline hazard period and storing it in the trace memory, the branch destination address can be stored. The memory capacity can be reduced as compared with the case where all bits are collectively stored, and the chip area can be reduced. (2) Regarding the invention by the solving means 2 (the invention according to claim 2) When tracing the program address, only the counter value obtained by counting the case where the address performs a sequential operation and the branch destination address are stored in the address trace memory. By doing so, the memory capacity of the address can be reduced, and the chip area can be reduced. (3) Invention by Solution 3 (Invention of Claim 3) At the time of tracing a program address, information "1" corresponding to an address change during a sequential operation.
(Or 0) "and when a branch occurs, only the branch destination address with" 0 (or 1) "at the beginning of the address is stored in the address trace memory, thereby reducing the memory capacity of the address. (4) Regarding the invention by the solution means 4 (the invention according to claim 4) At the time of tracing the program address, information on address change during sequential operation is described. 1
(Or 0) ", and when a branch occurs, only the branch destination address with" 0 (or 1) "at the beginning of the address is sequentially stored in an address trace memory formed of a serial access memory, thereby achieving a circuit configuration. Can be simplified, the operation speed can be increased, the memory capacity of addresses can be reduced, and the chip area can be reduced.

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

【図1】は、本発明のトレースメモリ内蔵プロセッサを
用いてデバッグを行うためのシステムの構成図。
FIG. 1 is a configuration diagram of a system for performing debugging using a processor with a built-in trace memory of the present invention.

【図2】は、パイプラインハザード期間を利用してアド
レス情報をトレースメモリに格納する際のメモリの内容
を示す図。
FIG. 2 is a diagram showing the contents of a memory when address information is stored in a trace memory using a pipeline hazard period.

【図3】は、分岐アドレスと連続アドレスのカウント値
をトレースメモリに格納する際のメモリの内容を示す
図。
FIG. 3 is a diagram showing contents of a memory when a count value of a branch address and a continuous address is stored in a trace memory.

【図4】は、インクリメント情報と分岐アドレスをシリ
アルにトレースメモリに格納するための構成及びメモリ
の内容を示す図。
FIG. 4 is a diagram showing a configuration for serially storing increment information and a branch address in a trace memory and the contents of the memory;

【図5】は、4段のパイプライン動作を示すタイミング
チャート。
FIG. 5 is a timing chart showing a 4-stage pipeline operation.

【図6】は、分岐元アドレスと分岐先アドレスのみをト
レースする従来のトレースメモリの内容を示す図。
FIG. 6 is a diagram showing the contents of a conventional trace memory that traces only a branch source address and a branch destination address.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 平井敬康 東京都大田区中馬込1丁目3番6号 株式 会社リコー内 ────────────────────────────────────────────────── ─── Continued on the front page (72) Inventor Takayasu Hirai 1-3-6 Nakamagome, Ota-ku, Tokyo Inside Ricoh Co., Ltd.

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】プログラムアドレスのトレースの際、アド
レスのシーケンシャルな動作または分岐動作の違いを特
定ビットで表し、これをアドレスの代わりにトレースメ
モリに記憶し、分岐の際、パイプラインの段数だけ分岐
先アドレスを分割し、パイプラインハザード期間にこの
分割された分岐先アドレスと分岐を表す特定ビットをト
レースメモリへ記憶させることを特徴とするトレースメ
モリ内蔵プロセッサ。
When a program address is traced, a difference between a sequential operation or a branch operation of an address is indicated by a specific bit, and this is stored in a trace memory instead of the address. A processor with a built-in trace memory, which divides a destination address and stores the divided destination address and a specific bit indicating a branch in a trace hazard period in a trace memory.
【請求項2】プログラムアドレスのトレースの際、アド
レスのシーケンシャルな変化の数をカウントするカウン
タを有し、アドレスの分岐が発生した場合は分岐先アド
レスと上記カウンタのカウンタ値をトレースメモリに記
憶させることを特徴とするトレースメモリ内蔵プロセッ
サ。
And a counter for counting the number of sequential changes in the address when tracing a program address. When an address branch occurs, a branch destination address and a counter value of the counter are stored in a trace memory. A processor with a built-in trace memory.
【請求項3】プログラムアドレスのトレースの際、アド
レスのシーケンシャルな変化に対してはその変化毎に”
1”(または“0”)を1ビットづつシフトさせながら
レジスタに書き込むとともに、アドレスの分岐が発生し
た場合、アドレスの先頭に”0”(または“1”)を付
けた分岐先アドレスをシフトさせながら、さらにレジス
タに書き込み、レジスタの全ての桁にデータが書き込ま
れたとき、上記レジスタのデータをトレースメモリに記
憶させることを特徴とするトレースメモリ内蔵プロセッ
サ。
3. At the time of tracing a program address, a sequential change of the address is performed every time the change occurs.
1 "(or" 0 ") is written to the register while shifting it bit by bit, and when an address branch occurs, the branch destination address with" 0 "(or" 1 ") added to the beginning of the address is shifted. A processor with a built-in trace memory, wherein the data in the register is stored in a trace memory when data is further written in the register and data is written in all digits of the register.
【請求項4】プログラムアドレスのトレースの際、シー
ケンシャルなアドレスの変化に対しては”1”(または
“0”)を1ビットづつシリアルアクセスメモリで構成
したトレースメモリにシフトさせながら書き込み、アド
レスの分岐が発生した場合、アドレスの先頭に”0”
(または“1”)を付けた分岐先アドレスを前のデータ
の後に引き続いてシフトさせながら上記シリアルアクセ
スメモリで構成したトレースメモリに書き込むことで、
アドレス情報をアドレストレースメモリに記憶させるこ
とを特徴とするトレースメモリ内蔵プロセッサ。
4. When tracing a program address, a sequential address change is written while shifting "1" (or "0") one bit at a time to a trace memory constituted by a serial access memory. When a branch occurs, "0" is added at the beginning of the address.
By writing the branch destination address appended with (or “1”) successively after the previous data while writing it in the trace memory constituted by the serial access memory,
A processor with a built-in trace memory, characterized by storing address information in an address trace memory.
JP10170528A 1998-06-04 1998-06-04 Processor built-in trace memory Pending JPH11353205A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10170528A JPH11353205A (en) 1998-06-04 1998-06-04 Processor built-in trace memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10170528A JPH11353205A (en) 1998-06-04 1998-06-04 Processor built-in trace memory

Publications (1)

Publication Number Publication Date
JPH11353205A true JPH11353205A (en) 1999-12-24

Family

ID=15906612

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10170528A Pending JPH11353205A (en) 1998-06-04 1998-06-04 Processor built-in trace memory

Country Status (1)

Country Link
JP (1) JPH11353205A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001093040A1 (en) * 2000-05-30 2001-12-06 Matsushita Electric Industrial Co., Ltd. Program counter trace system, program counter trace method, and semiconductor device
US7065749B2 (en) * 2000-03-28 2006-06-20 Nec Electronics Corporation Program development compressed trace support apparatus
US7146543B2 (en) 2002-09-04 2006-12-05 Renesas Technology Corp. Semiconductor device mounting chip having tracing function
JP2007122543A (en) * 2005-10-31 2007-05-17 Nec Electronics Corp Semiconductor integrated circuit device, and debug system and debug method therefor
JP2009259289A (en) * 2009-08-07 2009-11-05 Stmicroelectronics Sa Temporal correlation of message transmitted by monitor circuit of microprocessor

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7065749B2 (en) * 2000-03-28 2006-06-20 Nec Electronics Corporation Program development compressed trace support apparatus
WO2001093040A1 (en) * 2000-05-30 2001-12-06 Matsushita Electric Industrial Co., Ltd. Program counter trace system, program counter trace method, and semiconductor device
US7146543B2 (en) 2002-09-04 2006-12-05 Renesas Technology Corp. Semiconductor device mounting chip having tracing function
US7490271B2 (en) 2002-09-04 2009-02-10 Renesas Technology Corp. Semiconductor device mounting chip having tracing function
JP2007122543A (en) * 2005-10-31 2007-05-17 Nec Electronics Corp Semiconductor integrated circuit device, and debug system and debug method therefor
JP2009259289A (en) * 2009-08-07 2009-11-05 Stmicroelectronics Sa Temporal correlation of message transmitted by monitor circuit of microprocessor

Similar Documents

Publication Publication Date Title
US8527812B2 (en) Information processing device
US7149926B2 (en) Configurable real-time trace port for embedded processors
JP2003085000A (en) Trace information production device and its method
US11513804B2 (en) Pipeline flattener with conditional triggers
WO1999054809A1 (en) Real time debugger interface for embedded systems
JP2004013896A (en) Tracing of instruction in data processing system
JP2693678B2 (en) Data processing device
US5502827A (en) Pipelined data processor for floating point and integer operation with exception handling
US6615339B1 (en) VLIW processor accepting branching to any instruction in an instruction word set to be executed consecutively
EP0166431A2 (en) An information processing apparatus having an instruction prefetch circuit
US7334114B2 (en) Real-time monitoring, alignment, and translation of CPU stalls or events
JPH11353205A (en) Processor built-in trace memory
US20020199137A1 (en) Microcontroller with debug support unit
US7110934B2 (en) Analysis of the performance of a portion of a data processing system
US5237664A (en) Pipeline circuit
JPH10275092A (en) Trace information output method for microprocessor
US7606999B2 (en) Merging branch information with sync points
JP2002108647A (en) Semiconductor device with built-in trace memory and processor development support device
JP2915944B2 (en) Coverage measurement method and microcomputer
CN116107823A (en) Circuit testing method and device, electronic equipment and storage medium
JP2923570B2 (en) In-circuit emulator and microprocessor
CN114580329A (en) Real-time debugging method for digital signal processor chip
JPS5936853A (en) Operation processor
JPS6286442A (en) Data processor
JPH05158734A (en) Microprocessor