[go: up one dir, main page]

JP2000267885A - Computer-readable recording medium recording breakpoint setting method and breakpoint setting program - Google Patents

Computer-readable recording medium recording breakpoint setting method and breakpoint setting program

Info

Publication number
JP2000267885A
JP2000267885A JP11070472A JP7047299A JP2000267885A JP 2000267885 A JP2000267885 A JP 2000267885A JP 11070472 A JP11070472 A JP 11070472A JP 7047299 A JP7047299 A JP 7047299A JP 2000267885 A JP2000267885 A JP 2000267885A
Authority
JP
Japan
Prior art keywords
address
breakpoint
rom
ram
instruction code
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
JP11070472A
Other languages
Japanese (ja)
Inventor
Hideyuki Kawakita
英幸 川北
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 JP11070472A priority Critical patent/JP2000267885A/en
Publication of JP2000267885A publication Critical patent/JP2000267885A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

(57)【要約】 【課題】 専用ハードウェアを追加することなく、RO
Mを書き換えずに、ROMに格納されたプログラムに対
してブレークポイントを設定する。 【解決手段】 ブレークポイントを設定したいアドレス
を含むブロックを、ROM30からモニタRAM36を
経てRAM32へコピーし、RAM32上でブレーク実
行命令を書き込み、ブレーク命令を実行して、これをキ
ャッシュ20に取り込んだ後に、ROM30等を元の状
態に戻す。
(57) [Summary] [Problem] RO can be performed without adding dedicated hardware
A breakpoint is set for the program stored in the ROM without rewriting M. SOLUTION: A block including an address at which a breakpoint is to be set is copied from a ROM 30 to a RAM 32 via a monitor RAM 36, a break execution instruction is written on the RAM 32, a break instruction is executed, and the break instruction is taken into the cache 20. , The ROM 30 and the like are returned to the original state.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、ROMに格納され
たプログラムを書き換えることなく、ブレークポイント
を設定する方法及びそのようなブレークポイント設定用
プログラムを記録したコンピュータ読み取り可能な記録
媒体に関する。
The present invention relates to a method for setting a breakpoint without rewriting a program stored in a ROM and a computer-readable recording medium recording such a breakpoint setting program.

【0002】[0002]

【従来の技術】従来、ブレークポイントの設定は、書き
換え可能なメモリ、すなわちRAM(randam access mem
ory)領域の命令コードに対してしか実現できず、通常
は書き換えのできないメモリ、すなわちROM(read o
nly memory)に対しては実現できなかった。
2. Description of the Related Art Conventionally, setting of a breakpoint is performed by using a rewritable memory, that is, a RAM (random access memory).
ory) memory, which can be realized only for the instruction code in the area and cannot be normally rewritten, that is, ROM
nly memory).

【0003】また最近、ブロック単位で電気的に書き換
え可能なメモリ、すなわちフラッシュROMを搭載する
システムが増えており、搭載されたフラッシュROMへ
ユーザプログラムを直接書き込んで動作させる場合も少
なくない。かかる場合は、フラッシュROMの内容を書
き換えることによって所望アドレスにブレークポイント
を実現することが可能である。
Recently, systems equipped with electrically rewritable memories, ie, flash ROMs, in units of blocks have been increasing, and there are many cases where a user program is directly written and operated on the mounted flash ROM. In such a case, a breakpoint can be realized at a desired address by rewriting the contents of the flash ROM.

【0004】また、ブレークポイントを設定したい領域
全体をメモリコントローラの設定によりRAM領域に割
り当て、その領域にプログラムの内容をコピーし、RA
Mと同等に使用する方法も用いられていた。
Further, the entire area where a breakpoint is to be set is allocated to a RAM area by setting of a memory controller, and the contents of a program are copied to that area,
A method equivalent to that of M was also used.

【0005】[0005]

【発明が解決しようとする課題】しかしながら、フラッ
シュROMの内容を書き換えてブレークポイントを実現
するとなると設定に時間を要する。また、フラッシュR
OMは書込み回数が有限である。このため、フラッシュ
ROMに格納されたデバッグ対象プログラム等の内容を
書き換えることによって、かかるプログラムに対してブ
レークポイントを設定して、デバッグを行うことは実質
的には不可能であった。
However, if a breakpoint is realized by rewriting the contents of the flash ROM, it takes time to set. Also, Flash R
OM has a finite number of times of writing. For this reason, it has been practically impossible to set a breakpoint on such a program by rewriting the contents of the debug target program and the like stored in the flash ROM and perform debugging.

【0006】また、ブレークポイントを設定したい領域
全体をメモリコントローラの設定によりRAM領域に割
り当て、その領域にプログラムの内容をコピーし、RA
Mと同等に使用する方法だと、複数のブレークポイント
を設定する際に、RAM領域の大きさに制限される、R
AM及びメモリコントローラがブレークポイント実現の
ために専有されるという不具合が生じていた。
In addition, the entire area in which a breakpoint is to be set is allocated to a RAM area by setting of a memory controller, and the contents of a program are copied to that area.
When using a method similar to M, when setting a plurality of breakpoints, the size of the RAM area is limited.
There has been a problem that the AM and the memory controller are exclusively used to realize a breakpoint.

【0007】そこで、本発明は、上記事情に鑑みて成さ
れたものであり、その目的は、ROM領域のプログラム
に対してソフトウェアブレークを可能にするブレークポ
イント設定方法及びそのようなブレークポイント設定用
プログラムを記録したコンピュータ読み取り可能な記録
媒体を提供することにある。
Accordingly, the present invention has been made in view of the above circumstances, and has as its object to provide a breakpoint setting method for enabling a software break in a program in a ROM area, and a method for setting such a breakpoint. An object of the present invention is to provide a computer-readable recording medium on which a program is recorded.

【0008】[0008]

【課題を解決するための手段】上記目的を達成するため
に、本発明のブレークポイント設定方法は、(1)プロ
グラム中のブレークポイントを設定したいアドレスを含
むブロックのROM領域のアドレスをRAM領域に割り
当る、アドレス割当て変更ステップと、(2)前記RA
M領域に、前記ROM領域に格納されている前記プログ
ラムの前記ブロックを書き込む、RAM書き込みステッ
プと、(3)前記RAM領域に書き込まれた前記プログ
ラムの前記ブロック中の所望アドレスの命令コードを、
ブレークポイント設定用命令コードに書き換える、命令
コード書き換えステップと、(4)前記ブレークポイン
ト設定用命令コードを実行することによって、該命令コ
ードをキャッシュメモリに書き込む、キャッシュメモリ
書き込みステップと、(5)前記ROM領域と前記RA
M領域とのアドレスの割り当て変更を元の状態に戻す、
アドレス割当て変更解除ステップと、を有することを特
徴とする。
In order to achieve the above object, a method for setting a breakpoint according to the present invention comprises the steps of: (1) assigning an address of a ROM area of a block including an address at which a breakpoint is to be set in a program to a RAM area; Assigning, address assignment changing step, (2) the RA
Writing the block of the program stored in the ROM area to the M area; and writing the block of the program stored in the ROM area to the RAM area;
An instruction code rewriting step of rewriting the instruction code for setting a breakpoint; (4) a step of writing the instruction code in a cache memory by executing the instruction code for setting a breakpoint; ROM area and RA
Return the change of the address assignment with the M area to the original state,
Address assignment change release step.

【0009】ROMに格納されているプログラムの一部
をRAMに書き移し、その一部中の所望アドレスの命令
コードをブレークポイント設定用命令コード(以下、
「ブレークコード」とする。)で書き換え、このブレー
クコードを実行し、キャッシュメモリに書き込む。通常
ならば、キャッシュメモリに格納されている命令コード
は、キャッシュメモリのインデックス、タグ等により特
定されるアドレスに対応するROM上のアドレスに格納
されている命令コードと同一である。しかし、本発明に
おいては、キャッシュメモリに格納されている命令コー
ドと、インデックス、タグ等により特定されるアドレス
に格納されているROM上の命令コードとは異なる。す
なわち、キャッシュメモリにはブレークコードが格納さ
れているが、対応するROM上のアドレスにはデバッグ
対象プログラムに当初から書かれている命令コードが格
納されている。
A part of the program stored in the ROM is transferred to the RAM, and an instruction code at a desired address in the part is replaced with an instruction code for setting a breakpoint (hereinafter referred to as an instruction code).
"Break code". ), Execute this break code, and write it to the cache memory. Normally, the instruction code stored in the cache memory is the same as the instruction code stored in the address on the ROM corresponding to the address specified by the index, tag, or the like of the cache memory. However, in the present invention, the instruction code stored in the cache memory is different from the instruction code on the ROM stored at an address specified by an index, a tag, or the like. That is, a break code is stored in the cache memory, but an instruction code originally written in the debug target program is stored in the corresponding address on the ROM.

【0010】このように、ROMの内容を書き換えるこ
となく、ROM領域の所望アドレスにブレークポイント
を設定することが可能となる。
In this way, it is possible to set a breakpoint at a desired address in the ROM area without rewriting the contents of the ROM.

【0011】また、本発明のブレークポイント設定方法
においては、(1)前記RAM書き込みステップにおい
て、前記RAM領域への書き込み前に、該RAM領域の
データを待避させ、(2)前記アドレス割当て変更解除
ステップにおいて、前記変更解除後に前記待避データを
前記RAM領域の元のアドレスに戻す、ことが好まし
い。
Further, in the break point setting method of the present invention, (1) in the RAM writing step, the data in the RAM area is saved before writing to the RAM area, and (2) the address allocation change release. In the step, it is preferable that the save data is returned to an original address of the RAM area after the change is released.

【0012】RAM領域のデータを一旦待避させ、割当
て変更解除後に待避させていたデータを元のアドレスに
戻すことにより、このRAM領域をターゲットプログラ
ム等が使用可能となる。すなわち、ブレークポイント設
定用にRAM領域の一部を一時的に使用するが、ブレー
クポイント設定完了後は、ターゲットプログラム等実行
中(ブレーク前)であっても、かかるRAM領域はブレ
ークコード実行のためには必要とされない。つまり、ブ
レークポイント設定のためにも、ブレーク実行のために
も専用のRAMは必要ない。
By temporarily saving the data in the RAM area and returning the saved data to the original address after the assignment change is released, the RAM area can be used by a target program or the like. That is, a part of the RAM area is temporarily used for setting a breakpoint. After the breakpoint is set, even if the target program or the like is being executed (before the break), the RAM area is used for executing the break code. Is not required. That is, a dedicated RAM is not required for setting a breakpoint and for executing a break.

【0013】さらに、本発明のブレークポイント設定方
法においては、キャッシュメモリにロック機能を持た
せ、キャッシュメモリにブレークコードが格納された後
に、ブレークコードが格納されたインデックスをロック
することが好ましい。ロック機能とは、ロックされたイ
ンデックスの内容が、インデックスが同じでタグが異な
る他アドレスの命令コードによって書き換えられなくす
る機能をいう。キャッシュメモリがロックされていない
と、キャッシュメモリの内容が、インデックスは同じだ
がタグが異なる他アドレスの命令コードによって書き換
えられてしまうおそれがある。
Further, in the breakpoint setting method of the present invention, it is preferable that the cache memory is provided with a lock function, and after the breakcode is stored in the cache memory, the index in which the breakcode is stored is locked. The lock function refers to a function of preventing the contents of a locked index from being rewritten by an instruction code of another address having the same index but a different tag. If the cache memory is not locked, the contents of the cache memory may be rewritten by an instruction code of another address having the same index but a different tag.

【0014】しかし、キャッシュメモリのロック機能を
利用することにより、ブレークポイントを設定したブロ
ックがキャッシュメモリからリプレースされないように
することができる。
However, by using the lock function of the cache memory, it is possible to prevent the block in which the breakpoint is set from being replaced from the cache memory.

【0015】また、本発明の記録媒体は、前記プログラ
ム中のブレークポイントを設定したいアドレスを含むブ
ロックのROM領域のアドレスをRAM領域に割り当
る、アドレス割当て変更ステップと、前記RAM領域
に、前記ROM領域に格納されている前記プログラムの
前記ブロックを書き込む、RAM書き込みステップと、
前記RAM領域に書き込まれた前記プログラムの前記ブ
ロック中の所望アドレスの命令コードを、ブレークポイ
ント設定用命令コードに書き換える、命令コード書き換
えステップと、前記ブレークポイント設定用命令コード
を実行することによって、該命令コードをキャッシュメ
モリに書き込む、キャッシュメモリ書き込みステップ
と、前記ROM領域と前記RAM領域とのアドレスの割
り当て変更を元の状態に戻す、アドレス割当て変更解除
ステップと、を含みこれらの処理をコンピュータに実行
させることを特徴とするソフトウェアブレーク用プログ
ラムを記録するものである。
The recording medium according to the present invention further comprises: an address assignment changing step of assigning an address of a ROM area of a block including an address at which a breakpoint is desired to be set in the program to the RAM area; Writing the block of the program stored in the area, a RAM writing step;
By executing the instruction code rewriting step of rewriting an instruction code at a desired address in the block of the program written in the RAM area into a breakpoint setting instruction code, and executing the breakpoint setting instruction code, Executing an instruction code in a cache memory, a cache memory writing step, and restoring an address assignment change between the ROM area and the RAM area to an original state, and an address assignment change canceling step. A program for recording a software break is recorded.

【0016】このような記録媒体によれば、ROMを書
き換えることなくROM領域にもブレークポイントを容
易に設定できるという有用なプログラムの保存、実行、
運搬等を簡便に行うことができ、ブレークポイントの設
定をより容易なものとすることができる。
According to such a recording medium, storage and execution of a useful program that enables a breakpoint to be easily set in the ROM area without rewriting the ROM,
Transportation and the like can be performed easily, and breakpoints can be set more easily.

【0017】[0017]

【発明の実施の形態】(第1の実施形態)以下、本発明
の実施の形態を説明する。図1は、本実施形態で用いら
れるROM、RAM等の構成を示す。10はCPU(中
央演算処理装置)20は命令キャッシュ、30はRO
M、32はRAM、34はモニタROM、36はモニタ
RAM、40aおよびbはメモリコントローラ、50は
アドレスバス、52はデータバスをそれぞれ示す。
DESCRIPTION OF THE PREFERRED EMBODIMENTS (First Embodiment) An embodiment of the present invention will be described below. FIG. 1 shows a configuration of a ROM, a RAM, and the like used in the present embodiment. 10 is a CPU (Central Processing Unit) 20 is an instruction cache, 30 is RO
M and 32 are RAMs, 34 is a monitor ROM, 36 is a monitor RAM, 40a and b are memory controllers, 50 is an address bus, and 52 is a data bus.

【0018】ROM30は、デバッグの対象となるプロ
グラム(ターゲットプログラム)を格納する。RAM3
2は、ターゲットプログラムが使用する。モニターRO
M34は、デバッグ機能を実現するプログラム(モニタ
プログラム)を格納する。モニタRAM36は、原則と
してモニタプログラムが使用するが、ターゲットプログ
ラムの一部を一時的に格納する際に使用する。メモリコ
ントローラ40aは、ROM30のCS(チップセレク
ト)信号を有効にする。メモリーコントローラ40b
は、RAM32のCS信号を有効にする。
The ROM 30 stores a program to be debugged (target program). RAM3
2 is used by the target program. Monitor RO
M34 stores a program (monitor program) for realizing the debugging function. The monitor RAM 36 is used by the monitor program in principle, but is used to temporarily store a part of the target program. The memory controller 40a makes the CS (chip select) signal of the ROM 30 valid. Memory controller 40b
Makes the CS signal of the RAM 32 valid.

【0019】CPU10のアドレス幅はkビットであ
り、データ幅はwビットである。ROM30の容量は2
nワードであり、RAM32の容量は2mワードである。
命令キャッシュ20は、1ブロックが2bワードで構成
され、2iブロックを持つ。各ブロックは、幅tビット
のアドレスタグ、内容が有効であることを示すVビット
(有効ビット)、およびロックされたことを示すLビッ
ト(ロックビット)を持つ。
The address width of the CPU 10 is k bits, and the data width is w bits. The capacity of the ROM 30 is 2
n words, and the capacity of the RAM 32 is 2 m words.
The instruction cache 20 has one block composed of 2b words and 2i blocks. Each block has an address tag having a width of t bits, a V bit (valid bit) indicating that the content is valid, and an L bit (lock bit) indicating that the content is locked.

【0020】CPU10は、指定したアドレスの命令コ
ードが命令キャッシュ20に格納されていれば、その命
令コードを命令キャッシュ20からフェッチして実行す
る。また、実行を停止させたいアドレス(ブレークポイ
ント)に格納されているbkp命令を実行すると、ター
ゲットプログラムの実行を中断し、モニタプログラムの
実行を開始する。
If the instruction code at the designated address is stored in the instruction cache 20, the CPU 10 fetches the instruction code from the instruction cache 20 and executes it. When the bkp instruction stored at the address (breakpoint) where execution is to be stopped is executed, the execution of the target program is interrupted and the execution of the monitor program is started.

【0021】ROM30は、CS信号、リード信号およ
びアドレス線の下位nビットを用い、CS信号が有効で
かつリード信号が有効な時には、下位nビットで指定さ
れたアドレスのデータをデータバス52へ出力する。
The ROM 30 uses the lower n bits of the CS signal, the read signal and the address line, and outputs the data of the address specified by the lower n bits to the data bus 52 when the CS signal is valid and the read signal is valid. I do.

【0022】RAM32は、CS信号、リード信号、ラ
イト信号およびアドレス線の下位mビットを用い、CS
信号が有効でかつリード信号が有効な時には、下位mビ
ットで指定されたアドレスのデータをデータバス52へ
出力する。一方、CS信号が有効でかつライト信号が有
効な時には、下位mビットで指定されたアドレスへデー
タバス52の内容が書き込まれる。
The RAM 32 uses the lower m bits of the CS signal, the read signal, the write signal, and the address line,
When the signal is valid and the read signal is valid, the data at the address specified by the lower m bits is output to the data bus 52. On the other hand, when the CS signal is valid and the write signal is valid, the contents of the data bus 52 are written to the address specified by the lower m bits.

【0023】また、CPU10がモニタプログラムを実
行する際は、命令キャッシュ20は常に無効となるよう
にする。
When the CPU 10 executes the monitor program, the instruction cache 20 is always invalidated.

【0024】一般に、アドレスは、タグ(上位部分)と
インデックス(下位部分)に分割される。アドレスのイ
ンデックスに基づいて、対応するキャッシュ20のブロ
ックが選択される。そして、アドレスのタグとキャッシ
ュ20のタグが比較されて、キャッシュのヒットまたは
ミスが判定される。
Generally, an address is divided into a tag (upper part) and an index (lower part). Based on the index of the address, the corresponding block of the cache 20 is selected. Then, the tag of the address is compared with the tag of the cache 20 to determine a cache hit or miss.

【0025】アドレスのタグとキャッシュ20のタグが
等しく、Vビットがオンに設定されていれば、参照要求
はキャッシュヒットとなり、対応する語がCPU10に
渡される。そうでない場合は、参照要求はミスとなる。
If the tag of the address and the tag of the cache 20 are equal and the V bit is set to ON, the reference request becomes a cache hit, and the corresponding word is passed to the CPU 10. Otherwise, the reference request will be missed.

【0026】本実施形態においては、命令アドレスの一
部であるbビットから(b+i−1)ビットがインデッ
クスアドレスとなり、(k−t)ビットから(k−1)
ビットがタグアドレスとなる。
In the present embodiment, the (b + i-1) bits from the b bits which are a part of the instruction address become the index address, and the (kt) bits to the (k-1) bits.
The bit becomes the tag address.

【0027】キャッシュ20内のタグと命令アドレス内
のタグが一致しなかった場合またはVビットがオフの場
合は、キャッシュ・ミスとなり、ROM30またはRA
M32から命令コードが読み出される。読み出された命
令コードは、CPU10に渡されるとともに、キャッシ
ュ20に格納され、同時にVビットもオンとなる。
If the tag in the cache 20 does not match the tag in the instruction address or if the V bit is off, a cache miss occurs and the ROM 30 or RA
The instruction code is read from M32. The read instruction code is passed to the CPU 10 and stored in the cache 20, and at the same time, the V bit is turned on.

【0028】メモリコントローラ40a、40bは、R
OM30、RAM32のアドレス領域を指定し、入力さ
れたアドレスがROM30、RAM32のいずれの領域
に属するかを判断し、ROM30またはRAM32のC
S信号を有効にする。このアドレス領域の指定は、両メ
モリコントローラ40a、40bのレジスタへデータバ
ス52から指定アドレスを書込むことにより行われる。
The memory controllers 40a and 40b
An address area of the OM 30 or the RAM 32 is designated, and it is determined which area of the ROM 30 or the RAM 32 the input address belongs to.
Enable the S signal. The designation of the address area is performed by writing the designated address from the data bus 52 to the registers of both memory controllers 40a and 40b.

【0029】次に、図2および図3を用いて、ROM3
0からモニタRAM36、RAM32を経てキャッシュ
20へ、命令コードがコピーされていく処理手順を、タ
ーゲットプログラムの121h番地にブレークポイント
を設定する場合を例に説明する。なお、番地は全て16
進法で表記する。
Next, referring to FIG. 2 and FIG.
The procedure of copying an instruction code from 0 to the cache 20 via the monitor RAM 36 and the RAM 32 will be described by taking as an example a case where a breakpoint is set at address 121h of the target program. All addresses are 16
Notation in base.

【0030】なお、この例では、アドレスタグの幅は8
ビットとし、命令キャッシュ20は1ブロックが2
2(=4)ワードで構成され、22(=4)ブロックを持
ち、RAM32の容量は25(=32)ワード、ROM
30の容量は29(=512)ワードとする。
In this example, the width of the address tag is 8
And the instruction cache 20 has 2 blocks for one block.
It is composed of 2 (= 4) words, has 2 2 (= 4) blocks, and has a capacity of 2 5 (= 32) words, ROM
The capacity of 30 is 2 9 (= 512) words.

【0031】まず、ROM30上の120h番地から始
まるブロック(120h番地から123h番地)を、モ
ニタRAM36内の待避領域に格納する(ステップS
1)。
First, a block starting from address 120h on the ROM 30 (addresses from 120h to 123h) is stored in the save area in the monitor RAM 36 (step S).
1).

【0032】次に、120h番地から123h番地が、
RAM32の領域となるようにメモリコントローラ40
bのアドレスレジスタを設定する(ステップS2)。
Next, addresses 120h to 123h are:
The memory controller 40 is set to the area of the RAM 32.
The address register b is set (step S2).

【0033】さらに、RAM32上の120h番地から
123h番地の内容と、ROM30からモニタRAM3
6の待避領域へ格納した内容とを交換する(ステップS
3)。
Further, the contents of addresses 120h to 123h on the RAM 32 and the contents of the monitor RAM 3
6 is exchanged with the contents stored in the save area (step S
3).

【0034】この結果、ROM30の120h番地から
123h番地に格納されていた命令が、RAM32に割
り当て変更された120h番地から123h番地に移さ
れ、そもそもRAM32上にあったデータはモニタRA
M36の待避領域に待避される。つまり、120h番地
から123h番地の命令が、ROM30からモニタRA
M36を経てRAM32へ移され、これと入れ替えにも
ともとRAM32に存在したデータがモニタRAM36
へ待避される。
As a result, the instruction stored in the ROM 30 at addresses 120h to 123h is moved from the address 120h, which has been reallocated to the RAM 32, to 123h, and the data originally in the RAM 32 is stored in the monitor RA.
It is saved in the save area of M36. That is, the instruction from the address 120h to the address 123h is sent from the ROM 30 to the monitor RA.
M36 is transferred to the RAM 32 via M36.
Evacuated to

【0035】次に、RAM32上の121h番地を、”
add”から“bkp”(ブレークポイント設定用命令
コード)に書き換える(ステップS4)。
Next, the address 121h on the RAM 32 is changed to "
"add" is rewritten to "bkp" (breakpoint setting instruction code) (step S4).

【0036】次に、ターゲットプログラムを121h番
地から実行開始すると、120h番地から123h番地
の命令コードが命令キャッシュ20に取り込まれると同
時に、121h番地の“bkp”命令が実行されること
により、ターゲットプログラムの実行が中断される(ス
テップS5)。
Next, when the execution of the target program is started from the address 121h, the instruction codes from the addresses 120h to 123h are fetched into the instruction cache 20, and at the same time, the "bkp" instruction at the address 121h is executed. Is interrupted (step S5).

【0037】また、ROM30とRAM32のアドレス
の割当て変更を元に戻す。つまり、120h番地から1
23h番地がROM30となるように、メモリコントロ
ーラ40bのアドレスレジスタの設定を戻す(ステップ
S6)。モニタRAM36に待避した内容を、RAM3
2に戻す(ステップS7)。
The change of the address assignment between the ROM 30 and the RAM 32 is restored. That is, 1 from address 120h
The setting of the address register of the memory controller 40b is returned so that the address 23h becomes the ROM 30 (step S6). The contents saved in the monitor RAM 36 are stored in the RAM 3
2 (step S7).

【0038】この結果、命令キャッシュ20の121h
番地に対応する場所に”bkp”命令が格納され、RO
M30、RAM32およびモニタRAM36は、最初の
状態に戻る。命令キャッシュ20とROM30を比較す
ると、120h番地、122h番地および123h番地
の命令コードは同じだが、121h番地については、命
令キャッシュ20は”bkp”であるが、ROM30
は”add”となる。
As a result, 121h of the instruction cache 20
The “bkp” instruction is stored in the location corresponding to the address, and the RO
M30, RAM 32 and monitor RAM 36 return to the initial state. When the instruction cache 20 and the ROM 30 are compared, the instruction codes at addresses 120h, 122h, and 123h are the same, but at address 121h, the instruction cache 20 is “bkp”, but the ROM 30
Becomes "add".

【0039】次に、ターゲットプログラムを実行する
(ステップS8)。ターゲットプログラムの実行中に1
21h番地の命令の実行が要求されると、ROM30の
121h番地に格納されている”add”命令が実行さ
れるのではなく、命令キャッシュ20のインデックス”
0”のブロックに格納されている”bkp”命令が実行
される。この結果、ターゲットプログラムの実行が中断
される(ステップS9)。
Next, the target program is executed (step S8). 1 while the target program is running
When the execution of the instruction at the address 21h is requested, the "add" instruction stored at the address 121h in the ROM 30 is not executed, but the index "in the instruction cache 20".
The "bkp" instruction stored in the block of "0" is executed, and as a result, the execution of the target program is interrupted (step S9).

【0040】このような方法を用いることによって、R
OM30を書き換えることなく、ROM30の領域にブ
レークポイントを設定し、ソフトウェアブレークを行う
ことが可能となる。
By using such a method, R
It is possible to set a breakpoint in the area of the ROM 30 and perform a software break without rewriting the OM 30.

【0041】また、RAM32およびモニタRAM36
は、ブレークポイント設定のために一時的に使用され
る。しかし、ブレークポイント設定後ターゲットプログ
ラム実行中は、RAM32およびモニタRAM36は、
それぞれターゲットプログラムまたはモニタプログラム
に使用され、ソフトウェアブレークのために使用される
ことはない。つまり、ソフトウェアブレークのための専
用のRAMは必要ない。
The RAM 32 and the monitor RAM 36
Is used temporarily for setting breakpoints. However, during execution of the target program after the breakpoint is set, the RAM 32 and the monitor RAM 36
Each is used for the target program or monitor program, and is not used for software breaks. That is, there is no need for a dedicated RAM for a software break.

【0042】なお、ブレークポイントを解除するには、
命令キャッシュ20のインデックス0のVビットをオフ
とすれば良い。そうすれば、再度121h番地の命令の
実行が要求されても、インデックス0のVビットがオフ
であるため、キャッシュミスとなり、ROM30の12
1h番地から命令コード”add”が読み出され、命令
キャッシュ20から”bkp”命令が掃き出されて、”
add”が格納される。これにより、ブレークポイント
が解除される。
To release a breakpoint,
The V bit at index 0 of the instruction cache 20 may be turned off. Then, even if execution of the instruction at address 121h is requested again, a cache miss occurs because the V bit at index 0 is off, and
The instruction code “add” is read from the address 1h, the “bkp” instruction is swept out of the instruction cache 20, and “
add "is stored. Thereby, the break point is released.

【0043】(第2実施形態)次にキャッシュのロック
機能を利用する場合を説明する。命令キャッシュ20
は、ロックのステータスがセットされ、フェッチした命
令コードが属するブロックがロック可能ならば、フェッ
チしたブロックをロックするために、ロックビットをオ
ンとする。インデックスのロックビットがオンとされて
いる場合、命令フェッチの際に、ROM30からフェッ
チした命令コードは、ロックされているインデックスに
格納されない。以下、121h番地にブレークポイント
を設定し、ロックする場合について説明する。
(Second Embodiment) Next, a case where a cache lock function is used will be described. Instruction cache 20
Turns on the lock bit to lock the fetched block if the lock status is set and the block to which the fetched instruction code belongs is lockable. When the lock bit of the index is turned on, the instruction code fetched from the ROM 30 at the time of instruction fetch is not stored in the locked index. Hereinafter, a case where a breakpoint is set at address 121h and locked will be described.

【0044】まず、前述のステップ1からステップ4の
処理手順により、RAM32の121h番地にブレーク
ポイント設定命令コードをセットしたら、キャッシュ2
0のロックのステータスをセットする。
First, when the breakpoint setting instruction code is set at the address 121h of the RAM 32 according to the processing procedure of the above-described steps 1 to 4, the cache 2
Set the status of the lock to zero.

【0045】次に、121h番地から命令を実行し、1
21h番地が属するブロック(120h番地から123
h番地)がインデックス0に取り込まれたら、インデッ
クス0のロックビットをオンとする。これにより、ブレ
ークポイントが設定される。
Next, the instruction is executed from address 121h,
The block to which address 21h belongs (123 from address 120h)
When address h) is taken into index 0, the lock bit of index 0 is turned on. Thereby, a breakpoint is set.

【0046】再びターゲットプログラムを実行すると、
121h番地の命令が実行される際に、ターゲットプロ
グラムの実行がブレークされる。
When the target program is executed again,
When the instruction at address 121h is executed, the execution of the target program is broken.

【0047】このようにロック機能を使用することによ
り、ターゲットプログラム実行時に、インデックス0を
使用する他のアドレス(例えば、180h番地)の命令
コードがフェッチされても、180h番地の命令コード
はキャッシュ20に取り込まれず、インデックス0のタ
グは12が保持される。
By using the lock function in this manner, even if the instruction code at another address (for example, address 180h) using index 0 is fetched during execution of the target program, the instruction code at address 180h is stored in the cache 20. And the tag of index 0 retains 12.

【0048】もし、インデックス0がロックされていな
いと、例えば180h番地の命令コードが実行された際
に、インデックス0のタグ及びブロックが、書き換えら
れてしまう。すると、121h番地の命令が呼び出され
た際にキャッシュミスとなり、ROM30の121h番
地から”add”命令が読み出されてしまい、ターゲッ
トプログラムのブレークが実現されない。
If the index 0 is not locked, for example, when the instruction code at the address 180h is executed, the tag and the block of the index 0 are rewritten. Then, when the instruction at the address 121h is called, a cache miss occurs, and the "add" instruction is read from the address 121h in the ROM 30, so that the break of the target program cannot be realized.

【0049】しかし、ロック機能を使用すれば、キャッ
シュ20から”bkp”命令が掃き出されることはな
く、ソフトウェアブレークが確実に実現される。
However, if the lock function is used, the "bkp" instruction is not flushed from the cache 20, and a software break is reliably realized.

【0050】なお、”bkp”命令がインデックス0に
ロックされたら、ロックのステータスをクリアし、以下
のターゲットプログラムの実行ではロックされないよう
にすることが好ましい。つまり、インデックス0はロッ
クされたまま、インデックス1から3はロックされない
ようにする。インデックス1から3までもロックしてし
まうと、キャッシュ20が有効に利用されず、処理速度
が低下してしまうためである。また、ブレークポイント
を解除するためには、インデックス0のVビットとLビ
ットをクリアすれば良い。
When the "bkp" instruction is locked at index 0, it is preferable to clear the lock status so that it will not be locked in the execution of the following target program. That is, the indexes 0 to 3 are not locked while the index 0 is locked. This is because if the indexes 1 to 3 are locked, the cache 20 is not effectively used and the processing speed is reduced. To release the break point, the V bit and the L bit at index 0 may be cleared.

【0051】そして、このようなステップを有するソフ
トウェアは、例えば図4に示すような、フロッピーディ
スク83やカセットテープ86の磁気記録媒体やCD−
ROM84等の光ディスクの他、ROM85等のメモリ
装置などのコンピュータ読みとり可能な記録媒体に記録
することができる。この場合には、このソフトウェアを
記録した記録媒体を、コンピュータ本体80のフロッピ
ーディスクドライブ81、CD−ROMドライブ82等
のデバイスに挿入することによって、プログラムをイン
ストールしたり又はプログラムのバックアップ等を行う
ことができる。
The software having such steps is, for example, a magnetic recording medium such as a floppy disk 83 or a cassette tape 86 or a CD-ROM as shown in FIG.
In addition to an optical disk such as the ROM 84, the information can be recorded on a computer-readable recording medium such as a memory device such as the ROM 85. In this case, the program is installed or the program is backed up by inserting the recording medium storing the software into a device such as a floppy disk drive 81 or a CD-ROM drive 82 of the computer main body 80. Can be.

【0052】このようなプログラムを記録した記録媒体
によれば、ROMを書き換えることなくROM領域にも
ブレークポイントを容易に設定できるという有用なプロ
グラムの保存、実行、運搬等を簡便に行うことができ、
ブレークポイントの設定をより簡便且つ迅速なものとす
ることができる。
According to the recording medium on which such a program is recorded, it is possible to easily store, execute, and transport a useful program that can easily set a breakpoint in the ROM area without rewriting the ROM. ,
Breakpoint setting can be made simpler and faster.

【0053】[0053]

【発明の効果】以上説明したように、本発明のソフトウ
ェアブレーク方法及びソフトウェアブレーク用プログラ
ムを記録したコンピュータ読み取り可能な記録媒体によ
れば、ROMを書き換えることなく、ROMに格納され
たプログラムに対してブレークポイントを設定すること
ができる。また、ブレークポイント実現のために専用の
RAM等のハードウェアを用意することなく、ソフトウ
ェアブレークを行うことができる。また、キャッシュの
ロック機能を利用することにより、同一のインデックス
を使用する他のアドレスの命令によってブレークコード
が掃き出されることを防止できるため、確実にソフトウ
ェアブレークすることが可能となる。また、キャッシュ
メモリはほぼ全アドレス空間に設定可能であり、RAM
領域の制限を受けることなく複数のブレークポイントを
設定することができる。また、RAM及びメモリコント
ローラをターゲットプログラムなどで使用することがで
きる。さらに、かかる方法を実現するためのプログラム
の保存、実行、運搬等が簡易、迅速になる。
As described above, according to the software break method and the computer readable recording medium storing the software break program of the present invention, the program stored in the ROM can be executed without rewriting the ROM. You can set breakpoints. Also, a software break can be performed without preparing hardware such as a dedicated RAM for realizing a breakpoint. In addition, by using the cache lock function, it is possible to prevent a break code from being swept out by an instruction at another address using the same index, so that a software break can be reliably performed. Also, the cache memory can be set in almost all address spaces,
Multiple breakpoints can be set without being restricted by the area. Further, the RAM and the memory controller can be used in a target program or the like. Further, storage, execution, transportation, and the like of a program for realizing such a method are simple and quick.

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

【図1】本発明の実施形態において用いられるROM、
RAM等の構成を示す図。
FIG. 1 shows a ROM used in an embodiment of the present invention;
FIG. 2 is a diagram illustrating a configuration of a RAM and the like.

【図2】本発明の実施形態において用いられるROM、
RAM等のアドレスの割り当て状態を説明する図。
FIG. 2 shows a ROM used in an embodiment of the present invention;
FIG. 4 is a diagram for explaining an allocation state of addresses such as a RAM.

【図3】本発明の実施形態において用いられるブレーク
方法の処理手順を示すフローチャート。
FIG. 3 is a flowchart showing a processing procedure of a break method used in the embodiment of the present invention.

【図4】本発明の実施形態において用いられるソフトウ
ェアブレーク用プログラムを記録したコンピュータ読み
取り可能な記録媒体を示す説明図。
FIG. 4 is an explanatory diagram showing a computer-readable recording medium on which a software break program used in the embodiment of the present invention is recorded.

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

10…CPU、20…命令キャッシュ、30…ROM、
32…RAM、34…モニタROM、36…モニタRA
M、40a、b…メモリコントローラ
10 CPU, 20 instruction cache, 30 ROM
32 RAM, 34 monitor ROM, 36 monitor RA
M, 40a, b ... memory controller

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 ROMを書き換えることなく、ROMに
格納されているプログラムにブレークポイントを設定す
る方法であって、 前記プログラム中のブレークポイントを設定したいアド
レスを含むブロックのROM領域のアドレスをRAM領
域に割り当る、アドレス割当て変更ステップと、 前記RAM領域に、前記ROM領域に格納されている前
記プログラムの前記ブロックを書き込む、RAM書き込
みステップと、 前記RAM領域に書き込まれた前記プログラムの前記ブ
ロック中の所望アドレスの命令コードを、ブレークポイ
ント設定用命令コードに書き換える、命令コード書き換
えステップと、 前記ブレークポイント設定用命令コードを実行すること
によって、該命令コードをキャッシュメモリに書き込
む、キャッシュメモリ書き込みステップと、 前記ROM領域と前記RAM領域とのアドレスの割り当
て変更を元の状態に戻す、アドレス割当て変更解除ステ
ップと、 を有することを特徴とするブレークポイント設定方法。
1. A method for setting a breakpoint in a program stored in a ROM without rewriting the ROM, wherein an address of a ROM area of a block including an address at which the breakpoint is to be set in the program is changed to a RAM area. An address allocation changing step; writing the block of the program stored in the ROM area to the RAM area; writing a RAM; and writing the block of the program written in the RAM area to the RAM area. An instruction code rewriting step of rewriting an instruction code at a desired address into a breakpoint setting instruction code; and writing the instruction code into a cache memory by executing the breakpoint setting instruction code. Step and is returned to the original state allocation change of the address of the ROM region and the RAM region, the breakpoint setting method characterized by having the address allocation change release step.
【請求項2】 前記RAM書き込みステップにおいて、
前記RAM領域への書き込み前に、該RAM領域のデー
タを待避させ、 前記アドレス割当て変更解除ステップ後に前記待避デー
タを前記RAM領域の元のアドレスに戻す、 ことを特徴とする請求項1に記載のブレークポイント設
定方法。
2. In the RAM writing step,
2. The method according to claim 1, wherein data in the RAM area is saved before writing to the RAM area, and the saved data is returned to an original address in the RAM area after the address assignment change release step. 3. How to set breakpoints.
【請求項3】 前記キャッシュメモリがロック機能を有
し、前記キャッシュメモリ書き込みステップにおいて、
前記ブレークポイント設定用命令コードが格納された後
に、該ブレークポイント設定用命令コードが格納された
インデックスをロックすることを特徴とする請求項1又
は2に記載のブレークポイント設定方法。
3. The cache memory has a lock function, and in the cache memory writing step,
The breakpoint setting method according to claim 1, wherein after the breakpoint setting instruction code is stored, an index storing the breakpoint setting instruction code is locked.
【請求項4】 ROMに格納されているプログラム中の
ブレークポイントを設定したいアドレスを含むブロック
のROM領域のアドレスをRAM領域に割り当る、アド
レス割当て変更ステップと、 前記RAM領域に、前記ROM領域に格納されている前
記プログラムの前記ブロックを書き込む、RAM書き込
みステップと、 前記RAM領域に書き込まれた前記プログラムの前記ブ
ロック中の所望アドレスの命令コードを、ブレークポイ
ント設定用命令コードに書き換える、命令コード書き換
えステップと、 前記ブレークポイント設定用命令コードを実行すること
によって、該命令コードをキャッシュメモリに書き込
む、キャッシュメモリ書き込みステップと、 前記ROM領域と前記RAM領域とのアドレスの割り当
て変更を元の状態に戻す、アドレス割当て変更解除ステ
ップと、を含みこれらの処理をコンピュータに実行させ
ることを特徴とするブレークポイント設定用プログラム
を記録したコンピュータ読み取り可能な記録媒体。
4. An address assignment changing step of assigning an address of a ROM area of a block including an address at which a break point in a program stored in the ROM is desired to be set to the RAM area; RAM writing step of writing the stored block of the program, and rewriting an instruction code of a desired address in the block of the program written in the RAM area into an instruction code for setting a breakpoint; Writing the instruction code to a cache memory by executing the instruction code for setting a breakpoint; and writing the instruction code to a cache memory; and restoring the change of the address assignment between the ROM area and the RAM area to the original state. Computer readable recording medium storing a breakpoint setting program, characterized in that to execute the address assignment change release step, these processes include the computer.
JP11070472A 1999-03-16 1999-03-16 Computer-readable recording medium recording breakpoint setting method and breakpoint setting program Pending JP2000267885A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11070472A JP2000267885A (en) 1999-03-16 1999-03-16 Computer-readable recording medium recording breakpoint setting method and breakpoint setting program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11070472A JP2000267885A (en) 1999-03-16 1999-03-16 Computer-readable recording medium recording breakpoint setting method and breakpoint setting program

Publications (1)

Publication Number Publication Date
JP2000267885A true JP2000267885A (en) 2000-09-29

Family

ID=13432514

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11070472A Pending JP2000267885A (en) 1999-03-16 1999-03-16 Computer-readable recording medium recording breakpoint setting method and breakpoint setting program

Country Status (1)

Country Link
JP (1) JP2000267885A (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
US6205521B1 (en) Inclusion map for accelerated cache flush
JP3587591B2 (en) Method of controlling cache miss and computer system thereof
US6345351B1 (en) Maintenance of speculative state of parallel executed jobs in an information processing system
JPS5876957A (en) Memory hierarchy control
JPS5876956A (en) Peripheral system with buffer memory
JPH10207768A (en) Method and device for accessing flash memory during operation of engine
JP3236287B2 (en) Multiprocessor system
US5471602A (en) System and method of scoreboarding individual cache line segments
JP5286796B2 (en) Memory control device
US5737568A (en) Method and apparatus to control cache memory in multiprocessor system utilizing a shared memory
JP2021515308A (en) Devices and methods for accessing metadata when debugging devices
JPH04237349A (en) Cache memory system and cache memory controller
US7191319B1 (en) System and method for preloading cache memory in response to an occurrence of a context switch
JPH06139149A (en) Multiple virtual space controller
JP2005512192A (en) How to synchronize cache memory with main memory
US7373458B2 (en) Cache memory system with multiple ports cache memories capable of receiving tagged and untagged requests
JP2000267885A (en) Computer-readable recording medium recording breakpoint setting method and breakpoint setting program
JP3959870B2 (en) Disk content failure recovery method and computer apparatus
JP4423849B2 (en) Data protection system, data protection program, and data protection method
JP2004206369A (en) Access method and access program to common resource
WO1993003436A1 (en) Method and apparatus for reducing lock period of shared buffer
JP2000029690A (en) Method and device for data processing
JPH05257807A (en) Cache memory controller
JPH06119238A (en) Main memory control method and apparatus
JPS6161143B2 (en)