JP2008276683A - Testing device - Google Patents

Testing device Download PDF

Info

Publication number
JP2008276683A
JP2008276683A JP2007122389A JP2007122389A JP2008276683A JP 2008276683 A JP2008276683 A JP 2008276683A JP 2007122389 A JP2007122389 A JP 2007122389A JP 2007122389 A JP2007122389 A JP 2007122389A JP 2008276683 A JP2008276683 A JP 2008276683A
Authority
JP
Japan
Prior art keywords
bit pattern
program
management table
instruction
registration
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
JP2007122389A
Other languages
Japanese (ja)
Inventor
Atsushi Suzuki
敦 鈴木
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.)
NEC Electronics Corp
Original Assignee
NEC Electronics 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 NEC Electronics Corp filed Critical NEC Electronics Corp
Priority to JP2007122389A priority Critical patent/JP2008276683A/en
Publication of JP2008276683A publication Critical patent/JP2008276683A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To provide a testing device capable of acquiring an accurate profile without correcting a program. <P>SOLUTION: This testing device 1 has a command fetching unit 11 for fetching a command when executing the program, a registration memory 21 for storing an optional bit pattern, a bit comparison mechanism 23 for detecting the consistency of the fetched command with the bit pattern stored in the testing device 21, a control table 22 for registering the detection frequency of the optional bit pattern, and a registration/updating mechanism 24 for registering the execution thereof into the control table 22 or for updating an accumulated execution frequency thereof in the control table 22, when a consistency detecting part detects the consistency. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、マイコン上で動作するソフトウェアプログラムの性能解析を行なう試験装置に関する。   The present invention relates to a test apparatus for performing performance analysis of a software program operating on a microcomputer.

組み込みソフトウェアプログラムの開発では、プログラムの実行性能向上のため、先ず、実際にプログラムを動作させてプログラムの動作遷移をデータ(プロファイルデータ)として取得する。そしてこれを解析してプログラムのボトルネックを認識し、プログラム修正/性能改善を行なうという開発形態が浸透しつつある。よって、このような開発フローを助けるツールとして、プログラム動作解析ツールへの要求が高まってきている。現在のプログラム動作解析ツールは、以下に述べる二つの方法によってプロファイルデータの取得を行なっている。   In the development of an embedded software program, in order to improve the execution performance of the program, first, the program is actually operated and the operation transition of the program is acquired as data (profile data). The development form of analyzing this, recognizing the bottleneck of the program, and performing program modification / performance improvement is spreading. Accordingly, there is an increasing demand for a program operation analysis tool as a tool for assisting such a development flow. Current program behavior analysis tools acquire profile data by the following two methods.

先ず、ソフトウェア的にプロファイルデータを取得する方法について説明する。図3は、プログラムを修正しソフトウェア的にプロファイルデータを取得する方法を示す図である。このシステムは、組み込みプログラム(A)112及びプロファイル取得用プログラム(B)113をコンパイラするビルダ/コンパイラ111と、プロファイル取得用プログラム(B)113を実行するプログラム実行環境114と、この実行を制御するデバッガ115とからなる。プログラム実行環境114の実行によりプロファイルデータ116を取得する。   First, a method for acquiring profile data in software will be described. FIG. 3 is a diagram showing a method of correcting profile and acquiring profile data by software. This system includes a builder / compiler 111 that compiles the embedded program (A) 112 and the profile acquisition program (B) 113, a program execution environment 114 that executes the profile acquisition program (B) 113, and controls this execution. It consists of a debugger 115. The profile data 116 is acquired by executing the program execution environment 114.

この方法では、プログラムにソフトウェアのプロファイルコードを挿入したプロファイル取得用プログラム(B)113を作成し、これをターゲット、エミュレータ又はシミュレータなどのプログラム実行環境114上で実行しプロファイルデータ16を取得する。   In this method, a profile acquisition program (B) 113 in which a software profile code is inserted into a program is created and executed on a program execution environment 114 such as a target, an emulator, or a simulator, and profile data 16 is acquired.

次に、図3に示すこのソフトウェアによるプロファイルデータ取得方法について説明する。ソフトウェアによるプロファイルデータの取得では、組込みプログラム(A)112に対して組み込みプログラム(A)112のプロファイル取得用プログラム(B)113を作成し、これをターゲット、エミュレータ又はシミュレータ上で実行する。プロファイル取得用プログラム(B)113の生成は、一般的にコンパイル時にプロファイルデータ取得用プログラム生成オプションを指定することによって行なう。コンパイラ111は、プロファイルデータ取得用プログラム生成オプションが指定されると、関数の先頭、基本ブロックの先頭などにプロファイルデータ取得用コードを挿入する。この取得コードが実行されることによって、ある関数、ある基本ブロックの実行累積回数がターゲットやホストのメモリ上に保存される。これを後に、実行解析ツールなどを用いて参照することでプログラム(A)112の実行遷移を知ることが可能となる。   Next, a profile data acquisition method using this software shown in FIG. 3 will be described. In profile data acquisition by software, a profile acquisition program (B) 113 of the embedded program (A) 112 is created for the embedded program (A) 112, and this is executed on the target, emulator or simulator. The profile acquisition program (B) 113 is generally generated by specifying a profile data acquisition program generation option during compilation. When the profile data acquisition program generation option is designated, the compiler 111 inserts the profile data acquisition code at the beginning of a function, the beginning of a basic block, or the like. By executing this acquisition code, the cumulative number of executions of a certain function and a certain basic block is stored in the memory of the target or host. By referring to this later using an execution analysis tool or the like, it becomes possible to know the execution transition of the program (A) 112.

次に、ハードウェアによるプロファイルデータ取得方法について説明する。図4は、プログラムは修正せずエミュレータのトレース機能を用いて取得したトレースデータを元にプロファイルデータを取得する方法を示す図である。このシステムは、組み込みプログラム(A)122をコンパイラするビルダ/コンパイラ121と、組み込みプログラム(A)を実行するエミュレータ123と、この実行を制御するデバッガ124を有する。エミュレータ123から取得したトレースデータ125は、解析ツール126により解析されプロファイルデータ127が取り出される。この方法では、組み込みプログラム(A)122をエミュレータ123上で実行し、エミュレータ123のトレース情報出力機能によりトレースデータ125を取得、このデータを元にプロファイルデータ127を取得する。   Next, a method for acquiring profile data by hardware will be described. FIG. 4 is a diagram showing a method for obtaining profile data based on trace data obtained by using the trace function of the emulator without correcting the program. This system includes a builder / compiler 121 that compiles the embedded program (A) 122, an emulator 123 that executes the embedded program (A), and a debugger 124 that controls this execution. The trace data 125 acquired from the emulator 123 is analyzed by the analysis tool 126 and profile data 127 is extracted. In this method, the embedded program (A) 122 is executed on the emulator 123, the trace data 125 is acquired by the trace information output function of the emulator 123, and the profile data 127 is acquired based on this data.

次に、図4に示すハードウェアによるプロファイルデータ取得方法について説明する。ハードウェアのプロファイルデータ取得では組込みプログラム(A)122自体は修正する必要がない。プログラムを実行する環境として、トレースデータ125を取得することができるエミュレータ123を準備し、エミュレータ123上でプログラムを実行し、全実行のトレースデータ125を取得する。トレースデータ125には、プログラムの実行開始時点から終了時点までの全実行命令の履歴(実行アドレス、実行命令、アクセスアドレスなどの情報)が出力される。このトレースデータ125を実行解析ツール126などで読み取ることで、トレースデータ125からプロファイルデータ127への変換を行いプログラムの実行遷移を知ることが可能となる。   Next, a profile data acquisition method by hardware shown in FIG. 4 will be described. In acquiring hardware profile data, the embedded program (A) 122 itself does not need to be modified. As an environment for executing the program, an emulator 123 capable of acquiring the trace data 125 is prepared, the program is executed on the emulator 123, and the trace data 125 for all executions is acquired. In the trace data 125, a history of all execution instructions (information such as execution address, execution instruction, and access address) from the execution start point to the end point of the program is output. By reading the trace data 125 with the execution analysis tool 126 or the like, it is possible to convert the trace data 125 into the profile data 127 and know the execution transition of the program.

また、特許文献1には、任意のカストマーワークロードにおけるプロセッサステートを消極的に監視すると共に、ボトルネックを特徴付ける方法及び装置が開示されている。この特許文献1においては、CPU内部の命令の実行状態を外部ピンに接続したロジックアナライザで観測できるようにするため、CPU内部の整数及び浮動小数点データパスに対して10本のPIPE信号を設けている。PIPE信号は、PIPE9:いずれかの有効データメモリリファレンス命令が現れたときアサートされる、PIPE8:いずれかの有効コントロールトランスファ命令が現れたときアサートされる、といった信号であり、これらの信号を観測することで命令の合計数の計数ができ、また命令グループのヒストグラムによる解析を行なうことができる。
特開平6−89205号公報
Patent Document 1 discloses a method and an apparatus for characterizing a bottleneck while passively monitoring a processor state in an arbitrary customer workload. In this Patent Document 1, 10 PIPE signals are provided for integer and floating point data paths in the CPU so that the execution state of instructions in the CPU can be observed by a logic analyzer connected to an external pin. Yes. The PIPE signal is a signal such as PIPE9: asserted when any valid data memory reference instruction appears, PIPE8: asserted when any valid control transfer instruction appears, and these signals are observed. Thus, the total number of instructions can be counted, and an analysis by instruction group histogram can be performed.
JP-A-6-89205

既存のプロファイルデータ取得の仕組みに関する問題点を以下に説明する。まず、図3で示したソフトウェアによる取得方法では、再コンパイルを行い、プロファイルデータ取得用プログラム(B)113を得なければならない。これは、最終的に製品に組み込まれる組み込みプログラム(A)112とは、プログラムとして別のものとなる。ソフトウェアによるプロファイルデータ取得の仕組みで用いられるプロファイルコードは、その中で、各関数や基本ブロックを識別するよう割り振られた識別番号テーブルに対し、実行回数を累積していくなどの処理を行なっている。よって、組込みプログラム(A)112とプロファイルデータ取得用プログラム(B)113は、関数の呼び出し関係は同一であるが、コードサイズ、実行速度は異なる。   Problems related to the existing profile data acquisition mechanism will be described below. First, in the acquisition method using software shown in FIG. 3, re-compilation must be performed to obtain the profile data acquisition program (B) 113. This is different from the built-in program (A) 112 that is finally built into the product as a program. The profile code used in the profile data acquisition mechanism by software performs processing such as accumulating the number of executions for the identification number table allocated to identify each function and basic block. . Therefore, the built-in program (A) 112 and the profile data acquisition program (B) 113 have the same function calling relationship, but differ in code size and execution speed.

実行速度の違いは、割り込みなどの非同期に制御が移るプログラム部分の実行タイミングに影響を与えるため、実行遷移そのものも異なる結果となりうる。また、プロファイルによってプログラムのボトルネックを探し出す場合、そのマイコンのアーキテクチャ上ウィークポイントとなる命令の実行頻度を知ること(命令レベルのプロファイル)が重要であるが、ソフトウェアによるプロファイル取得方法では、その仕組み上プロファイルデータの粒度(プロファイルデータが、ある区間が実行されたことを示す時のある区間の大きさ)を基本ブロック(流入や分岐なしに一まとまりで実行される命令の塊)や関数レベル以下に小さくすることは困難であり、よって命令レベル(アセンブラ命令レベル)のプロファイルを得ることも難しいという問題点がある。   Since the difference in execution speed affects the execution timing of the program part to which control is transferred asynchronously such as an interrupt, the execution transition itself can be different. Also, when searching for the bottleneck of a program by profile, it is important to know the frequency of instruction execution (instruction level profile), which is a weak point in the architecture of the microcomputer. The granularity of profile data (profile data indicates the size of a section when a section is executed) is below the basic block (a group of instructions executed in a batch without inflow or branch) or the function level There is a problem that it is difficult to reduce the size, and it is therefore difficult to obtain a profile of an instruction level (assembler instruction level).

また、図4に示したハードウェアによる取得方法では、基本的にトレースデータを元にしたプロファイルデータの取得となるので、トレースデータが完全に取得できていることが前提となる。よってトレースデータを取得する仕組みを持たないマイコンに対しては適用が不可能である。また、最近の組込みマイコンは100MHz以上の高速で動作するものも多くなり、このようなマイコンではプログラムの実行に一対一で対応したトレースデータをエミュレータに対して漏れなく送出することがハードウェアの制約上困難になってきている。更に、トレースデータに漏れがなかったとしても、エミュレータ上で保存できるトレースデータ量は、エミュレータ上のトレースメモリサイズによって制限されるため、プログラムの実行開始時点から終了時点までの全トレースデータを保存可能なケースは稀である。トレースデータに漏れがあれば正しいプロファイルデータは得られない。また、全トレースデータが保存可能であっても、そのような場合トレースデータの総量が膨大となるためプロファイル情報への変換や、必要情報の抽出に非常に多くの時間がかかる。   Also, with the hardware acquisition method shown in FIG. 4, profile data is basically acquired based on trace data, so it is assumed that the trace data can be acquired completely. Therefore, it cannot be applied to a microcomputer that does not have a mechanism for acquiring trace data. In addition, many of the recent embedded microcomputers operate at a high speed of 100 MHz or more. In such microcomputers, it is a hardware restriction that the trace data corresponding to the execution of the program is sent to the emulator without omission. It is getting difficult. Furthermore, even if there is no omission in the trace data, the amount of trace data that can be saved on the emulator is limited by the size of the trace memory on the emulator, so all trace data from the start to the end of program execution can be saved Such cases are rare. If there is a leak in the trace data, correct profile data cannot be obtained. Even if all trace data can be saved, the total amount of trace data becomes enormous in such a case, so that it takes a very long time to convert to profile information and extract necessary information.

さらに、特許文献1に記載の技術においては、命令グループ(メモリリファレンス命令、コントロールトランスファ命令)レベルでの解析しかできないため、詳細なアセンブラ1命令レベルでの観測が困難であるという問題点がある。   Further, the technique described in Patent Document 1 has a problem that it is difficult to observe at the detailed assembler 1 instruction level because only analysis at the instruction group (memory reference instruction, control transfer instruction) level can be performed.

本発明にかかる試験装置は、プログラムの実行時に命令をフェッチする命令フェッチ部と、任意のビットパターンを保存する登録メモリと、フェッチされた命令と前記登録メモリに保存されたビットパターンとの一致を検出する一致検出部と、前記任意のビットパターンの検出回数を登録する管理テーブルと、前記一致検出部が一致検出した場合、前記管理テーブルにその検出を登録又は前記管理テーブルのその累積検出回数を更新する登録/更新部とを有するものである。   A test apparatus according to the present invention includes an instruction fetch unit that fetches an instruction when a program is executed, a registration memory that stores an arbitrary bit pattern, and a match between the fetched instruction and the bit pattern stored in the registration memory. A coincidence detection unit to be detected, a management table for registering the number of detections of the arbitrary bit pattern, and when the coincidence detection unit detects a coincidence, register the detection in the management table or the cumulative detection number of the management table It has a registration / update part to update.

本発明においては、登録メモリに保存された任意のビットパターンとフェッチした命令との一致、不一致を検出し、一致した場合はその累積検出回数を更新することで、詳細なプロファイルデータの取得を、プログラム修正なしで行うことができる。プログラムを修正しないため、プログラム実行速度及びタイミングの面でも実際のプログラムを完全に等価とすることができる。ここで、本発明の試験装置は、マイコン単体、マイコン及びエミュレータ、又はマイコン、エミュレータ及びデバッガからなるものとする。   In the present invention, it is possible to detect a match or mismatch between an arbitrary bit pattern stored in the registration memory and the fetched instruction, and when it matches, update the cumulative detection number to obtain detailed profile data. Can be done without program modification. Since the program is not modified, the actual program can be made completely equivalent in terms of program execution speed and timing. Here, the test apparatus of the present invention includes a microcomputer alone, a microcomputer and an emulator, or a microcomputer, an emulator and a debugger.

本発明によれば、プログラムを修正することなく正確なプロファイルデータを取得することができる試験装置を提供することができる。   According to the present invention, it is possible to provide a test apparatus that can acquire accurate profile data without correcting a program.

以下、本発明を適用した具体的な実施の形態について、図面を参照しながら詳細に説明する。本実施の形態においては、マイコン内部に、任意のビットパターンを保存する領域、フェッチされた命令と保存されたビットパターンとの一致検出機構、及び一致検出された場合その実行アドレスとその実行アドレスの累積実行回数を保存する機構を設けることで、マイコンの内部で任意のコードの実行累積回数を知ることができ、プロファイルデータを既存の仕組みと比較して省資源で正確に得ることができるものである。   Hereinafter, specific embodiments to which the present invention is applied will be described in detail with reference to the drawings. In the present embodiment, an area for storing an arbitrary bit pattern in the microcomputer, a coincidence detection mechanism between the fetched instruction and the stored bit pattern, and an execution address and an execution address of the coincidence are detected. By providing a mechanism to store the cumulative number of executions, it is possible to know the cumulative number of executions of arbitrary code inside the microcomputer, and to obtain profile data accurately with less resources compared to existing mechanisms. is there.

図1は、本実施の形態にかかる試験システムを示す図である。本実施の形態にかかる試験システム1は、CPU10、エミュレータ30及びホストコンピュータ40を有する。CPU10は、プロファイルユニット14を有している。CPU10は、キャッシュ12、メモリ13、メモリ13やキャッシュ12からフェッチした命令を保持する命令フェッチユニット11、及びプロファイルユニット14を有する。このCPUはエミュレータ30と接続され、エミュレータ30は、ホストコンピュータ40のデバッガ41により制御される。ここで、CPU10及びエミュレータ30でICE(in-circuit emulator)(登録商標)を構成してもよく、CPU10を実CPUとし、この実CPUチップ上にエミュレータ30を内蔵したオンチップデバッグを実現してもよい。   FIG. 1 is a diagram showing a test system according to the present embodiment. The test system 1 according to the present embodiment includes a CPU 10, an emulator 30, and a host computer 40. The CPU 10 has a profile unit 14. The CPU 10 includes a cache 12, a memory 13, an instruction fetch unit 11 that holds instructions fetched from the memory 13 and the cache 12, and a profile unit 14. This CPU is connected to the emulator 30, and the emulator 30 is controlled by a debugger 41 of the host computer 40. Here, the CPU 10 and the emulator 30 may constitute an ICE (in-circuit emulator) (registered trademark), and the CPU 10 is an actual CPU, and on-chip debugging in which the emulator 30 is built on the actual CPU chip is realized. Also good.

CPU10のプロファイルユニット14は、プロファイルするべき任意のビットパターンを保持することができる特定ビットパターン登録メモリ21を有する。特定ビットパターン登録メモリ21には、1又は複数の任意のビットパターンを登録することができる。更にプロファイルユニット14はビット比較機構23、プロファイルデータの登録/更新機構24、プロファイルデータを保存する管理テーブル22を有する。   The profile unit 14 of the CPU 10 has a specific bit pattern registration memory 21 that can hold an arbitrary bit pattern to be profiled. One or a plurality of arbitrary bit patterns can be registered in the specific bit pattern registration memory 21. The profile unit 14 further includes a bit comparison mechanism 23, a profile data registration / update mechanism 24, and a management table 22 for storing profile data.

なお、図1において、管理テーブル22及び登録/更新機構24はプロファイルユニット14に内蔵されているものとして説明するが、プロファイルユニット14の一部又は全部の機能を、エミュレータ30又はデバッガ41側で実現してもよい。   In FIG. 1, the management table 22 and the registration / update mechanism 24 are described as being built in the profile unit 14, but some or all of the functions of the profile unit 14 are realized on the emulator 30 or the debugger 41 side. May be.

次に、本実施の形態にかかる動作について説明する。図2は本実施の形態にかかる動作を示すフローチャートである。プロファイルユニット14が有する特定ビットパターン登録メモリ21は、プロファイルするべき任意のビットパターンを保持することができる。ここには使用者がホストコンピュータ40上で動作するデバッガ41から、エミュレータ30を介して任意のビットパターンを設定することができる。   Next, the operation according to the present embodiment will be described. FIG. 2 is a flowchart showing the operation according to the present embodiment. The specific bit pattern registration memory 21 included in the profile unit 14 can hold an arbitrary bit pattern to be profiled. Here, the user can set an arbitrary bit pattern via the emulator 30 from the debugger 41 operating on the host computer 40.

プロファイルユニット14が保持するビット比較機構23は、CPU10がプログラムを実行する際、命令フェッチユニット11がメモリ13やキャッシュ12からフェッチした命令と、特定ビットパターン登録メモリ21に保持されたビットパターンとの一致判定を行なう(ステップS1)。もし、合致すれば登録/更新機構24が管理テーブル22に対してプロファイルデータの登録/更新作業を行なう。管理テーブル22では、特定ビットパターン登録メモリ21に登録されたビットパターンと合致した命令の「アドレス」及びそのアドレスの「(累積実行)回数」を保持している。つまり、命令フェッチされた命令コードがビット比較機構23によって合致と認められたとき、プログラムカウンタ(PC)に保持されているその「アドレス」が管理テーブル22に未登録であれば管理テーブルにその「アドレス」と「回数(1回)」を保存する(ステップS3:No、S4)。その「アドレス」が管理テーブル22に既に登録済みであれば、該当する「アドレス」の「回数」を1加算する(ステップS3:Yes、S5)。このようにして、管理テーブル22上にはプロファイルデータが保存される。このプロファイルデータは、CPU10からエミュレータ30を介してホストコンピュータ40上で動作するデバッガ41に取り込まれる。最終的に、デバッガ41は自身が設定した特定ビットパターンと、その特定ビットパターンの実行箇所(アドレス)および各々の実行アドレスの累積実行回数を保持する。   The bit comparison mechanism 23 held by the profile unit 14 is configured such that when the CPU 10 executes a program, the instruction fetch unit 11 fetches from the memory 13 or the cache 12 and the bit pattern held in the specific bit pattern registration memory 21. A match determination is performed (step S1). If they match, the registration / update mechanism 24 registers / updates profile data in the management table 22. The management table 22 holds the “address” of the instruction that matches the bit pattern registered in the specific bit pattern registration memory 21 and the “(cumulative execution) number” of the address. That is, when the fetched instruction code is recognized as a match by the bit comparison mechanism 23, if the “address” held in the program counter (PC) is not registered in the management table 22, the “address” is stored in the management table. “Address” and “Number of times (1 time)” are stored (step S3: No, S4). If the “address” has already been registered in the management table 22, the “number of times” of the corresponding “address” is incremented by 1 (step S3: Yes, S5). In this way, profile data is stored on the management table 22. This profile data is taken into the debugger 41 operating on the host computer 40 from the CPU 10 via the emulator 30. Finally, the debugger 41 holds the specific bit pattern set by itself, the execution location (address) of the specific bit pattern, and the cumulative number of executions of each execution address.

本実施の形態では、CPU10内部において個々の命令のフェッチ時に登録ビットパターンとの比較によって実行頻度を記録する。よって、ソフトウェアによるプロファイル取得手法のような事前準備や、ハードウェアによるプロファイル取得手法のようなハードウェアの導入、膨大なトレース取得及びそこからのプロファイルの抽出などの手順が不要となり、省リソース、短時間でプロファイルデータを取得可能となる。   In the present embodiment, the execution frequency is recorded by comparison with the registered bit pattern when fetching individual instructions in the CPU 10. This eliminates the need for preparations such as the software profile acquisition method, hardware installation such as the hardware profile acquisition method, acquisition of enormous traces, and profile extraction from them, saving resources and shortening. Profile data can be acquired over time.

例えば特定ビットパターンとして関数の先頭に必ず置かれる命令コードを指定すれば、組み込みプログラム(A)の各関数の呼び出し頻度がプログラムの手直しなく、また多量なトレースメモリや解析時間を要することなく知ることが可能となる。あるいは、特定ビットパターンとしてCPU10のアーキテクチャ上実行が低速な命令を指定すれば、その命令の実行アドレスと実行頻度をデバッガ41上で知ることができ、プログラム処理上のボトルネック解析が可能となる。   For example, if an instruction code always placed at the beginning of a function is specified as a specific bit pattern, the call frequency of each function of the embedded program (A) can be known without reworking the program, and without requiring a large amount of trace memory and analysis time. Is possible. Alternatively, if an instruction whose execution is slow on the architecture of the CPU 10 is specified as the specific bit pattern, the execution address and execution frequency of the instruction can be known on the debugger 41, and a bottleneck analysis in program processing becomes possible.

本実施の形態においは、プロファイルデータの取得をプログラム修正なしで行うことができ、また、取得できるプロファイルデータは、プロファイル取得を行わない時と、プログラム実行速度/タイミングの面でも完全に等価とすることができる。さらに、エミュレータとトレースデータを元にしたプロファイル取得方式に対し、省リソース及び超短時間でプロファイルデータを取得することができる。   In the present embodiment, profile data can be acquired without program modification, and the profile data that can be acquired is completely equivalent in terms of program execution speed / timing when profile acquisition is not performed. be able to. Furthermore, profile data can be acquired in a resource-saving manner and in an extremely short time compared to a profile acquisition method based on an emulator and trace data.

なお、本発明は上述した実施の形態のみに限定されるものではなく、本発明の要旨を逸脱しない範囲において種々の変更が可能であることは勿論である。例えば、上述したように、CPU10に登録/更新機能24及び管理テーブル22をプロファイルユニット14に内蔵するものとして説明したが、これらの機能をエミュレータ30又はデバッガ41が有するものとしてもよい。同様にプロファイルユニット14の機能をエミュレータ30又はデバッガ41が有するものとしてもよい。   It should be noted that the present invention is not limited to the above-described embodiments, and various modifications can be made without departing from the scope of the present invention. For example, as described above, the registration / update function 24 and the management table 22 are described as being built in the profile unit 14 in the CPU 10, but the emulator 30 or the debugger 41 may have these functions. Similarly, the emulator 30 or the debugger 41 may have the function of the profile unit 14.

また、本実施の形態においては、特定ビットパターン登録メモリ21は、1つのビットパターンを登録するものとして説明したが、必要に応じて2以上のビットパターンを登録してもよいことは勿論である。その場合、管理テーブル22は、各ビットパターンとその実行アドレスを管理すればよい。   Further, in the present embodiment, the specific bit pattern registration memory 21 has been described as registering one bit pattern, but it goes without saying that two or more bit patterns may be registered as necessary. . In that case, the management table 22 may manage each bit pattern and its execution address.

本発明の実施の形態にかかる半導体装置を示す図である。It is a figure which shows the semiconductor device concerning embodiment of this invention. 本発明の実施の形態にかかる動作を示すフローチャートである。It is a flowchart which shows the operation | movement concerning embodiment of this invention. プログラムを修正しソフトウェア的にプロファイルデータを取得する方法を示す図である。It is a figure which shows the method of correcting a program and acquiring profile data like software. プログラムは修正せずエミュレータのトレース機能を用いて取得したトレースデータを元にプロファイルデータを取得する方法を示す図である。It is a figure which shows the method of acquiring profile data based on the trace data acquired using the trace function of the emulator, without correcting a program.

符号の説明Explanation of symbols

11 命令フェッチユニット
12 キャッシュ
13 メモリ
14 プロファイルユニット
16 プロファイルデータ
21 特定ビットパターン登録メモリ
22 管理テーブル
23 ビット比較機構
24 登録/更新機構
30 エミュレータ
40 ホストコンピュータ
41、115 デバッガ
111、121、124 ビルダ/コンパイラ
112、122 組み込みプログラム(A)
113 プロファイル取得用プログラム(B)
114 プログラム実行環境
116、127 プロファイルデータ
123 エミュレータ
125 トレースデータ
126 解析ツール
126 実行解析ツール
11 Instruction fetch unit 12 Cache 13 Memory 14 Profile unit 16 Profile data 21 Specific bit pattern registration memory 22 Management table 23 Bit comparison mechanism 24 Registration / update mechanism 30 Emulator 40 Host computer 41, 115 Debugger 111, 121, 124 Builder / compiler 112 122 Embedded program (A)
113 Profile acquisition program (B)
114 Program execution environment 116, 127 Profile data 123 Emulator 125 Trace data 126 Analysis tool 126 Execution analysis tool

Claims (7)

プログラムの実行時に命令をフェッチする命令フェッチ部と、
任意のビットパターンを保存する登録メモリと、
フェッチされた命令と前記登録メモリに保存されたビットパターンとの一致を検出する一致検出部と、
前記任意のビットパターンの検出回数を登録する管理テーブルと、
前記一致検出部が一致検出した場合、前記管理テーブルにその検出を登録又は前記管理テーブルのその累積検出回数を更新する登録/更新部とを有する試験装置。
An instruction fetch unit that fetches instructions during program execution;
A registration memory that stores arbitrary bit patterns;
A match detection unit for detecting a match between the fetched instruction and the bit pattern stored in the registration memory;
A management table for registering the number of detections of the arbitrary bit pattern;
A test apparatus comprising: a registration / updating unit that registers detection in the management table or updates the cumulative number of detections in the management table when the match detection unit detects a match.
前記管理テーブルは、前記任意のビットパターンの検出回数及びその実行アドレスを登録し、
前記登録/更新部は、前記一致検出した場合、前記管理テーブルに対し、累積実行回数及びその実行アドレスを登録又は更新する
ことを特徴とする請求項1記載の試験装置。
The management table registers the number of detections of the arbitrary bit pattern and its execution address,
The test apparatus according to claim 1, wherein, when the coincidence is detected, the registration / update unit registers or updates a cumulative execution count and an execution address thereof in the management table.
前記任意のビットパターンは、関数の先頭に置かれる命令コードである
ことを特徴とする請求項1又は2記載の試験装置。
The test apparatus according to claim 1, wherein the arbitrary bit pattern is an instruction code placed at a head of a function.
前記プログラムは高速な命令及び低速な命令を有し、
前記任意のビットパターンは、前記低速な命令を示す命令コードである
ことを特徴とする請求項1又は2記載の試験装置。
The program has a high speed instruction and a low speed instruction,
The test apparatus according to claim 1, wherein the arbitrary bit pattern is an instruction code indicating the low-speed instruction.
マイコンであることを特徴とする請求項1乃至4のいずれか1項記載の試験装置。   The test apparatus according to claim 1, wherein the test apparatus is a microcomputer. マイコンと、前記マイコンに接続されたエミュレータとを備え、
前記マイコンは、前記命令フェッチ部、前記登録メモリ及び前記一致検出部を有して、フェッチした命令と前記登録メモリに登録されたビットパターンとの一致検出を行い、
前記エミュレータは、前記管理テーブル及び前記登録/更新部を有して、前記一致検出の結果に基づき前記管理テーブルを更新する
ことを特徴とする請求項1乃至4のいずれか1項記載の試験装置。
A microcomputer and an emulator connected to the microcomputer;
The microcomputer includes the instruction fetch unit, the registration memory, and the coincidence detection unit, and performs coincidence detection between the fetched instruction and the bit pattern registered in the registration memory,
5. The test apparatus according to claim 1, wherein the emulator includes the management table and the registration / update unit, and updates the management table based on a result of the coincidence detection. .
マイコンと、前記マイコン接続されたエミュレータと、前記エミュレータを制御するデバッガとを備え、
前記マイコンは、前記命令フェッチ部、前記登録メモリ及び前記一致検出部を有して、フェッチした命令と前記登録メモリに登録されたビットパターンとの一致検出を行い、
前記デバッガは、前記管理テーブル及び前記登録/更新部を有して、前記一致検出の結果に基づき前記管理テーブルを更新する
ことを特徴とする請求項1乃至4のいずれか1項記載の試験装置。
A microcomputer, an emulator connected to the microcomputer, and a debugger for controlling the emulator;
The microcomputer includes the instruction fetch unit, the registration memory, and the coincidence detection unit, and performs coincidence detection between the fetched instruction and the bit pattern registered in the registration memory,
5. The test apparatus according to claim 1, wherein the debugger includes the management table and the registration / update unit, and updates the management table based on a result of the coincidence detection. .
JP2007122389A 2007-05-07 2007-05-07 Testing device Pending JP2008276683A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007122389A JP2008276683A (en) 2007-05-07 2007-05-07 Testing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007122389A JP2008276683A (en) 2007-05-07 2007-05-07 Testing device

Publications (1)

Publication Number Publication Date
JP2008276683A true JP2008276683A (en) 2008-11-13

Family

ID=40054534

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007122389A Pending JP2008276683A (en) 2007-05-07 2007-05-07 Testing device

Country Status (1)

Country Link
JP (1) JP2008276683A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010050311A1 (en) 2008-10-28 2010-05-06 日本電気株式会社 Authentication server

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01243141A (en) * 1988-03-24 1989-09-27 Nec Corp Information processor
JPH04153743A (en) * 1990-10-18 1992-05-27 Nec Corp Display system for module call information
JPH07182209A (en) * 1993-11-04 1995-07-21 Microsoft Corp Method and system for monitoring of performance of operating system-based program
JP2006293560A (en) * 2005-04-07 2006-10-26 Toshiba Lsi System Support Kk Debugging system and debugging method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01243141A (en) * 1988-03-24 1989-09-27 Nec Corp Information processor
JPH04153743A (en) * 1990-10-18 1992-05-27 Nec Corp Display system for module call information
JPH07182209A (en) * 1993-11-04 1995-07-21 Microsoft Corp Method and system for monitoring of performance of operating system-based program
JP2006293560A (en) * 2005-04-07 2006-10-26 Toshiba Lsi System Support Kk Debugging system and debugging method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010050311A1 (en) 2008-10-28 2010-05-06 日本電気株式会社 Authentication server

Similar Documents

Publication Publication Date Title
Sprunt The basics of performance-monitoring hardware
US6754856B2 (en) Memory access debug facility
JP5356635B2 (en) Non-intrusive application code profiling method and apparatus
WO2021057057A1 (en) Target-code coverage testing method, system, and medium of operating system-level program
US8612944B2 (en) Code evaluation for in-order processing
US10095611B1 (en) Methodology for unit test and regression framework
JP2007250010A (en) Automated processor generation system for designing configurable processor and method for the same
US11513804B2 (en) Pipeline flattener with conditional triggers
TWI361978B (en) Method for debugging a computer system
CN104169888A (en) Run-time instrumentation directed sampling
Sanchez et al. On the functional test of branch prediction units
US20230367516A1 (en) Program Detection Method and Apparatus
Parasyris et al. A framework for evaluating software on reduced margins hardware
US7684971B1 (en) Method and system for improving simulation performance
Gottschall et al. TEA: Time-proportional event analysis
Atanassov et al. Using real hardware to create an accurate timing model for execution-time analysis
US20060048011A1 (en) Performance profiling of microprocessor systems using debug hardware and performance monitor
JP2008276683A (en) Testing device
CN114780409A (en) Breakpoint setting method based on program running process, electronic device and storage medium
Bose Performance test case generation for microprocessors
US8484007B2 (en) Method and apparatus of handling instruction rejects, partial rejects, stalls and branch wrong in a simulation model
KR20230013124A (en) Profiling of sampled operations processed by processing circuitry
US11520682B2 (en) Code coverage method for embedded system on chip
US7617416B2 (en) System, method, and apparatus for firmware code-coverage in complex system on chip
CN107153604A (en) Parallel program performance method for monitoring and analyzing based on PMU

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100416

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20110622

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110726

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20111206