JP2004252729A - Interruption supporting circuit device, microcomputer, and interruption supporting method - Google Patents

Interruption supporting circuit device, microcomputer, and interruption supporting method Download PDF

Info

Publication number
JP2004252729A
JP2004252729A JP2003042683A JP2003042683A JP2004252729A JP 2004252729 A JP2004252729 A JP 2004252729A JP 2003042683 A JP2003042683 A JP 2003042683A JP 2003042683 A JP2003042683 A JP 2003042683A JP 2004252729 A JP2004252729 A JP 2004252729A
Authority
JP
Japan
Prior art keywords
interrupt
data
cache memory
cpu
unit
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
JP2003042683A
Other languages
Japanese (ja)
Inventor
Hitoshi Koyanagi
仁 小柳
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.)
Konica Minolta Inc
Original Assignee
Konica Minolta Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Konica Minolta Inc filed Critical Konica Minolta Inc
Priority to JP2003042683A priority Critical patent/JP2004252729A/en
Publication of JP2004252729A publication Critical patent/JP2004252729A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To shorten a response time without limiting the kinds of interruption processing. <P>SOLUTION: In an interruption supporting block 20 as an interruption supporting circuit device, interruption to occur is predicted by an interruption predicting part 24, and data to be used for the interruption processing of the predicted interruption are read from a main memory 30 via a memory interface 27, and stored in an incorporated cache memory. When a data request for data for interruption to be used by interruption processing is transmitted from a CPU core 10 as a CPU due to the occurrence of interruption, the data for interruption corresponding to the data request are read from the cache memory, and transmitted via a CPU interface 22 to the CPU core 10. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、割り込みを支援する割り込み支援回路装置及びその割り込み支援装置を有するマイクロコンピュータ並びに割り込み支援方法に関する。
【0002】
【従来の技術】
従来、マイクロコンピュータにおいて、処理の実行要求が発生した場合に、即座にその処理が実行されるリアルタイムシステムがあった。リアルタイムシステムにおいては、通常処理の実行中に発生する割り込みに応じて、実行する処理をその通常処理から割り込み処理へ所定時間内に切り替える必要がある。例えば、センサが障害物を検知してから規定時間内にその障害物を回避することである。この場合、センサの検知信号の入力が割り込みとして通知される。
【0003】
また、割り込みに対して素早く対応するための構成が考えられている。その例として、割り込み処理に用いるデータを予めマイクロコンピュータ内部のキャッシュとしての命令RAM(Random Access Memory)に記憶しておき、割り込み発生時にそのデータの読み出し元を、通常時用の命令キャッシュから割り込み用の命令RAMに切り替えることにより、その割り込み処理実行の応答時間の高速化が実現されていた(例えば、特許文献1参照)。
【0004】
【特許文献1】
特開2002−49607号公報
【0005】
【発明が解決しようとする課題】
しかし、特許文献1に記載の発明では、割り込み用の命令RAMに記憶されるデータが予め決定されて記憶されてその更新が行われない。このため、CPU(Central Processing Unit)において、予め命令RAMに記憶されたデータに対応する割り込み処理しか実行できないという問題があった。これに関して、命令RAMの容量が限られていることから、その容量に対応する限られた種類の割り込み処理しか実行できないという問題があった。
【0006】
本発明の課題は、割り込みの種類を限定することなくその割り込み処理の応答時間を短縮することである。
【0007】
【課題を解決するための手段】
請求項1に記載の発明は、割り込み処理に用いるデータのメインメモリからCPUへの通信を支援する割り込み支援回路装置であって、
前記CPUとの通信を行うCPUインタフェースと、
前記メインメモリとの通信を行うメモリインタフェースと、
データを記憶するキャッシュメモリを具備し、発生する割り込みを予測して、その割り込みの割り込み処理に用いるデータを、前記メモリインタフェースを介して前記メインメモリから読み出して前記キャッシュメモリに格納し、前記CPUからのデータ要求に基づいて、その格納されたデータを前記CPUに送信する割り込み予測部と、
前記CPUインタフェース及び前記メモリインタフェースを介して、前記CPUと前記メインメモリとの間の通信を制御する制御部とを備えることを特徴とする。
【0008】
請求項2に記載の発明は、請求項1に記載の割り込み支援回路装置において、
前記割り込み予測部は、前記予測された割り込みの割り込み処理の開始前に、その割り込み処理に用いるデータを前記キャッシュメモリに格納することを特徴とする。
【0009】
請求項3に記載の発明は、請求項1又は2に記載の割り込み支援回路装置において、
前記割り込み予測部は、
発生する割り込みを予測してその割り込みに基づく予測信号を出力する割り込み予測実行部と、
前記割り込み予測実行部から出力された予測信号に基づいて、予測された割り込みの割り込み処理に用いるデータを読み出すための投機フェチ要求を生成して前記メインメモリに送信する投機フェチ制御部と、
前記メインメモリから送信された前記割り込み処理に用いるデータを前記キャッシュメモリに格納させるキャッシュメモリ制御部とを備えることを特徴とする。
【0010】
請求項4に記載の発明は、請求項3に記載の割り込み支援回路装置において、
前記キャッシュメモリ制御部は、各種処理のデータ要求を前記CPUから前記CPUインタフェースを介して受信した場合に、そのデータ要求に対応するデータを前記キャッシュメモリから検索し、検索された場合にそのデータを前記CPUインタフェースを介して前記CPUに送信することを特徴とする。
【0011】
請求項5に記載の発明は、請求項4に記載の割り込み支援回路装置において、
前記制御部は、前記キャッシュメモリ制御部により前記データ要求に対応するデータが前記キャッシュメモリから検索されない場合に、前記データ要求に対応するデータを前記メモリインタフェースを介して前記メインメモリから受信し、そのデータを前記CPUインタフェースを介して前記CPUに送信することを特徴とする。
【0012】
請求項6に記載の発明は、請求項3から5のいずれか一項に記載の割り込み支援回路装置において、
前記キャッシュメモリ制御部は、前記メインメモリから送信された前記割り込み処理に用いるデータを前記キャッシュメモリに格納させる場合に、そのデータの読み出しを有効にして前記キャッシュメモリに格納させ、前記キャッシュメモリに格納されたデータを前記CPUに送信した場合に、その送信されたデータの読み出しを無効にして前記キャッシュメモリに格納させることを特徴とする。
【0013】
請求項7に記載の発明は、請求項3から6のいずれか一項に記載の割り込み支援回路装置において、
前記キャッシュメモリの記憶領域は、複数のチャネルに分割され、
前記キャッシュメモリ制御部は、1種類の割り込みに対応するデータを1つのチャネルに格納させることを特徴とする。
【0014】
請求項8に記載の発明は、請求項3から7のいずれか一項に記載の割り込み支援回路装置において、
前記割り込み予測実行部は、
各割り込みの発生間隔をカウントするカウンタと、
前記各割り込みの発生の基準となる基準間隔値を記憶する基準間隔記憶部と、
前記カウンタから出力された所定の割り込みに対応するカウンタ値が、前記基準間隔記憶部に記憶された基準間隔値に対応する場合に、その割り込みに対応する予測信号を生成する予測信号生成部とを備えることを特徴とする。
【0015】
請求項9に記載の発明は、請求項8に記載の割り込み支援回路装置において、
前記割り込み予測実行部は、
過去に発生した各割り込みの発生間隔を平均する平均部を備え、
前記基準間隔記憶部は、前記平均部により平均された各割り込みの発生間隔を基準間隔値として記憶することを特徴とする。
【0016】
請求項10に記載の発明は、請求項8又は9に記載の割り込み支援回路装置において、
前記所定の割り込みが周期的割り込みであり、
前記予測信号生成部は、前記カウンタから出力された前記周期的割り込みに対応するカウンタ値が、前記基準間隔記憶部に記憶された前記周期的割り込みに対応する基準間隔値を超える所定時間前に、その周期的割り込みに対応する予測信号を生成することを特徴とする。
【0017】
請求項11に記載の発明は、請求項8から10のいずれか一項に記載の割り込み支援回路装置において、
前記所定の割り込みが、第1の割り込み発生後に所定間隔で発生する関連型割り込みとしての第2の割り込みであり、
前記カウンタは、前記第1の割り込みの発生間隔をカウントし、
前記予測信号生成部は、前記カウンタから出力された前記第1の割り込みに対応するカウンタ値が、前記基準間隔記憶部に記憶された、前記第1の割り込み発生からの前記第2の割り込みの発生間隔に対応する基準間隔値を超える所定時間前に、その第2の割り込みに対応する予測信号を生成することを特徴とする。
【0018】
請求項12に記載の発明は、請求項8から11のいずれか一項に記載の割り込み支援回路装置において、
前記所定の割り込みがランダムに発生するランダム割り込みであり、
前記カウンタは、発生時間に規則性を有する規則的割り込みの発生間隔をカウントし、
前記予測信号生成部は、前記カウンタから出力されたカウンタ値が、前記基準間隔記憶部に記憶された前記規則的割り込みに対応する基準間隔値を超えた場合に、前記ランダム割り込みに対応する予測信号を生成することを特徴とする。
【0019】
請求項13に記載の発明は、請求項3から12のいずれか一項に記載の割り込み支援回路装置において、
前記キャッシュメモリ制御部は、前記キャッシュメモリの記憶領域を参照し、前記記憶領域に対する空き領域の割合が所定量以上である場合に、所定の割り込みに対応する投機フェチ要求を生成させるための投機フェチ開始要求を前記投機フェチ制御部に入力することを特徴とする。
【0020】
請求項14に記載の発明は、
CPUと、
割り込み処理に用いるデータのメインメモリから前記CPUへの通信を支援する請求項1から13のいずれか一項に記載の割込み支援回路装置とを備えるマイクロコンピュータであることを特徴とする。
【0021】
請求項15に記載の発明は、割り込み処理に用いるデータのメインメモリからCPUへの通信をキャッシュメモリを介して支援する割り込み支援方法であって、
発生する割り込みを予測して、その割り込みの割り込み処理に用いるデータを、前記メインメモリから読み出して前記キャッシュメモリに格納し、前記CPUからのデータ要求に基づいて、その格納されたデータを前記CPUに送信することを特徴とする。
【0022】
請求項1又は15に記載の発明によれば、予測された割り込みの割り込み処理に用いるデータを、読み出し速度の速いキャッシュメモリに格納して、データ要求に基づいてそのデータをCPUに送信するので、割り込みが発生した場合にCPUがすみやかに割り込み処理で用いるデータを取得して割り込み処理を実行でき、割り込み処理の種類を限定することなく割り込み処理の応答時間を短縮することができる。
【0023】
請求項16に記載の発明は、請求項15に記載の割り込み支援方法において、
前記予測された割り込みの割り込み処理の開始前に、その割り込み処理に用いるデータを前記キャッシュメモリに格納することを特徴とする。
【0024】
請求項2又は16に記載の発明によれば、予測された割り込みの割り込み処理の開始前に、その割り込み処理に用いるデータを読み出し速度の速いキャッシュメモリに格納するので、割り込み処理の応答時間を短縮することができる。
【0025】
請求項17に記載の発明は、請求項15又は16に記載の割り込み支援方法において、
発生する割り込みを予測してその割り込みに基づく予測信号を出力し、
前記出力された予測信号に基づいて、予測された割り込みの割り込み処理に用いるデータを読み出すための投機フェチ要求を生成して前記メインメモリに送信し、
前記メインメモリから送信された前記割り込み処理に用いるデータを前記キャッシュメモリに格納させることを備えることを特徴とする。
【0026】
請求項3又は17に記載の発明によれば、発生する割り込みを予測して、その予測信号に基づいて投機フェチ要求を生成してメインメモリに送信し、メインメモリから送信された、その投機フェチ要求に対応する前記割り込み処理に用いるデータをキャッシュメモリに格納させることができる。
【0027】
請求項18に記載の発明は、請求項17に記載の割り込み支援方法において、
割り込み処理のデータ要求を前記CPUから受信した場合に、そのデータ要求に対応するデータを前記キャッシュメモリから検索し、検索された場合にそのデータを前記CPUに送信することを特徴とする請求項17に記載の割り込み支援方法。
【0028】
請求項4又は18に記載の発明によれば、各種処理のデータ要求をCPUから受信し、そのデータ要求に対応するデータを、読み出し速度の速いキャッシュメモリから検索してCPUに送信するので、CPUにおいて各種処理の応答速度を高めることができる。
【0029】
請求項19に記載の発明は、請求項18に記載の割り込み支援方法において、
前記データ要求に対応するデータが前記キャッシュメモリから検索されない場合に、前記データ要求に対応するデータを前記メインメモリから受信し、そのデータを前記CPUに送信することを特徴とする。
【0030】
請求項5又は19に記載の発明によれば、キャッシュメモリからデータ要求に対応するデータが検索されない場合に、そのデータをメインメモリからCPUへ直接送信させるので、キャッシュメモリにデータを記憶する動作負担の増大を防ぎ、CPUにおいて各種処理の応答時間を短縮することができる。
【0031】
請求項20に記載の発明は、請求項15から19のいずれか一項に記載の割り込み支援方法において、
前記メインメモリから送信された前記割り込み処理に用いるデータを前記キャッシュメモリに格納させる場合に、そのデータの読み出しを有効にして前記キャッシュメモリに格納させ、前記キャッシュメモリに格納されたデータを前記CPUに送信した場合に、その送信されたデータの読み出しを無効にして前記キャッシュメモリに格納させることを特徴とする。
【0032】
請求項6又は20に記載の発明によれば、読み出しが有効か無効かの旨とともにデータがキャッシュメモリに格納されるので、キャッシュメモリの無効なデータをクリアして有効なデータを格納させ、キャッシュメモリ上の有効なデータの記憶効率を高めることができる。
【0033】
請求項21に記載の発明は、請求項15から20のいずれか一項に記載の割り込み支援方法において、
前記キャッシュメモリの記憶領域は、複数のチャネルに分割され、
1種類の割り込みに対応するデータを1つのチャネルに格納させることを特徴とする。
【0034】
請求項7又は21に記載の発明によれば、複数のチャネルそれぞれに、1種類の割り込みに対応するデータを格納させるので、チャネルを管理して、キャッシュメモリ上に同一の割り込みに対応する複数のデータを無駄に記憶させることを防ぐことができる。
【0035】
請求項22に記載の発明は、請求項15から21のいずれか一項に記載の割り込み支援方法において、
各割り込みの発生間隔をカウントし、
前記カウントされた所定の割り込みに対応するカウンタ値が、前記各割り込みの発生の基準となる基準間隔値に対応する場合に、その割り込みに対応する予測信号を生成することを特徴とする。
【0036】
請求項8又は22に記載の発明によれば、所定の割り込みに対応するカウンタ値が、その割り込みの基準間隔値に対応する場合に、その割り込みに対応する予測信号を生成するので、基準間隔値に基づいて発生時間に規則性を有する又は有しない割り込み処理を予測して予測信号を生成することができる。
【0037】
請求項23に記載の発明は、請求項22に記載の割り込み支援方法において、
過去に発生した各割り込みの発生間隔を平均し、
前記平均された各割り込みの発生間隔を基準間隔値とすることを特徴とする。
【0038】
請求項9又は23に記載の発明によれば、過去に発生した所定の割り込みの発生間隔を平均して基準間隔値とするので、現在までの発生傾向を含む基準間隔値により、より正確に割り込みを予測して予測信号を生成することができる。
【0039】
請求項24に記載の発明は、請求項22又は23に記載の割り込み支援方法において、
前記所定の割り込みが周期的割り込みであり、
前記カウントされた前記周期的割り込みに対応するカウンタ値が、前記周期的割り込みに対応する基準間隔値を超える所定時間前に、その周期的割り込みに対応する予測信号を生成することを特徴とする。
【0040】
請求項10又は24に記載の発明によれば、所定の周期的割り込みに対応するカウンタ値が、その周期的割り込みに対応する基準間隔値を超える所定時間前に、その周期的割り込みに対応する予測信号を生成するので、周期的割り込みを予測して予測信号を生成することができる。
【0041】
請求項25に記載の発明は、請求項22から24のいずれか一項に記載の割り込み支援方法において、
前記所定の割り込みが、第1の割り込み発生後に所定間隔で発生する関連型割り込みとしての第2の割り込みであり、
前記第1の割り込みの発生間隔をカウントし、
前記カウントされた前記第1の割り込みに対応するカウンタ値が、前記第1の割り込み発生からの前記第2の割り込みの発生間隔に対応する基準間隔値を超える所定時間前に、その第2の割り込みに対応する予測信号を生成することを特徴とする。
【0042】
請求項11又は25に記載の発明によれば、所定の第1の割り込みに対応するカウンタ値が、その第1の割り込み発生からの第2の割り込みの発生間隔に対応する基準間隔値を超える所定時間前に、その第2の割り込みに対応する予測信号を生成するので、関連型割り込みを予測して予測信号を生成することができる。
【0043】
請求項26に記載の発明は、請求項22から25のいずれか一項に記載の割り込み支援方法において、
前記所定の割り込みがランダムに発生するランダム割り込みであり、
発生時間に規則性を有する規則的割り込みの発生間隔をカウントし、
前記カウントされたカウンタ値が、前記規則的割り込みに対応する基準間隔値を超えた場合に、前記ランダム割り込みに対応する予測信号を生成することを特徴とする。
【0044】
請求項12又は26に記載の発明によれば、規則的割り込みに対応するカウンタ値が、規則的割り込みに対応する基準間隔値を超えた場合に、ランダム割り込みの種類に対応する予測信号を生成するので、ランダム割り込みを予測して予測信号を生成することができる。
【0045】
請求項27に記載の発明は、請求項17から26のいずれか一項に記載の割り込み支援方法において、
前記キャッシュメモリの記憶領域を参照し、前記記憶領域に対する空き領域の割合が所定量以上である場合に、所定の割り込みに対応する投機フェチ要求を生成させるための投機フェチ開始要求を生成して、その投機フェチ要求を生成させることを特徴とする。
【0046】
請求項13又は27に記載の発明によれば、キャッシュメモリの記憶領域に対する空き領域の割合が所定量以上である場合に、投機フェチ開始要求を生成してその投機フェチ要求を生成させるので、その投機フェチ開始要求に対応するデータがキャッシュメモリに記憶されて、キャッシュメモリ上のデータの記憶効率を高め、割り込み処理に対応するデータをキャッシュメモリから読み出す確率を高めて、割り込み処理の応答速度をさらに高めることができる。
【0047】
請求項14に記載の発明によれば、請求項1から13のいずれか一項に記載の割り込み支援回路装置を用いるので、請求項1から13のいずれか一項の効果とともに、CPUで実行される割り込み処理の種類を限定することなくその応答時間を短縮することができる。
【0048】
【発明の実施の形態】
以下、添付図面を参照して、本発明に係る第1、第2及び第3の実施の形態並びに変形例を順に説明する。
【0049】
(第1の実施の形態)
図1〜図6を参照して第1の実施の形態を説明する。先ず、図1〜図4を参照して、本実施の形態の装置の特長を説明する。図1は、本実施の形態のマイクロコンピュータ1の構成を示す図である。図2は、割り込み予測部24の内部構成を示す図である。図3は、本実施の形態における割り込み予測実行部241の内部構成を示す図である。図4は、キャッシュメモリ242に記憶されるデータの構成を示す図である。
【0050】
図1に示すように、本実施の形態に係るマイクロコンピュータ1は、各種データを記憶するRAMなどのメインメモリ30とデータが送受信可能に接続されている。マイクロコンピュータ1は、CPUコア10と、割り込みが発生した場合にCPUコア10における割り込み処理の実行を支援する割り込み支援回路装置としての割り込み支援ブロック20とを備える。CPUコア10は、図示しないが、各種データを記憶する内蔵キャッシュと、各種データを用いて各種演算を行う演算部とを有する。
【0051】
CPUコア10とは、CPUの中心部分である。CPUコア10のみにより、あるいはCPUコア10と2次キャッシュなどの周辺回路とによりCPUが構成される。本実施の形態では、CPUコア10を用いて説明するが、CPUコア10に代えてCPUとして構成してもよい。
【0052】
一般に、割り込みの種類として、周期的に発生する割り込みや、ある所定の割り込みの発生後に、その割り込みに対応して発生する別の所定の割り込みや、発生の時間的に規則性のないランダムな割り込みなどがある。本実施の形態において、割り込みとして、所定の時間間隔で周期的に発生する周期的割り込みを扱うものとする。
【0053】
割り込み支援ブロック20は、各部を制御する制御部21と、CPUコア10との通信を介するCPUインタフェース22と、CPUコア10−CPUインタフェース22間で送受信されるデータ信号の増幅を行うバッファアンプ23a,23bと、起こり得る割り込みを予測して、その予測された割り込みの割り込み処理に用いるデータを格納する割り込み予測部24と、データの通信路を選択するセレクタ25,26と、メインメモリ30との通信を介するメモリインタフェース27と、メインメモリ30−メモリインタフェース27間で送受信されるデータ信号の増幅を行うバッファアンプ28a,28bとを備える。
【0054】
CPUコア10からCPUインタフェース22へ送信されるデータ信号は、バッファアンプ23aにより増幅される。CPUインタフェース22からCPUコア10へ送信されるデータ信号は、バッファアンプ23bにより増幅される。また、メモリインタフェース27からメインメモリ30へ送信されるデータ信号は、バッファアンプ28aにより増幅される。メインメモリ30からメモリインタフェース27へ送信されるデータ信号は、バッファアンプ28bにより増幅される。
【0055】
割り込み予測部24は、CPUインタフェース22と、セレクタ26と接続されて、CPUインタフェース22(CPUコア10側)からのデータ信号が入力され、セレクタ26(メインメモリ30側)へのデータ信号を出力する。また、割り込み予測部24は、メモリインタフェース27と、セレクタ25と接続されて、メモリインタフェース27(メインメモリ30側)からのデータ信号が入力され、セレクタ25(CPUコア10側)へのデータ信号を出力する。
【0056】
セレクタ26は、CPUインタフェース22からメモリインタフェース27へのデータ送信路を、割り込み予測部24を経由する伝送路と、割り込み予測部24を経由しないバイパスBP1とから選択する。セレクタ25は、メモリインタフェース27からCPUインタフェース22へのデータ送信路を、割り込み予測部24を経由する伝送路と、割り込み予測部24を経由しないバイパスBP2とから選択する。また、割り込みが発生した場合の割り込み信号は、CPUコア10と割り込み予測部24とに入力される。セレクタ25,26は、制御部21により制御される。
【0057】
図2に示すように、割り込み予測部24は、実際に割り込み予測を行ってその予測された割り込みを示す予測信号を出力する割り込み予測実行部241と、割り込み処理に用いるデータ(以下、割り込み用データとする)を記憶するキャッシュメモリ242と、キャッシュメモリ242に記憶されたデータの検索及びキャッシュメモリ242の制御を行う検索制御部243と、予めメインメモリ30から投機フェチ(予測された割り込みの割り込み用データの読み出し)を行ってキャッシュメモリ242に新たな割り込み用データを記憶させるか否かを判別するプリフェチ判別部244と、投機フェチを行う場合に投機フェチ用の投機フェチ要求を生成する投機フェチ部235と、割り込み予測と直接割り込みとの割り込み用データの読み出しの優先順位を管理する調停部246とを備える。
【0058】
検索制御部243とプリフェチ判別部244とをまとめて、キャッシュメモリ制御部24Aとする。また、投機フェチ生成部245と調停部246とをまとめて、投機フェチ制御部24Bとする。
【0059】
図3に示すように、割り込み予測実行部241は、割り込み信号を受信することをトリガとしてカウントを行うカウンタ41Aと、カウンタ41Aのカウンタ値に所定単位時間ごとに所定数をインクリメントする加算部42Aと、割り込みの予測の基準となる基準間隔値を記憶する基準間隔記憶部43Aと、基準間隔記憶部43Aに記憶された基準間隔値とカウンタ41Aから出力されたカウント値との平均値を算出して出力する平均部44Aと、基準間隔記憶部43Aに記憶された基準間隔値とカウンタ41Aから出力されたカウント値との比較に基づいて、投機フェチを行わせるための予測信号を出力する予測信号生成部45Aとを備える。
【0060】
カウンタ41Aは、割り込み信号を受信した場合にカウンタ値がリセットされる。また、カウンタ41Aは、時間経過とともにカウンタ値が加算部42Aにより所定時間単位づつインクリメントされる。また、カウンタ41Aは、割り込み信号の入力とともにリセット直前のカウンタ値を平均部44Aに出力し、また、常にカウンタ値を予測信号生成部45Aに出力する。平均部44Aは、初回に入力されたカウンタ値を基準間隔記憶部43Aにそのまま出力する。
【0061】
基準間隔記憶部43Aは、初回に入力されたカウンタ値を基準間隔値として記憶する。また、基準間隔記憶部43Aは、割り込み信号を受信した場合に、記憶されている基準間隔値を平均部44A及び予測信号生成部45Aに出力する。平均部44Aは、割り込み発生によって2回目以降に入力されたカウンタ値と、基準間隔記憶部43Aから入力された基準間隔値との平均値を算出し、その平均値を基準間隔記憶部43Aに出力する。基準間隔記憶部43Aは、入力された平均値を基準間隔値として記憶する。
【0062】
基準間隔値は、周期的な割り込みが過去に発生した間隔の平均値を示し、次にいつ周期的な割り込みが発生かを予測する目安となる。予測信号生成部45Aは、入力されたカウンタ値と基準間隔値とを比較し、カウンタ値が基準間隔値を経過する所定時間前に予測信号を生成し、検索制御部243及び投機フェチ生成部245に出力する。予測信号には、発生が予測される割り込みに対応する割り込み処理に用いる命令データなどのデータの種類が含まれる。
【0063】
周期的に発生する周期的割り込みは、複数種類存在する。その種類が異なる割り込みどうしは、周期が異なるものもあれば、周期が同じものもある。割り込みの種類が異なれば、たとえ周期が同じでも発生のタイミングは異なる。よって、カウンタ41Aに記憶されるカウンタ値と、基準間隔記憶部43Aに記憶される基準間隔値とは、割り込みの種類ごとに別々に管理される。予測信号生成部45Aは、異なる割り込みの種類ごとに別々に予測信号を出力する。
【0064】
検索制御部243は、バッファアンプ23a及びCPUインタフェース22を介して、CPUコア10から各種処理に用いるデータのデータ要求を受信し、また、割り込み予測実行部241の予測信号生成部45Aから予測信号が入力される。各種処理とは、割り込み処理と、割り込み処理以外の通常処理とを含める。検索制御部243は、入力された予測信号に対応する割り込み用データを格納するチャネルをキャッシュメモリ242から選択する。また、検索制御部243は、受信したCPUコア10からのデータ要求に対応するデータをキャッシュメモリ242から検索する。
【0065】
キャッシュメモリ242は、記憶領域が複数のチャネルC0〜Cn(但し、nは自然数)に分割されている。各チャネルには、各割り込みに用いる命令データなどの割り込み用データが別々に格納される。各チャネルには、記憶領域単位である記憶ブロックを少なくとも1つ有し、1種類の割り込みに対応する割り込み用データを格納する。各チャネルは、1種類の割り込みに対応する1又は複数のデータを格納する。
【0066】
キャッシュメモリ242に記憶される割り込み用データは、例えば、図4に示すようなデータ構成となる。各チャネルに、格納されている割り込み用データの読み出しが有効か無効かを示す有効フラグと、格納されている割り込み用データ内の1又は複数のデータの内容とが記憶される。有効フラグは、格納されている割り込み用データが有効である場合が1であり、格納されている割り込み用データが無効である場合が0であるものとする。
【0067】
また、検索制御部243は、バッファアンプ28b及びメモリインタフェース27を介してメインメモリ30から送信された割り込み用データの、キャッシュメモリ242内の格納先のチャネルを選択する。選択されるチャネルは、データが格納されていないチャネルや、有効フラグが無効(=0)になっているチャネルである(以下、これらのチャネルを空きチャネルとする)。また、検索制御部243は、選択したチャネルをクリアし、メインメモリ30から送信されたデータを、そのクリアされたチャネル内へ格納させる制御を行い、その格納されたデータの有効フラグを1(有効)にする。
【0068】
また、検索制御部243は、CPUコア10からの信号により、要求された割り込み処理に対応するデータをキャッシュメモリ242内から検索し、検索された場合に、セレクタ25、CPUインタフェース22及びバッファアンプ23bを介して、その検索されたデータをキャッシュメモリ242からCPUコア10へ送信させる制御を行い、その送信されたデータの有効フラグを0(無効)にする。
【0069】
プリフェチ判別部244は、常にキャッシュメモリ242のチャネルC0〜Cnのデータの格納状態を調べ、空きチャネルが予め設定された所定数よりも多いか否かを判別する。空きチャネルが所定数以上の場合に、プリフェチ判別部244は、検索制御部243から各チャネルに対応付けられる割り込みの種類が入力されて、空きチャネルに対応する割り込みの種類を含む投機フェチ開始要求を生成して投機フェチ生成部245に入力する。
【0070】
投機フェチ生成部245は、割り込み予測実行部241の予測信号生成部45Aから予測信号が入力され、また、空きチャネルが所定数以上の場合にプリフェチ判別部244から投機フェチ開始要求が入力される。投機フェチ生成部245は、入力された予測信号に含まれる割り込みの種類に対応する投機フェチ要求を生成して調停部246に入力する。また、投機フェチ生成部245は、入力された投機フェチ開始要求に含まれる割り込みの種類に対応する投機フェチ要求を生成して調停部246に入力する。
【0071】
調停部246は、バッファアンプ23a及びCPUインタフェース22を介して、CPUコア10からの各種処理に用いるデータのデータ要求を受信し、割り込み予測実行部241の予測信号生成部45Aから投機フェチ要求が入力される。そのデータ要求と、その投機フェチ要求とのどちらを、メインメモリ30に送信するかの調停がとられる。調停部246は、例えば、データ要求に対応するデータが、検索制御部243によりキャッシュメモリ242から読み出されてCPUコア10側へ既に送信された場合に、入力されたデータ要求を破棄し、セレクタ26、メモリインタフェース27及びバッファアンプ28aを介して、投機フェチ要求をメインメモリ30に送信する。調停部246は、例えば、データ要求に対応するデータがキャッシュメモリ242からCPUコア10側へ既に送信されていない場合に、入力されたデータ要求を優先し、セレクタ26、メモリインタフェース27及びバッファアンプ28aを介して、データ要求をメインメモリ30に送信し、その送信後、投機フェチ要求をメインメモリ30に送信する。
【0072】
次に、図5〜図9を参照して、マイクロコンピュータ1の割り込み支援ブロック20における動作を説明する。図5は、投機フェチ処理を示すフローチャートである。図6は、プリフェチ処理を示すフローチャートである。図7は、読み出し処理を示すフローチャートである。図8は、1つの割り込みに対するマイクロコンピュータ1の動作の流れの一例を示す図である。図9は、2つの割り込みに対するマイクロコンピュータ1の動作の流れの一例を示す図である。
【0073】
先ず、図5を参照して、割り込み支援ブロック20において周期的割り込みを予測し、その予測された割り込みの割り込み用データをメインメモリ30から取り込み(投機フェチし)キャッシュメモリ242に格納させる投機フェチ処理を説明する。投機フェチ処理は、例えば、マイクロコンピュータ1を搭載する機器の起動をトリガとして実行される。マイクロコンピュータ1を搭載する機器の起動前には、キャッシュメモリ242にデータが格納されておらず、割り込みの種類とチャネルとの対応付けもされていないものとする。
【0074】
割り込みの発生により、随時、割り込み予測実行部241内のカウンタ41A及び基準間隔記憶部43Aに割り込み信号が入力される。図5に示すように、先ず、予測信号生成部45Aにより、カウンタ41Aに記憶された各割り込みに対応するカウンタ値が基準間隔記憶部43Aに記憶された基準間隔値−所定時間を超えたか否かが判別される(ステップS11)。基準間隔値が経過した場合に次の割り込みが発生するので、その所定時間前に、割り込み用データのキャッシュメモリ242への割り込みデータの格納処理を開始するためである。カウンタ値が基準間隔値−所定時間を超えていない場合(ステップS11;NO)、ステップS11に移行される。
【0075】
カウンタ値が基準間隔値−所定時間を超えた場合(ステップS11;YES)、予測信号生成部45Aにより、そのカウンタ値の割り込みに対応して割り込みの種類を含む予測信号が生成されて、検索制御部243及び投機フェチ生成部245に入力される(ステップS12)。そして、検索制御部243により、入力された予測信号に含まれる割り込みの種類に対応するキャッシュメモリ242のチャネルが選択される(ステップS13)。つまり、どの種類の割り込みを、どのチャネルに格納するかが設定され、その対応関係が以後、仮に固定される。また、選択されたチャネルは、検索制御部243によりデータ内容がクリアされる。また、ステップS13において、既に割り込みの種類とチャネルとが設定されている場合に、それらを再設定する構成でもよい。
【0076】
そして、投機フェチ生成部245により、入力された予測信号に含まれる割り込みの種類に対応する投機フェチ要求が生成されて調停部246に送信される。調停部246により、その投機フェチ要求と、CPUコア10からのデータ要求との調停がとられ、投機フェチ要求を送信する順番がまわってきた場合に、投機フェチ要求がセレクタ26、メモリインタフェース27及びバッファアンプ28aを介してメインメモリ30に送信される(ステップS14)。
【0077】
メインメモリ30において、受信した投機フェチ要求に基づく割り込み用データが読み出されて、割り込み支援ブロック20に送信される。そして、キャッシュメモリ242により、割り込み用データがバッファアンプ28b及びメモリインタフェース27を介してメインメモリ30から受信される。そして、検索制御部243により、ステップS13において選択されたチャネルに基づいて、割り込み用データをキャッシュメモリ242のチャネルに格納させ(ステップS15)、投機フェチ処理が終了される。
【0078】
次に、図6を参照して、割り込み支援ブロック20において、割り込み用データの読み出しに備えて、予め割り込み用データをメインメモリ30から取り込み(プリフェチし)キャッシュメモリ242に格納させるプリフェチ処理を説明する。プリフェチ処理は、所定の時間間隔で周期的に実行される処理とする。例えば、初回は、マイクロコンピュータ1を搭載する機器の起動をトリガとして実行される。
【0079】
図6に示すように、先ず、プリフェチ判別部244により、キャッシュメモリ242内の空きチャネルが認識され、その空きチャネルの数が所定数以上であるか否かが判別される(ステップS21)。空きチャネルの数が所定数以上でない場合(ステップS21;NO)、プリフェチ処理が終了される。
【0080】
空きチャネルの数が所定数以上である場合(ステップS21;YES)、プリフェチ判別部244により、その空きチャネルが割り込み処理の種類に対応付けて設定されているか否かが判別される(ステップS22)。具体的には、既に実行された図5のステップS13のチャネルの選択時に、空きチャネルに割り込みの種類が対応付けられているか否かが判別される。空きチャネルが設定されていない場合(ステップS22;NO)、プリフェチ処理が終了される。
【0081】
空きチャネルが設定されていている場合(ステップS22;YES)、プリフェチ判別部244により、割り込みの種類が対応付けられている空きチャネルが1つ選択され、その空きチャネルとその割り込みの種類とに基づいて、その割り込みの種類を含む投機フェチ開始要求が生成されて投機フェチ生成部245に入力される(ステップS23)。そして、投機フェチ生成部245により、入力された投機フェチ開始要求に含まれる割り込み処理の種類に対応する投機フェチ要求が生成されてメモリインタフェース27及びバッファアンプ28aを介してメインメモリ30に送信される(ステップS24)。ステップS24は、図5のステップS14と同様の処理である。
【0082】
そして、検索制御部243により、メインメモリ30から受信された割り込み用データを、ステップS23において選択されたキャッシュメモリ242の空きチャネルに格納させ(ステップS25)、プリフェチ処理が終了される。ステップS25は、図5のステップS15と同様の処理である。
【0083】
次に、図7を参照して、割り込み支援ブロック20において、CPUコア10において実行する各種処理に用いるデータ(ここでは、読み出しデータとする)を読み出す読み出し処理を説明する。CPUコア10から送信された読み出しデータのデータ要求を、バッファアンプ23a及びCPUインタフェース22を介して制御部21が受信したことをトリガとして、割り込み支援ブロック20において、読み出し処理が実行される。また、CPUコア10から送信されたデータ要求が、バッファアンプ23a及びCPUインタフェース22を介して、検索制御部243及び調停部246で受信される。
【0084】
図7に示すように、先ず、検索制御部243により、データ要求に対応する読み出しデータがキャッシュメモリ242から検索される(ステップS31)。そして、検索制御部243により、ステップS31において、読み出しデータがキャッシュメモリ242から検索されたか否か(キャッシュメモリ242に格納されているか否か)が判別される(ステップS32)。
【0085】
読み出しデータがキャッシュメモリ242に格納されている場合(ステップS32;YES)、検索制御部243により、読み出しデータがキャッシュメモリ242から読み出され、その読み出しデータが、セレクタ25、CPUインタフェース22及びバッファアンプ23bを介してCPUコア10に送信される(ステップS33)。
【0086】
そして、検索制御部243により、キャッシュメモリ242において、読み出されたチャネルに対応する有効フラグが無効に設定される(ステップS34)。また、調停部246により、CPUコア10側から送信されたデータ要求が破棄される。そして、読み出し処理が終了される。
【0087】
読み出しデータがキャッシュメモリ242に格納されていない場合(ステップS32;NO)、調停部246により、CPUコア10側から送信されたデータ要求が、セレクタ26、メモリインタフェース27及びバッファアンプ28aを介してメインメモリ30に送信される(ステップS36)。
【0088】
メインメモリ30において、受信したデータ要求に含まれる割り込みの種類に対応する読み出しデータが読み出されて、割り込み支援ブロック20に送信される。そして、制御部21により、読み出しデータがバッファアンプ28b、メモリインタフェース27、バイパスBP2、セレクタ25、CPUインタフェース22及びバッファアンプ23bを介してCPUコア10へ送信され(ステップS36)、読み出し処理が終了される。
【0089】
なお、CPUコア10において割り込み処理以外の通常処理が行われる場合に、その通常処理で用いるデータを、キャッシュメモリ242から検索及び読出ししない構成でもよい。この場合、その通常処理で用いるデータのデータ要求は、CPUコア10から、バッファアンプ23a、CPUインタフェース22、バイパスBP1、セレクタ26、メモリインタフェース27及びバッファアンプ28aを順に介してメインメモリ30に送信される。
【0090】
以上で説明した投機フェチ処理、プリフェチ処理及び読み出し処理は、それぞれ1種類の割り込みについての動作の流れである。実際には、複数種類の割り込みについての動作について、各割り込みについての動作がそれぞれ独立して行われることとなる。その際、各割り込みについての動作が重複して行われてもよい。
【0091】
また、図には示さないが、CPUコア10で各種処理が実行される場合に、実行中の処理で用いるデータ(以下、書き込みデータとする)をCPUコア10の内蔵キャッシュから一時的に退避させてメインメモリ30に記憶させる場合がある。先ず、CPUコア10から書き込みデータが割り込み支援ブロック20に送信される。そして、制御部21により、CPUコア10から送信された書き込みデータが、バッファアンプ23a、CPUインタフェース22、バイパスBP1、セレクタ26、メモリインタフェース27及びバッファアンプ28aを介して、メインメモリ30に送信される。そして、メインメモリ30により、受信された書き込みデータが記憶される。
【0092】
ここで、図8を参照して、CPUコア10における通常処理の実行中に、1つの割り込みが発生した場合におけるマイクロコンピュータ1の動作の流れの一例を説明する。図8の上から下方に時間が流れているものとし、1つの種類の割り込みを割り込みI1とする。
【0093】
図8に示すように、先ず、CPUコア10において通常処理が実行されている。▲1▼において、割り込み予測部24により割り込みI1に対応する予測信号が生成され、その投機フェチ要求が生成されてメインメモリ30に送信される(図5のステップS11〜S14に対応)。そして▲2▼において、メインメモリ30により、割り込みI1に対応する割り込み用データが読み出されて割り込み支援ブロック20に送信される。そして、割り込み予測部24により、割り込み用データが受信されてキャッシュメモリ242に格納される(図5のステップS15に対応)。
【0094】
そして、▲3▼において、割り込みI1が発生し、割り込みI1に対応する割り込み信号がCPUコア10と割り込み予測部24とに送信される。そして、▲4▼において、割り込み予測部24により割り込みI1に対応する割り込み用データが、読み出し速度の速いキャッシュメモリ242から読み出されてCPUコア10に送信される(図7のステップS31〜S34に対応)。よって、割り込みI1の割り込み処理を応答時間を短縮して実行することができる。
【0095】
次に、図9を参照して、CPUコア10における通常処理の実行中に、2種類の割り込みが発生した場合におけるマイクロコンピュータ1の動作の流れの一例を説明する。2つの種類の割り込みは、周期の異なる別の種類で、それぞれ割り込みI1,I2とし、割り込みI1が割り込みI2よりも優先順位が高いものとする。
【0096】
図9に示すように、▲5▼において、図8の▲1▼と同様に、割り込み予測部24により、割り込みI1,I2に対応する予測信号が順に別々に生成され、その投機フェチ要求が生成されてメインメモリ30に送信される。また、割り込みI1の割り込み用データの格納先は、キャッシュメモリ242のチャネルC1とし、割り込みI1の割り込み用データの格納先は、チャネルC2であると設定されたものとする。
【0097】
そして、▲6▼において、図8の▲2▼と同様に、割り込み予測部24において、割り込みI1,I2に対応する割り込み用データがメインメモリ30から受信されて、それぞれ、キャッシュメモリ242のチャネルC1,C2に格納される。そして、▲7▼において、図8の▲3▼と同様に、割り込みI1,I2が順に発生して、その割り込み信号がCPUコア10及び割り込み予測部24に送信される。
【0098】
そして、▲8▼において、図8の▲4▼と同様に、割り込みI1に対応する割り込み用データがCPUコア10に送信され、割り込みI1に対応する割り込み処理が実行される。優先順位の低い割り込みI2に対応する割り込み用データは、割り込みI1に対応する割り込み処理の実行後にCPUコア10に送信され、割り込みI2に対応する割り込み処理が実行される。
【0099】
よって、本実施の形態によれば、予測された割り込みの割り込み用データを、その割り込み処理の開始前に、読み出し速度の速いキャッシュメモリ242に格納して、データ要求に基づいてその割り込み用データをCPUコア10に送信するので、割り込みが発生した場合にCPUコア10がすみやかに割り込み用データを取得して割り込み処理を実行でき、割り込み処理の種類を限定することなく割り込み処理の応答時間を短縮することができる。
【0100】
また、各種処理のデータ要求をCPUコア10から受信し、そのデータ要求に対応するデータを、読み出し速度の速いキャッシュメモリ242から検索してCPUコア10に送信するので、CPUコア10において各種処理の応答速度を高めることができる。また、キャッシュメモリ242からデータ要求に対応するデータが検索されない場合に、そのデータをメインメモリ30からCPUコア10へ直接送信させるので、キャッシュメモリ30にデータを記憶させる動作負担の増大を防ぎ、CPUコア10において各種処理の応答時間を短縮することができる。
【0101】
また、有効フラグにより読み出しが有効か無効かの旨とともにデータがキャッシュメモリ242に格納されるので、キャッシュメモリ242の無効な割り込み用データをクリアして有効なデータを格納させ、キャッシュメモリ242の有効な割り込み用データの記憶効率を高めることができる。
【0102】
また、複数のチャネルC0〜Cnそれぞれに、1種類の割り込みに対応する割り込み用データを格納させるので、チャネルを管理して、キャッシュメモリ242上に同一の割り込みに対応する複数の割り込み用データを無駄に記憶させることを防ぐことができる。
【0103】
また、所定の周期的割り込みに対応するカウンタ41Aのカウンタ値が、その周期的割り込みに対応する基準間隔値を超える所定時間前に、その周期的割り込みの種類に対応する予測信号を予測信号生成部45Aで生成するので、周期的割り込みを予測して予測信号を生成することができる。
【0104】
また、平均部44Aにより過去に発生した所定の割り込みの発生間隔を平均して基準間隔値とするので、現在までの発生傾向を含む基準間隔値により、より正確に割り込みを予測して予測信号を生成することができる。
【0105】
また、プリフェチ判別部244によりキャッシュメモリ242の空きチャネルが所定数以上である場合に、投機フェチ開始要求を生成して投機フェチ生成部245に入力するので、その投機フェチ開始要求に対応する割り込み用データがキャッシュメモリ242に記憶されて、キャッシュメモリ242上の割り込み用データの記憶効率を高め、割り込み用データをキャッシュメモリ242から読み出す確率を高めて、割り込み処理の応答時間をさらに短縮することができる。
【0106】
(第2の実施の形態)
図10を参照して、第2の実施の形態を説明する。図10は、本実施の形態における割り込み予測実行部241の内部構成を示す図である。本実施の形態は、第1の実施の形態と、割り込み予測部241の内部構成を異にするものであり、説明の重複を避けるため、同様な部分の説明を省略する。
【0107】
第1の実施の形態は、周期的に発生する周期的割り込みを対象としていたが、本実施の形態では、第1の割り込みと第2の割り込みの発生に関連性があり、第1の割り込みが発生した後に、所定の時間間隔をおいて第2の割り込みが発生する構成を対象とする。このような割り込みを関連型割り込みとする。
【0108】
図10に示すように、本実施の形態のマイクロコンピュータ1の割り込み支援ブロック20の割り込み予測部24内の割り込み予測実行部241は、第1の割り込み信号を受信することをトリガとしてカウントを行うカウンタ41Bと、カウンタ41Bのカウンタ値に所定単位時間ごとに所定数をインクリメントする加算部42Bと、割り込みの予測の基準となる基準間隔値を記憶する基準間隔記憶部43Bと、基準間隔記憶部43Bに記憶された基準間隔値とカウンタ41Bから出力されたカウント値との平均値を算出して出力する平均部44Bと、基準間隔記憶部43Bに記憶された基準間隔値とカウンタ41Bから出力されたカウント値との比較に基づいて、投機フェチを行わせるための予測信号を出力する予測信号生成部45Bとを備える。
【0109】
カウンタ41Bは、第1の割り込み信号を受信した場合にカウンタ値がリセットされる。また、カウンタ41Bは、時間経過とともにカウンタ値が加算部42Bにより所定時間単位づつインクリメントされる。また、カウンタ41Bは、第1の割り込み信号の入力とともにリセット直前のカウンタ値を平均部44Bに出力し、また、常にカウンタ値を予測信号生成部45Bに出力する。平均部44Bは、初回に入力されたカウンタ値を基準間隔記憶部43Bにそのまま出力する。
【0110】
基準間隔記憶部43Bは、入力されたカウンタ値を基準間隔値として記憶する。また、基準間隔記憶部43Bは、第2の割り込み信号を受信した場合に、記憶されている基準間隔値を平均部44B及び予測信号生成部45Bに出力する。平均部44Bは、第1の割り込み発生によって2回目以降に入力されたカウンタ値と、基準間隔記憶部43Bから入力された基準間隔値との平均値を算出し、その平均値を基準間隔記憶部43Bに出力する。基準間隔記憶部43Bは、入力された平均値を基準間隔値として記憶する。
【0111】
基準間隔値は、過去に発生した第1の割り込みの発生から第2の割り込みの発生までの時間間隔の平均値を示し、第1の割り込みの発生後にいつ第2の割り込みが発生かを予測する目安となる。予測信号生成部45Bは、入力されたカウンタ値と基準間隔値とを比較し、カウンタ値が基準間隔値を経過する所定時間前に、第2の割り込みに対応する予測信号を生成し、検索制御部243及び投機フェチ生成部245に出力する。予測信号には、発生が予測される第2の割り込みの種類が含まれる。
【0112】
また、マイクロコンピュータ1における動作も、第1の実施の形態と同様である。第1の割り込みの発生により、随時、割り込み予測実行部241内のカウンタ41Bに第1の割り込み信号が入力され、第2の割り込みの発生により、随時、基準間隔記憶部43Bに第2の割り込み信号が入力される。本実施の形態の動作として、図5の投機フェチ処理のステップS11において、先ず、予測信号生成部45Bにより、カウンタ41Bに記憶された第1の割り込み発生後のカウンタ値が、基準間隔記憶部43Bに記憶された基準間隔値−所定時間を超えたか否かが判別される。本実施の形態の動作において、投機フェチ処理におけるステップS11の後のステップと、プリフェチ処理と、読み出し処理とは、第1の実施の形態と同様である。
【0113】
よって、本実施の形態によれば、所定の第1の割り込みに対応するカウンタ41Bのカウンタ値が、その第1の割り込み発生からの第2の割り込みの発生間隔に対応する基準間隔値を超える所定時間前に、その第2の割り込みの種類に対応する予測信号を予測信号生成部45Bで生成するので、関連型割り込みを予測して予測信号を生成することができる。
【0114】
(第3の実施の形態)
図11を参照して、第3の実施の形態を説明する。図11は、本実施の形態における割り込み予測実行部241の内部構成を示す図である。本実施の形態は、第1の実施の形態と、割り込み予測部241の内部構成を異にするものであり、説明の重複を避けるため、同様な部分の説明を省略する。
【0115】
第1の実施の形態が周期的に発生する周期的割り込みを対象とし、第2の実施の形態が関連型割り込みを対象としていた。本実施の形態では、周期的割り込みにも関連型割り込みにも当てはまらなく、発生時間が規則的でないランダムに発生するランダム割り込みを対象とする構成である。
【0116】
図11に示すように、本実施の形態のマイクロコンピュータ1の割り込み支援ブロック20の割り込み予測部24内の割り込み予測実行部241は、周期的割り込み及び割り込みなどの規則的割り込みを受信することをトリガとしてカウントを行うカウンタ41Cと、カウンタ41Cのカウンタ値に所定単位時間ごとに所定数をインクリメントする加算部42Cと、基準間隔値を記憶し、その規則的割り込みの発生後から基準間隔値を超えても、次の規則的割り込みが発生しない場合に、投機フェチを行わせるための予測信号を出力する予測信号生成部45Cとを備える。
【0117】
カウンタ41Cは、規則的割り込み信号を受信した場合にカウンタ値がリセットされる。また、カウンタ41Cは、時間経過とともにカウンタ値が加算部42Cにより所定時間単位づつインクリメントされる。また、カウンタ41Bは、常にカウンタ値を予測信号生成部45Cに出力する。
【0118】
基準間隔値は、規則的割り込みの発生後から、次の規則的割り込みが発生していないと判別されるまでの時間間隔を示す値であり、次にいつランダム割り込みが発生かを予測する目安となる。言い換えれば、規則的割り込みの発生後から、基準間隔値を経過しても、次の規則的割り込みが発生しない場合に、ランダム割り込みが発生すると予測される。予測信号生成部45Cは、予め記憶された基準間隔値と、カウンタ41Cから入力されるカウンタ値とを常に比較し、カウンタ値が基準間隔値を経過すると、ランダム割り込みに対応する予測信号を生成し、検索制御部243及び投機フェチ生成部245に出力する。予測信号には、発生が予測されるランダム割り込みに対応する割り込み処理に用いる命令データなどのデータの種類が含まれる。
【0119】
また、マイクロコンピュータ1における動作も、第1の実施の形態と同様である。規則的割り込みの発生により、随時、割り込み予測実行部241内のカウンタ41Cに規則的割り込み信号が入力される。本実施の形態の動作として、図5の投機フェチ処理のステップS11に代えて、先ず、予測信号生成部45Cにより、カウンタ41Cに記憶された規則的割り込み発生後のカウンタ値が、予め記憶された基準間隔値を超えたか否かが判別される。本実施の形態の動作において、投機フェチ処理におけるステップS11の後のステップと、プリフェチ処理と、読み出し処理とは、第1の実施の形態と同様である。
【0120】
よって、本実施の形態によれば、周期的及び関連型割り込みなどの規則的割り込みに対応するカウンタ値が、規則的割り込みに対応する基準間隔値を超えた場合に、ランダム割り込みの種類に対応する予測信号を予測信号生成部45Cで生成するので、ランダム割り込みを予測して予測信号を生成することができる。
【0121】
(変形例)
図12を参照して、第1の実施の形態の変形例を説明する。図12は、本変形例における割り込み予測実行部241の内部構成を示す図である。本変形例は、第1の実施の形態と、割り込み予測部241の内部構成を異にするものであり、説明の重複を避けるため、同様な部分の説明を省略する。本変形例は、第1の実施の形態と同様に、周期的に発生する周期的割り込みを対象とする。
【0122】
図12に示すように、本実施の形態のマイクロコンピュータ1の割り込み支援ブロック20の割り込み予測部24内の割り込み予測実行部241は、カウンタ41Aと、加算部42Aと、各周期的割り込みの基準周期としての基準間隔値を有する基準テーブルを記憶する基準間隔記憶部46と、カウンタ41Aから出力されたカウンタ値と基準間隔記憶部46に記憶された基準テーブルの基準間隔値との比較に基づいて、投機フェチを行わせるための予測信号を出力する予測信号生成部47とを備える。
【0123】
基準テーブルには、予め設定された、各周期的割り込みの種類を識別する識別番号と、その識別番号に対応する周期である基準間隔値とが格納される。基準間隔値は、次にいつ各割り込みが発生かを予測する目安となる。予測信号生成部47は、入力されたカウンタ値と基準間隔値とを比較し、カウンタ値が基準間隔値を経過する所定時間前に、第2の割り込みに対応する予測信号を生成し、検索制御部243及び投機フェチ生成部245に出力する。予測信号には、発生が予測される第2の割り込みに対応する割り込み処理に用いる割り込み用データの種類が含まれる。
【0124】
また、マイクロコンピュータ1における動作も、第1の実施の形態と同様である。周期的割り込みの発生により、随時、割り込み予測実行部241内のカウンタ41Aに割り込み信号が入力される。本変形例の動作として、図5の投機フェチ処理のステップS11において、先ず、予測信号生成部47により、カウンタ41Aに記憶された、ある周期的割り込みに対応するカウンタ値が、基準間隔記憶部46に記憶された基準テーブルの、前記周期的割り込みに対応する基準間隔値−所定時間を超えたか否かが判別される。本変形例の動作において、投機フェチ処理におけるステップS11の後のステップと、プリフェチ処理と、読み出し処理とは、第1の実施の形態と同様である。
【0125】
よって、本変形例によれば、所定の周期的割り込みに対応するカウンタ41Aのカウンタ値が、その周期的割り込みに対応する基準テーブルの基準間隔値を超える所定時間前に、その周期的割り込みの種類に対応する予測信号を予測信号生成部45Aで生成するので、周期的割り込みを予測して予測信号を生成することができる。
【0126】
なお、第1及び第2の実施の形態において、平均部44A,44Bにより平均された割り込みの発生間隔を基準間隔値として基準間隔記憶部43A,43Bに記憶する構成であったが、平均部44A,44Bを設けることなく、所定の基準間隔値を固定して、平均化しない構成でもよい。
【0127】
また、第1、第2及び第3の実施の形態において、それぞれ、周期的割り込み、関連型割り込み及びランダム割り込みを予測する構成であったが、第1、第2及び第3の実施の形態のうちの複数を組合せて、周期的割り込み、関連型割り込み及びランダム割り込みのうちの少なくとも2つを予測する構成でもよい。また、変形例の基準テーブルを用いる構成をさらに組合わせてもよい。また、変形例の基準テーブルを用いる構成を第2、第3の実施の形態に適用してもよい。
【0128】
また、第1、第2及び第3の実施の形態並びに変形例において、割り込み支援ブロック20は、CPUコア10に外付けされる構成であったが、割り込み回路装置としてCPUコア10とともに一体に形成される構成などでもよい。
【0129】
また、第1、第2及び第3の実施の形態並びに変形例において、キャッシュメモリ242内に記憶されているデータは、マイクロコンピュータ1を搭載する機器の電源オフにより消去されるが、これに限るものでなく、電源オフ後もデータが記憶保持される構成でもよい。
【0130】
以上、本発明の実施の形態につき説明したが、本発明は、必ずしも上述した手段及び手法にのみ限定されるものではなく、本発明にいう目的を達成し、本発明にいう効果を有する範囲内において適宜に変更実施が可能なものである。
【0131】
【発明の効果】
請求項1又は15に記載の発明によれば、予測された割り込みの割り込み処理に用いるデータを、読み出し速度の速いキャッシュメモリに格納して、データ要求に基づいてそのデータをCPUに送信するので、割り込みが発生した場合にCPUがすみやかに割り込み処理で用いるデータを取得して割り込み処理を実行でき、割り込み処理の種類を限定することなく割り込み処理の応答時間を短縮することができる。
【0132】
請求項2又は16に記載の発明によれば、予測された割り込みの割り込み処理の開始前に、その割り込み処理に用いるデータを読み出し速度の速いキャッシュメモリに格納するので、割り込み処理の応答時間を短縮することができる。
【0133】
請求項3又は17に記載の発明によれば、発生する割り込みを予測して、その予測信号に基づいて投機フェチ要求を生成してメインメモリに送信し、メインメモリから送信された、その投機フェチ要求に対応する前記割り込み処理に用いるデータをキャッシュメモリに格納させることができる。
【0134】
請求項4又は18に記載の発明によれば、各種処理のデータ要求をCPUから受信し、そのデータ要求に対応するデータを、読み出し速度の速いキャッシュメモリから検索してCPUに送信するので、CPUにおいて各種処理の応答速度を高めることができる。
【0135】
請求項5又は19に記載の発明によれば、キャッシュメモリからデータ要求に対応するデータが検索されない場合に、そのデータをメインメモリからCPUへ直接送信させるので、キャッシュメモリにデータを記憶する動作負担の増大を防ぎ、CPUにおいて各種処理の応答時間を短縮することができる。
【0136】
請求項6又は20に記載の発明によれば、読み出しが有効か無効かの旨とともにデータがキャッシュメモリに格納されるので、キャッシュメモリの無効なデータをクリアして有効なデータを格納させ、キャッシュメモリ上の有効なデータの記憶効率を高めることができる。
【0137】
請求項7又は21に記載の発明によれば、複数のチャネルそれぞれに、1種類の割り込みに対応するデータを格納させるので、チャネルを管理して、キャッシュメモリ上に同一の割り込みに対応する複数のデータを無駄に記憶させることを防ぐことができる。
【0138】
請求項8又は22に記載の発明によれば、所定の割り込みに対応するカウンタ値が、その割り込みの基準間隔値に対応する場合に、その割り込みに対応する予測信号を生成するので、基準間隔値に基づいて発生時間に規則性を有する又は有しない割り込み処理を予測して予測信号を生成することができる。
【0139】
請求項9又は23に記載の発明によれば、過去に発生した所定の割り込みの発生間隔を平均して基準間隔値とするので、現在までの発生傾向を含む基準間隔値により、より正確に割り込みを予測して予測信号を生成することができる。
【0140】
請求項10又は24に記載の発明によれば、所定の周期的割り込みに対応するカウンタ値が、その周期的割り込みに対応する基準間隔値を超える所定時間前に、その周期的割り込みに対応する予測信号を生成するので、周期的割り込みを予測して予測信号を生成することができる。
【0141】
請求項11又は25に記載の発明によれば、所定の第1の割り込みに対応するカウンタ値が、その第1の割り込み発生からの第2の割り込みの発生間隔に対応する基準間隔値を超える所定時間前に、その第2の割り込みに対応する予測信号を生成するので、関連型割り込みを予測して予測信号を生成することができる。
【0142】
請求項12又は26に記載の発明によれば、規則的割り込みに対応するカウンタ値が、規則的割り込みに対応する基準間隔値を超えた場合に、ランダム割り込みに対応する予測信号を生成するので、ランダム割り込みを予測して予測信号を生成することができる。
【0143】
請求項13又は27に記載の発明によれば、キャッシュメモリの記憶領域に対する空き領域の割合が所定量以上である場合に、投機フェチ開始要求を生成してその投機フェチ要求を生成させるので、その投機フェチ開始要求に対応するデータがキャッシュメモリに記憶されて、キャッシュメモリ上のデータの記憶効率を高め、割り込み処理に対応するデータをキャッシュメモリから読み出す確率を高めて、割り込み処理の応答速度をさらに高めることができる。
【0144】
請求項14に記載の発明によれば、請求項1から13のいずれか一項に記載の割り込み支援回路装置を用いるので、請求項1から13のいずれか一項の効果とともに、CPUで実行される割り込み処理の種類を限定することなくその応答時間を短縮することができる。
【図面の簡単な説明】
【図1】本発明に係る第1の実施の形態のマイクロコンピュータ1の構成を示す図である。
【図2】割り込み予測部24の内部構成を示す図である。
【図3】第1の実施の形態における割り込み予測実行部241の内部構成を示す図である。
【図4】キャッシュメモリ242に記憶されるデータの構成を示す図である。
【図5】投機フェチ処理を示すフローチャートである。
【図6】プリフェチ処理を示すフローチャートである。
【図7】読み出し処理を示すフローチャートである。
【図8】1つの割り込みに対するマイクロコンピュータ1の動作の流れの一例を示す図である。
【図9】2つの割り込みに対するマイクロコンピュータ1の動作の流れの一例を示す図である。
【図10】本発明に係る第2の実施の形態における割り込み予測実行部241の内部構成を示す図である。
【図11】本発明に係る第3の実施の形態における割り込み予測実行部241の内部構成を示す図である。
【図12】第1の実施の形態の変形例における割り込み予測実行部241の内部構成を示す図である。
【符号の説明】
1…マイクロコンピュータ
10…CPUコア
20…割り込み支援ブロック
21…制御部
22…CPUインタフェース
23a,23b,28a,28b…バッファアンプ
24…割り込み予測部
241…割り込み予測実行部
242…キャッシュメモリ
24A…キャッシュメモリ制御部
243…検索制御部
244…プリフェチ判別部
24B…投機フェチ制御部
245…投機フェチ生成部
246…調停部
41A,41B,41C…カウンタ
42A,42B,42C…加算部
43A,43B,46…基準間隔記憶部
44A,44B…平均部
45A,45B,45C,47…予測信号生成部
25,26…セレクタ
27…メモリインタフェース
30…メインメモリ
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an interrupt support circuit device that supports an interrupt, a microcomputer having the interrupt support device, and an interrupt support method.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, there has been a real-time system in which, when a processing execution request is issued, the processing is immediately executed in a microcomputer. In a real-time system, it is necessary to switch the process to be executed from the normal process to the interrupt process within a predetermined time in response to an interrupt generated during the execution of the normal process. For example, avoiding the obstacle within a specified time after the sensor detects the obstacle. In this case, the input of the detection signal of the sensor is notified as an interrupt.
[0003]
Further, a configuration for quickly responding to an interrupt has been considered. As an example, data used for interrupt processing is stored in advance in an instruction RAM (Random Access Memory) as a cache inside the microcomputer, and when an interrupt occurs, the source of the data is read from the normal instruction cache for the interrupt. By switching to the instruction RAM, the response time for executing the interrupt processing can be shortened (for example, see Patent Document 1).
[0004]
[Patent Document 1]
JP-A-2002-49607
[0005]
[Problems to be solved by the invention]
However, in the invention described in Patent Document 1, the data stored in the instruction RAM for interruption is determined and stored in advance, and is not updated. For this reason, there has been a problem that a CPU (Central Processing Unit) can execute only an interrupt process corresponding to data stored in the instruction RAM in advance. In this regard, since the capacity of the instruction RAM is limited, there is a problem that only a limited type of interrupt processing corresponding to the capacity can be executed.
[0006]
An object of the present invention is to reduce the response time of interrupt processing without limiting the type of interrupt.
[0007]
[Means for Solving the Problems]
The invention according to claim 1 is an interrupt support circuit device that supports communication of data used for interrupt processing from a main memory to a CPU,
A CPU interface for communicating with the CPU;
A memory interface for communicating with the main memory;
A cache memory for storing data, predicting an interrupt to occur, reading data used for interrupt processing of the interrupt from the main memory via the memory interface, storing the data in the cache memory, An interrupt prediction unit for transmitting the stored data to the CPU based on the data request of
A control unit that controls communication between the CPU and the main memory via the CPU interface and the memory interface.
[0008]
According to a second aspect of the present invention, in the interrupt support circuit device according to the first aspect,
The interrupt prediction unit stores data used for the interrupt processing in the cache memory before starting the interrupt processing of the predicted interrupt.
[0009]
According to a third aspect of the present invention, in the interrupt support circuit device according to the first or second aspect,
The interrupt prediction unit,
An interrupt prediction execution unit that predicts an interrupt to occur and outputs a prediction signal based on the interrupt;
A speculative fetish control unit that generates a speculative fetish request for reading data used for interrupt processing of the predicted interrupt based on the prediction signal output from the interrupt prediction execution unit and transmits the request to the main memory;
A cache memory control unit for storing data used for the interrupt processing transmitted from the main memory in the cache memory.
[0010]
According to a fourth aspect of the present invention, in the interrupt support circuit device according to the third aspect,
The cache memory control unit, when receiving data requests for various processes from the CPU via the CPU interface, searches the cache memory for data corresponding to the data requests. The data is transmitted to the CPU via the CPU interface.
[0011]
According to a fifth aspect of the present invention, in the interrupt support circuit device according to the fourth aspect,
The control unit, when the data corresponding to the data request is not retrieved from the cache memory by the cache memory control unit, receives data corresponding to the data request from the main memory via the memory interface, Data is transmitted to the CPU via the CPU interface.
[0012]
The invention according to claim 6 is the interrupt support circuit device according to any one of claims 3 to 5,
The cache memory control unit, when storing data used for the interrupt processing transmitted from the main memory in the cache memory, enables reading of the data, stores the data in the cache memory, and stores the data in the cache memory. When the transmitted data is transmitted to the CPU, reading of the transmitted data is invalidated and stored in the cache memory.
[0013]
According to a seventh aspect of the present invention, in the interrupt support circuit device according to any one of the third to sixth aspects,
The storage area of the cache memory is divided into a plurality of channels,
The cache memory control unit stores data corresponding to one type of interrupt in one channel.
[0014]
According to an eighth aspect of the present invention, in the interrupt support circuit device according to any one of the third to seventh aspects,
The interrupt prediction execution unit,
A counter that counts each interrupt occurrence interval,
A reference interval storage unit that stores a reference interval value serving as a reference for the occurrence of each interrupt;
When a counter value corresponding to a predetermined interrupt output from the counter corresponds to the reference interval value stored in the reference interval storage unit, a prediction signal generation unit that generates a prediction signal corresponding to the interrupt. It is characterized by having.
[0015]
According to a ninth aspect of the present invention, in the interrupt support circuit device according to the eighth aspect,
The interrupt prediction execution unit,
Equipped with an averaging unit that averages the interval between each interrupt that occurred in the past,
The reference interval storage unit stores the interrupt occurrence intervals averaged by the averaging unit as a reference interval value.
[0016]
According to a tenth aspect of the present invention, in the interrupt support circuit device according to the eighth or ninth aspect,
The predetermined interrupt is a periodic interrupt,
The prediction signal generation unit, a predetermined time before the counter value corresponding to the periodic interrupt output from the counter exceeds the reference interval value corresponding to the periodic interrupt stored in the reference interval storage unit, The method is characterized in that a prediction signal corresponding to the periodic interrupt is generated.
[0017]
The invention according to claim 11 is the interrupt support circuit device according to any one of claims 8 to 10, wherein
The predetermined interrupt is a second interrupt as a related interrupt generated at a predetermined interval after the first interrupt has occurred,
The counter counts an interval at which the first interrupt occurs,
The prediction signal generation unit may include a counter value corresponding to the first interrupt output from the counter, the counter value being stored in the reference interval storage unit, and the generation of the second interrupt from the generation of the first interrupt. A prediction signal corresponding to the second interrupt is generated a predetermined time before a reference interval value corresponding to the interval is exceeded.
[0018]
According to a twelfth aspect of the present invention, in the interrupt support circuit device according to any one of the eighth to eleventh aspects,
The predetermined interrupt is a random interrupt that occurs randomly,
The counter counts an interval of occurrence of a regular interrupt having a regularity in an occurrence time,
The prediction signal generation unit, when the counter value output from the counter exceeds the reference interval value corresponding to the regular interrupt stored in the reference interval storage unit, the prediction signal corresponding to the random interrupt Is generated.
[0019]
According to a thirteenth aspect of the present invention, in the interrupt support circuit device according to any one of the third to twelfth aspects,
The cache memory control unit refers to a storage area of the cache memory, and when a ratio of a free area to the storage area is equal to or more than a predetermined amount, a speculation fetish for generating a speculation fetish request corresponding to a predetermined interrupt A start request is input to the speculative fetish control unit.
[0020]
The invention according to claim 14 is
A CPU,
A microcomputer provided with the interrupt support circuit device according to any one of claims 1 to 13, which supports communication of data used for interrupt processing from the main memory to the CPU.
[0021]
An invention according to claim 15 is an interrupt support method for supporting communication of data used for interrupt processing from a main memory to a CPU via a cache memory,
Predicting an interrupt to occur, reading data used for interrupt processing of the interrupt from the main memory, storing the data in the cache memory, and transmitting the stored data to the CPU based on a data request from the CPU. It is characterized by transmitting.
[0022]
According to the first or fifteenth aspect of the present invention, the data used for the interrupt processing of the predicted interrupt is stored in the cache memory having a high read speed, and the data is transmitted to the CPU based on the data request. When an interrupt occurs, the CPU can promptly acquire data used in the interrupt process and execute the interrupt process, thereby shortening the response time of the interrupt process without limiting the type of the interrupt process.
[0023]
The invention according to claim 16 is the interrupt support method according to claim 15,
Before starting the interrupt processing of the predicted interrupt, data used for the interrupt processing is stored in the cache memory.
[0024]
According to the second or sixteenth aspect of the present invention, before starting the interrupt processing of the predicted interrupt, the data used for the interrupt processing is stored in the cache memory having a high readout speed, so that the response time of the interrupt processing is reduced. can do.
[0025]
The invention according to claim 17 is the interrupt support method according to claim 15 or 16,
Predicts an interrupt to occur and outputs a prediction signal based on the interrupt,
Based on the output prediction signal, generate a speculative fetish request for reading data used for the interrupt processing of the predicted interrupt and transmit the request to the main memory,
Storing the data used for the interrupt processing transmitted from the main memory in the cache memory.
[0026]
According to the third or 17th aspect of the present invention, an interrupt to be generated is predicted, a speculative fetish request is generated based on the predicted signal and transmitted to the main memory, and the speculative fetish transmitted from the main memory is transmitted. Data used for the interrupt processing corresponding to the request can be stored in the cache memory.
[0027]
The invention according to claim 18 is the interrupt support method according to claim 17, wherein
18. The method according to claim 17, wherein when a data request for interrupt processing is received from the CPU, data corresponding to the data request is retrieved from the cache memory, and when retrieved, the data is transmitted to the CPU. 3. The interrupt support method described in 1.
[0028]
According to the invention described in claim 4 or 18, data requests for various processes are received from the CPU, and data corresponding to the data requests is retrieved from the cache memory having a high read speed and transmitted to the CPU. In this case, the response speed of various processes can be increased.
[0029]
The invention according to claim 19 is the interrupt support method according to claim 18, wherein
When data corresponding to the data request is not retrieved from the cache memory, data corresponding to the data request is received from the main memory, and the data is transmitted to the CPU.
[0030]
According to the invention described in claim 5 or 19, when data corresponding to a data request is not retrieved from the cache memory, the data is transmitted directly from the main memory to the CPU. Can be prevented, and the response time of various processes in the CPU can be shortened.
[0031]
The invention according to claim 20 is the interrupt support method according to any one of claims 15 to 19,
In the case where the data used for the interrupt processing transmitted from the main memory is stored in the cache memory, reading of the data is enabled and stored in the cache memory, and the data stored in the cache memory is transmitted to the CPU. When the data is transmitted, reading of the transmitted data is invalidated and the data is stored in the cache memory.
[0032]
According to the invention described in claim 6 or 20, since the data is stored in the cache memory together with the information indicating whether the reading is valid or invalid, the invalid data in the cache memory is cleared and the valid data is stored. The efficiency of storing effective data on the memory can be improved.
[0033]
The invention according to claim 21 is the interrupt support method according to any one of claims 15 to 20, wherein
The storage area of the cache memory is divided into a plurality of channels,
It is characterized in that data corresponding to one type of interrupt is stored in one channel.
[0034]
According to the invention described in claim 7 or 21, since data corresponding to one type of interrupt is stored in each of the plurality of channels, the channels are managed and a plurality of channels corresponding to the same interrupt are stored in the cache memory. It is possible to prevent unnecessary storage of data.
[0035]
The invention according to claim 22 is the interrupt support method according to any one of claims 15 to 21,
Count the interval of each interrupt occurrence,
When a counter value corresponding to the counted predetermined interrupt corresponds to a reference interval value serving as a reference for the occurrence of each interrupt, a prediction signal corresponding to the interrupt is generated.
[0036]
According to the present invention, when the counter value corresponding to the predetermined interrupt corresponds to the reference interval value of the interrupt, a prediction signal corresponding to the interrupt is generated. , An interrupt process having or not having a regularity in occurrence time can be predicted to generate a prediction signal.
[0037]
The invention according to claim 23 is the interrupt support method according to claim 22, wherein
Average the interval of each interrupt that occurred in the past,
The averaged occurrence interval of each interrupt is set as a reference interval value.
[0038]
According to the ninth or twenty-third aspect of the present invention, the intervals at which predetermined interrupts have occurred in the past are averaged to obtain a reference interval value. Can be predicted to generate a prediction signal.
[0039]
The invention according to claim 24 is the interrupt support method according to claim 22 or 23,
The predetermined interrupt is a periodic interrupt,
The prediction signal corresponding to the periodic interrupt is generated a predetermined time before the counted counter value corresponding to the periodic interrupt exceeds a reference interval value corresponding to the periodic interrupt.
[0040]
According to the tenth or twenty-fourth aspect of the present invention, the prediction value corresponding to the periodic interrupt is provided a predetermined time before the counter value corresponding to the predetermined periodic interrupt exceeds the reference interval value corresponding to the periodic interrupt. Since a signal is generated, a periodic interrupt can be predicted and a predicted signal can be generated.
[0041]
The invention according to claim 25 is the interrupt support method according to any one of claims 22 to 24, wherein:
The predetermined interrupt is a second interrupt as a related interrupt generated at a predetermined interval after the first interrupt has occurred,
Counting the interval of occurrence of the first interrupt,
Before the counted counter value corresponding to the first interrupt exceeds a reference interval value corresponding to an interval of occurrence of the second interrupt from the occurrence of the first interrupt, a predetermined time before the second interrupt, Is generated.
[0042]
According to the eleventh or twenty-fifth aspects of the present invention, the counter value corresponding to the predetermined first interrupt exceeds the reference interval value corresponding to the second interrupt occurrence interval from the first interrupt occurrence. Since a prediction signal corresponding to the second interrupt is generated a time ago, the prediction signal can be generated by predicting the related type interrupt.
[0043]
The invention according to claim 26 is the interrupt support method according to any one of claims 22 to 25,
The predetermined interrupt is a random interrupt that occurs randomly,
Count the interval of occurrence of regular interrupts with regular occurrence time,
When the counted counter value exceeds a reference interval value corresponding to the regular interrupt, a prediction signal corresponding to the random interrupt is generated.
[0044]
According to the twelfth aspect of the present invention, when the counter value corresponding to the regular interrupt exceeds the reference interval value corresponding to the regular interrupt, a prediction signal corresponding to the type of the random interrupt is generated. Therefore, a random interruption can be predicted and a prediction signal can be generated.
[0045]
The invention according to claim 27 is the interrupt support method according to any one of claims 17 to 26,
Referring to the storage area of the cache memory, when the ratio of the free area to the storage area is a predetermined amount or more, generate a speculative fetish start request for generating a speculative fetish request corresponding to a predetermined interrupt, The speculative fetish request is generated.
[0046]
According to the thirteenth or twenty-seventh aspect, when the ratio of the free area to the storage area of the cache memory is equal to or more than a predetermined amount, a speculative fetish start request is generated and the speculative fetish request is generated. The data corresponding to the speculative fetish start request is stored in the cache memory, the storage efficiency of the data in the cache memory is increased, the probability of reading the data corresponding to the interrupt processing from the cache memory is increased, and the response speed of the interrupt processing is further increased. Can be enhanced.
[0047]
According to the fourteenth aspect of the present invention, the interrupt support circuit device according to any one of the first to thirteenth aspects is used. The response time can be reduced without limiting the type of interrupt processing.
[0048]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, with reference to the accompanying drawings, first, second, and third embodiments and modifications according to the present invention will be described in order.
[0049]
(First Embodiment)
The first embodiment will be described with reference to FIGS. First, the features of the apparatus of the present embodiment will be described with reference to FIGS. FIG. 1 is a diagram illustrating a configuration of a microcomputer 1 according to the present embodiment. FIG. 2 is a diagram showing the internal configuration of the interrupt prediction unit 24. FIG. 3 is a diagram illustrating an internal configuration of the interrupt prediction execution unit 241 according to the present embodiment. FIG. 4 is a diagram showing a configuration of data stored in the cache memory 242.
[0050]
As shown in FIG. 1, the microcomputer 1 according to the present embodiment is connected to a main memory 30 such as a RAM for storing various data so that data can be transmitted and received. The microcomputer 1 includes a CPU core 10 and an interrupt support block 20 as an interrupt support circuit device that supports execution of interrupt processing in the CPU core 10 when an interrupt occurs. Although not shown, the CPU core 10 has a built-in cache for storing various data, and an operation unit for performing various operations using the various data.
[0051]
The CPU core 10 is a central part of the CPU. The CPU is constituted only by the CPU core 10 or the CPU core 10 and peripheral circuits such as a secondary cache. Although the present embodiment is described using the CPU core 10, it may be configured as a CPU instead of the CPU core 10.
[0052]
In general, interrupts that occur periodically include interrupts that occur periodically, another predetermined interrupt that occurs after the occurrence of a certain interrupt, and random interrupts that do not occur at a regular time. and so on. In the present embodiment, it is assumed that a periodic interrupt that occurs periodically at a predetermined time interval is handled as the interrupt.
[0053]
The interrupt support block 20 includes a control unit 21 that controls each unit, a CPU interface 22 through communication with the CPU core 10, and a buffer amplifier 23a that amplifies data signals transmitted and received between the CPU core 10 and the CPU interface 22. 23b, an interrupt prediction unit 24 for predicting a possible interrupt and storing data used for interrupt processing of the predicted interrupt, selectors 25 and 26 for selecting a data communication path, and communication with the main memory 30. , And buffer amplifiers 28a and 28b for amplifying data signals transmitted and received between the main memory 30 and the memory interface 27.
[0054]
The data signal transmitted from the CPU core 10 to the CPU interface 22 is amplified by the buffer amplifier 23a. The data signal transmitted from the CPU interface 22 to the CPU core 10 is amplified by the buffer amplifier 23b. The data signal transmitted from the memory interface 27 to the main memory 30 is amplified by the buffer amplifier 28a. The data signal transmitted from the main memory 30 to the memory interface 27 is amplified by the buffer amplifier 28b.
[0055]
The interrupt prediction unit 24 is connected to the CPU interface 22 and the selector 26, receives a data signal from the CPU interface 22 (the CPU core 10 side), and outputs a data signal to the selector 26 (the main memory 30 side). . The interrupt prediction unit 24 is connected to the memory interface 27 and the selector 25, receives a data signal from the memory interface 27 (the main memory 30 side), and outputs a data signal to the selector 25 (the CPU core 10 side). Output.
[0056]
The selector 26 selects a data transmission path from the CPU interface 22 to the memory interface 27 from a transmission path passing through the interrupt prediction unit 24 and a bypass BP1 not passing through the interrupt prediction unit 24. The selector 25 selects a data transmission path from the memory interface 27 to the CPU interface 22 from a transmission path passing through the interrupt prediction unit 24 and a bypass BP2 not passing through the interrupt prediction unit 24. In addition, an interrupt signal when an interrupt occurs is input to the CPU core 10 and the interrupt prediction unit 24. The selectors 25 and 26 are controlled by the control unit 21.
[0057]
As shown in FIG. 2, the interrupt prediction unit 24 actually performs an interrupt prediction and outputs a prediction signal indicating the predicted interrupt, and data used for interrupt processing (hereinafter, interrupt data). ), A search control unit 243 that searches for data stored in the cache memory 242 and controls the cache memory 242, and a speculative fetish (predicted interrupt interrupt) from the main memory 30 in advance. (Reading data) to determine whether to store new interrupt data in the cache memory 242, and a speculative fetish unit for generating a speculative fetish request for speculative fetish when performing speculative fetish. 235, reading of interrupt data for interrupt prediction and direct interrupt And a mediation section 246 for managing the priorities.
[0058]
The search control unit 243 and the prefetch determination unit 244 are collectively referred to as a cache memory control unit 24A. Further, the speculative fetish generation unit 245 and the arbitration unit 246 are collectively referred to as a speculative fetish control unit 24B.
[0059]
As shown in FIG. 3, the interrupt prediction execution unit 241 includes a counter 41A that counts by receiving an interrupt signal as a trigger, and an addition unit 42A that increments a counter value of the counter 41A by a predetermined number every predetermined unit time. A reference interval storage unit 43A for storing a reference interval value serving as a reference for interrupt prediction; and calculating an average value of the reference interval value stored in the reference interval storage unit 43A and the count value output from the counter 41A. Prediction signal generation for outputting a prediction signal for performing speculative fetish based on a comparison between the averaging unit 44A to be output and the reference interval value stored in the reference interval storage unit 43A and the count value output from the counter 41A. A part 45A.
[0060]
The counter value of the counter 41A is reset when an interrupt signal is received. The counter value of the counter 41A is incremented by a predetermined time unit by the adding unit 42A as time passes. Further, the counter 41A outputs the counter value immediately before reset to the averaging unit 44A together with the input of the interrupt signal, and always outputs the counter value to the prediction signal generation unit 45A. The averaging unit 44A outputs the counter value input first time to the reference interval storage unit 43A as it is.
[0061]
The reference interval storage unit 43A stores a counter value input first time as a reference interval value. When receiving the interrupt signal, the reference interval storage unit 43A outputs the stored reference interval value to the averaging unit 44A and the prediction signal generation unit 45A. The averaging unit 44A calculates the average value of the counter value input from the second time onward due to the interruption and the reference interval value input from the reference interval storage unit 43A, and outputs the average value to the reference interval storage unit 43A. I do. The reference interval storage unit 43A stores the input average value as a reference interval value.
[0062]
The reference interval value indicates an average value of intervals at which periodic interrupts occurred in the past, and serves as a guide for predicting when a periodic interrupt will occur next. The prediction signal generation unit 45A compares the input counter value with the reference interval value, generates a prediction signal a predetermined time before the counter value passes the reference interval value, and searches the search control unit 243 and the speculative fetish generation unit 245. Output to The prediction signal includes a type of data such as instruction data used for interrupt processing corresponding to the interrupt whose occurrence is predicted.
[0063]
There are a plurality of types of periodic interrupts that occur periodically. Some types of interrupts have different periods, and others have the same period. If the type of interrupt is different, the timing of occurrence is different even if the cycle is the same. Therefore, the counter value stored in the counter 41A and the reference interval value stored in the reference interval storage unit 43A are separately managed for each type of interrupt. The prediction signal generator 45A outputs a prediction signal separately for each type of interrupt.
[0064]
The search control unit 243 receives a data request for data used for various processes from the CPU core 10 via the buffer amplifier 23a and the CPU interface 22, and outputs a prediction signal from the prediction signal generation unit 45A of the interrupt prediction execution unit 241. Will be entered. The various processes include an interrupt process and a normal process other than the interrupt process. The search control unit 243 selects a channel for storing interrupt data corresponding to the input prediction signal from the cache memory 242. Further, the search control unit 243 searches the cache memory 242 for data corresponding to the received data request from the CPU core 10.
[0065]
The cache memory 242 has a storage area divided into a plurality of channels C0 to Cn (where n is a natural number). In each channel, interrupt data such as instruction data used for each interrupt is separately stored. Each channel has at least one storage block, which is a storage area unit, and stores interrupt data corresponding to one type of interrupt. Each channel stores one or a plurality of data corresponding to one type of interrupt.
[0066]
The interrupt data stored in the cache memory 242 has, for example, a data configuration as shown in FIG. Each channel stores a valid flag indicating whether reading of stored interrupt data is valid or invalid, and the contents of one or more data in the stored interrupt data. The valid flag is 1 when the stored interrupt data is valid, and is 0 when the stored interrupt data is invalid.
[0067]
In addition, the search control unit 243 selects a channel in the cache memory 242 where interrupt data transmitted from the main memory 30 via the buffer amplifier 28b and the memory interface 27 is stored. The selected channel is a channel in which no data is stored or a channel in which the valid flag is invalid (= 0) (hereinafter, these channels are referred to as empty channels). The search control unit 243 clears the selected channel, stores data transmitted from the main memory 30 in the cleared channel, and sets the valid flag of the stored data to 1 (valid). ).
[0068]
The search control unit 243 searches the cache memory 242 for data corresponding to the requested interrupt processing based on a signal from the CPU core 10, and when the data is searched, the selector 25, the CPU interface 22, and the buffer amplifier 23 b Via the cache memory 242 to the CPU core 10 to set the valid flag of the transmitted data to 0 (invalid).
[0069]
The prefetch determination unit 244 always checks the data storage state of the channels C0 to Cn in the cache memory 242, and determines whether the number of available channels is larger than a predetermined number. When the number of available channels is equal to or more than the predetermined number, the prefetch determination unit 244 receives the interrupt type associated with each channel from the search control unit 243 and issues a speculative fetish start request including the interrupt type corresponding to the available channel. It is generated and input to the speculative fetish generator 245.
[0070]
The speculation fetish generation unit 245 receives the prediction signal from the prediction signal generation unit 45A of the interrupt prediction execution unit 241 and receives a speculation fetish start request from the pre-fetch determination unit 244 when the number of available channels is equal to or more than a predetermined number. The speculative fetish generation unit 245 generates a speculative fetish request corresponding to the type of interrupt included in the input prediction signal, and inputs the request to the arbitration unit 246. Further, the speculative fetish generation unit 245 generates a speculative fetish request corresponding to the type of interrupt included in the input speculative fetish start request and inputs the request to the arbitrating unit 246.
[0071]
The arbitration unit 246 receives a data request for data used for various processes from the CPU core 10 via the buffer amplifier 23a and the CPU interface 22, and receives a speculative fetish request from the prediction signal generation unit 45A of the interrupt prediction execution unit 241. Is done. Arbitration is performed to determine which of the data request and the speculative fetish request is transmitted to the main memory 30. The arbitration unit 246 discards the input data request, for example, when the data corresponding to the data request is read from the cache memory 242 by the search control unit 243 and has been transmitted to the CPU core 10 side. 26, a speculative fetish request is transmitted to the main memory 30 via the memory interface 27 and the buffer amplifier 28a. For example, when data corresponding to the data request has not been transmitted from the cache memory 242 to the CPU core 10 side, the arbitration unit 246 gives priority to the input data request, and selects the selector 26, the memory interface 27, and the buffer amplifier 28a. , A data request is transmitted to the main memory 30, and after that, a speculative fetish request is transmitted to the main memory 30.
[0072]
Next, an operation in the interrupt support block 20 of the microcomputer 1 will be described with reference to FIGS. FIG. 5 is a flowchart showing the speculative fetish processing. FIG. 6 is a flowchart showing the prefetch process. FIG. 7 is a flowchart showing the reading process. FIG. 8 is a diagram showing an example of the flow of the operation of the microcomputer 1 for one interrupt. FIG. 9 is a diagram showing an example of the operation flow of the microcomputer 1 for two interrupts.
[0073]
First, referring to FIG. 5, a speculative fetish process of predicting a periodic interrupt in the interrupt support block 20 and taking in the interrupt data of the predicted interrupt from the main memory 30 (speculative fetish) and storing it in the cache memory 242 Will be described. The speculative fetish processing is executed with, for example, activation of a device on which the microcomputer 1 is mounted as a trigger. It is assumed that data is not stored in the cache memory 242 and the type of interrupt is not associated with a channel before the device on which the microcomputer 1 is mounted.
[0074]
When an interrupt occurs, an interrupt signal is input to the counter 41A and the reference interval storage unit 43A in the interrupt prediction execution unit 241 as needed. As shown in FIG. 5, first, the prediction signal generation unit 45A determines whether or not the counter value corresponding to each interrupt stored in the counter 41A exceeds the reference interval value stored in the reference interval storage unit 43A minus a predetermined time. Is determined (step S11). This is because the next interrupt occurs when the reference interval value has elapsed, so that a process of storing the interrupt data in the cache memory 242 of the interrupt data is started a predetermined time before that. If the counter value does not exceed the reference interval value-predetermined time (step S11; NO), the process proceeds to step S11.
[0075]
When the counter value exceeds the reference interval value-predetermined time (step S11; YES), the prediction signal generation unit 45A generates a prediction signal including an interrupt type corresponding to the interruption of the counter value, and performs search control. It is input to the section 243 and the speculative fetish generation section 245 (step S12). Then, the search control unit 243 selects a channel of the cache memory 242 corresponding to the type of the interrupt included in the input prediction signal (step S13). That is, which type of interrupt is stored in which channel is set, and the correspondence is temporarily fixed thereafter. The data of the selected channel is cleared by the search control unit 243. Further, when the type of interrupt and the channel have already been set in step S13, the configuration may be such that they are reset.
[0076]
Then, the speculative fetish generation unit 245 generates a speculative fetish request corresponding to the type of interrupt included in the input prediction signal, and transmits the request to the arbitration unit 246. The arbitration unit 246 arbitrates between the speculative fetish request and the data request from the CPU core 10, and when the order of transmitting the speculative fetish request is changed, the speculative fetish request is transmitted to the selector 26, the memory interface 27, and The data is transmitted to the main memory 30 via the buffer amplifier 28a (step S14).
[0077]
In the main memory 30, interrupt data based on the received speculative fetish request is read and transmitted to the interrupt support block 20. Then, the cache memory 242 receives the interrupt data from the main memory 30 via the buffer amplifier 28b and the memory interface 27. Then, the search controller 243 causes the interrupt data to be stored in the channel of the cache memory 242 based on the channel selected in step S13 (step S15), and the speculative fetish processing ends.
[0078]
Next, referring to FIG. 6, a prefetch process in which the interrupt support block 20 prefetches the interrupt data from the main memory 30 (prefetches) and stores it in the cache memory 242 in preparation for reading the interrupt data will be described. . The prefetch process is a process that is periodically executed at predetermined time intervals. For example, the first time is executed with the activation of a device equipped with the microcomputer 1 as a trigger.
[0079]
As shown in FIG. 6, first, the prefetch determination unit 244 recognizes a free channel in the cache memory 242, and determines whether the number of the free channels is equal to or more than a predetermined number (step S21). If the number of available channels is not equal to or greater than the predetermined number (step S21; NO), the prefetch process ends.
[0080]
If the number of available channels is equal to or greater than the predetermined number (step S21; YES), the prefetch determination unit 244 determines whether the available channel is set in association with the type of interrupt processing (step S22). . Specifically, when a channel is selected in step S13 of FIG. 5 that has already been executed, it is determined whether or not an empty channel is associated with an interrupt type. If an empty channel has not been set (step S22; NO), the prefetch process ends.
[0081]
If an empty channel has been set (step S22; YES), the prefetch determination unit 244 selects one empty channel associated with the type of interrupt, and based on the empty channel and the type of interrupt. Then, a speculative fetish start request including the type of interrupt is generated and input to the speculative fetish generator 245 (step S23). Then, the speculative fetish generation unit 245 generates a speculative fetish request corresponding to the type of interrupt processing included in the input speculative fetish start request and transmits the request to the main memory 30 via the memory interface 27 and the buffer amplifier 28a. (Step S24). Step S24 is a process similar to step S14 of FIG.
[0082]
Then, the search control unit 243 causes the interrupt data received from the main memory 30 to be stored in the empty channel of the cache memory 242 selected in step S23 (step S25), and the prefetch process ends. Step S25 is a process similar to step S15 of FIG.
[0083]
Next, with reference to FIG. 7, a description will be given of a read process of reading data (here, read data) used for various processes executed in the CPU core 10 in the interrupt support block 20. The reading process is executed in the interrupt support block 20, triggered by the control unit 21 receiving the data request of the read data transmitted from the CPU core 10 via the buffer amplifier 23a and the CPU interface 22 as a trigger. The data request transmitted from the CPU core 10 is received by the search control unit 243 and the arbitration unit 246 via the buffer amplifier 23a and the CPU interface 22.
[0084]
As shown in FIG. 7, first, the search control unit 243 searches the cache memory 242 for read data corresponding to the data request (step S31). Then, in step S31, the search control unit 243 determines whether the read data has been searched from the cache memory 242 (whether or not the read data is stored in the cache memory 242) (step S32).
[0085]
If the read data is stored in the cache memory 242 (step S32; YES), the read data is read from the cache memory 242 by the search control unit 243, and the read data is stored in the selector 25, the CPU interface 22, and the buffer amplifier. The data is transmitted to the CPU core 10 via 23b (step S33).
[0086]
Then, the validity flag corresponding to the read channel is set to invalid in the cache memory 242 by the search control unit 243 (step S34). The arbitration unit 246 discards the data request transmitted from the CPU core 10. Then, the reading process ends.
[0087]
If the read data is not stored in the cache memory 242 (step S32; NO), the arbitration unit 246 sends the data request transmitted from the CPU core 10 to the main unit via the selector 26, the memory interface 27, and the buffer amplifier 28a. The data is transmitted to the memory 30 (step S36).
[0088]
In the main memory 30, read data corresponding to the type of interrupt included in the received data request is read and transmitted to the interrupt support block 20. Then, the control unit 21 transmits the read data to the CPU core 10 via the buffer amplifier 28b, the memory interface 27, the bypass BP2, the selector 25, the CPU interface 22, and the buffer amplifier 23b (Step S36), and the read processing is terminated. You.
[0089]
Note that when normal processing other than interrupt processing is performed in the CPU core 10, a configuration may be employed in which data used in the normal processing is not searched and read from the cache memory 242. In this case, a data request for data used in the normal processing is transmitted from the CPU core 10 to the main memory 30 via the buffer amplifier 23a, the CPU interface 22, the bypass BP1, the selector 26, the memory interface 27, and the buffer amplifier 28a in this order. You.
[0090]
The speculative fetish processing, pre-fetish processing, and read processing described above are the flow of operations for one type of interrupt. Actually, the operations for each of the plurality of types of interrupts are performed independently. At that time, the operation for each interrupt may be performed repeatedly.
[0091]
Although not shown in the figure, when various processes are executed by the CPU core 10, data (hereinafter referred to as write data) used in the process being executed is temporarily saved from the internal cache of the CPU core 10. May be stored in the main memory 30. First, write data is transmitted from the CPU core 10 to the interrupt support block 20. Then, the control unit 21 transmits the write data transmitted from the CPU core 10 to the main memory 30 via the buffer amplifier 23a, the CPU interface 22, the bypass BP1, the selector 26, the memory interface 27, and the buffer amplifier 28a. . Then, the received write data is stored in the main memory 30.
[0092]
Here, an example of the operation flow of the microcomputer 1 when one interrupt occurs during the execution of the normal processing in the CPU core 10 will be described with reference to FIG. It is assumed that time flows from the top to the bottom of FIG. 8, and one type of interrupt is an interrupt I1.
[0093]
As shown in FIG. 8, first, the CPU core 10 executes a normal process. In (1), a prediction signal corresponding to the interrupt I1 is generated by the interrupt prediction unit 24, and a speculative fetish request is generated and transmitted to the main memory 30 (corresponding to steps S11 to S14 in FIG. 5). Then, in (2), the main memory 30 reads the interrupt data corresponding to the interrupt I1 and sends it to the interrupt support block 20. Then, the interrupt data is received by the interrupt prediction unit 24 and stored in the cache memory 242 (corresponding to step S15 in FIG. 5).
[0094]
Then, in (3), an interrupt I1 is generated, and an interrupt signal corresponding to the interrupt I1 is transmitted to the CPU core 10 and the interrupt prediction unit 24. Then, in (4), the interrupt prediction unit 24 reads the interrupt data corresponding to the interrupt I1 from the cache memory 242 having a high read speed and transmits the data to the CPU core 10 (steps S31 to S34 in FIG. 7). Correspondence). Therefore, the interrupt process of the interrupt I1 can be executed with a reduced response time.
[0095]
Next, an example of an operation flow of the microcomputer 1 when two types of interrupts occur during execution of the normal processing in the CPU core 10 will be described with reference to FIG. The two types of interrupts are different types having different periods, and are respectively defined as interrupts I1 and I2, and the interrupt I1 has a higher priority than the interrupt I2.
[0096]
As shown in FIG. 9, in (5), similarly to (1) in FIG. 8, predicted signals corresponding to the interrupts I1 and I2 are separately generated in order by the interrupt prediction unit 24, and the speculative fetish request is generated. Then, it is transmitted to the main memory 30. It is assumed that the storage destination of the interrupt data of the interrupt I1 is set to the channel C1 of the cache memory 242, and the storage destination of the interrupt data of the interrupt I1 is set to the channel C2.
[0097]
Then, in (6), similarly to (2) in FIG. 8, in the interrupt prediction unit 24, the interrupt data corresponding to the interrupts I1 and I2 is received from the main memory 30, and the channel C1 of the cache memory 242 is respectively received. , C2. Then, in (7), interrupts I1 and I2 are generated in order, as in (3) in FIG. 8, and the interrupt signal is transmitted to the CPU core 10 and the interrupt prediction unit 24.
[0098]
Then, in (8), similarly to (4) in FIG. 8, the interrupt data corresponding to the interrupt I1 is transmitted to the CPU core 10, and the interrupt process corresponding to the interrupt I1 is executed. The interrupt data corresponding to the interrupt I2 having the lower priority is transmitted to the CPU core 10 after executing the interrupt process corresponding to the interrupt I1, and the interrupt process corresponding to the interrupt I2 is executed.
[0099]
Therefore, according to the present embodiment, the predicted interrupt data is stored in the cache memory 242 having a high read speed before the start of the interrupt processing, and the interrupt data is stored based on the data request. Since the interrupt is transmitted to the CPU core 10, when an interrupt occurs, the CPU core 10 can promptly acquire the interrupt data and execute the interrupt processing, thereby shortening the response time of the interrupt processing without limiting the type of the interrupt processing. be able to.
[0100]
Further, data requests for various processes are received from the CPU core 10, and data corresponding to the data requests is retrieved from the cache memory 242 having a high read speed and transmitted to the CPU core 10. Response speed can be increased. Further, when the data corresponding to the data request is not retrieved from the cache memory 242, the data is directly transmitted from the main memory 30 to the CPU core 10, so that an increase in the operation load for storing the data in the cache memory 30 is prevented, and The response time of various processes in the core 10 can be reduced.
[0101]
In addition, since the data is stored in the cache memory 242 together with the validity flag indicating whether the reading is valid or invalid, the invalid interrupt data in the cache memory 242 is cleared to store valid data, and the validity of the cache memory 242 is stored. It is possible to improve the storage efficiency of the interrupt data.
[0102]
Further, since the plurality of channels C0 to Cn store the interrupt data corresponding to one type of interrupt, the channels are managed, and the plurality of interrupt data corresponding to the same interrupt is wasted on the cache memory 242. Can be prevented from being stored.
[0103]
Further, before a predetermined time before the counter value of the counter 41A corresponding to the predetermined periodic interrupt exceeds the reference interval value corresponding to the periodic interrupt, a prediction signal corresponding to the type of the periodic interrupt is generated by the prediction signal generation unit. Since generation is performed at 45A, a periodic interrupt can be predicted and a prediction signal can be generated.
[0104]
Further, since the averaging unit 44A averages the occurrence intervals of predetermined interrupts that have occurred in the past and sets them as the reference interval value, the interrupt is more accurately predicted based on the reference interval value including the occurrence tendency up to now, and the prediction signal is generated. Can be generated.
[0105]
When the number of available channels in the cache memory 242 is equal to or more than the predetermined number by the pre-fetching determination unit 244, a speculative fetish start request is generated and input to the speculative fetish generation unit 245. The data is stored in the cache memory 242, the storage efficiency of the interrupt data on the cache memory 242 is increased, the probability of reading the interrupt data from the cache memory 242 is increased, and the response time of the interrupt processing can be further reduced. .
[0106]
(Second embodiment)
A second embodiment will be described with reference to FIG. FIG. 10 is a diagram illustrating an internal configuration of the interrupt prediction execution unit 241 according to the present embodiment. The present embodiment differs from the first embodiment in the internal configuration of the interrupt prediction unit 241, and a description of similar parts will be omitted to avoid duplication of description.
[0107]
Although the first embodiment is directed to a periodic interrupt that occurs periodically, in the present embodiment, the first interrupt and the second interrupt are related, and the first interrupt is generated. It is intended for a configuration in which a second interrupt is generated at a predetermined time interval after the occurrence. Such an interrupt is referred to as a related interrupt.
[0108]
As shown in FIG. 10, the interrupt prediction execution unit 241 in the interrupt prediction unit 24 of the interrupt support block 20 of the microcomputer 1 of the present embodiment performs a counter that counts upon receiving the first interrupt signal. 41B, an adder 42B that increments a counter value of the counter 41B by a predetermined number every predetermined unit time, a reference interval storage unit 43B that stores a reference interval value that is a reference of interruption prediction, and a reference interval storage unit 43B. An averaging unit 44B that calculates and outputs an average value of the stored reference interval value and the count value output from the counter 41B, and a reference interval value stored in the reference interval storage unit 43B and a count output from the counter 41B. And a prediction signal generation unit 45B that outputs a prediction signal for causing speculative fetish based on the comparison with the value. Obtain.
[0109]
The counter value of the counter 41B is reset when the first interrupt signal is received. In addition, the counter value of the counter 41B is incremented by a predetermined time unit by the adding unit 42B as time passes. Further, the counter 41B outputs the counter value immediately before reset to the averaging unit 44B together with the input of the first interrupt signal, and always outputs the counter value to the prediction signal generation unit 45B. The averaging unit 44B outputs the counter value input first time as it is to the reference interval storage unit 43B.
[0110]
The reference interval storage unit 43B stores the input counter value as a reference interval value. Further, when receiving the second interrupt signal, the reference interval storage unit 43B outputs the stored reference interval value to the averaging unit 44B and the prediction signal generation unit 45B. The averaging unit 44B calculates the average value of the counter value input from the second time onward due to the first interrupt and the reference interval value input from the reference interval storage unit 43B, and stores the average value in the reference interval storage unit. 43B. The reference interval storage unit 43B stores the input average value as a reference interval value.
[0111]
The reference interval value indicates an average value of a time interval from the occurrence of the first interrupt that occurred in the past to the occurrence of the second interrupt, and predicts when the second interrupt will occur after the occurrence of the first interrupt. It is a guide. The prediction signal generation unit 45B compares the input counter value with the reference interval value, generates a prediction signal corresponding to the second interrupt a predetermined time before the counter value passes the reference interval value, and performs search control. Unit 243 and the speculative fetish generation unit 245. The prediction signal includes the type of the second interrupt whose occurrence is predicted.
[0112]
The operation of the microcomputer 1 is the same as that of the first embodiment. When the first interrupt occurs, the first interrupt signal is input to the counter 41B in the interrupt prediction execution unit 241 as needed, and when the second interrupt occurs, the second interrupt signal is input to the reference interval storage unit 43B as needed. Is entered. As an operation of the present embodiment, in step S11 of the speculative fetish processing in FIG. 5, first, the prediction signal generation unit 45B stores the counter value after the first interrupt occurrence stored in the counter 41B into the reference interval storage unit 43B. It is determined whether or not the reference interval value stored in. In the operation of the present embodiment, the steps after step S11 in the speculative fetish processing, the pre-fetish processing, and the read processing are the same as those in the first embodiment.
[0113]
Therefore, according to the present embodiment, the count value of counter 41B corresponding to the predetermined first interrupt exceeds the reference interval value corresponding to the second interrupt occurrence interval from the occurrence of the first interrupt. Since the prediction signal corresponding to the second interrupt type is generated by the prediction signal generation unit 45B before the time, the prediction signal can be generated by predicting the related interrupt.
[0114]
(Third embodiment)
The third embodiment will be described with reference to FIG. FIG. 11 is a diagram illustrating an internal configuration of the interrupt prediction execution unit 241 according to the present embodiment. The present embodiment differs from the first embodiment in the internal configuration of the interrupt prediction unit 241, and a description of similar parts will be omitted to avoid duplication of description.
[0115]
The first embodiment is directed to a periodic interrupt that occurs periodically, and the second embodiment is directed to a related interrupt. In the present embodiment, neither a periodic interrupt nor a related interrupt is applicable, and the configuration is directed to a random interrupt that occurs randomly with an irregular occurrence time.
[0116]
As shown in FIG. 11, the interrupt prediction execution unit 241 in the interrupt prediction unit 24 of the interrupt support block 20 of the microcomputer 1 of the present embodiment triggers the reception of periodic interrupts and regular interrupts such as interrupts. A counter 41C that counts as a counter, an adder 42C that increments the counter value of the counter 41C by a predetermined number every predetermined unit time, and stores a reference interval value, and exceeds the reference interval value after the occurrence of the regular interrupt. Also includes a prediction signal generator 45C that outputs a prediction signal for causing speculative fetish when the next regular interrupt does not occur.
[0117]
The counter value of the counter 41C is reset when a regular interrupt signal is received. Further, the counter value of the counter 41C is incremented by a predetermined time unit by the adding unit 42C as time passes. Further, the counter 41B always outputs the counter value to the prediction signal generator 45C.
[0118]
The reference interval value is a value indicating a time interval from the occurrence of a regular interrupt to the time when it is determined that the next regular interrupt has not occurred, and a reference for predicting when a random interrupt will occur next. Become. In other words, it is predicted that a random interrupt will occur if the next regular interrupt does not occur even after the reference interval value has elapsed after the occurrence of the regular interrupt. The prediction signal generation unit 45C constantly compares the reference interval value stored in advance with the counter value input from the counter 41C, and when the counter value exceeds the reference interval value, generates a prediction signal corresponding to a random interrupt. Are output to the search control unit 243 and the speculative fetish generation unit 245. The prediction signal includes a type of data such as instruction data used for interrupt processing corresponding to a random interrupt whose occurrence is predicted.
[0119]
The operation of the microcomputer 1 is the same as that of the first embodiment. Upon occurrence of the regular interrupt, a regular interrupt signal is input to the counter 41C in the interrupt prediction execution unit 241 as needed. As an operation of the present embodiment, instead of step S11 of the speculative fetish processing of FIG. 5, first, the counter value after the occurrence of the regular interrupt stored in the counter 41C is stored in advance by the prediction signal generation unit 45C. It is determined whether or not the reference interval value has been exceeded. In the operation of the present embodiment, the steps after step S11 in the speculative fetish processing, the pre-fetish processing, and the read processing are the same as those in the first embodiment.
[0120]
Therefore, according to the present embodiment, when the counter value corresponding to the regular interrupt such as the periodic and related interrupt exceeds the reference interval value corresponding to the regular interrupt, the counter value corresponds to the type of the random interrupt. Since the prediction signal is generated by the prediction signal generation unit 45C, the prediction signal can be generated by predicting the random interruption.
[0121]
(Modification)
A modification of the first embodiment will be described with reference to FIG. FIG. 12 is a diagram illustrating the internal configuration of the interrupt prediction execution unit 241 according to the present modification. This modification is different from the first embodiment in the internal configuration of the interrupt prediction unit 241, and the description of the same parts will be omitted to avoid duplication of the description. This modification is directed to a periodic interrupt that occurs periodically, as in the first embodiment.
[0122]
As shown in FIG. 12, the interrupt prediction execution unit 241 in the interrupt prediction unit 24 of the interrupt support block 20 of the microcomputer 1 according to the present embodiment includes a counter 41A, an addition unit 42A, and a reference cycle of each periodic interrupt. Based on a comparison between the counter value output from the counter 41A and the reference interval value of the reference table stored in the reference interval storage unit 46, A prediction signal generation unit 47 that outputs a prediction signal for performing speculative fetishism.
[0123]
The reference table stores a preset identification number for identifying the type of each periodic interrupt and a reference interval value that is a cycle corresponding to the identification number. The reference interval value is a guide to predict when each interrupt will occur next. The prediction signal generation unit 47 compares the input counter value with the reference interval value, generates a prediction signal corresponding to the second interrupt a predetermined time before the counter value passes the reference interval value, and performs search control. Unit 243 and the speculative fetish generation unit 245. The prediction signal includes the type of interrupt data used for interrupt processing corresponding to the second interrupt whose occurrence is predicted.
[0124]
The operation of the microcomputer 1 is the same as that of the first embodiment. When a periodic interrupt occurs, an interrupt signal is input to the counter 41A in the interrupt prediction execution unit 241 as needed. As an operation of this modification, in step S11 of the speculative fetish processing of FIG. 5, first, the prediction signal generation unit 47 stores the counter value corresponding to a certain periodic interruption stored in the counter 41A into the reference interval storage unit 46. It is determined whether or not the reference interval value corresponding to the periodic interruption in the reference table stored in the predetermined table-the predetermined time is exceeded. In the operation of this modified example, the steps after step S11 in the speculative fetish processing, the pre-fetish processing, and the read processing are the same as those in the first embodiment.
[0125]
Therefore, according to the present modification, the type of the periodic interrupt can be determined before the counter value of the counter 41A corresponding to the predetermined periodic interrupt exceeds the reference interval value of the reference table corresponding to the periodic interrupt. Is generated by the prediction signal generation unit 45A, so that a periodic interruption can be predicted and the prediction signal can be generated.
[0126]
In the first and second embodiments, the interrupt occurrence intervals averaged by the averaging units 44A and 44B are stored as reference interval values in the reference interval storage units 43A and 43B. , 44B, a predetermined reference interval value may be fixed and not averaged.
[0127]
In the first, second, and third embodiments, the periodic interrupt, the related interrupt, and the random interrupt are predicted, respectively. However, in the first, second, and third embodiments, A configuration in which at least two of periodic interrupts, related interrupts, and random interrupts are predicted by combining a plurality of them may be used. Further, a configuration using the reference table of the modified example may be further combined. Further, the configuration using the reference table of the modified example may be applied to the second and third embodiments.
[0128]
In the first, second, and third embodiments and the modifications, the interrupt support block 20 is configured to be externally attached to the CPU core 10, but is formed integrally with the CPU core 10 as an interrupt circuit device. Or the like.
[0129]
In the first, second, and third embodiments and the modifications, the data stored in the cache memory 242 is erased by turning off the power of the device on which the microcomputer 1 is mounted, but is not limited thereto. Instead, data may be stored and held even after the power is turned off.
[0130]
As described above, the embodiments of the present invention have been described, but the present invention is not necessarily limited to the above-described means and methods, but may achieve the object of the present invention and have the effects of the present invention. Can be appropriately changed and implemented.
[0131]
【The invention's effect】
According to the first or fifteenth aspect of the present invention, the data used for the interrupt processing of the predicted interrupt is stored in the cache memory having a high read speed, and the data is transmitted to the CPU based on the data request. When an interrupt occurs, the CPU can promptly acquire data used in the interrupt process and execute the interrupt process, thereby shortening the response time of the interrupt process without limiting the type of the interrupt process.
[0132]
According to the second or sixteenth aspect of the present invention, before starting the interrupt processing of the predicted interrupt, the data used for the interrupt processing is stored in the cache memory having a high readout speed, so that the response time of the interrupt processing is reduced. can do.
[0133]
According to the third or 17th aspect of the present invention, an interrupt to be generated is predicted, a speculative fetish request is generated based on the predicted signal and transmitted to the main memory, and the speculative fetish transmitted from the main memory is transmitted. Data used for the interrupt processing corresponding to the request can be stored in the cache memory.
[0134]
According to the invention described in claim 4 or 18, data requests for various processes are received from the CPU, and data corresponding to the data requests is retrieved from the cache memory having a high read speed and transmitted to the CPU. In this case, the response speed of various processes can be increased.
[0135]
According to the invention described in claim 5 or 19, when data corresponding to a data request is not retrieved from the cache memory, the data is transmitted directly from the main memory to the CPU. Can be prevented, and the response time of various processes in the CPU can be shortened.
[0136]
According to the invention described in claim 6 or 20, since the data is stored in the cache memory together with the information indicating whether the reading is valid or invalid, the invalid data in the cache memory is cleared and the valid data is stored. The efficiency of storing effective data on the memory can be improved.
[0137]
According to the invention described in claim 7 or 21, since data corresponding to one type of interrupt is stored in each of the plurality of channels, the channels are managed and a plurality of channels corresponding to the same interrupt are stored in the cache memory. It is possible to prevent unnecessary storage of data.
[0138]
According to the present invention, when the counter value corresponding to the predetermined interrupt corresponds to the reference interval value of the interrupt, a prediction signal corresponding to the interrupt is generated. , An interrupt process having or not having a regularity in occurrence time can be predicted to generate a prediction signal.
[0139]
According to the ninth or twenty-third aspect of the present invention, the intervals at which predetermined interrupts have occurred in the past are averaged to obtain a reference interval value. Can be predicted to generate a prediction signal.
[0140]
According to the tenth or twenty-fourth aspect of the present invention, the prediction value corresponding to the periodic interrupt is provided a predetermined time before the counter value corresponding to the predetermined periodic interrupt exceeds the reference interval value corresponding to the periodic interrupt. Since a signal is generated, a periodic interrupt can be predicted and a predicted signal can be generated.
[0141]
According to the eleventh or twenty-fifth aspects of the present invention, the counter value corresponding to the predetermined first interrupt exceeds the reference interval value corresponding to the second interrupt occurrence interval from the first interrupt occurrence. Since a prediction signal corresponding to the second interrupt is generated a time ago, the prediction signal can be generated by predicting the related type interrupt.
[0142]
According to the invention described in claim 12 or 26, when the counter value corresponding to the regular interrupt exceeds the reference interval value corresponding to the regular interrupt, the prediction signal corresponding to the random interrupt is generated. A prediction signal can be generated by predicting a random interrupt.
[0143]
According to the thirteenth or twenty-seventh aspect, when the ratio of the free area to the storage area of the cache memory is equal to or more than a predetermined amount, a speculative fetish start request is generated and the speculative fetish request is generated. The data corresponding to the speculative fetish start request is stored in the cache memory, the storage efficiency of the data in the cache memory is increased, the probability of reading the data corresponding to the interrupt processing from the cache memory is increased, and the response speed of the interrupt processing is further increased. Can be enhanced.
[0144]
According to the fourteenth aspect of the present invention, the interrupt support circuit device according to any one of the first to thirteenth aspects is used. The response time can be reduced without limiting the type of interrupt processing.
[Brief description of the drawings]
FIG. 1 is a diagram showing a configuration of a microcomputer 1 according to a first embodiment of the present invention.
FIG. 2 is a diagram showing an internal configuration of an interrupt prediction unit 24.
FIG. 3 is a diagram illustrating an internal configuration of an interrupt prediction execution unit 241 according to the first embodiment.
FIG. 4 is a diagram showing a configuration of data stored in a cache memory 242.
FIG. 5 is a flowchart showing speculative fetish processing.
FIG. 6 is a flowchart showing a prefetch process.
FIG. 7 is a flowchart illustrating a reading process.
FIG. 8 is a diagram illustrating an example of an operation flow of the microcomputer 1 for one interrupt.
FIG. 9 is a diagram showing an example of the flow of operation of the microcomputer 1 for two interrupts.
FIG. 10 is a diagram illustrating an internal configuration of an interrupt prediction execution unit 241 according to the second embodiment of the present invention.
FIG. 11 is a diagram illustrating an internal configuration of an interrupt prediction execution unit 241 according to the third embodiment of the present invention.
FIG. 12 is a diagram illustrating an internal configuration of an interrupt prediction execution unit 241 according to a modification of the first embodiment.
[Explanation of symbols]
1. Microcomputer
10 ... CPU core
20 ... Interrupt support block
21 ... Control unit
22 ... CPU interface
23a, 23b, 28a, 28b ... buffer amplifier
24: Interrupt prediction unit
241, an interrupt prediction execution unit
242: Cache memory
24A: Cache memory control unit
243 ... Search control unit
244... Prefetch determination section
24B ... speculation fetish control unit
245: speculative fetish generation unit
246: Arbitration unit
41A, 41B, 41C ... counter
42A, 42B, 42C ... adding unit
43A, 43B, 46: Reference interval storage unit
44A, 44B: average part
45A, 45B, 45C, 47 ... prediction signal generation unit
25, 26 ... selector
27 ... Memory interface
30 ... Main memory

Claims (27)

割り込み処理に用いるデータのメインメモリからCPUへの通信を支援する割り込み支援回路装置であって、
前記CPUとの通信を行うCPUインタフェースと、
前記メインメモリとの通信を行うメモリインタフェースと、
データを記憶するキャッシュメモリを具備し、発生する割り込みを予測して、その割り込みの割り込み処理に用いるデータを、前記メモリインタフェースを介して前記メインメモリから読み出して前記キャッシュメモリに格納し、前記CPUからのデータ要求に基づいて、その格納されたデータを前記CPUに送信する割り込み予測部と、
前記CPUインタフェース及び前記メモリインタフェースを介して、前記CPUと前記メインメモリとの間の通信を制御する制御部とを備えることを特徴とする割り込み支援回路装置。
An interrupt support circuit device for supporting communication of data used for interrupt processing from a main memory to a CPU,
A CPU interface for communicating with the CPU;
A memory interface for communicating with the main memory;
A cache memory for storing data, predicting an interrupt to occur, reading data used for interrupt processing of the interrupt from the main memory via the memory interface, storing the data in the cache memory, An interrupt prediction unit for transmitting the stored data to the CPU based on the data request of
An interrupt support circuit device, comprising: a control unit that controls communication between the CPU and the main memory via the CPU interface and the memory interface.
前記割り込み予測部は、前記予測された割り込みの割り込み処理の開始前に、その割り込み処理に用いるデータを前記キャッシュメモリに格納することを特徴とする請求項1に記載の割り込み支援回路装置。The interrupt support circuit device according to claim 1, wherein the interrupt prediction unit stores data used for the interrupt processing in the cache memory before starting the interrupt processing of the predicted interrupt. 前記割り込み予測部は、
発生する割り込みを予測してその割り込みに基づく予測信号を出力する割り込み予測実行部と、
前記割り込み予測実行部から出力された予測信号に基づいて、予測された割り込みの割り込み処理に用いるデータを読み出すための投機フェチ要求を生成して前記メインメモリに送信する投機フェチ制御部と、
前記メインメモリから送信された前記割り込み処理に用いるデータを前記キャッシュメモリに格納させるキャッシュメモリ制御部とを備えることを特徴とする請求項1又は2に記載の割り込み支援回路装置。
The interrupt prediction unit,
An interrupt prediction execution unit that predicts an interrupt to occur and outputs a prediction signal based on the interrupt;
A speculative fetish control unit that generates a speculative fetish request for reading data used for interrupt processing of the predicted interrupt based on the prediction signal output from the interrupt prediction execution unit and transmits the request to the main memory;
The interrupt support circuit device according to claim 1, further comprising: a cache memory control unit configured to store data used for the interrupt processing transmitted from the main memory in the cache memory.
前記キャッシュメモリ制御部は、各種処理のデータ要求を前記CPUから前記CPUインタフェースを介して受信した場合に、そのデータ要求に対応するデータを前記キャッシュメモリから検索し、検索された場合にそのデータを前記CPUインタフェースを介して前記CPUに送信することを特徴とする請求項3に記載の割り込み支援回路装置。The cache memory control unit, when receiving data requests for various processes from the CPU via the CPU interface, searches the cache memory for data corresponding to the data requests. The interrupt support circuit device according to claim 3, wherein the interrupt is transmitted to the CPU via the CPU interface. 前記制御部は、前記キャッシュメモリ制御部により前記データ要求に対応するデータが前記キャッシュメモリから検索されない場合に、前記データ要求に対応するデータを前記メモリインタフェースを介して前記メインメモリから受信し、そのデータを前記CPUインタフェースを介して前記CPUに送信することを特徴とする請求項4に記載の割り込み支援回路装置。The control unit, when the data corresponding to the data request is not retrieved from the cache memory by the cache memory control unit, receives data corresponding to the data request from the main memory via the memory interface, The interrupt support circuit device according to claim 4, wherein the data is transmitted to the CPU via the CPU interface. 前記キャッシュメモリ制御部は、前記メインメモリから送信された前記割り込み処理に用いるデータを前記キャッシュメモリに格納させる場合に、そのデータの読み出しを有効にして前記キャッシュメモリに格納させ、前記キャッシュメモリに格納されたデータを前記CPUに送信した場合に、その送信されたデータの読み出しを無効にして前記キャッシュメモリに格納させることを特徴とする請求項3から5のいずれか一項に記載の割り込み支援回路装置。The cache memory control unit, when storing data used for the interrupt processing transmitted from the main memory in the cache memory, enables reading of the data, stores the data in the cache memory, and stores the data in the cache memory. 6. The interrupt support circuit according to claim 3, wherein when the transmitted data is transmitted to the CPU, reading of the transmitted data is invalidated and the data is stored in the cache memory. apparatus. 前記キャッシュメモリの記憶領域は、複数のチャネルに分割され、
前記キャッシュメモリ制御部は、1種類の割り込みに対応するデータを1つのチャネルに格納させることを特徴とする請求項3から6のいずれか一項に記載の割り込み支援回路装置。
The storage area of the cache memory is divided into a plurality of channels,
The interrupt support circuit device according to claim 3, wherein the cache memory control unit stores data corresponding to one type of interrupt in one channel.
前記割り込み予測実行部は、
各割り込みの発生間隔をカウントするカウンタと、
前記各割り込みの発生の基準となる基準間隔値を記憶する基準間隔記憶部と、
前記カウンタから出力された所定の割り込みに対応するカウンタ値が、前記基準間隔記憶部に記憶された基準間隔値に対応する場合に、その割り込みに対応する予測信号を生成する予測信号生成部とを備えることを特徴とする請求項3から7のいずれか一項に記載の割り込み支援回路装置。
The interrupt prediction execution unit,
A counter that counts each interrupt occurrence interval,
A reference interval storage unit that stores a reference interval value serving as a reference for the occurrence of each interrupt;
When a counter value corresponding to a predetermined interrupt output from the counter corresponds to the reference interval value stored in the reference interval storage unit, a prediction signal generation unit that generates a prediction signal corresponding to the interrupt. The interrupt support circuit device according to any one of claims 3 to 7, further comprising:
前記割り込み予測実行部は、
過去に発生した各割り込みの発生間隔を平均する平均部を備え、
前記基準間隔記憶部は、前記平均部により平均された各割り込みの発生間隔を基準間隔値として記憶することを特徴とする請求項8に記載の割り込み支援回路装置。
The interrupt prediction execution unit,
Equipped with an averaging unit that averages the interval between each interrupt that occurred in the past,
9. The interrupt support circuit device according to claim 8, wherein the reference interval storage unit stores, as a reference interval value, the intervals of occurrence of each interrupt averaged by the averaging unit.
前記所定の割り込みが周期的割り込みであり、
前記予測信号生成部は、前記カウンタから出力された前記周期的割り込みに対応するカウンタ値が、前記基準間隔記憶部に記憶された前記周期的割り込みに対応する基準間隔値を超える所定時間前に、その周期的割り込みに対応する予測信号を生成することを特徴とする請求項8又は9に記載の割り込み支援回路装置。
The predetermined interrupt is a periodic interrupt,
The prediction signal generation unit, a predetermined time before the counter value corresponding to the periodic interrupt output from the counter exceeds the reference interval value corresponding to the periodic interrupt stored in the reference interval storage unit, 10. The interrupt support circuit device according to claim 8, wherein a prediction signal corresponding to the periodic interrupt is generated.
前記所定の割り込みが、第1の割り込み発生後に所定間隔で発生する関連型割り込みとしての第2の割り込みであり、
前記カウンタは、前記第1の割り込みの発生間隔をカウントし、
前記予測信号生成部は、前記カウンタから出力された前記第1の割り込みに対応するカウンタ値が、前記基準間隔記憶部に記憶された、前記第1の割り込み発生からの前記第2の割り込みの発生間隔に対応する基準間隔値を超える所定時間前に、その第2の割り込みに対応する予測信号を生成することを特徴とする請求項8から10のいずれか一項に記載の割り込み支援回路装置。
The predetermined interrupt is a second interrupt as a related interrupt generated at a predetermined interval after the first interrupt has occurred,
The counter counts an interval at which the first interrupt occurs,
The prediction signal generation unit may include a counter value corresponding to the first interrupt output from the counter, the counter value being stored in the reference interval storage unit, and the generation of the second interrupt from the generation of the first interrupt. The interrupt support circuit device according to any one of claims 8 to 10, wherein a prediction signal corresponding to the second interrupt is generated a predetermined time before exceeding a reference interval value corresponding to the interval.
前記所定の割り込みがランダムに発生するランダム割り込みであり、
前記カウンタは、発生時間に規則性を有する規則的割り込みの発生間隔をカウントし、
前記予測信号生成部は、前記カウンタから出力されたカウンタ値が、前記基準間隔記憶部に記憶された前記規則的割り込みに対応する基準間隔値を超えた場合に、前記ランダム割り込みに対応する予測信号を生成することを特徴とする請求項8から11のいずれか一項に記載の割り込み支援回路装置。
The predetermined interrupt is a random interrupt that occurs randomly,
The counter counts an interval of occurrence of a regular interrupt having a regularity in an occurrence time,
The prediction signal generation unit, when the counter value output from the counter exceeds the reference interval value corresponding to the regular interrupt stored in the reference interval storage unit, the prediction signal corresponding to the random interrupt The interrupt support circuit device according to any one of claims 8 to 11, wherein the interrupt support circuit device generates:
前記キャッシュメモリ制御部は、前記キャッシュメモリの記憶領域を参照し、前記記憶領域に対する空き領域の割合が所定量以上である場合に、所定の割り込みに対応する投機フェチ要求を生成させるための投機フェチ開始要求を前記投機フェチ制御部に入力することを特徴とする請求項3から12のいずれか一項に記載の割り込み支援回路装置。The cache memory control unit refers to a storage area of the cache memory, and when a ratio of a free area to the storage area is equal to or more than a predetermined amount, a speculative fetish for generating a speculative fetish request corresponding to a predetermined interrupt. The interrupt support circuit device according to claim 3, wherein a start request is input to the speculative fetish control unit. CPUと、
割り込み処理に用いるデータのメインメモリから前記CPUへの通信を支援する請求項1から13のいずれか一項に記載の割込み支援回路装置とを備えることを特徴とするマイクロコンピュータ。
A CPU,
14. A microcomputer comprising the interrupt support circuit device according to claim 1, which supports communication of data used for interrupt processing from a main memory to the CPU.
割り込み処理に用いるデータのメインメモリからCPUへの通信をキャッシュメモリを介して支援する割り込み支援方法であって、
発生する割り込みを予測して、その割り込みの割り込み処理に用いるデータを、前記メインメモリから読み出して前記キャッシュメモリに格納し、前記CPUからのデータ要求に基づいて、その格納されたデータを前記CPUに送信することを特徴とする割り込み支援方法。
An interrupt support method for supporting communication of data used for interrupt processing from a main memory to a CPU via a cache memory,
Predicting an interrupt to occur, reading data used for interrupt processing of the interrupt from the main memory, storing the data in the cache memory, and transmitting the stored data to the CPU based on a data request from the CPU. An interrupt support method characterized by transmitting.
前記予測された割り込みの割り込み処理の開始前に、その割り込み処理に用いるデータを前記キャッシュメモリに格納することを特徴とする請求項15に記載の割り込み支援方法。16. The interrupt support method according to claim 15, wherein before starting the interrupt processing of the predicted interrupt, data used for the interrupt processing is stored in the cache memory. 発生する割り込みを予測してその割り込みに基づく予測信号を出力し、
前記出力された予測信号に基づいて、予測された割り込みの割り込み処理に用いるデータを読み出すための投機フェチ要求を生成して前記メインメモリに送信し、
前記メインメモリから送信された前記割り込み処理に用いるデータを前記キャッシュメモリに格納させることを備えることを特徴とする請求項15又は16に記載の割り込み支援方法。
Predicts an interrupt to occur and outputs a prediction signal based on the interrupt,
Based on the output prediction signal, generate a speculative fetish request for reading data used for the interrupt processing of the predicted interrupt and transmit the request to the main memory,
17. The interrupt support method according to claim 15, further comprising storing data used for the interrupt processing transmitted from the main memory in the cache memory.
割り込み処理のデータ要求を前記CPUから受信した場合に、そのデータ要求に対応するデータを前記キャッシュメモリから検索し、検索された場合にそのデータを前記CPUに送信することを特徴とする請求項17に記載の割り込み支援方法。18. The method according to claim 17, wherein when a data request for interrupt processing is received from the CPU, data corresponding to the data request is retrieved from the cache memory, and when retrieved, the data is transmitted to the CPU. 2. The interrupt support method according to 1. 前記データ要求に対応するデータが前記キャッシュメモリから検索されない場合に、前記データ要求に対応するデータを前記メインメモリから受信し、そのデータを前記CPUに送信することを特徴とする請求項18に記載の割り込み支援方法。19. The data processing apparatus according to claim 18, wherein when data corresponding to the data request is not retrieved from the cache memory, data corresponding to the data request is received from the main memory, and the data is transmitted to the CPU. Interrupt support method. 前記メインメモリから送信された前記割り込み処理に用いるデータを前記キャッシュメモリに格納させる場合に、そのデータの読み出しを有効にして前記キャッシュメモリに格納させ、前記キャッシュメモリに格納されたデータを前記CPUに送信した場合に、その送信されたデータの読み出しを無効にして前記キャッシュメモリに格納させることを特徴とする請求項15から19のいずれか一項に記載の割り込み支援方法。In the case where the data used for the interrupt processing transmitted from the main memory is stored in the cache memory, reading of the data is enabled and stored in the cache memory, and the data stored in the cache memory is transmitted to the CPU. 20. The interrupt support method according to claim 15, wherein, when transmitted, reading of the transmitted data is invalidated and stored in the cache memory. 前記キャッシュメモリの記憶領域は、複数のチャネルに分割され、
1種類の割り込みに対応するデータを1つのチャネルに格納させることを特徴とする請求項15から20のいずれか一項に記載の割り込み支援方法。
The storage area of the cache memory is divided into a plurality of channels,
21. The interrupt support method according to claim 15, wherein data corresponding to one type of interrupt is stored in one channel.
各割り込みの発生間隔をカウントし、
前記カウントされた所定の割り込みに対応するカウンタ値が、前記各割り込みの発生の基準となる基準間隔値に対応する場合に、その割り込みに対応する予測信号を生成することを特徴とする請求項15から21のいずれか一項に記載の割り込み支援方法。
Count the interval of each interrupt occurrence,
16. The method according to claim 15, wherein when the counted counter value corresponding to the predetermined interrupt corresponds to a reference interval value serving as a reference for the occurrence of each of the interrupts, a prediction signal corresponding to the interrupt is generated. 23. The interrupt support method according to any one of items 21 to 21.
過去に発生した各割り込みの発生間隔を平均し、
前記平均された各割り込みの発生間隔を基準間隔値とすることを特徴とする請求項22に記載の割り込み支援方法。
Average the interval of each interrupt that occurred in the past,
23. The interrupt support method according to claim 22, wherein the averaged interval of occurrence of each interrupt is set as a reference interval value.
前記所定の割り込みが周期的割り込みであり、
前記カウントされた前記周期的割り込みに対応するカウンタ値が、前記周期的割り込みに対応する基準間隔値を超える所定時間前に、その周期的割り込みに対応する予測信号を生成することを特徴とする請求項22又は23に記載の割り込み支援方法。
The predetermined interrupt is a periodic interrupt,
The prediction signal corresponding to the periodic interrupt is generated a predetermined time before the counted counter value corresponding to the periodic interrupt exceeds a reference interval value corresponding to the periodic interrupt. Item 24. The interrupt support method according to Item 22 or 23.
前記所定の割り込みが、第1の割り込み発生後に所定間隔で発生する関連型割り込みとしての第2の割り込みであり、
前記第1の割り込みの発生間隔をカウントし、
前記カウントされた前記第1の割り込みに対応するカウンタ値が、前記第1の割り込み発生からの前記第2の割り込みの発生間隔に対応する基準間隔値を超える所定時間前に、その第2の割り込みに対応する予測信号を生成することを特徴とする請求項22から24のいずれか一項に記載の割り込み支援方法。
The predetermined interrupt is a second interrupt as a related interrupt generated at a predetermined interval after the first interrupt has occurred,
Counting the interval of occurrence of the first interrupt,
Before the counted counter value corresponding to the first interrupt exceeds a reference interval value corresponding to an interval of occurrence of the second interrupt from the occurrence of the first interrupt, a predetermined time before the second interrupt, The method according to any one of claims 22 to 24, wherein a prediction signal corresponding to the following is generated.
前記所定の割り込みがランダムに発生するランダム割り込みであり、
発生時間に規則性を有する規則的割り込みの発生間隔をカウントし、
前記カウントされたカウンタ値が、前記規則的割り込みに対応する基準間隔値を超えた場合に、前記ランダム割り込みに対応する予測信号を生成することを特徴とする請求項22から25のいずれか一項に記載の割り込み支援方法。
The predetermined interrupt is a random interrupt that occurs randomly,
Count the interval of occurrence of regular interrupts with regular occurrence time,
26. A predictive signal corresponding to the random interrupt is generated when the counted counter value exceeds a reference interval value corresponding to the regular interrupt. 3. The interrupt support method described in 1.
前記キャッシュメモリの記憶領域を参照し、前記記憶領域に対する空き領域の割合が所定量以上である場合に、所定の割り込みに対応する投機フェチ要求を生成させるための投機フェチ開始要求を生成して、その投機フェチ要求を生成させることを特徴とする請求項17から26のいずれか一項に記載の割り込み支援方法。Referring to the storage area of the cache memory, when the ratio of the free area to the storage area is a predetermined amount or more, generate a speculative fetish start request for generating a speculative fetish request corresponding to a predetermined interrupt, The interrupt support method according to any one of claims 17 to 26, wherein the speculative fetish request is generated.
JP2003042683A 2003-02-20 2003-02-20 Interruption supporting circuit device, microcomputer, and interruption supporting method Pending JP2004252729A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003042683A JP2004252729A (en) 2003-02-20 2003-02-20 Interruption supporting circuit device, microcomputer, and interruption supporting method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003042683A JP2004252729A (en) 2003-02-20 2003-02-20 Interruption supporting circuit device, microcomputer, and interruption supporting method

Publications (1)

Publication Number Publication Date
JP2004252729A true JP2004252729A (en) 2004-09-09

Family

ID=33025897

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003042683A Pending JP2004252729A (en) 2003-02-20 2003-02-20 Interruption supporting circuit device, microcomputer, and interruption supporting method

Country Status (1)

Country Link
JP (1) JP2004252729A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8560748B2 (en) 2010-06-29 2013-10-15 Fujitsu Semiconductor Limited Information processing system including interrupt processing function

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8560748B2 (en) 2010-06-29 2013-10-15 Fujitsu Semiconductor Limited Information processing system including interrupt processing function

Similar Documents

Publication Publication Date Title
CN109446112B (en) Method and system for improved control of prefetch traffic
KR20180092277A (en) Data processing
TWI379229B (en) Microprocessor with multiple operating modes dynamically configurable by a device driver based on currently running applications
KR101168544B1 (en) Adaptively handling remote atomic execution
US8521982B2 (en) Load request scheduling in a cache hierarchy
US9223717B2 (en) Computer cache system providing multi-line invalidation messages
US8566493B2 (en) Interrupt controller and methods of operation
EP1782218B1 (en) Processing apparatus with burst read and write operations
JPS62152043A (en) Control system for instruction code access
JP2005182825A5 (en)
KR20000005675A (en) Cache architecture to enable accurate cache sensitivity
JP2008117388A (en) Cache and cache bypass functional method
JPH11353052A (en) Operation speed control method for processor inside computer and computer
JP2004038337A (en) Instruction fetch control device
WO2005088454A2 (en) Processing pipeline with progressive cache
WO2013118010A1 (en) Forward progress mechanism for stores in the presence of load contention in a system favoring loads
US6606688B1 (en) Cache control method and cache controller
US20170300416A1 (en) Arithmetic processing apparatus and control method of the arithmetic processing apparatus
TWI291102B (en) Sender to receiver request retry method and apparatus
EP1988465B1 (en) Processor, and cache control method
JP4030314B2 (en) Arithmetic processing unit
CN101911032A (en) Selective preclusion of a bus access request
JP2004252729A (en) Interruption supporting circuit device, microcomputer, and interruption supporting method
JP4504134B2 (en) System control apparatus, speculative fetch method, and information processing apparatus
JP5397771B2 (en) Performance optimization system, method and program