JPH113246A - Microcomputer containing cache memory - Google Patents

Microcomputer containing cache memory

Info

Publication number
JPH113246A
JPH113246A JP9156412A JP15641297A JPH113246A JP H113246 A JPH113246 A JP H113246A JP 9156412 A JP9156412 A JP 9156412A JP 15641297 A JP15641297 A JP 15641297A JP H113246 A JPH113246 A JP H113246A
Authority
JP
Japan
Prior art keywords
cache
data
microcomputer
timing
cache memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP9156412A
Other languages
Japanese (ja)
Inventor
Yoshio Takakura
良夫 高倉
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.)
NEC IC Microcomputer Systems Co Ltd
Original Assignee
NEC IC Microcomputer Systems Co 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 NEC IC Microcomputer Systems Co Ltd filed Critical NEC IC Microcomputer Systems Co Ltd
Priority to JP9156412A priority Critical patent/JPH113246A/en
Publication of JPH113246A publication Critical patent/JPH113246A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To improve the performance of a system containing a microcomputer while keeping consistency between a cache and an external memory by preparing a monitoring means to monitor the accesses to an external shared memory of the microcomputer. SOLUTION: A monitor circuit 119 detects that an external bus master accesses an external shared memory and then permits the external writing to a data cache memory. In such cases, a write control circuit 117 can continuously store the data into the data cache. The circuit 117 also can output the execution address of the program stored in an instruction cache to the outside through a terminal MA3-MA2 based on the monitoring result, can invalidate the data stored in the cache via a comparator 106, a 3-input AND 107 and a timing generation circuit 112 and then can rewrite the data of the cache. As a result, the coincidence of contents is effectively secured between the cache and the external shared memory.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、キャッシュメモリ
を内蔵したマイクロコンピュータに関し、特に、データ
用キャッシュメモリ内容の1部を無効にする手段と、マ
イクロコンピュータ外部から内蔵キャッシュメモリに書
き込む手段と、プログラムの実行結果を残す手段に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer having a built-in cache memory, and more particularly, to a means for invalidating a part of the contents of a data cache memory, a means for writing to the built-in cache memory from outside the microcomputer, and a program. Related to the means for leaving the execution result.

【0002】[0002]

【従来の技術】図4は特開平5−250257号に開示
されたキャッシュメモリ(以下、「キャッシュ」とい
う)内蔵型マイクロコンピュータのブロック図である。
キャッシュ内蔵型マイクロコンピュータでは、外部に接
続したメモリ(以下、「外部メモリ」)と内蔵キャッシ
ュの値を一致させること(以下、「一貫性」)が要求さ
れる。このキャッシュはいくつかのブロックで構成され
る。マイクロコンピュータは外部メモリからデータを一
度取り込むと、キャッシュのデータが有効(以下、「キ
ャッシュヒット」)であるとき、キャッシュにあるデー
タを使用する。キャッシュは高速アクセスが可能である
為、マイクロコンピュータの性能が向上する事になる。
キャッシュにデータが無い(以下、「ミスヒット」)と
きは外部メモリからデータを1ブロック分取り込む。1
ブロック分の取り込みを行うのに時間がかかるため、連
続アクセスしてデータを取り込むマイクロコンピュータ
が存在する。
2. Description of the Related Art FIG. 4 is a block diagram of a microcomputer with a built-in cache memory (hereinafter referred to as "cache") disclosed in Japanese Patent Application Laid-Open No. 5-250257.
In a microcomputer with a built-in cache, it is required that the value of the memory connected to the outside (hereinafter, referred to as “external memory”) and the value of the built-in cache match (hereinafter, “coherence”). This cache is composed of several blocks. The microcomputer, once fetching data from the external memory, uses the data in the cache when the data in the cache is valid (hereinafter, “cache hit”). Since the cache can be accessed at a high speed, the performance of the microcomputer is improved.
When there is no data in the cache (hereinafter, "miss hit"), one block of data is fetched from the external memory. 1
Since it takes time to capture blocks, there are microcomputers that continuously access and capture data.

【0003】図4のマイクロコンピュータが採用してい
る一貫性の実現方法について説明する。マイクロコンピ
ュータがキャッシュに対して書き込みを行った時には2
つの方法が用いられている。一つはマイクロコンピュー
タが書き込み動作をした時、必ず外部メモリにも書き込
む方法で、ライトスルー方式という。もう一つはキャッ
シュのデータのみ書き換えておき、必要な時に、外部メ
モリにも書き込む方法で、ライトバック方式又はコピー
バック方式という。
A description will be given of a method of realizing the consistency employed in the microcomputer shown in FIG. 2 when the microcomputer writes to the cache
Two methods are used. One is a method of writing data to an external memory whenever a microcomputer performs a write operation, which is called a write-through method. The other is a method in which only the data in the cache is rewritten and written into an external memory when necessary.

【0004】次にリード動作における一貫性の問題につ
いて説明する。バスマスタがマイクロコンピュータ1台
だけの場合は、前記の書き込み方法でキャッシュと外部
メモリの一貫性が保たれている。しかし、バスマスタと
して他のマイクロコンピュータやDMAコントローラが
ある場合は、他のマイクロコンピュータやDMAコント
ローラにより、外部メモリのデータが書き換えられるこ
とになるため、キャッシュと外部メモリの一貫性が守ら
れないことになる。
Next, the problem of consistency in the read operation will be described. When there is only one bus master, the cache and the external memory are kept consistent by the above-mentioned writing method. However, if there is another microcomputer or DMA controller as the bus master, the data in the external memory will be rewritten by the other microcomputer or DMA controller, and the consistency between the cache and the external memory will not be maintained. Become.

【0005】また、キャッシュを有するマイクロコンピ
ュータには別の重要な問題がある。すなわち、キャッシ
ュに取り込まれたプログラムを実行する際、プログラム
の実行結果をトレースする情報がマイクロコンピュータ
の外部に出てこないことである。
There is another important problem with microcomputers having a cache. That is, when executing a program taken into the cache, information for tracing the execution result of the program does not come out of the microcomputer.

【0006】図4の事例では、以下に述べる方法によ
り、キャッシュと外部メモリの一貫性の問題と、プログ
ラムの実行結果トレースの問題を解決している。すなわ
ち、一貫性を保つためキャッシュを無効にする(以下、
「パージする」)方法を採用している。パージされれば
必ず外部メモリからデータが取り込まれ、一貫性が保た
れる。つまり、外部メモリからデータが取り込まれる際
は、必ずキャッシュのブロックサイズ分のデータが取り
込まれることになる。図4の端子MA31−MA2は、
通常はマイクロコンピュータがアクセスするときのアド
レスを出力するが、パージするときは入力になり、パー
ジするアドレスを入力する。キャッシュパージタイミン
グ信号MASTBがアクティブの期間にキャッシュの1
つのブロックをパージすることになる。
In the case of FIG. 4, the problem of coherence between the cache and the external memory and the problem of tracing the execution result of the program are solved by the following method. In other words, invalidate the cache for consistency (hereafter,
"Purge") method. When purged, data is always taken from the external memory, and consistency is maintained. That is, when data is fetched from the external memory, data of the cache block size is always fetched. The terminals MA31-MA2 in FIG.
Normally, the address at the time of access by the microcomputer is output, but when purging, it is input and the address to be purged is input. While the cache purge timing signal MASTB is active,
One block will be purged.

【0007】実行トレースの動作について説明する。図
4におけるトレース情報選択信号MEANは端子MA3
1−MA2に有効なアドレスが出力されていることを示
す信号である。キャッシュがヒットしたときには端子M
A31−MA2にアドレスが出力されるため、トレース
情報選択信号MEANはアクティブになる。ミスヒット
のときはインアクティブのままである。
The operation of the execution trace will be described. The trace information selection signal MEAN in FIG.
1-A signal indicating that a valid address is output to MA2. Terminal M when the cache hits
Since the address is output to A31-MA2, the trace information selection signal MEAN becomes active. In the case of a mishit, it remains inactive.

【0008】他の従来例として、モトローラ社のマイク
ロコンピュータMC68040の動作を説明する。図5
はのMC68040ブロック図である。MC68040
は、データ用キャッシュ、命令用キャッシュ、及びデー
タメモリユニット内に外部バス監視機能を持ち、マイク
ロコンピュータの外部からキャッシュのデータ書き換え
が可能な構成になっている。
As another conventional example, the operation of a microcomputer MC68040 manufactured by Motorola will be described. FIG.
Is a MC68040 block diagram of FIG. MC68040
Has an external bus monitoring function in the data cache, the instruction cache, and the data memory unit, and is configured to be able to rewrite the cache data from outside the microcomputer.

【0009】MC68040のスヌープコントローラは
外部からキャッシュに対して書き込みがあることを、バ
ス制御信号の状態と外部バスマスタが出力するアドレス
で知ることができる。外部からのキャッシュに対する書
き込みのとき、外部バスマスタが外部メモリにあるデー
タで、かつキャッシュに取り込んだデータを書き換えよ
うとすると、MC68040は外部バスマスタの外部メ
モリへのアクセスを禁止させ、キャッシュを外部に解放
し、キャッシュのデータを更新させるように動作する。
そして、外部メモリに書き戻す必要があるときはキャッ
シュのデータを書き戻す。これにより、外部メモリとキ
ャッシュの一貫性を保つ。しかし、MC68040はキ
ャッシュ内のプログラムを実行したときのプログラムの
実行結果を履歴に残す機能を備えていない。
[0009] The snoop controller of MC68040 can recognize that there is an external write to the cache by the state of the bus control signal and the address output from the external bus master. When the external bus master tries to rewrite the data fetched into the cache with the data in the external memory when writing to the cache from the outside, the MC68040 prohibits the external bus master from accessing the external memory and releases the cache to the outside. Then, it operates to update the data in the cache.
Then, when it is necessary to write back to the external memory, the data in the cache is written back. This keeps the external memory and cache consistent. However, the MC68040 does not have a function of leaving the execution result of the program when the program in the cache is executed in the history.

【0010】[0010]

【発明が解決しようとする課題】以上説明した従来技術
の問題点は、マイクロコンピュータを組み込んだ応用シ
ステムにおいて高性能が得られないという点である。そ
れは、外部バスマスタがマイクロコンピュータであり、
外部メモリの1バイトのフラグにより2つのマイクロコ
ンピュータの同期を取る場合は、1バイトデータを書き
換えただけでパージしなければならなくなるからであ
り、また、フラグをリードするときデータを1ブロック
分取り込まなければならないので外部バスの空き時間が
少なくなるからである。
The problem of the prior art described above is that high performance cannot be obtained in an application system incorporating a microcomputer. That is, the external bus master is a microcomputer,
This is because, when synchronizing the two microcomputers with the 1-byte flag of the external memory, it is necessary to purge only by rewriting the 1-byte data, and when reading the flag, the data for one block is fetched. This is because the free time of the external bus decreases.

【0011】一方、外部バスマスタとしてDMAコント
ローラを置いたシステムにおいて、キャッシュに取り込
んだデータをバーストモードで書き換える場合、DMA
転送時には、マイクロコンピュータ内部のデータアクセ
ス用バスは外部バスマスタに解放しているため使用でき
ない。マイクロコンピュータがキャッシュをアクセスす
るときは、このDMA転送が終了するまでプログラムの
実行を待たされることになる。
On the other hand, in a system having a DMA controller as an external bus master, when data fetched into a cache is rewritten in a burst mode,
At the time of transfer, the data access bus inside the microcomputer is released to the external bus master and cannot be used. When the microcomputer accesses the cache, execution of the program is waited until the DMA transfer is completed.

【0012】本発明の課題は、データ用と命令用の、少
なくとも2つのキャッシュを内蔵するキャッシュメモリ
内蔵型マイクロコンピュータにおいて、キャッシュと外
部メモリの一貫性を保ちつつマイクロコンピュータを組
み込んだシステムの性能を向上させること、及びキャッ
シュに取り込まれたプログラムの実行結果を履歴に残せ
るようにすることである。
SUMMARY OF THE INVENTION It is an object of the present invention to provide a microcomputer with a built-in cache memory having at least two caches for data and instructions, and to improve the performance of a system incorporating the microcomputer while maintaining consistency between the cache and the external memory. And to enable the execution result of the program taken into the cache to be recorded in the history.

【0013】[0013]

【課題を解決するための手段】上記の課題は、マイクロ
コンピュータ外部の共有メモリアクセスを監視する監視
手段と、監視手段の出力状態に基づき、命令用キャッシ
ュに格納したプログラムの実行時に該実行したプログラ
ムのアドレスを外部出力する出力手段と、監視手段の出
力状態に基づき、データ用キャッシュの任意のデータを
無効にする無効手段と、監視手段の出力状態に基づき、
データ用キャッシュにデータを連続して格納する格納手
段と、無効手段の出力状態に基づき、任意のデータをマ
イクロコンピュータの外部からデータ用キャッシュに書
き込む手段とを備えたキャッシュ内蔵型マイクロコンピ
ュータ、により達成することができる。
The object of the present invention is to provide a monitoring means for monitoring access to a shared memory external to a microcomputer, and a program executed upon execution of a program stored in an instruction cache based on an output state of the monitoring means. Output means for externally outputting the address of the data, an invalidating means for invalidating any data in the data cache based on an output state of the monitoring means, and an output state of the monitoring means.
Achieved by a microcomputer with a built-in cache, comprising: storage means for continuously storing data in a data cache; and means for writing arbitrary data to the data cache from outside the microcomputer based on the output state of the invalidation means can do.

【0014】本発明のマイクロコンピュータでは、外部
バスマスタが外部共有メモリにアクセスすると、前記監
視手段が外部共有メモリアクセスを検出し、データ用キ
ャッシュメモリへの外部からの書き込みを許す。その場
合、データ用キャッシュにデータを連続して格納するこ
とができる。また、該監視結果に基づいて、命令用キャ
ッシュに格納したプログラムの実行アドレスを外部へ出
力すること、キャッシュのデータを無効にすること、及
びキャッシュのデータを書き換えることができる。これ
により、キャッシュと外部共有メモリの内容を効率的に
一致させ、プログラムの実行結果を外部アドレスメモリ
に残すことができるので、本発明のマイクロコンピュー
タを組み込んだシステムの性能を向上させることができ
る。
In the microcomputer according to the present invention, when the external bus master accesses the external shared memory, the monitoring means detects the access to the external shared memory, and permits external writing to the data cache memory. In that case, data can be continuously stored in the data cache. Further, based on the monitoring result, the execution address of the program stored in the instruction cache can be output to the outside, the data in the cache can be invalidated, and the data in the cache can be rewritten. As a result, the contents of the cache and the external shared memory can be efficiently matched and the execution result of the program can be left in the external address memory, so that the performance of the system incorporating the microcomputer of the present invention can be improved.

【0015】[0015]

【発明の実施の形態】本発明の好適な実施形態として、
次の(イ)、(ロ)を挙げることができる。 (イ)前記無効手段と、前記書込み手段のいずれか一方
を選択する選択手段を有すること。
DESCRIPTION OF THE PREFERRED EMBODIMENTS As a preferred embodiment of the present invention,
The following (a) and (b) can be mentioned. (B) A selection means for selecting one of the invalidation means and the writing means.

【0016】(ロ)前記無効手段による無効処理のタイ
ミング、前記書込み手段による書き込み処理のタイミン
グ、及び前記命令用キャッシュメモリに格納されている
プログラム実行処理のタイミングを合わせるタイミング
調整手段と、該タイミング調整手段によるタイミング調
整結果を外部に出力するタイミング出力手段とを有する
こと。
(B) timing adjustment means for adjusting the timing of the invalidation processing by the invalidation means, the timing of the write processing by the writing means, and the timing of the program execution processing stored in the instruction cache memory; Timing output means for outputting the result of the timing adjustment by the means to the outside.

【0017】実施形態(イ)は、状況に応じて無効手段
と書込み手段を選択することに関する。すなわち、外部
バスマスタがマイクロコンピュータであり、外部メモリ
に置いた1バイトのフラグで同期をとる場合は、書込み
手段を選択することによりキャッシュデータを書き換え
る方法を選択する。また、マイクロコンピュータ以外の
バスマスタがDMAコントローラであり、バーストモー
ドで連続にデータを転送する場合には、キャッシュのデ
ータの一部をマイクロコンピュータ外部よりパージする
方法を選択する。これにより、キャッシュデータの書き
換えとパージとを選択できる。また、パージを効果的に
使えるので、本発明のマイクロコンピュータを組み込ん
だシステムの性能を向上させることができる。
The embodiment (a) relates to selecting invalid means and writing means according to the situation. That is, when the external bus master is a microcomputer and synchronization is achieved with a 1-byte flag stored in the external memory, a method of rewriting cache data by selecting a writing means is selected. When a bus master other than the microcomputer is a DMA controller and data is continuously transferred in the burst mode, a method of purging a part of cache data from outside the microcomputer is selected. Thereby, rewriting and purging of cache data can be selected. In addition, since the purging can be used effectively, the performance of the system incorporating the microcomputer of the present invention can be improved.

【0018】実施形態(ロ)は、各処理のタイミングを
調整することに関する。すなわち、外部バスマスタから
キャッシュへのパージやアクセスを行う場合は、タイミ
ング調整手段がアドレスをアドレスメモリに書き込むた
めのタイミング調整を行い、タイミング出力手段から外
部に制御信号を出力する。また、通常のプログラム実行
時には、実行アドレスを外部に出力する。これにより、
プログラムの実行結果を確実にアドレスメモリに残すこ
とができる。
The embodiment (b) relates to adjusting the timing of each processing. That is, when the cache is purged or accessed from the external bus master, the timing adjustment unit adjusts the timing for writing the address to the address memory, and outputs a control signal from the timing output unit to the outside. Also, at the time of normal program execution, the execution address is output to the outside. This allows
The execution result of the program can be reliably left in the address memory.

【0019】[0019]

【実施例】本発明の好適な一実施例、及びこれを用いた
一応用例について、添付図面を参照しつつ説明する。図
1は実施例を説明するブロック図、図2はは図1に示す
マイクロコンピュータ各部のタイミング図、図3は図1
に示すマイクロコンピュータの応用例を示すブロック図
である。
DESCRIPTION OF THE PREFERRED EMBODIMENTS A preferred embodiment of the present invention and an application using the same will be described with reference to the accompanying drawings. FIG. 1 is a block diagram for explaining the embodiment, FIG. 2 is a timing chart of each part of the microcomputer shown in FIG. 1, and FIG.
FIG. 21 is a block diagram showing an application example of the microcomputer shown in FIG.

【0020】本発明にいう監視手段は、図1では外部の
共有メモリアクセスを監視する回路としての4NAND
(119)である。タイミング生成回路(105)でタ
イミング調整されたプログラムの実行アドレスは端子M
A31−MA2を介して出力される。また、データ用キ
ャッシュメモリの任意のデータを無効にする無効手段
は、コンパレータ(106)、3入力AND(10
7)、タイミング生成回路(112)で構成される。C
LRは無効を示す信号である。
In FIG. 1, the monitoring means according to the present invention is a 4 NAND circuit as a circuit for monitoring external shared memory access.
(119). The execution address of the program whose timing has been adjusted by the timing generation circuit (105) is the terminal M
Output through A31-MA2. The invalidating means for invalidating any data in the data cache memory includes a comparator (106) and a three-input AND (10
7), comprising a timing generation circuit (112). C
LR is a signal indicating invalidity.

【0021】データ用キャッシュメモリに連続してデー
タを格納する格納手段、及びマイクロコンピュータ外部
から任意のデータをデータ用キャッシュメモリに書き込
むための書込み手段は、書き込み制御回路(117)
と、外部バスマスタがキャッシュに書き込むタイミング
を入力する信号であるCEANと、外部メモリライトス
トローブであるMWR*(*は反転信号を示す。図1、
図2では上線で表示)と、外部マスタがバスを占有して
いることを示すHLDAK信号から構成される。監視手
段(119)はCAEN、MWR*、HLDAKの各信
号を使用することで、無効手段と書込み手段のどちらか
一方を選択する機能も有している。
The storage means for continuously storing data in the data cache memory and the writing means for writing arbitrary data from the outside of the microcomputer to the data cache memory include a write control circuit (117).
1, a signal CEAN for inputting a timing at which the external bus master writes data into the cache, and an MWR * (* indicates an inverted signal as an external memory write strobe.
2, and an HLDAK signal indicating that the external master occupies the bus. The monitoring means (119) also has a function of selecting one of the invalidating means and the writing means by using each signal of CAEN, MWR *, and HLDAK.

【0022】無効手段による無効処理のタイミングを調
整するタイミング調整手段は前記タイミング生成回路
(112)である。書込み手段によるマイクロコンピュ
ータ外部から任意のデータをデータ用キャッシュメモリ
に書き込むタイミングを調整するタイミング調整手段は
CEANである。命令用キャッシュメモリに格納されて
いるプログラムの実行処理と、タイミング生成回路(1
12)及びCEANのタイミングを合わせるタイミング
調整手段はタイミング生成回路(116)である。タイ
ミング生成回路(116)で生成されたタイミング調整
結果は、タイミング出力手段MAACKを介して出力さ
れる。MAACKは端子MA31−MA2へパージアド
レスの入力タイミング信号を出力するための信号であ
る。
The timing adjustment means for adjusting the timing of the invalidation processing by the invalidation means is the timing generation circuit (112). The timing adjusting means for adjusting the timing of writing arbitrary data from the outside of the microcomputer to the data cache memory by the writing means is CEAN. Execution processing of a program stored in the instruction cache memory and a timing generation circuit (1
The timing adjusting means for adjusting the timing of 12) and CEAN is a timing generation circuit (116). The timing adjustment result generated by the timing generation circuit (116) is output via timing output means MAACK. MAACK is a signal for outputting a purge address input timing signal to the terminals MA31-MA2.

【0023】キャッシュヒット、ミスヒットを生成する
回路はコンパレータ(108)、2入力AND(10
9)、NOT回路(110)、2入力AND(113)
から構成され、ミスヒット信号は端子MISSを介して
出力される。また、キャッシュヒット信号は内部信号で
あるHITで表されている。
A circuit for generating a cache hit or a mishit includes a comparator (108) and a two-input AND (10
9), NOT circuit (110), 2-input AND (113)
And the mishit signal is output via the terminal MISS. The cache hit signal is represented by an internal signal HIT.

【0024】キャッシュメモリは、デコーダであるMD
EC(101)、RDEC(102)、タグメモリ部
(103)、データメモリ部(104)、前記無効手
段、前記ヒット、ミスヒット信号生成回路、前記書き込
み制御回路(117)から構成される。
The cache memory is an MD which is a decoder.
It comprises an EC (101), an RDEC (102), a tag memory unit (103), a data memory unit (104), the invalidating means, the hit / miss hit signal generation circuit, and the write control circuit (117).

【0025】端子MA31−MA2はプログラム実行ア
ドレスを出力するとともに、任意データを無効にすると
きのパージアドレス入力や、キャッシュへ書き込みをす
るときの書き込みアドレス入力にも使用される。端子R
A31−RA2は外部メモリアクセスをするときのアド
レスバス端子である。DBは外部メモリアクセスをする
ときのデータバス端子である。DOはプログラム実行結
果の履歴を残すためにヒットしたデータを出力する端子
である。DOは3ステータバッファ(114)を介して
出力される。NWR*は外部メモリライトストローブ、
MRD*は外部メモリリードストローブである。MEA
Nはプログラム実行結果をトレースするための書き込み
情報の選択信号であり、キャッシュにヒットしたときは
MA31−MA2の出力情報を、ミスヒットしたときは
RA31−RA2DBの情報を、開発支援装置のアドレ
スメモリに書き込ませるための選択信号である。
The terminals MA31-MA2 output a program execution address, and are also used for inputting a purge address when invalidating arbitrary data and for inputting a write address when writing data to a cache. Terminal R
A31-RA2 is an address bus terminal for external memory access. DB is a data bus terminal for external memory access. DO is a terminal for outputting hit data to leave a history of program execution results. DO is output via a 3-stator buffer (114). NWR * is an external memory write strobe,
MRD * is an external memory read strobe. MEA
N is a write information selection signal for tracing a program execution result. When a cache hit occurs, the output information of MA31-MA2 is output. When a mishit occurs, the information of RA31-RA2DB is output. Is a selection signal for writing to the.

【0026】本実施例の動作について、図2のタイミン
グ図を参照しつつ説明する。まず、外部バスマスタがキ
ャッシュにライトするときを説明する。ホールドアクノ
リッジHLDAKとCAENが高電位(以下、「H
i」)、MWR*が低電位(以下、「Lo」)、MAS
TBがLoの状態である。書き込み制御回路(117)
が作動し、キャッシュへのライトストローブをアクティ
ブにする。MASTBがLoであるので、キャッシュの
パージは行われない。MEAN信号はHIT信号をタイ
ミング生成回路(111)へ入力し、タイミング調整後
に出力される。ここではHIT信号の1クロック遅れの
信号になっている。また、DOはHLDAKがアクティ
ブのとき外部バスマスタが外部のデータバスを使ってい
るため、高インピーダンスとなる。
The operation of this embodiment will be described with reference to the timing chart of FIG. First, the case where the external bus master writes data to the cache will be described. The hold acknowledges HLDAK and CAEN are at a high potential (hereinafter referred to as “H”).
i "), MWR * is low potential (hereinafter" Lo "), MAS
TB is in the Lo state. Write control circuit (117)
Activates and activates the write strobe to the cache. Since MASTB is Lo, the cache is not purged. As the MEAN signal, the HIT signal is input to the timing generation circuit (111), and is output after the timing is adjusted. Here, the HIT signal is a signal delayed by one clock. DO has a high impedance because the external bus master uses an external data bus when HLDAK is active.

【0027】次にHLDAKを使用すると思われるDR
AMリフレッシュについて考える。MASTBがLo、
CAENがLo、MWR*がHi、HLDAKがHiの
状態である。MWR*がHiであるのでキャッシュへの
書き込みは行われない。また、MASTBがLoである
のでキャッシュのパージも行われない。
Next, the DR which seems to use HLDAK
Consider AM refresh. MASTB is Lo,
CAEN is Lo, MWR * is Hi, and HLDAK is Hi. Since MWR * is Hi, writing to the cache is not performed. Also, since MASTB is Lo, the cache is not purged.

【0028】次にマイクロコンピュータがキャッシュを
リードしたときの説明をする。MASTBがLo、CA
ENがLo、HLDAKがLo、MWR*がHi、MR
D*がHiの状態である。MASTBがLoであるので
キャッシュのパージは行われない。また、CAENがL
oであるのでキャッシュへの書き込みも行われない。H
IT信号がHi、HLDAKがLoであるのでヒットし
たデータはDOを介して出力される。
Next, a description will be given of a case where the microcomputer reads the cache. MASTB is Lo, CA
EN is Lo, HLDAK is Lo, MWR * is Hi, MR
D * is Hi. Since MASTB is Lo, the cache is not purged. CAEN is L
Since it is o, writing to the cache is not performed. H
Since the IT signal is Hi and HLDAK is Lo, hit data is output via DO.

【0029】次に外部バスマスタが、キャッシュに取り
込まれたデータと同じデータを外部メモリからリードす
るときの説明をする。MASTBがLo、CAENがH
i、HLDAKがHi、MRD*がLo、MWR*がH
iの状態である。MASTBがLoであるのでキャッシ
ュのパージは行われない。また、MWR*がHiである
のでキャッシュへの書き込みは行われない。HIT信号
がHi、HLDAK信号がLoであるので、ヒットした
データはDOを介して出力される。
Next, a description will be given of a case where the external bus master reads the same data as the data fetched into the cache from the external memory. MASTB is Lo, CAEN is H
i, HLDAK is Hi, MRD * is Lo, MWR * is H
This is the state of i. Since MASTB is Lo, the cache is not purged. Since MWR * is Hi, writing to the cache is not performed. Since the HIT signal is Hi and the HLDAK signal is Lo, hit data is output via DO.

【0030】次にキャッシュをパージするときの説明を
する。ここではMASTBがHi、CAENがLo、H
LDAKがHi、MRD*がLo、MWR*がHiの状
態である。MASTBがHiであるので、コンパレータ
(106)、3入力AND(107)の出力信号CLR
がアクティブになりタグメモリ部の情報をクリアする。
CAENがLoであるのでキャッシュには書き込まれな
い。
Next, a description will be given of the case of purging the cache. Here, MASTB is Hi, CAEN is Lo, H
LDAK is Hi, MRD * is Lo, and MWR * is Hi. Since MASTB is Hi, the output signal CLR of the comparator (106) and the three-input AND (107) is output.
Becomes active and clears the information in the tag memory section.
Since CAEN is Lo, it is not written to the cache.

【0031】次にマイクロコンピュータがキャッシュへ
書き込みをおこなったときの説明をする。MASTBが
Lo、CAENがLo、HLDAKがLo、MWR*が
Loの状態である。MASTBがLoであるのでクアッ
シュはパージされない。CAENがLoであるが、マイ
クロコンピュータ内部のキャッシュライトストローブC
MWR*がアクティブになるのでキャッシュへの書き込
みが行われる。同時にMWR*がLoであるので、外部
メモリにDOから出力されたデータが書き込まれる。ミ
スヒットのときは外部メモリから1ブロック分のリード
が行われる。
Next, a description will be given of a case where the microcomputer writes data to the cache. MASTB is Lo, CAEN is Lo, HLDAK is Lo, and MWR * is Lo. The quash is not purged because MASTB is Lo. CAEN is Lo, but the cache write strobe C inside the microcomputer is
Since MWR * becomes active, writing to the cache is performed. At the same time, since MWR * is Lo, the data output from DO is written to the external memory. In the case of a mishit, one block is read from the external memory.

【0032】次にプログラム実行結果のアドレス出力に
ついて説明する。図2のタイミング図では、0200H
番地と0300H番地の時にMAACKがHiの期間に
有効なプログラム実行アドレスが出力されている。出力
するアドレスを出力するタイミングまで保持しておくの
がタイミング生成回路(105)である。MA31−M
A2の入力、出力タイミングを決めているのはタイミン
グ生成回路(116)である。ここではHLDAK、M
ASTB、CAENの信号を使い、アドレス出力タイミ
ングを作っている。このタイミング信号はMAACK信
号として外部に出力している。
Next, the address output of the program execution result will be described. In the timing diagram of FIG.
At the address and the address 0300H, a valid program execution address is output while MAACK is Hi. The timing generation circuit (105) holds the output address until the output timing. MA31-M
It is the timing generation circuit (116) that determines the input and output timings of A2. Here HLDAK, M
The address output timing is made using the ASTB and CAEN signals. This timing signal is output to the outside as a MAACK signal.

【0033】本実施例たるマイクロコンピュータの応用
例について、図3を参照して説明する。図3において、
アドレスメモリ(301)は、マイクロコンピュータ
(303)が実行したアドレスの履歴を記憶する。マル
チプレクサ(305)は、アドレスメモリに書く情報を
選択する回路である。プログラムの切り替え信号は、マ
イクロコンピュータ(303)が出力するMEAN信号
に基づき、アドレスメモリへの書き込み制御回路(30
4)で生成される。アドレスメモリに書き込まれるアド
レスは、マイクロコンピュータ(303)が外部メモリ
をアクセスするときはA31−A2を書き込み、キャッ
シュをアクセスしているときはMA31−MA2を書き
込む。また、キャッシュに対して外部からアクセスする
ときは、MAACK信号で3ステートバッファ(30
2)を切り替えることにより、MA31−MA2にアド
レスを入力することができる。このMA31−MA2を
アドレスメモリに書き込むことで、履歴に残すことが可
能になっている。
An application example of the microcomputer according to the present embodiment will be described with reference to FIG. In FIG.
The address memory (301) stores a history of addresses executed by the microcomputer (303). The multiplexer (305) is a circuit for selecting information to be written in the address memory. The program switching signal is based on the MEAN signal output from the microcomputer (303), and the write control circuit (30)
Generated in 4). The address written in the address memory is A31-A2 when the microcomputer (303) accesses the external memory, and MA31-MA2 when the microcomputer (303) accesses the cache. When the cache is externally accessed, the three-state buffer (30
By switching 2), an address can be input to MA31-MA2. By writing MA31-MA2 into the address memory, it is possible to leave it in the history.

【0034】[0034]

【発明の効果】本発明により、マイクロコンピュータの
キャッシュと外部メモリのデータの一貫性を保つ方法を
いつでも切り替えることができ、バスの使用頻度、キャ
ッシュの解放時間をシステムとして最適にすることがで
きるので、本発明に係るマイクロコンピュータを組み込
んだ応用システムの性能が向上する。
According to the present invention, the method of maintaining the consistency between the cache of the microcomputer and the data in the external memory can be switched at any time, and the frequency of use of the bus and the release time of the cache can be optimized as a system. Thus, the performance of an application system incorporating the microcomputer according to the present invention is improved.

【0035】また、キャッシュに取り込まれたプログラ
ムを実行するとき、プログラム実行結果を外部に出力す
る機能を備えているため、開発支援装置で実行結果の履
歴を残すことができる。
Further, when the program loaded into the cache is executed, a function of outputting the program execution result to the outside is provided, so that the history of the execution result can be left in the development support apparatus.

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

【図1】本発明の一実施例を説明するブロック図であ
る。
FIG. 1 is a block diagram illustrating an embodiment of the present invention.

【図2】実施例における各部のタイミング図である。FIG. 2 is a timing chart of each unit in the embodiment.

【図3】本発明の一応用例を説明するブロック図であ
る。
FIG. 3 is a block diagram illustrating an application example of the present invention.

【図4】従来例(特開平5−250257号所載)のブ
ロック図である。
FIG. 4 is a block diagram of a conventional example (published in JP-A-5-250257).

【図5】MC68040のブロック図である。FIG. 5 is a block diagram of MC68040.

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

101…MDEC アドレスデコーダ 102…RDEC アドレスデコーダ 103…タグメモリ部 104…データメモリ部 105…アドレス出力タイミング生成回路 106…パージ用コンパレータ 107…3入力AND 108…ヒット、ミスヒット用コンパレータ 109…2入力AND 110…NOT回路 111…MEAN信号タイミング生成回路 112…MASTB信号タイミング生成回路 113…2入力AND 114…データ出力用3ステートバッファ 115…アドレス出力用3ステートバッファ 116…アドレス出力バッファ制御タイミング生成回路 117…書き込み制御回路 118…2入力AND 301…実行アドレス格納メモリ 302…3ステートバッファ 302…CPU(マイクロコンピュータ) 304…アドレスメモリ書き込み制御回路 305…MPX(マルチプレクサ) 401…2入力AND 402…アドレス出力ディレイ回路 501…浮動小数点ユニット 502…整数ユニット 503…命令メモリユニット 504…データメモリユニット 505…データキャッシュスヌープコントローラ 506…データATC 507…データキャッシュ 508…命令キャッシュ 509…命令ATC 510…命令キャッシュスヌープコントローラ MA31−MA2…パージアドレス、キャッシュ書き込
みアドレス入力とプログラム実行アドレスの出力 RA31−RA2…外部メモリアクセス時のアドレス DB…外部メモリアクセス時のアドレス DO…キャッシュヒットデータ MWR*…外部メモリライトストローブ MRD*…外部メモリリードストローブ MISS…ミスヒット信号 CAEN…キャッシュ書き込みタイミング信号 MASTB…キャッシュパージタイミング信号 MEAN…トレース情報選択信号 MAACK…パージアドレスの入力タイミング信号 CMWR*…マイクロコンピュータ内部のキャッシュラ
イトストローブ HLDAK…ホールドアクノリッジ信号
101: MDEC address decoder 102: RDEC address decoder 103: tag memory unit 104: data memory unit 105: address output timing generation circuit 106: comparator for purging 107: 3-input AND 108: comparator for hit and mishit 109: 2-input AND 110 NOT circuit 111 MEAN signal timing generation circuit 112 MASTB signal timing generation circuit 113 2-input AND 114 Data output 3-state buffer 115 Address output 3-state buffer 116 Address output buffer control timing generation circuit 117 Write control circuit 118 ... 2-input AND 301 ... Execution address storage memory 302 ... 3-state buffer 302 ... CPU (microcomputer) 304 ... Address Memory write control circuit 305 MPX (multiplexer) 401 2-input AND 402 Address output delay circuit 501 Floating point unit 502 Integer unit 503 Instruction memory unit 504 Data memory unit 505 Data cache snoop controller 506 Data ATC 507 ... Data cache 508 ... Instruction cache 509 ... Instruction ATC 510 ... Instruction cache snoop controller MA31-MA2 ... Purge address, cache write address input and output of program execution address RA31-RA2 ... Address when accessing external memory DB ... Address DO: Cache hit data MWR *: External memory write strobe MRD *: External memory read strobe ISS ... miss-hit signal CAEN ... cache write timing signal MASTB ... cache purge timing signal MEAN ... trace information selection signal MAACK ... input timing signal CMWR * ... micro-computer inside of the cache write strobe HLDAK ... hold acknowledge signal of the purge address

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】データ用と命令用の、少なくとも2つのキ
ャッシュメモリを内蔵するキャッシュメモリ内蔵型マイ
クロコンピュータにおいて、 前記キャッシュメモリ内蔵型マイクロコンピュータの外
部の共有メモリアクセスを監視する監視手段と、 前記監視手段の出力状態に基づき、前記マイクロコンピ
ュータが前記命令用キャッシュメモリに格納したプログ
ラム実行時に該実行したプログラムのアドレスを外部出
力する出力手段と、 前記監視手段の出力状態に基づき、前記データ用キャッ
シュメモリの任意のデータを無効にする無効手段と、 前記監視手段の出力状態に基づき、前記データ用キャッ
シュメモリにデータを連続して格納する格納手段と、 前記無効手段の出力状態に基づき、任意のデータを前記
マイクロコンピュータ外部から前記データ用キャッシュ
メモリに書き込む書込み手段と、を有することを特徴と
するキャッシュメモリ内蔵型マイクロコンピュータ。
1. A microcomputer having at least two cache memories for data and instructions, the monitoring means monitoring access to a shared memory external to the microcomputer having the cache memory, and the monitoring means. Output means for externally outputting the address of the executed program when the microcomputer executes the program stored in the instruction cache memory based on the output state of the means; and the data cache memory based on the output state of the monitoring means. Invalidation means for invalidating any data of: a storage means for continuously storing data in the data cache memory based on an output state of the monitoring means; and arbitrary data based on an output state of the invalidation means. From outside the microcomputer Cache memory-based microcomputer and having a writing means for writing the serial data cache memory.
【請求項2】前記無効手段と、前記書込み手段のいずれ
か一方を選択する選択手段を有することを特徴とする、
請求項1記載のキャッシュメモリ内蔵型マイクロコンピ
ュータ。
2. The apparatus according to claim 1, further comprising a selection unit for selecting one of the invalidation unit and the writing unit.
A microcomputer with a built-in cache memory according to claim 1.
【請求項3】前記無効手段による無効処理のタイミン
グ、前記書込み手段による書き込み処理のタイミング、
及び前記命令用キャッシュメモリに格納されているプロ
グラム実行処理のタイミングを合わせるタイミング調整
手段と、該タイミング調整手段によるタイミング調整結
果を外部に出力するタイミング出力手段とを有すること
を特徴とする、請求項1記載のキャッシュメモリ内蔵型
マイクロコンピュータ。
3. The timing of invalid processing by said invalid means, the timing of write processing by said writing means,
And timing adjustment means for adjusting the timing of the program execution processing stored in the instruction cache memory, and timing output means for outputting the result of the timing adjustment by the timing adjustment means to the outside. 2. The microcomputer with a built-in cache memory according to 1.
JP9156412A 1997-06-13 1997-06-13 Microcomputer containing cache memory Pending JPH113246A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9156412A JPH113246A (en) 1997-06-13 1997-06-13 Microcomputer containing cache memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9156412A JPH113246A (en) 1997-06-13 1997-06-13 Microcomputer containing cache memory

Publications (1)

Publication Number Publication Date
JPH113246A true JPH113246A (en) 1999-01-06

Family

ID=15627192

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9156412A Pending JPH113246A (en) 1997-06-13 1997-06-13 Microcomputer containing cache memory

Country Status (1)

Country Link
JP (1) JPH113246A (en)

Similar Documents

Publication Publication Date Title
US7299335B2 (en) Translation information retrieval transparent to processor core
JP3289661B2 (en) Cache memory system
JPH0250237A (en) Multi-processor data processing system and cache device using the same
JP2010505195A (en) Data processing system having cache memory debug support and method therefor
JPH09237223A (en) Computer system using bus bridge
US7415576B2 (en) Data processor with block transfer control
US5590310A (en) Method and structure for data integrity in a multiple level cache system
KR100505695B1 (en) Cache memory device having dynamically-allocated or deallocated buffers, digital data processing system comprising it and method thereof
US5748938A (en) System and method for maintaining coherency of information transferred between multiple devices
JP2004030527A (en) Storage controller and storage control method
WO1997004392A1 (en) Shared cache memory device
US6594732B1 (en) Computer system with memory system in which cache memory is kept clean
JP3971807B2 (en) Cache storage device and method
JP3013631B2 (en) Cache memory synchronization method
JPH113246A (en) Microcomputer containing cache memory
US6694468B1 (en) Method and apparatus to test memory
JP3081635B2 (en) Cache memory invalidation processing apparatus and invalidation control method
JP2780555B2 (en) Microprocessor with built-in cache memory
JPH06149669A (en) System and device for transferring cache data
KR970004520B1 (en) High speed memory control method and apparatus
JP2780552B2 (en) Microprocessor with built-in cache memory
JPS6141023B2 (en)
JP2791319B2 (en) Data processing device
JP2982197B2 (en) Bus monitor circuit for cache
JPH04296950A (en) Cache memory device