JPH0454636A - processor - Google Patents
processorInfo
- Publication number
- JPH0454636A JPH0454636A JP2164102A JP16410290A JPH0454636A JP H0454636 A JPH0454636 A JP H0454636A JP 2164102 A JP2164102 A JP 2164102A JP 16410290 A JP16410290 A JP 16410290A JP H0454636 A JPH0454636 A JP H0454636A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- debug
- processor
- processing
- debugging
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
Abstract
(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は命令を解読して実行するプロセッサに関し、例
えばシングルチップマイクロコンピュータに適用して有
効な技術に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a processor that decodes and executes instructions, and relates to a technique that is effective when applied to, for example, a single-chip microcomputer.
プロセッサは、命令のブリフェッチを行う命令ブリフェ
ッチユニット、命令をデコードする命令デコードユニッ
ト、この命令デコード結果に従って命令を実行する実行
ユニットなどを含む、このようなプロセッサにおいては
、基本命令レベルの高速実行を可能とするため各種のキ
ャッシュメモリを内蔵し、高度なパイプライン処理を実
行可能としたものがある。また専用のハードウェア(エ
ミュレータ)を使用しなくてもユーザプログラムのデバ
ッグを可能とする機能としてセルフデバッグ機能を備え
たプロセッサも存在する。このセルフデバッグ機能とし
て、命令オペランドブレークやステップトレースを挙げ
ることができ、それらはプロセッサステータスワード中
のビットをセットすることにより使用可能とされる。A processor includes an instruction briefetch unit that briefetches instructions, an instruction decode unit that decodes instructions, and an execution unit that executes instructions according to the instruction decode results. In order to make this possible, some devices have various built-in cache memories and can perform advanced pipeline processing. There are also processors that have a self-debug function that allows user programs to be debugged without the use of dedicated hardware (emulator). These self-debug functions include instruction operand break and step trace, which are enabled by setting a bit in the processor status word.
尚、このようなプロセッサについて記載された文献の例
としては、昭和63年6月に日立製作所より発行された
rH32/200 オペレーションアーキテクチャマ
ニュアル(第3版)」がある。An example of a document describing such a processor is ``rH32/200 Operation Architecture Manual (Third Edition)'' published by Hitachi, Ltd. in June 1988.
しかしながら従来のプロセッサについて本発明者が検討
したところによれば、以下のような問題点のあることが
見い出された。However, according to the inventor's study of conventional processors, the following problems were found.
すなわち、セルフデバッグ機能を用いたデバッグにおい
て、プログラムミスによって命令実行が無限ループとな
ってしまう場合があり、この無限ループからの脱出が困
難とされる。That is, in debugging using the self-debug function, instruction execution may become an infinite loop due to a program error, and it is difficult to escape from this infinite loop.
またセルフデバッグ機能のステップトレースでは一命令
実行毎に必ずデバッグ例外処理が行われるようになって
いるため、リアルタイム性が重要とされる。ユーザシス
テムやそのプログラムのデバッグを行うのに従来のセル
フデバッグ機能は不適切とされる。リアルタイム性を向
上させるため所望命令についてのみトレースを行うよう
にすることもできるが、それを可能とするには、ユーザ
プログラムの命令置換えをを行わなければならないなど
の不便を伴う。尚、リアルタイム性を向上させるのにセ
ルフデバッグにおいて専用ハードウェアを使用すること
が考えられるが、CPU (中央処理装置)の高速化や
キャッシュメモリを内蔵するなど高機能化されたものに
おいては、専用ハードウェアを持つデバッガの開発が困
難となっているのが実情である。Furthermore, in the step trace of the self-debug function, debug exception handling is always performed every time one instruction is executed, so real-time performance is important. Conventional self-debugging functions are considered inappropriate for debugging user systems and their programs. In order to improve real-time performance, it is possible to trace only desired instructions, but to make this possible there is an inconvenience such as the need to replace instructions in the user program. It is possible to use dedicated hardware for self-debugging in order to improve real-time performance, but if the CPU (Central Processing Unit) is faster and has higher functionality such as a built-in cache memory, dedicated hardware may be used. The reality is that it is difficult to develop a debugger with hardware.
更に、セルフデバッグ機能の命令オペランドブレークに
よれば、ブレークポイント設定用レジスタの規模に限り
があることから、設定可能なブレークポイント数に限界
があり、規模の大きなプログラムのデバッグには使用し
難いものとされる。Furthermore, according to the self-debug function's instruction operand break, the number of breakpoints that can be set is limited because the size of the breakpoint setting register is limited, making it difficult to use for debugging large programs. It is said that
このように従来のプロセッサにおいては、ユーザプログ
ラムによってはセルフデバッグ機能が使い難い場合があ
り、ソフトウェア開発のためのデバッグの効率を必ずし
も向上し得るものではないことが、本発明者によって明
らかにされた。As described above, the present inventors have clarified that in conventional processors, the self-debug function may be difficult to use depending on the user program, and that it does not necessarily improve the efficiency of debugging for software development. .
本発明の目的は、ソフトウェア開発のためのデバッグの
効率向上を図ることができる技術を提供することにある
。An object of the present invention is to provide a technique that can improve the efficiency of debugging for software development.
本発明の前記ならびにその他の目的と新規な特徴は本明
細書の記述及び添付図面から明らかになるであろう。The above and other objects and novel features of the present invention will become apparent from the description of this specification and the accompanying drawings.
本願において開示される発明のうち代表的なものの概要
を簡単に説明すれば下記の通りである。A brief overview of typical inventions disclosed in this application is as follows.
すなわち、特定命令の解読結果に対する処理ルーチンを
第1の処理とそれとは異なる第2の処理とのいずれかと
する選択手段と、この選択手段に選択情報を与える指示
手段若しくは外部からこの選択手段への選択情報の供給
を可能とする外部端子とを設けてプロセッサを構成する
ものである。That is, there is a selection means for selecting a processing routine for a result of decoding a specific instruction as either a first process or a second process different from the first process, and an instruction means for providing selection information to this selection means, or an external instruction to this selection means. A processor is configured by providing an external terminal that allows selection information to be supplied.
ここで上記第1の処理を非デバッグ処理とし、上記第2
の処理をデバッグ処理とすることができる。Here, the above first process is a non-debug process, and the above second process is a non-debug process.
The processing can be treated as debugging processing.
また、上記特定命令をジャンプ命令とすることができ、
かかる場合に当該ジャンプ命令によって指定されたジャ
ンプ先から少なくとも更に1ネストレベル先の処理ルー
チンを上記デバッグ処理とすることができる。そしてま
た、マイクロ命令アドレスを指定するマイクロアドレス
シーケンサを上記選択手段とすることができる。In addition, the above specific command can be used as a jump command,
In such a case, a processing routine that is at least one nest level ahead from the jump destination specified by the jump instruction can be used as the debugging process. Furthermore, the selection means can also be a microaddress sequencer that specifies a microinstruction address.
上記した手段によれば、上記指示手段により若しくは外
部端子を介して外部より与えられた選択情報に基づいて
、特定命令の解読結果に対する処理ルーチンとして第1
の処理とそれとは異なる第2の処理とのいずれかが選択
可能とされる。このことが、プログラムミスによる命令
実行の無限ル−プからの脱出を容易とする。また、命令
毎にデバッグ例外を発生させるものではなく特定命令に
ついての処理ルーチンの選択的切換えによりデバッグ例
外を発生させるようにすることは、デバッグのリアルタ
イム性を向上させ、更にブレークポイント設定用レジス
タへのブレークポイントの設定を不要としてデバッグ効
率を向上させる。According to the above means, the first processing routine for the decoding result of the specific instruction is executed based on the selection information given from the outside by the instruction means or via the external terminal.
It is possible to select either the process or a second process different from the above process. This makes it easy to escape from an infinite loop of instruction execution caused by a program error. In addition, instead of generating debug exceptions for each instruction, generating debug exceptions by selectively switching the processing routine for a specific instruction improves the real-time performance of debugging, and furthermore, it improves the real-time performance of debugging. Improve debugging efficiency by eliminating the need to set breakpoints.
第2図には本発明の一実施例であるマイクロコンピュー
タが示される。同図に示されるマイクロコンピュータは
、特に制限されないが、公知の半導体集積回路製造技術
により単結晶シリコンなどの一つの半導体基板に形成さ
れる。FIG. 2 shows a microcomputer which is an embodiment of the present invention. The microcomputer shown in the figure is formed on a single semiconductor substrate, such as single crystal silicon, by a known semiconductor integrated circuit manufacturing technique, although this is not particularly limited.
命令ブリフェッチユニット2は、命令キャッシュメモリ
を内蔵し、命令の実行とは独立して命令のブリフェッチ
を行う。命令キャッシュにヒツトした場合には外部メモ
リへのアクセスは行われない。また分岐命令の高速化の
ため、特に制限されないが、4本の分岐ウィンドウが形
成され、これにヒツトした場合には分岐先命令のフェッ
チが簡略化される。また、外部データ/アドレスバスに
結合された入出力制御ユニット13は、命令やオペラン
ドの出力を制御し、命令デコートユニット5は、フェッ
チされた命令のデコード(解読)を行う。このデコード
結果は、後段の制御ユニット6に渡され、実行ユニット
8が制御される。これによって、フェッチされたオペラ
ンドの処理が行われる。処理されたオペランドは再び入
出力制御ユニット13に転送され、外部メモリにストア
される。また外部メモリへのアクセスはメモリ管理ユニ
ット11による保護条件のチエツクと、アドレス変換を
経て行われる。これは命令実行処理と並行して行われる
ため、性能のオーバヘッドは生じない。The instruction briefetch unit 2 has a built-in instruction cache memory, and performs instruction briefetch independently of instruction execution. If the instruction cache is hit, no external memory is accessed. Furthermore, in order to speed up branch instructions, four branch windows are formed, although this is not particularly limited, and when a hit occurs in one of the four branch windows, fetching of the branch destination instruction is simplified. Further, an input/output control unit 13 coupled to the external data/address bus controls the output of instructions and operands, and an instruction decode unit 5 decodes fetched instructions. This decoding result is passed to the subsequent control unit 6, and the execution unit 8 is controlled. This causes the fetched operand to be processed. The processed operands are transferred again to the input/output control unit 13 and stored in external memory. Furthermore, access to the external memory is performed through checking of protection conditions and address conversion by the memory management unit 11. Since this is performed in parallel with instruction execution processing, no performance overhead occurs.
第1図には、第2図に示されるマイクロコンピュータの
主要部の更に詳細な構成が示される。FIG. 1 shows a more detailed configuration of the main parts of the microcomputer shown in FIG. 2.
命令デコードユニット5は、上記入出力制御ユニット1
3から転送された命令を保持する命令レジスタ5Aと、
この命令レジスタ5Aの保持出力をデコードする命令デ
コーダ5Bとを含む。この命令デコーダ5Bのデコード
出力が、後述するマイクロ命令の先頭アドレスとされる
。The instruction decode unit 5 includes the input/output control unit 1.
an instruction register 5A that holds the instructions transferred from 3;
It also includes an instruction decoder 5B that decodes the output held by the instruction register 5A. The decoded output of this instruction decoder 5B is used as the start address of a microinstruction to be described later.
制御ユニット6は、マイクロプログラムを格納するマイ
クロプログラムROM (リード・オンリ・メモリ)6
Bと、このROM6Bのマイクロ命令アドレスを指定す
るマイクロアドレスシーケンサ6Aと、上記マイクロプ
ログラムROM6Bより読出されたマイクロ命令6Cを
デコードするマイクロ命令デコーダ6Dとを含む。そし
てこのデコーダ6Dのデコード出力は制御信号6Eとし
て各部に供給され、また直前に読出されたマイクロ命令
に含まれるネクストマイクロアドレス情報は上記マイク
ロアドレスシーケンサ6Aに取込まれる。The control unit 6 includes a microprogram ROM (read-only memory) 6 that stores microprograms.
B, a micro-address sequencer 6A that specifies the micro-instruction address of this ROM 6B, and a micro-instruction decoder 6D that decodes the micro-instruction 6C read out from the micro-program ROM 6B. The decoded output of the decoder 6D is supplied to each section as a control signal 6E, and the next microaddress information included in the microinstruction read immediately before is taken into the microaddress sequencer 6A.
すなわちこのマイクロアドレスシーケンサ6Aは、上記
命令デコーダ5Bからのマイクロ命令の先頭アドレスと
上記デコーダ6Dからのネクストマイクロアドレス情報
とに基・づいてマイクロプログラムROM6B内から一
連のマイクロ命令を読出す。That is, the microaddress sequencer 6A reads a series of microinstructions from the microprogram ROM 6B based on the start address of the microinstruction from the instruction decoder 5B and the next microaddress information from the decoder 6D.
そしてこのマイクロアドレスシーケンサ6Aにおいては
、特定命令の解読結果に対する処理ルーチンを第1の処
理とそれとは異なる第2の処理とのいずれかとする選択
機能が備えられ、この選択機能はマイクロプログラムR
OM6Bの読出しアドレス制御によって実現される。特
に制限されないが、上記特定命令はJSR(ジャンプサ
ブルーチン)命令とされ、第1の処理は非デバッグ処理
とされ、第2の処理はデバッグ処理どされる。ここにい
う非デバッグ処理はJSR命令の本来の処理とされ、デ
バッグ処理は後に詳述するデバッグのための例外処理と
される。また、このマイクロアドレスシーケンサ6Aに
よって第1の処理(非デバッグ処理)が選択されるか、
第2の処理(例外処理)が選択されるかは後述するレジ
スタブロック8A内の状態フラグレジスタ8Bの状態に
よって決定される。すなわち、本実施例において状態フ
ラグレジスタ8Bの状態が、上記第1.第2の処理の選
択情報とされる。特に制限されないが、状態フラグがd
i Ot+の場合に非デバッグ処理が選択され、1”の
場合にデバッグ処理が選択される。The microaddress sequencer 6A is provided with a selection function for selecting a processing routine for a result of decoding a specific instruction as either a first process or a second process different from the first process.
This is realized by the read address control of OM6B. Although not particularly limited, the specific instruction is a JSR (jump subroutine) instruction, the first process is a non-debug process, and the second process is a debug process. The non-debug processing referred to herein is the original processing of the JSR instruction, and the debug processing is defined as exception processing for debugging, which will be described in detail later. Also, whether the first process (non-debug process) is selected by this microaddress sequencer 6A,
Whether the second process (exception process) is selected is determined by the state of a status flag register 8B in a register block 8A, which will be described later. That is, in this embodiment, the state of the state flag register 8B is the above-mentioned first. This is used as selection information for the second process. There is no particular restriction, but if the status flag is d
When i Ot+, non-debug processing is selected, and when it is 1'', debug processing is selected.
実行ユニット8は、複数のレジスタより成るレジスタブ
ロック8Aと、ALU (算術論理演算ユニット)を含
む演算器ブロック8Cとを有し、それらは内部バス17
に結合され、当該内部バス17に結合された他ブロック
との間でデータのやりとりが可能とされる。The execution unit 8 has a register block 8A consisting of a plurality of registers and an arithmetic unit block 8C including an ALU (arithmetic logic unit), which are connected to an internal bus 17.
It is possible to exchange data with other blocks connected to the internal bus 17.
ここで、本発明における命令実行制御部は上記制御ユニ
ット6と実行ユニット8とによって構成される。Here, the instruction execution control section in the present invention is constituted by the control unit 6 and the execution unit 8.
第3図及び第4図には、本実施例プロセッサで実行され
るアプリケーションの一例が示される。3 and 4 show an example of an application executed by the processor of this embodiment.
状態フラグレジスタ8Bのフラグ状態がt O+″の場
合、それは通常状態とされ、JSR命令のフェッチによ
って当該命令本来の処理が行われる。When the flag state of the state flag register 8B is t O+'', it is set to the normal state, and the original processing of the JSR instruction is performed by fetching the JSR instruction.
すなわち、フラグ状態がIt OIIの場合、シーケン
サ6Aによって読出されるマイクロ命令によれば、先ず
レジスタブロック8A内のプログラムカウンタPCの値
が同ブロック8A内のスタックポインタSPに退避され
、サブルーチンアドレスdがプログラムカウンタPCに
入れられる。これによりメインルーチンからサブルーチ
ンに移行される。That is, when the flag state is It OII, according to the microinstruction read by the sequencer 6A, the value of the program counter PC in the register block 8A is first saved to the stack pointer SP in the same block 8A, and the subroutine address d is It is entered into the program counter PC. This causes a transition from the main routine to the subroutine.
一方、状態フラグレジスタ8Bのフラグ状態がII I
IIの場合、それはデバッグ状態とされ、JSR命令
のフェッチによってデバッグ処理が行われる。すなわち
、フラグ状態が11111の場合、プログラムカウンタ
PCの値がスタックポインタSPに退避され、更にサブ
ルーチンアドレスdがスタックポインタSPに退避され
、デバッグ例外アドレスVがプログラムカウンタPCに
入れられる。On the other hand, the flag state of the state flag register 8B is II I
In case of II, it is placed in a debug state and debug processing is performed by fetching JSR instructions. That is, when the flag state is 11111, the value of the program counter PC is saved to the stack pointer SP, the subroutine address d is saved to the stack pointer SP, and the debug exception address V is placed to the program counter PC.
これによりメインルーチンからデバッグ例外処理に移行
され、所定の例外処理の後にサブルーチン処理に移行さ
れ、しかる後にメインルーチンに戻される。つまりデバ
ッグ例外処理はJSR命令によって指定されたジャンプ
先から1ネストレベル先の処理ルーチンとされる。勿論
設定の仕方によっては、2ネストレベル以上先の処理ル
ーチンとすることも可能である。As a result, the main routine is moved to debug exception handling, and after predetermined exception handling, the process is moved to subroutine processing, and then the main routine is returned. In other words, debug exception handling is performed as a processing routine one nest level ahead from the jump destination specified by the JSR instruction. Of course, depending on how the settings are made, it is also possible to set the processing routine to be two or more nest levels ahead.
第5図には上記デバッグ例外処理ルーチンの一例が示さ
れる。FIG. 5 shows an example of the debug exception handling routine.
デバッグ例外ベクタによりデバッガの処理プログラムに
移行される。先ずユーザレジスタの内容が退避され(ス
テップ5TI)、ユーザプログラム停止時の状態が表示
(ブレーク表示)される(ステップ5T2)、そしてデ
バッガコマンドが入力され(ステップ5T3) 、当該
コマンドの解析が行われる(ステップST4.ST7,
5T9)。すなわちユーザプログラム再実行か否かの判
別が行われ(ステップ5T4)、この判別において再実
行ではない′N”と判断された場合にはメモリ表示か否
かの判別が行われ(ステップ5T7)、この判別におい
てメモリ表示ではない“N′″と判断された場合にはメ
モリ変更か否かの判別が行われ(ステップ5T9) 、
この判別においてメモリ変更ではないIIN”と判断さ
れた場合には更に他の判別が行われ、このようにしてデ
バッガコマンドの解析が行われる。そして上記ステップ
ST4の判別において再実行であるIIY”と判断され
た場合にはユーザプログラム再実行のための状態設定が
行われ(ステップ5T5)、上記ステップST1で退避
されたユーザレジスタの内容が回復され(ステップ5T
6)、当該デバッガプログラムの実行が終了される。ま
た、上記ステップST7の判別においてメモリ表示であ
る# Y IIと判断された場合にはメモリの内容表示
処理が行われ(ステップ5T8) 、更に上記ステップ
ST9の判別においてメモリ変更であるII Y jj
と判断された場合にはメモリ変更処理が行われ(ステッ
プ5T10)、しかる後に上記ステップST3の入力が
行われる。Transferred to the debugger processing program by the debug exception vector. First, the contents of the user register are saved (step 5TI), the state when the user program is stopped is displayed (break display) (step 5T2), a debugger command is input (step 5T3), and the command is analyzed. (Step ST4.ST7,
5T9). That is, it is determined whether or not to re-execute the user program (step 5T4), and if it is determined in this determination that it is not re-execution, it is determined whether or not memory display is to be performed (step 5T7). In this determination, if it is determined that "N'" is not a memory display, a determination is made as to whether or not the memory is to be changed (step 5T9).
In this case, if it is determined that "IIN" is not a memory change, another determination is made, and the debugger command is analyzed in this way.Then, in the determination in step ST4 above, "IIY" is a re-execution. If it is determined, the state setting for re-execution of the user program is performed (step 5T5), and the contents of the user register saved in step ST1 are restored (step 5T).
6), execution of the debugger program is ended. Further, if it is determined in the determination in step ST7 that the memory display is #Y II, memory contents display processing is performed (step 5T8), and further, in the determination in the step ST9 above, II Y jj that is memory change is determined.
If it is determined that this is the case, a memory change process is performed (step 5T10), and then the input in step ST3 is performed.
本実施例によれば以下の作用効果を得ることができる。According to this embodiment, the following effects can be obtained.
(1)状態レジスタ8Bのフラグ状態によって、特定命
令の解読結果に対する処理ルーチンを非デバッグ処理か
らデバッグ処理に変更することができ、従来のステップ
トレースのように命令毎にデバッグ例外処理を発生させ
るものではないから、デバッグのリアルタイム性を向上
させることができる。(1) Depending on the flag state of the status register 8B, the processing routine for the decoding result of a specific instruction can be changed from non-debug processing to debug processing, and debug exception handling is generated for each instruction like the conventional step trace. Therefore, the real-time performance of debugging can be improved.
(2)また上記実施例におけるデバッグ処理では従来の
セルフデバッグ機能の場合のように所定のレジスタにブ
レークポイントの設定を行う必要がなく、デバッグ対象
プログラムの規模が大きい場合でもレジスタとの関係で
ブレークポイント数が制限されることがないから、有効
なデバッグ機能とされる。(2) Furthermore, in the debugging process in the above embodiment, there is no need to set breakpoints in predetermined registers as in the case of conventional self-debugging functions, and even if the scale of the program to be debugged is large, breakpoints can be broken in relation to registers. Since the number of points is not limited, it is considered an effective debugging function.
(3)上記(1)、(2)の作用効果により、デバッグ
専用のハードウェア(エミュレータ)が存在しない場合
でも、デバッグ対象プログラムのデバッグを効率良く行
うことができる。(3) Due to the effects of (1) and (2) above, it is possible to efficiently debug a program to be debugged even if there is no hardware (emulator) dedicated to debugging.
以上本発明者によってなされた発明を実施例に基づいて
具体的に説明したが、本発明は上記実施例に限定されず
、その要旨を逸脱しない範囲において種々変更可能であ
る。Although the invention made by the present inventor has been specifically explained based on the examples above, the present invention is not limited to the above-mentioned examples, and can be variously modified without departing from the gist thereof.
例えば上記実施例では特定命令をJSR命令として説明
したが、このJSR命令に代えてRTS(リターンサブ
ルーチン)命令やその他の命令を使用することができる
。特に条件分岐命令を使用する場合において、この条件
分岐命令の処理ルーチンを状態フラグの状態によってサ
ブルーヂンジャンプ(JSR)命令と同様の処理に移行
可能とする場合には、通常動作状態においてプログラム
ミスによって無限ループ状態になった場合でも状態フラ
グ設定によりJSR命令実行と同様の処理に移行させる
ことで当該無限ループから容易に脱出することができる
。For example, in the above embodiment, the specific instruction is described as a JSR instruction, but an RTS (return subroutine) instruction or other instructions may be used instead of the JSR instruction. In particular, when using a conditional branch instruction, if the processing routine of this conditional branch instruction can be transitioned to processing similar to a subroutine jump (JSR) instruction depending on the state of the status flag, it is necessary to Even in the case of an infinite loop, it is possible to easily escape from the infinite loop by setting the status flag and transitioning to processing similar to JSR instruction execution.
また、上記実施例では状態フラグレジスタ8Bにフラグ
設定を行うようにしたが、プロセッサの外部端子を利用
して処理ルーチンの選択情報を外部より与えるようにす
ることもできる。この場合状態フラグレジスタ8Bは不
要とされる。Further, in the above embodiment, the flag is set in the status flag register 8B, but the selection information of the processing routine may also be given from the outside using an external terminal of the processor. In this case, the status flag register 8B is unnecessary.
また、特定命令の解読結果に対する処理ルーチン選択は
、プロセッサのテスティングや自己エラー検出などにも
利用することができる。Furthermore, selection of a processing routine based on the result of decoding a specific instruction can be used for testing the processor, self-error detection, and the like.
例えばNOP (無効)命令が処理ルーチン選択によっ
てソフトウェア割込み命令に変わるようにしても有効で
あるし、プロセッサ命令のデバッグ処理として、実際に
コプロセッサが使用される場合にはコプロセッサ命令と
して機能するが、それが存在しない場合にはデバッグル
ーチンをコールする命令とされるようにしても有効であ
る。For example, it would be effective to change the NOP (invalid) instruction to a software interrupt instruction by selecting a processing routine, or it would function as a coprocessor instruction when a coprocessor is actually used for debugging processor instructions. , it is also effective to make it an instruction to call a debug routine if it does not exist.
以上の説明では主として本発明者によってなされた発明
をシングルチップマイクロコンピュータに適用した場合
について説明したが、本発明はそれに限定されるもので
はなく、シングルボードに形成されたマイクロコンピュ
ータにも適用することができる。本発明は少なくとも解
読された命令を実行する命令実行制御部を備える条件の
ものに適用することができる。In the above explanation, the invention made by the present inventor was mainly applied to a single-chip microcomputer, but the present invention is not limited thereto, and can also be applied to a microcomputer formed on a single board. I can do it. The present invention can be applied to at least a device equipped with an instruction execution control unit that executes decoded instructions.
本願において開示される発明のち代表的なものによって
得られる効果を簡単に説明すれば下記の通りである。A brief explanation of the effects obtained by the typical inventions disclosed in this application is as follows.
すなわち、指示手段により若しくは外部端子を介して外
部より与えられた選択情報に基づいて、デバッグ対象プ
ログラムを変更することなく、特定命令の解読結果に対
する処理ルーチンを第1の処理とこれとは異なる第2の
処理とに切換えることができるので、デバッグにおいて
無限ループからの脱出を容易とし、また、命令毎にデバ
ッグ例外処理を発生させるものではないのでデバッグの
リアルタイム性に優れ、そしてブレークポイント設定用
レジスタへのブレークポイント設定を不要とすることに
より、デバッグ対象プログラムの規模が大きい場合でも
当該レジスタとの関係でブレークポイント数が制限され
ることがない。これにより、デバッグ専用のハードウェ
アを用いなくともデバッグ効率を向上させることができ
る。That is, based on selection information externally provided by an instruction means or via an external terminal, the processing routine for the decoding result of a specific instruction can be divided into a first processing and a different processing routine, without changing the program to be debugged. 2, it is easy to escape from an infinite loop during debugging. Also, since debug exception handling is not generated for each instruction, debugging can be performed in real time, and breakpoint setting registers are By eliminating the need to set breakpoints in registers, even if the program to be debugged is large in size, the number of breakpoints is not limited by the relationship with the registers. Thereby, debugging efficiency can be improved without using hardware dedicated to debugging.
第1図は本発明の一実施例マイクロコンピュータの主要
部構成ブロック図、
第2図は本発明に係るマイクロコンピュータの一実施例
ブロック図、
第3図及び第4図は本実施例マイクロコンピュータで実
行されるアプリケーションの一例の説明図、
第5図は上記アプリケーションにおけるデバッグ例外処
理の一例を示すフローチャートである。
1・・・マイクロコンピュータ、2・・・命令ブリフェ
ッチユニット、5・・・命令デコードユニット、5A・
・・命令レジスタ、5B・・・命令デコーダ、6・・・
制御ユニット、6A・・・マイクロアドレスシーケンサ
、6B・・・マイクロプログラムROM、6D・・マイ
クロ命令デコーダ、8・・・実行ユニット、8A・・・
レジスタブロック、8B・・・状態フラグレジスタ、8
C・・・演算器ブロック、13・・・入出力制御ユニッ
ト。FIG. 1 is a block diagram of the main parts of a microcomputer according to an embodiment of the present invention, FIG. 2 is a block diagram of an embodiment of a microcomputer according to the present invention, and FIGS. 3 and 4 are diagrams showing a microcomputer according to an embodiment of the present invention. An explanatory diagram of an example of an application to be executed. FIG. 5 is a flowchart showing an example of debug exception handling in the above application. DESCRIPTION OF SYMBOLS 1... Microcomputer, 2... Instruction brief fetch unit, 5... Instruction decode unit, 5A.
...Instruction register, 5B...Instruction decoder, 6...
Control unit, 6A...Micro address sequencer, 6B...Micro program ROM, 6D...Micro instruction decoder, 8...Execution unit, 8A...
Register block, 8B...Status flag register, 8
C... Arithmetic unit block, 13... Input/output control unit.
Claims (1)
命令実行制御部を含むプロセッサにおいて、上記命令実
行制御部は、特定命令の解読結果に対する処理ルーチン
を第1の処理とそれとは異なる第2の処理とのいずれか
とする選択手段と、この選択手段に選択情報を与える指
示手段とを含むことを特徴とするプロセッサ。 2、命令を解読し、これに従って当該命令を実行させる
命令実行制御部を含むプロセッサにおいて、上記命令実
行制御部は、特定命令の解読結果に対する処理ルーチン
を第1の処理とそれとは異なる第2の処理とのいずれか
とする選択手段と、外部からこの選択手段への選択情報
の供給を可能とする外部端子とを含むことを特徴とする
プロセッサ。 3、上記第1の処理を非デバッグ処理とし、上記第2の
処理をデバッグ処理とした請求項1又は2記載のプロセ
ッサ。 4、上記特定命令はジャンプ命令であり、上記デバッグ
処理はこのジャンプ命令によって指定されたジャンプ先
から少なくとも更に1ネストレベル先の処理ルーチンと
される請求項1,2又は3記載のプロセッサ。 5、上記選択手段は、マイクロ命令アドレスを指定する
マイクロアドレスシーケンサとされる請求項1,2,3
又は4記載のプロセッサ。[Scope of Claims] 1. In a processor including an instruction execution control unit that decodes an instruction and executes the instruction in accordance with the instruction, the instruction execution control unit performs a processing routine for a result of decoding a specific instruction as a first process. A processor characterized by comprising: selection means for performing a second process different from the second process; and instruction means for providing selection information to the selection means. 2. In a processor including an instruction execution control unit that decodes an instruction and executes the instruction in accordance with the instruction, the instruction execution control unit divides a processing routine for the decoding result of a specific instruction into a first process and a second process different from the first process. 1. A processor comprising: selection means for either processing; and an external terminal that allows selection information to be supplied from the outside to the selection means. 3. The processor according to claim 1 or 2, wherein the first process is a non-debug process and the second process is a debug process. 4. The processor according to claim 1, 2 or 3, wherein the specific instruction is a jump instruction, and the debugging process is a processing routine at least one nest level beyond the jump destination specified by the jump instruction. 5. Claims 1, 2, and 3, wherein the selection means is a microaddress sequencer that specifies a microinstruction address.
or the processor according to 4.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2164102A JPH0454636A (en) | 1990-06-25 | 1990-06-25 | processor |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2164102A JPH0454636A (en) | 1990-06-25 | 1990-06-25 | processor |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0454636A true JPH0454636A (en) | 1992-02-21 |
Family
ID=15786799
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2164102A Pending JPH0454636A (en) | 1990-06-25 | 1990-06-25 | processor |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0454636A (en) |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH06161822A (en) * | 1992-11-20 | 1994-06-10 | Mitsubishi Electric Corp | Microprocessor |
| JPH08263324A (en) * | 1995-03-22 | 1996-10-11 | Nec Ibaraki Ltd | Debug facilitation device |
| US7062684B2 (en) | 2002-12-19 | 2006-06-13 | International Business Machines Corporation | Enabling tracing of a repeat instruction |
| JP2006350676A (en) * | 2005-06-16 | 2006-12-28 | Hitachi Software Eng Co Ltd | Program debugging method of built-in system |
| JP2007004516A (en) * | 2005-06-24 | 2007-01-11 | Hitachi Software Eng Co Ltd | Program debugging method of built-in system |
| WO2012147168A1 (en) * | 2011-04-26 | 2012-11-01 | 富士通株式会社 | System and detection method |
-
1990
- 1990-06-25 JP JP2164102A patent/JPH0454636A/en active Pending
Cited By (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH06161822A (en) * | 1992-11-20 | 1994-06-10 | Mitsubishi Electric Corp | Microprocessor |
| JPH08263324A (en) * | 1995-03-22 | 1996-10-11 | Nec Ibaraki Ltd | Debug facilitation device |
| US7062684B2 (en) | 2002-12-19 | 2006-06-13 | International Business Machines Corporation | Enabling tracing of a repeat instruction |
| JP2006350676A (en) * | 2005-06-16 | 2006-12-28 | Hitachi Software Eng Co Ltd | Program debugging method of built-in system |
| JP2007004516A (en) * | 2005-06-24 | 2007-01-11 | Hitachi Software Eng Co Ltd | Program debugging method of built-in system |
| WO2012147168A1 (en) * | 2011-04-26 | 2012-11-01 | 富士通株式会社 | System and detection method |
| CN103493023A (en) * | 2011-04-26 | 2014-01-01 | 富士通株式会社 | System and detection method |
| JP5725169B2 (en) * | 2011-04-26 | 2015-05-27 | 富士通株式会社 | System and detection method |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Yiu | The definitive guide to the ARM Cortex-M3 | |
| JP6507435B2 (en) | Instruction emulation processor, method, and system | |
| US5740413A (en) | Method and apparatus for providing address breakpoints, branch breakpoints, and single stepping | |
| US5530804A (en) | Superscalar processor with plural pipelined execution units each unit selectively having both normal and debug modes | |
| CN100483336C (en) | Predication instruction within a data processing system | |
| US5838897A (en) | Debugging a processor using data output during idle bus cycles | |
| US5388233A (en) | Method and apparatus for counting instruction types using bit masks and a programmable bit map | |
| JP6508851B2 (en) | Avoid early enablement of non-maskable interrupts when returning from an exception | |
| EP0313848A2 (en) | Data processor with development support features | |
| US20050257089A1 (en) | Breakpoint logic unit, debug logic and breakpoint method for a data processing apparatus | |
| US20040030870A1 (en) | Software breakpoints with tailoring for multiple processor shared memory or multiple thread systems | |
| JP2002512399A (en) | RISC processor with context switch register set accessible by external coprocessor | |
| CN103119566A (en) | Debugging of a data processing apparatus | |
| JPH03158928A (en) | Data processor | |
| US5410660A (en) | System and method for executing branch on bit set/clear instructions using microprogramming flow | |
| JPH0454636A (en) | processor | |
| US5761492A (en) | Method and apparatus for uniform and efficient handling of multiple precise events in a processor by including event commands in the instruction set | |
| JP3716604B2 (en) | Information processing device | |
| JP2710994B2 (en) | Data processing device | |
| US6772372B2 (en) | System and method for monitoring unaligned memory accesses | |
| JPH04359323A (en) | Microcomputer | |
| JPH06103109A (en) | Data processor and debug device using the same | |
| Utting et al. | Pipeline specification of a MIPS R3000 CPU | |
| CN114168193B (en) | An instruction processing method, apparatus, system, and intelligent device | |
| Vranken | Debug facilities in the TriMedia CPU64 architecture |