JP2005196437A - Processor and development support system - Google Patents
Processor and development support system Download PDFInfo
- Publication number
- JP2005196437A JP2005196437A JP2004001652A JP2004001652A JP2005196437A JP 2005196437 A JP2005196437 A JP 2005196437A JP 2004001652 A JP2004001652 A JP 2004001652A JP 2004001652 A JP2004001652 A JP 2004001652A JP 2005196437 A JP2005196437 A JP 2005196437A
- Authority
- JP
- Japan
- Prior art keywords
- branch
- trace
- signal
- instruction
- branch instruction
- 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
Links
Images
Abstract
Description
本発明は、プログラム実行状態を外部で観測可能な情報処理装置(プロセッサ)及びそのプロセッサを用いた開発支援装置に関する。 The present invention relates to an information processing apparatus (processor) capable of observing a program execution state externally and a development support apparatus using the processor.
「トレース情報出力機能」は、プロセッサのプログラム実行状態を、外部のホストコンピュータ上で動作しているデバッガに出力する機能である。システムが何らかの異常動作を検出した場合に、蓄積されたトレース情報を用いることによって、その時点から遡った実行履歴をシステム開発者が確認し、その原因を特定できるようにする。
ところが、開発支援装置においては、プロセッサにトレース情報の出力を行なうためのピンを追加しなければならず、その本数や動作周波数(トレース情報出力のバンド幅)が制限される。また、トレース情報を蓄積するメモリ容量にも限界がある。そのため、限られたトレース出力バンド幅やトレースメモリ容量を用いて、最大限にその効果を発揮するためには、トレース情報の圧縮が必要となる。
The “trace information output function” is a function for outputting the program execution state of the processor to a debugger operating on an external host computer. When the system detects any abnormal operation, the accumulated trace information is used so that the system developer can confirm the execution history going back from that point and identify the cause.
However, in the development support apparatus, a pin for outputting trace information must be added to the processor, and the number and operating frequency (bandwidth of trace information output) are limited. There is also a limit to the memory capacity for storing trace information. Therefore, it is necessary to compress the trace information in order to maximize the effects using the limited trace output bandwidth and trace memory capacity.
従来のトレース情報の圧縮手法の一例として、いわゆる「分岐トレース」と呼ばれるトレース情報取得方法がある(たとえば非特許文献1)。分岐トレースでは、下記(1),(2)のルールに基づき、分岐発生毎に分岐に関する情報をチップ外部に出力する。その出力されたトレース情報を元に、外部のデバッガにおいて、ソースプログラムと照らし合わせながら解析することにより、全ての分岐先アドレスの情報がなくても、実行履歴が復元できる。
(1) ソースプログラムに明示的に分岐先アドレスが記述されている直接分岐の時には、分岐が実行されたことだけを示すメッセージ(Direct Branch Message)を出力
(2) ソースプログラムに分岐先アドレスが明示的に記述されておらず、実行時にそれが決定する間接分岐の時には、分岐先アドレスを含む分岐メッセージ(Indirect Branch Message)を出力
以上の原理に基づくプロセッサと実行履歴復元ソフトウェアを従来技術として挙げ、以下に図を参照しながら説明する。
As an example of a conventional technique for compressing trace information, there is a trace information acquisition method called “branch trace” (for example, Non-Patent Document 1). In the branch trace, based on the following rules (1) and (2), information about a branch is output to the outside of the chip every time a branch occurs. Based on the output trace information, an external debugger analyzes it against the source program, so that the execution history can be restored without any branch destination address information.
(1) When a direct branch whose branch destination address is explicitly described in the source program is output, a message (Direct Branch Message) indicating that the branch has been executed is output
(2) When the branch destination address is not explicitly described in the source program and an indirect branch is determined at the time of execution, a branch message (Indirect Branch Message) including the branch destination address is output. Processor based on the above principle The execution history restoration software will be described as a conventional technique, and will be described below with reference to the drawings.
図20は、従来のトレース情報を出力するプロセッサの構成を示している。 FIG. 20 shows a configuration of a processor that outputs conventional trace information.
CPU100は、直接分岐命令実行時の条件成立時には、直接分岐命令実行信号102と分岐命令実行時の条件成立信号104を同時に”1”にする。直接分岐命令実行時の条件不成立時には、直接分岐命令実行信号102が”1”であり、かつ、分岐命令実行時の条件成立信号104は”0”である。間接分岐命令実行時の条件成立時には、間接分岐命令実行信号103と分岐命令実行時の条件成立信号104を同時に”1”にする。間接分岐命令実行時の条件不成立時には、間接分岐命令実行信号103が”1”であり、かつ、分岐命令実行時の条件成立信号104は”0”である。割込みや例外を受理した時には、割込み実行信号105が”1”となり、直接分岐命令実行信号102、間接分岐命令実行信号103、分岐命令実行時の条件成立信号104の値は無視してもよい。
When the condition at the time of execution of the direct branch instruction is satisfied, the
トレースメッセージ/パケット制御ステートマシン(Type0)200は、CPU100からの直接分岐命令実行信号102、間接分岐命令実行信号103、条件分岐命令実行時の条件成立信号104、割込み実行信号105を受け取り、図21のトレースメッセージ/パケット制御ステートマシンのステート表に示すように、入力信号と内部状態からシーケンスを作り出し、MSEO[1:0]出力(Type0)201と、MDO[7:0]出力選択信号(Type0)202を生成する。MSEO[1:0]出力(Type0)201は、そのままトレース状態出力端子(MSEO[1:0])1010に出力される。
The trace message / packet control state machine (Type 0) 200 receives the direct branch
分岐taken+例外検出回路320は、CPU100からの直接分岐命令実行信号102、間接分岐命令実行信号103、条件分岐命令の条件成立信号104、割込み実行信号105を入力とし、直接分岐命令実行信号102と条件分岐命令の条件成立信号104の論理積、間接分岐命令実行信号103と条件分岐命令の条件成立信号104の論理積、並びに割込み実行信号105の3項の論理和をとったものであり、分岐が実行されることを意味する分岐taken+例外信号321を出力する。
分岐先アドレス更新検出回路310は、CPU100からの間接分岐命令実行信号103、条件分岐命令の条件成立信号104、割込み実行信号105を入力とし、間接分岐命令実行信号103と条件分岐命令の条件成立信号104の論理積、並びに割込み実行信号105の3項の論理和をとったものであり、アドレス出力が必要な分岐が実行されたことを意味する分岐先アドレス更新信号311を出力する。
The branch take +
The branch destination address
シーケンシャル命令実行カウンタ(Type0)500は、CPU100からの命令完了信号101をカウントイネーブルに入力し、前記分岐taken+例外信号321によって同期クリアされる。シーケンシャル命令実行カウンタ(Type0)500のカウント値は、前記分岐taken+例外信号321によって、シーケンシャル命令実行カウンタ値保持手段(Type0)510にロードされ、トレース情報の出力に備えられる。
The sequential instruction execution counter (Type 0) 500 receives the
分岐先アドレス保持手段600は、前記分岐先アドレス更新信号311がアサートされたとき、CPU100からの分岐先アドレス110を入力し保持する。
The branch destination
MDO[7:0]出力マルチプレクサ(Type0)700は、ヘッダー用固定値”0x03”出力回路410の出力と、ヘッダー用固定値”0x04”出力回路420の出力と、シーケンシャル命令実行カウンタ値保持手段(Type0)510の出力と、分岐先アドレス保持手段600の出力を8ビット単位に分割した信号とを、7グループの選択される信号として入力し、MDO[7:0]出力選択信号(Type0)202によって7グループの内の1つを選択して、MDO[7:0]出力信号(Type0)701として出力する。MD0[7:0]出力信号(Type0)701は、そのままトレースデータ出力端子(MDO[7:0])に出力される。
The MDO [7: 0] output multiplexer (Type0) 700 includes a header fixed value “0x03”
図22には、図20のシステムが出力するトレースメッセージのIDであるTCODEの割り当てを示している。図23には、Program Trace, Direct Branch Messageのメッセージフォーマットを、図24には、Program Trace, Indirect Branch Messageのメッセージフォーマットを示している。それぞれ、ここでは説明していないトレース出力の基準クロックに同期してMDO[7:0]出力とMSEO[1:0]出力を変化させる。とりわけMSEO[1:0]は、メッセージ及びパケットの開始・終了を意味するので重要である。 FIG. 22 shows assignment of TCODE which is an ID of a trace message output by the system of FIG. FIG. 23 shows a message format of Program Trace and Direct Branch Message, and FIG. 24 shows a message format of Program Trace and Direct Branch Message. The MDO [7: 0] output and the MSEO [1: 0] output are changed in synchronization with the reference clock of the trace output not described here. MSEO [1: 0] is particularly important because it means the beginning and end of messages and packets.
図21のトレースメッセージ/パケット制御ステートマシンのステート表に示すように、直接分岐の条件成立(直接分岐命令実行信号102と分岐命令実行時の条件成立信号104を同時に”1”)時にはIDLE状態→DIR_HEAD状態→DIR_ICNT状態→IDLE状態へと遷移し、MDO出力選択信号出力及びMSEO出力信号によって、図23のProgram Trace, Direct Branch Messageのメッセージフォーマットに示すようなシーケンス出力が得られる。間接分岐命令の条件成立(間接分岐命令実行信号103と分岐命令実行時の条件成立信号104を同時に”1”)時、または、割込み発生(割込み実行信号105が”1”)時には、IDLE状態→IND_HEAD状態→IND_ICNT状態→IND_UADR0状態→IND_UADR1状態→IND_UADR2状態→IND_UADR3状態→IDLE状態と遷移し、図24のProgram Trace, Indirect Branch Messageのメッセージフォーマットに示すようなトレース出力が得られる。本来であれば、それぞれのシーケンスの間にも次の分岐命令が実行される可能性があり、それらを受け付けるように作られている必要があるが、説明を簡単にするために省略している。また、U-ADDRの長さは、上位アドレスが変化ない場合には、上位ビットを出力しなくてもよいプロトコルとなっているが、これも単純化のため、固定長32ビット出力する制御で説明している点に注意頂きたい。
図19に、このプロセッサを用いた開発支援装置の全体の構成図を示す。
As shown in the trace message / packet control state machine state table in FIG. 21, when the condition for direct branching is satisfied (when the direct branching
FIG. 19 shows an overall configuration diagram of a development support apparatus using this processor.
プロセッサ1からのトレース状態信号1011、トレースデータ信号1021をトレース情報蓄積装置2が受け、トレースメモリ制御1210がトレースメモリ制御信号1211、トレースメモリ書込みデータ1212を制御することによって、トレースメモリ1230に対するメモリアクセスを制御し、トレース情報としてトレースメモリ1230に蓄積する。ホストコンピュータ3は、トレース情報蓄積装置2にトレースメモリ読み出し要求1301を出力し、トレースメモリ制御1210を介してトレースメモリにアクセスし、トレースメモリ出力1231を取得する。
The trace
次に、このように構成されたプロセッサ1からトレースデータを取得し、実行履歴を復元する様子を図26のプログラムを例にとりながら説明する。図26の0x50000000番地から実行した場合、(3)の直接分岐では、それまでにシーケンシャル命令実行数が2であるから、”PTDB I-CNT=2”が出力される。(6),(9)の直接分岐では、それ以前のシーケンシャル命令実行数はどちらも2であるが、まとめられて”PTDB I-CNT=2,I-CNT=2”が出力される。次の(12)では、not-takenであったため、(17)の間接分岐の出現まで、シーケンシャル命令実行数が持ち越され、I-CNT=7になり、また間接分岐がtakenであったため、”PTIB I-CNT=7,U-ADDR=0x50000300”が出力される。同様に(20)の”ret”命令は間接分岐のtakenとみなされるので、”PTIB I-CNT=2,U-ADDR=0x50000034”が出力される。このようにして取得されたトレース情報は図27のようになる。
Next, how the trace data is acquired from the
次に、図26のソースプログラムと図27のトレース情報が与えられた時にホストコンピュータ3が、図25に示したアルゴリズムに従って実行履歴を復元する手順を説明する。
Next, a description will be given of a procedure in which the
ステップ2001で、IPは0x50000000番地、TPは0番地、ETPは4番地に設定される。
In
TP≠ETPなので2002はスキップし、TP=0のトレースメッセージは”PTDB I-CNT=2”であるので、ステップ2003、ステップ2004と進み、IP=0x50000000番地の命令"命令1",IP=0x50000004番地の命令”命令2”を表示し、ステップ2005でIP=0x50000008番地の命令”bra loop_A”を表示し、直接分岐先アドレスの0x50000014(loop_A)をIPに設定する。ステップ2006では、このメッセージのI-CNTパケットを終了したのでステップ2050に進み、TPをインクリメントする。
Since TP ≠ ETP, 2002 is skipped, and the trace message of TP = 0 is “PTDB I-CNT = 2”. Therefore, the process proceeds to
次のTP=1では、”TPDB I-CNT=2,I-CNT=2”を処理するが、TP≠ETPなので2002はスキップし、ステップ2003、ステップ2004へと進み、IP=0x50000014, IP=0x50000018の命令を表示し、ステップ2005で、”bne loop_A”を表示し、IPを再び0x50000014(loop_A)に設定する。I-CNTのパケットが2つあるので、もう一度同じループを繰り返し、ステップ2050でTPを2にインクリメントする。
At the next TP = 1, “TPDB I-CNT = 2, I-CNT = 2” is processed, but since TP ≠ ETP, 2002 is skipped, and the process proceeds to
次のTP=2では、”PTIB I-CNT=7,U-ADDR=0x50000300”を処理するが、これもTP≠ETPなので2002はスキップし、ステップ2003でNへ進み、ステップ2013でYに進む。ステップ2014で、IP=0x50000014の”loop_A:命令3”から、IP=0x50000018の”命令4”、IP=0x5000001cの”bne loop_A”、IP=0x50000020の”命令5”、IP=0x50000024の”命令6”、IP=0x50000028の”命令7”、IP=0x5000002cの”mov Sub_C,a0”まで、順次表示する。続いてステップ2015で、IP=0x50000030の間接分岐命令”call (a0)”を表示し、ステップ2016で、IPをU-ADDRに示されるアドレス0x50000300に設定する。ステップ2050でTPを3にインクリメントする。
At the next TP = 2, “PTIB I-CNT = 7, U-ADDR = 0x50000300” is processed, but this is also TP ≠ ETP, so 2002 is skipped, proceeding to N in
次のTP=3では、”PTIB I-CNT=2,U-ADDR=0x5000034”を処理するが、これもTP≠ETPなので2002はスキップし、ステップ2003でNへ進み、ステップ2013でYに進む。ステップ2014で、IP=0x50000300の”Sub_C: 命令9”、IP=0x50000304の”命令10”まで、順次表示する。続いてステップ2015で、IP=0x50000308の間接分岐命令”ret” を表示し、ステップ2016で、IPをU-ADDRに示されるアドレス0x50000034に設定する。ステップ2050でTPを4にインクリメントする。
次のTP=4では、ステップ2002で、TP==ETPと判定されるので、実行履歴復元は終了する。このようにして得られた実行履歴を図28に示す。
At the next TP = 4, it is determined in
しかしながら従来技術には、トレース情報の圧縮率が低いという問題点がある。すなわち、従来技術においては、条件分岐命令の条件不成立がシーケンシャル命令実行にカウントされ、分岐(直接分岐または間接分岐)の条件成立(分岐の実行)の度に、シーケンシャル命令実行回数を出力しなければならない。また、1回のシーケンシャル命令実行回数の出力にトレース出力クロックの少なくとも1クロックかかっており、CPUの動作周波数とトレースクロックの比(トレース出力クロックは、通常CPUクロックの1/2,1/4など分周した周波数で、チップ外部に伝送可能な動作周波数が選ばれる)を考慮すれば、分岐命令が連続する場合など、トレース情報の発生レートに比べ、トレース情報の出力レートが低く、適当な容量のバッファを用意していても、すぐにトレース出力が不可能になってしまう。言い換えれば、実際のCPUの動作に比べ、トレース情報出力の圧縮率が低いということである。 However, the conventional technique has a problem that the compression rate of the trace information is low. In other words, in the prior art, the condition failure of the conditional branch instruction is counted in sequential instruction execution, and the sequential instruction execution count must be output every time the condition of branch (direct branch or indirect branch) is satisfied (branch execution). Don't be. In addition, it takes at least one trace output clock to output the number of sequential instruction executions, and the ratio between the CPU operating frequency and the trace clock (the trace output clock is usually 1/2, 1/4 of the CPU clock, etc.) If the operating frequency that can be transmitted to the outside of the chip is selected with the divided frequency), the output rate of the trace information is lower than the generation rate of the trace information, such as when branch instructions are continuous, and the appropriate capacity Even if the buffer is prepared, the trace output becomes impossible immediately. In other words, the compression rate of the trace information output is lower than the actual operation of the CPU.
このような問題点に鑑み、本願の発明は、高速なCPUの動作を外部で確実に捕捉可能な程度にトレース情報を高度に圧縮する手段を提供することが目的である。 In view of such problems, an object of the present invention is to provide means for highly compressing trace information to such an extent that high-speed CPU operations can be reliably captured externally.
上記課題に対しては、本願の請求項1、4の発明によって、分岐命令の条件不成立をシーケンシャル命令実行条件に含めず、CPUの分岐命令の条件が成立した時には成立ビットを、分岐が不成立の時は不成立ビットをシフトレジスタにシフトインし、そのシフトレジスタに蓄積した全ビットと有効ビット数情報をまとめた分岐状態メッセージを出力することにより解決する。
To solve the above problem, the invention according to
さらに特定の条件におけるトレース情報圧縮率を上げるため、本願の請求項2、5の発明によって、CPUの分岐が連続して成立した時に、その成立回数を計数するカウンタの値を含む分岐takenカウントメッセージを出力することにより、課題解決を図る。
Further, in order to increase the trace information compression rate under a specific condition, the branch taken count message including the value of the counter for counting the number of establishments when the CPU branches are successively established according to the inventions of
さらに、つねに最適な圧縮率のトレース情報を出力するため、本願の請求項3、6の発明によって、分岐状態メッセージと、分岐takenカウントメッセージのどちらが短いかを判断し、選択して出力することにより、課題解決を図る。
Further, in order to always output trace information with the optimum compression rate, according to the inventions of
本発明の請求項1、4の発明に関わるプロセッサ及び開発支援装置によれば、分岐発生の度に旧来は1パケット要していたところが、パケットの中の1ビットで済むようになるため、その情報の圧縮率は約1/8と見積もれる。 According to the processor and the development support apparatus according to the first and fourth aspects of the present invention, since one packet is conventionally required every time a branch occurs, only one bit in the packet can be used. The compression ratio of information is estimated to be about 1/8.
さらに、本発明の請求項3、6の発明に関わるプロセッサ及び開発支援装置によれば、同じ分岐が連続するときには、さらに情報の圧縮率は1/32まで高めることができる。 Furthermore, according to the processor and the development support apparatus according to the third and sixth aspects of the present invention, when the same branch continues, the information compression rate can be further increased to 1/32.
以下、本発明の実施例を、図面を参照しながら説明する。 Embodiments of the present invention will be described below with reference to the drawings.
図1は、本発明の第1の実施例におけるプロセッサの構成を示すブロック図である。
CPU100は、直接分岐命令実行時の条件成立時には、直接分岐命令実行信号102と分岐命令実行時の条件成立信号104を同時に”1”にする。直接分岐命令実行時の条件不成立時には、直接分岐命令実行信号102が”1”であり、かつ、分岐命令実行時の条件成立信号104は”0”である。間接分岐命令実行時の条件成立時には、間接分岐命令実行信号103と分岐命令実行時の条件成立信号104を同時に”1”にする。間接分岐命令実行時の条件不成立時には、間接分岐命令実行信号103が”1”であり、かつ、分岐命令実行時の条件成立信号104は”0”である。割込みや例外を受理した時には、割込み実行信号105が”1”となり、直接分岐命令実行信号102、間接分岐命令実行信号103、分岐命令実行時の条件成立信号104の値は無視してもよい。
FIG. 1 is a block diagram showing the configuration of the processor in the first embodiment of the present invention.
When the condition at the time of execution of the direct branch instruction is satisfied, the
トレースメッセージ/パケット制御ステートマシン(Type2)220は、CPU100からの直接分岐命令実行信号102、間接分岐命令実行信号103、条件分岐命令実行時の条件成立信号104、割込み実行信号105、分岐フラグカウンタ820からの分岐フラグカウンタ値821を受け取り、図2のトレースメッセージ/パケット制御ステートマシンのステート表に示すように、入力信号と内部状態からシーケンスを作り出し、MSEO[1:0]出力(Type2)221と、MDO[7:0]出力選択信号(Type2)222を生成する。MSEO[1:0]出力(Type2)221は、そのままトレース状態出力端子(MSEO[1:0])1010に出力される。
The trace message / packet control state machine (Type 2) 220 includes a direct branch
分岐taken検出回路350は、CPU100からの直接分岐命令実行信号102、間接分岐命令実行信号103、条件分岐命令の条件成立信号104を入力とし、直接分岐命令実行信号102と条件分岐命令の条件成立信号104の論理積と、間接分岐命令実行信号103と条件分岐命令の条件成立信号104の論理積との2項の論理和をとったものであり、分岐が実行されることを意味する分岐taken信号351を出力する。
The branch
分岐先アドレス更新検出回路310は、CPU100からの間接分岐命令実行信号103、条件分岐命令の条件成立信104、割込み実行信号105を入力とし、間接分岐命令実行信号103と条件分岐命令の条件成立信号104の論理積、並びに割込み実行信号105の3項の論理和をとったものであり、アドレス出力が必要な分岐が実行されたことを意味する分岐先アドレス更新信号311を出力する。
The branch destination address
分岐検出回路340は、CPU100からの直接分岐命令実行信号102、間接分岐命令実行信号103、割込み実行信105を入力とし、それらの論理和を、分岐実行信号341として出力する。
The
シーケンシャル命令実行カウンタ(Type2,3)530は、CPU100からの命令完了信号101をカウントイネーブルに入力し、前記分岐実行信号341によって同期クリアされる。シーケンシャル命令実行カウンタ(Type2,3)530のカウント値は、前記分岐実行信号341によって、シーケンシャル命令実行カウンタ値保持手段(Type2,3)540にロードされ、トレース情報の出力に備えられる。
The sequential instruction execution counter (
分岐先アドレス保持手段600は、前記分岐先アドレス更新信号311がアサートされたとき、CPU100からの分岐先アドレス110を入力し保持する。
The branch destination address holding means 600 receives and holds the
分岐フラグカウンタ820は、前記分岐実行信号341をカウントイネーブルに入力し、前記分岐先アドレス更新信号311で同期クリアされるカウンタである。分岐フラグカウンタ値821は、ステートマシン220に供給され、またその下位3ビットは、前記分岐先アドレス更新信号311がアサートされるタイミングまたは、図示されていないが、ステートマシン220がBST_HEADステートに遷移するタイミングで、分岐フラグカウンタ値保持手段830にロードされる。
The
分岐フラグ用シフトレジスタ800は、前記分岐実行信号341をシフトイネーブルの信号に使い、分岐taken信号351をシフトインする。前記分岐先アドレス更新信号311がアサートされる時、分岐フラグ用シフトレジスタ800は同期クリアされるが、それ以前のフラグの値は、分岐フラグ保持手段810にロードされる。
The branch
MDO[7:0]出力マルチプレクサ(Type2)720は、ヘッダー用固定値”0x38”出力回路430の出力と、ヘッダー用固定値”0x3a”出力回路450の出力と、シーケンシャル命令実行カウンタ値保持手段(Type2,3)540の出力と、分岐先アドレス保持手段600の出力を8ビット単位に分割した信号と、分岐フラグカウンタ値保持手段830の出力と分岐フラグ保持手段810の出力をマージして8ビット単位にアラインしなおした信号との、13グループの選択される信号として入力し、MDO[7:0]出力選択信号(Type2)222によって13グループの内の1つを選択して、MDO[7:0]出力信号(Type2)721として出力する。MD0[7:0]出力信号(Type2)721は、そのままトレースデータ出力端子(MDO[7:0])に出力される。
The MDO [7: 0] output multiplexer (Type 2) 720 includes an output of the header fixed value “0x38”
図3には、図1のシステムが出力するトレースメッセージのIDであるTCODEの割り当てを示している。図4には、Program Trace, Branch Status Messageのメッセージフォーマットを、図5には、Program Trace, Branch Destination Address Messageのメッセージフォーマットを、図6には、Program Trace, Exception Messageのメッセージフォーマットを示している。それぞれ、ここでは説明していないトレース出力の基準クロックに同期してMDO[7:0]出力とMSEO[1:0]出力を変化させる。 FIG. 3 shows assignment of TCODE which is an ID of a trace message output by the system of FIG. 4 shows a message format of Program Trace and Branch Status Message, FIG. 5 shows a message format of Program Trace and Branch Destination Address Message, and FIG. 6 shows a message format of Program Trace and Branch Exception Message. . The MDO [7: 0] output and the MSEO [1: 0] output are changed in synchronization with the reference clock of the trace output not described here.
図2のトレースメッセージ/パケット制御ステートマシン(Type2)のステート表に示すように、直接分岐の条件成立(直接分岐命令実行信号102と分岐命令実行時の条件成立信号104を同時に”1”)時、かつ分岐フラグカウント値がフル(BFcount==31)の時には、IDLE状態→BST_HEAD状態→BST_NV状態→BST_BRF0→BST_BRF1→BST_BRF2→BST_BRF3→IDLE状態へと遷移し、MDO出力選択信号出力及びMSEO出力信号によって、図4のProgram Trace, Branch Status Messageのメッセージフォーマットに示すシーケンス出力が得られる。
As shown in the trace message / packet control state machine (Type2) state table in FIG. 2, when a direct branch condition is satisfied (the direct branch
間接分岐命令の条件成立(間接分岐命令実行信号103と分岐命令実行時の条件成立信号104を同時に”1”)時、かつ分岐フラグカウント値がゼロ(BFcount==0)の時には、IDLE状態→BDA_HEAD状態→IND_UADR0状態→IND_UADR1状態→IND_UADR2状態→IND_UADR3状態→IDLE状態と遷移し、図5のProgram Trace, Branch Destination Address Messageのメッセージフォーマットに示すようなトレース出力が得られる。
When the condition of an indirect branch instruction is satisfied (the indirect branch
間接分岐命令の条件成立(間接分岐命令実行信号103と分岐命令実行時の条件成立信号104を同時に”1”)時、かつ分岐フラグカウント値がゼロでない(BFcount!=0)の時には、先にPTBSTメッセージを出力してから、PTBDAメッセージを出力するように制御される。
When the condition of an indirect branch instruction is satisfied (the indirect branch
割込み発生(割込み実行信号105が”1”)時、かつ分岐フラグカウント値がゼロ(BFcount==0)の時には、IDLE状態→EXC_HEAD状態→EXC_ICNT状態→IND_UADR0状態→IND_UADR1状態→IND_UADR2状態→IND_UADR3状態→IDLE状態と遷移し、図6のProgram Trace, Exception Messageのメッセージフォーマットに示すようなトレース出力が得られる。
When an interrupt occurs (interrupt
割込み発生(割込み実行信号105が”1”)時、かつ分岐フラグカウント値がゼロでない(BFcount!=0)の時には、先にPTBSTメッセージを出力してから、PTEXCメッセージを出力するように制御される。
When an interrupt occurs (interrupt
本来であれば、それぞれのシーケンスの間にも次の分岐命令が実行される可能性があり、それらを受け付けるように作られている必要があるが、説明を簡単にするために省略している。また、U-ADDRの長さは、上位アドレスが変化ない場合には、上位ビットを出力しなくてもよいプロトコルとなっているが、これも単純化のため、固定長32ビット出力する制御で説明している点に注意頂きたい。 Originally, there is a possibility that the next branch instruction may be executed between each sequence, and it is necessary to be designed to accept them, but this is omitted for the sake of simplicity. . The length of U-ADDR is a protocol that does not need to output the upper bits if the upper address does not change, but this is also controlled by outputting a fixed length of 32 bits for simplicity. Please note the points explained.
図19に、このプロセッサを用いた開発支援装置の全体の構成図を示す。 FIG. 19 shows an overall configuration diagram of a development support apparatus using this processor.
プロセッサ1からのトレース状態信号1011、トレースデータ信号1021をトレース情報蓄積装置2が受け、トレースメモリ制御1210がトレースメモリ制御信号1211、トレースメモリ書込みデータ1212を制御することによって、トレースメモリ1230に対するメモリアクセスを制御し、トレース情報としてトレースメモリ1230に蓄積する。ホストコンピュータ3は、トレース情報蓄積装置2にトレースメモリ読み出し要求1301を出力し、トレースメモリ制御1210を介してトレースメモリにアクセスし、トレースメモリ出力1231を取得する。(これは従来例と全く同じである。)
次に、このように構成されたプロセッサ1からトレースデータを取得し、実行履歴を復元する様子を図8のプログラムを例にとりながら説明する。図8の0x50000000番地から実行した場合、(17)の間接分岐の出現までの分岐のtaken/not-takenがシフトレジスタに蓄積され、”PTBST NV=4,BR-FLAG=0b0111”が出力され、その後(17)の間接分岐がtakenであったため、”PTBDA U-ADDR=0x50000300”が出力される。同様に(20)の”ret”命令は間接分岐のtakenとみなされるので、”PTBDA U-ADDR=0x50000034”が出力される。このようにして取得されたトレース情報は図9のようになる。
The trace
Next, how the trace data is acquired from the
次に、図8のソースプログラムと図9のトレース情報が与えられた時にホストコンピュータ3が、図7に示したアルゴリズムに 従って実行履歴を復元する手順を説明する。
Next, a description will be given of the procedure in which the
まず、ステップ2001で、IPは0x50000000番地、TPは0番地、ETPは3番地に設定される。次にTP≠ETPなので2002はスキップし、TP=0のトレースメッセージは”PTBST BR-FLAG=0b0111”であるので、ステップ2100、ステップ2101へと進み、IP=0x50000000番地の命令"命令1",IP=0x50000004番地の命令”命令2”を表示し、ステップ2102でIP=0x50000008番地の命令”bra loop_A”を表示し、直接分岐先アドレスの0x50000014番地(loop_A)をIPに設定する。ステップ2103では、分岐フラグの有効フラグはまだ残っているので、再度ステップ2101へ戻る。今度は、IP=0x50000014番地の命令”loop_A: 命令3”、IP=0x50000018番地の “命令4”を表示し、ステップ2102で、IP=0x5000001c番地の”bne loop_A”を表示し、分岐フラグが1であったので、IPに直接分岐先アドレス0x50000014番地(loop_A)を設定する。同様にIP=0x50000014からIP=0x5000001cを2回繰り返す。最後のIP=0x5000001c番地の”bne loop_A”では、対応する分岐フラグが”0”であるので、次の命令のアドレス0x50000020をIPに設定し、ステップ2103で有効フラグ数が終了したので、ステップ2050へ進み、TPをインクリメントする。
次のTP=1では、”PTBDA U-ADDR=0x50000300”を処理するが、これもTP≠ETPなので2002はスキップし、ステップ2100、ステップ2200でNへ進み、ステップ2300でYに進む。ステップ2301で、IP=0x50000020の”命令5”から、IP=0x50000024の”命令6”、IP=0x50000028の”命令7”、IP=0x5000002cの”mov Sub_C,a0”まで順次表示する。続いてステップ2302で、IP=0x50000030の間接分岐命令”call (a0)”を表示し、ステップ2303で、IPをU-ADDRに示されるアドレス0x50000300に設定する。ステップ2050でTPを2にインクリメントする。
First, in
At the next TP = 1, “PTBDA U-ADDR = 0x50000300” is processed, but since this is also TP ≠ ETP, 2002 is skipped, the process proceeds to N in
次のTP=2では、”PTBDA U-ADDR=0x5000034”を処理するが、これもTP≠ETPなので2002はスキップし、ステップ2100、ステップ2200でNへ進み、ステップ2300でYに進む。ステップ2301で、IP=0x50000300の”Sub_C: 命令9”、IP=0x50000304の”命令10”まで、順次表示する。続いてステップ2302で、IP=0x50000308の間接分岐命令”ret” を表示し、ステップ2303で、IPをU-ADDRに示されるアドレス0x50000034に設定する。ステップ2050でTPを3にインクリメントする。
次のTP=3では、ステップ2002で、TP==ETPと判定されるので、実行履歴復元は終了する。このようにして得られた実行履歴を図10に示す。
At the next TP = 2, “PTBDA U-ADDR = 0x5000034” is processed. Since this is also TP ≠ ETP, 2002 is skipped, and the process proceeds to N in
At the next TP = 3, it is determined in
この例で示したように、直接分岐命令の結果が従来1パケット要していたものを本発明では、PTBSTメッセージのBR-FLAGの1ビットにまで圧縮可能である。 As shown in this example, in the present invention, the result of the direct branch instruction that conventionally required one packet can be compressed to 1 bit of BR-FLAG of the PTBST message.
図11は、本発明の第2の実施例におけるプロセッサの構成を示すブロック図である。 FIG. 11 is a block diagram showing the configuration of the processor in the second embodiment of the present invention.
CPU100は、直接分岐命令実行時の条件成立時には、直接分岐命令実行信号102と分岐命令実行時の条件成立信号104を同時に”1”にする。直接分岐命令実行時の条件不成立時には、直接分岐命令実行信号102が”1”であり、かつ、分岐命令実行時の条件成立信号104は”0”である。間接分岐命令実行時の条件成立時には、間接分岐命令実行信号103と分岐命令実行時の条件成立信号104を同時に”1”にする。間接分岐命令実行時の条件不成立時には、間接分岐命令実行信号103が”1”であり、かつ、分岐命令実行時の条件成立信号104は”0”である。割込みや例外を受理した時には、割込み実行信号105が”1”となり、直接分岐命令実行信号102、間接分岐命令実行信号103、分岐命令実行時の条件成立信号104の値は無視してもよい。
When the condition at the time of execution of the direct branch instruction is satisfied, the
トレースメッセージ/パケット制御ステートマシン(Type3)230は、CPU100からの直接分岐命令実行信号102、間接分岐命令実行信号103、条件分岐命令実行時の条件成立信号104、割込み実行信号105、分岐フラグカウンタ820からの分岐フラグカウンタ値821、分岐takenカウンタ900からの分岐takenカウンタ値901を受け取り、図12のトレースメッセージ/パケット制御ステートマシン(Type3)のステート表に示すように、入力信号と内部状態からシーケンスを作り出し、MSEO[1:0]出力(Type3)231と、MDO[7:0]出力選択信号(Type3)232を生成する。MSEO[1:0]出力(Type3)231は、そのままトレース状態出力端子(MSEO[1:0])1010に出力される。
The trace message / packet control state machine (Type 3) 230 includes a direct branch
分岐taken検出回路350は、CPU100からの直接分岐命令実行信号102、間接分岐命令実行信号103、条件分岐命令の条件成立信号104を入力とし、直接分岐命令実行信号102と条件分岐命令の条件成立信号104の論理積と、間接分岐命令実行信号103と条件分岐命令の条件成立信号104の論理積との2項の論理和をとったものであり、分岐が実行されることを意味する分岐taken信号351を出力する。
The branch
分岐not-taken検出回路330は、CPU100からの直接分岐命令実行信号102、間接分岐命令実行信号103、条件分岐命令の条件成立信号104を入力とし、直接分岐命令実行信号102の否定と条件分岐命令の条件成立信号104の論理積と、間接分岐命令実行信号103の否定と条件分岐命令の条件成立信号104の論理積との2項の論理和をとったものであり、分岐が実行されないことを意味する分岐not-taken信号331を出力する。
The branch not-taken
分岐先アドレス更新検出回路310は、CPU100からの間接分岐命令実行信号103、条件分岐命令の条件成立信号104、割込み実行信号105を入力とし、間接分岐命令実行信号103と条件分岐命令の条件成立信号104の論理積、並びに割込み実行信号105の3項の論理和をとったものであり、アドレス出力が必要な分岐が実行されたことを意味する分岐先アドレス更新信号311を出力する。
The branch destination address
分岐検出回路340は、CPU100からの直接分岐命令実行信号102、間接分岐命令実行信号103、割込み実行信号105を入力とし、それらの論理和を、分岐実行信号341として出力する。
The
シーケンシャル命令実行カウンタ(Type2,3)530は、CPU100からの命令完了信号101をカウントイネーブルに入力し、前記分岐実行信号341によって同期クリアされる。シーケンシャル命令実行カウンタ(Type2,3)530のカウント値は、前記分岐実行信号341によって、シーケンシャル命令実行カウンタ値保持手段(Type2,3)540にロードされ、トレース情報の出力に備えられる。
The sequential instruction execution counter (
分岐先アドレス保持手段600は、前記分岐先アドレス更新信号311がアサートされたとき、CPU100からの分岐先アドレス110を入力し保持する。
The branch destination address holding means 600 receives and holds the
分岐フラグカウンタ820は、前記分岐実行信号341をカウントイネーブルに入力し、前記分岐先アドレス更新信号311で同期クリアされるカウンタである。分岐フラグカウンタ値821は、ステートマシン230に供給され、またその下位3ビットは、前記分岐先アドレス更新信号311がアサートされるタイミングまたは、図示されていないが、ステートマシン230がBST_HEADステートに遷移するタイミングで、分岐フラグカウンタ値保持手段830にロードされる。
The
分岐フラグ用シフトレジスタ800は、前記分岐実行信号341をシフトイネーブルの信号に使い、分岐taken信号351をシフトインする。前記分岐先アドレス更新信号311がアサートされる時、分岐フラグ用シフトレジスタ800は同期クリアされるが、それ以前のフラグの値は、分岐フラグ保持手段810にロードされる。
The branch
分岐takenカウンタ900は、前記分岐taken信号351をカウントイネーブルに入力し、前記分岐not-taken信号331で同期クリアされるカウンタである。分岐takenカウンタ値901は、ステートマシン230に供給される共に、前記分岐not-taken信号331がアサートされるタイミングで(これと人為的にロードする場合もありうるのを後で追加)、分岐takenカウンタ値保持手段910にロードされる。
The branch take
MDO[7:0]出力マルチプレクサ(Type3)730は、ヘッダー用固定値”0x38”出力回路430の出力と、ヘッダー用固定値”0x39”出力回路440の出力と、ヘッダー用固定値”0x3a”出力回路450の出力と、シーケンシャル命令実行カウンタ値保持手段(Type2,3)540の出力と、分岐先アドレス保持手段600の出力を8ビット単位に分割した信号と、分岐フラグカウンタ値保持手段830の出力と分岐フラグ保持手段810の出力をマージして8ビット単位に整列しなおした信号と、分岐takenカウンタ値保持手段910の出力との、15グループの選択される信号として入力し、MDO[7:0]出力選択信号(Type3)232によって15グループの内の1つを選択して、MDO[7:0]出力信号(Type3)731として出力する。MD0[7:0]出力信号(Type3)731は、そのままトレースデータ出力端子(MDO[7:0])に出力される。
The MDO [7: 0] output multiplexer (Type 3) 730 outputs the header fixed value “0x38”
図13には、図11のシステムが出力するトレースメッセージのIDであるTCODEの割り当てを示している。図4には、Program Trace, Branch Status Messageのメッセージフォーマットを、図5には、Program Trace, Branch Destination Address Messageのメッセージフォーマットを、図6には、Program Trace, Exception Messageのメッセージフォーマットを、図14には、Program Trace, Branch Taken Count Messageのメッセージフォーマットを示している。それぞれ、ここでは説明していないトレース出力の基準クロックに同期してMDO[7:0]出力とMSEO[1:0]出力を変化させる。 FIG. 13 shows assignment of TCODE which is an ID of a trace message output by the system of FIG. 4 shows a message format of Program Trace and Branch Status Message, FIG. 5 shows a message format of Program Trace and Branch Destination Address Message, FIG. 6 shows a message format of Program Trace and Branch Exception Message, and FIG. Shows the message format of Program Trace and Branch Taken Count Message. The MDO [7: 0] output and the MSEO [1: 0] output are changed in synchronization with the reference clock of the trace output not described here.
図12のトレースメッセージ/パケット制御ステートマシン(Type3)のステート表に示すように、直接分岐の条件成立(直接分岐命令実行信号102と分岐命令実行時の条件成立信号104を同時に”1”)時、かつ分岐フラグカウント値がフル(BFcount==31)の時には、IDLE状態→BST_HEAD状態→BST_NV状態→BST_BRF0→BST_BRF1→BST_BRF2→BST_BRF3→IDLE状態へと遷移し、MDO出力選択信号出力及びMSEO出力信号によって、図4のProgram Trace, Branch Status Messageのメッセージフォーマットに示すシーケンス出力が得られる。
As shown in the trace message / packet control state machine (Type 3) state table in FIG. 12, when a direct branch condition is satisfied (the direct branch
間接分岐命令の条件成立(間接分岐命令実行信号103と分岐命令実行時の条件成立信号104を同時に”1”)時、かつ分岐フラグカウント値がゼロ(BFcount==0)の時には、IDLE状態→BDA_HEAD状態→IND_UADR0状態→IND_UADR1状態→IND_UADR2状態→IND_UADR3状態→IDLE状態と遷移し、図5のProgram Trace, Branch Destination Address Messageのメッセージフォーマットに示すようなトレース出力が得られる。
When the condition of an indirect branch instruction is satisfied (the indirect branch
間接分岐命令の条件成立(間接分岐命令実行信号103と分岐命令実行時の条件成立信号104を同時に”1”)時、かつ分岐フラグカウント値がゼロでない(BFcount!=0)の時には、先にPTBSTメッセージを出力してから、PTBDAメッセージを出力するように制御される。
When the condition of an indirect branch instruction is satisfied (the indirect branch
割込み発生(割込み実行信号105が”1”)時、かつ分岐フラグカウント値がゼロ(BFcount==0)の時には、IDLE状態→EXC_HEAD状態→EXC_ICNT状態→IND_UADR0状態→IND_UADR1状態→IND_UADR2状態→IND_UADR3状態→IDLE状態と遷移し、図6のProgram Trace, Exception Messageのメッセージフォーマットに示すようなトレース出力が得られる。
When an interrupt occurs (interrupt
割込み発生(割込み実行信号105が”1”)時、かつ分岐フラグカウント値がゼロでない(BFcount!=0)の時には、先にPTBSTメッセージを出力してから、PTEXCメッセージを出力するように制御される。
When an interrupt occurs (interrupt
本来であれば、それぞれのシーケンスの間にも次の分岐命令が実行される可能性があり、それらを受け付けるように作られている必要があるが、説明を簡単にするために省略している。また、U-ADDRの長さは、上位アドレスが変化ない場合には、上位ビットを出力しなくてもよいプロトコルとなっているが、これも単純化のため、固定長32ビット出力する制御で説明している点に注意頂きたい。 Originally, there is a possibility that the next branch instruction may be executed between each sequence, and it is necessary to be designed to accept them, but this is omitted for the sake of simplicity. . The length of U-ADDR is a protocol that does not need to output the upper bits if the upper address does not change, but this is also controlled by outputting a fixed length of 32 bits for simplicity. Please note the points explained.
図19に、このプロセッサを用いた開発支援装置の全体の構成図を示す。 FIG. 19 shows an overall configuration diagram of a development support apparatus using this processor.
プロセッサ1からのトレース状態信号1011、トレースデータ信号1021をトレース情報蓄積装置2が受け、トレースメモリ制御1210がトレースメモリ制御信号1211、トレースメモリ書込みデータ1212を制御することによって、トレースメモリ1230に対するメモリアクセスを制御し、トレース情報としてトレースメモリ1230に蓄積する。ホストコンピュータ3は、トレース情報蓄積装置2にトレースメモリ読み出し要求1301を出力し、トレースメモリ制御1210を介してトレースメモリにアクセスし、トレースメモリ出力1231を取得する。(これは従来例と全く同じである。)
次に、このように構成されたプロセッサ1からトレースデータを取得し、実行履歴を復元する様子を図16のプログラムを例にとりながら説明する。図16の0x50000000番地から実行した場合、(69)の条件分岐命令がnot-takenになるまで、分岐taken/not-takenのフラグがシフトレジスタに蓄積されると同時に、分岐takenカウント値がインクリメントされるが、分岐takenカウントメッセージを出力した方が符号効率が高いため、”PTBTCBR-TAKEN=22”が出力される。その後(78)の間接分岐がtakenであったため、分岐フラグのシフトレジスタに残っていたno-takenフラグを含む”BTBST BR-FLAG=0b0”が出力され、続いて、”PTBDA U-ADDR=0x50000300”が出力される。同様に(77)の”ret”命令は間接分岐のtakenとみなされるので、”PTBDA U-ADDR=0x50000034”が出力される。このようにして取得されたトレース情報は図17のようになる。
The trace
Next, how the trace data is acquired from the
次に、図16のソースプログラムと図17のトレース情報が与えられた時にホストコンピュータ3が、図15に示したアルゴリズムに従って実行履歴を復元する手順を説明する。
Next, the procedure in which the
まず、ステップ2001で、IPは0x50000000番地、TPは0番地、ETPは4番地に設定される。次にTP≠ETPなので2002はスキップし、TP=0のトレースメッセージは”PTBTC BR-TAKEN=22”であるので、ステップ2400、ステップ2401へと進み、内部的には分岐フラグの集合0b11111111111111111111111に変換する。そしてステップ2101へ進み、IP=0x50000000番地の命令"命令1",IP=0x50000004番地の命令”命令2”を表示し、ステップ2102でIP=0x50000008番地の命令”bra loop_A”を表示し、直接分岐先アドレスの0x50000014番地(loop_A)をIPに設定する。ステップ2103では、分岐フラグの有効フラグはまだ残っているので、再度ステップ2101へ戻る。今度は、IP=0x50000014番地の命令”loop_A: 命令3”、IP=0x50000018番地の “命令4”を表示し、ステップ2102で、IP=0x5000001c番地の”bne loop_A”を表示し、分岐フラグが1であったので、IPに直接分岐先アドレス0x50000014番地(loop_A)を設定する。同様にIP=0x50000014からIP=0x5000001cを20回繰り返し、ステップ2103で有効フラグ数が終了したので、ステップ2050へ進み、TPをインクリメントする。
First, in
次のTP=1では、”PTBST BR-FLAG=0b0”を処理するが、これもTP≠ETPなので2002はスキップし、ステップ2400でNへ進み、ステップ2100でYへ進み、ステップ2101において、IP=0x50000014番地の”loop_A:命令3”、IP=0x500000018番地の”命令4”を表示し、ステップ2102において、IP=0x5000001c番地の”bne loop_A”を表示するが、分岐フラグが”0”なので、次の命令アドレス0x50000020をIPに設定し、ステップ2050へ進み、TPをインクリメントする。
At the next TP = 1, “PTBST BR-FLAG = 0b0” is processed, but since this is also TP ≠ ETP, 2002 is skipped, proceeding to N in
次のTP=2では、”PTBDA U-ADDR=0x50000300”を処理するが、これもTP≠ETPなので2002はスキップし、ステップ2400、ステップ2100、ステップ2200でNへ進み、ステップ2300でYに進む。ステップ2301で、IP=0x50000020の”命令5”から、IP=0x50000024の”命令6”、IP=0x50000028の”命令7”、IP=0x5000002cの”mov Sub_C,a0”まで順次表示する。続いてステップ2302で、IP=0x50000030の間接分岐命令”call (a0)”を表示し、ステップ2303で、IPをU-ADDRに示されるアドレス0x50000300に設定する。ステップ2050でTPを3にインクリメントする。
At the next TP = 2, “PTBDA U-ADDR = 0x50000300” is processed, but since this is also TP ≠ ETP, 2002 is skipped, proceeding to N in
次のTP=3では、”PTBDA U-ADDR=0x5000034”を処理するが、これもTP≠ETPなので2002はスキップし、ステップ2400、ステップ2100、ステップ2200でNへ進み、ステップ2300でYに進む。ステップ2301で、IP=0x50000300の”Sub_C: 命令9”、IP=0x50000304の”命令10”まで、順次表示する。続いてステップ2302で、IP=0x50000308の間接分岐命令”ret” を表示し、ステップ2303で、IPをU-ADDRに示されるアドレス0x50000034に設定する。ステップ2050でTPを4にインクリメントする。
At the next TP = 3, “PTBDA U-ADDR = 0x5000034” is processed, but since this is also TP ≠ ETP, 2002 is skipped, proceeding to N in
次のTP=4では、ステップ2002で、TP==ETPと判定されるので、実行履歴復元は終了する。このようにして得られた実行履歴を図18に示す。
At the next TP = 4, it is determined in
この例で示したように、直接分岐命令の結果が従来1パケット要していたものを本発明では、分岐takenが連続している場合で、かつ、PTBSTメッセージを出力するよりも短くなる場合にPTBTCメッセージを出力するように制御することで、どのような場合でも常に最高の圧縮効率を実現する。 As shown in this example, in the present invention, the result of the direct branch instruction that conventionally required one packet is used when the branch take is continuous and shorter than the PTBST message is output. By controlling to output PTBTC messages, the highest compression efficiency is always achieved in any case.
本発明にかかるプロセッサおよび開発支援装置は、プロセッサの動作を外部から解析、評価する手段として有用である。 The processor and the development support apparatus according to the present invention are useful as means for analyzing and evaluating the operation of the processor from the outside.
1 プロセッサ
2 トレース情報蓄積装置
3 ホストコンピュータ
100 CPU
101 命令実行完了信号
102 直接分岐命令実行信号
103 間接分岐命令実行信号
104 条件分岐命令の条件成立信号
105 割込み実行信号
110 分岐先アドレス
200 トレースメッセージ/パケット制御ステートマシン(Type0)
201 MSEO[1:0]出力信号(Type0)
202 MDO[7:0]出力選択信号(Type0)
220 トレースメッセージ/パケット制御ステートマシン(Type2)
221 MSEO[1:0]出力信号(Type2)
222 MDO[7:0]出力選択信号(Type2)
230 トレースメッセージ/パケット制御ステートマシン(Type3)
231 MSEO[1:0]出力信号(Type3)
232 MDO[7:0]出力選択信号(Type3)
310 分岐先アドレス更新検出回路
311 分岐先アドレス更新信号
320 分岐taken+例外検出回路
321 分岐taken+例外信号
330 分岐not-taken検出回路
331 分岐not-taken信号
340 分岐実行検出回路
341 分岐実行信号
350 分岐taken検出回路
351 分岐taken信号
410 ヘッダー用固定値”0x03”出力回路
420 ヘッダー用固定値”0x04”出力回路
430 ヘッダー用固定値”0x38”出力回路
440 ヘッダー用固定値”0x39”出力回路
450 ヘッダー用固定値”0x3a”出力回路
460 ヘッダー用固定値”0x3b”出力回路
500 シーケンシャル命令実行カウンタ(Type0)
510 シーケンシャル命令実行カウンタ値保持手段(Type0)
530 シーケンシャル命令実行カウンタ(Type2,3)
540 シーケンシャル命令実行カウンタ(Type2,3)
600 分岐先アドレス保持手段
700 MDO[7:0]出力マルチプレクサ(Type0)
701 MDO[7:0]出力信号(Type0)
720 MDO[7:0]出力マルチプレクサ(Type2)
721 MDO[7:0]出力信号(Type2)
730 MDO[7:0]出力マルチプレクサ(Type3)
731 MDO[7:0]出力信号(Type3)
800 分岐フラグ用シフトレジスタ
810 分岐フラグ保持手段
820 分岐フラグカウンタ
821 分岐フラグカウンタ値
830 分岐フラグカウンタ値保持手段
900 分岐takenカウンタ
901 分岐takenカウンタ値
910 分岐takenカウンタ値保持手段
1010 トレース状態出力端子(MSEO[1:0])
1020 トレースデータ出力端子(MDO[7:0])
1011 トレース状態信号
1021 トレースデータ信号
1210 トレースメモリ制御手段
1211 トレースメモリ制御信号
1212 トレースメモリ書込みデータ
1230 トレースメモリ
1231 トレースメモリ読出しデータ
1301 トレースメモリ読出し要求
1
101 Instruction
201 MSEO [1: 0] output signal (Type0)
202 MDO [7: 0] output selection signal (Type0)
220 Trace message / packet control state machine (Type2)
221 MSEO [1: 0] output signal (Type2)
222 MDO [7: 0] output selection signal (Type2)
230 Trace message / packet control state machine (Type3)
231 MSEO [1: 0] output signal (Type3)
232 MDO [7: 0] output selection signal (Type3)
310 Branch destination address
510 Sequential instruction execution counter value holding means (Type 0)
530 Sequential instruction execution counter (
540 Sequential instruction execution counter (
600 Branch destination address holding means 700 MDO [7: 0] output multiplexer (Type 0)
701 MDO [7: 0] output signal (Type0)
720 MDO [7: 0] output multiplexer (Type2)
721 MDO [7: 0] output signal (Type2)
730 MDO [7: 0] output multiplexer (Type3)
731 MDO [7: 0] output signal (Type3)
800 Branch
1020 Trace data output terminal (MDO [7: 0])
1011
Claims (6)
条件成立した分岐命令実行の時にはインクリメントし、条件成立していない分岐命令実行の時にはクリアする分岐takenカウンタを有し、分岐takenカウント値を含む分岐takenカウントメッセージを生成し、前記分岐状態メッセージよりも、前記分岐takenカウントメッセージの方が短い符号となる場合には、前記分岐takenカウントメッセージを出力することを選択し、そうでない場合には、分岐状態メッセージを出力することを選択するトレース制御回路から構成されたことを特徴としたプロセッサ。 The CPU receives the execution signal of the branch instruction and the condition establishment signal of the conditional branch instruction obtained from the CPU, and the establishment bit when executing the branch instruction when the condition is satisfied, and the unestablishment bit when executing the branch instruction when the condition is not satisfied Is shifted into the shift register, and a branch state message is generated that summarizes all the bits accumulated in the shift register and the effective bit number information.
It has a branch take counter that is incremented when a branch instruction that satisfies the condition is executed, and that is cleared when a branch instruction that does not satisfy the condition is executed, and generates a branch take count message that includes a branch take count value. When the branch take count message has a shorter code, select to output the branch take count message; otherwise, from the trace control circuit that selects to output the branch status message. A processor characterized by being configured.
An execution history which restores an execution history using a branch memory which inputs a branch status message or a branch take count message according to claim 3, stores trace information, reads the contents of the trace memory, and uses a source program executed by the CPU. In the development support apparatus constituted by a computer having a restoration program, the execution history restoration program restores the trace information on the trace memory while sequentially corresponding to the instructions of the source program, and branches on the trace memory. When the status message is encountered, the branch instruction is made to correspond to the branch establishment / non-establishment bit. When the branch take count message on the trace memory is encountered, the branch take repetition number is translated into a branch establishment bit string, and the branch instruction Correspond to the branch establishment bit, and Expediently, branches update the history restore point branch target instruction, if not satisfied bits, development support apparatus and updates the history restore point to the next instruction of the branch instruction.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004001652A JP2005196437A (en) | 2004-01-07 | 2004-01-07 | Processor and development support system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004001652A JP2005196437A (en) | 2004-01-07 | 2004-01-07 | Processor and development support system |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2005196437A true JP2005196437A (en) | 2005-07-21 |
Family
ID=34817108
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004001652A Pending JP2005196437A (en) | 2004-01-07 | 2004-01-07 | Processor and development support system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2005196437A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007323636A (en) * | 2006-05-30 | 2007-12-13 | Arm Ltd | Reducing size of data stream produced during tracing instruction |
-
2004
- 2004-01-07 JP JP2004001652A patent/JP2005196437A/en active Pending
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007323636A (en) * | 2006-05-30 | 2007-12-13 | Arm Ltd | Reducing size of data stream produced during tracing instruction |
GB2438699B (en) * | 2006-05-30 | 2011-06-08 | Advanced Risc Mach Ltd | Reducing the size of a data stream produced during instruction tracing |
JP2012160200A (en) * | 2006-05-30 | 2012-08-23 | Arm Ltd | Reducing size of data stream produced during instruction tracing |
JP2014220003A (en) * | 2006-05-30 | 2014-11-20 | エイアールエム リミテッド | Reducing size of data stream produced during instruction tracing |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4233893B2 (en) | Instruction tracing in data processing systems. | |
JP3583937B2 (en) | Information processing equipment | |
JP2009087343A (en) | Technique for generating trace stream for data processing apparatus | |
US7673187B2 (en) | Data processing apparatus and method for reducing trace bandwidth | |
WO2001093040A1 (en) | Program counter trace system, program counter trace method, and semiconductor device | |
JP4846493B2 (en) | Debug system and debug circuit | |
CN111158756B (en) | Method and apparatus for processing information | |
JP2002304291A (en) | Device and method for storing instruction set information | |
JP2513417B2 (en) | Information processing device | |
JPH10303993A (en) | Method for transmitting and receiving asynchronous serial data of digital signal processing processor | |
US8056088B1 (en) | Using scan chains for context switching | |
JP6458626B2 (en) | Debug circuit, semiconductor device, and debugging method | |
JP2005196437A (en) | Processor and development support system | |
US20120311304A1 (en) | Processor, computer product, compression apparatus, and compression method | |
US20120110307A1 (en) | Compressed instruction processing device and compressed instruction generation device | |
JP6354489B2 (en) | Debug circuit, semiconductor device, and debugging method | |
US20060107123A1 (en) | Processor and development supporting apparatus | |
JP2878264B1 (en) | Tracer device, trace data compression method, and compressed trace data reading method | |
CN111143218B (en) | Log debugging method and device suitable for 5G embedded equipment and readable storage medium | |
US6954843B2 (en) | Data driven information processor capable of internally processing data in a constant frequency irrespective of an input frequency of a data packet from the outside | |
US20030152111A1 (en) | System for verifying operations of system LSI | |
JP2010086321A (en) | Memory control system | |
JP3636702B2 (en) | Programmable sequence control circuit | |
KR100647956B1 (en) | Method for encoding and decoding a still photographic in mobile phone | |
CN116192897A (en) | Development method and device of Internet of things component |