JPH03204044A - Coverage measuring method and microcomputer - Google Patents

Coverage measuring method and microcomputer

Info

Publication number
JPH03204044A
JPH03204044A JP1342966A JP34296689A JPH03204044A JP H03204044 A JPH03204044 A JP H03204044A JP 1342966 A JP1342966 A JP 1342966A JP 34296689 A JP34296689 A JP 34296689A JP H03204044 A JPH03204044 A JP H03204044A
Authority
JP
Japan
Prior art keywords
instruction
branch
coverage
branch instruction
information area
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.)
Granted
Application number
JP1342966A
Other languages
Japanese (ja)
Other versions
JP2915944B2 (en
Inventor
Mitsuyuki Kawachi
河内 満幸
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 JP1342966A priority Critical patent/JP2915944B2/en
Publication of JPH03204044A publication Critical patent/JPH03204044A/en
Application granted granted Critical
Publication of JP2915944B2 publication Critical patent/JP2915944B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To accurately measure the coverage of a program by recognizing a branch instruction code as a coverage measurement subject together with addition of an information area and recording the program executing state in this information area. CONSTITUTION:A program to be debugged is supplied from a host computer 19 via an I/O 14 or an in-circuit emulator 18 and then stored in a RAM 12. In regard of the program stored in the RAM 12 a specific bit of a branch instruction is changed in a translation process. Thus the branch instruction can be recognized as a coverage measurement subject and at the same time an information area is formed into an instruction code for recording the executing state of the branch instruction. Then the instruction contained in the program stored in the RAM 12 is executed by an evaluation chip 24. The branch instruction if fetched is recorded in the information area of the branch instruction. When the execution of the program to b debugged is through, the program stored in the RAM 12 is used for analysis of the coverage of the computer 19.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はマイクロコンピュータ応用システムのソフトウ
ェアデバッグ技術、さらにはマイクロコンピュータによ
って実行される命令のカバレージ測定を可能とする方法
、及び当該方法の実施に用いられるマイクロコンピュー
タに関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a software debugging technique for microcomputer application systems, a method that enables coverage measurement of instructions executed by a microcomputer, and a method for implementing the method. Regarding the microcomputer used.

〔従来の技術〕[Conventional technology]

マイクロコンピュータ応用機器の開発において、その応
用システムのデバッグやそのシステムの詳細な評価を行
うため、インサーキットエミュレータが使用されている
。斯るインサーキットエミュレータは、ソフトウェア開
発用の親計算機(ホストコンピュータ)などのシステム
開発装置と、開発中の応用機器との間に接続され、その
応用機器に含まれるマイクロプロセッサ(ターゲットマ
イクロプロセッサ)の機能を代行する一方でデバッガと
しての機能を持ち、詳細なシステムデバッグを支援する
In the development of microcomputer application equipment, in-circuit emulators are used to debug the application system and perform detailed evaluation of the system. Such an in-circuit emulator is connected between a system development device such as a parent computer (host computer) for software development and an application device under development, and is used to control the microprocessor (target microprocessor) included in the application device. While acting as a debugger, it supports detailed system debugging.

尚、インサーキットエミュレータについて記載された文
献の例としては、昭和63年10月1日に日立マイクロ
コンピュータエンジニアリング株式会社より発行された
「日立マイコン技報(第2巻、第2号)」がある。
An example of a document describing in-circuit emulators is "Hitachi Microcomputer Technical Report (Volume 2, No. 2)" published by Hitachi Microcomputer Engineering Co., Ltd. on October 1, 1986. .

ところで、このようなインサーキットエミュレータにお
いては、応用機器側のプログラム(ターゲットプログラ
ム)の評価を可能とする手段としてリアルタイムトレー
ス機能の他にカバレージトレース機能を備えたものがあ
る。このカバレージトレース機能によれば、ターゲット
マイクロプロセッサによって実行されるプログラムの通
過アドレスに応じてフラグなどの所定の情報が単一のカ
バレジトレースメモリに順次蓄えられる。この情報によ
って、ターゲットプログラムの中の命令語の何パーセン
トをテストできたかを測定することができる。
Incidentally, among such in-circuit emulators, some are equipped with a coverage trace function in addition to a real-time trace function as a means for making it possible to evaluate a program (target program) on the application equipment side. According to this coverage trace function, predetermined information such as flags is sequentially stored in a single coverage trace memory according to the passing address of a program executed by a target microprocessor. With this information, it is possible to determine what percentage of the instructions in the target program were tested.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

しかしながら、上記従来技術によれば次のような問題点
のあることが本発明者によって見い出された。
However, the inventors have found that the above-mentioned prior art has the following problems.

従来技術において命令分岐命令の実行状況例えば当該分
岐命令によって分岐されたか否かを検出するには、マイ
クロコンピュータの外部に配置されたハードウェアによ
ってトレースしなければならない。しかしながら、命令
キャッシュやメモリマネージメントユニットなどの周辺
回路を内蔵してシステムオンチップ化することにより高
機能化されたマイクロコンピュータでは、分岐命令の実
行状況を検出するに十分な信号をマイクロコンピュータ
の外部に出力することができなくなっているため、マイ
クロコンピュータの外部に配置されたハードウェアでは
分岐命令の実行状況をトレースするのが困難になる。ま
た仮にそのような信号をマイクロコンピュータの外部に
出力することが可能であっても内部処理が高速で行われ
るため、外付はハードウェアで分岐命令の実行状況を検
出するのが困難になる。更に、仮想メモリシステムなど
のように単一のメモリが複数のプログラムによって時分
割で使用される場合には、プログラムの種類だけカバレ
ージトレースメモリを用意し、現在実行されるプログラ
ムに対応するように当該メモリの切換え制御を行わなけ
ればならず、外付はハードウェアにおいてこのようなメ
モリ切換え制御を行うのは非常に困難となる。
In the prior art, in order to detect the execution status of an instruction branch instruction, for example, whether or not a branch has been taken by the branch instruction, tracing must be performed using hardware placed outside the microcomputer. However, in microcomputers that have become more sophisticated by incorporating peripheral circuits such as instruction caches and memory management units into system-on-chip systems, signals sufficient to detect the execution status of branch instructions are sent to the outside of the microcomputer. Since output is no longer possible, it becomes difficult to trace the execution status of branch instructions using hardware placed outside the microcomputer. Furthermore, even if it were possible to output such a signal to the outside of the microcomputer, internal processing is performed at high speed, making it difficult for external hardware to detect the execution status of branch instructions. Furthermore, when a single memory is used in a time-sharing manner by multiple programs, such as in a virtual memory system, coverage trace memory is prepared for each type of program, and the coverage trace memory is set to correspond to the currently executed program. Memory switching control must be performed, and it is extremely difficult to perform such memory switching control using external hardware.

本発明の目的は、外部とやりとりされる信号に内部動作
状態が反映されない若しくは反映されても内部処理が高
速に行われることから分岐命令の実行状態を検知するこ
とができないような高機能化されたマイクロプロセッサ
であるにもかかわらず、プログラムのカバレージ測定を
適確に行い得る技術を提供することにある。
An object of the present invention is to provide a highly functional system in which the internal operating state is not reflected in the signals exchanged with the outside, or even if it is reflected, the internal processing is performed at high speed, so that the execution state of a branch instruction cannot be detected. The object of the present invention is to provide a technique that can accurately measure program coverage even though the microprocessor is a microprocessor.

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

〔課題を解決するための手段〕[Means to solve the problem]

本願において開示される発明のうち代表的なものの概要
を簡単に説明すれば下記の通りである。
A brief overview of typical inventions disclosed in this application is as follows.

すなわち、分岐命令コードの特定ビットの状態を変更す
るとともに当該命令コードに情報エリアを付加し、この
情報エリアが付加された分岐命令を含むプログラムをマ
イクロコンピュータに実行させ、当該分岐命令の実行状
況を上記情報エリアに記録させるようにし、この情報エ
リアの記録内容に基づいて当該分岐命令のカバレージ解
析を行う、というものである。ここで上記分岐命令の実
行状況としては、上記分岐命令に従って分岐したか否か
の判別情報を挙げることができるが、更に詳細なカバレ
ージ解析を可能とするためにはこのような判別情報に加
えて、分岐条件の種類についての情報をも含めることが
できる。
In other words, the state of a specific bit of a branch instruction code is changed, an information area is added to the instruction code, a microcomputer is executed a program including a branch instruction with this information area added, and the execution status of the branch instruction is checked. The branch instruction is recorded in the information area, and coverage analysis of the branch instruction is performed based on the recorded contents of the information area. Here, the execution status of the above-mentioned branch instruction can include discrimination information as to whether or not a branch has been taken according to the above-mentioned branch instruction, but in order to enable more detailed coverage analysis, in addition to such discrimination information, it is necessary to , information about the type of branch condition can also be included.

また、情報エリアを備えたカバレージ命令を、分岐命令
の分岐パスと通過パスとの双方に挿入し、当該カバレー
ジ命令がフェッチされた場合に当該カバレージ命令の実
行状況を上記情報エリアに記録させるようにし、この情
報エリアの記録内容に基づいて分岐命令の実行状態を間
接的に把握してカバレージ解析を行う、というものであ
る。
In addition, a coverage instruction with an information area is inserted into both the branch path and the passing path of the branch instruction, and when the coverage instruction is fetched, the execution status of the coverage instruction is recorded in the information area. Based on the recorded contents of this information area, the execution state of the branch instruction is indirectly understood and coverage analysis is performed.

ここで上記分岐命令コードの特定ビットの状態変更や分
岐コードへの情報エリアの付加、又は上記カバレージ命
令の挿入はソースプログラムを機械語に翻訳する段階で
行うことができる。
Here, changing the state of a specific bit of the branch instruction code, adding an information area to the branch code, or inserting the coverage instruction can be performed at the stage of translating the source program into machine language.

そして上記のようなカバレージ測定に使用されるマイク
ロコンピュータを、以下のように構成したものである。
The microcomputer used for coverage measurement as described above is configured as follows.

すなわち、分岐命令コードの特定ビットの状態が変更さ
れ且つ命令コードに情報エリアが付加された分岐命令を
フェッチした場合に当該情報エリアへの情報記録制御信
号を生成する命令制御部と、この情報記録制御信号に従
って上記分岐命令コードの実行状況を情報エリアに記録
する実行部とを含んでマイクロコンピュータを形成した
ものである。また、情報エリアを含むカバレージ命令を
フェッチした場合に当該情報エリアへの情報記録制御信
号を生成する命令制御部と、この情報記録制御信号に従
って当該命令コードの実行状況を上記情報エリアに記録
する実行部とを含んでマイクロコンピュータを形成した
ものである。
That is, when a branch instruction in which the state of a specific bit of a branch instruction code is changed and an information area is added to the instruction code is fetched, an instruction control unit that generates an information recording control signal to the information area; A microcomputer is formed including an execution section that records the execution status of the branch instruction code in an information area according to a control signal. It also includes an instruction control unit that generates an information recording control signal to the information area when a coverage instruction including an information area is fetched, and an execution unit that records the execution status of the instruction code in the information area according to the information recording control signal. A microcomputer is formed by including the following parts.

〔作 用〕[For production]

上記手段によれば、分岐命令若しくはカバレージ命令が
フェッチされた場合の情報エリアへの記録内容に基づい
てカバレージ解析が可能とされ、このことが、マイクロ
コンピュータの高機能化にかかわらず適確なカバレージ
測定を可能とするように作用する。このときマイクロコ
ンピュータは、上記分岐命令若しくはカバレージ命令が
フェッチされた場合に情報記録制御信号を生成し、この
情報記録制御信号に従って上記情報エリアに当該分岐命
令若しくはカバレージ命令の実行状況をセットするよう
に作用する。
According to the above means, it is possible to perform coverage analysis based on the contents recorded in the information area when a branch instruction or a coverage instruction is fetched. It acts to enable measurement. At this time, the microcomputer generates an information recording control signal when the branch instruction or coverage instruction is fetched, and sets the execution status of the branch instruction or coverage instruction in the information area according to this information recording control signal. act.

〔実 施 例1〕 第1図には本発明の第1実施例方法を適用したマイクロ
コンピュータ開発システムが示される。
[Embodiment 1] FIG. 1 shows a microcomputer development system to which the method of the first embodiment of the present invention is applied.

同図に示されるマイクロコンピュータ開発システムは、
特に制限されないが、マイクロコンピュータ応用機器と
してのユーザ開発装置10、ユーザプログラムのデバッ
グを可能とするインサーキットエミュレータ17、アセ
ンブラやリンケージエディタ更にはカバレージ解析ソフ
トウェアの動作環境が形成されるホストコンピュータ1
1を含む。
The microcomputer development system shown in the figure is
Although not particularly limited, a user development device 10 as a microcomputer application device, an in-circuit emulator 17 that enables debugging of user programs, an assembler, a linkage editor, and a host computer 1 in which an operating environment for coverage analysis software is formed.
Contains 1.

ユーザ開発装置10は、プログラム及びその他の必要デ
ータの書込み/読出しが可能とされるRAM(ランダム
・アクセス・メモリ)12と、当該ユーザ開発装置10
の初期設定用プログラムなどが保持されたROM (リ
ード・オンリ・メモリ)13と、外部との間でデータの
やりとりを行うIlo (インプット・アウトプット)
14を有する。
The user development device 10 includes a RAM (Random Access Memory) 12 into which programs and other necessary data can be written/read;
Ilo (input/output) that exchanges data between the ROM (read-only memory) 13, which stores initial setting programs, etc., and the outside world.
It has 14.

更にこのユーザ開発装置10には、当該装置10の動作
制御や所定の演算処理を行うマイクロコンピュータを搭
載するためのICソケット11が設けられている。ソフ
トウェアデバッグにおいてこのICソケット11には、
インサーキットエミュレータ18のインタフェースケー
ブル26の先端に設けられたプラグ25が結合される。
Furthermore, this user-developed device 10 is provided with an IC socket 11 for mounting a microcomputer that controls the operation of the device 10 and performs predetermined arithmetic processing. In software debugging, this IC socket 11 has
A plug 25 provided at the tip of an interface cable 26 of the in-circuit emulator 18 is coupled.

このインタフェースケーブル26の中間部にはポット2
3が配置され、このボッド23に、ユーザ開発装置10
に搭載されるべきマイクロコンピュータと同等の機能を
有する評価用のマイクロコンピュータ(以下評価チップ
と称する)24が装着される。
The pot 2 is located in the middle of this interface cable 26.
3 is placed, and the user-developed device 10 is placed in this box 23.
An evaluation microcomputer (hereinafter referred to as an evaluation chip) 24 having the same functions as the microcomputer to be installed in the microcomputer is mounted.

インサーキットエミュレータ18は、ユーザ開発装置1
0とホストコンピュータ19との間に配置され、トレー
ス機能やブレーク機能によりソフトウエアデバノグを支
援する。このインサーキットエミュレータ18とホスト
コンピュータ19とはシリアル回線パスラインによって
結合され、このパスラインによって両者間でのデータの
やりとりが可能とされる。デバッグ対象とされるプログ
ラムは、■1014を介して、若しくはインサーキット
エミュレータ18を介して、ホストコンピュータ19か
ら供給され、RA M l 2に格納される。
The in-circuit emulator 18 is the user-developed device 1
0 and the host computer 19, and supports software debugging with a trace function and a break function. The in-circuit emulator 18 and the host computer 19 are connected by a serial path line, and this path line allows data to be exchanged between the two. A program to be debugged is supplied from the host computer 19 via 1014 or the in-circuit emulator 18, and is stored in the RAM 12.

このRAM12に格納されるプログラムは機械語に翻訳
されており、この機械語への翻訳はホストコンピュータ
19においてアセンブラソフトを実行することにより行
われる。そしてこの翻訳過程においては、後に詳述する
ように、分岐命令の特定ビット例えば最上位ビットの状
態が変更されることにより当該分岐命令がカバレージ測
定対象として認識可能とされるとともに、当該命令コー
ドに分岐命令の実行状況を記録するための情報エリアが
形成される。この情報エリアの形成は、特に制限されな
いが、当該分岐命令を1ワード拡張することによって行
われる。そして上記RAM12に格納されたプログラム
中の命令は、評価チップ24によって順次実行され、こ
のプログラム実行において、上記分岐命令がフェッチさ
れた場合に当該命令の実行状況が当該分岐命令の情報エ
リアに記録されるようになっている。この実行状況の記
録は、具体的には上記RAM12内において当該分岐命
令の情報エリアに対応するアドレスに当該実行状況が書
込まれることによって行われる。
The program stored in the RAM 12 has been translated into machine language, and the translation into machine language is performed by executing assembler software in the host computer 19. In this translation process, as will be detailed later, the state of a specific bit of the branch instruction, such as the most significant bit, is changed so that the branch instruction can be recognized as a coverage measurement target, and the instruction code is An information area is formed for recording the execution status of the branch instruction. This information area is formed, although not particularly limited, by extending the branch instruction by one word. The instructions in the program stored in the RAM 12 are sequentially executed by the evaluation chip 24, and when the branch instruction is fetched during program execution, the execution status of the instruction is recorded in the information area of the branch instruction. It has become so. Specifically, this execution status is recorded by writing the execution status in the RAM 12 at an address corresponding to the information area of the branch instruction.

このようにしてデバッグ対象プログラムの実行が終了さ
れた後、上記RAM12内のプログラムは、後にホスト
コンピュータ19で行われるカバレージ解析に供される
After the execution of the program to be debugged is completed in this manner, the program in the RAM 12 is subjected to a coverage analysis performed later by the host computer 19.

上記RAM12からホストコンピュータ19へのプログ
ラム転送経路には、特に制限されないが、図中破線で示
されるように3通りある。すなわち、ユーザ開発装置1
0にフロッピーディスク装置(図示せず)が備えられて
いる場合にはl1014を介してこのフロッピーディス
ク装置にRAM12内のプログラムを転送し、ここで当
該プログラムが書込まれたフロッピーディスク16をホ
ストコンピュータ19に装着することによってプログラ
ム転送を可能とする第1の転送経路L1、インサーキッ
トエミュレータ18にフロッピーディスク装W(図示せ
ず)が備えられている場合には評価チップ24及びイン
サーキットエミュレータ18を介してこのフロッピーデ
ィスク装置に上記RAM12内のプログラムを転送し、
ここで当該プログラムが格納されたフロンピーディスク
17をホストコンピュータ19に装着することによって
プログラム転送を可能とする第2の転送経路L2、更に
、フロッピーディスクを介することなく評価チップ24
及びインサーキットエミュレータ18を介して直接ホス
トコンピュータ19にプログラムを転送する第3の転送
経路L3である。尚、ホストコンピュータ19でのカバ
レージ解析結果は表示装置22に表示され、また必要に
応じてフロッピーディスク21に格納され、あるいはプ
リンタ20によってプリントアウトされる。
Although there are no particular restrictions on the program transfer path from the RAM 12 to the host computer 19, there are three paths as shown by broken lines in the figure. That is, user developed device 1
0 is equipped with a floppy disk device (not shown), the program in the RAM 12 is transferred to this floppy disk device via the l1014, and the floppy disk 16 on which the program is written is transferred to the host computer. If the in-circuit emulator 18 is equipped with a floppy disk device W (not shown), the evaluation chip 24 and the in-circuit emulator 18 are connected to the first transfer path L1, which enables program transfer by attaching the evaluation chip 24 to the in-circuit emulator 19. Transfer the program in the RAM 12 to this floppy disk device via
Here, there is a second transfer path L2 that enables program transfer by attaching the floppy disk 17 on which the program is stored to the host computer 19;
and a third transfer path L3 that directly transfers the program to the host computer 19 via the in-circuit emulator 18. The results of the coverage analysis performed by the host computer 19 are displayed on the display device 22, and are stored on the floppy disk 21 or printed out by the printer 20, if necessary.

第2図には上記評価チップ24の詳細な構成の一例が示
される。同図に示される評価チップ24は、特に制限さ
れないが、基本命令レベルの高速実行を可能とするため
各種キャッシュを内蔵し、高速なパイプライン処理を実
行可能とされる。
FIG. 2 shows an example of a detailed configuration of the evaluation chip 24. Although not particularly limited, the evaluation chip 24 shown in the figure includes various caches to enable high-speed execution at the basic instruction level, and is capable of executing high-speed pipeline processing.

命令ブリフェッチユニット30は命令キャッシュ30a
を内蔵し、実行すべき命令を先行してフェッチする。ま
た分岐命令系の高速化のため、4本の分岐ウィンドウ3
0bを有する。これにヒツトした場合には分岐先命令の
フェッチが簡略化される。入出カニニット35はユーザ
開発装置10及びインサーキットエミュレータ18に結
合され、命令やオペランドの入出力を制御する。命令デ
コードユニット31はフェッチした命令のデコードを行
う。このデコード結果は、マイクロプログラムを内蔵す
る制御ユニット32に伝達され、演算器33aや各種レ
ジスタ群33bを含む実行ユニット33を制御してオペ
ランドの処理を行わせる。
The instruction briefetch unit 30 is an instruction cache 30a.
is built in and fetches the instructions to be executed in advance. In addition, to speed up the branch instruction system, four branch windows 3
It has 0b. If this is true, fetching the branch destination instruction is simplified. The input/output unit 35 is coupled to the user development device 10 and the in-circuit emulator 18, and controls input/output of instructions and operands. The instruction decode unit 31 decodes the fetched instructions. This decoding result is transmitted to a control unit 32 containing a microprogram, and controls an execution unit 33 including an arithmetic unit 33a and various register groups 33b to process the operand.

処理されたオペランドは再び入出力制御ユニット35に
転送され、ストアバッファ35bに格納される。スタッ
ク情報の場合にはスタックキャッシュ35aにも格納さ
れる。オペランドがストアバッファ35bに格納された
段階で1次の命令の処理が開始される。また外部メモリ
のアクセスはメモリ管理ユニット34による保護条件の
チエツクとアドレス変換を経て行われる。この処理は命
令実行処理と並行される。
The processed operands are transferred again to the input/output control unit 35 and stored in the store buffer 35b. In the case of stack information, it is also stored in the stack cache 35a. Once the operands are stored in the store buffer 35b, processing of the primary instruction is started. Furthermore, access to the external memory is performed through checking of protection conditions and address conversion by the memory management unit 34. This processing is performed in parallel with the instruction execution processing.

尚、上記制御ユニット32におけるマイクロプログラム
の実行によって、分岐命令を含む種々の命令に対応する
制御信号の発生が可能とされる。
Note that by executing the microprogram in the control unit 32, control signals corresponding to various instructions including branch instructions can be generated.

本発明における命令制御部はこの制御ユニット32と命
令デコードユニット31とを含んで実現される。
The instruction control section in the present invention is realized by including this control unit 32 and instruction decoding unit 31.

ここで、上記実行ユニット33におけるレジスタ群33
bには、特に制限されないが、第5図に示されるように
、アキュムレータ(A ccumulator:ACC
A)、インデックスレジスタ(I ndex Regi
ster: I X) +プログラムカウンタ(P r
ogramCounter:PC) + スタックポイ
ンタ (S tack Po1nter: S P )
 +コンデイションコードレジスタ(Conditio
n Codes Register)が含まれる。上記
アキュムレータはA、Bで区別されるように8ビツト構
成のものが2つ備えられる。上記インデックスレジスタ
、プログラムカウンタ及びスタックポインタは16ビツ
ト構成とされ、コンデイションレジスタは8ビツト構成
とされる。特にこのコンデイションコードレジスタは、
上記実行ユニット33において演算器33aの演算結果
が保持され、当該レジスタには、ネガティブ(Nega
tive:N)、ゼロ(zero:Z)、オーバフロー
(○verflow:V) r ビット7からのキャリ
(Carry: C)、ビット3からのハーフキャリ(
Half Carry)の各フラグが存在し、条件分岐
命令の実行において、これら各フラグのうち所定のフラ
グが参照されることにより当該分岐命令の条件が成立す
るか否かの判別が可能とされる。
Here, the register group 33 in the execution unit 33
Although not particularly limited to b, as shown in FIG.
A), index register (Index Regi)
ster: IX) + program counter (P r
ogramCounter:PC) + stack pointer (S p )
+Condition code register (Condition
n Codes Register). Two 8-bit accumulators are provided, distinguished by A and B. The index register, program counter and stack pointer have a 16-bit configuration, and the condition register has an 8-bit configuration. In particular, this condition code register is
In the execution unit 33, the calculation result of the calculation unit 33a is held, and the register contains a negative (Nega)
tive: N), zero (zero: Z), overflow (○verflow: V) r Carry from bit 7 (Carry: C), half carry from bit 3 (
There are flags such as "Half Carry" and "Half Carry", and when a conditional branch instruction is executed, by referring to a predetermined flag among these flags, it is possible to determine whether or not the condition of the branch instruction is satisfied.

上記のように本実施例における評価チップ24は多様な
分散キャッシュと並列処理により高機能化されており、
このようなマイクロコンピュータを含むシステムのソフ
トウェアデバッグ、特に条件分岐命令の適確なカバレー
ジ測定を可能とするため1本実施例では以下のようなカ
バレージ測定専用の分岐命令が使用される。
As mentioned above, the evaluation chip 24 in this embodiment is highly functional with various distributed caches and parallel processing.
In order to enable software debugging of a system including such a microcomputer, particularly accurate coverage measurement of conditional branch instructions, the following branch instructions dedicated to coverage measurement are used in this embodiment.

第6図には本実施例における評価チップ24において実
行可能とされる種々の分岐命令とその分岐条件との関係
が示される。
FIG. 6 shows the relationship between various branch instructions and their branch conditions that are executable in the evaluation chip 24 in this embodiment.

例えば条件分岐命令BEQは通常第3図に示されるよう
に、機械語で“67FE”と表わされる。
For example, the conditional branch instruction BEQ is usually expressed in machine language as "67FE" as shown in FIG.

このうちit 67 I+は当該命令が分岐命令である
ことを示し、r(F E +1は分岐先までの相対アド
レスを示している。本実施例においてこの”67FE”
は通常モードの分岐命令とされる。一方、カバレージ測
定モードの場合この命令コードは特に制限されないが、
”E7FE”とされ、通常モード時の命令コードの最上
位ビットが1に変更される。
Among them, it 67 I+ indicates that the instruction is a branch instruction, and r(F E +1 indicates the relative address to the branch destination. In this embodiment, this "67 FE"
is considered a normal mode branch instruction. On the other hand, in the case of coverage measurement mode, this instruction code is not particularly limited, but
"E7FE", and the most significant bit of the instruction code in normal mode is changed to 1.

第3図における11 E 7 I+がこれを意味する。11E7I+ in FIG. 3 means this.

そしてこれと同時にワード拡張がなされ、16ビツト構
成の情報エリア40が形成される。この情報エリア40
は更に3つのエリア40a、40b、40cに分かれて
いる。当該分岐命令によって分岐された場合には第1の
エリア40aにフラグが立てられ、当該分岐命令によっ
て分岐されずに通過された場合には第2のエリア40b
にフラグが立てられる。従ってこの第1.第2のエリア
40a。
At the same time, word expansion is performed to form an information area 40 having a 16-bit configuration. This information area 40
is further divided into three areas 40a, 40b, and 40c. If the branch is taken by the branch instruction, a flag is set in the first area 40a, and if the branch is passed through without being branched by the branch instruction, the flag is set in the second area 40b.
is flagged. Therefore, this first. Second area 40a.

40bのフラグ状態をチエツクすることで当該分岐命令
に従って分岐されたか否かの判別が可能となる。更に本
実施例では、単に分岐されたか否かの判別のみならず、
分岐された場合の分岐条件の種類が記録されるようにな
っている。この記録は、第3のエリア40cの該当箇所
にフラグを立てることによって行われる。
By checking the state of the flag 40b, it is possible to determine whether or not the branch has been branched in accordance with the branch instruction. Furthermore, in this embodiment, it is not only possible to simply determine whether or not a branch has occurred;
The type of branch condition when a branch occurs is recorded. This recording is performed by setting a flag at the relevant location in the third area 40c.

以上のような分岐命令のフォーマット形成は、第1図に
示されるホストコンピュータ19において、高級言語で
記述されたプログラムをアセンブラにより機械語に翻訳
する段階でモード指定に応じて行われる。つまり上記分
岐命令BEQの場合、通常モードの指定がなされれば”
67FE”と翻訳されるのに対して、カバレージ測定モ
ードの指定がなされた場合には” E 7 F E ”
と翻訳され、これとほぼ同時に当該命令コードに情報エ
リア40が付加される。
Formation of a branch instruction format as described above is performed in the host computer 19 shown in FIG. 1 in accordance with a mode specification when a program written in a high-level language is translated into machine language by an assembler. In other words, in the case of the above branch instruction BEQ, if the normal mode is specified,
67FE", whereas when the coverage measurement mode is specified, it is translated as "E 7 F E".
At the same time, an information area 40 is added to the instruction code.

そしてこのようなカバレージ測定モードの分岐命令が評
価チップ24においてフェッチされると。
When such a branch instruction in the coverage measurement mode is fetched in the evaluation chip 24.

制御ユニット32は、当該分岐命令の’ E 7 ”に
より当該分岐命令が、カバレージ測定モードにおけるB
EQであることを認識し、情報エリアへの情報記録制御
信号を生成する。すると実行ユニット33は制御ユニッ
ト32の制御下で分岐条件の判定を行い、この判定にお
いて分岐条件成立により分岐する場合には情報エリア4
0aにフラグre 1 nを立て、また条件不成立によ
り分岐せずに通過する場合には第2のエリア40bにフ
ラグ111 I+を立てる。更に分岐条件成立により分
岐する場合には、第3のエリアにおいて予め分岐条件と
の対応関係がとられている該当条件ビットにフラグ・・
1・・を立てる。従ってががる情報エリアへの記録内容
によれば、フラグ″1”の有無によって、分岐条件成立
により分岐されたか否か、及び分岐された場合の分岐条
件の種類判別が可能とされる。
The control unit 32 causes the branch instruction to be set to B in the coverage measurement mode due to 'E7' of the branch instruction.
It recognizes that it is EQ and generates an information recording control signal to the information area. Then, the execution unit 33 determines the branch condition under the control of the control unit 32, and in this determination, if the branch condition is satisfied and the branch is to be executed, the execution unit 33
A flag re 1 n is set in 0a, and a flag 111 I+ is set in the second area 40b if the condition is not satisfied and the process passes through without branching. Furthermore, when a branch occurs due to the establishment of a branch condition, a flag is set in the corresponding condition bit that has been previously associated with the branch condition in the third area.
Set up 1... According to the contents recorded in the information area, it is possible to determine whether or not a branch has been taken due to the establishment of a branch condition, and to determine the type of branch condition if a branch has been made, depending on the presence or absence of the flag "1".

例えば上記の分岐命令BEQの場合の分岐条件は、第6
図に示されるように、Z=1であり、これは、コンデイ
ションコードレジスタのゼロフラグ(第5図参照)が1
″′であることを示しており、当該分岐命令BEQの直
前における演算結果がゼロであることを意味する。従っ
てこの分岐命令BEQの条件が成立するか否かの判別は
、コンデイションコードレジスタのゼロフラグの状態判
別によって可能とされる。
For example, the branch condition for the above branch instruction BEQ is the sixth
As shown in the figure, Z=1, which means that the zero flag of the condition code register (see Figure 5) is 1.
``'', which means that the operation result immediately before the branch instruction BEQ is zero.Therefore, to determine whether the condition of this branch instruction BEQ is satisfied, check the condition code register. This is possible by determining the state of the zero flag.

分岐命令BEQの分岐条件はZ=1のみであるが、例え
ば分岐条件BLEの分岐条件は、第6図に示されるよう
に、 Z+(N@V)=1 であり、この条件が成立する場合は3通りある。
The branch condition for the branch instruction BEQ is only Z=1, but for example, the branch condition for the branch condition BLE is Z+(N@V)=1 as shown in FIG. 6, and if this condition is satisfied, There are three ways.

すなわち、Z=1(7)場合と、(Z=O)’(N=1
)−(V=O)(7)場合と、(z=O)・(N=o)
・(v=1)の場合である。このうちどの条件が成立し
て分岐されたかの判別を可能とするため、本実施例では
特に制限されないが、情報エリア4oにおける第3のエ
リア40cにおけるビットb8.b9゜bloに上記3
通りの成立条件が割付けられ、該当するビットにフラグ
l(I I+が立てられる。従って当該分岐命令BLE
のように条件の成立する場合が複数通りある場合でも、
第3のエリア40cのセット内容によって分岐条件の種
類を適確に把握することが可能とされる。
That is, the case Z=1(7) and the case (Z=O)'(N=1
)-(V=O) (7) and (z=O)・(N=o)
- This is the case when (v=1). In order to make it possible to determine which of these conditions has been met to cause the branch, bit b8. b9゜blo above 3
The conditions for the establishment of the branch instruction BLE are assigned, and the flag l(I I+ is set to the corresponding bit. Therefore, the corresponding branch instruction BLE
Even if there are multiple cases where the condition is satisfied, such as
It is possible to accurately grasp the type of branch condition based on the set contents of the third area 40c.

本実施例システムにおいてカバレージ測定は次のように
行われる。
In the system of this embodiment, coverage measurement is performed as follows.

第4図には、工1014若しくはインサーキットエミュ
レータ18を介してホストコンピュータ19より転送さ
れRAM12内に格納された命令語の配置とそれに対応
する機械語コードとの関係が示される。同図において分
岐命令BEQ及びBNEは、ホストコンピュータ19で
の翻訳過程にてカバレージ測定モードが選択されること
により、命令コードの最上位ビットがLl I I+と
され、ワード拡張により情報エリア40が付加されてい
る。
FIG. 4 shows the relationship between the arrangement of instruction words transferred from the host computer 19 via the machine 1014 or the in-circuit emulator 18 and stored in the RAM 12 and the corresponding machine language code. In the figure, for branch instructions BEQ and BNE, the most significant bit of the instruction code is set to Ll I I+ by selecting the coverage measurement mode during the translation process in the host computer 19, and an information area 40 is added by word expansion. has been done.

この情報エリアは同図に示されるように初期値として1
6進数の(0000)がセットされている。
This information area has an initial value of 1 as shown in the figure.
A hexadecimal number (0000) is set.

そして評価チップ24によりRAM12内の命令が順次
実行され、当該分岐命令BEQ又はBNEがフェッチさ
れた場合、当該分岐命令についての分岐条件に応じて当
該命令の情報エリア40に当該命令の実行状況が記録さ
れる。この実行状況の記録は、RAM12内において当
該命令の情報エリア40に対応するアドレスに実行状況
を書込むことによって行われる。また、この実行状況の
記録は、当該命令の前回実行時の状況を保存するため、
今回実行時の状況と前回実行時の状況との論理和をとっ
て行われる。
Then, when the evaluation chip 24 sequentially executes the instructions in the RAM 12 and fetches the branch instruction BEQ or BNE, the execution status of the instruction is recorded in the information area 40 of the instruction according to the branch condition for the branch instruction. be done. This recording of the execution status is performed by writing the execution status in the RAM 12 at an address corresponding to the information area 40 of the instruction. In addition, this execution status record saves the status of the previous execution of the instruction, so
This is done by calculating the logical sum of the current execution status and the previous execution status.

RAM12内のプログラムの−通りのテストが終了した
後に、当該RAM12内のプログラムを基にホストコン
ピュータ19においてカバレージ測定結果の情報解析が
行われる。RAM12からホストコンピュータ19への
データ転送において、第2のルートL2又は第3のルー
トL3を経る場合には、ホストコンピュータ19におい
て第12図に示されるような分岐命令ファイルを用いる
ことによりカバレージ情報のみを抽出することができる
。同図に示される分岐命令ファイルは、アセンブラ/リ
ンケージエディタにより、テスト対象プログラムから分
岐命令だけを抜出して作成されるファイルであり、アド
レス、命令語、飛び先、分岐条件の各項目が設けられて
いる。更にホストコンピュータ19では、上記分岐命令
ファイルを用いてカバレージ測定結果の分析を行い、第
13図に示されるようなカバレージ解析結果を得る。
After the program in the RAM 12 has been tested in several ways, information analysis of the coverage measurement results is performed in the host computer 19 based on the program in the RAM 12. When data is transferred from the RAM 12 to the host computer 19 via the second route L2 or the third route L3, the host computer 19 uses a branch instruction file as shown in FIG. 12 to transfer only coverage information. can be extracted. The branch instruction file shown in the figure is a file created by extracting only the branch instructions from the test target program using an assembler/linkage editor, and has the following items: address, instruction word, jump destination, and branch condition. There is. Furthermore, the host computer 19 analyzes the coverage measurement results using the branch instruction file to obtain coverage analysis results as shown in FIG.

このカバレージ解析結果には、分岐、通過、実行法分岐
条件、テスト完了命令の各項目が含まれる。
This coverage analysis result includes each item of branch, passage, execution method branch condition, and test completion instruction.

このような解析結果は表示装置22に表示され、必要に
応じてプリンタ20によりハードコピーされる。
Such analysis results are displayed on the display device 22 and hard-copied by the printer 20 if necessary.

また、RAM12からホストコンピュータ19へのデー
タ転送が第1のルートL1を経て行われる場合において
、ユーザ開発装置10にカバレージ解析のためのプログ
ラムを載せれば、上記の分岐命令ファイルをホストコン
ピュータ19からユーザ開発装置110に転送してユー
ザ開発装置10でカバレージ情報だけを取出し、それを
フロッピーディスク16に格納することによりホストコ
ンピュータ19に伝達することもできる。尚、ユーザ開
発装置10に表示装置やプリンタが備えられている場合
には、カバレージ解析及びその解析結果の出力までユー
ザ開発装置10で行うこともできる。
Furthermore, when data is transferred from the RAM 12 to the host computer 19 via the first route L1, if a program for coverage analysis is installed on the user-developed device 10, the above branch instruction file can be transferred from the host computer 19. It is also possible to transfer the information to the user development device 110, extract only the coverage information from the user development device 10, store it on the floppy disk 16, and transmit it to the host computer 19. Note that if the user development device 10 is equipped with a display device or a printer, the user development device 10 can also perform coverage analysis and output the analysis results.

本実施例システムによれば以下の作用効果を得ることが
できる。
According to the system of this embodiment, the following effects can be obtained.

(1)分岐命令コードの特定ビットの状態が変更され、
且つ、情報エリアが付加された分岐命令が評価チップ2
4によってフェッチされた場合に、当該分岐命令の実行
状況が当該情報エリアに記録されるので、この情報エリ
アのセット内容に基づいて当該分岐命令のカバレージ解
析を行うことができ、この解析によって本実施例の分岐
命令や分岐条件を明らかにすることにより、より高度な
ソフトウェア管理が可能となる。
(1) The state of a specific bit of the branch instruction code is changed,
In addition, the branch instruction with the information area added is the evaluation chip 2.
4, the execution status of the branch instruction is recorded in the information area, so coverage analysis of the branch instruction can be performed based on the set contents of this information area. By clarifying example branch instructions and branch conditions, more advanced software management becomes possible.

(2)上記(1)の作用効果により、テスト対象プログ
ラムについて−通りのカバレージ測定が終了された後に
、すべての分岐命令の情報エリア40の記録内容を抜出
して、各分岐命令毎に、条件成立により分岐したか否か
の判別、及び条件成立により分岐した場合においての当
該分岐の成立条件の判別を行うことができるので、ソフ
トウェアデバッグ特に分岐命令に関してのテストを詳細
に行うことができ、高品質ソフトウェアの開発を支援す
ることができる。
(2) Due to the effect of (1) above, after the coverage measurement for the test target program is completed, the recorded contents of the information area 40 of all branch instructions are extracted and the condition is satisfied for each branch instruction. Since it is possible to determine whether a branch has taken place or not, and to determine the conditions for the branch in the case where the branch is taken due to the condition being met, software debugging, especially tests regarding branch instructions, can be performed in detail, resulting in high quality Can support software development.

(3)また、ホストコンピュータ19においてはカバレ
ージ測定モードと通常動作モードとの切換えが可能とさ
れているため、カバレージ測定モードによりテスト対象
プログラムのデバッグが十分に行われた後、特に当該テ
スト対象プログラムが実稼動に移行される場合に、分岐
命令コードを通常モードに簡単に戻すことができ、これ
により、分岐命令のワード長がカバレージ測定時より減
少され、実稼動に移行された場合のプログラム実行の効
率低下を抑制できる。
(3) In addition, since the host computer 19 is capable of switching between the coverage measurement mode and the normal operation mode, after the program under test has been sufficiently debugged in the coverage measurement mode, The branch instruction code can be easily returned to normal mode when the program is moved to production, which reduces the word length of the branch instruction from the time of the coverage measurement and reduces program execution when the program is moved to production. It is possible to suppress the decrease in efficiency.

(4)更に上記(1)、(2)の作用効果は、カバレー
ジ測定モードにおいて形成された分岐命令を用いること
で得られるもので、外付はハードウェアによって得るも
のではないため、命令キャッシュを内蔵するなど、評価
チップが高機能化されたものであるにもかかわらず、デ
バッグ対象プログラムのカバレージ測定を適確に行うこ
とができる。換言すれば1本実施例でのカバレージ測定
方法によれば、特殊なハードウェアを必要とせずに、テ
スト対象プログラムの実行環境そのものにおいてテスト
することができるので、マイクロコンピュータが高機能
化されても、それに対処し得る。
(4) Furthermore, the effects of (1) and (2) above are obtained by using the branch instruction formed in the coverage measurement mode, and the external information is not obtained by hardware, so the instruction cache is Even though the evaluation chip is highly functional, such as by having a built-in chip, it is possible to accurately measure the coverage of the program to be debugged. In other words, according to the coverage measurement method in this embodiment, the test can be performed in the execution environment of the test target program itself without requiring special hardware, so even if the microcomputer becomes more sophisticated, , you can deal with it.

〔実 施 例2〕 第7図には、仮想記憶システムへの適用例が示される。[Implementation example 2] FIG. 7 shows an example of application to a virtual storage system.

同図に示されるように、このシステムは、特に制限され
ないが、多様な分散キャッシュと並列処理により高機能
化されたマイクロコンピュータ50と、テスト対象プロ
グラムなどが格納されるRAM51と、本実施例システ
ムの初期設定用のプログラムなどが格納されたROM5
2と、記憶装置54との間でデータの入出力を可能とす
るl1053とを有する。尚、マイクロコンピュータ5
0の基本的構成は第2図に示されるのと等しい。記憶装
置154には例えばフロッピーディスク装置が適用され
、A、B、Cで区別されるように複数のプログラムが格
納されている。このプログラムA、B、Cがl1053
を介して選択的にRAM51に転送されることにより、
当該複数のプログラムA、B、Cが時分割で使用可能と
される。
As shown in the figure, this system includes, but is not particularly limited to, a microcomputer 50 that is highly functional through various distributed caches and parallel processing, a RAM 51 in which test target programs, etc. are stored, and the system of this embodiment. ROM5 that stores initial setting programs, etc.
2, and an I1053 that enables data input/output between the storage device 54 and the storage device 54. Furthermore, microcomputer 5
The basic configuration of 0 is the same as shown in FIG. For example, a floppy disk device is applied to the storage device 154, and a plurality of programs are stored therein, distinguished by A, B, and C. This program A, B, and C are l1053
By being selectively transferred to the RAM 51 via
The plurality of programs A, B, and C can be used in a time-sharing manner.

かかるシステムにおいて外部記憶装置54内の複数のプ
ログラムA、B、Cの全てがテスト対象とされる場合で
も、上記実施例と同様に、分岐命令の特定ビット例えば
最上位ビットの状態を変更するとともに当該命令コード
に分岐命令の実行状況をセットするための情報エリアを
付加することにより(第3図参照)、当該分岐命令のカ
バレージ測定を適確に行うことができる。例えばプログ
ラムAがRAM51に転送され、それがマイクロコンピ
ュータ50により実行されると、上記の分岐命令フェッ
チにより当該分岐命令の情報エリアに当該命令の実行状
況が記録される。情報エリア及び当該エリアへの実行状
況の記録については上記第1実施例の場合と同様である
のでここでは詳述しない。そしてこのプログラムAから
他のプログラム例えばプログラムCの実行に移行される
場合、RAM51内にはプログラムCが格納されること
になるが、RAM51にこのプログラムCが転送される
前に当該RAM51内のプログラムAが記憶装置154
に退避される。これにより、上記プログラムAについて
のカバレージ測定結果が消滅されるのを防止することが
できる。そしてその後にRAM51にプログラムCが転
送され、上記プログラムAと同様にマイクロコンピュー
タ50により当該RAM51内のプログラムCが実行さ
れ、当該分岐命令の実行状況が当該分岐命令の情報エリ
アに記録される。尚、他のプログラムへ移行される場合
にも上記と同様にプログラムの退避が行われる。そして
同一分岐命令が複数回実行される場合には、上記実施例
の場合と同様に、情報エリアに既に記録されている実行
状況と今回の実行状況との論理和がとられ、それが新た
な実行状況として当該情報エリアに記録される。
Even if all of the programs A, B, and C in the external storage device 54 are to be tested in such a system, as in the above embodiment, the state of a specific bit of a branch instruction, for example, the most significant bit, is changed and By adding an information area for setting the execution status of the branch instruction to the instruction code (see FIG. 3), it is possible to accurately measure the coverage of the branch instruction. For example, when program A is transferred to the RAM 51 and executed by the microcomputer 50, the execution status of the branch instruction is recorded in the information area of the branch instruction by the branch instruction fetch described above. The information area and the recording of the execution status in the area are the same as in the first embodiment, and will not be described in detail here. When this program A is transferred to the execution of another program, for example, program C, program C will be stored in the RAM 51, but before this program C is transferred to the RAM 51, the program in the RAM 51 will be A is the storage device 154
will be evacuated to. This makes it possible to prevent the coverage measurement results for the program A from being erased. Thereafter, the program C is transferred to the RAM 51, and the program C in the RAM 51 is executed by the microcomputer 50 in the same way as the program A, and the execution status of the branch instruction is recorded in the information area of the branch instruction. Note that when moving to another program, the program is saved in the same way as above. When the same branch instruction is executed multiple times, the execution status already recorded in the information area is logically ORed with the current execution status, and this is used as the new execution status. The execution status is recorded in the information area.

このようにして全てのテスト対象プログラムについての
−通りのテストが終了された時点で、記憶装置54内に
退避されたプログラムから分岐命令を抽出することによ
り、上記実施例の場合と同様に分岐命令のカバレージ解
析を適確に行うことができる。尚、このカバレージ解析
については上記実施例と同様に、ホストコンピュータ1
9 (第1図参照)によって、若しくはマイクロコンピ
ュータ50によって行うことができる。
When the tests for all test target programs have been completed in this way, the branch instruction is extracted from the program saved in the storage device 54, and the branch instruction is extracted as in the case of the above embodiment. Coverage analysis can be performed accurately. Note that this coverage analysis is performed on the host computer 1 as in the above embodiment.
9 (see FIG. 1) or by the microcomputer 50.

〔実 施 例3〕 第8図には、他の実施例において使用されるCVR(カ
バレージ)命令のフォーマットが示される。同図に示さ
れるCVR命令は、特に制限されないが、60で示され
る命令コードと、61で示される情報エリアとから成る
。この命令コード(5555)は、当該命令がCVR命
令であることを示しているが、CVR命令を示す限り、
どのような値でもよい。この命令がマイクロコンピュー
タで実行される場合には、情報エリア61に当該命令の
実行回数が記録されるようになっている。
[Embodiment 3] FIG. 8 shows the format of a CVR (coverage) instruction used in another embodiment. The CVR instruction shown in the figure consists of an instruction code shown at 60 and an information area shown at 61, although this is not particularly limited. This instruction code (5555) indicates that the instruction is a CVR instruction, but as long as it indicates a CVR instruction,
Any value is acceptable. When this instruction is executed by a microcomputer, the number of executions of the instruction is recorded in the information area 61.

第9図には分岐命令を含む通常のプログラムの基本的な
流れが示され、第10図には上記CVR命令が含まれる
プログラムの流れが示される。
FIG. 9 shows the basic flow of a normal program including a branch instruction, and FIG. 10 shows the flow of a program including the CVR instruction.

上記CVR命令を用いてカバレージ測定を行う場合、第
10図に示されるように、分岐命令の通過パス62と分
岐命令の分岐パス63とにCVR命令64.65が挿入
される。このようなCVR命令挿入は、テスト対象プロ
グラムのアセンブラ段階で行うことができる。CVRの
情報エリア61には当該CVR命令の実行回数が記録さ
れるが、その初期値は16進数で(OOOO)とされる
When performing coverage measurement using the CVR instructions, CVR instructions 64 and 65 are inserted into the branch instruction passing path 62 and the branch instruction branch path 63, as shown in FIG. Such CVR instruction insertion can be performed at the assembler stage of the program to be tested. The CVR information area 61 records the number of executions of the CVR instruction, and its initial value is (OOOO) in hexadecimal.

CVR命令の実行回数は当該CVR命令を実行するマイ
クロコンピュータによって行われる。例えば第1図に示
されるシステムを使用する場合、分岐命令に情報エリア
を形成する必要はないが、ホストコンピュータ19にお
いて当該分岐命令の直後、すなわち当該分岐命令の通過
パス62と分岐パス63とに上記CVR命令が挿入され
る。そしてこのCVR命令を含むプログラムがRAM1
2に転送され、評価チップ24で当該プログラムが実行
される。このプログラム実行において第10図の分岐命
令がフェッチされ、当該分岐命令の条件不成立により当
該分岐命令が通過された場合には、CVR命令64にお
ける情報エリア61の値が+1され、また分岐条件成立
により分岐された場合にはCVR命令65における情報
エリア61の値が+1される。このようなインクリメン
トは、制御ユニット32の制御下で実行ユニット33に
よって行われる。尚、このインクリメントは、16進数
の(F F F F)で終了される。この情報エリアの
値は分岐命令の通過回数又は分岐回数を示し、これによ
って分岐命令の実行状況を間接的に把握することができ
、従って上記実施例と同様の効果を得ることができる。
The number of times a CVR instruction is executed is determined by the microcomputer that executes the CVR instruction. For example, when using the system shown in FIG. 1, it is not necessary to form an information area for a branch instruction, but in the host computer 19 immediately after the branch instruction, that is, on the path 62 and branch path 63 of the branch instruction. The above CVR instruction is inserted. The program containing this CVR instruction is stored in RAM1.
2, and the evaluation chip 24 executes the program. In this program execution, if the branch instruction shown in FIG. 10 is fetched and the branch instruction is passed because the condition of the branch instruction is not met, the value of the information area 61 in the CVR instruction 64 is increased by 1, and if the branch condition is met, the value of the information area 61 is increased by 1. When branched, the value of the information area 61 in the CVR instruction 65 is incremented by 1. Such incrementing is performed by the execution unit 33 under the control of the control unit 32. Note that this increment is terminated by a hexadecimal number (F F F F). The value of this information area indicates the number of times the branch instruction has passed or the number of branches, and thereby the execution status of the branch instruction can be indirectly grasped, so that the same effects as in the above embodiment can be obtained.

尚、CVR命令は、カバレージ測定が完了された後は不
必要となるから削除される。
Note that the CVR command is deleted after the coverage measurement is completed because it becomes unnecessary.

〔実 施 例4〕 第11図には、他の実施例において使用されるCVR命
令のフォーマットが示される。同図に示されるCVR命
令は上記第3実施例と同様に、CVR命令を示すコード
(5555)を含んで成るが、このコードの最上位ビッ
トが情報エリアとして利用される。すなわちこのCVR
命令がマイクロコンピュータによって実行された場合、
上記CVRの命令コード(5555)の最上位ビットが
111 I+とされ、16進数の(D555)とされる
[Embodiment 4] FIG. 11 shows the format of a CVR instruction used in another embodiment. The CVR instruction shown in the figure includes a code (5555) indicating the CVR instruction, as in the third embodiment, but the most significant bit of this code is used as an information area. In other words, this CVR
If the instructions are executed by a microcomputer,
The most significant bit of the CVR instruction code (5555) is 111 I+, which is hexadecimal (D555).

ただし、2回目以降のCVR命令フェッチ時には当該最
上位ビットへの書込みサイクルは発生されない。
However, during the second and subsequent CVR instruction fetches, a write cycle to the most significant bit is not generated.

本実施例におけるCVR命令は、上記第3実施例と同様
に分岐命令の通過パスと分岐パスとの双方に挿入される
ことにより、上記実施例と同様に評価チップ24で実行
され、それぞれ通過、分岐に応じた1ビツト情報により
分岐命令の実行状況の記録が可能とされる。従って本実
施例においても、上記実施例と同様の効果を得ることが
できる。
The CVR instruction in this embodiment is inserted into both the pass path and the branch path of the branch instruction as in the third embodiment, and is executed by the evaluation chip 24 in the same way as in the above embodiment. The execution status of a branch instruction can be recorded using 1-bit information corresponding to the branch. Therefore, in this embodiment as well, the same effects as in the above embodiment can be obtained.

特に本実施例では、カバレージ測定において2回目以降
のCVR命令フェッチ時には情報エリア(命令コードの
最上位ビット)への書込みサイクルが発生されないため
、高速システムのテスト時においてもカバレージ測定に
起因するプログラム実行速度の低下を阻止することがで
きる。
In particular, in this embodiment, a write cycle to the information area (the most significant bit of the instruction code) is not generated during the second and subsequent CVR instruction fetches during coverage measurement, so even when testing a high-speed system, program execution caused by coverage measurement It is possible to prevent a decrease in speed.

以上本発明者によってなされた発明を実施例に基づいて
具体的に説明したが、本発明は上記実施例に限定されず
、その要旨を逸脱しない範囲において種々変更可能であ
る。
Although the invention made by the present inventor has been specifically explained based on the examples above, the present invention is not limited to the above-mentioned examples, and can be variously modified without departing from the gist thereof.

例えば、上記実施例では評価チップ24によって、分岐
命令を含む各種命令を実行するようにしたが、ユーザ実
機に搭載される実チップを使用することもできる。また
、上記実施例ではテスト対象プログラムをユーザ開発装
置10内のRAM 12内に格納するようにしたが、イ
ンサーキットエミュレータ18内の貸出しメモリやその
他の書込み/読出し可能な外部メモリを使用することも
できる。更に上記第1実施例において、カバレージ測定
の簡略化を図るため、分岐条件の種類を記録するための
第3のエリア40cを省略してもよい。
For example, in the above embodiment, various instructions including branch instructions are executed by the evaluation chip 24, but a real chip mounted on a user's actual device may also be used. Further, in the above embodiment, the test target program is stored in the RAM 12 in the user development device 10, but it is also possible to use a loaned memory in the in-circuit emulator 18 or other writable/readable external memory. can. Furthermore, in the first embodiment, the third area 40c for recording the type of branch condition may be omitted in order to simplify the coverage measurement.

以上の説明では主として本発明者によってなされた発明
をその背景となった利用分野であるマイクロコンピュー
タ開発システムや仮想記憶システムに適用した場合につ
いて説明したが、本発明はそれに限定されるものではな
く、例えば中、大型の全てのコンピュータシステム及び
その開発システムなどにも広く適用することができる。
In the above description, the invention made by the present inventor was mainly applied to the field of application, such as a microcomputer development system or a virtual storage system, but the present invention is not limited thereto. For example, it can be widely applied to all medium to large-sized computer systems and their development systems.

本発明は少なくともソフトウェアデバッグを必要とする
条件のものに適用することができる。
The present invention can be applied to at least conditions that require software debugging.

〔発明の効果〕〔Effect of the invention〕

本願において開示される発明のうち代表的なものによっ
て得られる効果を簡単に説明すれば、下記の通りである
A brief explanation of the effects obtained by typical inventions disclosed in this application is as follows.

すなわち、分岐命令コードの特定ビットの状態を変更し
て当該命令コードをカバレージ測定対象として認識可能
とするとともに、当該命令コードに情報エリアを付加し
、若しくは情報エリアが付加されたカバレージ命令を分
岐命令の直後に挿入することにより、当該情報エリアに
、当該分岐命令実行状況を記録させ、当該情報エリアの
記録内容を解析することで適確なカバレージ測定を行う
ことができる。しかも、かかるカバレージ測定方法にお
ける分岐命令実行状況検出は、マイクロコンピュータの
外部に出力される信号を用いるのではなく、マイクロコ
ンピュータに実行状況を書込ませることで可能としてい
るので、マイクロコンピュータが高機能化されている場
合においても、分岐命令の実行状況を直接若しくはカバ
レージ命令の実行状況により間接的に検出することがで
き、ソフトウェアの品質向上に大きく寄与できる。
In other words, by changing the state of a specific bit of a branch instruction code so that the instruction code can be recognized as a coverage measurement target, an information area is added to the instruction code, or a coverage instruction with an information area added is used as a branch instruction. By inserting it immediately after, the execution status of the branch instruction is recorded in the information area, and by analyzing the recorded contents of the information area, it is possible to perform accurate coverage measurement. Moreover, branch instruction execution status detection in this coverage measurement method is made possible by writing the execution status into the microcomputer, rather than using signals output externally from the microcomputer. Even in the case where the branch instruction is executed, the execution status of the branch instruction can be detected directly or indirectly by the execution status of the coverage instruction, which can greatly contribute to improving the quality of the software.

更に、上記のように情報エリアが付加された分岐命令若
しくはカバレージ命令がフェッチされた場合に当該情報
エリアに分岐命令実行状況若しくはカバレージ命令の実
行状況を記録可能なマイクロコンピュータによって、上
記のようなカバレージ測定を適確に行うことができる。
Furthermore, when a branch instruction or a coverage instruction to which an information area is added as described above is fetched, a microcomputer capable of recording the execution status of the branch instruction or the coverage instruction in the information area is used to perform the coverage as described above. Measurements can be made accurately.

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

第1図は本発明の第1実施例方法を適用したマイクロコ
ンピュータ開発システムのブロック図、第2図は第1図
に示されるマイクロコンピュータ(評価チップ)の詳細
な構成ブロック図、第3図は分岐命令のフォーマット図
、 第4図は第1図に示されるシステムにおけるRAMの命
令語配置と当該命令の機械語コードとの関係説明図、 第5図はマイクロコンピュータ内の主要レジスタとその
ビット構成との説明図、 第6図は各種分岐命令とそれに対応する分岐条件との説
明図。 第7図は他の実施例システムのブロック図、第8図は他
の実施例方法に係るカバレージ命令のフォーマット説明
図、 第9図は分岐命令を含むプログラムの基本的な流れを示
すフローチャート、 第1O図はカバレージ命令が挿入されたプログラムの基
本的な流れを示すフローチャート、第11図は他の実施
例方法に係るカバレージ命令のフォーマット説明図、 第12図は分岐命令ファイルの説明図、第13図はカバ
レージ解析結果の説明図である。 10・・・ユーザ開発装置、12.51・・・RAM。 13.52・・・ROM、14.53・・・Ilo、1
6゜17.21・・・フロッピーディスク、18・・・
インサーキットエミュレータ、19・・・ホストコンピ
ュータ、20・・・プリンタ、22・・・表示装置、2
3・・・ポンド、24.50・・・マイクロコンピュー
タ、30・・・命令ブリフェッチユニット、31・・・
命令デコードユニット、32・・・制御−1=ソト、3
3・・・実行ユニット、34・・・メモリ管理ユニット
、35・・・入出力制御ユニット、40.61・・・情
報エリア、40a・・・第1のエリア、40b・・・第
2のエリア、40C・・・第3のエリア、54・・・記
憶装置、60・・・命令コード、62・・・通過パス、
63・・・分岐パス、64゜65・・・CVR命令。 5 第  1  図 第 2 図 第 図 第 図 第 図 第 図 第 図
FIG. 1 is a block diagram of a microcomputer development system to which the method of the first embodiment of the present invention is applied, FIG. 2 is a detailed configuration block diagram of the microcomputer (evaluation chip) shown in FIG. 1, and FIG. A format diagram of a branch instruction. Figure 4 is an explanatory diagram of the relationship between the instruction word arrangement in RAM and the machine code of the instruction in the system shown in Figure 1. Figure 5 is a diagram of the main registers in the microcomputer and their bit configurations. FIG. 6 is an explanatory diagram of various branch instructions and corresponding branch conditions. 7 is a block diagram of a system of another embodiment, FIG. 8 is an explanatory diagram of the format of a coverage instruction according to a method of another embodiment, FIG. 9 is a flowchart showing the basic flow of a program including a branch instruction, Figure 1O is a flowchart showing the basic flow of a program into which a coverage instruction has been inserted, Figure 11 is an explanatory diagram of the format of a coverage instruction according to another embodiment method, Figure 12 is an explanatory diagram of a branch instruction file, and Figure 13 is an explanatory diagram of a branch instruction file. The figure is an explanatory diagram of the coverage analysis results. 10... User development device, 12.51... RAM. 13.52...ROM, 14.53...Ilo, 1
6゜17.21...floppy disk, 18...
In-circuit emulator, 19... host computer, 20... printer, 22... display device, 2
3...pound, 24.50...microcomputer, 30...instruction brief fetch unit, 31...
Instruction decode unit, 32...Control-1=Soto, 3
3... Execution unit, 34... Memory management unit, 35... Input/output control unit, 40.61... Information area, 40a... First area, 40b... Second area , 40C...Third area, 54...Storage device, 60...Instruction code, 62...Transit path,
63...Branch path, 64°65...CVR instruction. 5 Figure 1 Figure 2 Figure Figure Figure Figure Figure Figure

Claims (1)

【特許請求の範囲】 1、分岐命令コードの特定ビットの状態を変更して当該
命令コードをカバレージ測定対象として認識可能とする
とともに、当該命令コードに情報エリアを付加するステ
ップと、この情報エリアが付加された分岐命令を含むプ
ログラムをマイクロコンピュータに実行させ、当該分岐
命令の実行状況を当該情報エリアに記録させるステップ
と、この情報エリアの記録内容に基づいて当該分岐命令
のカバレージ解析を行うステップとを含むカバレージ測
定方法。 2、上記分岐命令の実行状況には、上記分岐命令に従っ
て分岐したか否かの情報が含まれる請求項1記載のカバ
レージ測定方法。 3、上記分岐命令の実行状況には、上記分岐命令に従っ
て分岐したか否かの情報と、分岐条件の種類についての
情報とが含まれる請求項1記載のカバレージ測定方法。 4、分岐命令の分岐パスと通過パスとの双方に、情報エ
リアを備えたカバレージ命令を挿入するステップと、こ
のカバレージ命令が挿入されたプログラムをマイクロコ
ンピュータに実行させ、当該カバレージ命令の実行状況
を上記情報エリアに記録させるステップと、当該情報エ
リアの記録内容に基づいて上記分岐命令のカバレージ解
析を行うステップとを含むカバレージ測定方法。 5、上記分岐命令コードの特定ビットの状態変更及び分
岐命令コードへの情報エリアの付加、又は上記カバレー
ジ命令の挿入は、高級言語で記述されたソースプログラ
ムを機械語に翻訳する段階で行われる請求項1、2、3
又は4記載のカバレージ測定方法。 6、分岐命令コードの特定ビットの状態が変更され且つ
当該命令コードに情報エリアが付加されて成る分岐命令
をフェッチした場合に当該情報エリアへの情報記録制御
信号を生成する命令制御部と、この情報記録制御信号に
従って上記分岐命令の実行状況を当該情報エリアに記録
する実行部とを含むマイクロコンピュータ。 7、情報エリアを含むカバレージ命令をフェッチした場
合に当該情報エリアへの情報記録制御信号を生成する命
令制御部と、この情報記録制御信号に従って、当該命令
の実行状況を上記情報エリアにセットする実行部とを含
むマイクロコンピュータ。
[Claims] 1. Changing the state of a specific bit of a branch instruction code to make the instruction code recognizable as a coverage measurement target, and adding an information area to the instruction code; A step of causing the microcomputer to execute a program including the added branch instruction and recording the execution status of the branch instruction in the information area, and a step of performing coverage analysis of the branch instruction based on the recorded contents of the information area. Coverage measurement methods, including: 2. The coverage measuring method according to claim 1, wherein the execution status of the branch instruction includes information as to whether or not a branch has been taken in accordance with the branch instruction. 3. The coverage measuring method according to claim 1, wherein the execution status of the branch instruction includes information as to whether or not a branch has been taken in accordance with the branch instruction, and information as to the type of branch condition. 4. A step of inserting a coverage instruction with an information area into both the branch path and the passing path of the branch instruction, and causing the microcomputer to execute the program into which this coverage instruction has been inserted, and checking the execution status of the coverage instruction. A coverage measuring method comprising the steps of: recording in the information area; and performing coverage analysis of the branch instruction based on the recorded content of the information area. 5.Claim that changing the state of specific bits of the branch instruction code, adding an information area to the branch instruction code, or inserting the coverage instruction described above is performed at the stage of translating a source program written in a high-level language into machine language. Terms 1, 2, 3
Or the coverage measurement method described in 4. 6. An instruction control unit that generates an information recording control signal to the information area when a branch instruction in which the state of a specific bit of the branch instruction code is changed and an information area is added to the instruction code is fetched; A microcomputer including an execution unit that records the execution status of the branch instruction in the information area according to an information recording control signal. 7. An instruction control unit that generates an information recording control signal to the information area when a coverage instruction including an information area is fetched, and an execution unit that sets the execution status of the instruction to the information area in accordance with this information recording control signal. A microcomputer including a section.
JP1342966A 1989-12-29 1989-12-29 Coverage measurement method and microcomputer Expired - Fee Related JP2915944B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1342966A JP2915944B2 (en) 1989-12-29 1989-12-29 Coverage measurement method and microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1342966A JP2915944B2 (en) 1989-12-29 1989-12-29 Coverage measurement method and microcomputer

Publications (2)

Publication Number Publication Date
JPH03204044A true JPH03204044A (en) 1991-09-05
JP2915944B2 JP2915944B2 (en) 1999-07-05

Family

ID=18357893

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1342966A Expired - Fee Related JP2915944B2 (en) 1989-12-29 1989-12-29 Coverage measurement method and microcomputer

Country Status (1)

Country Link
JP (1) JP2915944B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140006861A (en) * 2011-01-13 2014-01-16 에이알엠 리미티드 Processing apparatus, trace unit and diagnostic apparatus
US11822468B2 (en) 2019-05-24 2023-11-21 Microsoft Technology Licensing, Llc Executable code branch annotations for objective branch verification

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140006861A (en) * 2011-01-13 2014-01-16 에이알엠 리미티드 Processing apparatus, trace unit and diagnostic apparatus
JP2014507710A (en) * 2011-01-13 2014-03-27 アーム・リミテッド Processing device, trace unit, and diagnostic device
US10379989B2 (en) 2011-01-13 2019-08-13 Arm Limited Processing apparatus, trace unit and diagnostic apparatus
US11822468B2 (en) 2019-05-24 2023-11-21 Microsoft Technology Licensing, Llc Executable code branch annotations for objective branch verification

Also Published As

Publication number Publication date
JP2915944B2 (en) 1999-07-05

Similar Documents

Publication Publication Date Title
US5134701A (en) Test apparatus performing runtime replacement of program instructions with breakpoint instructions for processor having multiple instruction fetch capabilities
US6286132B1 (en) Debugging support apparatus, a parallel execution information generation device, a computer-readable recording medium storing a debugging support program, and a computer-readable recording medium storing a parallel execution information generation program
US6321331B1 (en) Real time debugger interface for embedded systems
US5142679A (en) Method and apparatus for collecting execution status data of structured program
US8266608B2 (en) Post-compile instrumentation of object code for generating execution trace data
US6430741B1 (en) System and method for data coverage analysis of a computer program
US4742466A (en) System for measuring path coverage represented by the degree of passage of execution paths in a program
US20030033592A1 (en) Software debugger and software development support system
US20060041867A1 (en) Method, apparatus and computer program product for implementing enhanced compiled breakpoint analysis
JPH03188535A (en) Assembly language programming error detecting process
CN111367742A (en) Method, device, terminal and computer readable storage medium for debugging MVP processor
US7110934B2 (en) Analysis of the performance of a portion of a data processing system
JPH03204044A (en) Coverage measuring method and microcomputer
CN114691520A (en) Instruction programmable buffer area design system based on processor debugging framework
JPH096646A (en) Program simulation device
CN1997971A (en) Emulation and debug interfaces for testing an integrated circuit with an asynchronous microcontroller
CN112905396B (en) Information display method, device and equipment and storage medium
JPH07129430A (en) Testing method for program
JP3068578B2 (en) In-circuit emulator and saturation calculation processing method
JP3398178B2 (en) Simulator
CN117933167A (en) Simulation method and simulator for ultra-long instruction word heterogeneous processor
JPH0528002A (en) Microprocessor
CN116340082A (en) RISCV application program dynamic analysis method and device based on hardware virtualization
CN118245381A (en) Target instruction detection method, apparatus, storage medium, and computer program product
JPS61123942A (en) Debug device for microprocessor

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees