JPH07191879A - Microprocessor provided with executing function of instruction for debugging and debugging method - Google Patents

Microprocessor provided with executing function of instruction for debugging and debugging method

Info

Publication number
JPH07191879A
JPH07191879A JP5332878A JP33287893A JPH07191879A JP H07191879 A JPH07191879 A JP H07191879A JP 5332878 A JP5332878 A JP 5332878A JP 33287893 A JP33287893 A JP 33287893A JP H07191879 A JPH07191879 A JP H07191879A
Authority
JP
Japan
Prior art keywords
instruction
memory
debugging
address
main memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP5332878A
Other languages
Japanese (ja)
Inventor
Nobuhiko Yamagami
宣彦 山上
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP5332878A priority Critical patent/JPH07191879A/en
Publication of JPH07191879A publication Critical patent/JPH07191879A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Microcomputers (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PURPOSE:To easilky recognize the conditions of program execution by surely letting the influence of the execution of a program appear at any arbitrary check point of the program as memory reference outside a chip and observing that operation from the outside of the chip. CONSTITUTION:When an instruction decoded by an instruction decoder 106 is an instruction for debugging, an index number idi (=i) designated by this instruction for debugging is dispatched from the instruction decoder 106 to an instruction operation control part 110 for debugging, and the reading of the instruction is indicated. Based on this idi and the contents of a base register (BR) 109, the memory address of the moving destimation of the instruction, which is replaced by the instruction for debugging, to be originally executed, namely, the leading address of an i-th entry in a table area 201 of a main memory 20 is calculated by the instruction operation control part 110 for debugging, and the instruction to be truely executed from that address is read through a system bus 30, dispatched to the instruction decoder 106 and decoded.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】この発明は、チップ外に設けられ
た主メモリの格納情報の一部のコピーが保持されるキャ
ッシュメモリを内蔵し、デバッグ用命令の実行機能を有
するマイクロプロセッサおよびデバッグ方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microprocessor having a built-in cache memory for holding a part of stored information in a main memory provided outside a chip and having a function of executing a debugging instruction, and a debugging method. Regarding

【0002】[0002]

【従来の技術】近年のマイクロプロセッサは、半導体技
術の著しい進歩に伴う集積度の向上のために、同一チッ
プ上にキャッシュメモリを内蔵しているのが一般的であ
る。このようなマイクロプロセッサでは、当該プロセッ
サのチップ外に設けられた主メモリ(外部の主メモリ)
に格納されている実行中のプログラムの一部が外部バス
(システムバス)を介してキャッシュメモリに既に読み
込まれていて、実行すべき命令が直接キャッシュメモリ
から取り出される場合には、チップ外(の主メモリ)に
は命令フェッチ等の動作が生じない。
2. Description of the Related Art In recent years, microprocessors generally incorporate a cache memory on the same chip in order to improve the degree of integration with the remarkable progress of semiconductor technology. In such a microprocessor, a main memory (external main memory) provided outside the chip of the processor
If a part of the running program stored in is already loaded into the cache memory via the external bus (system bus) and the instruction to be executed is fetched directly from the cache memory, No operation such as instruction fetch occurs in the main memory).

【0003】このような場合、たとえロジックアナライ
ザ等で外部からチップ(とシステムバスとの接続部)を
観察していても、プログラムがどのように実行されるか
判断できない、
In such a case, it is not possible to determine how the program is executed, even if the chip (the connection portion with the system bus) is externally observed with a logic analyzer or the like.

【0004】[0004]

【発明が解決しようとする課題】上記したように、キャ
ッシュメモリをチップ上に内蔵するマイクロプロセッサ
では、当該マイクロプロセッサのチップ外に設けられた
主メモリに格納されている実行中のプログラムの一部が
キャッシュメモリに既に読み込まれていて、実行すべき
命令が直接キャッシュメモリから取り出される場合に
は、チップ外(の主メモリ)には命令フェッチ等の動作
が生じない。
As described above, in the microprocessor having the cache memory built in the chip, a part of the program being executed which is stored in the main memory provided outside the chip of the microprocessor. Has already been read into the cache memory and the instruction to be executed is directly fetched from the cache memory, no operation such as instruction fetch occurs outside (main memory of) the chip.

【0005】このため従来は、ロジックアナライザ等で
外部からチップを観察していても、プログラムの実行状
況は把握できず、プログラムのデバッグ作業が困難にな
るという問題があった。
For this reason, conventionally, there has been a problem that even if the chip is observed from the outside by a logic analyzer or the like, the execution state of the program cannot be grasped, and it is difficult to debug the program.

【0006】この発明は上記事情を考慮してなされたも
のでその目的は、プログラムの任意のチェックポイント
では、プログラムの実行の影響が必ずチップ外のメモリ
参照となって現れるようにすることができ、これによ
り、その動作をチップ外から観察することによりプログ
ラム実行の様子が簡単に把握できるデバッグ用命令の実
行機能を有するマイクロプロセッサおよびデバッグ方法
を提供することにある。
The present invention has been made in consideration of the above circumstances, and it is an object of the present invention to make it possible that at any checkpoint of a program, the influence of the execution of the program always appears as a memory reference outside the chip. Accordingly, it is an object of the present invention to provide a microprocessor and a debugging method having a function of executing a debugging instruction, by which the state of program execution can be easily grasped by observing the operation from outside the chip.

【0007】[0007]

【課題を解決するための手段】この発明は、キャッシュ
メモリをチップ上に内蔵するマイクロプロセッサが有す
る命令デコード手段に、上記キャッシュメモリから取り
出された実行すべき命令がチップ外に設けられた主メモ
リ上のメモリ番地を直接または間接に指定するためのア
ドレス情報を持つデバッグ用命令である場合には、当該
アドレス情報で指定される主メモリ上のメモリ番地の命
令の読み出しを指示する機能を付加する他、この命令デ
コード手段からの命令読出し指示に応じて、上記アドレ
ス情報で指定される主メモリ上のメモリ番地の命令を真
に実行すべき命令として読み込んで、この命令をデコー
ド手段に与えるデバッグ用命令動作制御手段を上記マイ
クロプロセッサに設け、上記デバッグ用命令を実行する
ことにより、当該命令で指定される主メモリのメモリ番
地から真に実行すべき命令がマイクロプロセッサ内に読
み込まれて、命令デコード手段により解読されるように
したことを特徴とするものである。
SUMMARY OF THE INVENTION According to the present invention, a main memory in which an instruction to be executed fetched from the cache memory is provided outside the chip in an instruction decoding means included in a microprocessor having a cache memory built in the chip. In the case of a debug instruction having address information for directly or indirectly designating the upper memory address, a function for instructing to read the instruction of the memory address on the main memory designated by the address information is added. In addition, in response to an instruction read instruction from the instruction decoding means, the instruction at the memory address on the main memory designated by the address information is read as an instruction to be truly executed, and this instruction is given to the decoding means. By providing the instruction operation control means in the microprocessor and executing the debugging instruction, Instruction to be executed true from the memory address of the main memory specified by decree is read into the microprocessor, it is characterized in that it has to be decrypted by the instruction decoding means.

【0008】[0008]

【作用】上記の構成において、プログラムのデバッグを
行う際には、主メモリに格納される当該プログラム中の
それぞれチェックポイントとすべき場所の各命令を、デ
バッグ用命令に置き換え、置き換えられた命令を、対応
するデバッグ用命令中のアドレス情報により直接或いは
間接に指定される主メモリの各メモリ番地に移してお
く。
In the above structure, when a program is debugged, each instruction stored in the main memory at each check point in the program is replaced with a debugging instruction, and the replaced instruction is replaced with the replaced instruction. , Is moved to each memory address of the main memory which is directly or indirectly designated by the address information in the corresponding debug instruction.

【0009】この主メモリ内のプログラムをマイクロプ
ロセッサにより実行する。ここで、マイクロプロセッサ
にて実行すべき命令は、キャッシュメモリから(キャッ
シュメモリにないミスヒット時には、目的とする命令を
含む1ライン分の命令群が主メモリからキャッシュメモ
リに転送された後)取り出され、命令デコード手段によ
り解読される。
The program in the main memory is executed by the microprocessor. Here, the instruction to be executed by the microprocessor is fetched from the cache memory (when there is a miss in the cache memory, one line of instruction group including the target instruction is transferred from the main memory to the cache memory). And decoded by the instruction decoding means.

【0010】したがって、実行すべき命令が既にキャッ
シュメモリに読み込まれている場合には、チップ外(の
主メモリ)には命令フェッチ等の動作が生じない。とこ
ろが上記の構成においては、キャッシュメモリから取り
出されて命令デコード手段により解読された命令がデバ
ッグ用命令である場合には、命令デコード手段からデバ
ッグ用命令動作制御手段に対して当該デバッグ用命令中
のアドレス情報で指定される主メモリ上のメモリ番地の
命令の読み出しが指示されるため、このデバッグ用命令
動作制御手段によりチップ外の主メモリがアクセスされ
て、上記デバッグ用命令中のアドレス情報で直接または
間接に指定される主メモリ上のメモリ番地の命令、即ち
当該デバッグ用命令に置き換えられて当該デバッグ用命
令のアドレス情報の指定するメモリ番地に移された命令
が、真に実行すべき命令としてマイクロプロセッサ内に
読み込まれる。
Therefore, when the instruction to be executed has already been read into the cache memory, no operation such as instruction fetch occurs outside (on the main memory of) the chip. However, in the above configuration, when the instruction fetched from the cache memory and decoded by the instruction decoding means is a debugging instruction, the instruction decoding means sends the debugging instruction operation control means Since the instruction to read the instruction at the memory address on the main memory specified by the address information is instructed, the main instruction memory outside the chip is accessed by this instruction operation control unit for debugging, and the address information in the above instruction for debugging is directly used. Or, the instruction at the memory address in the main memory that is indirectly designated, that is, the instruction that is replaced with the debugging instruction and moved to the memory address designated by the address information of the debugging instruction is the instruction that should be truly executed. It is loaded into the microprocessor.

【0011】このように、デバッグ用命令に置き換えら
れたプログラムの任意のチェックポイントでは、必ずそ
の置き換えられた元の命令をチップ外の主メモリから読
み込むための動作が行われる。
As described above, at an arbitrary checkpoint of the program replaced with the debugging instruction, the operation for reading the replaced original instruction from the main memory outside the chip is always performed.

【0012】したがって、そのメモリ参照の動作(参照
されるメモリ番地)をチップ外からロジックアナライザ
等で観察することによりプログラム実行の様子が簡単に
把握できる。
Therefore, by observing the memory referencing operation (referenced memory address) from outside the chip with a logic analyzer or the like, the state of program execution can be easily grasped.

【0013】なお、デバッグ用命令動作制御手段により
マイクロプロセッサ内に読み込まれた命令は、命令デコ
ード手段に渡されて、キャッシュメモリから取り出され
た命令の場合と同様に解読され、実行に供される。
The instruction read in the microprocessor by the debug instruction operation control means is passed to the instruction decoding means, decoded and provided for execution in the same manner as the instruction fetched from the cache memory. .

【0014】[0014]

【実施例】図1はこの発明の一実施例に係るマイクロプ
ロセッサを備えた情報処理装置の構成を、マイクロプロ
セッサの内部構成を中心に示すブロック図である。同図
において、10は1チップのマイクロプロセッサ、20
はマイクロプロセッサ1のチップ外に設けられた主メモ
リ、30はマイクロプロセッサ10および主メモリ20
が接続されるシステムバスである。このシステムバス3
0は、マイクロプロセッサ10の外部バスをなしてい
る。
FIG. 1 is a block diagram showing the configuration of an information processing apparatus including a microprocessor according to an embodiment of the present invention, focusing on the internal configuration of the microprocessor. In the figure, 10 is a one-chip microprocessor, 20
Is a main memory provided outside the chip of the microprocessor 1, and 30 is the microprocessor 10 and the main memory 20.
Is the system bus to which is connected. This system bus 3
0 forms an external bus of the microprocessor 10.

【0015】主メモリ20は、プログラム、データ等を
格納するためのものである。この主メモリ20には、マ
イクロプロセッサ10内の後述するベースレジスタ(B
R)108の指定する特定のメモリ番地(ベースアドレ
ス)から始まる例えば4nバイトのテーブル領域201
が必要に応じて確保される。
The main memory 20 is for storing programs, data and the like. The main memory 20 includes a base register (B
R) 108 starting from a specific memory address (base address) specified by, for example, a table area 201 of 4n bytes
Are secured as needed.

【0016】テーブル領域201は、例えば4バイト長
の命令がそれぞれ格納されるn個のエントリからなる。
このテーブル領域201内エントリ(のメモリ番地)は
インデックス番号(エントリ番号)idi (idi =0
〜n−1)により間接指定される。
The table area 201 is composed of n entries each of which stores, for example, a 4-byte instruction.
The entry (memory address) in this table area 201 is index number (entry number) id i (id i = 0
~ N-1) indirectly specified.

【0017】マイクロプロセッサ10は、主メモリ20
に格納されている実行中のプログラムの一部のコピーが
保持される命令キャッシュメモリ101と、主メモリ2
0に格納されているデータの一部が保持されるデータキ
ャッシュメモリ102と、システムバス30を介して主
メモリ20と命令キャッシュメモリ101/データキャ
ッシュメモリ102間の命令/データの転送を制御する
バスインタフェース103と、このバスインタフェース
103および後述するデバッグ用命令動作制御部110
とシステムバス30との間に設けられたバスドライバ1
04とを有している。
The microprocessor 10 includes a main memory 20.
An instruction cache memory 101 for holding a copy of a part of the program being executed stored in the main memory 2
A data cache memory 102 that holds a part of the data stored in 0, and a bus that controls transfer of instructions / data between the main memory 20 and the instruction cache memory 101 / data cache memory 102 via the system bus 30. Interface 103, bus interface 103, and debug instruction operation control unit 110 described later
Driver 1 provided between the bus and the system bus 30
04 and.

【0018】マイクロプロセッサ10はまた、命令キャ
ッシュメモリ101から読み出された命令を保持するた
めの命令バッファ105と、この命令バッファ105に
保持された命令のオペレーションコード(OPコード)
をもとに当該命令の指示する処理内容を解読する命令デ
コーダ106と、オペランドデータを保持するレジスタ
ファイル107とを有している。
The microprocessor 10 also has an instruction buffer 105 for holding an instruction read from the instruction cache memory 101, and an operation code (OP code) of the instruction held in the instruction buffer 105.
It has an instruction decoder 106 that decodes the processing content designated by the instruction based on the above, and a register file 107 that holds operand data.

【0019】命令デコーダ106は、命令の解読の他、
レジスタファイル107からの必要なオペランドの読み
出し(例えば分岐命令の場合に、分岐アドレスの計算に
必要なオペランドの読み出し)を行う。
The instruction decoder 106 decodes instructions and
A necessary operand is read from the register file 107 (for example, in the case of a branch instruction, an operand necessary for calculating a branch address is read).

【0020】また命令デコーダ106は、主メモリ20
のテーブル領域201内のエントリ(のメモリ番地)を
間接指定するためのインデックス番号idi が設定され
たインデックスフィールドを持つデバッグ用命令を解読
した場合には、デバッグ用命令動作制御部110に対し
て、当該インデックス番号idi で間接指定される主メ
モリ20上のメモリ番地の4バイト命令の読み出しを指
示するようになっている。
The instruction decoder 106 also includes a main memory 20.
When the debugging instruction having the index field in which the index number id i for indirectly designating the entry (memory address) in the table area 201 is decoded, the debugging instruction operation control unit 110 is read. The 4-byte instruction at the memory address on the main memory 20 indirectly designated by the index number id i is instructed to be read.

【0021】マイクロプロセッサ10は更に、命令デコ
ーダ106の命令解読結果に従い、指示された演算やデ
ータキャッシュメモリ102とのロード/ストア等を実
行し、結果のオペランドデータをレジスタファイル10
7等に書き込む命令実行部108と、上記デバッグ用命
令が使用する主メモリ20上のテーブル領域201の先
頭メモリ番地(をベースアドレスとして)保持するベー
スレジスタ(BR)109と、デバッグ用命令の指定す
る動作を制御するためのデバッグ用命令動作制御部11
0とを有している。
The microprocessor 10 further executes the instructed operation, load / store with the data cache memory 102, etc. according to the instruction decoding result of the instruction decoder 106, and stores the resulting operand data in the register file 10.
7 and so on, a base register (BR) 109 for holding the top memory address (with the base address) of the table area 201 on the main memory 20 used by the debug instruction, and designation of the debug instruction Instruction operation control section 11 for controlling the operation to be performed
It has 0 and.

【0022】デバッグ用命令動作制御部110は、命令
デコーダ105からのデバッグ用命令の解読結果に従う
命令読み出し指示に従いて、当該命令中のインデックス
番号idi およびベースレジスタ109の内容(BR)
をもとに算出されるメモリ番地を用いてシステムバス3
0を介して主メモリ20をアクセスし、そのメモリ番地
から始まるテーブル領域201内エントリに格納されて
いる命令を読み込むようになっている。この読み込まれ
た命令は、命令デコーダ106に渡される。
The instruction operation control unit for debugging 110, in accordance with the instruction read instruction according to the result of decoding the instruction for debugging from the instruction decoder 105, includes the index number id i in the instruction and the content (BR) of the base register 109.
System bus 3 using the memory address calculated based on
The main memory 20 is accessed via 0, and the instruction stored in the entry in the table area 201 starting from the memory address is read. The read instruction is passed to the instruction decoder 106.

【0023】次に、図1の構成の動作を説明する。今、
主メモリ20内に、図2(a)に示すようにデバッグ対
象となるプログラム202が格納されているものとす
る。もし、このプログラム202中のチェックポイント
となる場所CPi の(分岐命令などの)命令203をフ
ェッチして実行しようとする場合に、当該命令203を
含む命令列が既に命令キャッシュメモリ101に読み込
まれているならば、当該命令203は、主メモリ20か
らではなくて、命令キャッシュメモリ101から高速に
取り出され、命令バッファ105を介して命令デコーダ
106に送られる。そして、この命令203は命令デコ
ーダ106で解読され、その解読結果に従い、命令実行
部108で実行される。
Next, the operation of the configuration of FIG. 1 will be described. now,
It is assumed that a program 202 to be debugged is stored in the main memory 20 as shown in FIG. If an instruction 203 (such as a branch instruction) at the checkpoint location CP i in the program 202 is to be fetched and executed, the instruction sequence including the instruction 203 has already been read into the instruction cache memory 101. If so, the instruction 203 is fetched at high speed from the instruction cache memory 101, not from the main memory 20, and sent to the instruction decoder 106 via the instruction buffer 105. Then, the instruction 203 is decoded by the instruction decoder 106, and is executed by the instruction execution unit 108 according to the decoded result.

【0024】このようにプログラムデバッグのチェック
ポイントとなる場所CPi の命令203が既に命令キャ
ッシュメモリ101に読み込まれている状態で、当該命
令203を実行しようとした場合には、当該命令203
は命令キャッシュメモリ101から取り出され、マイク
ロプロセッサ10のチップ外、即ちシステムバス30上
には(主メモリ20に対する)命令フェッチの動作は現
れない。この場合、ロジックアナライザ等で外部からチ
ップ(とシステムバス30との接続部)を観察しても、
プログラムの実行状況は把握できない。
When the instruction 203 at the location CP i , which is the checkpoint for program debugging, is already read in the instruction cache memory 101 and the instruction 203 is executed, the instruction 203 is executed.
Are fetched from the instruction cache memory 101, and no instruction fetch operation (with respect to the main memory 20) appears outside the chip of the microprocessor 10, that is, on the system bus 30. In this case, even if the chip (and the connection portion with the system bus 30) is externally observed with a logic analyzer or the like,
The execution status of the program cannot be grasped.

【0025】そこで本実施例では、プログラム202を
デバッグしようとする場合、プログラム202中のチェ
ックポイントとすべき場所CPi の命令203を、図2
(b)に示すように、インデックス番号idi (=i)
が設定されているインデックスフィールドを持つデバッ
グ用命令204に置き換えて、デバッグ対象プログラム
212としておく。また、主メモリ20上にテーブル領
域201を確保し、当該デバッグ用命令204のインデ
ックスフィールド中のインデックス番号idi(=i)
で間接指定されるi番目のエントリエントリに、図2
(b)に示すように上記置き換えられた命令203を移
しておく。
Therefore, in the present embodiment, when the program 202 is to be debugged, the instruction 203 at the location CP i which should be a checkpoint in the program 202 is set as shown in FIG.
As shown in (b), the index number id i (= i)
Is replaced with the debug instruction 204 having an index field in which is set as the debug target program 212. Further, the table area 201 is secured in the main memory 20, and the index number id i (= i) in the index field of the debug instruction 204 is secured.
In the i-th entry that is indirectly specified by
The replaced instruction 203 is transferred as shown in FIG.

【0026】なお、図では、1つの命令だけが操作の対
象となっているが、実際には、同様の操作が任意のn個
の命令について行われる。更に、ベースレジスタ(B
R)109をデスティネーションレジスタとして指定す
るロード命令を実行することにより、当該ベースレジス
タ(BR)109に、テーブル領域201の先頭番地
(BR)を設定しておく。
Although only one instruction is the target of the operation in the figure, the same operation is actually performed for any n instructions. In addition, the base register (B
By executing a load instruction designating R) 109 as a destination register, the start address (BR) of the table area 201 is set in the base register (BR) 109.

【0027】以上のようにした後、主メモリ20内に図
2(b)に示すように格納されているデバッグ対象プロ
グラム212を実行する。今、このプログラム212の
実行状態にあり、当該プログラム212中のチェックポ
イントとなる場所CPi に(命令203に代えて)新た
に設定されたデバッグ用命令204を含む命令列が既に
命令キャッシュメモリ101に読み込まれているものと
する。
After the above processing, the debug target program 212 stored in the main memory 20 as shown in FIG. 2B is executed. Now, in the execution state of this program 212, an instruction string including the newly set debugging instruction 204 (in place of the instruction 203) is already in the instruction cache memory 101 at the check point CP i in the program 212. It is assumed to be loaded in.

【0028】この状態で、場所CPi の命令(デバッグ
用命令204)をフェッチして実行しようとする場合、
当該命令(デバッグ用命令204)は、主メモリ20か
らではなくて、命令キャッシュメモリ101から高速に
取り出され、命令バッファ105を介して命令デコーダ
106に送られる。
In this state, when the instruction at the location CP i (debugging instruction 204) is to be fetched and executed,
The instruction (debugging instruction 204) is fetched at high speed from the instruction cache memory 101, not from the main memory 20, and is sent to the instruction decoder 106 via the instruction buffer 105.

【0029】命令デコーダ106は、命令バッファ10
5を介して送られた命令のオペレーションコード(OP
コード)をもとに当該命令の指示する処理内容を解読す
る。そして命令デコーダ106は、解読の対象となって
いる命令がデバッグ用命令(ここではデバッグ用命令2
04)場合には、命令実行部108の動作を中断させ、
(デバッグ用命令204に置き換えられた真に実行すべ
き命令203を読み出すための)命令読み出し指示をデ
バッグ用命令動作制御部110に発行する。この際、命
令デコーダ106は、当該デバッグ用命令204のイン
デックスフィールドに設定されているインデックス番号
(エントリ番号)idi をデバッグ用命令動作制御部1
10に渡す。
The instruction decoder 106 includes an instruction buffer 10.
Operation code (OP
Decode the processing content designated by the instruction based on the code). Then, the instruction decoder 106 determines that the instruction to be decoded is a debug instruction (here, the debug instruction 2
In the case of 04), the operation of the instruction execution unit 108 is interrupted,
An instruction read instruction (for reading the instruction 203 to be executed, which is replaced with the debugging instruction 204) is issued to the debugging instruction operation control unit 110. At this time, the instruction decoder 106 uses the index number (entry number) id i set in the index field of the debug instruction 204 as the debug instruction operation control unit 1.
Pass to 10.

【0030】デバッグ用命令動作制御部110は、命令
デコーダ106から命令読み出し指示を受けると、同指
示と共に渡されたインデックス番号(エントリ番号)i
iと、ベースレジスタ109の内容(BR)、即ち主
メモリ20上のテーブル領域201の先頭メモリ番地
(ベースアドレス)とをもとに、次式 PA=(BR)+idi *4 ………(1) の演算を行い、インデックス番号idi (=i)で間接
指定される、主メモリ20上のテーブル領域201内の
エントリのメモリ番地(物理アドレス)PAを算出す
る。なお、上記(1)式中の“4”は命令語のバイト長
(エントリのサイズ)を示す。
When the instruction operation control unit 110 for debugging receives an instruction read instruction from the instruction decoder 106, the index number (entry number) i passed together with the instruction read instruction.
Based on d i and the contents (BR) of the base register 109, that is, the head memory address (base address) of the table area 201 on the main memory 20, the following expression PA = (BR) + id i * 4 ... The operation (1) is performed to calculate the memory address (physical address) PA of the entry in the table area 201 on the main memory 20, which is indirectly designated by the index number id i (= i). It should be noted that "4" in the above equation (1) indicates the byte length (entry size) of the instruction word.

【0031】次にデバッグ用命令動作制御部110は、
上記算出したメモリ番地(物理アドレス)PA、即ち
(BR)+idi *4をもとにバスドライバ104およ
びシステムバス30を介して(マイクロプロセッサ10
のチップ外に設けられている)主メモリ20をアクセス
し、そのメモリ番地から始まる4バイト長の命令、即ち
チェックポイントとなる場所CPi から主メモリ20上
のテーブル領域201のidi (=i)番目のエントリ
に移された命令203を、真に実行すべき命令として取
り込む。
Next, the debug instruction operation control unit 110
Based on the calculated memory address (physical address) PA, that is, (BR) + id i * 4, via the bus driver 104 and the system bus 30 (microprocessor 10
The main memory 20 (provided outside the chip) is accessed, and an instruction having a length of 4 bytes starting from the memory address, that is, a checkpoint location CP i , is stored in the main memory 20 with id i (= i The instruction 203 transferred to the) th entry is fetched as an instruction to be truly executed.

【0032】このように、プログラム202中のチェッ
クポイントとなる場所CPi の命令203をデバッグ用
命令204に置き換えて(プログラム212とし)、置
き換えられた本来実行すべき命令203を、当該デバッ
グ用命令204のインデックスフィールドに設定されて
いるインデックス番号idi で指定されるテーブル領域
201内エントリ、即ちidi (=i)番目のエントリ
に移しておくことにより、当該デバッグ用命令204が
命令キャッシュメモリから取り出されて命令デコーダ1
06で解読された場合には、このテーブル領域201内
のidi (=i)番目のエントリに移されている命令2
03を主メモリ20から読み込む動作が、デバッグ用命
令動作制御部110によって必ず行われる。
As described above, the instruction 203 at the checkpoint location CP i in the program 202 is replaced with the debugging instruction 204 (the program 212), and the replaced instruction 203 to be executed is replaced with the debugging instruction. By moving to the entry in the table area 201 specified by the index number id i set in the index field of 204, that is, the id i (= i) th entry, the debug instruction 204 is transferred from the instruction cache memory. Instruction decoder 1 taken out
When decoded in 06, the instruction 2 transferred to the id i (= i) th entry in this table area 201
The operation for reading 03 from the main memory 20 is always performed by the debug instruction operation control unit 110.

【0033】したがって、そのメモリアクセスの動作
(アクセスされるメモリ番地)をチップ外からロジック
アナライザ等で観察することによりプログラム実行の様
子が簡単に把握できる。
Therefore, by observing the memory access operation (the memory address to be accessed) from outside the chip with a logic analyzer or the like, the state of program execution can be easily grasped.

【0034】さて、デバッグ用命令動作制御部110
は、命令デコーダ106からのデバッグ用命令204に
従う命令読み出し指示に応じて、当該デバッグ用命令2
04に置き換えられた命令203を真に実行すべき命令
として取り込むと、この命令203を命令デコーダ10
6に送る。
Now, the debug instruction operation control unit 110
Is a debug instruction 2 in response to an instruction read instruction from the instruction decoder 106 according to the debug instruction 204.
When the instruction 203 replaced by 04 is fetched as an instruction to be truly executed, this instruction 203 is read by the instruction decoder 10
Send to 6.

【0035】すると命令デコーダ106は、このデバッ
グ用命令動作制御部110から送られた命令203を、
命令キャッシュメモリ101から読み出された場合と同
様に、即ち通常の手順で命令が読み出された場合と同様
に解読し、当該命令203の指定する処理を実行するの
に必要な各種制御信号を命令実行部108等に出力す
る。もし、当該命令203が分岐命令であるならば、命
令デコーダ106は、分岐アドレスの計算に必要なオペ
ランドをレジスタファイル107から読み出して、命令
実行部108に出力する。
Then, the instruction decoder 106 outputs the instruction 203 sent from the debugging instruction operation control unit 110,
Various control signals necessary for decoding and executing the processing specified by the instruction 203 are decoded in the same manner as when they are read from the instruction cache memory 101, that is, in the same manner as when an instruction is read in the normal procedure. It is output to the instruction execution unit 108 and the like. If the instruction 203 is a branch instruction, the instruction decoder 106 reads the operand required for calculating the branch address from the register file 107 and outputs it to the instruction execution unit 108.

【0036】命令実行部108は、命令デコーダ106
からの制御信号に従い、命令203の指定する処理(命
令203が分岐命令であるならば、分岐先アドレスに従
う分岐先の命令への分岐処理)を実行する。
The instruction execution unit 108 includes an instruction decoder 106.
In accordance with the control signal from, the process specified by the instruction 203 (if the instruction 203 is a branch instruction, the branch processing to the branch destination instruction according to the branch destination address) is executed.

【0037】なお、前記実施例では、デバッグ用命令2
04に置き換えられた命令の移動先を当該デバッグ用命
令204により間接指定するものとして説明したが、直
接指定するようにしても構わない。但し、直接指定方式
の場合には、テーブル領域201の位置が固定されるた
め、自由度に乏しくなる。
In the above embodiment, the debug instruction 2
Although the destination of the instruction replaced with 04 is indirectly specified by the debug instruction 204, it may be directly specified. However, in the case of the direct designation method, since the position of the table area 201 is fixed, the degree of freedom becomes poor.

【0038】また、前記実施例では、マイクロプロセッ
サ10に内蔵のキャッシュメモリが、命令を保持する命
令キャッシュメモリ101とデータを保持するデータキ
ャッシュメモリ102の2種である場合について説明し
たが、命令およびデータを保持するキャッシュメモリで
あっても構わない。
Further, in the above-mentioned embodiment, the case where the cache memory built in the microprocessor 10 is the two kinds of the instruction cache memory 101 for holding the instruction and the data cache memory 102 for holding the data is explained. It may be a cache memory that holds data.

【0039】[0039]

【発明の効果】以上詳述したようにこの発明によれば、
マイクロプロセッサの命令デコード手段に、当該マイク
ロプロセッサに内蔵のキャッシュメモリから取り出され
た実行すべき命令が外部の主メモリ上のメモリ番地を直
接または間接に指定するためのアドレス情報を持つデバ
ッグ用命令である場合には、そのアドレス情報で指定さ
れる主メモリ上のメモリ番地の命令の読み出しを指示す
る機能を付加する他、この命令デコード手段からの命令
読出し指示に応じて、上記アドレス情報で指定される主
メモリ上のメモリ番地の命令を真に実行すべき命令とし
て読み込んで、この命令デコード手段に与えて解読させ
るデバッグ用命令動作制御手段を上記マイクロプロセッ
サに設けたことにより、キャッシュメモリからデバッグ
用命令が読み出されて解読された場合、必ず当該デバッ
グ用命令で指定される命令を外部の主メモリから読み込
む動作が行われるため、その動作をチップ外からロジッ
クアナライザ等で観察することによりプログラム実行の
様子が簡単に把握できる。
As described above in detail, according to the present invention,
The instruction decoding means of the microprocessor is a debugging instruction that has address information for directly or indirectly designating a memory address on the external main memory so that the instruction to be executed fetched from the cache memory built in the microprocessor. In some cases, in addition to the function of instructing the reading of the instruction at the memory address on the main memory designated by the address information, it is designated by the address information according to the instruction reading instruction from the instruction decoding means. The instruction address control means for debugging for reading the instruction at the memory address on the main memory as the instruction to be truly executed and giving it to the instruction decoding means for decoding is provided from the cache memory for debugging. If the instruction is read and decoded, be sure to specify it with the relevant debugging instruction. Since the operation of loading that instruction from the external main memory is carried out, how the program execution by observing its operation from outside the chip logic analyzer or the like can be easily grasped.

【0040】また、プログラム中のチェックポイントと
すべき場所の命令をデバッグ用命令で置き換え、その置
き換えられた命令を当該デバッグ用命令で直接または間
接に指定される主メモリのメモリ番地に移しておくこと
により、上記のチェックポイントでは必ず主メモリを参
照する動作が発生して、デバッグ用命令に置き換えられ
た本来実行すべき命令がマイクロプロセッサ内に読み込
まれて解読・実行されるため、プログラムの実行トレー
スを行うことができる。
Further, the instruction at the place to be the checkpoint in the program is replaced with the debugging instruction, and the replaced instruction is moved to the memory address of the main memory directly or indirectly designated by the debugging instruction. As a result, the above checkpoint always causes an operation that refers to the main memory, and the instruction that should have been executed, which has been replaced by the instruction for debugging, is read into the microprocessor and decoded / executed. Trace can be done.

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

【図1】この発明の一実施例に係るマイクロプロセッサ
を備えた情報処理装置の構成を、マイクロプロセッサの
内部構成を中心に示すブロック図。
FIG. 1 is a block diagram showing the configuration of an information processing apparatus including a microprocessor according to an embodiment of the present invention, focusing on the internal configuration of the microprocessor.

【図2】同実施例におけるデバッグ用命令の利用方法を
説明するための図。
FIG. 2 is a diagram for explaining a method of using a debugging instruction in the embodiment.

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

10…マイクロプロセッサ、20…主メモリ、30…シ
ステムバス、101…命令キャッシュメモリ、103…
バスインタフェース、106…命令デコーダ、108…
命令実行部、109…ベースレジスタ(BR)、110
…デバッグ用命令動作制御部、201…テーブル領域、
202,212…プログラム、203…命令(チェック
ポイントとすべき場所の命令)、204…デバッグ用命
令。
10 ... Microprocessor, 20 ... Main memory, 30 ... System bus, 101 ... Instruction cache memory, 103 ...
Bus interface 106 ... Instruction decoder 108 ...
Instruction execution unit, 109 ... Base register (BR), 110
... debug instruction operation control unit, 201 ... table area,
202, 212 ... Program, 203 ... Instruction (instruction at place to be checkpoint), 204 ... Debugging instruction.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】チップ外に設けられた主メモリの格納情報
の一部のコピーが保持されるキャッシュメモリを前記チ
ップ上に内蔵するマイクロプロセッサにおいて、 前記キャッシュメモリから取り出された実行すべき命令
を解読する命令デコード手段であって、当該命令が前記
主メモリ上の真に実行すべき命令のメモリ番地を直接ま
たは間接に指定するためのアドレス情報を持つデバッグ
用命令である場合には、当該アドレス情報で指定される
前記主メモリ上のメモリ番地の命令の読み出しを指示す
る命令デコード手段と、 この命令デコード手段からの前記命令読出し指示に応じ
て、前記アドレス情報で直接または間接に指定される前
記主メモリ上のメモリ番地の命令を真に実行すべき命令
として読み込んで、前記命令デコード手段に与えるデバ
ッグ用命令動作制御手段とを具備し、前記デバッグ用命
令を実行することにより、当該命令で指定される前記主
メモリのメモリ番地から真に実行すべき命令が前記マイ
クロプロセッサ内に読み込まれて、前記命令デコード手
段により解読されるようにしたことを特徴とするマイク
ロプロセッサ。
1. A microprocessor having, on a chip, a cache memory that holds a copy of part of information stored in a main memory provided outside the chip, and executes an instruction to be executed fetched from the cache memory. The instruction decoding means for decoding, if the instruction is a debug instruction having address information for directly or indirectly designating the memory address of the instruction to be truly executed in the main memory, the address Instruction decoding means for instructing reading of an instruction at a memory address on the main memory specified by information; and the instruction information directly or indirectly specified by the address information according to the instruction reading instruction from the instruction decoding means. The instruction at the memory address on the main memory is read as the instruction to be truly executed, and is given to the instruction decoding means. By executing the debug instruction, the instruction to be truly executed is read from the memory address of the main memory specified by the instruction into the microprocessor. A microprocessor characterized by being decoded by the instruction decoding means.
【請求項2】主メモリに格納されるプログラム中のチェ
ックポイントとすべき場所の命令を、前記主メモリ上の
メモリ番地を直接または間接に指定するためのアドレス
情報を持つデバッグ用命令に置き換えると共に、置き換
えられた命令を当該デバッグ用命令の前記アドレス情報
で指定されるメモリ番地に移しておき、 前記主メモリを外部メモリとして用い、当該メモリの格
納情報の一部のコピーが保持されるキャッシュメモリを
チップ上に内蔵するマイクロプロセッサにおいて、前記
キャッシュメモリから取り出された実行すべき命令が前
記デバッグ用命令の場合に、当該デバッグ用命令中の前
記アドレス情報で指定される前記主メモリ上のメモリ番
地の命令を真に実行すべき命令として読み込んで解読・
実行することにより、 前記チップ外からプログラム実行状況が観察できるよう
にしたことを特徴とするデバッグ方法。
2. An instruction at a place to be a checkpoint in a program stored in a main memory is replaced with a debugging instruction having address information for directly or indirectly designating a memory address on the main memory. A cache memory in which the replaced instruction is moved to a memory address specified by the address information of the debug instruction, the main memory is used as an external memory, and a part of the stored information in the memory is held. In a microprocessor with a built-in chip on the chip, when the instruction to be executed fetched from the cache memory is the debugging instruction, a memory address on the main memory specified by the address information in the debugging instruction. Read and decode the command as the command that should be truly executed
A debugging method characterized in that a program execution status can be observed from outside the chip by executing the program.
JP5332878A 1993-12-27 1993-12-27 Microprocessor provided with executing function of instruction for debugging and debugging method Pending JPH07191879A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5332878A JPH07191879A (en) 1993-12-27 1993-12-27 Microprocessor provided with executing function of instruction for debugging and debugging method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5332878A JPH07191879A (en) 1993-12-27 1993-12-27 Microprocessor provided with executing function of instruction for debugging and debugging method

Publications (1)

Publication Number Publication Date
JPH07191879A true JPH07191879A (en) 1995-07-28

Family

ID=18259815

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5332878A Pending JPH07191879A (en) 1993-12-27 1993-12-27 Microprocessor provided with executing function of instruction for debugging and debugging method

Country Status (1)

Country Link
JP (1) JPH07191879A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004103024A (en) * 2002-09-11 2004-04-02 Agere Systems Inc Processor system with cache-based software breakpoint

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004103024A (en) * 2002-09-11 2004-04-02 Agere Systems Inc Processor system with cache-based software breakpoint

Similar Documents

Publication Publication Date Title
US5247639A (en) Microprocessor having cache bypass signal terminal
US5944841A (en) Microprocessor with built-in instruction tracing capability
US4937738A (en) Data processing system which selectively bypasses a cache memory in fetching information based upon bit information of an instruction
JPH0283735A (en) Instruction prefetching device
KR100309615B1 (en) High Speed Programmable Logic Controllers (PLC)
JP3439033B2 (en) Interrupt control device and processor
JPS6125169B2 (en)
JPH05204709A (en) Processor
JPH07191879A (en) Microprocessor provided with executing function of instruction for debugging and debugging method
JP2581565B2 (en) Data processing device that executes guarded instructions
JPH0259829A (en) Microcomputer
JPH0752402B2 (en) Data processing device
US6289439B1 (en) Method, device and microprocessor for performing an XOR clear without executing an XOR instruction
JP2856703B2 (en) Processor
JPH08328851A (en) Load and store instruction processing unit and method therefor
JP3428253B2 (en) Sequencer
JP2924575B2 (en) Microprocessor
JP2902847B2 (en) Self-modifying code execution method
JPS6286442A (en) Data processor
JP2002007154A (en) Information processor
JPH02110636A (en) Debugging device for tag architecture machine and its compiler
JPH0323938B2 (en)
JPH01240941A (en) Information processor
JPH03168845A (en) Instruction execution control system
JPS62264332A (en) Preread control circuit for instruction