JPH08221270A - Data processor - Google Patents

Data processor

Info

Publication number
JPH08221270A
JPH08221270A JP7137392A JP13739295A JPH08221270A JP H08221270 A JPH08221270 A JP H08221270A JP 7137392 A JP7137392 A JP 7137392A JP 13739295 A JP13739295 A JP 13739295A JP H08221270 A JPH08221270 A JP H08221270A
Authority
JP
Japan
Prior art keywords
instruction
prefetch
interrupt
cache
address
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.)
Granted
Application number
JP7137392A
Other languages
Japanese (ja)
Other versions
JP3614207B2 (en
Inventor
Hiroshi Takeda
博 武田
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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP13739295A priority Critical patent/JP3614207B2/en
Publication of JPH08221270A publication Critical patent/JPH08221270A/en
Application granted granted Critical
Publication of JP3614207B2 publication Critical patent/JP3614207B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE: To prefetch the interrupt program. CONSTITUTION: The data processor is provided with cache memories 20 to 22, prefetch buffers 23 to 25 for the memories 20 to 22, and control circuit 26 prefetching the command to the prefetch buffers 23 to 25 in parallel with the command fetch from the cache memories 20 to 23 by a CPU 3. The head address of the interrupt program is given to a register 27 during the interrupt transient control such as a retrieval required for the CPU 3 to move on the interrupt program. The device is provided with a control circuit 26 which prefetches a command to the prefetch buffer according to the interrupt address information given to the register 27.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、中央処理装置が命令キ
ャッシュメモリ及び命令プリフェッチバッファを利用し
てデータ処理を行うデータ処理装置に係り、詳しくは命
令プリフェッチ機能を割込みに対しても拡張する技術に
関し、例えばデータプロセッサ若しくはマイクロコンピ
ュータそしてその応用システムに適用して有効な技術に
関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data processing device in which a central processing unit uses an instruction cache memory and an instruction prefetch buffer to perform data processing, and more specifically, a technique for extending the instruction prefetch function to interrupts. The present invention relates to a technique effectively applied to, for example, a data processor or a microcomputer and its application system.

【0002】[0002]

【従来の技術】中央処理装置のデータ処理能力を向上さ
せるために、RAM(ランダム・アクセス・メモリ)、
ROM(リード・オンリ・メモリ)、ハードディスク装
置、フロッピーディスク装置などの大容量記憶装置の一
部の情報を読込む比較的小容量だが大容量記憶装置に比
べて命令やデータを高速にアクセスできるキャッシュメ
モリを内蔵または中央処理装置に密接に外付けすること
が一般的に行われている。このような中央処理装置は、
キャッシュメモリに情報が存在するうちはキャッシュメ
モリ中の命令やデータを参照しながら実行を継続し、ま
た、実行結果を一時的にキャッシュメモリに格納するこ
とで、外部大容量記憶装置をアクセスしながら実行する
のに比べて飛躍的にデータ処理能力を向上させることが
できる。但し、キャッシュメモリに中央処理装置が必要
とする情報が存在しない場合、キャッシュメモリは、中
央処理装置に命令の実行を中断させて外部大容量記憶装
置より必要な情報を読込んで保持する動作を行い、その
後中央処理装置に中断していた命令の実行を再開させ
る。この状態が多発すると逆に中央処理装置の性能が低
下することになる。したがって、そのような中央処理装
置の性能を最大限に引き出すには、命令実行の中断が無
いように実行中に必要な情報を常にキャッシュメモリに
存在させることが必要になる。
2. Description of the Related Art In order to improve the data processing capacity of a central processing unit, a RAM (random access memory),
A cache that reads some information from a mass storage device such as a ROM (Read Only Memory), hard disk device, floppy disk device, etc., but that can access instructions and data faster than a mass storage device. It is common practice to have the memory internal or closely external to the central processing unit. Such a central processing unit
While the information exists in the cache memory, the execution is continued while referring to the instructions and data in the cache memory, and the execution result is temporarily stored in the cache memory to access the external mass storage device. The data processing capability can be dramatically improved as compared with the execution. However, when the information required by the central processing unit does not exist in the cache memory, the cache memory performs the operation of causing the central processing unit to interrupt the execution of the instruction and reading and holding the necessary information from the external mass storage device. Then, the central processing unit restarts the execution of the interrupted instruction. If this state occurs frequently, the performance of the central processing unit is deteriorated. Therefore, in order to maximize the performance of such a central processing unit, it is necessary that the information required during execution be always present in the cache memory so that there is no interruption of instruction execution.

【0003】キャッシュメモリは、例えば一つのエント
リを構成する1キャッシュラインの情報が外部記憶装置
のどの位置(アドレス)に対応しているかを示す実効ア
ドレス(仮想アドレスまたは物理アドレス)を記憶するキ
ャッシュタグ、その実効アドレスを先頭とした連続する
nワードの情報を記憶するデータ部、そしてそのキャッ
シュラインに記憶している情報が有効であるかを示す有
効ビットを備える。尚、必要に応じてキャッシュメモリ
の内容が更新され外部大容量記憶装置の内容と異なるこ
とを示すダーティビットなどを設ける場合もある。
The cache memory is, for example, a cache tag that stores an effective address (virtual address or physical address) indicating which position (address) of the external storage device corresponds to one cache line information that constitutes one entry. , A data part for storing information of consecutive n words starting from the effective address, and a valid bit indicating whether the information stored in the cache line is valid. Incidentally, the contents of the cache memory may be updated as necessary, and a dirty bit indicating that the contents are different from the contents of the external mass storage device may be provided.

【0004】命令キャッシュメモリにおいては、中央処
理装置からの命令アドレスと命令キャッシュメモリ内の
キャッシュタグの情報とを基に命令キャッシュメモリ内
に有効な情報が存在するか否かの判定が行われ、存在す
る場合には中央処理装置はキャッシュメモリから命令を
フェッチする。存在しない場合には、その命令アドレス
を含むキャッシュメモリの1ライン分の情報(nワード
分)をラインフェッチと呼ばれるバースト転送にて外部
大容量記憶装置から該当キャッシュメモリの所定ライン
のデータ部へ読込む。そして、ラインフェッチされた命
令が中央処理装置にフェッチされる。命令実行中にキャ
ッシュメモリ内に有効な情報が無い場合、中央処理装置
はラインフェッチにて外部記憶装置から所要の命令が読
込まれるまで、その命令の実行を開始することができな
い。この待ち時間、即ち命令実行停止時間をミスヒット
ペナルティと呼ぶが、中央処理装置の動作速度が飛躍的
に速くなり外部記憶装置とのアクセス時間の相違が大き
くなるにしたがい、ミスヒットペナルティがデータ処理
性能低下へ著しく影響する。
In the instruction cache memory, it is judged whether or not valid information exists in the instruction cache memory based on the instruction address from the central processing unit and the cache tag information in the instruction cache memory. If present, the central processing unit fetches the instruction from cache memory. If it does not exist, information for one line (n words) of the cache memory including the instruction address is read from the external mass storage device to the data part of the predetermined line of the corresponding cache memory by burst transfer called line fetch. Put in. Then, the line fetched instruction is fetched by the central processing unit. If there is no valid information in the cache memory during instruction execution, the central processing unit cannot start execution of the instruction until the required instruction is read from the external storage device by line fetch. This waiting time, that is, the instruction execution stop time, is called a mishit penalty. The mishit penalty is a data processing as the operation speed of the central processing unit dramatically increases and the difference in access time from the external storage device increases. Significantly affects performance degradation.

【0005】そこで、中央処理装置が外部記憶装置との
間でデータのやり取りを行っていない期間を利用して、
中央処理装置が将来使用すると予想される情報を中央処
理装置の実行に先行して読込むというプリフェッチの手
法を採用することができる。このプリフェッチは、予想
アドレスを用いる以外はラインフェッチとほぼ同様の動
作によって実現される。ただし、プリフェッチを行なう
と中央処理装置によるキャッシュメモリからの命令フェ
ッチと外部記憶装置からキャッシュメモリへのラインフ
ェッチがキャッシュメモリにおいて競合することがある
ため、命令プリフェッチバッファを例えばキャッシュメ
モリの1ライン分以上備えることがある。これにより、
中央処理装置による命令キャッシュメモリからの命令フ
ェッチに並行して上記命令プリフェッチバッファに命令
をプリフェッチ可能にすることができる。このような命
令キャッシュメモリの構成は一般的にノンブロッキング
キャッシュメモリと呼ばれる。尚、命令先取りを行う技
術について記載された文献の例としては特開平3−97
032号公報がある。
Therefore, by utilizing the period during which the central processing unit is not exchanging data with the external storage device,
It is possible to employ a prefetching method of reading information expected to be used by the central processing unit in the future in advance of execution of the central processing unit. This prefetch is realized by almost the same operation as the line fetch except that the expected address is used. However, if prefetch is performed, the instruction fetch from the cache memory by the central processing unit and the line fetch from the external storage device to the cache memory may conflict with each other in the cache memory, so the instruction prefetch buffer may be, for example, one line of the cache memory or more. May be prepared. This allows
The instruction can be prefetched into the instruction prefetch buffer in parallel with the instruction fetch from the instruction cache memory by the central processing unit. Such an instruction cache memory configuration is generally called a non-blocking cache memory. As an example of a document describing a technique for prefetching an instruction, Japanese Patent Laid-Open No. 3-97
There is a 032 publication.

【0006】[0006]

【発明が解決しようとする課題】プログラムの流れが、
下位の命令アドレスから上位の命令アドレスに向かって
連続している場合、命令プリフェッチは、常に現在の実
行アドレスに対し単純に次のキャッシュ・メモリの1ラ
イン分の情報(nワード分)を先取りするだけでも確実
に効果がある。しかしながら、現在のプログラムの実行
から次に動作するプログラムアドレスを動的にも静的に
も推測できない事態(実行すべき命令アドレスが所定事
象の発生によって途中で不連続とされる事態)は割込み
などによって生ずる。本明細書において割込みとは、C
PUの命令実行途中に発生するアドレスエラーなどの例
外事象の発生を含む概念として用いられる。割込みがC
PUの外部から要求される場合にはその要因とされる事
象はCPUの動作とは非同期で発生され、また、CPU
の内部で割込みが発生される場合にも、CPUはそれが
何時発生するかを予測することは実質的に不可能であ
る。したがって、そのような割込み要求に応答するため
の割込み処理プログラムの命令をプリフェッチすること
は従来行われておらず、これによる性能の低下は如何と
もしがたいことが本発明者によって明らかにされた。こ
のように、高性能化のために内蔵もしくは外付けしたキ
ャッシュメモリに予測できる範囲で命令やデータをプリ
フェッチし、割込みのようにいつ処理動作が開始される
か予測不可能なプログラムについては、プリフェッチを
断念しており、高速化のために備えたキャッシュメモリ
の性能を十分に生かしきっていないことが本発明者によ
って明らかにされた。
[Problems to be Solved by the Invention]
When continuing from the lower instruction address to the upper instruction address, the instruction prefetch always simply prefetches the information (n words) for one line of the next cache memory to the current execution address. There is definitely an effect alone. However, if the next program address to be executed cannot be dynamically or statically estimated from the execution of the current program (the instruction address to be executed is discontinuous in the middle due to occurrence of a predetermined event), an interrupt etc. Caused by. In this specification, an interrupt is C
It is used as a concept including the occurrence of exception events such as address errors that occur during execution of PU instructions. Interrupt is C
When it is requested from the outside of the PU, the event that causes it is generated asynchronously with the operation of the CPU.
When an interrupt is generated inside the CPU, it is virtually impossible for the CPU to predict when it will occur. Therefore, it has been clarified by the present inventors that the instruction of the interrupt processing program for responding to such an interrupt request has not been prefetched in the past, and the performance degradation due to this has been difficult. . In this way, instructions and data are prefetched within the predictable range in the internal or external cache memory for high performance, and prefetching is performed for programs that cannot predict when processing will start, such as interrupts. It has been clarified by the present inventor that the performance of the cache memory provided for speeding up is not fully utilized.

【0007】本発明の目的は、実行開始時点を予測でき
ないような割込み処理プログラムについてもプリフェッ
チを行うことができるデータ処理装置を提供することに
ある。更に本発明は、従来からある多くの種類のプリフ
ェッチ機能を有するキャッシュメモリや命令プリフェッ
チバッファの構成を極僅かに変更するだけで、換言すれ
ばコスト上昇を抑えて、上記目的を達成できるデータ処
理装置を提供しようとするものである。
It is an object of the present invention to provide a data processing device capable of prefetching an interrupt processing program whose execution start time cannot be predicted. Further, the present invention is a data processing apparatus which can achieve the above-mentioned object by slightly changing the configurations of the cache memory and the instruction prefetch buffer having many kinds of conventional prefetch functions, in other words, suppressing the cost increase. Is to provide.

【0008】本発明の前記並びにその他の目的と新規な
特徴は本明細書の記述及び添付図面から明らかになるで
あろう。
The above and other objects and novel features of the present invention will be apparent from the description of this specification and the accompanying drawings.

【0009】[0009]

【課題を解決するための手段】本願において開示される
発明のうち代表的なものの概要を簡単に説明すれば下記
の通りである。
The outline of the representative one of the inventions disclosed in the present application will be briefly described as follows.

【0010】すなわち、割込みが発生してから中央処理
装置による命令実行が割込み処理プログラム(割込み要
求に応答するための処理プログラム)に切り替わるまで
には必ず時間的な間隙があるため、この時間的隙間に、
割込み処理プログラムを命令プリフェッチバッファや命
令キャッシュにプリフェッチして、データ処理性能を向
上させようとするものである。中央処理装置のデータ処
理性能を向上するには、実行する確率が高い命令を高い
確率で命令キャッシュメモリに留まらせる必要がある。
確率を高くするには、単に命令キャッシュメモリの容量
を大きくすることで対処することも可能であるが、シス
テムコストが上昇する難点があり、現実的ではない。こ
の点において本発明は、命令キャッシュメモリと命令プ
リフェッチバッファのプリフェッチ機構に着眼し、それ
らに対する命令のプリフェッチアルゴリズム(制御フロ
ー)とキャッシュメモリ及び命令プリフェッチバッファ
の構造に若干の工夫を加えることで、コストアップを抑
えて命令キャッシュメモリの高性能化を実現する。その
ための手段を以下に示す。
That is, there is always a time gap from the occurrence of the interrupt until the instruction execution by the central processing unit is switched to the interrupt processing program (processing program for responding to the interrupt request). To
The interrupt processing program is prefetched into an instruction prefetch buffer or an instruction cache to improve data processing performance. In order to improve the data processing performance of the central processing unit, it is necessary to cause the instruction cache memory to have a high probability of retaining an instruction having a high execution probability.
To increase the probability, it is possible to deal with it by simply increasing the capacity of the instruction cache memory, but this is not realistic because there is a drawback that the system cost increases. In this respect, the present invention focuses on the prefetch mechanism of the instruction cache memory and the instruction prefetch buffer, and adds some ingenuity to the instruction prefetch algorithm (control flow) and the structure of the cache memory and the instruction prefetch buffer for them, thereby reducing the cost. Achieve high performance of the instruction cache memory by suppressing the increase. The means for doing so will be described below.

【0011】〔1〕データ処理装置(データプロセッサ
1)は、命令を実行する中央処理装置(3)と、前記命
令をプリフェッチする命令プリフェッチバッファ(2
3,24,25)と、プリフェッチされた命令を保持す
る命令キャッシュメモリ(20,21,22)と、命令
フェッチの指令に対して命令フェッチアドレスに応ずる
命令を前記プリフェッチバッファ、命令キャッシュメモ
リ、又は外部から取得する制御を行い、命令プリフェッ
チの指令に対して命令プリフェッチアドレスに応ずる命
令を外部から前記プリフェッチバッファに取得する制御
を行うキャッシュ及びプリフェッチ制御回路(26)
と、割込み要求を受け付けたとき、当該要求に応答する
ための処理プログラムの先頭アドレス情報に基づいて命
令プリフェッチバッファに命令をプリフェッチさせる指
示(406)を上記キャッシュ及びプリフェッチ制御回
路に与える割込み制御回路(4)とを備えて成る。
[1] A data processing device (data processor 1) includes a central processing unit (3) for executing an instruction and an instruction prefetch buffer (2 for prefetching the instruction.
3, 24, 25), an instruction cache memory (20, 21, 22) for holding prefetched instructions, and an instruction corresponding to an instruction fetch address in response to an instruction fetch instruction, the prefetch buffer, the instruction cache memory, or A cache and prefetch control circuit (26) for controlling to acquire from the outside and controlling to acquire an instruction corresponding to an instruction prefetch address from the outside to the prefetch buffer in response to an instruction of the instruction prefetch
When an interrupt request is accepted, an instruction (406) for instructing the instruction prefetch buffer to prefetch an instruction based on the start address information of the processing program for responding to the request is given to the cache and the prefetch control circuit. 4) and are provided.

【0012】〔2〕割込み処理プログラムの命令プリフ
ェッチは、割込みが発生した後、中央処理装置が内部状
態を退避などするための割込み遷移制御の期間に並行し
て行われる。この割込み遷移制御の期間において、前記
命令プリフェッチ可能な機会を多くするという観点に立
てば、割込み制御回路からの割込み受け付けの通知を中
央処理装置が受け付けてから当該中央処理装置が当該割
込み要求に応答する処理プログラムの実行開始に至るま
での遷移制御期間に中央処理装置の内部状態が退避され
るデータ記憶手段を更に備えて、データ処理装置を一つ
の半導体基板に形成する。例えば前記データ記憶手段を
データキャッシュメモリ(DCACHE)とする場合に
は、当該データキャッシュメモリと外部との間にライト
バックバッファ(WBB)を設けるとよい。尚、ライト
バックはコピーバックとも称されている。
[2] The instruction prefetch of the interrupt processing program is performed in parallel with the interrupt transition control period for the central processing unit to save the internal state after the interrupt occurs. From the viewpoint of increasing the chances of instruction prefetching during this interrupt transition control period, the central processing unit responds to the interrupt request after the central processing unit receives the interrupt acceptance notification from the interrupt control circuit. Further, the data processing device is formed on one semiconductor substrate by further including data storage means for saving the internal state of the central processing unit during the transition control period until the execution of the processing program. For example, when the data storage means is a data cache memory (DCACHE), a write back buffer (WBB) may be provided between the data cache memory and the outside. The write back is also called copy back.

【0013】〔3〕上記割込み制御回路(4)はこれが
受け付けた割込み要求に応答するための割込み処理プロ
グラムの先頭アドレス情報をアドレスレジスタ(27)
に供給し、前記キャッシュ及びプリフェッチ制御回路
(26)は、前記アドレスレジスタに保持されたアドレ
ス情報に基づいて命令プリフェッチを行うように構成で
きる。また、割込み制御回路(4)は前記割込み処理プ
ログラムの先頭アドレス情報を出力するために、割込み
要因に対応させて各種先頭アドレス情報を保持するテー
ブル(40)を供え、割込み要求を受け付けたとき、当
該要求の要因に応ずるアドレスを上記テーブル(40)
から上記アドレスレジスタ(27)に供給するように構
成できる。このとき、割込み処理プログラムのマッピン
グに対する自由度を考慮するならば、上記テーブル(4
0)は上記中央処理装置(3)によって書き換え可能に
するとよい。更に前記割込み制御回路(4)は、受け付
けられた割込み要求元の周辺回路(7)から、割込み処
理プログラムの先頭アドレス情報を受け、これをアドレ
スレジスタ(27)に与えるようにすることも可能であ
る。
[3] The interrupt control circuit (4) stores the start address information of the interrupt processing program for responding to the interrupt request accepted by the address register (27).
The cache and prefetch control circuit (26) can be configured to perform instruction prefetch based on the address information held in the address register. Further, the interrupt control circuit (4) provides a table (40) for holding various start address information corresponding to an interrupt factor in order to output the start address information of the interrupt processing program, and when an interrupt request is accepted, The address corresponding to the cause of the request is set in the table (40).
To the address register (27). At this time, if the degree of freedom for mapping the interrupt processing program is taken into consideration, the above table (4
0) may be rewritable by the central processing unit (3). Further, the interrupt control circuit (4) can receive the start address information of the interrupt processing program from the peripheral circuit (7) of the accepted interrupt request source and give it to the address register (27). is there.

【0014】〔4〕命令キャッシュメモリが、所定語数
の命令を一つのデータブロックとして複数個格納するた
めのキャッシュデータ部(20)と、キャッシュデータ
部の命令とその命令アドレスとを関連付けるためのキャ
ッシュアドレス部(21)と、命令アクセスアドレスの
一部(ATAG)がキャッシュアドレス部のアドレス情
報(CTAG)に一致するか否かを検出するキャッシュ
比較回路(22)とによって構成されるとき、前記命令
プリフェッチバッファを、上記キャッシュデータ部の一
つのデータブロックの命令語数に等しい語数の命令を一
つのデータブロック(キャッシュデータ部20の1ライ
ン分のデータ)として格納可能なバッファデータ部(2
3)と、該バッファデータ部の命令とその命令アドレス
とを関連付けるためのバッファアドレス部(24)と、
命令アクセスアドレスの一部(ATAG,IDX)がバ
ッファアドレス部のアドレス情報(BTAG,IDX)
に一致するか否かを検出するバッファ比較回路(25)
とを供えて構成するとよい。これにより、命令キャッシ
ュメモリにおける1キャッシュライン分のラインフェッ
チと同様の制御によって命令プリフェッチバッファに対
するプリフェッチを行うことができるようになる。この
とき、上記キャッシュ及びプリフェッチ制御回路(2
6)は、前記命令プリフェッチの指令に対して、前記キ
ャッシュ比較回路(22)及びバッファ比較回路(2
5)の双方から不一致の比較結果を検出することにより
命令プリフェッチバッファへの命令プリフェッチを起動
し(ステップS44=NO)、実質的に無駄なプリフェ
ッチを行わない。命令プリフェッチバッファへの命令プ
リフェッチの完了後における命令アクセスに際して前記
バッファ比較回路における一致の比較結果を検出するこ
とにより前記プリフェッチ完了された命令プリフェッチ
バッファの内容をキャッシュメモリに書込み制御する
(ステップS8)。これにより、命令プリフェッチバッ
ファにプリフェッチしてもバッファヒットにならず利用
されないような命令によって、既存のキャッシュエント
リを命令キャッシュメモリから追い出してしまう不都合
を解消できる。このようなプリフェッチの機構に対し
て、割込み制御回路40は、割込み要求を受け付けたと
き、当該要求に応答するための処理プログラムの先頭ア
ドレス情報に基づいて命令プリフェッチバッファに命令
をプリフェッチさせる指令(406)をキャッシュ及び
プリフェッチ制御回路26に与える。
[4] An instruction cache memory has a cache data section (20) for storing a plurality of instructions having a predetermined number of words as one data block, and a cache for associating the instruction of the cache data section with its instruction address. The instruction when the address section (21) and a cache comparison circuit (22) for detecting whether a part (ATAG) of the instruction access address matches the address information (CTAG) of the cache address section In the prefetch buffer, a buffer data unit (2 that can store an instruction having a number of words equal to the number of instruction words of one data block of the cache data unit as one data block (data for one line of the cache data unit 20)
3), and a buffer address part (24) for associating the command of the buffer data part with the command address thereof,
Part of the instruction access address (ATAG, IDX) is the address information (BTAG, IDX) of the buffer address part.
Buffer comparison circuit (25) for detecting whether or not
It is good to configure with and. As a result, the prefetch for the instruction prefetch buffer can be performed by the same control as the line fetch for one cache line in the instruction cache memory. At this time, the cache and prefetch control circuit (2
6) is a cache comparison circuit (22) and a buffer comparison circuit (2) in response to the instruction prefetch command.
The instruction prefetch to the instruction prefetch buffer is started by detecting the non-coincidence comparison result from both of 5) (step S44 = NO), and substantially unnecessary prefetch is not performed. When the instruction access to the instruction prefetch buffer after completion of the instruction prefetch is performed, the content of the prefetch completed instruction prefetch buffer is written in the cache memory by detecting the comparison result of the coincidence in the buffer comparison circuit (step S8). As a result, it is possible to eliminate the inconvenience of erasing an existing cache entry from the instruction cache memory by an instruction that does not result in a buffer hit and is not used even if prefetched into the instruction prefetch buffer. In response to such a prefetch mechanism, the interrupt control circuit 40, when accepting an interrupt request, issues a command (406) for prefetching an instruction in the instruction prefetch buffer based on the start address information of the processing program for responding to the request. ) To the cache and prefetch control circuit 26.

【0015】〔5〕上記手段〔4〕において、命令プリ
フェッチの指令発生元として、中央処理装置の他に割込
み制御回路が追加されている。このとき、命令フェッチ
と命令プリフェッチのための命令アクセスアドレスを保
持するアドレスレジスタを、双方からの命令プリフェッ
チの指令と共に命令フェッチに共用させるには、割込み
処理プログラムの先頭アドレスと、プログラムカウンタ
の値と、プログラムカウンタの値に基づいて生成された
プリフェッチアドレスとから選ばれた一つのアドレスを
前記アドレスレジスタに与える選択手段(271,27
2)を設け、前記キャッシュ及びプリフェッチ制御回路
(26)は、命令フェッチの指令に対して前記キャッシ
ュ比較回路及びバッファ比較回路の双方から不一致の比
較結果を検出することにより選択手段にプログラムカウ
ンタ(30)の値を選択させ、命令プリフェッチの指令
に対して、その指令発生元が割込み制御回路である場合
には選択手段に割込み処理プログラムの先頭アドレスを
選択させ、命令プリフェッチの指令に対して、その指令
発生元が中央処理装置である場合には選択手段にプログ
ラムカウンタの値に基づいて生成されたプリフェッチア
ドレスを選択させるようにする。
[5] In the above-mentioned means [4], an interrupt control circuit is added in addition to the central processing unit as an instruction prefetch instruction generation source. At this time, in order to share the address register holding the instruction access address for instruction fetch and instruction prefetch with the instruction prefetch command from both sides for instruction fetch, the start address of the interrupt processing program and the value of the program counter , Selecting means (271, 27) for giving to the address register one address selected from the prefetch address generated based on the value of the program counter.
2), the cache and prefetch control circuit (26) detects a mismatched comparison result from both the cache comparison circuit and the buffer comparison circuit in response to an instruction fetch command, and causes the selection means to have a program counter (30). ) Value is selected, and when the instruction generation source is the interrupt control circuit, the selection means selects the start address of the interrupt processing program. When the command generation source is the central processing unit, the selecting means is made to select the prefetch address generated based on the value of the program counter.

【0016】[0016]

【作用】上記した手段によれば、割込みが発生してから
プログラムが割込み処理に切り替わるまでには、中央処
理装置はプログラムカウンタの値やプロセッサステータ
スレジスタの値などをハードウェア的に退避し、更に必
要な情報を退避した後に、割込み処理プログラムを実行
することになる。パイプライン処理が採用されている場
合には、割込み処理プログラムに移る前に、割込みによ
るパイプラインの乱れを最小限にするための各種情報の
退避も必要になる。データ処理装置はそのような退避な
どの割込み遷移制御に並行して、割込み処理プログラム
の命令をプリフェッチする。プリフェッチすべき命令ア
ドレスは割込み制御回路(4)から例えばアドレスレジ
スタ(27)に与えられ、当該アドレスレジスタ(2
7)の値を用いたプリフェッチ動作の指示が割込み制御
回路(4)からキャッシュ及びプリフェッチ制御回路
(26)に与えられる。割込み処理プログラムのプリフ
ェッチに必要なメモリアクセスの機会は、退避処理等の
期間にバスが空いている時に与えられることになる。例
えば、同じレジスタを複数組持ち、割込み時にレジスタ
を切り換えることによってレジスタの退避を行うアーキ
テクチャが採用されるデータ処理装置にあっては、当該
切換え時にバスが空いているので少なくともその間に割
込み処理プログラムの命令をプリフェッチすることがで
きる。また、データに関してもデータキャッシュメモリ
とライトバックバッファとを備えたノンブロッキング・
キャッシュ・メモリが採用されたものにあっては、レジ
スタの退避領域として外部メモリ領域を用いる場合に
も、キャッシュヒットにおいては退避すべきデータをキ
ャッシュメモリが蓄えることができるので、その間のバ
スの空きタイミングによって割込み処理プログラムの命
令をプリフェッチすることができる。キャッシュミスの
場合にもエントリ入れ替えのための外部メモリへの書き
戻しデータをライトバックバッファが一時的に蓄えるの
で、当該外部メモリへの書き戻しを後回しにすることが
できる。
According to the above-mentioned means, the central processing unit saves the value of the program counter, the value of the processor status register, etc. by hardware from the occurrence of the interrupt until the program is switched to the interrupt processing. After saving the necessary information, the interrupt processing program will be executed. When pipeline processing is adopted, it is also necessary to save various types of information in order to minimize disturbance of the pipeline due to interrupts before moving to the interrupt processing program. The data processing device prefetches the instruction of the interrupt processing program in parallel with the interrupt transition control such as saving. The instruction address to be prefetched is given from the interrupt control circuit (4) to, for example, the address register (27), and the address register (2)
An instruction of the prefetch operation using the value of 7) is given from the interrupt control circuit (4) to the cache and prefetch control circuit (26). The opportunity of memory access required for prefetching the interrupt processing program is given when the bus is free during the save processing or the like. For example, in a data processing device that adopts an architecture that has a plurality of sets of the same register and saves the register by switching the register at the time of interrupt, since the bus is free at the time of switching, the interrupt processing program is Instructions can be prefetched. In addition, with regard to data, non-blocking with a data cache memory and write-back buffer
In the case where the cache memory is used, even if the external memory area is used as the save area of the register, the cache memory can store the data to be saved in the case of a cache hit. The instruction of the interrupt processing program can be prefetched depending on the timing. Even in the case of a cache miss, the write-back buffer temporarily stores the write-back data to the external memory for replacing the entry, so that the write-back to the external memory can be postponed.

【0017】[0017]

【実施例】【Example】

〔割込み遷移制御とそれに並行する命令プリフェッチ〕
先ず、本発明の一実施例に係るデータプロセッサ1
の各部を容易に理解できるように、該データプロセッサ
1による命令フェッチ及びプリフェッチのための構成、
そして割込み遷移制御とそれに並行する割込み処理プロ
グラムのプリフェッチを概略的に説明する。
[Interrupt transition control and parallel instruction prefetch]
First, a data processor 1 according to an embodiment of the present invention.
In order to easily understand each part of the above, a configuration for instruction fetch and prefetch by the data processor 1,
Then, interrupt transition control and prefetching of an interrupt processing program in parallel therewith will be schematically described.

【0018】図1には本発明の一実施例に係るデータプ
ロセッサの部分ブロック図が示される。特に制限されな
いが、同図に示されるデータプロセッサ1は、公知の半
導体集積回路製造技術によって単結晶シリコンなどの1
個の半導体基板に形成される。本実施例のデータプロセ
ッサ1は、代表的に示された命令キャッシュ・プリフェ
ッチ部2、演算制御部としての中央処理装置(CPU)
3、及び割込み制御回路4を備え、それらは内部データ
バスIDBと内部アドレスバスIABに接続される。5
1,52,53,54,55で示されるものは代表的に
図示された外部インタフェースであり、外部端子及び入
出力用のバッファ回路を備えた回路ブロックを意味す
る。それら外部インタフェースには図2に例示的に示さ
れる主メモリ6、周辺回路7,8が外部データバスED
B及び外部アドレスバスEABなどを介して接続され
る。
FIG. 1 is a partial block diagram of a data processor according to an embodiment of the present invention. Although not particularly limited, the data processor 1 shown in FIG. 1 is made of single crystal silicon or the like by a known semiconductor integrated circuit manufacturing technique.
It is formed on each semiconductor substrate. The data processor 1 of this embodiment includes an instruction cache / prefetch unit 2 and a central processing unit (CPU) as an arithmetic control unit, which are representatively shown.
3 and an interrupt control circuit 4, which are connected to the internal data bus IDB and the internal address bus IAB. 5
Reference numerals 1, 52, 53, 54 and 55 are representatively illustrated external interfaces, and mean circuit blocks having external terminals and buffer circuits for input / output. A main memory 6 and peripheral circuits 7 and 8 exemplarily shown in FIG.
B and the external address bus EAB or the like.

【0019】上記命令キャッシュ・プリフェッチ部2
は、命令キャッシュメモリ(20,21,22)と、当
該命令キャッシュメモリのための命令プリフェッチバッ
ファ(23,24,25)と、キャッシュ及びプリフェ
ッチ制御回路26とを備える。キャッシュ及びプリフェ
ッチ制御回路26は、主メモリ6からの命令フェッチの
制御及び命令キャッシュメモリ及び命令プリフェッチバ
ッファの動作を制御する。
The instruction cache / prefetch unit 2
Includes an instruction cache memory (20, 21, 22), an instruction prefetch buffer (23, 24, 25) for the instruction cache memory, and a cache and prefetch control circuit 26. The cache and prefetch control circuit 26 controls the instruction fetch from the main memory 6 and the operations of the instruction cache memory and the instruction prefetch buffer.

【0020】前記中央処理装置3によって実行されるプ
ログラムは主メモリ6に格納され、中央処理装置が最近
実行した複数の命令は命令キャッシュメモリのキャッシ
ュデータ部20に格納されることになる。命令プリフェ
ッチバッファのバッファデータ部23は、命令キャッシ
ュメモリにおけるキャッシュミス時に主メモリ6から読
出されたデータ、又は命令プリフェッチのために主メモ
リ6から読出されたデータが一時的に格納されるバッフ
ァメモリである。キャッシュ及びプリフェッチ制御回路
26は、バッファデータ部23に所定語数(本実施例に
従えば8ワード)の命令が格納され、それが利用される
状態になったとき(バッファヒット)、その命令列をキ
ャッシュデータ部20に新たなエントリとして内部転送
する。中央処理装置3が次に実行すべき命令アドレスは
プログラムカウンタ30が保持する。
The program executed by the central processing unit 3 is stored in the main memory 6, and a plurality of instructions recently executed by the central processing unit are stored in the cache data section 20 of the instruction cache memory. The buffer data unit 23 of the instruction prefetch buffer is a buffer memory in which the data read from the main memory 6 at the time of a cache miss in the instruction cache memory or the data read from the main memory 6 for instruction prefetch is temporarily stored. is there. The cache and prefetch control circuit 26 stores a predetermined number of words (8 words according to this embodiment) of instructions in the buffer data section 23, and when the instruction is ready to be used (buffer hit), the instruction string is stored. Internally transferred to the cache data unit 20 as a new entry. The program counter 30 holds the instruction address to be executed next by the central processing unit 3.

【0021】中央処理装置3による命令フェッチにおい
て、プログラムカウンタ30の命令アドレスに対応する
命令が命令キャッシュデータ部20に存在するか否か
は、キャッシュ比較回路22がキャッシュアドレス部2
1の内容を参照して判断し、その結果がキャッシュヒッ
ト信号221にてキャッシュ及びプリフェッチ制御回路
26に通知される。また、プログラムカウンタ30の命
令アドレスに対応する命令がバッファデータ部23に存
在するか否かは、バッファ比較回路25がバッファアド
レス部24の内容を参照して判断し、その結果がバッフ
ァヒット信号251にてキャッシュ及びプリフェッチ制
御回路26に通知される。キャッシュ及びプリフェッチ
制御回路26は、信号221にてキャッシュヒットが通
知された場合にはプログラムカウンタ30の命令アドレ
スに対応する命令をキャッシュデータ部20から命令レ
ジスタ31に転送させる。信号221にてキャッシュミ
スが通知され、且つ信号251にてバッファヒットが通
知された場合にキャッシュ及びプリフェッチ制御回路2
6は、プログラムカウンタ30の命令アドレスに対応す
る命令をバッファデータ部23から命令レジスタ31に
転送させる。信号221にてキャッシュミスが通知され
且つ信号251にてバッファミスが通知された場合にキ
ャッシュ及びプリフェッチ制御回路26は、プログラム
カウンタ30の命令アドレスをアドレスレジスタ27を
介して主メモリ6に与え、それによって主メモリ6から
読出された命令をバッファデータ部23を通して命令レ
ジスタ31に転送する。このときのプログラムカウンタ
30の命令アドレスは、セレクタ272,271を経由
してアドレスレジスタ27に与えられる。主メモリ6に
対するアクセスはバーストアクセスとされ、全部で8ワ
ード分の命令がバッファデータ部23に格納され、且つ
信号251にてバッファヒットが通知された場合に、当
該8ワードの命令が新たなエントリとしてキャッシュデ
ータ部20に格納される。
In the instruction fetch by the central processing unit 3, the cache comparison circuit 22 determines whether or not the instruction corresponding to the instruction address of the program counter 30 exists in the instruction cache data section 20.
The cache and prefetch control circuit 26 is notified of the result by making a determination by referring to the contents of 1. Further, the buffer comparison circuit 25 judges whether or not the instruction corresponding to the instruction address of the program counter 30 exists in the buffer data section 23, by referring to the contents of the buffer address section 24, and the result is the buffer hit signal 251. The cache and prefetch control circuit 26 is notified at. When the cache hit is notified by the signal 221, the cache / prefetch control circuit 26 transfers the instruction corresponding to the instruction address of the program counter 30 from the cache data unit 20 to the instruction register 31. When the cache miss is notified by the signal 221 and the buffer hit is notified by the signal 251, the cache and prefetch control circuit 2
6 transfers the instruction corresponding to the instruction address of the program counter 30 from the buffer data section 23 to the instruction register 31. When the cache miss is notified by the signal 221 and the buffer miss is notified by the signal 251, the cache and prefetch control circuit 26 gives the instruction address of the program counter 30 to the main memory 6 via the address register 27, and The instruction read from the main memory 6 is transferred to the instruction register 31 through the buffer data section 23. The instruction address of the program counter 30 at this time is given to the address register 27 via the selectors 272 and 271. The access to the main memory 6 is a burst access, and when an instruction for 8 words in total is stored in the buffer data section 23 and a buffer hit is notified by the signal 251, the instruction of 8 word is a new entry. Is stored in the cache data unit 20 as

【0022】キャッシュ及びプリフェッチ制御回路26
は、中央処理装置3がバスアクセスを行っていないとき
命令プリフェッチを行う。命令プリフェッチのための主
メモリ6のアクセスは、前記キャッシュミス且つバッフ
ァミスの場合と同様に、主メモリ6に対するバーストア
クセスとされ、全部で8ワード分の命令がバッファデー
タ部23に格納され、且つ前記信号251にてバッファ
ヒットが通知された場合に、当該8ワードの命令が新た
なエントリとしてキャッシュデータ部20に格納され
る。このように命令プリフェッチの場合、バッファデー
タ部23に格納された命令は、すぐにはキャッシュデー
タ部20に転送されない。プリフェッチしてもバッファ
ヒットにならないような命令をキャッシュデータ部20
の新たなエントリとして追加すると、一度命令実行に利
用された既存のエントリを命令キャッシュメモリから追
い出すことになって不都合だからである。プリフェッチ
されるべき命令アドレスは、プログラムカウンタ30の
命令アドレスをカウンタ273にて1キャッシュライン
分増加(本実施例に従えば+8)させてアドレスレジス
タ27に与えられる。アドレスレジスタ27に命令プリ
フェッチアドレスを与えるタイミングは、中央処理装置
3からの命令プリフェッチの指令に同期される。
Cache and prefetch control circuit 26
Performs instruction prefetch when the central processing unit 3 is not accessing the bus. The access to the main memory 6 for the instruction prefetch is a burst access to the main memory 6 as in the case of the cache miss and the buffer miss, and a total of 8 words of instructions are stored in the buffer data unit 23, and When a buffer hit is notified by the signal 251, the 8-word instruction is stored in the cache data unit 20 as a new entry. As described above, in the case of instruction prefetch, the instruction stored in the buffer data unit 23 is not immediately transferred to the cache data unit 20. An instruction that does not result in a buffer hit even if prefetched is executed by the cache data unit 20.
This is because it is inconvenient to add an existing entry that was once used to execute an instruction from the instruction cache memory when adding it as a new entry. The instruction address to be prefetched is given to the address register 27 by increasing the instruction address of the program counter 30 by one cache line by the counter 273 (+8 according to this embodiment). The timing of giving the instruction prefetch address to the address register 27 is synchronized with the instruction of the instruction prefetch from the central processing unit 3.

【0023】さらに本実施例においては、上記命令プリ
フェッチのための構成を利用して、割込み制御回路4が
割込み処理プログラムのための命令プリフェッチの指令
を出す。割込み制御回路4は代表的に図1に示された割
込み要求信号401、402、404にて要求される何
れかの割込みを受け付けたとき、中央処理装置3に信号
405にて割込みを通知し、また、キャッシュ及びプリ
フェッチ制御回路26に信号406にて割込み処理プロ
グラムのプリフェッチを指令する。信号405にて割込
みが通知された中央処理装置3は、割込み処理プログラ
ムからの復帰のために必要とされる現在の内部状態を退
避したりするための割込み遷移制御を開始する。このと
き割込み制御回路4は、受け付けた割込み要求に対応さ
れる割込み処理プログラムの先頭アドレスを、セレクタ
272,271を経由し命令プリフェッチアドレスとし
てアドレスレジスタ27に供給する。前記信号406に
て命令プリフェッチ動作が指示されたキャッシュ及びプ
リフェッチ制御回路26は、アドレスレジスタ27に供
給された割込み処理プログラムの先頭アドレスを用いた
命令プリフェッチ動作を、中央処理装置3の前記割込み
遷移制御の期間に並行して開始する。
Further, in the present embodiment, the interrupt control circuit 4 issues an instruction prefetch command for the interrupt processing program by utilizing the above-mentioned configuration for instruction prefetch. When the interrupt control circuit 4 receives any interrupt requested by the interrupt request signals 401, 402, and 404 shown in FIG. 1, the interrupt control circuit 4 notifies the central processing unit 3 of the interrupt by a signal 405, Further, the cache and prefetch control circuit 26 is instructed to prefetch the interrupt processing program by a signal 406. The central processing unit 3 notified of the interrupt by the signal 405 starts interrupt transition control for saving the current internal state required for returning from the interrupt processing program. At this time, the interrupt control circuit 4 supplies the start address of the interrupt processing program corresponding to the accepted interrupt request to the address register 27 as an instruction prefetch address via the selectors 272 and 271. The cache and prefetch control circuit 26 instructed to perform the instruction prefetch operation by the signal 406 performs the instruction prefetch operation using the start address of the interrupt processing program supplied to the address register 27 to the interrupt transition control of the central processing unit 3. Start in parallel with the period.

【0024】前記中央処理装置3は、図11にその一例
が示されるように、データレジスタ又はそれに類似する
バススイッチ37を介して内部データバスIDBに接続
されたプログラムカウンタ30、ステータスレジスタ3
3、退避用レジスタ34、演算回路35、及び制御回路
36を供え、内部アドレスバスIABは演算回路35に
結合される。演算回路35は汎用レジスタ351、算術
論理演算器352、及びシフタ353等を備える。前記
制御回路36は、命令レジスタ31にフェッチされた命
令を解読して順次命令を実行するに必要な制御信号を生
成すると共に、割込み信号を受け付けてから所定の割込
み処理プログラムへ命令実行状態を移すまでの前記割込
み遷移制御などを行う。それらを実現するための制御論
理は、マイクロプログラム制御又はワイヤードロジッ
ク、さらには双方を併用した論理構成を採用することが
できる。図11においては割込み遷移制御部360が代
表的に示されている。割込み遷移制御部360は、割込
み信号405が活性化されると、その論理構成に従って
制御信号を生成し、復帰時に必要とされる内部情報の退
避を行い、その後で割込み処理プログラムへの分岐処理
を行う。退避すべき内部情報は、プログラムカウンタ3
0及びステータスレジスタ33の値、そして汎用レジス
タ351の値などとされる。ステータスレジスタ33の
値にはプロセッサステータスワード(PSW)を含む。
プログラムカウンタ30及びステータスレジスタ33が
保有する情報の退避は、多重割込み(所定の割込み処理
プログラムの実行中に多重に受け付けられた割込み)で
ない場合には避用レジスタ34に対して行われ、多重割
込みの場合には主メモリ6に対して行われる。汎用レジ
スタ351が保有する情報の退避は、多くの場合主メモ
リ6に対して行われる。そのような退避の処理を制御す
るための制御情報は割込み遷移制御部360がそのハー
ドウェア構成に従って生成する。
The central processing unit 3 has a program counter 30 and a status register 3 which are connected to an internal data bus IDB through a data register or a bus switch 37 similar thereto, as shown in FIG.
3, the save register 34, the arithmetic circuit 35, and the control circuit 36 are provided, and the internal address bus IAB is coupled to the arithmetic circuit 35. The arithmetic circuit 35 includes a general-purpose register 351, an arithmetic logic calculator 352, a shifter 353, and the like. The control circuit 36 decodes the instruction fetched in the instruction register 31 to generate a control signal necessary for sequentially executing the instructions, and after receiving the interrupt signal, shifts the instruction execution state to a predetermined interrupt processing program. The interrupt transition control up to the above is performed. The control logic for realizing them can employ microprogram control or wired logic, or a logic configuration using both in combination. In FIG. 11, the interrupt transition control unit 360 is representatively shown. When the interrupt signal 405 is activated, the interrupt transition control unit 360 generates a control signal in accordance with its logical configuration, saves internal information required at the time of restoration, and then performs branch processing to the interrupt processing program. To do. The internal information to be saved is the program counter 3
0, the value of the status register 33, the value of the general-purpose register 351 and the like. The value of the status register 33 includes the processor status word (PSW).
The saving of the information held by the program counter 30 and the status register 33 is performed to the save register 34 when it is not a multiple interrupt (interrupt accepted multiple times during execution of a predetermined interrupt processing program), and multiple interrupts are performed. In this case, the main memory 6 is used. In many cases, the saving of information held by the general-purpose register 351 is performed in the main memory 6. The interrupt transition control unit 360 generates control information for controlling such save processing according to its hardware configuration.

【0025】特に図1には図示を省略しているが、本実
施例のデータプロセッサ1は、中央処理装置3による命
令実行に利用されるデータを格納するためのデータキャ
ッシュメモリと、データキャッシュメモリのライトバッ
クバッファ(ライトバッファ)とを備えている。データ
キャッシュメモリ及びライトバックバッファについては
図8及び図9に基づいて別に説明するが、データキャッ
シュメモリは一旦利用された主メモリ6のデータをその
アドレス情報と共に保有する。キャッシュメモリを1次
記憶とすると2次記憶としての主メモリとの間で相互に
共有されるデータは整合(一致)されなければならな
い。このとき、ライトアクセスにてキャッシュヒットを
生じてキャッシュメモリのエントリが書き換えられた場
合、その内容を2次記憶に書き戻す制御手法にはライト
スルー方式とライトバック方式がある。ライトスルー方
式はキャッシュメモリの書き換えと同時に2次記憶にも
データのライトを行う。ライトバック方式は、ライトア
クセスにおいてキャッシュメモリが書き換えられたとき
当該書き換えられた内容を、その後キャッシュミスが生
じてそのエントリが新たなエントリにリプレースされる
ときに主メモリに書き戻すという手法である。本実施例
のデータプロセッサ1は、特に制限されないが、上記ラ
イトバック方式が採用される。前記ライトバックバッフ
ァはデータキャッシュメモリの保有する情報が書き換え
られるときにそれを主メモリ6の対応データに反映させ
るための主メモリ6への書込みデータを一時的に保持す
るバッファメモリとされる。したがって、主メモリ6を
退避先とするメモリアクセスが行われたとき、データキ
ャッシュメモリがそのアクセスアドレスに応ずるエント
リを保有している場合には、データプロセッサ1は外部
バスアクセスを起動することを要しない。更に、データ
キャッシュメモリと主メモリ6との間に配置されたライ
トバックバッファはデータキャッシュメモリのキャッシ
ュミス時にキャッシュエントリをリプレースするとき、
主メモリ6に書き戻すべきデータを一時的に蓄えて当該
キャッシュミスに係るデータのキャッシュメモリへの書
込みを優先させるから、前記書き戻しのための外部バス
サイクルの起動を後回しにすることができる。これらに
より、割込み遷移制御における前記退避のための処理に
おいては、その全てを外部バスサイクル起動による主メ
モリ6のアクセスで行う必要はない。換言すれば、中央
処理装置3による割込み遷移制御期間中における退避処
理において外部バスサイクルが起動されない期間は必ず
複数サイクル分存在することになる。したがって、中央
処理装置3による割込み遷移制御に並行してキャッシュ
及びプリフェッチ制御回路26が割込み処理プログラム
を主メモリ6からプリフェッチする動作を保証すること
ができる。
Although not specifically shown in FIG. 1, the data processor 1 of the present embodiment has a data cache memory for storing data used for instruction execution by the central processing unit 3 and a data cache memory. Write back buffer (write buffer). The data cache memory and the write-back buffer will be described separately with reference to FIGS. 8 and 9, but the data cache memory holds the data of the main memory 6 which has been used once together with its address information. When the cache memory is the primary storage, the data shared with the main memory as the secondary storage must be matched (matched). At this time, when a cache hit occurs in the write access and the entry of the cache memory is rewritten, there are a write-through method and a write-back method as a control method of writing back the content to the secondary storage. In the write-through method, data is written to the secondary storage at the same time when the cache memory is rewritten. The write-back method is a method in which, when a cache memory is rewritten in a write access, the rewritten contents are written back to the main memory when a cache miss occurs and the entry is replaced with a new entry. Although not particularly limited, the data processor 1 of the present embodiment adopts the write back method. The write-back buffer is a buffer memory for temporarily holding the write data to the main memory 6 for reflecting the information held in the data cache memory in the corresponding data of the main memory 6 when the information is rewritten. Therefore, when a memory access with the main memory 6 as the save destination is performed, if the data cache memory has an entry corresponding to the access address, the data processor 1 needs to activate the external bus access. do not do. In addition, the write-back buffer arranged between the data cache memory and the main memory 6 is used to replace the cache entry when a cache miss occurs in the data cache memory.
Since the data to be written back to the main memory 6 is temporarily stored and the writing of the data related to the cache miss to the cache memory is prioritized, the activation of the external bus cycle for the writing back can be postponed. As a result, in the saving process in the interrupt transition control, it is not necessary to perform all of them by accessing the main memory 6 by starting the external bus cycle. In other words, there are always a plurality of cycles during which the external bus cycle is not activated in the save processing during the interrupt transition control period by the central processing unit 3. Therefore, in parallel with the interrupt transition control by the central processing unit 3, the cache and prefetch control circuit 26 can guarantee the operation of prefetching the interrupt processing program from the main memory 6.

【0026】〔データプロセッサの全体構成〕 前述の
説明にてデータプロセッサ1における命令フェッチとプ
リフェッチの概略が理解されたところで、データプロセ
ッサ1の各部の詳細を再び図1を参照しながら説明す
る。
[Overall Configuration of Data Processor] Now that the outlines of instruction fetch and prefetch in the data processor 1 have been understood in the above description, the details of each part of the data processor 1 will be described again with reference to FIG.

【0027】上記命令キャッシュメモリは、所定語数の
データを一つのデータブロックとして複数個格納するた
めのキャッシュデータ部20と、キャッシュデータ部2
0のデータとそのデータのアドレスとを関連付けるため
のキャッシュアドレス部21と、命令アドレスの一部
(アドレスタグATAG)がキャッシュアドレス部21
のタグ情報(キャッシュタグCTAG)に一致するか否
かを検出するキャッシュ比較回路22とを主体として成
る。本実施例に従えば、キャッシュデータ部20はワー
ド#0〜ワード#7の8ワード分のデータ記憶領域を複
数組備え(ワード#0〜#7が一つのデータブロックを
成す)、キャッシュアドレス部21は8ワードのデータ
記憶領域(#0〜#7)に対応されるキャッシュタグC
TAGとその有効ビットVcの対を備える。8ワードの
データ記憶領域(#0〜#7)とそれに対応されるキャ
ッシュタグCTAG及び有効ビットVcを単にキャッシ
ュラインと称する。ここで、本実施例のデータプロセッ
サ1において命令アクセスのためのアドレス信号は最下
位側からワードWRD、インデックスIDX、アドレス
タグATAGとみなすことができる。このときワードW
RDは一つのキャッシュラインに含まれるワード#0〜
ワード#7から一つを選択するためのアドレス情報とみ
なすことができる。この例に従えばワードWRDは3ビ
ットとされる。インデックスIDXは複数のキャッシュ
ラインから一つのキャッシュラインを選択するためのア
ドレス情報とみなすことができる。例えばキャッシュデ
ータ部20が256個のキャッシュラインを有する場
合、インデックスIDXは8ビットとされる。前記キャ
ッシュタグCTAGは対応するキャッシュラインのワー
ド#0〜#7に格納される各命令に共通なアドレスタグ
ATAGを保持することになる。前記有効ビットVcは
それが含まれるキャッシュラインの有効(実在又は確
定)性をその論理値によって示し、例えば論理値”1”
が有効、”0”が無効を示す。
The instruction cache memory has a cache data unit 20 for storing a plurality of data of a predetermined number of words as one data block, and a cache data unit 2.
A cache address portion 21 for associating the data of 0 with the address of the data, and a part of the instruction address (address tag ATAG) is used as the cache address portion 21.
The cache comparison circuit 22 for detecting whether or not it matches the tag information (cache tag CTAG) of FIG. According to the present embodiment, the cache data unit 20 includes a plurality of sets of 8-word data storage regions of word # 0 to word # 7 (words # 0 to # 7 form one data block), and a cache address unit. 21 is a cache tag C corresponding to an 8-word data storage area (# 0 to # 7)
It comprises a pair of TAG and its valid bit Vc. The 8-word data storage area (# 0 to # 7) and the corresponding cache tag CTAG and valid bit Vc are simply called a cache line. Here, in the data processor 1 of the present embodiment, the address signal for instruction access can be regarded as the word WRD, the index IDX, and the address tag ATAG from the least significant side. Word W at this time
RD is word # 0 included in one cache line
It can be regarded as address information for selecting one from word # 7. According to this example, the word WRD has 3 bits. The index IDX can be regarded as address information for selecting one cache line from a plurality of cache lines. For example, when the cache data section 20 has 256 cache lines, the index IDX is 8 bits. The cache tag CTAG holds the address tag ATAG common to each instruction stored in the words # 0 to # 7 of the corresponding cache line. The valid bit Vc indicates the validity (existence or definiteness) of the cache line including it by its logical value, for example, a logical value "1".
Is valid, and “0” is invalid.

【0028】命令プリフェッチバッファは、バッファデ
ータ部23と、該バッファデータ部23のデータとその
アドレスとを関連付けるためのバッファアドレス部24
と、命令アドレスの一部(アドレスタグATAG及びイ
ンデックスIDX)がバッファアドレス部24のアドレ
ス情報(プリフェッチバッファタグBTAG及びインデ
ックスIDX)に一致するか否かを検出するバッファ比
較回路25とを主体として成る。上記バッファデータ部
23は、上記キャッシュデータ部20と同様にワード#
0〜ワード#7の8ワード分のデータ記憶領域を備え、
当該データ記憶領域(#0〜#7)は、特に制限されな
いが、一組設けられている。バッファアドレス部24
は、バッファデータ部23に格納される8ワードのデー
タに対応されるプリフェッチバッファタグBTAG、有
効ビットVb、書込み完了ビットCを有する。プリフェ
ッチバッファタグBTAGにはバッファデータ部23の
ワード#0〜#7に格納される各命令に共通なアドレス
タグATAGが保持されることになる。有効ビットVb
はバッファデータ部23に含まれるデータの有効性をそ
の論理値によって示し、例えば論理値”1”が有効、”
0”が無効を示す。書込み完了ビットCは、命令プリフ
ェッチに際してバッファデータ部23にワード#0〜#
7の合計8ワードが書き込まれたか否かをその論理値に
よって示し、例えば、論理値”1”が書込み完了、”
0”が未完了を意味する。
The instruction prefetch buffer has a buffer data section 23 and a buffer address section 24 for associating the data of the buffer data section 23 with its address.
And a buffer comparison circuit 25 for detecting whether or not a part of the instruction address (address tag ATAG and index IDX) matches the address information (prefetch buffer tag BTAG and index IDX) of the buffer address section 24. . The buffer data section 23 is similar to the cache data section 20 in word #
Equipped with a data storage area of 8 words from 0 to word # 7,
The data storage area (# 0 to # 7) is not particularly limited, but one set is provided. Buffer address section 24
Has a prefetch buffer tag BTAG corresponding to 8 words of data stored in the buffer data section 23, a valid bit Vb, and a write completion bit C. The prefetch buffer tag BTAG holds an address tag ATAG common to each instruction stored in the words # 0 to # 7 of the buffer data section 23. Effective bit Vb
Indicates the validity of the data contained in the buffer data section 23 by its logical value. For example, the logical value "1" is valid.
0 "indicates invalidity. The write completion bit C is stored in the buffer data section 23 in words # 0 to # when the instruction prefetch is performed.
Whether or not a total of 8 words of 7 has been written is indicated by its logical value. For example, the logical value "1" indicates that writing is completed.
0 "means incomplete.

【0029】バッファデータ部23の各ワード#0〜#
7に対応される記憶領域への入力データは主メモリ6か
ら内部データバスIDBを介して供給される。バッファ
データ部23に格納された記憶情報はキャッシュデータ
部20の所望キャッシュラインの記憶領域#0〜#7に
書き込み可能にされる。バッファデータ部23からキャ
ッシュデータ部20への書込みに応じてプリフェッチバ
ッファタグBTAGの情報がキャッシュアドレス部21
に供給されてキャッシュタグCTAGとされる。このと
きのキャッシュラインの選択はバッファアドレス部24
のインデックスIDXがセレクタ201を介してキャッ
シュデータ部20及びキャッシュアドレス部21に供給
されることにより行われる。キャッシュデータ部20で
選択された1キャッシュラインの記憶領域#0〜#7に
格納されたデータはセレクタ200を介して一つのワー
ドが選択される。また、前記セレクタ230はバッファ
データ部23の記憶領域#0〜#7の中から一つデータ
を選択してバイパス経路231に供給する。セレクタ2
00,230の選択制御は、キャッシュ及びプリフェッ
チ制御回路26がワードWRDに基づいて行う。尚、図
1に示される命令キャッシュメモリはダイレクトマップ
形式のキャッシュメモリのように図示されているが、セ
ットアソシアティブ形式を採用するができる。その場
合、命令プリフェッチバッファもセットアソシアティブ
形式におけるセット数若しくはウェイ数に応じて増設す
ることで実現できる。
Each word # 0 to # of the buffer data section 23
Input data to the storage area corresponding to 7 is supplied from the main memory 6 via the internal data bus IDB. The storage information stored in the buffer data section 23 is made writable in the storage areas # 0 to # 7 of the desired cache line of the cache data section 20. According to the writing from the buffer data unit 23 to the cache data unit 20, the information of the prefetch buffer tag BTAG is changed to the cache address unit 21.
To the cache tag CTAG. At this time, the cache line is selected by the buffer address section 24.
The index IDX is supplied to the cache data unit 20 and the cache address unit 21 via the selector 201. One word of the data stored in the storage areas # 0 to # 7 of one cache line selected by the cache data unit 20 is selected via the selector 200. Further, the selector 230 selects one data from the storage areas # 0 to # 7 of the buffer data section 23 and supplies it to the bypass path 231. Selector 2
The selection control of 00 and 230 is performed by the cache and prefetch control circuit 26 based on the word WRD. The instruction cache memory shown in FIG. 1 is illustrated as a direct map type cache memory, but a set associative type can be adopted. In that case, the instruction prefetch buffer can also be realized by adding more in accordance with the number of sets or the number of ways in the set associative format.

【0030】図1において命令アドレスを保持するレジ
スタとして、中央処理装置3に含まれるプログラムカウ
ンタ30と、命令キャッシュ・プリフェッチ部2に設け
られたアドレスレジスタ27とが図示されている。プロ
グラムカウンタ30は中央処理装置3が次に実行すべき
命令アドレスを保有する。アドレスレジスタ27は主メ
モリ6からフェッチ又はプリフェッチすべき命令アドレ
スを保持する。アドレスレジスタ27が保持すべき命令
アドレスのアドレスタグATAG、インデックスID
X、及びワードWRDは、プログラムカウンタ30、割
込み制御回路4又はカウンタ273が出力し、セレクタ
271,272でその何れかが選択されて、アドレスレ
ジスタ27に供給される。経路275にはプログラムカ
ウンタ30が保有している命令アドレス情報が供給され
る。経路274には割込み制御回路4が出力する後述の
割込み処理プログラム先頭アドレスが供給される。カウ
ンタ273は、プログラムカウンタ30が保有する命令
アドレスに基づいて命令プリフェッチアドレスを生成す
る。すなわち、カウンタ273はプログラムカウンタ3
0の値を入力し、それを1キャッシュライン分だけ増加
(+8ワード分増加)して出力する。セレクタ271に
よるカウンタ273の出力選択は、プリフェッチの指令
に基づいて行われる。
In FIG. 1, as a register for holding an instruction address, a program counter 30 included in the central processing unit 3 and an address register 27 provided in the instruction cache prefetch unit 2 are shown. The program counter 30 holds an instruction address to be executed next by the central processing unit 3. The address register 27 holds an instruction address to be fetched or prefetched from the main memory 6. Address tag ATAG and index ID of the instruction address that the address register 27 should hold
The X and the word WRD are output by the program counter 30, the interrupt control circuit 4 or the counter 273, one of them is selected by the selectors 271, 272 and supplied to the address register 27. The instruction address information held by the program counter 30 is supplied to the path 275. The start address of an interrupt processing program, which will be described later, output from the interrupt control circuit 4 is supplied to the path 274. The counter 273 generates an instruction prefetch address based on the instruction address held by the program counter 30. That is, the counter 273 is the program counter 3
Input a value of 0, increase it by one cache line (increase by +8 words), and output it. The output selection of the counter 273 by the selector 271 is performed based on a prefetch command.

【0031】キャッシュデータ部20とキャッシュアド
レス部21に対するキャッシュラインの選択はセレクタ
201の出力を図示しないデコーダ(インデックスデコ
ーダ)がデコードして行われる。セレクタ201はプロ
グラムカウンタ30が保有するアドレスのインデックス
IDX、アドレスレジスタ27が保有するアドレスのイ
ンデックスIDX、又はバッファアドレス部24が保有
するインデックスIDXを選択して出力する。上記キャ
ッシュ比較回路22は、セレクタ201の出力に基づい
て選択されたキャッシュラインの有効ビットVcにてそ
のキャッシュラインの有効性を判定し、それが有効であ
ることを示すときは、セレクタ220で選択されたアド
レスタグATAGがそのキャッシュラインのキャッシュ
タグCTAGに一致するかを判定し、判定結果が一致で
ある場合にキャッシュヒット信号221を活性化する。
これによってキャッシュ及びプリフェッチ制御回路26
にキャッシュヒットが通知される。セレクタ220は、
プログラムカウンタ30から供給されるアドレスタグA
TAG又はアドレスレジスタ27から供給されるアドレ
スタグATAGを選択する。上記バッファ比較回路25
は、バッファアドレス部24の有効ビットVbを入力
し、それが有効であることを示すときは、セレクタ22
0で選択されたアドレスタグATAGがそのバッファア
ドレス部24のプリフェッチバッファタグBTAGに一
致するか、そしてセレクタ250で選択されたインデッ
クスIDXがそのバッファアドレス部24のインデック
スIDXに一致するかを判定し、夫々の判定結果が一致
である場合にバッファヒット信号251を活性化する。
これによってキャッシュ及びプリフェッチ制御回路26
にバッファヒットが通知される。セレクタ250は、プ
ログラムカウンタ30から供給されるインデックスID
X又はアドレスレジスタ27から供給されるインデック
スIDXを選択する。
The selection of the cache line for the cache data section 20 and the cache address section 21 is performed by decoding the output of the selector 201 by a decoder (index decoder) not shown. The selector 201 selects and outputs the index IDX of the address held by the program counter 30, the index IDX of the address held by the address register 27, or the index IDX held by the buffer address unit 24. The cache comparison circuit 22 determines the validity of the cache line by the validity bit Vc of the cache line selected based on the output of the selector 201, and when it indicates that it is valid, the cache comparison circuit 22 selects it by the selector 220. It is determined whether the generated address tag ATAG matches the cache tag CTAG of the cache line, and the cache hit signal 221 is activated if the determination result is a match.
As a result, the cache and prefetch control circuit 26
Is notified of a cache hit. The selector 220 is
Address tag A supplied from the program counter 30
The address tag ATAG supplied from the TAG or the address register 27 is selected. The buffer comparison circuit 25
Inputs the valid bit Vb of the buffer address section 24, and when it indicates that it is valid, the selector 22
It is determined whether the address tag ATAG selected by 0 matches the prefetch buffer tag BTAG of the buffer address part 24 and the index IDX selected by the selector 250 matches the index IDX of the buffer address part 24, When the respective judgment results are in agreement, the buffer hit signal 251 is activated.
As a result, the cache and prefetch control circuit 26
Is notified of a buffer hit. The selector 250 is the index ID supplied from the program counter 30.
X or the index IDX supplied from the address register 27 is selected.

【0032】上記割込み制御回路4は、各種割込み要求
に対する優先順位付けや割込み要求に対するマスキング
のための情報に従って、データプロセッサ1の内部又は
外部からの割込み要求を調停して受け付け、受け付けた
割込み要求に対して応答を返す制御を行う。図1には外
部割込み要求信号401,402とそれに対する応答信
号403、そして中央処理装置3からの内部割込み要求
信号404が代表的に示されている。信号405は割込
み制御回路4が割込みを受け付けたことを中央処理装置
3に通知するための割込み信号である。割込み信号40
5によって中央処理装置3が割込み受け付けを認識する
と、当該中央処理装置3は前述のように割込み遷移制御
部360の制御に従って、プログラムカウンタ30やス
テータスレジスタ33などに格納されている情報の退避
を行う。退避処理等が済むと、プログラムカウンタ30
には、受け付けられた割込み要求に応答するための割込
み処理プログラムの先頭アドレス(割込み開始アドレ
ス)がセットされ、これによって中央処理装置3は割込
み処理プログラムを実行可能な状態にされる。中央処理
装置3がその内部を通常処理プログラムの実行状態から
割込み要求に対する割込み処理プログラムの実行可能状
態に遷移させるために必要な期間を割込み遷移期間と称
する。割込み遷移期間における中央処理装置3の処理の
一例については図10に基づいて後述する。
The interrupt control circuit 4 arbitrates and accepts interrupt requests from inside or outside the data processor 1 according to information for prioritizing various interrupt requests and masking the interrupt requests, and accepts the received interrupt requests. Controls that a response is returned. FIG. 1 representatively shows external interrupt request signals 401 and 402, a response signal 403 to them, and an internal interrupt request signal 404 from the central processing unit 3. A signal 405 is an interrupt signal for notifying the central processing unit 3 that the interrupt control circuit 4 has accepted the interrupt. Interrupt signal 40
When the central processing unit 3 recognizes the acceptance of the interrupt by 5, the central processing unit 3 saves the information stored in the program counter 30 and the status register 33 according to the control of the interrupt transition control unit 360 as described above. . When the evacuation process is completed, the program counter 30
Is set to the start address (interruption start address) of the interrupt processing program for responding to the accepted interrupt request, whereby the central processing unit 3 is made ready to execute the interrupt processing program. The period required for the central processing unit 3 to change its inside from the execution state of the normal processing program to the execution state of the interrupt processing program for the interrupt request is called an interrupt transition period. An example of the processing of the central processing unit 3 during the interrupt transition period will be described later with reference to FIG.

【0033】前記割込み制御回路4は、中央処理装置3
の前記割込み遷移期間に並行して命令キャッシュ・プリ
フェッチ部2に割込み処理プログラムのプリフェッチを
開始させる。すなわち、上記割込み制御回路4は、割込
み処理プログラムの先頭アドレスを割込み要因に対応さ
せて保持するテーブル40を供え、例えば周辺回路8か
らの割込み要求402又は中央処理装置3からの割込み
要求403を受け付けたとき、その要求に対応される割
込み処理プログラムの先頭アドレスを上記テーブル40
から選択し、選択した先頭アドレスの情報を経路274
を介して前記アドレスレジスタ27に供給する。また、
周辺回路7が、割込み処理プログラムの先頭アドレスを
格納するための割込み先頭アドレスレジスタ71を有
し、換言すれば、その周辺回路7に対応される割込み処
理プログラムの先頭アドレスが前記テーブル40には設
定されていない場合、信号403にて割込み要求元に割
込み込み受け付けの通知が返されたときに、割込み先頭
アドレスレジスタ71が保有するアドレス情報を内部デ
ータバスIDBに出力する機能を有する場合、上記割込
み制御回路4は、当該周辺回路7からの割込み要求信号
401に対して割込みを受け付けると、周辺回路7から
出力される割込み先頭アドレスを受け、これを経路27
4を介してアドレスレジスタ27に与える。上記テーブ
ル40は中央処理装置3によって書き換え可能にされ、
ユーザが記述する割込み処理プログラム(割込みハンド
ラ)に対するアドレスマッピングの自由度を保証する。
上記テーブル40は例えば中央処理装置3によってリー
ド・ライト可能な複数のレジスタによって構成すること
ができる。
The interrupt control circuit 4 includes a central processing unit 3
In parallel with the interrupt transition period, the instruction cache prefetch unit 2 starts prefetching of the interrupt processing program. That is, the interrupt control circuit 4 is provided with a table 40 that holds the start address of the interrupt processing program in association with the interrupt factor, and accepts an interrupt request 402 from the peripheral circuit 8 or an interrupt request 403 from the central processing unit 3, for example. Then, the start address of the interrupt processing program corresponding to the request is set to the table 40 above.
Information from the selected start address is selected from the route 274.
Is supplied to the address register 27 via. Also,
The peripheral circuit 7 has an interrupt start address register 71 for storing the start address of the interrupt processing program. In other words, the start address of the interrupt processing program corresponding to the peripheral circuit 7 is set in the table 40. Otherwise, when the interrupt request source has a function of outputting the address information held in the interrupt head address register 71 to the internal data bus IDB when the interrupt request source is notified by the signal 403, When the control circuit 4 accepts an interrupt in response to the interrupt request signal 401 from the peripheral circuit 7, the control circuit 4 receives the interrupt start address output from the peripheral circuit 7 and sends it to the path 27.
4 to the address register 27. The table 40 is rewritable by the central processing unit 3,
The degree of freedom of address mapping for the interrupt processing program (interrupt handler) written by the user is guaranteed.
The table 40 can be composed of a plurality of registers that can be read and written by the central processing unit 3, for example.

【0034】割込み制御回路4は、割込み処理プログラ
ムの先頭アドレスをレジスタ27に与えるとき、その先
頭アドレス(割込み開始アドレス)に従って命令をプリ
フェッチさせる指示を、割込み受け付け信号406にて
上記キャッシュ及びプリフェッチ制御回路26に与え
る。
When the interrupt control circuit 4 gives the start address of the interrupt processing program to the register 27, an instruction to prefetch an instruction according to the start address (interrupt start address) is given by the interrupt acceptance signal 406 to the cache and prefetch control circuit. Give to 26.

【0035】割込み制御回路4から経路274に出力さ
れる割込み処理プログラムの先頭アドレスは、中央処理
装置3にも供給される。図11の例に従えば、割込み処
理プログラムの先頭アドレスは制御回路36のラッチ3
61に与えられる。中央処理装置3は、割込み信号40
5による割込みの通知に基づいて割込み遷移制御を行っ
てから、その割込み処理プログラムの先頭アドレスをラ
ッチ361からプログラムカウンタ30にセットして、
割込み処理プログラムの実行に移る。
The start address of the interrupt processing program output from the interrupt control circuit 4 to the path 274 is also supplied to the central processing unit 3. According to the example of FIG. 11, the start address of the interrupt processing program is the latch 3 of the control circuit 36.
61. The central processing unit 3 uses the interrupt signal 40
After performing the interrupt transition control based on the notification of the interrupt by 5, set the start address of the interrupt processing program from the latch 361 to the program counter 30,
Move on to execution of interrupt processing program.

【0036】図2において上記周辺回路7には割込み制
御論理70と割込み開始アドレスレジスタ71が代表的
に示されている。割込み制御論理70は周辺回路7の動
作上、中央処理装置3による所定の割込み処理プログラ
ムの実行を要するときに、割込み要求信号401を活性
化する。特に制限されないが、割込み応答信号403は
割込み要求元に固有の識別情報が含まれる。したがって
割込み制御回路4がその割込み要求信号401による割
込み要求を受け付けると、周辺回路7に固有の識別情報
を含む割込み応答信号403を出力し、これによって周
辺回路7は割込み要求が受け付けられたことを認識し、
割込み開始アドレスレジスタ71に格納されている割込
み処理プログラムの先頭アドレスを外部データバスED
Bに出力する。割込み開始アドレスレジスタ71に対す
る初期設定は中央処理装置3によって行うことができ
る。外部データバスEDBに出力された割込み処理プロ
グラムの先頭アドレスは外部インタフェース55を介し
てデータプロセッサ1の割込み制御回路4に取り込まれ
る。図2に示される周辺回路8は割込みの要求と受け付
けを認識する割込み制御論理80を備え、割込み開始ア
ドレスレジスタは保有しない。即ち、当該周辺回路8の
割込み要求によって中央処理装置3が実行すべき割込み
処理プログラムの先頭アドレスは上記割込み制御回路4
のテーブル40に格納されている。
In FIG. 2, an interrupt control logic 70 and an interrupt start address register 71 are typically shown in the peripheral circuit 7. The interrupt control logic 70 activates the interrupt request signal 401 when the operation of the peripheral circuit 7 requires the execution of a predetermined interrupt processing program by the central processing unit 3. Although not particularly limited, the interrupt response signal 403 includes identification information unique to the interrupt request source. Therefore, when the interrupt control circuit 4 accepts the interrupt request by the interrupt request signal 401, it outputs an interrupt response signal 403 including identification information unique to the peripheral circuit 7, whereby the peripheral circuit 7 confirms that the interrupt request is accepted. Recognized,
The start address of the interrupt processing program stored in the interrupt start address register 71 is set to the external data bus ED.
Output to B. The initialization of the interrupt start address register 71 can be performed by the central processing unit 3. The start address of the interrupt processing program output to the external data bus EDB is taken into the interrupt control circuit 4 of the data processor 1 via the external interface 55. The peripheral circuit 8 shown in FIG. 2 has an interrupt control logic 80 that recognizes an interrupt request and acceptance, and does not have an interrupt start address register. That is, the start address of the interrupt processing program to be executed by the central processing unit 3 in response to the interrupt request from the peripheral circuit 8 is the interrupt control circuit 4 described above.
Stored in the table 40 of FIG.

【0037】前記主メモリ6はデータプロセッサ1のワ
ーク領域と、中央処理装置3の動作プログラム(命令セ
ット)及びデータが格納される記憶領域とを有する。命
令キャッシュ・プリフェッチ部2が読み込むべき割込み
処理プログラムやその他のプログラムは当該主メモリ6
にストアされている。主メモリ6に対するアクセスアド
レスは、本実施例に従えば、データプロセッサ1の外部
インタフェース54から外部アドレスバスEABを経由
して与えられる。この実施例では主メモリ6はワード単
位でデータアクセス可能なものとされる。主メモリ6に
対する命令フェッチ及び命令プリフェッチのためのアク
セスアドレスは、図1のアドレスレジスタ27から与え
られる。このとき、命令キャッシュ・プリフェッチ部2
はバッファデータ部23への命令プリフェッチをバース
ト転送にて行うことができるようになっている。主メモ
リ6それ自体がバースト転送モードを持つ場合には当該
バースト転送モードをその主メモリ6の仕様に従って設
定し、バースト転送の先頭語のアドレスを供給する。例
えば、主メモリ6が8ワード分の情報のバースト転送機
能を有する場合、アドレスレジスタ27のワードWRD
は最初にフェッチされるべきワードを指定するビット列
とされ、当該アドレスレジスタ27のアドレスが主メモ
リ6に供給される。主メモリ6がバースト転送モードを
持たない場合にはキャッシュ及びプリフェッチ制御回路
26は、アドレスレジスタ27のワードWRDを最初に
フェッチすべきワード指定用のビット列として主メモリ
6をアクセスさせ、アクセスの都度ワードWRDを順次
更新しながら8回のメモリアクセスによって8ワードの
命令をプリフェッチする。すなわちその場合には、キャ
ッシュ及びプリフェッチ制御回路26は、特に図示はし
ないが、アドレスレジスタ27のワードWRDを3ビッ
トのリングカウンタとして計数動作させる制御を行うこ
とができるようになっている。割込み制御回路4のテー
ブル40又は周辺回路7の割込み先頭アドレスレジスタ
71に格納されている割込み開始アドレスの下位3ビッ
ト(ワードWRD)と、プログラムカウンタ30のワー
ドWRDもセレクタ271,272を介してレジスタ2
7のワードWRDに供給可能にされている。
The main memory 6 has a work area for the data processor 1 and a storage area for storing operation programs (instruction sets) and data for the central processing unit 3. The interrupt processing program and other programs to be read by the instruction cache / prefetch unit 2 are the main memory 6 concerned.
It is stored in. According to the present embodiment, the access address for the main memory 6 is given from the external interface 54 of the data processor 1 via the external address bus EAB. In this embodiment, the main memory 6 can access data in word units. An access address for instruction fetch and instruction prefetch for the main memory 6 is given from the address register 27 of FIG. At this time, the instruction cache / prefetch unit 2
The instruction prefetch to the buffer data unit 23 can be performed by burst transfer. When the main memory 6 itself has a burst transfer mode, the burst transfer mode is set according to the specifications of the main memory 6 and the address of the first word of burst transfer is supplied. For example, when the main memory 6 has a burst transfer function of 8-word information, the word WRD of the address register 27
Is a bit string designating the word to be fetched first, and the address of the address register 27 is supplied to the main memory 6. If the main memory 6 does not have the burst transfer mode, the cache and prefetch control circuit 26 makes the word WRD of the address register 27 access the main memory 6 as a bit string for word designation to be fetched first, and the word is accessed every time the access is made. An 8-word instruction is prefetched by eight memory accesses while sequentially updating WRD. That is, in this case, the cache and prefetch control circuit 26 can control the word WRD of the address register 27 to perform a counting operation as a 3-bit ring counter (not shown). The lower 3 bits (word WRD) of the interrupt start address stored in the table 40 of the interrupt control circuit 4 or the interrupt start address register 71 of the peripheral circuit 7 and the word WRD of the program counter 30 are also registered via the selectors 271, 272. Two
7 words WRD can be supplied.

【0038】〔命令フェッチ及びプリフェッチ起動の制
御態様〕 図3には中央処理装置3からの指令に基づく
命令フェッチ及びプリフェッチ起動の動作フローチャー
トが示される。同図において命令プリフェッチの指令に
は割込み制御回路4からの命令プリフェッチの指令は含
まれていない。
[Control Mode of Instruction Fetch and Prefetch Activation] FIG. 3 shows an operation flowchart of instruction fetch and prefetch activation based on a command from the central processing unit 3. In the figure, the instruction prefetch instruction does not include the instruction prefetch instruction from the interrupt control circuit 4.

【0039】中央処理装置3は、現在実行している命令
から推測して次に実行するであろう命令をフェッチする
指示を、キャッシュ及びプリフェッチ制御回路26に要
求する。このとき、中央処理装置3は、命令キャッシュ
・プリフェッチ部2に向けてプログラムカウンタ30の
保有する命令フェッチアドレスを与える。命令キャッシ
ュ・プリフェッチ部2は、与えられた命令フェッチアド
レスを実効アドレスとして、命令フェッチ動作の制御を
開始する(ステップS1)。命令フェッチ動作において
は、フェッチすべき命令が命令キャッシュメモリのキャ
ッシュデータ部20に存在するか、又は命令プリフェッ
チバッファのバッファデータ部23に存在するかが検索
されることになる。図3では、便宜上、フェッチすべき
命令が命令キャッシュメモリに存在する場合、命令プリ
フェッチバッファに存在する場合、及び双方に存在しな
い場合に大別してその処理が記述されている。
The central processing unit 3 requests the cache and prefetch control circuit 26 to instruct the cache and prefetch control circuit 26 to infer an instruction which will be executed next by inferring from the currently executed instruction. At this time, the central processing unit 3 gives the instruction fetch address held by the program counter 30 to the instruction cache prefetch unit 2. The instruction cache prefetch unit 2 starts control of the instruction fetch operation using the given instruction fetch address as the effective address (step S1). In the instruction fetch operation, it is searched whether the instruction to be fetched exists in the cache data unit 20 of the instruction cache memory or the buffer data unit 23 of the instruction prefetch buffer. In FIG. 3, for convenience, the processing is roughly classified into a case where the instruction to be fetched exists in the instruction cache memory, a case where the instruction exists in the instruction prefetch buffer, and a case where neither of them exists.

【0040】命令フェッチ動作の制御が開始されると、
キャッシュデータ部20とキャッシュアドレス部21で
はプログラムカウンタ30のインデックスIDXによっ
て一つのキャッシュラインが選択される。選択されたキ
ャッシュラインに有効な命令が既に読込まれているか否
かは当該キャッシュラインの有効ビットVcが示し、有
効ビットVcが真(論理値”1”)の場合、当該キャッ
シュラインに含まれるキャッシュタグCTAGとプログ
ラムカウンタ30に含まれるアドレスタグATAGがキ
ャッシュ比較回路22にて比較される。比較結果が一致
の場合(ステップS2=YES、且つステップS3=Y
ES)、所要の命令が上記キャッシュラインに存在する
ことがキャッシュヒット信号221にてキャッシュ及び
プリフェッチ制御回路26に通知される。これによっ
て、キャッシュ及びプリフェッチ制御回路26は、プロ
グラムカウンタ30のワードWRDの情報に従ってセレ
クタ200,32を制御し、必要な命令を中央処理装置
3の命令レジスタ31に転送(フェッチ)させる(ステ
ップS4)。尚、図1において命令レジスタ31の前段
に配置されたセレクタ32はセレクタ200の出力情報
又はバイパス経路231からの情報を選択するものであ
り、キャッシュヒットの時はセレクタ200の出力情報
を、キャッシュミスの場合にはバイパス経路231から
の情報を選択する。その指示は信号261にてキャッシ
ュ及びプリフェッチ制御回路26から与えられる。
When the control of the instruction fetch operation is started,
In the cache data section 20 and the cache address section 21, one cache line is selected by the index IDX of the program counter 30. Whether the valid instruction has already been read into the selected cache line is indicated by the valid bit Vc of the relevant cache line. When the valid bit Vc is true (logical value "1"), the cache included in the relevant cache line. The cache comparison circuit 22 compares the tag CTAG with the address tag ATAG included in the program counter 30. When the comparison result is a match (step S2 = YES, and step S3 = Y)
ES), the cache and prefetch control circuit 26 is notified by the cache hit signal 221 that the required instruction exists in the cache line. As a result, the cache and prefetch control circuit 26 controls the selectors 200 and 32 according to the information in the word WRD of the program counter 30 to transfer (fetch) the necessary instruction to the instruction register 31 of the central processing unit 3 (step S4). . It should be noted that the selector 32 arranged in the preceding stage of the instruction register 31 in FIG. 1 selects the output information of the selector 200 or the information from the bypass path 231, and when the cache hit occurs, the output information of the selector 200 is changed to the cache miss. In the case of, the information from the bypass route 231 is selected. The instruction is given from the cache and prefetch control circuit 26 by a signal 261.

【0041】特に制限されないが、ステップS4の命令
フェッチの後には、中央処理装置3によるバスアクセス
が行われていないタイミングを以て中央処理装置3が命
令プリフェッチの指令をキャッシュ及びプリフェッチ制
御回路26に与える。例えば、そのときのプログラムカ
ウンタ30の命令アドレスがカウンタ273にて1キャ
ッシュライン分増加され、中央処理装置3によるバスア
クセスがない期間を利用して、その更新されたアドレス
情報(アドレスレジスタ27に格納されている)に基づ
き命令プリフェッチの動作が開始される。(ステップS
5)。命令プリフェッチの指令があったときの処理につ
いては図4に基づいて後述する。
Although not particularly limited, after the instruction fetch of step S4, the central processing unit 3 gives an instruction prefetch command to the cache and prefetch control circuit 26 at a timing when the bus access by the central processing unit 3 is not performed. For example, the instruction address of the program counter 30 at that time is incremented by one cache line in the counter 273, and the updated address information (stored in the address register 27 is stored in the address register 27 during a period in which there is no bus access by the central processing unit 3. The operation of instruction prefetch is started based on the above. (Step S
5). The processing when there is an instruction for instruction prefetch will be described later with reference to FIG.

【0042】命令キャッシュメモリでキャッシュミスし
た場合には、命令プリフェッチバッファでのヒット判定
の結果が参照される。即ち、命令プリフェッチバッファ
において、1キャッシュライン分の命令を格納できるバ
ッファデータ部23に、有効な命令が既に読込まれてい
るか否かは有効ビットVbが示す。有効ビットVbが真
(論理値”1”)の場合、バッファアドレス部24のプ
リフェッチバッファタグBTAG及びインデックスID
Xがバッファ比較回路25にてプログラムカウンタ30
のアドレスタグATAG及びインデックスIDXと比較
される。比較結果が一致の場合(ステップS2=YE
S、且つステップS3=NO)、必要な命令がバッファ
データ部23に存在することが信号251にてキャッシ
ュ及びプリフェッチ制御回路26に通知され、キャッシ
ュ及びプリフェッチ制御回路26は、プログラムカウン
タ30のワードWRDの情報に基づいてセレクタ230
を制御し、セレクタ230で選択した所要の命令をバイ
パス経路231を介して中央処理装置3に転送し(ステ
ップS7)、その命令が命令レジスタ31にフェッチさ
れる。
When a cache miss occurs in the instruction cache memory, the result of hit determination in the instruction prefetch buffer is referred to. That is, in the instruction prefetch buffer, the valid bit Vb indicates whether or not a valid instruction has already been read into the buffer data unit 23 that can store an instruction for one cache line. When the valid bit Vb is true (logical value “1”), the prefetch buffer tag BTAG and index ID of the buffer address section 24
X is the program counter 30 in the buffer comparison circuit 25.
Address tag ATAG and index IDX. When the comparison result is a match (step S2 = YE
S, and step S3 = NO), the cache and prefetch control circuit 26 is notified by the signal 251 that the necessary instruction exists in the buffer data unit 23, and the cache and prefetch control circuit 26 uses the word WRD of the program counter 30. 230 based on the information of
And transfers the required instruction selected by the selector 230 to the central processing unit 3 via the bypass path 231 (step S7), and the instruction is fetched into the instruction register 31.

【0043】このとき、有効ビットVbが真であっても
命令プリフェッチバッファが外部主メモリ6より命令を
読込み中の場合、即ち、読込み完了ビットCが偽(論理
値”0”)の場合、キャッシュ及びプリフェッチ制御回
路26は、ステップS6により8ワードのデータの読込
み完了後に該当命令を中央処理装置3に転送する。キャ
ッシュ及びプリフェッチ制御回路26は、主メモリ6か
ら命令プリフェッチバッファのバッファデータ部23に
第1ワード目の命令をプリフェッチするとき、読込み完
了ビットCを偽(論理値”0”)に初期化する。そし
て、キャッシュ及びプリフェッチ制御回路26は命令プ
リフェッチバッファのバッファデータ部23への書込み
ワードデータ数を計数する手段を有し、その計数値が8
になったとき読込み完了ビットCを真(論理値”1”)
に設定する。
At this time, even if the valid bit Vb is true, if the instruction prefetch buffer is reading an instruction from the external main memory 6, that is, if the read completion bit C is false (logical value "0"), the cache The prefetch control circuit 26 transfers the relevant instruction to the central processing unit 3 after the completion of reading the 8-word data in step S6. When prefetching the instruction of the first word from the main memory 6 to the buffer data section 23 of the instruction prefetch buffer, the cache and prefetch control circuit 26 initializes the read completion bit C to false (logical value "0"). The cache and prefetch control circuit 26 has means for counting the number of word data written to the buffer data unit 23 of the instruction prefetch buffer, and the count value is 8
Read completion bit C is true (logical value "1")
Set to.

【0044】主メモリ6から命令プリフェッチバッファ
のバッファデータ部23にプリフェッチされた8ワード
の命令は、命令キャッシュメモリのキャッシュデータ部
20における該当キャッシュラインに書込まれ(ステッ
プS8)、命令キャッシュメモリのキャッシュアドレス
部21における有効ビットVcが真(論理値”1”=O
N)に、かつ、キャッシュタグCTAGにはバッファア
ドレス部24のバッファタグBTAGの内容が設定され
る。そして、命令プリフェッチバッファのバッファアド
レス部24における有効ビットVbが偽(論理値”0”
=OFF)にされる(ステップS9)。これによりそれ
以降、命令キャッシュメモリと命令プリフェッチバッフ
ァの両方でヒットすることが防止される。そして上記同
様、命令プリフェッチが指令される(ステップS1
0)。
The 8-word instruction prefetched from the main memory 6 to the buffer data section 23 of the instruction prefetch buffer is written to the corresponding cache line in the cache data section 20 of the instruction cache memory (step S8), The valid bit Vc in the cache address portion 21 is true (logical value "1" = O
N) and the contents of the buffer tag BTAG of the buffer address unit 24 are set in the cache tag CTAG. Then, the valid bit Vb in the buffer address portion 24 of the instruction prefetch buffer is false (logical value "0").
= OFF) (step S9). This prevents subsequent hits in both the instruction cache memory and the instruction prefetch buffer. Then, similarly to the above, the instruction prefetch is instructed (step S1).
0).

【0045】尚、命令プリフェッチバッファの内容を命
令キャッシュメモリに書き込むときの対応キャッシュラ
インの選択はバッファアドレス部24が保有しているイ
ンデックスIDXの情報を用いる。また、2ウェイ以上
のセットアソシアティブ方式の命令キャッシュメモリで
は、命令プリフェッチバッファの命令列をどのウェイに
書込むかを制御する必要があるが、例えば図示しないが
公知のLRU(Least Recent Use)を用いることができ
る。これは、キャッシュラインのデータ部を入れ換える
際の重み付けを行う論理であり、最も最近参照されたキ
ャッシュラインを指すのに用いる。したがって、データ
部の入れ替えでは、LRUが指定していない方のキャッ
シュラインが入れ替えの対象とされる。
When writing the contents of the instruction prefetch buffer to the instruction cache memory, the corresponding cache line is selected using the information of the index IDX held by the buffer address section 24. Further, in a set associative instruction cache memory of two or more ways, it is necessary to control which way the instruction string of the instruction prefetch buffer is written. be able to. This is a logic for weighting when replacing the data part of a cache line, and is used to indicate the most recently referenced cache line. Therefore, when replacing the data part, the cache line not specified by the LRU is targeted for replacement.

【0046】命令キャッシュメモリにおいてキャッシュ
ミスされ、命令プリフェッチバッファにおいてバッファ
ミスされた場合(ステップS2=NO)、中央処理装置
3は主メモリ6より必要な命令を読込むまで命令を実行
することができないため、即座に命令プリフェッチ動作
が開始される。即ち、キャッシュ及びプリフェッチ制御
回路26はアドレスレジスタ27の値(プログラムカウ
ンタ30の命令アドレス)に基づいて、主メモリ6から
命令をプリフェッチする動作を開始させる(ステップS
12)。これによって、フェッチすべきアドレスの命令
が読み込まれると、プログラムカウンタ30のワードW
RDの情報に基づいて、セレクタ230が制御され、セ
レクタ230によって選択された命令がバイパス経路2
31を通って中央処理装置3に転送され、その命令が命
令レジスタ31にフェッチされる(ステップS13,S
14)。本実施例においては、中央処理装置3が必要と
する命令は主メモリ6から最初に読込まれる。すなわ
ち、中央処理装置3のミスヒット・ペナルティ低減のた
めにフェッチすべきアドレスの命令を先頭として主メモ
リ6から8ワードの命令がバースト転送される。したが
って、図3の制御フローには、命令プリフェッチバッフ
ァに最初に読込んだ1語の命令のみがバイパス経路23
1を経由して中央処理装置3に転送されるようになって
いる。さらに、命令プリフェッチバッファが外部の主メ
モリ6より命令を読込み中(読込み完了ビットCが偽)の
場合は、外部バスのトランズアクションの簡素化から命
令プリフェッチバッファが動作停止(読込み完了)してか
らフェッチ動作を開始するようになっている(ステップ
S11)。
When a cache miss occurs in the instruction cache memory and a buffer miss occurs in the instruction prefetch buffer (step S2 = NO), the central processing unit 3 cannot execute the instruction until the necessary instruction is read from the main memory 6. Therefore, the instruction prefetch operation is immediately started. That is, the cache and prefetch control circuit 26 starts the operation of prefetching an instruction from the main memory 6 based on the value of the address register 27 (the instruction address of the program counter 30) (step S
12). As a result, when the instruction at the address to be fetched is read, the word W of the program counter 30 is read.
The selector 230 is controlled based on the information of the RD, and the instruction selected by the selector 230 is the bypass path 2
It is transferred to the central processing unit 3 through 31 and the instruction is fetched into the instruction register 31 (steps S13, S).
14). In this embodiment, the instructions required by the central processing unit 3 are first read from the main memory 6. That is, 8-word instructions are burst-transferred from the main memory 6 starting with the instruction at the address to be fetched in order to reduce the miss hit penalty of the central processing unit 3. Therefore, in the control flow of FIG. 3, only the first one-word instruction read into the instruction prefetch buffer is bypass route 23.
The data is transferred to the central processing unit 3 via 1. Furthermore, if the instruction prefetch buffer is reading an instruction from the external main memory 6 (read completion bit C is false), the operation of the instruction prefetch buffer is stopped (read completion) to simplify the transaction of the external bus. The fetch operation is started (step S11).

【0047】〔割込みに基づく命令プリフェッチの起
動〕 図3に示される命令プリフェッチの指令は、プロ
グラムカウンタ30の値に従った命令フェッチの指令に
起因して発生される。命令プリフェッチのその他の指令
要因には、前述のように割込み受け付けにて割込み制御
回路4から信号406にてキャッシュ及びプリフェッチ
制御回路26に与えられる割込み処理プログラムの命令
プリフェッチの指令が存在する。斯る命令プリフェッチ
の指令は、図5のステップS56若しくはS57又は図
6のステップS63にて発生される。図5及び図6の詳
細については後述する。
[Invocation of Instruction Prefetch Based on Interrupt] The instruction prefetch instruction shown in FIG. 3 is generated due to the instruction fetch instruction according to the value of the program counter 30. Other instruction factors of the instruction prefetch include the instruction prefetch instruction of the interrupt processing program given to the cache and prefetch control circuit 26 by the signal 406 from the interrupt control circuit 4 upon acceptance of the interrupt as described above. The instruction prefetch command is generated in step S56 or S57 in FIG. 5 or step S63 in FIG. Details of FIGS. 5 and 6 will be described later.

【0048】〔命令プリフェッチの制御手順〕 図4に
は命令プリフェッチの指令を受けたときのキャッシュ及
びプリフェッチ制御回路26による制御手順が示され
る。命令プリフェッチの指令があると、その指令は割込
みコントローラ4からの命令プリフェッチ(割込みプリ
フェッチ)の指令か、或いは中央処理装置3による命令
実行段階における命令プリフェッチ(通常プリフェッ
チ)の指令かが判定される(ステップS41)。通常プ
リフェッチの場合、命令プリフェッチアドレスとしてカ
ウンタ273の出力もしくはプログラムカウンタ30の
出力が選択され、アドレスレジスタ27にセットされ
る。アドレスレジスタ27に設定された命令プリフェッ
チアドレスは命令キャッシュメモリ及び命令プリフェッ
チバッファに供給される(ステップS42)。また、割
込みプリフェッチの場合には命令プリフェッチアドレス
として割込み制御回路4からの割込み処理先頭アドレス
が選択されて、アドレスレジスタ27にセットされる。
アドレスレジスタ27に設定された命令プリフェッチア
ドレスは命令キャッシュメモリ及び命令プリフェッチバ
ッファに供給される(ステップS43)。命令プリフェ
ッチアドレスに対してはキャッシュヒット/ミス、バッ
ファヒット/ミスが判定され(ステップS44)、既に
命令キャッシュメモリ若しくは命令プリフェッチバッフ
ァに同一の命令列が存在している場合、主メモリ6から
の読込みを抑制(命令プリフェッチ動作を終了)し、外
部バスでの無駄なトランズアクションを防いでいる(ス
テップS44=YES)。
[Control Procedure of Instruction Prefetch] FIG. 4 shows a control procedure by the cache and prefetch control circuit 26 when the instruction of the instruction prefetch is received. When there is an instruction prefetch instruction, it is determined whether the instruction is an instruction prefetch (interrupt prefetch) instruction from the interrupt controller 4 or an instruction prefetch (normal prefetch) instruction at the instruction execution stage by the central processing unit 3 ( Step S41). In the case of normal prefetch, the output of the counter 273 or the output of the program counter 30 is selected as the instruction prefetch address and set in the address register 27. The instruction prefetch address set in the address register 27 is supplied to the instruction cache memory and the instruction prefetch buffer (step S42). In the case of interrupt prefetch, the interrupt processing start address from the interrupt control circuit 4 is selected as the instruction prefetch address and set in the address register 27.
The instruction prefetch address set in the address register 27 is supplied to the instruction cache memory and the instruction prefetch buffer (step S43). A cache hit / miss and a buffer hit / miss are determined for the instruction prefetch address (step S44), and if the same instruction string already exists in the instruction cache memory or the instruction prefetch buffer, read from the main memory 6. Is suppressed (the instruction prefetch operation is ended) to prevent a wasteful transaction on the external bus (step S44 = YES).

【0049】命令キャッシュメモリ及び命令プリフェッ
チバッファに同一の命令列が存在しない場合(ステップ
S44=NO)、通常プリフェッチかを判定し(ステッ
プS47)、割込みプリフェッチの場合には、プリフェ
ッチバッファは読込み完了かの判定(ステップS49=
YES)を待って、バッファーデータ部23の1ライン
分の命令を命令プリフェッチバッファに読込み開始する
(ステップS45)。通常プリフェッチの場合(ステッ
プS47=YES)には完了ビットCを参照してプリフ
ェッチバッファが読込み完了状態にあるかを判定し(ス
テップS48)、完了状態であればステップS45にて
命令プリフェッチバッファへの読込みが開始される。プ
リフェッチバッファが読込み完了状態でない場合には
(ステップS48=NO)、既に開始されている命令プ
リフェッチバッファへの1ライン分の読込み完了を待た
ずに処理を終了する。仮に読込み完了まで待つとすれ
ば、中央処理装置からの命令プリフェッチの指令がある
度に命令プリフェッチバッファへの読込みを完了できる
が、その間に発生する緊急の処理要求(例えば割込み要
求)に対する応答性が低下される。また、既に開始され
ている命令プリフェッチバッファへの1ライン分の読込
み完了を待たなくても、図3のフローチャートから明ら
かなように、その後の命令フェッチの指令の一貫として
再度同様の命令プリフェッチの指令が発生されるので一
切不都合はない。割込みプリフェッチの場合にステップ
S49=YESの判断を待って命令プリフェッチバッフ
ァへの読込みを開始するのは、割込み処理プログラムの
プリフェッチを優先させて、割込みに対する応答性を向
上させるためである。したがって、割込みプリフェッチ
の場合には、別の命令プリフェッチの指令に基づく命令
読込みが開始されず、かならず割込みプリフェッチが行
なわれるため、割込みへの応答性が向上する。
If the same instruction sequence does not exist in the instruction cache memory and the instruction prefetch buffer (step S44 = NO), it is judged whether it is a normal prefetch (step S47). Determination (step S49 =
After waiting for "YES", the instruction for one line of the buffer data section 23 is read into the instruction prefetch buffer and started (step S45). In the case of normal prefetch (step S47 = YES), it is determined whether the prefetch buffer is in the read completion state by referring to the completion bit C (step S48). If it is in the completion state, the instruction prefetch buffer is read in step S45. Reading is started. If the prefetch buffer is not in the read completion state (step S48 = NO), the process is terminated without waiting for the completion of the reading of one line into the instruction prefetch buffer that has already started. If it waits until the reading is completed, the reading to the instruction prefetch buffer can be completed each time there is an instruction of the instruction prefetch from the central processing unit, but the responsiveness to the urgent processing request (for example, interrupt request) that occurs during that Be lowered. Further, even if it is not necessary to wait for the completion of the reading of one line to the already started instruction prefetch buffer, as is clear from the flowchart of FIG. Is generated, so there is no inconvenience. In the case of interrupt prefetch, the reason why the instruction prefetch buffer is read after waiting for the determination of step S49 = YES is to prioritize the prefetch of the interrupt processing program and improve the responsiveness to the interrupt. Therefore, in the case of the interrupt prefetch, the instruction read based on another instruction of the instruction prefetch is not started, and the interrupt prefetch is always performed, so that the responsiveness to the interrupt is improved.

【0050】ステップS45の処理は、命令プリフェッ
チバッファのプリフェッチバッファタグBTAGにアド
レスレジスタ27のアドレスタグATAGの値を設定
し、アドレスレジスタ27の命令プリフェッチアドレス
にて外部主メモリ6から命令をバースト読込みを開始す
る処理とされる。その際、命令プリフェッチバッファの
有効ビットVbを真(論理値”1”)、読込み完了ビッ
トCを偽(論理値”0”)にし、命令プリフェッチバッ
ファが動作中であることを示す(ステップS46)。な
お、命令プリフェッチバッファの読込み完了ビットC
は、1ライン分の命令列を読込むと真(論理値”1”)
にされ、読込み動作完了を示す。
In the process of step S45, the value of the address tag ATAG of the address register 27 is set in the prefetch buffer tag BTAG of the instruction prefetch buffer, and the instructions are burst read from the external main memory 6 at the instruction prefetch address of the address register 27. It is a process to start. At that time, the valid bit Vb of the instruction prefetch buffer is set to true (logical value “1”) and the read completion bit C is set to false (logical value “0”), indicating that the instruction prefetch buffer is in operation (step S46). . The read completion bit C of the instruction prefetch buffer
Is true when the instruction sequence for one line is read (logical value "1")
Is set to indicate that the read operation is completed.

【0051】図4において、割込みプリフェッチの場合
における割込み処理プログラムの1ライン分の命令読込
み(ステップS45)は、図7に示される中央処理装置
3の割込み遷移期間内に行われるものである。本実施例
において、主メモリ6からプリフェッチした命令をプロ
グラムカウンタ30に転送することができるのは、制御
を簡略化したため少なくとも、8ワードの命令をバッフ
ァデータ部23に読込んだ以降とされる。これはステッ
プS6による。したがって本実施例の場合、8ワードの
命令を主メモリ6からデータバッファ部23にバースト
転送するために必要なメモリサイクル時間以上の割込み
遷移期間が存在して初めて、CPUが割込み処理に遷移
した時点でパイプラインに乱れなく、割込み処理プログ
ラムの命令をフェッチすることができる。但し、前記デ
ータバッファ部23の記憶容量が少なければ(キャッシ
ュラインのライン長が短かければ)、割込み処理プログ
ラムの命令プリフェッチに最低限必要な期間も短くな
る。また、割込み遷移制御において割込み処理プログラ
ムの先頭アドレスをプログラムカウンタ30にセットす
る直前に割込み完了ビットCを真値に変更する処理を追
加すれば、図3のステップS6が実質的に無視される結
果、割込み遷移期間に8ワードの命令プリフェッチが完
了しなくても、ステップS7にて割込み処理プログラム
の先頭命令をプログラムカウンタ30にフェッチするこ
とができる。ただし、図示はしないがステップ8にて実
質として割込み完了のタイミングを調整する制御が必要
になることは言うまでもない。
In FIG. 4, the instruction reading for one line of the interrupt processing program in the case of the interrupt prefetch (step S45) is performed within the interrupt transition period of the central processing unit 3 shown in FIG. In the present embodiment, the instruction prefetched from the main memory 6 can be transferred to the program counter 30 at least after the instruction of 8 words is read into the buffer data unit 23 for the sake of simplification of control. This depends on step S6. Therefore, in the case of the present embodiment, when the CPU transits to the interrupt processing for the first time after the interrupt transition period longer than the memory cycle time necessary for burst transfer of the 8-word instruction from the main memory 6 to the data buffer unit 23 exists. With, the instruction of the interrupt processing program can be fetched without disturbing the pipeline. However, if the storage capacity of the data buffer unit 23 is small (the line length of the cache line is short), the minimum period required for instruction prefetch of the interrupt processing program also becomes short. Further, in the interrupt transition control, if a process of changing the interrupt completion bit C to the true value is added immediately before the start address of the interrupt processing program is set in the program counter 30, step S6 of FIG. 3 is substantially ignored. Even if the 8-word instruction prefetch is not completed during the interrupt transition period, the head instruction of the interrupt processing program can be fetched into the program counter 30 in step S7. However, although not shown, it is needless to say that control for adjusting the timing of interrupt completion is substantially required in step 8.

【0052】〔割込み発生時における割込み制御回路の
制御〕 図5には外部割込み発生時の割込み制御回路4
の制御フローが示される。割込み制御回路4は、周辺回
路7,8より外部割込み要求信号401,402を受け
る。この際、割込み制御回路4は、複数の周辺回路7,
8より同時に外部割込みを受けたとき、そのどれを受付
るかを判断するために、図示しない割込み優先順位決定
回路及び要求信号に対応する受付マスク回路等を備え
る。そして、それら回路に設定された情報に基づいてど
の外部割込みを受付けるかが判断される(ステップS5
0)。
[Control of Interrupt Control Circuit When Interrupt Occurs] FIG. 5 shows the interrupt control circuit 4 when an external interrupt occurs.
The control flow of is shown. The interrupt control circuit 4 receives external interrupt request signals 401 and 402 from the peripheral circuits 7 and 8. At this time, the interrupt control circuit 4 uses a plurality of peripheral circuits 7,
When an external interrupt is received from 8 at the same time, an interrupt priority determining circuit (not shown) and a reception mask circuit corresponding to a request signal are provided in order to judge which of them is accepted. Then, it is determined which external interrupt is accepted based on the information set in these circuits (step S5).
0).

【0053】外部割込みが受け付けられたならば(ステ
ップS51=YES)、割込み制御回路4は中央処理装
置3に割込み信号405を与え、現在のプログラム実行
を中断して割込み遷移制御に移ることを指示する(ステ
ップS52)。これにより、中央処理装置3は、後述す
る図7の割込み遷移制御に移り、現在のプログラム実行
の停止ならびに割込み処理プログラムからの復帰のため
の退避処理などを開始する。
If an external interrupt is accepted (step S51 = YES), the interrupt control circuit 4 gives an interrupt signal 405 to the central processing unit 3 to instruct to interrupt the current program execution and shift to interrupt transition control. Yes (step S52). As a result, the central processing unit 3 shifts to the interrupt transition control of FIG. 7, which will be described later, and starts the current program execution stop and save processing for returning from the interrupt processing program.

【0054】割込み制御回路4は中央処理装置3による
割込み遷移制御に並行して以下の処理を行う。すなわ
ち、割込み制御回路4は、割込み処理プログラムの開始
アドレスを外部の周辺回路から受けるのか、前記テーブ
ル40が記憶する値を用いるかを割込み要求元に応じて
判断する(ステップS53)。前者において割込み開始
アドレスは周辺回路7のレジスタ71から供給される。
後者は、周辺回路がそのような割込み開始アドレス供給
機能を持たないものへの対応である。この判断は、外部
割込み要求信号に付加された情報や外部割込み要求信号
を受ける端子に意味を持たせるなどの方法にて決定する
ことができる。それらテーブル40やレジスタ71への
割込み開始アドレスの設定は、図1及び図2に示される
システムの始動時(パワーオンリセット時など)で行っ
たり中央処理装置3が任意時点で行うことができる。或
いは固定値を記憶するなど、別の手法を採用することも
できる。
The interrupt control circuit 4 performs the following processing in parallel with the interrupt transition control by the central processing unit 3. That is, the interrupt control circuit 4 determines whether to receive the start address of the interrupt processing program from an external peripheral circuit or to use the value stored in the table 40 according to the interrupt request source (step S53). In the former case, the interrupt start address is supplied from the register 71 of the peripheral circuit 7.
The latter corresponds to the peripheral circuit which does not have such an interrupt start address supply function. This determination can be made by a method such as giving meaning to the information added to the external interrupt request signal or the terminal receiving the external interrupt request signal. The setting of the interrupt start address in the table 40 and the register 71 can be performed at the time of starting the system shown in FIG. 1 and FIG. Alternatively, another method such as storing a fixed value can be adopted.

【0055】周辺回路7より割込み処理プログラムの開
始アドレスを受ける場合(ステップS53=YES)、
割込み制御回路4は、どの周辺回路からの外部割込みを
受付けたのかをその要求元の周辺回路7に外部割込み応
答信号403で知らせる(ステップS54)。この際、
この応答信号403には、周辺回路を特定するための情
報や外部割込み要因を示す情報ならびに割込み処理プロ
グラムの開始アドレスを割込み制御回路4が受けるため
のプロトコール(受付けを促したり、受付けを完了した
ことを示すためなどの一連の手続き)を付加すること
で、周辺回路からの応答性を高めることができる。
When the start address of the interrupt processing program is received from the peripheral circuit 7 (step S53 = YES),
The interrupt control circuit 4 informs the peripheral circuit 7 of the request source from which peripheral circuit the external interrupt is received by the external interrupt response signal 403 (step S54). On this occasion,
The response signal 403 includes a protocol for the interrupt control circuit 4 to receive information for identifying a peripheral circuit, information indicating an external interrupt factor, and the start address of the interrupt processing program (prompt acceptance or completion of acceptance). The response from the peripheral circuit can be improved by adding a series of procedures such as for indicating.

【0056】割込み制御回路4は、周辺回路より割込み
処理プログラムの開始アドレスを受け取ると(ステップ
S55=YES)、このアドレスは中央処理装置3とア
ドレスレジスタ27に転送され、キャッシュ及びプリフ
ェッチ制御回路26には信号406にて割込み処理プロ
グラムの命令フェッチが指令される(ステップS5
6)。アドレスレジスタ27に転送されたアドレスは、
割込み処理プログラムの先頭命令プリフェッチのための
プリフェッチアドレスとして利用される。中央処理装置
3に転送されるアドレスは、割込み遷移期間後に、割込
み処理プログラムの先頭命令を命令レジスタ31にフェ
ッチするためのアドレスとして利用される。中央処理装
置3による割込み遷移制御期間中において、キャッシュ
及びプリフェッチ制御回路26により前記割込み処理プ
ログラムの命令フェッチが行われる結果、命令レジスタ
31にフェッチされるべき割込み処理プログラムの命令
は、既に命令キャッシュメモリ若しくは命令プリフェッ
チバッファに読込まれており、割込み処理プログラムの
実行に際して最初から主メモリ6をアクセスしなければ
ならない事態が殆ど解消される。
When the interrupt control circuit 4 receives the start address of the interrupt processing program from the peripheral circuit (step S55 = YES), this address is transferred to the central processing unit 3 and the address register 27, and is sent to the cache and prefetch control circuit 26. Is instructed by the signal 406 to fetch the instruction of the interrupt processing program (step S5).
6). The address transferred to the address register 27 is
It is used as a prefetch address for prefetching the first instruction of the interrupt processing program. The address transferred to the central processing unit 3 is used as an address for fetching the first instruction of the interrupt processing program into the instruction register 31 after the interrupt transition period. As a result of the instruction fetch of the interrupt processing program being performed by the cache and prefetch control circuit 26 during the interrupt transition control period by the central processing unit 3, the instruction of the interrupt processing program to be fetched in the instruction register 31 has already been written in the instruction cache memory. Alternatively, the situation in which the main memory 6 is read from the beginning when the interrupt processing program is executed since it is read in the instruction prefetch buffer is almost eliminated.

【0057】上記周辺回路8のようにそれ自体が割込み
開始アドレスレジスタを備えないものに対しては、割込
み制御回路4のテーブル40のようなレジスタに記憶さ
れたアドレス情報を用いて上記同様の処理が行われる
(ステップS53=NO)。
For the peripheral circuit 8 that does not have an interrupt start address register itself, the same process as above is performed by using the address information stored in the register such as the table 40 of the interrupt control circuit 4. Is performed (step S53 = NO).

【0058】図6には内部割込み発生時の割込み制御回
路4の制御フローが示される。内部割込みは、中央処理
装置3のプログラム実行に伴い発生する割込みのこと
で、プログラム処理中にエラーが発生したり、内部タイ
マーなどで所定のイベントが発生したときなどに起き
る。基本的な処理内容は図5と同じであり、割込み開始
アドレスが割込み制御回路4から与えられ、割込み応答
信号405が内部割込み要求に対応するものであること
を中央処理装置3に返す点が相違され、その他の点は図
5と同様のステップS60からS63にて実現されてい
るので、その詳細な説明は省略する。
FIG. 6 shows a control flow of the interrupt control circuit 4 when an internal interrupt occurs. The internal interrupt is an interrupt that occurs when the central processing unit 3 executes a program, and occurs when an error occurs during the program processing or a predetermined event occurs in an internal timer or the like. The basic processing contents are the same as those in FIG. 5, except that the interrupt start address is given from the interrupt control circuit 4 and the interrupt response signal 405 returns to the central processing unit 3 that it corresponds to the internal interrupt request. Since the other points are realized in steps S60 to S63 similar to FIG. 5, detailed description thereof will be omitted.

【0059】〔中央処理装置による割込み遷移期間中の
処理〕 図7には中央処理装置3の割込み遷移期間中の
処理(割込み遷移制御)の一例フローチャートが示され
る。同図に示される処理は、割込み処理プログラムから
の復帰のための内部情報及びプログラムカウンタの値の
退避、割込み処理プログラムへの遷移のための内部の初
期化、そして割込み処理プログラムの先頭アドレスをプ
ログラムカウンタ30に設定する処理などとされる。す
なわち、中央処理装置3は信号405にて割込み受け付
けが通知されると、先ず、現在のプログラム実行を停止
し、中央処理装置3の内部情報例えばステータスレジス
タのプロセッサステータスワード(PSW)等をデータ
プロセッサ1の内部又は外部に退避し、PSWを初期化
する(ステップS70)。次に、割込み処理からの戻り
アドレスとしてプログラムカウンタ30の値若しくはそ
の前後の値(復帰後の処理が中断された処理からの継続
処理か、最初から再実行するか等によって相違される)
をデータプロセッサ1の内部又は外部に退避する(ステ
ップS71)。その後、必要に応じて特権レベルが最高
レベルに変更される(ステップS72)。そして、割込
みに関連した情報例えば割込み要因解析情報、そして割
込み復帰時に必要なその他のレジスタの値が、内部又は
外部に退避される(ステップS73)。上記夫々の退避
先は、プログラムカウンタやPSW用のレジスタと対を
成す退避用レジスタ34、外部主メモリ6、又は内蔵デ
ータキャッシュメモリ等とされる。前記処理が終了され
た後、割込み制御回路4から割込み開始アドレスが供給
されていることを条件に(ステップS74=YES)、
割込み制御回路4からの割込み開始アドレスをプログラ
ムカウンタ30に与えて、割込み処理プログラムに遷移
される(ステップS75)。同図で説明したステップS
70から”終了”までは、中央処理装置3の割込み遷移
期間とされる。
[Processing During Interrupt Transition Period by Central Processing Unit] FIG. 7 shows an example flowchart of the processing (interrupt transition control) during the interrupt transition period of the central processing unit 3. The processing shown in the figure is such that the internal information for returning from the interrupt processing program and the value of the program counter are saved, the internal initialization for transition to the interrupt processing program, and the start address of the interrupt processing program are programmed. The processing is set in the counter 30. That is, when the central processing unit 3 is notified of the interruption acceptance by the signal 405, first, the current program execution is stopped, and the internal information of the central processing unit 3, such as the processor status word (PSW) of the status register, is sent to the data processor. 1 is saved inside or outside, and the PSW is initialized (step S70). Next, as the return address from the interrupt process, the value of the program counter 30 or a value before and after the value (depending on whether the process after the recovery is a continuation process from the interrupted process or is re-executed from the beginning).
Is saved inside or outside the data processor 1 (step S71). Then, the privilege level is changed to the highest level if necessary (step S72). Then, the information related to the interrupt, for example, the interrupt factor analysis information, and the values of other registers necessary for returning from the interrupt are saved internally or externally (step S73). The respective save destinations are the save counter 34 that makes a pair with the program counter or the PSW register, the external main memory 6, the built-in data cache memory, or the like. After the processing is completed, on condition that the interrupt start address is supplied from the interrupt control circuit 4 (step S74 = YES),
The interrupt start address from the interrupt control circuit 4 is given to the program counter 30, and a transition is made to the interrupt processing program (step S75). Step S described in FIG.
The period from 70 to "end" is the interrupt transition period of the central processing unit 3.

【0060】〔ノンブロッキングキャッシュ〕 図8に
は図1において図示が省略されているノンブロッキング
キャッシュの構成を説明するためのブロック図である。
図8においてICACHEは図1で説明した命令キャッ
シュメモリ、IPBは図1で説明した命令プリフェッチ
バッファ、DCACHEはデータキャッシュメモリ、W
BBはライトバックバッファ、RBはリードバッファで
ある。命令プリフェッチバッファIPBの入力、ライト
バックバッファWBBの出力、及びリードバッファRB
の入力は外部インタフェース55を介して外部データバ
スEDBに接続される。命令プリフェッチバッファIP
B、リードバッファRB、及びライトバックバッファW
BBは命令キャッシュメモリICACHE及びデータキ
ャッシュメモリDCACHEの動作を抑止しないように
するためのバッファ手段として機能されるものであり、
その意味において図8に示されるキャッシュメモリの構
成はノンブロッキングキャッシュとされ、更に命令とデ
ータ用にキャッシュメモリが物理的に分離されているの
で、ハーバードアーキテクチャー形式のノンブロッキン
グキャッシュとして位置付けられる。その他の構成につ
いては図示していないが図1及び図2で説明した構成と
全く同一である。斯る構成においては、中央処理装置3
が命令キャッシュメモリICACHEから命令をフェッ
チしているとき、これに並行して命令プリフェッチバッ
ファIPBに命令をプリフェッチすることができる。ま
た、命令プリフェッチバッファIPBに命令をプリフェ
ッチしているとき、データキャッシュメモリDCACH
Eを介するデータアクセスを行うことができ、例えば主
メモリ6との間でのデータの整合(一致)を保つための
ライトバックはバスが空いているタイミングを見計らっ
てライトバックバッファWBBを介して後から行うこと
ができる。また、割込み発生時における退避の処理に当
たっても主メモリ6をアクセスせずにデータキャッシュ
メモリDCACHEのアクセスだけで済む場合も数多く
ある。
[Non-Blocking Cache] FIG. 8 is a block diagram for explaining the configuration of a non-blocking cache not shown in FIG.
In FIG. 8, ICACHE is the instruction cache memory described in FIG. 1, IPB is the instruction prefetch buffer described in FIG. 1, DCACHE is a data cache memory, W
BB is a write back buffer and RB is a read buffer. Input of instruction prefetch buffer IPB, output of write back buffer WBB, and read buffer RB
Is connected to the external data bus EDB via the external interface 55. Instruction prefetch buffer IP
B, read buffer RB, and write back buffer W
BB functions as a buffer unit for preventing the operations of the instruction cache memory ICACHE and the data cache memory DCACHE from being suppressed,
In that sense, the configuration of the cache memory shown in FIG. 8 is a non-blocking cache, and since the cache memory is physically separated for instructions and data, it is positioned as a Harvard architecture type non-blocking cache. Other configurations are not shown, but they are exactly the same as the configurations described in FIGS. 1 and 2. In such a configuration, the central processing unit 3
Is fetching an instruction from the instruction cache memory ICACHE, the instruction can be prefetched into the instruction prefetch buffer IPB in parallel with this. Further, when the instruction is prefetched to the instruction prefetch buffer IPB, the data cache memory DCACH
Data can be accessed via E. For example, write-back for maintaining data consistency (coincidence) with the main memory 6 is performed via the write-back buffer WBB in consideration of the timing when the bus is vacant. Can be done from Further, there are many cases in which the main memory 6 is not accessed and only the data cache memory DCACHE is accessed even in the saving process when an interrupt occurs.

【0061】図9にはノンブロッキングキャッシュの別
の例が示される。同図に示される例は、命令とデータを
同一キャッシュメモリに格納するユニファイドキャッシ
ュメモリを採用した場合である。図9においてUCAC
HEは図1で説明した命令キャッシュメモリの構成を備
え、データキャッシュメモリと兼用のキャッシュメモリ
である。RBはリードバッファ、WB1は第1のライト
バッファ、WB2は第2のライトバッファである。この
場合に図8の命令プリフェッチバッファIPBの機能は
リードバッファRBが実現する。リードバッファRB及
びライトバッファWB1,WB2は、ユニファイドキャ
ッシュメモリUCACHEの動作を抑止しないようにす
るためのバッファ手段として機能されるものであり、そ
の意味において図9に示されるキャッシュメモリの構成
も同じくノンブロッキングキャッシュとされる。その場
合に前記ライトバッファWB2は、かならずしも必要で
はない。その他の構成については図示していないが図1
及び図2で説明した構成と全く同一である。斯る構成に
おいては、中央処理装置3がユニファイドキャッシュメ
モリUCACHEから命令をフェッチしているとき、こ
れに並行してリードバッファRBに命令をプリフェッチ
することができる。また、リードバッファRBに命令を
プリフェッチしているとき、ユニファイドキャッシュメ
モリUCACHEを介するデータアクセスをライトバッ
ファWB1,WB2に対して行うことができ、例えば主
メモリ6との間でのデータの整合(一致)を保つための
ライトバックはバスが空いているタイミングを見計らっ
て第1のライトバッファWB1を介して後から行うこと
ができる。また、割込み発生時における退避の処理に当
たっても主メモリ6をアクセスせずに予じめライトバッ
ファWB1,WB2へ書き込んで対処できる場合も数多
くある。
FIG. 9 shows another example of the non-blocking cache. The example shown in the figure is a case where a unified cache memory that stores instructions and data in the same cache memory is adopted. In FIG. 9, UCAC
The HE is a cache memory that has the configuration of the instruction cache memory described in FIG. 1 and is also used as the data cache memory. RB is a read buffer, WB1 is a first write buffer, and WB2 is a second write buffer. In this case, the function of the instruction prefetch buffer IPB of FIG. 8 is realized by the read buffer RB. The read buffer RB and the write buffers WB1 and WB2 function as buffer means for preventing the operation of the unified cache memory UCACHE, and in that sense, the cache memory configuration shown in FIG. 9 is also the same. It is a non-blocking cache. In that case, the write buffer WB2 is not always necessary. Other configurations are not shown in FIG.
The configuration is the same as that described with reference to FIG. In such a configuration, when the central processing unit 3 is fetching an instruction from the unified cache memory UCACHE, the instruction can be prefetched to the read buffer RB in parallel with this. Further, while prefetching an instruction into the read buffer RB, data access via the unified cache memory UCACHE can be performed to the write buffers WB1 and WB2, and for example, data matching with the main memory 6 ( The write back for maintaining the (match) can be performed later via the first write buffer WB1 in consideration of the timing when the bus is vacant. In addition, there are many cases in which the main memory 6 can be written in the write buffers WB1 and WB2 in advance without accessing the main memory 6 even in the saving process when an interrupt occurs.

【0062】〔シングルチップマイクロコンピュータ〕
図10には図1で説明したデータプロセッサを更に別
のデータプロセッサ即ちマイクロコンピュータそしてデ
ータ処理システム等に展開した場合の実施例が示され
る。図10においてMCUとして図示している部分につ
いては、公知の半導体集積回路製造技術によって単結晶
シリコンのような1個の半導体基板にシングルチップマ
イクロコンピュータとして構成することも可能である。
[Single Chip Microcomputer]
FIG. 10 shows an embodiment in which the data processor described in FIG. 1 is further expanded to another data processor, that is, a microcomputer and a data processing system. The part shown as MCU in FIG. 10 can be configured as a single chip microcomputer on one semiconductor substrate such as single crystal silicon by a known semiconductor integrated circuit manufacturing technique.

【0063】図10においてキャッシュ及びプリフェッ
チ制御回路2、中央処理装置(CPU)3、割込み制御
回路4、そして主メモリ6は図1で説明した回路モジュ
ールと同等のものである。図10において主メモリ6は
RAMとROMを含む。900で示されキャッシュメモ
リ装置は図1で説明した命令プリフェッチバッファ及び
命令キャッシュメモリを含む回路ブロックである。その
他にデータキャッシュメモリ及びライトバックバッファ
を含んでもよい。また、別のキャッシュメモリ装置90
1を設けてもよい。その他の回路モジュールとして、ハ
ードディスク装置910やフロッピーディスク装置91
1を制御するファイル制御装置909、フレームバッフ
ァ913に対する描画制御とモニタ914に対する表示
制御を行う表示制御装置912、バス権監視装置90
2、ダイレクトメモリアクセスコントローラのような高
速データ転送装置903、システム監視装置905、コ
ミュニケーションインタフェース装置906、プリンタ
916やキーボード917とインタフェースされるパラ
レル/シリアルポート915などの周辺装置、更に、入
出力コントローラ904及びメモリコントローラ908
などを有する。上記キャッシュメモリ装置900,90
1は、大容量記憶装置(RAM及びROMを含む主メモ
リ6、ハードディスク装置910、フロッピーディスク
装置911など)の一部の情報を読込む比較的小容量だ
が大容量記憶装置に比べて命令やデータを高速にアクセ
スできるようにする。
In FIG. 10, the cache and prefetch control circuit 2, the central processing unit (CPU) 3, the interrupt control circuit 4, and the main memory 6 are equivalent to the circuit module described in FIG. In FIG. 10, the main memory 6 includes a RAM and a ROM. A cache memory device indicated by 900 is a circuit block including the instruction prefetch buffer and the instruction cache memory described in FIG. Besides, a data cache memory and a write back buffer may be included. In addition, another cache memory device 90
1 may be provided. Other circuit modules include a hard disk device 910 and a floppy disk device 91.
1, a file control device 909 for controlling the number 1, a display control device 912 for performing drawing control for the frame buffer 913 and a display control for the monitor 914, and a bus right monitoring device 90.
2. A high-speed data transfer device 903 such as a direct memory access controller, a system monitoring device 905, a communication interface device 906, peripheral devices such as a parallel / serial port 915 interfaced with a printer 916 and a keyboard 917, and an input / output controller 904. And memory controller 908
And so on. The cache memory device 900, 90
1 is a relatively small capacity for reading a part of information in a large-capacity storage device (main memory 6 including RAM and ROM, hard disk device 910, floppy disk device 911, etc.), but instructions and data compared to a large-capacity storage device. To allow fast access.

【0064】上記実施例によれば次に示す作用効果を得
る。〔1〕割込みが発生してからプログラムが割込み処
理に切り替わるまでには、中央処理装置3はプログラム
カウンタ30の値やステータスレジスタ33の値などを
ハードウェア的に退避し、更に必要な情報を退避した後
に、割込み処理プログラムを実行することになる。パイ
プライン処理が採用されている場合には、割込み処理プ
ログラムに遷移する前に、割込みによるパイプラインの
乱れを最小限にするための各種情報の退避も必要にな
る。データプロセッサ1は中央処理装置3によるそのよ
うな割込み遷移制御の期間に並行して、割込み処理プロ
グラムの命令をプリフェッチする。プリフェッチすべき
命令アドレスは割込み制御回路4からアドレスレジスタ
27に与えられ、当該アドレスレジスタ27の値を用い
たプリフェッチ動作の指示は割込み制御回路4からキャ
ッシュ及びプリフェッチ制御回路26に与えられる。割
込み処理プログラムのプリフェッチに必要なメモリアク
セスは、割込み遷移期間にバスが空いている時(中央処
理装置3がバスアクセスを行っていないとき)に行われ
る。本実施例に従えば、中央処理装置3は退避用レジス
タ34を有し、また、データキャッシュメモリDCAC
HEとライトバックバッファWBBとを備えたノンブロ
ッキングキャッシュメモリが採用されているので、中央
処理装置3の内部状態を退避する場合に、一定の情報に
ついては退避用レジスタ34に退避することにより主メ
モリ6のアクセスを省くことができ、また、退避に際し
てデータキャッシュメモリDCACHEがキャッシュヒ
ットであれば同様に主メモリ6のアクセスを省くことが
でき、更にキャッシュミスでもライトバックバッファW
BBの作用によってエントリ入れ替えに際しての主メモ
リ6への書き戻しを後回しにすることができる。このよ
うに割込み遷移制御期間において中央処理装置3による
主メモリ6のアクセスが行われない間のバスの空きタイ
ミングによって割込み処理プログラムの命令をプリフェ
ッチすることができる。
According to the above embodiment, the following operational effects are obtained. [1] The central processing unit 3 saves the value of the program counter 30, the value of the status register 33, and the like by hardware from the occurrence of the interrupt until the program is switched to the interrupt process, and further saves necessary information. After that, the interrupt processing program is executed. When pipeline processing is adopted, it is also necessary to save various types of information in order to minimize disturbance of the pipeline due to interrupts before transitioning to the interrupt processing program. The data processor 1 prefetches the instruction of the interrupt processing program in parallel with the period of such interrupt transition control by the central processing unit 3. The instruction address to be prefetched is given from the interrupt control circuit 4 to the address register 27, and the instruction of the prefetch operation using the value of the address register 27 is given from the interrupt control circuit 4 to the cache and prefetch control circuit 26. The memory access required for prefetching the interrupt processing program is performed when the bus is free during the interrupt transition period (when the central processing unit 3 is not accessing the bus). According to the present embodiment, the central processing unit 3 has the save register 34, and the data cache memory DCAC
Since the non-blocking cache memory including the HE and the write-back buffer WBB is adopted, when the internal state of the central processing unit 3 is saved, the main memory 6 is saved by saving certain information in the save register 34. Access to the main memory 6 can be omitted when the data cache memory DCACHE is a cache hit at the time of saving. Further, even if a cache miss occurs, the write back buffer W can be omitted.
By the action of BB, the writing back to the main memory 6 at the time of exchanging the entries can be postponed. In this way, during the interrupt transition control period, the instruction of the interrupt processing program can be prefetched depending on the vacant timing of the bus while the main memory 6 is not accessed by the central processing unit 3.

【0065】〔2〕図7の割込み遷移期間中には、割込
み要求に基づく命令プリフェッチ(割込みプリフェッ
チ)が並行される。すなわち、中央処理装置3が割込み
遷移制御を行っている間隙をぬって割込み処理プログラ
ムのプリフェッチが行われることになる。したがって、
その実行開始時点を予測し難い割込み処理プログラムに
対しても、その命令をプリフェッチすることが可能にな
る。割込み処理プログラムの命令が命令プリフェッチバ
ッファのバッファデータ部23にプリフェッチされれ
ば、図7のステップS75にて割込み処理プログラムに
遷移するための命令フェッチを命令プリフェッチバッフ
ァのバッファデータ部23からフェッチでき、割込み処
理プログラムの実行開始時点から命令キャッシュメモリ
及び命令プリフェッチバッファの性能を充分に生かして
割込み処理の高速化を実現できる。
[2] During the interrupt transition period of FIG. 7, instruction prefetch (interrupt prefetch) based on an interrupt request is performed in parallel. That is, the interrupt processing program is prefetched through the gap where the central processing unit 3 is performing interrupt transition control. Therefore,
It is possible to prefetch the instruction even for an interrupt processing program whose execution start time is difficult to predict. If the instruction of the interrupt processing program is prefetched into the buffer data unit 23 of the instruction prefetch buffer, the instruction fetch for transitioning to the interrupt processing program can be fetched from the buffer data unit 23 of the instruction prefetch buffer in step S75 of FIG. From the start of execution of the interrupt processing program, the performance of the instruction cache memory and the instruction prefetch buffer can be fully utilized to speed up the interrupt processing.

【0066】〔3〕命令キャッシュメモリを、キャッシ
ュデータ部20と、キャッシュアドレス部21と、キャ
ッシュ比較回路22とによって構成するとき、前記命令
プリフェッチバッファを、バッファデータ部23と、バ
ッファアドレス部24と、バッファ比較回路25とを供
えて構成することにより、命令キャッシュメモリにおけ
る1キャッシュライン分のラインフェッチと同様の制御
によって命令プリフェッチバッファに対するプリフェッ
チを行うことができるようになる。このとき、上記キャ
ッシュ及びプリフェッチ制御回路26は、前記命令プリ
フェッチの指令に対して、前記キャッシュ比較回路22
及びバッファ比較回路25の双方から不一致の比較結果
を検出することにより命令プリフェッチバッファへの命
令プリフェッチを起動し(ステップS44=NO)、実
質的に無駄なプリフェッチを行わない。命令プリフェッ
チバッファへの命令プリフェッチの完了後における命令
アクセスに際して前記バッファ比較回路25における一
致の比較結果を検出することにより前記プリフェッチ完
了された命令プリフェッチバッファの内容をキャッシュ
メモリに書込み制御する(ステップS8)。これによ
り、命令プリフェッチバッファにプリフェッチしてもバ
ッファヒットにならず利用されないような命令によっ
て、既存のキャッシュエントリを命令キャッシュメモリ
から追い出してしまう不都合を解消できる。このような
プリフェッチの機構に対して、割込み制御回路40は、
割込み要求を受け付けたとき、当該要求に応答するため
の処理プログラムの先頭アドレス情報に基づいて命令プ
リフェッチバッファに命令をプリフェッチさせる指令4
06をキャッシュ及びプリフェッチ制御回路26に与え
るから、割込み開始アドレスを元にプリフェッチを行う
と言う実に簡潔な構成により、従来のキャッシュメモリ
に多くの改造ならびに追加回路を必要とせずに上記作用
効果を得ることができる。
[3] When the instruction cache memory is composed of the cache data unit 20, the cache address unit 21, and the cache comparison circuit 22, the instruction prefetch buffer includes the buffer data unit 23, the buffer address unit 24, and the buffer data unit 23. , And the buffer comparison circuit 25, the instruction prefetch buffer can be prefetched under the same control as the line fetch for one cache line in the instruction cache memory. At this time, the cache and prefetch control circuit 26 responds to the instruction prefetch command by the cache comparison circuit 22.
The instruction prefetch to the instruction prefetch buffer is activated by detecting the mismatched comparison results from both the buffer comparison circuit 25 and the buffer comparison circuit 25 (step S44 = NO), and substantially unnecessary prefetch is not performed. The contents of the prefetch-completed instruction prefetch buffer are written into the cache memory by detecting the comparison result of the coincidence in the buffer comparison circuit 25 at the time of accessing the instruction after the completion of the instruction prefetch to the instruction prefetch buffer (step S8). . As a result, it is possible to eliminate the inconvenience of erasing an existing cache entry from the instruction cache memory by an instruction that does not result in a buffer hit and is not used even if prefetched into the instruction prefetch buffer. For such a prefetch mechanism, the interrupt control circuit 40
When an interrupt request is accepted, a command 4 for prefetching an instruction in the instruction prefetch buffer based on the start address information of the processing program for responding to the request
06 is given to the cache and prefetch control circuit 26, so that the prefetch is performed based on the interrupt start address, so that the above-described operation and effect can be obtained without requiring many modifications and additional circuits in the conventional cache memory. be able to.

【0067】〔4〕命令プリフェッチの指令発生元とし
て、中央処理装置3の他に割込み制御回路4が追加され
ている。割込み処理プログラムの先頭アドレスと、プロ
グラムカウンタ30の値と、プログラムカウンタ30の
値に基づいて生成されたプリフェッチアドレスとから選
ばれた一つのアドレスをアドレスレジスタ27に与える
選択手段271,272を設け、前記キャッシュ及びプ
リフェッチ制御回路26は、命令フェッチの指令に対し
て前記キャッシュ比較回路及びバッファ比較回路の双方
から不一致の比較結果を検出することにより選択手段に
プログラムカウンタ30の値を選択させ、命令プリフェ
ッチの指令に対して、その指令発生元が割込み制御回路
4である場合には選択手段271,272に割込み処理
プログラムの先頭アドレスを選択させ、命令プリフェッ
チの指令に対して、その指令発生元が中央処理装置3で
ある場合には選択手段271,272にプログラムカウ
ンタ30の値に基づいて生成されたプリフェッチアドレ
スを選択させるようにすることにより、命令フェッチと
命令プリフェッチのための命令アクセスアドレスを保持
するアドレスレジスタ27を、双方からの命令プリフェ
ッチの指令と共に命令フェッチに共用させることができ
る。
[4] In addition to the central processing unit 3, the interrupt control circuit 4 is added as an instruction prefetch instruction generation source. Selector means 271, 272 for providing the address register 27 with one address selected from the start address of the interrupt processing program, the value of the program counter 30, and the prefetch address generated based on the value of the program counter 30, The cache and prefetch control circuit 26 causes the selecting means to select the value of the program counter 30 by detecting the mismatched comparison result from both the cache comparison circuit and the buffer comparison circuit in response to the instruction fetch instruction, and the instruction prefetch When the instruction generation source is the interrupt control circuit 4, the selection means 271, 272 is caused to select the start address of the interrupt processing program, and the instruction generation source is the central source for the instruction prefetch command. In the case of the processing device 3, the selection means 27 , 272 by selecting the prefetch address generated based on the value of the program counter 30, the address register 27 holding the instruction access address for instruction fetch and instruction prefetch It can be shared with the instruction fetch along with the command.

【0068】〔5〕上記中央処理装置3によって書き換
え可能なテーブル40やレジスタ71に割込み開始アド
レスを保持させることにより、割込み処理プログラムの
マッピングに対する自由度を向上させることができる。
[5] By storing the interrupt start address in the rewritable table 40 or register 71 by the central processing unit 3, the degree of freedom for mapping the interrupt processing program can be improved.

【0069】以上本発明者によってなされた発明を実施
例に基づいて具体的に説明したが、本発明はそれに限定
されるものではなく、その要旨を逸脱しない範囲におい
て種々変更可能であることは言うまでもない。例えば、
命令プリフェッチバッファは命令キャッシュメモリの複
数キャッシュライン分の記憶領域を備えて構成できる。
キャッシュメモリの構成は上記実施例に限定されず種々
変更可能である。
Although the invention made by the present inventor has been specifically described based on the embodiments, the present invention is not limited thereto, and needless to say, various modifications can be made without departing from the scope of the invention. Yes. For example,
The instruction prefetch buffer can be configured with a storage area for a plurality of cache lines of the instruction cache memory.
The configuration of the cache memory is not limited to the above embodiment and can be modified in various ways.

【0070】[0070]

【発明の効果】本願において開示される発明のうち代表
的なものによって得られる効果を簡単に説明すれば下記
の通りである。
The effects obtained by the typical ones of the inventions disclosed in the present application will be briefly described as follows.

【0071】割込みが発生してから中央処理装置が割込
み処理プログラムの実行に移るまでの割込み遷移期間
に、割込み制御回路は割込み処理プログラムの先頭アド
レスを出力してプリフェッチ及びキャッシュ制御回路に
当該割込み処理プログラムの命令プリフェッチを指示す
る。これによって、プリフェッチ及びキャッシュ制御回
路は、中央処理装置による割込み遷移制御の期間に並行
して、割込み処理プログラムをプリフェッチすることが
できる。割込み処理プログラムの命令プリフェッチには
メモリアクセスが必要とされる。そのようなメモリアク
セスは、中央処理装置による割込み遷移制御の期間にお
けるバスサイクルで実現される。そのようなバスの空き
サイクルは、例えばデータキャッシュメモリを備えるこ
とにより、或いはデータキャッシュメモリにバッファを
備えたノンブロッキングキャッシュの構成により、さら
には中央処理装置が退避用レジスタを内蔵し又はバンク
レジスタを備える構成などによって、保証される。この
ようにして割込み処理プログラムの命令がプリフェッチ
されることにより、割込み処理プログラムの実行開始時
点から命令キャッシュメモリ及び命令プリフェッチバッ
ファの性能を充分に生かしてデータ処理の高速化を実現
できる。更に、割込み開始アドレスを元にプリフェッチ
を行うと言う実に簡潔な制御方式のため、従来のキャッ
シュメモリに多くの改造ならびに追加回路を必要とせ
ず、換言すればコスト上昇を抑えて、上記効果を得るこ
とができる。
During the interrupt transition period from the occurrence of the interrupt to the execution of the interrupt processing program by the central processing unit, the interrupt control circuit outputs the start address of the interrupt processing program to the prefetch and cache control circuit. Instructs program prefetch. With this, the prefetch and cache control circuit can prefetch the interrupt processing program in parallel with the period of the interrupt transition control by the central processing unit. Memory access is required for instruction prefetch of the interrupt processing program. Such memory access is realized in a bus cycle during the interrupt transition control by the central processing unit. Such an empty cycle of the bus is provided, for example, by providing a data cache memory, or by configuring a non-blocking cache having a buffer in the data cache memory, and further, the central processing unit has a save register built-in or a bank register. Guaranteed by configuration. By prefetching the instructions of the interrupt processing program in this manner, the performance of the instruction cache memory and the instruction prefetch buffer can be fully utilized from the start of execution of the interrupt processing program, and high-speed data processing can be realized. Furthermore, since the prefetch is performed based on the interrupt start address, the conventional cache memory does not require many modifications and additional circuits, in other words, the cost increase is suppressed and the above effect is obtained. be able to.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の一実施例に係るデータプロセッサの部
分ブロック図である。
FIG. 1 is a partial block diagram of a data processor according to an embodiment of the present invention.

【図2】図1のデータプロセッサを用いたシステム構成
例を示すブロック図である。
FIG. 2 is a block diagram showing a system configuration example using the data processor of FIG.

【図3】中央処理装置からの命令フェッチの指示に基づ
く命令フェッチ及びプリフェッチ起動の基本的な制御態
様の一例フローチャートである。
FIG. 3 is a flowchart of an example of a basic control mode of instruction fetch and prefetch activation based on an instruction fetch instruction from a central processing unit.

【図4】命令プリフェッチの制御手順を示すフローチャ
ートである。
FIG. 4 is a flowchart showing an instruction prefetch control procedure.

【図5】外部割込み発生時の割込み制御回路の一例制御
フローチャートである。
FIG. 5 is a control flowchart of an example of an interrupt control circuit when an external interrupt occurs.

【図6】内部割込み発生時の割込み制御回路の一例制御
フローチャートである。
FIG. 6 is a control flowchart of an example of an interrupt control circuit when an internal interrupt occurs.

【図7】中央処理装置の割込み前処理の一例フローチャ
ートである。
FIG. 7 is a flowchart of an example of pre-interruption processing of the central processing unit.

【図8】図1において明瞭に示されていないノンブロッ
キングキャッシュの構成をハーバードアーキテクチャー
を代表として説明するためのブロック図である。
FIG. 8 is a block diagram for explaining a configuration of a non-blocking cache, which is not clearly shown in FIG. 1, as a representative of Harvard architecture.

【図9】ノンブロッキングキャッシュの別の例をユニフ
ァイドキャッシュメモリを採用したもので示すブロック
図である。
FIG. 9 is a block diagram showing another example of a non-blocking cache using a unified cache memory.

【図10】図1で説明したデータプロセッサを更に別の
データプロセッサ若しくはマイクロコンピュータそして
データ処理システムに展開した場合の実施例ブロック図
である。
FIG. 10 is a block diagram of an embodiment when the data processor described in FIG. 1 is further developed to another data processor or microcomputer and a data processing system.

【図11】中央処理装置の一例ブロック図である。FIG. 11 is a block diagram of an example of a central processing unit.

【符号の説明】 1 データプロセッサ 2 命令キャッシュ・プリフェッチ部 20 キャッシュデータ部 21 キャッシュアドレス部 CTAG キャッシュタグ Vc 有効ビット 22 キャッシュ比較回路 23 バッファデータ部 24 バッファアドレス部 BTAG バッファタグ Vb 有効ビット C 読込み完了ビット 25 バッファ比較回路 26 キャッシュ及びプリフェッチ制御回路 27 アドレスレジスタ ATAG アドレスタグ IDX インデックス WRD ワード 3 中央処理装置 30 プログラムカウンタ 4 割込み制御回路 40 テーブル 401,402,404 割込み要求信号 405 割込み信号 406 割込み受け付け信号 6 主メモリ 7 周辺回路 8 周辺回路 IPB 命令プリフェッチバッファ ICACHE 命令キャッシュメモリ WBB ライトバックバッファ DCACHE データキャッシュメモリ RB リードバッファ WB1,WB2 ライトバッファ UCACHE ユニファイドキャッシュメモリ[Description of Codes] 1 data processor 2 instruction cache / prefetch unit 20 cache data unit 21 cache address unit CTAG cache tag Vc valid bit 22 cache comparison circuit 23 buffer data unit 24 buffer address unit BTAG buffer tag Vb valid bit C read completion bit 25 buffer comparison circuit 26 cache and prefetch control circuit 27 address register ATAG address tag IDX index WRD word 3 central processing unit 30 program counter 4 interrupt control circuit 40 table 401, 402, 404 interrupt request signal 405 interrupt signal 406 interrupt acceptance signal 6 main Memory 7 Peripheral circuit 8 Peripheral circuit IPB Instruction prefetch buffer ICACHE Instruction cache memory WB B write back buffer DCACHE data cache memory RB read buffer WB1, WB2 write buffer UCACHE unified cache memory

Claims (10)

【特許請求の範囲】[Claims] 【請求項1】 命令を実行する中央処理装置と、前記命
令をプリフェッチする命令プリフェッチバッファと、プ
リフェッチされた命令を保持する命令キャッシュメモリ
と、命令フェッチの指令に対して命令フェッチアドレス
に応ずる命令を前記プリフェッチバッファ、命令キャッ
シュメモリ、又は外部から取得する制御を行い、命令プ
リフェッチの指令に対して命令プリフェッチアドレスに
応ずる命令を外部から前記プリフェッチバッファに取得
する制御を行うキャッシュ及びプリフェッチ制御回路
と、割込み要求を受け付けたとき、当該要求に応答する
ための処理プログラムの先頭アドレス情報に基づいて命
令プリフェッチバッファに命令をプリフェッチさせる指
示を上記キャッシュ及びプリフェッチ制御回路に与える
割込み制御回路とを備えて成るものであることを特徴と
するデータ処理装置。
1. A central processing unit that executes instructions, an instruction prefetch buffer that prefetches the instructions, an instruction cache memory that holds the prefetched instructions, and an instruction that responds to an instruction fetch address in response to an instruction fetch instruction. A cache and prefetch control circuit that performs control for acquiring from the prefetch buffer, the instruction cache memory, or the outside, and an instruction corresponding to the instruction prefetch address in response to the instruction of the instruction prefetch from the outside, and a prefetch control circuit; When a request is accepted, an interrupt control circuit for giving an instruction for prefetching an instruction to the instruction prefetch buffer to the cache and the prefetch control circuit based on the start address information of the processing program for responding to the request is provided. A data processing device characterized in that it is made up of
【請求項2】 前記割込み制御回路からの割込み受け付
けの通知を中央処理装置が受け付けてから当該中央処理
装置が当該割込み要求に応答する処理プログラムの実行
開始に至るまでの遷移制御期間に中央処理装置の内部状
態の退避に利用されるデータ記憶手段を更に備え、全体
として一つの半導体基板に形成されて成るものであるこ
とを特徴とする請求項1記載のデータ処理装置。
2. The central processing unit during a transition control period from when the central processing unit receives a notice of acceptance of an interrupt from the interrupt control circuit until when the central processing unit starts execution of a processing program that responds to the interrupt request. 2. The data processing device according to claim 1, further comprising a data storage unit used for saving the internal state of the device, which is formed on one semiconductor substrate as a whole.
【請求項3】 前記データ記憶手段はデータキャッシュ
メモリであり、当該データキャッシュメモリと外部との
間にライトバックバッファとを備えて成るものであるこ
とを特徴とする請求項2記載のデータ処理装置。
3. The data processing apparatus according to claim 2, wherein the data storage means is a data cache memory, and a write back buffer is provided between the data cache memory and the outside. .
【請求項4】 前記割込み制御回路は、これが受け付け
た割込み要求に応答するための処理プログラムの先頭ア
ドレス情報をアドレスレジスタに供給し、前記キャッシ
ュ及びプリフェッチ制御回路は、前記アドレスレジスタ
に保持されたアドレス情報に基づいて命令プリフェッチ
を行うものであることを特徴とする請求項1乃至3の何
れか1項記載のデータ処理装置。
4. The interrupt control circuit supplies start address information of a processing program for responding to an interrupt request accepted by the interrupt control circuit to an address register, and the cache and prefetch control circuit supplies the address held in the address register. 4. The data processing device according to claim 1, wherein the instruction prefetch is performed based on information.
【請求項5】 前記割込み制御回路は、割込み要求に応
答するための処理プログラムの先頭アドレス情報を割込
み要因に対応させて記憶するテーブルを供え、割込み要
求を受け付けたとき、当該要求の要因に応ずるアドレス
情報を当該テーブルから前記アドレスレジスタに供給す
るものであることを特徴とする請求項4記載のデータ処
理装置。
5. The interrupt control circuit is provided with a table for storing the start address information of the processing program for responding to the interrupt request in association with the interrupt factor, and when accepting the interrupt request, responding to the factor of the request. The data processing device according to claim 4, wherein address information is supplied from the table to the address register.
【請求項6】 前記割込み制御回路は更に、受け付けら
れた割込み要求元の周辺回路から、割込み要求に応答す
るための処理プログラムの先頭アドレス情報を受け、こ
れを前記アドレスレジスタに与えるものであることを特
徴とする請求項5記載のデータ処理装置。
6. The interrupt control circuit further receives the start address information of a processing program for responding to the interrupt request from the peripheral circuit of the accepted interrupt request source, and supplies it to the address register. The data processing device according to claim 5, wherein
【請求項7】 前記テーブルは前記中央処理装置によっ
て書き換え可能にされて成るものであることを特徴とす
る請求項5又は6記載のデータ処理装置。
7. The data processing device according to claim 5, wherein the table is rewritable by the central processing unit.
【請求項8】 命令を実行する中央処理装置と、前記命
令をプリフェッチする命令プリフェッチバッファと、プ
リフェッチされた命令を保持する命令キャッシュメモリ
と、命令フェッチの指令に対して命令フェッチアドレス
に応ずる命令を前記プリフェッチバッファ、命令キャッ
シュメモリ、又は外部から取得する制御を行い、命令プ
リフェッチの指令に対して命令プリフェッチアドレスに
応ずる命令を外部から前記プリフェッチバッファに取得
する制御を行うキャッシュ及びプリフェッチ制御回路と
を供え、 前記命令キャッシュメモリは、所定語数の命令を一つの
データブロックとして複数個格納するためのキャッシュ
データ部と、キャッシュデータ部の命令とその命令アド
レスとを関連付けるためのキャッシュアドレス部と、命
令アクセスアドレスの一部がキャッシュアドレス部のア
ドレス情報に一致するか否かを検出するキャッシュ比較
回路とを供え、 前記命令プリフェッチバッファは、前記キャッシュデー
タ部の一つのデータブロックの命令語数に等しい語数の
命令を一つのデータブロックとして格納可能なバッファ
データ部と、バッファデータ部の命令とその命令アドレ
スとを関連付けるためのバッファアドレス部と、命令ア
クセスアドレスの一部がバッファアドレス部のアドレス
情報に一致するか否かを検出するバッファ比較回路とを
供え、 前記キャッシュ及びプリフェッチ制御回路は、前記命令
プリフェッチの指令に対して、前記キャッシュ比較回路
及びバッファ比較回路の双方から不一致の比較結果を検
出することにより命令プリフェッチバッファへの命令プ
リフェッチを起動するものであり、 更に、割込み要求を受け付けたとき、当該要求に応答す
るための処理プログラムの先頭アドレス情報に基づいて
命令プリフェッチバッファに命令をプリフェッチさせる
指示を上記キャッシュ及びプリフェッチ制御回路に与え
る割込み制御回路を備えて成るものであることを特徴と
するデータ処理装置。
8. A central processing unit that executes instructions, an instruction prefetch buffer that prefetches the instructions, an instruction cache memory that holds the prefetched instructions, and an instruction that responds to an instruction fetch address in response to an instruction fetch instruction. The prefetch buffer, the instruction cache memory, or a cache and a prefetch control circuit that performs control to obtain from the outside and perform control to obtain an instruction corresponding to an instruction prefetch address from the outside to the prefetch buffer in response to an instruction of the instruction prefetch. The instruction cache memory includes a cache data section for storing a plurality of instructions of a predetermined number of words as one data block, a cache address section for associating an instruction of the cache data section with its instruction address, and an instruction access unit. And a cache comparison circuit that detects whether or not a part of the address matches the address information of the cache address section, and the instruction prefetch buffer has a number of instructions equal to the number of instruction words of one data block of the cache data section. Can be stored as one data block, a buffer address part for associating an instruction in the buffer data part with its instruction address, and whether part of the instruction access address matches the address information in the buffer address part. A cache comparison circuit that detects whether or not the cache and prefetch control circuit detects an instruction by detecting a mismatched comparison result from both the cache comparison circuit and the buffer comparison circuit in response to the instruction prefetch command. Instruction pref to prefetch buffer When the interrupt request is accepted, an instruction to prefetch an instruction to the instruction prefetch buffer based on the start address information of the processing program for responding to the request is issued to the cache and prefetch control circuit. A data processing device comprising: an interrupt control circuit provided to the device.
【請求項9】 前記キャッシュ及びプリフェッチ制御回
路は更に、命令プリフェッチバッファへの命令プリフェ
ッチの完了後における命令アクセスに際して前記バッフ
ァ比較回路における一致の比較結果を検出することによ
り前記プリフェッチ完了された命令プリフェッチバッフ
ァの内容をキャッシュメモリに書込み制御するものであ
ることを特徴とする請求項8記載のデータ処理装置。
9. The prefetch-completed instruction prefetch buffer by detecting a comparison result of a match in the buffer comparison circuit at the time of instruction access to the instruction prefetch buffer after the instruction prefetch is completed. 9. The data processing device according to claim 8, wherein the contents of the above are controlled to be written in a cache memory.
【請求項10】 命令フェッチと命令プリフェッチのた
めの命令アクセスアドレスを保持するアドレスレジスタ
を供え、 割込み処理プログラムの先頭アドレスと、プログラムカ
ウンタの値と、プログラムカウンタの値に基づいて生成
されたプリフェッチアドレスとから選ばれた一つのアド
レスを前記アドレスレジスタに与える選択手段を有し、 前記キャッシュ及びプリフェッチ制御回路は、命令フェ
ッチの指令に対して前記キャッシュ比較回路及びバッフ
ァ比較回路の双方から不一致の比較結果を検出すること
により選択手段にプログラムカウンタの値を選択させ、
命令プリフェッチの指令に対して、その指令要因が割込
み制御回路である場合には選択手段に割込み処理プログ
ラムの先頭アドレスを選択させ、命令プリフェッチの指
令に対して、その指令要因が中央処理装置である場合に
は選択手段にプログラムカウンタの値に基づいて生成さ
れたプリフェッチアドレスを選択させるものであること
を特徴とする請求項8又は9記載のデータ処理装置。
10. An address register for holding an instruction access address for instruction fetch and instruction prefetch, and a start address of an interrupt processing program, a value of a program counter, and a prefetch address generated based on the value of the program counter. Selecting means for giving one address selected from the address register to the address register, and the cache and prefetch control circuit is a comparison result of a mismatch from both the cache comparison circuit and the buffer comparison circuit in response to an instruction fetch command. By causing the selection means to select the value of the program counter,
For the instruction prefetch command, if the instruction factor is the interrupt control circuit, the selecting means is caused to select the start address of the interrupt processing program, and the instruction factor is the central processing unit for the instruction prefetch command. 10. The data processing device according to claim 8 or 9, characterized in that the selection means is made to select the prefetch address generated based on the value of the program counter.
JP13739295A 1994-12-13 1995-05-11 Data processing device Expired - Fee Related JP3614207B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP13739295A JP3614207B2 (en) 1994-12-13 1995-05-11 Data processing device

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP33221294 1994-12-13
JP6-332212 1994-12-13
JP13739295A JP3614207B2 (en) 1994-12-13 1995-05-11 Data processing device

Publications (2)

Publication Number Publication Date
JPH08221270A true JPH08221270A (en) 1996-08-30
JP3614207B2 JP3614207B2 (en) 2005-01-26

Family

ID=26470722

Family Applications (1)

Application Number Title Priority Date Filing Date
JP13739295A Expired - Fee Related JP3614207B2 (en) 1994-12-13 1995-05-11 Data processing device

Country Status (1)

Country Link
JP (1) JP3614207B2 (en)

Cited By (2)

* 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
US8578135B2 (en) 2004-01-29 2013-11-05 Renesas Electronics Corporation Apparatus for calculating and prefetching a branch target address

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8578135B2 (en) 2004-01-29 2013-11-05 Renesas Electronics Corporation Apparatus for calculating and prefetching a branch target address
US8560748B2 (en) 2010-06-29 2013-10-15 Fujitsu Semiconductor Limited Information processing system including interrupt processing function

Also Published As

Publication number Publication date
JP3614207B2 (en) 2005-01-26

Similar Documents

Publication Publication Date Title
US5941981A (en) System for using a data history table to select among multiple data prefetch algorithms
JP3636986B2 (en) Semiconductor integrated circuit
JP3577331B2 (en) Cache memory system and method for manipulating instructions in a microprocessor
JP3218773B2 (en) Cache controller
US5822758A (en) Method and system for high performance dynamic and user programmable cache arbitration
JPH096633A (en) Method and system for operation of high-performance multiplelogical route in data-processing system
JPH11312122A (en) On-chip program memory system which is user constructable
WO1999021088A1 (en) An apparatus and method to guarantee forward progress in a multithreaded processor
JPH10154098A (en) Data processing system having cache and method for it
US4500959A (en) Apparatus for invalidating the content of an instruction buffer by program store compare check
JP4071942B2 (en) Data processing apparatus and data processor
EP1030243B1 (en) Optimized hardware cleaning function for virtual index virtual tag data cache
JP2000259498A (en) Instruction cache for multi-thread processor
JP3088303B2 (en) Cache memory bank controller
JP3614207B2 (en) Data processing device
JPH11232171A (en) Information processing system
JP2685455B2 (en) Data processing device
JP2000047942A (en) Device and method for controlling cache memory
JP4111645B2 (en) Memory bus access control method after cache miss
JPH07282023A (en) Data transfer amount variable processor and system using the same
JPH10254775A (en) Memory controller having common cache memory
JP2004094807A (en) Instruction cache, microprocessor, and design method for same
JP2002108703A (en) Cache controller and processor
JP3284508B2 (en) Data prefetch control device
JPH10247150A (en) Data processing system

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040205

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040224

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040426

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040713

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040913

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20041019

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20041026

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071112

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081112

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081112

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091112

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees