JP4250283B2 - Interrupt processing circuit - Google Patents
Interrupt processing circuit Download PDFInfo
- Publication number
- JP4250283B2 JP4250283B2 JP35019399A JP35019399A JP4250283B2 JP 4250283 B2 JP4250283 B2 JP 4250283B2 JP 35019399 A JP35019399 A JP 35019399A JP 35019399 A JP35019399 A JP 35019399A JP 4250283 B2 JP4250283 B2 JP 4250283B2
- Authority
- JP
- Japan
- Prior art keywords
- interrupt
- register
- priority
- input
- processing circuit
- 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
Links
Images
Description
【0001】
【発明の属する技術分野】
本発明は、同等の重要度を持つ複数の割込入力からの割込要求を優先順位に従って順次処理する割込処理回路に関するものである。
【0002】
【従来の技術】
割込処理回路は、外的要因からの割込要求を受け付けて処理するもので、割込処理が開始されると、現在実行中の処理は中断されて割込処理が実行され、割込終了後に中断された元の処理が再開される。従来の割込処理回路は、例えばインテル社製の型番8259という割込コントローラに代表されるように、複数の割込入力を持ち、各割込入力についてハードウェア的にあらかじめ決定された優先順位を与えられている。
【0003】
型番8259の割込コントローラはオートマチック・ローテーションという手法を採用している。この手法は、例えば特開平4−363748号公報に開示されているように、現在割込処理が実施されている割込入力の優先順位を、その処理の終了時すなわちマイクロプロセッサ(以下、CPUという)からEOI(End Of Interrupt)を受け取った際に最下位とし、その他の割込入力にはあらかじめ決定されている優先順位を順次割り当てるという方法である。
【0004】
この場合、優先順位を変更することはある程度ソフトウェアにより可能であるが、一般的に、その時々で状況に応じて動的に変更することは困難である。特に、割込入力が同程度の重要度を持つ場合にあらかじめ優先順位が決定されていると、高順位の割込入力からの割込要求に対する割込処理から順次実施されるため、低順位の割込入力からの割込要求に対する処理が滞るという状況が発生し、不都合が生じる原因となっていた。
【0005】
以下、前述のオートマチック・ローテーションを採用する割込処理回路を例に挙げて、従来の割込処理回路とその問題点について説明する。
図8は、従来の割込処理回路の内部構造を表す一例のブロック図である。
同図に示す割込処理回路36は、オートマチック・ローテーションを採用するもので、IRRレジスタ12と、優先順位割当回路16と、ISRレジスタ18と、制御回路20とから構成されている。
【0006】
割込処理回路36において、まず、IRRレジスタ12は割込要求レジスタである。IRRレジスタ12は、図示例の場合、割込入力IR0〜5から割込要求が発生すると、これに各々対応するIRRレジスタ12のビットが‘1’にセットされ、割込処理回路36によって割込処理が開始されると、これに対応するビットが‘0’にリセットされる。IRRレジスタ12からの出力は優先順位割当回路16に入力されている。
【0007】
続いて、優先順位割当回路16は、CPUからの信号EOIを受け取った時点で各割込入力IR0〜5に対して優先順位を割り当てる。
ISRレジスタ18はイン・サービス・レジスタであって、上記優先順位割当回路16と双方向に接続されている。ISRレジスタ18は、割込処理回路36が現在処理中の割込処理に対応するビットが‘1’にセットされ、処理が終了すると対応するビットが‘0’にリセットされる。
【0008】
最後に、制御回路20は、割込処理回路36全体の動作を制御するとともに、割込処理回路36とCPUとのインタフェースをとるもので、制御回路20とIRRレジスタ12および優先順位割当回路16とは双方向に接続され、ISRレジスタ18には、制御回路20からの制御信号が入力されている。制御回路20からCPUへは割込要求信号INTが入力され、これに対して、CPUから割込処理回路36へは割込許可信号INTA ̄が入力される。
【0009】
割込入力IR5〜0は、図9(a)の信号PRIの値で示すように、小さい数字を与えられている割込入力ほど高い優先順位を持つものとする。ここで、同図(b)に示すように、割込入力IR0,3,5から同時に割込要求がなされ、各々対応するIRRレジスタのビット0,3,5の値が‘1’になったとする。この時の優先順位は割込入力IR0が最も高いため、割込処理回路36は、まず、割込入力IR0からの割込要求を受け付ける。
【0010】
割込入力IR0を受け付けると、割込処理回路36は、ISRレジスタの割込入力IR0に対応するビットの値を‘1’とし、制御回路20により、CPUに対して割込要求信号INTを介して割込要求を行う。それがCPUに承認されると、CPUからは割込許可信号INTA ̄が与えられ、割込処理回路36は、割り込みベクタ等をCPUに対して発行する。これを受けて、CPUは現在実行中の処理を中断し、割込入力IR0に対応する割込処理を実行する。
【0011】
ここで、この割込入力IR0に対応する割込処理中にさらに割込入力IR2が入力されたとする。この時のIRRレジスタ12の値は、図9(c)に示すように、割込入力2,3,5に各々対応するビット2,3,5の値が‘1’となる。この時、割込入力IR2は同IR0よりも優先順位が低いので、現在処理中の割込入力IR0に対応する割込処理を中断して同IR2に対応する処理に移行することはない。
【0012】
その後、割込入力IR0に対応する割込処理が終了し、CPUの発行する信号EOIを割込処理回路36が受け取ると、オートマチック・ローテーション方式により、割込入力IR0に対応する優先順位が最下位となり、その他の割込入力IR1〜5の優先順位は1つずつ高くなる。すなわち、同図(d)に示すように、割込入力IR1の優先順位が最も高く、次いでIR2〜5の優先順位となり、IR0の優先順位が最も低く変更される。
【0013】
従って、割込入力IR2よりも先に、同程度の重要度を持つ割込入力IR3,5からの割込要求がなされているのにも係わらず、割込処理回路36によって次に受け付けられるのは、図10のタイミングチャートに示すように割込入力IR2からの割込要求となる。このことは、特に最も優先順位の低い割込入力IR5が、最悪の場合、今後IR2,3,4の3つの処理が終了する間の時間だけ待たされる可能性があることを意味する。
【0014】
また、割込処理回路36の受け付け可能な割込入力(割込要因)が上記例のように6本という少数ではなく、より多くの本数である場合には、待たなければならない時間がその分だけ長くなる可能性がある。従って、従来の割込処理回路36では、このような最悪の場合を考えてソフトウェアを作らなければならなかったので、それがソフトウェアのコーディング時の制約となってしまうという問題点があった。
【0015】
これに対し、上記問題の解決を図る別の方法もある。図11に示すように、IRRレジスタ12の前段にORゲート38を挿入し、例えば2つの割込入力IR00,IR01を1つの割込入力IR0として、それを処理するソフトウェアで解決する。この場合、割込入力の対象となる割込処理の先頭で、どちらの割込入力からの要求であるのかを調べ、前回処理した割込要因を前もって記憶させておいたメモリやレジスタを読み出して判断した上で処理を分岐する。
【0016】
しかし、この方法では、ORゲート38を追加するために、ハードウェアとソフトウェアの両方を変更しなければならず手間がかかるし、ソフトウェアでどちらの割込入力からの割込要求であるのかを調べる必要があるため、割込応答時間が長くなるなどの欠点があった。
【0017】
【発明が解決しようとする課題】
本発明の目的は、前記従来技術に基づく問題点を解消し、同等の優先順位を持つ複数の割込入力から割込要求がなされた場合に、割込要求がなされた順序とその優先順位とに応じて割込入力に優先順位を割り当て直すことができる割込処理回路を提供することにある。
【0018】
【課題を解決するための手段】
上記目的を達成するために、本発明は、複数の割込入力からの割込要求を記憶するとともに、割込処理が開始されると対応するビットの値がリセットされるIRRレジスタと、
現在処理中の割込処理に対応する割込入力を記憶するISRレジスタと、
割込処理が開始された時点のIRRレジスタの値を記憶するILRレジスタと、
現在処理中の割込処理が終了する毎に、前記IRRレジスタ、前記ISRレジスタおよび前記ILRレジスタの値に基づき、複数の前記割込入力のうち、前記ILRレジスタに割込要求が記憶された第1の割込入力に対して、前記ILRレジスタに割込要求が記憶されていないものの、現在処理中の割込処理が開始された後に割込要求がなされたことによって、前記IRRレジスタに割込要求が記憶された第2の割込入力に比較して高い優先順位を与える優先順位の割り当てし直しを行い、次に処理すべき最も優先順位の高い割込入力からの割込要求を判定する優先順位割当回路と、
全体の動作を制御するとともに、マイクロプロセッサとのインタフェースをとる制御回路とを備えていることを特徴とする割込処理回路を提供するものである。
ここで、前記優先順位割当回路が、さらに、前記第2の割込入力に対して、前記IRRレジスタに割込要求が記憶されていない第3の割込入力に比較して高い優先順位を与えることが好ましい。
前記優先順位割当回路が、さらに、前記ISRレジスタに記憶されている割込入力に対して一番低い優先順位を与えることが好ましい。
【0019】
【発明の実施の形態】
以下に、添付の図面に示す好適実施例に基づいて、本発明の割込処理回路を詳細に説明する。
【0020】
図1は、本発明の割込処理回路の一実施例のブロック構成図である。
図示例の割込処理回路10は、割込処理発生時の割込要求の状態を記憶しておき、割込処理終了時に、割込処理発生時に割込要求があった割込入力に対して優先的に高い優先順位を割り当てるように動作するもので、IRRレジスタ12と、ILRレジスタ14と、優先順位割当回路16’と、ISRレジスタ18と、制御回路20とを備えている。
【0021】
同図に示す本発明の割込処理回路10は、図8に示す従来の割込処理回路36との対比が容易となるように6本の割込入力IR0〜5を持つもので、ILRレジスタ14を備えている点と、優先順位割当回路16’の機能が多少異なる点を除いて、他の部分は従来の割込処理回路36と同じであるから、同一の機能を備える構成要素であるIRRレジスタ12、ISRレジスタ18および制御回路20には同一の符号を付して、その詳細な説明は省略する。
【0022】
割込処理回路10において、ILRレジスタ14は割込要求記憶レジスタであって、ILRレジスタ14には、IRRレジスタ12からの出力が入力されている。既に述べたように、IRRレジスタ12は、割込処理が開始されると、これに対応するビットの値が‘0’にリセットされる。ILRレジスタ14には、本実施例では、開始された割込処理に対応するビットの値が‘0’にリセットされた後のIRRレジスタ12の値が記憶される。
【0023】
ILRレジスタ14からの出力は、IRRレジスタ12からの出力とともに優先順位割当回路16’に入力されている。優先順位割当回路16’は、後述する優先順位レジスタを用いて、各割込処理が終了し、図示していないマイクロプロセッサ(以下、CPUという)から、割込処理の終了を意味する信号EOI(End Of Interrupt)が入力される毎に、各割込入力IR0〜5に対して優先順位の割り当てをし直す。
【0024】
続いて、図2に、本発明の割込処理回路で用いられる優先順位割当回路の一実施例のブロック構成図を示す。
同図に示すように、優先順位割当回路16’は、優先順位レジスタ22と、優先順位判定回路24と、優先順位変更回路26とを備えている。なお、同図には、IRRレジスタ12からの出力IRR0〜nとILRレジスタ14からの出力ILR0〜nとの論理積をとるANDゲート28も合わせて示してある。
【0025】
まず、優先順位レジスタ22は、割込入力IR0〜5の優先順位を割り当てる信号PRIを記憶する。信号PRIの状態は、割込入力の本数をn本とすると、その順列であるn!通り、本実施例の場合にはn=6であるから、信号PRIの順列の個数は6!=720通りとなる。従って、信号PRIとして、割り当てられた優先順位をそのままの形で記憶してもよいが、回路が大型化するのを防止するために信号PRIをエンコードするのが好ましい。
【0026】
なお、図示例では、割込入力の本数n=6の場合の一例を示しているが、実際には、割込入力の本数がさらに多い場合もあり得る。この場合、上述するように回路規模が大型化するため、これを防止するために、信号PRIをエンコードするだけでなく、全割込入力に対して、2〜3個の割込入力を1つのグループとしてまとめ、各々のグループに対して本発明を適用するようにすることで、実用上十分な効果を得るようにすることができる。
【0027】
続いて、優先順位判定回路24は、優先順位レジスタ22からの信号PRIに基づいて、ANDゲート28からの出力が‘1’、すなわち、現在処理中の割込処理とほぼ同時に割込要求され、もしくは、前回の割込処理が開始されてから、終了されるまでの間に割込要求がなされ、まだ割込処理が開始されていない最も優先順位の高い割込入力IR0〜5を判定する。その判定結果は、判定出力信号としてISRレジスタ18および優先順位変更回路26へ入力される。
【0028】
優先順位変更回路26は、上記優先順位判定回路24から出力され、ISRレジスタ18へ入力される判定出力信号と、IRRレジスタ12およびILRレジスタ14の値と、優先順位レジスタ22から出力される信号PRIの値とを用いて、以下に示す手順に従って新しい優先順位を決定する。この新しい優先順位は、CPUから信号EOIが入力されるタイミングで優先順位レジスタ22に記憶され、次の割込処理の優先順位を判定するために使用される。
【0029】
以下に、上記優先順位変更回路26が優先順位を決定する手順を示す。
手順1)ISRレジスタ18に‘1’がセットされているビット、すなわち、現在処理中の割込処理に対応する割込入力の優先順位を一番低くする。
手順2)ILRレジスタ14に‘1’がセットされているビットの内、現在の優先順位レジスタ22によって高い優先順位を割り当てられているビットから順に高い優先順位を割り当てる。
【0030】
なお、ILRレジスタ14に‘1’がセットされているビットに対応するIRRレジスタ12のビットには‘1’がセットされている。従って、上記手順2)では、ANDゲート28により、両者に‘1’がセットされているビット、すなわち、現在処理中の割込処理とほぼ同時に割込要求がなされ、もしくは、前回の割込処理が開始されてから、終了されるまでの間に割込要求がなされ、まだ割込処理が開始されていない割込入力に対応するビットを検出する。
【0031】
手順3)IRRレジスタ12に‘1’がセットされていて、かつ、上記手順2)の対象外のビット(IRRレジスタ12の値が‘1’で、かつ、ILRレジスタ14の値が‘0’のビット)の内、すなわち、現在処理中の割込処理が開始された後に割込要求がなされた割込入力に対応するビットの内、現在の優先順位レジスタ22によって高い優先順位を割り当てられているビットから順に高い優先順位を割り当てる。
【0032】
手順4)上記手順1)〜3)の対象外のビット(IRRレジスタ12の値が‘0’で、かつ、ILRレジスタ14の値が‘0’のビット)、すなわち、割込要求がなされていない割込要求に対応するビットに、あらかじめ決められている優先順位、例えば割込入力IR0〜5の添字の数値の小さい順もしくは大きい順に、あるいは、現在の優先順位レジスタ22によって高い優先順位を割り当てられているビットから順に高い優先順位を順次割り当てる。
【0033】
手順5)最後に、上記手順1)〜4)に従って割り当てた優先順位、もしくは、これをエンコードした値を優先順位レジスタ22に記憶する。
【0034】
本発明の割込処理回路10の構成は、基本的に以上のようなものである。
次に、本発明の割込処理回路10の動作について説明する。
【0035】
割込入力IR5〜0は、図3(a)の信号PRIの値で示すように、同じく小さい数字を与えられている割込入力ほど高い優先順位を持つものとする。ここで、同図(b)に示すように、割込入力IR0,3,5から同時に割込要求がなされ、各々対応するIRRレジスタ12のビット0,3,5の値が‘1’になったとする。この時の優先順位は割込入力IR0が最も高いため、割込処理回路10は、まず、割込入力IR0からの割込要求を受け付ける。
【0036】
割込入力IR0を受け付けると、割込処理回路10は、IRRレジスタ12の割込入力IR0に対応するビットを‘0’にリセットし、ISRレジスタ18の割込入力IR0に対応するビットの値を‘1’にセットする。図3(c)に示すように、リセット後のIRRレジスタ12の値はこの時点でILRレジスタ14に記憶される。そして、制御回路20によってCPUに対して割込要求を行う。これ以後の動作は既に述べた通りである。
【0037】
ここで、この割込入力IR0に対応する割込処理中にさらに割込入力IR2が入力されたとする。図3(d)に示すように、この時のIRRレジスタ12の値は、割込入力2,3,5に各々対応するビット2,3,5の値が‘1’となるが、ILRレジスタ14のビット2の値は‘0’のままである。なお、割込入力IR2は同IR0よりも優先順位が低いので、現在処理中の割込入力IR0に対応する割込処理を中断して同IR2に対応する処理には移行しない。
【0038】
その後、割込入力IR0に対応する割込処理が終了し、CPUの発行する信号EOIを割込処理回路10が受け取ると、優先順位割当回路16’は、図3(e)に示すように、まず、手順1)に従って割込入力IR0に対応する優先順位を最下位の‘5’とし、手順2)に従って、ILRレジスタ14の値と信号PRIの状態から割込入力IR3に最上位の優先順位‘0’を、割込入力IR5に第2位の優先順位‘1’をそれぞれ割り当てる。
【0039】
続いて、手順3)に従って、IRRレジスタ12の値と信号PRIの状態から、割込入力IR2に第3位の優先順位‘2’を割り当て、手順4)に従って、信号PRIによって割り当てられている優先順位の順序で割込入力IR1に第4位の優先順位‘3’を、また、割込入力IR4に第5位の優先順位‘4’をそれぞれ割り当てる。そして、割り当てられた優先順位は、手順5)に従って優先順位レジスタ22に記憶される。
【0040】
同じようにして、割込処理回路10は、割込入力IR3を受け付けて、図4(f)に示すように、同じくIRRレジスタ12の割込入力IR3に対応するビットを‘0’にリセットし、ISRレジスタ18の割込入力IR3に対応するビットの値を‘1’にセットする。リセット後のIRRレジスタ12の値はこの時点でILRレジスタ14に記憶される。そして、制御回路20によってCPUに対して割込要求を行う。これ以後の動作は同じである。
【0041】
ここで、この割込入力IR3に対応する割込処理中にさらに割込入力IR1が入力されると、図4(g)に示すように、この時のIRRレジスタ12の値は、割込入力1,2,5に各々対応するビット1,2,5の値が‘1’となるが、ILRレジスタ14のビット1の値は‘0’のままである。なお、割込入力IR1は同IR3よりも優先順位が低いので、現在処理中の割込入力IR3に対応する割込処理を中断して同IR1に対応する処理には移行しない。
【0042】
その後、割込入力IR0に対応する割込処理が終了し、CPUの発行する信号EOIを割込処理回路10が受け取ると、優先順位割当回路16’は、手順1)〜5)に従って、割込入力IR0〜5に対して優先順位をそれぞれ割り当てる。すなわち、図4(h)に示すように、割込入力IR5に最上位の優先順位を割り当て、以下同様にして、割込入力IR2,1,4,0,3の順に優先順位を割り当てる。
【0043】
このように、本発明の割込処理回路10では、同時に複数の割込入力から割込要求がなされた場合には、優先順位レジスタにあらかじめ記憶されている優先順位に従って、また異なるタイミングで複数の割込入力から割込要求がなされた場合には割込要求がなされた順序に従って、優先順位を割り当てし直すことによって、図5のタイミングチャートに示すように、割込入力IR0,3,5,2,1の順に割込処理が開始される。
【0044】
続いて、図6に、優先順位判定回路の一実施例の構成回路図を示す。
まず、同図は、割込入力が2本の場合の本発明の割込処理回路10で用いられる優先順位判定回路24であって、ANDゲート30と、2つのAND−ORゲート32とから構成されている。なお、同図に示すANDゲート28は、図2に示すANDゲート28であり、各々ビット0,1に対応するANDゲート28の出力を信号IN0,1としてある。
【0045】
同図において、信号PRIは優先順位レジスタ22からの出力であり、優先順位を示す値をエンコードしたものである。従って、信号PRIが‘0’の場合には割込入力IR0が優先され、信号PRIが‘1’の場合には割込入力IR1が優先される。また、信号IS0,1は、ISRレジスタ18に入力される判定出力信号であって、信号PRIおよび信号IN0,1の状態に応じて図7の真理値表に示す通りに決定される。
【0046】
既に述べたように、従来の割込処理回路では、各割込入力に対してある程度優先順位が固定されている。これに対し、本発明の割込処理回路10では、割込処理発生時の割込要求の状態を記憶しておき、割込処理終了時に、割込処理発生時に割込要求があった割込入力に対して優先的に高い優先順位を割り当てるように動作するため、低順位の割込入力からの割込要求が必要以上に待たされることがないという利点がある。
【0047】
本発明の割込処理回路は、基本的に以上のようなものである。
以上、本発明の割込処理回路について詳細に説明したが、本発明は上記実施例に限定されず、本発明の主旨を逸脱しない範囲において、種々の改良や変更をしてもよいのはもちろんである。
【0048】
【発明の効果】
以上詳細に説明した様に、本発明の割込処理回路は、現在処理中の割込処理が終了する毎に、IRRレジスタ、ISRレジスタおよびILRレジスタの値に基づき、複数の割込入力に対して優先順位の割り当てをし直し、次に処理すべき最も優先順位の高い割込入力からの割込要求を判定するようにしたものである。
これにより、本発明の割込処理回路によれば、同等の優先順位を持つ複数の割込入力から割込要求がなされた場合に、割込要求がなされた順序とその優先順位とに従って割込処理を行わせることができ、低順位の割込入力からの割込要求に対する処理が滞るという不都合の発生を防止することができる。
【図面の簡単な説明】
【図1】 本発明の割込処理回路の一実施例のブロック構成図である。
【図2】 本発明の割込処理回路で用いられる優先順位割当回路の一実施例のブロック構成図である。
【図3】 (a)〜(e)は、図1に示す本発明の割込処理回路の動作に対応する一実施例の表である。
【図4】 (f)〜(h)は、図1に示す本発明の割込処理回路の続きの動作に対応する一実施例の表である。
【図5】 本発明の割込処理回路の動作を表す一実施例のタイミングチャートである。
【図6】 本発明の割込処理回路で用いられる優先順位判定回路の一実施例の構成回路図である。
【図7】 図6に示す優先順位判定回路の動作を表す一実施例の真理値表である。
【図8】 従来の割込処理回路の一例のブロック構成図である。
【図9】 (a)〜(d)は、図8に示す従来の割込処理回路の動作に対応する一実施例の表である。
【図10】 従来の割込処理回路の動作を表す一例のタイミングチャートである。
【図11】 従来の割込処理回路の別の例のブロック構成図である。
【符号の説明】
10,36 割込処理回路
12 IRRレジスタ
14 ILRレジスタ
16,16’ 優先順位割当回路
18 ISRレジスタ
20 制御回路
22 優先順位レジスタ
24 優先順位判定回路
26 優先順位変更回路
28,30 ANDゲート
32 AND−ORゲート
38 ORゲート[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an interrupt processing circuit that sequentially processes interrupt requests from a plurality of interrupt inputs having the same importance according to priority.
[0002]
[Prior art]
The interrupt processing circuit accepts and processes interrupt requests from external factors. When interrupt processing is started, the current processing is interrupted and the interrupt processing is executed. The original process that was interrupted later is resumed. A conventional interrupt processing circuit has a plurality of interrupt inputs, as represented by an interrupt controller of model number 8259 manufactured by Intel, for example, and priorities determined in hardware for each interrupt input are determined. Is given.
[0003]
The interrupt controller of model No. 8259 adopts a method called automatic rotation. For example, as disclosed in Japanese Patent Laid-Open No. 4-363748, this method sets the priority order of interrupt inputs currently being interrupted at the end of the processing, that is, a microprocessor (hereinafter referred to as a CPU). ) Is the lowest when an EOI (End Of Interrupt) is received, and a predetermined priority order is sequentially assigned to other interrupt inputs.
[0004]
In this case, the priority order can be changed by software to some extent, but in general, it is difficult to dynamically change the priority order according to the situation. In particular, if the priority is determined in advance when the interrupt input has the same level of importance, since the interrupt processing for the interrupt request from the higher-order interrupt input is performed sequentially, the lower-order There was a situation where processing for interrupt requests from interrupt inputs was delayed, causing inconvenience.
[0005]
Hereinafter, the conventional interrupt processing circuit and its problems will be described by taking the interrupt processing circuit adopting the above-described automatic rotation as an example.
FIG. 8 is a block diagram showing an example of the internal structure of a conventional interrupt processing circuit.
The
[0006]
In the
[0007]
Subsequently, the priority
The
[0008]
Finally, the
[0009]
As shown by the value of the signal PRI in FIG. 9A, the interrupt inputs IR5 to IR0 have a higher priority as the interrupt input is given a smaller number. Here, as shown in FIG. 5B, when interrupt requests are simultaneously made from the interrupt inputs IR0, 3 and 5, the values of the
[0010]
Upon receiving the interrupt input IR0, the
[0011]
Here, it is assumed that the interrupt input IR2 is further input during the interrupt process corresponding to the interrupt input IR0. At this time, as shown in FIG. 9C, the values of the
[0012]
After that, when the interrupt processing corresponding to the interrupt input IR0 is completed and the
[0013]
Accordingly, the
[0014]
In addition, when the number of interrupt inputs (interrupt factors) that can be accepted by the
[0015]
On the other hand, there is another method for solving the above problem. As shown in FIG. 11, an
[0016]
However, in this method, in order to add the
[0017]
[Problems to be solved by the invention]
An object of the present invention is to solve the problems based on the prior art, and when an interrupt request is made from a plurality of interrupt inputs having the same priority, the order in which the interrupt requests are made and the priority thereof, It is an object of the present invention to provide an interrupt processing circuit capable of reassigning the priority order to the interrupt input according to the above.
[0018]
[Means for Solving the Problems]
To achieve the above object, the present invention stores an interrupt request from a plurality of interrupt inputs, and resets the value of a corresponding bit when an interrupt process is started,
An ISR register that stores an interrupt input corresponding to the interrupt process currently being processed;
An ILR register for storing the value of the IRR register at the time when the interrupt processing is started;
The interrupt request stored in the ILR register among the plurality of interrupt inputs based on the values of the IRR register, the ISR register, and the ILR register each time the interrupt process currently being processed ends . Although no interrupt request is stored in the ILR register for an interrupt input of 1, an interrupt request is made after the interrupt process currently being processed is started. request have rows reallocate priority providing a second higher priority compared to the interrupt input stored, then determine the interrupt request from the high interrupt input highest priority to be processed A priority assignment circuit to
There is provided an interrupt processing circuit characterized by comprising a control circuit for controlling the entire operation and interfacing with a microprocessor.
Here, the priority assignment circuit further to the second interrupt input, given compared to high priority on third interrupt input the interrupt request to the IRR register is not stored and Turkey is preferred.
The priority assignment circuit further includes a Turkey gives the lowest priority to an interrupt input which is remembers the ISR register is preferred.
[0019]
DETAILED DESCRIPTION OF THE INVENTION
In the following, the interrupt processing circuit of the present invention will be described in detail based on a preferred embodiment shown in the accompanying drawings.
[0020]
FIG. 1 is a block diagram of an embodiment of an interrupt processing circuit according to the present invention.
The interrupt
[0021]
The interrupt
[0022]
In the interrupt
[0023]
The output from the
[0024]
Next, FIG. 2 shows a block diagram of an embodiment of a priority order assignment circuit used in the interrupt processing circuit of the present invention.
As shown in the figure, the priority
[0025]
First, the priority order register 22 stores a signal PRI for assigning priority orders of the interrupt inputs IR0 to IR5. The state of the signal PRI is a permutation n! Where n is the number of interrupt inputs. As described above, since n = 6 in this embodiment, the number of permutations of the signal PRI is 6! = 720. Therefore, the assigned priority order may be stored as it is as the signal PRI, but it is preferable to encode the signal PRI in order to prevent the circuit from becoming large.
[0026]
In the illustrated example, an example in which the number of interrupt inputs n = 6 is shown, but in practice, there may be a larger number of interrupt inputs. In this case, since the circuit scale is increased as described above, in order to prevent this, not only the signal PRI is encoded, but two to three interrupt inputs are provided for all interrupt inputs. By combining the present invention as a group and applying the present invention to each group, a practically sufficient effect can be obtained.
[0027]
Subsequently, based on the signal PRI from the
[0028]
The
[0029]
The procedure for determining priority by the
Procedure 1) Lower the bit of which “1” is set in the
Procedure 2) Among the bits for which "1" is set in the
[0030]
Note that “1” is set to the bit of the IRR register 12 corresponding to the bit for which “1” is set in the
[0031]
Procedure 3) '1' is set in the
[0032]
Procedure 4) Bits not subject to the above procedures 1) to 3) (bits with the value of the
[0033]
Step 5) Finally, the priority assigned according to the above steps 1) to 4) or the encoded value is stored in the
[0034]
The configuration of the interrupt
Next, the operation of the interrupt
[0035]
As shown by the value of the signal PRI in FIG. 3 (a), the interrupt inputs IR5 to 0 have higher priority as the interrupt inputs given the same small numbers. Here, as shown in FIG. 5B, interrupt requests are simultaneously made from the interrupt inputs IR0, 3, and 5, and the values of the
[0036]
When receiving the interrupt input IR0, the interrupt
[0037]
Here, it is assumed that the interrupt input IR2 is further input during the interrupt process corresponding to the interrupt input IR0. As shown in FIG. 3 (d), the value of the
[0038]
After that, when the interrupt processing corresponding to the interrupt input IR0 is completed and the interrupt
[0039]
Subsequently, according to the procedure 3), the third priority “2” is assigned to the interrupt input IR2 from the value of the
[0040]
Similarly, the interrupt
[0041]
Here, when the interrupt input IR1 is further input during the interrupt processing corresponding to the interrupt input IR3, the value of the
[0042]
Thereafter, when the interrupt processing corresponding to the interrupt input IR0 is completed and the interrupt
[0043]
As described above, in the interrupt
[0044]
Next, FIG. 6 shows a configuration circuit diagram of an embodiment of the priority determination circuit.
First, FIG. 2 shows a
[0045]
In the figure, a signal PRI is an output from the
[0046]
As already described, in the conventional interrupt processing circuit, the priority order is fixed to some extent for each interrupt input. On the other hand, in the interrupt
[0047]
The interrupt processing circuit of the present invention is basically as described above.
The interrupt processing circuit of the present invention has been described in detail above. However, the present invention is not limited to the above-described embodiment, and various modifications and changes may be made without departing from the spirit of the present invention. It is.
[0048]
【The invention's effect】
As described above in detail, the interrupt processing circuit according to the present invention is configured to process a plurality of interrupt inputs based on the values of the IRR register, the ISR register, and the ILR register each time the interrupt process currently being processed is completed. The priority is reassigned, and the interrupt request from the interrupt input with the highest priority to be processed next is determined.
Thus, according to the interrupt processing circuit of the present invention, when an interrupt request is made from a plurality of interrupt inputs having the same priority, the interrupt is made according to the order in which the interrupt requests are made and the priority. Processing can be performed, and the occurrence of inconvenience that processing for interrupt requests from low-order interrupt inputs is delayed can be prevented.
[Brief description of the drawings]
FIG. 1 is a block diagram of an embodiment of an interrupt processing circuit according to the present invention.
FIG. 2 is a block configuration diagram of an embodiment of a priority assignment circuit used in the interrupt processing circuit of the present invention.
FIGS. 3A to 3E are tables of an embodiment corresponding to the operation of the interrupt processing circuit of the present invention shown in FIG.
4 (f) to (h) are tables of an embodiment corresponding to the subsequent operation of the interrupt processing circuit of the present invention shown in FIG.
FIG. 5 is a timing chart of an embodiment showing the operation of the interrupt processing circuit of the present invention.
FIG. 6 is a configuration circuit diagram of an embodiment of a priority determination circuit used in the interrupt processing circuit of the present invention.
7 is a truth table of one embodiment showing the operation of the priority determination circuit shown in FIG. 6. FIG.
FIG. 8 is a block diagram of an example of a conventional interrupt processing circuit.
9 (a) ~ (d) is a table of an example corresponding to the operation of the conventional interrupt processing circuit shown in FIG.
FIG. 10 is a timing chart showing an example of the operation of a conventional interrupt processing circuit.
FIG. 11 is a block diagram of another example of a conventional interrupt processing circuit.
[Explanation of symbols]
10, 36 Interrupt processing
Claims (3)
現在処理中の割込処理に対応する割込入力を記憶するISRレジスタと、
割込処理が開始された時点のIRRレジスタの値を記憶するILRレジスタと、
現在処理中の割込処理が終了する毎に、前記IRRレジスタ、前記ISRレジスタおよび前記ILRレジスタの値に基づき、複数の前記割込入力のうち、前記ILRレジスタに割込要求が記憶された第1の割込入力に対して、前記ILRレジスタに割込要求が記憶されていないものの、現在処理中の割込処理が開始された後に割込要求がなされたことによって、前記IRRレジスタに割込要求が記憶された第2の割込入力に比較して高い優先順位を与える優先順位の割り当てし直しを行い、次に処理すべき最も優先順位の高い割込入力からの割込要求を判定する優先順位割当回路と、
全体の動作を制御するとともに、マイクロプロセッサとのインタフェースをとる制御回路とを備えていることを特徴とする割込処理回路。An IRR register that stores interrupt requests from a plurality of interrupt inputs and that resets the value of the corresponding bit when the interrupt processing is started;
An ISR register that stores an interrupt input corresponding to the interrupt process currently being processed;
An ILR register for storing the value of the IRR register at the time when the interrupt processing is started;
The interrupt request stored in the ILR register among the plurality of interrupt inputs based on the values of the IRR register, the ISR register, and the ILR register each time the interrupt process currently being processed ends . Although no interrupt request is stored in the ILR register for an interrupt input of 1, an interrupt request is made after the interrupt process currently being processed is started. request have rows reallocate priority providing a second higher priority compared to the interrupt input stored, then determine the interrupt request from the high interrupt input highest priority to be processed A priority assignment circuit to
An interrupt processing circuit comprising a control circuit for controlling the entire operation and interfacing with a microprocessor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP35019399A JP4250283B2 (en) | 1999-12-09 | 1999-12-09 | Interrupt processing circuit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP35019399A JP4250283B2 (en) | 1999-12-09 | 1999-12-09 | Interrupt processing circuit |
Publications (3)
Publication Number | Publication Date |
---|---|
JP2001166951A JP2001166951A (en) | 2001-06-22 |
JP2001166951A5 JP2001166951A5 (en) | 2007-01-25 |
JP4250283B2 true JP4250283B2 (en) | 2009-04-08 |
Family
ID=18408856
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP35019399A Expired - Lifetime JP4250283B2 (en) | 1999-12-09 | 1999-12-09 | Interrupt processing circuit |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4250283B2 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100817047B1 (en) | 2004-02-27 | 2008-03-26 | 삼성전자주식회사 | Interrupt controller |
JP2007310438A (en) * | 2006-05-16 | 2007-11-29 | Kawasaki Microelectronics Kk | Interruption processing circuit |
JP5144407B2 (en) * | 2008-07-07 | 2013-02-13 | 株式会社オートネットワーク技術研究所 | Signal processing apparatus, signal processing method, and relay apparatus |
-
1999
- 1999-12-09 JP JP35019399A patent/JP4250283B2/en not_active Expired - Lifetime
Also Published As
Publication number | Publication date |
---|---|
JP2001166951A (en) | 2001-06-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7533206B2 (en) | Resource management device | |
US8312229B2 (en) | Method and apparatus for scheduling real-time and non-real-time access to a shared resource | |
US7127539B2 (en) | Statistic method for arbitration | |
US7739437B2 (en) | Access arbiter and arbitrable condition verification device | |
JPH04260954A (en) | Arbitration system and method | |
US6473780B1 (en) | Scheduling of direct memory access | |
US20050080942A1 (en) | Method and apparatus for memory allocation | |
US6907491B2 (en) | Methods and structure for state preservation to improve fairness in bus arbitration | |
JP2009301588A (en) | Access controller, access control integrated circuit, and access control method | |
JP4250283B2 (en) | Interrupt processing circuit | |
US7155717B2 (en) | Apportioning a shared computer resource | |
US5481726A (en) | Information processing system having a plurality of processors | |
US20050066093A1 (en) | Real-time processor system and control method | |
JP2004038967A (en) | Method and device which can control use frequency of bus | |
US7836235B2 (en) | Resource management device | |
JPH0727507B2 (en) | Channel selection arbitration | |
JP2006215621A (en) | Dma controller | |
JPS6368934A (en) | Task scheduing system | |
WO2017036041A1 (en) | Data synchronous access method and synchronous access device | |
US5799160A (en) | Circuit and method for controlling bus arbitration | |
US8732369B1 (en) | Minimal-cost pseudo-round-robin arbiter | |
JP4190629B2 (en) | Multiprocessor system | |
JP2005173859A (en) | Memory access control circuit | |
JP2008250419A (en) | Competition arbitration apparatus, master-slave system, and method for competition arbitration | |
JPH11219585A (en) | Refresh control system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20061205 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20061205 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20080707 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20080715 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20080912 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20081118 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20081201 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20090113 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20090119 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120123 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4250283 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120123 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130123 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130123 Year of fee payment: 4 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140123 Year of fee payment: 5 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R360 | Written notification for declining of transfer of rights |
Free format text: JAPANESE INTERMEDIATE CODE: R360 |
|
R360 | Written notification for declining of transfer of rights |
Free format text: JAPANESE INTERMEDIATE CODE: R360 |
|
R371 | Transfer withdrawn |
Free format text: JAPANESE INTERMEDIATE CODE: R371 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
EXPY | Cancellation because of completion of term |