JPH11306044A - Data processor - Google Patents

Data processor

Info

Publication number
JPH11306044A
JPH11306044A JP10112125A JP11212598A JPH11306044A JP H11306044 A JPH11306044 A JP H11306044A JP 10112125 A JP10112125 A JP 10112125A JP 11212598 A JP11212598 A JP 11212598A JP H11306044 A JPH11306044 A JP H11306044A
Authority
JP
Japan
Prior art keywords
branch
trace data
register
instruction
data
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.)
Withdrawn
Application number
JP10112125A
Other languages
Japanese (ja)
Inventor
Norishige Sakamoto
憲成 阪本
Kenichi Nitta
健一 新田
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP10112125A priority Critical patent/JPH11306044A/en
Publication of JPH11306044A publication Critical patent/JPH11306044A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To expand a range in which PC trace is possible for the number of PC trace register means. SOLUTION: A data processor includes trace data registers 33a to 33d which successively store branching trace data that specify a branching origin and a branched party when a branching occurs to the instruction execution of a CPU 2, repeat number of times registers 34a to 34d, and control means 30, 31 and 32. The control means 30 to 32 have the repeat number of times registers corresponding to the branching trace data of the previous branching update the number of times data when the branching equal to the previous one occurs and obtains the trace data for another trace data register and initializes the corresponding repeat number of times register when a branching different from the previous one occurs. Even if the same branching is repeated by a repeat instruction or the like, the same trace data are blocked so that they are not stored in new trace data registers 33a to 33d.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、CPU(中央処理
装置)による命令実行順序が変化される分岐が発生した
とき分岐元及び分岐先の命令アドレスを取得するための
分岐トレースデータを保持することができる、所謂PC
トレース機能を有するデータプロセッサに関し、例え
ば、リピート命令をサポートするマイクロコンピュータ
に適用して有効な技術に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to holding branch trace data for obtaining instruction addresses of a branch source and a branch destination when a branch whose instruction execution order is changed by a CPU (Central Processing Unit) occurs. So-called PC
The present invention relates to a data processor having a trace function, for example, to a technique effective when applied to a microcomputer that supports a repeat instruction.

【0002】[0002]

【従来の技術】マイクロコンピュータには、オンボード
でユーザデバッグ機能をサポートするためのPCトレー
ス機能を有するものがある。CPUによる命令実行順序
が変化されることになる分岐は、分岐命令、割込み、例
外処理、リピート命令などによって生ずる。PCトレー
ス機能は、前記分岐が発生したとき分岐元及び分岐先の
命令アドレスを取得するための分岐トレースデータをP
Cトレース用レジスタに保持させる、デバッグサポート
機能とされる。このPCトレースレジスタは、複数組備
えられており、分岐が発生する度に、順次格納先レジス
タが変化されていく。
2. Description of the Related Art Some microcomputers have a PC trace function for supporting a user debug function on-board. A branch whose instruction execution order is changed by the CPU is caused by a branch instruction, an interrupt, an exception process, a repeat instruction, or the like. When the branch occurs, the PC trace function stores the branch trace data for acquiring the instruction addresses of the branch source and the branch destination in the PC.
This is a debug support function to be held in the C trace register. A plurality of sets of the PC trace registers are provided, and each time a branch occurs, the storage destination register is sequentially changed.

【0003】尚、PCトレース機能について記載された
文献の例としては、日立SH7410ハードウェアマニ
ュアル第2版(平成9年11月発行)第186頁〜第1
88頁並びに第195頁〜第196頁がある。
As an example of a document describing the PC trace function, see the Hitachi SH7410 Hardware Manual, 2nd edition (November 1997), pages 186 to 1
Pages 88 and 195-196.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、従来技
術のPCトレース機能では、同じ分岐が何回も繰り返さ
れる場合であっても、毎回同じ分岐トレースデータを保
持していくため、記憶容量に限りの有るPCトレースレ
ジスタを無駄に費やすことになり、広範囲にPCトレー
スを行なうことができない。
However, the conventional PC trace function retains the same branch trace data every time even if the same branch is repeated many times, so that the storage capacity is limited. A certain PC trace register is wasted and a wide range of PC trace cannot be performed.

【0005】本発明の目的は、レジスタ手段の数が限ら
れていても広範囲にPCトレースを行なうことができる
データプロセッサを提供することにある。
An object of the present invention is to provide a data processor capable of performing PC tracing over a wide range even when the number of register means is limited.

【0006】本発明の前記並びにその他の目的と新規な
特徴は本明細書の記述及び添付図面から明らかになるで
あろう。
The above and other objects and novel features of the present invention will become apparent from the description of the present specification and the accompanying drawings.

【0007】[0007]

【課題を解決するための手段】本願において開示される
発明のうち代表的なものの概要を簡単に説明すれば下記
の通りである。
The following is a brief description of an outline of a typical invention among the inventions disclosed in the present application.

【0008】すなわち、データプロセッサは、CPU
(2)と、CPUによる命令実行順序が変化される分岐
が発生したとき分岐元及び分岐先の命令アドレスを特定
するための分岐トレースデータを順次格納する複数個の
トレースデータレジスタ(33a〜33d)と、前記夫
々のトレースデータレジスタに設けられたリピート回数
レジスタ(34a〜34d)と、前記複数個のトレース
データレジスタに対する分岐トレースデータの格納を制
御すると共に、前記リピート回数レジスタに対する回数
データの格納を制御する制御手段(30,31,32,
30a,30b)とを含む。前記制御手段の機能を包括
的に説明すれば、分岐の発生を検出したとき、その分岐
が前回の分岐と等しいときは対応する分岐トレースデー
タを既に有するトレースデータレジスタのリピート回数
レジスタ上で回数データを更新し、その分岐が前回の分
岐と異なるときは別のトレースデータレジスタに今回の
分岐トレースデータを取得すると共に対応するリピート
回数レジスタを初期化するものである。
That is, the data processor is a CPU
And (2) a plurality of trace data registers (33a to 33d) for sequentially storing branch trace data for specifying a branch source address and a branch destination instruction address when a branch whose instruction execution order is changed by the CPU occurs. And a repeat count register (34a to 34d) provided in each of the trace data registers; and controlling storage of branch trace data in the plurality of trace data registers and storing count data in the repeat count register. Control means (30, 31, 32,
30a, 30b). To explain the function of the control means comprehensively, when the occurrence of a branch is detected and the branch is equal to the previous branch, the count data is stored in the repeat count register of the trace data register already having the corresponding branch trace data. Is updated, and when the branch is different from the previous branch, the current branch trace data is acquired in another trace data register, and the corresponding repeat number register is initialized.

【0009】上記により、リピート命令やループによっ
て同じ分岐が何回も繰り返される場合であっても、毎回
同じトレースデータが新たなトレースデータレジスタに
格納される事態を阻止することができる。したがって、
記憶容量に限りの有るPCトレース用のトレースデータ
レジスタを無駄に費やすことがない。したがって、広範
囲にPCトレースを行なうことが可能になる。
As described above, even when the same branch is repeated many times by a repeat instruction or a loop, it is possible to prevent the same trace data from being stored in a new trace data register every time. Therefore,
The trace data register for the PC trace having a limited storage capacity is not wasted. Therefore, it is possible to perform PC trace over a wide range.

【0010】第1の具体的な態様による前記制御手段
(30,31,32)は、新たに分岐が生じたときの分
岐トレースデータがレジスタ手段(33a〜33d、3
4a〜34d)に既に格納されている分岐トレースデー
タに等しいときは、新たな分岐トレースデータの取得に
代えて、一致に係る分岐の回数を対応するレジスタ手段
に格納し、新たに分岐が生じたときの分岐トレースデー
タが前記レジスタ手段に既に格納されている分岐トレー
スデータと不一致のときは、レジスタ手段を変えて新た
な分岐トレースデータを取得する。
The control means (30, 31, 32) according to the first specific mode stores the branch trace data when a new branch occurs in the register means (33a-33d, 3).
4a to 34d), when the value is equal to the branch trace data already stored, the number of branches relating to the match is stored in the corresponding register means instead of acquiring new branch trace data, and a new branch is generated. If the branch trace data at that time does not match the branch trace data already stored in the register means, the register means is changed to acquire new branch trace data.

【0011】第2の具体的な態様による前記制御手段
(30a,32)は、新たに分岐が生じたときその分岐
がリピート命令の実行による繰返しであるときは、新た
な分岐トレースデータの取得に代えて、そのリピート命
令に係る分岐の回数を対応するレジスタ手段に格納し、
新たに分岐が生じたときその分岐がリピート命令の実行
による繰返しでないときは、レジスタ手段を変えて新た
な分岐トレースデータを取得する。第2の具体的な態様
は、リピート命令に対してだけ新たなトレースデータ入
力を抑止する点で、その回路及び機能は第1の具体的な
態様に比べて簡素化されている。
The control means (30a, 32) according to the second specific mode is adapted to acquire new branch trace data when a new branch is taken and the branch is repeated by execution of a repeat instruction. Instead, the number of branches related to the repeat instruction is stored in the corresponding register means,
If a new branch occurs and the branch is not a repetition by execution of a repeat instruction, the register means is changed to acquire new branch trace data. The second specific mode is that the circuit and function thereof are simplified as compared with the first specific mode in that new trace data input is suppressed only for a repeat instruction.

【0012】第3の具体的な態様による前記制御手段
(30b,32)は、第2の具体的な態様に対して更
に、リピート命令の途中で割込みに基づく分岐が発生し
たときレジスタ手段を変えて新たな分岐トレースデータ
を取得する処理を抑止する。これによれば、リピート命
令の途中で割込みが発生しても、その割り込みによる分
岐ではトレースデータの保持を行なわない。処理若しく
はプログラムが正常であれば、割込み処理を終了する
と、CPUの処理は割り込み発生時点の処理に復帰され
るので、リピート命令途中の割り込みを無視すれば、P
Cトレースの範囲を更に広げることも可能になる、とい
う点でPCトレースの融通性が増す。
[0012] The control means (30b, 32) according to the third specific mode further changes the register means when a branch based on an interrupt occurs in the middle of a repeat instruction. To suppress the process of acquiring new branch trace data. According to this, even if an interrupt occurs in the middle of a repeat instruction, trace data is not held in a branch caused by the interrupt. If the processing or the program is normal, when the interrupt processing is completed, the processing of the CPU is returned to the processing at the time of occurrence of the interrupt.
The flexibility of the PC trace is increased in that the range of the C trace can be further expanded.

【0013】[0013]

【発明の実施の形態】図6には本発明に係るデータプロ
セッサの一例であるマイクロコンピュータのブロック図
が示される。同図に示されるマイクロコンピュータ1
は、例えば公知の半導体集積回路製造技術によって単結
晶シリコンのような1個の半導体基板(半導体チップ)
に形成される。このマイクロコンピュータ1は、特に制
限されないが、内部バスI−Bus及びペリフェラルバ
スP−Busを有する。それらバスはデータ、アドレ
ス、制御信号の各信号線群を備えている。
FIG. 6 is a block diagram showing a microcomputer as an example of a data processor according to the present invention. Microcomputer 1 shown in FIG.
Is a single semiconductor substrate (semiconductor chip) made of, for example, single crystal silicon by a known semiconductor integrated circuit manufacturing technique.
Formed. Although not particularly limited, the microcomputer 1 has an internal bus I-Bus and a peripheral bus P-Bus. These buses are provided with data, address, and control signal lines.

【0014】内部バスI−Busには中央処理装置(C
PU)2、ユーザブレークコントローラ(UBC)4、
Xメモリ5、及びYメモリ6、バスステートコントロー
ラ(BSC)7が結合されている。バスステートコント
ローラ(BSC)7はペリフェラルバスP−Busに接
続される。ペリフェラルバスP−Busには、特に制限
されないが、割込みコントローラ(INTC)10、ダ
イレクトメモリアクセスコントローラ(DMAC)1
1、フリーランニングタイマ(FRT)12、シリアル
コミュニケーションインタフェース(SCI)13、シ
リアルインタフェース(SIO)14、ユーザデバッグ
インタフェース15、及びシステムコントローラ16が
結合されている。図6において17,18で示されるも
のは入出力ポート回路である。入出力ポート回路17は
外部アドレスバス、データバス及びコントロールバスと
インタフェースされる。入出力ポート回路18は周辺回
路のための外部インタフェース回路とされる。
A central processing unit (C) is connected to the internal bus I-Bus.
PU) 2, user break controller (UBC) 4,
An X memory 5, a Y memory 6, and a bus state controller (BSC) 7 are connected. The bus state controller (BSC) 7 is connected to the peripheral bus P-Bus. Although not particularly limited, the peripheral bus P-Bus includes an interrupt controller (INTC) 10 and a direct memory access controller (DMAC) 1
1, a free running timer (FRT) 12, a serial communication interface (SCI) 13, a serial interface (SIO) 14, a user debug interface 15, and a system controller 16 are connected. In FIG. 6, reference numerals 17 and 18 denote input / output port circuits. The input / output port circuit 17 is interfaced with an external address bus, data bus and control bus. The input / output port circuit 18 is an external interface circuit for peripheral circuits.

【0015】前記CPU2は、特に制限されないが、算
術論理演算器などを有する整数ユニット20と共に積和
演算器などを有するDSPユニット21を備える。DS
Pユニット21にはDSPレジスタ22が割り当てら
れ、整数ユニット20には汎用レジスタ23が割り当て
られる。その他にCPU2には制御レジスタ24が設け
られている。CPU2における命令フェッチ及び命令デ
コードなどの命令制御は命令制御部25が行なう。ま
た、演算に必要なデータフェッチは命令制御部から出力
される制御信号に基づいてデータ制御部26が行なう。
CPU2は図示を省略する外部メモリなどから命令をフ
ェッチし、その命令を命令制御部25の命令デコーダに
て解読することにより、整数ユニット20やDSPユニ
ット21を用いて当該命令に応じたデータ処理を行う。
The CPU 2 includes, but is not limited to, an integer unit 20 having an arithmetic and logic unit and a DSP unit 21 having a product-sum operation unit and the like. DS
The P unit 21 is assigned a DSP register 22, and the integer unit 20 is assigned a general-purpose register 23. In addition, a control register 24 is provided in the CPU 2. Instruction control such as instruction fetch and instruction decode in the CPU 2 is performed by the instruction control unit 25. The data fetch necessary for the operation is performed by the data control unit 26 based on a control signal output from the instruction control unit.
The CPU 2 fetches an instruction from an external memory or the like (not shown) and decodes the instruction with an instruction decoder of the instruction control unit 25, thereby performing data processing corresponding to the instruction using the integer unit 20 and the DSP unit 21. Do.

【0016】前記DSPユニット21による積和演算を
考慮して、前記Xメモリ5及びYメモリ6はそれ専用の
バスX−Bus,Y−Busを介してCPU2に接続す
るデータパスを有している。
In consideration of the product-sum operation by the DSP unit 21, the X memory 5 and the Y memory 6 have a data path connected to the CPU 2 via dedicated buses X-Bus and Y-Bus. .

【0017】前記バスステートコントローラ7は、CP
U2やDMAC11によるアクセス対象回路(アクセス
対象とされるアドレスエリア)に応じて、アクセスデー
タサイズ、アクセスタイム、ウェイトステートの挿入制
御などを行なって、バスサイクルを制御する。
The bus state controller 7 has a CP
The bus cycle is controlled by controlling the access data size, the access time, the insertion of the wait state, and the like in accordance with the circuit to be accessed by U2 and DMAC 11 (address area to be accessed).

【0018】上記マイクロコンピュータ1はシステムコ
ントローラ16から出力されるクロック信号に同期動作
される。マイクロコンピュータ1の内外からの割込み要
求や例外処理要求に対するマスク処理や調停は割込みコ
ントローラ10が行なう。
The microcomputer 1 is operated in synchronization with a clock signal output from a system controller 16. The interrupt controller 10 performs mask processing and arbitration for interrupt requests and exception processing requests from inside and outside the microcomputer 1.

【0019】マイクロコンピュータ1は、評価専用のマ
イクロコンピュータではなく、所謂実チップであるが、
ユーザブレークコントローラ4、ユーザデバッグインタ
フェース15によって、ある程度のデバッグ機能を実現
している。
The microcomputer 1 is not a microcomputer dedicated to evaluation but a so-called real chip.
The user break controller 4 and the user debug interface 15 realize a certain debugging function.

【0020】前記ユーザブレークコントローラ4は、命
令アドレスなどのブレーク条件が設定され、設定された
ブレーク条件の成立を監視し、成立を検出したとき、C
PU2によるユーザプログラムの実行を停止される。ユ
ーザプログラムの実行停止はブレーク割り込みなどを用
いる。ブレーク条件の設定は、特に制限されないが、前
記入出力ポート回路17,18よりBSC7、DMAC
11を介して行なわれる。
The user break controller 4 sets a break condition such as an instruction address and monitors whether the set break condition is satisfied.
Execution of the user program by PU2 is stopped. To stop the execution of the user program, a break interrupt or the like is used. The setting of the break condition is not particularly limited, but the BSC 7 and DMAC
11 is performed.

【0021】更にユーザブレークコントローラ4は、C
PU2による分岐命令実行や割込み発生によりCPU2
の実行命令に分岐が発生したとき、これを検出し、分岐
先アドレスと分岐元アドレスを特定できるデータ(分岐
トレースデータ)を生成して外部に出力可能にする、P
Cトレース機能を有する。分岐トレースデータの出力は
前記入出力ポート回路17,18よりBSC7、DMA
C11を利用して行なわれる。
Furthermore, the user break controller 4
Execution of a branch instruction by PU2 or occurrence of an interrupt
When a branch is generated in the execution instruction of, this is detected, and data (branch trace data) that can specify a branch destination address and a branch source address is generated and output to the outside.
It has a C trace function. The output of the branch trace data is transmitted from the input / output port circuits 17 and 18 to BSC7 and DMA.
This is performed using C11.

【0022】図1には前記PCトレース機能を実現する
ためのPCトレース回路の第1の例が示される。同図に
おいてPCトレース回路は、シフト制御回路30、コン
パレータ31、インクリメンタ32、トレースデータレ
ジスタ33a〜33d、及びリピート回数レジスタ34
a〜34dによって構成される。
FIG. 1 shows a first example of a PC trace circuit for realizing the PC trace function. In the figure, the PC trace circuit includes a shift control circuit 30, a comparator 31, an incrementer 32, trace data registers 33a to 33d, and a repeat number register 34.
a to 34d.

【0023】CPU2による命令実行順序が変化される
ことになる分岐は、分岐命令、割込み、例外処理、リピ
ート命令などによって生ずる。リピート命令は、オペラ
ンドとして、命令スタートアドレス、命令エンドアドレ
ス、及び繰返し回数を有する。リピート命令が実行され
ると、実行命令を命令スタートアドレスに分岐して命令
エンドアドレスまで命令を実行する処理を、前記繰返し
回数だけ繰り返す。このようなリピート命令はディジタ
ル信号処理で多用される積和演算処理の繰返しを効率化
できる。前記命令制御部25は前記分岐が発生したとき
分岐信号35をアサートする。即ち、分岐命令において
は分岐先命令アドレスが出力され或いは分岐先命令がフ
ェッチされるとき、割込みの場合には割込みによって指
示される処理ルーチンの先頭命令アドレスが出力され或
いは当該先頭命令がフェッチされるとき、また、リピー
ト命令の場合には前記命令スタートアドレスが出力され
或いは当該スタート命令がフェッチされるとき、分岐信
号35がアサートされる。
A branch whose instruction execution order is changed by the CPU 2 is caused by a branch instruction, an interrupt, an exception process, a repeat instruction, or the like. The repeat instruction has, as operands, an instruction start address, an instruction end address, and the number of repetitions. When the repeat instruction is executed, the process of branching the execution instruction to the instruction start address and executing the instruction up to the instruction end address is repeated by the repetition number. Such a repeat instruction can increase the efficiency of the repetition of the product-sum operation processing frequently used in digital signal processing. The instruction control unit 25 asserts a branch signal 35 when the branch occurs. That is, in the case of a branch instruction, a branch destination instruction address is output or a branch destination instruction is fetched. In the case of an interrupt, a head instruction address of a processing routine designated by the interrupt is output or the head instruction is fetched. In the case of a repeat instruction, the branch signal 35 is asserted when the instruction start address is output or when the start instruction is fetched.

【0024】前記トレースデータレジスタ33a〜33
dはCPU2による命令実行順序が変化される分岐が発
生したとき分岐先及び分岐元の各命令アドレスを特定す
るための分岐トレースデータを順次格納するレジスタで
あり、直列4段のシフトレジスタ形式を有する。図1の
例では、分岐トレースデータは、分岐先命令アドレス及
び分岐前最後に実行した命令アドレスとされる。前記リ
ピート回数レジスタ34a〜34dは、前記夫々のトレ
ースデータレジスタ33a〜33dに対応して設けられ
ており、同様に直列4段のシフトレジスタ形式を有す
る。前記分岐先命令アドレス及び分岐前最後に実行した
命令アドレスは、特に制限されないが、命令制御部25
から出力される。
The trace data registers 33a-33
Reference numeral d denotes a register for sequentially storing branch trace data for specifying each instruction address of a branch destination and a branch source when a branch whose instruction execution order is changed by the CPU 2 has a serial 4-stage shift register format. . In the example of FIG. 1, the branch trace data is the branch destination instruction address and the last executed instruction address before the branch. The repeat number registers 34a to 34d are provided corresponding to the trace data registers 33a to 33d, and similarly have a serial four-stage shift register format. The branch destination instruction address and the last executed instruction address before the branch are not particularly limited.
Output from

【0025】シフトレジスタ形式のリピート回数レジス
タ34a〜34d及びトレースデータレジスタ33a〜
33dに対するシフト制御は前記シフト制御回路30が
行なう。前記コンパレータ31は、トレースデータレジ
スタ33aに格納されている分岐先の情報と分岐先命令
アドレスとを比較し、且つ、トレースデータレジスタ3
3aに格納され得ている分岐元の情報と前記分岐前最後
に実行した命令アドレスとを比較する。コンパレータ3
1による双方の比較結果が不一致の状態は、直前に発生
した分岐が繰り返されていないことを意味する。コンパ
レータ31による双方の比較結果が一致の状態は、直前
に発生した分岐が再度繰り返されることを意味する。後
者の場合としては、分岐命令によるループの発生、或い
はリピート命令による第2回目以降の繰返し処理があ
る。前者の場合には信号36によりシフト制御回路30
はトレースデータレジスタ33a〜33dのシフト動作
を行ない、初段に新しいトレースデータを格納する。後
者の場合には、信号36によりシフト制御回路30によ
るシフト動作を抑止させ、その代わりに、初段リピート
回数レジスタ34aの値をインクリメンタ32を介して
+1する。
A shift register type repeat number register 34a-34d and a trace data register 33a-33
The shift control for the 33d is performed by the shift control circuit 30. The comparator 31 compares the branch destination information stored in the trace data register 33a with the branch destination instruction address.
The information of the branch source stored in 3a is compared with the last executed instruction address before the branch. Comparator 3
A state in which the comparison results of 1 and 2 do not match indicates that the immediately preceding branch has not been repeated. The state in which the comparison results of the two comparators 31 match indicates that the immediately preceding branch is repeated again. In the latter case, a loop is generated by a branch instruction, or the second and subsequent iterations are performed by a repeat instruction. In the former case, the shift control circuit 30
Performs a shift operation of the trace data registers 33a to 33d, and stores new trace data in the first stage. In the latter case, the shift operation by the shift control circuit 30 is suppressed by the signal 36, and instead, the value of the first-stage repeat number register 34a is incremented by one via the incrementer 32.

【0026】図2には図1に示されるPCトレース回路
による制御動作のフローチャートが示される。シフト制
御回路30は命令制御部25をモニタし(S1)、分岐
信号35がアサートされたか否かを判定する(S2)。
分岐信号35がアサートされると、リピートかの判定、
即ちコンパレータ31による比較結果が一致状態かの判
定が行なわれる(S3)。リピートでない場合には、ト
レースデータレジスタ33a〜33d及びリピート回数
レジスタ34a〜34dをシフトし(S5)、その時の
分岐先命令アドレス及び分岐前最後に実行した命令アド
レスをレジスタ33aに格納し、リピート回数レジスタ
を0にリセットする(S6)。一方、ステップS3の判
定結果が、リピートである場合には、前記ステップS
5,S6によるトレースデータの更新を行なわず、リピ
ート回数レジスタ34aの値を+1する。
FIG. 2 shows a flowchart of the control operation by the PC trace circuit shown in FIG. The shift control circuit 30 monitors the instruction control unit 25 (S1) and determines whether the branch signal 35 has been asserted (S2).
When the branch signal 35 is asserted, it is determined whether the signal is repeat,
That is, it is determined whether or not the comparison result by the comparator 31 is a coincidence state (S3). If not, the trace data registers 33a to 33d and the repeat count registers 34a to 34d are shifted (S5), and the branch destination instruction address and the last executed instruction address before branch are stored in the register 33a. The register is reset to 0 (S6). On the other hand, if the result of the determination in step S3 is repeat,
5, the value of the repeat number register 34a is incremented by one without updating the trace data by S6.

【0027】これにより、リピート命令やループによっ
て同じ分岐が何回も繰り返される場合であっても、毎回
同じトレースデータが新たなトレースデータレジスタに
格納される事態を阻止することができる。したがって、
記憶容量に限りの有るPCトレース用のトレースデータ
レジスタを無駄に費やすことがない。したがって、広範
囲にPCトレースを行なうことが可能になる。仮に図7
に例示される比較例の場合には、分岐が発生する度に、
順次格納先レジスタが変化されていくから、同じ分岐が
何回も繰り返される場合であっても、毎回同じ分岐トレ
ースデータを保持していく。これにより、記憶容量に限
りの有るPCトレース用のレジスタを無駄に費やすこと
になる。
Thus, even if the same branch is repeated many times by a repeat instruction or a loop, it is possible to prevent the same trace data from being stored in a new trace data register every time. Therefore,
The trace data register for the PC trace having a limited storage capacity is not wasted. Therefore, it is possible to perform PC trace over a wide range. Figure 7
In the case of the comparative example illustrated in
Since the storage destination register is sequentially changed, even if the same branch is repeated many times, the same branch trace data is held every time. As a result, a PC trace register having a limited storage capacity is wasted.

【0028】図3には前記PCトレース機能を実現する
ためのPCトレース回路の第2の例が示される。同図に
おいてPCトレース回路は、図1に対してコンパレータ
31が省かれ、その代わりにリピート実行信号37を受
けるシフト制御回路30aが設けられている。その他の
構成は図1と同じである。前記リピート実行信号37
は、リピート命令における分岐が繰り返されるときアサ
ートされる。換言すれば、リピート命令による処理の繰
返しが行なわれるときリピート実行信号37がアサート
される。リピート実行信号37がアサートされるときは
分岐信号35は必ずアサートされる。リピート実行信号
37がアサートされると、シフト制御回路30aは、分
岐信号35がアサートされていてもトレースデータレジ
スタ33a〜33d及びリピート回数レジスタ34a〜
34dに対するシフト動作を抑止する。それに代え、イ
ンクリメンタを利用してリピート回数レジスタ34aの
値を+1する。
FIG. 3 shows a second example of a PC trace circuit for realizing the PC trace function. In the figure, the PC trace circuit is different from that of FIG. 1 in that the comparator 31 is omitted, and a shift control circuit 30a for receiving a repeat execution signal 37 is provided instead. Other configurations are the same as those in FIG. The repeat execution signal 37
Is asserted when a branch in a repeat instruction is repeated. In other words, the repeat execution signal 37 is asserted when the processing by the repeat instruction is repeated. When the repeat execution signal 37 is asserted, the branch signal 35 is always asserted. When the repeat execution signal 37 is asserted, the shift control circuit 30a outputs the trace data registers 33a to 33d and the repeat number registers 34a to 34d even if the branch signal 35 is asserted.
The shift operation for 34d is suppressed. Instead, the value of the repeat number register 34a is incremented by one using an incrementer.

【0029】このように、図3のPCトレース回路は、
図1に比べて回路構成が簡単になっているが、リピート
命令に対してだけデータレジスタ33a〜33d,34
a〜34dのシフト動作を抑止する点で、その機能は図
1に比べて簡素化されている。その他の点では図1と同
じ効果を有する。
As described above, the PC trace circuit of FIG.
Although the circuit configuration is simpler than that of FIG. 1, the data registers 33a to 33d, 34
The function is simplified as compared with FIG. 1 in that the shift operations a to 34d are suppressed. In other respects, it has the same effect as FIG.

【0030】図4には前記PCトレース機能を実現する
ためのPCトレース回路の第3の例が示される。同図に
おいてPCトレース回路は、図3に対してシフト制御回
路30bが相違される。図3の構成に対して、シフト制
御回路30bにはリピート命令の途中であることを示す
ステータス信号38aと割込み信号38bとが供給され
ている。前記ステータス信号38aは命令制御部25が
リピート命令の命令コードをデコードすることによって
アサートされ、リピート命令で規定される繰返し回数分
の処理を終了することによってネゲートされる。シフト
制御回路30bはステータス信号38aがアサートされ
ている状態によって、リピート命令実行中、若しくはリ
ピート命令実行中における分岐が生じていること、換言
すればリピート命令の途中であることを認識することが
できる。シフト制御回路30bは、前記ステータス信号
38aによってリピート命令の途中であることを認識し
ているときは、割込みに基づく分岐が発生しても、トレ
ースデータレジスタ33aに対するデータ更新とレジス
タ33a〜33d及び34a〜34dのシフト動作抑止
する。割込みに基づく分岐の発生は、分岐信号35及び
割り込み信号38bのアサートによって認識される。
FIG. 4 shows a third example of a PC trace circuit for realizing the PC trace function. In the figure, the PC trace circuit is different from the shift control circuit 30b in FIG. In contrast to the configuration of FIG. 3, the shift control circuit 30b is supplied with a status signal 38a indicating that a repeat command is being performed and an interrupt signal 38b. The status signal 38a is asserted when the instruction control unit 25 decodes the instruction code of the repeat instruction, and is negated when the processing for the number of repetitions specified by the repeat instruction is completed. The shift control circuit 30b can recognize that the repeat instruction is being executed or that a branch occurs during the execution of the repeat instruction, in other words, that the branch is in the middle of the repeat instruction, depending on the state of the status signal 38a being asserted. . When the shift control circuit 30b recognizes from the status signal 38a that it is in the middle of a repeat instruction, it updates the data in the trace data register 33a and updates the registers 33a to 33d and 34a even if a branch based on an interrupt occurs. 34d shift operation is suppressed. The occurrence of the branch based on the interrupt is recognized by the assertion of the branch signal 35 and the interrupt signal 38b.

【0031】したがって、図4の構成では、リピート命
令の途中で割込みが発生しても、その割り込みによる分
岐ではトレースデータの保持を行なわない。処理若しく
はプログラムが正常であれば、割込み処理が終了する
と、CPUの処理は割り込み発生時点の処理に復帰され
るので、そのような割り込み処理を無視しても支障がな
ければ、PCトレースの範囲を更に広げるという要求に
対処でき、融通性を増すことができる。
Therefore, in the configuration of FIG. 4, even if an interrupt occurs in the middle of a repeat instruction, trace data is not held in a branch caused by the interrupt. If the processing or the program is normal, when the interrupt processing is completed, the processing of the CPU is returned to the processing at the time of the occurrence of the interrupt. The need for further expansion can be met, and flexibility can be increased.

【0032】図5には前記PCトレース機能を実現する
ためのPCトレース回路の第4の例が示される。同図に
おいてシフト制御回路30cによるシフト制御対象はフ
ラグ40a〜40dとされる。分岐先命令アドレス及び
分岐前最後に実行した命令アドレスは入力ゲート42a
〜42dを介してトレースデータレジスタ33a〜33
dに供給される。リピート回数レジスタ34a〜34d
の値はインクリメンタ41a〜41dによって選択的に
+1される。インクリメンタ41a〜41dによる+1
動作はリピート実行信号37のアサートによって制御さ
れる。どのインクリメンタ41a〜41dを動作させ、
また、どの入力ゲート42a〜42dを動作させるか
は、フラグ40a〜40dの値によって制御される。フ
ラグ40a〜40dは、分岐信号35によって分岐が生
じたときそれがリピート命令による繰返しでないとき、
シフト制御回路30cによってシフトされる。したがっ
て、上述のトレースデータレジスタを直列的に接続した
シフトレジスタ形式でなくても図1と同様の効果を得る
ことができる。
FIG. 5 shows a fourth example of a PC trace circuit for realizing the PC trace function. In the figure, the shift control target by the shift control circuit 30c is flags 40a to 40d. The branch destination instruction address and the last executed instruction address before the branch are input gate 42a.
Through the trace data registers 33a through 33d
d. Repeat count registers 34a to 34d
Is selectively incremented by +1 by the incrementers 41a to 41d. +1 by the incrementers 41a to 41d
The operation is controlled by the assertion of the repeat execution signal 37. Operate any of the incrementers 41a to 41d,
Which of the input gates 42a to 42d is operated is controlled by the values of the flags 40a to 40d. The flags 40a to 40d indicate that when a branch is caused by the branch signal 35 and it is not a repetition by a repeat instruction,
The shift is performed by the shift control circuit 30c. Therefore, the same effect as in FIG. 1 can be obtained even if the above-mentioned trace data register is not a shift register type connected in series.

【0033】以上本発明者によってなされた発明を実施
形態に基づいて具体的に説明したが、本発明はそれに限
定されるものではなく、その要旨を逸脱しない範囲にお
いて種々変更可能であることは言うまでもない。
Although the invention made by the inventor has been specifically described based on the embodiments, it is needless to say that the present invention is not limited to the embodiments and can be variously modified without departing from the gist of the invention. No.

【0034】例えば、トレースデータレジスタの段数は
4段に限定されず適宜変更することができる。マイクロ
コンピュータの機能実モジュールは図6に限定されな
い。また、PCトレース機能をサポートする回路ブロッ
クもユーザブレークコントローラに限定されない。
For example, the number of trace data registers is not limited to four and can be changed as appropriate. The function actual module of the microcomputer is not limited to FIG. Further, the circuit block supporting the PC trace function is not limited to the user break controller.

【0035】以上の説明では主として本発明者によって
なされた発明をその背景となった利用分野であるDSP
ユニットを有するマイクロコンピュータに適用した場合
について説明したが、本発明はそれに限定されず、CP
Uを含み命令若しくはコマンドを実行するデータプロセ
ッサに広く適用することができる。
In the above description, the invention made mainly by the present inventor is a DSP which is a field of application which is the background of the invention.
The case where the present invention is applied to a microcomputer having a unit has been described, but the present invention is not limited thereto.
It can be widely applied to data processors including U and executing instructions or commands.

【0036】[0036]

【発明の効果】本願において開示される発明のうち代表
的なものによって得られる効果を簡単に説明すれば下記
の通りである。
The effects obtained by typical ones of the inventions disclosed in the present application will be briefly described as follows.

【0037】すなわち、リピート命令やループによって
同じ分岐が何回も繰り返される場合であっても、毎回同
じトレースデータが新たなトレースデータレジスタに格
納される事態を阻止することができる。したがって、記
憶容量に限りの有るPCトレース用のトレースデータレ
ジスタを無駄に費やすことがない。したがって、広範囲
にPCトレースを行なうことが可能になる。
That is, even when the same branch is repeated many times by a repeat instruction or a loop, it is possible to prevent the same trace data from being stored in a new trace data register every time. Therefore, the trace data register for the PC trace having a limited storage capacity is not wasted. Therefore, it is possible to perform PC trace over a wide range.

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

【図1】PCトレース機能を実現するためのPCトレー
ス回路の第1の例を示すブロック図である。
FIG. 1 is a block diagram showing a first example of a PC trace circuit for realizing a PC trace function.

【図2】図1に示されるPCトレース回路による制御動
作の一例を示すフローチャートである。
FIG. 2 is a flowchart showing an example of a control operation by the PC trace circuit shown in FIG.

【図3】PCトレース機能を実現するためのPCトレー
ス回路の第2の例を示すブロック図である。
FIG. 3 is a block diagram showing a second example of a PC trace circuit for realizing a PC trace function.

【図4】PCトレース機能を実現するためのPCトレー
ス回路の第3の例を示すブロック図である。
FIG. 4 is a block diagram showing a third example of a PC trace circuit for realizing a PC trace function.

【図5】PCトレース機能を実現するためのPCトレー
ス回路の第4の例を示すブロック図である。
FIG. 5 is a block diagram showing a fourth example of a PC trace circuit for realizing a PC trace function.

【図6】本発明に係るデータプロセッサの一例であるマ
イクロコンピュータを全体的に示すブロック図である。
FIG. 6 is a block diagram generally showing a microcomputer as an example of a data processor according to the present invention.

【図7】分岐が発生する度に毎回トレースデータを更新
する形式のPCトレース回路を比較例として示すブロッ
ク図である。
FIG. 7 is a block diagram showing, as a comparative example, a PC trace circuit in which trace data is updated every time a branch occurs.

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

1 マイクロコンピュータ 2 CPU 4 ユーザブレークコントローラ 25 命令制御部 30,30a,30b,30c シフト制御回路 31 コンパレータ 32 インクリメンタ 33a〜33d トレースデータレジスタ 34a〜34d リピート回数レジスタ 35 分岐信号 37 リピート実行信号 38a リピート命令の途中であることを示すステータ
ス信号 38b 割り込み信号 40a〜40d フラグ 41a〜41d インクリメンタ 42a〜42d 入力ゲート
Reference Signs List 1 microcomputer 2 CPU 4 user break controller 25 instruction control unit 30, 30a, 30b, 30c shift control circuit 31 comparator 32 incrementer 33a to 33d trace data register 34a to 34d repeat number register 35 branch signal 37 repeat execution signal 38a repeat instruction Signal 38b interrupt signal 40a-40d flag 41a-41d incrementer 42a-42d input gate

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 CPUと、CPUによる命令実行順序が
変化される分岐が発生したとき分岐元及び分岐先の命令
アドレスを特定するための分岐トレースデータを順次格
納する複数個のトレースデータレジスタと、前記夫々の
トレースデータレジスタに設けられたリピート回数レジ
スタと、前記複数個のトレースデータレジスタに対する
分岐トレースデータの格納を制御すると共に、前記リピ
ート回数レジスタに対する回数データの格納を制御する
制御手段とを含み、 前記制御手段は、分岐の発生を検出したときその分岐が
前回の分岐と等しいときは対応する分岐トレースデータ
を既に有するトレースデータレジスタのリピート回数レ
ジスタ上で回数データを更新し、その分岐が前回の分岐
と異なるときは別のトレースデータレジスタに今回の分
岐トレースデータを取得すると共に対応するリピート回
数レジスタを初期化する、ものであることを特徴とする
データプロセッサ。
1. A CPU, and a plurality of trace data registers for sequentially storing branch trace data for specifying an instruction address of a branch source and a branch destination when a branch whose instruction execution order is changed by the CPU occurs; A repeat count register provided in each of the trace data registers; and control means for controlling storage of branch trace data in the plurality of trace data registers and controlling storage of count data in the repeat count register. When the occurrence of a branch is detected and the branch is equal to the previous branch, the control means updates the count data on the repeat count register of the trace data register already having the corresponding branch trace data, If it is different from the branch of Toki data processor, characterized in that the corresponding repeat count register is initialized, is intended to acquire the trace data.
【請求項2】 CPUと、CPUによる命令実行順序が
変化される分岐が発生したとき分岐元及び分岐先の命令
アドレスを特定するための分岐トレースデータを順次格
納する複数個のレジスタ手段と、前記複数個のレジスタ
手段に対する分岐トレースデータの格納を制御する制御
手段とを含み、 前記制御手段は、新たに分岐が生じたときの分岐トレー
スデータが前記レジスタ手段に既に格納されている分岐
トレースデータに等しいときは新たな分岐トレースデー
タの取得に代えて一致に係る分岐の回数を対応するレジ
スタ手段に格納し、新たに分岐が生じたときの分岐トレ
ースデータが前記レジスタ手段に既に格納されている分
岐トレースデータと不一致のときはレジスタ手段を変え
て新たな分岐トレースデータを取得する、ものであるこ
とを特徴とするデータプロセッサ。
2. A CPU, and a plurality of register means for sequentially storing branch trace data for specifying an instruction address of a branch source and a branch destination when a branch whose instruction execution order is changed by the CPU occurs; Control means for controlling storage of branch trace data in a plurality of register means, wherein the control means stores the branch trace data when a new branch occurs in the branch trace data already stored in the register means. When they are equal to each other, the number of branches relating to the match is stored in the corresponding register means instead of acquiring new branch trace data, and the branch trace data when a new branch occurs is stored in the register means. If it does not match the trace data, change the register means and acquire new branch trace data. Data processor, characterized.
【請求項3】 CPUと、CPUによる命令実行順序が
変化される分岐が発生したとき分岐元及び分岐先の命令
アドレスを特定するための分岐トレースデータを順次格
納する複数個のレジスタ手段と、前記複数個のレジスタ
手段に対する分岐トレースデータの格納を制御する制御
手段とを含み、 前記制御手段は、新たに分岐が生じたときその分岐がリ
ピート命令の実行による繰返しであるときは新たな分岐
トレースデータの取得に代えてそのリピート命令に係る
分岐の回数を対応するレジスタ手段に格納し、新たに分
岐が生じたときその分岐がリピート命令の実行による繰
返しでないときはレジスタ手段を変えて新たな分岐トレ
ースデータを取得する、ものであることを特徴とするデ
ータプロセッサ。
3. A CPU, and a plurality of register means for sequentially storing branch trace data for specifying an instruction address of a branch source and a branch destination when a branch whose instruction execution order is changed by the CPU occurs; Control means for controlling storage of branch trace data in a plurality of register means, the control means including, when a new branch is generated, the new branch trace data when the branch is repeated by execution of a repeat instruction. Is stored in the corresponding register means in place of the acquisition of the branch instruction, and if a new branch is generated and the branch is not repeated by execution of the repeat instruction, the register means is changed and a new branch trace is performed. A data processor for acquiring data.
【請求項4】 前記制御手段は更に、リピート命令の途
中で割込みに基づく分岐が発生したとき、レジスタ手段
を変えて新たな分岐トレースデータを取得する処理を抑
止するものであることを特徴とする請求項3記載のデー
タプロセッサ。
4. The control unit according to claim 1, wherein when a branch based on an interrupt occurs in the middle of a repeat instruction, the control unit changes a register unit to suppress a process of acquiring new branch trace data. The data processor according to claim 3.
JP10112125A 1998-04-22 1998-04-22 Data processor Withdrawn JPH11306044A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10112125A JPH11306044A (en) 1998-04-22 1998-04-22 Data processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10112125A JPH11306044A (en) 1998-04-22 1998-04-22 Data processor

Publications (1)

Publication Number Publication Date
JPH11306044A true JPH11306044A (en) 1999-11-05

Family

ID=14578830

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10112125A Withdrawn JPH11306044A (en) 1998-04-22 1998-04-22 Data processor

Country Status (1)

Country Link
JP (1) JPH11306044A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7155570B1 (en) 2000-09-29 2006-12-26 Intel Corporation FIFO write/LIFO read trace buffer with software and hardware loop compression
JP2007109116A (en) * 2005-10-17 2007-04-26 Fukuoka Pref Gov Sangyo Kagaku Gijutsu Shinko Zaidan Estimation apparatus, apparatus and method for table management, selection apparatus, program which makes computer attain the table management method, and storage medium storing the program
US7496792B2 (en) 2002-10-15 2009-02-24 Stmicroelectronics S.A. Repeat digital message transmission between a microprocessor monitoring circuit and an analyzing tool
JP2012190137A (en) * 2011-03-09 2012-10-04 Lapis Semiconductor Co Ltd Emulator device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7155570B1 (en) 2000-09-29 2006-12-26 Intel Corporation FIFO write/LIFO read trace buffer with software and hardware loop compression
US7496792B2 (en) 2002-10-15 2009-02-24 Stmicroelectronics S.A. Repeat digital message transmission between a microprocessor monitoring circuit and an analyzing tool
JP2007109116A (en) * 2005-10-17 2007-04-26 Fukuoka Pref Gov Sangyo Kagaku Gijutsu Shinko Zaidan Estimation apparatus, apparatus and method for table management, selection apparatus, program which makes computer attain the table management method, and storage medium storing the program
WO2007046324A1 (en) * 2005-10-17 2007-04-26 Fukuoka Industry, Science & Technology Foundation Estimator, table managing device, selecting device, table managing method, program for allowing computer to execute the table managing method, and recording medium where the program is recorded
JP2012190137A (en) * 2011-03-09 2012-10-04 Lapis Semiconductor Co Ltd Emulator device

Similar Documents

Publication Publication Date Title
US8135975B2 (en) Software programmable timing architecture
TW201530320A (en) Data processing apparatus and semiconductor integrated circuit device
US7376777B2 (en) Performing an N-bit write access to an M×N-bit-only peripheral
US6986028B2 (en) Repeat block with zero cycle overhead nesting
JP3822568B2 (en) Event processing
JPH11306044A (en) Data processor
JPH03204718A (en) Information processor
US20170329603A1 (en) Conditional selection of data elements
US6425047B1 (en) Process containing address decoders suited to improvements in clock speed
JP2000347862A (en) Instruction replacing circuit
US20050216708A1 (en) Processor for performing context switching, a method for performing context switching, a computer program for perform context switching
JP2001265593A (en) Information processor
JP3729250B2 (en) Information processing apparatus and electronic apparatus
JP3525582B2 (en) Bit operation circuit
JPH07182165A (en) Processing method/device for instruction with committing condition
JPH08179954A (en) Semiconductor integrated circuit
JPH07210388A (en) Fuzzy computer
JP2004185060A (en) Microcomputer
JPH06162067A (en) Device and method for controlling vector instruction
JP2020140290A (en) Central processing unit
JPH11288378A (en) Data processor provided with function for protecting non-maskable interruption
Andreas et al. ENSONIQ SIGNAL PROCESSOR 2
JPH0442327A (en) Advance controller
JP2004288203A (en) Processor core and processor using the same
JPS62208132A (en) Electronic computer

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20050705