JP2009252004A - Cache system - Google Patents

Cache system Download PDF

Info

Publication number
JP2009252004A
JP2009252004A JP2008100160A JP2008100160A JP2009252004A JP 2009252004 A JP2009252004 A JP 2009252004A JP 2008100160 A JP2008100160 A JP 2008100160A JP 2008100160 A JP2008100160 A JP 2008100160A JP 2009252004 A JP2009252004 A JP 2009252004A
Authority
JP
Japan
Prior art keywords
way
cache
cache data
control unit
index
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
JP2008100160A
Other languages
Japanese (ja)
Inventor
Soichiro Hosoda
宗一郎 細田
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 JP2008100160A priority Critical patent/JP2009252004A/en
Publication of JP2009252004A publication Critical patent/JP2009252004A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a cache system that performs efficient processing and reduces power consumption. <P>SOLUTION: The cache system has an instruction cache data RAM 10 serving as a cache data storage part configured to store cache data to a plurality of ways of each index entry, and a way validity bit control part 16 serving as a way information control part for controlling way information indicating whether each way of each index entry corresponds to a valid way capable of storing inconsecutively addressed cache data for other cache data to be stored in the cache data storage part or an invalid way restricting the storage of inconsecutively addressed cache data for other cache data. The cache data storage part is configured to integrate an invalid way with a valid way of the same or different index entry as or from the invalid way. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、キャッシュシステム、特に、プロセッサに搭載されるキャッシュシステムに関する。   The present invention relates to a cache system, and more particularly to a cache system mounted on a processor.

従来、マイクロプロセッサは、メモリアクセスのボトルネックを解消するために、チップ上にキャッシュメモリを搭載するものが主流となっている。キャッシュメモリの構成としては、複数のウェイを用いるセットアソシアティブ(Set Associative)方式が多く採用されている。セットアソシアティブ方式のキャッシュシステムにおいてヒット率を向上させるための技術として、例えば、特許文献1には、ウェイの数を一時的に増加させる技術が提案されている。   Conventionally, in order to eliminate the bottleneck of memory access, microprocessors are mainly equipped with a cache memory on a chip. As a configuration of the cache memory, a set associative method using a plurality of ways is often used. As a technique for improving the hit rate in a set associative cache system, for example, Patent Document 1 proposes a technique for temporarily increasing the number of ways.

従来、キャッシュメモリは、一旦実装されてからは固定されたラインサイズで使用される。キャッシュタグメモリからのタグ情報の読み出しは、プロセッサコアからのキャッシュアクセスの態様に関わらず、キャッシュラインごとに行われる。このため、連続するアドレスへのアクセスであっても、キャッシュラインの境界を越えるごとにキャッシュタグメモリへのアクセスが必要であることにより、無駄な電力消費が生じることとなる。また、連続するアドレスのデータに対してラインサイズが小さい場合、リフィルの際における主メモリとの間の転送回数を増大させることとなる。これに対して、一定のキャッシュ容量のキャッシュメモリにおいてラインサイズを大きくするに従い、ライン数が減少することとなる。ライン数が減少すると、不連続なアドレスへのアクセスの場合のキャッシュミスが増加することとなる。さらに、特許文献1の技術の場合、ウェイの数を一時的に増加させるための補助的なキャッシュを新たに実装する必要がある。このように、従来の技術によると、効率的な処理を可能とすること、及び消費電力を低減させることが困難であるという問題を生じる。   Conventionally, a cache memory is used with a fixed line size once it is mounted. Reading tag information from the cache tag memory is performed for each cache line regardless of the mode of cache access from the processor core. For this reason, even when accessing consecutive addresses, use of the cache tag memory is required every time the boundary of the cache line is crossed, resulting in useless power consumption. Further, when the line size is small with respect to continuous address data, the number of transfers to the main memory during refilling is increased. On the other hand, the number of lines decreases as the line size is increased in a cache memory having a fixed cache capacity. As the number of lines decreases, cache misses in the case of accessing discontinuous addresses will increase. Furthermore, in the case of the technique of Patent Document 1, it is necessary to newly install an auxiliary cache for temporarily increasing the number of ways. As described above, according to the conventional technique, it is difficult to enable efficient processing and to reduce power consumption.

特開平6−231044号公報JP-A-6-231044

本発明は、上述の問題に鑑みてなされたものであり、効率的な処理を可能とし、かつ消費電力を低減可能なキャッシュシステムを提供することを目的とする。   The present invention has been made in view of the above-described problems, and an object of the present invention is to provide a cache system that enables efficient processing and can reduce power consumption.

本願発明の一態様によれば、インデックスごとの複数のウェイへキャッシュデータを格納可能に構成されたキャッシュデータ記憶部と、キャッシュデータ記憶部に格納される他のキャッシュデータに対してアドレスが不連続であるキャッシュデータを格納可能なウェイである有効ウェイ、及び他のキャッシュデータに対してアドレスが不連続であるキャッシュデータの格納が制限されるウェイである無効ウェイのいずれに該当するかを、インデックスごとの各ウェイについて表すウェイ情報を制御するウェイ情報制御部と、を有し、キャッシュデータ記憶部は、無効ウェイを、無効ウェイと同一或いは異なるインデックスの有効ウェイに統合可能に構成されることを特徴とするキャッシュシステムが提供される。   According to one aspect of the present invention, a cache data storage unit configured to store cache data in a plurality of ways for each index, and addresses are discontinuous with respect to other cache data stored in the cache data storage unit An index indicating which of the valid way, which is a way that can store cache data, and the invalid way, which is a way that limits the storage of cache data whose address is discontinuous with respect to other cache data A way information control unit that controls way information representing each way, and the cache data storage unit is configured to be able to integrate invalid ways into valid ways with the same or different index as invalid ways. A featured cache system is provided.

本発明によれば、効率的な処理を可能とし、かつ消費電力を低減できるという効果を奏する。   According to the present invention, it is possible to perform efficient processing and reduce power consumption.

以下に添付図面を参照して、本発明に係るキャッシュシステムの最良な実施の形態を詳細に説明する。   Exemplary embodiments of a cache system according to the present invention will be explained below in detail with reference to the accompanying drawings.

(第1の実施の形態)
図1は、本発明の第1の実施の形態に係るキャッシュシステムの構成を示すブロック図である。本実施の形態に係るキャッシュシステムは、命令キャッシュメモリを備える命令キャッシュシステムであって、本来的に、ウェイ0及びウェイ1からなる2ウェイセットアソシアティブ方式を採用する。命令キャッシュメモリは、プロセッサへの命令群であるプログラムを格納する。
(First embodiment)
FIG. 1 is a block diagram showing the configuration of the cache system according to the first embodiment of the present invention. The cache system according to the present embodiment is an instruction cache system including an instruction cache memory, and inherently employs a 2-way set associative method including way 0 and way 1. The instruction cache memory stores a program that is a group of instructions to the processor.

本実施の形態に係るキャッシュシステムは、本発明が属する分野の技術者によって、以下の説明要綱に基づき、命令キャッシュメモリ以外のデータキャッシュメモリ等を備える多様なキャッシュシステム、及び2ウェイより高次なセットアソシアティブ方式のキャッシュシステムへ変形可能である。従って、以下の説明は、当該分野に対して開示される内容として広く理解されるべきであり、本発明を限定するものではない。   The cache system according to the present embodiment includes various cache systems including a data cache memory other than the instruction cache memory, and a higher order than the 2-way, based on the following explanation summary by an engineer in the field to which the present invention belongs. It can be transformed into a set associative cache system. Accordingly, the following description should be broadly understood as the contents disclosed for the relevant field, and is not intended to limit the present invention.

本実施の形態に係るキャッシュシステムは、命令キャッシュデータRAM(Random Access Memory)10、キャッシュタグRAM11、命令キャッシュ制御部12、タグ比較回路13、及び命令フェッチユニット15を有する。命令キャッシュデータRAM10は、キャッシュデータを格納するキャッシュデータ記憶部として機能する。キャッシュタグRAM11は、キャッシュタグ情報を格納するキャッシュタグ記憶部として機能する。命令キャッシュ制御部12は、キャッシュシステム全体を制御する。   The cache system according to the present embodiment includes an instruction cache data RAM (Random Access Memory) 10, a cache tag RAM 11, an instruction cache control unit 12, a tag comparison circuit 13, and an instruction fetch unit 15. The instruction cache data RAM 10 functions as a cache data storage unit that stores cache data. The cache tag RAM 11 functions as a cache tag storage unit that stores cache tag information. The instruction cache control unit 12 controls the entire cache system.

タグ比較回路13は、プロセッサによりアクセスされたアドレスのタグ情報と、キャッシュタグRAM11から読み出されたタグ情報とを比較し、比較結果を命令キャッシュ制御部12へ出力する。命令フェッチユニット15は、命令コードをフェッチする。ウェイバリッド(Way Valid;WV)ビット制御部16は、命令キャッシュ制御部12に含まれる。ウェイバリッドビット制御部16は、ウェイバリッドビット制御線17を介してウェイバリッドビットを制御する。   The tag comparison circuit 13 compares the tag information of the address accessed by the processor with the tag information read from the cache tag RAM 11 and outputs the comparison result to the instruction cache control unit 12. The instruction fetch unit 15 fetches an instruction code. A way valid (WV) bit control unit 16 is included in the instruction cache control unit 12. The way-valid bit control unit 16 controls the way-valid bit via the way-valid bit control line 17.

図2は、命令キャッシュデータRAM10の構造を説明するものである。命令キャッシュデータRAM10は、複数のラインを並列させたアレイ構造をなす。各ラインは、何行目であるかを表すインデックス(Index 0〜Index x)が割り当てられている。各ラインには、ウェイの数に応じて最大2つのキャッシュデータが格納される。命令キャッシュデータRAM10は、インデックスごとのウェイ0及びウェイ1へキャッシュデータを格納可能に構成されている。   FIG. 2 explains the structure of the instruction cache data RAM 10. The instruction cache data RAM 10 has an array structure in which a plurality of lines are arranged in parallel. Each line is assigned an index (Index 0 to Index x) indicating the number of lines. Each line stores a maximum of two cache data according to the number of ways. The instruction cache data RAM 10 is configured to store cache data in way 0 and way 1 for each index.

図3は、キャッシュタグRAM11の構造、及びウェイバリッドビットについて説明するものである。キャッシュタグRAM11は、命令キャッシュデータRAM10と同様に、アレイ構造をなす。キャッシュタグRAM11は、インデックスごとの2つのウェイにキャッシュタグ情報を格納可能に構成されている。   FIG. 3 is a diagram for explaining the structure of the cache tag RAM 11 and the valid bits. Similarly to the instruction cache data RAM 10, the cache tag RAM 11 has an array structure. The cache tag RAM 11 is configured to be able to store cache tag information in two ways for each index.

ウェイバリッドビットWVは、例えば、メモリ上のビットとしてキャッシュタグRAM11内に実装される。ウェイバリッドビットWVは、有効ウェイ及び無効ウェイのいずれに該当するかを、インデックスごとの各ウェイについて表すウェイ情報である。有効ウェイとは、命令キャッシュデータRAM10に格納される他のキャッシュデータに対してアドレスが不連続であるキャッシュデータを格納可能なウェイである。無効ウェイとは、命令キャッシュデータRAM10に格納される他のキャッシュデータに対してアドレスが不連続であるキャッシュデータの格納が制限されるウェイである。無効ウェイは、命令キャッシュデータRAM10に格納される他のキャッシュデータに対して連続するアドレスのキャッシュデータのみを格納する。   For example, the valid bit WV is mounted in the cache tag RAM 11 as a bit on a memory. The way valid bit WV is way information that indicates which of the valid way and the invalid way corresponds to each way for each index. The effective way is a way capable of storing cache data whose addresses are discontinuous with respect to other cache data stored in the instruction cache data RAM 10. The invalid way is a way in which storage of cache data whose addresses are discontinuous with respect to other cache data stored in the instruction cache data RAM 10 is restricted. The invalid way stores only cache data at addresses that are continuous with other cache data stored in the instruction cache data RAM 10.

ウェイバリッドビットWVは、インデックスごとに設定され、本来のウェイの数に対応するビット幅を持つ。本実施の形態において、ウェイバリッドビットWVは、2ビット構成を採る。ウェイバリッドビットWVは、例えば、2ビットのうち上位1ビットをウェイ0、下位1ビットをウェイ1に割り当て、無効ウェイである場合を「0」、有効ウェイである場合を「1」と表すとする。ウェイバリッドビットWVは、キャッシュタグRAM11内に実装される場合に限られず、いずれの位置に実装することとしても良い。ウェイバリッドビットWVは、例えば、レジスタとして命令キャッシュ制御部12内に実装することとしても良い。   The way valid bit WV is set for each index and has a bit width corresponding to the original number of ways. In this embodiment, the valid bit WV has a 2-bit configuration. For example, when the way valid bit WV is assigned to the way 0 as the upper 1 bit and the way 1 as the lower 1 bit among the 2 bits, the invalid way is represented by “0”, and the valid way is represented by “1”. To do. The way bit WV is not limited to being mounted in the cache tag RAM 11, and may be mounted at any position. The waived bit WV may be mounted in the instruction cache control unit 12 as a register, for example.

また、キャッシュタグRAM11は、次にリフィルするウェイを指示するリプレイス(Replace)ビットR、格納されたデータがタグ情報として有効であるか否かを示すバリッド(Valid)ビットVを格納する。リプレイスビットRは、インデックスごとに設定され、1ビット構成を採る。リプレイスビットRは、例えば、次にリフィルするのがウェイ0である場合を「0」、次にリフィルするのがウェイ1である場合を「1」と表すとする。リプレイスビットRの設定は、例えば、長い時間アクセスが無かったデータを優先してリフィルするLRU(Least Recently Used)方式に従う。バリッドビットVは、各インデックスのウェイごとに設定され、1ビット構成を採る。バリッドビットVは、例えば、格納されたデータがタグ情報として無効である場合を「0」、タグ情報として有効である場合を「1」と表すとする。   Further, the cache tag RAM 11 stores a replace bit R that indicates a way to be refilled next, and a valid bit V that indicates whether the stored data is valid as tag information. The replace bit R is set for each index and adopts a 1-bit configuration. For example, the replace bit R represents “0” when the next refill is way 0 and “1” when the next refill is way 1. The replacement bit R is set according to, for example, an LRU (Least Recently Used) method in which data that has not been accessed for a long time is preferentially refilled. The valid bit V is set for each way of each index and takes a 1-bit configuration. The valid bit V represents, for example, “0” when the stored data is invalid as tag information and “1” when it is valid as tag information.

プロセッサから要求された命令のアドレスは、命令フェッチユニット15を経て命令キャッシュ制御部12へ供給される。プロセッサからの要求には、逐次要求と分岐要求とがある。逐次要求は、連続するアドレスへのアクセスである。分岐要求は、不連続であるアドレスへのアクセスである。命令キャッシュデータRAM10は、命令キャッシュ制御部12からのアドレスのインデックス部によって指定されたデータを読み出す。キャッシュタグRAM11は、命令キャッシュ制御部12からのアドレスのインデックス部によって指定されたタグ情報を読み出す。タグ比較回路13は、読み出されたタグ情報と、要求されたアドレスのタグ情報とを比較し、比較結果を命令キャッシュ制御部12へ出力する。   The address of the instruction requested from the processor is supplied to the instruction cache control unit 12 via the instruction fetch unit 15. The request from the processor includes a sequential request and a branch request. A sequential request is an access to consecutive addresses. A branch request is an access to a discontinuous address. The instruction cache data RAM 10 reads data designated by the index part of the address from the instruction cache control unit 12. The cache tag RAM 11 reads the tag information specified by the index part of the address from the instruction cache control unit 12. The tag comparison circuit 13 compares the read tag information with the tag information of the requested address, and outputs the comparison result to the instruction cache control unit 12.

キャッシュタグRAM11から読み出されたいずれかのタグ情報と、要求されたアドレスのタグ情報とが一致(ヒット)した場合、命令キャッシュ制御部12は、ヒットしたキャッシュデータを選択する。命令キャッシュ制御部12により選択されたキャッシュデータは、命令フェッチユニット15へ出力される。キャッシュタグRAM11から読み出されたいずれのタグ情報も、要求されたアドレスのタグ情報と一致しない場合(キャッシュミス)、リプレイスビットRにより指示されたウェイについてリフィルを行う。このようにして、キャッシュシステムは、プロセッサから要求された命令コードを出力する。   When any tag information read from the cache tag RAM 11 matches the tag information of the requested address, the instruction cache control unit 12 selects the hit cache data. The cache data selected by the instruction cache control unit 12 is output to the instruction fetch unit 15. If any tag information read from the cache tag RAM 11 does not match the tag information of the requested address (cache miss), the refill is performed for the way designated by the replace bit R. In this way, the cache system outputs the instruction code requested from the processor.

図4及び図5は、本実施の形態に係るキャッシュシステムにおけるウェイの統合について説明するものである。例えば、図4の白抜き矢印より上に示すように、全てのインデックスについてウェイバリッドビットWVが「11」であるとする。ウェイバリッドビットWV「11」は、ウェイ0、ウェイ1ともに有効ウェイであることを表す。   4 and 5 describe way integration in the cache system according to the present embodiment. For example, as shown above the white arrow in FIG. 4, it is assumed that the valid bits WV are “11” for all indexes. The way valid bit WV “11” indicates that both way 0 and way 1 are valid ways.

ウェイバリッドビットWV「11」に対して、図5の白抜き矢印より上に示すように、例えば、命令キャッシュデータRAM10のインデックス0について、ウェイ0にラインA(Line A)のキャッシュデータ、ウェイ1にラインJ(Line J)のキャッシュデータが格納されるとする。ここで、ラインJは、ラインAに対してアドレスが不連続なデータであるとする。キャッシュタグRAM11のインデックス0には、ウェイ0にラインAのタグ情報、ウェイ1にラインJのタグ情報が格納される。インデックス0のバリッドビットVはウェイ0、ウェイ1ともに「1」であって、キャッシュタグRAM11に格納されたデータは、ウェイ0、ウェイ1ともに有効なタグ情報であることを表す。なお、インデックス0のリプレイスビットR「1」は、先にリフィルされるのがウェイ1に格納されたラインJであることを表している。   For the way valid bit WV “11”, as shown above the white arrow in FIG. 5, for example, for the index 0 of the instruction cache data RAM 10, the cache data of the line A (Line A) in the way 0, the way 1 Assume that the cache data of line J (Line J) is stored in. Here, it is assumed that the line J is data whose addresses are discontinuous with respect to the line A. In the index 0 of the cache tag RAM 11, the tag information of the line A is stored in the way 0 and the tag information of the line J is stored in the way 1. The valid bit V of index 0 is “1” for both way 0 and way 1, and the data stored in the cache tag RAM 11 indicates that both way 0 and way 1 are valid tag information. The replace bit R “1” of index 0 indicates that the line J stored in the way 1 is refilled first.

インデックス1、インデックスx−1、インデックスxのバリッドビットVは、ウェイ0、ウェイ1ともに「0」であって、キャッシュタグRAM11に格納されたデータは、ウェイ0、ウェイ1ともにタグ情報として無効であることを表す。キャッシュタグRAM11のインデックス1、インデックスx−1、インデックスxのタグ情報は、ウェイ0、ウェイ1ともに「don’t care」(図中「−」と表示)とされる。   The valid bit V of index 1, index x-1, and index x is "0" for both way 0 and way 1, and the data stored in the cache tag RAM 11 is invalid as tag information for both way 0 and way 1. Represents something. The tag information of the index 1, index x-1, and index x in the cache tag RAM 11 is "don't care" (indicated as "-" in the figure) for both way 0 and way 1.

タグ情報が無効であることから、インデックス1、インデックスx−1、インデックスxについて、リプレイスビットR、命令キャッシュデータRAM10のキャッシュデータも「don’t care」とされる。インデックス2は、ウェイバリッドビットWVが「11」であるため、ウェイ0、ウェイ1ともに有効である。ウェイ0にはラインT(Line T)、ウェイ1にはラインL(Line L)が格納される。ラインLは、ラインTに対してアドレスが不連続なデータであるとする。なお、インデックス2のリプレイスビットR「1」は、先にリフィルされるのがウェイ1に格納されたラインLであることを表している。   Since the tag information is invalid, the replace bit R and the cache data of the instruction cache data RAM 10 are also set to “don't care” for the index 1, the index x−1, and the index x. In the index 2, since the way valid bit WV is “11”, both the way 0 and the way 1 are valid. The way 0 stores a line T (Line T), and the way 1 stores a line L (Line L). The line L is data having discontinuous addresses with respect to the line T. The replace bit R “1” of the index 2 indicates that the line L stored in the way 1 is refilled first.

次に、図4の白抜き矢印より下に示すように、インデックス0についてのウェイバリッドビットWVが「10」であるとする。ウェイバリッドビットWV「10」は、ウェイ0が有効ウェイ、ウェイ1が無効ウェイであることを表す。ウェイバリッドビットWV「10」に対して、図5の白抜き矢印より下に示すように、命令キャッシュデータRAM10のインデックス0には、ウェイ0にラインAのキャッシュデータ、ウェイ1にラインB(Line B)のキャッシュデータが格納される。ラインBは、ラインAに対して連続するアドレスのデータであるとする。   Next, as shown below the white arrow in FIG. 4, it is assumed that the weighted bit WV for index 0 is “10”. The way valid bit WV “10” indicates that the way 0 is a valid way and the way 1 is an invalid way. For the way valid bit WV “10”, as shown below the white arrow in FIG. 5, the index 0 of the instruction cache data RAM 10 has the cache data of line A in way 0 and the line B (Line) in way 1. B) cache data is stored. It is assumed that the line B is data of continuous addresses with respect to the line A.

無効ウェイとされたウェイ1は、直前のウェイ0に格納されるラインAに対してアドレスが不連続なキャッシュデータの格納が制限され、ラインAに対して連続するアドレスのラインBのキャッシュデータのみを格納する。無効ウェイとされたウェイ1は、同一のインデックス0の有効ウェイであるウェイ0に統合される。インデックス0のラインは、ウェイ0及びウェイ1の統合により、ダイレクトマップ方式のキャッシュラインと同様に扱われる。   In the way 1, which is an invalid way, storage of cache data with discontinuous addresses for the line A stored in the immediately preceding way 0 is restricted, and only the cache data of the line B of addresses that are continuous with the line A is stored. Is stored. The way 1 that is set as the invalid way is integrated into the way 0 that is the valid way of the same index 0. The line with index 0 is handled in the same way as a direct-mapped cache line by integrating way 0 and way 1.

キャッシュタグRAM11のインデックス0には、本来のウェイ0にラインAのタグ情報が格納される。本来のウェイ1へ格納されるキャッシュデータはラインAに対して連続するアドレスのラインBのキャッシュデータと一意的に決定される。このため、本来のウェイ1へのラインBのタグ情報の格納は不要であって、ウェイ1のタグ情報は「don’t care」(図中「−」と表示)とされる。ウェイ0のバリッドビットVは「1」であって、ウェイ0は有効なキャッシュデータが格納されていることを表す。ウェイ0が有効か否かを判定すればウェイ1が有効か否かの判定は不要であるため、ウェイ1のバリッドビットVは、「don’t care」とされる。また、インデックス0については一つのキャッシュラインとして扱われることから、リプレイスビットRも「don’t care」とされる。   In the index 0 of the cache tag RAM 11, the tag information of the line A is stored in the original way 0. The cache data stored in the original way 1 is uniquely determined as the cache data of the line B of the continuous address with respect to the line A. Therefore, it is not necessary to store the tag information of the line B in the original way 1, and the tag information of the way 1 is “don't care” (indicated as “−” in the figure). The valid bit V of way 0 is “1”, and way 0 represents that valid cache data is stored. If it is determined whether the way 0 is valid or not, it is not necessary to determine whether the way 1 is valid. Therefore, the valid bit V of the way 1 is set to “don't care”. Since index 0 is treated as one cache line, the replace bit R is also set to “don't care”.

インデックス0のラインは、ウェイ0及びウェイ1の統合により、本来のセットアソシアティブ方式の場合のラインサイズに比較して2倍のラインサイズのキャッシュラインとして利用される。逐次要求に対しては、ラインAのヒットにより、ラインBについてのタグ情報の読み出し及び比較、キャッシュデータの選択をするまでも無く、ラインA及びラインBのキャッシュデータを出力する。   The line with index 0 is used as a cache line having a line size twice that of the original set associative method by integrating way 0 and way 1. In response to the sequential request, the cache data of the lines A and B is output without the need to read and compare the tag information about the line B and select the cache data due to the hit of the line A.

さらに、統合されたウェイは、ウェイバリッドビットWVを「11」とすることにより本来のウェイ0及びウェイ1へ分割され、元のセットアソシアティブ方式のキャッシュラインに再構成される。命令キャッシュデータRAM10及びキャッシュタグRAM11は、ウェイバリッドビットWVに応じて、インデックスごとにウェイの数を1又は2と動的に変化させる。   Further, the integrated way is divided into the original way 0 and way 1 by setting the way valid bit WV to “11”, and is reconfigured into the original set associative cache line. The instruction cache data RAM 10 and the cache tag RAM 11 dynamically change the number of ways to 1 or 2 for each index according to the way valid bit WV.

本実施の形態に係るキャッシュシステムは、有効ウェイに無効ウェイを統合させることにより、格納可能なキャッシュラインのラインサイズを動的に拡張させる。ウェイの統合により適宜ラインサイズを拡張させることにより、連続するアドレスへアクセスする逐次要求に対して、キャッシュラインの境界を越えるごとに必要となるキャッシュタグRAM11へのアクセスが減少する。キャッシュタグRAM11へのアクセスを減少させることで、電力消費を低減させる。また、一度のバースト転送により多くのデータのリフィルを可能とし、リフィルの効率を向上させる。ウェイバリッドビットWVに応じてウェイの数を動的に変化させることで、キャッシュミスの抑制を可能とする。これにより、効率的な処理を可能とし、かつ消費電力を低減できるという効果を奏する。   The cache system according to the present embodiment dynamically expands the line size of cache lines that can be stored by integrating invalid ways with valid ways. By appropriately expanding the line size by way integration, access to the cache tag RAM 11 required every time the boundary of the cache line is exceeded is reduced for sequential requests to access consecutive addresses. By reducing access to the cache tag RAM 11, power consumption is reduced. In addition, a large amount of data can be refilled by one burst transfer, and the efficiency of refilling is improved. Cache misses can be suppressed by dynamically changing the number of ways according to the way valid bits WV. As a result, it is possible to perform efficient processing and reduce power consumption.

2ウェイより高次なセットアソシアティブ方式の場合も、上記の説明と同様にして、ウェイを動的に統合する。本発明に係るキャッシュシステムは、mウェイ(mは、2以上の整数)のセットアソシアティブ方式について、mウェイからnウェイ(nは、m>nを満たす正の整数)への統合が可能である。   In the case of a set associative system higher than 2 ways, the ways are dynamically integrated in the same manner as described above. The cache system according to the present invention is capable of integration from m ways to n ways (n is a positive integer satisfying m> n) for an m way (m is an integer of 2 or more) set associative method. .

次に、ウェイバリッドビットWVを更新する方式について説明する。第1の方式では、逐次要求及び分岐要求の数に基づいてウェイバリッドビットWVを更新する。第2の方式では、アドレスデコーダによる定義に基づいてウェイバリッドビットWVを更新する。第3の方式では、ウェイ情報更新指示信号に応じてウェイバリッドビットWVを更新する。   Next, a method for updating the valid bit WV will be described. In the first method, the valid bit WV is updated based on the number of sequential requests and branch requests. In the second method, the valid bit WV is updated based on the definition by the address decoder. In the third method, the way valid bit WV is updated according to the way information update instruction signal.

図6は、第1の方式によりウェイバリッドビットWVを更新するための構成を説明するものである。命令キャッシュ制御部12に設けられたアクセスカウンタ21は、逐次要求の回数、及び分岐要求の回数をカウントする。カウント処理部22は、一定時間においてアクセスカウンタ21でカウントされた逐次要求及び分岐要求の合計回数のうち分岐要求の回数が占める割合を求める。命令キャッシュ制御部12は、かかる分岐要求の割合の閾値をレジスタ値として保持する。ウェイバリッドビット制御部16は、分岐要求の割合が閾値より小さい場合に、分岐要求が少ない命令コードパターンであると判断し、分岐要求の割合が閾値以上である場合に、分岐要求が多い命令コードパターンであると判断する。閾値は、例えばキャッシュメモリの本来のラインサイズ等に応じて任意に設定可能であって、例えばユーザにより設定される。   FIG. 6 illustrates a configuration for updating the valid bit WV by the first method. The access counter 21 provided in the instruction cache control unit 12 counts the number of sequential requests and the number of branch requests. The count processing unit 22 obtains the ratio of the number of branch requests to the total number of sequential requests and branch requests counted by the access counter 21 in a certain time. The instruction cache control unit 12 holds a threshold value of the branch request ratio as a register value. The way bit control unit 16 determines that the instruction code pattern has a small number of branch requests when the ratio of branch requests is smaller than the threshold, and the instruction code with many branch requests when the ratio of branch requests is equal to or greater than the threshold. Judge as a pattern. The threshold value can be arbitrarily set according to the original line size of the cache memory, for example, and is set by the user, for example.

逐次要求は、連続するアドレスへのアクセスであるため、あるキャッシュラインの終端まで命令フェッチを行うと、次のキャッシュラインへのアクセスが発生する。一方、分岐要求は、アドレスが不連続なデータへのアクセスであるため、あるキャッシュラインの次にアクセスするキャッシュラインは確定されない。分岐要求が多いほどキャッシュミスの確率が増加するため、多くの分岐要求に対してはウェイの数を高次のままとすることが望ましい。これに対して、逐次要求が多いほどアクセスのパターンが確定的となるため、ウェイの数を減少させてラインサイズを拡張することが望ましい。   Since the sequential request is an access to consecutive addresses, when an instruction is fetched to the end of a certain cache line, an access to the next cache line occurs. On the other hand, since the branch request is access to data with discontinuous addresses, a cache line to be accessed next to a certain cache line is not determined. Since the probability of a cache miss increases as the number of branch requests increases, it is desirable to keep the number of ways high for many branch requests. On the other hand, as the number of sequential requests increases, the access pattern becomes deterministic. Therefore, it is desirable to expand the line size by reducing the number of ways.

第1の方式では、カウント処理部22で求められた分岐要求の割合が閾値より小さい場合に、ウェイバリッドビット制御部16は、ウェイの数を低次とするウェイバリッドビットWVをセットする。これに対して、カウント処理部22で求められた分岐要求の割合が閾値以上である場合に、ウェイバリッドビット制御部16は、ウェイの数を高次とするウェイバリッドビットWVをセットする。ウェイバリッドビット制御部16は、アクセスカウンタ21によりカウントされた逐次要求の回数及び分岐要求の回数に基づいて、ウェイバリッドビットWVを更新する。キャッシュシステムは、ウェイバリッドビットWVの更新により、ウェイの数を動的に切り替える。これにより、多くの逐次要求に対してリフィル効率の向上、及び消費電力の低減を可能とし、多くの分岐要求に対してキャッシュミスを低減させ、効率的な処理を可能にできる。   In the first method, when the ratio of the branch request obtained by the count processing unit 22 is smaller than the threshold, the way valid bit control unit 16 sets the way valid bit WV that makes the number of ways low. On the other hand, when the ratio of the branch request obtained by the count processing unit 22 is equal to or greater than the threshold, the way-valid bit control unit 16 sets the way-valid bit WV having a higher number of ways. The way valid bit control unit 16 updates the way valid bit WV based on the number of sequential requests and the number of branch requests counted by the access counter 21. The cache system dynamically switches the number of ways by updating the way valid bit WV. This makes it possible to improve refill efficiency and reduce power consumption for many sequential requests, reduce cache misses for many branch requests, and enable efficient processing.

なお、ウェイバリッドビット制御部16は、逐次要求の割合に基づいてウェイバリッドビットWVを更新することとしても良い。ウェイバリッドビット制御部16は、分岐要求及び逐次要求のうちいずれか一方の頻度のみによって命令コードパターンを判断することとしても良い。ウェイバリッドビット制御部16は、アクセスカウンタ21によりカウントされた逐次要求の回数及び分岐要求の回数の少なくとも一方に基づいて、ウェイバリッドビットWVを更新するものであれば良い。アクセスカウンタ21は、逐次要求及び分岐要求の少なくとも一方の回数をカウントするものであれば良い。   The valid bit control unit 16 may update the valid bit WV based on the ratio of sequential requests. The valid bit control unit 16 may determine the instruction code pattern based only on the frequency of one of the branch request and the sequential request. The way valid bit control unit 16 may update the way valid bit WV based on at least one of the number of sequential requests and the number of branch requests counted by the access counter 21. The access counter 21 only needs to count at least one of the sequential request and the branch request.

図7は、第2の方式によりウェイバリッドビットWVを更新するための構成を説明するものである。アドレスデコーダ23は、アクセスされたアドレスをデコードする。アドレスデコーダ23は、命令キャッシュ制御部12内に配備されている。アドレスデコーダ23は、命令キャッシュ制御部12以外に、例えば、命令フェッチユニット15に配備しても良い。アドレスデコーダ23は、動的にメモリ空間を定義可能であるとする。   FIG. 7 illustrates a configuration for updating the valid bit WV by the second method. The address decoder 23 decodes the accessed address. The address decoder 23 is provided in the instruction cache control unit 12. The address decoder 23 may be provided in the instruction fetch unit 15 in addition to the instruction cache control unit 12, for example. It is assumed that the address decoder 23 can dynamically define the memory space.

図8は、アドレスデコーダ23により定義されたメモリマップの例を示す。ここでは、あるインデックスのラインについて本来の2ウェイセットアソシアティブ方式からウェイを統合することにより、ダイレクトマップ方式のキャッシュラインと同様に扱う場合を例として説明する。メモリアクセスするアドレス空間は、アドレス順に、非キャッシュ領域(Un Cache)、ローカルメモリ領域(Local Memory)、リザーブ(禁止)領域(Reserved)、2ウェイセットアソシアティブ用キャッシュ領域(Cache(2−way))、ダイレクトマップ用キャッシュ領域(Cache(Direct))の各メモリ空間が定義されている。各領域の種類及びサイズは、アドレスデコーダ23内の記憶論理(レジスタ又は小規模なメモリ)に記憶される。なお、非キャッシュ領域、ローカルメモリ領域、リザーブ領域については、第2の方式によるウェイバリッドビットWVの切り替えには関係しないことから、詳細な説明を省略する。   FIG. 8 shows an example of a memory map defined by the address decoder 23. Here, a case will be described as an example where a certain index line is handled in the same way as a direct-mapped cache line by integrating ways from the original 2-way set associative method. The address space for memory access is, in order of address, non-cache area (Un Cache), local memory area (Local Memory), reserved area (Reserved), 2-way set associative cache area (Cache (2-way)) Each memory space of the cache area for direct map (Cache (Direct)) is defined. The type and size of each area are stored in storage logic (register or small memory) in the address decoder 23. Note that the non-cache area, the local memory area, and the reserved area are not related to the switching of the valid bit WV by the second method, and thus detailed description thereof is omitted.

アドレスデコーダ23により定義されたダイレクトマップ用キャッシュ領域へのキャッシュアクセスに対して、ウェイバリッドビット制御部16は、ダイレクトマップのキャッシュラインとするウェイバリッドビットWVをセットする。また、アドレスデコーダ23により定義された2ウェイセットアソシアティブ用キャッシュ領域へのキャッシュアクセスに対して、ウェイバリッドビット制御部16は、2ウェイのキャッシュラインとするウェイバリッドビットWVをセットする。このように、ウェイバリッドビット制御部16は、アドレスデコーダ23による定義に基づいて、ウェイバリッドビットWVを更新する。   In response to a cache access to the direct map cache area defined by the address decoder 23, the valid bit control unit 16 sets a valid bit WV as a cache line of the direct map. In response to a cache access to the 2-way set associative cache area defined by the address decoder 23, the way-valid bit control unit 16 sets the way-valid bit WV as a 2-way cache line. As described above, the valid bit control unit 16 updates the valid bit WV based on the definition of the address decoder 23.

さらに、アドレスデコーダ23は、各領域のアドレス位置及び範囲を自由に変更させる。例えば、斜線両矢印を付して示すように、アドレスデコーダ23は、ダイレクトマップ用キャッシュ領域及び2ウェイセットアソシアティブ用キャッシュ領域の境界を移動させることが可能である。また、白抜き両矢印を付して示すように、アドレスデコーダ23は、ダイレクトマップ用キャッシュ領域と2ウェイセットアソシアティブ用キャッシュ領域とを置き換えることが可能である。このように、アドレスデコーダ23は、各領域を動的に定義可能である。   Furthermore, the address decoder 23 freely changes the address position and range of each area. For example, the address decoder 23 can move the boundary between the direct map cache area and the two-way set associative cache area, as indicated by hatched double arrows. In addition, as indicated by a white double arrow, the address decoder 23 can replace the direct map cache area and the 2-way set associative cache area. Thus, the address decoder 23 can dynamically define each area.

2ウェイセットアソシアティブ用キャッシュ領域は、例えば、多くの条件分岐を必要とするプログラムコードを配備したメモリ空間に適している。ダイレクトマップ用キャッシュ領域は、例えば、演算実行を繰り返すような逐次実行が予想されるプログラムコードを配備したメモリ空間に適している。第2の方式によると、ユーザによるキャッシュ領域の使い分けにより、プログラムコードに応じた効率的な処理を可能にできる。   The 2-way set associative cache area is suitable for a memory space in which program code that requires many conditional branches is provided, for example. The direct map cache area is suitable for, for example, a memory space in which program code that is expected to be sequentially executed so as to repeat execution of operations is provided. According to the second method, efficient processing according to the program code can be performed by properly using the cache area by the user.

図9は、第3の方式によりウェイバリッドビットWVを更新するための構成を説明するものである。本方式では、ウェイバリッドビットWVの更新を指示するウェイバリッドビット更新指示信号に基づいて、ウェイバリッドビットWVを更新する。ウェイバリッドビット更新指示信号は、ウェイ情報の更新を指示するウェイ情報更新指示信号である。ウェイバリッドビット更新指示信号は、命令フェッチユニット15及びウェイバリッドビット制御部16の間に設けられたウェイバリッドビット更新指示パス25を介して、命令フェッチユニット15からウェイバリッドビット制御部16へ入力される。ウェイバリッドビット更新指示パス25は、ウェイバリッドビット更新指示信号を伝送するウェイ情報更新指示パスとして機能する。   FIG. 9 illustrates a configuration for updating the valid bit WV by the third method. In this method, the way-valid bit WV is updated based on the way-valid bit update instruction signal that instructs to update the way-valid bit WV. The way valid bit update instruction signal is a way information update instruction signal instructing to update way information. The way-valid bit update instruction signal is input from the instruction fetch unit 15 to the way-valid bit control unit 16 via the way-valid bit update instruction path 25 provided between the instruction fetch unit 15 and the way-valid bit control unit 16. The The way valid bit update instruction path 25 functions as a way information update instruction path for transmitting a way valid bit update instruction signal.

ウェイの数を切り替えるためのキャッシュ命令がプロセッサコアにおいて実行されると、命令フェッチユニット15は、ウェイバリッドビット更新指示信号を出力する。ウェイバリッドビット制御部16は、命令フェッチユニット15からのウェイバリッドビット更新指示信号に従って、ウェイバリッドビットWVを更新する。第3の方式によると、ユーザの自由な設定により効率的な処理を可能にできる。なお、ウェイバリッドビット更新指示パス25は、命令フェッチユニット15及びウェイバリッドビット制御部16の間に設けられる場合に限られず、ウェイバリッドビット制御部16へウェイバリッドビット更新指示信号を伝送可能であればいずれの位置に設けても良い。   When a cache instruction for switching the number of ways is executed in the processor core, the instruction fetch unit 15 outputs a way bit update instruction signal. The way-valid bit control unit 16 updates the way-valid bit WV according to the way-valid bit update instruction signal from the instruction fetch unit 15. According to the third method, efficient processing can be made possible by user's free setting. The way valid bit update instruction path 25 is not limited to the case where it is provided between the instruction fetch unit 15 and the way valid bit control unit 16, and it is possible to transmit the way valid bit update instruction signal to the way valid bit control unit 16. It may be provided at any position.

次に、図10及び図11を用いて、本実施の形態の変形例に係るキャッシュシステムにおけるウェイの統合について説明する。本変形例に係るキャッシュシステムは、同一のインデックスのウェイのみならず異なるインデックスのウェイを統合可能であることを特徴とする。   Next, way integration in a cache system according to a modification of the present embodiment will be described with reference to FIGS. The cache system according to this modification is characterized in that not only ways with the same index but also ways with different indexes can be integrated.

例えば、図10の白抜き矢印より上に示すように、インデックス0についてのウェイバリッドビットWVが「10」であるとする。ウェイバリッドビットWV「10」に対して、図11の白抜き矢印より上に示すように、命令キャッシュデータRAM10のインデックス0には、アドレスが連続するラインAのキャッシュデータ、ラインBのキャッシュデータが格納される。   For example, as shown above the white arrow in FIG. 10, it is assumed that the weighted bit WV for index 0 is “10”. As shown above the white arrow in FIG. 11 with respect to the valid bit WV “10”, the index 0 of the instruction cache data RAM 10 includes the cache data of the line A and the cache data of the line B having consecutive addresses. Stored.

次に、図10の白抜き矢印より下に示すように、インデックス0についてのウェイバリッドビットWVが「10」、インデックス1についてのウェイバリッドビットWVが「00」であるとする。インデックス1のウェイバリッドビットWV「00」は、ウェイ0、ウェイ1がともに無効ウェイであることを表す。インデックス0についてのウェイバリッドビットWV「10」に対して、図11の白抜き矢印より下に示すように、命令キャッシュデータRAM10のインデックス0にはラインAのキャッシュデータ、及びラインBのキャッシュデータが格納される。インデックス1についてのウェイバリッドビットWV「00」に対して、命令キャッシュデータRAM10のインデックス1にはラインC(Line C)のキャッシュデータ、及びラインD(Line D)のキャッシュデータが格納される。   Next, as shown below the white arrow in FIG. 10, it is assumed that the valid bit WV for index 0 is “10” and the valid bit WV for index 1 is “00”. The way valid bit WV “00” of index 1 indicates that both way 0 and way 1 are invalid ways. For the valid bit WV “10” for index 0, the cache data of line A and the cache data of line B are stored in index 0 of the instruction cache data RAM 10 as shown below the white arrow in FIG. Stored. For the valid bit WV “00” for index 1, cache data for line C (Line C) and cache data for line D (Line D) are stored in index 1 of the instruction cache data RAM 10.

ラインCは、ラインBに対して連続するアドレスのデータであるとする。ラインDは、ラインCに対して連続するアドレスのデータであるとする。インデックス1のウェイ0及びウェイ1は、インデックスの境界を越えて、インデックス1とは異なるインデックス0のウェイ0及びウェイ1に統合される。   It is assumed that the line C is data of continuous addresses with respect to the line B. It is assumed that the line D is data of continuous addresses with respect to the line C. Way 0 and way 1 of index 1 are integrated into way 0 and way 1 of index 0 different from index 1 across the boundary of the index.

キャッシュタグRAM11のインデックス0には、本来のウェイ0にラインAのタグ情報が格納される。インデックス1へ格納されるキャッシュデータはインデックス0に格納されたラインA及びラインBに対して連続するアドレスのラインC及びラインDのキャッシュデータであることが一意的に決定される。このため、インデックス1へのラインCのタグ情報、ラインDのタグ情報の格納は不要となる。インデックス1のウェイ0、ウェイ1が有効か否かの判定は不要であるため、インデックス1のバリッドビットVはいずれも「don’t care」(図中「−」と表示)とされる。また、インデックス0及びインデックス1が一つのキャッシュラインとして扱われることから、インデックス1のリプレイスビットRも「don’t care」とされる。   In the index 0 of the cache tag RAM 11, the tag information of the line A is stored in the original way 0. The cache data stored in the index 1 is uniquely determined to be the cache data of the line C and the line D having consecutive addresses with respect to the line A and the line B stored in the index 0. Therefore, it is not necessary to store the tag information of line C and the tag information of line D in index 1. Since it is not necessary to determine whether the way 0 and the way 1 of the index 1 are valid, both the valid bits V of the index 1 are “don't care” (indicated as “−” in the figure). Further, since index 0 and index 1 are treated as one cache line, the replace bit R of index 1 is also set to “don't care”.

インデックス0及びインデックス1のラインは、ウェイの統合により、本来の2ウェイセットアソシアティブ方式の場合に対して4倍のラインサイズのキャッシュラインとして利用される。逐次要求に対しては、ラインAのヒットにより、ラインB、ラインC、ラインDのタグ情報の読み出し及び比較、キャッシュデータの選択をするまでも無く、ラインA、ラインB、ラインC、ラインDのキャッシュデータを出力する。統合されたウェイは、インデックス0、インデックス1のウェイバリッドビットWVを「11」とすることにより本来のウェイへ分割され、元のセットアソシアティブ方式のキャッシュラインに再構成される。   The lines of index 0 and index 1 are used as cache lines having a line size four times that of the original two-way set associative system by way integration. For sequential requests, line A, line B, line C, and line D are not required because the tag information of line B, line C, and line D is read and compared and cache data is selected by hitting line A. The cache data is output. The integrated way is divided into the original way by setting the way valid bit WV of index 0 and index 1 to “11”, and is reconfigured to the original set-associative cache line.

ウェイは、2つのインデックスのみならず3つ以上のインデックスについて統合しても良く、最大で全てのインデックスについて統合可能である。本変形例によると、同一のインデックスのみならず異なるインデックスのウェイを統合することで、元来実装された命令キャッシュデータRAM10のラインサイズを超えるラインサイズのキャッシュラインを自由に設定することができる。異なるインデックスについてのウェイの統合により、プロセッサは、最終的に、ローカルメモリに準じるものとしてキャッシュメモリを利用することも可能となる。   A way may be integrated not only for two indexes but also for three or more indexes, and can be integrated for all indexes at the maximum. According to this modification, by integrating ways of not only the same index but also different indexes, a cache line having a line size exceeding the line size of the instruction cache data RAM 10 originally mounted can be freely set. The integration of ways for different indexes will eventually allow the processor to use the cache memory as if it were local memory.

(第2の実施の形態)
図12は、本発明の第2の実施の形態に係るキャッシュシステムの構成を示すブロック図である。本実施の形態に係るキャッシュシステムは、タグメモリアクセス制御部35を有することを特徴とする。上記第1の実施の形態と同一の部分には同一の符号を付し、重複する説明を省略する。本実施の形態に係るキャッシュシステムは、命令キャッシュデータRAM30、キャッシュタグRAM31、命令キャッシュ制御部32、タグ比較回路13、及び命令フェッチユニット15を有する。
(Second Embodiment)
FIG. 12 is a block diagram showing the configuration of the cache system according to the second embodiment of the present invention. The cache system according to the present embodiment includes a tag memory access control unit 35. The same parts as those in the first embodiment are denoted by the same reference numerals, and redundant description is omitted. The cache system according to the present embodiment includes an instruction cache data RAM 30, a cache tag RAM 31, an instruction cache control unit 32, a tag comparison circuit 13, and an instruction fetch unit 15.

命令キャッシュデータRAM30及びキャッシュタグRAM31は、ウェイ0に対応するメモリバンクと、ウェイ1に対応するメモリバンクとに分割されている。各メモリバンクは、それぞれ一つのウェイに対応している。命令キャッシュ制御部32は、ウェイバリッドビット制御部33及びタグメモリアクセス制御部35を有する。ウェイバリッドビット記憶部34は、レジスタ又は小規模なメモリであって、ウェイバリッドビット制御部33内に設けられている。ウェイバリッドビット記憶部34は、ウェイバリッドビット制御部33により制御されたウェイバリッドビットWVを格納する。タグメモリアクセス制御部35は、ウェイバリッドビット記憶部34に記憶されたウェイバリッドビットWVに基づいて、キャッシュタグRAM31の各メモリバンクへのアクセスを制御する。なお、ウェイバリッドビットWV以外の情報であるタグ情報、バリッドビットV、リプレイスビットRは、上記第1の実施の形態と同様に、キャッシュタグRAM31に格納される。   The instruction cache data RAM 30 and the cache tag RAM 31 are divided into a memory bank corresponding to the way 0 and a memory bank corresponding to the way 1. Each memory bank corresponds to one way. The instruction cache control unit 32 includes a valid bit control unit 33 and a tag memory access control unit 35. The valid bit storage unit 34 is a register or a small-scale memory, and is provided in the valid bit control unit 33. The way-valid bit storage unit 34 stores the way-valid bit WV controlled by the way-valid bit control unit 33. The tag memory access control unit 35 controls access to each memory bank of the cache tag RAM 31 based on the valid bit WV stored in the valid bit storage unit 34. Note that the tag information, the valid bit V, and the replace bit R, which are information other than the way valid bit WV, are stored in the cache tag RAM 31 as in the first embodiment.

例えば、あるインデックスについてウェイバリッドビット記憶部34に記憶されたウェイバリッドビットWVが「11」であるとする。ウェイバリッドビットWV「11」は、ウェイ0、ウェイ1ともに有効ウェイであることを表す。ウェイバリッドビットWV「11」に対して、タグメモリアクセス制御部35は、ウェイ0に対応するメモリバンク、ウェイ1に対応するメモリバンクの両方へのアクセスを許可する。命令キャッシュ制御部32からのアクセスに対して、キャッシュタグRAM31は、ウェイ0に対応するメモリバンク、ウェイ1に対応するメモリバンクの両方を活性化し、両方のメモリバンクからタグ情報を読み出す。   For example, suppose that the valid bit WV stored in the valid bit storage unit 34 for a certain index is “11”. The way valid bit WV “11” indicates that both way 0 and way 1 are valid ways. The tag memory access control unit 35 permits access to both the memory bank corresponding to the way 0 and the memory bank corresponding to the way 1 with respect to the way valid bit WV “11”. In response to an access from the instruction cache control unit 32, the cache tag RAM 31 activates both the memory bank corresponding to the way 0 and the memory bank corresponding to the way 1, and reads the tag information from both memory banks.

次に、あるインデックスについてウェイバリッドビット記憶部34に記憶されたウェイバリッドビットWVが「10」であるとする。ウェイバリッドビットWV「10」は、ウェイ0が有効ウェイ、ウェイ1が無効ウェイであることを表す。ウェイバリッドビットWV「10」に対して、タグメモリアクセス制御部35は、ウェイ0に対応するメモリバンクへのアクセスを許可し、ウェイ1に対応するメモリバンクへのアクセスを遮断する。このように、タグメモリアクセス制御部35は、無効ウェイに対応するメモリバンクへのアクセスを抑制する。命令キャッシュ制御部32からのアクセスに対して、キャッシュタグRAM31は、ウェイ0に対応するメモリバンクのみを活性化し、ウェイ0に対応するメモリバンクのみからタグ情報を読み出す。   Next, it is assumed that the valid bit WV stored in the valid bit storage unit 34 for a certain index is “10”. The way valid bit WV “10” indicates that the way 0 is a valid way and the way 1 is an invalid way. For the way valid bit WV “10”, the tag memory access control unit 35 permits access to the memory bank corresponding to the way 0 and blocks access to the memory bank corresponding to the way 1. In this manner, the tag memory access control unit 35 suppresses access to the memory bank corresponding to the invalid way. In response to an access from the instruction cache control unit 32, the cache tag RAM 31 activates only the memory bank corresponding to the way 0 and reads the tag information from only the memory bank corresponding to the way 0.

本実施の形態では、ウェイバリッドビットWVに基づき、タグメモリアクセス制御部35によりキャッシュタグRAM31への不要なアクセスを遮断するために、ウェイバリッドビット制御部33内にウェイバリッドビット記憶部34を設けることが望ましい。本実施の形態に係るキャッシュシステムは、ウェイバリッドビットWVによって指定される有効ウェイが存在するメモリバンクのみを活性化させることで、キャッシュタグRAM31の全体を活性化させる場合に比較して、タグ情報を読み出す際の電力消費を低減させる。これにより、さらに消費電力を低減できるという効果を奏する。   In the present embodiment, a way-valid bit storage unit 34 is provided in the way-valid bit control unit 33 in order to block unnecessary access to the cache tag RAM 31 by the tag memory access control unit 35 based on the way-valid bit WV. It is desirable. The cache system according to the present embodiment activates only the memory bank in which the valid way specified by the way valid bit WV is present, thereby comparing the tag information as compared with the case where the entire cache tag RAM 31 is activated. To reduce power consumption when reading. Thereby, there exists an effect that power consumption can be reduced further.

各メモリバンクを一つのウェイに対応させる場合、mウェイに対して、命令キャッシュデータRAM30及びキャッシュタグRAM31をm個のメモリバンクに分割する。本実施の形態に係るキャッシュシステムは、本来のウェイの数とメモリバンクの数とを一致させる場合に限られない。各メモリバンクを複数のウェイに対応させることとし、ウェイの数よりメモリバンクの数を少なくしても良い。例えば、ウェイ0、ウェイ1、ウェイ2、ウェイ3からなる4ウェイセットアソシアティブ方式を採用する場合に、命令キャッシュデータRAM30及びキャッシュタグRAM31を2個のメモリバンクに分割することとしても良い。この場合、一方のメモリバンクは、ウェイ0及びウェイ1の二つのウェイに対応させ、他方のメモリバンクは、ウェイ2及びウェイ3の二つのウェイに対応させる。このように、各メモリバンクを複数のウェイに対応させる場合も、消費電力を低減させる効果を得ることができる。   When each memory bank corresponds to one way, the instruction cache data RAM 30 and the cache tag RAM 31 are divided into m memory banks for m ways. The cache system according to the present embodiment is not limited to the case where the number of original ways matches the number of memory banks. Each memory bank may correspond to a plurality of ways, and the number of memory banks may be smaller than the number of ways. For example, when a 4-way set associative method including way 0, way 1, way 2, and way 3 is adopted, the instruction cache data RAM 30 and the cache tag RAM 31 may be divided into two memory banks. In this case, one memory bank corresponds to two ways, way 0 and way 1, and the other memory bank corresponds to two ways, way 2 and way 3. Thus, even when each memory bank is associated with a plurality of ways, an effect of reducing power consumption can be obtained.

第1の実施の形態に係るキャッシュシステムの構成を示すブロック図。The block diagram which shows the structure of the cache system which concerns on 1st Embodiment. 命令キャッシュデータRAMの構造を説明する図。The figure explaining the structure of instruction cache data RAM. キャッシュタグRAMの構造、及びウェイバリッドビットについて説明する図。The figure explaining the structure of a cache tag RAM, and a way bit. キャッシュタグRAMにおけるウェイの統合について説明する図。The figure explaining integration of the way in cash tag RAM. 命令キャッシュデータRAMにおけるウェイの統合について説明する図。The figure explaining integration of the way in instruction cache data RAM. 第1の方式によりウェイバリッドビットを更新するための構成を説明する図。The figure explaining the structure for updating a way valid bit by a 1st system. 第2の方式によりウェイバリッドビットを更新するための構成を説明する図。The figure explaining the structure for updating a way valid bit by a 2nd system. アドレスデコーダにより定義されたメモリマップの例を示す図。The figure which shows the example of the memory map defined by the address decoder. 第3の方式によりウェイバリッドビットを更新するための構成を説明する図。The figure explaining the structure for updating a way bit according to a 3rd system. キャッシュタグRAMにおけるインデックス境界を越えたウェイの統合について説明する図。The figure explaining the integration of the way beyond the index boundary in cash tag RAM. 命令キャッシュデータRAMにおけるインデックス境界を越えたウェイの統合について説明する図。The figure explaining the integration of the way beyond the index boundary in instruction cache data RAM. 第2の実施形態に係るキャッシュシステムの構成を示すブロック図。The block diagram which shows the structure of the cache system which concerns on 2nd Embodiment.

符号の説明Explanation of symbols

10、30 命令キャッシュデータRAM、11、31 キャッシュタグRAM、16、33 ウェイバリッドビット制御部、21 アクセスカウンタ、23 アドレスデコーダ、25 ウェイバリッドビット更新指示パス、35 タグメモリアクセス制御部。   10, 30 Instruction cache data RAM, 11, 31 Cache tag RAM, 16, 33 Way valid bit control unit, 21 Access counter, 23 Address decoder, 25 Way valid bit update instruction path, 35 Tag memory access control unit.

Claims (5)

インデックスごとの複数のウェイへキャッシュデータを格納可能に構成されたキャッシュデータ記憶部と、
前記キャッシュデータ記憶部に格納される他のキャッシュデータに対してアドレスが不連続であるキャッシュデータを格納可能なウェイである有効ウェイ、及び前記他のキャッシュデータに対してアドレスが不連続であるキャッシュデータの格納が制限されるウェイである無効ウェイのいずれに該当するかを、前記インデックスごとの各ウェイについて表すウェイ情報を制御するウェイ情報制御部と、を有し、
前記キャッシュデータ記憶部は、前記無効ウェイを、前記無効ウェイと同一或いは異なるインデックスの前記有効ウェイに統合可能に構成されることを特徴とするキャッシュシステム。
A cache data storage unit configured to store cache data in a plurality of ways for each index; and
A valid way which is a way capable of storing cache data whose address is discontinuous with respect to other cache data stored in the cache data storage unit, and a cache whose address is discontinuous with respect to the other cache data A way information control unit that controls which way information represents each way for each index, which corresponds to an invalid way that is a way for which data storage is restricted, and
The cache data storage unit is configured to be able to integrate the invalid way into the valid way having the same or different index as the invalid way.
連続するアドレスへのアクセスである逐次要求の回数、及び不連続であるアドレスへのアクセスである分岐要求の回数の少なくとも一方をカウントするアクセスカウンタを有し、
前記ウェイ情報制御部は、前記アクセスカウンタによりカウントされた前記逐次要求の回数及び前記分岐要求の回数の少なくとも一方に基づいて、前記ウェイ情報を更新することを特徴とする請求項1に記載のキャッシュシステム。
An access counter that counts at least one of the number of sequential requests that are accesses to consecutive addresses and the number of branch requests that are accesses to discontinuous addresses;
The cache according to claim 1, wherein the way information control unit updates the way information based on at least one of the number of sequential requests and the number of branch requests counted by the access counter. system.
アクセスされたアドレスをデコードするアドレスデコーダを有し、
前記ウェイ情報制御部は、前記アドレスデコーダによる定義に基づいて前記ウェイ情報を更新することを特徴とする請求項1に記載のキャッシュシステム。
Having an address decoder for decoding the accessed address;
The cache system according to claim 1, wherein the way information control unit updates the way information based on a definition by the address decoder.
前記ウェイ情報の更新を指示するウェイ情報更新指示信号を前記ウェイ情報制御部へ伝送するウェイ情報更新指示パスを有することを特徴とする請求項1に記載のキャッシュシステム。   2. The cache system according to claim 1, further comprising a way information update instruction path for transmitting a way information update instruction signal for instructing update of the way information to the way information control unit. 一つ又は複数の前記ウェイに対応する複数のメモリバンクに分割され、キャッシュタグ情報を格納するキャッシュタグ記憶部と、
前記ウェイ情報制御部により制御された前記ウェイ情報に基づいて、前記メモリバンクへのアクセスを制御するタグメモリアクセス制御部と、を有し、
前記タグメモリアクセス制御部は、前記無効ウェイに対応する前記メモリバンクへのアクセスを抑制することを特徴とする請求項1〜4のいずれか一項に記載のキャッシュシステム。
A cache tag storage unit that is divided into a plurality of memory banks corresponding to one or a plurality of the ways and stores cache tag information;
A tag memory access control unit that controls access to the memory bank based on the way information controlled by the way information control unit;
The cache system according to claim 1, wherein the tag memory access control unit suppresses access to the memory bank corresponding to the invalid way.
JP2008100160A 2008-04-08 2008-04-08 Cache system Pending JP2009252004A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008100160A JP2009252004A (en) 2008-04-08 2008-04-08 Cache system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008100160A JP2009252004A (en) 2008-04-08 2008-04-08 Cache system

Publications (1)

Publication Number Publication Date
JP2009252004A true JP2009252004A (en) 2009-10-29

Family

ID=41312642

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008100160A Pending JP2009252004A (en) 2008-04-08 2008-04-08 Cache system

Country Status (1)

Country Link
JP (1) JP2009252004A (en)

Similar Documents

Publication Publication Date Title
US9575901B2 (en) Programmable address-based write-through cache control
US7502887B2 (en) N-way set associative cache memory and control method thereof
US7389402B2 (en) Microprocessor including a configurable translation lookaside buffer
JP4920378B2 (en) Information processing apparatus and data search method
US20110167224A1 (en) Cache memory, memory system, data copying method, and data rewriting method
US20090259813A1 (en) Multi-processor system and method of controlling the multi-processor system
US11301250B2 (en) Data prefetching auxiliary circuit, data prefetching method, and microprocessor
US20180150399A1 (en) Semiconductor device and method for prefetching to cache memory
JP2005293300A (en) Set associative cache system and control method of cache memory
US7761665B2 (en) Handling of cache accesses in a data processing apparatus
US6560676B1 (en) Cache memory system having a replace way limitation circuit and a processor
JP4009306B2 (en) Cache memory and control method thereof
JP2007156821A (en) Cache system and shared secondary cache
WO2011151944A1 (en) Cache memory device, program transformation device, cache memory control method, and program transformation method
JP2007272280A (en) Data processor
US10013352B2 (en) Partner-aware virtual microsectoring for sectored cache architectures
KR101099417B1 (en) Cache memory device
JP2009252004A (en) Cache system
JP5245349B2 (en) Registration destination way fixing method, processor, and information processing apparatus
CN114691541B (en) DRAM-NVM hybrid memory predictor based on dynamic access
JP5445701B1 (en) Flash control device, flash control method, and cache memory device
JP2010033317A (en) Cache system
JP2005149290A (en) Information processing device and cache memory control method
JP2010191754A (en) Cache storage