JP2009093344A - Microcomputer, method of using the same, and electronic control unit - Google Patents

Microcomputer, method of using the same, and electronic control unit Download PDF

Info

Publication number
JP2009093344A
JP2009093344A JP2007262227A JP2007262227A JP2009093344A JP 2009093344 A JP2009093344 A JP 2009093344A JP 2007262227 A JP2007262227 A JP 2007262227A JP 2007262227 A JP2007262227 A JP 2007262227A JP 2009093344 A JP2009093344 A JP 2009093344A
Authority
JP
Japan
Prior art keywords
interrupt
cpu
address range
microcomputer
specific
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
JP2007262227A
Other languages
Japanese (ja)
Inventor
Tadaharu Nishimura
忠治 西村
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.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to JP2007262227A priority Critical patent/JP2009093344A/en
Publication of JP2009093344A publication Critical patent/JP2009093344A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To execute certain programs while prohibiting interrupt without increasing a processing load on a CPU and the volume of the programs. <P>SOLUTION: In a microcomputer 3 mounted on an onboard electronic control unit (ECU) 1, an interrupt mask determination part 17 monitors the address of a program executed by the CPU 5 to determine whether or not the address value is within a specific address range shown by information in an address range register 17a, and if determining that it is within the address range, outputs an interrupt mask signal to an interrupt controller 11. An AND circuit 11c in the interrupt controller 11 then prohibits an interrupt request signal to be output to the CPU 5. The microcomputer 3 executes the programs while prohibiting interrupt only by storing the programs in the specific address range in memories 7 and 9. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、マイクロコンピュータ及びマイクロコンピュータを備えた電子制御装置に関するものである。   The present invention relates to a microcomputer and an electronic control device including the microcomputer.

従来より、マイクロコンピュータにおいては、あるプログラムの実行中に割り込みを禁止するための方法として、そのプログラム(即ち、割り込み禁止状態で実行したいプログラム)の先頭で、割り込みを禁止するための処理が行われるようにし、そのプログラムの最後で、割り込みの禁止を解除するための処理が行われるようにする、というプログラミング方法が用いられている。   Conventionally, in a microcomputer, as a method for prohibiting an interrupt during execution of a program, a process for prohibiting an interrupt is performed at the head of the program (that is, a program to be executed in an interrupt disabled state). Thus, a programming method is used in which processing for canceling the prohibition of interrupt is performed at the end of the program.

また、特許文献1には、実行中のプログラムがアクセスしているアドレスと、そのプログラムについてプログラムエリア設定レジスタに設定されたアクセス許可エリアのアドレスとを比較し、アクセスしているアドレスがアクセス許可エリア外のアドレスなら、CPUに割り込みをかけて不正アクセスを知らせる、ということが記載されている。
特開平8−272625号公報
Further, Patent Document 1 compares an address accessed by a program being executed with an address of an access permission area set in the program area setting register for the program, and the address being accessed is an access permission area. It is described that if the address is outside, the CPU is interrupted to notify the unauthorized access.
JP-A-8-272625

上記従来のプログラミング方法を実施したのでは、プログラムの先頭と最後でそれぞれ割り込み禁止/禁止解除のための処理をCPUが実行する必要があり、CPUの処理負荷が大きくなるという問題がある。特に、割り込み禁止状態で実行したいプログラムが頻繁に呼び出されるサブルーチンである場合、CPUの処理負荷が一層大きくなってしまう。   When the above-described conventional programming method is implemented, there is a problem that the CPU needs to execute processing for interrupt prohibition / inhibition cancellation at the beginning and end of the program, respectively, which increases the processing load on the CPU. In particular, when a program that is desired to be executed in an interrupt disabled state is a subroutine that is frequently called, the processing load on the CPU is further increased.

更に、上記従来のプログラミング方法では、プログラム容量(プログラムを構成するデータ量)が大きくなることから、そのプログラムを格納するメモリの容量が大きくなり、延いては、マイクロコンピュータを搭載する電子制御装置のコスト増加を招いてしまう。   Further, in the above conventional programming method, since the program capacity (the amount of data constituting the program) increases, the capacity of the memory for storing the program increases, and as a result, the electronic control device equipped with the microcomputer is increased. This will increase the cost.

一方、上記特許文献1に記載の技術では、こうした問題を解決することはできない。
そこで、本発明は、あるプログラムを割り込み禁止状態で実行することを、CPUの処理負荷及びプログラム容量を増大させることなく実現することを目的としている。
On the other hand, the technique described in Patent Document 1 cannot solve such a problem.
Therefore, an object of the present invention is to realize that a certain program is executed in an interrupt disabled state without increasing the processing load and program capacity of the CPU.

請求項1のマイクロコンピュータ(以下、マイコンともいう)では、CPUがメモリに格納されているプログラムを実行する。そして特に、割り込み制限手段が設けられており、その割り込み制限手段は、CPUが実行するプログラムのアドレス(以下、実行アドレスという)が、メモリ上の特定アドレス範囲内であるか否かを判定すると共に、実行アドレスが特定アドレス範囲内であると判定している場合には、CPUが割り込みを受け付けないようにする。   In the microcomputer according to claim 1 (hereinafter also referred to as a microcomputer), the CPU executes a program stored in the memory. In particular, interrupt limiting means is provided, and the interrupt limiting means determines whether the address of a program executed by the CPU (hereinafter referred to as an execution address) is within a specific address range on the memory. If it is determined that the execution address is within the specific address range, the CPU is prevented from accepting an interrupt.

このマイコンによれば、請求項6に記載のように、CPUに実行させるプログラムのうち、割り込み禁止状態で実行したいプログラムを、メモリの前記特定アドレス範囲内に格納しておけば、そのプログラムを割り込み禁止状態で実行することができる。そのプログラムの実行時には、割り込み制限手段により、CPUが割り込みを受け付けない(即ち、割り込み処理を実行しない)ようになるからである。   According to this microcomputer, if the program to be executed in the interrupt disabled state is stored in the specific address range of the memory among the programs to be executed by the CPU, the program is interrupted. Can be executed in prohibited state. This is because when the program is executed, the interrupt restriction means prevents the CPU from accepting the interrupt (ie, does not execute the interrupt process).

よって、プログラムによる割り込み禁止及び禁止解除のための処理を省略することができ、CPUの処理負荷及びプログラム容量を低減することができる。また、このため、メモリの容量も低減することができる。   Therefore, it is possible to omit the processing for interrupt prohibition and prohibition cancellation by the program, and the processing load and program capacity of the CPU can be reduced. For this reason, the capacity of the memory can also be reduced.

次に、請求項2のマイコンでは、請求項1のマイコンにおいて、割り込み制限手段は、CPUが命令フェッチ時に該CPUとメモリとの間のアドレスバスへ出力するアドレス値を監視し、そのアドレスバス上のアドレス値が前記特定アドレス範囲内であるか否かを判定することより、実行アドレスが前記特定アドレス範囲内であるか否かを判定するようになっている。   According to a second aspect of the present invention, in the microcomputer according to the first aspect, the interrupt limiting means monitors the address value output to the address bus between the CPU and the memory when the instruction is fetched. By determining whether the address value is within the specific address range, it is determined whether the execution address is within the specific address range.

この構成によれば、割り込み制限手段のうち、実行アドレスが特定アドレス範囲内であるか否かを判定する部分(以下、判定機能部分という)を、CPUの外部に構成することができるため、その判定機能部分の追加や削除が容易となる。   According to this configuration, a part of the interrupt limiting unit that determines whether or not the execution address is within the specific address range (hereinafter referred to as a determination function part) can be configured outside the CPU. It is easy to add or delete judgment function parts.

次に、請求項3のマイコンでは、請求項1,2のマイコンにおいて、割り込み制限手段は、CPUの外部に設けられた割り込みコントローラがCPUに対して割り込み要求信号を出力するのを阻止することにより、CPUが割り込みを受け付けないようにする。   Next, in the microcomputer according to claim 3, in the microcomputer according to claims 1 and 2, the interrupt restricting means prevents the interrupt controller provided outside the CPU from outputting an interrupt request signal to the CPU. The CPU does not accept interrupts.

この構成によれば、割り込み制限手段のうち、CPUが割り込みを受け付けないようにするための部分(以下、割り込み禁止機能部分という)を、CPUの外部に構成することができるため、その割り込み禁止機能部分の追加や削除が容易となる。   According to this configuration, a portion of the interrupt limiting means for preventing the CPU from accepting an interrupt (hereinafter referred to as an interrupt disable function portion) can be configured outside the CPU. It is easy to add or delete parts.

次に、請求項4のマイコンでは、請求項1〜3のマイコンにおいて、メモリ上のアドレス範囲を示す情報がCPUによって書き込まれるアドレス範囲設定用レジスタが設けられている。そして、割り込み制限手段は、アドレス範囲設定用レジスタ内の情報が示すアドレス範囲を、前記特定アドレス範囲として扱うようになっている。つまり、割り込み制限手段は、実行アドレスが、アドレス範囲設定用レジスタ内の情報が示す特定アドレス範囲内であるか否かを判定するようになっている。   According to a fourth aspect of the present invention, in the microcomputer according to the first to third aspects, an address range setting register in which information indicating the address range on the memory is written by the CPU is provided. The interrupt restricting means handles the address range indicated by the information in the address range setting register as the specific address range. That is, the interrupt restricting means determines whether or not the execution address is within a specific address range indicated by the information in the address range setting register.

このため、アドレス範囲設定用レジスタに書き込む内容によって特定アドレス範囲を任意に設定することができる。よって、このマイコンによれば、割り込み禁止状態で実行したいプログラムのサイズなどに応じて、前記特定アドレス範囲を設定できるようになり、高い汎用性が得られる。   Therefore, the specific address range can be arbitrarily set depending on the contents written to the address range setting register. Therefore, according to this microcomputer, the specific address range can be set according to the size of the program to be executed in the interrupt disabled state, and high versatility can be obtained.

次に、請求項5のマイコンでは、請求項1〜4のマイコンにおいて、CPUが割り込み制限手段の動作状態を保持するための状態保持用命令を実行すると、その状態保持用命令による動作状態の保持を解除するための解除用命令をCPUが実行するまでの間、割り込み制限手段は、その状態保持用命令が実行された時になっている動作状態を保持するようになっている。尚、割り込み制限手段の動作状態とは、CPUが割り込みを受け付けないようにする動作状態と、CPUが割り込みを受け付けることができるようにする動作状態との何れかである。   Next, in the microcomputer according to claim 5, in the microcomputer according to claims 1 to 4, when the CPU executes a state holding instruction for holding the operation state of the interrupt limiting means, the operation state is held by the state holding instruction. Until the CPU executes a release instruction for canceling the state, the interrupt limiting means holds the operation state that is in effect when the state holding instruction is executed. Note that the operating state of the interrupt limiting means is either an operating state in which the CPU does not accept interrupts or an operating state in which the CPU can accept interrupts.

このような請求項5のマイコンによれば、特定アドレス範囲内のプログラムPaから、特定アドレス範囲外のプログラムPbを呼び出して、そのプログラムPbを実行する際に、必要により、割り込み禁止状態が維持されるようにすることができる。   According to such a microcomputer of claim 5, when the program Pb outside the specific address range is called from the program Pa within the specific address range and the program Pb is executed, the interrupt disabled state is maintained as necessary. You can make it.

例えば、特定アドレス範囲外のサブルーチンプログラムPbを特定アドレス範囲外の他のプログラムPcから呼び出した場合には、割り込み禁止としないが、そのサブルーチンプログラムPbを特定アドレス範囲内のプログラムPaから呼び出した場合には、割り込み禁止状態を継続したい、つまり呼び出し元の状態を引き継いで処理を行いたい、という場合がある。そして、これを実現するためには、特定アドレス範囲内のプログラムPaから特定アドレス範囲外のサブルーチンプログラムPbを呼び出す際に上記状態保持用命令が実行され、呼び出したサブルーチンプログラムPbから戻ると上記解除用命令が実行されるように、プログラムPaを作成すれば良い。   For example, when a subroutine program Pb outside the specific address range is called from another program Pc outside the specific address range, interrupts are not prohibited, but when the subroutine program Pb is called from a program Pa within the specific address range. In some cases, it is desired to continue the interrupt disabled state, that is, to perform processing while taking over the state of the caller. In order to realize this, the state holding instruction is executed when the subroutine program Pb outside the specific address range is called from the program Pa within the specific address range. The program Pa may be created so that the instructions are executed.

一方、請求項7の電子制御装置は、請求項6に記載の使用方法が適用された電子制御装置である。即ち、請求項7の電子制御装置は、請求項1〜5のマイコンを備え、そのマイコンによって制御対象を制御するための処理を行う電子制御装置であって、制御対象を制御するためにCPUが実行するプログラムのうち、割り込み禁止状態で実行されるプログラムが、メモリの前記特定アドレス範囲内に格納されていることを特徴としている。   On the other hand, an electronic control device according to a seventh aspect is an electronic control device to which the usage method according to the sixth aspect is applied. That is, an electronic control device according to a seventh aspect is an electronic control device that includes the microcomputer according to any one of the first to fifth aspects, and performs processing for controlling a control target by the microcomputer, and the CPU is used to control the control target. Among the programs to be executed, a program executed in the interrupt disabled state is stored in the specific address range of the memory.

そして、この電子制御装置によれば、プログラム容量の低減により、必要なメモリ容量を抑制することができ、コスト増加を防止することができる。また、CPUの処理負荷が低減されるため、制御性能を高めることができる。   According to this electronic control device, the required memory capacity can be suppressed by reducing the program capacity, and an increase in cost can be prevented. Further, since the processing load on the CPU is reduced, control performance can be improved.

次に、請求項8のマイコンでは、CPUがメモリに格納されているプログラムを実行する。また、割り込みマスクレベルが記憶されるマスクレベル記憶手段と、割り込みコントローラを備えている。そして、割り込みコントローラは、優先レベルがマスクレベル記憶手段内の割り込みマスクレベルよりも高い割り込みの要求信号が発生すると、その割り込みをCPUに受け付けさせる(即ち、その割り込みに該当する割り込み処理を実行させる)が、優先レベルがマスクレベル記憶手段内の割り込みマスクレベル以下である割り込みの要求信号が発生しても、その割り込みをCPUが受け付けないようにする(即ち、その割り込みに該当する割り込み処理を実行しないようにする)。よって、優先レベルがマスクレベル記憶手段内の割り込みマスクレベル以下である割り込みは、起動されずにマスク(禁止)されることとなる。   Next, in the microcomputer according to the eighth aspect, the CPU executes a program stored in the memory. Also provided is a mask level storing means for storing an interrupt mask level and an interrupt controller. When an interrupt request signal having a priority level higher than the interrupt mask level in the mask level storage means is generated, the interrupt controller causes the CPU to accept the interrupt (that is, to execute an interrupt process corresponding to the interrupt). However, even if an interrupt request signal whose priority level is lower than or equal to the interrupt mask level in the mask level storage means is generated, the interrupt is not accepted by the CPU (that is, the interrupt processing corresponding to the interrupt is not executed). ). Therefore, an interrupt whose priority level is equal to or lower than the interrupt mask level in the mask level storage means is masked (prohibited) without being activated.

そして特に、請求項8のマイコンには、以下の判定手段とマスクレベル変更手段とマスクレベル復元手段とが備えられている。
判定手段は、CPUが実行するプログラムのアドレスである実行アドレスが、メモリ上の特定アドレス範囲外から特定アドレス範囲内に入ったか否かと、実行アドレスが、特定アドレス範囲内から特定アドレス範囲外に出たか否かとを判定する。
In particular, the microcomputer of claim 8 is provided with the following judging means, mask level changing means, and mask level restoring means.
The judging means determines whether or not the execution address, which is the address of the program executed by the CPU, has entered the specific address range from outside the specific address range on the memory, and the execution address is out of the specific address range from the specific address range. It is determined whether or not.

そして、判定手段により実行アドレスが特定アドレス範囲外から特定アドレス範囲内に入ったと判定されると、マスクレベル変更手段が、マスクレベル記憶手段内の割り込みマスクレベルを特定の記憶部に記憶した後、マスクレベル記憶手段内の割り込みマスクレベルを、前記特定アドレス範囲に対して定められている特定の優先レベルに変更する。   Then, when it is determined by the determination means that the execution address has entered the specific address range from outside the specific address range, the mask level changing means stores the interrupt mask level in the mask level storage means in the specific storage unit, The interrupt mask level in the mask level storage means is changed to a specific priority level determined for the specific address range.

また、判定手段により実行アドレスが特定アドレス範囲内から特定アドレス範囲外に出たと判定されると、マスクレベル復元手段が、マスクレベル記憶手段内の割り込みマスクレベルを、前記記憶部内の割り込みマスクレベル(即ち、実行アドレスが特定アドレス範囲外から特定アドレス範囲内になったと判定された際にマスクレベル変更手段によって記憶部内に退避された元の割り込みマスクレベル)に戻す。   When the determination means determines that the execution address has gone out of the specific address range from the specific address range, the mask level restoration means sets the interrupt mask level in the mask level storage means to the interrupt mask level ( That is, when it is determined that the execution address is outside the specific address range and within the specific address range, the mask level changing means restores the original interrupt mask level saved in the storage unit).

このようなマイコンによれば、請求項14に記載のように、CPUに実行させるプログラムのうち、優先レベルが前記特定の優先レベル以下である割り込み(以下、特定の優先レベル以下の割り込みともいう)を禁止した状態で実行したいプログラムを、メモリの前記特定アドレス範囲内に格納しておけば、そのプログラムを、特定の優先レベル以下の割り込みを禁止した状態で実行することができる。特定アドレス範囲内に格納されたプログラムの実行時には、マスクレベル変更手段により、マスクレベル記憶手段内の割り込みマスクレベルが自動的に前記特定の優先レベルに設定されるからである。   According to such a microcomputer, as described in claim 14, an interrupt whose priority level is equal to or lower than the specific priority level among programs to be executed by the CPU (hereinafter also referred to as an interrupt equal to or lower than a specific priority level). If a program desired to be executed in a state in which the above-described prohibition is prohibited is stored in the specific address range of the memory, the program can be executed in a state in which an interrupt having a specific priority level or lower is prohibited. This is because when executing a program stored in the specific address range, the mask level changing means automatically sets the interrupt mask level in the mask level storage means to the specific priority level.

よって、このマイコンによれば、特定の優先レベル以下の割り込みを禁止した状態で実行したいプログラムがある場合に、そのプログラムの先頭で特定の優先レベル以下の割り込みを禁止するための処理を行い該プログラムの最後で特定の優先レベル以下の割り込みの禁止を解除するための処理を行うようにする必要がなくなる。   Therefore, according to this microcomputer, when there is a program to be executed in a state in which interrupts below a specific priority level are prohibited, processing for prohibiting interrupts below a specific priority level is performed at the head of the program and the program is executed. It is no longer necessary to perform processing for canceling the prohibition of interrupts below a specific priority level at the end of.

尚、特定の優先レベル以下の割り込みを禁止するための処理としては、マスクレベル記憶手段内の割り込みマスクレベルを特定の優先レベルに書き換える処理であり、特定の優先レベル以下の割り込みの禁止を解除するための処理としては、マスクレベル記憶手段内の割り込みマスクレベルを特定の優先レベルに書き換える前の元の割り込みマスクレベルに戻す処理が考えられる。そして、そのような処理をプログラム中で行う必要がなくなる。   The process for prohibiting interrupts below a specific priority level is a process of rewriting the interrupt mask level in the mask level storage means to a specific priority level, and the prohibition of interrupts below a specific priority level is canceled. As a process for this, a process of returning the interrupt mask level in the mask level storage means to the original interrupt mask level before rewriting to a specific priority level can be considered. And it is not necessary to perform such processing in the program.

このため、CPUの処理負荷及びプログラム容量を低減することができ、メモリの容量も低減することができる。
次に、請求項9のマイコンでは、請求項8のマイコンにおいて、マスクレベル変更手段は、マスクレベル記憶手段内の変更前の割り込みマスクレベルが、前記特定の優先レベル以上ならば、マスクレベル記憶手段内の割り込みマスクレベルを変更しないようになっている。
For this reason, the processing load and program capacity of the CPU can be reduced, and the capacity of the memory can also be reduced.
Next, in the microcomputer according to claim 9, in the microcomputer according to claim 8, the mask level changing means has a mask level storing means if the interrupt mask level before the change in the mask level storing means is equal to or higher than the specific priority level. The interrupt mask level is not changed.

この構成によれば、特定アドレス範囲外のプログラムによってマスクレベル記憶手段内の割り込みマスクレベルが前記特定の優先レベル以上に設定されている状態で、特定アドレス範囲外の何れかのプログラムから特定アドレス範囲内のプログラムが呼び出された場合に、マスクレベル記憶手段内の割り込みマスクレベルが、呼び出し元のプログラムがマスクしたい割り込みの優先レベルよりも低くなってしまうこと(即ち、呼び出し元のプログラムがマスクしたい割り込みが割り込んでしまうこと)を防止することができる。つまり、呼び出し元のプログラムの実行時に設定されていた割り込みマスクレベルを保証することができる。   According to this configuration, in a state where the interrupt mask level in the mask level storage means is set to be equal to or higher than the specific priority level by a program outside the specific address range, the program from any program outside the specific address range When an internal program is called, the interrupt mask level in the mask level storage means becomes lower than the priority level of the interrupt that the call source program wants to mask (that is, the interrupt that the call source program wants to mask) Can be prevented. In other words, it is possible to guarantee the interrupt mask level set when the calling program is executed.

次に、請求項10のマイコンでは、請求項8,9のマイコンにおいて、CPUが割り込みを受け付けて割り込み処理を行う場合と、その割り込み処理から元の処理へ復帰する場合には、判定手段の作動が禁止されるようになっている。   Next, in the microcomputer according to claim 10, in the microcomputer according to claims 8 and 9, when the CPU accepts an interrupt and performs interrupt processing, and when returning from the interrupt processing to the original processing, the operation of the determination means Is now prohibited.

この構成によれば、下記の問題(1),(2)を解決でき有利である。
(1)まず、特定アドレス範囲内のプログラムの実行中に、その特定アドレス範囲に対して定められた特定の優先レベルよりも高レベルの割り込みが発生して、特定アドレス範囲外の割り込み処理のプログラムが実行された場合、その割り込み処理中の割り込みマスクレベルは、その割り込みの要因に対応したレベルに設定したい。しかし、この場合、実行アドレスが特定アドレス範囲内から特定アドレス範囲外へ移ることとなるため、そのことが判定手段によって判定されると、マスクレベル復元手段が作動して、マスクレベル記憶手段内の割り込みマスクレベルが、その時点で記憶部に記憶されている割り込みマスクレベルに設定されてしまう。
This configuration is advantageous because it can solve the following problems (1) and (2).
(1) First, during execution of a program within a specific address range, an interrupt with a higher level than a specific priority level determined for the specific address range occurs, and an interrupt processing program outside the specific address range When is executed, the interrupt mask level during the interrupt processing is set to a level corresponding to the cause of the interrupt. However, in this case, since the execution address moves from within the specific address range to outside the specific address range, when this is determined by the determining means, the mask level restoring means is activated and the mask level storage means The interrupt mask level is set to the interrupt mask level stored in the storage unit at that time.

(2)また仮に、割り込み処理中の割り込みマスクレベルが、その割り込みの要因に対応したレベルに設定されたとしても、割り込み処理から元の処理へ戻る際には、実行アドレスが特定アドレス範囲外から特定アドレス範囲内へ移ることとなるため、そのことが判定手段によって判定されると、マスクレベル変更手段が作動して、記憶部に上記割り込みの要因に対応した割り込みマスクレベルが記憶されてしまう。すると、その後、特定アドレス範囲内のプログラムの実行が終了して特定アドレス範囲外のプログラムへ戻る場合に、マスクレベル記憶手段内の割り込みマスクレベルを、元の値に戻すことができなくなる。   (2) Even if the interrupt mask level during interrupt processing is set to a level corresponding to the cause of the interrupt, when returning from interrupt processing to the original processing, the execution address is not within the specified address range. Since it moves to the specific address range, if it is determined by the determining means, the mask level changing means is activated, and the interrupt mask level corresponding to the interrupt factor is stored in the storage unit. Then, when the execution of the program in the specific address range is finished and the program returns to the program outside the specific address range, the interrupt mask level in the mask level storage means cannot be returned to the original value.

これに対して請求項10のマイコンによれば、CPUが割り込みを受け付けて割り込み処理を行う場合と、その割り込み処理から元の処理へ復帰する場合には、判定手段の作動が禁止されるため、マスクレベル復元手段とマスクレベル変更手段が作動せず、上記問題を解決することができるのである。   On the other hand, according to the microcomputer of claim 10, when the CPU accepts the interrupt and performs the interrupt process, and when returning from the interrupt process to the original process, the operation of the determining means is prohibited. The mask level restoring means and the mask level changing means do not operate, and the above problem can be solved.

次に、請求項11のマイコンでは、請求項8のマイコンにおいて、前記特定アドレス範囲は、複数の部分特定アドレス範囲からなると共に、その各部分特定アドレス範囲に対してそれぞれ異なる優先レベルが定められている。   Next, in the microcomputer according to claim 11, in the microcomputer according to claim 8, the specific address range includes a plurality of partial specific address ranges, and different priority levels are defined for the partial specific address ranges. Yes.

更に、判定手段は、実行アドレスが特定アドレス範囲外から前記複数の部分特定アドレス範囲のうちの何れに入ったかを区別して判定するようになっている。
そして、マスクレベル変更手段は、判定手段により実行アドレスが特定アドレス範囲外から前記部分特定アドレス範囲の何れかに入ったと判定されると、マスクレベル記憶手段内の割り込みマスクレベルを前記記憶部に記憶した後、マスクレベル記憶手段内の割り込みマスクレベルを、実行アドレスが今回入った部分特定アドレス範囲に対して定められている特定の優先レベルに変更する。
Further, the determination means distinguishes and determines which of the plurality of partial specific address ranges the execution address has entered from outside the specific address range.
The mask level changing unit stores the interrupt mask level in the mask level storage unit in the storage unit when the determination unit determines that the execution address has entered any of the partial specific address ranges from outside the specific address range. After that, the interrupt mask level in the mask level storage means is changed to a specific priority level determined for the partial specific address range in which the execution address is entered this time.

このようなマイコンによれば、請求項16に記載のように、CPUに実行させるプログラムのうち、優先レベルがN(Nは優先レベルを示す数)以下である割り込み(以下、優先レベルN以下の割り込みともいう)を禁止した状態で実行したいプログラムを、メモリにおける複数の部分特定アドレス範囲のうち、優先レベルがNに定められている部分特定アドレス範囲内に格納しておけば、そのプログラムを、優先レベルN以下の割り込みを禁止した状態で実行することができる。よって、実行中に禁止したい割り込みの優先レベルが異なる複数のプログラムがあっても対応することができる。   According to such a microcomputer, as described in claim 16, among the programs to be executed by the CPU, an interrupt whose priority level is N or less (N is a number indicating the priority level) (hereinafter referred to as priority level N or less). If a program to be executed in a state in which interrupt is also prohibited is stored in a partial specific address range whose priority level is set to N among a plurality of partial specific address ranges in the memory, the program is It can be executed in a state in which an interrupt with a priority level N or less is prohibited. Therefore, it is possible to cope with a plurality of programs having different priority levels of interrupts to be prohibited during execution.

次に、請求項12のマイコンでは、請求項11のマイコンにおいて、マスクレベル変更手段は、マスクレベル記憶手段内の変更前の割り込みマスクレベルが、前記特定の優先レベル(即ち、実行アドレスが今回入った部分特定アドレス範囲に対して定められている優先レベル)以上ならば、マスクレベル記憶手段内の割り込みマスクレベルを変更しないようになっている。そして、このマイコンによれば、請求項9のマイコンについて述べた効果が得られる。   Next, in the microcomputer according to claim 12, in the microcomputer according to claim 11, the mask level changing means sets the interrupt mask level before the change in the mask level storing means to the specific priority level (that is, the execution address is input this time). If it is equal to or higher than the priority level determined for the partial specific address range, the interrupt mask level in the mask level storage means is not changed. And according to this microcomputer, the effect described about the microcomputer of Claim 9 is acquired.

次に、請求項13のマイコンでは、請求項11,12のマイコンにおいて、CPUが割り込みを受け付けて割り込み処理を行う場合と、その割り込み処理から元の処理へ復帰する場合には、判定手段の作動が禁止されるようになっている。そして、このマイコンによれば、請求項10のマイコンについて述べた効果が得られる。   Next, in the microcomputer according to claim 13, in the microcomputer according to claims 11 and 12, when the CPU accepts an interrupt and performs interrupt processing, and when the interrupt processing returns to the original processing, the operation of the determination means Is now prohibited. And according to this microcomputer, the effect described about the microcomputer of Claim 10 is acquired.

一方、請求項15の電子制御装置は、請求項14に記載の使用方法が適用された電子制御装置である。即ち、請求項15の電子制御装置は、請求項8〜請求項10のマイコンを備え、そのマイコンによって制御対象を制御するための処理を行う電子制御装置であって、制御対象を制御するためにCPUが実行するプログラムのうち、優先レベルが前記特定の優先レベル以下である割り込みを禁止した状態で実行されるプログラムが、メモリの前記特定アドレス範囲内に格納されていることを特徴としている。   On the other hand, an electronic control device according to a fifteenth aspect is an electronic control device to which the usage method according to the fourteenth aspect is applied. That is, an electronic control device according to a fifteenth aspect is an electronic control device including the microcomputer according to the eighth to tenth aspects, and performs processing for controlling a control target by the microcomputer, and controls the control target. Among the programs executed by the CPU, a program that is executed in a state in which an interrupt whose priority level is lower than the specific priority level is prohibited is stored in the specific address range of the memory.

また、請求項17の電子制御装置は、請求項16に記載の使用方法が適用された電子制御装置である。即ち、請求項17の電子制御装置は、請求項11〜13のマイコンを備え、そのマイコンによって制御対象を制御するための処理を行う電子制御装置であって、制御対象を制御するためにCPUが実行するプログラムのうち、優先レベルがN以下である割り込みを禁止した状態で実行されるプログラムが、メモリにおける複数の部分特定アドレス範囲のうち、優先レベルがNに定められている部分特定アドレス範囲内に格納されていることを特徴としている。   An electronic control device according to a seventeenth aspect is an electronic control device to which the usage method according to the sixteenth aspect is applied. That is, an electronic control device according to a seventeenth aspect is an electronic control device including the microcomputer according to the first to thirteenth aspects, and performs processing for controlling a control target by the microcomputer, and the CPU is used to control the control target. Among programs to be executed, a program that is executed in a state where an interrupt whose priority level is N or less is prohibited is within a partial specific address range in which a priority level is set to N among a plurality of partial specific address ranges in the memory. It is characterized by being stored in.

そして、請求項15,17の電子制御装置によれば、プログラム容量の低減により、必要なメモリ容量を抑制することができ、コスト増加を防止することができる。また、CPUの処理負荷が低減されるため、制御性能を高めることができる。   According to the electronic control device of the fifteenth and seventeenth aspects, the required memory capacity can be suppressed and the increase in cost can be prevented by reducing the program capacity. Further, since the processing load on the CPU is reduced, control performance can be improved.

次に、請求項18のマイコンでは、CPUがメモリに格納されているプログラムを実行する。そして特に、特定割り込み制限手段が設けられており、その特定割り込み制限手段は、CPUが実行するプログラムのアドレスである実行アドレスが、メモリ上の特定アドレス範囲内であるか否かを判定すると共に、実行アドレスが特定アドレス範囲内であると判定している場合には、CPUが特定の割り込み要因の割り込みを受け付けないようにする。   Next, in the microcomputer according to claim 18, the CPU executes the program stored in the memory. In particular, specific interrupt limiting means is provided, and the specific interrupt limiting means determines whether or not an execution address that is an address of a program executed by the CPU is within a specific address range on the memory, and When it is determined that the execution address is within the specific address range, the CPU is prevented from accepting an interrupt of a specific interrupt factor.

このマイコンによれば、請求項24に記載のように、CPUに実行させるプログラムのうち、前記特定の割り込み要因の割り込みを禁止した状態で実行したいプログラムを、メモリの特定アドレス範囲内に格納しておけば、そのプログラムを、特定の割り込み要因の割り込みを禁止した状態で実行することができる。そのプログラムの実行時には、特定割り込み制限手段により、CPUが特定の割り込み要因の割り込みを受け付けない(即ち、特定の割り込み要因の割り込み処理を実行しない)ようになるからである。   According to this microcomputer, among the programs to be executed by the CPU, the program to be executed in a state where the interruption of the specific interrupt factor is prohibited is stored in a specific address range of the memory. If this is the case, the program can be executed in a state in which interrupts of specific interrupt factors are prohibited. This is because when the program is executed, the CPU does not accept an interrupt with a specific interrupt factor (that is, does not execute an interrupt process with a specific interrupt factor) by the specific interrupt limiting means.

よって、このマイコンによれば、特定の割り込み要因の割り込みを禁止した状態で実行したいプログラムがある場合に、そのプログラムの先頭で特定の割り込み要因の割り込みを禁止するための処理を行い該プログラムの最後で特定の割り込み要因の割り込み禁止を解除するための処理を行うようにする必要がなくなる。このため、CPUの処理負荷及びプログラム容量を低減することができ、メモリの容量も低減することができる。   Therefore, according to this microcomputer, when there is a program to be executed in a state where the interrupt of a specific interrupt factor is prohibited, the process for prohibiting the interrupt of the specific interrupt factor is performed at the head of the program and the end of the program is executed. Thus, it is not necessary to perform processing for canceling the prohibition of interrupt of a specific interrupt factor. For this reason, the processing load and program capacity of the CPU can be reduced, and the capacity of the memory can also be reduced.

次に、請求項19のマイコンでは、請求項18のマイコンにおいて、割り込み要因を示す情報がCPUによって書き込まれる割り込み要因設定用レジスタが設けられている。そして、特定割り込み制限手段は、割り込み要因設定用レジスタ内の情報が示す割り込み要因を、前記特定の割り込み要因として扱うようになっている。つまり、特定割り込み制限手段は、割り込み要因設定用レジスタ内の情報が示す割り込み要因の割り込みをCPUが受け付けないようにする。   According to a nineteenth aspect of the present invention, there is provided an interrupt factor setting register in which information indicating an interrupt factor is written by the CPU. The specific interrupt limiting means handles the interrupt factor indicated by the information in the interrupt factor setting register as the specific interrupt factor. That is, the specific interrupt limiting means prevents the CPU from accepting an interrupt factor interrupt indicated by the information in the interrupt factor setting register.

このため、割り込み要因設定用レジスタに書き込む内容により、禁止される割り込みの要因を任意に設定することができる。よって、このマイコンによれば、高い汎用性が得られる。   For this reason, the interrupt factor to be prohibited can be arbitrarily set according to the contents written to the interrupt factor setting register. Therefore, according to this microcomputer, high versatility can be obtained.

次に、請求項20のマイコンでは、請求項19のマイコンにおいて、割り込み要因設定用レジスタには、複数種類の割り込み要因を示す情報を書き込むことが可能になっている。そして、この構成によれば、特定アドレス範囲内のプログラムが実行されるときに禁止される割り込みの要因を複数指定することができるため、プログラム設計の自由度を向上させることができる。   Next, in the microcomputer according to claim 20, in the microcomputer according to claim 19, information indicating a plurality of types of interrupt factors can be written in the interrupt factor setting register. According to this configuration, it is possible to specify a plurality of interrupt factors that are prohibited when a program within a specific address range is executed, so that the degree of freedom in program design can be improved.

次に、請求項21のマイコンでは、請求項18〜20のマイコンにおいて、特定割り込み制限手段は、CPUが命令フェッチ時に該CPUとメモリとの間のアドレスバスへ出力するアドレス値を監視し、そのアドレスバス上のアドレス値が前記特定アドレス範囲内であるか否かを判定することより、実行アドレスが前記特定アドレス範囲内であるか否かを判定するようになっている。   Next, in the microcomputer according to claim 21, in the microcomputer according to claims 18 to 20, the specific interrupt limiting means monitors an address value output to an address bus between the CPU and the memory at the time of fetching an instruction. By determining whether the address value on the address bus is within the specific address range, it is determined whether the execution address is within the specific address range.

この構成によれば、特定割り込み制限手段のうち、実行アドレスが特定アドレス範囲内であるか否かを判定する判定機能部分を、CPUの外部に構成することができるため、その判定機能部分の追加や削除が容易となる。   According to this configuration, the determination function part for determining whether or not the execution address is within the specific address range in the specific interrupt limiting unit can be configured outside the CPU. And deletion is easy.

次に、請求項22のマイコンでは、請求項18〜21のマイコンにおいて、特定割り込み制限手段は、CPUの外部に設けられた割り込みコントローラがCPUに対して前記特定の割り込み要因の割り込み要求信号を出力するのを阻止することにより、CPUが前記特定の割り込み要因の割り込みを受け付けないようにする。   According to a twenty-second aspect of the present invention, in the microcomputer of any of the eighteenth to twenty-first aspects, the specific interrupt limiting means outputs an interrupt request signal of the specific interrupt factor to the CPU from an interrupt controller provided outside the CPU. By preventing this, the CPU is prevented from accepting an interrupt of the specific interrupt factor.

この構成によれば、特定割り込み制限手段のうち、CPUが特定の割り込み要因の割り込みを受け付けないようにするための部分を、CPUの外部に構成することができるため、その部分の追加や削除が容易となる。   According to this configuration, a part of the specific interrupt limiting means for preventing the CPU from accepting an interrupt of a specific interrupt factor can be configured outside the CPU. It becomes easy.

次に、請求項23のマイコンでは、請求項18〜22のマイコンにおいて、メモリ上のアドレス範囲を示す情報がCPUによって書き込まれるアドレス範囲設定用レジスタが設けられている。そして、特定割り込み制限手段は、アドレス範囲設定用レジスタ内の情報が示すアドレス範囲を、前記特定アドレス範囲として扱うようになっている。つまり、特定割り込み制限手段は、実行アドレスが、アドレス範囲設定用レジスタ内の情報が示す特定アドレス範囲内であるか否かを判定するようになっている。   According to a twenty-third aspect of the present invention, in the microcomputer according to any one of the eighteenth to twenty-second aspects, an address range setting register in which information indicating an address range on the memory is written is provided. The specific interrupt limiting means handles the address range indicated by the information in the address range setting register as the specific address range. That is, the specific interrupt limiting unit determines whether or not the execution address is within the specific address range indicated by the information in the address range setting register.

このマイコンによれば、アドレス範囲設定用レジスタに書き込む内容によって特定アドレス範囲を任意に設定することができ、高い汎用性が得られる。
一方、請求項25の電子制御装置は、請求項24に記載の使用方法が適用された電子制御装置である。即ち、請求項25の電子制御装置は、請求項18〜請求項23のマイコンを備え、そのマイコンによって制御対象を制御するための処理を行う電子制御装置であって、制御対象を制御するためにCPUが実行するプログラムのうち、前記特定の割り込み要因の割り込みを禁止した状態で実行されるプログラムが、メモリの前記特定アドレス範囲内に格納されていることを特徴としている。
According to this microcomputer, the specific address range can be arbitrarily set according to the contents written in the address range setting register, and high versatility can be obtained.
On the other hand, an electronic control device according to claim 25 is an electronic control device to which the usage method according to claim 24 is applied. That is, an electronic control device according to claim 25 is an electronic control device including the microcomputer according to claim 18 to claim 23, and performs processing for controlling the controlled object by the microcomputer, in order to control the controlled object. Of the programs executed by the CPU, a program that is executed in a state in which the interruption of the specific interrupt factor is prohibited is stored in the specific address range of the memory.

そして、この電子制御装置によれば、プログラム容量の低減により、必要なメモリ容量を抑制することができ、コスト増加を防止することができる。また、CPUの処理負荷が低減されるため、制御性能を高めることができる。   According to this electronic control device, the required memory capacity can be suppressed by reducing the program capacity, and an increase in cost can be prevented. Further, since the processing load on the CPU is reduced, control performance can be improved.

以下に、本発明が適用された実施形態の電子制御装置について説明する。尚、本実施形態の電子制御装置(以下、ECUという)は、例えば車両に搭載されて、その車両におけるエンジン等の制御対象を制御するものである。
[第1実施形態]
図1に示すように、第1実施形態のECU1は、制御対象を制御するための処理を行うマイコン3を備えている。そして、マイコン3は、プログラムを実行するCPU5と、CPU5によって実行されるプログラムが格納されるROM7及びRAM9と、割り込みコントローラ(INTC)11と、入力ポート13と、内部タイマ15と、割り込みマスク判定部17とを備えている。尚、以下では、ROM7とRAM9を総称してメモリ7,9と言う。
Hereinafter, an electronic control device according to an embodiment to which the present invention is applied will be described. An electronic control device (hereinafter referred to as an ECU) according to the present embodiment is mounted on, for example, a vehicle and controls a control target such as an engine in the vehicle.
[First Embodiment]
As shown in FIG. 1, the ECU 1 of the first embodiment includes a microcomputer 3 that performs processing for controlling a control target. The microcomputer 3 includes a CPU 5 that executes a program, a ROM 7 and a RAM 9 that store programs executed by the CPU 5, an interrupt controller (INTC) 11, an input port 13, an internal timer 15, and an interrupt mask determination unit. 17. Hereinafter, the ROM 7 and the RAM 9 are collectively referred to as memories 7 and 9.

CPU5には、ステータスレジスタ19が備えられており、そのステータスレジスタ19には、割り込みマスクレベル(詳しくは、その割り込みマスクレベルを示すデジタル値であり、以下、IMと記す)が書き込まれるようになっている。このIMは、マスクされる割り込みの優先レベルの最大値であり、そのIM以下の優先レベルの割り込みはマスクされることを意味している。   The CPU 5 includes a status register 19, and an interrupt mask level (specifically, a digital value indicating the interrupt mask level, hereinafter referred to as IM) is written in the status register 19. ing. This IM is the maximum value of the priority level of interrupts to be masked, and means that interrupts with priority levels below that IM are masked.

また、割り込みコントローラ11は、優先順位判定部11aと、レベル比較部11bと、論理積回路11cとを備えている。
そして、割り込みコントローラ11には、入力ポート13や内部タイマ15などから、様々な割り込み要因の割り込み要求信号(周辺割り込み要求信号)が入力される。
The interrupt controller 11 includes a priority order determination unit 11a, a level comparison unit 11b, and an AND circuit 11c.
The interrupt controller 11 receives interrupt request signals (peripheral interrupt request signals) of various interrupt factors from the input port 13 and the internal timer 15.

例えば、マイコン3外部からの信号が入力される入力ポート13の入力端子(図示省略)のうち、所定数(本実施形態では2以上)の入力端子は、外部割り込みを発生させるための割り込み入力端子となっている。そして、各割り込み入力端子への入力信号が所定の状態変化をすると、入力ポート13から割り込みコントローラ11へ、その割り込み入力端子への入力信号が状態変化したことを要因とする外部割り込みの割り込み要求信号が出力される。また、内部タイマ15は、複数のタイマ機能を備えており、その各タイマ機能によって設定時間の経過が検知されると、内部タイマ15から割り込みコントローラ11へ、そのタイマ機能の設定時間が経過したことを要因とするタイマ割り込みの割り込み要求信号が出力される。尚、図示は省略しているが、割り込みコントローラ11へは、例えば、マイコン3の外部又は内部に設けられた通信回路が通信データを受信したことを要因とする通信割り込みの割り込み要求信号なども入力される。   For example, among input terminals (not shown) of the input port 13 to which signals from the outside of the microcomputer 3 are input, a predetermined number (two or more in this embodiment) of input terminals are interrupt input terminals for generating external interrupts. It has become. When an input signal to each interrupt input terminal changes in a predetermined state, an interrupt request signal for an external interrupt caused by a change in the state of the input signal to the interrupt input terminal from the input port 13 to the interrupt controller 11 Is output. Further, the internal timer 15 has a plurality of timer functions, and when the set time has been detected by each timer function, the set time of the timer function has passed from the internal timer 15 to the interrupt controller 11. An interrupt request signal for a timer interrupt caused by Although not shown in the figure, an interrupt request signal for a communication interrupt caused by reception of communication data by a communication circuit provided outside or inside the microcomputer 3 is also input to the interrupt controller 11, for example. Is done.

そして、割り込みコントローラ11では、入力ポート13や内部タイマ15などからの割り込み要求信号が優先順位判定部11aに入力され、その優先順位判定部11aは、入力される割り込み要求信号のうち、優先レベルが一番高い割り込みの割り込み要求信号をレベル比較部11bに出力する。尚、各割り込みの優先レベルは予め定められている。   In the interrupt controller 11, an interrupt request signal from the input port 13 or the internal timer 15 is input to the priority determination unit 11a, and the priority determination unit 11a has a priority level of the input interrupt request signals. The interrupt request signal of the highest interrupt is output to the level comparison unit 11b. The priority level of each interrupt is determined in advance.

レベル比較部11bは、優先順位判定部11aから出力された割り込み要求信号に対応する割り込みの優先レベル(以下、ILと記す)と、CPU5のステータスレジスタ19に記憶されているIMとを比較する。そして、レベル比較部11bは、「IL>IM」ならば(つまり、ILの方がIMよりもレベルが高ければ)、優先順位判定部11aからの割り込み要求信号を論理積回路11cへ出力するが、「IL≦IM」ならば(つまり、ILがIM以下ならば)、優先順位判定部11aからの割り込み要求信号を論理積回路11cに出力せずにマスクする。   The level comparison unit 11b compares the priority level of the interrupt corresponding to the interrupt request signal output from the priority order determination unit 11a (hereinafter referred to as IL) and the IM stored in the status register 19 of the CPU 5. If “IL> IM” (that is, if IL has a higher level than IM), the level comparison unit 11b outputs the interrupt request signal from the priority determination unit 11a to the logical product circuit 11c. If “IL ≦ IM” (that is, if IL is equal to or less than IM), the interrupt request signal from the priority determination unit 11a is masked without being output to the AND circuit 11c.

論理積回路11cは、割り込みマスク判定部17から後述する割り込みマスク信号が出力されていなければ、レベル比較部11bからの割り込み要求信号をCPU5へ出力する。すると、CPU5は、その割り込み要求信号に対応する割り込みを受け付けて、その割り込み要求信号に対応する割り込み処理を実行する。よって、割り込みマスク判定部17から割り込みマスク信号が出力されていない場合には、ステータスレジスタ19内のIMよりも優先レベルが高い割り込みの割り込み要求信号が割り込みコントローラ11に入力されると、その中で最も優先レベルの高い割り込み要求信号が割り込みコントローラ11からCPU5に出力されて、CPU5が該当する割り込み処理を実行することとなる。   The AND circuit 11c outputs an interrupt request signal from the level comparison unit 11b to the CPU 5 if an interrupt mask signal described later is not output from the interrupt mask determination unit 17. Then, the CPU 5 accepts an interrupt corresponding to the interrupt request signal and executes an interrupt process corresponding to the interrupt request signal. Therefore, when an interrupt mask signal is not output from the interrupt mask determination unit 17, an interrupt request signal for an interrupt having a higher priority level than the IM in the status register 19 is input to the interrupt controller 11. The interrupt request signal with the highest priority level is output from the interrupt controller 11 to the CPU 5, and the CPU 5 executes the corresponding interrupt process.

また、論理積回路11cは、割り込みマスク判定部17から割り込みマスク信号が出力されていれば、レベル比較部11bからの割り込み要求信号をCPU5に出力せずにマスクする。このため、割り込みマスク判定部17から割り込みマスク信号が出力されている場合には、割り込みコントローラ11のレベル比較部11bから割り込み要求信号が出力されたとしても、CPU5は割り込みを受け付けないようになる。尚、本実施形態において、割り込みマスク信号は、ハイアクティブの信号である。   If the interrupt mask signal is output from the interrupt mask determination unit 17, the logical product circuit 11 c masks the interrupt request signal from the level comparison unit 11 b without outputting it to the CPU 5. Therefore, when an interrupt mask signal is output from the interrupt mask determination unit 17, even if an interrupt request signal is output from the level comparison unit 11b of the interrupt controller 11, the CPU 5 does not accept an interrupt. In this embodiment, the interrupt mask signal is a high active signal.

次に、割り込みマスク判定部17は、アドレス範囲レジスタ17aと、アドレス比較部17bとを備えている。
アドレス範囲レジスタ17aには、CPU5により、メモリ7,9上の任意のアドレス範囲を示す情報が書き込まれる。そして、CPU5は、動作開始直後に起動されるイニシャルルーチンの実行により、アドレス範囲レジスタ17aにアドレス範囲の情報を書き込むようになっている。また、その情報としては、例えばアドレス範囲の先頭アドレスと最終アドレスである。
Next, the interrupt mask determination unit 17 includes an address range register 17a and an address comparison unit 17b.
Information indicating an arbitrary address range on the memories 7 and 9 is written by the CPU 5 in the address range register 17a. The CPU 5 writes address range information in the address range register 17a by executing an initial routine that is started immediately after the operation is started. The information includes, for example, the start address and end address of the address range.

そして、アドレス比較部17bは、CPU5が命令フェッチ時に該CPU5とメモリ7,9との間の命令フェッチバスとしてのアドレスバス21へ出力するアドレス値(即ち、CPU5が実行するプログラムのアドレス)を監視して、そのアドレス値が、アドレス範囲レジスタ17a内の情報が示すアドレス範囲内であるか否かを判定し、そのアドレス範囲内であると判定している場合に、割り込みコントローラ11へ上記割り込みマスク信号を出力する。   Then, the address comparison unit 17b monitors an address value (that is, an address of a program executed by the CPU 5) output to the address bus 21 as an instruction fetch bus between the CPU 5 and the memories 7 and 9 when the CPU 5 fetches the instruction. Then, it is determined whether the address value is within the address range indicated by the information in the address range register 17a. If it is determined that the address value is within the address range, the interrupt mask is sent to the interrupt controller 11. Output a signal.

このようなマイコン3では、メモリ7,9の記憶領域のうち、アドレス範囲レジスタ17a内の情報が示すアドレス範囲に記憶されているプログラムをCPU3が実行している場合には、割り込みマスク判定部17から割り込みコントローラ11へ割り込みマスク信号が出力される。そして、割り込みマスク信号が出力されると、たとえステータスレジスタ19内のIMよりも優先レベルが高い割り込みの割り込み要求信号が割り込みコントローラ11に入力されても、その割り込み要求信号がCPU5に出力されず、CPU5は割り込みを受け付けなくなる。つまり、割り込みが禁止される。よって、アドレス範囲レジスタ17a内の情報が示すアドレス範囲は、割り込み禁止アドレス範囲(即ち、割り込みが禁止されるアドレス範囲)ということになる。   In such a microcomputer 3, when the CPU 3 is executing a program stored in the address range indicated by the information in the address range register 17 a among the storage areas of the memories 7 and 9, the interrupt mask determination unit 17. Interrupt mask signal is output to the interrupt controller 11. When the interrupt mask signal is output, even if an interrupt request signal of an interrupt having a higher priority level than the IM in the status register 19 is input to the interrupt controller 11, the interrupt request signal is not output to the CPU 5, The CPU 5 does not accept interrupts. That is, interrupts are prohibited. Therefore, the address range indicated by the information in the address range register 17a is an interrupt prohibited address range (that is, an address range where interrupts are prohibited).

そこで、本実施形態のECU1では、メモリ7,9における特定のアドレス範囲の情報がアドレス範囲レジスタ17aに書き込まれるようにプログラミングすると共に、CPU5に実行させるプログラム(制御対象を制御するためのプログラム)のうち、割り込み禁止状態で実行したいプログラムを、その特定のアドレス範囲内に格納するようにしている。   Therefore, in the ECU 1 of the present embodiment, programming is performed so that information on a specific address range in the memories 7 and 9 is written in the address range register 17a, and a program to be executed by the CPU 5 (program for controlling the control target) is stored. Among them, a program to be executed in the interrupt disabled state is stored in the specific address range.

例えば、図2に示すように、メモリ7,9におけるプログラム格納用のアドレス空間(プログラム格納領域)のうち、A番地からB番地までのアドレス範囲には、割り込み許可状態で実行しても良い処理Xのプログラムが格納されている。そして、その処理Xのプログラムでは、最初のS110にて、割り込み許可状態で実行しても良い処理が行われ、次のS120にて、割り込み禁止状態で実行したい処理Aのプログラムをサブルーチンコールするが、その処理Aのプログラムは、C番地からD番地までのアドレス範囲に格納されている。そして更に、そのC番地からD番地までのアドレス範囲を示す情報が、アドレス範囲レジスタ17aに書き込まれるようにしている。   For example, as shown in FIG. 2, the address range from address A to address B in the address space (program storage area) for storing programs in the memories 7 and 9 may be executed in an interrupt enabled state. X programs are stored. Then, in the process X program, a process that may be executed in the interrupt enabled state is performed in the first S110, and in the next S120, the program of the process A to be executed in the interrupt disabled state is called as a subroutine call. The program for processing A is stored in the address range from address C to address D. Further, information indicating the address range from the C address to the D address is written in the address range register 17a.

このため、処理Xのプログラムから処理Aのプログラムが呼び出されると、その処理Aのプログラムが実行されている間(そのプログラムへジャンプした時点から該プログラムを抜けるまでの間)は、前述した割り込みコントローラ11内の論理積回路11cと割り込みマスク判定部17の作用により、CPU5が割り込みを受け付けるのが阻止され、その処理Aのプログラムは割り込み禁止状態で実行されることとなる。   For this reason, when the process A program is called from the process X program, the interrupt controller described above is executed while the process A program is being executed (from the time when the program jumps to the program). The operation of the AND circuit 11c and the interrupt mask determination unit 17 in the CPU 11 prevents the CPU 5 from accepting an interrupt, and the process A program is executed in an interrupt disabled state.

以上のような第1実施形態のECU1に設けられたマイコン3によれば、割り込み禁止状態で実行したいプログラムがある場合に、そのプログラムの先頭で割り込みを禁止するための処理を行い該プログラムの最後で割り込みの禁止を解除(割り込みを許可)するための処理を行う、というプログラミングをする必要がなくなる。そして、そのような処理が省略できることにより、CPU3の処理負荷及びプログラム容量を低減することができ、更に、プログラムを記憶するためのメモリ容量も低減することができる。   According to the microcomputer 3 provided in the ECU 1 of the first embodiment as described above, when there is a program to be executed in the interrupt disabled state, a process for prohibiting the interrupt is performed at the head of the program and the end of the program is performed. This eliminates the need for programming to cancel the prohibition of the interrupt (permit the interrupt). Since such processing can be omitted, the processing load and program capacity of the CPU 3 can be reduced, and further, the memory capacity for storing the program can be reduced.

そして、そのようなマイコン3を備えた本実施形態のECU1によれば、メモリ容量の低減により、コスト増加を防止することができ、更に、CPU5の処理負荷が低減されるため、制御性能を高めることができる。   And according to ECU1 of this embodiment provided with such a microcomputer 3, the increase in cost can be prevented by reducing the memory capacity, and the processing load of the CPU 5 is further reduced, so that the control performance is improved. be able to.

また、本実施形態のマイコン3によれば、割り込み禁止アドレス範囲を、アドレス範囲レジスタ17aに書き込む内容によって任意に設定することができる。よって、そのアドレス範囲を、割り込み禁止状態で実行したいプログラムのサイズなどに応じて設定できるようになり、高い汎用性が得られる。   Further, according to the microcomputer 3 of the present embodiment, the interrupt prohibited address range can be arbitrarily set depending on the contents written to the address range register 17a. Therefore, the address range can be set according to the size of the program to be executed in the interrupt disabled state, and high versatility can be obtained.

また、本実施形態のマイコン3では、CPU5の外部に設けた割り込みマスク判定部17が、アドレスバス21上のアドレス値を監視することにより、CPU5の実行アドレスがアドレス範囲レジスタ17aにより設定されたアドレス範囲内か否かを判定するようになっているため、その割り込みマスク判定部17の追加や削除が容易である。更に、CPU5の外部に設けた論理積回路11cにより、割り込みコントローラ11からCPU5に割り込み要求信号が出力されるのを阻止することで、CPU5が割り込みを受け付けないようにしているため、その論理積回路11cの追加や削除も容易である。   In the microcomputer 3 of the present embodiment, the interrupt mask determination unit 17 provided outside the CPU 5 monitors the address value on the address bus 21 so that the execution address of the CPU 5 is an address set by the address range register 17a. Since it is determined whether or not it is within the range, it is easy to add or delete the interrupt mask determination unit 17. Further, the AND circuit 11c provided outside the CPU 5 prevents the interrupt request signal from being output from the interrupt controller 11 to the CPU 5, thereby preventing the CPU 5 from accepting the interrupt. It is easy to add or delete 11c.

尚、マイコン3において、割り込み禁止アドレス範囲は固定であっても良い。この場合、例えば、アドレス範囲レジスタ17aに相当する部分に予め固定値がセットされる構成が考えられる。   In the microcomputer 3, the interrupt prohibition address range may be fixed. In this case, for example, a configuration in which a fixed value is set in advance in a portion corresponding to the address range register 17a is conceivable.

また、論理積回路11cをCPU5内に設けて、割り込みコントローラ11からの割り込み要求信号をCPU5側でマスクするようにしても良い。
更に、割り込みマスク判定部17もCPU5内に設けても良い。また、その場合には、例えば、CPU5におけるプログラムカウンタの値を監視して、その値が、割り込み禁止アドレス範囲内であるか否かを判定するように構成することもできる。
Further, an AND circuit 11c may be provided in the CPU 5, and an interrupt request signal from the interrupt controller 11 may be masked on the CPU 5 side.
Further, the interrupt mask determination unit 17 may be provided in the CPU 5. In that case, for example, the value of the program counter in the CPU 5 can be monitored to determine whether or not the value is within the interrupt prohibited address range.

一方、上記実施形態では、割り込みマスク判定部17と論理積回路11cが、割り込み制限手段に相当している。また、アドレス範囲レジスタ17aが、アドレス範囲設定用レジスタに相当している。
[第2実施形態]
第2実施形態のECU1は、第1実施形態と比較すると、下記の点が異なっている。
On the other hand, in the above-described embodiment, the interrupt mask determination unit 17 and the AND circuit 11c correspond to the interrupt limiting unit. The address range register 17a corresponds to an address range setting register.
[Second Embodiment]
The ECU 1 of the second embodiment is different from the first embodiment in the following points.

まず、マイコン3における割り込みマスク判定部17内に、1ビットの状態変化禁止レジスタ17cが追加されている。
そして、その状態変化禁止レジスタ17cには、CPU5が所定のビットセット命令を実行すると“1”が書き込まれ、CPU5が所定のビットクリア命令を実行すると“0”が書き込まれる。
First, a 1-bit state change prohibition register 17c is added to the interrupt mask determination unit 17 in the microcomputer 3.
Then, “1” is written in the state change prohibition register 17c when the CPU 5 executes a predetermined bit set instruction, and “0” is written when the CPU 5 executes a predetermined bit clear instruction.

更に、割り込みマスク判定部17では、状態変化禁止レジスタ17cに“1”が書き込まれると、アドレス比較部17bの判定結果が保持され、その結果、アドレス比較部17bから割り込みコントローラ11への出力(即ち、割り込みマスク信号を出力する/しないの状態)が保持される。そして、状態変化禁止レジスタ17cに“0”が書き込まれると、上記保持状態が解除される。   Further, when “1” is written in the state change prohibition register 17c, the interrupt mask determination unit 17 holds the determination result of the address comparison unit 17b, and as a result, the output from the address comparison unit 17b to the interrupt controller 11 (ie, , The state of whether or not to output an interrupt mask signal) is held. When “0” is written in the state change prohibiting register 17c, the holding state is released.

よって、アドレス比較部17bが割り込みマスク信号を出力している場合に、状態変化禁止レジスタ17cに“1”が書き込まれると、CPU5が割り込みを受け付けない状態(割り込み禁止状態)が保持されることとなる。   Therefore, when the address comparison unit 17b outputs an interrupt mask signal, if “1” is written in the state change prohibit register 17c, a state in which the CPU 5 does not accept an interrupt (interrupt disabled state) is maintained. Become.

そして、このような第2実施形態のマイコン3によれば、割り込み禁止アドレス範囲内のプログラムPaから、割り込み禁止アドレス範囲外のプログラムPbを呼び出して、そのプログラムPbを実行する際に、必要により、割り込み禁止状態が維持されるようにすることができる。   According to the microcomputer 3 of the second embodiment, when the program Pb outside the interrupt prohibited address range is called from the program Pa within the interrupt prohibited address range and the program Pb is executed, if necessary, The interrupt disabled state can be maintained.

具体的に説明すると、例えば、割り込み禁止アドレス範囲外のサブルーチンプログラムPbを割り込み禁止アドレス範囲外の他のプログラムPcから呼び出した場合には、割り込み禁止としないが、そのサブルーチンプログラムPbを割り込み禁止アドレス範囲内のプログラムPaから呼び出した場合には、割り込み禁止状態を継続したい、という場合がある。   More specifically, for example, when a subroutine program Pb outside the interrupt prohibition address range is called from another program Pc outside the interrupt prohibition address range, the interrupt is not prohibited, but the subroutine program Pb is not interrupted within the interrupt prohibition address range. When called from the program Pa, there is a case where it is desired to continue the interrupt disabled state.

そして、その場合には、割り込み禁止アドレス範囲内のプログラムPaから割り込み禁止アドレス範囲外のサブルーチンプログラムPbを呼び出す際に、状態変化禁止レジスタ17cについてのビットセット命令(状態保持用命令に相当)が実行され、呼び出したサブルーチンプログラムPbから元のプログラムPaに戻ると状態変化禁止レジスタ17cについてのビットクリア命令(解除用命令に相当)が実行されるように、プログラムPaを作成すれば良い。   In this case, when calling the subroutine program Pb outside the interrupt prohibition address range from the program Pa within the interrupt prohibition address range, a bit set instruction (corresponding to a state holding instruction) for the state change prohibition register 17c is executed. Then, the program Pa may be created so that the bit clear instruction (corresponding to the canceling instruction) for the state change prohibition register 17c is executed when returning from the called subroutine program Pb to the original program Pa.

尚、状態変化禁止レジスタ17cに“1”が書き込まれた場合に、アドレス比較部17bの判定結果ではなく、そのアドレス比較部17bの出力自体がラッチされる構成でも良い。また、状態保持/保持解除のための命令としては、状態変化禁止レジスタ17cについてのビットセット命令/ビットクリア命令に限らず、例えば他の専用命令でも良い。
[第3実施形態]
図4に示す第3実施形態のECU1は、第1実施形態と比較すると、マイコン3が下記の点で異なっている。
In addition, when “1” is written in the state change prohibiting register 17c, the output of the address comparison unit 17b itself may be latched instead of the determination result of the address comparison unit 17b. Further, the instruction for holding / releasing the state is not limited to the bit set instruction / bit clear instruction for the state change prohibition register 17c, but may be another dedicated instruction, for example.
[Third Embodiment]
Compared with the first embodiment, the ECU 1 of the third embodiment shown in FIG. 4 differs in the microcomputer 3 in the following points.

まず、割り込みマスク判定部17と、割り込みコントローラ11内の論理積回路11cが削除されている。このため、レベル比較部11bからの割り込み要求信号が無条件でCPU5に出力される。   First, the interrupt mask determination unit 17 and the AND circuit 11c in the interrupt controller 11 are deleted. For this reason, the interrupt request signal from the level comparison unit 11b is output to the CPU 5 unconditionally.

また、CPU5には、割り込みの優先レベル(本実施形態では1〜nのn通りで、nは2以上の整数)がそれぞれ定められたアドレス範囲PA1〜PAnであって、それに定められた優先レベル以下の割り込みを禁止した状態で実行したいプログラムが格納されるアドレス範囲PA1〜PAnを設定するためのアドレス範囲レジスタAR1〜ARnが設けられている。そして、アドレス範囲レジスタARm(mは1〜nの何れか)には、それに対応する優先レベル(=m)以下の割り込みを禁止した状態で実行したいプログラムを格納するアドレス範囲PAmを示す情報が、当該CPU5によって書き込まれるようになっている。   Further, the CPU 5 has address ranges PA1 to PAn in which priority levels of interrupts (n in this embodiment, 1 to n, where n is an integer equal to or greater than 2) are defined, and the priority levels determined thereby Address range registers AR1 to ARn are provided for setting address ranges PA1 to PAn in which programs to be executed in a state where the following interrupts are prohibited are stored. In the address range register ARm (m is any one of 1 to n), information indicating an address range PAm that stores a program to be executed in a state in which interrupts corresponding to the priority level (= m) or lower are prohibited. It is written by the CPU 5.

尚、CPU5は、動作開始直後に起動されるイニシャルルーチンの実行により、アドレス範囲レジスタAR1〜ARnの各々にアドレス範囲の情報を書き込むようになっている。また、その情報としては、例えばアドレス範囲の先頭アドレスと最終アドレスである。一方、前述の実施形態では図示を省略していたが、CPU5にはプログラムカウンタ23も備えられている。また、以下では、アドレス範囲レジスタARmに書き込まれた情報が示すアドレス範囲のことを、アドレス範囲レジスタARmによって設定されたアドレス範囲PAmという。   The CPU 5 writes address range information in each of the address range registers AR1 to ARn by executing an initial routine started immediately after the operation is started. The information includes, for example, the start address and end address of the address range. On the other hand, although not shown in the above embodiment, the CPU 5 is also provided with a program counter 23. Hereinafter, an address range indicated by information written in the address range register ARm is referred to as an address range PAm set by the address range register ARm.

そして、図5に示すように、メモリ7,9におけるプログラム格納用のアドレス空間のうち、アドレス範囲レジスタAR1〜ARnによって設定されたアドレス範囲PA1〜PAnの各々には、CPU5に実行させるプログラム(制御対象を制御するためのプログラム)のうち、そのアドレス範囲に定められている優先レベル以下の割り込みを禁止した状態で実行したいプログラムが格納されている。   As shown in FIG. 5, in the address spaces for storing programs in the memories 7 and 9, each of the address ranges PA1 to PAn set by the address range registers AR1 to ARn has a program (control) to be executed by the CPU 5. Stores a program to be executed in a state in which an interrupt having a priority level or lower determined in the address range is prohibited.

即ち、アドレス範囲レジスタAR1によって設定されたアドレス範囲PA1(この例ではC番地〜D番地)には、優先レベルが1以下の割り込みを禁止した状態で実行したいプログラムが格納されており、アドレス範囲レジスタAR2によって設定されたアドレス範囲PA2(この例ではE番地〜F番地)には、優先レベルが2以下の割り込みを禁止した状態で実行したいプログラムが格納されている。そして同様に、アドレス範囲レジスタARnによって設定されたアドレス範囲PAn(この例ではX番地〜Y番地)には、優先レベルがn以下の割り込みを禁止した状態(即ち、全ての割り込みを禁止した状態)で実行したいプログラムが格納されている。   That is, the address range PA1 (addresses C to D in this example) set by the address range register AR1 stores a program to be executed in a state where an interrupt having a priority level of 1 or less is prohibited. In the address range PA2 (addresses E to F in this example) set by AR2, a program to be executed in a state where an interrupt having a priority level of 2 or less is prohibited is stored. Similarly, in the address range PAn (addresses X to Y in this example) set by the address range register ARn, interrupts whose priority level is n or less are prohibited (that is, all interrupts are prohibited). Contains the program you want to run on

また、図5に示すように、アドレス範囲レジスタAR1〜ARnの何れによっても設定されていないアドレス範囲であって、アドレス範囲PA1〜PAn以外のアドレス範囲(この例ではA番地〜B番地)には、全ての割り込みを許可した状態で実行しても良いプログラム(通常プログラム)が格納されている。   Also, as shown in FIG. 5, the address range is not set by any of the address range registers AR1 to ARn, and the address range other than the address range PA1 to PAn (address A to address B in this example) A program (normal program) that may be executed in a state where all interrupts are permitted is stored.

更に、図4に示すように、CPU5には、割り込みマスクレベル制御部25が設けられており、その割り込みマスクレベル制御部25は、プログラムの分岐命令(ブランチ命令、ジャンプ命令、リターンサブルーチン命令など)が実行された時に図6の動作を行う。   Further, as shown in FIG. 4, the CPU 5 is provided with an interrupt mask level control unit 25. The interrupt mask level control unit 25 is a program branch instruction (branch instruction, jump instruction, return subroutine instruction, etc.). When the above is executed, the operation of FIG.

そして、図6に示すように、割り込みマスクレベル制御部25が動作すると、まず、分岐先のアドレスであるプログラムカウンタ23の値(以下、PC値という)が、アドレス範囲レジスタAR1〜ARnによって設定された何れかのアドレス範囲PA1〜PAn内に入っているか否かと、入っているならばどのアドレス範囲に入っているかを判定し(S310〜S330)、PC値が何れかのアドレス範囲PA1〜PAn内であれば、そのPC値が入っているアドレス範囲PAmに対応する優先レベルmを、IM候補値として記憶する(S340〜S360)。例えば、PC値がアドレス範囲PA1内であれば、1をIM候補値として記憶し(S340)、PC値がアドレス範囲PA2内であれば、2をIM候補値として記憶する(S350)。   As shown in FIG. 6, when the interrupt mask level control unit 25 operates, first, the value of the program counter 23 (hereinafter referred to as the PC value), which is the branch destination address, is set by the address range registers AR1 to ARn. It is determined whether it is in any address range PA1 to PAn, and if it is in which address range (S310 to S330), the PC value is in any address range PA1 to PAn. If so, the priority level m corresponding to the address range PAm containing the PC value is stored as an IM candidate value (S340 to S360). For example, if the PC value is within the address range PA1, 1 is stored as the IM candidate value (S340), and if the PC value is within the address range PA2, 2 is stored as the IM candidate value (S350).

次に、範囲内フラグがオンされているか否かを判定する(S370)。尚、範囲内フラグは、PC値がアドレス範囲PA1〜PAn内の場合にオンされるフラグである。
そして、範囲内フラグがオンされていれば(S370:YES)、今回の動作時以前からPC値がアドレス範囲PA1〜PAn内であるということであるため、そのまま動作を終了する。
Next, it is determined whether or not the in-range flag is turned on (S370). The in-range flag is a flag that is turned on when the PC value is in the address range PA1 to PAn.
If the in-range flag is turned on (S370: YES), it means that the PC value is within the address range PA1 to PAn before the current operation, and thus the operation is ended as it is.

これに対し、PC値がアドレス範囲PA1〜PAn内であるのに範囲内フラグがオンされていなければ(S370:NO)、今回、PC値がアドレス範囲PA1〜PAn以外からアドレス範囲PA1〜PAn内に入ったということであるため、範囲内フラグをオンする(S380)。   On the other hand, if the in-range flag is not turned on even though the PC value is in the address range PA1 to PAn (S370: NO), this time, the PC value is in the address range PA1 to PAn from other than the address range PA1 to PAn. Since it is in the range, the in-range flag is turned on (S380).

そして次に、ステータスレジスタ19内のIM(以下、IM値ともいう)を、CPU5におけるスタック領域に格納し(S390)、次に、IM値と上記S340〜S360の動作で記憶したIM候補値(即ち、PC値が今回入ったアドレス範囲PAmに対して定められている優先レベルm)とを比較して、IM値がIM候補値以上であるか否かを判定する(S400)。   Next, the IM (hereinafter also referred to as IM value) in the status register 19 is stored in the stack area in the CPU 5 (S390), and then the IM value and the IM candidate value stored in the above operations of S340 to S360 ( That is, the PC value is compared with the priority level m) determined for the address range PAm that has entered this time, and it is determined whether the IM value is equal to or greater than the IM candidate value (S400).

そして、IM値がIM候補値以上であれば(S400:YES)、そのまま動作を終了するが、IM値がIM候補値以上でなければ(S400:NO)、IM値をIM候補値に書き換え(S410)、その後、動作を終了する。   If the IM value is equal to or greater than the IM candidate value (S400: YES), the operation is terminated as it is. If the IM value is not equal to or greater than the IM candidate value (S400: NO), the IM value is rewritten to the IM candidate value ( After that, the operation is terminated.

一方、上記S310〜S330の判定で、PC値がアドレス範囲PA1〜PAn内に入っていない(つまり、アドレス範囲PA1〜PAn以外である)と判定した場合には、範囲内フラグがオンされているか否かを判定し(S420)、範囲内フラグがオンされていなければ(S420:NO)、今回の動作時以前からPC値がアドレス範囲PA1〜PAn以外であるということであるため、そのまま動作を終了する。   On the other hand, if it is determined in S310 to S330 that the PC value does not fall within the address range PA1 to PAn (that is, other than the address range PA1 to PAn), is the in-range flag turned on? If the in-range flag is not turned on (S420: NO), it means that the PC value is outside the address range PA1 to PAn before the current operation. finish.

これに対し、PC値がアドレス範囲PA1〜PAn以外であるのに範囲内フラグがオンされていれば(S420:YES)、今回、PC値がアドレス範囲PA1〜PAn内からアドレス範囲PA1〜PAn以外に出たということであるため、範囲内フラグをオフする(S430)。そして、IM値を、上記S390の動作でスタック領域に格納しておいた値に戻し(S440)、その後、動作を終了する。   On the other hand, if the in-range flag is turned on even if the PC value is outside the address range PA1 to PAn (S420: YES), this time, the PC value is within the address range PA1 to PAn but outside the address range PA1 to PAn. Therefore, the in-range flag is turned off (S430). Then, the IM value is returned to the value stored in the stack area by the operation of S390 (S440), and then the operation is terminated.

このような割り込みマスクレベル制御部25を備えたマイコン3では、CPU5の実行アドレス(PC値)がアドレス範囲PA1〜PAn以外からアドレス範囲PA1〜PAn内に入ると、IM値がスタック領域に退避され(S390)、そのIM値が、実行アドレスが今回入ったアドレス範囲PAmに対して定められている優先レベルmよりも小さければ(S400:NO)、IM値がその優先レベルmに変更されることとなる(S410)。そして、CPU5の実行アドレスがアドレス範囲PA1〜PAn内からアドレス範囲PA1〜PAn以外へ出ると、IM値が、スタック領域に退避されていた元の値に戻されることとなる(S440)。   In the microcomputer 3 having such an interrupt mask level control unit 25, when the execution address (PC value) of the CPU 5 enters the address range PA1 to PAn from other than the address range PA1 to PAn, the IM value is saved in the stack area. (S390) If the IM value is smaller than the priority level m determined for the address range PAm in which the execution address has entered this time (S400: NO), the IM value is changed to the priority level m. (S410). Then, when the execution address of the CPU 5 goes out of the address range PA1 to PAn to other than the address range PA1 to PAn, the IM value is returned to the original value saved in the stack area (S440).

よって、アドレス範囲PA1〜PAnの各々について言えることであるが、そのアドレス範囲に格納されているプログラムの実行中は、そのアドレス範囲に対応する優先レベル以下の割り込みが禁止されることとなる。   Therefore, as can be said with respect to each of the address ranges PA1 to PAn, during execution of a program stored in the address range, an interrupt having a priority level or lower corresponding to the address range is prohibited.

以上のような第3実施形態のマイコン3によれば、CPU5に実行させるプログラムのうち、優先レベルがm以下の割り込み(以下、優先レベルm以下の割り込みともいう)を禁止した状態で実行したいプログラムを、メモリ7,9におけるアドレス範囲PA1〜PAnのうち、優先レベルがmに定められているアドレス範囲PAm内に格納するだけで、そのプログラムを、優先レベルがm以下の割り込みを禁止した状態で実行することができる。   According to the microcomputer 3 of the third embodiment as described above, among the programs to be executed by the CPU 5, a program to be executed in a state where an interrupt having a priority level of m or lower (hereinafter also referred to as an interrupt having a priority level of m or lower) is prohibited. Is stored in the address range PAm in which the priority level is set to m among the address ranges PA1 to PAn in the memories 7 and 9, and the program is in a state in which interrupts with the priority level of m or less are prohibited. Can be executed.

よって、ある優先レベルm以下の割り込みを禁止した状態で実行したいプログラムがある場合に、そのプログラムの先頭で優先レベルがm以下の割り込みを禁止するための処理を行い該プログラムの最後で優先レベルがm以下の割り込みの禁止を解除するための処理を行うようにする必要がなくなる。   Therefore, when there is a program to be executed in a state where an interrupt with a priority level m or lower is prohibited, a process for prohibiting an interrupt with a priority level m or lower is performed at the beginning of the program, and the priority level is set at the end of the program. There is no need to perform processing for canceling the prohibition of interrupts of m or less.

このため、CPU5の処理負荷及びプログラム容量を低減することができ、更に、プログラムを記憶するためのメモリ容量も低減することができる。また、実行中に禁止したい割り込みの優先レベルが異なる複数のプログラムがあっても対応することができる。また、アドレス範囲PA1〜PAnを、アドレス範囲レジスタAR1〜ARn17aによって任意に設定することができるため、高い汎用性が得られる。   For this reason, the processing load and program capacity of the CPU 5 can be reduced, and the memory capacity for storing the program can also be reduced. It is also possible to cope with a plurality of programs having different priority levels of interrupts to be prohibited during execution. Further, since the address ranges PA1 to PAn can be arbitrarily set by the address range registers AR1 to ARn17a, high versatility is obtained.

更に、第3実施形態のマイコン3において、割り込みマスクレベル制御部25は、実行アドレスがアドレス範囲PA1〜PAn以外からアドレス範囲PA1〜PAnの何れかに入った際に、その時のIM値と、実行アドレスが今回入ったアドレス範囲PAmに対して定められている優先レベルmとを比較して、IM値が優先レベルm以上であれば(S400:YES)、IM値を変更しないようになっている。   Furthermore, in the microcomputer 3 of the third embodiment, when the execution address enters any of the address ranges PA1 to PAn from other than the address range PA1 to PAn, the interrupt mask level control unit 25 executes the IM value at that time and the execution When the IM value is equal to or higher than the priority level m (S400: YES), the IM value is not changed when the address is compared with the priority level m determined for the address range PAm that has entered this time. .

このため、アドレス範囲PA1〜PAn以外のプログラムによってIM値が優先レベルm以上に設定されている状態で、アドレス範囲PA1〜PAn以外のプログラムからアドレス範囲PAm内のプログラムが呼び出された場合に、IM値が、呼び出し元のプログラムがマスクしたい割り込みの優先レベルよりも低くなってしまうこと(即ち、呼び出し元のプログラムがマスクしたい割り込みが割り込んでしまうこと)を防止することができる。   Therefore, when a program in the address range PAm is called from a program other than the address range PA1 to PAn in a state where the IM value is set to the priority level m or higher by a program other than the address range PA1 to PAn, the IM It is possible to prevent the value from becoming lower than the priority level of the interrupt that the calling program wants to mask (that is, the interrupt that the calling program wants to mask interrupts).

ところで、もしCPU5に割り込みマスクレベル制御部25が設けられておらず、その割り込みマスクレベル制御部25による作用と同様の作用を得ようとするならば、ある優先レベルm以下の割り込みを禁止した状態で実行したいプログラムを、図7のように作成する必要がある。   By the way, if the interrupt mask level control unit 25 is not provided in the CPU 5 and an operation similar to that by the interrupt mask level control unit 25 is to be obtained, an interrupt with a priority level m or lower is prohibited. In this case, it is necessary to create a program to be executed as shown in FIG.

まず、図7(a)に示す処理Aのプログラムは、優先レベルm以下の割り込みを禁止した状態で実行したいプログラムである。そして、そのプログラムでは、最初のS210にて、優先レベルm以下の割り込みを禁止するための、図7(b)の割り込み禁止処理を行う。   First, the process A program shown in FIG. 7A is a program to be executed in a state in which interrupts with priority level m or lower are prohibited. Then, in the program, in step S210, the interrupt prohibition process shown in FIG. 7B for prohibiting an interrupt having a priority level m or lower is performed.

そして、図7(b)に示すように、割り込み禁止処理では、まずS211にて、現在のIM値をバッファに記憶し、次のS213にて、その現在のIM値が、禁止したい割り込みの優先レベルm以上であるか否かを判定し、「IM値≧m」であれば、そのまま割り込み禁止処理を終了する。また、S213にて、「IM値≧m」ではないと判定したならば、次のS215にて、IM値を、禁止したい割り込みの優先レベルmに書き換え、その後、割り込み禁止処理を終了する。   As shown in FIG. 7B, in the interrupt prohibition process, first, in S211, the current IM value is stored in the buffer, and in the next S213, the current IM value is the priority of the interrupt to be prohibited. It is determined whether or not the level is equal to or higher than level m. If “IM value ≧ m”, the interrupt prohibition process is terminated as it is. If it is determined in S213 that “IM value ≧ m” is not satisfied, the IM value is rewritten to the priority level m of the interrupt to be prohibited in the next S215, and then the interrupt prohibition process is terminated.

このような割り込み禁止処理が終了すると、図7(a)に戻り、S220にて、優先レベルm以下の割り込みを禁止した状態で実行する必要のある処理を行う。そして、その処理が終わると、最後のS230にて、優先レベルm以下の割り込みの禁止を解除するための、図7(c)の割り込み許可処理を行う。   When such an interrupt prohibition process ends, the process returns to FIG. 7A, and in S220, a process that needs to be executed in a state in which an interrupt with a priority level m or lower is prohibited is performed. When the processing is completed, the interrupt permission processing shown in FIG. 7C for canceling the prohibition of the interrupt with the priority level m or less is performed in the last S230.

そして、図7(c)に示すように、割り込み許可処理では、S231にて、IM値を、図7(b)のS211でバッファに記憶しておいた値に戻し、その後、当該割り込み許可処理を終了する。これにより、図7(a)のプログラムが終了する。   As shown in FIG. 7C, in the interrupt permission process, the IM value is returned to the value stored in the buffer in S211 of FIG. 7B in S231, and then the interrupt permission process. Exit. As a result, the program of FIG.

このように、割り込みマスクレベル制御部25が無いと仮定すると、優先レベルm以下の割り込みを禁止した状態で実行したいプログラムの先頭(S210)と最後(S230)の各々にて、図7(b),(c)の各処理を行う必要が生じるが、本第3実施形態のマイコン3によれば、そのような処理を行う必要がなく、CPU5の処理負荷及びプログラム容量を低減できるのである。   As described above, assuming that there is no interrupt mask level control unit 25, at the beginning (S210) and the end (S230) of the program to be executed in the state where the interrupt of the priority level m or lower is prohibited, FIG. However, according to the microcomputer 3 of the third embodiment, it is not necessary to perform such processing, and the processing load and program capacity of the CPU 5 can be reduced.

そして、上記のようなマイコン3を備えた第3実施形態のECU1によれば、メモリ容量の低減により、コスト増加を防止することができ、更に、CPU5の処理負荷が低減されるため、制御性能を高めることができる。   And according to ECU1 of 3rd Embodiment provided with the above microcomputers 3, since increase in cost can be prevented by reduction of memory capacity, and also processing load of CPU5 is reduced, control performance Can be increased.

次に、第3実施形態のマイコン3の追加機能について説明する。
まず、図8に例示するように、図5のA番地〜B番地内のプログラムが実行されている時に、そのプログラムによりIM値が0に設定されており、そのA番地〜B番地内のプログラムから図5のC番地〜D番地内のプログラム(アドレス範囲PA1内のプログラム )が呼び出されたとすると、IM値は、割り込みマスクレベル制御部25により0から1に変更されることとなる。
Next, additional functions of the microcomputer 3 according to the third embodiment will be described.
First, as illustrated in FIG. 8, when the program in the addresses A to B in FIG. 5 is being executed, the program sets the IM value to 0, and the program in the addresses A to B 5 is called (program in the address range PA1), the IM value is changed from 0 to 1 by the interrupt mask level control unit 25.

そして、その後、C番地〜D番地内のプログラムが実行されている時に、優先レベルが1よりも高い割り込みが発生して、A番地〜B番地内の割り込み処理のプログラムが起動されたとすると、その割り込み処理の実行期間においては、IM値を、OS等の機能により、その割り込みの要因に対応した優先レベル(この例では11)に設定する必要がある。   Then, when the program in the addresses C to D is being executed, an interrupt with a priority level higher than 1 is generated, and the interrupt processing program in the addresses A to B is started. In the execution period of the interrupt process, the IM value needs to be set to a priority level (11 in this example) corresponding to the cause of the interrupt by a function such as the OS.

また、その後、割り込み処理が終了して、OS等の機能によりIM値が11から1に戻され、更にその後、C番地〜D番地内のプログラムが終了して、A番地〜B番地内の呼び出し元のプログラムへ戻ると、IM値は、割り込みマスクレベル制御部25により1から元の0に戻されることとなる。   After that, the interrupt process is finished, the IM value is returned from 11 to 1 by the function of the OS, etc., and the program in the addresses C to D is finished and the call in the addresses A to B is finished. When returning to the original program, the IM value is returned from 1 to the original 0 by the interrupt mask level control unit 25.

そして、以上が、本来期待されるIM値の遷移である。
ところが、図9(a)に示すように、C番地〜D番地内のプログラムが実行されている時に、優先レベルが1よりも高い割り込みのプログラムが起動されると、プログラムの実行アドレスがアドレス範囲PA1〜PAn以外であるA番地〜B番地へ移ることとなるため、割り込みマスクレベル制御部25により、そのことが判定されて、IM値が、その時点でスタック領域に退避されている0に戻されてしまう。これは、図6におけるS440の動作によるものである。
The above is the IM value transition expected originally.
However, as shown in FIG. 9A, when a program in addresses C to D is being executed, if an interrupt program with a priority level higher than 1 is activated, the execution address of the program is changed to an address range. Since the transition is made to addresses A to B other than PA1 to PAn, this is determined by the interrupt mask level control unit 25, and the IM value is returned to 0 which is saved in the stack area at that time. Will be. This is due to the operation of S440 in FIG.

また仮に、図9(b)に示すように、割り込み処理の実行中におけるIM値が、0に戻されることなく、OS等の機能により、その割り込みの要因に対応したレベル(=11)に設定されたとしても、割り込み処理のプログラムから元のC番地〜D番地内のプログラムへ戻る際には、プログラムの実行アドレスがアドレス範囲PA1〜PAn以外であるA番地〜B番地からアドレス範囲PA1(C番地〜D番地)内へ移ることとなるため、割り込みマスクレベル制御部25により、そのことが判定されて、スタック領域に、上記割り込みの要因に対応した優先レベル(=11)が格納されてしまう。これは、図6におけるS390の動作によるものである。すると、その後、C番地〜D番地内のプログラムの実行が終了して、A番地〜B番地内の呼び出し元のプログラムへ戻る場合に、IM値を、元の値である0に戻すことができず、11に設定してしまうこととなる。   Also, as shown in FIG. 9B, the IM value during execution of the interrupt process is not returned to 0, but is set to a level (= 11) corresponding to the cause of the interrupt by a function such as the OS. Even when the program is interrupted, when returning from the interrupt processing program to the program in the original address C to address D, the execution address of the program is from address A to address B other than the address range PA1 to PAn to the address range PA1 (C Since the interrupt mask level control unit 25 determines that the priority level (= 11) corresponding to the cause of the interrupt is stored in the stack area. . This is due to the operation of S390 in FIG. Then, when the execution of the program in the addresses C to D is finished and the program returns to the calling program in the addresses A to B, the IM value can be returned to 0 which is the original value. Therefore, it will be set to 11.

そこで、こうしたケースでの上記不具合を解決するためには、CPU5が割り込みを受け付けて割り込み処理を行う場合と、その割り込み処理から元の処理へ復帰する場合には、割り込みマスクレベル制御部25の動作のうち、少なくとも、図6におけるS310〜S330の動作が禁止されるように構成すれば良い。上記の例で説明するならば、C番地〜D番地内のプログラムが実行されている時に、優先レベルが1よりも高い割り込みのプログラムが起動されて、プログラムの実行アドレスがアドレス範囲PA1〜PAn以外であるA番地〜B番地へ移っても、図6におけるS440の動作が行われなくなり、また、その割り込み処理のプログラムから元のC番地〜D番地内のプログラムへ復帰した際に、図6におけるS390の動作が行われなくなるため、図8に示したようにIM値を遷移させることができるようになるからである。   Therefore, in order to solve the above problem in such a case, the operation of the interrupt mask level control unit 25 is performed when the CPU 5 accepts an interrupt and performs an interrupt process, or when returning from the interrupt process to the original process. Of these, at least the operations of S310 to S330 in FIG. 6 may be prohibited. As explained in the above example, when a program in addresses C to D is being executed, an interrupt program with a priority level higher than 1 is started, and the execution address of the program is outside the address range PA1 to PAn. 6, the operation of S440 in FIG. 6 is not performed, and when returning from the interrupt processing program to the program in the original address C to address D in FIG. This is because the operation of S390 is not performed, and the IM value can be transitioned as shown in FIG.

尚、上記第3実施形態では、ステータスレジスタ19が、マスクレベル記憶手段に相当し、割り込みマスクレベル制御部25が、判定手段、マスクレベル変更手段、及びマスクレベル復元手段に相当している。特に、割り込みマスクレベル制御部25のうち、図6におけるS310〜S330,S370,S380,S420,S430の動作を行う部分が、判定手段に相当し、図6におけるS340〜S360,S390〜S410の動作を行う部分が、マスクレベル変更手段に相当し、図6におけるS440の動作を行う部分が、マスクレベル復元手段に相当している。そして、スタック領域が特定の記憶部に相当している。また、アドレス範囲PA1〜PAn以外のアドレス範囲が、特定アドレス範囲外に相当し、アドレス範囲PA1〜PAnの各々が、特定アドレス範囲又は部分特定アドレス範囲に相当している。
[第4実施形態]
図10に示す第4実施形態のECU1は、第1実施形態と比較すると、マイコン3が下記の点で異なっている。
In the third embodiment, the status register 19 corresponds to mask level storage means, and the interrupt mask level control unit 25 corresponds to determination means, mask level changing means, and mask level restoring means. In particular, the portion of the interrupt mask level control unit 25 that performs the operations of S310 to S330, S370, S380, S420, and S430 in FIG. 6 corresponds to the determination unit, and the operations of S340 to S360 and S390 to S410 in FIG. The portion for performing the processing corresponds to the mask level changing means, and the portion for performing the operation of S440 in FIG. 6 corresponds to the mask level restoring means. The stack area corresponds to a specific storage unit. Further, address ranges other than the address ranges PA1 to PAn correspond to outside the specific address range, and each of the address ranges PA1 to PAn corresponds to a specific address range or a partial specific address range.
[Fourth Embodiment]
The ECU 1 of the fourth embodiment shown in FIG. 10 differs from the first embodiment in the microcomputer 3 in the following points.

まず、割り込みコントローラ11内の論理積回路11cが削除されている。このため、レベル比較部11bからの割り込み要求信号が無条件でCPU5に出力される。
そして、割り込みコントローラ11には、割り込み要因設定レジスタ11dと、割り込みマスク部11eが設けられている。
First, the AND circuit 11c in the interrupt controller 11 is deleted. For this reason, the interrupt request signal from the level comparison unit 11b is output to the CPU 5 unconditionally.
The interrupt controller 11 is provided with an interrupt factor setting register 11d and an interrupt mask unit 11e.

割り込み要因設定レジスタ11dは、マスクする割り込みの要因(割り込み要因)を設定するためのレジスタである。そして、その割り込み要因設定レジスタ11dには、CPU5により、マスクすべき割り込みの割り込み要因を示す情報として、入力ポート13や内部タイマ15などから当該割り込みコントローラ11に入力される割り込み要求信号(周辺割り込み要求信号)のうちの1つ以上を示す情報が書き込まれる。   The interrupt factor setting register 11d is a register for setting an interrupt factor (interrupt factor) to be masked. In the interrupt factor setting register 11d, an interrupt request signal (peripheral interrupt request) input from the input port 13 or the internal timer 15 to the interrupt controller 11 as information indicating the interrupt factor of the interrupt to be masked by the CPU 5 is stored in the interrupt factor setting register 11d. Information indicating one or more of (signal) is written.

例えば、本実施形態において、割り込み要因設定レジスタ11dは、割り込みコントローラ11に入力される割り込み要求信号の各々に対応した複数のビットを有するレジスタであり、“1”が書き込まれたビットに対応する割り込み要求信号が、マスクすべき割り込みの割り込み要因による割り込み要求信号であることを意味している。尚、CPU5は、動作開始直後に起動されるイニシャルルーチンの実行により、割り込み要因設定レジスタ11dの各ビットに“1”か“0”を書き込むようになっている。   For example, in the present embodiment, the interrupt factor setting register 11d is a register having a plurality of bits corresponding to each interrupt request signal input to the interrupt controller 11, and an interrupt corresponding to a bit in which “1” is written. This means that the request signal is an interrupt request signal due to an interrupt factor of the interrupt to be masked. The CPU 5 writes “1” or “0” in each bit of the interrupt factor setting register 11d by executing an initial routine that is started immediately after the operation starts.

そして、割り込みマスク部11eは、割り込みマスク判定部17から前述の割り込みマスク信号が出力されていない場合には、入力ポート13や内部タイマ15などから当該割り込みコントローラ11に入力される割り込み要求信号を、全て優先順位判定部11aに入力させる。   Then, when the interrupt mask signal is not output from the interrupt mask determination unit 17, the interrupt mask unit 11e outputs an interrupt request signal input to the interrupt controller 11 from the input port 13, the internal timer 15, or the like. All are input to the priority determination unit 11a.

また、割り込みマスク部11eは、割り込みマスク判定部17から割り込みマスク信号が出力されている場合には、当該割り込みコントローラ11に入力される割り込み要求信号のうち、割り込み要因設定レジスタ11dによって設定された割り込み要因の割り込み要求信号が優先順位判定部11aに入力されるのを阻止する。つまり、割り込み要因設定レジスタ11dのビットのうち、“1”が書き込まれているビットに対応した割り込み要求信号が優先順位判定部11aに入力されるのを禁止する。   In addition, when an interrupt mask signal is output from the interrupt mask determination unit 17, the interrupt mask unit 11e includes the interrupt set by the interrupt factor setting register 11d among the interrupt request signals input to the interrupt controller 11. The factor interrupt request signal is prevented from being input to the priority determination unit 11a. That is, the interrupt request signal corresponding to the bit in which “1” is written among the bits of the interrupt factor setting register 11d is prohibited from being input to the priority determination unit 11a.

尚、このような割り込みマスク部11eは、論理積回路の組み合わせにより構成することができる。例えば、1つの割り込み要求信号IR1について説明すると、割り込みマスク部11eは、その割り込み要求信号IR1に対応する割り込み要因設定レジスタ11dのビット値と割り込みマスク判定部17からの割り込みマスク信号とを入力とするナンド回路(否定論理積回路)と、そのナンド回路の出力と割り込み要求信号IR1とを入力とするアンド回路(論理積回路)とから構成することができる。そして、この構成の場合、アンド回路から優先順位判定部11aへ割り込み要求信号IR1が出力されることとなる。   Such an interrupt mask unit 11e can be configured by a combination of AND circuits. For example, when describing one interrupt request signal IR1, the interrupt mask unit 11e receives the bit value of the interrupt factor setting register 11d corresponding to the interrupt request signal IR1 and the interrupt mask signal from the interrupt mask determination unit 17. A NAND circuit (negative AND circuit) and an AND circuit (AND circuit) that receives the output of the NAND circuit and the interrupt request signal IR1 can be used. In this configuration, the interrupt request signal IR1 is output from the AND circuit to the priority determination unit 11a.

このような第4実施形態のマイコン3では、第1実施形態と同様に、メモリ7,9の記憶領域のうち、アドレス範囲レジスタ17a内の情報が示すアドレス範囲に記憶されているプログラムをCPU3が実行している場合には、割り込みマスク判定部17から割り込みコントローラ11へ割り込みマスク信号が出力される。   In such a microcomputer 3 of the fourth embodiment, as in the first embodiment, the CPU 3 loads a program stored in the address range indicated by the information in the address range register 17a in the storage areas of the memories 7 and 9. If it is being executed, an interrupt mask signal is output from the interrupt mask determination unit 17 to the interrupt controller 11.

そして、割り込みマスク判定部17から割り込みマスク信号が出力されると、割り込みコントローラ11に入力される割り込み要求信号のうち、割り込み要因設定レジスタ11dによって設定された割り込み要因の割り込み要求信号は、優先順位判定部11aに入力されなくなるため、たとえその割り込み要求信号がステータスレジスタ19内のIMよりも優先レベルが高い割り込みの割り込み要求信号であっても、CPU5へ出力されるのが阻止される。よって、CPU5は、その割り込み要求信号に対応する割り込みを受け付けなくなる。   Then, when an interrupt mask signal is output from the interrupt mask determination unit 17, the interrupt request signal of the interrupt factor set by the interrupt factor setting register 11d among the interrupt request signals input to the interrupt controller 11 is determined according to the priority order. Since it is not input to the unit 11a, even if the interrupt request signal is an interrupt request signal of an interrupt having a higher priority level than the IM in the status register 19, it is prevented from being output to the CPU 5. Therefore, the CPU 5 does not accept an interrupt corresponding to the interrupt request signal.

そこで、本第4実施形態では、CPU5に実行させるプログラムのうち、特定の割り込み要因の割り込みを禁止した状態で実行したいプログラム(以下、プログラムP1という)を、メモリ7,9における特定のアドレス範囲に格納し、更に、その特定のアドレス範囲の情報がアドレス範囲レジスタ17aに書き込まれると共に、上記特定の割り込み要因(即ち、プログラムP1の実行中に禁止したい割り込みの割り込み要因)を示す情報が割り込み要因設定レジスタ11dに書き込まれるようにイニシャルルーチンをプログラミングしている。   Therefore, in the fourth embodiment, among the programs to be executed by the CPU 5, a program (hereinafter referred to as a program P 1) that is desired to be executed in a state in which interruption of a specific interrupt factor is prohibited is assigned to a specific address range in the memories 7 and 9. In addition, information on the specific address range is written into the address range register 17a, and information indicating the specific interrupt factor (that is, interrupt factor of an interrupt to be prohibited during execution of the program P1) is set as an interrupt factor. The initial routine is programmed to be written to the register 11d.

このようにすれば、プログラムP1が実行されている間は、前述した割り込みコントローラ11内の割り込み要因設定レジスタ11d及び割り込みマスク部11eと割り込みマスク判定部17の作用により、CPU5が上記特定の割り込み要因の割り込みを受け付けなくなるからである。   In this way, while the program P1 is being executed, the CPU 5 causes the above-described specific interrupt factor to operate by the action of the interrupt factor setting register 11d, the interrupt mask unit 11e and the interrupt mask determination unit 17 in the interrupt controller 11 described above. This is because no interrupts are accepted.

よって、本第4実施形態のマイコン3によれば、特定の割り込み要因の割り込みを禁止した状態で実行したいプログラムがある場合に、そのプログラムの先頭で特定の割り込み要因の割り込みを禁止するための処理を行い該プログラムの最後で特定の割り込み要因の割り込み禁止を解除するための処理を行う、というプログラミングをする必要がなくなる。このため、CPU5の処理負荷及びプログラム容量を低減することができ、更に、プログラムを記憶するためのメモリ容量も低減することができる。   Therefore, according to the microcomputer 3 of the fourth embodiment, when there is a program that is desired to be executed in a state where the interrupt of a specific interrupt factor is prohibited, the process for prohibiting the interrupt of the specific interrupt factor at the head of the program It is not necessary to perform programming for canceling the prohibition of interrupt of a specific interrupt factor at the end of the program. For this reason, the processing load and program capacity of the CPU 5 can be reduced, and the memory capacity for storing the program can also be reduced.

そして、このようなマイコン3を備えた第4実施形態のECU1によれば、メモリ容量の低減により、コスト増加を防止することができ、更に、CPU5の処理負荷が低減されるため、制御性能を高めることができる。   And according to ECU1 of 4th Embodiment provided with such a microcomputer 3, since increase in cost can be prevented by reduction of memory capacity, and also the processing load of CPU5 is reduced, control performance is reduced. Can be increased.

また、第4実施形態のマイコン3によれば、禁止される割り込みの要因を、割り込み要因設定レジスタ11dに書き込む内容によって任意に設定することができる。よって、高い汎用性が得られる。更に、禁止される割り込みの要因を複数指定することができるため、プログラム設計の自由度を向上させることができる。   Further, according to the microcomputer 3 of the fourth embodiment, the interrupt factor to be prohibited can be arbitrarily set according to the contents written in the interrupt factor setting register 11d. Therefore, high versatility can be obtained. Furthermore, since a plurality of interrupt factors to be prohibited can be designated, the degree of freedom in program design can be improved.

また、第4実施形態のマイコン3においても、特定の割り込み要因の割り込みが禁止されることとなるアドレス範囲を、アドレス範囲レジスタ17aに書き込む内容によって任意に設定することができ、高い汎用性が得られる。   Also in the microcomputer 3 of the fourth embodiment, the address range in which the interrupt of a specific interrupt factor is prohibited can be arbitrarily set depending on the contents written in the address range register 17a, and high versatility is obtained. It is done.

また更に、第4実施形態のマイコン3においても、割り込みマスク判定部17と、割り込み要因設定レジスタ11d及び割り込みマスク部11eとを、CPU5の外部に設けているため、それらの追加や削除が容易である。   Furthermore, in the microcomputer 3 of the fourth embodiment, since the interrupt mask determination unit 17, the interrupt factor setting register 11d, and the interrupt mask unit 11e are provided outside the CPU 5, it is easy to add or delete them. is there.

尚、特定の割り込み要因の割り込みが禁止されることとなるアドレス範囲は固定であっても良い。この場合、例えば、アドレス範囲レジスタ17aに相当する部分に予め固定値がセットされる構成が考えられる。同様に、禁止される割り込みの要因は固定であっても良い。この場合、例えば、割り込み要因設定レジスタ11dに相当する部分に予め固定値がセットされる構成が考えられる。   It should be noted that the address range in which the interrupt of a specific interrupt factor is prohibited may be fixed. In this case, for example, a configuration in which a fixed value is set in advance in a portion corresponding to the address range register 17a is conceivable. Similarly, the factor of the interrupt that is prohibited may be fixed. In this case, for example, a configuration in which a fixed value is set in advance in a portion corresponding to the interrupt factor setting register 11d can be considered.

一方、第4実施形態では、割り込みマスク判定部17と割り込み要因設定レジスタ11d及び割り込みマスク部11eとが、特定割り込み制限手段に相当している。また、割り込み要因設定レジスタ11dが、割り込み要因設定用レジスタに相当している。   On the other hand, in the fourth embodiment, the interrupt mask determination unit 17, the interrupt factor setting register 11d, and the interrupt mask unit 11e correspond to a specific interrupt limiting unit. The interrupt factor setting register 11d corresponds to an interrupt factor setting register.

以上、本発明の一実施形態について説明したが、本発明はこうした実施形態に何等限定されるものではなく、本発明の要旨を逸脱しない範囲において、種々なる態様で実施し得ることは勿論である。   As mentioned above, although one Embodiment of this invention was described, this invention is not limited to such Embodiment at all, Of course, in the range which does not deviate from the summary of this invention, it can implement in a various aspect. .

例えば、第3実施形態において、IM値の退避先はスタック領域に限らず、例えばRAM9における何れかの記憶領域でも良い。
また、各実施形態において、アドレス範囲レジスタ17a,AR1〜ARnに書き込むアドレス範囲の情報としては、目的のアドレス範囲の先頭アドレスと最終アドレスに限らず、アドレス範囲が特定できる情報であればどのような形式の情報でも良い。例えば、先頭アドレスと、その先頭アドレスから何バイト分といった容量情報でも良い。また例えば、目的のアドレス範囲における各アドレス同士で共通なビットからなるビット列を示す共通ビット情報と、共通ではないビットの位置を示す非共通ビット情報とが、アドレス範囲レジスタ17a,AR1〜ARnに書き込まれるようにし、実行アドレスのビット列のうち、非共通ビット情報が示す位置のビットを無視したビット列が、共通ビット情報が示すビット列と一致すれば、その実行アドレスがアドレス範囲レジスタ17a,AR1〜ARnにより設定されたアドレス範囲内であると判定するように構成することもできる。
For example, in the third embodiment, the IM value save destination is not limited to the stack area, and may be any storage area in the RAM 9, for example.
In each embodiment, the address range information to be written to the address range registers 17a and AR1 to ARn is not limited to the start address and the final address of the target address range, but any information that can specify the address range. It may be in the form of information. For example, capacity information such as the start address and the number of bytes from the start address may be used. Further, for example, common bit information indicating a bit string composed of bits common to each address in a target address range and non-common bit information indicating a position of a bit that is not common are written in the address range registers 17a and AR1 to ARn. If the bit string ignoring the bit at the position indicated by the non-common bit information in the execution address bit string matches the bit string indicated by the common bit information, the execution address is determined by the address range registers 17a and AR1 to ARn. It can also be configured to determine that it is within the set address range.

第1実施形態のECU及びマイコンの構成を表す構成図である。It is a block diagram showing the structure of ECU and microcomputer of 1st Embodiment. 第1実施形態のマイコンの使用方法及び作用を説明する説明図である。It is explanatory drawing explaining the usage method and effect | action of the microcomputer of 1st Embodiment. 第2実施形態のECU及びマイコンの構成を表す構成図である。It is a block diagram showing the structure of ECU and microcomputer of 2nd Embodiment. 第3実施形態のECU及びマイコンの構成を表す構成図である。It is a block diagram showing the structure of ECU and microcomputer of 3rd Embodiment. 第3実施形態のマイコンにおけるプログラムの格納状態を説明する説明図である。It is explanatory drawing explaining the storage state of the program in the microcomputer of 3rd Embodiment. 第3実施形態のマイコンにおける割り込みマスクレベル制御部の動作を表すフローチャートである。It is a flowchart showing operation | movement of the interruption mask level control part in the microcomputer of 3rd Embodiment. 割り込みマスクレベル制御部が設けられていないと仮定した場合の、プログラムの構成例を説明するフローチャートである。It is a flowchart explaining the example of a structure of a program on the assumption that the interruption mask level control part is not provided. 第3実施形態のマイコンの追加機能を説明するための第1の説明図である。It is the 1st explanatory view for explaining the additional function of the microcomputer of a 3rd embodiment. 第3実施形態のマイコンの追加機能を説明するための第2の説明図である。It is the 2nd explanatory view for explaining the additional function of the microcomputer of a 3rd embodiment. 第4実施形態のECU及びマイコンの構成を表す構成図である。It is a block diagram showing the structure of ECU and microcomputer of 4th Embodiment.

符号の説明Explanation of symbols

1…電子制御装置(ECU)、3…マイコン(マイクロコンピュータ)、5…CPU、7…ROM、9…RAM、11…割り込みコントローラ、11a…優先順位判定部、11b…レベル比較部、11c…論理積回路、11d…割り込み要因設定レジスタ、11e…割り込みマスク部、13…入力ポート、15…内部タイマ、17…割り込みマスク判定部、17a,AR1〜ARn…アドレス範囲レジスタ、17b…アドレス比較部、17c…状態変化禁止レジスタ、19…ステータスレジスタ、21…アドレスバス(命令フェッチバス)、23…プログラムカウンタ、25…割り込みマスクレベル制御部   DESCRIPTION OF SYMBOLS 1 ... Electronic control unit (ECU), 3 ... Microcomputer (microcomputer), 5 ... CPU, 7 ... ROM, 9 ... RAM, 11 ... Interrupt controller, 11a ... Priority determination part, 11b ... Level comparison part, 11c ... Logic Product circuit, 11d ... Interrupt factor setting register, 11e ... Interrupt mask unit, 13 ... Input port, 15 ... Internal timer, 17 ... Interrupt mask determination unit, 17a, AR1-ARn ... Address range register, 17b ... Address comparison unit, 17c ... State change prohibition register, 19 ... Status register, 21 ... Address bus (instruction fetch bus), 23 ... Program counter, 25 ... Interrupt mask level control unit

Claims (25)

CPUと、該CPUによって実行されるプログラムが格納されるメモリと、を備えたマイクロコンピュータにおいて、
前記CPUが実行するプログラムのアドレス(以下、実行アドレスという)が、前記メモリ上の特定アドレス範囲内であるか否かを判定すると共に、前記実行アドレスが前記特定アドレス範囲内であると判定している場合には、前記CPUが割り込みを受け付けないようにする割り込み制限手段を備えていること、
を特徴とするマイクロコンピュータ。
In a microcomputer comprising a CPU and a memory storing a program executed by the CPU,
It is determined whether an address of a program executed by the CPU (hereinafter referred to as an execution address) is within a specific address range on the memory, and it is determined that the execution address is within the specific address range. If there is an interrupt limiting means for preventing the CPU from accepting an interrupt,
A microcomputer characterized by.
請求項1に記載のマイクロコンピュータにおいて、
前記割り込み制限手段は、前記CPUが命令フェッチ時に該CPUと前記メモリとの間のアドレスバスへ出力するアドレス値を監視し、そのアドレスバス上のアドレス値が前記特定アドレス範囲内であるか否かを判定することより、前記実行アドレスが前記特定アドレス範囲内であるか否かを判定するように構成されていること、
を特徴とするマイクロコンピュータ。
The microcomputer according to claim 1,
The interrupt limiting unit monitors an address value output to an address bus between the CPU and the memory when the CPU fetches an instruction, and determines whether the address value on the address bus is within the specific address range. Is configured to determine whether the execution address is within the specific address range,
A microcomputer characterized by.
請求項1又は請求項2に記載のマイクロコンピュータにおいて、
前記割り込み制限手段は、前記CPUの外部に設けられた割り込みコントローラが前記CPUに対して割り込み要求信号を出力するのを阻止することにより、前記CPUが割り込みを受け付けないようにすること、
を特徴とするマイクロコンピュータ。
The microcomputer according to claim 1 or 2,
The interrupt limiting unit prevents the CPU from accepting an interrupt by preventing an interrupt controller provided outside the CPU from outputting an interrupt request signal to the CPU;
A microcomputer characterized by.
請求項1ないし請求項3の何れか1項に記載のマイクロコンピュータにおいて、
前記メモリ上のアドレス範囲を示す情報が前記CPUによって書き込まれるアドレス範囲設定用レジスタを備え、
前記割り込み制限手段は、前記アドレス範囲設定用レジスタ内の情報が示すアドレス範囲を、前記特定アドレス範囲として扱うこと、
を特徴とするマイクロコンピュータ。
The microcomputer according to any one of claims 1 to 3,
An address range setting register in which information indicating an address range on the memory is written by the CPU;
The interrupt limiting unit handles the address range indicated by the information in the address range setting register as the specific address range;
A microcomputer characterized by.
請求項1ないし請求項4の何れか1項に記載のマイクロコンピュータにおいて、
前記CPUが前記割り込み制限手段の動作状態を保持するための状態保持用命令を実行すると、その状態保持用命令による動作状態の保持を解除するための解除用命令を前記CPUが実行するまでの間、前記割り込み制限手段は、前記CPUが割り込みを受け付けないようにする動作状態と、前記CPUが割り込みを受け付けることができるようにする動作状態とのうち、前記状態保持用命令が実行された時になっている動作状態を保持するようになっていること、
を特徴とするマイクロコンピュータ。
The microcomputer according to any one of claims 1 to 4,
When the CPU executes a state holding instruction for holding the operation state of the interrupt limiting unit, the CPU executes a release instruction for releasing the holding of the operation state by the state holding instruction. The interrupt limiting means is when the state holding instruction is executed among an operation state in which the CPU does not accept an interrupt and an operation state in which the CPU can accept an interrupt. To keep the operating state
A microcomputer characterized by.
請求項1ないし請求項5の何れか1項に記載のマイクロコンピュータの使用方法であって、
前記CPUに実行させるプログラムのうち、割り込み禁止状態で実行したいプログラムを、前記メモリの前記特定アドレス範囲内に格納すること、
を特徴とするマイクロコンピュータの使用方法。
A method of using the microcomputer according to any one of claims 1 to 5,
Of the programs to be executed by the CPU, storing a program to be executed in an interrupt disabled state within the specific address range of the memory;
A method of using a microcomputer characterized by the above.
請求項1ないし請求項5の何れか1項に記載のマイクロコンピュータを備え、そのマイクロコンピュータによって制御対象を制御するための処理を行う電子制御装置であって、
前記制御対象を制御するために前記CPUが実行するプログラムのうち、割り込み禁止状態で実行されるプログラムが、前記メモリの前記特定アドレス範囲内に格納されていること、
を特徴とする電子制御装置。
An electronic control device comprising the microcomputer according to any one of claims 1 to 5, wherein the microcomputer performs processing for controlling a controlled object.
Of the programs executed by the CPU to control the control target, a program executed in an interrupt disabled state is stored in the specific address range of the memory,
An electronic control device.
CPUと、
該CPUによって実行されるプログラムが格納されるメモリと、
マスクされる割り込みの優先レベルの最大値である割り込みマスクレベルが記憶されるマスクレベル記憶手段と、
優先レベルが前記マスクレベル記憶手段内の割り込みマスクレベルよりも高い割り込みの要求信号が発生すると、その割り込みを前記CPUに受け付けさせ、優先レベルが前記マスクレベル記憶手段内の割り込みマスクレベル以下である割り込みの要求信号が発生しても、その割り込みを前記CPUが受け付けないようにする割り込みコントローラと、
を備えたマイクロコンピュータにおいて、
前記CPUが実行するプログラムのアドレス(以下、実行アドレスという)が、前記メモリ上の特定アドレス範囲外から特定アドレス範囲内に入ったか否かと、前記実行アドレスが、前記特定アドレス範囲内から前記特定アドレス範囲外に出たか否かとを判定する判定手段と、
前記判定手段により前記実行アドレスが前記特定アドレス範囲外から前記特定アドレス範囲内に入ったと判定されると、前記マスクレベル記憶手段内の割り込みマスクレベルを特定の記憶部に記憶した後、前記マスクレベル記憶手段内の割り込みマスクレベルを、前記特定アドレス範囲に対して定められている特定の優先レベルに変更するマスクレベル変更手段と、
前記判定手段により前記実行アドレスが前記特定アドレス範囲内から前記特定アドレス範囲外に出たと判定されると、前記マスクレベル記憶手段内の割り込みマスクレベルを、前記記憶部内の割り込みマスクレベルに戻すマスクレベル復元手段と、
を備えていることを特徴とするマイクロコンピュータ。
CPU,
A memory for storing a program executed by the CPU;
Mask level storage means for storing an interrupt mask level which is the maximum priority level of interrupts to be masked;
When an interrupt request signal having a priority level higher than the interrupt mask level in the mask level storage means is generated, the CPU accepts the interrupt, and an interrupt whose priority level is equal to or lower than the interrupt mask level in the mask level storage means An interrupt controller that prevents the CPU from accepting the interrupt even when a request signal is generated;
In a microcomputer equipped with
Whether an address of a program executed by the CPU (hereinafter referred to as an execution address) has entered the specific address range from outside the specific address range on the memory, and the execution address is within the specific address range from the specific address range. Determination means for determining whether or not the vehicle has gone out of range;
When the determination means determines that the execution address has entered the specific address range from outside the specific address range, the interrupt mask level in the mask level storage means is stored in a specific storage unit, and then the mask level Mask level changing means for changing the interrupt mask level in the storage means to a specific priority level determined for the specific address range;
A mask level for returning the interrupt mask level in the mask level storage means to the interrupt mask level in the storage section when the determination means determines that the execution address is out of the specific address range from the specific address range Recovery means,
A microcomputer comprising:
請求項8に記載のマイクロコンピュータにおいて、
前記マスクレベル変更手段は、前記マスクレベル記憶手段内の変更前の割り込みマスクレベルが、前記特定の優先レベル以上ならば、前記マスクレベル記憶手段内の割り込みマスクレベルを変更しないようになっていること、
を特徴とするマイクロコンピュータ。
The microcomputer according to claim 8,
The mask level changing means does not change the interrupt mask level in the mask level storage means if the interrupt mask level before the change in the mask level storage means is equal to or higher than the specific priority level. ,
A microcomputer characterized by.
請求項8又は請求項9に記載のマイクロコンピュータにおいて、
前記CPUが割り込みを受け付けて割り込み処理を行う場合と、その割り込み処理から元の処理へ復帰する場合には、前記判定手段の作動が禁止されること、
を特徴とするマイクロコンピュータ。
The microcomputer according to claim 8 or 9,
When the CPU accepts an interrupt and performs an interrupt process, and when returning from the interrupt process to the original process, the operation of the determination means is prohibited.
A microcomputer characterized by.
請求項8に記載のマイクロコンピュータにおいて、
前記特定アドレス範囲は、複数の部分特定アドレス範囲からなると共に、その各部分特定アドレス範囲に対してそれぞれ異なる優先レベルが定められており、
更に、前記判定手段は、前記実行アドレスが前記特定アドレス範囲外から前記複数の部分特定アドレス範囲のうちの何れに入ったかを区別して判定するようになっており、
前記マスクレベル変更手段は、前記判定手段により前記実行アドレスが前記特定アドレス範囲外から前記部分特定アドレス範囲の何れかに入ったと判定されると、前記マスクレベル記憶手段内の割り込みマスクレベルを前記記憶部に記憶した後、前記マスクレベル記憶手段内の割り込みマスクレベルを、前記実行アドレスが今回入った前記部分特定アドレス範囲に対して定められている特定の優先レベルに変更すること、
を特徴とするマイクロコンピュータ。
The microcomputer according to claim 8,
The specific address range includes a plurality of partial specific address ranges, and different priority levels are defined for the partial specific address ranges,
Further, the determination means is configured to distinguish and determine which of the plurality of partial specific address ranges has entered the execution address from outside the specific address range,
The mask level changing means stores the interrupt mask level in the mask level storage means when the determination means determines that the execution address has entered any of the partial specific address ranges from outside the specific address range. The interrupt mask level in the mask level storage means is changed to a specific priority level determined for the partial specific address range in which the execution address has entered this time,
A microcomputer characterized by.
請求項11に記載のマイクロコンピュータにおいて、
前記マスクレベル変更手段は、前記マスクレベル記憶手段内の変更前の割り込みマスクレベルが、前記特定の優先レベル以上ならば、前記マスクレベル記憶手段内の割り込みマスクレベルを変更しないようになっていること、
を特徴とするマイクロコンピュータ。
The microcomputer according to claim 11, wherein
The mask level changing means does not change the interrupt mask level in the mask level storage means if the interrupt mask level before the change in the mask level storage means is equal to or higher than the specific priority level. ,
A microcomputer characterized by.
請求項11又は請求項12に記載のマイクロコンピュータにおいて、
前記CPUが割り込みを受け付けて割り込み処理を行う場合と、その割り込み処理から元の処理へ復帰する場合には、前記判定手段の作動が禁止されること、
を特徴とするマイクロコンピュータ。
The microcomputer according to claim 11 or 12,
When the CPU accepts an interrupt and performs an interrupt process, and when returning from the interrupt process to the original process, the operation of the determination means is prohibited.
A microcomputer characterized by.
請求項8ないし請求項10の何れか1項に記載のマイクロコンピュータの使用方法であって、
前記CPUに実行させるプログラムのうち、優先レベルが前記特定の優先レベル以下である割り込みを禁止した状態で実行したいプログラムを、前記メモリの前記特定アドレス範囲内に格納すること、
を特徴とするマイクロコンピュータの使用方法。
A method of using the microcomputer according to any one of claims 8 to 10,
Storing a program to be executed in a state in which an interrupt whose priority level is equal to or lower than the specific priority level among the programs to be executed by the CPU is prohibited in the specific address range of the memory;
A method of using a microcomputer characterized by the above.
請求項8ないし請求項10の何れか1項に記載のマイクロコンピュータを備え、そのマイクロコンピュータによって制御対象を制御するための処理を行う電子制御装置であって、
前記制御対象を制御するために前記CPUが実行するプログラムのうち、優先レベルが前記特定の優先レベル以下である割り込みを禁止した状態で実行されるプログラムが、前記メモリの前記特定アドレス範囲内に格納されていること、
を特徴とする電子制御装置。
An electronic control device comprising the microcomputer according to any one of claims 8 to 10, wherein the microcomputer performs processing for controlling a controlled object.
Among programs executed by the CPU to control the control target, a program executed in a state where an interrupt whose priority level is equal to or lower than the specific priority level is prohibited is stored in the specific address range of the memory. is being done,
An electronic control device.
請求項11ないし請求項13の何れか1項に記載のマイクロコンピュータの使用方法であって、
前記CPUに実行させるプログラムのうち、優先レベルがN(Nは優先レベルを示す数)以下である割り込みを禁止した状態で実行したいプログラムを、前記メモリにおける複数の部分特定アドレス範囲のうち、優先レベルが前記Nに定められている部分特定アドレス範囲内に格納すること、
を特徴とするマイクロコンピュータの使用方法。
A method of using the microcomputer according to any one of claims 11 to 13,
Among the programs to be executed by the CPU, a program to be executed in a state in which an interrupt whose priority level is N or less (N is a number indicating the priority level) is prohibited is selected from among a plurality of partial specific address ranges in the memory. Is stored in the partial specific address range defined in the N,
A method of using a microcomputer characterized by the above.
請求項11ないし請求項13の何れか1項に記載のマイクロコンピュータを備え、そのマイクロコンピュータによって制御対象を制御するための処理を行う電子制御装置であって、
前記制御対象を制御するために前記CPUが実行するプログラムのうち、優先レベルがN(Nは優先レベルを示す数)以下である割り込みを禁止した状態で実行されるプログラムが、前記メモリにおける複数の部分特定アドレス範囲のうち、優先レベルが前記Nに定められている部分特定アドレス範囲内に格納されていること、
を特徴とする電子制御装置。
An electronic control device comprising the microcomputer according to any one of claims 11 to 13, wherein the microcomputer performs processing for controlling a controlled object.
Among programs executed by the CPU to control the control target, a program executed in a state in which an interrupt whose priority level is N or less (N is a number indicating the priority level) is prohibited is a plurality of programs in the memory. Among the partial specific address ranges, the priority level is stored in the partial specific address range defined in N,
An electronic control device.
CPUと、該CPUによって実行されるプログラムが格納されるメモリと、を備えたマイクロコンピュータにおいて、
前記CPUが実行するプログラムのアドレス(以下、実行アドレスという)が、前記メモリ上の特定アドレス範囲内であるか否かを判定すると共に、前記実行アドレスが前記特定アドレス範囲内であると判定している場合には、前記CPUが特定の割り込み要因の割り込みを受け付けないようにする特定割り込み制限手段を備えていること、
を特徴とするマイクロコンピュータ。
In a microcomputer comprising a CPU and a memory storing a program executed by the CPU,
It is determined whether an address of a program executed by the CPU (hereinafter referred to as an execution address) is within a specific address range on the memory, and it is determined that the execution address is within the specific address range. A specific interrupt limiting means for preventing the CPU from accepting an interrupt of a specific interrupt factor,
A microcomputer characterized by.
請求項18に記載のマイクロコンピュータにおいて、
割り込み要因を示す情報が前記CPUによって書き込まれる割り込み要因設定用レジスタを備え、
前記特定割り込み制限手段は、前記割り込み要因設定用レジスタ内の情報が示す割り込み要因を、前記特定の割り込み要因として扱うこと、
を特徴とするマイクロコンピュータ。
The microcomputer according to claim 18,
An interrupt factor setting register in which information indicating an interrupt factor is written by the CPU;
The specific interrupt limiting means handles the interrupt factor indicated by the information in the interrupt factor setting register as the specific interrupt factor;
A microcomputer characterized by.
請求項19に記載のマイクロコンピュータにおいて、
前記割り込み要因設定用レジスタには、複数種類の割り込み要因を示す情報を書き込むことが可能になっていること、
を特徴とするマイクロコンピュータ。
The microcomputer according to claim 19,
In the interrupt factor setting register, information indicating a plurality of types of interrupt factors can be written,
A microcomputer characterized by.
請求項18ないし請求項20の何れか1項に記載のマイクロコンピュータにおいて、
前記特定割り込み制限手段は、前記CPUが命令フェッチ時に該CPUと前記メモリとの間のアドレスバスへ出力するアドレス値を監視し、そのアドレスバス上のアドレス値が前記特定アドレス範囲内であるか否かを判定することより、前記実行アドレスが前記特定アドレス範囲内であるか否かを判定するように構成されていること、
を特徴とするマイクロコンピュータ。
The microcomputer according to any one of claims 18 to 20,
The specific interrupt limiting unit monitors an address value output to the address bus between the CPU and the memory when the CPU fetches an instruction, and whether or not the address value on the address bus is within the specific address range. Determining whether or not the execution address is within the specific address range,
A microcomputer characterized by.
請求項18ないし請求項21の何れか1項に記載のマイクロコンピュータにおいて、
前記特定割り込み制限手段は、前記CPUの外部に設けられた割り込みコントローラが前記CPUに対して前記特定の割り込み要因の割り込み要求信号を出力するのを阻止することにより、前記CPUが前記特定の割り込み要因の割り込みを受け付けないようにすること、
を特徴とするマイクロコンピュータ。
The microcomputer according to any one of claims 18 to 21,
The specific interrupt limiting means prevents the interrupt controller provided outside the CPU from outputting an interrupt request signal of the specific interrupt factor to the CPU, so that the CPU can output the specific interrupt factor. Not accepting any interrupts,
A microcomputer characterized by.
請求項18ないし請求項22の何れか1項に記載のマイクロコンピュータにおいて、
前記メモリ上のアドレス範囲を示す情報が前記CPUによって書き込まれるアドレス範囲設定用レジスタを備え、
前記特定割り込み制限手段は、前記アドレス範囲設定用レジスタ内の情報が示すアドレス範囲を、前記特定アドレス範囲として扱うこと、
を特徴とするマイクロコンピュータ。
The microcomputer according to any one of claims 18 to 22,
An address range setting register in which information indicating an address range on the memory is written by the CPU;
The specific interrupt limiting means handles the address range indicated by the information in the address range setting register as the specific address range;
A microcomputer characterized by.
請求項18ないし請求項23の何れか1項に記載のマイクロコンピュータの使用方法であって、
前記CPUに実行させるプログラムのうち、前記特定の割り込み要因の割り込みを禁止した状態で実行したいプログラムを、前記メモリの前記特定アドレス範囲内に格納すること、
を特徴とするマイクロコンピュータの使用方法。
A method of using the microcomputer according to any one of claims 18 to 23,
Of the programs to be executed by the CPU, storing a program to be executed in a state in which interruption of the specific interrupt factor is prohibited, within the specific address range of the memory,
A method of using a microcomputer characterized by the above.
請求項18ないし請求項23の何れか1項に記載のマイクロコンピュータを備え、そのマイクロコンピュータによって制御対象を制御するための処理を行う電子制御装置であって、
前記制御対象を制御するために前記CPUが実行するプログラムのうち、前記特定の割り込み要因の割り込みを禁止した状態で実行されるプログラムが、前記メモリの前記特定アドレス範囲内に格納されていること、
を特徴とする電子制御装置。
An electronic control device comprising the microcomputer according to any one of claims 18 to 23, wherein the microcomputer performs processing for controlling a controlled object.
Of the programs executed by the CPU to control the control target, a program executed in a state in which interruption of the specific interrupt factor is prohibited is stored in the specific address range of the memory,
An electronic control device.
JP2007262227A 2007-10-05 2007-10-05 Microcomputer, method of using the same, and electronic control unit Pending JP2009093344A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007262227A JP2009093344A (en) 2007-10-05 2007-10-05 Microcomputer, method of using the same, and electronic control unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007262227A JP2009093344A (en) 2007-10-05 2007-10-05 Microcomputer, method of using the same, and electronic control unit

Publications (1)

Publication Number Publication Date
JP2009093344A true JP2009093344A (en) 2009-04-30

Family

ID=40665292

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007262227A Pending JP2009093344A (en) 2007-10-05 2007-10-05 Microcomputer, method of using the same, and electronic control unit

Country Status (1)

Country Link
JP (1) JP2009093344A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013028414A2 (en) * 2011-08-22 2013-02-28 Intel Corporation Performing an atomic operation without quiescing an interconnect structure
JP2013190929A (en) * 2012-03-13 2013-09-26 Denso Corp Microcomputer
JP2013190930A (en) * 2012-03-13 2013-09-26 Denso Corp Microcomputer
JP2015531521A (en) * 2012-10-09 2015-11-02 コンチネンタル オートモーティヴ ゲゼルシャフト ミット ベシュレンクテル ハフツングContinental Automotive GmbH Method and controller for controlling the separate execution of a plurality of linked program blocks

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013028414A2 (en) * 2011-08-22 2013-02-28 Intel Corporation Performing an atomic operation without quiescing an interconnect structure
WO2013028414A3 (en) * 2011-08-22 2013-05-02 Intel Corporation Performing an atomic operation without quiescing an interconnect structure
US9015436B2 (en) 2011-08-22 2015-04-21 Intel Corporation Performing an atomic operation without quiescing an interconnect structure
JP2013190929A (en) * 2012-03-13 2013-09-26 Denso Corp Microcomputer
JP2013190930A (en) * 2012-03-13 2013-09-26 Denso Corp Microcomputer
JP2015531521A (en) * 2012-10-09 2015-11-02 コンチネンタル オートモーティヴ ゲゼルシャフト ミット ベシュレンクテル ハフツングContinental Automotive GmbH Method and controller for controlling the separate execution of a plurality of linked program blocks

Similar Documents

Publication Publication Date Title
JP7280600B2 (en) processor
US8234476B2 (en) Information processing apparatus and method of updating stack pointer
US7984432B2 (en) Method for patching a read-only memory and a data processing system comprising a means of patching the read-only memory based on patch contexts
CN103329102A (en) Multiprocessor system
JP2009093344A (en) Microcomputer, method of using the same, and electronic control unit
EP2590082A1 (en) Cache memory apparatus, cache control method, and microprocessor system
JP6838223B2 (en) Vehicle control device
JP2017204083A (en) Memory protection system
JP5870043B2 (en) Start control device, information device, and start control method
JP2004272844A (en) Method for controlling interruption
JP2019049928A (en) Electronic control device and control method for electronic control device
JP4889235B2 (en) Program control processor
JP6365387B2 (en) Electronic control unit
JP2004030224A (en) Processor, method for retracting register and method for designating register
CN108701031B (en) Register access control
US20050144408A1 (en) Memory protection unit, memory protection method, and computer-readable record medium in which memory protection program is recorded
JP3395727B2 (en) Arithmetic device and method
US6725298B1 (en) Method and system for filter-processing by ensuring a memory space for a ring-buffer in digital signal processor
JP2007286921A (en) Information processor and security release program unauthorized execution prohibition method using it
JP3583918B2 (en) Microprocessor
JP2005209178A (en) Memory protection unit, memory protection method, and memory protection program
JP2011150457A (en) Information processing apparatus and memory access control method
JP3617445B2 (en) Information processing device
JP6252321B2 (en) Memory control method and information processing apparatus
JP2006085868A (en) Rewrite limiting method and semiconductor device