JP2014081783A - Microcontroller, handler address specification method and program - Google Patents
Microcontroller, handler address specification method and program Download PDFInfo
- Publication number
- JP2014081783A JP2014081783A JP2012229148A JP2012229148A JP2014081783A JP 2014081783 A JP2014081783 A JP 2014081783A JP 2012229148 A JP2012229148 A JP 2012229148A JP 2012229148 A JP2012229148 A JP 2012229148A JP 2014081783 A JP2014081783 A JP 2014081783A
- Authority
- JP
- Japan
- Prior art keywords
- handler
- interrupt
- address
- storage means
- cpu
- 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
Links
Images
Landscapes
- Microcomputers (AREA)
Abstract
Description
本発明は、マイクロコントローラ、ハンドラアドレス特定方法及びプログラムに関し、特にハンドラアドレスを特定する技術に関する。 The present invention relates to a microcontroller, a handler address specifying method, and a program, and more particularly to a technique for specifying a handler address.
マイクロコントローラは、演算結果がエラーを起こした場合や周辺機器から処理要求が送られてきた場合等に、実行中のプログラムを中断してあらかじめ登録されたプログラムを呼び出す機能を持っている。これを割込という。このとき、割込要求の種類に応じて呼び出される、割込を処理及び制御するためにメモリ上に待機しているプログラムを割込ハンドラ(以下、割込ハンドラ又はハンドラ)という。従来より、マイクロコントローラに対する割込要求に応じ、実行すべきハンドラの格納アドレス(以下、ハンドラアドレス)を特定するための方式が提案されている。 The microcontroller has a function of interrupting a program being executed and calling a pre-registered program when an error occurs in a calculation result or when a processing request is sent from a peripheral device. This is called interruption. At this time, a program that is called in accordance with the type of interrupt request and is waiting on the memory for processing and controlling the interrupt is referred to as an interrupt handler (hereinafter referred to as an interrupt handler or handler). Conventionally, a method for specifying a storage address of a handler to be executed (hereinafter referred to as a handler address) in response to an interrupt request to a microcontroller has been proposed.
特許文献1は、ハンドラアドレスの特定方式として、固定ベクタ割込方式及び可変ベクタ割込方式を開示している。固定ベクタ割込方式では、複数の割込レベルに対応付けられた複数のハンドラアドレスが、レジスタIHAに格納されている。そして、発生した割込要求の割込レベルに応じ、レジスタIHAからその割込レベルに対応するハンドラアドレスを選択する。固定ベクタ割込方式は、処理時間が短く、レジスタIHAの内容を自由に設定できるため自由度が高いという特長がある。一方、可変ベクタ割込方式とは、割込が発生するとベクタ番号フェッチを行い、そのベクタ番号に基づいてベクタテーブルエントリ計算を行い、ハンドラアドレスを特定する方式である。可変ベクタ割込方式も、自由度が高いという特長がある。
特許文献1はさらに、固定ベクタ割込方式及び可変ベクタ割込方式のそれぞれの特長を補完するため、これらの方式を選択可能とした構成を開示している。具体的には、複数の割込レベル毎に、それぞれ採用すべきハンドラアドレスの特定方式を予め対応付けてレジスタIVCに格納しておき、発生した割込要求の割込レベルに応じ、レジスタIVCからその割込レベルに対応するハンドラアドレスの特定方式を選択するものである。
特許文献1記載の装置では、固定ベクタ割込方式のために、レジスタIHAが、複数の割込レベルに対応する複数のハンドラアドレスをすべて格納している。かかる構成においては、割込レベルの種類が増大するほど、レジスタIHAのサイズも増大する。また、一般にレジスタIHAに使用されるようなレジスタは、汎用のフラッシュメモリ等に比べアクセス時間が短い、換言すれば高速である半面、単位ビットあたりの面積(コスト)が高価である。そのため、レジスタの増大は、回路サイズや製造コストの増大を招くという問題がある。よって、高速かつ高い自由度という特長を維持しつつ、小サイズ、低コストを実現できるハンドラアドレスの特定手法が望まれる。
In the device described in
その他の課題と新規な特徴は、本明細書の記述及び添付図面から明らかになるであろう。 Other problems and novel features will become apparent from the description of the specification and the accompanying drawings.
一実施の形態によれば、マイクロコントローラは、複数の割込要因による割込要求に応じて割込ハンドラを実行するマイクロコントローラであって、
前記割込ハンドラの格納位置を示すアドレスであるハンドラアドレスを特定するために用いられるベースアドレスを記憶する第1の記憶手段と、前記割込ハンドラを記憶する第2の記憶手段と、
前記割込要求の入力に応じて、割込要求と、前記割込要因に予め対応付けられた制御情報を出力する割込コントローラと、
前記割込コントローラから出力された割込要求に応じて、前記割込ハンドラを取得して実行するCPUを備え、
前記CPUから前記第1の記憶手段に対するアクセス時間は、前記CPUから前記第2の記憶手段に対するアクセス時間よりも短く、かつ、
前記CPUは、
(a)前記割込コントローラから出力された割込要求に応じて、前記第1の記憶手段にアクセスして前記ベースアドレスを取得し、
(b)当該取得されたベースアドレスと、前記割込コントローラから出力された前記制御情報に基づいて、前記ハンドラアドレスを特定し、
(c)特定されたハンドラアドレスに基づいて前記第2の記憶手段にアクセスして前記割込ハンドラを実行する。
According to one embodiment, the microcontroller is a microcontroller that executes an interrupt handler in response to an interrupt request from a plurality of interrupt factors,
First storage means for storing a base address used for specifying a handler address which is an address indicating a storage position of the interrupt handler; and second storage means for storing the interrupt handler;
In response to the input of the interrupt request, an interrupt controller that outputs control information associated with the interrupt factor in advance,
In response to an interrupt request output from the interrupt controller, a CPU for acquiring and executing the interrupt handler is provided.
The access time from the CPU to the first storage means is shorter than the access time from the CPU to the second storage means, and
The CPU
(A) In response to the interrupt request output from the interrupt controller, the first storage means is accessed to obtain the base address;
(B) identifying the handler address based on the acquired base address and the control information output from the interrupt controller;
(C) Based on the specified handler address, the second storage means is accessed to execute the interrupt handler.
他の実施の形態によれば、マイクロコントローラは、複数の割込要因による割込要求に応じて割込ハンドラを実行するマイクロコントローラであって、
前記割込要求の入力に応じて、割込要求と、前記割込要因に予め対応付けられた第1又は第2の制御情報と、前記割込要因に予め対応づけられたハンドラアドレス特定方式情報とを出力する割込コントローラと、
前記割込コントローラから出力された割込要求に応じて、前記第1の割込ハンドラ又は前記第2の割込ハンドラを取得して実行するCPUと、
前記第1の割込ハンドラの格納位置を示すアドレスである第1のハンドラアドレスを特定するために用いられる第1のベースアドレスと、前記第2の割込ハンドラの格納位置を示すアドレスである第2のハンドラアドレスを特定するために用いられる第2のベースアドレスを記憶する第1の記憶手段と、
複数の前記第1の割込ハンドラのそれぞれを前記第1の制御情報によって特定される順に予め用意された固定サイズの個別領域のそれぞれに格納する第1の割込ハンドラ格納領域と、前記第2の制御情報と前記第2のハンドラアドレスとを予め対応付けたハンドラアドレステーブルを格納するテーブル記憶領域と、前記第1の割込ハンドラを格納する第1の割込ハンドラ格納領域とを有する第2の記憶手段とを備え、
前記CPUから前記第1の記憶手段に対するアクセス時間は、前記CPUから前記第2の記憶手段に対するアクセス時間よりも短く、かつ、
前記CPUは、
(A)前記ハンドラアドレス特定方式情報が直接分岐方式を示す場合には、
(a)前記割込コントローラから出力された割込要求に応じて、前記第1の記憶手段にアクセスして前記第1のベースアドレスを取得し、
(b−2)前記第1のベースアドレスに基づいて、前記第1の制御情報によって特定される順と、前記第1のハンドラ格納領域において前記割込ハンドラのそれぞれを格納する個別領域の固定サイズから前記第1のハンドラアドレスを特定し、
(c)特定された第1のハンドラアドレスに基づいて前記第2の記憶手段にアクセスして前記第1の割込ハンドラを実行する、
(B)前記ハンドラアドレス特定方式情報がテーブル参照方式を示す場合には、
(a)前記割込コントローラから出力された割込要求に応じて、前記第1の記憶手段にアクセスして前記第2のベースアドレスを取得し、
(b−1)前記第2のベースアドレスに基づいて前記ハンドラアドレステーブルを参照し、当該ハンドラアドレステーブルにおいて前記割込コントローラから出力された前記第2の制御情報と対応づけられた前記第2のハンドラアドレスを特定し、
(c)特定された第2のハンドラアドレスに基づいて前記第2の記憶手段にアクセスして前記第2の割込ハンドラを実行する。
According to another embodiment, the microcontroller is a microcontroller that executes an interrupt handler in response to an interrupt request from a plurality of interrupt factors,
In response to the input of the interrupt request, the interrupt request, the first or second control information associated in advance with the interrupt factor, and the handler address specifying method information associated in advance with the interrupt factor An interrupt controller that outputs
CPU that acquires and executes the first interrupt handler or the second interrupt handler in response to an interrupt request output from the interrupt controller;
A first base address used to specify a first handler address which is an address indicating a storage location of the first interrupt handler, and an address indicating a storage location of the second interrupt handler. First storage means for storing a second base address used to identify the two handler addresses;
A first interrupt handler storage area for storing each of the plurality of first interrupt handlers in a fixed-size individual area prepared in advance in the order specified by the first control information; A table storage area that stores a handler address table that associates the control information with the second handler address in advance, and a first interrupt handler storage area that stores the first interrupt handler. Storage means,
The access time from the CPU to the first storage means is shorter than the access time from the CPU to the second storage means, and
The CPU
(A) When the handler address specifying method information indicates a direct branch method,
(A) In response to the interrupt request output from the interrupt controller, the first storage means is accessed to obtain the first base address,
(B-2) Based on the first base address, the order specified by the first control information, and the fixed size of the individual area for storing each of the interrupt handlers in the first handler storage area Identifying the first handler address from
(C) accessing the second storage means based on the identified first handler address to execute the first interrupt handler;
(B) When the handler address specifying method information indicates a table reference method,
(A) In response to the interrupt request output from the interrupt controller, the first storage means is accessed to obtain the second base address;
(B-1) Refers to the handler address table based on the second base address, and the second address associated with the second control information output from the interrupt controller in the handler address table. Identify the handler address,
(C) Based on the specified second handler address, the second storage means is accessed to execute the second interrupt handler.
他の実施の形態によれば、ハンドラアドレス特定方法は、CPUが、
割込コントローラから割込要因に対応する制御情報を入力するステップと、
第1の記憶手段からベースアドレスを取得するステップと、
前記ベースアドレス及び前記制御情報に基づいて、第2の記憶手段におけるハンドラの格納位置であるハンドラアドレスを特定するステップと、を有し、
前記CPUから前記第1の記憶手段に対するアクセス時間は、前記CPUから前記第2の記憶手段に対するアクセス時間よりも短い。
According to another embodiment, the handler address specifying method is performed by the CPU:
A step of inputting control information corresponding to the interrupt factor from the interrupt controller;
Obtaining a base address from the first storage means;
Identifying a handler address which is a storage location of the handler in the second storage means based on the base address and the control information,
The access time from the CPU to the first storage means is shorter than the access time from the CPU to the second storage means.
他の実施の形態によれば、ハンドラアドレス特定方法は、CPUが、
割込コントローラから、割込要因に対応する第1又は第2の制御情報と、前記割込要因に対応するハンドラアドレス特定方式情報とを入力するステップと、
(A)前記ハンドラアドレス特定方式情報が直接分岐方式を示す場合、
第1の記憶手段から第1のベースアドレスを取得するステップと、
前記第1のベースアドレス及び前記第1の制御情報に基づいて、第2の記憶手段における第1のハンドラ格納領域から第1のハンドラの格納位置である第1のハンドラアドレスを特定するステップと、
(B)前記ハンドラアドレス特定方式情報がテーブル参照方式を示す場合、
第1の記憶手段から第2のベースアドレスを取得するステップと、
前記第2のベースアドレス及び前記第2の制御情報に基づいて、ハンドラアドレステーブルから第2のハンドラアドレスを特定するステップと、を有し、
前記第1のハンドラ格納領域は、前記第1のハンドラをそれぞれ格納するための固定サイズの個別領域に前記第1の制御情報に基づく順序で格納し、
前記第1のベースアドレスは、前記第2の記憶手段における前記第1のハンドラ格納領域の格納位置を示すアドレスであり、
前記ハンドラアドレステーブルは、前記第2の制御情報と前記第2のハンドラアドレスとを予め対応付けたテーブルであり、
前記第2のベースアドレスは、前記第2の記憶手段におけるハンドラアドレステーブルの格納位置を示すアドレスであり、
前記CPUから前記第1の記憶手段に対するアクセス時間は、前記CPUから前記第2の記憶手段に対するアクセス時間よりも短い。
According to another embodiment, the handler address specifying method is performed by the CPU:
Inputting from the interrupt controller the first or second control information corresponding to the interrupt factor and the handler address specifying method information corresponding to the interrupt factor;
(A) When the handler address specifying method information indicates a direct branch method,
Obtaining a first base address from a first storage means;
Identifying a first handler address that is a storage location of the first handler from a first handler storage area in a second storage means based on the first base address and the first control information;
(B) When the handler address specifying method information indicates a table reference method,
Obtaining a second base address from the first storage means;
Identifying a second handler address from a handler address table based on the second base address and the second control information,
The first handler storage area is stored in an order based on the first control information in a fixed-size individual area for storing the first handler,
The first base address is an address indicating a storage position of the first handler storage area in the second storage means,
The handler address table is a table in which the second control information and the second handler address are associated with each other in advance.
The second base address is an address indicating a storage position of a handler address table in the second storage means,
The access time from the CPU to the first storage means is shorter than the access time from the CPU to the second storage means.
他の実施の形態によれば、プログラムは、コンピュータに、上述のいずれか1つの方法を実行させるものである。 According to another embodiment, the program causes a computer to execute any one of the methods described above.
本発明により、高い自由度かつ低コストでハンドラを配置できるとともに、高速にハンドラアドレスを特定できるマイクロコントローラ、ハンドラアドレス特定方法及びプログラムを提供することができる。 According to the present invention, it is possible to provide a microcontroller, a handler address specifying method, and a program capable of specifying a handler address at high speed while arranging handlers with high flexibility and low cost.
以下、本発明を適用した具体的な実施の形態について、図面を参照しながら詳細に説明する。 Hereinafter, specific embodiments to which the present invention is applied will be described in detail with reference to the drawings.
<実施の形態1>
本実施の形態では、上述の固定ベクタ割当方式に比べ低コストであるテーブル参照方式と、テーブル参照方式に比べより高速な割込応答が可能である直接分岐方式と、の2つのハンドラアドレス特定方式を開示する。
<
In the present embodiment, there are two handler address specifying methods: a table reference method that is lower in cost than the above-described fixed vector allocation method, and a direct branch method that enables a faster interrupt response than the table reference method. Is disclosed.
はじめに、テーブル参照方式の概要について説明する。テーブル参照方式では、ハンドラアドレステーブルベースレジスタ(HTBASE)がハンドラアドレステーブルの先頭アドレスを格納し、ハンドラアドレステーブルが、複数の割込要因に対応する複数のハンドラアドレスを格納する。そして、割込要求の発生に応じ、CPUが、レジスタHTBASEからハンドラアドレステーブルの先頭アドレスを取得し、ハンドラアドレステーブルから、その割込要求の割込要因に対応するハンドラアドレスを選択する。 First, an outline of the table reference method will be described. In the table reference method, the handler address table base register (HTBASE) stores the top address of the handler address table, and the handler address table stores a plurality of handler addresses corresponding to a plurality of interrupt factors. Then, in response to the generation of the interrupt request, the CPU acquires the head address of the handler address table from the register HTBASE, and selects the handler address corresponding to the interrupt factor of the interrupt request from the handler address table.
テーブル参照方式では、ハンドラアドレステーブルを、レジスタに比べ低速であるが単位ビット当たりの面積(コスト)が安価である汎用のフラッシュメモリ等に格納することが可能である。したがって、テーブル参照方式は、特許文献1記載の固定ベクタ割込方式においてレジスタIHAに要していたコストを削減することができる。
In the table reference method, the handler address table can be stored in a general-purpose flash memory or the like that is slower than a register but has a lower area (cost) per unit bit. Therefore, the table reference method can reduce the cost required for the register IHA in the fixed vector interrupt method described in
本実施の形態は、このような構成により、高速かつ高い自由度という特長を維持しつつ、小サイズ、低コストでのハンドラアドレスの特定を実現する。 With this configuration, the present embodiment realizes specification of a handler address with a small size and low cost while maintaining the features of high speed and high flexibility.
一方、より高速な割込応答性への要求も存在する。よって、本実施の形態では、この更なる要求に応えるため、直接分岐方式によるハンドラアドレスの特定もサポートした。直接分岐方式によれば、テーブル参照方式よりも高速な割込応答を実現できる。 On the other hand, there is a demand for faster interrupt responsiveness. Therefore, in this embodiment, in order to respond to this further request, the identification of the handler address by the direct branch method is also supported. According to the direct branch method, it is possible to realize an interrupt response faster than the table reference method.
直接分岐方式の概要について説明する。直接分岐方式では、ハンドラアドレスベースレジスタ(HABASE)がベースアドレスを格納する。また、メモリ(汎用のフラッシュメモリ等)が、複数の割込レベル(例えば優先度)に対応する複数のハンドラを、ベースアドレスを先頭に優先度順に格納する。ここで、各ハンドラの格納領域のサイズは一律に固定される。そのため、ベースアドレスと優先度とに基づき、その優先度に対応するハンドラの格納領域のアドレス(ハンドラアドレス)が一意に特定される。割込要求が発生すると、CPUは、レジスタHABASEからベースアドレスを取得し、ベースアドレスとその割込要求の優先度とから、ハンドラアドレスを特定する。 An outline of the direct branching method will be described. In the direct branch method, the handler address base register (HABASE) stores the base address. In addition, a memory (such as a general-purpose flash memory) stores a plurality of handlers corresponding to a plurality of interrupt levels (for example, priority) in order of priority starting from the base address. Here, the size of the storage area of each handler is fixed uniformly. Therefore, based on the base address and the priority, the address (handler address) of the storage area of the handler corresponding to the priority is uniquely specified. When an interrupt request is generated, the CPU acquires a base address from the register HABASE, and specifies a handler address from the base address and the priority of the interrupt request.
直接分岐方式は、ハンドラアドレステーブルを参照するステップを要しないため、テーブル参照方式に比べ高速である。但し、直接分岐方式では、ハンドラの格納領域のサイズが固定されるという制約が生ずる。 The direct branch method is faster than the table reference method because it does not require a step of referring to the handler address table. However, the direct branching method has a restriction that the size of the storage area of the handler is fixed.
図1を用いて、上述の特徴を備えたマイクロコントローラ100の構成について説明する。
The configuration of the
本実施の形態にかかるマイクロコントローラ100は、少なくとも割込コントローラ200、CPU300、ハンドラ記憶手段401、ベースアドレス記憶手段402を含む。
The
ハンドラ記憶手段401は、第2の記憶手段として割込ハンドラを格納する記憶手段である。ハンドラ記憶手段401における割込ハンドラの格納アドレスをハンドラアドレスという。ハンドラ記憶手段401としては、例えば汎用のフラッシュメモリを用いることができる。
The
ベースアドレス記憶手段402は、第1の記憶手段として、ベースアドレスを格納する記憶手段である。ベースアドレス記憶手段402としては、例えばレジスタを用いることができる。CPU300から第1の記憶手段であるベースアドレス記憶手段402に対するアクセス時間は、CPU300から第2の記憶手段であるハンドラ記憶手段401に対するアクセス時間よりも短い。ここで、ベースアドレスとは、ハンドラアドレスを特定するための演算の基準、即ちハンドラアドレスを特定するために用いられるアドレスである。
The base
割込コントローラ200は、複数の割込要因による割込要求の入力に応じ、割込要因毎に予め対応付けられた制御情報をCPU300に対して出力する。
The interrupt
CPU300は、割込コントローラ200が出力する制御情報と、ベースアドレス記憶手段402に格納されているベースアドレスと、をパラメタとする所定の演算によってハンドラアドレスを特定する。
The
例えば、テーブル参照方式によりハンドラアドレスを特定する場合は、以下の演算を行うことによりハンドラアドレスを特定できる。 For example, when the handler address is specified by the table reference method, the handler address can be specified by performing the following calculation.
前提として、マイクロコントローラ100は、制御情報とハンドラアドレスとを予め対応付けたハンドラアドレステーブルを格納している、テーブル記憶手段をさらに有しているものとする。また、ベースアドレスは、テーブル記憶手段におけるハンドラアドレステーブルの格納アドレスを示しているものとする。このとき、CPU300は、テーブル記憶手段のベースアドレスに格納されているハンドラアドレステーブルから、制御情報をキーとして目的のハンドラアドレスを取得する。その後、CPU300は、ハンドラ記憶手段401のハンドラアドレスからハンドラを取得し、割込処理を実行することができる。
As a premise, the
また、直接分岐方式によりハンドラアドレスを特定する場合は、以下の演算を行うことによりハンドラアドレスを特定できる。 When the handler address is specified by the direct branch method, the handler address can be specified by performing the following calculation.
前提として、ハンドラ記憶手段401は、ハンドラをそれぞれ格納するための固定長の領域を、制御情報に基づく順序で格納したハンドラ格納領域を有しているものとする。また、ベースアドレスは、ハンドラ記憶手段401におけるハンドラ格納領域の先頭アドレスを示しているものとする。このとき、CPU300は、ハンドラ記憶手段401のベースアドレスと、上述の固定長と、制御情報に基づく順序のルールとに基づき、ハンドラアドレスを特定する。その後、CPU300は、ハンドラ記憶手段401のハンドラアドレスからハンドラを取得し、割込処理を実行することができる。
As a premise, it is assumed that the
また、本実施の形態では、これらの2つのハンドラアドレス特定方式それぞれの特長を補完するため、条件に応じてこれらの方式を選択するための構成も開示する。これにより、小サイズ、低コストを前提としつつ、高速性と自由度とのバランスを兼ね備えたハンドラアドレス特定手法を実現できる。 In the present embodiment, in order to complement the features of each of these two handler address specifying methods, a configuration for selecting these methods according to conditions is also disclosed. As a result, it is possible to realize a handler address specifying method that has a balance between high speed and flexibility while assuming a small size and low cost.
図2を用いて、2つのハンドラアドレス特定方式を選択可能なマイクロコントローラ100の構成について説明する。
A configuration of the
割込コントローラ200は、マイクロコントローラ100の内部の周辺機能101からの割込要求、及びマイクロコントローラ100の外部からの割込要求の入力を受け付け、CPU300に割込処理に必要な情報を出力する。割込コントローラ200は、例えば、割込要因に応じたハンドラアドレスの特定方式を選択し、その選択の結果をハンドラアドレス特定方式情報としてCPU300に出力することが可能である。外部からの割込要求の中には、例えば、自動車の衝突センサ502からの割込要求のように、CPU300が高速に応答してエアバッグを膨らませる処理を行う必要があるものもあれば、温度センサ501からの割込要求のように、それほど高速な応答が必要でないものもある。衝突センサ502のように、高速な応答性が求められる割込要因による割込要求の場合は、ハンドラアドレスの特定方式として、直接分岐方式が適している。また、温度センサ501のように、それほど高速な応答が必要でない割込要因による割込要求の場合は、ハンドラアドレスの特定方式として、メモリの利用効率を高められるテーブル参照方式が適している。
The interrupt
ハンドラ記憶手段401としてのメモリ4010は、プログラム格納領域としてのフラッシュメモリである。CPU300の動作速度がメモリ4010の動作速度よりも大きい場合には、その速度差によるCPU300の処理性能低下を防ぐため、メモリ4010とCPU300との間にキャッシュ104を設けることが多い。
A
図2のようにメモリ4010がマイクロコントローラ100の内部に搭載される場合、割込ハンドラ(直接分岐方式によって特定される割込ハンドラ(第1の割込ハンドラ)及びテーブル参照方式によって特定される割込ハンドラ(第2の割込ハンドラ)を含む)及びテーブル参照方式において用いられるハンドラアドレステーブルをメモリ4010に格納することが好適である。本実施の形態では、第1の割込ハンドラ、第2の割込ハンドラ及びハンドラアドレステーブルがメモリ4010に格納されている形態を例として説明する。なお、第1の割込ハンドラ、第2の割込ハンドラ、及びハンドラアドレステーブルは、必ずしも物理的に同一のメモリ4010に格納する必要はない。例えば、第1の割込ハンドラ、第2の割込ハンドラ、及びハンドラアドレステーブルを、1つのアドレス空間を構成する複数の物理的な記憶装置に分散して格納しても良い。あるいは、これらをそれぞれ異なるアドレス空間に格納することもできる。具体的には、第1の割込ハンドラ又は第2の割込ハンドラのいずれか一方をメモリ4010に格納し、他方をRAM105、外部メモリ503又は図示しない他の記憶手段に格納しても良い。
When the
CPU300は、メモリ4010に格納されたプログラムに従って所定の処理を実行する。CPU300は、命令フェッチユニット302及びキャッシュ104を介して、メモリ4010に格納されている命令コードを読み出す。CPU300が必要とする命令コードが既にキャッシュ104に格納されている場合は、メモリ4010に対するアクセスは行われず、キャッシュ104から直ちに命令フェッチユニット302に命令コードが送られる。
なお、プログラムは、マイクロコントローラ100の内部にあるRAM105又はマイクロコントローラ100の外部にある外部メモリ503に格納することもできる。RAM105に命令コードが格納されている場合、CPU300は、命令フェッチユニット302、キャッシュ104、CPUバス103、ロードストアユニット303を介して命令コードを読み出す。また、外部メモリ503に命令コードが格納されている場合、CPU300は、命令フェッチユニット302、キャッシュ104、CPUバス103、外部メモリキャッシュ106、外部メモリコントローラ107を介して命令コードを読み出す。
The program may be stored in the
CPU300が、割込コントローラ200から、直接分岐方式が選択された割込要因からの割込要求を受け付けた場合、まず実行ユニット301が、ベースアドレス記憶手段402としてのハンドラアドレスベースレジスタ(HABASE)4020にアクセスし、第1のベースアドレスを取得する。そして、実行ユニット301は、取得した第1のベースアドレスと、割込コントローラ200から受け付けた第1の制御情報、典型的には優先度を用いて、ハンドラアドレスを計算する。ハンドラアドレスの計算方法については後に詳述する。CPU300は、こうして得られたハンドラアドレスから、上述の手順により、ハンドラの命令コードの読み出しを行う。
When the
CPU300が、割込コントローラ200から、テーブル参照方式が選択された割込要因からの割込要求を受け付けた場合、まず実行ユニット301が、ベースアドレス記憶手段402としてのハンドラアドレステーブルベースレジスタ(HTBASE)4030にアクセスし、第2のベースアドレスを取得する。そして、実行ユニット301は、取得した第2のベースアドレスと、割込コントローラ200から受け付けた第2の制御情報、典型的には割込要因の識別子、例えば要因番号を用いて、ハンドラアドレスの格納アドレスを計算する。ハンドラアドレスの格納アドレスについては後に詳述する。
次いで、CPU300は、ハンドラアドレスの格納アドレスを、ロードストアユニット303からCPUバス103に出力する。ハンドラアドレスの格納アドレスがメモリ4010内のアドレスであれば、CPU300は、メモリ4010の上記格納アドレスからからハンドラアドレスを読み出す。すなわち、CPU300は、ロードストアユニット303、CPUバス103、キャッシュ104を介して、メモリ4010からハンドラアドレスを読み出す。CPU300が必要とするハンドラアドレスが既にキャッシュ104に格納されている場合は、メモリ4010へのアクセスは行われず、キャッシュ104から直ちにCPUバス103を経由してロードストアユニット303にハンドラアドレスが送られる。こうして得られたハンドラアドレスからの命令コードの読み出しは、上述した手順により行われる。
When the
Next, the
ベースアドレス記憶手段402としてのハンドラアドレスベースレジスタ(HABASE)4020は、第1のベースアドレスとしての、直接分岐方式のハンドラの開始アドレス(ベースアドレス)を設定するレジスタである。第2のレジスタとしてのハンドラアドレステーブルベースレジスタ(HTBASE)4030は、第2のベースアドレスとしての、テーブル参照方式のハンドラアドレステーブルの開始アドレス(ベースアドレス)を設定するレジスタである。HABASE4020及びHTBASE4030は、CPU300の内部又は外部のいずれに設けても良いが、CPU300が可能な限り高速に、すなわち短いアクセス時間でアクセスできるよう、CPU300の近傍に設けることが望ましい。
A handler address base register (HABASE) 4020 as the base
なお、HABASE4020及びHTBASE4030に格納するベースアドレスを適切に設定することで、第1の割込ハンドラ、第2の割込ハンドラ及びハンドラアドレステーブルを、メモリ4010のみならず、マイクロコントローラ100の内部にあるRAM105、マイクロコントローラ100の外部にある外部メモリ503又は図示しない他の記憶手段に格納することも可能である。例えば、ハンドラアドレステーブルをロードストアユニット303に直結したRAM105に格納すれば、ハンドラアドレスの読み出しを高速に行えるようになり、テーブル参照方式が選択された割込要因の割込要求に対する応答性能を高めることが可能である。
By appropriately setting the base addresses stored in the
図3を用いて、割込コントローラ200の具体的な実装例を示す。
A specific implementation example of the interrupt
割込コントローラ200は、マイクロコントローラ100の内部にある周辺機能や、マイクロコントローラ100の外部からの割込要求0乃至nの入力を受け付ける。割込要求0乃至nは、それぞれ割込要因0乃至nに対応しており、それぞれ独立の信号線を介して要求検出部201に入力される。
The interrupt
要求検出部201は、上述の割込要求の入力を検出する。割込要求の検出結果は、割込要因0乃至n毎に要求フラグ202に格納される。また、要求フラグ202の内容は要求マスク部203に送られる。
The
要求マスク部203は、割込要因0乃至n毎に設けられた割込制御レジスタ206から入力される要求マスク0乃至nに従って、割込要求をマスクするか否か、すなわちCPU300への割込を禁止するか又は許可するかを決定し、マスクしない場合、割込要求を優先度判定部204に送る。
The
優先度判定部204は、要求マスク部203から入力される割込要求と、割込制御レジスタ206から入力される、割込要因0乃至n毎に設定された優先度0乃至nとに基づいて、最高優先度の割込要因を選択する。優先度判定部204は、選択された最高優先度の割込要因の要因番号及び優先度を、割込要求生成部205へ送る。
The
割込要求生成部205は、優先度判定部204から入力される最高優先度の割込要因の要因番号、優先度、及び割込制御レジスタ206から入力される割込要因毎に設定されたハンドラアドレス特定方式情報0乃至nに基づいて、CPU300に対し、割込要求とともに、CPU300がハンドラアドレスを特定するのに必要な情報である、第1の制御情報としての優先度、第2の制御情報としての要因番号、及びハンドラアドレス特定方式情報を出力する。ここで、ハンドラアドレス特定方式情報とは、ハンドラアドレスの特定方式、すなわち、直接分岐方式又はテーブル参照方式のいずれの方式によりハンドラアドレスを特定すべきかを示す情報である。なお、割込要求生成部205は、ハンドラアドレス特定方式情報が直接分岐方式である場合には第1の制御情報とハンドラアドレス特定方式情報のみを、テーブル参照方式である場合は第2の制御情報とハンドラアドレス特定方式情報のみをCPU300に出力することとしても良い。
The interrupt
CPU300は、割込コントローラ200から割込要求を受け付けると、割込応答と受け付けた割込要求の要因番号とを割込コントローラ200に通知する。
When receiving an interrupt request from the interrupt
割込コントローラ200の内部にある割込応答入力部207は、CPU300から通知される割込応答と要因番号との入力を受け付け、要因番号に対応する要求フラグクリア信号を要求フラグ202へ出力し、要因番号に対応する割込要因の要求フラグ202をクリアする。
An interrupt
周辺バスインタフェース208は、周辺バスから割込制御レジスタ206へのアクセス要求を受け付け、割込制御レジスタ206に値を設定したり、割込制御レジスタ206から値を読み出したりするための制御を行う。
The
図4を用いて、割込制御レジスタ206の具体例について説明する。 A specific example of the interrupt control register 206 will be described with reference to FIG.
割込制御レジスタ206は、割込要因0乃至nに対応してそれぞれ設けられる。割込制御レジスタ206は、対応する割込要因からの割込要求をマスクするか否かを設定するビット(EIMK)、対応する割込要因からの割込要求をCPU300が受け付けた際のハンドラアドレス特定方式情報を設定するビット(EITB)、対応する割込要因の優先度を設定するビット(EIP3−EIP0)を含む。
Interrupt control registers 206 are provided corresponding to interrupt
図5を用いて、HABASE4020、HTBASE4030の具体例について説明する。 Specific examples of HABASE4020 and HTBASE4030 will be described with reference to FIG.
ハンドラアドレスベースレジスタ(HABASE)4020は、直接分岐方式の割込ハンドラの開始アドレス(ベースアドレス)を設定するレジスタである。直接分岐方式の割込ハンドラ(第1の割込ハンドラ)は、このレジスタに設定されたアドレスを先頭に、優先度順に配置される。 A handler address base register (HABASE) 4020 is a register for setting a start address (base address) of a direct branch type interrupt handler. The direct branch type interrupt handler (first interrupt handler) is arranged in order of priority starting at the address set in this register.
ハンドラアドレステーブルベースレジスタ(HTBASE)4030は、テーブル参照方式のハンドラアドレステーブルの開始アドレス(ベースアドレス)を設定するレジスタである。テーブル参照方式のハンドラアドレスは、このレジスタに設定されたアドレスを先頭に、割込要因の要因番号順に配置される。 The handler address table base register (HTBASE) 4030 is a register for setting the start address (base address) of the handler address table of the table reference method. The table reference type handler addresses are arranged in the order of the interrupt cause factor numbers, starting with the address set in this register.
つづいて、図6を用いて、マイクロコントローラ100が割込要求を受け付けた際にCPU300が実行する処理について説明する。
Next, a process executed by the
S101:CPU300は、割込コントローラ200から割込要求信号とともに、ハンドラアドレスを特定するための情報として、第1の制御情報としての優先度及び第2の制御情報としての割込の要因番号のうち少なくともいずれか一方と、ハンドラアドレス特定方式情報との入力を受け付ける。
S101: The
このとき、CPU300は、割込コントローラ200に対し、割込応答と受け付けた割込の要因番号を出力することができる。これにより、割込コントローラ200は、当該要因番号に係る割込要求がCPU300によって受け付けられたことを認識できる。割込コントローラ200の内部にある割込応答入力部207は、当該要因番号に対応する割込要因の要求フラグ202をクリアして、当該要因番号に係る割込要求の受け付け待ち状態を解消する。
At this time, the
S102:割込コントローラ200から入力されたハンドラアドレス特定方式情報が直接分岐方式を示す情報である場合、CPU300は、ハンドラアドレスベースレジスタ(HABASE)4020の値を取得する。
S102: When the handler address specifying method information input from the interrupt
S103:一方、割込コントローラ200から入力されたハンドラアドレス特定方式情報がテーブル参照方式を示す情報である場合、CPU300は、ハンドラアドレステーブルベースレジスタ(HTBASE)4030の値を取得する。
S103: On the other hand, when the handler address specifying method information input from the interrupt
S104:ハンドラアドレス特定方式情報が直接分岐方式を示す情報である場合、CPU300は、S101において入力された第1の制御情報としての優先度と、S102において取得したHABASEの値とに基づいて、ハンドラアドレスを特定する。具体的には、数1の計算を行ってハンドラアドレスを特定する。数1において、ハンドラサイズは所定の固定値(例えば16バイト)である。
(数1)ハンドラアドレス = HABASEに格納されたベースアドレス + 優先度 × ハンドラサイズ
S104: When the handler address specifying method information is information indicating the direct branch method, the
(Expression 1) Handler address = Base address stored in HABASE + Priority x Handler size
S105:ハンドラアドレス特定方式情報がテーブル参照方式を示す情報である場合、CPU300は、まず、S101において入力された第2の制御情報としての要因番号と、S103において取得したHTBASEの値とに基づいて、ハンドラアドレスの格納アドレスを特定する。具体的には、数2の計算を行ってハンドラアドレスの格納アドレス、すなわちハンドラアドレスが格納されているテーブルのアドレスを特定する。数2において、アドレスサイズは所定の固定値(例えば4バイト)である。
(数2)ハンドラアドレスの格納アドレス = HTBASEに格納されたベースアドレス + 要因番号 × アドレスサイズ
S105: When the handler address specifying method information is information indicating the table reference method, the
(Equation 2) Handler address storage address = Base address stored in HTBASE + Reason number × Address size
S106:CPU300は、数2により計算したハンドラアドレスの格納アドレスからデータを読み出し、読み出されたデータをハンドラアドレスとする。
S106: The
S107:CPU300は、ハンドラアドレスへ分岐する。すなわち、直接分岐方式又はテーブル参照方式のいずれかのハンドラアドレスの特定方式により特定したハンドラアドレスに格納された割込ハンドラの命令コードを読み出し、その命令コードに従い処理を行う。
S107: The
図7に、メモリ4010における、割込ハンドラ(第1の割込ハンドラ及び第2の割込ハンドラ)のアドレス空間上の配置イメージを示す。
FIG. 7 shows an arrangement image on the address space of the interrupt handlers (first interrupt handler and second interrupt handler) in the
直接分岐方式の割込ハンドラ(第1の割込ハンドラ)602は、ハンドラアドレスベースレジスタ(HABASE)4020に設定されたベースアドレス601から優先度順に配置される。各ハンドラの格納領域のサイズ、すなわちハンドラサイズは固定である(例えば16バイト)。例えば、優先度として0乃至15が設定可能である場合、ベースアドレス601を基点として、優先度0乃至15に対応するハンドラINTPR0乃至INTPR15が、それぞれ16バイトのハンドラサイズの領域に格納されて、優先度順に配置される。
The direct branch type interrupt handler (first interrupt handler) 602 is arranged in order of priority from the
テーブル参照方式のハンドラアドレスは、ハンドラアドレステーブルベースレジスタ(HTBASE)4030に設定されたベースアドレス603から要因番号順に配置される。これらのハンドラアドレスを格納する領域をハンドラアドレステーブル604と呼ぶ。各ハンドラアドレスの格納領域のサイズ、すなわちアドレスサイズは固定である(例えば4バイト)。例えば、要因番号として0乃至nが存在する場合、ベースアドレス603を基点として、要因番号0乃至nに対応するハンドラアドレスINT0乃至INTnが、それぞれ4バイトのアドレスサイズの領域に格納されて、要因番号順に配置される。
The handler address of the table reference method is arranged in the order of the factor number from the
テーブル参照方式では、各要因番号に対応する割込ハンドラ(第2の割込ハンドラ)の配置アドレス及びサイズは任意である(605)。 In the table reference method, the arrangement address and size of the interrupt handler (second interrupt handler) corresponding to each factor number are arbitrary (605).
図8に、割込発生時の割込コントローラ200とCPU300間との信号のタイミングチャートを示す。
FIG. 8 shows a timing chart of signals between the interrupt
時刻t2:割込要因1の割込要求(req1)がアサートされる。
Time t2: Interrupt request 1 (req1) of interrupt
時刻t3〜t5:req1のアサートを受け、要求フラグ1がセットされる。割込コントローラ200は、CPU300へ割込要求(intreq)とともに、要因番号(intnum[N:0])、優先度(intpri[3:0])、ハンドラアドレス特定方式情報(inteitb)を出力する。このとき、割込要因1に対応する割込制御レジスタ1の設定値は以下のようになっており、この設定値に従って割込コントローラ200からCPU300へ信号が出力される。
EITB = 1:テーブル参照方式を選択
EIP3−EIP0 = 5:優先度5
From time t3 to t5: req1 is asserted, and the
EITB = 1: Select table reference method EIP3-EIP0 = 5:
なお、この期間は、CPU300が、割込応答(intack)と要因番号(intacknum[N:0])を割込コントローラ200に通知していないことからわかるように、CPU300が優先度5よりも高い優先度の割り込みを処理中であるなどの何らかの理由により、この割り込みはCPU300に受け付けられていない。
Note that during this period, the
時刻t5:割込要因3の割込要求(req3)がアサートされる。
Time t5: The interrupt request (req3) for interrupt
時刻t6〜t8:req3のアサートを受け、要求フラグ3がセットされる。割込要因3の優先度は、割込要因1の優先度よりも高いため、割込コントローラ200がCPU300へ通知する情報が、要因1のものから要因3のものに切り替わる。要因3に対応する割込制御レジスタ3の設定値は以下のようになっており、この設定値に従って割込コントローラ200からCPU300へ信号が出力される。
EITB = 0:優先度に基づいた直接分岐方式を選択
EIP3−EIP0 = 2:優先度2
Time t6 to t8:
EITB = 0: Select a direct branching method based on priority EIP3-EIP0 = 2:
時刻t8:CPU300が要因3の割込要求を受け付け、割込応答(intack)と要因番号(intacknum[N:0])を割込コントローラ200に通知する。
Time t8: The
時刻t9:割込コントローラ200がCPU300から割込応答(intack)を受け取り、要因3に対応する要求フラグ3をクリアすると同時に割込要求(intreq)を取り下げる。
Time t9: The interrupt
時刻t10〜t12:要求フラグ1はセットされたままであるため、割込コントローラ200は再びCPU300へ割込要求(intreq)とともに要因1の情報(要因番号、優先度、ハンドラアドレス特定方式情報)を通知する。
Time t10 to t12: Since the
本実施の形態においては、割込コントローラ200の外部のメモリ4010にハンドラやハンドラアドレステーブルを格納することとしたため、ハンドラやハンドラアドレステーブルを自由に配置することが可能であり、割込要因の数が増大したとしても、低コストで割込要因に対応するハンドラを設けることができる。
In this embodiment, since the handlers and handler address tables are stored in the
また、本実施の形態においては、メモリ4010よりアクセス時間が短いHABASE4020、HTBASE4030にベースアドレスを格納することにより、CPU300はハンドラアドレス又はハンドラアドレスの格納アドレスを高速に計算することができる。
In this embodiment, the
<実施の形態2>
実施の形態1の直接分岐方式では、割込要因に応じて設定された優先度に基づいてハンドラアドレスを特定する。そのため、直接分岐方式でハンドラアドレスを特定できる割込ハンドラ(第1の割込ハンドラ)の数は、優先度の数以下に制限される。また、複数の割込要因を同一の優先度に設定し、かつ、これらの複数の要因のハンドラアドレスの特定方法を直接分岐方式とした場合、これらの複数の割込要因の割込ハンドラは同一となるので、割込ハンドラ内で割込要因を判別する処理を行う必要が生じ、直接分岐方式の利点である高速な割込応答性を損なってしまう。
<
In the direct branching method of the first embodiment, the handler address is specified based on the priority set according to the interrupt factor. Therefore, the number of interrupt handlers (first interrupt handlers) that can specify the handler address by the direct branching method is limited to the number of priorities or less. Also, when multiple interrupt sources are set to the same priority and the method for specifying the handler addresses of these multiple sources is the direct branch method, the interrupt handlers for these multiple interrupt sources are the same Therefore, it becomes necessary to perform processing for determining the interrupt factor in the interrupt handler, and the high-speed interrupt responsiveness that is an advantage of the direct branching method is impaired.
そこで、本発明の実施の形態2においては、割込制御レジスタ206に、直接分岐方式を選択した場合のハンドラ番号を指定するビットをさらに設ける。これにより、割込要因に設定した優先度とは独立に、直接分岐方式のハンドラアドレスを特定することができ、実施の形態1における上述の問題点を解決することができる。 Therefore, in the second embodiment of the present invention, the interrupt control register 206 is further provided with a bit for designating a handler number when the direct branching method is selected. Thereby, the handler address of the direct branching method can be specified independently of the priority set as the interrupt factor, and the above-described problems in the first embodiment can be solved.
本発明の実施の形態2にかかるマイクロコントローラ100の構成について説明する。
A configuration of the
実施の形態2のマイクロコントローラ100は、割込コントローラ200内の割込制御レジスタ206の構成に特徴を有する。その余の構成については、実施の形態1と同様である。
The
図9を用いて、本実施の形態における割込制御レジスタ206の構成について説明する。 The configuration of the interrupt control register 206 in this embodiment will be described with reference to FIG.
割込制御レジスタ206は、割込要因0乃至n毎に設けられる。割込制御レジスタ206は、ハンドラアドレス特定方式情報が直接分岐方式に設定された場合の、ハンドラ番号を指定するビット(HN5−HN0)を含む。なお、本実施の形態における上記ビット数は一例であり、これに限定されるものではない。
The interrupt control register 206 is provided for each interrupt
図10を用いて、本実施の形態におけるマイクロコントローラ100が割込要求を受け付けた際にCPU300が実行する処理について説明する。
A process executed by the
S201:CPU300は、割込コントローラ200から割込要求信号とともに、ハンドラアドレスを特定するための情報として、第1の制御情報としてのハンドラ番号及び第2の制御情報としての割込の要因番号のうち少なくともいずれか一方と、ハンドラアドレス特定方式情報との入力を受け付ける。
S201: The
このとき、CPU300は、割込コントローラ200に対し、割込応答と受け付けた割込の要因番号を出力することができる。
At this time, the
S102:割込コントローラ200から入力されたハンドラアドレス特定方式情報が直接分岐方式を示す情報である場合、CPU300は、ハンドラアドレスベースレジスタ(HABASE)4020の値を取得する。
S102: When the handler address specifying method information input from the interrupt
S103:一方、割込コントローラ200から入力されたハンドラアドレス特定方式情報がテーブル参照方式を示す情報である場合、CPU300は、ハンドラアドレステーブルベースレジスタ(HTBASE)4030の値を取得する。
S103: On the other hand, when the handler address specifying method information input from the interrupt
S204:ハンドラアドレス特定方式情報が直接分岐方式を示す情報である場合、CPU300は、S201において入力された第1の制御情報としてのハンドラ番号と、S102において取得したHABASEの値とに基づいて、ハンドラアドレスを特定する。具体的には、数3の計算を行ってハンドラアドレスを特定する。
(数3)ハンドラアドレス = HABASEに格納されたベースアドレス + ハンドラ番号 × ハンドラサイズ
S204: When the handler address specifying method information is information indicating the direct branch method, the
(Expression 3) Handler address = Base address stored in HABASE + Handler number × Handler size
S105:ハンドラアドレス特定方式情報がテーブル参照方式を示す情報である場合、CPU300は、まず、S201において入力された第2の制御情報としての要因番号と、S103において取得したHTBASEの値とに基づいて、ハンドラアドレスの格納アドレスを特定する。具体的には、数2の計算を行ってハンドラアドレスの格納アドレス、すなわちハンドラアドレスが格納されているテーブルのアドレスを特定する。
S105: When the handler address specifying method information is information indicating the table reference method, the
S106:CPU300は、数2により計算したハンドラアドレスの格納アドレスからデータを読み出し、読み出されたデータをハンドラアドレスとする。
S106: The
S107:CPU300は、ハンドラアドレスへ分岐する。すなわち、直接分岐方式又はテーブル参照方式のいずれかのハンドラアドレスの特定方式により特定したハンドラアドレスに格納された割込ハンドラの命令コードを読み出し、その命令コードに従い処理を行う。
S107: The
図11に、本実施の形態における割込ハンドラ(第1の割込ハンドラ及び第2の割込ハンドラ)のアドレス空間上の配置イメージを示す。 FIG. 11 shows an arrangement image on the address space of the interrupt handlers (first interrupt handler and second interrupt handler) in the present embodiment.
直接分岐方式の割込ハンドラ(第1の割込ハンドラ)606は、ハンドラアドレスベースレジスタ(HABASE)4020に設定されたベースアドレス601からハンドラ番号順に配置される。各ハンドラの格納領域のサイズ、すなわちハンドラサイズは固定である(例えば16バイト)。例えば、ハンドラ番号として0乃至63が設定可能である場合、ベースアドレス601を基点として、ハンドラ番号0乃至63に対応するハンドラINTNUM0乃至INTNUM63が、それぞれ16バイトのハンドラサイズの領域に格納されて、ハンドラ番号順に配置される。
Direct branch type interrupt handlers (first interrupt handlers) 606 are arranged in the order of handler numbers starting from the
テーブル参照方式のハンドラアドレスは、ハンドラアドレステーブルベースレジスタ(HTBASE)4030に設定されたベースアドレス603から要因番号順に配置される。これらのハンドラアドレスを格納する領域をハンドラアドレステーブル604と呼ぶ。各ハンドラアドレスの格納領域のサイズ、すなわちアドレスサイズは固定である(例えば4バイト)。例えば、要因番号として0乃至nが存在する場合、ベースアドレス603を基点として、要因番号0乃至nに対応するハンドラアドレスINT0乃至INT15が、それぞれ4バイトのアドレスサイズの領域に格納されて、要因番号順に配置される。
The handler address of the table reference method is arranged in the order of the factor number from the
テーブル参照方式では、各要因番号に対応する割込ハンドラ(第2の割込ハンドラ)の配置アドレス及びサイズは任意である(605)。 In the table reference method, the arrangement address and size of the interrupt handler (second interrupt handler) corresponding to each factor number are arbitrary (605).
本実施の形態においては、直接分岐方式において、割込コントローラ200が、割込制御レジスタ206によって割込要因に予め対応付けられたハンドラ番号をCPU300に出力し、CPU300がハンドラ番号に基づいてハンドラアドレスを特定するよう構成した。これにより、優先度の数に拘束されることなく、ハンドラの数を特定することができる。また、ハンドラ内で割込要因を判別する処理を行う必要がない。
In the present embodiment, in the direct branch method, the interrupt
<実施の形態3>
実施の形態1及び実施の形態2では、高速な割込応答が必要な割込要因については直接分岐方式を、そうでない割込要因についてはテーブル参照方式を割り当てることにより、高速な割込応答性とメモリの自由かつ効率的な利用とを両立させた。
<
In the first and second embodiments, a direct branch method is assigned for interrupt factors that require a high-speed interrupt response, and a table reference method is assigned for interrupt factors that do not require a high-speed interrupt response. And free and efficient use of memory.
しかしながら、何らかの制約条件により、ハンドラアドレスの特定方式として直接分岐方式しか利用できない場合が考えられる。本発明の実施の形態3は、かかる場合においてもメモリを自由かつ効率的に利用することができるマイクロコントローラ100に関する。
However, there may be a case where only the direct branching method can be used as a method for specifying the handler address due to some constraints. The third embodiment of the present invention relates to a
本発明の実施の形態3にかかるマイクロコントローラ100の構成について説明する。
A configuration of the
実施の形態3のマイクロコントローラ100は、割込コントローラ200内の割込制御レジスタ206の構成と、メモリ4010内の割込ハンドラの配置方法とに特徴を有する。その余の構成については、実施の形態1及び実施の形態2と同様である。
The
図12を用いて、本実施の形態における割込制御レジスタ206の構成について説明する。 The configuration of the interrupt control register 206 in this embodiment will be described with reference to FIG.
割込制御レジスタ206は、割込要因0乃至n毎に設けられる。割込制御レジスタ206は、ハンドラ番号を指定するビット(HN5−HN0)を含む。なお、本実施の形態における上記ビット数は一例であり、これに限定されるものではない。本実施の形態では、割込要因0乃至nのうち、高速な割込応答を必要としない割込要因x1乃至xnのハンドラ番号を、全て共通の番号、例えば63に設定する。これにより、CPU300が割込要因x1乃至xnからの割込要求を受け付けた場合、ハンドラ番号63の割込ハンドラへ分岐する。
The interrupt control register 206 is provided for each interrupt
図13を用いて、本実施の形態におけるマイクロコントローラ100が割込要求を受け付けた際にCPU300が実行する処理について説明する。
A process executed by the
S301:CPU300は、割込コントローラ200から割込要求信号とともに、ハンドラアドレスを特定するための情報として、第1の制御情報としてのハンドラ番号の入力を受け付ける。
S301:
このとき、CPU300は、割込コントローラ200に対し、割込応答と受け付けた割込の要因番号を出力することができる。
At this time, the
S102:CPU300は、ハンドラアドレスベースレジスタ(HABASE)4020の値を取得する。
S102: The
S204:CPU300は、S301において入力された第1の制御情報としてのハンドラ番号と、S102において取得したHABASEの値とに基づいて、ハンドラアドレスを特定する。具体的には、数3の計算を行ってハンドラアドレスを特定する。
S204: The
S107:CPU300は、ハンドラアドレスへ分岐する。すなわち、ハンドラアドレスに格納された割込ハンドラの命令コードを読み出し、その命令コードに従い処理を行う。
S107: The
図14に、本実施の形態における割込ハンドラのアドレス空間上の配置イメージを示す。 FIG. 14 shows an arrangement image of the interrupt handlers in the address space according to the present embodiment.
割込ハンドラ(第1の割込ハンドラ)606は、ハンドラアドレスベースレジスタ(HABASE)4020に設定されたベースアドレス601からハンドラ番号順に配置される。各ハンドラの格納領域のサイズ、すなわちハンドラサイズは固定である(例えば16バイト)。例えば、ハンドラ番号として0乃至63が設定可能である場合、ベースアドレス601を基点として、ハンドラ番号0乃至63に対応するハンドラINTNUM0乃至INTNUM63が、それぞれ16バイトのハンドラサイズの領域に格納されて、ハンドラ番号順に配置される。
Interrupt handlers (first interrupt handlers) 606 are arranged in the order of handler numbers from the
本実施の形態では、割込コントローラ200内の割込制御レジスタ206において、高速な割込応答を必要としない割込要因x1乃至xnのハンドラ番号が、全て共通の番号、例えば63に設定される。これにより、CPU300が割込要因x1乃至xnからの割込要求を受け付けた場合、ハンドラINTNUM63へ分岐する。ハンドラINTNUM63には、割込要求が割込要因x1乃至xnのどの要因からのものなのかを判別し、割込要因x1乃至xnそれぞれに固有のハンドラINTx1乃至INTxnへ分岐する処理を記述しておく。こうすることで、高速な割込応答を必要としない割込要因x1乃至xnについて、割込ハンドラ(第1の割込ハンドラ)の配置場所やサイズに自由度が増し、メモリの利用効率を高めることができる。
In the present embodiment, in the interrupt control register 206 in the interrupt
本実施の形態においては、直接分岐方式しか利用できないマイクロコントローラ100において、割込コントローラ200内の割込制御レジスタ206が、高速な割込応答を必要としない割込要因に共通のハンドラ番号を割り当て、メモリ4010内の上記共通のハンドラ番号に対応する割込ハンドラに、割込要求の割込要因を判別し、割込要因毎の他の割込ハンドラへ分岐する処理を行わせる。これにより、高速な割込応答を必要としない割込要因について、割込ハンドラの配置場所やサイズに自由度が増し、メモリの利用効率を高めることができる。
In the present embodiment, in
<実施の形態4>
実施の形態3は、高速な割込応答を必要としない割込要因について、メモリの自由かつ効率的な利用を実現した。本発明の実施の形態4は、高速な割込応答を必要とする割込要因についても、メモリを自由かつ効率的に利用することができるマイクロコントローラ100に関する。
<
The third embodiment realizes free and efficient use of the memory for an interrupt factor that does not require a high-speed interrupt response. The fourth embodiment of the present invention relates to a
本発明の実施の形態4にかかるマイクロコントローラ100の構成について説明する。
A configuration of the
実施の形態4のマイクロコントローラ100は、割込コントローラ200内の割込制御レジスタ206の構成と、メモリ4010内の割込ハンドラの配置方法とに特徴を有する。その余の構成については、実施の形態3と同様である。
The
本実施の形態における割込制御レジスタ206は、高速な割込応答を必要とする割込要因yのハンドラ番号を任意の要因番号、例えば30に設定する。このとき、もし割込要因yに対応する割込ハンドラが、規定のハンドラサイズより大きいものである場合、割込制御レジスタ206は、ハンドラ番号30に連続するハンドラ番号31を、他のどの割込要因にも割り当てないようにする。
The interrupt control register 206 in the present embodiment sets the handler number of the interrupt factor y that requires a high-speed interrupt response to an arbitrary factor number, for example, 30. At this time, if the interrupt handler corresponding to the interrupt factor y is larger than the specified handler size, the interrupt control register 206 assigns the
加えて、図14に示すように、メモリ4010内のハンドラINTNUM30の領域とハンドラINTNUM31の領域を連結した領域に、要因yの割込ハンドラを格納する。
In addition, as shown in FIG. 14, the interrupt handler for the factor y is stored in an area obtained by connecting the area of the handler INTNUM 30 and the area of the
これにより、高速な割込応答性能を損なわないまま割込ハンドラのサイズの自由度を増すことができる。 Thereby, the freedom degree of the size of an interrupt handler can be increased without impairing high-speed interrupt response performance.
本実施の形態においては、メモリ4010が、複数の割込ハンドラの識別子と関連付けられた連続する格納領域に1つの割込ハンドラを格納し、割込コントローラ200内の割込制御レジスタ206は、上記複数の割込ハンドラの識別子のうち、上記連続する格納領域の先頭領域に関連付けられた割込ハンドラの識別子のみを、所定の割込要因と対応付けるよう構成した。これにより、高速な割込応答性能を損なわないまま割込ハンドラのサイズの自由度を増すことができる。
In the present embodiment, the
<その他の実施の形態>
なお、本発明は上述した実施の形態のみに限定されるものではなく、本発明の要旨を逸脱しない範囲において種々の変更が可能であることは勿論である。
<Other embodiments>
It should be noted that the present invention is not limited to the above-described embodiments, and various modifications can be made without departing from the scope of the present invention.
例えば、上述の実施の形態では、ハードウェアの構成として説明したが、これに限定されるものではなく、任意の処理を、CPU(Central Processing Unit)にコンピュータプログラムを実行させることにより実現することも可能である。この場合、コンピュータプログラムは、様々なタイプの非一時的なコンピュータ可読媒体(non−transitory computer readable medium)を用いて格納され、コンピュータに供給することができる。非一時的なコンピュータ可読媒体は、様々なタイプの実体のある記録媒体(tangible storage medium)を含む。非一時的なコンピュータ可読媒体の例は、磁気記録媒体(例えばフレキシブルディスク、磁気テープ、ハードディスクドライブ)、光磁気記録媒体(例えば光磁気ディスク)、CD−ROM(Read Only Memory)、CD−R、CD−R/W、半導体メモリ(例えば、マスクROM、PROM(Programmable ROM)、EPROM(Erasable PROM)、フラッシュROM、RAM(random access memory))を含む。また、プログラムは、様々なタイプの一時的なコンピュータ可読媒体(transitory computer readable medium)によってコンピュータに供給されてもよい。一時的なコンピュータ可読媒体の例は、電気信号、光信号、及び電磁波を含む。一時的なコンピュータ可読媒体は、電線及び光ファイバ等の有線通信路、又は無線通信路を介して、プログラムをコンピュータに供給できる。 For example, in the above-described embodiment, the hardware configuration has been described. However, the present invention is not limited to this, and any processing may be realized by causing a CPU (Central Processing Unit) to execute a computer program. Is possible. In this case, the computer program can be stored and provided to the computer using various types of non-transitory computer readable media. Non-transitory computer readable media include various types of tangible storage media. Examples of non-transitory computer-readable media include magnetic recording media (for example, flexible disks, magnetic tapes, hard disk drives), magneto-optical recording media (for example, magneto-optical disks), CD-ROMs (Read Only Memory), CD-Rs, CD-R / W, semiconductor memory (for example, mask ROM, PROM (Programmable ROM), EPROM (Erasable PROM), flash ROM, RAM (Random Access Memory)). The program may also be supplied to the computer by various types of transitory computer readable media. Examples of transitory computer readable media include electrical signals, optical signals, and electromagnetic waves. The temporary computer-readable medium can supply the program to the computer via a wired communication path such as an electric wire and an optical fiber, or a wireless communication path.
100 マイクロコントローラ
101 周辺機能
102 周辺バス
103 CPUバス
104 キャッシュ
105 RAM
106 外部メモリキャッシュ
107 外部メモリコントローラ
200 割込コントローラ
201 要求検出部
202 要求フラグ
203 要求マスク部
204 優先度判定部
205 割込要求生成部
206 割込制御レジスタ
207 割込応答入力部
208 周辺バスインタフェース
300 CPU
301 実行ユニット
302 命令フェッチユニット
303 ロードストアユニット
401 ハンドラ記憶手段
402 ベースアドレス記憶手段
4010 メモリ
4020 HABASE(第1のベースアドレス記憶手段)
4030 HTBASE(第2のベースアドレス記憶手段)
501 温度センサ
502 衝突センサ
503 外部メモリ
100
106
301
4030 HTBASE (second base address storage means)
501
Claims (20)
前記割込ハンドラの格納位置を示すアドレスであるハンドラアドレスを特定するために用いられるベースアドレスを記憶する第1の記憶手段と、
前記割込ハンドラを記憶する第2の記憶手段と、
前記割込要求の入力に応じて、割込要求と、前記割込要因に予め対応付けられた制御情報を出力する割込コントローラと、
前記割込コントローラから出力された割込要求に応じて、前記割込ハンドラを取得して実行するCPUを備え、
前記CPUから前記第1の記憶手段に対するアクセス時間は、前記CPUから前記第2の記憶手段に対するアクセス時間よりも短く、かつ、
前記CPUは、
(a)前記割込コントローラから出力された割込要求に応じて、前記第1の記憶手段にアクセスして前記ベースアドレスを取得し、
(b)当該取得されたベースアドレスと、前記割込コントローラから出力された前記制御情報に基づいて、前記ハンドラアドレスを特定し、
(c)特定されたハンドラアドレスに基づいて前記第2の記憶手段にアクセスして前記割込ハンドラを実行する、
マイクロコントローラ。 A microcontroller that executes an interrupt handler in response to an interrupt request caused by multiple interrupt factors,
First storage means for storing a base address used for specifying a handler address which is an address indicating a storage position of the interrupt handler;
Second storage means for storing the interrupt handler;
In response to the input of the interrupt request, an interrupt controller that outputs control information associated with the interrupt factor in advance,
In response to an interrupt request output from the interrupt controller, a CPU for acquiring and executing the interrupt handler is provided.
The access time from the CPU to the first storage means is shorter than the access time from the CPU to the second storage means, and
The CPU
(A) In response to the interrupt request output from the interrupt controller, the first storage means is accessed to obtain the base address;
(B) identifying the handler address based on the acquired base address and the control information output from the interrupt controller;
(C) accessing the second storage means based on the specified handler address to execute the interrupt handler;
Microcontroller.
前記ベースアドレスは、前記第2の記憶手段における前記ハンドラアドレステーブルの格納位置を示すアドレスであり、
前記CPUは、
(b−1)前記ベースアドレスに基づいて前記ハンドラアドレステーブルを参照し、当該ハンドラアドレステーブルにおいて前記割込コントローラから出力された前記制御情報と対応づけられた前記ハンドラアドレスを特定する
請求項1記載のマイクロコントローラ。 The second storage means has a table storage area for storing a handler address table in which the control information and the handler address are associated in advance.
The base address is an address indicating a storage position of the handler address table in the second storage means,
The CPU
(B-1) The handler address table is referenced based on the base address, and the handler address associated with the control information output from the interrupt controller is specified in the handler address table. Microcontroller.
前記ベースアドレスは、前記第2の記憶手段における前記ハンドラ格納領域の格納位置を示すアドレスであり、
前記CPUは、
(b−2)前記ベースアドレスに基づいて、前記制御情報によって特定される順と、前記ハンドラ格納領域において前記割込ハンドラのそれぞれを格納する個別領域の固定サイズから前記ハンドラアドレスを特定する
請求項1記載のマイクロコントローラ。 The second storage means has a handler storage area for storing each of the plurality of interrupt handlers in each of the fixed-size individual areas prepared in the order specified by the control information,
The base address is an address indicating a storage position of the handler storage area in the second storage means,
The CPU
(B-2) The handler address is specified based on the base address based on the order specified by the control information and a fixed size of an individual area for storing each of the interrupt handlers in the handler storage area. 1. The microcontroller according to 1.
前記割込要求の入力に応じて、割込要求と、前記割込要因に予め対応付けられた第1又は第2の制御情報と、前記割込要因に予め対応づけられたハンドラアドレス特定方式情報とを出力する割込コントローラと、
前記割込コントローラから出力された割込要求に応じて、前記第1の割込ハンドラ又は前記第2の割込ハンドラを取得して実行するCPUと、
前記第1の割込ハンドラの格納位置を示すアドレスである第1のハンドラアドレスを特定するために用いられる第1のベースアドレスと、前記第2の割込ハンドラの格納位置を示すアドレスである第2のハンドラアドレスを特定するために用いられる第2のベースアドレスを記憶する第1の記憶手段と、
複数の前記第1の割込ハンドラのそれぞれを前記第1の制御情報によって特定される順に予め用意された固定サイズの個別領域のそれぞれに格納する第1の割込ハンドラ格納領域と、前記第2の制御情報と前記第2のハンドラアドレスとを予め対応付けたハンドラアドレステーブルを格納するテーブル記憶領域と、前記第1の割込ハンドラを格納する第1の割込ハンドラ格納領域とを有する第2の記憶手段とを備え、
前記CPUから前記第1の記憶手段に対するアクセス時間は、前記CPUから前記第2の記憶手段に対するアクセス時間よりも短く、かつ、
前記CPUは、
(A)前記ハンドラアドレス特定方式情報が直接分岐方式を示す場合には、
(a)前記割込コントローラから出力された割込要求に応じて、前記第1の記憶手段にアクセスして前記第1のベースアドレスを取得し、
(b−2)前記第1のベースアドレスに基づいて、前記第1の制御情報によって特定される順と、前記第1のハンドラ格納領域において前記割込ハンドラのそれぞれを格納する個別領域の固定サイズから前記第1のハンドラアドレスを特定し、
(c)特定された第1のハンドラアドレスに基づいて前記第2の記憶手段にアクセスして前記第1の割込ハンドラを実行する、
(B)前記ハンドラアドレス特定方式情報がテーブル参照方式を示す場合には、
(a)前記割込コントローラから出力された割込要求に応じて、前記第1の記憶手段にアクセスして前記第2のベースアドレスを取得し、
(b−1)前記第2のベースアドレスに基づいて前記ハンドラアドレステーブルを参照し、当該ハンドラアドレステーブルにおいて前記割込コントローラから出力された前記第2の制御情報と対応づけられた前記第2のハンドラアドレスを特定し、
(c)特定された第2のハンドラアドレスに基づいて前記第2の記憶手段にアクセスして前記第2の割込ハンドラを実行する、
マイクロコントローラ。 A microcontroller that executes an interrupt handler in response to an interrupt request caused by multiple interrupt factors,
In response to the input of the interrupt request, the interrupt request, the first or second control information associated in advance with the interrupt factor, and the handler address specifying method information associated in advance with the interrupt factor An interrupt controller that outputs
CPU that acquires and executes the first interrupt handler or the second interrupt handler in response to an interrupt request output from the interrupt controller;
A first base address used to specify a first handler address which is an address indicating a storage location of the first interrupt handler, and an address indicating a storage location of the second interrupt handler. First storage means for storing a second base address used to identify the two handler addresses;
A first interrupt handler storage area for storing each of the plurality of first interrupt handlers in a fixed-size individual area prepared in advance in the order specified by the first control information; A table storage area that stores a handler address table that associates the control information with the second handler address in advance, and a first interrupt handler storage area that stores the first interrupt handler. Storage means,
The access time from the CPU to the first storage means is shorter than the access time from the CPU to the second storage means, and
The CPU
(A) When the handler address specifying method information indicates a direct branch method,
(A) In response to the interrupt request output from the interrupt controller, the first storage means is accessed to obtain the first base address,
(B-2) Based on the first base address, the order specified by the first control information, and the fixed size of the individual area for storing each of the interrupt handlers in the first handler storage area Identifying the first handler address from
(C) accessing the second storage means based on the identified first handler address to execute the first interrupt handler;
(B) When the handler address specifying method information indicates a table reference method,
(A) In response to the interrupt request output from the interrupt controller, the first storage means is accessed to obtain the second base address;
(B-1) Refers to the handler address table based on the second base address, and the second address associated with the second control information output from the interrupt controller in the handler address table. Identify the handler address,
(C) accessing the second storage means based on the identified second handler address to execute the second interrupt handler;
Microcontroller.
前記第2の記憶手段は、前記レジスタよりも前記CPUによるアクセス時間が長いメモリである
請求項1乃至4いずれか1項記載のマイクロコントローラ。 The first storage means is a register;
The microcontroller according to any one of claims 1 to 4, wherein the second storage unit is a memory having a longer access time by the CPU than the register.
請求項4記載のマイクロコントローラ。 The microcontroller according to claim 4, wherein the table storage area, the first interrupt handler storage area, and the second interrupt handler storage area are on the same address space.
請求項1乃至3いずれか1項記載のマイクロコントローラ。 The microcontroller according to any one of claims 1 to 3, wherein the control information is a priority.
請求項1乃至3いずれか1項記載のマイクロコントローラ。 The microcontroller according to any one of claims 1 to 3, wherein the control information is an identifier of an interrupt factor.
請求項1乃至3いずれか1項記載のマイクロコントローラ。 The microcontroller according to any one of claims 1 to 3, wherein the control information is a handler identifier.
請求項4又は6記載のマイクロコントローラ。 The microcontroller according to claim 4 or 6, wherein the second control information is an identifier of an interrupt factor.
前記第2の記憶手段は、前記ハンドラ識別子に対応する格納領域に、割込要因毎に異なる他のハンドラへさらに分岐する処理を前記CPUに実行させるハンドラを格納する
請求項9記載のマイクロコントローラ。 A common handler identifier is associated with a plurality of interrupt factors in advance,
The microcontroller according to claim 9, wherein the second storage unit stores a handler that causes the CPU to execute a process of further branching to another handler that differs for each interrupt factor in a storage area corresponding to the handler identifier.
前記複数のハンドラ識別子のうち、前記連続する格納領域の先頭領域に対応するハンドラの識別子のみが、所定の割込要因と対応付けられる
請求項9又は11記載のマイクロコントローラ。 The second storage means stores one handler in a continuous storage area corresponding to a plurality of handler identifiers,
The microcontroller according to claim 9 or 11, wherein among the plurality of handler identifiers, only the identifier of the handler corresponding to the head area of the continuous storage area is associated with a predetermined interrupt factor.
割込コントローラから割込要因に対応する制御情報を入力するステップと、
第1の記憶手段からベースアドレスを取得するステップと、
前記ベースアドレス及び前記制御情報に基づいて、第2の記憶手段におけるハンドラの格納位置であるハンドラアドレスを特定するステップと、を有し、
前記CPUから前記第1の記憶手段に対するアクセス時間は、前記CPUから前記第2の記憶手段に対するアクセス時間よりも短い
ハンドラアドレス特定方法。 CPU
A step of inputting control information corresponding to the interrupt factor from the interrupt controller;
Obtaining a base address from the first storage means;
Identifying a handler address which is a storage location of the handler in the second storage means based on the base address and the control information,
The handler address specifying method, wherein an access time from the CPU to the first storage means is shorter than an access time from the CPU to the second storage means.
請求項13記載のハンドラアドレス特定方法。 The handler address specifying method according to claim 13, wherein the base address is an address indicating a storage position of a handler address table in which the control information and the handler address are associated in advance in the second storage unit.
前記ベースアドレスは、前記第2の記憶手段における前記ハンドラ格納領域の格納位置を示すアドレスである
請求項13記載のハンドラアドレス特定方法。 The second storage means has a handler storage area for storing each of the plurality of interrupt handlers in each of the fixed-size individual areas prepared in the order specified by the control information,
The handler address specifying method according to claim 13, wherein the base address is an address indicating a storage position of the handler storage area in the second storage means.
割込コントローラから、割込要因に対応する第1又は第2の制御情報と、前記割込要因に対応するハンドラアドレス特定方式情報とを入力するステップと、
(A)前記ハンドラアドレス特定方式情報が直接分岐方式を示す場合、
第1の記憶手段から第1のベースアドレスを取得するステップと、
前記第1のベースアドレス及び前記第1の制御情報に基づいて、第2の記憶手段における第1のハンドラ格納領域から第1のハンドラの格納位置である第1のハンドラアドレスを特定するステップと、
(B)前記ハンドラアドレス特定方式情報がテーブル参照方式を示す場合、
第1の記憶手段から第2のベースアドレスを取得するステップと、
前記第2のベースアドレス及び前記第2の制御情報に基づいて、ハンドラアドレステーブルから第2のハンドラアドレスを特定するステップと、を有し、
前記第1のハンドラ格納領域は、前記第1のハンドラをそれぞれ格納するための固定サイズの個別領域に前記第1の制御情報に基づく順序で格納し、
前記第1のベースアドレスは、前記第2の記憶手段における前記第1のハンドラ格納領域の格納位置を示すアドレスであり、
前記ハンドラアドレステーブルは、前記第2の制御情報と前記第2のハンドラアドレスとを予め対応付けたテーブルであり、
前記第2のベースアドレスは、前記第2の記憶手段におけるハンドラアドレステーブルの格納位置を示すアドレスであり、
前記CPUから前記第1の記憶手段に対するアクセス時間は、前記CPUから前記第2の記憶手段に対するアクセス時間よりも短い
ハンドラアドレス特定方法。 CPU
Inputting from the interrupt controller the first or second control information corresponding to the interrupt factor and the handler address specifying method information corresponding to the interrupt factor;
(A) When the handler address specifying method information indicates a direct branch method,
Obtaining a first base address from a first storage means;
Identifying a first handler address that is a storage location of the first handler from a first handler storage area in a second storage means based on the first base address and the first control information;
(B) When the handler address specifying method information indicates a table reference method,
Obtaining a second base address from the first storage means;
Identifying a second handler address from a handler address table based on the second base address and the second control information,
The first handler storage area is stored in an order based on the first control information in a fixed-size individual area for storing the first handler,
The first base address is an address indicating a storage position of the first handler storage area in the second storage means,
The handler address table is a table in which the second control information and the second handler address are associated with each other in advance.
The second base address is an address indicating a storage position of a handler address table in the second storage means,
The handler address specifying method, wherein an access time from the CPU to the first storage means is shorter than an access time from the CPU to the second storage means.
前記第2の記憶手段は、前記レジスタよりも前記CPUによるアクセス時間が長いメモリである
請求項13乃至16いずれか1項記載のハンドラアドレス特定方法。 The first storage means is a register;
The handler address specifying method according to any one of claims 13 to 16, wherein the second storage unit is a memory having a longer access time by the CPU than the register.
複数の割込要因に共通のハンドラ識別子が予め対応付けられ、
前記第2の記憶手段は、前記ハンドラ識別子に対応する格納領域に、割込要因毎に異なる他のハンドラへさらに分岐する処理を前記CPUに実行させるハンドラを格納する
請求項16記載のハンドラアドレス特定方法。 The first control information is a handler identifier;
A common handler identifier is associated with a plurality of interrupt factors in advance,
17. The handler address specification according to claim 16, wherein the second storage means stores a handler that causes the CPU to execute a process of further branching to another handler that differs for each interrupt factor in a storage area corresponding to the handler identifier. Method.
前記複数のハンドラ識別子のうち、前記連続する格納領域の先頭領域に対応するハンドラの識別子のみが、所定の割込要因と対応付けられる
請求項18記載のハンドラアドレス特定方法。 The second storage means stores one handler in a continuous storage area corresponding to a plurality of handler identifiers,
The handler address specifying method according to claim 18, wherein, among the plurality of handler identifiers, only the identifier of the handler corresponding to the head area of the continuous storage area is associated with a predetermined interrupt factor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012229148A JP2014081783A (en) | 2012-10-16 | 2012-10-16 | Microcontroller, handler address specification method and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012229148A JP2014081783A (en) | 2012-10-16 | 2012-10-16 | Microcontroller, handler address specification method and program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2014081783A true JP2014081783A (en) | 2014-05-08 |
Family
ID=50785925
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012229148A Pending JP2014081783A (en) | 2012-10-16 | 2012-10-16 | Microcontroller, handler address specification method and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2014081783A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06324884A (en) * | 1993-05-13 | 1994-11-25 | Mitsubishi Electric Corp | Data processor |
JPH08320796A (en) * | 1994-09-09 | 1996-12-03 | Hitachi Ltd | Data processor |
JP2003162418A (en) * | 2001-11-28 | 2003-06-06 | Denso Corp | Interrupt-activation method and information processor |
JP2005267640A (en) * | 2004-03-18 | 2005-09-29 | Arm Ltd | Method and device for calling function |
-
2012
- 2012-10-16 JP JP2012229148A patent/JP2014081783A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH06324884A (en) * | 1993-05-13 | 1994-11-25 | Mitsubishi Electric Corp | Data processor |
JPH08320796A (en) * | 1994-09-09 | 1996-12-03 | Hitachi Ltd | Data processor |
JP2003162418A (en) * | 2001-11-28 | 2003-06-06 | Denso Corp | Interrupt-activation method and information processor |
JP2005267640A (en) * | 2004-03-18 | 2005-09-29 | Arm Ltd | Method and device for calling function |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9442870B2 (en) | Interrupt priority management using partition-based priority blocking processor registers | |
JP5894496B2 (en) | Semiconductor device | |
JP5498505B2 (en) | Resolving contention between data bursts | |
US20140244981A1 (en) | Processor and control method for processor | |
US7328295B2 (en) | Interrupt controller and interrupt controlling method for prioritizing interrupt requests generated by a plurality of interrupt sources | |
JP2017091544A (en) | Method, processing unit, and design structure for handling interrupts in processing unit using virtual processor thread groups | |
US20160275028A1 (en) | Semiconductor device | |
JP4855864B2 (en) | Direct memory access controller | |
US9697118B1 (en) | Memory controller with interleaving and arbitration scheme | |
US20080168203A1 (en) | Data Processing System With Interrupt Controller and Interrupt Controlling Method | |
JP5108690B2 (en) | DMA apparatus and DMA transfer method | |
JP2014081783A (en) | Microcontroller, handler address specification method and program | |
KR101306670B1 (en) | Memory control device and method for controlling same | |
JP2010044645A (en) | Data transfer device, and data transfer method | |
JP2009288978A (en) | Multiple interrupt processor | |
US20140317627A1 (en) | Scheduling apparatus and method of dynamically setting the size of a rotating register | |
US20150100759A1 (en) | Pipelined finite state machine | |
US7952505B2 (en) | Semiconductor device and input selection control method | |
JP2007026091A (en) | Interrupt control circuit and its control method | |
JP5644197B2 (en) | Computer system and interrupt request processing method | |
US11429437B2 (en) | System for arbitrating between multiple flows | |
US11030127B2 (en) | Multi-threaded architecture for memory controller data paths | |
JP2013161367A (en) | Information processing apparatus and control method thereof | |
JPH0969072A (en) | Memory mapped i/o control circuit | |
JP2015014934A (en) | Memory controller and memory control method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20150820 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20160531 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20160607 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20170207 |