JP2007026084A - Microprocessor - Google Patents

Microprocessor Download PDF

Info

Publication number
JP2007026084A
JP2007026084A JP2005207177A JP2005207177A JP2007026084A JP 2007026084 A JP2007026084 A JP 2007026084A JP 2005207177 A JP2005207177 A JP 2005207177A JP 2005207177 A JP2005207177 A JP 2005207177A JP 2007026084 A JP2007026084 A JP 2007026084A
Authority
JP
Japan
Prior art keywords
microprocessor
debug
program
asr
interrupt
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
JP2005207177A
Other languages
Japanese (ja)
Inventor
Masayuki Kodama
征之 兒玉
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.)
Renesas Technology Corp
Original Assignee
Renesas Technology 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 Renesas Technology Corp filed Critical Renesas Technology Corp
Priority to JP2005207177A priority Critical patent/JP2007026084A/en
Publication of JP2007026084A publication Critical patent/JP2007026084A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Microcomputers (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To make it possible for a program which performs real time processing using interruption by discontinuing a debug mode to use a brake function in a transient state to the debug mode by using the brake function. <P>SOLUTION: A microprocessor is provided with an ASR register 2 having bits showing that a debug mode has been discontinued and that interruption has been accepted and bits showing the state of a debug exclusive resource inside a processor, and configured to retreat and restore from/to the debug program. Also, the content of the ASR register 2 is written in an ASE-RAM 7 as a stack so that it is possible to perform multiplex discontinuation of the debug mode, and to accept the interruption. Thus, it is possible even for a user program started by discontinuing the debug software and accepting interruption to use a brake function. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、ユーザシステム上で動作するソフトウェアの開発支援のためのエミュレーション技術、そのエミュレーションを可能とするシステムLSIもしくはマイクロプロセッサ、及びそれらを含むエミュレータに適用して有効な技術に関する。   The present invention relates to an emulation technology for supporting development of software that operates on a user system, a system LSI or a microprocessor that enables the emulation, and a technology that is effective when applied to an emulator including them.

本発明者が検討した技術として、例えば、マイクロプロセッサ等のエミュレーション技術においては、以下の技術が考えられる。   As technologies studied by the present inventor, for example, the following technologies are conceivable in an emulation technology such as a microprocessor.

システムLSIもしくはマイクロプロセッサ応用機器の開発において、その応用システム(ユーザシステム)のデバッグやそのシステムの詳細な評価を行うため、エミュレータが使用されている。このエミュレータは、開発中のユーザシステムに接続されて、その詳細なシステムデバッグを支援するものである。   In the development of system LSI or microprocessor application equipment, an emulator is used to debug the application system (user system) and perform detailed evaluation of the system. This emulator is connected to a user system under development and supports detailed system debugging.

ユーザシステムのデバッグにおいて、所定の条件が成立した場合にユーザプログラムの実行を停止(ブレーク)する機能は、エミュレータの基本機能の一つとされる。   In the debugging of the user system, the function of stopping (breaking) execution of the user program when a predetermined condition is satisfied is one of the basic functions of the emulator.

ユーザプログラム実行中にブレーク命令またはブレーク信号がマイクロプロセッサに入力されると、ユーザプログラムモードからデバッグモードに遷移される。この機能を用いてユーザプログラムのブレーク機能が実現される。   When a break instruction or a break signal is input to the microprocessor during execution of the user program, a transition is made from the user program mode to the debug mode. A break function of the user program is realized using this function.

ユーザプログラムの特定アドレスの命令がブレーク命令に置き換えられたり、アドレスバスやデータバスの状態が特定条件に一致したことによりブレーク信号が生成されたりすると、それを受けて、制御がユーザプログラムモードからデバッグモードに遷移される。制御がデバッグモードに遷移されると、デバッグプログラムが動作してレジスタやメモリの内容表示や、デバッグを行っているプログラマによるエミュレータを介したレジスタやメモリの内容変更などの操作が行われる。   When an instruction at a specific address in the user program is replaced with a break instruction, or when a break signal is generated when the address bus or data bus state matches a specific condition, control is debugged from the user program mode. Transition to mode. When the control shifts to the debug mode, the debug program operates to display the contents of the registers and memories, and the operations such as changing the contents of the registers and memories through the emulator by the programmer performing debugging.

このとき、ユーザプログラムの実行は停止しているが、デバッグを行っているプログラマのエミュレータ操作と連動してユーザプログラムの実行再開を行うため、割込み応答時間として要求される時間(通常は数十マイクロ秒)と比べ、非常に長い時間、割込み処理を行うことができない。そのため、機器制御などのリアルタイム処理を必要とするシステムでは、デバッグ効率を著しく低下させる恐れがある。   At this time, the execution of the user program is stopped, but the execution of the user program is resumed in conjunction with the emulator operation of the programmer who is debugging, so the time required for the interrupt response time (usually several tens of microseconds) Interrupt processing cannot be performed for a very long time compared to (second). Therefore, in a system that requires real-time processing such as device control, there is a risk that debugging efficiency may be significantly reduced.

この問題に対し、特許文献1では、デバッグプログラムが中断したことを示す信号を用意し、当該信号が“1”の時、割込からの復帰命令を実行した場合、デバッグモードへ復帰する方式で解決が図られている。   To solve this problem, Patent Document 1 prepares a signal indicating that the debug program has been interrupted. When the signal is “1”, when a return instruction from an interrupt is executed, the method returns to debug mode. A solution is being made.

また同様に、特許文献2では、デバッグプログラム実行中に割込みを検出した場合、デバッグプログラムにより、割込みの種類に対応したユーザ指定のアドレスをテーブルから検索し、ブレークからの復帰命令で割込みハンドラへ直接分岐し、割込みからの復帰命令にブレークを設定し、再度デバッグプログラムへ復帰する方式で解決が図られている。   Similarly, in Patent Document 2, when an interrupt is detected during execution of a debug program, the debug program searches the table for a user-specified address corresponding to the type of interrupt, and directly returns to the interrupt handler with a return instruction from a break. The problem is solved by branching, setting a break in the return instruction from the interrupt, and returning to the debug program again.

また、ユーザシステムのデバッグにおいて、バスに流れるアドレスやデータ、もしくはユーザプログラムの分岐元、分岐先アドレスを取り出し、所定のメモリもしくはピンを使用して外部に出力する(トレース)する機能は、前記ブレーク機能と並び、エミュレータの基本機能の一つとされる。   In the debugging of the user system, the address and data flowing on the bus or the branch source and branch destination addresses of the user program are taken out and output (traced) to the outside using a predetermined memory or pin. Along with the functions, it is one of the basic functions of the emulator.

このトレース機能により、ユーザプログラム実行中に、マイクロプロセッサから、バスに接続されたメモリや他のIPへのロード、ストアに対するアドレスやデータ、もしくはマイクロプロセッサの実行するユーザプログラム内の分岐命令に対する分岐元アドレスや分岐先アドレスを、ユーザプログラムの実行を停止させることなく取り出すことができる。このように取り出した情報(トレースデータという)は、所定のメモリもしくはピンを介して外部へ取り出され、デバッグを行っているプログラマが確認することができる。
特開平11−143732号公報 特開2000−148529号公報
With this trace function, during execution of a user program, a branch source for a load from a microprocessor to a memory or other IP connected to the bus, an address or data for a store, or a branch instruction in a user program executed by the microprocessor The address and branch destination address can be taken out without stopping execution of the user program. Information thus extracted (referred to as trace data) is extracted to the outside via a predetermined memory or pin, and can be confirmed by a programmer performing debugging.
Japanese Patent Laid-Open No. 11-143732 JP 2000-148529 A

ところで、前記のようなマイクロプロセッサ等のエミュレーション技術について、本発明者が検討した結果、以下のようなことが明らかとなった。   By the way, as a result of the study of the emulation technology such as the microprocessor as described above, the following has been clarified.

ブレーク機能によるユーザプログラムの停止は、トレース機能では不可能なマイクロプロセッサ内部のレジスタなどの内容表示や変更を可能とするが、機器制御などの割込みを利用したリアルタイム処理を不可能にする。   Stopping the user program by the break function enables the display and change of the contents of registers in the microprocessor, which is impossible with the trace function, but disables real-time processing using interrupts such as device control.

これに対し、前記特許文献1、特許文献2のようにデバッグモードを中断し、割込みを利用したリアルタイム処理を可能とする方法が挙げられる。この方法では、デバッグモード中であっても例外的にリアルタイム処理を可能とするが、ブレーク機能で停止させているユーザプログラム1で使用するデバイスやメモリ領域と、リアルタイム処理として実行されるユーザプログラム2で使用するデバイスやメモリ領域に共通部分がある場合、ユーザプログラム2が実行されることにより、ユーザプログラム1で使用するデバイスやメモリ領域の状態が変化してしまうことがある。そのため、ユーザプログラム1のデバッグが不可能となる場合がある。   On the other hand, there is a method of interrupting the debug mode and enabling real-time processing using an interrupt as in Patent Document 1 and Patent Document 2. In this method, real-time processing is exceptionally possible even in the debug mode, but the device and memory area used by the user program 1 stopped by the break function and the user program 2 executed as real-time processing When there is a common part in the device and memory area used in the above, the state of the device and memory area used in the user program 1 may change when the user program 2 is executed. For this reason, the user program 1 may not be debugged.

そこで、ユーザプログラム2にブレーク機能を使ってデバッグすることを考えた場合、ユーザプログラム2を実行中のプロセッサ内部のレジスタなどの内容表示や変更は可能となるが、ユーザプログラム2をブレークにより長時間停止することになるため、リアルタイム処理ではなくなってしまう。また、ユーザプログラム1に対してブレーク機能を使用している状態で、ユーザプログラム2に対するブレーク機能を使用することになるため、プロセッサ内部のデバッグ専用リソースの状態(ステート)をデバッグプログラムから退避及び復帰可能とする必要がある。   Therefore, when considering debugging the user program 2 using the break function, it is possible to display or change the contents of a register or the like inside the processor that is executing the user program 2, but the user program 2 can be displayed for a long time by the break. Since it will stop, it will not be real-time processing. In addition, since the break function for the user program 2 is used while the break function is being used for the user program 1, the state (state) of the dedicated debugging resource in the processor is saved and restored from the debug program. It needs to be possible.

一方、ユーザプログラム2にトレース機能を使ってデバッグを行う場合、そもそもマイクロプロセッサ内部のレジスタなどの内容表示や変更が行えないため、ブレーク機能が利用可能である場合と比べ、マイクロプロセッサ内部でどのような原因で不具合が発生するか、特定がより難しくなる。   On the other hand, when the user program 2 is debugged using the trace function, the contents of the registers in the microprocessor cannot be displayed or changed in the first place. It becomes difficult to identify whether a problem occurs due to various reasons.

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

本願において開示される発明のうち、代表的なものの概要を簡単に説明すれば、次のとおりである。   Of the inventions disclosed in the present application, the outline of typical ones will be briefly described as follows.

すなわち、本発明によるマイクロプロセッサは、ブレーク機能を使用してデバッグモードへ遷移した状態で、デバッグモードを中断して割込みを利用したリアルタイム処理を行っているプログラムに対して、さらにブレーク機能を使用可能とするため、前記マイクロプロセッサの内部状態を保持・退避可能なレジスタと、前記マイクロプロセッサの内部状態の退避及び復帰に使用されるメモリとを有するものである。   In other words, the microprocessor according to the present invention can further use the break function for a program in which the debug mode is interrupted and the real-time processing using the interrupt is performed after transitioning to the debug mode using the break function. For this reason, a register capable of holding and saving the internal state of the microprocessor and a memory used for saving and restoring the internal state of the microprocessor are provided.

本願において開示される発明のうち、代表的なものによって得られる効果を簡単に説明すれば、以下のとおりである。   Of the inventions disclosed in the present application, effects obtained by typical ones will be briefly described as follows.

デバッグ効率の向上を図ることができる。   The debugging efficiency can be improved.

以下、本発明の実施の形態を図面に基づいて詳細に説明する。なお、実施の形態を説明するための全図において、同一部材には原則として同一の符号を付し、その繰り返しの説明は省略する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. Note that components having the same function are denoted by the same reference symbols throughout the drawings for describing the embodiment, and the repetitive description thereof will be omitted.

以下に述べる本発明の実施の形態1〜3に係るマイクロプロセッサにより、デバッグモードを中断して実行している割込みを利用したリアルタイム処理に対し、デバッグを行っているプログラマが設定する割り込み応答時間の許容範囲内で、自由にブレーク機能を適用可能とし、デバッグ効率の向上を実現した。   By the microprocessor according to the first to third embodiments of the present invention described below, the interrupt response time set by the debugging programmer is set for the real-time processing using the interrupt that is executed while the debug mode is interrupted. The break function can be freely applied within the allowable range, and debugging efficiency has been improved.

(実施の形態1)
図1は、本発明の実施の形態1に係るマイクロプロセッサの構成を示すブロック図である。
(Embodiment 1)
FIG. 1 is a block diagram showing a configuration of a microprocessor according to Embodiment 1 of the present invention.

まず、図1により、本実施の形態1に係るマイクロプロセッサの構成の一例を説明する。本実施の形態1のマイクロプロセッサ10は、例えば、CPU(中央処理装置)コア1、デバッグ制御回路6、ユーザRAM(ランダムアクセスメモリ)8、ASE−RAM(デバッグ専用メモリ)7、BUS(バス)9などから構成されている。また、CPUコア1は、内部ステート制御回路3、モード遷移制御回路4、CPU動作制御回路5、ASR.state(内部ステート)レジスタ80などから構成されている。なお、ユーザRAM8は、図1ではマイクロプロセッサ10に内蔵されているが、外付けにしてもよい。また、マイクロプロセッサ10は、通常は1つのチップで構成されるが、2つ以上の複数のチップで構成してもよい。また、マイクロプロセッサ10はシステムLSIの一部であってもよい。   First, an example of the configuration of the microprocessor according to the first embodiment will be described with reference to FIG. The microprocessor 10 according to the first embodiment includes, for example, a CPU (central processing unit) core 1, a debug control circuit 6, a user RAM (random access memory) 8, an ASE-RAM (debug dedicated memory) 7, and a BUS (bus). 9 or the like. The CPU core 1 includes an internal state control circuit 3, a mode transition control circuit 4, a CPU operation control circuit 5, an ASR. It is composed of a state (internal state) register 80 and the like. The user RAM 8 is built in the microprocessor 10 in FIG. 1, but may be externally attached. In addition, the microprocessor 10 is normally constituted by one chip, but may be constituted by two or more chips. Further, the microprocessor 10 may be a part of the system LSI.

ASR.stateレジスタ80は、マイクロプロセッサ10内部のデバッグ専用リソースのステート(状態)を示すレジスタである。内部ステート制御回路3は、ASR.stateレジスタ80の更新制御を行う回路である。モード遷移制御回路4は、デバッグモードとデバッグモードの中断時の更新制御を行う回路である。CPU動作制御回路5は、入力された割込み要求信号と命令実行の状態とASR.stateレジスタ80の内容から内部ステート制御回路3およびモード遷移制御回路4を動作させる回路である。デバッグ制御回路6は、マイクロプロセッサ10内のデバッグ制御とマイクロプロセッサ10外との通信を行う回路である。ASE−RAM7は、デバッグプログラムでのみ操作可能なデバッグ専用メモリである。ユーザRAM8は、ユーザプログラムおよびデバッグプログラムで操作可能なメモリである。BUS9は、CPUコア1、デバッグ制御回路6、ASE−RAM7、ユーザRAM8とを接続するバスである。   ASR. The state register 80 is a register that indicates the state of the dedicated debug resource inside the microprocessor 10. The internal state control circuit 3 is ASR. This is a circuit for performing update control of the state register 80. The mode transition control circuit 4 is a circuit that performs update control when the debug mode and the debug mode are interrupted. The CPU operation control circuit 5 receives the input interrupt request signal, the instruction execution state, the ASR. This is a circuit for operating the internal state control circuit 3 and the mode transition control circuit 4 from the contents of the state register 80. The debug control circuit 6 is a circuit that performs debug control in the microprocessor 10 and communication with the outside of the microprocessor 10. The ASE-RAM 7 is a debug-dedicated memory that can be operated only by a debug program. The user RAM 8 is a memory that can be operated by a user program and a debug program. The BUS 9 is a bus that connects the CPU core 1, the debug control circuit 6, the ASE-RAM 7, and the user RAM 8.

図2に、ASR.stateレジスタ80を構成するASR.stateビットの制御論理の一例を示す。このASR.stateビットを複数ビット(例えば32ビット)並べることによりASR.stateレジスタ80が構成される。   In FIG. ASR. An example of the control logic of the state bit is shown. This ASR. By arranging a plurality of state bits (for example, 32 bits), ASR. A state register 80 is configured.

図2において、ASR.stateビットに対応するCPUコア内部のデバッグ専用リソースのステートのセット条件を40、リセット時の初期値を41、クリア条件を42、内部ステートを保持するフリップフロップを43とする。また、ASR書き込み信号34が“1”の時、ASR.stateレジスタ80に書き込む値がのったASRデータ信号35の対応する値をフリップフロップ43に書き込む。   In FIG. It is assumed that the debug condition resource setting condition in the CPU core corresponding to the state bit is 40, the reset initial value is 41, the clear condition is 42, and the flip-flop holding the internal state is 43. When the ASR write signal 34 is “1”, ASR. The corresponding value of the ASR data signal 35 with the value to be written in the state register 80 is written in the flip-flop 43.

図3に、本実施の形態1に対応するデバッグプログラムのフローチャートを示す。まず、ステップS94でユーザプログラムを開始し、ステップS90でブレークが発生しているか否かを判定する。ブレークが発生している場合は、ステップS95でスタック待避(ASR.stateレジスタ80の内容をスタックとしてASE−RAM7に書き出す)を行い、ステップS91で割込みを監視しながら、ステップS96でデバッグプログラムを実行する。割込みが発生しない場合は、デバッグプログラムが終了するまで実行し(ステップS96〜S97)、ステップS98でスタック復帰(ASE−RAM7の内容をスタックとしてASRレジスタ2に書き戻す)を行った後、ユーザプログラムに復帰する。   FIG. 3 shows a flowchart of the debug program corresponding to the first embodiment. First, a user program is started at step S94, and it is determined whether a break has occurred at step S90. If a break has occurred, the stack is saved in step S95 (the contents of the ASR.state register 80 are written to the ASE-RAM 7 as a stack), the interrupt is monitored in step S91, and the debug program is executed in step S96. To do. If no interrupt occurs, the program is executed until the debug program is finished (steps S96 to S97), and after returning to the stack in step S98 (the contents of the ASE-RAM 7 are written back to the ASR register 2 as a stack), the user program is executed. Return to.

また、ステップS91で割込みを受理した場合は、ステップS92で割込みハンドラへ分岐して割込み処理用ユーザプログラムに分岐する。また、ユーザプログラムからデバッグプログラムへの復帰はステップS93で割込みから復帰する命令(RTE命令)の復帰先がデバッグプログラムかどうかを判定することで行う。   If an interrupt is accepted in step S91, the process branches to the interrupt handler in step S92 and branches to the interrupt processing user program. The return from the user program to the debug program is performed by determining whether the return destination of the instruction (RTE instruction) that returns from the interrupt is the debug program in step S93.

以上のような回路とデバッグプログラムの組み合わせで、デバッグモードを中断して実行している割込みを利用したユーザプログラムに対し、自由にブレーク機能が適用可能となる。   With the combination of the circuit and the debug program as described above, the break function can be freely applied to the user program that uses the interrupt executed by interrupting the debug mode.

(実施の形態2)
図4は本発明の実施の形態2に係るマイクロプロセッサの構成を示すブロック図である。
(Embodiment 2)
FIG. 4 is a block diagram showing a configuration of a microprocessor according to Embodiment 2 of the present invention.

まず、図4により、本実施の形態2に係るマイクロプロセッサ10aの構成の一例を説明する。本実施の形態のマイクロプロセッサ10aは、例えば、前記実施の形態1のマイクロプロセッサ10にブレーク抑止制御回路1000を追加したものである。本実施の形態のマイクロプロセッサ10aは、例えば、CPUコア1a、デバッグ制御回路6、ユーザRAM8、ASE−RAM7、BUS9などから構成されている。また、CPUコア1aは、内部ステート制御回路3、モード遷移制御回路4、ブレーク抑止制御回路1000、CPU動作制御回路5a、ASR.stateレジスタ80などから構成されている。前記実施の形態1と同様に、ユーザRAM8は、図4ではマイクロプロセッサ10aに内蔵されているが、外付けにしてもよい。また、マイクロプロセッサ10aは、通常は1つのチップで構成されるが、2つ以上の複数のチップで構成してもよい。また、マイクロプロセッサ10aはシステムLSIの一部であってもよい。   First, an example of the configuration of the microprocessor 10a according to the second embodiment will be described with reference to FIG. The microprocessor 10a of the present embodiment is obtained by adding a break suppression control circuit 1000 to the microprocessor 10 of the first embodiment, for example. The microprocessor 10a according to the present embodiment includes, for example, a CPU core 1a, a debug control circuit 6, a user RAM 8, an ASE-RAM 7, a BUS 9, and the like. The CPU core 1a includes an internal state control circuit 3, a mode transition control circuit 4, a break suppression control circuit 1000, a CPU operation control circuit 5a, ASR. It consists of a state register 80 and the like. As in the first embodiment, the user RAM 8 is built in the microprocessor 10a in FIG. 4, but may be externally attached. In addition, the microprocessor 10a is normally configured with one chip, but may be configured with two or more chips. Further, the microprocessor 10a may be a part of the system LSI.

ASR.stateレジスタ80は、プロセッサ内部のデバッグ専用リソースのステートを示すレジスタである。内部ステート制御回路3は、ASR.stateの更新制御を行う回路である。モード遷移制御回路4は、デバッグモードとデバッグモードの中断時の更新制御を行う回路である。ブレーク抑止制御回路1000は、デバッグモード中の割込み受理を積算し、ある回数に達するとそれ以降のブレークを抑止する信号を発生する回路である。CPU動作制御回路5aは、入力された割込み要求信号と命令実行の状態とASR.stateレジスタ80の内容から、内部ステート制御回路3およびモード遷移制御回路4を動作させる回路である。デバッグ制御回路6は、マイクロプロセッサ内のデバッグ制御とマイクロプロセッサ外との通信を行う回路である。ASE−RAM7は、デバッグプログラムでのみ操作可能なデバッグ専用メモリである。ユーザRAM8は、ユーザプログラムおよびデバッグプログラムで操作可能なメモリである。BUS9はCPUコア1a、デバッグ制御回路6、ASE−RAM7、ユーザRAM8とを接続するバスである。   ASR. The state register 80 is a register indicating the state of a dedicated debug resource inside the processor. The internal state control circuit 3 is ASR. This is a circuit for performing update control of state. The mode transition control circuit 4 is a circuit that performs update control when the debug mode and the debug mode are interrupted. The break suppression control circuit 1000 is a circuit for accumulating interrupt acceptances during the debug mode and generating a signal for suppressing subsequent breaks when a certain number of times is reached. The CPU operation control circuit 5a receives the input interrupt request signal, instruction execution status, ASR. This is a circuit for operating the internal state control circuit 3 and the mode transition control circuit 4 based on the contents of the state register 80. The debug control circuit 6 is a circuit that performs debug control inside the microprocessor and communication outside the microprocessor. The ASE-RAM 7 is a debug-dedicated memory that can be operated only by a debug program. The user RAM 8 is a memory that can be operated by a user program and a debug program. BUS9 is a bus for connecting the CPU core 1a, the debug control circuit 6, the ASE-RAM 7, and the user RAM 8.

ASR.stateビットの制御論理は、前記実施の形態1で示した図2の論理を使用する。   ASR. As the control logic of the state bit, the logic of FIG. 2 shown in the first embodiment is used.

図5に、ブレーク抑止制御回路1000の構成を示す。ブレーク抑止制御回路1000は、デバッグモード中であることを示すASE信号30と、割込みが受理されたことを示す割込み受理信号31が同時に“1”になったとき、カウンタ1100をカウントアップし、クリア信号1105が“1”になったときにカウントダウンする。このクリア信号1105が“1”になるのは、リセット期間中と、割込みから復帰する命令(RTE命令)により、中断していたデバッグプログラムを再開する際である。また、デバッグ中断上限回数を示す信号1104の値をデバッグプログラムからのみ書き込み可能であって、アドレスマップされているレジスタ1101を持ち、前記カウンタ1100の値と、レジスタ1101との値を比較して一致した場合にブレーク抑止信号1103を“1”とする比較器1102を持つ。   FIG. 5 shows the configuration of the break suppression control circuit 1000. The break suppression control circuit 1000 counts up and clears the counter 1100 when the ASE signal 30 indicating that it is in the debug mode and the interrupt acceptance signal 31 indicating that the interrupt has been accepted simultaneously become “1”. When the signal 1105 becomes “1”, it counts down. The clear signal 1105 becomes “1” during the reset period and when the interrupted debug program is restarted by an instruction to return from the interrupt (RTE instruction). In addition, the value of the signal 1104 indicating the upper limit number of debug interruptions can be written only from the debug program, has an address mapped register 1101, and compares the value of the counter 1100 with the value of the register 1101 to match. In this case, a comparator 1102 is provided that sets the break suppression signal 1103 to “1”.

図6に、本実施の形態2に対応するデバッグプログラムのフローチャートを示す。まず、ステップS125でユーザプログラムを開始し、ステップS120でブレーク抑止制御回路1000を使用してデバッグ中断回数が上限でないかを判定する。上限に達していた場合、ブレークを受け付けずユーザプログラムのみを実行する。そのため、割込みなどで他のユーザプログラムが動作しても、多重ブレークを使用することを抑止し、スタック領域が無限に増加することを防ぐ。一方、上限に達していない場合は、ステップS121でブレークが発生しているかを判定し、ブレークが発生している場合は、ステップS126でスタック待避を行い、ステップS122で割込みを監視しながらデバッグプログラムを実行する(ステップS127)。割込みが発生しない場合は、デバッグプログラムが終了するまで実行し(ステップS128)、ステップS129でスタック復帰を行った後、ユーザプログラムに復帰する。また、ステップS122で割込みを受理した場合は、ステップS123で割込みハンドラへ分岐して割込み処理用ユーザプログラムに分岐する。また、ユーザプログラムからデバッグプログラムへの復帰は、ステップS124でRTE命令の復帰先がデバッグプログラムかどうかを判定することでを行う。   FIG. 6 shows a flowchart of a debug program corresponding to the second embodiment. First, in step S125, the user program is started, and in step S120, it is determined whether the number of debug interruptions is not the upper limit using the break suppression control circuit 1000. If the limit is reached, only the user program is executed without accepting a break. Therefore, even if another user program operates due to an interrupt or the like, the use of multiple breaks is suppressed and the stack area is prevented from increasing indefinitely. On the other hand, if the upper limit has not been reached, it is determined in step S121 whether a break has occurred. If a break has occurred, the stack is saved in step S126, and the debug program is monitored while monitoring for an interrupt in step S122. Is executed (step S127). If no interrupt occurs, the program is executed until the debug program ends (step S128), and after returning to the stack in step S129, the process returns to the user program. If an interrupt is accepted in step S122, the process branches to the interrupt handler in step S123 and branches to the interrupt processing user program. Also, the return from the user program to the debug program is performed by determining whether or not the return destination of the RTE instruction is a debug program in step S124.

以上のような回路とデバッグプログラムの組み合わせで、デバッグモードを中断して実行している割込みを利用したユーザプログラムに対し、自由にブレーク機能を適用可能となる。また、デバッグ中断回数を制限することで、デバッグ専用リソースを減らすことができる。   With the combination of the circuit and the debug program as described above, the break function can be freely applied to the user program that uses the interrupt that is executed by interrupting the debug mode. Further, by limiting the number of debugging interruptions, it is possible to reduce debugging dedicated resources.

(実施の形態3)
図7は本発明の実施の形態3に係るマイクロプロセッサの構成を示すブロック図である。
まず、図7により、本実施の形態3に係るマイクロプロセッサ10bの構成の一例を説明する。本実施の形態3に係るマイクロプロセッサ10bは、例えば、前記実施の形態1に係るマイクロプロセッサ10のASR.stateレジスタ80をASRレジスタ2に置き換えたものである。
(Embodiment 3)
FIG. 7 is a block diagram showing a configuration of a microprocessor according to Embodiment 3 of the present invention.
First, an example of the configuration of the microprocessor 10b according to the third embodiment will be described with reference to FIG. The microprocessor 10b according to the third embodiment is, for example, an ASR. Of the microprocessor 10 according to the first embodiment. The state register 80 is replaced with the ASR register 2.

本実施の形態3のマイクロプロセッサ10bは、例えば、CPUコア1b、デバッグ制御回路6、ユーザRAM8、ASE−RAM7、BUS9などから構成されている。また、CPUコア1bは、内部ステート制御回路3、モード遷移制御回路4、CPU動作制御回路5b、ASRレジスタ2などから構成されている。前記実施の形態1及び2と同様に、ユーザRAM8は、図7ではマイクロプロセッサ10bに内蔵されているが、外付けにしてもよい。また、マイクロプロセッサ10bは、通常は1つのチップで構成されるが、2つ以上の複数のチップで構成してもよい。また、マイクロプロセッサ10bはシステムLSIの一部であってもよい。   The microprocessor 10b according to the third embodiment includes, for example, a CPU core 1b, a debug control circuit 6, a user RAM 8, an ASE-RAM 7, a BUS 9, and the like. The CPU core 1b includes an internal state control circuit 3, a mode transition control circuit 4, a CPU operation control circuit 5b, an ASR register 2, and the like. As in the first and second embodiments, the user RAM 8 is built in the microprocessor 10b in FIG. 7, but may be externally attached. In addition, the microprocessor 10b is usually configured by one chip, but may be configured by two or more chips. Further, the microprocessor 10b may be a part of the system LSI.

図8に、ASRレジスタ2の構成を示す。ASRレジスタ2は、デバッグモードを中断して割込みを受理したことを示すASR.ARビット20と、前記実施の形態1及び2のASR.stateレジスタ80に相当する、プロセッサ内部のデバッグ専用リソースのステートを示すASR.stateビット21を持ったレジスタである。   FIG. 8 shows the configuration of the ASR register 2. The ASR register 2 indicates that ASR.2 indicates that the debug mode is interrupted and the interrupt is accepted. AR bit 20 and the ASR. corresponding to the state register 80, the ASR. A register having a state bit 21.

図7の内部ステート制御回路3は、ASR.stateビット21の更新制御を行う回路である。モード遷移制御回路4は、ASR.ARビット20の更新制御を行う回路である。CPU動作制御回路5bは、入力された割込み要求信号と命令実行の状態とASRレジスタ2の内容から内部ステート制御回路3およびモード遷移制御回路4を動作させる回路である。デバッグ制御回路6は、マイクロプロセッサ10b内のデバッグ制御と、マイクロプロセッサ10b外との通信を行う回路である。ASE−RAM7は、デバッグプログラムでのみ操作可能なデバッグ専用メモリである。ユーザRAM8は、ユーザプログラムおよびデバッグプログラムで操作可能なメモリである。、BUS9は、CPUコア1b、デバッグ制御回路6、ASE−RAM7、ユーザRAM8とを接続するバスである。   The internal state control circuit 3 of FIG. This is a circuit for performing update control of the state bit 21. The mode transition control circuit 4 is ASR. This is a circuit for performing update control of the AR bit 20. The CPU operation control circuit 5 b is a circuit that operates the internal state control circuit 3 and the mode transition control circuit 4 based on the input interrupt request signal, the state of instruction execution, and the contents of the ASR register 2. The debug control circuit 6 is a circuit that performs debug control in the microprocessor 10b and communication with the outside of the microprocessor 10b. The ASE-RAM 7 is a debug-dedicated memory that can be operated only by a debug program. The user RAM 8 is a memory that can be operated by a user program and a debug program. BUS9 is a bus for connecting the CPU core 1b, the debug control circuit 6, the ASE-RAM 7, and the user RAM 8.

図8に示すように、ASRレジスタ2は、デバッグプログラムからのみ操作可能なアドレス割り付けの32ビットレジスタとし、最上位ビットをASR.ARビット20、それ以外のビットをASR.stateビット21とする。ASR.stateビット21は、CPUコア内部のデバッグ専用リソースのステートの数に従い必要な数だけ使用し、残りはリザーブビットとして“0”固定とする。   As shown in FIG. 8, the ASR register 2 is an address-assigned 32-bit register that can be operated only from the debug program, and the most significant bit is ASR. The AR bit 20 and the other bits are referred to as ASR.state bit 21. ASR. The necessary number of state bits 21 is used according to the number of states of the dedicated resources for debugging in the CPU core, and the remaining bits are fixed to “0” as reserved bits.

図9に、ASR.ARビット20の制御論理を示す。デバッグモード中であることを示すASE信号30と、割込みが受理されたことを示す割込み受理信号31が同時に“1”になったとき、フリップフロップ32に“1”を書き込み、またARクリア信号33が“1”になったときはフリップフロップ32に書き込まれている値を“0”に書き換える。このARクリア信号33が“1”となるのは、リセット期間中と、割込みから復帰する命令(RTE命令という)により、中断していたデバッグプログラムを再開する際である。また、ASR書き込み信号34が“1”の時、ASRレジスタ2に書き込む値がのったASRデータ信号35のASR.ARビット20に対応する値をフリップフロップ32に書き込む。   In FIG. The control logic of the AR bit 20 is shown. When the ASE signal 30 indicating that it is in the debug mode and the interrupt acceptance signal 31 indicating that the interrupt has been accepted are simultaneously "1", "1" is written to the flip-flop 32, and the AR clear signal 33 When the value becomes “1”, the value written in the flip-flop 32 is rewritten to “0”. The AR clear signal 33 becomes “1” during the reset period and when the interrupted debug program is restarted by an instruction to return from an interrupt (referred to as an RTE instruction). When the ASR write signal 34 is “1”, the ASR. A value corresponding to the AR bit 20 is written to the flip-flop 32.

ASR.stateビット21の制御論理は、前記実施の形態1で示した図2の論理を使用する。図2に示すように、ASR.stateビット21に対応するCPUコア内部のデバッグ専用リソースのステートのセット条件を40、リセット時の初期値を41、クリア条件を42、内部ステートを保持するフリップフロップを43とする。また、ASR書き込み信号34が“1”の時、ASRレジスタに書き込む値がのったASRデータ信号35の対応する値をフリップフロップ43に書き込む。   ASR. The control logic of the state bit 21 uses the logic of FIG. 2 shown in the first embodiment. As shown in FIG. Assume that the state setting condition of the dedicated debug resource in the CPU core corresponding to the state bit 21 is 40, the initial value at the time of reset is 41, the clear condition is 42, and the flip-flop holding the internal state is 43. When the ASR write signal 34 is “1”, the corresponding value of the ASR data signal 35 with the value to be written to the ASR register is written to the flip-flop 43.

次に図10により、ASR.ARビット20の遷移を説明する。ユーザプログラムA500において、ブレーク501が発生すると、マイクロプロセッサ10bはデバッグモードに遷移し、デバッグプログラムA502の実行を開始する。このデバッグプログラムA502を実行中に、割込み503が発生すると、マイクロプロセッサはASR.ARビット20に“1”を書き込み、ユーザプログラムB504の実行を開始する。ユーザプログラムB504実行中に、さらにブレーク505が発生すると、マイクロプロセッサ10bは再度デバッグモードへ遷移し、デバッグプログラムB506の実行を開始する。デバッグプログラムB506の実行が終わると、ブレークから復帰命令(RTB命令とよぶ)により、ブレーク機能により中断していたユーザプログラムB508に復帰する(507)。ユーザプログラムB508の実行が終わると、割込みからの復帰命令(RTE命令とよぶ)により、デバッグプログラムA502の続きである510に復帰する(509)。この際、前記ARクリア信号33が“1”となるため、ASR.ARビット20が“0”となる。デバッグプログラムA510の実行が終わると、RTB命令により、ユーザプログラムA512に復帰し、ブレーク501が発生した直後の状態へ復帰する。   Next, referring to FIG. The transition of the AR bit 20 will be described. When a break 501 occurs in the user program A500, the microprocessor 10b transitions to the debug mode and starts executing the debug program A502. If an interrupt 503 is generated during execution of the debug program A502, the microprocessor performs ASR. “1” is written to the AR bit 20 and the execution of the user program B 504 is started. If a break 505 further occurs during execution of the user program B504, the microprocessor 10b transitions to the debug mode again and starts executing the debug program B506. When the execution of the debug program B506 is finished, a return instruction (referred to as an RTB instruction) is returned from the break to the user program B508 interrupted by the break function (507). When the execution of the user program B508 is completed, it returns to 510, which is a continuation of the debug program A502, by a return instruction from an interrupt (referred to as an RTE instruction) (509). At this time, since the AR clear signal 33 becomes “1”, the ASR. The AR bit 20 becomes “0”. When the execution of the debug program A510 is finished, the program returns to the user program A512 by the RTB instruction and returns to the state immediately after the break 501 occurs.

図11に、500〜512までのユーザプログラム、デバッグプログラムの実行順と、スタック操作の様子を時間軸にそって示す。ブレーク501によって開始されるデバッグプログラムA502では、まずASE−RAM7へのスタック待避A600を行う。また同様に、ブレーク505によって開始されるデバッグプログラムB506では、ASE−RAM7へのスタック待避B601を行う。   FIG. 11 shows the execution order of user programs 500 to 512 and the state of stack operation along the time axis. In the debug program A502 started by the break 501, the stack saving A600 to the ASE-RAM 7 is first performed. Similarly, in the debug program B506 started by the break 505, stack saving B601 to the ASE-RAM 7 is performed.

また、デバッグプログラムB506から、ユーザプログラムB508へRTB命令で復帰する際には、RTB命令実行前に、スタック復帰B602を行う。同様に、デバッグプログラムA510から、ユーザプログラムA512へRTB命令で復帰する際には、RTB命令実行前に、スタック復帰B603を行う。   When returning from the debug program B506 to the user program B508 with an RTB instruction, a stack return B602 is performed before the RTB instruction is executed. Similarly, when returning from the debug program A510 to the user program A512 with an RTB instruction, a stack return B603 is performed before executing the RTB instruction.

以上の中で、デバッグプログラムB506を実行している期間が、多重ブレーク期間604である。また、デバッグプログラムのためのスタック操作をしている期間600〜603は、割込み受理禁止期間であり、それ以外のデバッグモードである期間605がデバッグプログラム実行中の割込み許可期間605である。なお、スタック領域としてASE−RAM7を使用するのは、ユーザプログラムによる予期せぬデータ破壊からデバッグプログラムのスタック情報を保護するためである。また、ASE−RAM7はデバッグプログラム専用のメモリであるため、容量が非常に少なく(通常数キロバイト)、さらにデバッグプログラム本体の格納以外にトレースデータ保存用にも使用される事があるため、スタック領域のサイズはできる限り少ない方が望ましい。   Among the above, the period during which the debug program B 506 is executed is the multiple break period 604. A period 600 to 603 during which the stack operation for the debug program is performed is an interrupt acceptance prohibition period, and a period 605 that is a debug mode other than that is an interrupt permission period 605 during execution of the debug program. The reason why the ASE-RAM 7 is used as the stack area is to protect the stack information of the debug program from unexpected data destruction by the user program. Since the ASE-RAM 7 is a memory dedicated to the debug program, it has a very small capacity (usually several kilobytes), and may be used for storing trace data in addition to storing the debug program main body. It is desirable that the size of is as small as possible.

ところで、ユーザプログラムB504,508は、デバッグプログラムA502,510よりも優先して実行すべきリアルタイム処理である。また、デバッグプログラムA502,510は、デバッグを行っているプログラマのエミュレータ操作と連動してユーザプログラムの実行再開を行う。   By the way, the user programs B504 and 508 are real-time processes to be executed with priority over the debug programs A502 and 510. The debug programs A 502 and 510 resume execution of the user program in conjunction with the emulator operation of the programmer who is performing debugging.

デバッグプログラムA502,510と、デバッグプログラムB506は、ともにASE−RAM7上に置かれる。デバッグプログラムB506は、リアルタイム処理に対するブレーク505の後に実行するため、デバッグプログラムA502,510のように、デバッグを行っているプログラマのエミュレータ操作と連動していると、ユーザプログラムB504,508のリアルタイム処理が不可能になってしまう。そのため、デバッグプログラムB506で実行する命令列数、多重ブレーク期間604の上限を設定することで、ユーザプログラムB504,508のリアルタイム処理を可能とする必要がある。   Both the debug programs A 502 and 510 and the debug program B 506 are placed on the ASE-RAM 7. Since the debug program B506 is executed after the break 505 for the real-time processing, the real-time processing of the user programs B504 and 508 is performed when interlocked with the emulator operation of the programmer who is performing the debugging like the debug programs A502 and 510. It becomes impossible. Therefore, it is necessary to enable real-time processing of the user programs B504 and 508 by setting the number of instruction sequences executed in the debug program B506 and the upper limit of the multiple break period 604.

図12に、この制約に対応するデバッグプログラムのフローチャートを示す。まず、ステップS700の初期設定で、リアルタイム処理を行うユーザプログラムに対して、実行したい命令列と多重ブレーク期間の上限を設定する。その後、ステップS712でユーザプログラムを開始し、ステップS701でブレークが発生しているかを判定する。ブレークが発生している場合は、ステップS702でASR.ARビット20の評価を行う。ASR.ARビット20が“0”である場合は、ステップS713でスタック待避を行い、ステップS703で割込みを監視しながらデバッグを行っているプログラマのエミュレータ操作と連動したデバッグプログラムを実行する。ステップS703で割込みが発生しない場合は、ステップS705のデバッグプログラムが終了するまで実行し(ステップS714)、ステップS715でスタック復帰を行った後、ユーザプログラムに復帰する。   FIG. 12 shows a flowchart of the debug program corresponding to this restriction. First, as an initial setting in step S700, an instruction sequence to be executed and an upper limit of a multiple break period are set for a user program that performs real-time processing. Thereafter, the user program is started in step S712, and it is determined whether a break has occurred in step S701. If a break has occurred, the ASR. The AR bit 20 is evaluated. ASR. If the AR bit 20 is “0”, the stack is saved in step S713, and the debugging program linked with the emulator operation of the programmer performing debugging is executed while monitoring the interrupt in step S703. If no interrupt is generated in step S703, the process is executed until the debug program in step S705 ends (step S714). After the stack is returned in step S715, the process returns to the user program.

また、ステップS703で割込みを受理した場合は、ステップS707でASR.ARビット20に“1”を書き込み、割込みハンドラへ分岐して割込み処理用ユーザプログラムに分岐する。   If an interrupt is accepted in step S703, ASR. Write “1” to the AR bit 20, branch to the interrupt handler, and branch to the interrupt processing user program.

一方、ステップS702でASR.ARビット20が“1”であった場合は、ステップS700で設定した制約に違反しないかを確認する(ステップS708)。違反しない場合はさらにスタック領域に空きがあるかを確認し(ステップS709)、大丈夫な場合はステップS713のスタック操作を行う。   On the other hand, in step S702, ASR. If the AR bit 20 is “1”, it is confirmed whether or not the constraint set in step S700 is violated (step S708). If there is no violation, it is further checked whether there is a free space in the stack area (step S709), and if it is okay, the stack operation in step S713 is performed.

また、ステップS704ではASR.ARビット20が“1”であるため、ステップS700で設定したリアルタイム処理に対応するデバッグプログラムを実行する(ステップS706)。また、ステップS708、ステップS709の判定で、多重ブレークできなかった場合は、ステップS700で設定したリアルタイム処理に対応するデバッグプログラムを実行し(ステップS710)、ステップS716で終了したらユーザプログラムに復帰する。また、ユーザプログラムからデバッグプログラムへの復帰はステップS711で判定を行う。   In step S704, ASR. Since the AR bit 20 is “1”, a debug program corresponding to the real-time processing set in step S700 is executed (step S706). If it is determined in steps S708 and S709 that multiple breaks cannot be made, a debug program corresponding to the real-time process set in step S700 is executed (step S710), and the process returns to the user program when the process ends in step S716. Also, the return from the user program to the debug program is determined in step S711.

以上のような回路とデバッグプログラムの組み合わせで、リアルタイム処理ではないユーザプログラムだけでなく、デバッグモードを中断して実行している割込みを利用したリアルタイム処理に対し、デバッグを行っているプログラマが設定する割り込み応答時間の許容範囲内で、自由にブレーク機能を適用可能となる。   With the combination of the above circuit and debug program, the debugging programmer sets not only the user program that is not real-time processing but also the real-time processing that uses the interrupt that is executed by interrupting the debug mode. The break function can be freely applied within the allowable range of interrupt response time.

本実施の形態3のマイクロプロセッサは、デバッグモードを中断して割込みを受理したことを示すビット(ASR.ARビット20)と、プロセッサ内部のデバッグ専用リソースのステートを示すビット(ASR.stateビット21)を持ったレジスタ(ASRレジスタ2)をデバッグプログラムから参照できるため、検出したブレークが通常のユーザプログラムのデバッグのために発生したものか、割込みを利用したリアルタイム処理のためにデバッグモードを中断して実行しているユーザプログラムのものかを判別可能である。また、マイクロプロセッサ内部のデバッグ専用リソースをスタックとしてメモリに書き出すことで、さらに多重にデバッグモードを中断して割込みを受理することができるという利点がある。   The microprocessor according to the third embodiment has a bit (ASR.AR bit 20) indicating that the debug mode is interrupted and an interrupt is accepted, and a bit (ASR.state bit 21) indicating the state of the dedicated debugging resource in the processor. ) Can be referenced from the debug program, so whether the detected break occurred for debugging a normal user program or the debug mode is suspended for real-time processing using interrupts. It is possible to determine whether the user program is being executed. Further, by writing the debugging dedicated resources inside the microprocessor as a stack to the memory, there is an advantage that the debugging mode can be interrupted and interrupts can be accepted.

以上、本発明者によってなされた発明をその実施の形態に基づき具体的に説明したが、本発明は前記実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。   As mentioned above, the invention made by the present inventor has been specifically described based on the embodiment. However, the invention is not limited to the embodiment, and various modifications can be made without departing from the scope of the invention. Needless to say.

例えば、ASRレジスタのビット数を変更することで、バス幅の異なるマイクロプロセッサに適用可能である。   For example, it can be applied to microprocessors having different bus widths by changing the number of bits of the ASR register.

また、ASR.stateビットの数が非常に多い場合、ASR.stateビットのみで構成されるデバッグプログラムからのみ操作可能なアドレス割り付けのレジスタを追加定義する事で対応可能である。   In addition, ASR. If the number of state bits is very large, ASR. This can be dealt with by additionally defining an address allocation register that can be operated only from a debug program composed only of state bits.

多重ブレーク回数を制限するために、ASR.ARビットを任意のビット数のカウンタとし、またブレークの上限回数を設定するレジスタを別途用意することで、ASR.ARビットの比較などを行う回数を減らすことも可能である。   In order to limit the number of multiple breaks, ASR. By using the AR bit as a counter of an arbitrary number of bits and separately preparing a register for setting the upper limit number of breaks, ASR. It is also possible to reduce the number of times the AR bit comparison is performed.

ブレーク発生時のデバッグプログラムの開始アドレスを、ASR.ARビットによって切り替える事で、ASR.ARビットの比較などを行う回数を減らすことも可能である。   The start address of the debug program when a break occurs is set to ASR. By switching by AR bit, ASR. It is also possible to reduce the number of times the AR bit comparison is performed.

本発明は、マイクロプロセッサ等の半導体製品の製造業で利用可能である。   The present invention can be used in the manufacturing industry of semiconductor products such as microprocessors.

本発明の実施の形態1に係るマイクロプロセッサの構成を示すブロック図である。It is a block diagram which shows the structure of the microprocessor which concerns on Embodiment 1 of this invention. 本発明の実施の形態1〜3において、ASR.stateビットの制御論理を示す図である。In the first to third embodiments of the present invention, ASR. It is a figure which shows the control logic of a state bit. 本発明の実施の形態1において、デバッグプログラムの動作例を示すフローチャートである。5 is a flowchart illustrating an operation example of a debug program in the first embodiment of the present invention. 本発明の実施の形態2に係るマイクロプロセッサの構成を示すブロック図である。It is a block diagram which shows the structure of the microprocessor which concerns on Embodiment 2 of this invention. 本発明の実施の形態2において、ブレーク抑止制御回路の構成を示す図である。In Embodiment 2 of this invention, it is a figure which shows the structure of a break suppression control circuit. 本発明の実施の形態2において、デバッグプログラムの動作例を示すフローチャートである。In Embodiment 2 of this invention, it is a flowchart which shows the operation example of a debug program. 本発明の実施の形態3に係るマイクロプロセッサの構成を示すブロック図である。It is a block diagram which shows the structure of the microprocessor which concerns on Embodiment 3 of this invention. 本発明の実施の形態3において、ASRレジスタの構成を示す図である。In Embodiment 3 of this invention, it is a figure which shows the structure of an ASR register. 本発明の実施の形態3において、ASR.ARビットの制御論理を示す図である。In Embodiment 3 of the present invention, ASR. It is a figure which shows the control logic of AR bit. 本発明の実施の形態3において、ASR.ARビットの遷移を示す説明図である。In Embodiment 3 of the present invention, ASR. It is explanatory drawing which shows transition of AR bit. 本発明の実施の形態3において、マイクロプロセッサでのユーザプログラムとデバッグプログラムの動作例を示す図である。In Embodiment 3 of this invention, it is a figure which shows the operation example of the user program and debug program in a microprocessor. 本発明の実施の形態3において、デバッグプログラムの動作例を示すフローチャートである。In Embodiment 3 of this invention, it is a flowchart which shows the operation example of a debug program.

符号の説明Explanation of symbols

1,1a,1b CPUコア
2 ASRレジスタ
3 内部ステート制御回路
4 モード遷移制御回路
5,5a,5b CPU動作制御回路
6 デバッグ制御回路
7 ASE−RAM(デバッグ専用メモリ)
8 ユーザRAM
9 BUS
10,10a,10b マイクロプロセッサ
20 ASR.ARビット
21 ASR.stateビット
32,43 フリップフロップ
80 ASR.stateレジスタ
1000 ブレーク抑止制御回路
1100 カウンタ
1101 レジスタ
1102 比較器
1, 1a, 1b CPU core 2 ASR register 3 Internal state control circuit 4 Mode transition control circuit 5, 5a, 5b CPU operation control circuit 6 Debug control circuit 7 ASE-RAM (debug dedicated memory)
8 User RAM
9 BUS
10, 10a, 10b Microprocessor 20 ASR. AR bit 21 ASR. state bits 32, 43 flip-flop 80 ASR. state register 1000 break suppression control circuit 1100 counter 1101 register 1102 comparator

Claims (7)

第1のデバッグプログラム実行中に、割込みにより前記第1のデバッグプログラムを中断してユーザプログラムの実行が可能なマイクロプロセッサであって、
前記マイクロプロセッサの内部状態を保持し、退避可能なレジスタと、
前記マイクロプロセッサの内部状態の退避及び復帰に使用されるメモリとを有し、
前記ユーザプログラムを中断してさらに第2のデバッグプログラムの実行が可能であることを特徴とするマイクロプロセッサ。
A microprocessor capable of interrupting the first debug program by an interrupt and executing a user program during execution of the first debug program,
A register that holds and saves the internal state of the microprocessor;
A memory used for saving and restoring the internal state of the microprocessor;
A microprocessor characterized in that the user program can be interrupted to execute a second debug program.
請求項1記載のマイクロプロセッサにおいて、
前記メモリは、デバッグプログラムでのみ操作可能なデバッグ専用メモリであり、
前記レジスタの退避先は、前記デバッグ専用メモリであることを特徴とするマイクロプロセッサ。
The microprocessor of claim 1, wherein
The memory is a dedicated debug memory that can be operated only by a debug program,
The microprocessor is characterized in that the save destination of the register is the debug-dedicated memory.
請求項1記載のマイクロプロセッサにおいて、
多重割込み回数をカウントするカウンタと、
多重割込み回数の上限値を保持する保持回路と、
前記カウンタの値と前記保持回路の値とを比較する比較器とを有し、
前記比較器の比較結果に基づいて、多重割込み回数を制限することを特徴とするマイクロプロセッサ。
The microprocessor of claim 1, wherein
A counter that counts the number of multiple interrupts;
A holding circuit that holds the upper limit of the number of multiple interrupts;
A comparator that compares the value of the counter with the value of the holding circuit;
A microprocessor that limits the number of multiple interrupts based on a comparison result of the comparator.
請求項1記載のマイクロプロセッサにおいて、
デバッグモードを中断して割込みを受理したことを示すビットを有し、
前記ビットの内容に基づいて、多重割込み回数を制限することを特徴とするマイクロプロセッサ。
The microprocessor of claim 1, wherein
Has a bit to indicate that the interrupt was accepted by interrupting debug mode,
A microprocessor characterized in that the number of multiple interrupts is limited based on the contents of the bits.
請求項4記載のマイクロプロセッサにおいて、
前記ビットを利用して、前記割込みにより実行される処理が、リアルタイム処理の必要な処理か否かを判定し、前記リアルタイム処理を崩さない範囲でブレーク機能を利用可能とする機能を有することを特徴とするマイクロプロセッサ。
The microprocessor of claim 4, wherein
Using the bit, it is determined whether or not the process executed by the interrupt is a process that requires a real-time process, and has a function of enabling a break function within a range that does not break the real-time process. And a microprocessor.
請求項1記載のマイクロプロセッサにおいて、
前記レジスタに保持される前記マイクロプロセッサの内部状態は、デバッグ専用リソースのステートであることを特徴とするマイクロプロセッサ。
The microprocessor of claim 1, wherein
The microprocessor characterized in that the internal state of the microprocessor held in the register is a state of a dedicated resource for debugging.
請求項1記載のマイクロプロセッサにおいて、
前記マイクロプロセッサの内部状態の退避及び復帰は、デバッグプログラムにより行われることを特徴とするマイクロプロセッサ。
The microprocessor of claim 1, wherein
The microprocessor characterized in that the internal state of the microprocessor is saved and restored by a debug program.
JP2005207177A 2005-07-15 2005-07-15 Microprocessor Pending JP2007026084A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005207177A JP2007026084A (en) 2005-07-15 2005-07-15 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005207177A JP2007026084A (en) 2005-07-15 2005-07-15 Microprocessor

Publications (1)

Publication Number Publication Date
JP2007026084A true JP2007026084A (en) 2007-02-01

Family

ID=37786749

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005207177A Pending JP2007026084A (en) 2005-07-15 2005-07-15 Microprocessor

Country Status (1)

Country Link
JP (1) JP2007026084A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011501265A (en) * 2007-10-12 2011-01-06 フリースケール セミコンダクター インコーポレイテッド Debug instructions for use in data processing systems
JP2011512603A (en) * 2008-02-21 2011-04-21 ローベルト ボツシユ ゲゼルシヤフト ミツト ベシユレンクテル ハフツング Device for examining the program memory of a computing unit

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011501265A (en) * 2007-10-12 2011-01-06 フリースケール セミコンダクター インコーポレイテッド Debug instructions for use in data processing systems
JP2011512603A (en) * 2008-02-21 2011-04-21 ローベルト ボツシユ ゲゼルシヤフト ミツト ベシユレンクテル ハフツング Device for examining the program memory of a computing unit
US8464100B2 (en) 2008-02-21 2013-06-11 Robert Bosch Gmbh System for checking a program memory of a processing unit

Similar Documents

Publication Publication Date Title
CN105095128B (en) Interrupt processing method and interrupt controller
JP2009524140A (en) Area protection device, instruction set, and method for protecting memory area
EP3770765B1 (en) Error recovery method and apparatus
US8392641B2 (en) Microcontroller with an interrupt structure having programmable priority levels with each priority level associated with a different register set
CN105453029A (en) Handling access attributes for data accesses
JP2008009721A (en) Evaluation system and evaluation method thereof
US7010725B2 (en) Method and apparatus for getting dump of a computer system
WO2015075505A1 (en) Apparatus and method for external access to core resources of a processor, semiconductor systems development tool comprising the apparatus, and computer program product and non-transitory computer-readable storage medium associated with the method
US6877113B2 (en) Break determining circuit for a debugging support unit in a semiconductor integrated circuit
US5257269A (en) Error controller for use in debugging microprocessor
JP2007026084A (en) Microprocessor
CN115576734B (en) Multi-core heterogeneous log storage method and system
JP2011134162A (en) System and method for controlling switching of task
US20060195849A1 (en) Method for synchronizing events, particularly for processors of fault-tolerant systems
WO2017020639A1 (en) Network processor, packet processing data acquisition method, and storage medium
JP2001256044A (en) Data processor
US20030145175A1 (en) Multiprocessor system having respective control programs of a plurality of processors stored contiguously in a memory
JPH1040130A (en) Microcomputer
JP2005018650A (en) Nonvolatile semiconductor storage device and data processor
JP3088285B2 (en) In-circuit emulator
US20020032821A1 (en) Management of interruptions in a computer platform
JP2003030003A (en) Debug system
JP2015201208A (en) System on chip and verification method thereof
JP2011215853A (en) Semiconductor device and control method for the same
US7206926B2 (en) Programmable unit including program operation unit and associated stopping device