JP2006155048A - Interrupt controller - Google Patents

Interrupt controller Download PDF

Info

Publication number
JP2006155048A
JP2006155048A JP2004342402A JP2004342402A JP2006155048A JP 2006155048 A JP2006155048 A JP 2006155048A JP 2004342402 A JP2004342402 A JP 2004342402A JP 2004342402 A JP2004342402 A JP 2004342402A JP 2006155048 A JP2006155048 A JP 2006155048A
Authority
JP
Japan
Prior art keywords
interrupt
program
control device
register
setting
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
JP2004342402A
Other languages
Japanese (ja)
Inventor
Takashi Sakai
崇 酒井
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2004342402A priority Critical patent/JP2006155048A/en
Publication of JP2006155048A publication Critical patent/JP2006155048A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To increase a processing speed in controlling interruption for making it necessary to inhibit interruption, and to reduce stack usage without complicating configurations in an interruption controller to be used for a microprocessor. <P>SOLUTION: In this microprocessor for executing an interrupting program according to an interrupting signal from the outside, an interrupt controller for controlling an interrupting program is provided with a comparator 13 for comparing a data address 14 with an address range in which the interrupting program is inexecutable, and for judging whether or not the data address 14 is included in the address range and an interrupting signal controller 17 for controlling an interrupting signal so that the interrupting program can be made inexecutable when it is judged that the data address 14 is included in the address range by the comparator 13. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、マイクロプロセッサに使用される割り込み制御装置に関するものである。   The present invention relates to an interrupt control device used for a microprocessor.

従来のマイクロプロセッサに使用される割り込み制御装置においては、割り込み許可フラグを備え、割り込み要因が発生した際、割り込み許可フラグの状態によって、割り込みプログラムを実行するか否かの判断を行っている。   An interrupt control device used in a conventional microprocessor includes an interrupt permission flag. When an interrupt factor occurs, it is determined whether to execute an interrupt program according to the state of the interrupt permission flag.

また、所定のアドレス範囲を設定する手段を設け、プログラムカウンタの値が所定のアドレス範囲内にあるときには、割り込み許可フラグの状態によらず、強制的に割り込み許可ならびに禁止できるようにした割り込み制御装置も提案されている(例えば、特許文献1参照)。
特開平2−90235号公報
An interrupt control device provided with a means for setting a predetermined address range so that when the value of the program counter is within the predetermined address range, the interrupt can be forcibly permitted and prohibited regardless of the state of the interrupt permission flag. Has also been proposed (see, for example, Patent Document 1).
JP-A-2-90235

従来の割り込み制御装置では、複数の割り込みプログラム及びタスクが同一の変数に対してアクセスを行なうとき、一旦、割り込み禁止状態にしてアクセスを行なう必要がある。実際には、割り込みを禁止する前の状態を保存し、実際に割り込みを禁止した後に、保存された状態を復元し、割り込みを許可するといった一連の処理が必要となり、処理速度の低下とスタックの浪費を招くという問題があった。   In a conventional interrupt control device, when a plurality of interrupt programs and tasks access the same variable, it is necessary to make access once in an interrupt disabled state. In practice, a series of processes are required, such as saving the state before disabling interrupts, restoring the saved state after actually disabling interrupts, and enabling interrupts. There was a problem of incurring waste.

また、特許文献1のように、プログラムカウンタの値と所定のアドレス範囲とを比較して、強制的に割り込み許可ならびに禁止できるようにした割り込み制御装置では、複数の割り込みやタスクからアクセスする変数が複数箇所で操作されている場合、所定のアドレス範囲を設定する手段ならびにプログラムカウンタの値との比較手段が、変数にアクセスするプログラム箇所分必要となり、構成の複雑化を招くという新たな問題が生じる。   Further, as in Patent Document 1, in an interrupt control device that compares the value of a program counter with a predetermined address range and can forcibly permit or prohibit interrupts, a variable accessed from a plurality of interrupts or tasks When operated at a plurality of locations, a means for setting a predetermined address range and a means for comparing with the value of the program counter are required for the program location for accessing the variable, resulting in a new problem that the configuration becomes complicated. .

本発明は、外部からの割り込み信号により割り込みプログラムを実行するマイクロプロセッサにおいて、前記割り込みプログラムを制御する割り込み制御装置であって、データアドレスと、前記割り込みプログラムが実行不可能なアドレス範囲とを比較して、前記データアドレスが前記アドレス範囲内に含まれるか否かを判断する比較手段と、前記比較手段により、前記データアドレスが前記アドレス範囲内に含まれると判断された場合、割り込みプログラムが実行不可能となるように割り込み信号を制御する割り込み信号制御手段とを備えたものである。   The present invention relates to an interrupt control device that controls an interrupt program in a microprocessor that executes an interrupt program by an external interrupt signal, and compares a data address with an address range in which the interrupt program cannot be executed. And the comparing means for determining whether or not the data address is included in the address range, and the interrupt program is not executed when the comparing means determines that the data address is included in the address range. An interrupt signal control means for controlling the interrupt signal so as to be possible is provided.

前記比較手段は、前記割り込みプログラムが実行不可能なアドレス範囲を、領域開始指定記憶レジスタに記憶されているアドレスから領域終了指定記憶レジスタに記憶されているアドレスまでの範囲とする。   The comparison means sets an address range in which the interrupt program cannot be executed as a range from an address stored in the area start designation storage register to an address stored in the area end designation storage register.

本発明の割り込み制御装置によると、データアドレスが、割り込みプログラムの実行が不可能なアドレス範囲内に含まれると判断されると、割り込み禁止状態となり、割り込みプログラムの実行が不可能となる。よって、割り込みを禁止する前の状態を保存し、実際に割り込みを禁止した後に、保存された状態を復元し、割り込みを許可するというような一連の処理が不要となり、割り込み禁止を必要とする割り込み制御における処理速度の向上と、スタック使用量の低減を図ることができる。   According to the interrupt control device of the present invention, when it is determined that the data address is included in the address range where the interrupt program cannot be executed, the interrupt is disabled and the interrupt program cannot be executed. Therefore, it is not necessary to perform a series of processing such as saving the state before disabling interrupts, restoring the saved state after actually disabling interrupts, and enabling interrupts. It is possible to improve the processing speed in the control and reduce the stack usage.

本発明の割り込み制御装置によると、構成の複雑化を招くことなく、割り込み禁止を必要とする割り込み制御における処理速度の向上と、スタック使用量の低減を図ることができる。   According to the interrupt control device of the present invention, it is possible to improve the processing speed and reduce the stack usage in interrupt control that requires interrupt prohibition without complicating the configuration.

(実施の形態1)
本実施の形態に係る割り込み制御装置について、図1,2を用いて説明する。
(Embodiment 1)
The interrupt control device according to the present embodiment will be described with reference to FIGS.

図1は割り込み制御装置のブロック図、図2は割り込み制御装置の割り込み信号制御装置のブロック図を示している。   FIG. 1 is a block diagram of an interrupt control device, and FIG. 2 is a block diagram of an interrupt signal control device of the interrupt control device.

図1において、11は領域開始指定記憶レジスタ、12は領域終了指定記憶レジスタ、13は比較装置(比較手段)、14はデータアドレス、15は割り込み許可フラグ(IE)、16は割り込み要求フラグ(IR)、17は割り込み信号制御装置(割り込み信号制御手段)、18は割り込み検出フラグ(ID)である。   In FIG. 1, 11 is an area start designation storage register, 12 is an area end designation storage register, 13 is a comparison device (comparison means), 14 is a data address, 15 is an interrupt enable flag (IE), and 16 is an interrupt request flag (IR). ), 17 is an interrupt signal control device (interrupt signal control means), and 18 is an interrupt detection flag (ID).

割り込み信号制御装置17は、図2に示すように、比較装置13と割り込み要求フラグ16と割り込み許可フラグ15の論理積を行う論理積回路19にて構成されている。   As shown in FIG. 2, the interrupt signal control device 17 includes a logical product circuit 19 that performs a logical product of the comparison device 13, the interrupt request flag 16, and the interrupt permission flag 15.

まず、領域開始指定記憶レジスタ11と領域終了指定記憶レジスタ12にて所定のアドレス範囲を設定する。   First, a predetermined address range is set in the area start designation storage register 11 and the area end designation storage register 12.

比較装置13では、データアドレス14と上記アドレス範囲とを比較し、データアドレス14がアドレス範囲内のときは0を出力し、データアドレス14がアドレス範囲外のときは1を出力する。   The comparison device 13 compares the data address 14 with the address range, and outputs 0 when the data address 14 is within the address range, and outputs 1 when the data address 14 is outside the address range.

割り込み信号制御装置17では、論理積回路19によって、比較装置13の比較結果と、割り込み要求フラグ16と、割り込み許可フラグ15との論理積を行い、その論理積の結果を割り込み検出フラグ18に格納する。   In the interrupt signal control device 17, the logical product 19 performs a logical product of the comparison result of the comparison device 13, the interrupt request flag 16, and the interrupt permission flag 15, and stores the logical product result in the interrupt detection flag 18. To do.

データアドレス14が所定のアドレス範囲内の場合、比較装置13は0を出力し、割り込み信号制御装置17による論理積の結果は0となり、割り込み検出フラグ18に0が格納される。割り込み検出フラグ18が0に設定されることにより、割り込み禁止状態となり、割り込みプログラムの実行が不可能となる。   When the data address 14 is within the predetermined address range, the comparator 13 outputs 0, the logical product by the interrupt signal controller 17 is 0, and 0 is stored in the interrupt detection flag 18. When the interrupt detection flag 18 is set to 0, the interrupt is disabled and the interrupt program cannot be executed.

このように構成された割り込み制御装置によると、データアドレス14が、割り込みプログラムの実行が不可能なアドレス範囲内に含まれると判断されると、割り込みプログラムの実行が不可能となる。よって、割り込みを禁止する前の状態を保存し、実際に割り込みを禁止した後に、保存された状態を復元し、割り込みを許可するというような一連の処理が不要となり、割り込み禁止を必要とする割り込み制御における処理速度の向上と、スタック使用量の低減を図ることができる。すなわち、領域開始指定記憶レジスタ11と領域終了指定記憶レジスタ12にて設定される所定のアドレス範囲を、複数の割り込みやタスクからアクセスする変数が収まるように設定することにより、割り込み禁止を必要とする割り込み制御における処理速度の向上と、スタック使用量の低減を図ることができる。   According to the interrupt control device configured as described above, when it is determined that the data address 14 is included in an address range where the interrupt program cannot be executed, the interrupt program cannot be executed. Therefore, it is not necessary to perform a series of processing such as saving the state before disabling interrupts, restoring the saved state after actually disabling interrupts, and enabling interrupts. It is possible to improve the processing speed in the control and reduce the stack usage. In other words, interrupt prohibition is required by setting a predetermined address range set in the area start designation storage register 11 and the area end designation storage register 12 so that a plurality of interrupts and variables accessed from tasks can be accommodated. It is possible to improve the processing speed and reduce the stack usage in interrupt control.

また、アトミックな処理が必要な変数を所定のアドレス範囲に配置することができるため、割り込みを禁止する前の状態を保存し、実際に割り込みを禁止した後に、保存された状態を復元し、割り込みを許可するというような一連の処理が不要になる。   In addition, since variables that require atomic processing can be placed in a predetermined address range, the state before interrupts are disabled is saved, the interrupted state is actually restored, the saved state is restored, and interrupts are interrupted. A series of processing such as permitting is unnecessary.

さらに、複数の割り込みやタスクからアクセスする変数が複数箇所で操作されている場合においても、領域開始指定記憶レジスタ11、領域終了指定記憶レジスタ12、比較装置13を変数にアクセスするプログラム箇所分用意する必要がなく、構成の複雑化を招かない。   Further, even when variables accessed from a plurality of interrupts or tasks are operated at a plurality of locations, the region start designation storage register 11, the region end designation storage register 12, and the comparison device 13 are prepared for the program locations that access the variables. It is not necessary and does not cause complication of configuration.

(実施の形態2)
本実施の形態に係る割り込み制御装置について、図3,4を用いて説明する。
(Embodiment 2)
The interrupt control device according to the present embodiment will be described with reference to FIGS.

図3は割り込み制御装置のブロック図、図4は割り込み制御装置の割り込み信号制御装置のブロック図を示している。なお、図1,2に示した例と同一部分は、同一符号を付してその説明を省略する。   FIG. 3 is a block diagram of the interrupt control device, and FIG. 4 is a block diagram of the interrupt signal control device of the interrupt control device. In addition, the same part as the example shown in FIGS.

図3において、21はカウントダウンタイマ、22は割り込み信号制御装置(割り込み信号制御手段)である。割り込み信号制御装置22は、図4に示すように、カウントダウンタイマ21の値を入力する比較回路23と、比較回路23と割り込み要求フラグ16と割り込み許可フラグ15の論理積を行う論理積回路24にて構成されている。   In FIG. 3, 21 is a countdown timer, and 22 is an interrupt signal control device (interrupt signal control means). As shown in FIG. 4, the interrupt signal control device 22 includes a comparison circuit 23 that inputs the value of the countdown timer 21, and a logical product circuit 24 that performs a logical product of the comparison circuit 23, the interrupt request flag 16, and the interrupt permission flag 15. Configured.

カウントダウンタイマ21は、プログラムにより初期値を設定されると、システムクロックやその他のクロックに同期してカウントダウンを行い、カウント値が0になるとカウントダウンを停止する。なお、カウントダウンタイマ21のカウント値が0になった否かの監視は、割り込み信号制御装置22に設けられているカウントダウンタイマ21からの入力によって出力を切り替える機能からなる監視手段にて行われる。   The countdown timer 21 counts down in synchronization with the system clock and other clocks when an initial value is set by a program, and stops counting down when the count value becomes zero. Whether or not the count value of the countdown timer 21 has become 0 is monitored by a monitoring means having a function of switching the output by an input from the countdown timer 21 provided in the interrupt signal control device 22.

割り込み信号制御装置22では、カウントダウンタイマ21の値と、割り込み要求フラグ16と、割り込み許可フラグ15とにより、割り込み検出フラグ18の値を設定する。すなわち、比較回路23は、カウントダウンタイマ21の値が0の場合は1を出力し、カウントダウンタイマ21の値が0以外の場合は0を出力する。論理積回路24は、比較回路23の出力と、割り込み要求フラグ16と、割り込み許可フラグ15との論理積を行い、その論理積の結果を割り込み検出フラグ18に格納する。   In the interrupt signal control device 22, the value of the interrupt detection flag 18 is set by the value of the countdown timer 21, the interrupt request flag 16, and the interrupt permission flag 15. That is, the comparison circuit 23 outputs 1 when the value of the countdown timer 21 is 0, and outputs 0 when the value of the countdown timer 21 is other than 0. The logical product circuit 24 performs a logical product of the output of the comparison circuit 23, the interrupt request flag 16, and the interrupt permission flag 15, and stores the result of the logical product in the interrupt detection flag 18.

カウントダウンタイマ21が初期値を設定されてカウントダウンを開始し、当該カウント値が0になるまでの間、比較回路23は0を出力し、論理積回路24による論理積の結果は0となり、割り込み検出フラグ18に0が格納される。割り込み検出フラグ18が0に設定されることにより、割り込み禁止状態となり、割り込みプログラムの実行が不可能となる。また、カウントダウンタイマ21に設定された時間が経過しカウント値が0になると比較回路23は1を出力し、論理積回路24による論理積の結果も1となり、割り込み検出フラグ18に1が格納され、割り込み信号を有効にし、割り込みプログラムの実行が可能となる。   Until the countdown timer 21 is set to an initial value and starts counting down until the count value becomes 0, the comparison circuit 23 outputs 0, and the result of the logical product by the logical product circuit 24 becomes 0, and an interrupt is detected. 0 is stored in the flag 18. When the interrupt detection flag 18 is set to 0, the interrupt is disabled and the interrupt program cannot be executed. Further, when the time set in the countdown timer 21 elapses and the count value becomes 0, the comparison circuit 23 outputs 1, the result of the logical product by the logical product circuit 24 also becomes 1, and 1 is stored in the interrupt detection flag 18. The interrupt signal is enabled and the interrupt program can be executed.

このように構成された割り込み制御装置によると、カウントダウンタイマ21のカウント値が0になるまでの間、割り込みプログラムの実行が不可能となる。よって、割り込みを禁止する前の状態を保存し、実際に割り込みを禁止した後に、保存された状態を復元し、割り込みを許可するというような一連の処理が不要となり、割り込み禁止を必要とする割り込み制御における処理速度の向上と、スタック使用量の低減を図ることができる。   According to the interrupt control device configured as described above, the interrupt program cannot be executed until the count value of the countdown timer 21 becomes zero. Therefore, it is not necessary to perform a series of processing such as saving the state before disabling interrupts, restoring the saved state after actually disabling interrupts, and enabling interrupts. It is possible to improve the processing speed in the control and reduce the stack usage.

(実施の形態3)
本実施の形態に係る割り込み制御装置について、図5を用いて説明する。
(Embodiment 3)
The interrupt control apparatus according to this embodiment will be described with reference to FIG.

図5は割り込み制御装置のブロック図を示している。なお、図1〜4に示した例と同一部分は、同一符号を付してその説明を省略する。   FIG. 5 shows a block diagram of the interrupt control device. In addition, the same part as the example shown in FIGS. 1-4 is attached | subjected with the same code | symbol, and the description is abbreviate | omitted.

図5において、31はタイマ初期値設定レジスタ(タイマ初期値記憶手段)、32はタイマ初期値転送制御装置である。   In FIG. 5, 31 is a timer initial value setting register (timer initial value storage means), and 32 is a timer initial value transfer control device.

まず、領域開始指定記憶レジスタ11と領域終了指定記憶レジスタ12にて所定のアドレス範囲を設定する。   First, a predetermined address range is set in the area start designation storage register 11 and the area end designation storage register 12.

比較装置13では、データアドレス14と上記アドレス範囲とを比較し、データアドレス14がアドレス範囲内のときは0を出力し、データアドレス14がアドレス範囲外のときは1を出力する。   The comparison device 13 compares the data address 14 with the address range, and outputs 0 when the data address 14 is within the address range, and outputs 1 when the data address 14 is outside the address range.

タイマ初期値設定レジスタ31は、プログラムにより値を設定される。タイマ初期値転送装置32では、比較装置13の出力が1の場合に、タイマ初期値設定レジスタ31の値をカウントダウンタイマ21に設定する。   The timer initial value setting register 31 is set by a program. The timer initial value transfer device 32 sets the value of the timer initial value setting register 31 in the countdown timer 21 when the output of the comparison device 13 is 1.

カウントダウンタイマ21では、初期値を設定されるとシステムクロックやその他のクロックに同期してカウントダウンを行い、カウント値が0になるとカウントダウンを停止する。なお、カウントダウンタイマ21のカウント値が0になった否かの監視は、割り込み信号制御装置22に設けられているカウントダウンタイマ21からの入力によって出力を切り替える機能からなる監視手段にて行われる。   When an initial value is set, the countdown timer 21 counts down in synchronization with the system clock and other clocks, and stops counting down when the count value reaches zero. Whether or not the count value of the countdown timer 21 has become 0 is monitored by a monitoring means having a function of switching the output by an input from the countdown timer 21 provided in the interrupt signal control device 22.

割り込み信号制御装置22では、カウントダウンタイマ21の値と、割り込み要求フラグ16と、割り込み許可フラグ15とにより、割り込み検出フラグ18の値を設定する。なお、割り込み信号制御装置22の構成については、図4に示した例と同様である。   In the interrupt signal control device 22, the value of the interrupt detection flag 18 is set by the value of the countdown timer 21, the interrupt request flag 16, and the interrupt permission flag 15. Note that the configuration of the interrupt signal control device 22 is the same as the example shown in FIG.

データアドレス14が所定のアドレス範囲外の場合、比較装置13は1を出力し、カウントダウンタイマ21にタイマ初期値設定レジスタ31の値が初期値として設定されてカウントダウンを開始する。当該カウント値が0になるまでの間、割り込み信号制御装置22による論理積の結果は0となり、割り込み検出フラグ18に0が格納される。割り込み検出フラグ18が0に設定されることにより、割り込み禁止状態となり、割り込みプログラムの実行が不可能となる。また、カウントダウンタイマ21に設定された時間が経過しカウント値が0になると、割り込み検出フラグ18に1が格納され、割り込み信号を有効にし、割り込みプログラムの実行が可能となる。   When the data address 14 is outside the predetermined address range, the comparison device 13 outputs 1, and the value of the timer initial value setting register 31 is set as the initial value in the countdown timer 21 to start the countdown. Until the count value becomes 0, the result of the logical product by the interrupt signal control device 22 becomes 0, and 0 is stored in the interrupt detection flag 18. When the interrupt detection flag 18 is set to 0, the interrupt is disabled and the interrupt program cannot be executed. When the time set in the countdown timer 21 elapses and the count value becomes 0, 1 is stored in the interrupt detection flag 18, the interrupt signal is validated, and the interrupt program can be executed.

このように構成された割り込み制御装置によると、カウントダウンタイマ21のカウント値が0になるまでの間、割り込みプログラムの実行が不可能となる。よって、割り込みを禁止する前の状態を保存し、実際に割り込みを禁止した後に、保存された状態を復元し、割り込みを許可するというような一連の処理が不要となり、割り込み禁止を必要とする割り込み制御における処理速度の向上と、スタック使用量の低減を図ることができる。具体的には、所定のアドレス範囲内に配置された変数Aに所定のアドレス範囲外に配置された変数Bを加算し変数Aに格納する、といった割り込みプログラムを実行する場合、データアドレス14が所定のアドレス範囲外となることで、カウントダウンタイマ21のカウント値が0になるまでの間、割り込みプログラムの実行が不可能となり、割り込み禁止ならびに許可の一連の処理が不要となる。   According to the interrupt control device configured as described above, the interrupt program cannot be executed until the count value of the countdown timer 21 becomes zero. Therefore, it is not necessary to perform a series of processing such as saving the state before disabling interrupts, restoring the saved state after actually disabling interrupts, and enabling interrupts. It is possible to improve the processing speed in the control and reduce the stack usage. Specifically, when executing an interrupt program in which a variable B arranged outside a predetermined address range is added to a variable A arranged within a predetermined address range and stored in the variable A, the data address 14 is predetermined. When the count value of the countdown timer 21 reaches 0, it becomes impossible to execute the interrupt program, and a series of processes for prohibiting and permitting interrupts becomes unnecessary.

(実施の形態4)
本実施の形態に係る割り込み制御装置について、図6,7を用いて説明する。
(Embodiment 4)
The interrupt control apparatus according to the present embodiment will be described with reference to FIGS.

図6は割り込み制御装置のブロック図、図7は割り込み制御装置の割り込み信号制御装置のブロック図を示している。なお、図1,2に示した例と同一部分は、同一符号を付してその説明を省略する。   6 is a block diagram of the interrupt control device, and FIG. 7 is a block diagram of the interrupt signal control device of the interrupt control device. In addition, the same part as the example shown in FIGS.

図6において、41は割り込み禁止設定回数レジスタ、42は割り込み禁止設定レジスタ,43は加算器、44は割り込み許可設定レジスタ、45は減算器、46は割り込み信号制御装置(割り込み信号制御手段)である。割り込み信号制御装置46は、図7に示すように、割り込み禁止設定回数レジスタ41の値を入力する比較回路47と、比較回路47と割り込み要求フラグ16と割り込み許可フラグ15の論理積を行う論理積回路48にて構成されている。   In FIG. 6, 41 is an interrupt prohibition setting number register, 42 is an interrupt prohibition setting register, 43 is an adder, 44 is an interrupt permission setting register, 45 is a subtractor, and 46 is an interrupt signal control device (interrupt signal control means). . As shown in FIG. 7, the interrupt signal control device 46 performs a logical product of a comparison circuit 47 that inputs the value of the interrupt prohibition setting number register 41, a comparison circuit 47, an interrupt request flag 16, and an interrupt permission flag 15. The circuit 48 is used.

まず、割り込み禁止設定レジスタ42に対して割り込み禁止設定が行われると、加算器43が割り込み禁止設定回数レジスタ41に1を加算する。割り込み許可設定レジスタ44に対して割り込み許可設定が行われると、減算器45が割り込み禁止設定回数レジスタ41から1を減算する。   First, when interrupt prohibition setting is performed for the interrupt prohibition setting register 42, the adder 43 adds 1 to the interrupt prohibition setting number register 41. When the interrupt permission setting is performed for the interrupt permission setting register 44, the subtracter 45 subtracts 1 from the interrupt prohibition setting number register 41.

割り込み信号制御装置46では、割り込み禁止設定回数レジスタ41の値が0の時には割り込みを許可し、割り込み禁止設定回数レジスタ41の値が0以外の時には割り込みを禁止する。すなわち、比較回路47は、割り込み禁止設定回数レジスタ41の値が0の場合は1を出力し、割り込み禁止設定回数レジスタ41の値が0以外の場合は0を出力する。論理積回路48は、比較回路47の出力と、割り込み要求フラグ16と、割り込み許可フラグ15との論理積を行い、その論理積の結果を割り込み検出フラグ18に格納する。   The interrupt signal controller 46 permits an interrupt when the value of the interrupt prohibition setting number register 41 is 0, and prohibits an interrupt when the value of the interrupt prohibition setting number register 41 is other than 0. That is, the comparison circuit 47 outputs 1 when the value of the interrupt prohibition setting number register 41 is 0, and outputs 0 when the value of the interrupt prohibition setting number register 41 is other than 0. The logical product circuit 48 performs a logical product of the output of the comparison circuit 47, the interrupt request flag 16, and the interrupt permission flag 15, and stores the result of the logical product in the interrupt detection flag 18.

割り込み禁止設定回数レジスタ41の値が0の場合、比較回路47は1を出力し、論理積回路48による論理積の結果は1となり、割り込み検出フラグ18に1が格納される。割り込み検出フラグ18が1に設定されることにより、割り込みプログラムの実行が可能となる。また、割り込み禁止設定回数レジスタ41の値が0以外の場合、比較回路47は0を出力し、論理積回路48による論理積の結果は0となり、割り込み検出フラグ18に0が格納される。割り込み検出フラグ18が0に設定されることにより、割り込みは禁止状態となり、割り込みプログラムの実行が不可能となる。   When the value of the interrupt prohibition setting count register 41 is 0, the comparison circuit 47 outputs 1, the result of the logical product by the logical product circuit 48 is 1, and 1 is stored in the interrupt detection flag 18. When the interrupt detection flag 18 is set to 1, the interrupt program can be executed. When the value of the interrupt prohibition setting number register 41 is other than 0, the comparison circuit 47 outputs 0, the result of the logical product by the logical product circuit 48 is 0, and 0 is stored in the interrupt detection flag 18. When the interrupt detection flag 18 is set to 0, the interrupt is disabled and the interrupt program cannot be executed.

このように構成された割り込み制御装置によると、割り込み禁止設定回数レジスタ41の値が0の時に、割り込みプログラムの実行が可能となり、割り込み禁止設定回数レジスタ41の値が0以外の時に、割り込みプログラムの実行が不可能となる。よって、割り込みを禁止する前の状態を保存し、実際に割り込みを禁止した後に、保存された状態を復元し、割り込みを許可するというような一連の処理が不要となり、割り込み禁止を必要とする割り込み制御における処理速度の向上と、スタック使用量の低減を図ることができる。特に、ネストの深い関数や再帰関数内での割り込み禁止および割り込み許可に必要なスタック量の低減と処理時間の短縮を行うことができる。   According to the interrupt control device configured as described above, the interrupt program can be executed when the value of the interrupt prohibition setting number register 41 is 0, and when the value of the interrupt prohibition setting number register 41 is other than 0, the interrupt program can be executed. Execution becomes impossible. Therefore, it is not necessary to perform a series of processing such as saving the state before disabling interrupts, restoring the saved state after actually disabling interrupts, and enabling interrupts. It is possible to improve the processing speed in the control and reduce the stack usage. In particular, it is possible to reduce the amount of stack and the processing time required to disable and enable interrupts in deeply nested functions and recursive functions.

なお、図8に示すように、割り込み禁止設定レジスタと割り込み許可設定レジスタを1つのレジスタにした割り込み禁止許可設定レジスタ51を用いてもよい。すなわち、割り込み禁止許可設定レジスタ51に対して割り込み禁止設定が行われると、加算器43が割り込み禁止設定回数レジスタ41に1を加算する。割り込み禁止許可設定レジスタ51に対し割り込み許可設定が行われると、減算器45が割り込み禁止設定回数レジスタ41から1を減算する。その他の構成は、図6,7に示した例と同様である。   As shown in FIG. 8, an interrupt prohibition setting register 51 in which the interrupt prohibition setting register and the interrupt permission setting register are combined into one register may be used. That is, when the interrupt prohibition setting is performed for the interrupt prohibition permission setting register 51, the adder 43 adds 1 to the interrupt prohibition setting number register 41. When the interrupt permission setting is performed for the interrupt prohibition permission setting register 51, the subtracter 45 subtracts 1 from the interrupt prohibition setting number register 41. Other configurations are the same as those shown in FIGS.

割り込み禁止許可設定レジスタ51は、書き込まれる値により禁止設定か許可設定かを区別する方法や、割り込み禁止許可設定レジスタ51へ書き込みアクセスか読み込みアクセスかにより禁止設定か許可設定かを区別する方法がある。   The interrupt prohibition permission setting register 51 has a method for distinguishing between prohibition setting and permission setting depending on a value to be written, and a method for distinguishing whether the interrupt prohibition permission setting register 51 is prohibited or permitted depending on whether write access or read access is made. .

本発明に係る割り込み制御装置は、ビット長に関わらず、様々な種類のマイクロプロセッサにおいて有用である。   The interrupt control device according to the present invention is useful in various types of microprocessors regardless of the bit length.

実施の形態1に係る割り込み制御装置のブロック図Block diagram of interrupt control apparatus according to Embodiment 1 実施の形態1に係る割り込み制御装置の割り込み信号制御装置のブロック図Block diagram of an interrupt signal control device of the interrupt control device according to the first embodiment 実施の形態2に係る割り込み制御装置のブロック図Block diagram of an interrupt control device according to the second embodiment 実施の形態2に係る割り込み制御装置の割り込み信号制御装置のブロック図Block diagram of interrupt signal control device of interrupt control device according to Embodiment 2 実施の形態3に係る割り込み制御装置のブロック図Block diagram of interrupt control apparatus according to Embodiment 3 実施の形態4に係る割り込み制御装置のブロック図Block diagram of interrupt control apparatus according to Embodiment 4 実施の形態4に係る割り込み制御装置の割り込み信号制御装置のブロBlock of interrupt signal control device of interrupt control device according to embodiment 4 実施の形態4の変形例に係る割り込み制御装置のブロック図Block diagram of an interrupt control device according to a modification of the fourth embodiment

符号の説明Explanation of symbols

11 領域開始指定記憶レジスタ
12 領域終了指定記憶レジスタ
13 比較装置(比較手段)
14 データアドレス
15 割り込み許可フラグ(IE)
16 割り込み要求フラグ(IR)
17,22,46 割り込み信号制御装置(割り込み信号制御手段)
18 割り込み検出フラグ(ID)
21 カウントダウンタイマ
31 タイマ初期値設定レジスタ(タイマ初期値記憶手段)
32 タイマ初期値転送制御装置(タイマ初期値記憶手段)
41 割り込み禁止設定回数レジスタ
42 割り込み禁止設定レジスタ
43 加算器
44 割り込み許可設定レジスタ
45 減算器
51 割り込み禁止許可設定レジスタ
11 area start designation storage register 12 area end designation storage register 13 comparison device (comparison means)
14 Data address 15 Interrupt enable flag (IE)
16 Interrupt request flag (IR)
17, 22, 46 Interrupt signal control device (interrupt signal control means)
18 Interrupt detection flag (ID)
21 Countdown timer 31 Timer initial value setting register (timer initial value storage means)
32 Timer initial value transfer control device (timer initial value storage means)
41 Interrupt Disable Setting Count Register 42 Interrupt Disable Setting Register 43 Adder 44 Interrupt Enable Setting Register 45 Subtractor 51 Interrupt Disable Enable Setting Register

Claims (5)

外部からの割り込み信号により割り込みプログラムを実行するマイクロプロセッサにおいて、前記割り込みプログラムを制御する割り込み制御装置であって、
データアドレスと、前記割り込みプログラムが実行不可能なアドレス範囲とを比較して、前記データアドレスが前記アドレス範囲内に含まれるか否かを判断する比較手段と、
前記比較手段により、前記データアドレスが前記アドレス範囲内に含まれると判断された場合、割り込みプログラムが実行不可能となるように割り込み信号を制御する割り込み信号制御手段と、を備えた割り込み制御装置。
In a microprocessor that executes an interrupt program in response to an external interrupt signal, the interrupt control device controls the interrupt program,
Comparing means for comparing a data address with an address range where the interrupt program cannot be executed to determine whether the data address is included in the address range;
An interrupt control device comprising: an interrupt signal control unit configured to control an interrupt signal so that an interrupt program cannot be executed when the comparison unit determines that the data address is included in the address range.
前記比較手段は、前記割り込みプログラムが実行不可能なアドレス範囲を、領域開始指定記憶レジスタに記憶されているアドレスから領域終了指定記憶レジスタに記憶されているアドレスまでの範囲とする、ことを特徴とする請求項1に記載の割り込み制御装置。   The comparing means is characterized in that an address range in which the interrupt program cannot be executed is a range from an address stored in an area start designation storage register to an address stored in an area end designation storage register. The interrupt control device according to claim 1. 外部からの割り込み信号により割り込みプログラムを実行するマイクロプロセッサにおいて、前記割り込みプログラムを制御する割り込み制御装置であって、
カウントダウンタイマと、
前記カウントダウンタイマに設定された時間が経過したか否かを監視する監視手段と、
前記設定された時間が経過するまでの間、割り込みプログラムが実行不可能となるように割り込み信号を制御する割り込み信号制御手段と、を備えた割り込み制御装置。
In a microprocessor that executes an interrupt program in response to an external interrupt signal, the interrupt control device controls the interrupt program,
A countdown timer,
Monitoring means for monitoring whether or not the time set in the countdown timer has elapsed;
An interrupt control device comprising: interrupt signal control means for controlling an interrupt signal so that an interrupt program cannot be executed until the set time elapses.
外部からの割り込み信号により割り込みプログラムを実行するマイクロプロセッサにおいて、前記割り込みプログラムを制御する割り込み制御装置であって、
データアドレスと、前記割り込みプログラムを実行可能なアドレス範囲とを比較して、前記データアドレスが前記アドレス範囲内に含まれるか否かを判断する比較手段と、
所定の時間を記憶するタイマ初期値記憶手段と、
前記比較手段により、前記データアドレスが前記アドレス範囲外と判断された場合、前記タイマ初期値記憶手段において記憶された時間を設定するカウントダウンタイマと、
前記カウントダウンタイマに設定された時間が経過したか否かを監視する監視手段と、
前記設定された時間が経過するまでの間、割り込みプログラムが実行不可能となるように割り込み信号を制御する割り込み信号制御手段と、を備えた割り込み制御装置。
In a microprocessor that executes an interrupt program in response to an external interrupt signal, the interrupt control device controls the interrupt program,
Comparing means for comparing a data address with an address range in which the interrupt program can be executed to determine whether the data address is included in the address range;
Timer initial value storage means for storing a predetermined time;
A countdown timer for setting a time stored in the timer initial value storage means when the comparison means determines that the data address is out of the address range;
Monitoring means for monitoring whether or not the time set in the countdown timer has elapsed;
An interrupt control device comprising: interrupt signal control means for controlling an interrupt signal so that an interrupt program cannot be executed until the set time elapses.
外部からの割り込み信号により割り込みプログラムを実行するマイクロプロセッサにおいて、前記割り込みプログラムを制御する割り込み制御装置であって、
割り込み禁止設定回数を記憶する割り込み禁止設定回数レジスタと、
割り込み禁止設定を行うための割り込み禁止設定レジスタと、
前記割り込み禁止設定レジスタに割り込み禁止設定がされた際に、前記割り込み禁止設定回数レジスタに記憶されている割り込み禁止設定回数に1加算する加算器と、
割り込み許可設定を行うための割り込み許可設定レジスタと、
前記割り込み許可設定レジスタに割り込み許可が設定された際に、前記割り込み禁止設定回数レジスタに記憶されている割り込み禁止設定回数を1減算する減算器と、
前記割り込み禁止設定回数レジスタの値により、割り込みプログラムが実行不可能となるように割り込み信号を制御する割り込み信号制御手段と、を備えた割り込み制御装置。
In a microprocessor that executes an interrupt program in response to an external interrupt signal, the interrupt control device controls the interrupt program,
An interrupt disable setting count register that stores the interrupt disable setting count,
Interrupt disable setting register for interrupt disable setting,
An adder that adds 1 to the number of interrupt prohibition settings stored in the interrupt prohibition setting count register when the interrupt prohibition setting is set in the interrupt prohibition setting register;
Interrupt enable setting register for setting interrupt enable,
A subtractor for subtracting 1 from the interrupt disable setting number stored in the interrupt disable setting number register when interrupt enable is set in the interrupt enable setting register;
An interrupt control device comprising: interrupt signal control means for controlling an interrupt signal so that an interrupt program cannot be executed according to a value of the interrupt prohibition setting number register.
JP2004342402A 2004-11-26 2004-11-26 Interrupt controller Pending JP2006155048A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004342402A JP2006155048A (en) 2004-11-26 2004-11-26 Interrupt controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004342402A JP2006155048A (en) 2004-11-26 2004-11-26 Interrupt controller

Publications (1)

Publication Number Publication Date
JP2006155048A true JP2006155048A (en) 2006-06-15

Family

ID=36633302

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004342402A Pending JP2006155048A (en) 2004-11-26 2004-11-26 Interrupt controller

Country Status (1)

Country Link
JP (1) JP2006155048A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013097442A (en) * 2011-10-28 2013-05-20 Kyocera Document Solutions Inc Interruption control circuit

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013097442A (en) * 2011-10-28 2013-05-20 Kyocera Document Solutions Inc Interruption control circuit

Similar Documents

Publication Publication Date Title
KR101740224B1 (en) Illegal mode change handling
US20050240701A1 (en) Interrupt control apparatus
JPH08272625A (en) Device and method for multiprogram execution control
US20060075158A1 (en) Information processing apparatus and data transfer control method
JP2013137835A (en) Microcomputer and method of operation thereof
JPH1115675A (en) Interruption controller and control system
JP2002278779A (en) Processing performing device and program
JP6955858B2 (en) Control device
JPH0877075A (en) Information processor
JP2010186386A (en) Processor
JP2006155048A (en) Interrupt controller
JP2010267064A (en) Computer system and method of controlling the same
JP2008225807A (en) Control device, and program runaway monitoring method for the same
JP2000020352A (en) Stack overflow detecting method and stack underflow detecting method
JP2010191616A (en) Watchdog timer and method for controlling the same
JP2019020869A (en) Vehicle control device
JP4647276B2 (en) Semiconductor circuit device
JP5756413B2 (en) Control device
JP2005031724A (en) Abnormality detecting device
JP2019511042A (en) Register access control
US20220415405A1 (en) Memory-control circuit and method for controlling erasing operation of flash memory
JP5331451B2 (en) Microcontroller
JP4611659B2 (en) Unauthorized access detection device, unauthorized access detection method, program
JP2009098972A (en) Interruption control method and interruption system
KR100442290B1 (en) A circuit for controlling program counter