JP2723847B2 - Microprocessor - Google Patents

Microprocessor

Info

Publication number
JP2723847B2
JP2723847B2 JP7208890A JP20889095A JP2723847B2 JP 2723847 B2 JP2723847 B2 JP 2723847B2 JP 7208890 A JP7208890 A JP 7208890A JP 20889095 A JP20889095 A JP 20889095A JP 2723847 B2 JP2723847 B2 JP 2723847B2
Authority
JP
Japan
Prior art keywords
interrupt
signal
register
processing
microprocessor
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 - Lifetime
Application number
JP7208890A
Other languages
Japanese (ja)
Other versions
JPH0954697A (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.)
NIPPON DENKI AISHII MAIKON SHISUTEMU KK
Original Assignee
NIPPON DENKI AISHII MAIKON SHISUTEMU KK
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 NIPPON DENKI AISHII MAIKON SHISUTEMU KK filed Critical NIPPON DENKI AISHII MAIKON SHISUTEMU KK
Priority to JP7208890A priority Critical patent/JP2723847B2/en
Publication of JPH0954697A publication Critical patent/JPH0954697A/en
Application granted granted Critical
Publication of JP2723847B2 publication Critical patent/JP2723847B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、マイクロプロセッ
サに関し、特に複数のレジスタセットを備えるマイクロ
プロセッサに関する。
The present invention relates to a microprocessor, and more particularly, to a microprocessor having a plurality of register sets.

【0002】[0002]

【従来の技術】まず、最初に従来のマイクロプロセッサ
の割り込み応答の機能について説明する。
2. Description of the Related Art First, an interrupt response function of a conventional microprocessor will be described.

【0003】一般のマイクロプロセッサにおける割り込
み処理に必要とされる機能は、第1に特定の割り込み応
答に対して対応する処理を選択して所定の処理を実行す
るために実行先番地を変更させる機構であり、第2に割
り込み処理の終了後割り込まれた処理に復帰するとき割
り込みが発生する以前の状態を完全に保証する機構であ
る。
A function required for interrupt processing in a general microprocessor is, first, a mechanism for selecting a process corresponding to a specific interrupt response and changing an execution destination address in order to execute a predetermined process. The second is a mechanism for completely guaranteeing the state before the occurrence of the interrupt when returning to the interrupted processing after the end of the interrupt processing.

【0004】本発明の対象は上記の第2の機構に関す
る。この第2の機構の観点から、一般的マイクロプロセ
ッサにおける上記の割り込み処理について説明する。
An object of the present invention relates to the above-mentioned second mechanism. From the viewpoint of the second mechanism, the above-described interrupt processing in a general microprocessor will be described.

【0005】マイクロプロセッサに割り込みが発生する
と、まず、現在実行中の処理の中断を行い、次に、割り
込み要因に対応した割り込み処理を開始する。その時、
中断した処理に復帰するために、中断した処理の実行プ
ログラムの番地データとその時点の状態データ(以下P
SWという)とを一時的に退避する。通常は、割り込み
処理中での別の要因の再割り込み(以下多重割り込みと
いう)に対してその機能を有効に働かせるために、一般
にメモリ内にスタック領域という領域を確保し、その中
に積み込む形で実現する。このようにする事により多重
割り込みに対して復帰に必要な情報が欠落することを回
避する。
[0005] When an interrupt occurs in the microprocessor, the process currently being executed is first interrupted, and then the interrupt process corresponding to the interrupt factor is started. At that time,
In order to return to the interrupted process, the address data of the execution program of the interrupted process and the status data at that time (hereinafter P
SW). Normally, in order to effectively use the function for re-interruption of another factor during interrupt processing (hereinafter referred to as multiple interrupts), generally, an area called a stack area is secured in memory and loaded in it. Realize. By doing so, it is possible to avoid losing information necessary for return to multiple interrupts.

【0006】次に、割り込みした側のプログラムの最初
で、その割り込み処理に使用予定のレジスタ類を命令に
よって明示的に退避した後、その割り込み処理固有の処
理を行う。その理由は割り込まれた側の処理でそれらの
レジスタ類を使用中である可能性があるからである。こ
の退避も前述したメモリ内のスタック領域に行うのが一
般である。
Next, at the beginning of the interrupting program, registers to be used for the interrupt processing are explicitly saved by an instruction, and then processing specific to the interrupt processing is performed. The reason is that there is a possibility that those registers are being used in the processing of the interrupted side. Generally, this saving is also performed in the stack area in the memory described above.

【0007】割り込み処理が完了すると、割り込み処理
の最初に退避したレジスタ類を再度復帰した後、割り込
まれた処理に復帰する。この時、自動的に退避された実
行先番地データとPSWの状態を復帰する。これによっ
て割り込まれた処理は、中断した時点から再び再開可能
になる。上述した割り込み処理の最初に行うレジスタ類
の退避を命令により明示的に行うのは、割り込み処理側
で使用するレジスタが各割り込み処理の内容によって異
なることによる。
When the interrupt process is completed, the registers saved at the beginning of the interrupt process are restored again, and then the process returns to the interrupted process. At this time, the automatically saved execution destination address data and PSW state are restored. As a result, the interrupted process can be resumed from the point at which it was interrupted. The reason why the registers to be saved at the beginning of the above-described interrupt processing are explicitly saved by an instruction is that registers used on the interrupt processing side differ depending on the contents of each interrupt processing.

【0008】上述した一般的なマイクロプロセッサの機
構は、1組の連続したスタック領域をメモリ内に確保す
るだけで多重割り込みに対しスタック領域の大きさのみ
管理すればよい事が利点である。しかしながら、一般に
メモリへの入出力は時間の消費を伴うと同時に、それら
の時間は本来の処理においては出来れば不要にしたい時
間である。特に電子機器に組み込まれる用途のマイクロ
プロセッサにおいては頻繁に発生する割り込みに対して
速やかな対応が必要とされ、しかも、それぞれの割り込
み処理自体は単純で簡単な処理が多い。そのため上述し
た一般的マイクロプロセッサの割り込み処理機構の場
合、レジスタの退避という余分の処理が無視できない性
能低下をもたらす結果になる。
The above-described general microprocessor mechanism has an advantage that it is only necessary to secure a set of continuous stack areas in the memory and to manage only the size of the stack area for multiple interrupts. However, input and output to and from the memory generally consumes time, and these times are times that should be eliminated if possible in the original processing. In particular, a microprocessor incorporated in an electronic device needs to quickly respond to frequently occurring interrupts, and the interrupt processing itself is often simple and simple. Therefore, in the case of the above-described interrupt processing mechanism of the general microprocessor, the extra processing of saving the register results in a performance that cannot be ignored.

【0009】そのため、組み込み用途マイクロプロセッ
サにおいては、上述した割り込み処理でのレジスタの退
避時間を最小にとどめるためにレジスタセットを複数組
持たせ、割り込みの発生毎にレジスタセットを切り替え
る事により、レジスタの退避処理を省略する機能を有す
るものが多い。以下に、上記の複数のレジスタセットを
有する従来のマイクロプロセッサの例を2件述べる。
Therefore, in the embedded microprocessor, a plurality of register sets are provided in order to minimize the register saving time in the above-described interrupt processing, and the register set is switched every time an interrupt is generated, so that the register set is changed. Many have a function of omitting the evacuation processing. Hereinafter, two examples of the conventional microprocessor having the plurality of register sets will be described.

【0010】図は、従来のマイクロプロセッサの第一
例を示すブロック図である。図を参照して説明する。
FIG. 6 is a block diagram showing a first example of a conventional microprocessor. It will be described with reference to FIG.

【0011】この従来例のマイクロプロセッサは、実行
部200,レジスタセット群201,割り込み制御部2
02,レジスタセット選択部205とから構成され、各
割り込み要因に対して特定のレジスタセットを予め割り
当て、割り込み発生時に自動的に該当するレジスタセッ
トを選択するものである。
The conventional microprocessor includes an execution unit 200, a register set group 201, and an interrupt control unit 2.
02, a register set selecting unit 205, a specific register set is assigned in advance to each interrupt factor, and the corresponding register set is automatically selected when an interrupt occurs.

【0012】実行部200は、マイクロプロセッサの本
体でありプログラムの実行を行う。
The execution section 200 is a main body of the microprocessor and executes a program.

【0013】レジスタセット群201は、実行部で使用
する複数のレジスタセットの集まりであり、その時点で
選択されたレジスタセットと実行部200との間を、複
数の信号線で構成されるレジスタ入出力信号群11で互
いにデータのやりとりを行う。
The register set group 201 is a group of a plurality of register sets used in the execution unit. The register set group 201 includes a plurality of signal lines. The output signal group 11 exchanges data with each other.

【0014】割り込み制御部202は、マイクロプロセ
ッサに対する外部からの複数の割り込み要求信号群1を
受け取り、実行部200に対してどのような割り込み処
理を行うかを指示する複数の信号線で構成される割り込
みベクタ信号3を実行部200に与える。実行部200
は、割り込みベクタ信号3を受け取り、指定された割り
込み処理に実行番地を変更して割り込み処理を開始す
る。また、実行部200からは、割り込み制御部202
に実行部が現在割り込みを受け付け可能かどうかを知ら
せるIE信号2と、割り込み処理を受け付けた旨の信号
であるINT信号4と、割り込み処理からの復帰を伝え
るIRET信号5とを出力し、割り込み制御部202と
実行部200との間の整合性を取る。
The interrupt control unit 202 receives a plurality of interrupt request signal groups 1 from the outside of the microprocessor and includes a plurality of signal lines for instructing the execution unit 200 what kind of interrupt processing is to be performed. The interrupt vector signal 3 is provided to the execution unit 200. Execution unit 200
Receives the interrupt vector signal 3, changes the execution address to the designated interrupt processing, and starts the interrupt processing. Also, the execution unit 200 sends an interrupt control unit 202
And an IE signal 2 notifying that the execution unit can accept the interrupt, an INT signal 4 indicating that the interrupt process has been accepted, and an IRET signal 5 indicating the return from the interrupt process. The consistency between the unit 202 and the execution unit 200 is obtained.

【0015】レジスタセット選択部205は、現在実行
中のプログラムで使用するレジスタセットを指定するた
めに、レジスタセットの数を指定するに必要な数の信号
線で構成されるレジスタセット指定信号10をレジスタ
セット群201へ与える。
The register set selecting unit 205 generates a register set specifying signal 10 composed of signal lines required to specify the number of register sets in order to specify a register set to be used in the program currently being executed. This is given to the register set group 201.

【0016】そのため、本レジスタセット選択部205
は、内部に各割り込みベクタに対応するレジスタセット
を指定する記憶部を持ち、割り込み制御部202からの
割り込みベクタ信号3の値に対して適切なレジスタセッ
ト指定信号10を出力する機能を持つ。この記憶部へは
通常実行部200よりプログラムの実行の初期段階でレ
ジスタセット事前指定信号群13によって予め対応表を
書き込んでおく。さらに、現在実行中の割り込み処理の
深さより浅い割り込みのベクタを記憶して実行部200
より入力されるIRET信号5によって割り込まれた処
理のレジスタセットに復帰出来る機構を持っている。
For this reason, the register set selection unit 205
Has a storage unit for designating a register set corresponding to each interrupt vector, and has a function of outputting a register set designation signal 10 appropriate for the value of the interrupt vector signal 3 from the interrupt control unit 202. In the storage unit, a correspondence table is written in advance by the register set advance designation signal group 13 at the initial stage of program execution from the normal execution unit 200. Further, the execution unit 200 stores an interrupt vector shallower than the depth of the currently executed interrupt processing.
It has a mechanism that can return to the register set of the process interrupted by the input IRET signal 5.

【0017】以上述べた構成および信号線以外に、通常
マイクロプロセッサは、実行の進行の単位を与えるクロ
ック信号6と最初にマイクロプロセッサの動作を初期化
するためのリセット信号7とを外部より与える必要があ
る。その理由は、実行部200,割り込み制御部202
およびレジスタセット選択部205の間の同期のためで
ある。
In addition to the configuration and signal lines described above, the microprocessor normally needs to externally supply a clock signal 6 for giving a unit of execution progress and a reset signal 7 for initially initializing the operation of the microprocessor. There is. The reason is that the execution unit 200, the interrupt control unit 202
And the register set selection unit 205 for synchronization.

【0018】本機構は、同一要因の多重割り込みには利
用できないが、特定の割り込み要因毎にレジスタセット
を割り当てることができるので、用途が比較的簡単で割
り込み要因の数がレジスタセットの数より少ない場合に
おいては有効な機構である。この機構の例としては、特
開平3−209528号公報に示されている。
Although this mechanism cannot be used for multiple interrupts of the same factor, a register set can be assigned for each specific interrupt factor, so the application is relatively simple and the number of interrupt factors is smaller than the number of register sets. In some cases, it is an effective mechanism. An example of this mechanism is disclosed in JP-A-3-209528.

【0019】しかしながら、本従来例の場合、割り込み
要因の数がレジスタセットの数以上の場合、各割り込み
要因に対するレジスタセットの間の割り当てに工夫が必
要になると同時にレジスタセットに割り当てられなかっ
た割り込み要因に対しては、既に述べた一般的マイクロ
プロセッサの機構を利用する以外に方法がなく、その割
り込み処理において応答時間が急増する不利点がある。
However, in the case of this conventional example, if the number of interrupt factors is equal to or greater than the number of register sets, it is necessary to devise the assignment between register sets for each interrupt factor, and at the same time, the interrupt factors not assigned to the register set However, there is no other method than using the mechanism of the general microprocessor described above, and there is a disadvantage that the response time is sharply increased in the interrupt processing.

【0020】現在の組み込み用途のマイクロプロセッサ
においては、その用途の高機能化に伴いマイクロコンピ
ュータに経済的に保有可能なレジスタセットの数に比べ
要求される割り込み要因の数は、大幅に増えつつある。
In today's embedded microprocessors, the number of required interrupt sources is increasing significantly compared to the number of register sets that can be economically held by the microcomputer as the functions become more sophisticated. .

【0021】図は、第二の従来例のマイクロプロセッ
サを示すブロック図である。図を参照して説明する。
FIG. 7 is a block diagram showing a second conventional microprocessor. It will be described with reference to FIG.

【0022】この従来例のマイクロプロセッサは、第一
の従来例の割り込みベクタ信号3によってレジスタを選
択するレジスタセット選択部205を割り込みが発生し
たとき自動的にレジスタセット指定信号10の値を増加
させ割り込みからの復帰によって減数させる機構を持っ
たレジスタセット選択部204に置き換えたものであ
り、その他の機能は同一である。
This conventional microprocessor automatically increases the value of the register set designating signal 10 when an interrupt occurs in the register set selecting section 205 for selecting a register by the interrupt vector signal 3 of the first conventional example. It is replaced by a register set selection unit 204 having a mechanism for reducing the number of bits by returning from an interrupt, and the other functions are the same.

【0023】このレジスタセット選択部204は、レジ
スタセットの選択を計数手段によって得ているので、割
り込みベクタ信号3と実行部200よりのレジスタ事前
指定信号を必要としない。この例としては、特開昭59
−33558号公報に示されている。以後、第一の従来
例のレジスタセット選択部205と第二の従来例のレジ
スタセット選択部204は符号によって区別するものと
する。
The register set selection unit 204 does not need the interrupt vector signal 3 and the register advance designation signal from the execution unit 200 since the selection of the register set is obtained by the counting means. An example of this is disclosed in
No. 33558. Hereinafter, the register set selecting section 205 of the first conventional example and the register set selecting section 204 of the second conventional example are distinguished by reference numerals.

【0024】本従来例の場合、第一の従来例に比べ割り
込み要因の数がレジスタセットの数より少ない必要性は
なく、マイクロプロセッサの実動作時の多重割り込みの
深さがレジスタセットの数より少なければ有効に機能す
る点が異なる。一般にマイクロプロセッサの実動作時に
おいて、多重割り込みの深さは割り込み要因の数より少
ないため、同じ用途の場合、本従来例の方が第一の従来
例に比べて少ないレジスタセット数で対処可能になる。
その理由を以下に説明する。
In the case of this conventional example, it is not necessary that the number of interrupt factors is smaller than the number of register sets as compared with the first conventional example, and the depth of multiple interrupts during actual operation of the microprocessor is smaller than the number of register sets. The difference is that it works effectively if it is small. In general, during the actual operation of the microprocessor, the depth of multiple interrupts is smaller than the number of interrupt sources, so for the same application, this conventional example can deal with a smaller number of register sets than the first conventional example. Become.
The reason will be described below.

【0025】マイクロプロセッサのある任意の状態にお
いて何らかの割り込みが発生する確率をPとすると、n
重以上の割り込みが発生する確率は、Pのn乗となる。
この確率は、割り込み要因の数には影響されない。もち
ろん割り込み要因の数が増えれば割り込みの発生する確
率Pは増加するが、マイクロプロセッサの一般的動作に
おいて何らかの割り込み処理が起こる確率Pは、最大で
も1/2以下と考えるのが妥当である。ここで、レジス
タセットの数をマイクロプロセッサで現実的に可能な値
として8個と仮定すると、8重以上の割り込みが発生す
る確率は1/128となる。以上説明したように、8組
のレジスタセットの場合そのレジスタセットで足りなく
なる可能性は極めて小さくなる。
Assuming that the probability of occurrence of any interrupt in any given state of the microprocessor is P, n
The probability of occurrence of more interrupts is P raised to the nth power.
This probability is not affected by the number of interrupt sources. Of course, as the number of interrupt factors increases, the probability P of occurrence of an interrupt increases, but it is reasonable to consider that the probability P of some kind of interrupt processing in the general operation of the microprocessor is at most 1 / or less. Here, assuming that the number of register sets is eight as a value practically possible by the microprocessor, the probability of occurrence of eight or more interrupts is 1/128. As described above, in the case of eight register sets, the possibility that the register set becomes insufficient is extremely small.

【0026】本機構の問題点は、実動作中においてマイ
クロプロセッサが保有するレジスタセットの数以上の多
重割り込みが発生した場合において何らかの保護機構が
必要な点である。一般に、割り込みの深さを計数する機
構を有し、その値をマイクロプロセッサによって検出す
る事によりレジスタセットの数以上の多重割り込みが発
生した場合、既に述べた一般的マイクロプロセッサの機
構に切り替える方法が考えられる。
The problem with this mechanism is that some protection mechanism is required when multiple interrupts occur in the actual operation that exceed the number of register sets held by the microprocessor. In general, there is a mechanism for counting the depth of an interrupt, and when multiple interrupts greater than the number of register sets occur by detecting the value by the microprocessor, a method for switching to the mechanism of the general microprocessor described above is used. Conceivable.

【0027】しかしながら、多重割り込みの深さがレジ
スタセットの数以上になると、全ての割り込み処理にお
いて常にメモリへの退避処理が発生し応答時間が急増す
る第一の従来例と同様な第一の問題点と、全ての割り込
み処理プログラムの先頭で割り込みの深さのオーバフロ
ーの確認処理を行わなければいけない第一の従来例に比
べて不利な第二の問題点がある。
However, when the depth of the multiple interrupts is equal to or greater than the number of register sets, the first problem similar to the first conventional example in which the saving process to the memory always occurs in all the interrupt processes and the response time sharply increases. There is a second problem that is disadvantageous in comparison with the first conventional example in which an interrupt depth overflow check process must be performed at the beginning of all interrupt processing programs.

【0028】[0028]

【発明が解決しようとする課題】上述したように、第一
の従来例では、割り込み要因がレジスタセットの数以上
の用途では、割り込み発生時の余分の処理を有効に削減
出来ない。また、第二の従来例では、第一の従来例より
多くの割り込み要因に対して同じレジスタセットの数で
対応出来るが、実動作において割り込みの深さがレジス
タセットの数以上になった場合に割り込み発生時の余分
の処理が急増する第一の問題点と、全ての割り込み処理
プログラムの先頭で割り込みの深さを検出する処理が必
要になるという第二の問題点が有った。
As described above, in the first conventional example, when the interrupt factor is equal to or larger than the number of register sets, the extra processing at the time of the occurrence of the interrupt cannot be effectively reduced. Also, in the second conventional example, the same number of register sets can cope with more interrupt factors than the first conventional example, but when the depth of the interrupt becomes larger than the number of register sets in actual operation, There are a first problem that extra processing at the time of occurrence of an interrupt suddenly increases, and a second problem that a process of detecting the depth of the interrupt is required at the beginning of all interrupt processing programs.

【0029】したがって、発明が解決しようとする課題
は、複数のレジスタセットを備えるマイクロプロセッサ
において、割り込み応答時間を改善することにある。
An object of the present invention is to improve an interrupt response time in a microprocessor having a plurality of register sets.

【0030】[0030]

【課題を解決するための手段】そのため、本発明は、複
数のレジスタセットを備え、割り込み許可信号に従って
割り込み要求の受付制御をすると共に割り込み要求を受
け付けたことを示す割込信号と割り込み処理から復帰し
たことを示す復帰信号とにより前記レジスタセットの選
択制御をする割り込み処理機能を持つマイクロプロセッ
サにおいて、前記割込信号の発生により計数値を増分し
前記復帰信号の発生により前記計数値を減数する計数手
段と、前記計数値が前記レジスタセットのセット数と等
しい最大値に達したとき前記計数値の増分を抑制する増
分抑制手段と、前記計数値が最小値に達したとき前記計
数値の減数を抑制する減数抑制手段と、前記計数値が前
記最大値であるとき更に割り込み要求を受け付けたこと
を示す信号を割り込み処理の制御情報として出力するオ
ーバフロー通知手段と、前記計数値が前記最小値である
ことを示す信号を割り込み処理の制御情報として出力す
る最小値通知手段とからなる割り込み処理制御手段を備
えている。
Therefore, the present invention comprises a plurality of register sets, controls acceptance of an interrupt request according to an interrupt enable signal, and returns from an interrupt signal indicating that the interrupt request has been accepted and interrupt processing. A microprocessor having an interrupt processing function of performing selection control of the register set in response to a return signal indicating that the count value has been incremented by the generation of the interrupt signal and decremented by the generation of the return signal. Means, an increment suppressing means for suppressing an increment of the count value when the count value reaches a maximum value equal to the set number of the register set, and a decrement of the count value when the count value reaches a minimum value. And a signal indicating that an interrupt request has been accepted when the count value is the maximum value. And an interrupt processing control means comprising: an overflow notification means for outputting as control information for the only processing; and a minimum value notification means for outputting a signal indicating that the count value is the minimum value as control information for the interrupt processing. .

【0031】また、前記割込信号が発生したとき割り込
み前に実行していたプログラムの番地データおよび状態
データを割り込み前に選択されていた前記レジスタセッ
ト内の領域に保存する保存処理手段と、前記復帰信号が
発生したとき選択された前記レジスタセット内の前記領
域から前記番地データおよび前記状態データを復帰し前
記プログラムを継続実行する復帰処理手段とを備えてい
る。
A storage processing means for storing address data and status data of a program executed before the interruption when the interrupt signal is generated in an area in the register set selected before the interruption; Return processing means for returning the address data and the status data from the selected area in the register set when a return signal is generated, and continuously executing the program.

【0032】[0032]

【発明の実施の形態】次に本発明について図面を参照し
て説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the present invention will be described with reference to the drawings.

【0033】図1は、本発明のマイクロプロセッサの第
一の実施形態を示すブロック図である。
FIG. 1 is a block diagram showing a first embodiment of the microprocessor of the present invention.

【0034】この実施形態のマイクロプロセッサは、実
行部200,レジスタセット群201,割り込み許可信
号に従って割り込み要求の受付制御をする割り込み制御
部202,割り込み要求を受け付けたことを示す割込信
号と割り込み処理から復帰したことを示す復帰信号とに
よりレジスタセットの選択制御をするレジスタセット選
択部204,割り込み処理制御部203とから構成され
ている。なお、このレジスタセット選択部204は、通
常のカウンタのように、選択されたレジスタセットの位
置が最大値であるときに割り込みが発生するとレジスタ
セットの位置が最小値になり、レジスタセットの位置が
最小値であるときに割り込みから復帰するとレジスタセ
ットの位置は最大値に変わる。に示した第二の従来
例のマイクロプロセッサとの相違点は、割り込み処理制
御部203が追加されている点である。他のブロックは
と同じなので説明を省略する。
The microprocessor of this embodiment includes an execution unit 200, a register set group 201, an interrupt control unit 202 for controlling acceptance of an interrupt request according to an interrupt enable signal, an interrupt signal indicating that an interrupt request has been accepted, and an interrupt process. A register set selection unit 204 for controlling the selection of a register set in response to a return signal indicating that the operation has returned from the CPU, and an interrupt processing control unit 203. Note that this register set selection unit 204
Like the usual counter, the position of the selected register set
If an interrupt occurs when the value is
The position of the register set becomes the minimum value, and the position of the register set becomes
When returning from an interrupt when the value is at the minimum value, the register
The position of the unit changes to the maximum value. The difference from the microprocessor of the second conventional example shown in FIG. 7 is that an interrupt processing control unit 203 is added. Other blocks are omitted because it is the same as FIG.

【0035】この実施形態のマイクロプロセッサは、割
り込み処理制御部203からの出力であるオーバフロー
信号8と最小値信号9とを実行部200に入力し、これ
ら2本の信号線の論理値を実行部200の命令で読み込
み、それらの値によって割り込み処理プログラムの制御
をする。
The microprocessor of this embodiment inputs the overflow signal 8 and the minimum value signal 9 output from the interrupt processing control unit 203 to the execution unit 200, and outputs the logic values of these two signal lines to the execution unit. It is read by 200 instructions, and the interrupt processing program is controlled by those values.

【0036】図2は、図1の第一の実施形態における割
り込み処理制御部203の詳細構成を示す回路図であ
る。図2を参照して説明を続ける。
FIG. 2 is a circuit diagram showing a detailed configuration of the interrupt processing control unit 203 in the first embodiment of FIG. The description will be continued with reference to FIG.

【0037】この割り込み処理制御部203は、計数器
100と、AND回路101およびNOT回路102か
らなる増分抑制手段と、AND回路103およびNOT
回路104からなる減数抑制手段と、JKFF105お
よびAND回路106からなるオーバフロー通知手段と
から構成されている。
The interrupt processing control unit 203 includes a counter 100, an increment suppressing means including an AND circuit 101 and a NOT circuit 102, and an AND circuit 103 and a NOT circuit.
It comprises a decrement suppressing means consisting of a circuit 104 and an overflow notifying means consisting of a JKFF 105 and an AND circuit.

【0038】また、この割り込み処理制御部203は、
マイクロプロセッサが割り込みを受け付けた旨を伝える
INT信号4と割り込みからの復帰を伝えるIRET信
号5とクロック入力信号6と回路を初期化するリセット
信号7の4本の入力信号とを持ち、割り込みがレジスタ
セットの数以上続けて発生したことを示すオーバフロー
信号8と計数器100が最小値である事を示す最小値信
号9の2本の出力信号を持っている。INT信号4とI
RET信号5は、1つの事象が発生した時点で1クロッ
クの幅分の期間論理値1になる信号と仮定している。ク
ロック信号6はマイクロプロセッサの動作タイミングを
支える基本クロックから得るものとしている。
The interrupt processing control unit 203
The microprocessor has four input signals, an INT signal 4 for notifying that the interrupt has been accepted, an IRET signal 5 for notifying return from the interrupt, a clock input signal 6, and a reset signal 7 for initializing the circuit. It has two output signals, an overflow signal 8 indicating that the number of sets has continuously occurred and a minimum value signal 9 indicating that the counter 100 has the minimum value. INT signal 4 and I
The RET signal 5 is assumed to be a signal having a logical value of 1 for a period of one clock width when one event occurs. The clock signal 6 is obtained from a basic clock that supports the operation timing of the microprocessor.

【0039】計数器100は、マイクロプロセッサが有
するレジスタセットの数分を計数することが可能な計数
器であり、内部の計数値が最大値のとき論理値1を出力
するMAX出力と、最小値のとき論理値1を出力するM
IN出力とを持っている。なお、ここでいう最大値およ
び最小値は、レジスタセットの数の計数を実現する数値
であればよく、例えば、最小値が0ならば、最大値はレ
ジスタセットの数−1 であり、最小値が1ならば、最大
値はレジスタセットの数になる。クロック信号6が入力
された入力CKと、入力CKの信号が論理値1に変化す
るとき論理値1であれば計数器100の内部の計数値を
1つ増加させる増加入力Uと、入力CKの信号が論理値
1に変化するとき論理値1であれば計数器100の内部
の計数値を1つ減少させる減少入力Dと、他の入力がど
んな場合でも論理値1が入力されると計数器100の内
部の計数値を0に初期化させるリセット信号7が入力さ
れた入力Rの4本の入力を持つ。
The counter 100 is a counter capable of counting the number of register sets included in the microprocessor, and includes a MAX output for outputting a logical value 1 when the internal count value is a maximum value, and a minimum output value. Output logical value 1 when
It has an IN output. Note that the maximum value and the
And the minimum value is a numerical value that can be used to count the number of register sets.
For example, if the minimum value is 0, the maximum value is
The number of register sets minus 1, if the minimum value is 1, the maximum
The value will be the number of register sets. An input CK to which the clock signal 6 is input, an increase input U for increasing the count value inside the counter 100 by one when the signal of the input CK changes to a logical value 1 if the logical value is 1; When the signal changes to a logical value 1, if the logical value is 1, the decreasing input D for decreasing the internal count value of the counter 100 by one, and the logical value 1 is input when the logical value 1 is inputted regardless of the other inputs. It has four inputs R, to which a reset signal 7 for initializing the internal count value of 100 to 0 is input.

【0040】また、この計数器100は、前述した入力
Uおよび入力Dは同時に1になることはなく、また、入
力Uおよび入力Dの両方が論理値0であれば入力CKの
信号が論理値1に変化したときも内部の計数値は変化し
ない機構を持つ。この計数器は、既に単体製品としても
存在するものなので、これ以上の説明は省略する。
In the counter 100, the input U and the input D described above do not become 1 at the same time, and if both the input U and the input D have the logical value 0, the signal of the input CK becomes the logical value. It has a mechanism that the internal count value does not change even when it changes to 1. Since this counter already exists as a single product, further description will be omitted.

【0041】次に、AND回路101およびNOT回路
102からなる増分抑制手段において、NOT回路10
2の入力は、計数器100のMAX出力から入力してい
る。AND回路101は、NOT回路102の出力およ
びINT信号4を入力とし、出力を計数器100の入力
Uに出力している。
Next, in the increment suppressing means including the AND circuit 101 and the NOT circuit 102, the NOT circuit 10
The input of 2 is input from the MAX output of the counter 100. The AND circuit 101 receives the output of the NOT circuit 102 and the INT signal 4 as inputs, and outputs the output to the input U of the counter 100.

【0042】同様に、AND回路103およびNOT回
路104からなる減数抑制手段において、NOT回路1
04の入力は、計数器100のMIN出力から入力して
いる。AND回路103は、NOT回路104の出力お
よびIRET信号5を入力とし、出力を計数器100の
入力Dに出力している。
Similarly, in a reduction control means comprising an AND circuit 103 and a NOT circuit 104, the NOT circuit 1
04 is input from the MIN output of the counter 100. The AND circuit 103 receives the output of the NOT circuit 104 and the IRET signal 5 as inputs, and outputs the output to the input D of the counter 100.

【0043】また、JKFF105およびAND回路1
06からなるオーバフロー通知手段において、AND回
路106は、計数器100のMAX出力およびINT信
号4を入力とし、JKFF105の入力Jに出力してい
る。また、JKFF105の入力KにはIRET信号5
が入力され、その入力Rにはリセット信号7が加えられ
ている。JK型フリップフロップであるJKFF105
は、入力CKが論理値1に変化したとき、入力Jが論理
値1ならば論理値1を出力し、入力Kが論理値1ならば
論理値0を出力し、入力Jおよび入力Kがともに論理値
0ならば出力変化しない。このJKFF105の出力Q
によって、オーバフロー信号8を生成している。
The JKFF 105 and the AND circuit 1
In the overflow notification unit 06, the AND circuit 106 receives the MAX output of the counter 100 and the INT signal 4 as inputs and outputs the input to the input J of the JKFF 105. The input K of the JKFF 105 has an IRET signal 5
, And a reset signal 7 is applied to its input R. JKFF105 which is a JK flip-flop
When the input CK changes to the logical value 1, the logical value 1 is output if the input J is the logical value 1, the logical value 0 is output if the input K is the logical value 1, and both the input J and the input K are output. If the logical value is 0, the output does not change. The output Q of this JKFF105
Thus, the overflow signal 8 is generated.

【0044】さらに、計数器100のMIN出力を最小
値信号9として出力することにより最小値通知手段を構
成している。
Further, by outputting the MIN output of the counter 100 as the minimum value signal 9, the minimum value notification means is constituted.

【0045】次に、本マイクロプロセッサにおける割り
込み処理の動作の詳細を、図面を参照して説明する。
Next, the details of the operation of the interrupt processing in the microprocessor will be described with reference to the drawings.

【0046】図3は、本実施形態における本発明の効果
を実現するための割り込み処理プログラムの典型例を示
す流れ図である。また、図4は、説明をわかりやすくす
るために用意した、割り込みの深さを縦軸にして、プロ
グラムの実際の実行における割り込みの深さの変化例を
時系列で示したグラフである。説明を分かり易くするた
め、割り込みの深さを縦軸にし、時間を横軸にしてい
る。以下、図4に沿って説明する。
FIG. 3 is a flowchart showing a typical example of an interrupt processing program for realizing the effect of the present invention in the present embodiment. FIG. 4 is a graph prepared in order to make the description easier to understand, and shows a time-series example of a change in the depth of the interrupt in the actual execution of the program, with the vertical axis representing the depth of the interrupt. For ease of explanation, the vertical axis indicates the depth of interrupt and the horizontal axis indicates time. Hereinafter, description will be made with reference to FIG.

【0047】図4のグラフの左下が、マイクロプロセッ
サの実行の開始である。このグラフの横線が上向きの縦
線に変化した時点が割り込みが発生であり、横線が下向
きの縦線に変化した時点が割り込みからの復帰を意味し
ている。
The lower left of the graph in FIG. 4 is the start of the execution of the microprocessor. When the horizontal line of the graph changes to an upward vertical line, an interrupt occurs, and when the horizontal line changes to a downward vertical line, it means return from the interrupt.

【0048】時点aが1重の割り込みの発生である。時
点bは一度全ての割り込み処理が完了した後の一重の割
り込みの発生である。割り込み処理は全てが図3の形式
の構成である。
The time point a is when a single interrupt occurs. Time point b is the occurrence of a single interrupt after all interrupt processing has been completed once. All of the interrupt processing has the configuration of the format shown in FIG.

【0049】時点aから時点bおよび時点cの1つ前の
割り込み処理までは、図3の割り込み処理の最初で、オ
ーバフロー信号8がオーバフロー状態かどうか評価して
いるステップ301においてオーバフローしてないた
め、ステップ302を実行せずステップ303の実行に
移る。また、割り込み処理からの復帰時にも、最小値信
号9が最小値でないため、ステップ307を実行せずに
ステップ308の割り込み復帰命令を実行する。この期
間、全ての割り込み処理の間でレジスタセットは、順次
切り替わって使用されている。
From the time point a to the interrupt processing immediately before the time point b and the time point c, since the overflow signal 8 does not overflow at the beginning of the interrupt processing in FIG. Then, the process proceeds to step 303 without executing step 302. Also, when returning from the interrupt processing, since the minimum value signal 9 is not the minimum value, the interrupt return instruction of step 308 is executed without executing step 307. During this period, the register set is sequentially switched and used between all the interrupt processes.

【0050】時点cにおいては、レジスタセットを使い
きっているため割り込み処理の最初の時点でオーバフロ
ー信号8が有効になっているため図3のステップ302
が実行される。その結果、その時点で選択されたレジス
タセットの内容が退避されるが、そのレジスタは、割り
込みの深さが0のときに使用されていたものである。
At time point c, since the register set has been used up, the overflow signal 8 is valid at the first time point of the interrupt processing.
Is executed. As a result, the currently selected registry
The contents of the tuset are saved, but its registers are
This is used when the depth of the embedding is 0.

【0051】同様に、時点dおよび時点eでの割り込み
処理でもオーバフロー信号8が有効なためレジスタの退
避が行われる。このとき退避されるレジスタセットは、
割り込みの深さが1および2のときに使用されていたも
のである。
Similarly, in the interrupt processing at the time points d and e, the register is saved because the overflow signal 8 is valid. The register set saved at this time is:
Used when the interrupt depth was 1 and 2
It is.

【0052】しかしながら、本発明の特徴として、時点
cで発生した割り込み処理の復帰時点j,それ以後発生
した時点dおよびeの割り込み処理の復帰の時点gおよ
びfでは、最小値信号は有効になってないため図3のス
テップ307のレジスタセットの復帰処理は行われな
い。このように復帰処理が行われなくとも、退避されて
いるレジスタセットは、その時点では割り込みの深さが
0から3で使用されているレジスタセットであるので、
この時点では必要ないものであるからである。
However, as a feature of the present invention, the minimum value signal is valid at the return point j of the interrupt processing generated at the time point c and at the return points g and f of the interrupt processing at the subsequent time points d and e. Therefore, the process of restoring the register set in step 307 of FIG. 3 is not performed. Even if the return process is not performed,
Register set has a current interrupt depth
Since it is a register set used in 0 to 3,
This is because it is not necessary at this point.

【0053】さらに、特徴的な点は、時点hにおける割
り込み処理が発生したとき、割り込み処理制御部203
内の計数器100は、最大値から−2されているためオ
ーバーフロー信号8は発生せず、その結果、ステップ3
02は実行されない。しかしながら、この時点で使用す
るように設定されるレジスタバンクは、以前に時点dで
発生した割り込み処理プログラム内で使用済みのもので
あるため、そのまま使用しても問題ない。時点c,時点
dおよび時点eにおいて退避されたレジスタセットの内
容は、時点m,時点lおよび時点kで復帰される。この
動作は本発明の特徴であり、その理由は、図1の回路と
図3の流れ図とから容易に理解できる。このため、本発
明の場合のレジスタセットの内容の退避と復帰処理は、
実際の一連の多重割り込み動作において最小の回数に最
適化される。
Further, a characteristic point is that when an interrupt process occurs at time point h , the interrupt process control unit 203
Since the counter 100 in FIG.
No overflow signal 8 is generated, resulting in step 3
02 is not executed. However, use at this point
The register bank that is set to
Used in the generated interrupt processing program
There is no problem if used as it is. The contents of the register set saved at the time points c, d and e are restored at the time points m, l and k. This operation is a feature of the present invention, and the reason can be easily understood from the circuit of FIG. 1 and the flowchart of FIG. For this reason, the save and restore processing of the contents of the register set in the case of the present invention
It is optimized to the minimum number of times in an actual series of multiple interrupt operations.

【0054】以上説明したように、本発明は、割り込み
処理におけるレジスタセットの内容の退避処理によって
発生する余分の処理を最小に出来る効果がある。
As described above, the present invention has the effect of minimizing the extra processing that occurs due to the processing of saving the contents of the register set in the interrupt processing.

【0055】本発明と異なる単に多重割り込みの深さを
検出する機構の場合を図4の例で説明すると、レジスタ
セットの退避処理は時点c,時点d,時点eおよび時点
hとなり、レジスタセットの復帰処理は時点f,時点
g,時点iおよび時点jとなる。したがって、この場合
の退避処理および復帰処理は計8回となり本発明の例の
6回と比べ必ず多くなる。
The case of a mechanism for simply detecting the depth of multiple interrupts, which is different from the present invention, will be described with reference to the example of FIG. 4. The return processing is performed at time f, time g, time i, and time j. Therefore, the evacuation process and the restoration process in this case are eight times in total, which is always larger than six times in the example of the present invention.

【0056】本発明の特徴は、連続した割り込み発生ま
たは連続した割り込みからの復帰がレジスタセットの数
以上続く場合以外では,レジスタセットの退避およびレ
ジスタセットの復帰処理が不要である点であり、割り込
みの発生と復帰が少ない幅で上下している間はレジスタ
セットの退避処理および復帰処理が不要になることが特
徴である。
A feature of the present invention is that the save of the register set and the process of restoring the register set are unnecessary unless the continuous interrupt generation or the return from the continuous interrupt continues for more than the number of register sets. The feature is that the save and restore processing of the register set is not required while the occurrence and return of the register set are up and down with a small width.

【0057】また、従来の技術で説明した単に割り込み
の深さを検出する手法を実現する回路は、実際に発生す
る割り込みの深さ分の計数器を内蔵しなければならな
く、現実には対象のマイクロプロセッサのアドレス値に
近い計数器が必要になる不利点があった。
Further, a circuit for realizing the technique of simply detecting the depth of an interrupt described in the prior art must incorporate a counter for the depth of an actually generated interrupt. However, there is a disadvantage that a counter close to the address value of the microprocessor is required.

【0058】次に、第一の実施形態における図3のステ
ップ302が実行される割り込み処理は、割り込みの深
さがレジスタセットの数以上に達した後の割り込み処理
であり、ステップ307が実行される割り込み処理は、
通常、割り込みの深さが浅い割り込み処理の復帰時に行
われる。
Next, the interrupt processing in step 302 of FIG. 3 in the first embodiment is an interrupt processing after the depth of the interrupt reaches the number of register sets or more, and step 307 is executed. Interrupt processing
Usually, it is performed at the time of return from interrupt processing in which the depth of the interrupt is shallow.

【0059】一方、通常のマイクロプロセッサは、一組
のスタックポインタによって割り込みからの復帰番地デ
ータおよびPSWの退避先と、図3のステップ302お
よびステップ307のレジスタセットの退避および復帰
先を一元管理している。さらに、通常のサブルーチンの
呼び出しとサブルーチンからの復帰もこのスタックポイ
ンタを使用している。この理由は従来の技術で述べたよ
うに1つの連続したスタック領域をメモリ内に確保する
だけでよい利点から来ている。
On the other hand, the ordinary microprocessor unitarily manages the return address data from the interrupt and the save destination of the PSW and the save and restore destinations of the register set in steps 302 and 307 in FIG. 3 by a set of stack pointers. ing. Further, the call of the normal subroutine and the return from the subroutine also use the stack pointer. The reason for this comes from the advantage that it is only necessary to secure one continuous stack area in the memory as described in the prior art.

【0060】そのため、第一の実施形態を適用した場
合、割り込みからの復帰番地データおよびPSWを退避
するスタック領域と同一のスタック領域にレジスタセッ
トの退避領域を確保すると、退避と復帰の順番が狂い、
整合性が取れなくなる問題が発生することがある。これ
を回避する方法は、上記の復帰時の実行先番地データお
よびPSWの退避領域と独立にレジスタセットの退避領
域を確保すればよいが、それぞれに必要な大きさの領域
を独立に確保するのはメモリ活用の効率上望ましくな
い。
Therefore, when the first embodiment is applied, if the save area of the register set is secured in the same stack area as the stack area for saving the return address data from the interrupt and the PSW, the order of saving and restoring will be out of order. ,
In some cases, a problem may occur in which consistency cannot be obtained. A method for avoiding this is to secure the save area of the register set independently of the execution destination address data upon return and the save area of the PSW, but it is necessary to secure the area of the required size independently for each. Is not desirable in terms of memory utilization efficiency.

【0061】さらに、第一の実施形態においては、図3
におけるステップ307においてどのレジスタが退避さ
れていたのかが判断出来ない点がある。全てのレジスタ
セットの退避時に全てのレジスタセットを退避すれば、
復帰時点で無条件でレジスタセットを全て復帰すること
で可能であるが、不要なレジスタの退避はそのまま実行
時間の低下の要因になる。この解決策として、レジスタ
セットの退避時に最後にどのレジスタを退避したかの情
報を追加して書き込むことで、復帰時に最初にその内容
を読み出してそれに基づいて復帰を行なう手法により可
能にできる。さらに前述した処理を行う専用命令をマイ
クロプロセッサに追加すれば、プログラムの容量および
実行速度の向上が可能になる。これらの第一の実施形態
における問題点に関する解決策として、第二の実施形態
を次に説明する。
Further, in the first embodiment, FIG.
In step 307, it cannot be determined which register has been saved. If all register sets are saved when all register sets are saved,
It is possible to unconditionally restore all register sets at the time of restoration, but unnecessary saving of registers directly causes a reduction in execution time. As a solution to this, it is possible to add the information of which register was saved last when the register set is saved, and to write the added information, so that the contents can be read first and the system can be restored based on the content. Further, by adding a dedicated instruction for performing the above-described processing to the microprocessor, the capacity and execution speed of the program can be improved. As a solution to the problems in the first embodiment, a second embodiment will be described below.

【0062】図5は、本発明のマイクロプロセッサの第
二の実施形態を示すブロック図である。
FIG. 5 is a block diagram showing a second embodiment of the microprocessor of the present invention.

【0063】この第二の実施形態のマイクロプロセッサ
は、上述した第一の実施形態における問題点を解決する
ための機構を備えている。図5を参照して説明すると、
レジスタセット群201内部に割り込みからの復帰時の
実行プログラムの番地データを保存するPC保存部50
5と割り込み時のPSWを保存するPSW保存部506
とを有し、新たに保存処理部503と復帰処理部504
とが追加されている。
The microprocessor according to the second embodiment has a mechanism for solving the problem in the first embodiment. Referring to FIG.
A PC storage unit 50 for storing address data of an execution program at the time of returning from an interrupt in the register set group 201
5 and PSW storage unit 506 for storing the PSW at the time of interruption
And a new storage processing unit 503 and a restoration processing unit 504
And have been added.

【0064】次に、本実施形態のマイクロプロセッサの
動作について説明する。
Next, the operation of the microprocessor of this embodiment will be described.

【0065】保存処理部503は、実行部200からの
INT信号4を受け取り、割り込み発生時点での実行プ
ログラムの復帰情報として実行部200内のプログラム
カウンタであるPC501とPSW制御レジスタである
PSW502とからデータをそれぞれ読み出し、現在指
定されているレジスタセット内のPC保存部505およ
びPSW保存部506にそれぞれ書き込む。
The storage processing unit 503 receives the INT signal 4 from the execution unit 200, and receives the INT signal 4 from the PC 501 as the program counter in the execution unit 200 and the PSW 502 as the PSW control register as the return information of the execution program at the time of occurrence of the interrupt. The data is read out and written to the PC storage unit 505 and the PSW storage unit 506 in the currently specified register set, respectively.

【0066】書き込みが終了すると、割り込み制御部2
02およびレジスタセット選択部204および割り込み
処理制御部203に対して図2におけるINT信号1の
代わりの遅延INT信号14を出力する。この理由は、
現在のレジスタセットの切り替え前にレジスタセットに
PC501およびPSW502のデータを書き込む必要
があるからである。
When the writing is completed, the interrupt control unit 2
2 and outputs a delayed INT signal 14 instead of the INT signal 1 in FIG. 2 to the register set selection unit 204 and the interrupt processing control unit 203. The reason for this is
This is because it is necessary to write the data of the PC 501 and the PSW 502 to the register set before switching the current register set.

【0067】さらに、割り込み処理からの復帰時に復帰
処理部504はIRET信号5を受け取ると、レジスタ
セット選択部204によってレジスタセットの切り替え
が完了するのを待って、PC保存部505とPSW保存
部506とからデータを読み出して実行部200内のP
C501およびPSW502に復帰させる。復帰が完了
すると、実行部200は、割り込まれた処理の再開を開
始する。
Further, when the return processing unit 504 receives the IRET signal 5 at the time of return from the interrupt processing, the recovery processing unit 504 waits until the register set switching by the register set selection unit 204 is completed, and then the PC storage unit 505 and the PSW storage unit 506. And read the data from
Return to C501 and PSW502. When the return is completed, the execution unit 200 starts restarting the interrupted process.

【0068】本発明の効果のためには、上述したPC保
存部505およびPSW保存部506は、必ずしも専用
のレジスタとして確保する必要はなく、通常のレジスタ
の一部を使用することでも可能である。
For the effect of the present invention, the above-described PC storage unit 505 and PSW storage unit 506 do not necessarily need to be secured as dedicated registers, and can use a part of ordinary registers. .

【0069】すなわち、再割り込みを許す割り込み処理
プログラムおよび主プログラム内で割り込まれる可能性
がある処理部において、予めPC保存部505およびP
SW保存部506として使用することに決められたレジ
スタを使用しないようにさえすればよい。それ以外のと
きは、前記PC保存部505およびPSW保存部506
は通常のレジスタとして利用可能である。
That is, in the interrupt processing program that permits re-interruption and the processing unit that may be interrupted in the main program, the PC storage unit 505 and the P
It is only necessary that the register determined to be used as the SW storage unit 506 is not used. Otherwise, the PC storage unit 505 and the PSW storage unit 506
Is available as a normal register.

【0070】ここで、本実施形態によって第一の実施形
態における問題点が解決される理由を追加説明する。
Here, the reason why the problem in the first embodiment is solved by the present embodiment will be additionally described.

【0071】本実施形態においては、割り込み発生時の
処理において割り込みからの復帰のための再実行番地お
よびPSWをスタックに積まずにレジスタセットの中に
保存する点が異なる。そのため、多重の割り込みの処理
の間サブプログラムの呼び出し等のスタックを使用する
命令を実行しなければ割り込み処理にいっさいの明示的
スタックの使用がないことが特徴である。そのため、ス
タックは図3の使用するレジスタの退避処理であるステ
ップ302と退避したレジスタの復帰処理であるステッ
プ307が別々の割り込み処理プログラムで実行されて
もスタック上に退避する順序と復帰する順序は常に逆の
関係になるため矛盾は生じない。
The present embodiment is different from the first embodiment in that a re-execution address for returning from an interrupt and a PSW are stored in a register set without being stacked on a stack in a process when an interrupt occurs. Therefore, it is a feature that no explicit stack is used for interrupt processing unless an instruction that uses a stack such as a subprogram call is executed during processing of multiple interrupts. Therefore, the order of saving and restoring the stack on the stack even if step 302, which is the saving process of the register used, and step 307, which is the restoring process of the saved register in FIG. There is no contradiction because the relationship is always reversed.

【0072】以上説明したように、新たなる構成を追加
することによって第一の実施形態における問題点が解決
出来る。
As described above, the problem in the first embodiment can be solved by adding a new configuration.

【0073】[0073]

【発明の効果】以上説明したように、本発明は、複数の
レジスタセットを備えるマイクロプロセッサにおいて、
多重割り込みの深さがレジスタセットの数以上になった
ことを示す信号と多重割り込みの深さが最小値であるこ
とを示す信号とを割り込み処理の制御情報として出力す
る割り込み処理制御手段を備えることにより、多重割り
込みの深さがレジスタセットの数より少ない場合におい
ての割り込み応答時間を従来例と同等にした上で、多重
割り込みの深さがレジスタセットの数以上になった場合
にレジスタセットの退避および復帰の処理を最小にし、
割り込み応答時間を最小に出来る効果がある。
As described above, the present invention relates to a microprocessor having a plurality of register sets.
Interrupt processing control means for outputting, as interrupt processing control information, a signal indicating that the depth of multiple interrupts is equal to or greater than the number of register sets and a signal indicating that the depth of multiple interrupts is the minimum value This makes the interrupt response time when the depth of multiple interrupts is less than the number of register sets equal to that of the conventional example, and saves register sets when the depth of multiple interrupts exceeds the number of register sets. And minimize the return process,
This has the effect of minimizing the interrupt response time.

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

【図1】本発明のマイクロプロセッサの第一実施形態を
示すブロック図である。
FIG. 1 is a block diagram showing a first embodiment of a microprocessor of the present invention.

【図2】図1の第一実施形態における割り込み処理制御
部の構成を示す回路図である。
FIG. 2 is a circuit diagram showing a configuration of an interrupt processing control unit in the first embodiment of FIG.

【図3】割り込み処理プログラムの典型例を示す流れ図
である。
FIG. 3 is a flowchart showing a typical example of an interrupt processing program.

【図4】割り込みの深さの変化例を時系列で示したグラ
フである。
FIG. 4 is a graph showing an example of a change in the depth of interruption in a time series.

【図5】本発明のマイクロプロセッサの第二実施形態を
示すブロック図である。
FIG. 5 is a block diagram showing a second embodiment of the microprocessor of the present invention.

【図6】従来のマイクロプロセッサの第一例を示すブロ
ック図である。
FIG. 6 is a block diagram showing a first example of a conventional microprocessor.

【図7】従来のマイクロプロセッサの第二例を示すブロ
ック図である。
FIG. 7 is a block diagram illustrating a second example of a conventional microprocessor.

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

1 割り込み要求信号群 2 IE信号(割り込み許可信号) 3 割り込みベクタ信号 4 INT信号(割込信号) 5 IRET信号(復帰信号) 6 クロック信号 7 リセット信号 8 オーバフロー信号 9 最小値信号 10 レジスタセット指定信号 11 レジスタ入出力信号群 13 レジスタセット事前指定信号 14 遅延INT信号 100 計数器 101,103,106 AND回路 102,104 NOT回路 105 JKFF(JK型フリップフロップ) 200 実行部 201 レジスタセット群 202 割り込み制御部 203 割り込み処理制御部 204,205 レジスタセット選択部 300 割り込み処理の開始ステップ 301 オーバフロー信号の検出ステップ 302 割り込み処理部内で使用するレジスタの退避
ステップ 303 割り込み処理部内で割り込みを再許可するス
テップ 304 割り込み処理の本体ステップ 305 割り込みの禁止ステップ 306 最小値信号の検出ステップ 307 退避したレジスタの復帰ステップ 308 IRET(割り込みからの復帰命令)ステッ
プ 501 PC(実行部200内のプログラムカウン
タ) 502 PSW(実行部200内のPSW制御レジス
タ) 503 保存処理部 504 復帰処理部 a 最初の割り込み位置 b レジスタセットの数以上の深さの割り込みになる
割り込みの開始位置 c レジスタセットの数以上の深さになった割り込み
の開始位置 d c以後の再割り込み位置 e d以後の再割り込み位置 f eの割り込みからの復帰位置 g dの割り込みからの復帰位置 h レジスタセットの数以上の深さでの再割り込みの
開始位置 i hの割り込みからの復帰位置 j cの割り込みからの復帰位置 k eの割り込み時に退避したレジスタの復帰を行う
割り込みからの復帰位置 l dの割り込み時に退避したレジスタの復帰を行う
割り込みからの復帰位置 m cの割り込み時に退避したレジスタの復帰を行う
割り込みからの復帰位置
Reference Signs List 1 interrupt request signal group 2 IE signal (interrupt enable signal) 3 interrupt vector signal 4 INT signal (interrupt signal) 5 IRET signal (return signal) 6 clock signal 7 reset signal 8 overflow signal 9 minimum value signal 10 register set designation signal REFERENCE SIGNS LIST 11 register input / output signal group 13 register set advance designation signal 14 delayed INT signal 100 counter 101, 103, 106 AND circuit 102, 104 NOT circuit 105 JKFF (JK flip-flop) 200 execution unit 201 register set group 202 interrupt control unit 203 Interrupt processing control unit 204, 205 Register set selecting unit 300 Interrupt processing start step 301 Overflow signal detection step 302 Register saving step used in interrupt processing unit 303 Interrupt Step of re-enabling an interrupt in the control unit 304 Main step of interrupt processing 305 Step of prohibiting interrupt 306 Step of detecting minimum value signal 307 Step of restoring saved register 308 Step of IRET (return instruction from interrupt) Step 501 PC (execution unit 200 502 PSW (PSW control register in the execution unit 200) 503 Save processing unit 504 Return processing unit a First interrupt position b Start position of an interrupt that becomes an interrupt with a depth equal to or greater than the number of register sets c Register set The start position of the interrupt that has a depth greater than or equal to d The re-interrupt position after d c The re-interrupt position after d f The return position from the interrupt of e g The return position from the interrupt of d h The number of register sets or more Start position of re-interruption at depth i Return position from the interrupt of j j return position from the interrupt of c c return position from the interrupt that restores the register saved at the interrupt of ke l return position from the interrupt that restores the register saved at the interrupt of l d mc From the interrupt that restores the registers saved at the time of the interrupt

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 複数のレジスタセットを備え、割り込み
許可信号に従って割り込み要求の受付制御をすると共に
割り込み要求を受け付けたことを示す割込信号と割り込
み処理から復帰したことを示す復帰信号とにより前記レ
ジスタセットの選択制御をする割り込み処理機能を持つ
マイクロプロセッサにおいて、 前記割込信号の発生により計数値を増分し前記復帰信号
の発生により前記計数値を減数する計数手段と、前記計
数値が前記レジスタセットのセット数と等しい最大値に
達したとき前記計数値の増分を抑制する増分抑制手段
と、前記計数値が最小値に達したとき前記計数値の減数
を抑制する減数抑制手段と、前記計数値が前記最大値で
あるとき更に割り込み要求を受け付けたことを示す信号
を割り込み処理の制御情報として出力するオーバフロー
通知手段と、前記計数値が前記最小値であることを示す
信号を割り込み処理の制御情報として出力する最小値通
知手段とからなる割り込み処理制御手段を備えることを
特徴とするマイクロプロセッサ。
A plurality of register sets for controlling reception of an interrupt request in accordance with an interrupt enable signal, and providing said register with an interrupt signal indicating that the interrupt request has been received and a return signal indicating that the process has returned from interrupt processing. A microprocessor having an interrupt processing function of performing selection control of a set, a counting means for incrementing a count value by generation of the interrupt signal and decrementing the count value by generation of the return signal; Increment suppression means for suppressing the increment of the count value when the maximum value equal to the set number of the count value is reached; reduction count suppression means for suppressing the reduction of the count value when the count value reaches the minimum value; and the count value Is the maximum value, a signal indicating that an interrupt request has been accepted is output as control information for interrupt processing. And Bafuro notification unit, a microprocessor in which the count value is characterized in that it comprises an interruption processing control means comprising a minimum value notification unit for outputting a signal indicating that said the minimum value as the control information of the interrupt processing.
【請求項2】 前記割込信号が発生したとき割り込み前
に実行していたプログラムの番地データおよび状態デー
タを割り込み前に選択されていた前記レジスタセット内
の領域に保存する保存処理手段と、前記復帰信号が発生
したとき選択された前記レジスタセット内の前記領域か
ら前記番地データおよび前記状態データを復帰し前記プ
ログラムを継続実行する復帰処理手段とを備える、請求
項1記載のマイクロプロセッサ。
2. A storage processing means for storing address data and status data of a program executed before an interrupt when the interrupt signal is generated, in an area in the register set selected before the interrupt, and 2. The microprocessor according to claim 1, further comprising: return processing means for returning the address data and the status data from the area in the register set selected when a return signal is generated, and continuously executing the program.
JP7208890A 1995-08-16 1995-08-16 Microprocessor Expired - Lifetime JP2723847B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7208890A JP2723847B2 (en) 1995-08-16 1995-08-16 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7208890A JP2723847B2 (en) 1995-08-16 1995-08-16 Microprocessor

Publications (2)

Publication Number Publication Date
JPH0954697A JPH0954697A (en) 1997-02-25
JP2723847B2 true JP2723847B2 (en) 1998-03-09

Family

ID=16563827

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7208890A Expired - Lifetime JP2723847B2 (en) 1995-08-16 1995-08-16 Microprocessor

Country Status (1)

Country Link
JP (1) JP2723847B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1124185A1 (en) * 2000-02-09 2001-08-16 Siemens Aktiengesellschaft Interface system and method for processing interrupts to a processor
TW200511111A (en) 2003-07-30 2005-03-16 Koninkl Philips Electronics Nv Microcontroller with an interrupt structure having programmable priority levels with each priority level associated with a different register set
GB2462258B (en) * 2008-07-28 2012-02-08 Advanced Risc Mach Ltd Interrupt control for virtual processing apparatus

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5933558A (en) * 1982-08-19 1984-02-23 Nec Corp Information processor
JPS62120544A (en) * 1985-11-21 1987-06-01 Nec Corp Information processor

Also Published As

Publication number Publication date
JPH0954697A (en) 1997-02-25

Similar Documents

Publication Publication Date Title
JP3699806B2 (en) Interrupt controller and control system
US20020161941A1 (en) System and method for efficiently performing a data transfer operation
JP4127848B2 (en) Task processing device
JP3676882B2 (en) Microprocessor and its peripheral devices
US5233691A (en) Register window system for reducing the need for overflow-write by prewriting registers to memory during times without bus contention
JP3970609B2 (en) Processor system
US20050028159A1 (en) Memory managing system and task controller in multitask system
JP2004157636A (en) Data processing apparatus
JP2723847B2 (en) Microprocessor
EP1652079A2 (en) Microcontroller with an interrupt structure having programmable priority levels with each priority level associated with a different register set
JP2006039874A (en) Information processor
JPH1139171A (en) Multitask processor, multitask processing control method and control program storing medium
JPH04241032A (en) System call execution device
JP3539984B2 (en) Processor
JPS6290728A (en) Interruption processing method
JP2585905B2 (en) Multitask execution device
JPH11167494A (en) Arithmetic processor and register managing method for it
JPH044630B2 (en)
JP2008269597A (en) Task processor
JP2005071141A (en) Method and device for managing stack and stack management program
JPH0333934A (en) Register saving/recovering system
JPH04256027A (en) Microcomputer
JP2000132409A (en) Stack sharing system for task having no wait state
JPH0683640A (en) Interruption response processing system
JP2000010908A (en) Dma controller

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19971111