JP2007310438A - Interruption processing circuit - Google Patents

Interruption processing circuit Download PDF

Info

Publication number
JP2007310438A
JP2007310438A JP2006136031A JP2006136031A JP2007310438A JP 2007310438 A JP2007310438 A JP 2007310438A JP 2006136031 A JP2006136031 A JP 2006136031A JP 2006136031 A JP2006136031 A JP 2006136031A JP 2007310438 A JP2007310438 A JP 2007310438A
Authority
JP
Japan
Prior art keywords
interrupt
input
request
priority
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.)
Pending
Application number
JP2006136031A
Other languages
Japanese (ja)
Inventor
Yutaka Fujimaki
裕 藤巻
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.)
Kawasaki Microelectronics Inc
Original Assignee
Kawasaki Microelectronics Inc
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 Kawasaki Microelectronics Inc filed Critical Kawasaki Microelectronics Inc
Priority to JP2006136031A priority Critical patent/JP2007310438A/en
Publication of JP2007310438A publication Critical patent/JP2007310438A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To make the request of interruption processing to a CPU in the order of the generation of interruption requests when a plurality of interruption requests are made. <P>SOLUTION: This interruption processing circuit is provided with a generation order storage circuit 3 for assigning and storing priority orders to a plurality of interrupting inputs having the same priority order according to the generation order of the interruption requests. The generation order storage circuit 3 requests interruption processing to a CPU about the interrupting input whose priority order is the highest, and each time the interruption processing about the interrupting input whose priority order is the highest is completed, the generation order storage circuit 3 updates the storage content so that the priority order about the residual interrupting inputs whose interruption requests have been made can be advanced by one. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、同一の優先順位をもつ複数の割込み入力に割込み要求があったとき、割込み要求の発生の順序にしたがって、割込み入力に応じた割込み処理をCPUに要求する割込み処理回路に関するものである。   The present invention relates to an interrupt processing circuit that requests an interrupt process according to an interrupt input from a CPU according to the order of generation of the interrupt request when an interrupt request is made to a plurality of interrupt inputs having the same priority. .

割込み処理回路(割込みコントローラ)は、CPUと周辺装置との間に介在し、周辺装置から割込み要求があった場合に、予め設定した優先順位に基づいて、優先順位の高い割込み入力への割込み要求から順にCPUに対して割込み処理を要求するものである。CPUに対して割込み処理が要求されると、CPUは現在実行中の処理を中断して割込み処理を実行し、割込み処理の完了後に中断された元の処理が再開される。   An interrupt processing circuit (interrupt controller) is interposed between the CPU and the peripheral device, and when there is an interrupt request from the peripheral device, an interrupt request to an interrupt input with a high priority based on a preset priority order The CPU requests interrupt processing sequentially from the CPU. When an interrupt process is requested to the CPU, the CPU interrupts the currently executing process and executes the interrupt process, and the interrupted original process is resumed after the interrupt process is completed.

従来の割込み処理回路は、例えばインテル社製の8259という割込みコントローラに代表されるように、複数の割込み入力を持ち、各割込み入力についてハードウエア的に予め決定された優先順位が与えられている。   A conventional interrupt processing circuit has a plurality of interrupt inputs, as represented by an interrupt controller 8259 made by Intel, for example, and given a priority order determined in advance for each interrupt input.

このような割込み処理回路を使用して、優先度が同一の複数の割込み要求について、その割込み要求の発生順に処理を希望する場合には、予め定められた優先順位になってしまうので、期待した順番で割り込み処理が実行されないという問題があった。これは多重割込み時(ある割込み処理の実行中に別の割込み要求が発生する時)が顕著な例である。   Using such an interrupt processing circuit, if you want to process multiple interrupt requests with the same priority in the order in which the interrupt requests are generated, it will be in a predetermined priority order. There was a problem that interrupt processing was not executed in order. This is a remarkable example when multiple interrupts occur (when another interrupt request is generated during execution of a certain interrupt process).

図4は従来の割込み処理回路の構成を示すブロック図、図5はこの割込み処理回路を使用した多重割込み時の処理の説明図である。図4において、1は4個の割込み入力IR0〜IR3を受け付ける割込み要求レジスタ(IRR)、6は割込み入力IR0に最優先を割り当て、IR1,IR2,IR3の順に低い優先順位を割り当てた優先順位割当回路、4は現在割込み処理が行われている割込み入力を示すインサービスレジスタ(ISR)、5はCPUとの間で指令のやりとりを行い、割込み要求レジスタ1、優先順位割当回路6、インサービスレジスタ4を制御する制御回路である。   FIG. 4 is a block diagram showing the configuration of a conventional interrupt processing circuit, and FIG. 5 is an explanatory diagram of processing at the time of multiple interrupts using this interrupt processing circuit. In FIG. 4, 1 is an interrupt request register (IRR) for receiving four interrupt inputs IR0 to IR3, 6 is a priority assignment in which the highest priority is assigned to the interrupt input IR0 and the lower priority is assigned in the order of IR1, IR2, IR3. Circuit 4 is an in-service register (ISR) indicating an interrupt input for which interrupt processing is currently being performed, 5 is a command exchange with the CPU, interrupt request register 1, priority allocation circuit 6, in-service register 4 is a control circuit for controlling 4.

割込み要求レジスタ1は、割込み入力IR0〜IR3のいずれか1つに割込み要求があると、当該割込み入力に対応する出力に「1」のフラグを立て、優先順位割当回路6と制御回路5に送る。他に割り込み入力がないときは、制御回路5はこの入力に基づきCPUに割込み要求(INT)を出力し、CPUから割込み許可(INTAの反転)」を受けると割込み要求レジスタ1の当該「1」のフラグを「0」にリセットし、次の割込み要求を受け付け可能にする。インサービスレジスタ4は、制御回路5によって、CPUの割込み処理中は当該割込み入力に対応する内容を「1」にして、現在の処理がどの割込み入力についての割込み処理であるかを示し、制御回路5がCPUから割込み処理完了(EOI)を受けると、その制御回路5によって該当内容が「0」にリセットされる。   When there is an interrupt request for any one of the interrupt inputs IR0 to IR3, the interrupt request register 1 sets a flag “1” on the output corresponding to the interrupt input and sends it to the priority assignment circuit 6 and the control circuit 5. . When there is no other interrupt input, the control circuit 5 outputs an interrupt request (INT) to the CPU based on this input, and upon receiving an interrupt permission (inversion of INTA) from the CPU, the corresponding “1” in the interrupt request register 1 Is reset to “0” so that the next interrupt request can be accepted. The in-service register 4 sets the content corresponding to the interrupt input to “1” during the interrupt processing of the CPU by the control circuit 5 and indicates which interrupt input the current processing is. When 5 receives an interrupt processing completion (EOI) from the CPU, the control circuit 5 resets the corresponding content to “0”.

このような構成の割込み処理回路を使用して、ユーザがシステムを構築するときは、使用する割込み要求の優先順位を予め把握して、割込み入力IR0〜IR3に割り当てることが必要となる。この例では、割込み入力としてIR0〜IR3を使用することになるが、ユーザは割込み入力IR1,IR2,IR3が機能的に同一優先度のものを想定しているものとする。   When the user constructs a system using the interrupt processing circuit having such a configuration, it is necessary to grasp in advance the priority order of interrupt requests to be used and assign them to the interrupt inputs IR0 to IR3. In this example, IR0 to IR3 are used as interrupt inputs, but it is assumed that the user assumes that the interrupt inputs IR1, IR2, and IR3 have the same functional priority.

この場合は、図5に示すように、まず、CPUがメインルーチンを実行しているときに、最初の割込み入力IR0に割込み要求が発生すると、処理はメインルーチンから割り込み入力IR0に対応する割込みルーチンに飛ぶ。この割込み入力IR0に対応する割込みルーチンの実行中に割り込み入力IR3に割込み要求が発生しても、割込み入力IR0が最優先であるのでその割込み入力IR3の処理に飛ぶことはない。その後に割込み入力IR2に割込み要求が発生しても、先と同様に、割込み入力IR0に対応するルーチンの処理の実行が続く。その後にさらに割込み入力IR1に割込み要求が発生しても、同様に割り込み入力IR0に対応する割込みルーチンの処理の実行が続く。   In this case, as shown in FIG. 5, first, when an interrupt request is generated at the first interrupt input IR0 while the CPU is executing the main routine, the processing is interrupted from the main routine to the interrupt routine corresponding to the interrupt input IR0. Fly to. Even if an interrupt request is generated in the interrupt input IR3 during execution of the interrupt routine corresponding to the interrupt input IR0, the interrupt input IR0 has the highest priority, so that the processing of the interrupt input IR3 is not skipped. After that, even if an interrupt request is generated at the interrupt input IR2, the routine corresponding to the interrupt input IR0 continues to be executed as before. Thereafter, even if an interrupt request is further generated at the interrupt input IR1, the execution of the interrupt routine corresponding to the interrupt input IR0 continues.

割込み入力IR0に対応する割込みルーチンの処理が完了すると、割込み処理回路はサービスを待つ割込み入力について、その状態を記憶している割込み要求レジスタ1のフラグを読み、割込み入力IR1,IR2,IR3が処理待ちであることを認識する。このような場合、ユーザは、割込み入力IR1,IR2,IR3に優先度が同一と想定した割込み要求を接続していたのであるから、本来発生順序に従ってIR3,IR2,IR1の順序で割込みが処理されることを期待する。   When the processing of the interrupt routine corresponding to the interrupt input IR0 is completed, the interrupt processing circuit reads the flag of the interrupt request register 1 storing the status of the interrupt input waiting for service, and the interrupt inputs IR1, IR2, and IR3 process them. Recognize that you are waiting. In such a case, since the user connected an interrupt request with the same priority to the interrupt inputs IR1, IR2, and IR3, the interrupts are processed in the order of IR3, IR2, and IR1 according to the original generation order. I hope that.

ところが、実際には、図4の割込み処理回路では、優先順位割当回路6の優先順位割当を参照して、この中で最も優先順位が高い割込み入力IR1についてのサービスを行うことを決定をする。その割込み入力IR1に対応する割込みルーチンの処理の実行中に割り込み入力IR0に要求が発生しなければ、その割込み入力IR1に対応する割込みルーチンの処理が完了したところで、次の優先順位の割込み入力IR2に対応する割込みルーチンの処理へと移る。その後、その割込み入力IR2に対応する割込みルーチンの処理の実行中に割り込み入力IR0,IR1に要求が発生しなければ、その割込み入力IR2に対応する割込みルーチンの処理が完了したところで、次の優先順位の割込み入力IR3に対応する割込みルーチンの処理へと移る。   However, in practice, the interrupt processing circuit of FIG. 4 refers to the priority order assignment of the priority order assignment circuit 6 and determines to service the interrupt input IR1 having the highest priority among them. If no request is generated for the interrupt input IR0 during the execution of the interrupt routine corresponding to the interrupt input IR1, the interrupt input IR2 of the next priority is completed when the processing of the interrupt routine corresponding to the interrupt input IR1 is completed. The process proceeds to the interrupt routine corresponding to. Thereafter, if a request is not generated for the interrupt inputs IR0 and IR1 during the execution of the interrupt routine corresponding to the interrupt input IR2, the next priority is given when the processing of the interrupt routine corresponding to the interrupt input IR2 is completed. The process proceeds to the interrupt routine corresponding to the interrupt input IR3.

このように、図4に示す割込み処理回路では、ユーザが期待した順序で割込み処理が行われない場合がある。すなわち、図5のIR3のように、早く発生したにもかかわらず実行までに長時間待たされる場合がある。   As described above, in the interrupt processing circuit shown in FIG. 4, interrupt processing may not be performed in the order expected by the user. That is, there is a case where a long time is required before execution even though it occurs early, like IR3 in FIG.

従来では、割込み要求の発生順を検出する提案として、割込み要求の発生時刻情報をメモリに書き込むもの(特許文献1)がある。また、割込み順序を設定する割込み順序設定センスレジスタを設けて、その内容に基づいて割込み発生順序を認識して発生順に処理するもの(特許文献2)もある。
特開平11−338712号公報 特開平08−212082号公報
Conventionally, as a proposal for detecting the order in which interrupt requests are generated, there is a method of writing interrupt request generation time information in a memory (Patent Document 1). In addition, there is an interrupt order setting sense register for setting an interrupt order, which recognizes the interrupt generation order based on the contents thereof and processes them in the order of generation (Patent Document 2).
JP-A-11-338712 Japanese Patent Laid-Open No. 08-212082

ところが、特許文献1に記載の手法は、障害発生時に割込み要求発生の正確な順序をトレースすることができるようにするためであり、発生順により優先度を決めることについては記載がない。また、特許文献2に記載の手法は、割込み要求の発生順序を認識しその順序にその順に処理するものであるが、割込み順序設定センスレジスタの内容を読み出して処理するので、次に処理する割込みがどれになるかを決めるには比較や決定処理を行う特別なソフトウエア処理が必要となる。   However, the method described in Patent Document 1 is intended to enable tracing of the exact order of occurrence of interrupt requests when a failure occurs, and there is no description about determining the priority according to the order of occurrence. The technique described in Patent Document 2 recognizes the generation order of interrupt requests and processes them in that order. However, since the contents of the interrupt order setting sense register are read and processed, the interrupt to be processed next is processed. A special software process that performs comparison and decision processing is required to determine which one will be.

本発明の目的は、複数の割込みの要求があった場合に、特別なソフトウエア処理を必要とすることなく、割込み要求の発生順にCPUに対して割込み処理の要求を行うことができるようにした割込み処理回路を提供することである。   An object of the present invention is to enable interrupt processing requests to the CPU in the order in which interrupt requests are generated without requiring special software processing when there are a plurality of interrupt requests. An interrupt processing circuit is provided.

上記目的を達成するために、請求項1にかかる発明の割込み処理回路は、同一の優先順位をもつ複数の割込み入力に割込み要求があったとき、該割込み要求の発生の順序にしたがって、前記割込み入力に応じた割込み処理をCPUに要求する割込み処理回路であって、前記複数の割込み入力の個々について、前記割込み要求の発生順序にしたがって優先順位を割り振って記憶する発生順序記憶手段を備え、該発生順序記憶手段は、最優先順位の割込み入力について前記CPUに対して割込み処理を要求し、最優先順位の割込み入力についての割込み処理が完了する毎に、割込み要求のあった残りの割込み入力について前記優先順位を1つづつ繰り上げるよう記憶内容が更新されることを特徴とする。
請求項2にかかる発明は、請求項1に記載の割込み処理回路において、割込み要求があった割込み入力について個々にフラグを立てると共に割込み処理が完了した割込み入力については該フラグをリセットし、フラグの立っている割込み入力については新たな割込み要求を受け付けない割込み要求受付手段を備え、前記発生順序記憶手段は、特定の割込み入力について新たな割込み要求があったとき、前記割込み要求受付手段の現在立っているフラグの数を参照して、当該特定の割込み入力に優先順位を割り振ることを特徴とする。
請求項3にかかる発明は、請求項2に記載の割込み処理回路において、前記割込み要求受付手段の前記フラグの立上りを検出する立上り検出手段を備え、前記発生順序記憶手段は、該立上り検出手段の検出出力によって前記特定の割込み入力についての新たな割込み要求を知ることを特徴とする。
In order to achieve the above object, the interrupt processing circuit according to the first aspect of the present invention is configured such that when there are interrupt requests for a plurality of interrupt inputs having the same priority, the interrupt processing circuit is configured according to the order of generation of the interrupt requests. An interrupt processing circuit for requesting an interrupt process according to an input to a CPU, comprising: an occurrence order storage means for allocating and storing a priority order according to the occurrence order of the interrupt request for each of the plurality of interrupt inputs; The generation order storage means requests the CPU for interrupt processing for the highest priority interrupt input, and each time the interrupt processing for the highest priority interrupt input is completed, the remaining interrupt input for which an interrupt request has been made The stored contents are updated so that the priorities are incremented one by one.
According to a second aspect of the present invention, in the interrupt processing circuit according to the first aspect, a flag is individually set for an interrupt input for which an interrupt request has been made, and the flag is reset for an interrupt input for which interrupt processing has been completed. An interrupt request accepting unit that does not accept a new interrupt request for an interrupt input that is standing, and the occurrence order storage unit is configured to receive a current interrupt request accepting unit when there is a new interrupt request for a specific interrupt input. A priority order is assigned to the specific interrupt input by referring to the number of flags that are present.
According to a third aspect of the present invention, in the interrupt processing circuit according to the second aspect of the present invention, the interrupt processing circuit includes a rising edge detecting unit that detects a rising edge of the flag of the interrupt request receiving unit, and the generation order storage unit includes: A new interrupt request for the specific interrupt input is known from the detection output.

本発明によれば、発生順序記憶手段の記憶内容が、最優先順位の割込み入力についての割込み処理が完了する毎に、割込み要求のあった残りの割込み入力について優先順位を1つづつ繰り上げるよう更新されるので、最優先順位の割込み入力は順次更新されることになり、特別なソフトウエア処理を必要とすることなく、多重割込みの要求があった場合でも、割込みの要求の発生順に割込み処理を行うことが可能となる。   According to the present invention, the contents stored in the generation order storage means are updated so that the priority order is incremented by one for the remaining interrupt inputs for which an interrupt request has been made each time the interrupt processing for the highest priority interrupt input is completed. Therefore, the interrupt input with the highest priority is updated sequentially, and even if there are multiple interrupt requests without requiring special software processing, interrupt processing is performed in the order in which the interrupt requests are generated. Can be done.

図1は、本発明の1つの実施例の割込み処理回路の構成を示すブロック図である。図1において、1は割込み要求レジスタ(IRR)(請求項の割込み要求受付手段に相当)であって、図4で説明したものと同じであり、4個の割込み入力IR0〜IR3のいずれかに割込み要求を受け付けると、出力IRA0〜IRA3の対応するものを「1」にセットしてフラグを立てる。   FIG. 1 is a block diagram showing the configuration of an interrupt processing circuit according to one embodiment of the present invention. In FIG. 1, reference numeral 1 denotes an interrupt request register (IRR) (corresponding to the interrupt request receiving means in the claims), which is the same as described in FIG. 4, and is one of the four interrupt inputs IR0 to IR3. When an interrupt request is received, the corresponding one of the outputs IRA0 to IRA3 is set to “1” and a flag is set.

2はIRR立上りエッジ検出回路(請求項の立上り検出手段に相当)であって、図2に示すように、割込み要求レジスタ1からの各出力IRA0〜IRA3毎に、FF21とアンド回路22の組み合わせで構成され、割込み要求レジスタ1の出力IRA0〜IRA3が「1」に立ち上がると、その立上りエッジを検出して、出力IRB0〜IRB3の対応するものに「1」パルスを出力する。   Reference numeral 2 denotes an IRR rising edge detection circuit (corresponding to the rising detection means in claims). As shown in FIG. 2, for each output IRA0 to IRA3 from the interrupt request register 1, a combination of FF21 and AND circuit 22 is used. When the outputs IRA0 to IRA3 of the interrupt request register 1 rise to “1”, the rising edge is detected and a “1” pulse is output to the corresponding one of the outputs IRB0 to IRB3.

3は発生順序記憶回路(請求項の発生順序記憶手段に相当)であって、割込み要求レジスタ1の出力IRA0〜IRA3とIRR立上りエッジ検出回路2のパルス出力IRB0〜IRB3を入力し、そのときの出力IRA0〜IRA3の「1」の数を参照して、割込み入力IR0〜IR3の立上りの順序を記憶する発生順序記憶レジスタ(ISQ)を有する。この発生順序記憶レジスタ(ISQ)の割込み入力IR0〜IR3に対応した4個の出力の値は、それぞれ「0」,「1」,「2」,「3」,「4」のいずれかで順位を示す。「0」は割込み要求なし、「1」は最優先、「2」は次優先、・・・、「4」は最低優先である。   Reference numeral 3 denotes a generation order storage circuit (corresponding to the generation order storage means in the claims), which inputs the outputs IRA0 to IRA3 of the interrupt request register 1 and the pulse outputs IRB0 to IRB3 of the IRR rising edge detection circuit 2, With reference to the number of “1” of the outputs IRA0 to IRA3, there is an occurrence order storage register (ISQ) for storing the order of rising of the interrupt inputs IR0 to IR3. The values of the four outputs corresponding to the interrupt inputs IR0 to IR3 of the generation order storage register (ISQ) are ranked according to any one of “0”, “1”, “2”, “3”, and “4”. Indicates. “0” is no interrupt request, “1” is the highest priority, “2” is the next priority,..., “4” is the lowest priority.

そして、この発生順序記憶回路3は、システムリセットされると、発生順序記憶レジスタ(ISQ)の4個の出力を「0」にする。また、IRR立上り検出回路2の出力IRB0〜IRB3のいずれかに「1」パルスが発生すると、割込み要求レジスタ1の出力IRA0〜IRA3の出力(フラグ)を見て、そこに「1」があれば、出力IRB0〜IRB3の内のすでに「1」になったものに対応する発生順序記憶レジスタ(ISQ)の出力の最大値に「+1」して、その発生順序記憶レジスタ(ISQ)に記憶させる。   When the system is reset, the generation order storage circuit 3 sets the four outputs of the generation order storage register (ISQ) to “0”. Further, when a “1” pulse is generated in any of the outputs IRB0 to IRB3 of the IRR rising detection circuit 2, the outputs (flags) of the outputs IRA0 to IRA3 of the interrupt request register 1 are checked and if there is “1” there. Then, “+1” is set to the maximum value of the output of the generation order storage register (ISQ) corresponding to the output IRB0 to IRB3 which has already become “1”, and is stored in the generation order storage register (ISQ).

例えば、IRR立上りエッジ検出回路2の出力IRB0に「1」パルスが発生したときに、割込み要求レジスタ1の出力IRA0〜IRA3の「1」の数が合計で1個であった場合は最優先順位「1」を、2個であった場合は次の優先順位の「2」を、・・・、4個であった場合は最低の優先順位の「4」を、当該割込み入力IR0に対応して記憶する。   For example, when a “1” pulse is generated at the output IRB0 of the IRR rising edge detection circuit 2, if the number of “1” s of the outputs IRA0 to IRA3 of the interrupt request register 1 is one in total, the highest priority is given. If there are two “1” s, “2” of the next priority is assigned to the interrupt input IR0. Remember.

さらに、この発生順序記憶回路3は、割込み処理が完了してCPUが発行する割込み処理完了(EOI)が制御回路5に受け付けられると、発生順序記憶レジスタ(ISQ)の「0」以外の各出力について、「−1」を行う。すなわち、最優先順位「1」の割込み入力についての割込み処理が完了すると、その優先順位が「0」に、「2」であった優先順位が「1」に、「3」であった優先順位が「2」に、「4」であった優先順位が「3」に、それぞれ更新して繰り上げられる。   Further, when the interrupt processing is completed and the interrupt processing completion (EOI) issued by the CPU is received by the control circuit 5, the generation sequence storage circuit 3 outputs each output other than “0” in the generation sequence storage register (ISQ). Then, “−1” is performed. That is, when the interrupt processing for the interrupt input with the highest priority “1” is completed, the priority is “0”, the priority is “2”, the priority is “1”, and the priority is “3”. Is updated to “2” and “4”, and the priority is updated to “3”.

4はインサービスレジスタ(ISR)であって、図4で説明したものと同じであり、割込み入力IR0〜IR3に対応する値が「1」であるとき、当該割込み入力について現在CPUによって処理が行われていることを示す。   Reference numeral 4 denotes an in-service register (ISR), which is the same as that described with reference to FIG. 4, and when the value corresponding to the interrupt inputs IR0 to IR3 is “1”, the current CPU processes the interrupt input. Indicates that

制御回路5は、図4で説明したものと同様であり、CPUへの割込み要求(INT)を出力したり、CPUからの割込み許可(INTAの反転)を受け付けたり、CPUからの割込み完了(EOI)を受け付けて、割込み要求レジスタ1、発生順序記憶回路3、インサービスレジスタ4を制御する。   The control circuit 5 is the same as that described with reference to FIG. 4, and outputs an interrupt request (INT) to the CPU, accepts an interrupt permission (INTA inversion) from the CPU, and completes an interrupt from the CPU (EOI). ) To control the interrupt request register 1, the generation order storage circuit 3, and the in-service register 4.

以下、図3を参照し、具体的な例を挙げて説明する。ここでは、割込み入力IR0〜IR3は全て同一の優先順位であるとする。図3において、IRRは割込み要求レジスタ1のレジスタのフラグ(2値)を、ISQは発生順序記憶回路3の発生順序記憶レジスタの内容(10進数)を示す。システムリセット解除後に、まだ割込み要求がなされていない場合が図3(a)である。   Hereinafter, a specific example will be described with reference to FIG. Here, it is assumed that the interrupt inputs IR0 to IR3 all have the same priority. In FIG. 3, IRR indicates the flag (binary value) of the register of the interrupt request register 1, and ISQ indicates the contents (decimal number) of the generation order storage register of the generation order storage circuit 3. FIG. 3A shows a case where an interrupt request has not yet been made after the system reset is released.

割込み入力IR2に割込み要求が発生したときは、図3(b)に示すように、割込み要求レジスタ1(IRR)はIR2に対応する出力が「1」になる。これを受けて、IRR立上りエッジ検出回路2のIR2に対応する出力に「1」パルスが立ち、図3(c)に示すように、IR2に対応する発生順序記憶レジスタ(ISQ)の出力を「1」の順位に設定する。   When an interrupt request is generated at the interrupt input IR2, the output corresponding to IR2 is "1" in the interrupt request register 1 (IRR) as shown in FIG. In response to this, a “1” pulse rises at the output corresponding to IR2 of the IRR rising edge detection circuit 2, and the output of the generation order storage register (ISQ) corresponding to IR2 becomes “ 1 ”is set.

続いて、割込み入力IR3に割り込み要求が発生したときは、図3(d)に示すように、割込み要求レジスタ1(IRR)はIR3に対応する出力が「1」になる。これを、IRR立上りエッジ検出回路2が検出し、発生順序記憶レジスタ(ISQ)のIR3に対応する出力を「2」の順位に設定する。   Subsequently, when an interrupt request is generated at the interrupt input IR3, as shown in FIG. 3 (d), the interrupt request register 1 (IRR) outputs "1" corresponding to IR3. This is detected by the IRR rising edge detection circuit 2, and the output corresponding to IR3 of the generation order storage register (ISQ) is set to a rank of “2”.

続いて、割込み入力IR1,IR0に割込み要求が順次発生したときは、図3(e)に示すように、割込み要求レジスタ1(IRR)はIR1、IR0に対応する出力が「1」になる。これを、IRR立上りエッジ検出回路2が検出し、発生順序記憶レジスタ(ISQ)のIR1,IR0に対応する出力をそれぞれ「3」、「4」の順位に設定する。   Subsequently, when interrupt requests are sequentially generated in the interrupt inputs IR1 and IR0, as shown in FIG. 3E, the interrupt request register 1 (IRR) outputs "1" corresponding to IR1 and IR0. This is detected by the IRR rising edge detection circuit 2, and the outputs corresponding to IR1 and IR0 of the generation order storage register (ISQ) are set in the order of “3” and “4”, respectively.

この後、制御回路5からのCPUへの割込み要求(INT)がCPUに受け付けられてCPUから割り込み許可(INTAの反転)が入力し、割込み入力IR2に対応した割込み処理が開始されると、図3(f)に示すように、割込み要求レジスタ1(IRR)のIR2に対応する出力IRA2のフラグは「1」から「0」にクリアされる。これにより、IR2への割込み要求の再受付が可能となる。   Thereafter, when an interrupt request (INT) from the control circuit 5 to the CPU is received by the CPU, an interrupt permission (INTA inversion) is input from the CPU, and an interrupt process corresponding to the interrupt input IR2 is started. As shown in FIG. 3 (f), the flag of the output IRA2 corresponding to IR2 of the interrupt request register 1 (IRR) is cleared from “1” to “0”. This makes it possible to re-accept the interrupt request to IR2.

そして、割込み入力IR2に対応した割込み処理が完了し、CPUが発行する割込み処理完了(EOI)を制御回路5が受け取ると、その制御回路5によって、発生順序記憶レジスタ(ISQ)のIR2に対応する値は「0」にクリアされる。それと同時に発生順序記憶レジスタ(ISQ)の他の出力はその値が「−1」されて、図3(g)に示すように更新される。すなわち、割込み要求のあった残りの割込み入力について、優先順位を1つづつ繰り上げるよう記憶内容が更新される。この結果、次に割込みサービスを受ける権利をもつのは、発生順序記憶レジスタ(ISQ)の値が「1」になった割込み入力IR3への割込み要求となる。以降同様に、発生順序記憶レジスタ(ISQ)の値が「1」になった割込み入力に対応した割込み処理をCPUに要求すると共に、発生順序記憶レジスタ(ISQ)の記憶内容の更新を行うことにより、割込み要求が発生した順番に割込み処理を実行することができる。   When the interrupt processing corresponding to the interrupt input IR2 is completed and the control circuit 5 receives the interrupt processing completion (EOI) issued by the CPU, the control circuit 5 corresponds to IR2 of the generation order storage register (ISQ). The value is cleared to “0”. At the same time, the other output of the generation order storage register (ISQ) is updated to "-1" as shown in FIG. 3 (g). That is, the stored contents are updated so that the priority order is incremented one by one for the remaining interrupt inputs for which there has been an interrupt request. As a result, the next request to receive the interrupt service is an interrupt request to the interrupt input IR3 in which the value of the generation order storage register (ISQ) is “1”. Similarly, by requesting the CPU to perform interrupt processing corresponding to the interrupt input whose value of the occurrence order storage register (ISQ) is “1”, and updating the storage contents of the occurrence order storage register (ISQ) Interrupt processing can be executed in the order in which interrupt requests are generated.

本発明の実施例の割込み処理回路の構成を示すブロック図である。It is a block diagram which shows the structure of the interrupt processing circuit of the Example of this invention. IRR立上りエッジ検出回路の具体的回路図である。It is a specific circuit diagram of an IRR rising edge detection circuit. 本実施例の割込み処理の説明図である。It is explanatory drawing of the interruption process of a present Example. 従来の割込み処理回路の構成を示すブロック図である。It is a block diagram which shows the structure of the conventional interrupt processing circuit. 従来の割込み処理の説明図である。It is explanatory drawing of the conventional interruption process.

符号の説明Explanation of symbols

1:割込み要求レジスタ
2:IRR立上りエッジ検出回路
3:発生順序記憶回路
4:インサービスレジスタ
5:制御回路
6:優先順位割当回路
1: Interrupt request register 2: IRR rising edge detection circuit 3: Generation order storage circuit 4: In-service register 5: Control circuit 6: Priority assignment circuit

Claims (3)

同一の優先順位をもつ複数の割込み入力に割込み要求があったとき、該割込み要求の発生の順序にしたがって、前記割込み入力に応じた割込み処理をCPUに要求する割込み処理回路であって、
前記複数の割込み入力の個々について、前記割込み要求の発生順序にしたがって優先順位を割り振って記憶する発生順序記憶手段を備え、
該発生順序記憶手段は、最優先順位の割込み入力について前記CPUに対して割込み処理を要求し、最優先順位の割込み入力についての割込み処理が完了する毎に、割込み要求のあった残りの割込み入力について前記優先順位を1つづつ繰り上げるよう記憶内容が更新されることを特徴とする割込み処理回路。
An interrupt processing circuit that requests an interrupt process according to the interrupt input to the CPU according to the order of generation of the interrupt request when there is an interrupt request to a plurality of interrupt inputs having the same priority,
For each of the plurality of interrupt inputs, it comprises generation order storage means for allocating and storing priorities according to the generation order of the interrupt requests,
The generation order storage means requests the CPU to perform interrupt processing for the highest-priority interrupt input, and each time the interrupt processing for the highest-priority interrupt input is completed, the remaining interrupt input for which an interrupt request has been made The interrupt processing circuit is characterized in that the stored contents are updated so as to increment the priorities one by one.
請求項1に記載の割込み処理回路において、
割込み要求があった割込み入力について個々にフラグを立てると共に割込み処理が完了した割込み入力については該フラグをリセットし、フラグの立っている割込み入力については新たな割込み要求を受け付けない割込み要求受付手段を備え、
前記発生順序記憶手段は、特定の割込み入力について新たな割込み要求があったとき、前記割込み要求受付手段の現在立っているフラグの数を参照して、当該特定の割込み入力に優先順位を割り振ることを特徴とする割込み処理回路。
The interrupt processing circuit according to claim 1,
An interrupt request accepting means that individually sets a flag for an interrupt input having an interrupt request, resets the flag for an interrupt input for which interrupt processing has been completed, and does not accept a new interrupt request for an interrupt input having a flag. Prepared,
The occurrence order storage means assigns a priority to the specific interrupt input by referring to the number of flags currently set in the interrupt request reception means when there is a new interrupt request for the specific interrupt input. An interrupt processing circuit.
請求項2に記載の割込み処理回路において、
前記割込み要求受付手段の前記フラグの立上りを検出する立上り検出手段を備え、前記発生順序記憶手段は、該立上り検出手段の検出出力によって前記特定の割込み入力についての新たな割込み要求を知ることを特徴とする割込み処理回路。
The interrupt processing circuit according to claim 2,
Rising edge detection means for detecting the rising edge of the flag of the interrupt request receiving means is provided, and the generation order storage means knows a new interrupt request for the specific interrupt input by a detection output of the rising edge detection means. An interrupt processing circuit.
JP2006136031A 2006-05-16 2006-05-16 Interruption processing circuit Pending JP2007310438A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006136031A JP2007310438A (en) 2006-05-16 2006-05-16 Interruption processing circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006136031A JP2007310438A (en) 2006-05-16 2006-05-16 Interruption processing circuit

Publications (1)

Publication Number Publication Date
JP2007310438A true JP2007310438A (en) 2007-11-29

Family

ID=38843262

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006136031A Pending JP2007310438A (en) 2006-05-16 2006-05-16 Interruption processing circuit

Country Status (1)

Country Link
JP (1) JP2007310438A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04369064A (en) * 1991-06-18 1992-12-21 Kawasaki Steel Corp Method and device for controlling interruption processing
JP2001166951A (en) * 1999-12-09 2001-06-22 Kawasaki Steel Corp Interruption processing circuit

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04369064A (en) * 1991-06-18 1992-12-21 Kawasaki Steel Corp Method and device for controlling interruption processing
JP2001166951A (en) * 1999-12-09 2001-06-22 Kawasaki Steel Corp Interruption processing circuit

Similar Documents

Publication Publication Date Title
KR101391907B1 (en) Interrupt Controller
US20080140896A1 (en) Processor and interrupt controlling method
US7721035B2 (en) Multiprocessor system, processor and interrupt control method
KR101673247B1 (en) Processor with assignable general purpose register set
US20100042757A1 (en) Data transfer control device and computer system
CN111831408A (en) Asynchronous task processing method and device, electronic equipment and medium
JP2007310438A (en) Interruption processing circuit
JP2010044645A (en) Data transfer device, and data transfer method
JP2008276739A (en) Information processing system and information processing program
JP2005258509A (en) Storage device
JP2008225641A (en) Computer system, interrupt control method and program
JP2022102333A (en) Execution scheduling determination method and execution scheduling determination program
US20160239443A1 (en) Dma controller
US20180181508A1 (en) Semiconductor device
JP2007233608A (en) Interruption controller and program for making computer execute interruption control method
WO2019038834A1 (en) Information processing device and resource use coordination method
JP2006209500A (en) Data transfer device
JP2000259430A (en) Processing method for computer system
JP6940283B2 (en) DMA transfer control device, DMA transfer control method, and DMA transfer control program
JP5644197B2 (en) Computer system and interrupt request processing method
JP2007219925A (en) Bus controller, bus control program and recording medium
JP2752894B2 (en) File transfer device
US10025750B2 (en) Transmission device, controller, and system comprising transmission device and controller
CN113485815A (en) Job batch processing system, method, device, storage medium and electronic equipment
JP6392556B2 (en) Access request issuing device, access request issuing system, access request issuing method, and access request issuing program

Legal Events

Date Code Title Description
A621 Written request for application examination

Effective date: 20080724

Free format text: JAPANESE INTERMEDIATE CODE: A621

A977 Report on retrieval

Effective date: 20091209

Free format text: JAPANESE INTERMEDIATE CODE: A971007

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20091215

A521 Written amendment

Effective date: 20100209

Free format text: JAPANESE INTERMEDIATE CODE: A523

A02 Decision of refusal

Effective date: 20100325

Free format text: JAPANESE INTERMEDIATE CODE: A02