JP2000099399A - Way predictive cache memory and access method therefor - Google Patents

Way predictive cache memory and access method therefor

Info

Publication number
JP2000099399A
JP2000099399A JP10283376A JP28337698A JP2000099399A JP 2000099399 A JP2000099399 A JP 2000099399A JP 10283376 A JP10283376 A JP 10283376A JP 28337698 A JP28337698 A JP 28337698A JP 2000099399 A JP2000099399 A JP 2000099399A
Authority
JP
Japan
Prior art keywords
way
tag
information
ways
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
JP10283376A
Other languages
Japanese (ja)
Inventor
Hiroshi Inoue
弘士 井上
Toru Ishihara
亨 石原
Kazuaki Murakami
和彰 村上
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.)
Apriori Microsystems Inc
Original Assignee
Apriori Microsystems Inc
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 Apriori Microsystems Inc filed Critical Apriori Microsystems Inc
Priority to JP10283376A priority Critical patent/JP2000099399A/en
Publication of JP2000099399A publication Critical patent/JP2000099399A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/60Details of cache memory
    • G06F2212/608Details relating to cache mapping
    • G06F2212/6082Way prediction in set-associative cache
    • 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

PROBLEM TO BE SOLVED: To reduce energy consumption without decelerating an access speed by providing a way predictive flag for selecting any way independently of tag comparison and a way predictive table for storing that flag, and controlling the operation of the way based on the signal of the way predictive table. SOLUTION: While receiving the status information of ways 21-24 and the signals of comparators 31-34, a predictive update circuit 5 outputs information showing either predictive hit or error and information showing cache error and updates the way predictive flag by predicting the way when a set referred to at present is next accessed. While receiving the predicted result, a way predictive table 6 records a flag designating the way. While receiving this information, an access controller 1 commands which way is to be made active. In the case of predictive hit, an encoder 4 receives the predictive flag of the way predictive table 6 and commands a selector 7 so as to output only the data of the relevant way.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、オンチップ・キャ
ッシュメモリの低消費エネルギー化のための、アクセス
方法に関する。
The present invention relates to an access method for reducing the energy consumption of an on-chip cache memory.

【0002】[0002]

【従来の技術】PDAやノート型PCに代表される携帯
型電子機器システムの普及に伴い、CPUの高性能、低
消費エネルギー化に対する要求が高まっている。しか
し、一般に性能と消費エネルギーはトレードオフの関係
にあり、どちらか一方の要求を満足するには、他方の要
求を犠牲にしなければならない。このような相反する要
求を同時に満足する手段としてオンチップ・キャッシュ
の搭載がある。この技術によると、オンチップ・キャッ
シュにヒットした場合、外部メモリーへのアクセス・レ
イテンシ隠蔽による高性能化と、外部入出力ピン駆動の
削除による低消費エネルギー化が達成される。しかしな
がら、順調なトランジスタ集積度の向上を背景に、更な
る高ヒット率の達成を目的としてキャッシュサイズは年
々増加傾向にあり、それに伴ってキャッシュアクセスに
おける消費エネルギーの増大が顕著化し、CPU全体の
消費エネルギーに大きく影響するようになっている。そ
して、キャッシュの低消費エネルギー化がチップ全体の
省エネルギー化を実現するための必要不可欠な技術要素
となっている。
2. Description of the Related Art With the spread of portable electronic equipment systems typified by PDAs and notebook PCs, demands for high performance and low energy consumption of CPUs are increasing. However, performance and energy consumption are generally in a trade-off relationship, and satisfying one of the requirements requires sacrificing the other. A means for simultaneously satisfying these conflicting demands is to mount an on-chip cache. According to this technology, when a hit occurs in the on-chip cache, high performance is achieved by hiding the access latency to the external memory, and low energy consumption is achieved by eliminating external input / output pin driving. However, the cache size has been increasing year by year for the purpose of achieving a higher hit ratio with a steady improvement in transistor integration, and the energy consumption in cache access has been remarkably increased, and the overall CPU consumption has been increased. It has a large effect on energy. The reduction in energy consumption of the cache is an indispensable technical element for realizing energy saving of the entire chip.

【0003】ところで、従来の多くの高性能CPUに
は、キャッシュコンフリクトを回避して高ヒット率を達
成するため、セット・アソシアティブ・キャッシュ方式
が採用されている。このような従来技術について説明す
るため、一般的な4ウェイ・セット・アソシアティブ・
キャッシュについて図を用いて説明する。図4は4ウェ
イ・セット・アソシアティブ・キャッシュの構成を示す
図であり、ここでは従来型キャッシュと呼ぶ。図におい
て、21、22、23、24はそれぞれタグとラインを
保持するメモリーであり、指令が与えられると全ウェイ
のタグは比較器31、32、33、34によってプロセ
ッサが出した参照アドレス内のタグ・フィールドの値と
比較され、その結果がエンコーダ4に出力される。この
タグの比較結果を受けたエンコーダ4は各ウェイに対応
する全てのラインの中から、プロセッサが要求する参照
データが格納されている唯一の参照ラインを選択するた
めのセレクタ7の制御信号を出力する。図において、ラ
インとは、ある一つのタグ・アドレスに対応するキャッ
シュ内データの集合をいい、ミスがあるときは、すなわ
ち参照するデータがキャッシュ内にないときは、ライン
単位でデータの置換えが行われる。ウェイとは、一つの
タグ・サブアレイと、それに対応するライン・サブアレ
イの組をいい、連想度が4の場合、4個のウェイが存在
する。セットとは、各ウェイにおいて、同一インデック
スを有するタグとラインの集合のことをいい、連想度が
4の場合、一つのセットは、タグとラインの組4個で構
成される。検索セットとは、プロセッサからのメモリ参
照が発生したとき、参照アドレスのインデックス・フィ
ールドによって指定され、タグ検索の対象となるセット
である。参照ラインとは、プロセッサが参照するデータ
が格納されているラインをいい、ヒットの時は、検索セ
ット内に1個の参照ラインが存在し、ミスの時は、参照
ラインはキャッシュ内には存在しない。
[0003] Many conventional high performance CPUs employ a set associative cache system in order to achieve a high hit rate while avoiding cache conflicts. In order to explain such prior art, a general 4-way set associative
The cache will be described with reference to the drawings. FIG. 4 is a diagram showing a configuration of a 4-way set associative cache, which is referred to as a conventional cache here. In the figure, reference numerals 21, 22, 23, and 24 denote memories for holding tags and lines, respectively. When a command is given, tags of all ways are stored in reference addresses in the reference addresses issued by the processors by comparators 31, 32, 33, and 34. The value is compared with the value of the tag field, and the result is output to the encoder 4. The encoder 4 receiving this tag comparison result outputs a control signal of the selector 7 for selecting the only reference line storing the reference data requested by the processor from all the lines corresponding to each way. I do. In the figure, a line refers to a set of data in the cache corresponding to a certain tag address. When there is a mistake, that is, when the data to be referred to is not in the cache, data replacement is performed in line units. Will be A way refers to a set of one tag subarray and a corresponding line subarray. When the degree of association is 4, there are four ways. A set refers to a set of tags and lines having the same index in each way. When the associativity is 4, one set is composed of four sets of tags and lines. The search set is a set that is specified by the index field of the reference address when a memory reference from the processor occurs, and is a target for tag search. A reference line is a line in which data to be referred to by the processor is stored. In the case of a hit, one reference line exists in the search set. In the case of a miss, the reference line exists in the cache. do not do.

【0004】次にそのような構成におけるキャッシュメ
モリの動作を図5と図6を用いて説明する。図5は、プ
ロセッサからのメモリ参照が発生したときに、従来型の
4ウェイ・セット・アソシアティブ・キャッシュが動作
する手順を示すフローを示している。フローの初めのス
テップ(S1)で、まずプロセッサが出力したアドレス
がデコードされる。ステップ(S2)では、そのデコー
ドの結果に基づいて検索セットが決定される。ステップ
(S3)では、検索セット内の全ウェイに対応するタグ
とラインがタグ・サブアレイとライン・サブアレイから
同時に読み出される。ステップ(S4)では、読み出さ
れた4つのタグとプロセッサが出力した参照アドレスの
タグ・フィールドの値が比較され、何れかの結果が一致
であればステップ(S5)に進み、そうでなければステ
ップ(S6)に進む。ステップ(S5)では、ステップ
(S3)で読み出された4つのラインの中からタグの比
較結果に基づき参照ラインが選択される。また、参照ア
ドレスのオフセット・フィールドで指定されるデータが
参照ライン内から選択されて、キャッシュ・アクセスは
終了する。ステップ(S6)では、ステップ(S3)で
読み出された4つのラインがすべて破棄され、キャッシ
ュ・リプレイスが行われる。図6は、ステップ(S3)
からステップ(S5)の間で情報が出力されているとこ
ろを太線の矢印で示しており、全てのウェイが活性化さ
れていることを示している。このように、上記の従来型
キャッシュは、ヒット/ミスに関わらずキャッシュ・ア
クセス毎に4個のタグと4個のラインが読み出されるの
で、タグの比較とラインの参照が1回のアクセスで終了
し、高速に作動するようになっている。
Next, the operation of the cache memory having such a configuration will be described with reference to FIGS. FIG. 5 is a flowchart showing a procedure for operating a conventional 4-way set associative cache when a memory reference from a processor occurs. In the first step (S1) of the flow, first, the address output by the processor is decoded. In step (S2), a search set is determined based on the decoding result. In step (S3), tags and lines corresponding to all ways in the search set are simultaneously read from the tag sub-array and the line sub-array. In step (S4), the four read tags are compared with the value of the tag field of the reference address output by the processor, and if any of the results match, the process proceeds to step (S5); Proceed to step (S6). In step (S5), a reference line is selected from the four lines read in step (S3) based on the tag comparison result. Also, the data specified by the offset field of the reference address is selected from within the reference line, and the cache access ends. In step (S6), all four lines read in step (S3) are discarded, and cache replacement is performed. FIG. 6 shows the step (S3).
The point where the information is output from the step (S5) to the step (S5) is indicated by a thick arrow, indicating that all the ways are activated. As described above, in the above-described conventional cache, four tags and four lines are read for each cache access regardless of hit / miss, so that tag comparison and line reference are completed in one access. And operate at high speed.

【0005】これに対し、従来型キャッシュより電力消
費を抑えるよう構成されたものに段階型キャッシュがあ
るので、その概要を説明する。図7の(a)と(b)は
段階型キャッシュがとる2段階のステップにおけるキャ
ッシュ内のアクティブな状態を示している。第1段階の
(a)では、各ウェイのタグだけが読み出されてプロセ
ッサの参照アドレスの情報と比較され、参照されるべき
ウェイがあるかどうかが判断される。その何れかに参照
されるウェイがあることがわかれば、第2段階の(b)
で、該当するウェイのラインのみが参照ラインとして読
み出され、セレクタから出力される。この段階型キャッ
シュの場合、2段階を通してアクティブにされるタグと
ラインは5ヶ所であり、図6に示した従来型キャッシュ
の8ヶ所に比べておよそ半減している。従って、キャッ
シュメモリのアクセスに要する電力が大幅に低減されて
いる。
[0005] On the other hand, a staged cache is configured so as to reduce power consumption as compared with the conventional cache. FIGS. 7A and 7B show the active state in the cache in two steps taken by the staged cache. In the first stage (a), only the tag of each way is read and compared with the information of the reference address of the processor to determine whether there is a way to be referred to. If it is found that any of the ways is referred to, the second stage (b)
Then, only the line of the relevant way is read as a reference line and output from the selector. In the case of this staged cache, the number of tags and lines activated through two stages is five, which is approximately halved compared to the eight positions of the conventional cache shown in FIG. Therefore, the power required for accessing the cache memory is greatly reduced.

【0006】[0006]

【発明が解決しようとする課題】ところが、前記の従来
型キャッシュは、キャッシュアクセスが生じるたびに全
てのウェイに対してタグ読み出しとライン読み出しが発
生するので、アクセス毎に全てのウェイが電力を消費す
るという欠点がある。一方、前記の段階型キャッシュ
は、従来型キャッシュに比べて電力が半減しているもの
の、キャッシュ・ヒットの時は、2段階のステップを踏
むのでアクセスの時間が長くなっており、高速に作動す
るというキャッシュメモリの本来の効果を半減させてい
る。本発明は、キャッシュメモリの高速化と低消費電力
化という相反する課題をトレードオフすることなく解決
するものであり、アクセス速度を低下させることなく低
消費エネルギー化を可能とするウェイ予測型キャッシュ
メモリとそのアクセス方法を提供することを目的とす
る。
However, in the above-mentioned conventional cache, tag reading and line reading occur for every way every time a cache access occurs, so that every way consumes power every access. There is a disadvantage of doing so. On the other hand, the above-mentioned tiered cache has half the power as compared with the conventional cache, but at the time of a cache hit, it takes two steps to access it for a long time and operates at high speed. The original effect of the cache memory is halved. The present invention solves the contradictory problems of high speed and low power consumption of a cache memory without trade-off, and a way prediction type cache memory that enables low energy consumption without lowering access speed. And to provide access to it.

【0007】[0007]

【課題を解決するための手段】そこで本発明のウェイ予
測型キャッシュメモリは、複数のウェイと、そのウェイ
の動作を制御するアクセスコントローラと、前記ウェイ
に格納されたタグの情報とプロセッサが出力した参照ア
ドレスのタグの情報を比較する比較器と、その比較器の
信号がオンになっているウェイのラインを出力するセレ
クタとからなるキャッシュメモリにおいて、タグ比較と
は独立にウェイ選択を行なうためのウェイ予測フラグお
よびそれを格納するためのウェイ予測テーブルと、前記
比較器の信号とキャッシュ・ミス時にリプレイス対象と
なるウェイを示す信号とを入力として次アクセスのため
に前記ウェイ予測テーブルのウェイ予測フラグの更新を
行うウェイ予測更新回路と、該ウェイ予測テーブルの信
号に基づいて前記ウェイの動作を制御するアクセスコン
トローラとを備えたことを特徴としている。そして、前
記ウェイ予測更新回路がウェイ予測フラグの更新を行っ
てウェイを予め指定するときは、最も新しく参照された
ウェイに対応するフラグを指定し、あるいは、ランダム
にウェイに対応するフラグを指定することを特徴として
いる。また、請求項4に記載のウェイ予測型キャッシュ
メモリのアクセス方法は、複数のウェイと、そのウェイ
の動作を制御するアクセスコントローラと、前記ウェイ
に格納されたタグの情報とプロセッサが出力した参照ア
ドレスのタグの情報を比較する比較器と、その比較器の
信号がオンになっているウェイのデータを出力するセレ
クタとからなるキャッシュメモリにおいて、前記ウェイ
の何れかを予め指定し、指定した唯一のウェイのタグと
ラインの情報を読み出し、プロセッサが出力した参照ア
ドレスのタグ情報と比較して読み出すべきウェイであれ
ばその情報の読み出しを終え、読み出すべきウェイでな
ければ、指定されなかった残りの全てのウェイを指定し
てタグとラインの情報を読み出し、何れかのタグ比較結
果がオンであればオンとなっているタグに対応するライ
ンを選択して参照データをプロセッサに供給し、何れの
タグ比較結果もオンでなければ、キャッシュ・リプレイ
ス・アルゴリズムに従ってラインの置換えを行うことを
特徴としている。請求項5に記載のウェイ予測型キャッ
シュメモリのアクセス方法は、複数のウェイと、そのウ
ェイの動作を制御するアクセスコントローラと、前記ウ
ェイに格納されたタグの情報とプロセッサが出力した参
照アドレスのタグの情報を比較する比較器と、その比較
器の信号がオンになっているウェイのデータを出力する
セレクタとからなるキャッシュメモリにおいて、前記ウ
ェイの何れかを予め指定し、指定した唯一のウェイのタ
グとラインの情報を読み出し、プロセッサが出力した参
照アドレスのタグ情報と比較して読み出すべきウェイで
あればその情報の読み出しを終え、読み出すべきウェイ
でなければ、指定されなかった全てのウェイを指定して
タグの情報を読み出し、何れかのタグとプロセッサが出
力した参照アドレスのタグフィールドが一致すればその
タグ比較結果に基づいて参照ラインだけを読み出しプロ
セッサに供給し、、一致しなければ置換えアルゴリズム
に従ってラインのリプレイスを行うことを特徴としてい
る。さらに、請求項4または請求項5に記載のウェイ予
測型キャッシュメモリのアクセス方法でウェイを予め指
定するときは、最も新しく参照されたウェイに指定する
こと、あるいは、ランダムに指定することを特徴として
いる。このような構成または方法により、予測ヒットの
場合にはキャッシュの性能を損なうことなく大幅な低消
費エネルギー化を可能とするができ、予測ミスがある場
合でもプロセッサによる全アクセスに占める予測ミスの
比率が非常に小さいので、全体として低消費エネルギー
化が可能となるのである。
SUMMARY OF THE INVENTION Accordingly, a way prediction cache memory according to the present invention provides a plurality of ways, an access controller for controlling the operation of the ways, information on tags stored in the ways, and output from a processor. In a cache memory comprising a comparator for comparing information of a tag of a reference address and a selector for outputting a line of a way in which the signal of the comparator is on, a method for selecting a way independently of tag comparison is provided. A way prediction flag, a way prediction table for storing the same, and a signal of the comparator and a signal indicating a way to be replaced at the time of a cache miss are input, and the way prediction flag of the way prediction table for the next access. And a way prediction updating circuit for updating the way prediction table based on a signal of the way prediction table. It is characterized by comprising an access controller for controlling the operation of E i. When the way prediction updating circuit updates the way prediction flag and designates a way in advance, the way designation flag designates the flag corresponding to the most recently referred way, or designates the flag corresponding to the way at random. It is characterized by: The method of accessing a way prediction type cache memory according to claim 4, further comprising: a plurality of ways; an access controller for controlling an operation of the way; information on a tag stored in the way; and a reference address output by the processor. In a cache memory consisting of a comparator for comparing information of a tag and a selector for outputting data of a way in which the signal of the comparator is turned on, any one of the ways is designated in advance, and only one designated way is designated. Read the tag and line information of the way and compare it with the tag information of the reference address output by the processor. If the way is to be read, finish reading that information. Tag and line information is read out, and if any tag comparison result is on, it is turned on. Select the line corresponding to Tsu with a tag supplies reference data to the processor, if also an on any tag comparison, is characterized by performing the replacement of the line according to the cache replacement algorithm. 6. The access method for a way predictive cache memory according to claim 5, wherein the plurality of ways, an access controller for controlling the operation of the way, the tag information stored in the way and the tag of the reference address output by the processor. In a cache memory consisting of a comparator for comparing the information of the way and a selector for outputting data of the way in which the signal of the comparator is turned on, any of the ways is designated in advance, and only the designated way is designated. Reads the tag and line information, compares it with the tag information of the reference address output by the processor, if it is a way to be read, finishes reading that information, and if it is not a way to read, specifies all unspecified ways Tag information and read the tag field of any tag and the reference address output by the processor. There has been characterized by performing replacement of the line according to the based on the tag comparison result is supplied to only the read processor reference line ,, matched unless replacement algorithm if they match. Furthermore, when a way is specified in advance by the access method of the way prediction type cache memory according to claim 4 or 5, the way is specified to the most recently referred way or specified at random. I have. With such a configuration or method, in the case of a prediction hit, it is possible to significantly reduce the energy consumption without impairing the cache performance, and even if there is a prediction miss, the ratio of the prediction miss to all accesses by the processor. Is so small that energy consumption can be reduced as a whole.

【0008】[0008]

【発明の実施の形態】以下、本発明の実施の形態につい
て図に基づいて説明する。図1は本発明のキャッシュメ
モリの構成を示すブロック図であり、図2はそのアクセ
ス方法を示すフローチャート、図3はアクセス中にキャ
ッシュ内のウェイがアクティブになっている状況を示す
図である。図1において、ウェイ21、22、23、2
4と、比較器31、32、33、34、セレクタ7は図
4に示したものと同じであり、アクセスコントローラ1
とエンコーダ4は図4のものに機能が少し追加されてい
るので重複部分の説明を省略する。1はウェイ21、2
2、23、24の動作を独立に制御することができるア
クセスコントローラであり、従来のSRAMアクセスコ
ントローラを拡張した回路である。5はウェイ21、2
2、23、24のステータス情報と比較器31、32、
33、34の信号とを受けて、予測がヒットしたかミス
したかを示す情報とキャッシュミスをしたかどうかを示
す情報を出力するとともに、現在参照されているセット
が次回アクセスされた時のウェイを予測してウェイ予測
フラグを更新する予測更新回路である。6はウェイ予測
更新回路5が予測した結果を受けて、ウェイを指定する
フラグを記録するウェイ予測テーブルである。アクセス
コントローラ1は予測更新回路5の情報と、ウェイ予測
テーブル6のウェイ予測フラグを受けてどのウェイをア
クティブにするかという指令を出力する。エンコーダ4
は予測がヒットした時、ウェイ予測テーブル6のウェイ
予測フラグを受けて、該当するウェイのデータのみを出
力するようセレクタ7 に指令を送る。なお、予測更新回
路5がウェイ予測テーブル6のウェイ予測フラグを更新
して予測する仕方には、最も新しく参照されたウェイを
見込みウェイにするやり方と、ランダムに選んで見込み
ウェイにするやり方があるが、使用されるプログラムと
キャッシュメモリとに依存するので、総合的な効果を比
較判断して何れを採用するかが決められる。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing a configuration of a cache memory according to the present invention, FIG. 2 is a flowchart showing an access method thereof, and FIG. 3 is a diagram showing a situation in which a way in a cache is active during access. In FIG. 1, ways 21, 22, 23, 2
4 and the comparators 31, 32, 33, and 34 and the selector 7 are the same as those shown in FIG.
Since the function of the encoder 4 is slightly added to that of FIG. 1 is way 21, 2
This is an access controller that can independently control the operations of 2, 23, and 24, and is a circuit that is an extension of the conventional SRAM access controller. 5 is way 21, 2
2, 23, 24 status information and comparators 31, 32,
In response to the signals 33 and 34, information indicating whether the prediction has been hit or missed and information indicating whether a cache miss has been made are output, and the currently referenced set is accessed when the set is accessed next time. And updates the way prediction flag. Reference numeral 6 denotes a way prediction table for recording a flag designating a way in response to a result predicted by the way prediction update circuit 5. The access controller 1 receives the information of the prediction update circuit 5 and the way prediction flag of the way prediction table 6 and outputs a command indicating which way is to be activated. Encoder 4
Receives a way prediction flag in the way prediction table 6 when a prediction hits, and sends a command to the selector 7 to output only data of the corresponding way. The way in which the prediction update circuit 5 updates the way prediction flag of the way prediction table 6 for prediction includes a method of making the most recently referred way a prospective way and a method of randomly selecting a way as a prospective way. Depends on the program to be used and the cache memory, and the overall effect is compared and determined to determine which one to adopt.

【0009】このような構成をしたウェイ予測型キャッ
シュメモリは図2のフローチャートが示す手順に沿って
動作する。その手順とは、初めのステップ(S1)で
は、参照アドレスが生成されるとすぐに予測フラグがウ
ェイ予測テーブル6から呼び出され、見込みウェイ、す
なわちプロセッサが参照するであろうと予測されたウェ
イが決められる。ステップ(S2)では、キャッシュア
クセスが開始され、プロセッサが出力したアドレスがデ
コードされる。そして、アクセスコントローラ2によっ
て該当するウェイが選択される。ステップ(S3)で
は、見込みウェイに対応して選択されたウェイからタグ
とラインが読み出される。ステップ(S4)では、見込
みウェイに対応するウェイのタグとプロセッサが出力す
る参照アドレスのタグフィールドTGの値が一致したか
どうかが判断される。一致すれば、ステップ(S5)で
ライン内の参照データが選択され、プロセッサにサービ
スされて処理、すなわちキャッシュメモリのアクセスが
終了する。ステップ(S4)で一致しなければ、ステッ
プ(S6)で、アクセスコントローラ1が見込みウェイ
を除く全てのウェイを指定し、それぞれに対応するタグ
とラインが同時に呼び出される。ステップ(S7)で
は、何れかのタグとプロセッサが出力する参照アドレス
のタグフィールドTGが一致したかどうかが判断され
る。具体的には、各比較器の2つの入力が一致しなけれ
ばLが出力され一致すればHが出力される。一致すれ
ば、ステップ(S8)で、タグの比較結果に基づいて該
当するウェイの参照ラインが選択され、参照データがプ
ロセッサにサービスされてステップ(S10)に移行す
る。その際、例えばウェイ1(22)のみがタグの比較
で一致し、その比較器(32)から1が出力されれば、
エンコーダ4がセレクタ7を制御してウェイ1 (22)
の参照ラインのみが選択されて出力される。ステップ
(S7)で一致しなければ、ステップ(S9)で従来と
同じ置き換えアルゴリズムに従ってラインのリプレース
が行われる。このリプレイスの動作手順については公知
であるで、説明を省略する。ステップ(S10)では、
予測ミスの場合、タグの比較結果に基づいて参照ライン
が存在するウェイのアドレスがウェイ予測テーブル6に
登録される。例えば、ステップ(S3)でウェイ1(2
2)が見込みウェイに該当せずに比較器32の出力がL
になれば、ウェイ0(21)、ウェイ2(23)、ウェ
イ3(24)のタグが比較され、ウェイ2(23)のタ
グが一致した場合、ウェイ0、1、2、3のキャッシュ
メモリ内のアドレスがそれぞれ00、01、10、11
であると仮定すると、ウェイ2(23)のアドレス10
がウェイ予測更新回路5からウェイ予測テーブル6に出
力され、ウェイ予測フラグが更新され、登録される。キ
ャッシュミスの場合、すなわちプロセッサが参照するデ
ータがキャッシュメモリにない場合、リプレイスの対象
となるウェイのアドレスがウェイ予測テーブル6に登録
されて処理、すなわちキャッシュメモリのアクセス、が
終了する。例えば、4つのウェイのうちウェイ3(2
4)が最も古く更新されていた場合、リプレイス・イン
されるデータセットがウェイ3(24)に格納されると
ともに、ウェイ3(24)が最も新しく更新されたとい
う情報と、そのアドレス11がウェイ予測フラグとして
ウェイ予測テーブル6に格納される。
The way prediction type cache memory having such a configuration operates according to the procedure shown in the flowchart of FIG. The procedure is as follows. In the first step (S1), a prediction flag is called from the way prediction table 6 as soon as a reference address is generated, and a prospective way, that is, a way predicted to be referred to by the processor is determined. Can be In step (S2), cache access is started, and the address output by the processor is decoded. Then, the corresponding way is selected by the access controller 2. In step (S3), tags and lines are read from the way selected corresponding to the prospective way. In step (S4), it is determined whether or not the tag of the way corresponding to the prospective way matches the value of the tag field TG of the reference address output by the processor. If they match, the reference data in the line is selected in step (S5) and serviced by the processor to complete the processing, that is, the access to the cache memory. If they do not match in step (S4), in step (S6), the access controller 1 specifies all the ways except the prospective way, and the corresponding tags and lines are called simultaneously. In step (S7), it is determined whether any tag matches the tag field TG of the reference address output by the processor. Specifically, if the two inputs of the comparators do not match, L is output, and if they match, H is output. If they match, in step (S8), the reference line of the corresponding way is selected based on the tag comparison result, the reference data is serviced by the processor, and the process proceeds to step (S10). At this time, for example, if only the way 1 (22) matches in the tag comparison, and the comparator (32) outputs 1,
Encoder 4 controls selector 7 to control way 1 (22)
Is selected and output. If they do not match in step (S7), the line is replaced in step (S9) according to the same replacement algorithm as in the past. The operation procedure of the replacement is publicly known, and the description is omitted. In step (S10),
In the case of a prediction error, the address of the way in which the reference line exists is registered in the way prediction table 6 based on the tag comparison result. For example, in step (S3), way 1 (2
2) does not correspond to the expected way and the output of the comparator 32 is L
, The tags of way 0 (21), way 2 (23), and way 3 (24) are compared, and if the tag of way 2 (23) matches, the cache memory of way 0, 1, 2, 3 Are 00, 01, 10, 11
, Address 10 of way 2 (23)
Is output from the way prediction updating circuit 5 to the way prediction table 6, and the way prediction flag is updated and registered. In the case of a cache miss, that is, when the data referred to by the processor is not in the cache memory, the address of the way to be replaced is registered in the way prediction table 6, and the processing, that is, the access to the cache memory is completed. For example, way 3 (2
If 4) has been updated the oldest, the data set to be replaced-in is stored in way 3 (24), and the information that way 3 (24) has been updated most recently and its address 11 are stored in way 3 (24). It is stored in the way prediction table 6 as a prediction flag.

【0010】図3はそのような動作手順におけるウェイ
の動作状態を示す図である。(a)はステップ(S3)
からステップ(S5)の間でウェイがアクティブになっ
ている状況を示しており、4つのウェイの内、参照アド
レスに一致した見込みウェイのみがアクティブになって
いることを示している。この場合、第1段階でヒットし
ており、アクティブになっているのが2個だけである。
(b)はステップ(S4)で一致しない場合の第2段階
の状況を示しており、ステップ(S6)からステップ
(S9)の間でウェイがアクティブになっている状況を
示している。第1段階でミスしたウェイを除いてアクテ
ィブになっており、この段階まで経過する場合は合わせ
て8個がアクティブになっている。この段階まで経過す
ると、従来型キャッシュと比べると消費電力が同じであ
り、アクセス時間が2倍になっている。次に、前記のウ
ェイ予測型キャッシュメモリのアクセス方法に段階型キ
ャッシュの手順を取り入れた方法について図8を用いて
説明する。この方法では、図2のステップ(S5)まで
が同じであるが、その後に段階型キャッシュの手順が追
加される。ステップ(S4)の比較で一致しなければ、
ステップ(S6)でアクセスコントローラ1が見込みウ
ェイを除く全てのウェイを指定し、それぞれに対応する
タグのみが読み出される。しかし、このステップではラ
インはまだ読み出されることはない。ステップ(S7)
では、何れかのタグと参照アドレスのタグフィールドT
Gが一致したかどうかが判断される。具体的には、各比
較器の2つの入力が一致しなければLが出力され一致す
ればHが出力される。一致すればステップ(S8)でタ
グの比較結果に基づいて該当するウェイの参照ラインだ
けが読み出され、ステップ(S9)で参照データがプロ
セッサにサービスされてステップ(S11)に移行す
る。その際、例えばウェイ1(22)のみがタグの比較
で一致し、その比較器(32)から1が出力されれば、
エンコーダ4がセレクタ7を制御してウェイ1 (22)
の参照ラインのみが選択されて出力される。ステップ
(S7)で一致しなければ、ステップ(S10)で従来
と同じ置き換えアルゴリズムに従ってラインのリプレイ
スが行われる。リプレイスの手順は前記の通りである。
ステップ(S11)では、予測ミスの場合、タグの比較
結果に基づいて参照ラインが存在するウェイのアドレス
がウェイ予測テーブル6に登録される。この方法による
各ウェイの動作状態は、第1段階が図3の(a)、第2
段階、第3段階が図7の(a)、(b)の組合せにな
る。なお、実施例ではウェイが4個の場合を示したが、
複数個であれば同じように動作するので、総合的な速度
や消費エネルギーを考慮して決めればよい。本発明を適
用した場合、第1段階までで終る場合と、第2 段階また
は第3段階まで要する場合とがあるが、CPUの実際の
動作と性質からみると、最近引用したデータが再度引用
されることが非常に多く、第1段階までで終る場合が非
常に多くなっている。その平均的なアクセス状況を具体
的に調べると、従来型キャッシュに比べてアクセス時間
が10%増加しているものの、エネルギー消費が70%
削減できることがわかった。このように、本発明のキャ
ッシュメモリとそのアクセス方法がCPUの性質を利用
し、見込みウェイを決めてアクセスしているので、キャ
ッシュメモリ全体としての消費電力を従来型のものにく
らべて大幅に低減することができるのである。
FIG. 3 is a diagram showing an operation state of a way in such an operation procedure. (A) is a step (S3)
From the step (S5) to the step (S5), and shows that, of the four ways, only the prospective way that matches the reference address is active. In this case, there are only two hits in the first stage and active.
(B) shows the situation of the second stage when the values do not match in step (S4), and shows the situation where the way is active between steps (S6) and (S9). Except for the way that was missed in the first stage, it is active, and when this stage has elapsed, a total of eight are active. At this stage, the power consumption is the same as compared with the conventional cache, and the access time is doubled. Next, a method in which a stepwise cache procedure is incorporated into the above-described way prediction type cache memory access method will be described with reference to FIG. In this method, the steps up to step (S5) in FIG. 2 are the same, but a step-by-step cache procedure is added thereafter. If there is no match in the comparison in step (S4),
In step (S6), the access controller 1 specifies all the ways except the prospective way, and only the corresponding tags are read. However, at this step, the lines have not yet been read. Step (S7)
Then, any tag and the tag field T of the reference address
It is determined whether or not G matches. Specifically, if the two inputs of the comparators do not match, L is output, and if they match, H is output. If they match, in step (S8), only the reference line of the relevant way is read based on the tag comparison result, and in step (S9), the reference data is serviced by the processor, and the process proceeds to step (S11). At this time, for example, if only the way 1 (22) matches in the tag comparison, and the comparator (32) outputs 1,
Encoder 4 controls selector 7 to control way 1 (22)
Is selected and output. If they do not match in step (S7), line replacement is performed in step (S10) according to the same replacement algorithm as in the past. The replacement procedure is as described above.
In step (S11), in the case of a prediction error, the address of the way in which the reference line exists is registered in the way prediction table 6 based on the tag comparison result. The operation state of each way according to this method is as follows.
The third and third stages are a combination of (a) and (b) in FIG. In the embodiment, the case where the number of ways is four is shown.
If there is more than one, they operate in the same way, so they may be determined in consideration of overall speed and energy consumption. When the present invention is applied, there are cases where the process ends up to the first stage and cases where the process requires the second stage or the third stage. In view of the actual operation and characteristics of the CPU, recently cited data is re-cited. Very often, and very often end up with the first stage. Specifically, the average access status shows that although the access time has increased by 10% compared to the conventional cache, the energy consumption has increased by 70%.
It turns out that it can be reduced. As described above, since the cache memory of the present invention and the access method thereof utilize the characteristics of the CPU and determine the expected way to access, the power consumption of the entire cache memory is significantly reduced as compared with the conventional type. You can do it.

【0011】[0011]

【発明の効果】以上述べたように、本発明によると、キ
ャッシュメモリのアクセス速度の低下をわずかに抑える
だけで電力消費を大幅に低減することができるので、適
用される計算機装置の実用性を高めることができるとい
う効果がある。
As described above, according to the present invention, the power consumption can be greatly reduced by only slightly suppressing the decrease in the access speed of the cache memory. There is an effect that it can be increased.

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

【図1】本発明のウェイ予測型キャッシュメモリのブロ
ック図
FIG. 1 is a block diagram of a way prediction type cache memory according to the present invention.

【図2】本発明のアクセス方法の手順を示すフローチャ
ート
FIG. 2 is a flowchart showing a procedure of an access method of the present invention.

【図3】本発明のウェイ予測型キャッシュメモリの動作
説明図
FIG. 3 is a diagram illustrating the operation of a way prediction cache memory according to the present invention;

【図4】従来のキャッシュメモリのブロック図FIG. 4 is a block diagram of a conventional cache memory.

【図5】従来のアクセス方法の手順を示すフローチャー
FIG. 5 is a flowchart showing a procedure of a conventional access method.

【図6】従来のキャッシュメモリの動作説明図FIG. 6 is a diagram illustrating the operation of a conventional cache memory.

【図7】従来のキャッシュメモリの動作説明図FIG. 7 is a diagram illustrating the operation of a conventional cache memory.

【図8】本発明の第2のアクセス方法の手順を示すフロ
ーチャート
FIG. 8 is a flowchart showing a procedure of a second access method of the present invention.

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

1 アクセスコントローラ 21、22、23、24 ウェイ 31、32、33、34 比較器 4 エンコーダ 5 予測更新回路 6 ウェイ予測テーブル 7 セレクタ Reference Signs List 1 access controller 21, 22, 23, 24 way 31, 32, 33, 34 comparator 4 encoder 5 prediction update circuit 6 way prediction table 7 selector

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】複数のウェイと、そのウェイの動作を制御
するアクセスコントローラと、前記ウェイに格納された
タグの情報とプロセッサが出力した参照アドレスのタグ
の情報を比較する比較器と、その比較器の信号がオンに
なっているウェイのデータを出力するセレクタとからな
るキャッシュメモリにおいて、タグ比較とは独立にウェ
イ選択を行なうためのウェイ予測フラグおよびそれを格
納するためのウェイ予測テーブルと、前記比較器の信号
とキャッシュ・ミス時にリプレイス対象となるウェイを
示す信号とを入力として次アクセスのために前記ウェイ
予測テーブルのウェイ予測フラグの更新を行うウェイ予
測更新回路と、前記ウェイ予測テーブルの信号に基づい
て前記ウェイの動作を制御するアクセスコントローラと
を備えたことを特徴とするウェイ予測型キャッシュメモ
リ。
1. A plurality of ways, an access controller for controlling the operation of the ways, a comparator for comparing information of a tag stored in the way with information of a tag of a reference address output by a processor, and the comparison Memory, comprising a selector for outputting data of a way whose signal is turned on, a way prediction flag for performing way selection independently of tag comparison, and a way prediction table for storing the same. A way prediction update circuit for updating the way prediction flag of the way prediction table for the next access by inputting a signal of the comparator and a signal indicating a way to be replaced at the time of a cache miss; An access controller for controlling the operation of the way based on a signal. Way predictive cache memory to be.
【請求項2】前記ウェイ予測更新回路がウェイ予測フラ
グの更新を行ってウェイを予め指定するときは、最も新
しく参照されたウェイに対応するフラグを指定すること
を特徴とする請求項1記載のウェイ予測型キャッシュメ
モリ。
2. The method according to claim 1, wherein when the way prediction updating circuit updates the way prediction flag and specifies a way in advance, the way prediction update circuit specifies a flag corresponding to the most recently referred way. Way prediction cache memory.
【請求項3】前記ウェイ予測更新回路がウェイ予測フラ
グの更新を行ってウェイを予め指定するときは、ランダ
ムにウェイに対応するフラグを指定することを特徴とす
る請求項1記載のウェイ予測型キャッシュメモリ。
3. The way prediction type according to claim 1, wherein when the way prediction updating circuit updates the way prediction flag and designates a way in advance, the way prediction type circuit randomly designates a flag corresponding to the way. Cache memory.
【請求項4】複数のウェイと、そのウェイの動作を制御
するアクセスコントローラと、前記ウェイに格納された
タグの情報とプロセッサが出力した参照アドレスのタグ
の情報を比較する比較器と、その比較器の信号がオンに
なっているウェイのデータを出力するセレクタとからな
るキャッシュメモリにおいて、前記ウェイの何れかを予
め指定し、指定した唯一のウェイのタグとラインの情報
を読み出し、プロセッサが出力した参照アドレスのタグ
情報と比較して読み出すべきウェイであればその情報の
読み出しを終え、読み出すべきウェイでなければ、指定
されなかった全てのウェイを指定してタグとラインの情
報を読み出し、何れかのタグ比較結果がオンであればオ
ンとなっているタグに対応するラインを選択して参照デ
ータをプロセッサに供給し、何れのタグ比較結果もオン
でなければ、キャッシュ・リプレイス・アルゴリズムに
従ってラインの置換えを行うことを特徴とするウェイ予
測型キャッシュメモリのアクセス方法。
4. A plurality of ways, an access controller for controlling the operation of the ways, a comparator for comparing tag information stored in the ways with tag information of a reference address output by a processor, In a cache memory consisting of a selector that outputs data of a way whose signal is turned on, one of the ways is designated in advance, tag and line information of the designated unique way is read, and the processor outputs If the way is to be read in comparison with the tag information of the reference address specified, the reading of the information is finished. If the way is not the way to be read, the tag and line information is read by specifying all the unspecified ways. If the tag comparison result is ON, select the line corresponding to the tag that is ON and process the reference data Supplied, if also an on any tag comparison result way predictive cache memory access method and performing replacement of the line according to the cache replacement algorithm.
【請求項5】複数のウェイと、そのウェイの動作を制御
するアクセスコントローラと、前記ウェイに格納された
タグの情報とプロセッサが出力した参照アドレスのタグ
の情報を比較する比較器と、その比較器の信号がオンに
なっているウェイのデータを出力するセレクタとからな
るキャッシュメモリにおいて、前記ウェイの何れかを予
め指定し、指定した唯一のウェイのタグとラインの情報
を読み出し、プロセッサが出力した参照アドレスのタグ
情報と比較して読み出すべきウェイであればその情報の
読み出しを終え、読み出すべきウェイでなければ、指定
されなかった全てのウェイを指定してタグの情報を読み
出し、何れかのタグとプロセッサが出力した参照アドレ
スのタグフィールドが一致すればそのタグ比較結果に基
づいて参照ラインだけを読み出しプロセッサに供給し、
一致しなければ置換えアルゴリズムに従ってラインのリ
プレイスを行うことを特徴とするウェイ予測型キャッシ
ュメモリのアクセス方法。
5. A plurality of ways, an access controller for controlling the operation of the ways, a comparator for comparing the information of the tags stored in the ways with the information of the tags of the reference addresses output by the processor, and the comparator In a cache memory consisting of a selector that outputs data of a way whose signal is turned on, one of the ways is designated in advance, tag and line information of the designated unique way is read, and the processor outputs If the way is to be read in comparison with the tag information of the reference address specified, the reading of the information is terminated. If the way is not the way to be read, the tag information is read by specifying all the unspecified ways. If the tag and the tag field of the reference address output by the processor match, the reference line based on the tag comparison result Only supplied to the read processor,
A method for accessing a way prediction type cache memory, characterized in that if they do not match, a line is replaced according to a replacement algorithm.
【請求項6】ウェイを予め指定するときは、最も新しく
参照されたウェイを指定することを特徴とする請求項4
または5記載のウェイ予測型キャッシュメモリのアクセ
ス方法。
6. The method according to claim 4, wherein when the way is designated in advance, the way referred to most recently is designated.
Or the access method of the way prediction type cache memory according to 5.
【請求項7】ウェイを予め指定するときは、ランダムに
指定することを特徴とする請求項4または5記載のウェ
イ予測型キャッシュメモリのアクセス方法。
7. The access method for a way prediction type cache memory according to claim 4, wherein when the way is designated in advance, the way is designated at random.
JP10283376A 1998-09-19 1998-09-19 Way predictive cache memory and access method therefor Pending JP2000099399A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10283376A JP2000099399A (en) 1998-09-19 1998-09-19 Way predictive cache memory and access method therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10283376A JP2000099399A (en) 1998-09-19 1998-09-19 Way predictive cache memory and access method therefor

Publications (1)

Publication Number Publication Date
JP2000099399A true JP2000099399A (en) 2000-04-07

Family

ID=17664713

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10283376A Pending JP2000099399A (en) 1998-09-19 1998-09-19 Way predictive cache memory and access method therefor

Country Status (1)

Country Link
JP (1) JP2000099399A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006120163A (en) * 2004-10-22 2006-05-11 Fujitsu Ltd Method, system, software and apparatus for reducing power of cache memory
WO2006101113A1 (en) * 2005-03-22 2006-09-28 Matsushita Electric Industrial Co., Ltd. Cache memory control method and cache memory control device
JP2014085890A (en) * 2012-10-24 2014-05-12 Fujitsu Ltd Memory device, arithmetic processing unit, and cache memory control method
JP2018190372A (en) * 2017-05-09 2018-11-29 晶心科技股▲ふん▼有限公司Andes Technology Corporation Processor and its way prediction method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006120163A (en) * 2004-10-22 2006-05-11 Fujitsu Ltd Method, system, software and apparatus for reducing power of cache memory
WO2006101113A1 (en) * 2005-03-22 2006-09-28 Matsushita Electric Industrial Co., Ltd. Cache memory control method and cache memory control device
US7636812B2 (en) 2005-03-22 2009-12-22 Panasonic Corporation Cache memory control method and cache memory control device
JP2014085890A (en) * 2012-10-24 2014-05-12 Fujitsu Ltd Memory device, arithmetic processing unit, and cache memory control method
JP2018190372A (en) * 2017-05-09 2018-11-29 晶心科技股▲ふん▼有限公司Andes Technology Corporation Processor and its way prediction method
US11281586B2 (en) 2017-05-09 2022-03-22 Andes Technology Corporation Processor and way prediction method thereof

Similar Documents

Publication Publication Date Title
US5210842A (en) Data processor having instruction varied set associative cache boundary accessing
US20100318742A1 (en) Partitioned Replacement For Cache Memory
JP4036206B2 (en) Set associative cache system and cache memory control method
US8347020B2 (en) Memory access controller, systems, and methods for optimizing memory access times
US6578065B1 (en) Multi-threaded processing system and method for scheduling the execution of threads based on data received from a cache memory
US6963962B2 (en) Memory system for supporting multiple parallel accesses at very high frequencies
US7093100B2 (en) Translation look aside buffer (TLB) with increased translational capacity for multi-threaded computer processes
US7822952B2 (en) Context switching device
US20020161976A1 (en) Data processor
US6952761B2 (en) Bus interface selection by page table attributes
US20100106910A1 (en) Cache memory and method of controlling the same
JP2000099399A (en) Way predictive cache memory and access method therefor
US7543127B2 (en) Computer system
US5724548A (en) System including processor and cache memory and method of controlling the cache memory
US8452920B1 (en) System and method for controlling a dynamic random access memory
US6880066B2 (en) Central processing unit and system having a prefetch queue and a command cache to perform an efficient information reading operation
JPH0659977A (en) Cache memory capable of executing indicative line substituting operation and its control method
JP2786886B2 (en) Prefetch control method and prefetch control device
JP2001216193A (en) Cache mechanism and operation control method of cache mechanism
KR20050095107A (en) Cache device and cache control method reducing power consumption
EP0502206A1 (en) System equipped with processor and cache memory, and method of controlling said cache memory
JP2003203486A (en) Semiconductor memory device and its control method
JP2003044357A (en) Cache prefetch system
KR100505633B1 (en) Data reading apparatus and method for cache memory
JPH01255944A (en) Cache memory