JPH0579646U - Microprocessor - Google Patents

Microprocessor

Info

Publication number
JPH0579646U
JPH0579646U JP1675792U JP1675792U JPH0579646U JP H0579646 U JPH0579646 U JP H0579646U JP 1675792 U JP1675792 U JP 1675792U JP 1675792 U JP1675792 U JP 1675792U JP H0579646 U JPH0579646 U JP H0579646U
Authority
JP
Japan
Prior art keywords
instruction
address
counter
trace
trace 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.)
Pending
Application number
JP1675792U
Other languages
Japanese (ja)
Inventor
弘巳 山崎
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP1675792U priority Critical patent/JPH0579646U/en
Publication of JPH0579646U publication Critical patent/JPH0579646U/en
Pending legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)
  • Debugging And Monitoring (AREA)

Abstract

(57)【要約】 【目的】 通常動作時に実行速度を落とさずに同じ動作
のままで命令アドレスをトレースできるマイクロプロセ
ッサを得る。 【構成】 最終段の命令カウンタの値を入力とするトレ
ース・メモリと、トレース・メモリの番地を指し示すカ
ウンタと、トレース・メモリ及びカウンタの出力を選択
して入力するデータ入力レジスタと、データ入力レジス
タの値を入力するレジスタ・ファイルから構成した。 【効果】 通常動作時に現時点から過去の命令アドレス
値がトレース・メモリに格納され、デバッグ時には入出
力命令によってそれらの値をレジスタ・ファイルに読み
出せるので、通常動作時の動作を変えることなしに命令
アドレスのトレースを知ることができ、デバッグが容易
になるという効果がある。
(57) [Summary] [Purpose] To obtain a microprocessor that can trace instruction addresses in the same operation without slowing down the execution speed during normal operation. [Structure] A trace memory that inputs the value of the instruction counter at the final stage, a counter that indicates the address of the trace memory, a data input register that selects and inputs the trace memory and the output of the counter, and a data input register Configured from a register file to input the value of. [Effect] Instruction address values from the current time to the past are stored in the trace memory during normal operation, and those values can be read into the register file by input / output instructions during debugging, so instructions can be used without changing the operation during normal operation. The address trace can be known, which has the effect of facilitating debugging.

Description

【考案の詳細な説明】[Detailed description of the device]

【0001】[0001]

【産業上の利用分野】[Industrial applications]

この考案は、パイプライン方式のマイクロプロセッサのデバッグ機能、特にそ の中の命令アドレス・トレース機能に関するものである。 The present invention relates to a debug function of a pipeline type microprocessor, and particularly to an instruction address trace function therein.

【0002】[0002]

【従来の技術】[Prior Art]

マイクロプロセッサを使ったシステムをデバッグする際は、命令カウンタ(以 下ICと略す)の内容すなわち次に実行すべき命令アドレスをトレースすること が有効である。しかしパイプライン方式のマイクロプロセッサでは命令実行は最 終段で完了するので次に実行すべき命令アドレスを格納しているのは最終段のI Cであり、そのため命令コードがマイクロプロセッサに取り込まれる時点で命令 アドレスを観測してもこれは実際に実行された命令アドレスのトレースとは一致 しない。そこで従来のマイクロプロセッサでは命令アドレスをトレースするため にトレース割込み機能を設けている。図3は従来のマイクロプロセッサにおいて トレース割込みの実行に関係する部分を示すブロック図であり、図において1は マイクロプロセッサ、2は主メモリ、3、4はそれぞれマイクロプロセッサ1と 主メモリ2とを接続するアドレス・バス及びデータ・バス、5は次にフェッチす る命令のアドレスを保持する初段IC、6は初段IC5の値を入力とする複数の 中間段IC、7は中間段IC6の値を入力とする最終段IC、8はデータ・バス 4の値を入力とするデータ入力レジスタ(以下DIRと呼ぶ)、9はDIR8の 値を入力とするレジスタ・ファイル、10は最終段IC7またはレジスタ・ファ イル9の値を入力としデータ・バス4を出力とするデータ出力レジスタ(以下D ORと呼ぶ)、11はアドレス生成部、12はアドレス生成部11と初段IC5 とを選択しアドレス・バス3へ出力するセレクタ、13は上記5から12までの ブロック間のデータ転送を制御する制御部であり、5から13までのブロックは すべてマイクロプロセッサ1に内蔵されている。 When debugging a system using a microprocessor, it is effective to trace the contents of an instruction counter (hereinafter abbreviated as IC), that is, the instruction address to be executed next. However, in a pipeline-type microprocessor, instruction execution is completed at the final stage, so that the instruction address to be executed next is stored in the final stage IC, so that when the instruction code is fetched into the microprocessor. Even if the instruction address is observed at, this does not match the trace of the actually executed instruction address. Therefore, the conventional microprocessor has a trace interrupt function to trace the instruction address. FIG. 3 is a block diagram showing a portion related to execution of a trace interrupt in a conventional microprocessor. In the figure, 1 is a microprocessor, 2 is a main memory, 3 and 4 are a microprocessor 1 and a main memory 2, respectively. Address bus and data bus, 5 is a first-stage IC that holds the address of the instruction to be fetched next, 6 is a plurality of intermediate-stage ICs that receive the value of the first-stage IC 5, and 7 is the value of the intermediate-stage IC 6. Is a final stage IC, 8 is a data input register (hereinafter referred to as DIR) which receives the value of the data bus 4, 9 is a register file which receives the value of DIR8, 10 is the final stage IC7 or register file Data output register (hereinafter referred to as DOR) that receives the value of file 9 as an input and outputs data bus 4 as an output, 11 is an address generator, and 12 is an adder A selector for selecting the memory generating unit 11 and the first-stage IC 5 and outputting it to the address bus 3, and a control unit 13 for controlling the data transfer between the blocks 5 to 12 described above. It is built in the processor 1.

【0003】 次にこの従来例の動作を説明する。通常動作時は初段IC5が次にフェッチす る命令のアドレスをアドレス・バス3から出力し、命令が主メモリ2からマイク ロプロセッサ1にフェッチされる。命令がパイプラインの各段で処理されるのに 伴いその命令に対応する命令アドレスも初段IC5から中間段IC6を経由して 転送され、実際に命令の実行される時点では最終段IC7に入力される。命令実 行が完了するごとに最終段IC7の内容は次命令アドレスに更新されてゆく。な お命令以外のアドレスはアドレス生成部11で生成されセレクタ12で選択され て出力される。一方デバッグ時は、命令ごとに割込みが入るように制御回路13 を設定しておく。この場合、1つの命令が最終段で完了すると割込み処理として 制御回路13は最終段IC7の値をDOR10とデータ・バス4を経由して主メ モリ2の特定アドレスに格納する。割込み処理後、最終段IC7が示していた次 命令アドレスに分岐するようにプログラムしておけば、マイクロプロセッサ1は 次命令をパイプラインの最初の処理から実行する。結果として主メモリ2に、実 行した命令アドレスが格納されトレースを知ることができる。Next, the operation of this conventional example will be described. During normal operation, the first-stage IC 5 outputs the address of the instruction to be fetched next from the address bus 3, and the instruction is fetched from the main memory 2 to the microprocessor 1. As the instruction is processed in each stage of the pipeline, the instruction address corresponding to the instruction is also transferred from the first-stage IC5 through the intermediate-stage IC6, and is input to the last-stage IC7 when the instruction is actually executed. It Each time the instruction execution is completed, the contents of the final stage IC 7 are updated to the next instruction address. Addresses other than these instructions are generated by the address generator 11, selected by the selector 12, and output. On the other hand, at the time of debugging, the control circuit 13 is set so that an interrupt occurs for each instruction. In this case, when one instruction is completed at the final stage, the control circuit 13 stores the value of the final stage IC 7 at a specific address of the main memory 2 via the DOR 10 and the data bus 4 as an interrupt process. After the interrupt processing, the microprocessor 1 executes the next instruction from the first processing of the pipeline by programming so as to branch to the next instruction address indicated by the final stage IC7. As a result, the executed instruction address is stored in the main memory 2 and the trace can be known.

【0004】[0004]

【考案が解決しようとする課題】[Problems to be solved by the device]

以上のように従来のマイクロプロセッサにおいては命令アドレスをトレースし て知るためには、一命令ごとに割込みを発生させて割込み処理により最終段IC の内容をメモリに格納し、次命令の処理ははじめからやり直すので、通常動作時 の実行速度より大幅に遅くなる。特にリアルタイム処理の場合は通常動作時と同 じ量の処理ができなくなり不都合である。またマイクロプロセッサ内部の動作も デバッグ時と通常動作時とで異なるのでマイクロプロセッサ自身のデバッグをす る場合にも不都合である、という課題があった。 As described above, in the conventional microprocessor, in order to trace and know the instruction address, an interrupt is generated for each instruction, the contents of the final stage IC are stored in the memory by the interrupt processing, and the processing of the next instruction is started. Since it starts again from the beginning, it will be significantly slower than the execution speed during normal operation. Especially in the case of real-time processing, the same amount of processing as in normal operation cannot be performed, which is inconvenient. In addition, the internal operation of the microprocessor differs between during debugging and during normal operation, which is also inconvenient when debugging the microprocessor itself.

【0005】 この考案は上記のような課題を解消するためになされたもので、通常動作時に 実行速度を落とさずに同じ動作のままで命令アドレスをトレースできるマイクロ プロセッサを得ることを目的とする。The present invention has been made to solve the above problems, and an object thereof is to obtain a microprocessor capable of tracing an instruction address in the same operation without reducing the execution speed during normal operation.

【0006】[0006]

【課題を解決するための手段】[Means for Solving the Problems]

この考案のマイクロプロセッサは、最終段ICの値を入力とするトレース・メ モリとトレース・メモリの番地を示すカウンタと、トレース・メモリ及びカウン タの出力を選択してデータ入力レジスタに出力するセレクタと、データ入力レジ スタの値を入力とするレジスタ・ファイルとを設けたものである。 The microprocessor of the present invention comprises a counter indicating the address of the trace memory and the trace memory which receives the value of the final stage IC, and a selector which selects the output of the trace memory and the counter and outputs it to the data input register. And a register file for inputting the value of the data input register.

【0007】 また、この考案の別の実施例によるマイクロプロセッサは、最終段ICの値を 入力とするトレース・メモリとトレース・メモリの番地を示すカウンタと、トレ ース・メモリの出力を選択してデータ入力レジスタに出力するセレクタと、デー タ入力レジスタの値を入力とするレジスタ・ファイルとを設けたものである。Further, a microprocessor according to another embodiment of the present invention selects a trace memory which receives the value of the final stage IC, a counter which indicates the address of the trace memory, and an output of the trace memory. A selector that outputs the data to the data input register and a register file that inputs the value of the data input register are provided.

【0008】[0008]

【作用】[Action]

この考案のマイクロプロセッサは、通常動作時は命令実行ごとに最終段IC中 の命令アドレスをカウンタの示す番地へトレース・メモリに格納していき、デバ ッグ時には、まず入出力命令でカウンタの値をデータ入力レジスタを経由してレ ジスタ・ファイルに読み出し、この値を使った入出力命令で、カウンタの示す番 地からさかのぼって命令アドレスを、トレース・メモリからデータ入力レジスタ を経由してレジスタ・ファイルに読み出せるので、過去の命令アドレスを知るこ とができる。 During normal operation, the microprocessor of the present invention stores the instruction address in the final stage IC in the trace memory at the address indicated by the counter at every instruction execution, and at the time of debugging, first, the counter value is input / output instruction. To the register file via the data input register, and with this input / output instruction, the instruction address can be traced back from the address indicated by the counter, and the register address can be registered from the trace memory via the data input register. Since it can be read to a file, it is possible to know past instruction addresses.

【0009】 また、この考案の別の実施例によるマイクロプロセッサは、通常動作時は命令 実行ごとに最終段IC中の命令アドレスをカウンタの示す番地へトレース・メモ リに格納していき、デバッグ時には、まず入出力命令でカウンタの値をカウント ・ダウンするとともにカウンタの示す番地の命令アドレスを、トレース・メモリ からデータ入力レジスタを経由してレジスタ・ファイルに読み出せるので、過去 の命令アドレスを知ることができる。In addition, the microprocessor according to another embodiment of the present invention stores the instruction address in the final stage IC in the trace memory at the address indicated by the counter every time the instruction is executed at the time of normal operation, and at the time of debugging. , First, count down the counter value with an input / output instruction, and read the instruction address at the address indicated by the counter from the trace memory to the register file via the data input register. Know the past instruction address. You can

【0010】[0010]

【実施例】【Example】

実施例1. 図1はこの考案の一実施例を示すブロック図であり、1〜13は上記従来例と 同一または相当部分であり、14はカウンタ、15は最終段IC7の値をデータ 入力とするトレース・メモリ、16はデータ・バス4とカウンタ14とトレース ・メモリ5との出力を選択してDIR8に出力するセレクタ、17はカウンタ1 4とアドレス生成部11との出力を選択してトレース・メモリ15へ番地を出力 するセレクタである。 Example 1. FIG. 1 is a block diagram showing an embodiment of the present invention. Reference numerals 1 to 13 are the same as or equivalent to the above-mentioned conventional example, 14 is a counter, and 15 is a trace memory in which the value of the final stage IC 7 is input as data. , 16 is a selector for selecting the output of the data bus 4, the counter 14 and the trace memory 5 and outputting the same to the DIR 8, and 17 is the selector for selecting the output of the counter 14 and the address generating unit 11 to the trace memory 15. It is a selector that outputs the address.

【0011】 次に実施例の動作を説明する。通常動作時は従来例と同様に命令アドレスが初 段IC5から最終段IC7まで転送されてくる。最終段で命令実行が終了すると 最終段IC7の値はカウンタ14の示す番地のトレース・メモリ15へ格納され カウンタ14は1だけカウント・アップされる。入れ替わりに次の命令アドレス が最終段IC7に入る。この動作を繰り返してトレース・メモリ15がいっぱい になった場合は、カウンタ14の値は0にもどり以前に格納した番地に上書きし ていく。一方デバッグ時には、トレース・メモリ15への格納を禁止するように 制御部13を設定しておき、入出力命令を使ったプログラムによってトレース・ メモリ15の内容をレジスタ・ファイル9に読み出すことにより命令アドレスの トレースを知る。具体的には、まずカウンタ14に対する入出力命令を実行し、 カウンタ14の値(以下この値をAとする)をセレクタ16、DIR8をを経由 してレジスタ・ファイル9に入力する。次に減算命令で(A−1)をレジスタ・ ファイル9に格納してから、この値を用いてトレース・メモリ15に対する入出 力命令を実行すると、この入出力命令に従ってアドレス生成部11が生成した値 (A−1)がセレクタ17で選択されトレース・メモリ15に入力され、(A− 1)番地の命令アドレスすなわち最後に実行した命令アドレスがセレクタ16、 DIR8を経由してレジスタ・ファイル9に読み出される。さらに(A−2)以 前の番地を同じ手順でトレース・メモリ15からレジスタ・ファイル9に読み出 すことをくりかえせば、トレース・メモリ15に格納されていた分だけのトレー ス結果を知ることができる。Next, the operation of the embodiment will be described. In the normal operation, the instruction address is transferred from the first stage IC5 to the last stage IC7 as in the conventional example. When the instruction execution at the final stage is completed, the value of the final stage IC 7 is stored in the trace memory 15 at the address indicated by the counter 14, and the counter 14 is incremented by 1. Instead, the next instruction address enters the final stage IC7. When the trace memory 15 becomes full by repeating this operation, the value of the counter 14 returns to 0 and the previously stored address is overwritten. On the other hand, at the time of debugging, the control unit 13 is set so as to prohibit the storage in the trace memory 15, and the contents of the trace memory 15 are read out to the register file 9 by the program using the input / output instruction. Get to know the trace. Specifically, first, an input / output instruction for the counter 14 is executed, and the value of the counter 14 (hereinafter, this value is referred to as A) is input to the register file 9 via the selector 16 and the DIR 8. Next, when (A-1) is stored in the register file 9 by the subtraction instruction, and the input / output instruction to / from the trace memory 15 is executed using this value, the address generator 11 generates it according to this input / output instruction. The value (A-1) is selected by the selector 17 and input to the trace memory 15, and the instruction address at the address (A-1), that is, the last executed instruction address is stored in the register file 9 via the selector 16 and the DIR 8. Read out. Further, by repeating the steps from (A-2) to read the address from the trace memory 15 to the register file 9 in the same procedure, it is possible to know the trace result only for the amount stored in the trace memory 15. You can

【0012】 実施例2. 図2は他の実施例を示すブロック図であり、1〜13は上記従来例と同一又は 相当部分であり、14〜16は実施例1と同一部分である。Example 2. FIG. 2 is a block diagram showing another embodiment, in which 1 to 13 are the same or corresponding parts as those in the conventional example, and 14 to 16 are the same parts as in the first embodiment.

【0013】 この図2に示す実施例2では、まず通常動作時は実施例1と同様に動作する。 トレース・メモリ15に格納された過去の命令アドレスを知るためには、特定の 入出力命令を実行することにより、カウンタ14を1だけカウント・ダウンする と共に、トレース・メモリ15からその値の番地の命令アドレスすなわち最後に 実行した命令アドレスがセレクタ16、DIR8を経由してレジスタ・ファイル 9に読み出される。さらにこの入出力命令実行を繰り返せば過去のアドレス値が トレース・メモリ15からレジスタ・ファイル9に順次読み出される。In the second embodiment shown in FIG. 2, first, during normal operation, the same operation as in the first embodiment is performed. In order to know the past instruction address stored in the trace memory 15, the counter 14 is counted down by 1 by executing a specific input / output instruction, and at the same time, the address of the value is read from the trace memory 15. The instruction address, that is, the last executed instruction address is read out to the register file 9 via the selector 16 and the DIR 8. If this input / output instruction execution is further repeated, past address values are sequentially read from the trace memory 15 to the register file 9.

【0014】[0014]

【考案の効果】[Effect of the device]

以上のように、この考案のマイクロプロセッサは通常動作時に実行した命令ア ドレスをトレース・メモリに格納し、デバッグ時にはカウンタの値とトレース・ メモリの任意の番地の内容を読み出せるように構成したので、通常動作時の命令 アドレスのトレースが速度を落とさずに求められるという効果がある。 As described above, the microprocessor of the present invention is configured to store the instruction address executed during normal operation in the trace memory and read the counter value and the contents of any address in the trace memory during debugging. The effect is that the instruction address trace during normal operation can be obtained without slowing down.

【0015】 また、この考案の別の実施例は、トレース・メモリの内容を順番に過去にさか のぼってしか読み出すことができないが、同様の効果がひとつの入出力命令で得 られる。Further, according to another embodiment of the present invention, the contents of the trace memory can be sequentially read only backward, but the same effect can be obtained by one input / output instruction.

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

【図1】この考案の実施例1を示すブロック図である。FIG. 1 is a block diagram showing a first embodiment of the present invention.

【図2】この考案の実施例2を示すブロック図である。FIG. 2 is a block diagram showing a second embodiment of the present invention.

【図3】従来例を示すブロック図である。FIG. 3 is a block diagram showing a conventional example.

【符号の説明】 1 マイクロプロセッサ 2 主メモリ 3 アドレス・バス 4 データ・バス 5 初段IC 6 中間段IC 7 最終段IC 8 データ入力レジスタ 9 レジスタ・ファイル 10 データ出力レジスタ 11 アドレス生成部 12 セレクタ 13 制御部 14 カウンタ 15 トレース・メモリ 16 セレクタ 17 セレクタ[Explanation of Codes] 1 Microprocessor 2 Main Memory 3 Address Bus 4 Data Bus 5 First Stage IC 6 Intermediate Stage IC 7 Last Stage IC 8 Data Input Register 9 Register File 10 Data Output Register 11 Address Generation Unit 12 Selector 13 Control Part 14 Counter 15 Trace memory 16 Selector 17 Selector

Claims (1)

【実用新案登録請求の範囲】[Scope of utility model registration request] 【請求項1】 パイプライン方式のマイクロプロセッサ
において、次命令のアドレスを計算する初段命令カウン
タと、この命令アドレスを転送するパイプライン各段ご
との中間段命令ウンタと、中間段レジスタを経由して転
送されてきた命令アドレスを入力とする最終段命令カウ
ンタと、最終段命令カウンタの出力を入力するトレース
・メモリとトレース・メモリの番地を示すカウンタと、
データ入力レジスタと、上記トレース・メモリの出力と
カウンタの出力と外部からのデータ入力とを選択しデー
タ入力レジスタに出力するセレクタと、データ入力レジ
スタの出力を入力とするレジスタ・ファイルとを備えた
ことを特徴とするマイクロプロセッサ。
1. In a pipeline type microprocessor, an initial stage instruction counter for calculating an address of a next instruction, an intermediate stage instruction counter for transferring each instruction address of the pipeline, and an intermediate stage register are used. A final stage instruction counter that inputs the transferred instruction address, a trace memory that inputs the output of the final stage instruction counter, and a counter that indicates the address of the trace memory,
It has a data input register, a selector for selecting the output of the trace memory, the output of the counter and the data input from the outside and outputting to the data input register, and a register file having the output of the data input register as the input. A microprocessor characterized in that.
JP1675792U 1992-03-27 1992-03-27 Microprocessor Pending JPH0579646U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1675792U JPH0579646U (en) 1992-03-27 1992-03-27 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1675792U JPH0579646U (en) 1992-03-27 1992-03-27 Microprocessor

Publications (1)

Publication Number Publication Date
JPH0579646U true JPH0579646U (en) 1993-10-29

Family

ID=11925112

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1675792U Pending JPH0579646U (en) 1992-03-27 1992-03-27 Microprocessor

Country Status (1)

Country Link
JP (1) JPH0579646U (en)

Similar Documents

Publication Publication Date Title
EP0516161A2 (en) Fuzzy rule-based system formed in a chip
US5390306A (en) Pipeline processing system and microprocessor using the system
JPH0579646U (en) Microprocessor
JP2752076B2 (en) Programmable controller
JPH0528431B2 (en)
JPH0650512B2 (en) Data processing device
JPH10240522A (en) Arithmetic unit
EP0969370A2 (en) Computer system having a cache memory and a tracing function
JPH06309349A (en) Program-controlled processor
JPH0831033B2 (en) Data processing device
JP3542358B2 (en) operating system
JPS6398704A (en) Programmable controller
JPH082727Y2 (en) Programmable sequencer
JP3693873B2 (en) Mask bit number arithmetic unit, vector processing unit, information processing unit
JP2003076547A (en) System and method for automatically generating control software
JPH0460719A (en) Electronic computer
JP2989830B2 (en) Vector processing method
JP2000242524A (en) Software simulator for processor
JPH03252820A (en) Optimum object generating/processing system
JPH04232506A (en) Robot controller
JPS60230245A (en) Microprocessor
JPS58205256A (en) Data processor
JPS62212743A (en) Memory dump system
JPS603656B2 (en) Computer memory expansion method
JPH0221331A (en) Program control system for microcomputer