JP2002108702A - Microcomputer and data processor - Google Patents

Microcomputer and data processor

Info

Publication number
JP2002108702A
JP2002108702A JP2000303491A JP2000303491A JP2002108702A JP 2002108702 A JP2002108702 A JP 2002108702A JP 2000303491 A JP2000303491 A JP 2000303491A JP 2000303491 A JP2000303491 A JP 2000303491A JP 2002108702 A JP2002108702 A JP 2002108702A
Authority
JP
Japan
Prior art keywords
data
write
cache
memory
microcomputer
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.)
Withdrawn
Application number
JP2000303491A
Other languages
Japanese (ja)
Inventor
Hironori Takahashi
宏徳 高橋
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 JP2000303491A priority Critical patent/JP2002108702A/en
Publication of JP2002108702A publication Critical patent/JP2002108702A/en
Withdrawn legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To reduce a decrease in the performance of a system. SOLUTION: A central processor (3) is provided which can write data of a cache memory back to a memory in a period wherein a task managed by an operating system is not executed while valid bits of blocks whose dirty bits are effective are made effective, and the writing-back processing is carried out in the period wherein the task is not performed to reduce cases wherein the cache contents which were used last are written back right before caching, thereby reducing the decrease in the performance of the system.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、データ処理技術、
さらにはキャッシュシステムの改良技術に関し、例えば
シングルチップマイクロコンピュータ(単に「マイクロ
コンピュータ」という)及びそれを含むデータ処理装置
に適用して有効な技術に関する。
The present invention relates to a data processing technology,
Further, the present invention relates to a technique for improving a cache system, for example, a technique effective when applied to a single-chip microcomputer (hereinafter simply referred to as a "microcomputer") and a data processing device including the same.

【0002】[0002]

【従来の技術】近年の制御用マイクロコンピュータにお
いては、取り扱うデータ量の増加に伴い、大量データの
高速処理を可能とするキャッシュメモリシステムが搭載
されている。このキャッシュシステムによれば、前回の
外部メモリアクセスによってキャッシュメモリに残され
ているデータについては、それを利用することにより、
目的とするデータを高速に得ることができるので、シス
テムの処理性能の向上を図ることができる。
2. Description of the Related Art Recent control microcomputers are equipped with a cache memory system which enables high-speed processing of a large amount of data as the amount of data to be handled increases. According to this cache system, by using the data left in the cache memory by the previous external memory access,
Since the target data can be obtained at high speed, the processing performance of the system can be improved.

【0003】また、ユーザが実メモリを意識せずに、オ
ペレーティングシステムがメモリ管理を行う分野では、
データ処理装置が、アドレス変換機構をサポートする必
要がある。アドレス変換機構とは、仮想記憶を実現する
ために仮想アドレスを物理アドレスに変換する機構であ
る。さらに、アドレス変換機構を高速に実行するため
に、仮想アドレスと物理アドレスの変換対を保持するア
ドレス変換バッファ(Translation lookaside buffer
「TLB」と略記される)を、マイクロコンピュータに
内蔵する技術も採用されている。尚、キャッシュシステ
ムについて記載された文献の例としては、1995年1
1月5日に朝倉書店から発行された「計算機アーキテク
チャと構成方式(第273頁から第308頁)がある。
In the field where the operating system manages memory without the user being aware of the actual memory,
The data processing device needs to support an address translation mechanism. The address translation mechanism is a mechanism that translates a virtual address into a physical address in order to implement virtual storage. Furthermore, in order to execute the address translation mechanism at high speed, an address translation buffer (Translation lookaside buffer) holding a translation pair of a virtual address and a physical address.
(Abbreviated as "TLB") in a microcomputer is also employed. As an example of a document describing a cache system, see,
There is “Computer Architecture and Configuration Method (pages 273 to 308)” issued by Asakura Shoten on January 5th.

【0004】[0004]

【発明が解決しようとする課題】キャッシュメモリシス
テムは、マイクロコンピュータの外部に配置された半導
体メモリ(「外部メモリ)という)より高速である反
面、記憶容量が小さいため、外部メモリの一部しか代替
できない。キャッシュメモリシステムによる外部メモリ
の代替の要因には次の二つが考えられる。すなわち、
(1)命令、定数値など、読み出しにのみ使用される場
合、及び(2)読み出したデータに対して行われた演算
の結果(中間結果をも含む)を保存する場合である。
The cache memory system is faster than a semiconductor memory (hereinafter referred to as "external memory") arranged outside the microcomputer, but has a small storage capacity, so that only a part of the external memory is replaced. No. There are two possible reasons for replacing the external memory by the cache memory system:
(1) Instructions and constant values are used only for reading, and (2) Results of operations (including intermediate results) performed on read data are stored.

【0005】上記(1)の場合は、外部メモリにある使
用頻度の高いデータをキャッシュメモリにコピーし(こ
れを「キャッシング」という)し、2回目以降の参照を
高速化する。この場合は、データの参照しか行わないた
め、キャッシュメモリの情報は外部メモリの記憶情報に
整合している。これに対して、上記(2)の場合には、
キャッシュメモリのデータの内容変更を伴うため、キャ
ッシュメモリの情報は外部メモリの記憶情報に整合しな
くなる。そのため、キャッシュメモリにおいて更新され
た内容を外部メモリに書き戻す作業(ライトバック)が
必要になる。
In the case of (1), frequently used data in the external memory is copied to the cache memory (this is referred to as "caching"), and the second and subsequent references are speeded up. In this case, since only the data is referred to, the information in the cache memory matches the information stored in the external memory. In contrast, in case (2) above,
Since the contents of the data in the cache memory are changed, the information in the cache memory does not match the information stored in the external memory. Therefore, it is necessary to write back the updated contents in the cache memory to the external memory (write back).

【0006】キャッシングや、ライトバックは、比較的
低速な外部メモリとのデータ交換なので、システムの性
能低下の大きな要因となる。これら性能低下を軽減する
ため、プリフェッチ、ライトバックバッファなどの技術
がある。プリフェッチは、実際にデータ必要となる前に
キャッシングしておく技術である。ライトバックバッフ
ァは、ライトバックしてキャッシングする過程におい
て、ライトバックを後回しにしてキャッシングを高速化
する技術である。
[0006] Caching or write-back is a data exchange with a relatively low-speed external memory, and is a major factor in lowering system performance. In order to reduce such performance degradation, there are techniques such as prefetch and write-back buffer. Prefetch is a technique for caching data before it is actually needed. The write-back buffer is a technique for increasing the speed of caching by postponing the write-back in the process of writing back and caching.

【0007】マイクロコンピュータ応用システム、特に
機器組み込み制御装置では、ある事象(Event)を
発端として、演算を開始するイベント駆動システムが一
般的である。例えばイベント駆動型の処理には、装置を
操作する人の指示により何らかの動作をするというもの
がある。イベント駆動システムでは、例えば図6に示さ
れるように、イベントが発生するまでの間は、CPU
(中央処理装置)の待機状態であり、この状態では、演
算が不要であるが、イベント発生からは高速演算のため
の即時性が要求される。また、連続する二つのイベント
が互いに等しい場合には、図7に示されるように、キャ
ッシュメモリは、CPUのアイドル状態ではアクセスさ
れず、イベント発生後の高速演算の際に頻繁にアクセス
される。それに対して、連続する二つのイベントが互い
に異なる場合には、図8に示されるように、イベント発
生後の処理が異なる。すなわち、イベント発生により
外部メモリの第1ブロックへのアクセスが行われ、イベ
ント発生により、外部メモリの第1ブロックへのライ
トバック及び外部メモリの第2ブロックへのアクセスが
行われる。このように連続する二つのイベントが互いに
異なる場合には、前回使用した第1ブロックのデータと
は異なる第2ブロックについてのキャッシングが必要に
なるが、この際、前回使用したキャッシュ内容をライト
バックする必要があり、このことが、システムの性能低
下の要因とされていることが、本願発明者によって見い
だされた。
[0007] In a microcomputer application system, particularly in a device built-in control device, an event driven system which starts an operation starting from a certain event (Event) is generally used. For example, there is an event-driven process in which some operation is performed according to an instruction of a person who operates the apparatus. In an event-driven system, for example, as shown in FIG.
This is a standby state of the (central processing unit). In this state, no operation is required, but immediacy for high-speed operation is required from the occurrence of an event. Further, when two consecutive events are equal to each other, as shown in FIG. 7, the cache memory is not accessed when the CPU is in an idle state, but is frequently accessed at the time of high-speed operation after the event occurs. On the other hand, when two consecutive events are different from each other, the processing after the occurrence of the event is different as shown in FIG. That is, the first block of the external memory is accessed by the occurrence of the event, and the first block of the external memory is written back and the second block of the external memory is accessed by the occurrence of the event. When two consecutive events are different from each other, caching is required for a second block different from the data of the first block used last time. At this time, the cache content used last time is written back. It has been found by the inventor of the present application that this is necessary, and this is considered to be a cause of system performance degradation.

【0008】本発明の目的は、システムの性能低下を軽
減することにある。
[0008] An object of the present invention is to reduce a decrease in system performance.

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

【0010】[0010]

【課題を解決するための手段】本願において開示される
発明のうち代表的なものの概要を簡単に説明すれば下記
の通りである。
The following is a brief description of an outline of a typical invention among the inventions disclosed in the present application.

【0011】すなわち、データの記憶エリアと、そのデ
ータに関連するアドレス情報を記憶するタグエリアと、
上記データの内容が更新されたことを示すダーティビッ
トと、上記データの有効性を示すバリッドビットとを含
んで一つのキャッシュブロックが形成され、上記データ
が格納されたメモリのリードキャッシュ及びライトキャ
ッシュを可能とするキャッシュシステムを設け、さら
に、オペレーティングシステムによって管理されるタス
クが実行されていない期間に、上記ダーティビットが有
効なブロックについてバリッドビットを有効とした状態
でキャッシュシステムのデータを上記メモリにライトバ
ック可能な中央処理装置を設ける。
That is, a data storage area, a tag area for storing address information related to the data,
One cache block is formed including a dirty bit indicating that the content of the data has been updated and a valid bit indicating the validity of the data, and a read cache and a write cache of a memory in which the data is stored are formed. A cache system that enables the cache system, and further writes data of the cache system to the memory in a state where the dirty bit is valid while the task managed by the operating system is not executed. A central processing unit capable of backing is provided.

【0012】上記の手段によれば、中央処理装置は、オ
ペレーティングシステムによって管理されるタスクが実
行されていない期間に、上記ダーティビットが有効なブ
ロックについてバリッドビットを有効とした状態でキャ
ッシュシステムのデータを上記メモリにライトバックす
る。連続する二つのイベントが互いに異なる場合には、
前回使用した第1ブロックのデータとは異なる第2ブロ
ックについてのキャッシングが必要になるが、上記のよ
うにオペレーティングシステムによって管理されるタス
クが実行されていない期間にライトバック処理が実行さ
れるようになっているため、上記第2ブロックについて
のキャッシングの直前において、前回使用したキャッシ
ュ内容をライトバックするケースが減少され、このこと
が、システムの性能低下を軽減する。
[0012] According to the above means, the central processing unit, while the task managed by the operating system is not executed, stores the data of the cache system in a state where the valid bit is valid for the block in which the dirty bit is valid. Is written back to the memory. If two consecutive events are different from each other,
Although caching is required for the second block different from the data of the first block used last time, the write-back processing is executed so that the task managed by the operating system is not executed as described above. Therefore, immediately before the caching of the second block, the number of cases in which the previously used cache contents are written back is reduced, which alleviates the performance degradation of the system.

【0013】また、上記メモリアクセスに使用されるバ
スの監視を行うことで、上記中央処理装置によって上記
メモリがアクセスされていない期間を検出可能なバス状
態監視回路と、上記検出段の検出結果に基づいて、上記
メモリがアクセスされていない期間にライトバック処理
の開始を指示するライトバック制御回路とを含んでマイ
クロコンピュータを構成することができる。
Further, by monitoring the bus used for the memory access, a bus state monitoring circuit capable of detecting a period during which the memory is not accessed by the central processing unit, and a detection result of the detection stage. Based on this, the microcomputer can be configured to include a write-back control circuit for instructing the start of the write-back process during a period in which the memory is not accessed.

【0014】[0014]

【発明の実施の形態】図10には本発明にかかるマイク
ロコンピュータが適用されるデータ処理装置が示され
る。
FIG. 10 shows a data processing apparatus to which a microcomputer according to the present invention is applied.

【0015】このデータ処理装置200は、特に制限さ
れないが情報端末機器とされ、システムバスBUSを介
して、マイクロコンピュータ231、SDRAM23
2、ROM(リード・オンリ・メモリ)234、周辺装
置制御部235、表示制御部236などが互いに信号の
やり取り可能に結合され、予め定められたプログラムに
従って所定のデータ処理を行う。上記マイクロコンピュ
ータ231は、本システムの論理的中核とされ、主とし
て、アドレス指定、情報の読み出しと書き込み、データ
の演算、命令のシーケンス、割り込の受付け、記憶装置
と入出力装置との情報交換の起動等の機能を有し、演算
制御や、バス制御、メモリアクセス制御などを行う。上
記SDRAM232及びROM234はマイクロコンピ
ュータ231の外部メモリとして位置付けられている。
SDRAM232は、マイクロコンピュータ231で実
行されるオペレーティングシステムソフトや、アプリケ
ーションソフト、さらにはマイクロコンピュータの演算
処理において必要とされる各種データが外部記憶装置2
38などからロードされる。ここで、外部記憶装置23
8は、特に制限されないが、記憶素子としてフラッシュ
メモリ素子を含んでカード状に形成された半導体メモリ
カードなどとされる。ROM234には読み出し専用の
プログラムが格納される。周辺装置制御部235によっ
て、外部憶装置238の動作制御や、キーボード239
などからの情報入力制御が行われる。また、上記表示制
御部236によって液晶ディスプレイ240への情報表
示制御が行われる。この表示制御部236には描画処理
のための半導体チップや画像メモリなどが含まれる。
The data processing device 200 is an information terminal device, although not particularly limited, and includes a microcomputer 231 and an SDRAM 23 via a system bus BUS.
2. A ROM (Read Only Memory) 234, a peripheral device control unit 235, a display control unit 236, and the like are connected to each other so as to be able to exchange signals, and perform predetermined data processing according to a predetermined program. The microcomputer 231 is a logical core of the present system, and is mainly used for addressing, reading and writing of information, data operation, instruction sequence, acceptance of interrupt, and information exchange between the storage device and the input / output device. It has a function such as activation, and performs arithmetic control, bus control, memory access control, and the like. The SDRAM 232 and the ROM 234 are positioned as external memories of the microcomputer 231.
The SDRAM 232 stores operating system software executed by the microcomputer 231, application software, and various data necessary for arithmetic processing of the microcomputer in the external storage device 2.
38 and so on. Here, the external storage device 23
Although not particularly limited, 8 is a semiconductor memory card or the like formed in a card shape including a flash memory element as a storage element. The ROM 234 stores a read-only program. The peripheral device control unit 235 controls the operation of the external storage device 238 and the keyboard 239.
Information input control is performed. The display control unit 236 controls information display on the liquid crystal display 240. The display control unit 236 includes a semiconductor chip and an image memory for drawing processing.

【0016】図1には、上記マイクロコンピュータ23
1の構成例が示される。同図に示されるマイクロコンピ
ュータ231は、特に制限されないが、単結晶シリコン
のようなの1個の半導体基板に集積回路化されて構成さ
れる。マイクロコンピュータ231は浮動小数点ユニッ
ト(FPUとも称する)2を持つ。更に、マイクロコン
ピュータ231は、整数を操作することができる中央処
理装置(CPUとも称する)3を備える。マイクロコン
ピュータ231は、特に制限されないが、16ビット固
定長命令セットを備えた32ビットRISC(Reduced
Instruction Set Computer:縮小命令セットコンピュー
タ)アーキテクチャを有する。
FIG. 1 shows the microcomputer 23
1 is shown. Although not particularly limited, the microcomputer 231 shown in the figure is configured to be integrated on a single semiconductor substrate such as single crystal silicon. The microcomputer 231 has a floating point unit (also referred to as FPU) 2. Further, the microcomputer 231 includes a central processing unit (also referred to as a CPU) 3 capable of operating an integer. The microcomputer 231 is not particularly limited, but includes a 32-bit RISC (Reduced Reduced Instruction Set) having a 16-bit fixed-length instruction set.
Instruction Set Computer (reduced instruction set computer) architecture.

【0017】図1において参照符号4で示されるものは
アドレス変換・キャッシュユニット(CCN)である。
CPU3による命令アクセスとデータアクセスを並列化
できるように、上記アドレス変換・キャッシュユニット
4は、命令用の命令アドレス変換バッファ(命令TLB
とも称する)40と、データ用のユニファイドアドレス
変換バッファ(ユニファイドTLBとも称する)41を
別々に持ち、また、命令キャッシュメモリ42とデータ
キャッシュメモリ43もそれぞれ個別化されている。キ
ャッシュ・アドレス変換バッファコントローラ(キャッ
シュTLBコントローラとも称する)44はアドレス変
換・キャッシュユニット4を全体的に制御する。
In FIG. 1, what is indicated by reference numeral 4 is an address translation / cache unit (CCN).
The address translation / cache unit 4 includes an instruction address translation buffer (instruction TLB) for instructions so that instruction access and data access by the CPU 3 can be parallelized.
) And a data unified address translation buffer (also referred to as a unified TLB) 41, and an instruction cache memory 42 and a data cache memory 43 are also individualized. A cache / address translation buffer controller (also referred to as a cache TLB controller) 44 controls the address translation / cache unit 4 as a whole.

【0018】図1において参照符号5で示されるものは
バスステートコントローラであり、32ビットのデータ
バス50及び29ビットのアドレスバス51を介して上
記アドレス変換・キャッシュユニット4に接続されてい
る。このバスステートコントローラ5にはデータバス5
4及びアドレスバス55を介してDMAC8が接続され
ている。
In FIG. 1, reference numeral 5 denotes a bus state controller, which is connected to the address conversion / cache unit 4 via a 32-bit data bus 50 and a 29-bit address bus 51. The bus state controller 5 includes a data bus 5
4 and the DMAC 8 via the address bus 55.

【0019】マイクロコンピュータ231において上記
CPU3及びDMAC8がバスマスタモジュールを構成
する。マイクロコンピュータ231による外部アクセス
は、64ビットのデータバス52及びアドレスバス53
を介して上記バスステートコントローラ5に接続された
外部バスインタフェース回路(PAD)6で行う。外部
バスインタフェース回路6は外部データバス60及び外
部アドレスバス61に接続される。
In the microcomputer 231, the CPU 3 and the DMAC 8 constitute a bus master module. External access by the microcomputer 231 is performed by a 64-bit data bus 52 and an address bus 53.
The operation is performed by an external bus interface circuit (PAD) 6 connected to the bus state controller 5 through the interface. The external bus interface circuit 6 is connected to an external data bus 60 and an external address bus 61.

【0020】マイクロコンピュータ231は、16ビッ
トの周辺データバス56及び周辺アドレスバス57に接
続された内蔵周辺回路として、クロックパルスジェネレ
ータ(CPGとも称する)70、割り込み制御回路7
1、シリアルコミュニケーションインタフェースコント
ローラ(SCI1,SCI2)72、リアルタイムクロ
ック回路73及びタイマ74を有する。それら周辺回路
は上記バスステートコントローラ5を介してCPU3又
はDMAC8によってアクセスされる。
The microcomputer 231 includes a clock pulse generator (CPG) 70 and an interrupt control circuit 7 as built-in peripheral circuits connected to the 16-bit peripheral data bus 56 and the peripheral address bus 57.
1, a serial communication interface controller (SCI1, SCI2) 72, a real-time clock circuit 73, and a timer 74. These peripheral circuits are accessed by the CPU 3 or the DMAC 8 via the bus state controller 5.

【0021】上記DMAC8は、例えば4個のデータ転
送チャネルを有し、各データ転送チャネル毎に、転送元
アドレスが設定されるソースアドレスレジスタ、転送先
アドレスが設定されるディスティネーションアドレスレ
ジスタ、転送回数を計数するためのトランスファカウン
トレジスタ、及びデータ転送制御態様等が設定されるチ
ャネルコントロールレジスタを有する。上記レジスタに
対するデータ転送制御情報の初期設定はCPU3等が行
なう。DMAC8の制御部は、マイクロコンピュータ2
31の外部からのデータ転送要求DREQ、マイクロコ
ンピュータ内部の周辺回路(タイマ74など)からのデ
ータ転送要求PDREQ、又はCPUからのデータ転送
要求があったとき、チャネルコントロールレジスタのチ
ャネルイネーブルビットなどを参照して、そのデータ転
送要求に応答して起動すべきデータ転送チャネルが動作
可能かを判定する。更に、データ転送要求が競合する場
合には予め決められている優先順位に従って、起動すべ
き一つのデータ転送チャネルを判定する。データ転送要
求に応答すべき一つのデータ転送チャネルを決定する
と、バスステートコントローラ5に対してバス権要求信
号BREQをアサートしてバス権を要求する。バスステ
ートコントローラ5がバス権承認信号BACKをアサー
トすると、これによってDMAC8はバス権を獲得し、
DMAC8は、データ転送要求に応答するデータ転送制
御をバスステートコントローラ5を介して行う。バスス
テートコントローラ5は、DMAC8から供給されるア
ドレス信号のアドレスエリアなどに応じたメモリサイク
ル数でバスサイクルを起動する。
The DMAC 8 has, for example, four data transfer channels, and for each data transfer channel, a source address register in which a transfer source address is set, a destination address register in which a transfer destination address is set, and a transfer count. And a channel control register for setting a data transfer control mode and the like. Initial setting of the data transfer control information for the register is performed by the CPU 3 or the like. The control unit of the DMAC 8 is a microcomputer 2
When there is a data transfer request DREQ from outside the CPU 31, a data transfer request PDREQ from a peripheral circuit (such as the timer 74) inside the microcomputer, or a data transfer request from the CPU, the channel enable bit of the channel control register is referred to. Then, it is determined whether the data transfer channel to be activated in response to the data transfer request is operable. Further, when the data transfer requests conflict, one data transfer channel to be started is determined according to a predetermined priority. When one data transfer channel to respond to the data transfer request is determined, a bus right request signal BREQ is asserted to the bus state controller 5 to request a bus right. When the bus state controller 5 asserts the bus right acknowledge signal BACK, this causes the DMAC 8 to acquire the bus right,
The DMAC 8 controls data transfer in response to the data transfer request via the bus state controller 5. The bus state controller 5 starts the bus cycle with the number of memory cycles according to the address area of the address signal supplied from the DMAC 8 and the like.

【0022】DMAC8は、デュアルアドレスモードと
シングルアドレスモードのデータ転送モードを有する。
双方の動作モードは、よく知られているように、デュア
ルアドレスモードは転送先及び転送元の双方のデバイス
にアドレスを指定してデータ転送を行なう動作であり、
シングルアドレスモードは転送先又は転送元の一方のデ
バイスだけアドレス指定を行なってデータ転送を行なう
動作である。前者はメモリマップドデバイス同士のデー
タ転送であり、後者はメモリマップドデバイスとI/O
デバイスとの間のデータ転送である。
The DMAC 8 has a data transfer mode of a dual address mode and a single address mode.
As is well known, both operation modes are operations in which a dual address mode performs data transfer by designating an address to both a transfer destination device and a transfer source device.
The single address mode is an operation of performing data transfer by specifying an address only for one of the transfer destination and transfer source devices. The former is for data transfer between memory mapped devices, and the latter is for data transfer between memory mapped devices and I / O.
Data transfer to and from the device.

【0023】上記バスステートコントローラ5は、CP
U3やDMAC8によるアクセス対象とされる回路のア
ドレスエリアに応じて、アクセスデータサイズ、アクセ
スタイム、後述する内部ウェイトステート数及びアイド
ルウェイトステート数を決定し、周辺バスバス56,5
7、そして外部バス60,61に対するバスアクセスを
制御する。更にバスステートコントローラ5は、キャッ
シュTLBコントローラ44及びDMAC8からのバス
使用要求の競合を調停したりする。バスステートコント
ローラ5はデータバッファ58を有する。データバッフ
ァ58は、内部バス50,51、周辺バス56,57、
外部バス60,61に接続される回路の動作速度の差を
吸収するために転送データを一時的にラッチする。更
に、DMAC8によるデータ転送制御では、DMAC8
はデータバッファ58にラッチされたデータを採り込ま
ず、データバッファ58から転送先にデータを転送し、
DMAC8とデータバッファ58との間の無駄なデータ
転送を省くようにデータ転送を行なう。
The bus state controller 5 includes a CP
The access data size, the access time, the number of internal wait states and the number of idle wait states, which will be described later, are determined in accordance with the address area of the circuit to be accessed by the U3 or the DMAC 8, and the peripheral buses 56, 5
7, and control the bus access to the external buses 60 and 61. Further, the bus state controller 5 arbitrates contention for a bus use request from the cache TLB controller 44 and the DMAC 8. The bus state controller 5 has a data buffer 58. The data buffer 58 includes internal buses 50 and 51, peripheral buses 56 and 57,
Transfer data is temporarily latched in order to absorb a difference in operation speed between circuits connected to the external buses 60 and 61. Further, in the data transfer control by the DMAC 8, the DMAC 8
Transfers the data from the data buffer 58 to the transfer destination without taking in the data latched in the data buffer 58,
Data transfer is performed such that useless data transfer between DMAC 8 and data buffer 58 is omitted.

【0024】上記CPU3は、命令をフェッチするとき
32ビットの命令アドレスバス30に命令アドレスを出
力し、命令データバス31に出力された命令をフェッチ
する。また、CPU3は、32ビットのデータアドレス
バス32にデータアドレスを出力し、32ビットのデー
タバス33を介してデータのリード(ロード)を行い、
32ビットのデータバス34を介してデータのライト
(ストア)を行う。上記命令アドレス及びデータアドレ
スは論理アドレスである。
When fetching an instruction, the CPU 3 outputs an instruction address to a 32-bit instruction address bus 30 and fetches the instruction output to an instruction data bus 31. The CPU 3 outputs a data address to the 32-bit data address bus 32 and reads (loads) data via the 32-bit data bus 33.
Data is written (stored) via a 32-bit data bus 34. The instruction address and the data address are logical addresses.

【0025】上記FPU2は、特に制限されないが、デ
ータキャッシュメモリ42などをアクセスするためのメ
モリアドレシング能力を備えていない。CPU3がFP
U2に代わってデータをアクセスするためのアドレシン
グ動作を行う。これは、FPU2のメモリアドレシング
回路の必要性を取り除いてチップ面積を節約するためで
ある。FPU2へのデータのロードは32ビットのデー
タバス33と32ビットのデータバス35を介して行
い、FPU2からのデータのストアは64ビットのデー
タバス36を介して行う。FPU2からCPU3へのデ
ータ転送は上記64ビットデータバス36の下位32ビ
ットを用いて行われる。
The FPU 2 is not particularly limited, but does not have a memory addressing capability for accessing the data cache memory 42 and the like. CPU3 is FP
An addressing operation for accessing data is performed in place of U2. This is to eliminate the need for the memory addressing circuit of the FPU 2 and save chip area. Loading of data to the FPU 2 is performed via a 32-bit data bus 33 and a 32-bit data bus 35, and storage of data from the FPU 2 is performed via a 64-bit data bus 36. Data transfer from the FPU 2 to the CPU 3 is performed using the lower 32 bits of the 64-bit data bus 36.

【0026】CPU3はFPU2のためにデータフェッ
チを行なうだけでなく、FPU2のための浮動小数点命
令を含む全ての命令をフェッチする。CPU3がフェッ
チした浮動小数点命令は32ビットのデータバス34を
介してCPU3からFPU2に与えられる。
CPU 3 not only fetches data for FPU 2 but also fetches all instructions for FPU 2 including floating point instructions. The floating-point instruction fetched by the CPU 3 is supplied from the CPU 3 to the FPU 2 via a 32-bit data bus 34.

【0027】マイクロコンピュータ231は、特に制限
されないが、32ビットの仮想アドレスで規定される仮
想アドレス空間と29ビットの物理アドレスで規定され
る物理アドレス空間を扱う。仮想アドレスを物理アドレ
スに変換するためのアドレス変換情報は仮想ページ番号
とそれに対応される物理ページ番号を含んでいる。アド
レス変換テーブルはマイクロコンピュータ231の外部
に配置されたSDRAM232に形成される。アドレス
変換テーブルのアドレス変換情報のうち、最近利用され
たものが上記命令TLB40とユニファイドTLB41
に格納されることになる。その制御は、例えばオペレー
ティングシステム(OS)が行う。
Although not particularly limited, the microcomputer 231 handles a virtual address space defined by a 32-bit virtual address and a physical address space defined by a 29-bit physical address. Address conversion information for converting a virtual address to a physical address includes a virtual page number and a corresponding physical page number. The address conversion table is formed in the SDRAM 232 arranged outside the microcomputer 231. Of the address translation information in the address translation table, the one recently used is the instruction TLB 40 and the unified TLB 41.
Will be stored. The control is performed by, for example, an operating system (OS).

【0028】上記データ用のユニファイドTLB41は
データ及び命令のアドレス変換情報を最大64エントリ
格納する。このユニファイドTLB41は、データフェ
ッチのためにCPU3がデータアドレスバス32に出力
する仮想アドレスの仮想ページ番号に応ずる物理ページ
番号をアドレス変換情報から連想検索して、その仮想ア
ドレスを物理アドレスに変換する。
The data unified TLB 41 stores up to 64 entries of address conversion information of data and instructions. The unified TLB 41 performs an associative search of the physical page number corresponding to the virtual page number of the virtual address output to the data address bus 32 by the CPU 3 for data fetch from the address conversion information, and converts the virtual address into a physical address. .

【0029】上記命令用の命令TLB40は命令専用の
アドレス変換情報を最大4エントリ格納する。特に命令
TLB40が保有するエントリは、ユニファイドTLB
41が保有する命令アドレスのアドレス変換情報の一部
とされる。すなわち、連想検索により命令TLB40に
目的とするアドレス変換情報がないことが分かると、そ
のアドレス変換情報はユニファイドTLB41から命令
TLB40へ供給される。この命令TLB40は、命令
フェッチのためにCPU3が命令アドレスバス30に出
力する仮想アドレスの仮想ページ番号に応ずる物理ペー
ジ番号をアドレス変換情報から連想検索する。検索の結
果、目的とするアドレス変換情報がある場合(TLBヒ
ット)、そのアドレス変換情報を用いて、当該仮想アド
レスを物理アドレスに変換する。上記検索の結果、目的
とするアドレス変換情報がない場合(TLBミス)、上
記ユニファイドTLB41から目的とするアドレス変換
情報を得るための動作をキャッシュTLBコントローラ
44が制御する。
The instruction TLB 40 for instructions stores up to four entries of address conversion information dedicated to instructions. In particular, the entry held by the instruction TLB 40 is a unified TLB
41 is a part of the address conversion information of the instruction address held. That is, if it is found by the associative search that there is no target address translation information in the instruction TLB 40, the address translation information is supplied from the unified TLB 41 to the instruction TLB 40. The instruction TLB 40 performs an associative search from the address conversion information for a physical page number corresponding to a virtual page number of a virtual address output from the CPU 3 to the instruction address bus 30 for instruction fetch. As a result of the search, if there is target address translation information (TLB hit), the virtual address is translated into a physical address using the address translation information. As a result of the search, if there is no target address translation information (TLB miss), the cache TLB controller 44 controls an operation for obtaining the target address translation information from the unified TLB 41.

【0030】データキャッシュメモリ43においては、
データの記憶エリアと、そのデータに関連するアドレス
情報を記憶するタグエリアと、上記データの内容が更新
されたことを示すダーティビットと、上記データの有効
性を示すバリッドビットとを含んで一つのキャッシュブ
ロックが形成される。
In the data cache memory 43,
One area including a data storage area, a tag area for storing address information related to the data, a dirty bit indicating that the content of the data has been updated, and a valid bit indicating validity of the data. A cache block is formed.

【0031】オペレーティングシステムによって管理さ
れるタスクがCPU3によって実行されている場合にお
いて、上記データキャッシュメモリ43は、データフェ
ッチに際してユニファイドTLB41で変換された物理
アドレスを受け取り、これに基づいてキャッシュエント
リの連想検索を行う。検索結果がリードヒットであれ
ば、ヒットに係るキャッシュブロックからその物理アド
レスに応ずるデータがデータバス33又は35に出力さ
れる。検索結果がリードミスであれば、ミスに係るデー
タを含む1キャッシュブロック分のデータがバスステー
トコントローラ5を介してSDRAM232から読み込
まれて、キャッシュフィルが行われる。これによってキ
ャッシュミスに係るデータが上記バス33又は35に読
み出される。検索結果がライトヒットした場合、キャッ
シュ動作モードがライトバックモードならばヒットした
エントリにデータを書き込み、当該エントリのダーティ
ビットをセットする。セット状態のダーティビットによ
りSDRAM232のデータとの不整合状態が分かり、
上記キャッシュフィル動作で当該ダーティなキャッシュ
エントリがキャッシュメモリから追い出されるとき、S
DRAM232へのライトバックが行われる。ライトス
ルーモードではヒットしたエントリにデータを書き込む
と共にSDRAM232へのデータの書き込みも併せて
行われる。検索結果がライトミスである場合、コピーバ
ックモードならキャッシュフィルを行うと共にダーティ
ビットをセットしてタグアドレスを更新し、フィルを行
ったキャッシュブロックにデータを書き込む。ライトス
ルーモードの場合にはSDRAM232に対してのみ書
き込みを行う。
When a task managed by the operating system is being executed by the CPU 3, the data cache memory 43 receives the physical address converted by the unified TLB 41 at the time of data fetch, and based on the received physical address, associates the cache entry with the physical address. Perform a search. If the search result is a read hit, data corresponding to the physical address is output to the data bus 33 or 35 from the cache block related to the hit. If the search result is a read miss, data for one cache block including the data related to the miss is read from the SDRAM 232 via the bus state controller 5, and cache filling is performed. As a result, data relating to the cache miss is read out to the bus 33 or 35. When the search result is a write hit, if the cache operation mode is the write-back mode, data is written to the hit entry and the dirty bit of the entry is set. The dirty bit in the set state indicates the state of inconsistency with the data of the SDRAM 232,
When the dirty cache entry is evicted from the cache memory in the cache fill operation, S
Write back to the DRAM 232 is performed. In the write-through mode, data is written to the hit entry and data writing to the SDRAM 232 is also performed. If the search result is a write miss, the cache fill is performed in the copy back mode, the dirty bit is set, the tag address is updated, and the data is written to the cache block where the fill was performed. In the case of the write-through mode, writing is performed only on the SDRAM 232.

【0032】オペレーティングシステムによって管理さ
れるタスクがCPU3によって実行されていない場合に
は、後に詳述するように、上記ダーティビットが有効な
ブロックについてバリッドビットを有効とした状態でデ
ータキャッシュメモリ43のデータを上記SDRAM2
32にライトバックする。
When the task managed by the operating system is not executed by the CPU 3, as described later in detail, the data in the data cache memory 43 is stored in a state where the valid bit is valid for the block in which the dirty bit is valid. To SDRAM2
Write back to 32.

【0033】上記命令キャッシュメモリ42は、命令フ
ェッチに際して命令TLB40で変換された物理アドレ
スを受け取り、これに基づいてキャッシュエントリの連
想検索を行う。検索結果がリードヒットであれば、ヒッ
トに係るキャッシュブロックからその物理アドレスに応
ずる命令が命令データバス31に出力される。検索結果
がリードミスであれば、ミスに係る命令を含む1キャッ
シュブロック分のデータがバスステートコントローラ5
を介してSDRAM232から読み込まれて、キャッシ
ュフィルが行われる。これによってミスに係る命令が命
令データバス31を介してCPU3に与えられる。
The instruction cache memory 42 receives the physical address converted by the instruction TLB 40 at the time of instruction fetch, and performs an associative search for a cache entry based on the physical address. If the search result is a read hit, an instruction corresponding to the physical address is output to the instruction data bus 31 from the cache block related to the hit. If the search result is a read miss, the data for one cache block including the instruction related to the miss is stored in the bus state controller 5.
Is read from the SDRAM 232 to perform a cache fill. Thereby, the instruction relating to the miss is provided to the CPU 3 via the instruction data bus 31.

【0034】上記命令TLB40、ユニファイドTLB
41及びキャッシュTLBコントローラ44はメモリマ
ネージメントユニットを構成する。このメモリマネージ
メントユニットは、特権モード及びユーザモードのそれ
ぞれにおいて、仮想アドレス空間へのアクセス権を設定
して、記憶保護を行うことができる。例えばアドレス変
換情報は仮想アドレスページ番号毎に保護キーデータを
有する。保護キーデータはページのアクセス権をコード
で表した2ビットのデータであり、特権モードでのみ読
み出し可能、特権モードで読み出し及び書き込み可能、
特権及びユーザモードの双方で読み出しのみ可能、そし
て、特権モード及びユーザモードの双方で読み出し及び
書き込み可能の何れかのアクセス権が設定可能にされ
る。実際のアクセスタイプが上記保護キーデータで設定
されたアクセス権に違反する場合には、TLB保護違反
例外が発生される。TLB保護違反例外が発生された場
合、例えば、その保護違反を例外処理にて解決した後、
例外処理からの復帰命令を実行して、中断された通常処
理命令を再実行することになる。
The above-mentioned instruction TLB 40, unified TLB
41 and the cache TLB controller 44 constitute a memory management unit. This memory management unit can set the access right to the virtual address space in each of the privileged mode and the user mode to protect the memory. For example, the address conversion information has protection key data for each virtual address page number. The protection key data is 2-bit data representing a page access right by a code, and is readable only in the privileged mode, readable and writable in the privileged mode,
Only reading is possible in both the privileged mode and the user mode, and any of the read and write access rights is settable in both the privileged mode and the user mode. If the actual access type violates the access right set by the protection key data, a TLB protection violation exception is generated. When a TLB protection violation exception occurs, for example, after the protection violation is resolved by exception processing,
The return instruction from the exception processing is executed, and the interrupted normal processing instruction is executed again.

【0035】図3(a)には、オペレーティングシステ
ムによって管理されるタスクが実行されていない場合の
主要処理の流れが示される。
FIG. 3A shows a flow of main processing when a task managed by the operating system is not executed.

【0036】CPUの処理単位(タスク)を効率良く実
行管理するプログラムをスケジューラといい、これが起
動されることによりスケジューリング処理が可能にな
る。このスケジューリング処理が開始された後に実行で
きるタスクがあるか否かの判別が行われる(S31,S
32)。この判別において、実行できるタスクがある
(YES)と判断された場合には当該タスクが実行され
る(S33)。また、上記ステップS32の判別におい
て、実行できるタスクが無い(NO)と判断された場合
には、アイドル状態に入る前に、ライトバック処理が行
われる(S34)。そしてこのライトバック処理が行わ
れた後に、アイドル処理が行われ、この処理によりCP
U3は、消費電力低減のため低消費電力モードに移行さ
れる(S35)。この低消費電力モードにおいてイベン
トが発生した場合には、対応するタスクが実行される
(S36)。ここで、従来技術に従えば、実行すべきタ
スクが無い場合には、CPUは消費電力低減のためにア
イドル状態に移行されるが、本例においては、このアイ
ドル状態に移行される前に、SDRAM232へのライ
トバックが行われ、しかる後に、アイドル状態に移行さ
れる。これは、CPU3によってメモリアクセスが行わ
れていない期間を利用してライトバック処理を行うこと
により、キャッシングにおけるシステム性能低下を軽減
するためである。
A program for efficiently executing and managing the processing units (tasks) of the CPU is called a scheduler. When the program is started, a scheduling process becomes possible. It is determined whether there is a task that can be executed after the start of the scheduling process (S31, S31).
32). In this determination, when it is determined that there is a task that can be executed (YES), the task is executed (S33). If it is determined in step S32 that there is no executable task (NO), a write-back process is performed before entering the idle state (S34). After the write-back process is performed, an idle process is performed.
U3 is shifted to a low power consumption mode to reduce power consumption (S35). When an event occurs in the low power consumption mode, a corresponding task is executed (S36). Here, according to the related art, when there is no task to be executed, the CPU is shifted to an idle state in order to reduce power consumption, but in this example, before shifting to the idle state, Write-back to the SDRAM 232 is performed, and after that, the SDRAM 232 is shifted to an idle state. This is to reduce a decrease in system performance in caching by performing write-back processing using a period in which memory access is not performed by the CPU 3.

【0037】図3(b)には上記ライトバック処理(S
34)の流れが示される。
FIG. 3B shows the write-back processing (S
34) is shown.

【0038】ライトバック処理(S34)においては、
先ず1ブロック分のダーティビットがチェックされる
(S341)。このチェックにおいて、ダーティビット
の論理状態からダーティか否かの判別が行われる(S3
42)。上記ステップS342の判別において、ダーテ
ィである(YES)と判断された場合には、バリッドビ
ットを有効とした状態でそのブロックについてSDRA
M232へライトバックし、その後、当該ブロックにお
けるダーティビットをクリアする(S343)。そし
て、全てのブロックについての処理を完了したか否かの
判別が行われる(S344)。この判別において全ての
ブロックについての処理が完了していない(NO)と判
断された場合には、上記ステップS341の判別に戻
る。また、上記ステップS344の判別において全ての
ブロックについての処理が完了した(YES)と判断さ
れた場合には当該ライトバック処理が終了される。尚、
上記ステップS342の判別においてダーティではない
(NO)と判断された場合には、それはデータキャッシ
ュメモリ43のデータが更新されていないことを意味す
るから、上記ステップS343のライトバック処理を行
うことなしに、上記ステップS344の判別に移行され
る。
In the write-back process (S34),
First, dirty bits for one block are checked (S341). In this check, it is determined from the logic state of the dirty bit whether or not it is dirty (S3).
42). If it is determined in step S342 that the block is dirty (YES), the SDRA is performed on the block with the valid bit enabled.
Write back to M232, and then clear the dirty bit in the block (S343). Then, it is determined whether or not the processing has been completed for all the blocks (S344). If it is determined that the processing has not been completed for all the blocks (NO), the process returns to the determination in step S341. If it is determined in step S344 that the processing for all the blocks has been completed (YES), the write-back processing ends. still,
If it is determined in step S342 that the data is not dirty (NO), it means that the data in the data cache memory 43 has not been updated. Then, the process proceeds to the determination in step S344.

【0039】図2には、上記ステップS33においてタ
スクが実行されている場合の主要処理の流れが示され
る。
FIG. 2 shows the flow of main processing when the task is being executed in step S33.

【0040】CPU3から、あるアドレスに対する読み
出し、又は書き込みが要求されると(S11)、該当ア
ドレスのデータがデータキャッシュメモリ43上にある
か否かの判別が行われる(S12)。この判別におい
て、該当アドレスのデータがデータキャッシュメモリ4
3上にある(YES)と判断された場合には、読み出し
か書き込みかの判別が行われる。この判別において、
「読み出し」であると判断された場合にはデータキャッ
シュメモリ43上のデータがCPU3に渡される。ま
た、上記ステップS13の判別において書き込みである
と判断された場合には、データキャッシュメモリ43上
のデータをCPU3から受け取ったデータに変更する
(S15)。そして、該当ブロックに対してダーティビ
ットをセットし(S16)、CPU3からの要求待ち状
態になる(S24)。
When a read or write request for a certain address is requested from the CPU 3 (S11), it is determined whether or not the data of the address exists in the data cache memory 43 (S12). In this determination, the data of the corresponding address is stored in the data cache memory 4
3 (YES), it is determined whether the data is read or written. In this determination,
If it is determined to be “read”, the data on the data cache memory 43 is passed to the CPU 3. If it is determined in step S13 that the data is to be written, the data in the data cache memory 43 is changed to the data received from the CPU 3 (S15). Then, the dirty bit is set for the corresponding block (S16), and the system waits for a request from the CPU 3 (S24).

【0041】また、上記ステップS12の判別におい
て、該当アドレスのデータがデータキャッシュメモリ4
3上には無い(NO)と判断された場合には、入れ替え
を行うキャッシュメモリブロックの選択が行われる(S
17)。そして、該当ブロックはダーティか否かの判別
が行われる(S18)。この判別において、該当ブロッ
クはダーティである(YES)と判断された場合には、
該当ブロックのデータがSDRAM232に書き戻され
る(S19)。そして、SDRAM232から該当アド
レスデータがキャッシュメモリブロック分読み出され
(S20)、上記ステップS13の判別に移行される。
In the determination in step S12, the data at the corresponding address is
3 (NO), a cache memory block to be replaced is selected (S3).
17). Then, it is determined whether the corresponding block is dirty (S18). In this determination, when it is determined that the corresponding block is dirty (YES),
The data of the corresponding block is written back to the SDRAM 232 (S19). Then, the corresponding address data for the cache memory block is read from the SDRAM 232 (S20), and the process proceeds to the determination in step S13.

【0042】図9には上記マイクロコンピュータ231
でのメモリアクセスの様子が示される。
FIG. 9 shows the microcomputer 231.
Shows the state of the memory access in.

【0043】図9に示されるように、CPU3によって
SDRAM232における第1ブロックへのアクセスが
行われ、このとき、データキャッシュメモリ43のデー
タが変更されたものとすると、実行できるタスクが無く
なったときに、アイドル状態に入る前にライトバックが
行われる。このようにライトバックが行われることか
ら、次のイベントが発生した場合には、SDRAM2
32における第1ブロックへのライトバックを行うこと
なしにSDRAM232における第2ブロックへのアク
セスが可能とされるので、ライトバックに起因する性能
低下を軽減することができる。
As shown in FIG. 9, when the first block in the SDRAM 232 is accessed by the CPU 3 and the data in the data cache memory 43 is changed at this time, when there is no task that can be executed, Write-back is performed before entering the idle state. Since the write-back is performed in this manner, when the next event occurs, the SDRAM 2
Since it is possible to access the second block in the SDRAM 232 without performing the write-back to the first block in 32, it is possible to reduce the performance degradation due to the write-back.

【0044】上記した例によれば、以下の作用効果を得
ることができる。
According to the above example, the following functions and effects can be obtained.

【0045】(1)CPU3によってSDRAM232
における第1ブロックへのアクセスが行われ、このと
き、データキャッシュメモリ43のデータが変更された
ものとすると、実行できるタスクが無くなったときに、
アイドル状態に入る前にライトバックが行われるため、
次のイベントが発生した場合には、SDRAM232
における第1ブロックへのライトバックを行うことなし
にSDRAM232における第2ブロックへのアクセス
が可能とされるので、ライトバックに起因するシステム
性能低下を軽減することができる。つまり、CPU3に
よって実行できるタスクが無くなったとき、直ぐにアイ
ドル状態に移行させるのではなく、先ず、SDRAM2
32へのライトバックを行い、しかる後にアイドル状態
に移行させることにより、イベントの発生においてS
DRAM232のライトバックを行うこと無しに、SD
RAM232の新たなキャッシングが行われるため、ラ
イトバックに起因するシステム性能低下を軽減すること
ができる。
(1) SDRAM 232 by CPU 3
Is accessed at this time, and at this time, assuming that the data in the data cache memory 43 has been changed, when there is no longer any task that can be executed,
Because write back is performed before entering the idle state,
When the next event occurs, the SDRAM 232
It is possible to access the second block in the SDRAM 232 without performing the write-back to the first block in the above, so that a decrease in system performance due to the write-back can be reduced. That is, when there are no more tasks that can be executed by the CPU 3, the CPU 3 does not immediately shift to the idle state.
32, and then transitions to the idle state, so that S
Without writing back the DRAM 232, the SD
Since new caching of the RAM 232 is performed, a decrease in system performance due to write-back can be reduced.

【0046】(2)オペレーティングシステムによって
上記ライトバックが制御されるので、オペレーティング
システムを変更すれば良く、マイクロコンピュータ23
1のハードウェアの構成変更を伴わずに済む。
(2) Since the write back is controlled by the operating system, the operating system may be changed, and the microcomputer 23
No change in hardware configuration is required.

【0047】以上本発明者によってなされた発明を具体
的に説明したが、本発明はそれに限定されるものではな
く、その要旨を逸脱しない範囲で種々変更可能であるこ
とはいうまでもない。
Although the invention made by the present inventor has been specifically described above, the present invention is not limited to this, and it goes without saying that various modifications can be made without departing from the gist of the invention.

【0048】例えば、ハードウェアによってライトバッ
ク処理を行うことができる。図4には、ハードウェアに
よってライトバック処理を行う場合のマイクロコンピュ
ータの主要構成が示される。尚、図4においてはキャッ
シュTLBコントローラ44以外の構成は、図1に示さ
れるのと同様とされる。
For example, write-back processing can be performed by hardware. FIG. 4 shows a main configuration of a microcomputer when the write-back processing is performed by hardware. In FIG. 4, the configuration other than the cache TLB controller 44 is the same as that shown in FIG.

【0049】図4に示されるマイクロコンピュータ23
1においては、キャッシュコントローラ44として、ラ
イトバック制御回路44a、バス状態制御回路44b、
キャッシュ制御回路44cとを含んで成るものが適用さ
れている。
The microcomputer 23 shown in FIG.
1, the cache controller 44 includes a write-back control circuit 44a, a bus state control circuit 44b,
A configuration including the cache control circuit 44c is applied.

【0050】バス状態監視回路44bはバスコントロー
ラ5のコントロール状態からバスの状態を監視すること
により、CPU3によってSDRAM232がアクセス
されていない期間を検出する。ライトバック制御回路4
4aは、データキャッシュメモリ43にダーティブロッ
クが存在する場合に、上記バス状態監視回路44bによ
るバス監視結果に基づいて、SDRAM232がアクセ
スされていない期間にキャッシュ制御回路44cに対し
てライトバック指令信号を与える。キャッシュ制御回路
44cには、データキャッシュメモリ43に一つでもダ
ーティなブロックがあることを示すフラグを保持するた
めのレジスタが含まれる。キャッシュメモリ43内のブ
ロックがダーティにされる際、上記フラグがセットされ
る。従って、上記ダーティブロックが存在するか否か
は、キャッシュ制御回路44c内の上記フラグの状態に
よって知ることができる。ライトバック制御回路44a
は、上記キャッシュ制御回路44c内の上記フラグ状態
に従って、ライトバック制御を開始する。このライトバ
ック制御において、バス状態監視回路44bによるバス
監視結果に基づいてライトバック指示信号をアサートす
る。キャッシュ制御回路44cは、キャッシュTLBコ
ントローラとしての基本的な制御機能を備えている。キ
ャッシュ制御回路44cは、上記ライトバック制御回路
44aから与えられたライトバック指示信号に基づいて
データキャッシュメモリ43のライトバックを制御す
る。
The bus state monitoring circuit 44b detects a period during which the SDRAM 232 is not being accessed by the CPU 3 by monitoring the state of the bus from the control state of the bus controller 5. Write-back control circuit 4
4a, when a dirty block exists in the data cache memory 43, a write-back command signal to the cache control circuit 44c during a period in which the SDRAM 232 is not accessed, based on the bus monitoring result by the bus state monitoring circuit 44b. give. The cache control circuit 44c includes a register for holding a flag indicating that at least one dirty block exists in the data cache memory 43. When a block in the cache memory 43 is dirty, the flag is set. Therefore, whether or not the dirty block exists can be known from the state of the flag in the cache control circuit 44c. Write-back control circuit 44a
Starts write-back control in accordance with the flag state in the cache control circuit 44c. In this write-back control, a write-back instruction signal is asserted based on the bus monitoring result by the bus state monitoring circuit 44b. The cache control circuit 44c has a basic control function as a cache TLB controller. The cache control circuit 44c controls the write back of the data cache memory 43 based on the write back instruction signal given from the write back control circuit 44a.

【0051】図5には、図4に示されるキャッシュコン
トローラ44の動作の流れが示される。
FIG. 5 shows a flow of the operation of the cache controller 44 shown in FIG.

【0052】CPU3から、あるアドレスに対する読み
出し、又は書き込みが要求されると(S11)、該当ア
ドレスのデータがデータキャッシュメモリ43上にある
か否かの判別が行われる(S12)。この判別におい
て、該当アドレスのデータがデータキャッシュメモリ4
3上にある(YES)と判断された場合には、読み出し
か書き込みかの判別が行われる。この判別において、
「読み出し」であると判断された場合にはデータキャッ
シュメモリ43上のデータがCPU3に渡される。ま
た、上記ステップS13の判別において書き込みである
と判断された場合には、データキャッシュメモリ43上
のデータをCPU3から受け取ったデータに変更する
(S15)。そして、該当ブロックに対してダーティビ
ットをセットし(S16)、CPU3からの要求待ち状
態になる(S24)。
When a read or write request for a certain address is requested from the CPU 3 (S11), it is determined whether or not the data of the address exists in the data cache memory 43 (S12). In this determination, the data of the corresponding address is stored in the data cache memory 4
3 (YES), it is determined whether the data is read or written. In this determination,
If it is determined to be “read”, the data on the data cache memory 43 is passed to the CPU 3. If it is determined in step S13 that the data is to be written, the data in the data cache memory 43 is changed to the data received from the CPU 3 (S15). Then, the dirty bit is set for the corresponding block (S16), and the system waits for a request from the CPU 3 (S24).

【0053】また、上記ステップS12の判別におい
て、該当アドレスのデータがデータキャッシュメモリ4
3上には無い(NO)と判断された場合には、入れ替え
を行うキャッシュメモリブロックの選択が行われる(S
17)。そして、該当ブロックはダーティか否かの判別
が行われる(S18)。この判別において、該当ブロッ
クはダーティである(YES)と判断された場合には、
該当ブロックのデータがSDRAM232に書き戻され
る(S19)。そして、SDRAM232から該当アド
レスデータがキャッシュメモリブロック分読み出され
(S20)、上記ステップS13の判別に移行される。
In the determination in step S12, the data at the corresponding address is
3 (NO), a cache memory block to be replaced is selected (S3).
17). Then, it is determined whether the corresponding block is dirty (S18). In this determination, when it is determined that the corresponding block is dirty (YES),
The data of the corresponding block is written back to the SDRAM 232 (S19). Then, the corresponding address data for the cache memory block is read from the SDRAM 232 (S20), and the process proceeds to the determination in step S13.

【0054】一方、バス状態監視回路44bによって外
部アドレスバス60の状態が監視されており、それによ
ってSDRAM232がCPU3によってアクセスされ
ていない期間を把握することができる。ライトバック制
御回路44aは、バス状態監視回路44bによって、S
DRAM232がアクセス中でないことが確認された場
合にライトバック指示信号をアサートする。これによ
り、キャッシュ制御回路44cは、ダーティブロックは
存在するか否かの判別を行う(S22)。この判別にお
いてダーティブロックは存在する(Yes)と判断され
た場合には、キャッシュブロックのバリッドビットを有
効とした状態のままSDRAM232にライトバック
し、その後、対応するダーティビットのフラグをクリア
する(S23)。また、上記ステップS22の判別にお
いて、ダーティなブロックは存在しないと判断された場
合には、上記ステップS23のライトバックを行わず
に、CPU3からの次の要求待ち状態に移行される(S
23)。
On the other hand, the status of the external address bus 60 is monitored by the bus status monitoring circuit 44b, whereby it is possible to know the period during which the SDRAM 232 is not being accessed by the CPU 3. The write-back control circuit 44a uses the bus state monitoring circuit 44b to
When it is confirmed that the DRAM 232 is not being accessed, the write back instruction signal is asserted. As a result, the cache control circuit 44c determines whether a dirty block exists (S22). If it is determined in this determination that a dirty block exists (Yes), write back to the SDRAM 232 with the valid bit of the cache block being valid, and then clear the flag of the corresponding dirty bit (S23). ). If it is determined in step S22 that there is no dirty block, the process shifts to a state of waiting for the next request from the CPU 3 without performing the write-back in step S23 (S23).
23).

【0055】このようにSDRAM232がアクセスさ
れていない期間を利用してライトバックが行われるた
め、例えば図9に示されるようにイベントが発生され
た際に、ライトバックを行わずに済むので、ライトバッ
クに起因するシステムの性能低下を軽減することができ
る。
As described above, since the write-back is performed using the period during which the SDRAM 232 is not accessed, for example, as shown in FIG. 9, when an event occurs, it is not necessary to perform the write-back. It is possible to reduce the performance degradation of the system due to the back.

【0056】以上の説明では主として本発明者によって
なされた発明をその背景となった利用分野であるRIS
Cアーキテクチャを有するマイクロコンピュータに適用
した場合について説明したが、本発明はそれに限定され
るものではなく、各種マイクロコンピュータに広く適用
することができる。
In the above description, the invention made mainly by the present inventor is described in the field of application RIS, which is the background of the invention.
The case where the present invention is applied to a microcomputer having the C architecture has been described, but the present invention is not limited to this, and can be widely applied to various microcomputers.

【0057】本発明は、少なくともキャッシュシステム
を有することを条件に適用することができる。
The present invention can be applied on the condition that it has at least a cache system.

【0058】[0058]

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

【0059】すなわち、オペレーティングシステムによ
って管理されるタスクが実行されていない期間に、ダー
ティビットが有効なブロックについてバリッドビットを
有効とした状態でキャッシュメモリのデータをメモりに
ライトバックする。連続する二つのイベントが互いに異
なる場合には、前回使用した第1ブロックのデータとは
異なる第2ブロックについてのキャッシングが必要にな
るが、上記のようにオペレーティングシステムによって
管理されるタスクが実行されていない期間にライトバッ
ク処理が実行されるようになっているため、上記第2ブ
ロックについてのキャッシングの直前において、前回使
用したキャッシュ内容をライトバックするケースが減少
され、それによってシステムの性能低下が軽減される。
That is, while the task managed by the operating system is not being executed, the data in the cache memory is written back to the memory with the valid bit being valid for the block where the dirty bit is valid. If two consecutive events are different from each other, caching is required for a second block different from the data of the first block used last time, but the task managed by the operating system is being executed as described above. Since the write-back process is executed during the non-period, the number of cases in which the previously used cache contents are written back immediately before caching for the second block is reduced, thereby reducing the system performance degradation. Is done.

【0060】また、メモリアクセスに使用されるバスの
監視を行うことで、中央処理装置によってメモリがアク
セスされていない期間を検出し、上記メモリがアクセス
されていない期間にライトバック処理を行うことによ
り、前回使用した第1ブロックのデータとは異なる第2
ブロックについてのキャッシングが必要になる場合にお
いて、前回使用したキャッシュ内容を当該キャッシング
の直前にライトバックするケースが減少されるから、そ
の分、システムの性能低下が軽減される。
Further, by monitoring a bus used for memory access, a period during which the central processing unit does not access the memory is detected, and a write-back process is performed during the period when the memory is not accessed. , A second block different from the data of the first block used last time
When caching is required for a block, the number of cases in which the cache contents used last time are written back immediately before the caching is reduced, so that the performance degradation of the system is reduced accordingly.

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

【図1】本発明にかかるマイクロコンピュータの構成例
ブロック図である。
FIG. 1 is a block diagram illustrating a configuration example of a microcomputer according to the present invention.

【図2】上記マイクロコンピュータにおいてオペレーテ
ィングシステムによって管理されるタスクが実行される
場合のフローチャートである。
FIG. 2 is a flowchart when a task managed by an operating system is executed in the microcomputer.

【図3】上記マイクロコンピュータにおいてオペレーテ
ィングシステムによって管理されるタスクが実行されて
いない場合のフローチャートである。
FIG. 3 is a flowchart when a task managed by an operating system is not executed in the microcomputer.

【図4】本発明にかかるマイクロコンピュータの別の構
成例ブロック図である。
FIG. 4 is a block diagram illustrating another configuration example of the microcomputer according to the present invention.

【図5】図4に示されるマイクロコンピュータにおける
主要動作のフローチャートである。
FIG. 5 is a flowchart of a main operation in the microcomputer shown in FIG. 4;

【図6】マイクロコンピュータにおけるCPUの状態説
明図である。
FIG. 6 is an explanatory diagram of a state of a CPU in the microcomputer.

【図7】マイクロコンピュータにおけるCPUの別の状
態説明図である。
FIG. 7 is another state explanatory diagram of the CPU in the microcomputer.

【図8】マイクロコンピュータにおけるCPUの別の状
態説明図である。
FIG. 8 is another state explanatory diagram of the CPU in the microcomputer.

【図9】本発明にかかるマイクロコンピュータにおける
メモリアクセスの状態例説明図である。
FIG. 9 is a diagram illustrating an example of a state of memory access in the microcomputer according to the present invention.

【図10】上記マイクロコンピュータが適用されるデー
タ処理装置の全体的な構成例ブロック図である。
FIG. 10 is a block diagram illustrating an overall configuration example of a data processing device to which the microcomputer is applied.

【符号の説明】[Explanation of symbols]

3 CPU 4 アドレス変換・キャッシュユニット 5 バスステートコントローラ 6 外部バスインタフェース 40 命令TLB 41 ユニファイドTLB 42 命令キャッシュメモリ 43 データキャッシュメモリ 44 キャッシュTLBコントローラ 44a ライトバック制御回路 44b バス状態監視回路 44c キャッシュ制御回路 231 マイクロコンピュータ 232 SDRAM 234 ROM 235 周辺装置制御部 236 表示制御部 237 ディスプレイ 238 外部記憶装置 239 キーボード 3 CPU 4 Address conversion / cache unit 5 Bus state controller 6 External bus interface 40 Instruction TLB 41 Unified TLB 42 Instruction cache memory 43 Data cache memory 44 Cache TLB controller 44a Write-back control circuit 44b Bus state monitoring circuit 44c Cache control circuit 231 Microcomputer 232 SDRAM 234 ROM 235 Peripheral device control unit 236 Display control unit 237 Display 238 External storage device 239 Keyboard

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 データの記憶エリアと、そのデータに関
連するアドレス情報を記憶するタグエリアと、上記デー
タの内容が更新されたことを示すダーティビットと、上
記データの有効性を示すバリッドビットとを含んで一つ
のキャッシュブロックが形成され、上記データが格納さ
れたメモリのリードキャッシュ及びライトキャッシュを
可能とするキャッシュシステムと、 オペレーティングシステムによって管理されるタスクが
実行されていない期間に、上記ダーティビットが有効な
ブロックについてバリッドビットを有効とした状態でキ
ャッシュシステムのデータを上記メモリにライトバック
可能な中央処理装置と、を含むこと特徴とするマイクロ
コンピュータ。
1. A storage area for data, a tag area for storing address information related to the data, a dirty bit indicating that the content of the data has been updated, and a valid bit indicating validity of the data. And a cache system that enables a read cache and a write cache of a memory in which the data is stored, and a dirty bit during a period in which a task managed by an operating system is not executed. And a central processing unit capable of writing back the data of the cache system to the memory in a state where the valid bit of the block is valid.
【請求項2】 中央処理装置と、 上記中央処理装置によってアクセス可能なメモリのリー
ドキャッシュ及びライトキャッシュが可能とされるキャ
ッシュシステムと、を含むマイクロコンピュータであっ
て、 キャッシュシステムは、上記メモリアクセスに使用され
るバスの監視を行うことで、上記中央処理装置によって
上記メモリがアクセスされていない期間を検出可能なバ
ス状態監視回路と、 上記バス状態監視回路の検出結果に基づいて、上記メモ
リがアクセスされていない期間にライトバック処理の開
始を指示するライトバック制御回路と、を含んで成るこ
とを特徴とするマイクロコンピュータ。
2. A microcomputer comprising: a central processing unit; and a cache system capable of performing a read cache and a write cache of a memory accessible by the central processing unit. A bus state monitoring circuit capable of detecting a period during which the memory is not accessed by the central processing unit by monitoring a bus used; and accessing the memory based on a detection result of the bus state monitoring circuit. A write-back control circuit for instructing the start of a write-back process during a period in which the write-back process is not performed.
【請求項3】 上記ライトバック制御回路は、上記キャ
ッシュシステムにダーティなブロックが存在することを
示すフラグを設定可能なレジスタを含み、上記ライトバ
ック制御回路は、上記レジスタに設定されたフラグの状
態に従ってライトバック制御を開始する請求項2記載の
マイクロコンピュータ。
3. The write-back control circuit includes a register capable of setting a flag indicating that a dirty block exists in the cache system, and the write-back control circuit sets a state of the flag set in the register. 3. The microcomputer according to claim 2, wherein write-back control is started according to the following.
【請求項4】 請求項1乃至3の何れか1項記載のマイ
クロコンピュータと、上記マイクロコンピュータの外部
に配置され、上記マイクロコンピュータによってアクセ
ス可能なメモリとを含んで成るデータ処理装置。
4. A data processing device comprising: the microcomputer according to claim 1; and a memory arranged outside the microcomputer and accessible by the microcomputer.
JP2000303491A 2000-10-03 2000-10-03 Microcomputer and data processor Withdrawn JP2002108702A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000303491A JP2002108702A (en) 2000-10-03 2000-10-03 Microcomputer and data processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000303491A JP2002108702A (en) 2000-10-03 2000-10-03 Microcomputer and data processor

Publications (1)

Publication Number Publication Date
JP2002108702A true JP2002108702A (en) 2002-04-12

Family

ID=18784684

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000303491A Withdrawn JP2002108702A (en) 2000-10-03 2000-10-03 Microcomputer and data processor

Country Status (1)

Country Link
JP (1) JP2002108702A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006524850A (en) * 2003-04-04 2006-11-02 ペーアーツェーテー イクスペーペー テクノロジーズ アクチエンゲゼルシャフト Data processing method and data processing apparatus
US8892819B2 (en) 2010-06-23 2014-11-18 Fujitsu Limited Multi-core system and external input/output bus control method
US9703704B2 (en) 2012-05-01 2017-07-11 Semiconductor Energy Laboratory Co., Ltd. Semiconductor device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006524850A (en) * 2003-04-04 2006-11-02 ペーアーツェーテー イクスペーペー テクノロジーズ アクチエンゲゼルシャフト Data processing method and data processing apparatus
US8892819B2 (en) 2010-06-23 2014-11-18 Fujitsu Limited Multi-core system and external input/output bus control method
US9703704B2 (en) 2012-05-01 2017-07-11 Semiconductor Energy Laboratory Co., Ltd. Semiconductor device

Similar Documents

Publication Publication Date Title
JP3285644B2 (en) Data processor with cache memory
US5787486A (en) Bus protocol for locked cycle cache hit
JP3158161B2 (en) Integrated cache unit and method for caching interlock variables in integrated cache unit
US5185878A (en) Programmable cache memory as well as system incorporating same and method of operating programmable cache memory
US6591340B2 (en) Microprocessor having improved memory management unit and cache memory
US5025366A (en) Organization of an integrated cache unit for flexible usage in cache system design
JP4162825B2 (en) Microprocessor
JP3016575B2 (en) Multiple cache memory access methods
US6629207B1 (en) Method for loading instructions or data into a locked way of a cache memory
KR100228940B1 (en) Method for maintaining memory coherency in a computer system having a cache
JP2000250813A (en) Data managing method for i/o cache memory
JP3136257B2 (en) Computer memory interface device
EP0408058A2 (en) Microprocessor
JP4803983B2 (en) Arithmetic processing unit
JP2018511120A (en) Cache maintenance instruction
KR19990044934A (en) Data Processing System and Microcomputer
JP3841810B2 (en) Data processor
KR100710922B1 (en) Set-associative cache-management method using parallel reads and serial reads initiated while processor is waited
US6553460B1 (en) Microprocessor having improved memory management unit and cache memory
JP4160228B2 (en) Microprocessor
JPH03163640A (en) Multi-processor system and cache memory used therefor
JP2002108702A (en) Microcomputer and data processor
JP4024247B2 (en) Semiconductor data processor
JP3445873B2 (en) Data prefetch method and information processing apparatus therefor
JPH07282023A (en) Data transfer amount variable processor and system using the same

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20071204