JP3097602B2 - Data processing device - Google Patents

Data processing device

Info

Publication number
JP3097602B2
JP3097602B2 JP09150802A JP15080297A JP3097602B2 JP 3097602 B2 JP3097602 B2 JP 3097602B2 JP 09150802 A JP09150802 A JP 09150802A JP 15080297 A JP15080297 A JP 15080297A JP 3097602 B2 JP3097602 B2 JP 3097602B2
Authority
JP
Japan
Prior art keywords
instruction
program
unit
instruction fetch
fetch
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.)
Expired - Fee Related
Application number
JP09150802A
Other languages
Japanese (ja)
Other versions
JPH10340209A (en
Inventor
光郎 大内
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP09150802A priority Critical patent/JP3097602B2/en
Publication of JPH10340209A publication Critical patent/JPH10340209A/en
Application granted granted Critical
Publication of JP3097602B2 publication Critical patent/JP3097602B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Advance Control (AREA)
  • Debugging And Monitoring (AREA)

Description

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

【0001】[0001]

【発明の属する技術分野】本発明はデータ処理装置に関
し、特にパイプライン制御機能を備え、ソフトウェアの
デバグをするための専用機能を付加したデータ処埋装置
に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data processing apparatus, and more particularly to a data processing apparatus having a pipeline control function and having a dedicated function for debugging software.

【0002】[0002]

【従来の技術】最近のマイクロコンピュータは、動作周
波数を高速化するためにパイプライン動作機構を備え
る、いわゆるRISC(Reduced Instruction Set Comp
uter)型のものが多く開発されてきている。一般に、R
ISC型プロセッサにおけるパイプライン制御は、命令
フェッチ、命令デコード、オペランドフェッチ、演算実
行および結果格納の5つのステージに分かれている。
2. Description of the Related Art Recent microcomputers have a so-called RISC (Reduced Instruction Set Compiler) having a pipeline operation mechanism for increasing the operating frequency.
Many (uter) types have been developed. In general, R
Pipeline control in an ISC type processor is divided into five stages: instruction fetch, instruction decode, operand fetch, operation execution, and result storage.

【0003】従来のマイクロコンピュータにおけるソフ
トウェアのデバグの方法について説明する。通常、ソフ
トウェアのデバグをするためには、プログラム中の所定
の命令で動作を停止して、それまでにCPUが実行した
命令アドレスをトレースしたり、CPU内部のレジスタ
内容のダンプ、メモリ内容のダンプなどを行う。
A method of debugging software in a conventional microcomputer will be described. Usually, in order to debug software, the operation is stopped by a predetermined instruction in the program, the instruction address executed by the CPU so far is traced, the register contents in the CPU are dumped, and the memory contents are dumped. And so on.

【0004】図3は、従来例におけるRISC型プロセ
ッサのデータ処理装置の構成を示すブロック図である。
図3に示したデータ処理装置は、5つのステージを実行
するユニットである命令フェッチ部100、命令デコー
ド部101、オペランドフェッチ部102、演算部10
3および結果格納部104と、退避レジスタ105〜1
09と、パイプライン制御部110と、ブレークポイン
トレジスタ111と、プログラムカウンタ112と、プ
ログラムメモリ115と、退避レジスタ116とを有す
る構成となっている。ここで、命令フェッチ部100、
命令デコード部101、オペランドフェッチ部102、
演算部103および結果格納部104のそれぞれには、
待避レジスタ105〜109が接続されている。パイプ
ライン制御部110には、ブレークポイントレジスタ1
11およびプログラムカウンタ112が接続されてい
る。プログラムカウンタ112には、退避レジスタ11
6が接続されている。通常の命令実行時には、プログラ
ムカウンタ112は1アドレスずつインクリメントされ
る。また、全体の処理の制御はパイプライン制御部11
0で行う。
FIG. 3 is a block diagram showing a configuration of a data processing device of a RISC type processor in a conventional example.
The data processing device shown in FIG. 3 includes an instruction fetch unit 100, an instruction decode unit 101, an operand fetch unit 102, and an arithmetic unit 10 which are units that execute five stages.
3 and the result storage unit 104 and the save registers 105 to 1
09, a pipeline control unit 110, a breakpoint register 111, a program counter 112, a program memory 115, and a save register 116. Here, the instruction fetch unit 100,
An instruction decoding unit 101, an operand fetch unit 102,
The arithmetic unit 103 and the result storage unit 104 each include:
The save registers 105 to 109 are connected. The pipeline control unit 110 includes a breakpoint register 1
11 and a program counter 112 are connected. The program counter 112 includes the save register 11
6 are connected. During normal instruction execution, the program counter 112 is incremented by one address. Further, control of the entire processing is performed by the pipeline control unit 11.
Perform at 0.

【0005】ソフトウェアをデバグするときには、まず
ブレークポイントレジスタ111を設定する。ブレーク
ポイントレジスタ111は、通常のI/O設定命令を実
行することによって設定される。すなわち、命令デコー
ド部101がブレークポイントレジスタ111への書き
込み命令であることを検出すると、オペランドフェッチ
部102が書き込みデータを生成し、結果格納部104
からパイプライン制御部110を介して、ブレークポイ
ントレジスタ111の内容を書き換える。その後、パイ
プライン制御部110は、プログラムカウンタ112と
ブレークポイントレジスタ111とが一致するかどうか
を各命令ごとに比較する。一致する場合には、待避レジ
スタ105〜109に各ステージ100〜104の実行
状態の待避を指示する信号200をアクティブにする。
When debugging software, first, a breakpoint register 111 is set. The breakpoint register 111 is set by executing a normal I / O setting instruction. That is, when the instruction decoding unit 101 detects that the instruction is a write instruction to the breakpoint register 111, the operand fetch unit 102 generates write data, and the result storage unit 104
Through the pipeline control unit 110 to rewrite the contents of the breakpoint register 111. Thereafter, the pipeline control unit 110 compares, for each instruction, whether the program counter 112 matches the breakpoint register 111. If they match, a signal 200 instructing the save registers 105 to 109 to save the execution state of each stage 100 to 104 is activated.

【0006】これによって、待避レジスタ105には、
命令フェッチ部100から現在フェッチした命令の情報
が退避される。待避レジスタ106には、命令デコード
部101から1つ前の命令のデコード情報が退避され
る。待避レジスタ107には、オペランドフェッチ部1
02から2つ前の命令のオペランド情報が退避される。
待避レジスタ108には、演算部103から3つ前の命
令の演算情報が退避される。待避レジスタ109には、
結果格納部104から4つ前の命令の結果格納情報が待
避されることになる。同時に、プログラムカウンタ11
2の内容は待避レジスタ116に格納される。
As a result, the save register 105 contains
Information on the currently fetched instruction is saved from the instruction fetch unit 100. The save register 106 saves decode information of the immediately preceding instruction from the instruction decode unit 101. The save register 107 includes the operand fetch unit 1
The operand information of the instruction two before the 02 is saved.
In the save register 108, the operation information of the instruction three instructions before from the operation unit 103 is saved. In the save register 109,
The result storage information of the instruction four steps before is saved from the result storage unit 104. At the same time, the program counter 11
2 is stored in the save register 116.

【0007】そして、プログラムメモリ115では、あ
らかじめ決められたデバグ用のプログラムが格納されて
いるアドレスにジャンプすることによって、デバグプロ
グラムの実行が開始される。デバグプログラムは、レジ
スタやメモリの内容をダンプするプログラムを実行す
る。
In the program memory 115, the execution of the debug program is started by jumping to an address where a predetermined debug program is stored. The debug program executes a program for dumping the contents of registers and memory.

【0008】デバグプログラムからの復帰は、以下のよ
うにして行われる。デバグプログラムの最後に、専用の
復帰命令をプログラムしておく。この命令を実行する
と、パイプライン制御部110は、待避レジスタ105
〜109の内容を各ユニット100〜104に戻し、さ
らに待避レジスタ116の内容をプログラムカウンタ1
12に戻す。これによって、デバグプログラム実行前の
状態に完全に戻ることになる。
The return from the debug program is performed as follows. At the end of the debug program, a dedicated return instruction is programmed. When this instruction is executed, the pipeline control unit 110
To the units 100 to 104, and further saves the contents of the save register 116 to the program counter 1
Return to 12. This completely returns to the state before the execution of the debug program.

【0009】[0009]

【発明が解決しようとする課題】以上説明した従来のデ
バグ方法は、各パイプラインステージの状態を待避する
ための待避レジスタのハードウェア規模が非常に大き
く、コストアップを伴うという欠点があった。例えば、
命令フェッチをするための待避レジスタ105は、32
ビットの命令コードを格納するレジスタを必要とする。
命令デコードをするための待避レジスタ106は、デコ
ードされた100種類余りの制御信号を格納するレジス
タを必要とする。待避レジスタ107は、32ビットの
レジスタを識別する5本のアドレス情報を3組(第1オ
ペランド〜第3オペランド)またはイミディエイト値を
格納する必要がある。待避レジスタ108は、32ビッ
トの演算入力を2本必要とする。待避レジスタ109
は、32ビットの演算結果などを必要とする。このよう
に、後続して実行されるデバグプログラムによってCP
Uの内部状態が壊れても復帰することができるようにす
るために、パイプラインの状態を保存する必要があっ
た。
The conventional debugging method described above has a drawback that the hardware scale of the save register for saving the state of each pipeline stage is very large, and the cost is increased. For example,
The save register 105 for fetching instructions has 32
Requires a register to store the bit instruction code.
The save register 106 for decoding an instruction requires a register for storing over 100 types of decoded control signals. The save register 107 needs to store three sets (first operand to third operand) of five pieces of address information for identifying a 32-bit register or an immediate value. The save register 108 requires two 32-bit operation inputs. Save register 109
Requires a 32-bit operation result. Thus, the CP executed by the subsequently executed debug program
In order to be able to return even if the internal state of U is broken, it was necessary to save the state of the pipeline.

【0010】また、これらの待避レジスタは、通常の回
路とマルチプレクスされるので、動作周波数を制約する
いわゆるクリティカルパスとなる。このため、このよう
なデバグ機能のないCPUと比較して、動作周波数が低
速になるという欠点があった。
[0010] Further, since these save registers are multiplexed with ordinary circuits, they serve as so-called critical paths that limit the operating frequency. For this reason, there is a disadvantage that the operating frequency is lower than that of a CPU without such a debug function.

【0011】さらに、デバグプログラムを応用プログラ
ム空間と同一の空間にマッピングするので、ソフトウェ
ア設計において、メモリサイズやプログラムのリンク等
の制約があるという欠点があった。
Furthermore, since the debug program is mapped in the same space as the application program space, there is a drawback that software design has restrictions such as memory size and program link.

【0012】このような点に鑑み本発明は、ハードウェ
ア削減によるコスト削減および動作周波数の向上、なら
びにソフトウェア開発手順の単純化を図るデータ処理装
置を提供することを目的とする。
[0012] In view of the above, an object of the present invention is to provide a data processing apparatus that reduces costs and improves operating frequencies by reducing hardware, and simplifies software development procedures.

【0013】[0013]

【課題を解決するための手段】上述の欠点を解決するた
めに本発明のデータ処理装置は、プログラムの命令を実
行中に該プログラムを停止させる指令を検出すると、該
プログラムの代わりにnop命令を実行し、該プログラ
ムを復帰させる指令を検出すると、該nop命令の代わ
りに該プログラムの実行を再開する。
SUMMARY OF THE INVENTION In order to solve the above-mentioned drawbacks, a data processing apparatus according to the present invention, when detecting a command to stop a program while executing the program instruction, issues a nop instruction instead of the program. When a command to execute and return the program is detected, execution of the program is resumed instead of the nop instruction.

【0014】上記本発明のデータ処理装置は、パイプラ
イン制御機構を備えるデータ処理装置であって、第1の
プログラム(応用プログラム)の命令をフェッチする第
1の命令フェッチ手段(115)と、該第1のプログラ
ム(応用プログラム)の命令の実行を停止するためにあ
らかじめ設定されている停止条件が成立したかどうかを
検出する検出手段(1)と、該停止条件が成立したと該
検出手段(1)が判定すると、実行すべき該第1のプロ
グラム(応用プログラム)の有効な命令に引き続いて自
動的にnop命令をフェッチする第2の命令フェッチ手
段(4)と、第2のプログラム(デバグプログラム)の
命令をフェッチする第3の命令フェッチ手段(3)と、
該第1の命令フェッチ手段(115)と該第2の命令フ
ェッチ手段(4)と該第3の命令フェッチ手段(3)と
のうちのいずれか1つがフェッチする命令を選択する命
令選択手段(2)とを有し、該命令選択手段(2)が該
第1の命令フェッチ手段(115)を選択して該第1の
プログラム(応用プログラム)を実行しているときに、
該検出手段(1)が該停止条件が成立したと判定したと
きには、該命令選択手段(2)が該第2の命令フェッチ
手段(4)を選択して、該停止条件が成立したときの該
有効な命令の後に該nop命令をフェッチし、該有効な
命令の実行が完了した後に、該命令選択手段(2)が該
第3の命令フェッチ手段(3)を選択して該第2のプロ
グラム(デバグプログラム)を実行し、該第2のプログ
ラム(デバグプログラム)を実行しているときには、該
命令選択手段(2)が、該第2の命令フェッチ手段
(4)と該第3の命令フェッチ手段(3)とを交互に選
択し、該第2のプログラム(デバグプログラム)におい
て所定の復帰命令が実行されたときには、該命令選択手
段(2)が該第1の命令フェッチ手段(115)を選択
する。
The data processing apparatus according to the present invention is a data processing apparatus having a pipeline control mechanism, wherein first instruction fetch means (115) for fetching an instruction of a first program (application program); Detecting means (1) for detecting whether a preset stop condition for stopping the execution of the instruction of the first program (application program) is provided; and detecting means ( 1), a second instruction fetch means (4) for automatically fetching a nop instruction following a valid instruction of the first program (application program) to be executed, and a second program (debug) Third instruction fetch means (3) for fetching instructions of the program);
Instruction selecting means (115) for selecting an instruction to be fetched by any one of the first instruction fetching means (115), the second instruction fetching means (4), and the third instruction fetching means (3) Wherein the instruction selecting means (2) selects the first instruction fetch means (115) and executes the first program (application program),
When the detecting means (1) determines that the stop condition has been satisfied, the instruction selecting means (2) selects the second instruction fetch means (4) and determines whether the second instruction fetch means (4) has been satisfied. The nop instruction is fetched after the valid instruction, and after the execution of the valid instruction is completed, the instruction selecting means (2) selects the third instruction fetch means (3) and executes the second program When the second program (debug program) is being executed and the second program (debug program) is being executed, the instruction selecting means (2) includes the second instruction fetching means (4) and the third instruction fetching means. Means (3) are alternately selected, and when a predetermined return instruction is executed in the second program (debug program), the instruction selection means (2) causes the first instruction fetch means (115) to select.

【0015】上記本発明のデータ処理装置は、前記第3
の命令フェッチ手段(3)が、シリアルインタフェース
を介して外部から前記第2のプログラム(デバグプログ
ラム)を入力する入力手段(5)を備えることができ
る。
The data processing apparatus of the present invention is characterized in that
The instruction fetch means (3) can include input means (5) for externally inputting the second program (debug program) via a serial interface.

【0016】[0016]

【発明の実施の形態】次に、本発明の実施の形態につい
て、図面を用いて説明する。
Next, embodiments of the present invention will be described with reference to the drawings.

【0017】[第1の実施の形態]本発明の第1の実施
の形態を図1を用いて説明する。図1は、本発明の第1
の実施の形態におけるデータ処理装置の構成を示すブロ
ック図である。
[First Embodiment] A first embodiment of the present invention will be described with reference to FIG. FIG. 1 shows a first embodiment of the present invention.
FIG. 3 is a block diagram illustrating a configuration of a data processing device according to the embodiment.

【0018】図1に示したデータ処理装置は、パイプラ
イン制御部1と、マルチプレクサ2と、デバグプログラ
ムメモリ3と、nop挿入部4と、各パイプラインを実
行するユニットである命令フェッチ部100、命令デコ
ード部101、オペランドフェッチ部102、演算部1
03および結果格納部104と、ブレークポイントレジ
スタ111と、プログラムカウンタ112と、プログラ
ムメモリ115と、退避レジスタ116とを有する構成
となっている。ここで、命令フェッチ部100、命令デ
コード部101、オペランドフェッチ部102、演算部
103および結果格納部104には、パイプライン制御
部1が接続されている。また、プログラムカウンタ11
2には、退避レジスタ116が接続されている。
The data processing apparatus shown in FIG. 1 has a pipeline control unit 1, a multiplexer 2, a debug program memory 3, a nop insertion unit 4, an instruction fetch unit 100 which is a unit for executing each pipeline, Instruction decoding unit 101, operand fetch unit 102, operation unit 1
03, a result storage unit 104, a breakpoint register 111, a program counter 112, a program memory 115, and a save register 116. Here, the instruction fetch unit 100, the instruction decode unit 101, the operand fetch unit 102, the operation unit 103, and the result storage unit 104 are connected to the pipeline control unit 1. Also, the program counter 11
2 is connected to a save register 116.

【0019】このような構成において、各ユニット10
0〜104、ブレークポイントレジスタ111およびプ
ログラムカウンタ112の通常の動作は、従来の技術で
説明したものと同様である。主な相違点は、待避レジス
タ105〜109がなく、各ユニット100〜104が
パイプライン制御部1に直接接続されており、命令フェ
ッチをするためのマルチプレクサ2が、プログラムメモ
リ115、nop挿入部4およびデバグプログラムメモ
リ3を入力として、出力を命令フェッチ部100に入力
していることである。
In such a configuration, each unit 10
Normal operations of 0 to 104, the breakpoint register 111 and the program counter 112 are the same as those described in the related art. The main difference is that there are no save registers 105 to 109, each unit 100 to 104 is directly connected to the pipeline control unit 1, and the multiplexer 2 for fetching an instruction includes a program memory 115, a nop insertion unit 4 That is, the debug program memory 3 is input and the output is input to the instruction fetch unit 100.

【0020】ソフトウェアをデバグするときには、従来
の技術で説明したように、まずブレークポイントレジス
タ111を設定する。その後、パイプライン制御部1に
おいて、プログラムカウンタ112の内容とブレークポ
イントレジスタ111の内容とが一致するかどうかを各
命令ごとに比較する。一致する場合には、選択信号20
をアクティブにして、マルチプレクサ2がnop挿入部
4の出力を選択する。このように、ブレークポイントで
指定された命令の後にnop命令が挿入されるだけなの
で、それ以前の命令は通常通りに全て実行される。した
がって、最短で5クロック後に、ブレークポイントで指
定された命令を含んだそれまでの命令の実行が完了する
ことになる。この間にパイプラインの動作が乱れて処理
時間が長くなるいわゆるパイプライン・ハザードが起き
たとしても、それが終了するまでnop命令をフェッチ
し続ける。
When debugging software, first, the breakpoint register 111 is set as described in the background art. Thereafter, the pipeline control unit 1 compares each instruction whether the contents of the program counter 112 and the contents of the breakpoint register 111 match. If they match, the selection signal 20
Is activated, and the multiplexer 2 selects the output of the nop insertion unit 4. As described above, since only the nop instruction is inserted after the instruction specified by the breakpoint, all instructions before that are executed as usual. Therefore, after a minimum of 5 clocks, the execution of the instructions including the instruction specified by the breakpoint is completed. Even if a so-called pipeline hazard in which the operation of the pipeline is disturbed and the processing time is prolonged during this time, the nop instruction is continuously fetched until the end thereof.

【0021】パイプライン制御部1においてブレークポ
イントよりも前の命令の実行が全て完了したことを確認
すると、選択信号20を切り替えて、マルチプレクサ2
がデバグプログラムメモリ3の出力を選択する。このデ
バグプログラムメモリ3は、安価にするためにプログラ
ムメモリ115よりも低速なものを使用している。第1
の実施の形態においては、デバグプログラムメモリ3の
アクセスタイムがプログラムメモリ115のアクセスタ
イムの1/2となるように構成している。
When the pipeline controller 1 confirms that all instructions before the breakpoint have been executed, it switches the selection signal 20 to the multiplexer 2.
Selects the output of the debug program memory 3. The debug program memory 3 uses a lower speed than the program memory 115 in order to reduce the cost. First
In the embodiment, the access time of the debug program memory 3 is configured to be 1/2 of the access time of the program memory 115.

【0022】このように選択信号20を制御することに
よって、マルチプレクサ2が、通常のプログラム実行時
にはプログラムメモリ115の出力を選択し、デバグを
行うときには、ブレークポイント以前の命令を終了する
までnop挿入部4の出力であるnop命令を選択し、
ブレークポイント以前の命令が全て完了した後に、デバ
グプログラムメモリ3の出力を選択し、デバグ中は、n
op挿入部4の出力とデバグプログラムメモリ3の出力
とを交互に選択する。これによって、デバグ中にパイプ
ライン制御を停止することなく、応用プログラムがno
p命令を実行しながら、デバグプログラムを実行するこ
とができる。
By controlling the selection signal 20 in this manner, the multiplexer 2 selects the output of the program memory 115 during normal program execution, and when debugging, executes the nop insertion section until the instruction before the breakpoint ends. Select the nop instruction that is the output of 4
After all instructions before the breakpoint have been completed, the output of the debug program memory 3 is selected.
The output of the op insertion unit 4 and the output of the debug program memory 3 are alternately selected. As a result, the application program can be set to no without stopping the pipeline control during debugging.
The debug program can be executed while executing the p instruction.

【0023】デバグプログラム終了時には、ブレークポ
インタの次の命令からフェッチするように、デバグプロ
グラムの最後で専用の復帰命令を実行する。これによっ
て、待避レジスタ116の内容をプログラムカウンタ1
12に戻し、マルチプレクサ2はプログラムメモリ11
5の出力を選択して出力する。
At the end of the debug program, a dedicated return instruction is executed at the end of the debug program so as to fetch from the instruction following the break pointer. As a result, the contents of the save register 116 are stored in the program counter 1
12, the multiplexer 2 is connected to the program memory 11
5 is selected and output.

【0024】本発明のデバグプログラムにおいては、い
わゆる内部状態を変化させないようにソフトウェア上の
配慮を行っている。これはデバグプログラムを設計する
上での制限にはなるが、デバグプログラムそのものは単
純であり、また応用プログラムに依存しないものである
ので、一旦設計を完了してしまえば、汎用的に利用する
ことができる。内部状態を変化させる要因としては、レ
ジスタの内容がある。メモリの内容をダンプする際には
レジスタを用いて間接アドレッシングをしなければなら
ないが、デバグプログラムの最初にこの値をデバグプロ
グラムメモリ3に待避しておき、復帰する直前にこの待
避した内容を書き戻す。
In the debug program of the present invention, consideration is given to software so as not to change the so-called internal state. This is a limitation in designing a debug program, but since the debug program itself is simple and does not depend on application programs, once the design is completed, it should be used for general purposes. Can be. Factors that change the internal state include the contents of registers. When dumping the contents of the memory, indirect addressing must be performed using registers. However, this value is saved in the debug program memory 3 at the beginning of the debug program, and the saved contents are written immediately before returning. return.

【0025】また、RISCプロセッサの種類によって
は、ブレークポイントとして設定した命令が分岐命令の
場合には、直後の命令を必ず実行するように設計されて
いるものがある。この場合は、分岐命令にブレークポイ
ントを設定することができないという制限にはなるが、
使用上大きな問題になることはない。
Further, depending on the type of RISC processor, if the instruction set as a breakpoint is a branch instruction, there is one designed to always execute the immediately following instruction. In this case, the limitation is that a breakpoint cannot be set at the branch instruction.
There is no major problem in use.

【0026】なお、第1の実施の形態においてはデバグ
プログラムメモリ3をプログラムメモリ115と独立し
た空間に設定した。これは、デバグプログラムを応用プ
ログラムと分離することによって、応用プログラム設計
におけるサイズの制限を回避することおよび両者のプロ
グラムのリンクを不要として開発効率をあげることを目
的とした。当然、デバグプログラムメモリ3をプログラ
ムメモリ115と同じメモリ空間にマッピングすること
によって、両者のメモリを物理的にひとつにすることは
可能であり容易である。この際には、マルチプレクサ2
の構成は3入力から2入力となるが、容易に実現するこ
とができるということは明白である。
In the first embodiment, the debug program memory 3 is set in a space independent of the program memory 115. The purpose of this is to separate the debug program from the application program, thereby avoiding the size limitation in the application program design, and increasing the development efficiency by eliminating the link between the two programs. Naturally, by mapping the debug program memory 3 in the same memory space as the program memory 115, it is possible and easy to physically combine both memories. In this case, the multiplexer 2
Is changed from three inputs to two inputs, but it is obvious that it can be easily realized.

【0027】[第2の実施の形態]本発明の第2の実施
の形態を図2を用いて説明する。図2は、本発明の第2
の実施の形態におけるデータ処理装置の構成を示すブロ
ック図である。
[Second Embodiment] A second embodiment of the present invention will be described with reference to FIG. FIG. 2 shows a second embodiment of the present invention.
FIG. 3 is a block diagram illustrating a configuration of a data processing device according to the embodiment.

【0028】図2に示したデータ処理装置の構成は、図
1に示した第1の実施の形態におけるデータ処理装置の
構成とほぼ同様である。異なる点は、デバグプログラム
メモリ3の代わりにシリアルインタフェース5を有して
いる点である。シリアルインタフェース5は、出力をマ
ルチプレクサ2に入力し、シリアル制御信号10および
受信完了信号11を用いてパイプライン制御部1との間
で入出力を行い、結果格納部104の出力をデータバス
30を介して入力している。このように、第2の実施の
形態においては、デバグプログラムメモリ3を使用せず
に、シリアルインタフェース5を介してデバグプログラ
ムをフェッチする。
The configuration of the data processing device shown in FIG. 2 is almost the same as the configuration of the data processing device according to the first embodiment shown in FIG. The difference is that a serial interface 5 is provided instead of the debug program memory 3. The serial interface 5 inputs the output to the multiplexer 2, performs input / output with the pipeline control unit 1 using the serial control signal 10 and the reception completion signal 11, and connects the output of the result storage unit 104 to the data bus 30. You are typing through. As described above, in the second embodiment, the debug program is fetched via the serial interface 5 without using the debug program memory 3.

【0029】このような構成において、パイプライン制
御部1がブレークポイントを検出すると、選択信号20
を切り替えて、マルチプレクサ2がnop挿入部4の出
力を選択する。同時に、パイプライン制御部1はシリア
ル制御信号10をアクティブにして、シリアルインタフ
ェース5の動作を開始させる。シリアルインタフェース
5は、調歩同期式の手順によって外部のホストコンピュ
ータ(不図示)と通信を行い、あらかじめ準備してある
デバグプログラムを1命令ずつ受信する。1命令の受信
を完了すると受信完了信号11をアクティブにする。こ
れを受けて、パイプライン制御部1は、1クロック間だ
けマルチプレクサ2がシリアルインタフェース5の出力
を選択するように、選択信号20を制御する。
In such a configuration, when the pipeline control unit 1 detects a breakpoint, the selection signal 20
And the multiplexer 2 selects the output of the nop insertion unit 4. At the same time, the pipeline control unit 1 activates the serial control signal 10 to start the operation of the serial interface 5. The serial interface 5 communicates with an external host computer (not shown) by a start-stop synchronization procedure, and receives a debug program prepared in advance one instruction at a time. When the reception of one command is completed, the reception completion signal 11 is activated. In response to this, the pipeline control unit 1 controls the selection signal 20 so that the multiplexer 2 selects the output of the serial interface 5 only for one clock.

【0030】こうして1命令ずつデバグプログラムが実
行されるが、レジスタやメモリのダンプそのものは、次
のようにして行う。シリアルインタフェース5の内部に
送信レジスタ(不図示)があり、結果格納部104から
データバス30を経由して、ダンプした内容を送信レジ
スタに格納する。この格納自体も、デバグプログラムの
中で実行する。受信と送信との切り替えは、全てホスト
コンピュータ側で制御する。デバグプログラムの進行に
伴い、ダンプデータを引き取るときには、シリアルイン
タフェース5に送信を要求してダンプデータをシリアル
通信でホストコンピュータ側に引き取る。
In this way, the debug program is executed one instruction at a time. The dump of the register and the memory itself is performed as follows. A transmission register (not shown) is provided inside the serial interface 5, and stores the dumped contents from the result storage unit 104 via the data bus 30 in the transmission register. This storage itself is executed in the debug program. Switching between reception and transmission is all controlled by the host computer. When the dump data is collected with the progress of the debug program, transmission is requested to the serial interface 5 and the dump data is collected to the host computer by serial communication.

【0031】デバグプログラムの最後には、専用の復帰
命令をプログラムしておく。これを実行することによっ
て、待避レジスタ116の内容がプログラムカウンタ1
12に戻り、マルチプレクサ2はプログラムメモリ11
5を選択する。
At the end of the debug program, a dedicated return instruction is programmed. By executing this, the contents of the save register 116 are stored in the program counter 1
12, the multiplexer 2 is connected to the program memory 11
Select 5.

【0032】[0032]

【発明の効果】以上説明したように本発明は、ブレーク
ポイントを検出したときにパイプライン動作を停止せず
にnop命令を挿入することによって、デバグプログラ
ムを実行する際に、パイプラインの状態を保存するため
のハードウェアの追加を必要とせず、デバグプログラム
実行のために追加するハードウェアを削減することがで
きるという効果を有する。従来の技術においては5つの
待避レジスタが合計で最低250ビットのレジスタおよ
び相当の選択回路(約5kゲート)が必要であるのに対
して、本発明においては不要なので、全体のハードウェ
ア(約50kゲート)の10%程度を削減することがで
きるという効果を有する。また、各パイプラインにおけ
る最長のゲート段数は20段程度であるが、待避レジス
タを復帰するための選択回路の1ゲートを削減すること
によって、動作周波数を約5%向上することができると
いう効果を有する。
As described above, according to the present invention, when a debug program is executed by inserting a nop instruction without stopping the pipeline operation when a breakpoint is detected, the state of the pipeline can be changed. There is an effect that it is not necessary to add hardware for saving, and hardware added for executing the debug program can be reduced. In the prior art, five save registers require a register of at least 250 bits in total and a corresponding selection circuit (approximately 5k gates), whereas the present invention does not require the entire hardware (approximately 50k). Gate) can be reduced by about 10%. Although the longest number of gate stages in each pipeline is about 20, the reduction of one gate of the selection circuit for restoring the save register has the effect of improving the operating frequency by about 5%. Have.

【0033】第1の実施の形態においては、プログラム
メモリとデバグプログラムメモリとを独立に備えて、応
用プログラム空間と独立した空間にデバグプログラムを
マッピングすることによって、応用プログラムの最大許
容サイズが実質的に拡大するという効果を有する。一般
に、デバグプログラムのサイズは100Kバイト程度必
要なので、応用プログラムが1Mバイト程度の場合に
は、約10%の有効利用をすることができる。また、応
用プログラムを作成する際にデバグプログラムとリンク
する必要がなくなり、ソフトウェアの開発手順を単純化
することができるという効果を有する。
In the first embodiment, the program memory and the debug program memory are independently provided, and the maximum allowable size of the application program is substantially reduced by mapping the debug program in a space independent of the application program space. This has the effect of expanding to. In general, the size of a debug program is required to be about 100 Kbytes. Therefore, when the application program is about 1 Mbyte, about 10% can be effectively used. In addition, there is no need to link with a debug program when creating an application program, which has the effect of simplifying the software development procedure.

【0034】第2の実施の形態においては、デバグプロ
グラムメモリの代わりにシリアルインタフェースを採用
したことによって、RISCプロセッサとホストコンピ
ュータとの間の端子数を大幅に削減することができると
いう効果を有する。
In the second embodiment, the use of the serial interface instead of the debug program memory has the effect of greatly reducing the number of terminals between the RISC processor and the host computer.

【0035】ここで、第1の実施の形態においては、実
行速度はデバグ時にも通常と変わらず高速であることが
優位点だが、32ビット長のデータバス、32ビット長
のアドレスバス、制御信号などを端子として備えなけれ
ばならないので高価になる。デバグプログラムを全てR
ISCプロセッサ内部に内蔵することができる場合には
端子数の問題はないが、チップサイズが大きくなり、コ
ストアップの要因になる。これに対して第2の実施の形
態においては、第1の実施の形態と比較してデバグプロ
グラムの実行速度は低速であるが、レジスタやメモリの
ダンプが多少低速であってもデバグをするためには大き
な問題とならず、シリアルインタフェースの回路規模が
小さいというメリットや端子数の削減によってコストを
大幅に低減することができるというメリットが大きい。
Here, in the first embodiment, it is advantageous that the execution speed is as fast as usual even at the time of debugging, but the execution speed is 32 bits, the 32-bit data bus, the 32-bit address bus, and the control signal. And so on must be provided as terminals, which is expensive. R all debug programs
If the chip can be built in the ISC processor, there is no problem with the number of terminals, but the chip size increases, which causes a cost increase. On the other hand, in the second embodiment, the execution speed of the debug program is lower than that of the first embodiment. Does not pose a major problem, and has a great advantage that the circuit scale of the serial interface is small and that the cost can be significantly reduced by reducing the number of terminals.

【0036】このように本発明は、ハードウェア削減に
よるコスト削減および動作周波数の向上、ならびにソフ
トウェア開発手順の単純化を図ることができるという効
果を有する。
As described above, the present invention has an effect that the cost can be reduced and the operating frequency can be improved by reducing the hardware, and the software development procedure can be simplified.

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

【図1】本発明の第1の実施の形態におけるデータ処理
装置の構成を示すブロック図
FIG. 1 is a block diagram showing a configuration of a data processing device according to a first embodiment of the present invention.

【図2】本発明の第2の実施の形態におけるデータ処理
装置の構成を示すブロック図
FIG. 2 is a block diagram showing a configuration of a data processing device according to a second embodiment of the present invention.

【図3】従来例におけるRISC型プロセッサのデータ
処理装置の構成を示すブロック図
FIG. 3 is a block diagram showing a configuration of a data processing device of a RISC type processor in a conventional example.

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

1,110 パイプライン制御部 2 マルチプレクサ 3 デバグプログラムメモリ 4 nop挿入部 5 シリアルインタフェース 100 命令フェッチ部 101 命令デコード部 102 オペランドフェッチ部 103 演算部 104 結果格納部 105〜109,116 待避レジスタ 111 ブレークポイントレジスタ 112 プログラムカウンタ 115 プログラムメモリ 1, 110 Pipeline control unit 2 Multiplexer 3 Debug program memory 4 Nop insertion unit 5 Serial interface 100 Instruction fetch unit 101 Instruction decode unit 102 Operand fetch unit 103 Operation unit 104 Result storage unit 105 to 109, 116 Save register 111 Breakpoint register 112 program counter 115 program memory

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 パイプライン制御機構を備えるデータ処
理装置において、 命令フェッチ部、命令デコード部、オペランドフェッチ
部、演算部、及び結果格納部における動作の各ステージ
を制御するパイプライン制御部と、実行プログラムを格
納するプログラムメモリと、デバグ用プログラムメモリ
を格納するデバグプログラムメモリと、nop命令を出
力するnop挿入部と、前記プログラムメモリ、デバグ
プログラムメモリ、又はnop挿入部の各出力のうち、
いずれか1つを選択し前記命令フェッチ部へ出力するマ
ルチプレクサと、前記実行プログラムに対してブレーク
ポイントを保持するブレークポイントレジスタと、プロ
グラムカウンタと、待避レジスタとを有し、 前記プログラムカウンタの値と前記ブレークポイントの
値とが一致した時、前記待避レジスタは前記プログラム
カウンタの値を保持するとともに、前記パイプライン制
御部は、前記ブレークポイントで指定された命令を含ん
だ命令が完了するまで前記マルチプレクサがnop命令
を出力し、前記ブレークポイントで指定された命令を含
んだ命令が完了後には前記マルチプレクサが前記デバグ
用プログラムを出力するように制御することを特徴とす
る、 データ処理装置。
1. A data processor having a pipeline control mechanism.
In management apparatus, an instruction fetch unit, an instruction decode unit, an operand fetch
Stages of operation in the storage unit, operation unit, and result storage unit
A pipeline control unit that controls
Program memory to store and program memory for debugging
Debug program memory for storing
A nop insertion part, the program memory, and the debug
Of each output of the program memory or the nop insertion unit,
Select one of them and output to the instruction fetch unit.
Break on the multiplexor and the execution program
A breakpoint register to hold points
A program counter and a save register .
When the value matches, the save register stores the program
While holding the counter value, the pipeline system
The control unit includes the instruction specified by the breakpoint.
The multiplexer is a nop instruction until the instruction is completed.
Is output, and the instruction specified by the breakpoint is included.
After the completion of the instruction, the multiplexer
Control to output a program for use
That, the data processing device.
【請求項2】 パイプライン制御機構を備えるデータ処
理装置において、 第1のプログラムの命令をフェッチする第1の命令フェ
ッチ手段と、 該第1のプログラムの命令の実行を停止するためにあら
かじめ設定されている停止条件が成立したかどうかを検
出する検出手段と、 該停止条件が成立したと該検出手段が判定すると、実行
すべき該第1のプログラムの有効な命令に引き続いて自
動的にnop命令をフェッチする第2の命令フェッチ手
段と、 第2のプログラムの命令をフェッチする第3の命令フェ
ッチ手段と、 該第1の命令フェッチ手段と該第2の命令フェッチ手段
と該第3の命令フェッチ手段とのうちのいずれか1つが
フェッチする命令を選択する命令選択手段とを有し、 該命令選択手段が該第1の命令フェッチ手段を選択して
該第1のプログラムを実行しているときに、該検出手段
が該停止条件が成立したと判断したときには、該命令選
択手段が該第2の命令フェッチ手段を選択して、該停止
条件が成立したときの該有効な命令の後に該nop命令
をフェッチし、 該有効な命令の実行が完了した後に、該命令選択手段が
該第3の命令フェッチ手段を選択して該第2のプログラ
ムを実行し、 該第2のプログラムを実行しているときには、該命令選
択手段が、該第2の命令フェッチ手段と該第3の命令フ
ェッチ手段とを交互に選択し、 該第2のプログラムにおいて所定の復帰命令が実行され
たときには、該命令選択手段が該第1の命令フェッチ手
段を選択することを特徴とする、データ処理装置。
2. A data processing device having a pipeline control mechanism, wherein: first instruction fetch means for fetching an instruction of a first program; and a preset instruction fetch means for stopping execution of the instruction of the first program. Detecting means for detecting whether or not the stopping condition has been satisfied; and when the detecting means determines that the stopping condition has been satisfied, a nop instruction is automatically provided following a valid instruction of the first program to be executed. Instruction fetch means for fetching an instruction of the second program, third instruction fetch means for fetching an instruction of the second program, the first instruction fetch means, the second instruction fetch means, and the third instruction fetch Means for selecting an instruction to be fetched by any one of the first means and the first means for selecting the first instruction fetch means. If the detecting means determines that the stop condition is satisfied during execution of the first program, the instruction selecting means selects the second instruction fetch means and the stop condition is satisfied. Fetching the nop instruction after the valid instruction at the time, and after the execution of the valid instruction is completed, the instruction selecting means selects the third instruction fetch means and executes the second program. When the second program is being executed, the instruction selecting means alternately selects the second instruction fetch means and the third instruction fetch means, and a predetermined return in the second program is performed. A data processing device , wherein when an instruction is executed, the instruction selecting means selects the first instruction fetch means .
【請求項3】 前記第3の命令フェッチ手段が、シリア
ルインタフェースを介して外部から前記第2のプログラ
ムを入力する入力手段を備えることを特徴とする、請求
項2に記載のデータ処理装置。
3. The data processing apparatus according to claim 2, wherein said third instruction fetch means includes an input means for externally inputting said second program via a serial interface.
JP09150802A 1997-06-09 1997-06-09 Data processing device Expired - Fee Related JP3097602B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP09150802A JP3097602B2 (en) 1997-06-09 1997-06-09 Data processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP09150802A JP3097602B2 (en) 1997-06-09 1997-06-09 Data processing device

Publications (2)

Publication Number Publication Date
JPH10340209A JPH10340209A (en) 1998-12-22
JP3097602B2 true JP3097602B2 (en) 2000-10-10

Family

ID=15504756

Family Applications (1)

Application Number Title Priority Date Filing Date
JP09150802A Expired - Fee Related JP3097602B2 (en) 1997-06-09 1997-06-09 Data processing device

Country Status (1)

Country Link
JP (1) JP3097602B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101741680B1 (en) * 2017-01-03 2017-05-30 이경화 Apparatus of manufacturing side covers for side cover for bed mattress

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101741680B1 (en) * 2017-01-03 2017-05-30 이경화 Apparatus of manufacturing side covers for side cover for bed mattress

Also Published As

Publication number Publication date
JPH10340209A (en) 1998-12-22

Similar Documents

Publication Publication Date Title
US4562538A (en) Microprocessor having decision pointer to process restore position
JPS63301339A (en) Computer device
JPH0193837A (en) Microprocessor for debug
JP3439033B2 (en) Interrupt control device and processor
JP3226055B2 (en) Information processing device
US4223381A (en) Lookahead memory address control system
JPH1078889A (en) Microcomputer
JP3260083B2 (en) Debug system and debugging method
KR100223844B1 (en) Option circuit
JP3097602B2 (en) Data processing device
JP3694005B2 (en) Digital signal processing apparatus and digital signal processing method
AU714669B2 (en) Peripheral device control
JP2002157115A (en) Data processor
US20020004877A1 (en) Method and system for updating user memory in emulator systems
JP2001092686A (en) Semiconductor device
US5557772A (en) Data processing apparatus including a register storing a parameter and a microinstruction execution arrangement including a correction arrangement for causing a first value of the parameter to be change to a second, correct value
JPH1011315A (en) In-circuit emulator device and in-circuit emulation method
KR100465610B1 (en) Microcomputer with embedded flash memory having on-chip programming capability and method of programming data into the embedded flash memory
JP2679591B2 (en) Emulation chip and in-circuit emulator
JP2666737B2 (en) Microprocessor with built-in trace memory and trace method
JP3197045B2 (en) Extended central processing unit
JP2000029508A (en) Programmable controller
JP2003162411A (en) Data processor
JPH10254725A (en) Processor, and its bug adoiding method
JPH0683986A (en) Single chip microcomputer

Legal Events

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