JPH10207767A - Cache memory with lock function and microprocessor equipped with cache memory - Google Patents

Cache memory with lock function and microprocessor equipped with cache memory

Info

Publication number
JPH10207767A
JPH10207767A JP9005775A JP577597A JPH10207767A JP H10207767 A JPH10207767 A JP H10207767A JP 9005775 A JP9005775 A JP 9005775A JP 577597 A JP577597 A JP 577597A JP H10207767 A JPH10207767 A JP H10207767A
Authority
JP
Japan
Prior art keywords
address
storage area
index
locked
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
JP9005775A
Other languages
Japanese (ja)
Inventor
Masami Funiyuu
正美 普入
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP9005775A priority Critical patent/JPH10207767A/en
Publication of JPH10207767A publication Critical patent/JPH10207767A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a cache memory with a lock function and a microprocessor equipped with the cache memory in which a CPU cycle to be spent on data transfer to a locked area can be reduced. SOLUTION: A microprocessor incorporating a cache memory equipped with a lock function is provided with an index register 6 which sets an index address for designating the cache line of a lock area for operating writing independently of an address register 1 which sets an operand address. A block transferring instruction for directly transferring data from a main memory to the locked set of the cache line is executed, and writing is operated to the locked set.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、キャッシュライ
ンのロック機能を有するキャッシュメモリならびにこの
キャッシュメモリを備えたマイクロプロセッサに関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a cache memory having a cache line locking function and a microprocessor having the cache memory.

【0002】[0002]

【従来の技術】セットアソシアティブ方式を採用するキ
ャッシュメモリを内蔵するマイクロプロセッサにおい
て、キャッシュミスによるペナルティを減らす目的のた
めに、キャッシュライン毎に複数あるセットの1つをロ
ックして、リプレースの対象から外すことで、キャッシ
ュメモリのロックした部分をあたかも高速アクセス可能
な内蔵RAMのように使用する方法がある。
2. Description of the Related Art In a microprocessor incorporating a cache memory adopting a set associative method, one of a plurality of sets is locked for each cache line to reduce a penalty due to a cache miss, and is replaced from a replacement target. There is a method of using the locked portion of the cache memory as if it were removed, as if it were a built-in RAM that can be accessed at high speed.

【0003】例えば、1Kバイト,2ウェイセットアソ
シアティブ方式のデータキャッシュを内蔵して、データ
キャッシュのライン毎に、次にリプレースされるセット
を示すLRUリプレースビットと、キャッシュラインが
ロックされたことを示すロックビットを設けることで、
キャッシュラインのロック機能を実現しているプロセッ
サが製品化されている。
For example, a 1-Kbyte, 2-way set associative data cache is built in, and for each line of the data cache, an LRU replacement bit indicating a set to be replaced next and an indication that the cache line is locked. By providing a lock bit,
A processor realizing a cache line locking function has been commercialized.

【0004】LRUリプレースビットは、キャッシュラ
インのセット0がアクセスされるとセット1を示し、セ
ット1がアクセスされるとセット0を示すことで、キャ
ッシュミスが発生してキャッシュラインをリプレースす
る時に、最近アクセスされたセットがキャッシュメモリ
に残るように制御される。
The LRU replacement bit indicates set 1 when set 0 of the cache line is accessed, and indicates set 0 when set 1 is accessed, so that when a cache miss occurs and the cache line is replaced, The recently accessed set is controlled to remain in the cache memory.

【0005】一方、キャッシュラインのセット0をロッ
クする場合はLRUリプレースビットを1にセットした
後、セット1をロックする場合はLRUリプレースビッ
トを0にセットした後、ロックビットを1にセットす
る。ロックビットが1にセットされたキャッシュライン
では、キャッシュラインのアクセスによるLRUリプレ
ースビットの更新が抑止されることで、ロックされたセ
ットがリプレースの対象から外される。
On the other hand, when locking the set 0 of the cache line, the LRU replacement bit is set to 1, and when locking the set 1, the LRU replacement bit is set to 0 and then the lock bit is set to 1. In the cache line in which the lock bit is set to 1, the update of the LRU replacement bit due to access to the cache line is suppressed, so that the locked set is excluded from the replacement target.

【0006】図2に2ウエイセットアソシアティブ方式
のキャッシュメモリを一例として、従来のマイクロプロ
セッサのデータキャッシュの制御機構を示す。
FIG. 2 shows a conventional microprocessor data cache control mechanism using a two-way set associative cache memory as an example.

【0007】図2に示すデータキャッシュにおいて、ロ
ード命令及びストア命令を実行することにより、オペラ
ンドリード要求又はオペランドライト要求があると、ア
ドレスレジスタ100にオペランドアドレスがセットさ
れる。アドレスレジスタ100の下位アドレスをインデ
ックスとして、該当するキャッシュラインのリプレース
ビット、ロックビット、及び2セット分のバリッドビッ
トとタグアドレスがキャッシュ記憶部101から読み出
される。アドレスレジスタ100の上位アドレスと読み
出されたキャッシュラインのタグアドレスが比較器10
2で比較され、バリッドビットが1で上位アドレスとタ
グアドレスが一致した場合は、キャッシュヒットと判定
される。
In the data cache shown in FIG. 2, when a load instruction and a store instruction are executed and an operand read request or an operand write request is issued, an operand address is set in the address register 100. Using the lower address of the address register 100 as an index, a replacement bit, a lock bit, and two sets of valid bits and a tag address of the corresponding cache line are read from the cache storage unit 101. The upper address of the address register 100 and the read tag address of the cache line are
If the valid bit is 1 and the upper address matches the tag address, a cache hit is determined.

【0008】オペランドリードの場合は、アドレスレジ
スタ100の下位アドレスをインデックスとしてヒット
したセットのデータがセレクタ103により選択されて
読み出され、オペランドリードデータとして出力され
る。オペランドライトの場合には、アドレスレジスタ1
00の下位アドレスをインデックスとしてオペランドラ
イトデータがセレクタ104により選択されてヒットし
たセットに書き込まれる。
In the case of operand read, data of a set that has been hit using the lower address of the address register 100 as an index is selected and read by the selector 103 and output as operand read data. In the case of operand write, address register 1
Operand write data is selected by the selector 104 and written to the hit set using the lower address of 00 as an index.

【0009】いずれのセットもヒット判定されない場合
は、キャッシュミスとしてリプレース要求がキャッシュ
制御回路105から出力される。この時、アドレスレジ
スタ100の値がリプレースアドレスとして出力され
る。また、キャッシュラインから読み出されたリプレー
スビットで示されるセットがリプレース対象となる。メ
インメモリからリプレースアドレスのデータが読み出さ
れると、リプレースアクノリッジがキャッシュ制御回路
105に入力され、アドレスレジスタ100の下位アド
レスをインデックスとしてリプレース対象のセットのデ
ータにリプレースデータが書き込まれ、タグアドレスに
アドレスレジスタの上位アドレスが書き込まれ、バリッ
ドビットに1が書き込まれる。キャッシュラインのリプ
レースが完了すると、オペランドリードではアドレスレ
ジスタ100の下位アドレスをインデックスとしてリプ
レースされたセットのデータが読み出され、オペランド
リードデータとして出力される。一方、オペランドライ
トではアドレスレジスタ100の下位アドレスをインデ
ックスとしてオペランドライトデータがリプレースされ
たセットに書き込まれる。
If no hit is determined for any of the sets, a replacement request is output from the cache control circuit 105 as a cache miss. At this time, the value of the address register 100 is output as a replacement address. Also, the set indicated by the replacement bit read from the cache line is to be replaced. When the data of the replacement address is read from the main memory, the replacement acknowledgment is input to the cache control circuit 105, the replacement data is written in the data of the set to be replaced using the lower address of the address register 100 as an index, and the address register is stored in the tag address. Is written, and 1 is written to the valid bit. When the replacement of the cache line is completed, in the operand read, the replaced set of data is read using the lower address of the address register 100 as an index, and output as operand read data. On the other hand, in the operand write, the operand write data is written in the replaced set using the lower address of the address register 100 as an index.

【0010】オペランドリード要求又はオペランドライ
ト要求により、キャッシュヒットした場合は、読み出さ
れたロックビットが1でなければ、リプレースビットが
ヒットしなかったセットを示すようにリプレースビット
の更新が行われる。キャッシュミスした場合には、読み
出されたロックビットが1でなければ、リプレースビッ
トがリプレースされなかったセットを示すようにリプレ
ースビットの更新が行われる。一方、ロックビットが1
の場合は、リプレースビットの更新は行われず、リプレ
ースビットが常にロックされていないセットを示すた
め、ロックされたセットがリプレースされることは防止
される。
When a cache hit occurs due to an operand read request or an operand write request, if the read lock bit is not 1, the replacement bit is updated so as to indicate the set in which the replacement bit did not hit. In the case of a cache miss, if the read lock bit is not 1, the replacement bit is updated so as to indicate the set in which the replacement bit has not been replaced. On the other hand, when the lock bit is 1
In the case of, the replacement bit is not updated, and the replacement bit always indicates the unlocked set, so that the locked set is prevented from being replaced.

【0011】このような制御によって、キャッシュメモ
リの一部、すなわちロックした部分をあたかも高速アク
セス可能な内蔵RAMとして使用することが可能とな
る。
By such control, a part of the cache memory, that is, a locked part can be used as if it were a built-in RAM which can be accessed at a high speed.

【0012】このような使用形態にあって、キャッシュ
メモリのロックされたセットへメインメモリのデータを
転送する場合は、メインメモリからレジスタへデータを
転送するロード命令と、レジスタからキャッシュメモリ
のロックしたセットへデータを転送するストア命令を組
み合わせて行う必要があった。
In such a usage form, when data in the main memory is transferred to the locked set of the cache memory, a load instruction for transferring data from the main memory to the register and a lock instruction of the cache memory from the register are used. It had to be performed in combination with a store instruction to transfer data to the set.

【0013】[0013]

【発明が解決しようとする課題】以上説明したように、
ロック機能を有するキャッシュメモリを備えた従来のマ
イクロプロセッサは、ロックされたセットのキャッシュ
ラインにメインメモリからデータを転送する場合には、
ロード命令とストア命令の2つの命令を実行しなければ
ならなかった。このため、データ転送に時間がかかると
ともに、2つの命令が実行される分のCPUサイクルを
費やしていた。
As described above,
A conventional microprocessor with a cache memory having a lock function, when transferring data from main memory to a locked set of cache lines,
Two instructions, a load instruction and a store instruction, had to be executed. For this reason, data transfer takes time and CPU cycles for executing two instructions are spent.

【0014】そこで、この発明は、上記に鑑みてなされ
たものであり、その目的とするところは、ロックされた
領域へのデータ転送に費やされるCPUサイクルを削減
し、ロック領域における書き込み時間を短縮したロック
機能付キャッシュメモリ及びこのキャッシュメモリを備
えたマイクロプロセッサを提供することにある。
Accordingly, the present invention has been made in view of the above, and has as its object to reduce the number of CPU cycles spent for transferring data to a locked area and shorten the write time in a locked area. It is an object of the present invention to provide a cache memory with a lock function and a microprocessor having the cache memory.

【0015】[0015]

【課題を解決するための手段】上記目的を達成するため
に、請求項1記載の発明は、予め指定されたデータ記憶
領域のミスヒット時にリプレースを禁止してロックする
ロック機能付キャッシュメモリにおいて、通常のキャッ
シュアクセスを行う場合はデータをアクセスする第1の
オペランドアドレスがセットされて保持され、ロックさ
れたデータ記憶領域に書き込みを行う場合には書き込み
データを指定する第2のオペランドアドレスがブロック
転送命令の実行によりセットされて保持されるオペラン
ドアドレス保持手段と、ロックされたデータ記憶領域の
内、書き込みを行うデータ記憶領域を指定するインデッ
クスアドレスがブロック転送命令の実行によりセットさ
れて保持されるインデックスアドレス保持手段と、通常
のキャッシュアクセスを行う場合は前記オペランドアド
レス保持手段に保持されたオペランドアドレスを選択し
てデータ記憶領域を指定し、又はロックされた記憶領域
に書き込みを行う場合には前記インデックスアドレス保
持手段に保持されたインデックスアドレスを選択してデ
ータ記憶領域を指定する選択手段と、ロックされたデー
タ記憶領域に書き込みを行うブロック転送命令の実行に
よりブロック転送要求を受けて、前記選択手段により指
定されてロックされたデータ記憶領域に、前記オペラン
ドアドレス保持手段に保持されたオペランドアドレスに
より指定されて転送元から直接転送された書き込みデー
タを書き込み制御する制御手段を有して構成される。
According to an aspect of the present invention, there is provided a cache memory with a lock function for prohibiting and locking replacement in the event of a mishit in a data storage area designated in advance. When performing normal cache access, the first operand address for accessing data is set and held, and when writing to a locked data storage area, the second operand address for specifying write data is used for block transfer. An operand address holding means which is set and held by execution of an instruction, and an index which sets and holds an index address designating a data storage area to be written among the locked data storage areas by executing a block transfer instruction Address holding means and normal cache access When performing a write operation, an operand address held in the operand address holding means is selected to designate a data storage area, or when writing is performed in a locked storage area, an index held in the index address holding means is used. Selecting means for selecting a data storage area by selecting an address; receiving a block transfer request by executing a block transfer instruction for writing to the locked data storage area; The area is provided with control means for controlling writing of write data specified by the operand address held in the operand address holding means and directly transferred from the transfer source.

【0016】請求項2記載の発明は、請求項1記載のロ
ック機能付キャッシュメモリにおいて、前記インデック
スアドレス保持手段に保持されたインデックスアドレス
をインクリメントし、インクリメントされたインデック
スアドレスを選択的に前記インデックスアドレス保持手
段にセットするインクリメント手段を有し、インクリメ
ントされたインデックスアドレスにより連続してロック
されたデータ記憶領域に書き込みを行うことを特徴とす
る。
According to a second aspect of the present invention, in the cache memory with the lock function according to the first aspect, the index address held in the index address holding means is incremented, and the incremented index address is selectively selected as the index address. An increment means for setting the data in the holding means is provided, and writing is continuously performed on the data storage area locked by the incremented index address.

【0017】請求項3記載の発明は、請求項1又は2記
載のロック機能付キャッシュメモリにおいて、前記制御
手段は、前記インデックスアドレス保持手段に保持され
たインデックスアドレスにより指定されたデータ記憶領
域がロックされているか否かを判別し、ロックされてい
ない場合は前記インデックスアドレス保持手段に保持さ
れたインデックスアドレスにより指定されたデータ記憶
領域への書き込みを中止制御して構成される。
According to a third aspect of the present invention, in the cache memory with the lock function according to the first or second aspect, the control means locks the data storage area specified by the index address held in the index address holding means. It is determined whether or not the data has been locked, and if the data is not locked, the writing to the data storage area specified by the index address held by the index address holding means is stopped and controlled.

【0018】請求項4記載の発明は、請求項1,2又は
3記載のロック機能付キャッシュメモリを備え、前記ブ
ロック転送命令を命令セットに含み、ブロック転送命令
を実行して前記オペランドアドレス保持手段にオペラン
ドアドレスをセットし、ブロック転送命令を実行して前
記インデックスアドレス保持手段にインデックスアドレ
スをセットし、ブロック転送命令を実行して前記ブロッ
ク転送要求を前記制御手段に与え、前記オペランドアド
レス保持手段に保持されたオペランドアドレスにしたが
ってロックされたデータ記憶領域に書き込まれるデータ
を前記ロック機能付キャッシュメモリに直接転送して構
成される。
According to a fourth aspect of the present invention, there is provided the cache memory with a lock function according to the first, second or third aspect, wherein the block transfer instruction is included in an instruction set, the block transfer instruction is executed, and the operand address holding means is executed. , An index address is set in the index address holding means by executing a block transfer instruction, and a block transfer instruction is executed to give the block transfer request to the control means. The data to be written to the data storage area locked according to the held operand address is directly transferred to the cache memory with lock function.

【0019】[0019]

【発明の実施の形態】図1は請求項1,2,3又は4記
載の発明の一実施形態に係るロック機能付キャッシュメ
モリ及びこのキャッシュメモリを備えたマイクロプロセ
ッサの構成を示す図である。
FIG. 1 is a diagram showing the configuration of a cache memory with a lock function according to an embodiment of the present invention, and a microprocessor provided with the cache memory.

【0020】図1において、この実施形態のロック機能
付キャッシュメモリは、前述したロック機能を備えた2
ウエイセットアソシアティブ方式と同様なキャッシュメ
モリであり、図2に示すロック機能付キャッシュメモリ
を構成するアドレスレジスタ100、キャッシュ記憶部
101、比較器102及びセレクタ103,104と同
様な機能を有するアドレスレジスタ1、キャッシュ記憶
部2、比較器3及びセレクタ4,5に加えて、キャッシ
ュ記憶部2のロックされたキャッシュラインにおいて書
き込みを行うキャッシュラインを指定するインデックス
アドレスがブロック転送命令の実行によりセットされて
保持されるインデックスレジスタ6と、インデックスレ
ジスタ6に保持されたインデックスアドレスをインクリ
メントするインクリメンタ7と、インクリメンタ7によ
りインクリメントされたインデックスアドレス又はブロ
ック転送命令の実行により与えられるインデックスアド
レスを選択してインデックスレジスタ6に与えるセレク
タ8と、アドレスレジスタ1に保持されたオペランドア
ドレスの下位アドレス又はインデックスレジスタ6に保
持されたインデックスアドレスを選択して、キャッシュ
記憶部2の書き込みを行うロックされたキャッシュライ
ンを指定するセレクタ9と、通常のキャッシュアクセス
動作とリプレース動作ならびにロックされたキャッシラ
インの書き込み動作を制御するキャッシュ制御回路10
を備えて構成される。
In FIG. 1, the cache memory with a lock function according to the present embodiment has the above-described lock function.
An address register 1 having the same functions as those of the address register 100, the cache storage unit 101, the comparator 102, and the selectors 103 and 104 constituting the cache memory with a lock function shown in FIG. In addition to the cache storage unit 2, the comparator 3, and the selectors 4 and 5, an index address specifying a cache line to be written in the locked cache line of the cache storage unit 2 is set and held by executing the block transfer instruction. Index register 6, an incrementer 7 for incrementing the index address held in the index register 6, and an index address incremented by the incrementer 7 or the execution of the block transfer instruction. And a selector 8 for selecting an index address given by the formula (1) and giving the index address to the index register 6, and selecting a lower address of the operand address held in the address register 1 or an index address held in the index register 6, and A selector 9 for specifying a locked cache line to be written, and a cache control circuit 10 for controlling a normal cache access operation and a replace operation and a write operation of a locked cache line
It is comprised including.

【0021】このような構成において、通常のキャッシ
ュアクセス動作ならびにリプレース動作は、前述した図
2に示す構成と同様にして行われる。マイクロプロセッ
サによりロード命令及びストア命令が実行されて、オペ
ランドリード要求又はオペランドライト要求があると、
アドレスレジスタ1にオペランドアドレスがセットされ
る。アドレスレジスタ1の下位アドレスがインデックス
として選択され、このアドレスで指定されるキャッシュ
ラインのアクセスが行われる。キャッシュのミス/ヒッ
ト判定、オペランドリードデータの読み出し、オペラン
ドライトデータの書き込み、キャッシュミス時のリプレ
ースは、従来と同様に行われる。オペランドリード要求
又はオペランドライト要求では、アドレスレジスタの下
位アドレスがキャッシュのインデックスとして用いられ
る。
In such a configuration, ordinary cache access operation and replacement operation are performed in the same manner as the configuration shown in FIG. When a load instruction and a store instruction are executed by the microprocessor and there is an operand read request or an operand write request,
An operand address is set in the address register 1. The lower address of the address register 1 is selected as an index, and the cache line specified by this address is accessed. The cache miss / hit determination, operand read data read, operand write data write, and cache miss replacement are performed in the same manner as in the related art. In an operand read request or an operand write request, the lower address of the address register is used as a cache index.

【0022】次に、メインメモリ(図示せず)の任意の
アドレスから、キャッシュラインのロックされたセット
にデータを転送する動作について説明する。
Next, an operation of transferring data from an arbitrary address of a main memory (not shown) to a locked set of a cache line will be described.

【0023】まず、書き込みデータの転送元のメインメ
モリのアドレスをオペランドアドレスとして、転送先の
キャッシュラインのアドレスをインデックスアドレスと
してブロック転送命令が実行され、オペランドアドレス
がアドレスレジスタ1にセットされ、インデックスアド
レスがインデックスレジスタ6にセットされる。ブロッ
ク転送命令は、メインメモリから書き込みデータを直接
転送して、転送したデータをロックされたキャッシュラ
インのセットに書き込む動作を実現するための命令であ
り、この実施形態のキャッシュメモリを備えたマイクロ
プロセッサの命令セットに含まれる。インデックスアド
レス及びオペランドアドレスはブロック転送命令のアド
レスフィールドの値として設定される。
First, a block transfer instruction is executed using the address of the main memory of the transfer source of the write data as the operand address and the address of the cache line of the transfer destination as the index address, the operand address is set in the address register 1, and the index address is set. Is set in the index register 6. The block transfer instruction is an instruction for directly transferring write data from the main memory and performing an operation of writing the transferred data to a set of locked cache lines, and a microprocessor including the cache memory according to the present embodiment. Included in the instruction set. The index address and the operand address are set as values of the address field of the block transfer instruction.

【0024】ブロック転送命令が実行されるとブロック
転送要求がマイクロプロセッサからキャッシュ制御回路
10に与えら、インデックスレジスタ6に保持されたイ
ンデックスアドレスがインデックスとしてセレクタ9に
より選択され、選択されたインデックスアドレスで指定
されキャッシュラインのリプレースビット、ロックビッ
ト、及び2セット分のバリッドビット、タグアドレスが
読み出される。
When the block transfer instruction is executed, a block transfer request is given from the microprocessor to the cache control circuit 10, and the index address held in the index register 6 is selected by the selector 9 as an index. The replacement bit and the lock bit of the designated cache line, the valid bits for two sets, and the tag address are read.

【0025】ブロック転送では、アドレスレジスタ1の
上位アドレスとタグアドレスの比較結果によらず、リプ
レース要求がキャッシュ制御回路10からプロセッサ側
に出力される。この時、アドレスレジスタ1に保持され
たアドレスがリプレースアドレスとしてプロセッサ側に
出力される。ブロック転送では、読み出されたリプレー
スビットが0の場合はセット1が、1の場合はセット0
がリプレース対象となる。メインメモリからリプレース
アドレスのデータが読み出されると、リプレースアクノ
リッジがプロセッサ側からキャッシュ制御回路10に入
力され、インデックスレジスタ6の出力がインデックス
として選択され、リプレース対象のセットのキャッシュ
ラインにセレクタ5を介して与えられるリプレースデー
タが書き込まれる。
In the block transfer, a replacement request is output from the cache control circuit 10 to the processor irrespective of the result of comparison between the upper address of the address register 1 and the tag address. At this time, the address held in the address register 1 is output to the processor as a replacement address. In the block transfer, set 1 is set when the read replacement bit is 0, and set 0 when the read replacement bit is 1.
Are replaced. When the data of the replacement address is read from the main memory, the replacement acknowledgment is input to the cache control circuit 10 from the processor side, the output of the index register 6 is selected as an index, and the cache line of the set to be replaced is selected via the selector 5. The given replacement data is written.

【0026】ブロック転送では、タグアドレス、バリッ
ドビット、リプレースビットの更新は行われない。ま
た、インデックスレジスタ6に保持されたインデックス
アドレスは、インクリメンタ7によりインクリメントさ
れて更新される。
In the block transfer, the tag address, the valid bit, and the replacement bit are not updated. The index address held in the index register 6 is incremented and updated by the incrementer 7.

【0027】このように、ブロック転送命令では、イン
デックスレジスタ6にセットされたインデックスアドレ
スをキャッシュのインデックスとして、オペランドアド
レスで指定されたメインメモリのデータをキャッシュに
転送する。また、インデックスレジスタ6に保持された
インデックスアドレスがインクリメントされるため、ブ
ロック転送命令を連続実行してインクリメンタ7でイン
クリメントされたインデックスアドレスをセレクタ8で
選択しインデックスレジスタ6にセットすることで、キ
ャッシュ記憶部2にロックされた連続するデータ記憶領
域に対して、メインメモリのデータを連続して転送する
ことが可能となる。これにより、連続してロックされた
領域のひとまとまりのデータを入れ替えるのに有効であ
る。
As described above, in the block transfer instruction, the data of the main memory specified by the operand address is transferred to the cache using the index address set in the index register 6 as the cache index. Further, since the index address held in the index register 6 is incremented, the block transfer instruction is continuously executed, and the index address incremented by the incrementer 7 is selected by the selector 8 and set in the index register 6, thereby enabling the cache to be executed. The data in the main memory can be continuously transferred to the continuous data storage area locked in the storage unit 2. This is effective for replacing a group of data in a continuously locked area.

【0028】ブロック転送命令では、インデックスレジ
スタ6に保持されたインデックスアドレスで指定された
キャッシュラインのロックビットが1にセットされてい
ることを前提としている。キャッシュラインのロックさ
れたセットは、高速アクセス可能な内蔵RAMとして使
用するため、メインメモリとキャッシュメモリのデータ
の一貫性(コヒーレンシ)を取る必要はない。一方、ロ
ックビットが0にセットされているキャッシュラインに
対してブロック転送命令を実行した場合は、メインメモ
リとキャッシュメモリのデータの一貫性が保証できなく
なる。したがって、本発明はロック機能を有するキャッ
シュメモリを内蔵するマイクロプロセッサで特に有効と
なる。なお、キャッシュ制御回路10に、インデックス
レジスタ6に保持されたインデックスアドレスにより指
定されたキャッシュラインがロックされているか否かを
ロックビットを読み出すことにより判別し、ロックされ
ていない場合は書き込みを中止制御させる機能を持たせ
るようにしてもよい。このような場合には、ロックされ
ていない領域に書き込みを行うことを防止できる。
The block transfer instruction assumes that the lock bit of the cache line specified by the index address held in the index register 6 has been set to 1. Since the locked set of cache lines is used as a built-in RAM that can be accessed at a high speed, it is not necessary to maintain coherency of data in the main memory and the cache memory. On the other hand, if a block transfer instruction is executed for a cache line in which the lock bit is set to 0, data consistency between the main memory and the cache memory cannot be guaranteed. Therefore, the present invention is particularly effective in a microprocessor having a cache memory having a lock function. The cache control circuit 10 determines whether or not the cache line specified by the index address held in the index register 6 is locked by reading the lock bit, and if not locked, stops writing. You may make it have the function to make it. In such a case, it is possible to prevent writing into an unlocked area.

【0029】また、本発明はデータキャッシュに限定す
るものではなく、命令キャッシュでも有効である。例え
ば命令キャッシュの一部の領域をロックして、高速実行
が必要なルーチンを命令キャッシュに常駐させることが
あるが、本発明によれば、命令キャッシュに常駐させる
ルーチンを切替える場合に、新しいルーチンを命令キャ
ッシュに高速にロードすることが可能になる。
The present invention is not limited to a data cache, but is also effective for an instruction cache. For example, a routine that requires high-speed execution may be resident in the instruction cache by locking a part of the instruction cache. According to the present invention, when switching the routine resident in the instruction cache, a new routine is used. It is possible to load the instruction cache at high speed.

【0030】このように上記実施形態においては、ロッ
ク機能を有するキャッシュメモリ及びこのキャッシメモ
リを内蔵するマイクロプロセッサにおいて、オペランド
アドレスを設定するアドレスレジスタ1とは独立に、キ
ャッシュのインデックスアドレスを設定するインデック
スレジスタ6を備えることで、メインメモリの任意のア
ドレスからキャッシュラインのロックされたセットへデ
ータを転送するブロック転送命令の実行を可能として、
従来ロード命令とストア命令を組み合わせることで、不
要に使用していたCPUサイクルを削減できる。また、
インデックスレジスタ6にインクリメント機能を追加す
ることで、ブロック転送命令の連続実行が可能になり、
キャッシュメモリの連続したロック領域に対するブロッ
ク転送が可能となる。
As described above, in the above-described embodiment, in the cache memory having the lock function and the microprocessor incorporating the cache memory, the index for setting the index address of the cache independently of the address register 1 for setting the operand address. By providing the register 6, it is possible to execute a block transfer instruction for transferring data from an arbitrary address of the main memory to the locked set of the cache line,
By combining a load instruction and a store instruction in the past, unnecessary CPU cycles can be reduced. Also,
By adding the increment function to the index register 6, continuous execution of the block transfer instruction becomes possible,
Block transfer to a continuous lock area of the cache memory becomes possible.

【0031】[0031]

【発明の効果】以上説明したように、この発明によれ
ば、ブロック転送命令を実行することによりロックされ
た領域に書き込まれるデータを転送元から直接転送し、
インデックスアドレス保持手段にセットされたインデッ
クスアドレスで指定されるロックされた領域に転送され
たデータを書き込むようにしたので、ロックされた領域
へのデータ転送に費やされるCPUサイクルを削減し、
ロック領域における書き込み時間を短縮したロック機能
付キャッシュメモリ及びこのキャッシュメモリを備えた
マイクロプロセッサを提供することができる。
As described above, according to the present invention, data written in a locked area by executing a block transfer instruction is directly transferred from a transfer source.
Since the transferred data is written to the locked area specified by the index address set in the index address holding means, CPU cycles spent for transferring data to the locked area are reduced,
It is possible to provide a cache memory with a lock function in which the write time in the lock area is reduced, and a microprocessor including the cache memory.

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

【図1】図1は請求項1,2,3又は4記載の発明の一
実施形態に係るロック機能付キャッシュメモリ及びこの
キャッシュメモリを備えたマイクロプロセッサの構成を
示す図である。
FIG. 1 is a diagram showing a configuration of a cache memory with a lock function and a microprocessor including the cache memory according to an embodiment of the present invention.

【図2】従来のロック機能付キャッシュメモリ及びこの
キャッシュメモリを備えたマイクロプロセッサの構成を
示す図である。
FIG. 2 is a diagram showing a configuration of a conventional cache memory with a lock function and a microprocessor provided with the cache memory.

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

1 アドレスレジスタ 2 キャッシュ記憶部 3 比較器 4,5,8,9 セレクタ 6 インデックスレジスタ 7 インクリメンタ 10 キャッシュ制御回路 DESCRIPTION OF SYMBOLS 1 Address register 2 Cache storage unit 3 Comparator 4, 5, 8, 9 Selector 6 Index register 7 Incrementer 10 Cache control circuit

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 予め指定されたデータ記憶領域のミスヒ
ット時にリプレースを禁止してロックするロック機能付
キャッシュメモリにおいて、 通常のキャッシュアクセスを行う場合はデータをアクセ
スする第1のオペランドアドレスがセットされて保持さ
れ、ロックされたデータ記憶領域に書き込みを行う場合
には書き込みデータを指定する第2のオペランドアドレ
スがブロック転送命令の実行によりセットされて保持さ
れるオペランドアドレス保持手段と、 ロックされたデータ記憶領域の内、書き込みを行うデー
タ記憶領域を指定するインデックスアドレスがブロック
転送命令の実行によりセットされて保持されるインデッ
クスアドレス保持手段と、 通常のキャッシュアクセスを行う場合は前記オペランド
アドレス保持手段に保持されたオペランドアドレスを選
択してデータ記憶領域を指定し、又はロックされた記憶
領域に書き込みを行う場合には前記インデックスアドレ
ス保持手段に保持されたインデックスアドレスを選択し
てデータ記憶領域を指定する選択手段と、 ロックされ
たデータ記憶領域に書き込みを行うブロック転送命令の
実行によりブロック転送要求を受けて、前記選択手段に
より指定されてロックされたデータ記憶領域に、前記オ
ペランドアドレス保持手段に保持されたオペランドアド
レスにより指定されて転送元から直接転送された書き込
みデータを書き込み制御する制御手段とを有することを
特徴とするロック機能付キャッシュメモリ。
In a cache memory with a lock function for inhibiting replacement and locking when a mishit occurs in a data storage area designated in advance, a first operand address for accessing data is set when performing normal cache access. An operand address holding means for setting and holding a second operand address designating write data when writing to a locked data storage area by executing a block transfer instruction; Among the storage areas, an index address for designating a data storage area to be written is set and held by execution of a block transfer instruction, and the operand address holding means is used for performing normal cache access. Operation Selecting a land address to specify a data storage area, or, when writing to a locked storage area, selecting an index address held by the index address holding means and specifying a data storage area; Receiving a block transfer request by executing a block transfer instruction for writing to the locked data storage area, and storing the operand address stored in the operand address storage means in the locked data storage area specified by the selection means. And a control means for controlling writing of the write data specified directly by the transfer source and transferred from the transfer source.
【請求項2】 前記インデックスアドレス保持手段に保
持されたインデックスアドレスをインクリメントし、イ
ンクリメントされたインデックスアドレスを選択的に前
記インデックスアドレス保持手段にセットするインクリ
メント手段を有し、インクリメントされたインデックス
アドレスにより連続してロックされたデータ記憶領域に
書き込みを行うことを特徴とする請求項1記載のロック
機能付キャッシュメモリ。
2. An index address holding means for incrementing an index address held by the index address holding means, and selectively setting the incremented index address in the index address holding means, wherein the incremented index address is continuously set by the incremented index address. 2. The cache memory with a lock function according to claim 1, wherein data is written to the locked data storage area.
【請求項3】 前記制御手段は、前記インデックスアド
レス保持手段に保持されたインデックスアドレスにより
指定されたデータ記憶領域がロックされているか否かを
判別し、ロックされていない場合は前記インデックスア
ドレス保持手段に保持されたインデックスアドレスによ
り指定されたデータ記憶領域への書き込みを中止制御す
ることを特徴とする請求項1又は2記載のロック機能付
キャッシュメモリ。
3. The control means determines whether or not a data storage area specified by an index address held by the index address holding means is locked. If the data storage area is not locked, the control means determines whether the data storage area is locked. 3. The cache memory with a lock function according to claim 1, wherein writing control to the data storage area specified by the index address stored in the cache memory is stopped.
【請求項4】 請求項1,2又は3記載のロック機能付
キャッシュメモリを備え、前記ブロック転送命令を命令
セットに含み、ブロック転送命令を実行して前記オペラ
ンドアドレス保持手段にオペランドアドレスをセット
し、ブロック転送命令を実行して前記インデックスアド
レス保持手段にインデックスアドレスをセットし、ブロ
ック転送命令を実行して前記ブロック転送要求を前記制
御手段に与え、前記オペランドアドレス保持手段に保持
されたオペランドアドレスにしたがってロックされたデ
ータ記憶領域に書き込まれるデータを前記ロック機能付
キャッシュメモリに直接転送することを特徴とするロッ
ク機能付キャッシュメモリを備えたマイクロプロセッ
サ。
4. A cache memory with a lock function according to claim 1, wherein said block transfer instruction is included in an instruction set, said block transfer instruction is executed, and an operand address is set in said operand address holding means. Executing a block transfer instruction to set an index address in the index address holding means, executing the block transfer instruction and giving the block transfer request to the control means, and setting the operand address held in the operand address holding means to Therefore, a microprocessor provided with a cache memory with a lock function, which directly transfers data written in a locked data storage area to the cache memory with a lock function.
JP9005775A 1997-01-16 1997-01-16 Cache memory with lock function and microprocessor equipped with cache memory Pending JPH10207767A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9005775A JPH10207767A (en) 1997-01-16 1997-01-16 Cache memory with lock function and microprocessor equipped with cache memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9005775A JPH10207767A (en) 1997-01-16 1997-01-16 Cache memory with lock function and microprocessor equipped with cache memory

Publications (1)

Publication Number Publication Date
JPH10207767A true JPH10207767A (en) 1998-08-07

Family

ID=11620502

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9005775A Pending JPH10207767A (en) 1997-01-16 1997-01-16 Cache memory with lock function and microprocessor equipped with cache memory

Country Status (1)

Country Link
JP (1) JPH10207767A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002510085A (en) * 1998-03-31 2002-04-02 インテル・コーポレーション Shared cache structure for temporary and non-temporary instructions
JP2009252165A (en) * 2008-04-10 2009-10-29 Toshiba Corp Multi-processor system
JP2016139239A (en) * 2015-01-27 2016-08-04 Necエンジニアリング株式会社 Cache memory control device and control method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002510085A (en) * 1998-03-31 2002-04-02 インテル・コーポレーション Shared cache structure for temporary and non-temporary instructions
JP2009252165A (en) * 2008-04-10 2009-10-29 Toshiba Corp Multi-processor system
JP2016139239A (en) * 2015-01-27 2016-08-04 Necエンジニアリング株式会社 Cache memory control device and control method

Similar Documents

Publication Publication Date Title
JP3504282B2 (en) Integrated circuit chip providing real-time cache function
JP5217432B2 (en) Cache memory with sector function
JP3370683B2 (en) Cash system
US7321954B2 (en) Method for software controllable dynamically lockable cache line replacement system
US20060059317A1 (en) Multiprocessing apparatus
JP5536655B2 (en) Cache memory, memory system, and data copy method
JPH04324546A (en) Computer system
JPH06348595A (en) Cache device
US6438655B1 (en) Method and memory cache for cache locking on bank-by-bank basis
JP2968509B2 (en) Computer system and method for changing coherency state of cache contents
JPH0452741A (en) Cache memory device
JP4008947B2 (en) Cache memory and control method thereof
JP3812258B2 (en) Cache storage
JPH0519176B2 (en)
JPH10207767A (en) Cache memory with lock function and microprocessor equipped with cache memory
JP2004110240A (en) Cache memory device
JP2001101077A (en) Method for controlling cache memory and computer adopting the same method
JP2586112B2 (en) Address conversion table access control method
US5636365A (en) Hierarchical buffer memories for selectively controlling data coherence including coherence control request means
JP3078303B2 (en) Cache memory control circuit
JPH0659977A (en) Cache memory capable of executing indicative line substituting operation and its control method
JPH11143774A (en) Cache control mechanism
WO2005050455A1 (en) Cache memory and control method thereof
JP5420182B2 (en) Cache memory system, data processing device, and storage device
JPH01255944A (en) Cache memory