JP2005084999A - Device and method for controlling cache memory - Google Patents

Device and method for controlling cache memory Download PDF

Info

Publication number
JP2005084999A
JP2005084999A JP2003316884A JP2003316884A JP2005084999A JP 2005084999 A JP2005084999 A JP 2005084999A JP 2003316884 A JP2003316884 A JP 2003316884A JP 2003316884 A JP2003316884 A JP 2003316884A JP 2005084999 A JP2005084999 A JP 2005084999A
Authority
JP
Japan
Prior art keywords
data
read
cache
processor
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.)
Granted
Application number
JP2003316884A
Other languages
Japanese (ja)
Other versions
JP4374956B2 (en
Inventor
Mitsunari Todoroki
晃成 轟
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson 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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2003316884A priority Critical patent/JP4374956B2/en
Priority to US10/927,090 priority patent/US20050086435A1/en
Publication of JP2005084999A publication Critical patent/JP2005084999A/en
Application granted granted Critical
Publication of JP4374956B2 publication Critical patent/JP4374956B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related 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 increase process efficiency by reducing power consumption of a cache memory. <P>SOLUTION: When data to be read is being read from a processor, a cache memory control device 1 detects whether or not the data expected to be read subsequently is cached. When the data expected to be read subsequently is stored in the cache, it is stored in a look-ahead cache part 20; when it is not stored in the cache, it is read from an external memory and stored in the look-ahead cache part 20. Thereafter, when the address of the data actually read from the processor in a subsequent cycle matches the address of the data stored in the look-ahead cache part 20, the data is outputted from the look-ahead cache part 20 to the processor. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、プロセッサとメモリデバイスとの間で、データの転送を効率的に行うために設けられるキャッシュメモリの制御装置およびキャッシュメモリの制御方法に関する。   The present invention relates to a cache memory control device and a cache memory control method provided for efficiently transferring data between a processor and a memory device.

従来、プロセッサがメインメモリ等のメモリデバイス上のデータを読み出す処理を高速化するために、キャッシュメモリが用いられている。
キャッシュメモリは、プロセッサによって高速にデータを読み出すことが可能な記憶素子によって構成されている。そして、キャッシュメモリは、メモリデバイスに記憶されているデータ(以下、適宜「メモリデバイスデータ」と言う。)の一部を記憶しておき、プロセッサがメモリデバイスからデータの読み出しを行う場合に、そのデータがキャッシュメモリに記憶されているものであれば、キャッシュメモリから読み出すことによって、データを高速に読み出すことを可能としている。
Conventionally, a cache memory is used in order to speed up a process in which a processor reads data on a memory device such as a main memory.
The cache memory is configured by a storage element that can read data at high speed by a processor. The cache memory stores a part of data stored in the memory device (hereinafter referred to as “memory device data” as appropriate), and when the processor reads data from the memory device, the cache memory If the data is stored in the cache memory, the data can be read at high speed by reading from the cache memory.

ここで、キャッシュメモリの方式には種々のものがあるが、セット・アソシアティブ方式が一般的である。
セット・アソシアティブ方式とは、キャッシュメモリを複数の領域(ウェイ)に分割し、それぞれのウェイに、メモリデバイス上の異なるアドレスのデータを格納しておくことにより、ヒット率を向上させることができる方式である。
Here, there are various cache memory systems, but the set associative system is common.
The set associative method is a method that can improve the hit rate by dividing the cache memory into a plurality of areas (way) and storing data of different addresses on the memory device in each way. It is.

図12は、従来のセット・アソシアティブ方式のキャッシュメモリ100の構成を示す概略図である。
図12において、キャッシュメモリ100は、タグ・テーブル110と、データ・メモリ120と、ヒット検出部130と、マルチプレクサ(MUX)140とを含んで構成される。なお、キャッシュメモリ100においては、その記憶領域内に、複数N個の要素を記憶することが可能であり、これらの要素それぞれは“エントリ”と称される。また、キャッシュメモリ100は、2ウェイのセット・アソシアティブ方式であり、各エントリには、それぞれ2つのメモリデバイスデータ(ウェイAおよびウェイBのデータ)が格納されている。
FIG. 12 is a schematic diagram showing a configuration of a conventional set-associative cache memory 100. As shown in FIG.
In FIG. 12, the cache memory 100 includes a tag table 110, a data memory 120, a hit detection unit 130, and a multiplexer (MUX) 140. In the cache memory 100, a plurality of N elements can be stored in the storage area, and each of these elements is referred to as an “entry”. The cache memory 100 is a two-way set associative method, and each entry stores two memory device data (way A and way B data).

タグ・テーブル110は、データ・メモリ120におけるウェイA,Bそれぞれのメモリデバイスデータが、メモリデバイス上のいずれのアドレスに記憶されているものであるかを示すアドレス情報を記憶している。タグ・テーブル110に記憶されているアドレス情報は、後述するヒット検出部130によって参照され、キャッシュがヒットしたか否かの判定に用いられる。   The tag table 110 stores address information indicating at which address on the memory device the memory device data of the ways A and B in the data memory 120 is stored. The address information stored in the tag table 110 is referred to by a hit detection unit 130, which will be described later, and is used to determine whether or not the cache is hit.

データ・メモリ120は、アクセス頻度の高いデータ等、所定のメモリデバイスデータを記憶している。また、データ・メモリ120には、ウェイA,Bそれぞれに対応するメモリデバイスデータを記憶することが可能である。
ヒット検出部130は、プロセッサからの読み出し命令に対し、キャッシュメモリ100に記憶されているメモリデバイスデータがヒットしたか否かを検出する。具体的には、タグ・テーブル110に記憶されたアドレス情報それぞれを参照し、プロセッサからの読み出し命令に示されたアドレスに対応するアドレス情報が検出されると、キャッシュがヒットしたものと判定する。そして、ヒット検出部130は、ヒットしたウェイを示す情報をMUX140に出力する。
The data memory 120 stores predetermined memory device data such as frequently accessed data. The data memory 120 can store memory device data corresponding to each of the ways A and B.
The hit detection unit 130 detects whether or not the memory device data stored in the cache memory 100 has hit in response to a read command from the processor. Specifically, the address information stored in the tag table 110 is referred to, and when the address information corresponding to the address indicated in the read command from the processor is detected, it is determined that the cache is hit. Then, the hit detection unit 130 outputs information indicating the hit way to the MUX 140.

MUX140は、ヒット検出部130から入力されたウェイを示す情報に基づいて、データ・メモリ120から出力されるいずれかのメモリデバイスデータを選択し、プロセッサへの出力データ(プロセッサによって読み出されたデータ)とする。
このようなセット・アソシアティブ方式においては、プロセッサからエントリ・アドレス(キャッシュメモリ内に記憶されているいずれかのエントリを選択するアドレス)が入力された場合、キャッシュメモリ100の複数のウェイそれぞれについて、タグ・テーブル110およびデータ・メモリ120にアクセスを行い、データがヒットしたか否かが検出される。
The MUX 140 selects any memory device data output from the data memory 120 based on the information indicating the way input from the hit detection unit 130, and outputs data to the processor (data read by the processor). ).
In such a set associative method, when an entry address (an address for selecting one of the entries stored in the cache memory) is input from the processor, a tag is assigned to each of the plurality of ways in the cache memory 100. Access to table 110 and data memory 120 to detect if data hits.

そのため、キャッシュメモリ100内の不要な部分に対するアクセスが増加することとなり、消費電力の増加、あるいは、処理効率の低下を招くと言う問題があった。
ここで、上述のようなキャッシュメモリ100を含め、従来のキャッシュメモリにおける問題を解決するために、種々の提案がなされている。
特開平11−39216号公報には、複数のウェイを有するセット・アソシアティブ方式のキャッシュメモリにおいて、データ・メモリの出力が確定するまでの遅延を低減するために、メモリデバイスをインターリーブしてアクセスする方法が開示されている。
For this reason, access to unnecessary portions in the cache memory 100 increases, and there is a problem that power consumption increases or processing efficiency decreases.
Here, various proposals have been made to solve the problems in the conventional cache memory including the cache memory 100 as described above.
Japanese Patent Laid-Open No. 11-39216 discloses a set associative cache memory having a plurality of ways in which a memory device is interleaved and accessed in order to reduce a delay until the output of the data memory is determined Is disclosed.

また、同様の目的で、特開2002−328839号公報には、連想記憶によってウェイの予測を行う方法が開示されている。さらに、特開2000−112820号公報や特開2000−347934号公報には、キャッシュのヒットを先行的に予測する技術として、プロセッサが命令を読み出す場合、命令は連続したアドレスから読み出されることが多いという傾向を利用して、引き続く命令を予測する技術が開示されている。
特開平11−39216号公報 特開2002−328839号公報 特開2000−112820号 特開2000−347934号公報
For the same purpose, Japanese Patent Laid-Open No. 2002-328839 discloses a method for predicting a way by associative memory. Furthermore, in Japanese Patent Laid-Open Nos. 2000-112820 and 2000-347934, as a technique for predicting cache hits in advance, when a processor reads instructions, the instructions are often read from consecutive addresses. A technique for predicting subsequent instructions using the above tendency is disclosed.
Japanese Patent Laid-Open No. 11-39216 JP 2002-328839 A JP 2000-112820 A JP 2000-347934 A

しかしながら、上述の公報に記載された技術は、いずれも読み出されるデータに対するアクセスの遅延を低減するための技術であった。
即ち、上述の公報に記載された技術においては、キャッシュメモリ内の不要な部分に対するアクセスが増加することにより、消費電力の増加、あるいは、処理効率の低下を招くと言う問題を解決することが困難であった。
However, all of the techniques described in the above-mentioned publications are techniques for reducing an access delay with respect to read data.
That is, in the technique described in the above-mentioned publication, it is difficult to solve the problem of increasing power consumption or reducing processing efficiency due to an increase in access to unnecessary portions in the cache memory. Met.

本発明の課題は、キャッシュメモリにおける消費電力を低減し、処理効率の向上を図ることである。   An object of the present invention is to reduce power consumption in a cache memory and improve processing efficiency.

以上の課題を解決するため、本発明は、
プロセッサの読み出し対象となるデータを記憶しているメモリデバイス(例えば、発明を実施するための最良の形態中の外部メモリ)から、記憶されているデータの少なくとも一部を複数のウェイ(例えば、発明を実施するための最良の形態中のウェイA,B)含むキャッシュメモリにキャッシュしておき、キャッシュされたデータをプロセッサに供給可能なキャッシュメモリ制御装置であって、プロセッサが読み出している読み出し中データの後に読み出されると予想される予定データが、前記キャッシュメモリのいずれかのウェイにキャッシュされているか否かを判定するキャッシュ判定手段(例えば、図1のアクセス管理部10およびタグ・テーブル30)と、前記キャッシュ判定手段によって、前記予定データがいずれかのウェイにキャッシュされていると判定された場合に、前記複数のウェイのうち、該予定データが記憶されているウェイにアクセスし、該予定データを読み出して記憶する先読みキャッシュ手段(例えば、図1のアクセス管理部10および先読みキャッシュ部20)とを含み、前記先読みキャッシュ手段は、前記読み出し中データの後に前記予定データが読み出された場合に、記憶している予定データをプロセッサに出力することを特徴としている。
In order to solve the above problems, the present invention provides:
A memory device storing data to be read by a processor (for example, an external memory in the best mode for carrying out the invention), and at least part of the stored data is divided into a plurality of ways (for example, the invention). In the best mode for implementing the above, a cache memory control device that is cached in a cache memory including ways A and B) and can supply the cached data to the processor, the data being read being read by the processor Cache determination means (for example, the access management unit 10 and the tag table 30 in FIG. 1) for determining whether or not the scheduled data that is expected to be read after is cached in any way of the cache memory; And the cache determination means causes the scheduled data to be sent to any way. When it is determined that the schedule data is cached, a prefetch cache means (for example, access management in FIG. 1) that accesses the way in which the schedule data is stored and reads and stores the schedule data. Unit 10 and a prefetch cache unit 20), wherein the prefetch cache means outputs the stored plan data to a processor when the plan data is read after the data being read. Yes.

このような構成により、プロセッサによって読み出されているデータの後に読み出されると考えられるデータを予め先読みキャッシュ手段に記憶しておき、プロセッサに出力することが可能になると共に、そのデータをキャッシュメモリから読み出す際に、不要なウェイにアクセスすることを防止することができる。即ち、キャッシュメモリ内の不要な部分に対するアクセスが増加することにより、消費電力の増加、あるいは、処理効率の低下を招くと言う問題を解決することができる。   With such a configuration, data that is considered to be read after the data being read by the processor can be stored in advance in the prefetch cache means and output to the processor, and the data can be output from the cache memory. When reading, it is possible to prevent access to unnecessary ways. That is, it is possible to solve the problem that an increase in power consumption or a decrease in processing efficiency due to an increase in access to an unnecessary portion in the cache memory.

また、前記キャッシュメモリは、前記複数のウェイについて、キャッシュしているデータのアドレスを格納しているアドレス記憶手段と、該アドレスそれぞれに対応するデータを記憶しているデータ記憶手段とを含み、前記キャッシュ判定手段は、前記アドレス記憶手段のいずれかのウェイに、前記予定データのアドレスが記憶されているか否かによって、該予定データがキャッシュされているか否かを判定し、前記先読みキャッシュ手段は、前記データ記憶手段の複数のウェイのうち、前記予定データのアドレスを記憶している前記アドレス記憶手段のウェイに対応するウェイにアクセスすることを特徴としている。   Further, the cache memory includes address storage means for storing addresses of data cached for the plurality of ways, and data storage means for storing data corresponding to each of the addresses, The cache determination means determines whether or not the schedule data is cached according to whether or not the address of the schedule data is stored in any of the ways of the address storage means. Of the plurality of ways of the data storage means, the way corresponding to the way of the address storage means storing the address of the scheduled data is accessed.

このような構成により、アドレス記憶手段にアクセスすることで、予定データがキャッシュにヒットするか否かを判定することができるため、キャッシュにヒットするか否かを判定する際にデータ記憶手段にアクセスすることによって発生する不要な消費電力を低減することが可能となる。また、データ記憶手段において、予定データが記憶されているウェイにのみアクセスすることができるため、さらに消費電力を低減することが可能となる。   With such a configuration, it is possible to determine whether or not the scheduled data hits the cache by accessing the address storage means, so the data storage means is accessed when determining whether or not the cache hits the cache. By doing so, it is possible to reduce unnecessary power consumption. Further, since the data storage means can access only the way where the scheduled data is stored, it is possible to further reduce the power consumption.

また、前記予定データは、前記読み出し中データの直後に読み出されると予想されるデータ(例えば、読み出し中データのアドレスに引き続くアドレスのデータ等)であることを特徴としている。
したがって、読み出し中データの次に読み出されると予想されるデータのみについて、キャッシュされているか否かおよび先読みキャッシュ手段への記憶等の処理を行えばよいため、処理効率を向上させることができる。
The scheduled data is data that is expected to be read immediately after the data being read (for example, data at an address subsequent to the address of the data being read).
Therefore, only the data that is expected to be read next to the data being read only needs to be processed such as whether it is cached and stored in the prefetch cache means, so that the processing efficiency can be improved.

また、プロセッサの読み出し対象となるデータは、複数のワードを含むブロックとして構成され、該ブロックを単位として、前記予定データがキャッシュされているか否かの判定あるいは前記予定データの読み出しを行うことを特徴としている。
このような構成により、複数のワードそれぞれについて、プロセッサが読み出し命令を行う必要がなく、一つの読み出し命令でブロック全体を読み出すことができるため、消費電力を低減することができると共に、処理効率を向上させることが可能となる。
Further, the data to be read by the processor is configured as a block including a plurality of words, and whether or not the scheduled data is cached or the scheduled data is read in units of the block. It is said.
With this configuration, it is not necessary for the processor to execute a read command for each of a plurality of words, and the entire block can be read with a single read command, thus reducing power consumption and improving processing efficiency. It becomes possible to make it.

また、前記キャッシュ判定手段は、前記読み出し中データを構成する複数のワードのうち、プロセッサが末尾のワードの読み出しを指示することに対応して、前記予定データがキャッシュされているか否かを判定することを特徴としている。
一般に、予定データは、読み出し中データのより後のワードがプロセッサに読み出されているタイミングで予想する方が、的中する確率が高くなるものである。
The cache determination means determines whether the scheduled data is cached in response to the processor instructing to read the last word among the plurality of words constituting the data being read. It is characterized by that.
In general, it is more likely that the scheduled data will be hit when it is predicted at the timing when the word after the data being read is read by the processor.

したがって、このような構成により、より高い確率でプロセッサに読み込まれるデータを予定データとして先読みすることが可能となる。
また、前記キャッシュ判定手段は、前記読み出し中データを構成する複数のワードのうち、プロセッサが末尾のワードに先行するワードの読み出しを指示することに対応して、前記予定データがキャッシュされているか否かを判定することを特徴としている。
Therefore, with such a configuration, data read into the processor with higher probability can be prefetched as scheduled data.
The cache determination means determines whether the scheduled data is cached in response to the processor instructing to read the word preceding the last word among the plurality of words constituting the data being read. It is characterized by determining whether or not.

このような構成により、より早いタイミングで予定データがキャッシュされているか否かを判定できるため、キャッシュされていない場合の処理(例えば、メモリデバイスから読み込む処理等)をより早く行うことができ、ウェイトサイクルの発生を防止することあるいは発生するウェイトサイクルを低減することが可能となる。
また、前記先読みキャッシュ手段は、前記キャッシュ判定手段によって、前記予定データがいずれかのウェイにキャッシュされていると判定された場合に、前記読み出し中データを構成する複数のワードのうち、プロセッサが末尾のワードの読み出しを指示することに対応して、該予定データが記憶されているウェイにアクセスし、該予定データを読み出すことを特徴としている。
With such a configuration, it is possible to determine whether or not the scheduled data is cached at an earlier timing, so that the processing when it is not cached (for example, processing to read from the memory device) can be performed earlier, and the wait It is possible to prevent the occurrence of cycles or reduce the number of wait cycles that occur.
Further, the prefetch cache means, when the cache judgment means judges that the scheduled data is cached in any way, the processor reads the end of the plurality of words constituting the data being read. In response to the instruction to read the word, the way in which the schedule data is stored is accessed to read the schedule data.

このような構成により、より早いタイミングで予定データがキャッシュされているか否かを判定した場合にも、予定データが読み出される確率が高くなったタイミングで、実際に予定データを読み出すことができる。したがって、先読みキャッシュ手段に記憶された予定データがプロセッサに読み出されないこととなる割合を低減できるため、処理効率の低下を防止することができる。   With such a configuration, even when it is determined whether the schedule data is cached at an earlier timing, the schedule data can be actually read at a timing when the probability that the schedule data is read is increased. Therefore, since the rate at which the scheduled data stored in the prefetch cache means is not read by the processor can be reduced, it is possible to prevent a reduction in processing efficiency.

また、前記キャッシュメモリにおける複数のウェイのうち、データの読み出しに関係しないウェイを低消費電力で動作させる低消費電力化手段をさらに含むことを特徴としている。
このような構成により、不要な部分の消費電力を低減することができ、キャッシュメモリ制御装置の消費電力をさらに低減することが可能となる。
Further, the present invention is characterized by further comprising a power consumption reduction means for operating a way not related to data reading among a plurality of ways in the cache memory with low power consumption.
With such a configuration, it is possible to reduce power consumption of unnecessary portions and further reduce power consumption of the cache memory control device.

また、前記低消費電力化手段は、データの読み出しに関係しないウェイに対し、クロック信号を供給しないように制御するクロックゲーティング機能を備えることを特徴としている。
このような構成により、不要な部分に対するクロック信号を供給することにより発生する不要な消費電力を低減することができる。
Further, the low power consumption means is characterized by having a clock gating function for controlling so that a clock signal is not supplied to a way not related to data reading.
With such a configuration, unnecessary power consumption generated by supplying a clock signal to unnecessary portions can be reduced.

また、前記キャッシュメモリは、セット・アソシアティブ方式のキャッシュメモリであることを特徴としている。
このような構成により、セット・アソシアティブ方式のキャッシュメモリにおいて、エントリに含まれる各ウェイのアドレス記憶手段(タグ・テーブル)およびデータ記憶手段(データ・メモリ)に不必要にアクセスすることによって発生する消費電力を大幅に低減できると共に、処理効率を向上させることが可能となる。
Further, the cache memory is a set associative cache memory.
With this configuration, in the set associative cache memory, consumption caused by unnecessary access to the address storage means (tag table) and data storage means (data memory) of each way included in the entry The power can be greatly reduced and the processing efficiency can be improved.

また、前記先読みキャッシュ手段は、前記キャッシュ判定手段によって、前記キャッシュメモリのいずれのウェイにも前記予定データがキャッシュされていないと判定された場合、前記メモリデバイスにアクセスし、該予定データを読み出して記憶することを特徴としている。
このような構成により、予定データがキャッシュされていない場合に、メモリデバイスから予定データを読み出す処理をより早く行うことができるため、ウェイトサイクルの発生を防止することあるいは発生するウェイトサイクルを低減することが可能となる。
The prefetch cache unit accesses the memory device and reads the scheduled data when the cache determining unit determines that the scheduled data is not cached in any way of the cache memory. It is characterized by memorizing.
With this configuration, when the scheduled data is not cached, the process of reading the scheduled data from the memory device can be performed more quickly, so that the generation of wait cycles can be prevented or the generated wait cycles can be reduced. Is possible.

また、本発明は、
プロセッサの読み出し対象となるデータを記憶しているメモリデバイスから、記憶されているデータの少なくとも一部を複数のウェイを含むキャッシュメモリにキャッシュしておき、キャッシュされたデータをプロセッサに供給するためのキャッシュメモリ制御方法であって、プロセッサが読み出している読み出し中データの後に読み出されると予想される予定データが、前記キャッシュメモリのいずれかのウェイにキャッシュされているか否かを判定するキャッシュ判定ステップと、前記キャッシュ判定ステップにおいて、前記予定データがいずれかのウェイにキャッシュされていると判定された場合に、前記複数のウェイのうち、該予定データが記憶されているウェイにアクセスし、該予定データを読み出して記憶する先読みキャッシュステップと、プロセッサによって、前記読み出し中データの後に前記予定データが読み出された場合に、前記先読みキャッシュステップにおいて記憶された予定データをプロセッサに出力する出力ステップとを含むことを特徴としている。
The present invention also provides:
A method for caching at least a part of stored data in a cache memory including a plurality of ways from a memory device storing data to be read by the processor and supplying the cached data to the processor A cache memory control method for determining whether or not scheduled data expected to be read after the data being read being read by the processor is cached in any way of the cache memory, In the cache determination step, when it is determined that the scheduled data is cached in any way, the way in which the scheduled data is stored is accessed from among the plurality of ways, and the scheduled data Read-ahead cache to read and store And step, by the processor, when the schedule data is read after the read in data, is characterized in that it comprises an output step of outputting the schedule data stored in the read-ahead cache step processor.

このように、本発明によれば、キャッシュメモリにおける消費電力を低減し、処理効率の向上を図ることが可能となる。   Thus, according to the present invention, it is possible to reduce the power consumption in the cache memory and improve the processing efficiency.

以下、図を参照して本発明に係るキャッシュメモリ制御装置の実施の形態を説明する。
まず、構成を説明する。
図1は、本発明を適用したキャッシュメモリ制御装置1の構成を示す図である。
図1において、キャッシュメモリ制御装置1は、アクセス管理部10と、先読みキャッシュ部20と、タグ・テーブル30と、データ・メモリ40と、ヒット検出部50と、MUX60とを含んで構成される。
Hereinafter, an embodiment of a cache memory control device according to the present invention will be described with reference to the drawings.
First, the configuration will be described.
FIG. 1 is a diagram showing a configuration of a cache memory control device 1 to which the present invention is applied.
In FIG. 1, the cache memory control device 1 includes an access management unit 10, a prefetch cache unit 20, a tag table 30, a data memory 40, a hit detection unit 50, and a MUX 60.

また、図2は、タグ・テーブル30およびデータ・メモリ40に記憶されるデータの構成を示す図であり、(a)はタグ・テーブル30内のデータの構成、(b)はデータ・メモリ40内のデータの構成を示している。
以下、図1に基づいて、キャッシュメモリ制御装置1の構成を説明し、適宜、図2を参照することとする。なお、ここでは、キャッシュメモリ制御装置1が、2ウェイ(ウェイA,B)のセット・アソシアティブ方式である場合を想定している。
FIG. 2 is a diagram showing a configuration of data stored in the tag table 30 and the data memory 40. (a) is a configuration of data in the tag table 30, and (b) is a data memory 40. The structure of the data in is shown.
Hereinafter, the configuration of the cache memory control device 1 will be described with reference to FIG. 1, and FIG. 2 will be referred to as appropriate. Here, it is assumed that the cache memory control device 1 is a two-way (way A, B) set associative method.

アクセス管理部10は、キャッシュメモリ制御装置1全体を制御するものであり、後述する状態遷移図に従うように、キャッシュメモリ制御装置1を動作させる。
例えば、アクセス管理部10は、プロセッサから入力された読み出し命令に基づいて、読み出し命令に示されたアドレスのデータが先読みキャッシュ部20に記憶されている場合には、そのアドレスに対応するデータをプロセッサに対して出力させると共に、引き続き読み出されるデータを予想し、予想したデータを先読みキャッシュ部20のプロセッサ先読みバッファ22に記憶させる。
The access management unit 10 controls the cache memory control device 1 as a whole, and operates the cache memory control device 1 in accordance with a state transition diagram to be described later.
For example, when the data at the address indicated in the read command is stored in the prefetch cache unit 20 based on the read command input from the processor, the access management unit 10 transmits the data corresponding to the address to the processor. The data to be continuously read is predicted, and the predicted data is stored in the processor prefetch buffer 22 of the prefetch cache unit 20.

一方、読み出し命令に示されたアドレスのデータが先読みキャッシュ部20に記憶されていない場合、アクセス管理部10は、タグ・テーブル30を参照する。そして、そのアドレスがタグ・テーブル30に記憶されている場合、アクセス管理部10は、そのアドレスに対応するデータをデータ・メモリ40からプロセッサ先読みバッファ22に記憶させる。   On the other hand, when the data at the address indicated in the read command is not stored in the prefetch cache unit 20, the access management unit 10 refers to the tag table 30. When the address is stored in the tag table 30, the access management unit 10 stores data corresponding to the address from the data memory 40 to the processor prefetch buffer 22.

また、読み出し命令に示されたアドレスがタグ・テーブル30に記憶されていない場合、アクセス管理部10は、外部メモリにアクセスし、そのアドレスのデータを先読みキャッシュ部20の外部メモリ先読みバッファ23に記憶させる。
先読みキャッシュ部20は、プロセッサから入力された読み出し命令を受け取り、読み出し命令に示されたアドレスをアクセス管理部10に出力する。また、先読みキャッシュ部20は、アクセス管理部10の指示に従って、プロセッサによって読み出されると予想されたデータを、データ・メモリ40あるいは外部メモリから予め読み出して記憶し、プロセッサから実際に読み出された場合に、そのデータをプロセッサに出力する。
When the address indicated in the read command is not stored in the tag table 30, the access management unit 10 accesses the external memory and stores data at the address in the external memory prefetch buffer 23 of the prefetch cache unit 20. Let
The prefetch cache unit 20 receives a read command input from the processor and outputs an address indicated by the read command to the access management unit 10. In addition, the prefetch cache unit 20 reads and stores data predicted to be read by the processor in advance from the data memory 40 or the external memory in accordance with an instruction from the access management unit 10, and when the data is actually read from the processor The data is output to the processor.

具体的には、先読みキャッシュ部20は、アドレス制御部21と、プロセッサ先読みバッファ22と、外部メモリ先読みバッファ23とを含んで構成される。
アドレス制御部21は、プロセッサから入力された読み出し命令から、読み出し対象となっているデータのアドレスを取得し、アクセス管理部10に出力する。また、アドレス制御部21は、データ・メモリ40にキャッシュされているデータを読み出す際に、タグ・テーブル30およびデータ・メモリ40に読み出し対象のアドレスを出力したり、データ・メモリ40にキャッシュされていないデータを外部メモリから読み出す際に、読み出し対象のアドレスを外部メモリに出力したりする。
Specifically, the prefetch cache unit 20 includes an address control unit 21, a processor prefetch buffer 22, and an external memory prefetch buffer 23.
The address control unit 21 acquires the address of data to be read from the read command input from the processor, and outputs it to the access management unit 10. Further, the address control unit 21 outputs an address to be read to the tag table 30 and the data memory 40 when reading the data cached in the data memory 40, or is cached in the data memory 40. When reading out non-existing data from the external memory, the read target address is output to the external memory.

なお、アドレス制御部21は、アクセス管理部10からデータの読み出し(先読み)が指示され、そのデータのアドレスがタグ・テーブル30に記憶されている場合には、データ・メモリ40の各ウェイのうち、そのデータが記憶されているウェイにのみアドレスを出力する。
そのため、不要なウェイへのアクセス回数を低減することができ、消費電力を低減することができると共に、処理効率の向上を実現することができる。
The address control unit 21 is instructed to read data (read ahead) from the access management unit 10 and stores the address of the data in the tag table 30. The address is output only to the way in which the data is stored.
As a result, the number of accesses to unnecessary ways can be reduced, power consumption can be reduced, and processing efficiency can be improved.

プロセッサ先読みバッファ22は、データ・メモリ40から読み出されたデータを、MUX60を介して受け取り、プロセッサに出力するデータとして記憶する。
外部メモリ先読みバッファ23は、外部メモリから読み出されたデータを受け取り、プロセッサに出力するデータとして記憶する。また、外部メモリ先読みバッファ23に記憶されたデータは、キャッシュメモリ制御装置1において処理が行われないクロックタイミングにデータ・メモリ40に格納される。
The processor prefetch buffer 22 receives the data read from the data memory 40 via the MUX 60 and stores it as data to be output to the processor.
The external memory prefetch buffer 23 receives data read from the external memory and stores it as data to be output to the processor. Further, the data stored in the external memory prefetch buffer 23 is stored in the data memory 40 at a clock timing at which processing is not performed in the cache memory control device 1.

タグ・テーブル30は、図2(a)に示すように、各エントリ(0番〜511番、ただし、エントリ数N=512の場合)について、データ・メモリ40に記憶されたデータがキャッシュヒットしたか否かを示すフラグと、データ・メモリ40に記憶されたデータが記憶されている外部メモリ上のアドレスとを記憶している。また、各エントリには、ウェイA,Bに対応するフラグおよびアドレスが記憶されている。タグ・テーブル30に記憶されているアドレスを参照することにより、データ・メモリ40のデータが、キャッシュにヒットしたか否かを判定することができる。   As shown in FIG. 2A, the tag table 30 has a cache hit for data stored in the data memory 40 for each entry (0 to 511, where the number of entries is N = 512). And a flag indicating whether or not, and an address on the external memory in which the data stored in the data memory 40 is stored. Each entry stores flags and addresses corresponding to the ways A and B. By referring to the address stored in the tag table 30, it is possible to determine whether or not the data in the data memory 40 has hit the cache.

データ・メモリ40は、各エントリについて、所定のメモリデバイスデータを記憶している。なお、データ・メモリ40は、4ワードを1ブロックとして取り扱い、データ・メモリ40からデータを読み出す場合には、エントリに含まれるいずれかのウェイの4ワード(w0〜w4)を1まとまりとして読み出すことが可能である。ただし、1ブロックにおける一部のワード(例えば、ワードw1〜w3)を読み出すことも可能である。   The data memory 40 stores predetermined memory device data for each entry. The data memory 40 treats 4 words as one block, and when reading data from the data memory 40, reads 4 words (w0 to w4) of any way included in the entry as one group. Is possible. However, it is also possible to read out some words (for example, words w1 to w3) in one block.

ヒット検出部50は、アドレス制御部21からタグ・テーブル30に対し、読み出し命令に示されたアドレスが入力された場合に、データ・メモリ40に記憶されているメモリデバイスデータがヒットしたか否かを検出する。具体的には、タグ・テーブル30に記憶されたアドレスそれぞれを参照し、アドレス制御部21から入力されたアドレスが検出されると、キャッシュがヒットしたものと判定する。そして、ヒット検出部50は、ヒットしたウェイを示す情報をMUX60に出力する。   The hit detection unit 50 determines whether or not the memory device data stored in the data memory 40 has been hit when the address indicated in the read command is input from the address control unit 21 to the tag table 30. Is detected. Specifically, each address stored in the tag table 30 is referred to, and when an address input from the address control unit 21 is detected, it is determined that the cache is hit. Then, the hit detection unit 50 outputs information indicating the hit way to the MUX 60.

MUX60は、ヒット検出部50からヒットしたウェイを示す情報を受け取り、データ・メモリ40の各ウェイの記憶領域からメモリデバイスデータを受け取る。そして、MUX60は、ヒット検出部50から入力されたウェイに対応するメモリデバイスデータを選択し、プロセッサ先読みバッファ22に出力する。
次に、動作を説明する。
The MUX 60 receives information indicating the hit way from the hit detection unit 50 and receives memory device data from the storage area of each way in the data memory 40. Then, the MUX 60 selects memory device data corresponding to the way input from the hit detection unit 50 and outputs it to the processor prefetch buffer 22.
Next, the operation will be described.

キャッシュメモリ制御装置1は、主としてアクセス管理部10の制御によって、所定の動作に対応する状態遷移を行う。
まず、キャッシュメモリ制御装置1の基本的な動作について説明する。
キャッシュメモリ制御装置1の基本的な動作においては、読み出し対象であるメモリデバイスデータの最後のワードのアドレスがプロセッサから出力されるタイミングで、タグ・テーブル30を参照し、引き続き読み出されると予想されるデータ(以下、「予定データ」と言う。)がキャッシュにヒットするか否かを検出(先読み)する。したがって、実際に読み出される可能性の高いデータについて、キャッシュを先読みすることができるため、先読みキャッシュ部20におけるデータのヒット率を向上させることができる。
The cache memory control device 1 performs state transition corresponding to a predetermined operation mainly under the control of the access management unit 10.
First, the basic operation of the cache memory control device 1 will be described.
In the basic operation of the cache memory control device 1, it is expected that the address of the last word of the memory device data to be read is read with reference to the tag table 30 at the timing when it is output from the processor. Whether data (hereinafter referred to as “planned data”) hits the cache is detected (prefetched). Therefore, since the cache can be prefetched for data that is highly likely to be read, the data hit rate in the prefetch cache unit 20 can be improved.

図3は、キャッシュメモリ制御装置1の基本的な動作を示す状態遷移図である。
図3において、キャッシュメモリ制御装置1は、状態S1〜S4を遷移し、それぞれの状態間を遷移するための遷移条件C1〜C12が定められている。
状態S1(ST-PRC-NORMAL)においては、予定データが、プロセッサ先読みバッファ22に記憶されている場合(先読みキャッシュにヒットしている場合)に、そのデータをブロック単位でプロセッサに出力する。
FIG. 3 is a state transition diagram showing the basic operation of the cache memory control device 1.
In FIG. 3, the cache memory control device 1 transitions between states S1 to S4, and transition conditions C1 to C12 for transitioning between the states are defined.
In the state S1 (ST-PRC-NORMAL), when the scheduled data is stored in the processor prefetch buffer 22 (when the prefetch cache is hit), the data is output to the processor in units of blocks.

また、状態S1においては、予定データが、プロセッサ先読みバッファ22に記憶されていない場合には、読み出し対象のアドレスに基づいて、タグ・テーブル30およびデータ・メモリ40にアクセスし、そのアドレスと一致するデータをデータ・メモリ40から読み込む状態(ST-PREREAD-ACTIVE)に移行する。
さらに、状態S1においては、外部メモリから読み込まれているデータのブロックのうち、末尾のワードの読み出しが完了するまでは、キャッシュのリード(データ・メモリ40の読み出し)を行わない。
In the state S1, if the scheduled data is not stored in the processor prefetch buffer 22, the tag table 30 and the data memory 40 are accessed based on the read target address, and coincide with the address. The state shifts to a state of reading data from the data memory 40 (ST-PREREAD-ACTIVE).
Further, in the state S1, the cache reading (reading of the data memory 40) is not performed until the reading of the last word in the block of data read from the external memory is completed.

状態S2(ST-PREREAD-ACTIVE)においては、予定データのアドレスに基づいて、タグ・テーブル30にのみアクセスし、タグ・テーブル30に記憶されたアドレスと一致(キャッシュにヒット)した場合、そのアドレスに対応するデータをデータ・メモリ40から読み出す。
状態S3(ST-CACHE-HIT-TEST)においては、タグ・テーブル30とデータ・メモリ40にアクセスし、予定データのアドレスがタグ・テーブル30のアドレスと一致するか否かを検出する。そして、状態S3においては、予定データのアドレスと一致したアドレスに対応するデータをデータ・メモリ40から読み出す。
In the state S2 (ST-PREREAD-ACTIVE), based on the address of the scheduled data, only the tag table 30 is accessed, and when it matches the address stored in the tag table 30 (cache hit), that address Is read from the data memory 40.
In the state S3 (ST-CACHE-HIT-TEST), the tag table 30 and the data memory 40 are accessed, and it is detected whether or not the address of the scheduled data matches the address of the tag table 30. In the state S3, data corresponding to the address that matches the address of the scheduled data is read from the data memory 40.

状態S4(ST-EXMEM-ACCESS)においては、外部メモリを読み出すためのステートマシン“sm-exmem-access”(図4参照)を起動し、外部メモリを読み出す。状態S4から他の状態へ遷移するタイミングは、1ワードの読み込みが終了する時点であり、ステートマシン“sm-exmem-access”の動作の終了を待たない。即ち、他の状態においては、外部メモリの読み出しを待つためのウェイトサイクル(wait-cycle)が生ずる場合がある。   In the state S4 (ST-EXMEM-ACCESS), the state machine “sm-exmem-access” (see FIG. 4) for reading the external memory is activated to read the external memory. The timing of transition from the state S4 to another state is the time when reading of one word is completed, and the end of the operation of the state machine “sm-exmem-access” is not waited. That is, in other states, a wait cycle (wait-cycle) for waiting for reading from the external memory may occur.

遷移条件C1(CND-PRA-START)は、状態S1において、読み込み対象であるデータの末尾のワード(16進数で表されたアドレスの末尾が“C”のワード)のアドレスが、プロセッサから入力されることを意味している。
遷移条件C2(CND-PRA-END)は、状態S2において、ウェイトサイクルが発生しなければ、次のサイクルで状態S1に戻ることを意味している。
In the transition condition C1 (CND-PRA-START), in the state S1, the address of the last word of the data to be read (the word with the end of the address expressed in hexadecimal number “C”) is input from the processor. It means that.
The transition condition C2 (CND-PRA-END) means that if no wait cycle occurs in the state S2, the state returns to the state S1 in the next cycle.

遷移条件C3(CND-CHT-START)は、状態S1において、予定データが、先読みキャッシュにヒットしない場合(プロセッサ先読みバッファ22に記憶されている場合)を意味している。
遷移条件C4(CND-CHT-CNT)は、状態S3を継続するための条件である。即ち、先読みキャッシュ部20に予定データが記憶されていないため、タグ・テーブル30およびデータ・メモリ40にアクセスしてキャッシュヒットを確認し続けるための条件である。なお、分岐命令について、分岐先のアドレスがブロックの末尾であり、かつ状態S3である場合には、次のサイクルでブロックの先頭のワードにアクセスすることから、連続して先読みキャッシュにヒットしない場合に、先読みキャッシュのミスヒットと判定される。
The transition condition C3 (CND-CHT-START) means a case where the scheduled data does not hit the prefetch cache (stored in the processor prefetch buffer 22) in the state S1.
The transition condition C4 (CND-CHT-CNT) is a condition for continuing the state S3. In other words, since the scheduled data is not stored in the prefetch cache unit 20, it is a condition for continuously checking the cache hit by accessing the tag table 30 and the data memory 40. For branch instructions, if the branch destination address is at the end of the block and is in state S3, the first word of the block is accessed in the next cycle, so the prefetch cache is not hit continuously. On the other hand, it is determined that the prefetch cache is a miss hit.

遷移条件C5(CND-CHT-PRA)は、状態S3から状態S2へ遷移するための条件である。即ち、先読みキャッシュ部20に予定データが記憶されていないため、タグ・テーブル30およびデータ・メモリ40にアクセスしてキャッシュヒットを確認する状態から、タグ・テーブル30にのみアクセスし、キャッシュヒットを確認する状態へ遷移するための条件である。なお、分岐命令について、分岐先のアドレスがブロックの末尾から2番目(16進数で表されたアドレスの末尾が“8”のワード)であり、かつ状態S3である場合には、次のサイクルでブロックの末尾のデータにアクセスすることとなり、即ち、状態S2に遷移することとなるため、状態S1に戻ることなく、状態S2に直接遷移するものである。   The transition condition C5 (CND-CHT-PRA) is a condition for making a transition from the state S3 to the state S2. That is, since the scheduled data is not stored in the prefetch cache unit 20, only the tag table 30 is accessed and the cache hit is confirmed from the state where the cache hit is confirmed by accessing the tag table 30 and the data memory 40. It is a condition for making a transition to a state to perform. For the branch instruction, if the branch destination address is the second from the end of the block (the word expressed as a hexadecimal number with the end of the address “8”) and is in the state S3, in the next cycle Since the data at the end of the block is accessed, that is, the state transits to the state S2, the state directly transits to the state S2 without returning to the state S1.

遷移条件C6(CND-CHT-END)は、状態S3において、分岐先のアドレスがブロックの先頭および2番目(16進数で表されたアドレスの末尾が“0”あるいは“4”のワード)である場合に、先読みキャッシュにヒットしている状態であれば、状態S1に戻ることを意味している。
遷移条件C7(CND-EMA-START)は、状態S3において、キャッシュにヒットしない場合(データ・メモリ40に読み込み対象であるデータが記憶されていない場合)を意味している。
In the transition condition C6 (CND-CHT-END), in the state S3, the branch destination address is the head and the second of the block (the word whose hexadecimal address ends with “0” or “4”). In this case, if the prefetch cache is hit, it means that the process returns to the state S1.
The transition condition C7 (CND-EMA-START) means a case in which no cache is hit in the state S3 (when data to be read is not stored in the data memory 40).

遷移条件C8(CND-PRA-EMA)は、状態S2において、キャッシュにヒットしない場合を意味している。
遷移条件C9(CND-PRA-CHT)は、状態S2において、先読みキャッシュにヒットしない場合を意味している。
遷移条件C10(CND-NORM-CNT)は、状態S1において、先読みキャッシュにヒットしている場合あるいは外部メモリにアクセスしている場合を意味している。
The transition condition C8 (CND-PRA-EMA) means a case where the cache is not hit in the state S2.
The transition condition C9 (CND-PRA-CHT) means a case where the prefetch cache is not hit in the state S2.
The transition condition C10 (CND-NORM-CNT) means a case where the prefetch cache is hit or an external memory is accessed in the state S1.

遷移条件C11(CND-PRA-CNT)は、状態S2において、先読み処理を継続する場合を意味している。
遷移条件C12(CND-EMA-END)は、状態S4において、外部メモリへのアクセスが終了した場合を意味している。
次に、外部メモリを読み出すためのステートマシン“sm-exmem-access”について説明する。
The transition condition C11 (CND-PRA-CNT) means a case where the prefetch process is continued in the state S2.
The transition condition C12 (CND-EMA-END) means a case where access to the external memory is completed in the state S4.
Next, the state machine “sm-exmem-access” for reading the external memory will be described.

図4は、キャッシュメモリ制御装置1上に構築されるステートマシン“sm-exmem-access”の動作を示す状態遷移図である。
図4において、キャッシュメモリ制御装置1は、状態T1〜T6を遷移する。
状態T1(ST-WAIT)においては、外部メモリへのアクセスを停止している。状態T1においては、所定のタイミングで、状態T2に移行する。
FIG. 4 is a state transition diagram showing the operation of the state machine “sm-exmem-access” constructed on the cache memory control device 1.
In FIG. 4, the cache memory control device 1 transitions between states T1 to T6.
In state T1 (ST-WAIT), access to the external memory is stopped. In the state T1, the state transitions to the state T2 at a predetermined timing.

状態T2(ST-EXMEM-READ-1W-S)においては、読み出し対象であるデータの第1番目のワードを外部メモリから読み出し、読み出す処理が終了すると、状態T3に移行する。
状態T3(ST-EXMEM-READ-1W-E-2W-S)においては、読み出し対象であるデータの第2番目のワードを外部メモリから読み出し、読み出す処理が終了すると、状態T4に移行する。
In the state T2 (ST-EXMEM-READ-1W-S), when the first word of the data to be read is read from the external memory and the reading process is completed, the process proceeds to the state T3.
In the state T3 (ST-EXMEM-READ-1W-E-2W-S), when the second word of the data to be read is read from the external memory and the reading process is completed, the process proceeds to the state T4.

状態T4(ST-EXMEM-READ-2W-E-3W-S)においては、読み出し対象であるデータの第3番目のワードを外部メモリから読み出し、読み出す処理が終了すると、状態T5に移行する。
状態T5(ST-EXMEM-READ-3W-E-4W-S)においては、読み出し対象であるデータの第4番目のワードを外部メモリから読み出し、読み出す処理が終了すると、状態T6に移行する。
In the state T4 (ST-EXMEM-READ-2W-E-3W-S), when the third word of the data to be read is read from the external memory and the reading process is completed, the process proceeds to the state T5.
In the state T5 (ST-EXMEM-READ-3W-E-4W-S), when the fourth word of the data to be read is read from the external memory and the reading process is completed, the process proceeds to the state T6.

状態T6(ST-EXMEM-READ-4W-E)においては、読み出し対象であるデータの第4番目のワードを外部メモリから読み出す処理が終了することに対応して、状態T1に戻る。
図3および図4に示すように各状態を遷移する結果、キャッシュメモリ制御装置1は、プロセッサによって読み出されるデータに応じて、具体的に以下のような動作を行う。
まず、プロセッサによって読み出されるデータが、連続して先読みキャッシュにヒットする場合の例について説明する。
In the state T6 (ST-EXMEM-READ-4W-E), the process returns to the state T1 in response to the completion of the process of reading the fourth word of the data to be read from the external memory.
As a result of transitioning between the states as shown in FIGS. 3 and 4, the cache memory control device 1 specifically performs the following operation according to the data read by the processor.
First, an example will be described in which data read by the processor continuously hits the prefetch cache.

図5は、プロセッサによって読み出されるデータが、連続して先読みキャッシュにヒットする場合の動作例を示すタイミングチャートである。
図5においては、プロセッサによって、連続するアドレスのデータ(アドレス“A00〜A0C”、“A10〜A1C”および“A20〜A2C”のデータ)が読み出される場合を示している。なお、以下、アドレス“A00〜A0C”、“A10〜A1C”および“A20〜A2C”によって示されるデータをそれぞれ第1〜第3のデータと称する。
FIG. 5 is a timing chart showing an operation example when data read by the processor hits the prefetch cache continuously.
FIG. 5 shows a case where data of consecutive addresses (data of addresses “A00 to A0C”, “A10 to A1C” and “A20 to A2C”) is read by the processor. Hereinafter, data indicated by addresses “A00 to A0C”, “A10 to A1C”, and “A20 to A2C” are referred to as first to third data, respectively.

図5において、第1のデータにおける末尾のワードのアドレス(アドレス“A0C”)がプロセッサから入力されるタイミング(サイクル“4”)で、予定データである第2のデータのアドレスがタグ・テーブル30の各ウェイに入力される。
すると、次のクロックタイミング(サイクル “5”)において、タグ・テーブル30の各ウェイに記憶されたアドレスが出力されると共に、それらのアドレスと第2のデータのアドレスとが一致するか否かが判定され、ここでは一致していることから、キャッシュにヒットしたことが検出される(CACHE-HIT=1)。また、このとき、第2のデータのアドレスが、データ・メモリ40の第2のデータが記憶されている方のウェイ(ここでは、図5中に実線で示されているウェイAであるものとし、第2のデータが記憶されていないウェイBについては点線で示す。以下、同様である。)に入力される(WAYA-DATA-ADRS,WAYB-DATA-ADRS)。
In FIG. 5, the address of the last data in the first data (address “A0C”) is input from the processor (cycle “4”), and the address of the second data that is the scheduled data is the tag table 30. Is input to each way.
Then, at the next clock timing (cycle “5”), the addresses stored in the respective ways of the tag table 30 are output, and whether these addresses match the address of the second data or not. In this case, since they match, it is detected that the cache is hit (CACHE-HIT = 1). At this time, the address of the second data is assumed to be the way in which the second data of the data memory 40 is stored (here, the way A indicated by a solid line in FIG. 5). The way B in which the second data is not stored is indicated by a dotted line (the same applies hereinafter) (WAYA-DATA-ADRS, WAYB-DATA-ADRS).

そして、引き続くクロックタイミング(サイクル “6”)において、データ・メモリ40から、第2のデータを記憶しているウェイのデータ(WAYA-TAG-DATA,WAYB-TAG-DATA)が出力されると共に、ヒット検出部50から、いずれかのウェイを選択する情報(WAY-SELECT)が出力される。その結果、選択されたウェイのメモリデバイスデータ(データ“D10”)が、プロセッサに対して出力される(PBUS-RDDATA)。   At the subsequent clock timing (cycle “6”), the data of the way storing the second data (WAYA-TAG-DATA, WAYB-TAG-DATA) is output from the data memory 40, and The hit detection unit 50 outputs information (WAY-SELECT) for selecting any way. As a result, the memory device data (data “D10”) of the selected way is output to the processor (PBUS-RDDATA).

即ち、サイクル “5”で行われたプロセッサからの読み出し命令に対し、キャッシュメモリ制御装置1は、対応するメモリデバイスデータをサイクル“6”で出力している。
また、キャッシュメモリ制御装置1においては、メモリデバイスデータをブロック単位で読み出すことができるため、データ“D10”を読み出すことにより、同じブロックの他のデータ(データ“D14”〜“D1C”)もまとめて読み出され、プロセッサ先読みバッファ22に記憶される。その結果、データ“D10”に引き続く3ワードは、それぞれを読み出すためにタグ・テーブル30およびデータ・メモリ40にアクセスすることなく、データ“D10”に連続して、プロセッサ先読みバッファ22からプロセッサに出力されることとなる。
That is, the cache memory control device 1 outputs the corresponding memory device data in cycle “6” in response to the read command from the processor executed in cycle “5”.
In addition, since the memory device data can be read in block units in the cache memory control device 1, by reading the data “D10”, other data (data “D14” to “D1C”) in the same block are also collected. Are read out and stored in the processor prefetch buffer 22. As a result, the three words following the data “D10” are output from the processor prefetch buffer 22 to the processor in succession to the data “D10” without accessing the tag table 30 and the data memory 40 to read each. Will be.

なお、キャッシュメモリ制御装置1は、第2のデータをプロセッサに出力しながら、上述のような処理によって第3のデータを先読みし、同様にプロセッサに出力する。
次に、プロセッサによって読み出されるデータが、先読みキャッシュにヒットしない場合の例について説明する。
図6は、プロセッサによって読み出されるデータが、先読みキャッシュにヒットしない場合の動作例を示すタイミングチャートである。なお、図6におけるデータ名や信号名等は、図5における場合と同様である。
The cache memory control device 1 prefetches the third data by the process as described above while outputting the second data to the processor, and similarly outputs the third data to the processor.
Next, an example in which data read by the processor does not hit the prefetch cache will be described.
FIG. 6 is a timing chart showing an operation example when the data read by the processor does not hit the prefetch cache. The data names and signal names in FIG. 6 are the same as those in FIG.

図6において、サイクル“6”までの動作は、図5に示すサイクル“6”までの動作とほぼ同様である。ただし、サイクル“5”で読み出される第2のデータの先頭ワードは分岐命令であり、その命令はサイクル“6”で実行される。
そして、サイクル“7”において、分岐先であるアドレス“A44”のデータは、プロセッサ先読みバッファ22に記憶されていないことから、先読みキャッシュにヒットしないことが検出される(PRC-HIT=0)。このとき、キャッシュメモリ制御装置1は、ノーウェイトでデータの供給を行うため、次のサイクルでアドレス“A44”に対応するメモリデバイスデータ“D44”を出力するべく、タグ・テーブル30およびデータ・メモリ40の各ウェイに、アドレス“A44”のワードを含むブロック(以下、「分岐先データ」と言う。)のアドレスを出力する。
In FIG. 6, the operation up to cycle “6” is almost the same as the operation up to cycle “6” shown in FIG. However, the first word of the second data read in cycle “5” is a branch instruction, and the instruction is executed in cycle “6”.
In cycle “7”, since the data of the branch destination address “A44” is not stored in the processor prefetch buffer 22, it is detected that the prefetch cache is not hit (PRC-HIT = 0). At this time, since the cache memory control device 1 supplies data without waiting, in order to output the memory device data “D44” corresponding to the address “A44” in the next cycle, the tag table 30 and the data memory The address of the block including the word of address “A44” (hereinafter referred to as “branch destination data”) is output to each of the 40 ways.

そして、サイクル“8”において、タグ・テーブル30から、各ウェイに記憶されたアドレス(WAYA-TAG-DATA,WAYB-TAG-DATA)が出力されると共に、データ・メモリ40から、各ウェイのデータ(WAYA-TAG-DATA,WAYB-TAG-DATA)が出力される。このとき、タグ・テーブル30の各ウェイに記憶されたアドレスと、分岐先データのアドレスとが一致することから、キャッシュにヒットしたことが検出される(CACHE-HIT=1)。さらに、ヒット検出部50から、いずれかのウェイを選択する情報(WAY-SELECT)が出力される。その結果、選択されたウェイのメモリデバイスデータ(データ“D44”)がプロセッサに対して出力される(PBUS-RDDATA)。   In cycle “8”, the address (WAYA-TAG-DATA, WAYB-TAG-DATA) stored in each way is output from the tag table 30 and the data of each way is output from the data memory 40. (WAYA-TAG-DATA, WAYB-TAG-DATA) is output. At this time, since the address stored in each way of the tag table 30 matches the address of the branch destination data, it is detected that the cache is hit (CACHE-HIT = 1). Further, the hit detection unit 50 outputs information (WAY-SELECT) for selecting any way. As a result, the memory device data (data “D44”) of the selected way is output to the processor (PBUS-RDDATA).

即ち、サイクル“7”で行われたプロセッサからの分岐先の読み出し命令に対し、キャッシュメモリ制御装置1は、対応するメモリデバイスデータをサイクル“8”で出力している。
ここで、分岐先であるアドレス“A44”は、ブロックの第2番目のワードであることから、キャッシュメモリ制御装置1においては、そのブロックの第2番目から第4番目のワード(アドレス“A44〜”A4C“のワード)がまとめて読み出され、プロセッサ先読みバッファ22に記憶される。
That is, the cache memory control device 1 outputs the corresponding memory device data in cycle “8” in response to the branch destination read instruction from the processor executed in cycle “7”.
Here, since the branch destination address “A44” is the second word of the block, in the cache memory control device 1, the second to fourth words (address “A44˜ “A4C”) are read together and stored in the processor prefetch buffer 22.

この後、キャッシュメモリ制御装置1は、図5における処理と同様に、分岐先データをプロセッサに出力しながら、引き続くデータを先読みし、プロセッサに出力する。
次に、プロセッサによって読み出されるデータが、先読みキャッシュにもキャッシュにもヒットしない場合の例について説明する。
図7は、プロセッサによって読み出されるデータが、先読みキャッシュにもキャッシュにもヒットしない場合の動作例を示すタイミングチャートである。なお、図7におけるデータ名や信号名等は、図5における場合と同様である。
Thereafter, the cache memory control device 1 prefetches the subsequent data and outputs it to the processor while outputting the branch destination data to the processor in the same manner as the processing in FIG.
Next, an example in which data read by the processor does not hit the prefetch cache or the cache will be described.
FIG. 7 is a timing chart showing an operation example when the data read by the processor does not hit the prefetch cache or the cache. The data names and signal names in FIG. 7 are the same as in FIG.

図7において、サイクル“7”までの動作は、図6に示すサイクル“7”までの動作と同様である。
そして、サイクル“8”において、タグ・テーブル30から、各ウェイに記憶されたアドレス(WAYA-TAG-DATA,WAYB-TAG-DATA)が出力されると共に、データ・メモリ40から、各ウェイのデータ(WAYA-TAG-DATA,WAYB-TAG-DATA)が出力される。このとき、タグ・テーブル30の各ウェイに記憶されたアドレスと、分岐先データのアドレスとが一致しないことから、キャッシュにヒットしないことが検出される(CACHE-HIT=0)。
In FIG. 7, the operation up to the cycle “7” is the same as the operation up to the cycle “7” shown in FIG.
In cycle “8”, the address (WAYA-TAG-DATA, WAYB-TAG-DATA) stored in each way is output from the tag table 30 and the data of each way is output from the data memory 40. (WAYA-TAG-DATA, WAYB-TAG-DATA) is output. At this time, since the address stored in each way of the tag table 30 does not match the address of the branch destination data, it is detected that the cache is not hit (CACHE-HIT = 0).

すると、アドレス“A44”のデータが読み出せないことから、キャッシュメモリ制御装置1は、外部メモリからデータを読み出す。そのため、外部メモリからデータが取り込めるまでの3サイクル分、ウェイトサイクルが発生する。
なお、キャッシュメモリ制御装置1は、外部メモリから取り込んだ分岐先データを外部メモリ先読みバッファ23に順次記憶する。このとき、外部メモリからデータを取り込むためには、キャッシュの場合と異なり、1ワードにつき2サイクルを要している(データ“D44〜D48”)。そして、キャッシュメモリ制御装置1は、分岐先データを外部メモリ先読みバッファ23に記憶した後には、図5における処理と同様に、引き続くデータを先読みし、同様にプロセッサに出力する。また、外部メモリ先読みバッファ23に記憶された分岐先データは、データ・メモリ40へのアクセスが行われていないタイミングで、データ・メモリ40にキャッシュされる。さらに、外部メモリ先読みバッファ23に外部メモリから取り込んだデータが記憶されている状態で、そのデータに対する読み出し命令がプロセッサから入力された場合、外部メモリ先読みバッファ23に記憶されたデータが、プロセッサに出力される。
Then, since the data at the address “A44” cannot be read, the cache memory control device 1 reads the data from the external memory. Therefore, a wait cycle is generated for three cycles until data can be taken from the external memory.
Note that the cache memory control device 1 sequentially stores the branch destination data fetched from the external memory in the external memory prefetch buffer 23. At this time, in order to fetch data from the external memory, two cycles are required for each word (data “D44 to D48”) unlike the case of the cache. Then, after storing the branch destination data in the external memory prefetch buffer 23, the cache memory control device 1 prefetches the subsequent data and outputs it to the processor in the same manner as in the processing in FIG. The branch destination data stored in the external memory prefetch buffer 23 is cached in the data memory 40 at a timing when the data memory 40 is not accessed. Further, when the data fetched from the external memory is stored in the external memory prefetch buffer 23 and a read command for the data is input from the processor, the data stored in the external memory prefetch buffer 23 is output to the processor. Is done.

次に、プロセッサによって読み出されるデータが、連続するアドレスのデータであるにもかかわらず、先読みが行えない場合(キャッシュにヒットしない場合)の例について説明する。なお、このような場合には、予定データを外部メモリから取り込む必要がある。
図8は、プロセッサによって読み出されるデータが、連続するアドレスのデータであるにもかからず、キャッシュにヒットしない場合の動作例を示すタイミングチャートである。なお、図8におけるデータ名や信号名等は、図5における場合と同様である。
Next, an example will be described in which the data read by the processor is data at consecutive addresses, but prefetching cannot be performed (the cache is not hit). In such a case, it is necessary to fetch the scheduled data from the external memory.
FIG. 8 is a timing chart showing an operation example when the data read by the processor does not hit the cache even though the data is continuous address data. Note that the data names and signal names in FIG. 8 are the same as those in FIG.

図8において、サイクル“4〜5”の動作は、図7に示すサイクル“6〜7”の動作とほぼ同様である。ただし、図8の場合、キャッシュにヒットしないことが検出されるサイクル“5”において、外部メモリへのアクセスを直ちに開始している。
そして、外部メモリへのアクセスを行ってから3サイクルの後(サイクル“8”)、外部メモリから予定データの各ワードが順次取り込まれる。
In FIG. 8, the operations of cycles “4 to 5” are substantially the same as the operations of cycles “6 to 7” shown in FIG. However, in the case of FIG. 8, access to the external memory is immediately started in cycle “5” in which it is detected that the cache is not hit.
Then, after three cycles after accessing the external memory (cycle “8”), each word of the scheduled data is sequentially fetched from the external memory.

即ち、プロセッサから読み出し対象となるデータのアドレス(アドレス“A10”)が入力されるサイクル“5”に対し、3サイクル後に外部メモリのデータがプロセッサに出力されることとなる。
この結果、従来のように、プロセッサから読み出し対象となるデータのアドレスが入力されてから、キャッシュにヒットするか否かを検出する場合に比べ、1サイクル早いタイミングで外部メモリのデータを取り込むことが可能となる。つまり、従来の方法では、プロセッサから読み出し命令が入力されてから、プロセッサにデータが出力されるまで4サイクルを要していたが、図8においては、3サイクルに短縮されている。
That is, the data in the external memory is output to the processor after three cycles with respect to the cycle “5” in which the address (address “A10”) of the data to be read is input from the processor.
As a result, the data in the external memory can be fetched at a timing earlier by one cycle than in the conventional case where it is detected whether or not the cache hits after the address of the data to be read is input from the processor. It becomes possible. That is, in the conventional method, four cycles are required from when a read command is input from the processor to when data is output to the processor, but in FIG. 8, the number is shortened to three cycles.

なお、図3〜図8の説明においては、予定データがキャッシュにヒットするか否かを検出(先読み)するタイミングを、読み出し対象であるメモリデバイスデータの最後のワードのアドレスがプロセッサから出力されるタイミングであるものとして説明したが、読み出し対象であるメモリデバイスデータの先頭のワードのアドレスがプロセッサから入力されるタイミングで先読みを行うこととしても良い。この場合、先読みしたデータが実際にプロセッサから読み出される確率が低下するものの、キャッシュにヒットしない場合にウェイトサイクルのペナルティを軽減できる。   In the description of FIGS. 3 to 8, the timing of detecting whether or not the scheduled data hits the cache (prefetching), the address of the last word of the memory device data to be read is output from the processor. Although it has been described that it is timing, prefetching may be performed at the timing when the address of the first word of memory device data to be read is input from the processor. In this case, although the probability that the prefetched data is actually read from the processor is lowered, the penalty of the wait cycle can be reduced when the cache is not hit.

以下、読み出し対象であるメモリデバイスデータの先頭のワードのアドレスがプロセッサから入力されるタイミングで先読みを行う場合(以下、「先行先読み処理」と言う。)の動作について説明する。
図9は、先行先読み処理の動作を示す状態遷移図である。
図9において、キャッシュメモリ制御装置1は、状態P1〜P4および状態P5,6を遷移し、それぞれの状態間を遷移するための遷移条件G1〜G14が定められている。
The operation when prefetching is performed at the timing when the address of the first word of the memory device data to be read is input from the processor (hereinafter referred to as “prefetching prefetch processing”) will be described.
FIG. 9 is a state transition diagram showing the operation of the prefetching process.
In FIG. 9, the cache memory control device 1 transitions between states P1 to P4 and states P5 and P6, and transition conditions G1 to G14 are defined for transitioning between the states.

なお、図9における状態P1〜P4および遷移条件G2〜G12は、図3における状態S1〜S4および遷移条件C2〜C12とそれぞれ同様であるため説明を省略し、異なる部分についてのみ説明する。
状態P5(ST-PREREAD-IDLE)は、タイミングを遅らせるためのアイドル状態である。即ち、ブロックの先頭のワードのアドレスがプロセッサから入力されるタイミングで先読みを行う場合、読み出し対象となるデータをプロセッサ先読みバッファ22に取り込むタイミングが早すぎてしまう“ずれ”を解消するために、一定サイクルのアイドル状態が挿入されるものである。
Note that states P1 to P4 and transition conditions G2 to G12 in FIG. 9 are the same as states S1 to S4 and transition conditions C2 to C12 in FIG.
The state P5 (ST-PREREAD-IDLE) is an idle state for delaying the timing. That is, when prefetching is performed at the timing when the address of the first word of the block is input from the processor, in order to eliminate the “shift” in which the timing for fetching data to be read into the processor prefetch buffer 22 is too early, The idle state of the cycle is inserted.

状態P6(ST-PREREAD-EXE)においては、データ・メモリ40からプロセッサ先読みバッファ22にデータが転送される。
遷移条件 G1(CND-PRA-F-START)は、状態P1において、読み込み対象であるデータの先頭のワード(16進数で表されたアドレスの末尾が“0”のワード)のアドレスが、プロセッサから入力されることを意味している。
In the state P6 (ST-PREREAD-EXE), data is transferred from the data memory 40 to the processor prefetch buffer 22.
The transition condition G1 (CND-PRA-F-START) indicates that in the state P1, the address of the first word of the data to be read (the word whose hexadecimal address ends with “0”) is read from the processor. It means that it is input.

遷移条件G13(CND-PRA-READ-START)は、状態P5において、読み込み対象であるデータの末尾のワード(16進数で表されたアドレスの末尾が“C”のワード)のアドレスが、プロセッサから入力されることを意味している。
遷移条件G14(CND-PRA-READ-END)は、データ・メモリ40からプロセッサ先読みバッファ22へのデータの転送が終了することを意味している。
In the transition condition G13 (CND-PRA-READ-START), in the state P5, the address of the last word of the data to be read (the word with the end of the address represented by the hexadecimal number “C”) is sent from the processor. It means that it is input.
The transition condition G14 (CND-PRA-READ-END) means that data transfer from the data memory 40 to the processor prefetch buffer 22 is completed.

図9に示すように各状態を遷移する結果、キャッシュメモリ制御装置1は、例えば、上述の図5〜図8に対応する動作を行う。なお、ここでは具体的な動作の説明を省略する。
以上のように、本実施の形態に係るキャッシュメモリ制御装置1は、読み出し対象であるデータがプロセッサから読み出されている際に、引き続いて読み出されると予想されるデータがキャッシュされているか否か(データ・メモリ40に記憶されているか否か)を検出する。そして、引き続いて読み出されると予想されるデータがキャッシュに記憶されている場合、そのデータを先読みキャッシュ部20に記憶し、引き続いて読み出されると予想されるデータがキャッシュに記憶されていない場合、そのデータを外部メモリから読み出し、先読みキャッシュ部20に記憶する。その後、引き続くサイクルでプロセッサから実際に読み出されたデータのアドレスが、先読みキャッシュ部20に記憶されたデータのアドレスと一致する場合、そのデータを先読みキャッシュ部20からプロセッサに出力する。なお、引き続くサイクルでプロセッサから実際に読み出されたデータのアドレスが、先読みキャッシュ部20に記憶されたデータのアドレスと一致しない場合には、その時点で外部メモリにアクセスする。
As a result of the transition of each state as shown in FIG. 9, the cache memory control device 1 performs, for example, the operation corresponding to the above-described FIGS. In addition, description of specific operation | movement is abbreviate | omitted here.
As described above, the cache memory control device 1 according to the present embodiment determines whether data that is expected to be read subsequently is cached when the data to be read is read from the processor. (Whether or not it is stored in the data memory 40). If data that is expected to be read subsequently is stored in the cache, the data is stored in the prefetch cache unit 20, and if data that is expected to be read subsequently is not stored in the cache, the data is stored in the cache. Data is read from the external memory and stored in the prefetch cache unit 20. Thereafter, when the address of data actually read from the processor in the subsequent cycle matches the address of data stored in the prefetch cache unit 20, the data is output from the prefetch cache unit 20 to the processor. If the address of the data actually read from the processor in the subsequent cycle does not match the address of the data stored in the prefetch cache unit 20, the external memory is accessed at that time.

そのため、プロセッサから読み出し対象であるデータのアドレスが入力された場合に、タグ・テーブル30およびデータ・メモリ40の各ウェイに常にはアクセスする必要がなく、データ・メモリ40に読み出し対象であるデータが記憶されている場合にのみアクセスすれば足りる。
したがって、キャッシュメモリ制御装置1内の不要な部分に対するアクセスを防ぐことができ、消費電力の低減、および、処理効率の向上を実現することが可能となる。
Therefore, when the address of the data to be read is input from the processor, it is not always necessary to access each way of the tag table 30 and the data memory 40, and the data to be read is stored in the data memory 40. Access only if it is remembered.
Therefore, access to an unnecessary part in the cache memory control device 1 can be prevented, and it becomes possible to reduce power consumption and improve processing efficiency.

また、キャッシュメモリ制御装置1は、読み出し対象であるデータの末尾のワードのアドレスが入力されているタイミングで、予定データの先読みを行う。
したがって、引き続くサイクルで読み出される確率の高いデータを先読みキャッシュ部20に記憶しておくことができるため、無駄なデータに対するアクセスを行う事態を低減でき、消費電力の低減を図ることができる。
Further, the cache memory control device 1 prefetches the scheduled data at the timing when the address of the last word of the data to be read is input.
Therefore, since data having a high probability of being read in the subsequent cycle can be stored in the prefetch cache unit 20, it is possible to reduce the situation of accessing useless data and to reduce power consumption.

一方、キャッシュメモリ制御装置1は、読み出し対象であるデータの先頭のワードのアドレスが入力されるタイミング等、末尾のワードのアドレスが入力されるタイミングより早く予定データの先読みを行うことも可能である。
この場合、より早いタイミングでキャッシュのヒットが検出されるため、キャッシュにヒットしない場合に、外部メモリから読み出し対象であるデータを読み込む処理をより早く行うことができ、ウェイトサイクルの発生を防止すること、あるいは、ウェイトサイクルの回数を低減することが可能となる。
On the other hand, the cache memory control device 1 can pre-read the scheduled data earlier than the timing at which the address of the last word is input, such as the timing at which the address of the first word of the data to be read is input. .
In this case, a cache hit is detected at an earlier timing, so that if the cache is not hit, the process of reading the data to be read from the external memory can be performed earlier and the occurrence of a wait cycle can be prevented. Alternatively, the number of wait cycles can be reduced.

なお、キャッシュメモリ制御装置1において、クロックゲーティング機能を備えることにより、さらに消費電力を低減することが可能である。
図10は、キャッシュメモリ制御装置1がクロックゲーティング機能を備える場合の構成を示す図である。
図10において、キャッシュメモリ制御装置1は、図1に示す構成に加え、消費電力制御部70を含んで構成される。
Note that the cache memory control device 1 can further reduce power consumption by providing a clock gating function.
FIG. 10 is a diagram showing a configuration when the cache memory control device 1 has a clock gating function.
In FIG. 10, the cache memory control device 1 includes a power consumption control unit 70 in addition to the configuration shown in FIG. 1.

消費電力制御部70は、キャッシュメモリ制御装置1において動作を行わない部分に対し、クロック信号の供給を停止させる機能を備えている。
図11は、消費電力制御部70の構成を示す図である。
図11において、消費電力制御部70は、複数n個のメモリそれぞれに対応するクロックゲーティング素子(以下、「CG素子」と言う。)71−1〜71−nを含んで構成される。
The power consumption control unit 70 has a function of stopping the supply of a clock signal to a portion that does not operate in the cache memory control device 1.
FIG. 11 is a diagram illustrating a configuration of the power consumption control unit 70.
In FIG. 11, the power consumption control unit 70 includes clock gating elements (hereinafter referred to as “CG elements”) 71-1 to 71-n corresponding to a plurality of n memories.

これらのCG素子71−1〜71−nには、アクセス管理部10から、クロック信号の供給を行うか否かを切り替えるための消費電力モード信号SG1〜SGnがそれぞれ入力される。アクセス管理部10は、動作が不要であると判定されたメモリに対してはクロック信号の供給を停止させる消費電力モード信号を出力し、動作を行うと判定されたメモリに対してはクロック信号を供給する消費電力モード信号を出力する。   These CG elements 71-1 to 71-n receive power consumption mode signals SG1 to SGn for switching whether or not to supply a clock signal from the access management unit 10, respectively. The access management unit 10 outputs a power consumption mode signal for stopping the supply of the clock signal to the memory determined to be unnecessary, and outputs the clock signal to the memory determined to be operated. A power consumption mode signal to be supplied is output.

このような構成とすることにより、先読みキャッシュ部20に読み込むデータが記憶されているデータ・メモリ40のウェイに対してのみクロック信号を供給するといったことが可能となり、さらに消費電力の低減を図ることができる。   By adopting such a configuration, it becomes possible to supply a clock signal only to the way of the data memory 40 in which data to be read into the prefetch cache unit 20 is stored, and to further reduce power consumption. Can do.

本発明を適用したキャッシュメモリ制御装置1の構成を示す図である。It is a figure which shows the structure of the cache memory control apparatus 1 to which this invention is applied. タグ・テーブル30およびデータ・メモリ40に記憶されるデータの構成を示す図である。FIG. 3 is a diagram illustrating a configuration of data stored in a tag table 30 and a data memory 40. キャッシュメモリ制御装置1の基本的な動作を示す状態遷移図である。FIG. 3 is a state transition diagram showing basic operations of the cache memory control device 1. キャッシュメモリ制御装置1上に構築されるステートマシン“sm-exmem-access”の動作を示す状態遷移図である。FIG. 6 is a state transition diagram showing an operation of a state machine “sm-exmem-access” constructed on the cache memory control device 1. プロセッサによって読み出されるデータが、連続して先読みキャッシュにヒットする場合の動作例を示すタイミングチャートである。It is a timing chart which shows the operation example when the data read by a processor hits a prefetch cache continuously. プロセッサによって読み出されるデータが、先読みキャッシュにヒットしない場合の動作例を示すタイミングチャートである。It is a timing chart which shows the operation example when the data read by a processor does not hit a prefetch cache. プロセッサによって読み出されるデータが、先読みキャッシュにもキャッシュにもヒットしない場合の動作例を示すタイミングチャートである。It is a timing chart which shows the operation example when the data read by a processor do not hit neither a prefetch cache nor a cache. プロセッサによって読み出されるデータが、連続するアドレスのデータであるにもかからず、キャッシュにヒットしない場合の動作例を示すタイミングチャートである。7 is a timing chart illustrating an operation example in a case where data read by a processor is data at consecutive addresses and does not hit a cache. 先行先読み処理の動作を示す状態遷移図である。It is a state transition diagram which shows the operation | movement of a prefetching process. キャッシュメモリ制御装置1がクロックゲーティング機能を備える場合の構成を示す図である。It is a figure which shows a structure in case the cache memory control apparatus 1 is provided with a clock gating function. 消費電力制御部70の構成を示す図である。3 is a diagram illustrating a configuration of a power consumption control unit 70. FIG. 従来のセット・アソシアティブ方式のキャッシュメモリ100の構成を示す概略図である。1 is a schematic diagram illustrating a configuration of a conventional set-associative cache memory 100. FIG.

符号の説明Explanation of symbols

1 キャッシュメモリ制御装置,10 アクセス管理部,20 先読みキャッシュ部,21 アドレス制御部,22 プロセッサ先読みバッファ,23 外部メモリ先読みバッファ,30,110 タグ・テーブル,40,120 データ・メモリ,50,130 ヒット検出部,60 MUX,70 消費電力制御部,71 CG素子,100 キャッシュメモリ 1 cache memory control device, 10 access management unit, 20 prefetch cache unit, 21 address control unit, 22 processor prefetch buffer, 23 external memory prefetch buffer, 30, 110 tag table, 40, 120 data memory, 50, 130 hit Detection unit, 60 MUX, 70 Power consumption control unit, 71 CG element, 100 Cache memory

Claims (12)

プロセッサの読み出し対象となるデータを記憶しているメモリデバイスから、記憶されているデータの少なくとも一部を複数のウェイを含むキャッシュメモリにキャッシュしておき、キャッシュされたデータをプロセッサに供給可能なキャッシュメモリ制御装置であって、
プロセッサが読み出している読み出し中データの後に読み出されると予想される予定データが、前記キャッシュメモリのいずれかのウェイにキャッシュされているか否かを判定するキャッシュ判定手段と、
前記キャッシュ判定手段によって、前記予定データがいずれかのウェイにキャッシュされていると判定された場合に、前記複数のウェイのうち、該予定データが記憶されているウェイにアクセスし、該予定データを読み出して記憶する先読みキャッシュ手段と、
を含み、
前記先読みキャッシュ手段は、前記読み出し中データの後に前記予定データが読み出された場合に、記憶している予定データをプロセッサに出力することを特徴とするキャッシュメモリ制御装置。
A cache capable of supplying at least a part of stored data to a cache memory including a plurality of ways from a memory device storing data to be read by the processor and supplying the cached data to the processor A memory control device,
Cache determination means for determining whether or not scheduled data expected to be read after the data being read being read by the processor is cached in any way of the cache memory;
When the cache determination means determines that the scheduled data is cached in any way, the way in which the scheduled data is stored is accessed from among the plurality of ways, and the scheduled data is Prefetch cache means for reading and storing;
Including
The cache memory control device, wherein the prefetch cache means outputs the stored plan data to a processor when the plan data is read after the data being read.
前記キャッシュメモリは、前記複数のウェイについて、キャッシュしているデータのアドレスを格納しているアドレス記憶手段と、該アドレスそれぞれに対応するデータを記憶しているデータ記憶手段とを含み、
前記キャッシュ判定手段は、前記アドレス記憶手段のいずれかのウェイに、前記予定データのアドレスが記憶されているか否かによって、該予定データがキャッシュされているか否かを判定し、
前記先読みキャッシュ手段は、前記データ記憶手段の複数のウェイのうち、前記予定データのアドレスを記憶している前記アドレス記憶手段のウェイに対応するウェイにアクセスすることを特徴とする請求項1記載のキャッシュメモリ制御装置。
The cache memory includes, for the plurality of ways, address storage means for storing cached data addresses, and data storage means for storing data corresponding to each of the addresses,
The cache determination means determines whether the schedule data is cached by determining whether the address of the schedule data is stored in any way of the address storage means,
2. The prefetch cache unit accesses a way corresponding to a way of the address storage unit storing an address of the scheduled data among a plurality of ways of the data storage unit. Cache memory controller.
前記予定データは、前記読み出し中データの直後に読み出されると予想されるデータであることを特徴とする請求項1または2記載のキャッシュメモリ制御装置。   3. The cache memory control device according to claim 1, wherein the scheduled data is data that is expected to be read immediately after the data being read. プロセッサの読み出し対象となるデータは、複数のワードを含むブロックとして構成され、該ブロックを単位として、前記予定データがキャッシュされているか否かの判定あるいは前記予定データの読み出しを行うことを特徴とする請求項1から3のいずれか1項に記載のキャッシュメモリ制御装置。   Data to be read by the processor is configured as a block including a plurality of words, and the block is used as a unit to determine whether the scheduled data is cached or to read the scheduled data. The cache memory control device according to any one of claims 1 to 3. 前記キャッシュ判定手段は、前記読み出し中データを構成する複数のワードのうち、プロセッサが末尾のワードの読み出しを指示することに対応して、前記予定データがキャッシュされているか否かを判定することを特徴とする請求項4記載のキャッシュメモリ制御装置。   The cache determination means determines whether the scheduled data is cached in response to the processor instructing to read the last word among the plurality of words constituting the data being read. 5. The cache memory control device according to claim 4, wherein: 前記キャッシュ判定手段は、前記読み出し中データを構成する複数のワードのうち、プロセッサが末尾のワードに先行するワードの読み出しを指示することに対応して、前記予定データがキャッシュされているか否かを判定することを特徴とする請求項4記載のキャッシュメモリ制御装置。   The cache determination means determines whether or not the scheduled data is cached in response to the processor instructing to read the word preceding the last word among the plurality of words constituting the data being read. 5. The cache memory control device according to claim 4, wherein the determination is made. 前記先読みキャッシュ手段は、前記キャッシュ判定手段によって、前記予定データがいずれかのウェイにキャッシュされていると判定された場合に、前記読み出し中データを構成する複数のワードのうち、プロセッサが末尾のワードの読み出しを指示することに対応して、該予定データが記憶されているウェイにアクセスし、該予定データを読み出すことを特徴とする請求項6記載のキャッシュメモリ制御装置。   The prefetch cache means, when the cache judgment means judges that the scheduled data is cached in any way, the processor is the last word among the plurality of words constituting the data being read. 7. The cache memory control device according to claim 6, wherein in response to instructing to read the data, the way in which the schedule data is stored is accessed to read the schedule data. 前記キャッシュメモリにおける複数のウェイのうち、データの読み出しに関係しないウェイを低消費電力で動作させる低消費電力化手段をさらに含むことを特徴とする請求項1から7のいずれか1項に記載のキャッシュメモリ制御装置。   The power consumption reducing means for operating a way not related to data reading among a plurality of ways in the cache memory with low power consumption. Cache memory controller. 前記低消費電力化手段は、データの読み出しに関係しないウェイに対し、クロック信号を供給しないように制御するクロックゲーティング機能を備えることを特徴とする請求項8記載のキャッシュメモリ制御装置。   9. The cache memory control device according to claim 8, wherein the low power consumption means includes a clock gating function for controlling a way not related to data reading so as not to supply a clock signal. 前記キャッシュメモリは、セット・アソシアティブ方式のキャッシュメモリであることを特徴とする請求項1から9のいずれか1項に記載のキャッシュメモリ制御装置。   The cache memory control device according to claim 1, wherein the cache memory is a set associative cache memory. 前記先読みキャッシュ手段は、前記キャッシュ判定手段によって、前記キャッシュメモリのいずれのウェイにも前記予定データがキャッシュされていないと判定された場合、前記メモリデバイスにアクセスし、該予定データを読み出して記憶することを特徴とする請求項1から10のいずれか1項に記載のキャッシュメモリ制御装置。   The prefetch cache means accesses the memory device to read and store the scheduled data when the cache judging means determines that the scheduled data is not cached in any way of the cache memory. 11. The cache memory control device according to claim 1, wherein the cache memory control device is a cache memory control device. プロセッサの読み出し対象となるデータを記憶しているメモリデバイスから、記憶されているデータの少なくとも一部を複数のウェイを含むキャッシュメモリにキャッシュしておき、キャッシュされたデータをプロセッサに供給するためのキャッシュメモリ制御方法であって、
プロセッサが読み出している読み出し中データの後に読み出されると予想される予定データが、前記キャッシュメモリのいずれかのウェイにキャッシュされているか否かを判定するキャッシュ判定ステップと、
前記キャッシュ判定ステップにおいて、前記予定データがいずれかのウェイにキャッシュされていると判定された場合に、前記複数のウェイのうち、該予定データが記憶されているウェイにアクセスし、該予定データを読み出して記憶する先読みキャッシュステップと、
プロセッサによって、前記読み出し中データの後に前記予定データが読み出された場合に、前記先読みキャッシュステップにおいて記憶された予定データをプロセッサに出力する出力ステップと、
を含むことを特徴とするキャッシュメモリ制御方法。
A method for caching at least a part of stored data in a cache memory including a plurality of ways from a memory device storing data to be read by the processor and supplying the cached data to the processor A cache memory control method comprising:
A cache determination step of determining whether or not the scheduled data expected to be read after the data being read being read by the processor is cached in any of the ways of the cache memory;
In the cache determination step, when it is determined that the scheduled data is cached in any way, the way in which the scheduled data is stored is accessed from among the plurality of ways, and the scheduled data is A read-ahead cache step for reading and storing;
An output step of outputting the scheduled data stored in the prefetch cache step to the processor when the scheduled data is read after the data being read by the processor;
A cache memory control method comprising:
JP2003316884A 2003-09-09 2003-09-09 Cache memory control device and cache memory control method Expired - Fee Related JP4374956B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2003316884A JP4374956B2 (en) 2003-09-09 2003-09-09 Cache memory control device and cache memory control method
US10/927,090 US20050086435A1 (en) 2003-09-09 2004-08-27 Cache memory controlling apparatus, information processing apparatus and method for control of cache memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003316884A JP4374956B2 (en) 2003-09-09 2003-09-09 Cache memory control device and cache memory control method

Publications (2)

Publication Number Publication Date
JP2005084999A true JP2005084999A (en) 2005-03-31
JP4374956B2 JP4374956B2 (en) 2009-12-02

Family

ID=34416644

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003316884A Expired - Fee Related JP4374956B2 (en) 2003-09-09 2003-09-09 Cache memory control device and cache memory control method

Country Status (1)

Country Link
JP (1) JP4374956B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007200213A (en) * 2006-01-30 2007-08-09 Nec Corp Information processing device, entry configuration control method and program
JP2009116621A (en) * 2007-11-06 2009-05-28 Toshiba Corp Arithmetic processing apparatus
WO2015034082A1 (en) * 2013-09-06 2015-03-12 株式会社 東芝 Memory control circuit and cache memory
US9892049B2 (en) 2012-10-31 2018-02-13 Renesas Electronics Corporation Semiconductor device and method for prefetching to cache memory
KR20190058316A (en) * 2017-11-20 2019-05-29 삼성전자주식회사 Systems and methods for efficient cache line handling based on predictions

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007200213A (en) * 2006-01-30 2007-08-09 Nec Corp Information processing device, entry configuration control method and program
JP2009116621A (en) * 2007-11-06 2009-05-28 Toshiba Corp Arithmetic processing apparatus
US9892049B2 (en) 2012-10-31 2018-02-13 Renesas Electronics Corporation Semiconductor device and method for prefetching to cache memory
WO2015034082A1 (en) * 2013-09-06 2015-03-12 株式会社 東芝 Memory control circuit and cache memory
JP2015052940A (en) * 2013-09-06 2015-03-19 株式会社東芝 Memory control circuit and cache memory
US9786342B2 (en) 2013-09-06 2017-10-10 Kabushiki Kaisha Toshiba Memory control circuit and cache memory
KR20190058316A (en) * 2017-11-20 2019-05-29 삼성전자주식회사 Systems and methods for efficient cache line handling based on predictions
KR102193689B1 (en) 2017-11-20 2020-12-21 삼성전자주식회사 Systems and methods for efficient cache line handling based on predictions
US11138121B2 (en) 2017-11-20 2021-10-05 Samsung Electronics Co., Ltd. Systems and methods for efficient cacheline handling based on predictions

Also Published As

Publication number Publication date
JP4374956B2 (en) 2009-12-02

Similar Documents

Publication Publication Date Title
JP3739491B2 (en) Harmonized software control of Harvard architecture cache memory using prefetch instructions
US6718454B1 (en) Systems and methods for prefetch operations to reduce latency associated with memory access
EP1029280B1 (en) Cache memory operation
JP2000339157A (en) Cache memory controller and computer system
JP5444889B2 (en) Arithmetic processing device and control method of arithmetic processing device
JPH10232827A (en) Method and device for writing back prefetch cache
JP2004171177A (en) Cache system and cache memory controller
JP2007213578A (en) Data-cache miss prediction and scheduling
JP2005276199A (en) Method to provide cache management command for dma controller
US20070005938A1 (en) Branch instruction prediction
JP2007514237A (en) Method and apparatus for allocating entry in branch target buffer
KR101049319B1 (en) Method and apparatus for reducing lookups in branch target address cache
JP2008186233A (en) Instruction cache pre-fetch control method and device thereof
JP4173858B2 (en) Instruction cache and method for reducing memory contention
JP4374956B2 (en) Cache memory control device and cache memory control method
JPH1055276A (en) Multi-level branching prediction method and device
US20040049642A1 (en) Method and architecture capable of accessing data and instructions using store and forward
JPH11232171A (en) Information processing system
US10776043B2 (en) Storage circuitry request tracking
JP2008015668A (en) Task management device
US5724533A (en) High performance instruction data path
JP2006139646A (en) Data transfer device and data transfer method
JP2007193433A (en) Information processor
JP5170050B2 (en) Hardware processor, hardware processor control method, and information processing apparatus
JP2006285727A (en) Cache memory device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060327

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20070403

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090723

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: 20090818

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: 20090831

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20120918

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20130918

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees