JP2001350648A - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JP2001350648A
JP2001350648A JP2000171761A JP2000171761A JP2001350648A JP 2001350648 A JP2001350648 A JP 2001350648A JP 2000171761 A JP2000171761 A JP 2000171761A JP 2000171761 A JP2000171761 A JP 2000171761A JP 2001350648 A JP2001350648 A JP 2001350648A
Authority
JP
Japan
Prior art keywords
internal state
function
microcomputer
program
execution
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
JP2000171761A
Other languages
Japanese (ja)
Inventor
Yuuri Ikeda
有里 池田
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 JP2000171761A priority Critical patent/JP2001350648A/en
Publication of JP2001350648A publication Critical patent/JP2001350648A/en
Pending legal-status Critical Current

Links

Landscapes

  • Test And Diagnosis Of Digital Computers (AREA)
  • Microcomputers (AREA)
  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To output the information showing the internal state of a CPU even during the executing of a user program in an on-chip debug type microcomputer having an emulation function to perform a precise debug. SOLUTION: This microcomputer has a brake function capable of stopping the executing of the user program in a desired position, a trace function capable of gaining the information for an internal bus at an optional point of time during the execution of the user program, and a function of outputting the information gained by the trace function to the outside during the execution of the user program is stopped by the brake function. This microcomputer is provided with an internal state output circuit (AVD) for outputting a prescribed piece of internal state information to the outside during the executing of the user program and terminals (T2-T5) for outputting the internal state information.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、エミュレーション機能
を有するマイクロコンピュータにおけるアプリケーショ
ンプログラム実行中の内部状態を把握する技術に関し、
特にアプリケーションプログラムを停止させることなく
リアルタイムで内部状態をモニタできるようにする技術
に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a technique for grasping an internal state during execution of an application program in a microcomputer having an emulation function.
In particular, the present invention relates to a technique for monitoring an internal state in real time without stopping an application program.

【0002】[0002]

【従来の技術】マイクロコンピュータ応用システムの開
発において、その応用システムのデバッグやそのシステ
ムの詳細な評価を行なうため、ホストコンピュータ(パ
ーソナルコンピュータ)と応用システムとの間に設けれ
て応用システムのアプリケーションプログラム(ユーザ
・プログラム)のエミュレーションを行なうエミュレー
タが使用されている。
2. Description of the Related Art In the development of a microcomputer application system, an application program of the application system is provided between a host computer (personal computer) and the application system in order to debug the application system and evaluate the system in detail. An emulator that emulates (user program) is used.

【0003】従来のエミュレータは、エミュレーション
対象となる応用システムのマイクロコンピュータと同機
能を有するマイクロコンピュータ(評価用のエバリュエ
ーションチップ)やプログラムの実行を任意の位置(命
令)で停止させることができるブレーク制御回路などを
有し、この代行マイクロコンピュータにてユーザ・プロ
グラムを実行、停止させながらユーザ・システムを制御
し、ユーザ・プログラム実行中の応用システム上の信号
を採取して解析することにより、ハードウェアおよびソ
フトウェアのデバッグを可能にしたインサーキット・エ
ミュレータが一般的であった。
A conventional emulator has a microcomputer (evaluation evaluation chip) having the same function as a microcomputer of an application system to be emulated and a breaker which can stop program execution at an arbitrary position (instruction). It has a control circuit, etc., controls the user system while executing and stopping the user program with this substitute microcomputer, and collects and analyzes signals on the application system during execution of the user program, thereby realizing the hardware. In-circuit emulators that enable debugging of software and software have been popular.

【0004】インサーキット・エミュレータは、エミュ
レータ本体から延設されたケーブルの先端に設けられた
コネクタをユーザ・システムなどの応用システム上のマ
イクロコンピュータ用ソケットに接続してエミュレータ
本体内のエバリュエーションチップにより応用システム
を制御するため、信号の遅延が大きくなり高速なエミュ
レーションが行えないという不具合がある。そこで、ユ
ーザ・システムに搭載されるマイクロコンピュータに、
プログラムのブレーク機能やバス上の信号のトレース機
能やエミュレーション制御機能、通信機能などを持たせ
て、自分自身でデバッグを行えるようにしたオンチップ
デバッグ方式のマイクロコンピュータが提供されるよう
になって来ている。このようなマイクロコンピュータの
例として、例えば(株)日立製作所製の型番SH775
0のような製品がある。
In an in-circuit emulator, a connector provided at the end of a cable extending from the emulator main body is connected to a microcomputer socket on an application system such as a user system, and an evaluation chip in the emulator main body is used. Since the application system is controlled, there is a problem that signal delay increases and high-speed emulation cannot be performed. Therefore, the microcomputer installed in the user system
On-chip debugging type microcomputers have been provided that have a program break function, a signal tracing function on the bus, an emulation control function, a communication function, and the like, so that debugging can be performed by themselves. ing. As an example of such a microcomputer, for example, model number SH775 manufactured by Hitachi, Ltd.
There are products like 0.

【0005】[0005]

【発明が解決しようとする課題】ところで、上記マイク
ロコンピュータは、分岐命令発生時にユーザ・プログラ
ムの実行状態からエミュレーション制御状態へ移行する
ことができるように構成されているとともに、内部にユ
ーザ・プログラムの実行を停止させるためのブレーク制
御回路やキャッシュメモリ、MMU(メモリ管理ユニッ
ト)などを備えており、極めて高性能のマイクロコンピ
ュータである。かかる高性能のマイクロコンピュータの
応用プログラムを開発しそのデバッグを行なう場合、キ
ャッシュメモリやMMUなどのCPUの内部状態情報が
得られると極めて効率的である。
By the way, the above-mentioned microcomputer is configured so as to be able to shift from the execution state of the user program to the emulation control state when a branch instruction is generated, and to internally store the user program. The microcomputer is provided with a break control circuit for stopping execution, a cache memory, an MMU (memory management unit), and the like, and is an extremely high-performance microcomputer. When developing and debugging an application program of such a high-performance microcomputer, it is extremely efficient if internal state information of a CPU such as a cache memory or an MMU is obtained.

【0006】ところが、オンチップデバッグ方式の従来
のマイクロコンピュータは、ユーザ・プログラム実行中
のプログラムカウンタの値を外部へ出力する機能を有す
るものはあるものの、それ以外のCPUの内部状態を外
部へ出力する機能を備えていないため、リアルタイムで
CPUの詳しい内部状態を知ることはできなかった。そ
こで、マイクロコンピュータの内部にキャッシュメモリ
からのメモリフェッチ動作やオペランドのアクセス、M
MUでのキャッシュミスの発生など所定の状態の発生を
選択してカウントアップすることができるカウンタを設
け、このカウンタの値を外部へ出力させる技術について
検討した。ところが、従来のマイクロコンピュータにあ
っては、上記カウンタの値を外部に出力するには分岐命
令によりエミュレーション制御に移行してカウンタの値
を外部に読み出す以外に方法がなかった。
[0006] However, some conventional microcomputers of the on-chip debugging system have a function of outputting the value of a program counter during execution of a user program to the outside, but output the other internal states of the CPU to the outside. However, it was not possible to know the detailed internal state of the CPU in real time because it was not provided with a function to perform the processing. Therefore, a memory fetch operation from a cache memory, operand access, M
A technology was provided that provided a counter capable of selecting and counting up the occurrence of a predetermined state such as the occurrence of a cache miss in the MU, and outputting the value of this counter to the outside. However, in the conventional microcomputer, there is no other way to output the value of the counter to the outside except to shift to emulation control by a branch instruction and read the value of the counter to the outside.

【0007】しかしながら、カウンタの値を知るために
分岐命令によりエミュレーション制御に移行するという
ことは、ユーザ・プログラムの実行を中断することを意
味しており、ユーザ割込みがマスク(禁止)されてしま
うなどユーザ・プログラム実行状態を変えてしまうこと
なり、本当に正確なデバッグを行なうことができないな
いことが明らかになった。
However, the transition to emulation control by a branch instruction in order to know the value of the counter means that the execution of the user program is interrupted, and the user interrupt is masked (prohibited). It changed the execution state of the user program, and it became clear that truly accurate debugging could not be performed.

【0008】本発明の目的は、エミュレーション機能を
有するオンチップデバッグ方式のマイクロコンピュータ
において、ユーザ・プログラムの実行中においてもCP
Uの内部状態を示す情報を外部に出力できるようにし
て、正確なデバッグを可能にすることにある。
An object of the present invention is to provide a microcomputer of an on-chip debugging system having an emulation function in which a CP can be used even during execution of a user program.
An object of the present invention is to enable information indicating the internal state of U to be output to the outside, thereby enabling accurate debugging.

【0009】本発明の他の目的は、エミュレーション機
能を有するオンチップデバッグ方式のマイクロコンピュ
ータにおいて、端子数を増加させることなくユーザ・プ
ログラムの実行中においても内部状態を示す情報を外部
に出力できるようにすることにある。
Another object of the present invention is to provide an on-chip debugging type microcomputer having an emulation function that can output information indicating an internal state to the outside even during execution of a user program without increasing the number of terminals. It is to make.

【0010】この発明の前記ならびにそのほかの目的と
新規な特徴については、本明細書の記述および添附図面
から明らかになるであろう。
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.

【0011】[0011]

【課題を解決するための手段】本願において開示される
発明のうち、代表的なものの概要を簡単に説明すれば下
記のとおりである。すなわち、アプリケーションプログ
ラム(ユーザ・プログラム)の実行を所望の箇所で停止
可能なブレーク機能と、上記アプリケーションプログラ
ム実行中の任意の時点での内部バスの情報を取得可能な
トレース機能と、上記ブレーク機能によりアプリケーシ
ョンプログラムの実行が停止されている間に上記トレー
ス機能により取得された情報を外部へ出力する機能とを
有するマイクロコンピュータにおいて、アプリケーショ
ンプログラム実行中に所定の内部状態情報を外部へ出力
させる内部状態出力回路と、前記内部状態情報を出力す
るための端子とを設けるようにしたものである。
SUMMARY OF THE INVENTION Among the inventions disclosed in the present application, typical ones will be briefly described as follows. That is, a break function capable of stopping the execution of an application program (user program) at a desired position, a trace function capable of acquiring information on an internal bus at any time during the execution of the application program, and a break function An internal state output for outputting predetermined internal state information during execution of the application program in a microcomputer having a function of outputting information obtained by the trace function to the outside while the execution of the application program is stopped. A circuit and a terminal for outputting the internal state information are provided.

【0012】上記した手段によれば、アプリケーション
プログラムの実行中においてもチップの内部状態を示す
情報が外部に出力されるため、これを外部で監視するこ
とによりアプリケーションプログラムのより正確なデバ
ッグが可能になる。
According to the above-mentioned means, information indicating the internal state of the chip is output to the outside even during the execution of the application program. By monitoring this externally, more accurate debugging of the application program becomes possible. Become.

【0013】また、望ましくは、アプリケーションプロ
グラム実行中における所定の内部状態の発生を計数する
1または2以上のカウンタを設け、該カウンタの内容を
上記内部状態情報として出力するように構成する。内部
状態をリアルタイムで外部へ出力させるには、高速で動
作する出力回路や多数の出力端子が必要となりハードウ
ェアの負担が大幅に増加するが、内部状態の発生を計数
するカウンタの内容を出力するようにすれば、ハードウ
ェアの負担をそれほど大きくすることなく内部状態を知
ることができる。
Preferably, one or more counters are provided for counting occurrences of a predetermined internal state during execution of the application program, and the contents of the counter are output as the internal state information. Outputting the internal state to the outside in real time requires an output circuit that operates at high speed and a large number of output terminals, which greatly increases the load on the hardware, but outputs the contents of a counter that counts the occurrence of the internal state. By doing so, it is possible to know the internal state without significantly increasing the load on the hardware.

【0014】さらに、望ましくは、上記カウンタは、複
数種類の内部状態のうち予め設定された任意の内部状態
の発生回数を選択的に計数可能に構成する。すべての内
部状態の発生回数を計数するには数多くのカウンタが必
要となりハードウェア量が増加するが、内部状態のうち
1つあるいは幾つか選択して計数するようにすれば、ハ
ードウェア量の増加を抑えることができる。ユーザ・プ
ログラムのデバッグでは、プログラム全体ではなく一部
の機能(サブルーチン)に着目して検証することが多い
ので、一度にすべての内部状態を知る必要はなく、所望
の内部状態の未を知ることができれば充分である。
Preferably, the counter is configured to be able to selectively count the number of occurrences of a predetermined internal state among a plurality of types of internal states. Counting the number of occurrences of all internal states requires a large number of counters and increases the amount of hardware. However, if one or some of the internal states are selected and counted, the amount of hardware increases. Can be suppressed. In debugging a user program, verification is often performed not on the entire program but on some functions (subroutines). Therefore, it is not necessary to know all the internal states at once, and to know the desired internal state. Is enough.

【0015】また、上記内部状態出力回路は、上記内部
状態情報とプログラムカウンタの内容とを時分割方式で
出力するように構成すると良い。時分割方式で出力する
ことにより、内部状態情報を出力するための端子数の増
加を抑えることができるとともに、内部状態情報とプロ
グラムカウンタの内容を同時に出力することで、プログ
ラムの解析が容易となる。
The internal state output circuit may output the internal state information and the contents of the program counter in a time-division manner. By outputting in a time-sharing manner, it is possible to suppress an increase in the number of terminals for outputting internal state information, and to simultaneously output the internal state information and the contents of the program counter, thereby facilitating program analysis. .

【0016】さらに、上記所定の内部状態は、上記アプ
リケーションプログラム実行中に分岐が発生したとき
に、分岐アドレスと共に外部へ出力されるように構成す
ると良い。分岐が発生したときにのみ外部へ出力するこ
とにより、ハードウェアの負担が少なく効率良く内部状
態情報を出力することができる。また、内部状態情報を
分岐アドレスと共に外部へ出力することにより、プログ
ラムの解析が容易となる。
Further, it is preferable that the predetermined internal state is output to the outside together with a branch address when a branch occurs during execution of the application program. By outputting to the outside only when a branch occurs, the internal state information can be output efficiently with less burden on the hardware. Also, by outputting the internal state information to the outside together with the branch address, the analysis of the program becomes easy.

【0017】[0017]

【発明の実施の形態】以下、本発明の好適な実施例を図
面に基づいて説明する。図1には、プログラムのブレー
ク機能やバス上の信号のトレース機能やエミュレーショ
ン制御機能、通信機能などのデバッグ機能を備えた本発
明に係るマイクロコンピュータの一実施例の概略構成が
示されている。特に制限されないが、図1に示されてい
る各回路ブロックは、公知の半導体集積回路の製造技術
により、単結晶シリコンのような1個の半導体チップ上
に形成されている。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Preferred embodiments of the present invention will be described below with reference to the drawings. FIG. 1 shows a schematic configuration of an embodiment of a microcomputer according to the present invention having a debugging function such as a program break function, a signal trace function on a bus, an emulation control function, and a communication function. Although not particularly limited, each circuit block shown in FIG. 1 is formed on one semiconductor chip such as single crystal silicon by a known semiconductor integrated circuit manufacturing technique.

【0018】図1に示されているように、この実施例の
マイクロコンピュータは、プログラム制御方式の中央処
理ユニットCPU、CPUが実行するプログラムや制御
に必要な固定データを記憶するリード・オンリ・メモリ
ROM、ユーザ・プログラムを格納したりCPUの作業
領域を提供するとともにプログラムの実行に伴って得ら
れたデータを一時的に格納したりするためのランダム・
アクセス・メモリRAM、データの一時記憶領域を提供
するキャッシュメモリCACHE、該キャッシュメモリ
のデータブロックの置換等の制御を含むメモリ全般の管
理を行なうメモリ管理ユニットMMU、エミュレーショ
ンの際にユーザが指定したブレークポイントでCPUに
対しプログラムの実行停止を要求したりするユーザ・ブ
レーク・コントローラUBC、エミュレーション用プロ
グラムの一部が格納されるメモリを備えユーザブレイク
制御回路UBCなどエミュレーションに関連する回路に
対する制御信号を形成するエミュレーション制御回路E
MC、エミュレーション中にバスBUS上の信号を採取
するためのトレースバッファTBF、外部からの制御信
号や転送クロックを受けたり該転送クロックに同期して
トレースバッファTBFに採取された内容を外部へ出力
したりするユーザ・デバッグ・インタフェース回路UD
I/F、ユーザ・プログラム実行中にCPU内のプログ
ラムカウンタPCの値(例えば分岐アドレス)等をリア
ルタイムに出力する内部状態出力回路AVDなどにより
構成されており、これらの回路は、アドレスバスおよび
データバスを含む内部バスBUSを介して互いに接続さ
れている。
As shown in FIG. 1, the microcomputer of this embodiment comprises a central processing unit CPU of a program control system, a read-only memory for storing programs executed by the CPU and fixed data necessary for control. A random access memory (ROM) for storing a user program, providing a work area for the CPU, and temporarily storing data obtained during execution of the program.
An access memory RAM, a cache memory CACHE for providing a temporary storage area for data, a memory management unit MMU for managing the entire memory including control such as replacement of data blocks in the cache memory, and a break specified by a user during emulation A user break controller UBC for requesting the CPU to stop the execution of the program at a point, a memory for storing a part of an emulation program is provided, and a control signal for a circuit related to emulation such as a user break control circuit UBC is formed. Emulation control circuit E
MC, a trace buffer TBF for sampling a signal on the bus BUS during emulation, receiving a control signal or transfer clock from the outside, or outputting the contents collected in the trace buffer TBF to the outside in synchronization with the transfer clock User debug interface circuit UD
An I / F, an internal state output circuit AVD for outputting a value (for example, a branch address) of a program counter PC in the CPU during execution of a user program, and the like in real time. They are connected to each other via an internal bus BUS including a bus.

【0019】上記インタフェース回路UDI/Fは、エ
ミュレーションモード時にCPUの制御に従って外部の
ホストコンピュータ30との間のデータ通信を行なうよ
うに構成される。特に制限されるものでないが、このデ
ータ通信はシリアル通信である。また、上記メモリ管理
ユニットMMUは、CPUから出力される論理アドレス
を物理アドレスに変換するアドレス変換機能も備えてい
る。ユーザ・プログラムの実行状態からエミュレーショ
ン制御状態への遷移は、所定の命令を実行したりブレー
ク制御回路におけるブレーク条件が成立したことなどに
より発生する。
The interface circuit UDI / F is configured to perform data communication with an external host computer 30 under the control of the CPU in the emulation mode. Although not particularly limited, this data communication is a serial communication. The memory management unit MMU also has an address conversion function of converting a logical address output from the CPU into a physical address. The transition from the execution state of the user program to the emulation control state occurs when a predetermined instruction is executed or a break condition in a break control circuit is satisfied.

【0020】この実施例においては、CPUによるキャ
ッシュメモリCACHEからのフェッチやオペランドの
アクセス、キャッシュのヒットやミスヒットの発生など
の状態の発生回数を計数することができる例えば48ビ
ットのパフォーマンスカウンタPCNTが設けられてい
る。しかも、このパフォーマンスカウンタPCNTに対
応されたレジスタが設けられており、このレジスタを設
定することによりパフォーマンスカウンタPCNTが計
数すべき状態を選択することができるように構成されて
いる。特に制限されないが、この実施例のマイクロコン
ピュータには、上記パフォーマンスカウンタPCNTが
2個設けられており、それぞれ独立に計数すべき状態発
生を設定できるように構成されている。
In this embodiment, for example, a 48-bit performance counter PCNT capable of counting the number of occurrences of a state such as a fetch from the cache memory CACHE by the CPU, access of an operand, occurrence of a cache hit or a mishit, or the like is provided. Is provided. In addition, a register corresponding to the performance counter PCNT is provided, and by setting this register, a state in which the performance counter PCNT should count can be selected. Although not particularly limited, the microcomputer of this embodiment is provided with the two performance counters PCNT, and is configured so that the occurrence of a state to be counted can be set independently.

【0021】上記パフォーマンスカウンタPCNTによ
る所定の内部状態の発生回数の計数は、例えばMMUで
生成されるキャッシュヒット信号やミスヒット信号など
の内部信号を計数するように構成することで可能であ
る。そして、この実施例においては、上記パフォーマン
スカウンタPCNTの値が、上記内部状態出力回路AV
Dへ供給され、ユーザ・プログラム実行中において例え
ばプログラムで分岐が発生した場合などに、内部状態出
力回路AVDから外部へ出力されるように構成されてい
る。ただし、パフォーマンスカウンタPCNTの値は、
分岐が発生した場合などに上記内部状態出力回路AVD
へ送り、外部へ出力させるように構成しても良い。
The counting of the number of occurrences of the predetermined internal state by the performance counter PCNT can be performed by, for example, counting internal signals such as a cache hit signal and a mishit signal generated by the MMU. In this embodiment, the value of the performance counter PCNT is determined by the internal state output circuit AV.
D and is output from the internal state output circuit AVD to the outside when, for example, a branch occurs in the program during execution of the user program. However, the value of the performance counter PCNT is
The internal state output circuit AVD is used when a branch occurs.
And output to the outside.

【0022】上記内部状態出力回路AVDには、例えば
6本の外部端子T0〜T5が接続され、そのうち2本
(T0,T1)は制御用、残りの4本(T2〜T5)を
出力用として使用するように構成される。そして、この
4本の出力用外部端子より48ビットのパフォーマンス
カウンタPCNTの値を出力するため、内部状態出力回
路AVDにはパフォーマンスカウンタPCNTより48
ビット同時に送られて来た値を、4ビットずつ12回に
分割して外部端子T2〜T5より出力する機能が設けら
れる。さらに、内部状態出力回路AVDは、状態変化が
発生したときのCPU内のプログラムカウンタPCの値
すなわち分岐アドレスも上記パフォーマンスカウンタP
CNTの値とともに外部端子T2〜T5より時分割で出
力する機能が設けられる。
The internal state output circuit AVD is connected to, for example, six external terminals T0 to T5, of which two (T0, T1) are used for control and the remaining four (T2 to T5) are used for output. Configured to use. Then, since the 48-bit value of the performance counter PCNT is output from these four output external terminals, the internal state output circuit AVD outputs 48 bits from the performance counter PCNT.
A function is provided to divide the value transmitted simultaneously with the bits into twelve 4-bit values and output the divided values from the external terminals T2 to T5. Further, the internal state output circuit AVD determines whether the value of the program counter PC in the CPU, that is, the branch address when the state change occurs, is the performance counter P
There is provided a function of outputting the value of CNT from the external terminals T2 to T5 in a time sharing manner.

【0023】なお、内部状態出力回路AVDがパフォー
マンスカウンタPCNTの値を出力する場合、48ビッ
ト全てを毎回出力すると時間がかかるので、変化してい
るビットのみを出力するような機能を内部状態出力回路
AVDに持たせるようにしても良い。また、上記制御用
端子T0,T6を用いて、内部状態出力回路AVDに対
してプログラムカウンタPCの値とパフォーマンスカウ
ンタPCNTの値のいずれの値を出力するのか、あるい
は両方出力するのかの指令を入力できるように構成して
も良い。
In the case where the internal state output circuit AVD outputs the value of the performance counter PCNT, it takes time to output all 48 bits every time. Therefore, the internal state output circuit AVD has a function of outputting only the changed bits. The AVD may be provided. Also, using the control terminals T0 and T6, a command is input to the internal state output circuit AVD as to which of the value of the program counter PC and the value of the performance counter PCNT is to be output, or whether both are to be output. You may comprise so that it may be possible.

【0024】図2には、上記内部状態出力回路AVDに
より外部端子T2〜T5より内部状態情報を出力するタ
イミングの一例を説明するためのフローチャートが示さ
れている。ユーザ・プログラム内の例えば関数A(独立
したルーチン)のプログラムがのように実行されてい
る途中で分岐が発生すると分岐アドレスとパフォーマン
スカウンタPCNTの値が内部状態出力回路AVDへ送
られ、さらに関数Aから関数B(サブルーチン)のプロ
グラムへの分岐が発生したとすると、この分岐の際
のPC値すなわち分岐アドレスとパフォーマンスカウン
タPCNTの値が内部状態出力回路AVDへ送られ、外
部端子T2〜T5より出力される。
FIG. 2 is a flowchart for explaining an example of the timing at which the internal state output circuit AVD outputs internal state information from the external terminals T2 to T5. If a branch occurs during the execution of the program of the function A (independent routine) in the user program, for example, the branch address and the value of the performance counter PCNT are sent to the internal state output circuit AVD. If a branch to the program of the function B (subroutine) occurs, the PC value at the time of the branch, that is, the branch address and the value of the performance counter PCNT are sent to the internal state output circuit AVD and output from the external terminals T2 to T5 Is done.

【0025】また、分岐先の関数Bのプログラムの実行
が終了して元の関数Aのプログラムに復帰する分岐
の際のPC値すなわち分岐アドレスとパフォーマンスカ
ウンタPCNTの値も内部状態出力回路AVDへ送ら
れ、外部端子T2〜T5より出力される。その後、関数
Aのプログラムがのように実行されている途中で分岐
が発生すればそのときの分岐アドレスとパフォーマンス
カウンタPCNTの値も内部状態出力回路AVDへ送ら
れ、外部端子T2〜T5より出力されるように構成され
る。
The PC value, ie, the branch address and the value of the performance counter PCNT at the time of the branch returning to the original program of the function A after the execution of the program of the function B at the branch destination is also transmitted to the internal state output circuit AVD. And output from external terminals T2 to T5. Thereafter, if a branch occurs during the execution of the program of the function A, the branch address at that time and the value of the performance counter PCNT are also sent to the internal state output circuit AVD and output from the external terminals T2 to T5. It is configured to be.

【0026】図3に、本発明が適用されたマイクロコン
ピュータを使用したエミュレータの概略構成図を示す。
FIG. 3 shows a schematic configuration diagram of an emulator using a microcomputer to which the present invention is applied.

【0027】この実施例のエミュレータは、ユーザシス
テムに搭載されるマイクロコンピュータに、プログラム
のブレーク機能やバス上の信号のトレース機能やエミュ
レーション制御機能、通信機能などを持たせて自分自身
でデバッグを行えるようにしたオンチップデバッグ方式
のエミュレータである。
The emulator of this embodiment can perform debugging on its own by providing a microcomputer mounted on a user system with a program break function, a signal trace function on a bus, an emulation control function, a communication function, and the like. This is an on-chip debug emulator.

【0028】図3のオンチップデバッグ方式のエミュレ
ータにおいては、エミュレーション機能を有するマイク
ロコンピュータ21が搭載されたユーザシステム20の
ボード上に、マイクロコンピュータ21の通信ポートと
接続されたソケット22が設けられ、このソケット22
にはエミュレータ専用PCカード10から延設されたケ
ーブル23の先端に設けられたコネクタ24が結合可能
に構成されている。上記エミュレータ用専PCカード1
0は、もっぱらユーザ・システムのマイクロコンピュー
タ21とパーソナル・コンピュータなどのホストコンピ
ュータ30との通信のためのインタフェース機能を有す
るものであり、このインタフェース機能として例えばJ
TAG(Joint Test Action Group)で規定している規
格のインタフェース方式を採用することができ、これに
より汎用性を持たせることができる。
In the emulator of the on-chip debugging system shown in FIG. 3, a socket 22 connected to a communication port of the microcomputer 21 is provided on a board of a user system 20 on which a microcomputer 21 having an emulation function is mounted. This socket 22
A connector 24 provided at the end of a cable 23 extended from the PC card 10 dedicated to the emulator is connectable. Special PC card for emulator 1
0 has an interface function exclusively for communication between the microcomputer 21 of the user system and the host computer 30 such as a personal computer.
An interface system of a standard defined by a TAG (Joint Test Action Group) can be adopted, thereby providing versatility.

【0029】ユーザ・プログラムのデバックに際して
は、前記実施例のマイクロコンピュータに接続されるホ
ストコンピュータ30側に、上記外部端子T2〜T5よ
り出力されるデータを蓄積するトレースメモリを設けて
おくとともに、予めユーザ・プログラムをデバック情報
付きコンパイルしてホストコンピュータのファイル(ハ
ードディスク)に入れてソフトウェアとリンクさせてお
くことで、デバッグ対象のマイクロコンピュータから出
力されたアドレス値からユーザ・プログラムの該当する
ソース行(関数名)を解析できるようにしておく。
When debugging a user program, a trace memory for storing data output from the external terminals T2 to T5 is provided on the host computer 30 connected to the microcomputer of the above-described embodiment. By compiling the user program with debug information, putting it in a file (hard disk) of the host computer and linking it with the software, the corresponding source line of the user program (from the address value output from the microcomputer to be debugged) Function name) can be analyzed.

【0030】また、ホストコンピュータ側にはトレース
されたデータを解析する次のようなソフトウェアを用意
しておく。これにより、ユーザ・プログラムの実行を停
止することなくCPUの動作状態を把握することができ
るようになる。ホストコンピュータ側に必要とされる上
記トレースメモリのデータ解析ソフトの条件は以下の通
りである。 (1)分岐アドレスからユーザ・プログラムの該当する
ソース行(関数名)を解析できること。 (2)分岐アドレスから分岐元と分岐先の関数名が異な
るもの(サブルーチン分岐)を抽出できること。 (3)解析した関数名とパフォーマンスカウンタPCN
Tの値とから各関数におけるパフォーマンスカウンタP
CNTの値の変化量を算出できること。
Further, the following software for analyzing the traced data is prepared on the host computer side. Thus, the operation state of the CPU can be grasped without stopping the execution of the user program. The conditions of the data analysis software of the trace memory required on the host computer side are as follows. (1) The applicable source line (function name) of the user program can be analyzed from the branch address. (2) A function (subroutine branch) having different function names at the branch source and the branch destination can be extracted from the branch address. (3) Analyzed function name and performance counter PCN
From the value of T, the performance counter P for each function
Able to calculate the amount of change in the value of CNT.

【0031】解析ソフトに上記のような機能を持たせる
ことにより、例えばパフォーマンスカウンタPCNTが
計数する内部状態として、キャッシュメモリへのアクセ
スとキャッシュヒットもしくはミスヒットを設定してユ
ーザ・プログラムを実行させれば、図3の例では分岐元
のアドレス値と分岐先のアドレス値から関数Bを抽出す
ることができ、関数AからBへの分岐時と関数BからA
への復帰時のパフォーマンスカウンタPCNTの値の差
を計算することで関数Bの実行中におけるキャッシュヒ
ット率を知ることができる。
By providing the analysis software with the functions described above, for example, an access to the cache memory and a cache hit or mishit are set as the internal states counted by the performance counter PCNT, and the user program is executed. For example, in the example of FIG. 3, the function B can be extracted from the address value of the branch source and the address value of the branch destination.
By calculating the difference between the values of the performance counter PCNT at the time of return to, the cache hit rate during execution of the function B can be known.

【0032】なお、図1には示されていないが、この実
施例のマイクロコンピュータには、内部の動作に必要と
されるクロックを発生するクロック制御回路、所定の割
込み要因の発生に基づいてCPUに対して割込み要求を
行なう割込みコントローラ、アナログ・デジタル変換回
路,外部装置との間でシリアル通信を行なうシリアルコ
ミュニケーションインタフェース,時間管理用のタイマ
ー回路などの周辺モジュールなども設けられている。さ
らに、CPUに代わって乗算などの演算処理を行なう演
算ユニットや、CPUに代わって外部のハードディスク
装置のような記憶装置と内部のRAMとの間でDMA
(ダイレクト・メモリ・アクセス)方式のデータ転送を
行なうDMAコントローラが設けられることもある。ま
た、バスがCPUバスと周辺バスとで構成される場合に
は、バス上の信号のタイミングを調整してCPUと周辺
モジュールとの間の信号の橋渡しをするバスステートコ
ントローラが設けられる。
Although not shown in FIG. 1, the microcomputer of this embodiment includes a clock control circuit for generating a clock required for internal operation, and a CPU based on the occurrence of a predetermined interrupt factor. There are also provided peripheral modules such as an interrupt controller for making an interrupt request, an analog / digital conversion circuit, a serial communication interface for performing serial communication with an external device, and a timer circuit for time management. Further, an arithmetic unit for performing arithmetic processing such as multiplication in place of the CPU, and a DMA between an internal RAM and a storage device such as an external hard disk device in place of the CPU.
A DMA controller for performing (direct memory access) data transfer may be provided. When the bus is composed of a CPU bus and a peripheral bus, a bus state controller is provided to adjust the timing of signals on the bus to bridge signals between the CPU and the peripheral modules.

【0033】以上本発明者によってなされた発明を実施
例に基づき具体的に説明したが、本発明は上記実施例に
限定されるものではなく、その要旨を逸脱しない範囲で
種々変更可能であることはいうまでもない。例えば、上
記実施例では、ユーザ・プログラム実行中に分岐が発生
したときにパフォーマンスカウンタPCNTの値をチッ
プ外部へ出力するようにした場合について説明したが、
予め指定した命令が実行されたときに予め指定した内蔵
I/Oレジスタの内容を、内部状態出力回路AVDによ
りチップ外部へ出力するように構成することも可能であ
る。これにより、所望のタイミングにおける周辺モジュ
ールの動作状態を、ユーザ・プログラムを停止させるこ
となく知ることができるようになる。具体的には、例え
ばシリアルコミュニケーションインタフェースにおける
送受信データを出力させて外部でトレースし解析を行な
うことで、送受信の軌跡すなわちどういう内容でシリア
ルデータの送受信が行なわれたかを知ることができる。
Although the invention made by the inventor has been specifically described based on the embodiments, the present invention is not limited to the above embodiments, and various modifications can be made without departing from the gist of the invention. Needless to say. For example, in the above embodiment, the case has been described where the value of the performance counter PCNT is output to the outside of the chip when a branch occurs during execution of the user program.
It is also possible to configure so that the content of the pre-designated internal I / O register is output to the outside of the chip by the internal state output circuit AVD when the pre-specified instruction is executed. As a result, the operation state of the peripheral module at a desired timing can be known without stopping the user program. Specifically, for example, by transmitting / receiving data in the serial communication interface and tracing and analyzing the data externally, it is possible to know the trajectory of the transmission / reception, that is, the content of the transmission / reception of the serial data.

【0034】また、予め指定したリセットや割込み処理
などの例外処理が発生したときに、予め指定した内蔵I
/Oレジスタの内容と分岐前のプログラムカウンタPC
の値をチップ外部へ出力するように構成することも可能
である。これにより、例えばMMUに内蔵されている論
理アドレスと物理アドレスの変換用テーブルがテーブル
全体でなく一部であり、テーブルの入れ替えを行なうよ
うな機能を有する場合に、アドレス変換テーブルの参照
ミスが発生したときに、例外を起こす要因となったメモ
リアクセスのアドレスを格納しているレジスタの内容を
チップ外部へ出力させることで、アドレス変換テーブル
に登録されている論理アドレスの軌跡(変化の履歴)を
知ることができる。
When an exception process such as a preset reset or interrupt process occurs, a predetermined internal I
/ O register contents and program counter PC before branch
Is output to the outside of the chip. As a result, for example, when the conversion table for logical addresses and physical addresses contained in the MMU is not the entire table but a part of the table and has a function of exchanging the tables, a reference error in the address conversion table occurs. Then, by outputting the contents of the register storing the address of the memory access which caused the exception to the outside of the chip, the locus (change history) of the logical address registered in the address conversion table can be obtained. You can know.

【0035】以上の説明では主として本発明者によって
なされた発明をその背景となった利用分野であるエミュ
レーション機能を有するオンチップデバッグ方式のマイ
クロコンピュータに適用した場合について説明したが、
本発明はそれに限定されるものでなく、マイクロコンピ
ュータ以外のエミュレーション機能を有するデータ処理
用LSIに適用することができる。
In the above description, mainly the case where the invention made by the present inventor is applied to an on-chip debug type microcomputer having an emulation function, which is a field of application as the background, has been described.
The present invention is not limited to this, and can be applied to a data processing LSI having an emulation function other than a microcomputer.

【0036】[0036]

【発明の効果】本願において開示される発明のうち代表
的なものによって得られる効果を簡単に説明すれば下記
のとおりである。すなわち、本発明に従うと、エミュレ
ーション機能を有するオンチップデバッグ方式のマイク
ロコンピュータにおいて、ユーザ・プログラムの実行中
においてもCPUの内部状態を示す情報が外部に出力さ
れるため、正確なデバッグが可能になる。また、端子数
を増加させることなくユーザ・プログラムの実行中にお
いても内部状態を示す情報を外部に出力することができ
るという効果がある。
The effects obtained by typical ones of the inventions disclosed in the present application will be briefly described as follows. That is, according to the present invention, in the on-chip debugging type microcomputer having the emulation function, information indicating the internal state of the CPU is output to the outside even during the execution of the user program, so that accurate debugging can be performed. . Further, there is an effect that information indicating the internal state can be output to the outside even during the execution of the user program without increasing the number of terminals.

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

【図1】エミュレーション機能を備えたオンチップデバ
ッグ方式のマイクロコンピュータの一例を示すブロック
図である。
FIG. 1 is a block diagram showing an example of an on-chip debugging type microcomputer having an emulation function.

【図2】本発明の機能が有効に働く場合のプログラムの
流れを示すフローチャートである。
FIG. 2 is a flowchart showing a program flow when a function of the present invention works effectively.

【図3】本発明が適用されたマイクロコンピュータを使
用したオンチップデバッグ方式のエミュレータを示すブ
ロック図である。
FIG. 3 is a block diagram showing an on-chip debug emulator using a microcomputer to which the present invention is applied;

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

20 ユーザシステム 21 エミュレーション機能を有するマイクロコンピュ
ータ 22 ソケット 23 ケーブル 24 コネクタ CPU 中央処理ユニット INTC 割込み制御回路 UBC ユーザ・ブレーク制御回路 EMC エミュレーション制御回路 TBF トレースバッファ UDI/F ユーザ・デバッグ・インタフェース AVD 内部状態出力回路 PCNT パフォーマンスカウンタ
Reference Signs List 20 user system 21 microcomputer having emulation function 22 socket 23 cable 24 connector CPU central processing unit INTC interrupt control circuit UBC user break control circuit EMC emulation control circuit TBF trace buffer UDI / F user debug interface AVD internal state output circuit PCNT performance counter

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 アプリケーションプログラムの実行を所
望の箇所で停止可能なブレーク機能と、上記アプリケー
ションプログラム実行中の任意の時点での内部バスの情
報を取得可能なトレース機能と、上記ブレーク機能によ
りアプリケーションプログラムの実行が停止されている
間に上記トレース機能により取得された情報を外部へ出
力する機能とを有するマイクロコンピュータにおいて、
アプリケーションプログラム実行中に所定の内部状態情
報を外部へ出力させる内部状態出力回路と、前記内部状
態情報を出力するための端子とを設けたことを特徴とす
るマイクロコンピュータ。
1. A break function capable of stopping execution of an application program at a desired position, a trace function capable of acquiring information on an internal bus at any time during the execution of the application program, and an application program executed by the break function. A function of outputting information obtained by the trace function to the outside while execution of the program is stopped,
A microcomputer comprising: an internal state output circuit for outputting predetermined internal state information to the outside during execution of an application program; and a terminal for outputting the internal state information.
【請求項2】 アプリケーションプログラム実行中にお
ける所定の内部状態の発生を計数する1または2以上の
カウンタを備え、該カウンタの内容を上記内部状態情報
として出力するようにしたことを特徴とする請求項1に
記載のマイクロコンピュータ。
2. The apparatus according to claim 1, further comprising one or more counters for counting occurrences of a predetermined internal state during execution of the application program, and outputting the contents of said counter as said internal state information. 2. The microcomputer according to 1.
【請求項3】 上記カウンタは、複数種類の内部状態の
うち予め設定された任意の内部状態の発生回数を選択的
に計数可能に構成されていることを特徴とする請求項1
または2に記載のマイクロコンピュータ。
3. The counter according to claim 1, wherein the counter is capable of selectively counting the number of occurrences of a predetermined internal state among a plurality of types of internal states.
Or the microcomputer according to 2.
【請求項4】 上記内部状態出力回路は、上記内部状態
情報とプログラムカウンタの内容とを時分割方式で出力
するように構成されていることを特徴とする請求項1、
2または3に記載のマイクロコンピュータ。
4. The apparatus according to claim 1, wherein said internal state output circuit is configured to output the internal state information and the contents of a program counter in a time-division manner.
The microcomputer according to 2 or 3.
【請求項5】 上記所定の内部状態は、上記アプリケー
ションプログラム実行中に分岐が発生したときに、分岐
アドレスと共に外部へ出力されるように構成されている
ことを特徴とする請求項4に記載のマイクロコンピュー
タ。
5. The apparatus according to claim 4, wherein the predetermined internal state is output to the outside together with a branch address when a branch occurs during execution of the application program. Microcomputer.
JP2000171761A 2000-06-08 2000-06-08 Microcomputer Pending JP2001350648A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000171761A JP2001350648A (en) 2000-06-08 2000-06-08 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000171761A JP2001350648A (en) 2000-06-08 2000-06-08 Microcomputer

Publications (1)

Publication Number Publication Date
JP2001350648A true JP2001350648A (en) 2001-12-21

Family

ID=18674273

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000171761A Pending JP2001350648A (en) 2000-06-08 2000-06-08 Microcomputer

Country Status (1)

Country Link
JP (1) JP2001350648A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005250821A (en) * 2004-03-04 2005-09-15 Renesas Technology Corp Emulator and microprocessor
JP2008513875A (en) * 2004-09-14 2008-05-01 フリースケール セミコンダクター インコーポレイテッド Method and apparatus for non-intrusive tracking
JP2009009596A (en) * 2008-08-18 2009-01-15 Renesas Technology Corp Microcomputer
JP2012181603A (en) * 2011-02-28 2012-09-20 Verification Technology Inc Semiconductor device provided with verification function
WO2012127955A1 (en) 2011-03-24 2012-09-27 ルネサスエレクトロニクス株式会社 Semiconductor device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005250821A (en) * 2004-03-04 2005-09-15 Renesas Technology Corp Emulator and microprocessor
JP2008513875A (en) * 2004-09-14 2008-05-01 フリースケール セミコンダクター インコーポレイテッド Method and apparatus for non-intrusive tracking
JP2009009596A (en) * 2008-08-18 2009-01-15 Renesas Technology Corp Microcomputer
JP2012181603A (en) * 2011-02-28 2012-09-20 Verification Technology Inc Semiconductor device provided with verification function
WO2012127955A1 (en) 2011-03-24 2012-09-27 ルネサスエレクトロニクス株式会社 Semiconductor device
JP5628411B2 (en) * 2011-03-24 2014-11-19 ルネサスエレクトロニクス株式会社 Semiconductor device

Similar Documents

Publication Publication Date Title
US5911059A (en) Method and apparatus for testing software
KR0168656B1 (en) Data processing system
US6145122A (en) Development interface for a data processor
US8327039B2 (en) Integrated DMA processor and PCI express switch for a hardware-based functional verification system
US4231087A (en) Microprocessor support system
US6145123A (en) Trace on/off with breakpoint register
EP0942372B1 (en) Processor with breakpoint circuit
EP0084431A2 (en) Monitoring computer systems
WO2006117377A1 (en) Procedure and device for emulating a programmable unit
US20160231376A1 (en) System And Method For Generating Cross-Core Breakpoints In A Multi-Core Microcontroller
EP0942373B1 (en) Adapter device with a local memory and method for processor emulation
EP0942375B1 (en) Adapter device with a local memory and method for processor emulation
CN113849433B (en) Execution method and device of bus controller, computer equipment and storage medium
EP0942374B1 (en) Method and device to simulate interruptions for the emulation of a processor
JP2001350648A (en) Microcomputer
US8103496B1 (en) Breakpoint control in an in-circuit emulation system
EP0942371A1 (en) Debugging method for a microcomputer
JPH06214819A (en) Information processor and system and method for evaluating the same
US7451074B2 (en) Embedded microprocessor emulation method
JP2004086447A (en) Microcomputer
JP4968799B2 (en) Microcomputer
JP2876909B2 (en) Interrupt emulator
Feng et al. A SoC architecture compatible with Cortex-M4
JP2558902B2 (en) Semiconductor integrated circuit device
Kosowska et al. Implementing the Bus Protocol of a Microprocessor in a Software-Defined Computer

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040326

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040329

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20061106

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20061207

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20070405