JP4918535B2 - Cache memory, cache memory device and allocation method - Google Patents

Cache memory, cache memory device and allocation method Download PDF

Info

Publication number
JP4918535B2
JP4918535B2 JP2008263175A JP2008263175A JP4918535B2 JP 4918535 B2 JP4918535 B2 JP 4918535B2 JP 2008263175 A JP2008263175 A JP 2008263175A JP 2008263175 A JP2008263175 A JP 2008263175A JP 4918535 B2 JP4918535 B2 JP 4918535B2
Authority
JP
Japan
Prior art keywords
data
cache
memory
address
data 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.)
Expired - Fee Related
Application number
JP2008263175A
Other languages
Japanese (ja)
Other versions
JP2009043282A (en
Inventor
修 遠藤
Original Assignee
ダッチエンタープライズ アイティ,エル.エル.シー.
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 ダッチエンタープライズ アイティ,エル.エル.シー. filed Critical ダッチエンタープライズ アイティ,エル.エル.シー.
Priority to JP2008263175A priority Critical patent/JP4918535B2/en
Publication of JP2009043282A publication Critical patent/JP2009043282A/en
Application granted granted Critical
Publication of JP4918535B2 publication Critical patent/JP4918535B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

本発明は、
本発明は、マイクロプロセッサに接続するキャッシュメモリに関し、特にそのデータメモリの構成に関する。
The present invention
The present invention relates to a cache memory connected to a microprocessor, and more particularly to the configuration of the data memory.

一般にキャッシュのデータメモリは1サイクルでリードおよびライトすることによりMPU(マイクロプロセッサ)の待ちサイクルを減らして高速動作を実現する。   In general, a cache data memory is read and written in one cycle, thereby reducing the number of MPU (microprocessor) wait cycles and realizing high-speed operation.

図2は、従来のセットアソシアティブのキャッシュメモリの構成図である。
図示例は、4ウェイのセットアソシアティブの構成であり、図中のウェイ1のデータメモリマクロ(ユニット)20〜23、ウェイ2のデータメモリマクロ30〜33、ウェイ3のデータメモリマクロ40〜43は、ウェイ0のデータメモリマクロ10〜13と同様の構成である。また、ライトデータD0〜D3は、それぞれセレクタ50〜53によりラインバッファ1のデータまたはMPUライトデータを選択した値で各データメモリマクロ10〜43に入力されるよう構成され、各データメモリマクロ10〜43からのリードデータは、セレクタ60〜63、70を介して出力されるようになっている。
FIG. 2 is a configuration diagram of a conventional set associative cache memory.
The illustrated example has a 4-way set associative configuration. The data memory macros (units) 20 to 23 of way 1, the data memory macros 30 to 33 of way 2, and the data memory macros 40 to 43 of way 3 in the figure are as follows: The data memory macros 10 to 13 of the way 0 have the same configuration. The write data D0 to D3 are configured to be input to the data memory macros 10 to 43 with values selected from the data in the line buffer 1 or the MPU write data by the selectors 50 to 53, respectively. The read data from 43 is output via selectors 60-63, 70.

キャッシュメモリでは、1サイクルでリードデータを出力するために、全ウェイの全ワード(図では4ワード)毎にデータメモリマクロ10〜43を用意する。全てのデータメモリマクロ10〜43のアドレス入力端子Aにアドレスを入力し、チップイネーブル入力端子CEにチップイネーブル0〜3[0:3]をアサートすることで、同時にリードすることができる。尚、[0:3]は、[0]〜[3]を表している。リードしたデータはワードアドレスとキャッシュヒットしたウェイ番号から必要なデータ一つを選択し、MPUに返送する。   In the cache memory, in order to output read data in one cycle, data memory macros 10 to 43 are prepared for every word (4 words in the figure) of all ways. By inputting an address to the address input terminal A of all the data memory macros 10 to 43 and asserting chip enable 0 to 3 [0: 3] to the chip enable input terminal CE, it is possible to read simultaneously. [0: 3] represents [0] to [3]. For the read data, one necessary data is selected from the word address and the way number where the cache hit occurs, and is returned to the MPU.

各データメモリマクロ10〜43へのライトはMPUからのライト要求またはキャッシュミスにより発生する。キャッシュミスによる場合、メモリシステムから読み出したデータがラインバッファ1に格納された後に発生する。全てのワードデータが揃うと、いずれか一つのウェイの全ワードのデータメモリマクロ10〜43に書き込みを行う。例えば、ウェイ0に書き込みを行う場合、1サイクルで全ワードを同時に書き込むために、データメモリマクロ10〜13のアドレス入力端子Aにアドレスを入力し、データ入力端子DにライトデータD0〜D3をそれぞれ入力し、ウェイ0の全ワードのチップイネーブル入力端子CEにチップイネーブル0[0:3]を、ライトイネーブル入力端子WEにライトイネーブル0[0:3]をアサートすることで、全ワード同時にライトすることができる。   Writing to each of the data memory macros 10 to 43 occurs due to a write request from the MPU or a cache miss. In the case of a cache miss, it occurs after the data read from the memory system is stored in the line buffer 1. When all the word data is prepared, writing is performed to the data memory macros 10 to 43 of all the words in any one way. For example, when writing to way 0, in order to write all words simultaneously in one cycle, an address is input to address input terminal A of data memory macros 10 to 13, and write data D0 to D3 are respectively input to data input terminal D. All the words are written simultaneously by asserting chip enable 0 [0: 3] to the chip enable input terminal CE of all words in way 0 and write enable 0 [0: 3] to the write enable input terminal WE. be able to.

図3は、アドレスフォーマットの説明図である。
MPUが出力するアドレスをキャッシュではタグデータ部X1、インデックスアドレス部X2、ワードアドレス部X3、バイトアドレス部X4に分けて使用する。タグデータ部X1はキャッシュのタグメモリに格納するデータである。MPUからのアクセス要求アドレスと有効なタグメモリのデータを比較して一致した時キャッシュヒットとなる。インデックスアドレス部X2はキャッシュの一つのウェイに登録できるライン数を示すビット数である。ワードアドレス部X3は1ラインのワード数を示すビット数であり、バイトアドレス部X4は1ワードのバイト数を示すビット数となる。
FIG. 3 is an explanatory diagram of an address format.
The address output by the MPU is divided into a tag data part X1, an index address part X2, a word address part X3, and a byte address part X4 in the cache. The tag data part X1 is data stored in the tag memory of the cache. When the access request address from the MPU matches the valid tag memory data, a cache hit occurs. The index address part X2 is the number of bits indicating the number of lines that can be registered in one way of the cache. The word address portion X3 is the number of bits indicating the number of words in one line, and the byte address portion X4 is the number of bits indicating the number of bytes in one word.

図4は、ウェイ0〜3の各データメモリマクロ10〜43のデータ格納位置の説明図である。
例えば、データメモリマクロ10〜13は、それぞれ図3のワードアドレス部X3における0〜3のデータに対応したデータを格納する。メモリアドレスはインデックスアドレス部X2と等しくする。ウェイ1〜ウェイ3のデータメモリマクロ20〜43も同様である。例として、リード/ライト時のデータ格納位置を網掛け部分で示す。MPUのリード要求アドレスがインデックスアドレス=0、ワードアドレス=2の場合、図4中の(x,0,z)のデータが読み出される。また、リードミスアドレスのインデックスアドレス=511、書き込みウェイ=0の場合は、図4中の(0,511,z)の箇所にラインバッファのデータが書き込まれる。
FIG. 4 is an explanatory diagram of data storage positions of the data memory macros 10 to 43 of the ways 0 to 3.
For example, the data memory macros 10 to 13 each store data corresponding to data 0 to 3 in the word address part X3 of FIG. The memory address is made equal to the index address part X2. The same applies to the data memory macros 20 to 43 of the ways 1 to 3. As an example, the data storage position at the time of reading / writing is indicated by a shaded portion. When the MPU read request address is index address = 0 and word address = 2, data (x, 0, z) in FIG. 4 is read. When the index address of the read miss address = 511 and the write way = 0, the data in the line buffer is written at the location (0,511, z) in FIG.

図5は、従来のフロアプラン例の説明図である。
ここでは、キャッシュのTAGメモリ部81、MPU82、制御部83、データメモリ部84のみ示している。また、80はLSIのダイサイズを示している。データメモリ部84にはデータメモリマクロ85を16個配置する。これらのデータメモリマクロ85は、図2におけるデータメモリマクロ10〜13、20〜23、30〜33、40〜43を示している。
FIG. 5 is an explanatory diagram of a conventional floor plan example.
Here, only the cache TAG memory unit 81, the MPU 82, the control unit 83, and the data memory unit 84 are shown. Reference numeral 80 denotes an LSI die size. In the data memory unit 84, 16 data memory macros 85 are arranged. These data memory macros 85 represent the data memory macros 10 to 13, 20 to 23, 30 to 33, and 40 to 43 in FIG.

図6は、データメモリマクロ10〜43のリード/ライト時のタイムチャートである。
データメモリマクロ10〜43はクロックに同期して動作する。リード時はクロックのエッジT2に対してアドレスRA1およびチップイネーブル0〜3[0:3]をアサートして入力する。リードデータRD1はクロックのエッジT3でMPUがラッチできるように出力される。ライト時(この例ではウェイ0へのライト)はクロックのエッジT4に対してアドレスWA2、ライトデータ0〜3WD2、チップイネーブル0[0:3]をアサート、ライトイネーブル0[0:3]をアサートして入力する。これによりライトデータ0〜3WD2の値がデータメモリマクロに書き込まれる。
FIG. 6 is a time chart when the data memory macros 10 to 43 are read / written.
The data memory macros 10 to 43 operate in synchronization with the clock. At the time of reading, the address RA1 and chip enable 0 to 3 [0: 3] are asserted and input to the clock edge T2. The read data RD1 is output so that the MPU can be latched at the clock edge T3. When writing (in this example, writing to way 0), address WA2, write data 0 to 3WD2, chip enable 0 [0: 3] are asserted and write enable 0 [0: 3] is asserted with respect to clock edge T4. And input. As a result, the values of the write data 0 to 3WD2 are written into the data memory macro.

しかしながら、上記従来の構成ではデータメモリマクロ10〜43をウェイ数×ワード数(上記例では16個)だけ用意して接続する必要があり、図5のフロアプラン例のようにMPU82とデータメモリマクロ85間の配線が長くなる箇所ができてしまい、その結果遅延が発生し高速動作の妨げとなっていた。またLSIの面積増によるLSI単価の上昇という問題点があった。   However, in the conventional configuration, it is necessary to prepare and connect the data memory macros 10 to 43 by the number of ways × the number of words (16 in the above example), and the MPU 82 and the data memory macro are connected as in the floor plan example of FIG. A portion where the wiring between 85 becomes long is formed, resulting in a delay, which hinders high-speed operation. In addition, there is a problem that the LSI unit price increases due to an increase in the area of the LSI.

本発明は、前述の課題を解決するため次の構成を採用する。
〈構成1〉
Nウェイのセットアソシアティブ方式に基づいてキャッシュデータを格納するよう設定され、複数のキャッシュデータにそれぞれ対応する複数の格納位置を有する複数のデータメモリマクロユニットを備え、各格納位置は、Nウェイの1つを識別するために用いられるウェイ番号と、メインメモリのキャッシュデータのそれぞれが格納されているアドレスに対応する部分によって決定されるインデックス番号と、メインメモリの対応するアドレスの他の部分によって決定されるワード番号によって指定され、複数のデータメモリマクロユニットは、それぞれ同時にアクセス可能なキャッシュメモリにおいて、複数のデータメモリマクロユニットに対しN個のキャッシュデータを同時書き込み許可するべく、複数のデータメモリマクロユニットのいずれか1つのデータ入力端子にそれぞれ接続されている複数のマルチプレクサを備え、同一のインデックス番号及び相違するワード番号によって指定されたそれぞれのキャッシュデータは、各データメモリマクロユニットに共通に格納され、同一のインデックス番号及び相違するウェイ番号によって指定されたそれぞれのキャッシュデータは、相違するデータメモリマクロユニットに格納されることを特徴とするキャッシュメモリ。
The present invention employs the following configuration in order to solve the above-described problems.
<Configuration 1>
It is set to store cache data based on the N-way set associative method, and includes a plurality of data memory macro units each having a plurality of storage positions respectively corresponding to a plurality of cache data. Is determined by the way number used to identify each, the index number determined by the portion corresponding to the address where each cache data in the main memory is stored, and the other portion corresponding to the address in the main memory. A plurality of data memory macro units in a cache memory that can be accessed simultaneously, so that N cache data can be simultaneously written to the plurality of data memory macro units. A plurality of multiplexers respectively connected to any one of the data input terminals are provided, and the respective cache data designated by the same index number and different word numbers are stored in common in each data memory macro unit, and the same Each cache data designated by an index number and a different way number is stored in a different data memory macro unit.

〈構成2〉
他の発明は、Nウェイのセットアソシアティブ方式に基づいてメインメモリからのデータを格納するよう設定されている多数のデータメモリマクロユニットを備え、データメモリマクロユニットの数がウェイNの数と等しく、データメモリマクロユニットがデータを格納可能に複数の格納位置が割り当てられているキャッシュメモリにおいて、各格納位置は、データのそれぞれの一部を格納するように設定され、Nウェイの1つを識別するために用いられるウェイ番号と、データの一部が格納されているメインメモリのアドレスに対応する部分によって決定されているインデックス番号と、メインメモリ内の対応するアドレスの他の部分によって決定されているワード番号とによって指定され、同一のインデックス番号及び相違するワード番号によって指定された各データは、各データメモリマクロユニットに共通に格納され、同一のインデックス番号及び相違するウェイ番号によって指定された各データは、相違するデータメモリマクロユニットに格納されることを特徴とするキャッシュメモリ。
<Configuration 2>
Another invention comprises a number of data memory macro units configured to store data from main memory based on an N-way set associative scheme, the number of data memory macro units being equal to the number of ways N; In a cache memory in which a plurality of storage locations are allocated so that the data memory macro unit can store data, each storage location is set to store a part of the data and identifies one of the N ways Is determined by the way number used for this purpose, the index number determined by the part corresponding to the address of the main memory where a part of the data is stored, and the other part of the corresponding address in the main memory. The same index number and different word numbers. Each data specified by the data memory macro unit is stored in common in each data memory macro unit, and each data specified by the same index number and different way numbers is stored in different data memory macro units. To cache memory.

〈構成3〉
また、他の発明は、マイクロプロセッシングユニット(MPU)と、MPUと組み合わされているメインメモリと、MPUによるデータ処理可能にメインメモリからのデータを格納するよう設定されているキャッシュメモリとを含み、該キャッシュメモリは、Nウェイのセットアソシアティブ方式に基づいてデータを格納する複数のデータメモリマクロユニットを備え、複数のデータメモリマクロユニットの数は、ウェイNの数と等しいことを特徴とするキャッシュメモリ装置。
<Configuration 3>
Another invention includes a microprocessing unit (MPU), a main memory combined with the MPU, and a cache memory set to store data from the main memory so that the data can be processed by the MPU. The cache memory includes a plurality of data memory macro units for storing data based on an N-way set associative method, and the number of the plurality of data memory macro units is equal to the number of ways N. apparatus.

〈構成4〉
更に他の発明は、複数のデータメモリマクロユニットを有するキャッシュメモリに格納位置を割り当てる方法であって、複数のデータメモリマクロユニットの数が、ウェイNの数と等しく、各格納位置は、キャッシュデータのそれぞれの一部を格納するように設定され、Nウェイの1つを識別するために用いられるウェイ番号と、キャッシュデータの各一部が格納されているメインメモリのアドレスに対応する部分によって決定されているインデックス番号と、メインメモリ内の対応するアドレスの他の部分によって決定されているワード番号とによって指定され、割り当てられた格納位置に対応させて、メインメモリからのデータをキャッシュメモリに格納することを特徴とする割当て方法。
<Configuration 4>
Yet another invention is a method of assigning storage locations to a cache memory having a plurality of data memory macro units, wherein the number of data memory macro units is equal to the number of ways N, and each storage location is stored in cache data. Is determined to be stored in accordance with the way number used to identify one of the N ways and the part corresponding to the address of the main memory in which each part of the cache data is stored. The data from the main memory is stored in the cache memory according to the assigned storage location specified by the index number being assigned and the word number determined by the other part of the corresponding address in the main memory An allocation method characterized by:

本発明によれば、Nウェイのセットアソシアティブ方式のキャッシュメモリであっても最少としてN個のデータメモリマクロを設ければよいので、高速にアクセスすることができる上に配置空間を小さくすることができる。   According to the present invention, even if it is an N-way set associative cache memory, it is sufficient to provide at least N data memory macros, so that access can be made at high speed and the arrangement space can be reduced. it can.

以下、本発明の実施の形態を具体例を用いて詳細に説明する。
《具体例》
図1は、本発明のキャッシュメモリにおけるデータ格納位置の説明図であるが、これに先立ち、キャッシュメモリの構成について説明する。
Hereinafter, embodiments of the present invention will be described in detail using specific examples.
"Concrete example"
FIG. 1 is an explanatory diagram of data storage positions in the cache memory of the present invention. Prior to this, the configuration of the cache memory will be described.

図7は、具体例のキャッシュメモリの構成図である。
図示のキャッシュメモリは、ラインバッファ1、データメモリマクロ100〜103、セレクタ200〜203、300〜303、400からなる。ラインバッファ1は、従来と同様に、複数のワードデータを格納するラインバッファであり、本具体例では4ワードを格納するよう構成されている。データメモリマクロ100〜103は、それぞれが同時にアクセス可能なメモリブロックで、そのキャッシュメモリのウェイ数以上設けられるもので、本具体例ではウェイ数と等しい4個が設けられている。これらのデータメモリマクロ100〜103は、それぞれ図4に示した従来のデータメモリマクロの一つ分と比べて、ワード数4の場合、4倍の容量となる。但し、データメモリマクロの個数は1/4であるためメモリの総容量は変わらない。
FIG. 7 is a configuration diagram of a cache memory of a specific example.
The illustrated cache memory includes a line buffer 1, data memory macros 100 to 103, and selectors 200 to 203, 300 to 303, and 400. The line buffer 1 is a line buffer that stores a plurality of word data, as in the prior art, and is configured to store 4 words in this specific example. Each of the data memory macros 100 to 103 is a memory block that can be accessed at the same time, and is provided more than the number of ways of the cache memory. In this specific example, four data memory macros 100 to 103 are provided. Each of these data memory macros 100 to 103 has a capacity four times that of the conventional data memory macro shown in FIG. However, since the number of data memory macros is 1/4, the total capacity of the memory does not change.

各データメモリマクロ100〜103には、そのアドレス入力端子Aにアドレス0〜3が、データ入力端子Dにはセレクタ300〜303の出力が、チップイネーブル入力端子CEにはチップイネーブル0〜3が、ライトイネーブル入力端子WEにはライトイネーブル0〜3が入力されるよう構成され、その出力Qはセレクタ400に入力されるよう構成されている。尚、これらのデータ格納位置の詳細については図1を参照して後述する。   Each of the data memory macros 100 to 103 has addresses 0 to 3 at its address input terminal A, outputs of the selectors 300 to 303 at the data input terminal D, and chip enables 0 to 3 at the chip enable input terminal CE. Write enable 0 to 3 are input to the write enable input terminal WE, and the output Q is input to the selector 400. Details of these data storage positions will be described later with reference to FIG.

セレクタ200〜203は、それぞれラインバッファ1から出力された各ワードのライトデータD0〜D3を選択するためのセレクタであり、その選択出力はセレクタ300〜303に入力されるようになっている。セレクタ300〜303は、それぞれ、MPUライトデータと、セレクタ200〜203の出力を選択するためのセレクタであり、その選択出力は各データメモリマクロ100〜103のデータ入力端子Dに入力されるようになっている。セレクタ400は、各データメモリマクロ100〜103の出力Qを入力し、その選択出力をリードデータとして送出するセレクタである。   The selectors 200 to 203 are selectors for selecting the write data D0 to D3 of each word output from the line buffer 1, and the selection outputs are input to the selectors 300 to 303. The selectors 300 to 303 are selectors for selecting the MPU write data and the outputs of the selectors 200 to 203, respectively, and the selection outputs are input to the data input terminals D of the data memory macros 100 to 103, respectively. It has become. The selector 400 is a selector that receives the output Q of each of the data memory macros 100 to 103 and sends the selected output as read data.

次に、図1を用いて本具体例の各データメモリマクロ100〜103のデータ格納状態を説明する。
図1に示すように、本具体例の各データメモリマクロ100〜103は、同一インデックスアドレスのワードアドレス毎に異なるウェイ番号となり、かつ、各ウェイの同一インデックスで同一ワードアドレスのデータは各データメモリマクロ100〜103に格納されるよう構成されている。例えば、データメモリマクロ100のメモリアドレス0にはウェイ0のインデックスアドレス0、ワードアドレス0のデータを格納する。また、メモリアドレス1には、ウェイ1のインデックスアドレス0、ワードアドレス1のデータを、メモリアドレス2には、ウェイ2のインデックスアドレス0、ワードアドレス2のデータを割り当てるといったように、本具体例では、各データメモリマクロ100〜103のそれぞれにワードアドレスを組み込んで割り付けている。従って、このデータ格納位置に対応するよう、メモリアドレスはインデックスアドレス部X2とワードアドレス部X3で構成する。例えば、具体例ではインデックスアドレスが512通り、ワードアドレスが4通りであるからメモリアドレスは0〜2047となる。
Next, the data storage state of each of the data memory macros 100 to 103 according to this specific example will be described with reference to FIG.
As shown in FIG. 1, each data memory macro 100-103 of this specific example has a different way number for each word address of the same index address, and data of the same word address in the same index of each way is stored in each data memory. The macros 100 to 103 are configured to be stored. For example, data of index address 0 and word address 0 of way 0 is stored in memory address 0 of data memory macro 100. In this specific example, memory address 1 is assigned data of index address 0 and word address 1 of way 1, and memory address 2 is assigned data of index address 0 and word address 2 of way 2. A word address is incorporated and assigned to each of the data memory macros 100 to 103. Therefore, the memory address is composed of the index address part X2 and the word address part X3 so as to correspond to this data storage position. For example, in the specific example, there are 512 index addresses and 4 word addresses, so the memory addresses are 0-2047.

また、各データメモリマクロ100〜103は、同一インデックスアドレスかつ同一ワードアドレスで四つのウェイのデータをリードできるように、各データメモリマクロ100〜103毎に、同一インデックスアドレスおよび同一ワードアドレスのウェイ番号が一つずつずれて割り付けられている。   In addition, each data memory macro 100 to 103 can read four ways of data with the same index address and the same word address, and each data memory macro 100 to 103 has a way number with the same index address and the same word address. Are assigned one by one.

即ち、本具体例のデータメモリマクロ100〜103は、リード時は、特定のインデックスかつ特定のワードの全てのウェイのデータをリードでき、また、ライト時は、特定インデックスかつ特定のウェイの全ワードのデータをライトできるという構成において、データメモリマクロの個数を最小限にするという目的で構成されているものである。   That is, the data memory macros 100 to 103 of this specific example can read data of all ways of a specific index and a specific word when reading, and all words of a specific index and a specific way when writing. In this configuration, the number of data memory macros can be minimized.

そして、このように割り付けられたデータメモリマクロ100〜103に対するリード/ライト時のアドレスは次のようになっている。
●リード時のメモリアドレス=MPU要求アドレスのうち、インデックスアドレスとワードアドレス部分
●ライト時のメモリアドレス
インデックス部=キャッシュミスしたアドレスのインデックスアドレス部
ワード部=(ライトしたいウェイ番号−データメモリ番号+4)÷4の剰余
The addresses at the time of reading / writing with respect to the data memory macros 100 to 103 allocated in this way are as follows.
● Memory address at read = Index address and word address part of MPU request address ● Memory address at write Index part = Index address part of cache missed word Word part = (Way number to write-Data memory number + 4) ÷ remainder of 4

また、リード時にセレクタ400で選択するデータやライト時にセレクタ200〜203で選択するデータは以下の式に従って操作する。
●各データメモリマクロ100〜103から読み出されるデータのウェイ番号=(ワードアドレス+データメモリ番号)÷4の剰余
●各データメモリマクロ100〜103へのライトデータのワード番号=ライトアドレスのワード部と同じ
Further, the data selected by the selector 400 at the time of reading and the data selected by the selectors 200 to 203 at the time of writing are operated according to the following equations.
-Way number of data read from each data memory macro 100-103 = (word address + data memory number) ÷ 4 remainder-Word number of write data to each data memory macro 100-103 = word part of write address the same

〈動作〉
このように構成されたキャッシュメモリでは、上述したメモリアドレスとリード/ライト時のデータ選択操作により、従来と同様に1サイクルで全ウェイからのリードおよび一つのウェイへの全ワードライトが可能となる。
<Operation>
In the cache memory configured as described above, the memory address and the data selection operation at the time of reading / writing enable the reading from all the ways and the writing of all the words to one way in the same manner as in the past. .

例えば、MPUのリード要求アドレスがインデックスアドレス=0、ワードアドレス=2の場合、図1に示した各データメモリマクロ100〜103の(2,0,2)、(3,0,2)、(0,0,2)、(1,0,2)のデータが読み出される(図中、網掛けA部分に示す)。従って、データメモリマクロ100〜103に対応するウェイの順番は、2,3,0,1となっている。また、リードミスアドレスのインデックスアドレス=511、書き込みウェイ=0であった場合は、各データメモリマクロ100〜103の(0,511,0)、(0,511,3)、(0,511,2)、(0,511,1)、の箇所にラインバッファ1のデータ(ライトデータ0〜3)がそれぞれ書き込まれる(図中、網掛けB部分に示す)。この時、データメモリマクロ100〜103に対応するワードアドレスの順番は、0,3,2,1となる。   For example, when the MPU read request address is index address = 0 and word address = 2, (2, 0, 2), (3, 0, 2), (3, 0) of each of the data memory macros 100 to 103 shown in FIG. 0, 0, 2) and (1, 0, 2) are read (shown in shaded area A in the figure). Therefore, the order of ways corresponding to the data memory macros 100 to 103 is 2, 3, 0, 1. Further, when the index address of the read miss address = 511 and the write way = 0, (0,511,0), (0,511,3), (0,511,2) of each data memory macro 100-103. ), (0, 511, 1), the data (write data 0 to 3) of the line buffer 1 are respectively written (shown in the shaded area B in the figure). At this time, the order of the word addresses corresponding to the data memory macros 100 to 103 is 0, 3, 2, 1.

図8は、本具体例のフロアプラン例の説明図である。
従来に比べて、データメモリマクロが4個になったため、データメモリ部91が小さくなり、従って、従来のLSIのダイサイズ80に比べて本具体例のダイサイズ90は小さくすることができる。
FIG. 8 is an explanatory diagram of a floor plan example of this specific example.
Since the number of data memory macros is four as compared with the prior art, the data memory unit 91 becomes smaller. Therefore, the die size 90 of this example can be made smaller than the die size 80 of the conventional LSI.

図9は、本具体例のリード/ライト時のタイムチャートである。
データメモリマクロ100〜103は、クロックに同期して動作する。リード時はクロックのエッジT2に対してアドレス0〜3およびチップイネーブル0〜3をアサートして入力する。この時、アドレス0〜3は同じアドレスでよい。リードデータはクロックのエッジT3でサンプルできるタイミングで有効なデータを出力する。この時、各データメモリマクロ100〜103からはアドレスで指定された各ウェイのデータが出力されている。
FIG. 9 is a time chart at the time of reading / writing of this specific example.
The data memory macros 100 to 103 operate in synchronization with the clock. At the time of reading, addresses 0 to 3 and chip enables 0 to 3 are asserted and input to the clock edge T2. At this time, the addresses 0 to 3 may be the same address. The read data is output as valid data at a timing that can be sampled at the clock edge T3. At this time, each data memory macro 100 to 103 outputs data of each way designated by the address.

ライト時はクロックのエッジT4に対してアドレス0〜3およびライトデータ0〜3を入力する。この時のアドレス0〜3のインデックスアドレスは同一で、ワードアドレスは書き込みたいウェイ番号により決められた値を供給する。また、この決められたワードアドレスに対応するライトデータ0〜3の一つが選択されてデータメモリマクロ100〜103へのライトデータとなる。同じタイミングでチップイネーブル0〜3およびライトイネーブル0〜3がアサートされる。これによりデータメモリマクロ100〜103にデータが書き込まれる。   At the time of writing, addresses 0 to 3 and write data 0 to 3 are input to the clock edge T4. At this time, the index addresses 0 to 3 are the same, and the word address supplies a value determined by the way number to be written. Also, one of the write data 0 to 3 corresponding to the determined word address is selected and becomes the write data to the data memory macros 100 to 103. At the same timing, chip enable 0-3 and write enable 0-3 are asserted. As a result, data is written to the data memory macros 100 to 103.

〈効果〉
以上のように、具体例によれば、各データメモリマクロにおけるデータ格納位置を、同一インデックスのワードアドレス毎に別のウェイ番号とし、かつ、各ウェイの同一インデックスで同一ワードアドレスのデータは各データメモリマクロ毎に格納するようにしたので、データメモリマクロの数を従来の16個から4個に削減することができ、その結果、図8に示すように、例えばMPUとデータメモリマクロ100〜103間の配線を短くすることができる。これにより配線遅延、リピータによる遅延も小さく抑えることができ、性能向上を図ることができる。また、一般にデータメモリマクロは同じ容量を複数個で実現するより1個で実現する方が面積は小さくなる。これは1個にまとめることで共有できる部分(信号、電源の配線など)が増え、その分面積は小さくすることができるからである。これによりLSIの面積も削減することができ、LSI単価を抑えることができる。また、同一メモリアドレスで特定のワードの全てのウェイのデータをリードすることができるため、キャッシュメモリとしての高速性を損なうことがない。
<effect>
As described above, according to the specific example, the data storage position in each data memory macro is set to a different way number for each word address of the same index, and the data of the same word address in the same index of each way is each data Since the data is stored for each memory macro, the number of data memory macros can be reduced from 16 to 4 as a result. As a result, as shown in FIG. 8, for example, MPU and data memory macros 100 to 103 are used. The wiring between them can be shortened. As a result, the delay due to the wiring delay and the repeater can be suppressed to be small, and the performance can be improved. Further, in general, the area of the data memory macro is smaller when the same capacity is realized by one rather than by a plurality. This is because the number of parts (signals, power supply wirings, etc.) that can be shared increases by combining them into one, and the area can be reduced accordingly. As a result, the area of the LSI can be reduced, and the LSI unit price can be reduced. In addition, since data of all ways of a specific word can be read at the same memory address, high speed performance as a cache memory is not impaired.

《利用形態》
具体例のデータメモリマクロ100〜103のデータ格納位置ではワードアドレスをメモリアドレスのLSB側に割り当てたがその他のビットに割り当ててもよい。
また、具体例のデータメモリマクロはLSI内部で使用することを例として説明したが、これに限定されるものではなく、例えばSRAMのIC部品としてLSI外部で使用しても適用可能である。この場合は、ICの数を減らすことができる。
<< Usage form >>
In the data storage positions of the data memory macros 100 to 103 in the specific example, the word address is assigned to the LSB side of the memory address, but may be assigned to other bits.
Further, the specific example of the data memory macro has been described as being used inside the LSI. However, the present invention is not limited to this. For example, the data memory macro can be applied as an SRAM IC component outside the LSI. In this case, the number of ICs can be reduced.

上記具体例では、ウェイ数4、ワード数4で説明したが、他のウェイ数、ワード数でも適用可能である。この場合、データメモリマクロの数はウェイ数と同じかそれ以上とし、ウェイ数よりワード数が多い場合は、一つのデータメモリマクロのビット幅を2ワード以上とする。そして、これらのワードは同一のウェイとする。例えば、ウェイ数4、ワード数8の場合は、データメモリマクロを4として、一つのデータメモリマクロのビット幅を2ワードとする。   In the above specific example, the number of ways is 4 and the number of words is 4. However, other ways and words are also applicable. In this case, the number of data memory macros is equal to or greater than the number of ways, and if the number of words is greater than the number of ways, the bit width of one data memory macro is set to two or more words. These words are the same way. For example, when the number of ways is 4 and the number of words is 8, the data memory macro is 4 and the bit width of one data memory macro is 2 words.

図10は、ウェイ数4、ワード数8の場合のデータ格納位置の説明図である。
図示のように、各データメモリマクロ100〜103の同一メモリアドレスに対してそれぞれ2ワードが割り当てられている。これにより、リード時は、各ウェイの同一の2ワード単位でリードし、ライト時は、対象となるウェイの全ワード(0〜7)をライトする。
FIG. 10 is an explanatory diagram of data storage positions when the number of ways is 4 and the number of words is 8.
As shown in the figure, two words are assigned to the same memory address of each of the data memory macros 100 to 103. Thereby, at the time of reading, reading is performed in units of the same two words of each way, and at the time of writing, all words (0 to 7) of the target way are written.

また、上記具体例では、図1に示すようなデータ格納状態としたが、各データメモリブロックにおけるデータ格納位置を、(同一インデックスの)ワードアドレス毎に別のウェイ番号とし、かつ、各ウェイの同一インデックスで同一ワードアドレスのデータは各データメモリ毎に別に格納する構成であれば、このような割付に限定されるものではない。   In the above specific example, the data storage state is as shown in FIG. 1, but the data storage position in each data memory block is set to a different way number for each word address (of the same index), and As long as the data of the same index and the same word address is stored separately for each data memory, it is not limited to such allocation.

図11は、データ格納位置の変形例を示す説明図である。
この例は、ライト時(図中、Bで示す)に各データメモリマクロ100〜103の同一メモリアドレスでアクセスするように配置したものである。この場合のデータメモリマクロ100〜103に対するリード/ライト時のアドレスは次のようになる。
●リード時のメモリアドレス
インデックス部=MPU要求アドレスのインデックスアドレスと同じ
ワード部=(MPU要求アドレスのワードアドレス−データメモリ番号+4)÷4の剰余
●ライト時のメモリアドレス
インデックス部=キャッシュミスしたアドレスのインデックスアドレス
ワード部=ウェイ番号
FIG. 11 is an explanatory diagram showing a modification of the data storage position.
In this example, the data memory macros 100 to 103 are arranged to be accessed at the same memory address during writing (indicated by B in the figure). In this case, addresses at the time of reading / writing with respect to the data memory macros 100 to 103 are as follows.
● Memory address at the time of reading Index part = Same as index address of MPU request address Word part = (word address of MPU request address-data memory number + 4) ÷ 4 remainder ● Memory address at the time of writing Index part = address where cache missed Index address Word part = Way number

また、リード時にセレクタ400で選択するデータやライト時にセレクタ200〜203で選択するデータは以下の式に従って操作する。
●各データメモリマクロ100〜103から読み出されるデータのウェイ番号=(MPU要求アドレスのワードアドレス−データメモリ番号+4)÷4の剰余
●各データメモリマクロ100〜103へのライトデータのワード番号=(ウェイ番号+データメモリ番号)÷4の剰余
Further, the data selected by the selector 400 at the time of reading and the data selected by the selectors 200 to 203 at the time of writing are operated according to the following equations.
● Way number of data read from each data memory macro 100-103 = (MPU request address word address−data memory number + 4) ÷ 4 remainder ● Word number of write data to each data memory macro 100-103 = ( Way number + data memory number) ÷ 4 remainder

例えば、MPUのリード要求アドレスがインデックスアドレス=0、ワードアドレス=2の場合、図1に示した各データメモリマクロ100〜103の(2,0,2)、(1,0,2)、(0,0,2)、(3,0,2)のデータが読み出される(図中、網掛けA部分に示す)。従って、データメモリマクロ100〜103に対応するウェイの順番は、2,1,0,3となっている。また、リードミスアドレスのインデックスアドレス=511、書き込みウェイ=0であった場合は、各データメモリマクロ100〜103の(0,511,0)、(0,511,1)、(0,511,2)、(0,511,3)の箇所にラインバッファ1のデータ(ライトデータ0〜3)がそれぞれ書き込まれる(図中、網掛けB部分に示す)。この時、データメモリマクロ100〜103に対応するワードアドレスの順番は、0,1,2,3となる。   For example, when the MPU read request address is index address = 0 and word address = 2, (2, 0, 2), (1, 0, 2), (1,0) of each of the data memory macros 100 to 103 shown in FIG. Data of (0, 0, 2) and (3, 0, 2) are read (shown in shaded area A in the figure). Therefore, the order of ways corresponding to the data memory macros 100 to 103 is 2, 1, 0, 3. If the index address of the read miss address = 511 and the write way = 0, (0, 511, 0), (0, 511, 1), (0, 511, 1) of each data memory macro 100-103. ) And (0, 511, 3), the data (write data 0 to 3) of the line buffer 1 are respectively written (shown in the shaded area B in the figure). At this time, the order of the word addresses corresponding to the data memory macros 100 to 103 is 0, 1, 2, 3.

本発明のキャッシュメモリにおけるデータ格納位置の説明図である。It is explanatory drawing of the data storage position in the cache memory of this invention. 従来のキャッシュメモリの構成図である。It is a block diagram of the conventional cache memory. アドレスフォーマットの説明図である。It is explanatory drawing of an address format. 従来のデータ格納位置の説明図である。It is explanatory drawing of the conventional data storage position. 従来のフロアプラン例の説明図である。It is explanatory drawing of the example of the conventional floor plan. 従来例のリード/ライト時のタイムチャートである。It is a time chart at the time of the read / write of a prior art example. 具体例のキャッシュメモリの構成図である。It is a block diagram of the cache memory of an example. 具体例のフロアプラン例の説明図である。It is explanatory drawing of the example of a floor plan of a specific example. 具体例のリード/ライト時のタイムチャートである。It is a time chart at the time of read / write of a specific example. ウェイ数4、ワード数8の場合のデータ格納位置の説明図である。It is explanatory drawing of the data storage position in the case of 4 ways and 8 words. データ格納位置の変形例を示す説明図である。It is explanatory drawing which shows the modification of a data storage position.

符号の説明Explanation of symbols

100〜103 データメモリマクロ   100 to 103 data memory macro

Claims (10)

Nウェイのセットアソシアティブ方式に基づいてキャッシュデータを格納するよう設定され、複数のキャッシュデータにそれぞれ対応する複数の格納位置を有する複数のデータメモリマクロユニットを備え、
各前記格納位置は、前記Nウェイの1つを識別するために用いられるウェイ番号と、
メインメモリの前記キャッシュデータのそれぞれが格納されているアドレスに対応する部分によって決定されるインデックス番号と、
前記メインメモリの前記対応するアドレスの他の部分によって決定されるワード番号によって指定され、
前記複数のデータメモリマクロユニットは、それぞれ同時にアクセス可能なキャッシュメモリにおいて、
前記複数のデータメモリマクロユニットに対しN個のキャッシュデータを同時書き込み許可するべく、前記複数のデータメモリマクロユニットのいずれか1つのデータ入力端子にそれぞれ接続されている複数のマルチプレクサを備え、
同一のインデックス番号及び相違するワード番号によって指定された前記それぞれのキャッシュデータは、前記各データメモリマクロユニットに共通に格納され、同一のインデックス番号及び相違するウェイ番号によって指定された前記それぞれのキャッシュデータは、相違するデータメモリマクロユニットに格納され
物理的キャッシュメモリアドレスは、前記各データメモリマクロユニットにおける前記各格納位置のために決定され、同一のインデックス番号及び同一のウェイ番号によって指定されたそれぞれのキャッシュデータが、前記各データメモリマクロユニットにおいて同一のキャッシュメモリアドレスに格納されることを特徴とするキャッシュメモリ。
A plurality of data memory macro units each configured to store cache data based on an N-way set associative method and having a plurality of storage positions respectively corresponding to the plurality of cache data;
Each storage location has a way number used to identify one of the N ways;
An index number determined by a portion corresponding to an address in which each of the cache data of the main memory is stored;
Specified by a word number determined by another part of the corresponding address of the main memory;
The plurality of data memory macro units are each in a cache memory that can be accessed simultaneously,
A plurality of multiplexers respectively connected to any one data input terminal of the plurality of data memory macro units in order to permit simultaneous writing of N pieces of cache data to the plurality of data memory macro units;
The respective cache data designated by the same index number and different word numbers are stored in common in the respective data memory macro units, and the respective cache data designated by the same index number and different way numbers Are stored in different data memory macro units ,
A physical cache memory address is determined for each storage location in each data memory macro unit, and each cache data specified by the same index number and the same way number is stored in each data memory macro unit. A cache memory that is stored in the same cache memory address .
前記同一のインデックス番号及び同一のワード番号によって指定されたそれぞれのキャッシュデータが、前記各データメモリマクロユニットにおける相違するキャッシュメモリアドレスに格納されることを特徴とする請求項1記載のキャッシュメモリ。 2. The cache memory according to claim 1 , wherein the respective cache data designated by the same index number and the same word number are stored at different cache memory addresses in the respective data memory macro units. 前記各データメモリマクロユニットに格納されている前記キャッシュデータの部分を構成する前記同一のインデックス番号によって指定された各キャッシュデータは、相違するウェイ番号及び相違するワード番号によって指定されることを特徴とする請求項1記載のキャッシュメモリ。 Each cache data designated by the same index number constituting a part of the cache data stored in each data memory macro unit is designated by a different way number and a different word number. The cache memory according to claim 1. 前記複数のデータメモリマクロユニットに書き込むための前記メインメモリからの前記N個のデータを受信するために、複数のマルチプレクサに接続されているラインバッファを更に備えることを特徴とする請求項1記載のキャッシュメモリ。 The line buffer of claim 1, further comprising a line buffer connected to a plurality of multiplexers for receiving the N data from the main memory for writing to the plurality of data memory macro units. Cache memory. ウェイNの数は4であることを特徴とする請求項1記載のキャッシュメモリ。 2. The cache memory according to claim 1 , wherein the number of ways N is four. 前記各データメモリマクロユニットに格納されている複数の前記それぞれのキャッシュデータは、同一のインデックス番号によって指定されている前記各キャッシュデータのグループに設定され、前記グループは、前記キャッシュメモリアドレスの設定に対応させる方式で、インデックス番号が順次増加する順序で設定されており、前記各グループを構成する前記各キャッシュデータは、ワード番号が順次増加する順序で周期的に設定されることを特徴とする請求項1記載のキャッシュメモリ。Each of the plurality of cache data stored in each of the data memory macro units is set to a group of each of the cache data designated by the same index number, and the group is set to the cache memory address. The index number is set in order of increasing in a corresponding manner, and each of the cache data constituting each of the groups is periodically set in order of increasing word number. Item 4. The cache memory according to Item 1. 前記キャッシュデータの前記グループを構成する各キャッシュデータを指定する前記ワード番号の前記周期的なシーケンスにおけるイニシャルウェイ番号が、前記データメモリマクロユニット間で相違することを特徴とする請求項6記載のキャッシュメモリ。7. The cache according to claim 6, wherein an initial way number in the periodic sequence of the word numbers designating each cache data constituting the group of the cache data is different between the data memory macro units. memory. 前記それぞれのキャッシュデータは、前記Nの倍数であるメインメモリからのワード番号を備えることを特徴とする請求項1記載のキャッシュメモリ。2. The cache memory according to claim 1, wherein each of the cache data includes a word number from a main memory that is a multiple of the N. 前記データメモリマクロユニットの数は、前記Nの倍数であることを特徴とする請求項1記載のキャッシュメモリ。2. The cache memory according to claim 1, wherein the number of the data memory macro units is a multiple of the N. 前記複数のデータメモリマクロユニットからN個のキャッシュデータを同時読み込み許可するべく、前記各データメモリマクロユニットのデータ出力端子に接続されているマルチプククサを備えることを特徴とする請求項1記載のキャッシュメモリ。2. The cache memory according to claim 1, further comprising a multiplexer connected to a data output terminal of each data memory macro unit so as to permit simultaneous reading of N cache data from the plurality of data memory macro units. .
JP2008263175A 2008-10-09 2008-10-09 Cache memory, cache memory device and allocation method Expired - Fee Related JP4918535B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008263175A JP4918535B2 (en) 2008-10-09 2008-10-09 Cache memory, cache memory device and allocation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008263175A JP4918535B2 (en) 2008-10-09 2008-10-09 Cache memory, cache memory device and allocation method

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2001073337A Division JP2002278836A (en) 2001-03-15 2001-03-15 Cache memory

Publications (2)

Publication Number Publication Date
JP2009043282A JP2009043282A (en) 2009-02-26
JP4918535B2 true JP4918535B2 (en) 2012-04-18

Family

ID=40443895

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008263175A Expired - Fee Related JP4918535B2 (en) 2008-10-09 2008-10-09 Cache memory, cache memory device and allocation method

Country Status (1)

Country Link
JP (1) JP4918535B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6287545B2 (en) * 2014-04-25 2018-03-07 富士通株式会社 Arithmetic processing device and control method of arithmetic processing device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03273592A (en) * 1990-03-22 1991-12-04 Nec Corp Cache memory device
JP2000215103A (en) * 1999-01-21 2000-08-04 Hitachi Ltd Cache memory circuit

Also Published As

Publication number Publication date
JP2009043282A (en) 2009-02-26

Similar Documents

Publication Publication Date Title
JP3807582B2 (en) Information processing apparatus and semiconductor device
US5146582A (en) Data processing system with means to convert burst operations into memory pipelined operations
US6170070B1 (en) Test method of cache memory of multiprocessor system
US20080222360A1 (en) Multi-port integrated cache
JP4034738B2 (en) Data mask mapping information acquisition method
CN102084428A (en) Multi-mode memory device and method
JPH0594698A (en) Semiconductor memory
US6779074B2 (en) Memory device having different burst order addressing for read and write operations
US20180314640A1 (en) Memory Device Accessed In Consideration Of Data Locality And Electronic System Including The Same
CN108139989B (en) Computer device equipped with processing in memory and narrow access port
JP2006507555A (en) Data mask mapping to hardware by controller programming
US10275392B2 (en) Data processing device
TW491970B (en) Page collector for improving performance of a memory
JP2009288977A (en) Cache memory control device, semiconductor integrated circuit, and cache memory control method
JP4918535B2 (en) Cache memory, cache memory device and allocation method
JP4846383B2 (en) Information processing device
US20110197013A1 (en) Cache system
JP2002278836A (en) Cache memory
JP5055989B2 (en) Memory controller
JPH09198862A (en) Semiconductor memory
JP2009217714A (en) Data processing circuit, cache system and data transfer device
JP5182284B2 (en) Vector processing equipment
US7404049B2 (en) Method and system for managing address bits during buffered program operations in a memory device
CN103871476A (en) Programmable Built In Self Test (pBIST) system
JPH0836525A (en) Multiple access cache storage device

Legal Events

Date Code Title Description
RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20100420

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A711

Effective date: 20100526

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20100526

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110802

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20111101

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120106

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120130

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150203

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees