JP2010231701A - Apparatus for quickly starting system - Google Patents
Apparatus for quickly starting system Download PDFInfo
- Publication number
- JP2010231701A JP2010231701A JP2009081059A JP2009081059A JP2010231701A JP 2010231701 A JP2010231701 A JP 2010231701A JP 2009081059 A JP2009081059 A JP 2009081059A JP 2009081059 A JP2009081059 A JP 2009081059A JP 2010231701 A JP2010231701 A JP 2010231701A
- Authority
- JP
- Japan
- Prior art keywords
- storage device
- access
- main storage
- cache memory
- data
- 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.)
- Withdrawn
Links
Images
Classifications
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Memory System Of A Hierarchy Structure (AREA)
Abstract
Description
本発明は、CPUと主記憶装置との間にキャッシュメモリを備えるシステムにおいて、キャッシュメモリの制御を工夫することにより、システム起動時の処理時間を短縮する起動高速化装置に関するものである。 The present invention relates to a startup speed-up device that shortens the processing time during system startup by devising control of the cache memory in a system including a cache memory between a CPU and a main storage device.
電気製品等の組み込みシステムとして、CPU(コンピュータ)と、キャッシュメモリ(キャッシュコントローラを含む)と、主記憶装置(メインメモリ)とを含むシステムが用いられている。 A system including a CPU (computer), a cache memory (including a cache controller), and a main storage device (main memory) is used as an embedded system such as an electric product.
キャッシュメモリは、CPUから主記憶装置へのアクセスの遅延を減らすために、CPUと主記憶装置との間に配置される揮発性メモリである。CPUが一度ロードした(読み出した)命令コードやデータ(以下、両者を纏めて読み出しデータともいう)をキャッシュメモリに保存しておき、CPUが同じ読み出しデータを再利用する際に、主記憶装置からではなくキャッシュメモリから再ロードすることにより、ロード時間を短縮し、CPUの処理速度を上昇させることができる。 The cache memory is a volatile memory disposed between the CPU and the main storage device in order to reduce a delay in access from the CPU to the main storage device. The instruction code and data once loaded (read) by the CPU (hereinafter collectively referred to as read data) are stored in the cache memory, and when the CPU reuses the same read data, Instead of reloading from the cache memory, the load time can be shortened and the processing speed of the CPU can be increased.
システムの起動直後には、揮発性のキャッシュメモリにはどのような読み出しデータも記憶されていない。その結果、システムの起動直後には、CPUが初期化プログラム(初期化ルーチンないし起動プログラムとも呼ばれる)を実行する時に主記憶装置への多くのアクセスが生じてしまう。また、初期化プログラムには繰り返し命令が少なく、これにより主記憶装置へのアクセスが頻繁に発生し、その都度、CPUに待ち時間が発生することが分かった。 Immediately after the system is started, no read data is stored in the volatile cache memory. As a result, immediately after the system is started, many accesses to the main storage device occur when the CPU executes an initialization program (also called an initialization routine or a startup program). Further, it has been found that the initialization program has few repeated instructions, which causes frequent access to the main storage device, and a waiting time is generated in the CPU each time.
このような問題に対応するため、従来、いくつかの方法が提案されている。
1つの方法は、データ先読み制御方式であり、CPUが実行した命令コードの後続の命令コードないしデータを先読みして次回の読み出しに備えるというものである(特許文献1)。
In order to cope with such a problem, several methods have been conventionally proposed.
One method is a data prefetch control method, in which an instruction code or data subsequent to an instruction code executed by the CPU is prefetched to prepare for the next reading (Patent Document 1).
ところが、この方法では、プログラムの分岐命令などによって、先読みした後続の命令コードやデータが必ずしも使用されるとは限らない。そのため、これによりキャッシュメモリに不必要なキャッシュデータがロードされ、他の必要なキャッシュデータが削除されてしまうため、その結果、それらの命令コードおよびデータの再ロードが発生してしまうリスクがある。 However, in this method, the prefetched subsequent instruction code and data are not always used by a program branch instruction or the like. As a result, unnecessary cache data is loaded into the cache memory and other necessary cache data is deleted. As a result, there is a risk of reloading those instruction codes and data.
また、他の方法として、電源投入時にあらかじめロードすることが分かっているデータをキャッシュメモリにロードしておき、CPUが初期化プログラムを実行するとき、キャッシュメモリにロードしたデータを利用して初期化プログラムのキャッシュ時間を短縮するものがある(特許文献2)。 As another method, data that is known to be loaded in advance when the power is turned on is loaded into the cache memory. When the CPU executes the initialization program, the data loaded into the cache memory is used for initialization. There is one that shortens the cache time of a program (Patent Document 2).
しかしながら、この方法も、キャッシュメモリの容量の範囲に限ってのみの高速化であるため、それを超えるサイズの初期化プログラムである場合、それを超えた分については高速化できない。また、電源投入時からCPUが起動するまでの時間が短い場合には、初期化プログラムを十分にキャッシュできないか、キャッシュが終わるまでCPUの始動を待たせなければならないという問題がある。 However, since this method is also speeded up only within the range of the capacity of the cache memory, if the initialization program exceeds the size, it cannot be speeded up beyond that. In addition, when the time from when the power is turned on to when the CPU starts up is short, there is a problem that the initialization program cannot be sufficiently cached or the CPU must be started until the cache is completed.
本発明の目的は、CPUと主記憶装置との間にキャッシュメモリを備えるシステムにおいて、電源投入からシステム起動完了までの時間を短縮することができる起動高速化装置を提供することにある。 An object of the present invention is to provide a startup acceleration device capable of shortening the time from power-on to system startup completion in a system including a cache memory between a CPU and a main storage device.
上記目的を達成するために、本発明は、CPUと、該CPUが使用する読み出しデータが記憶された主記憶装置と、該主記憶装置から読み出した読み出しデータを前記CPUに供給するとともに、一時的に記憶するキャッシュメモリとを備えるシステムの起動高速化装置であって、
1回目のシステム起動時に、前記キャッシュメモリから前記主記憶装置へのアクセスを監視して、電源投入から前記アクセスが行われるまでのアクセス時間とアクセス先の前記主記憶装置のアドレスを取得する監視装置と、
前記監視装置により取得されたアクセス時間とアドレスをテーブルデータとして記憶するテーブル記憶装置とを備え、
前記監視装置は、2回目以降のシステム起動時に、前記テーブル記憶装置に記憶されたテーブルデータに含まれるアクセス時間の順序に従って、該アクセス時間到達までに、前記テーブルデータに含まれるアドレスに対応する前記主記憶装置のアドレスから読み出しデータを読み出し、該読み出した読み出しデータを前記キャッシュメモリに書き込むことを特徴とする起動高速化装置を提供するものである。
In order to achieve the above object, the present invention provides a CPU, a main storage device storing read data used by the CPU, read data read from the main storage device to the CPU, and temporarily A system startup speed-up device comprising a cache memory stored in
A monitoring device that monitors the access from the cache memory to the main storage device at the first system startup, and obtains the access time from power-on to the access and the address of the access destination main storage device When,
A table storage device for storing the access time and address acquired by the monitoring device as table data;
The monitoring device corresponds to the address corresponding to the address included in the table data before reaching the access time according to the order of the access time included in the table data stored in the table storage device at the second or subsequent system startup. It is an object of the present invention to provide a startup acceleration device characterized in that read data is read from an address of a main storage device, and the read data is written to the cache memory.
ここで、前記監視装置は、2回目以降のシステム起動時に、前記キャッシュメモリから前記主記憶装置へのアクセスがあったことを検出し、かつ、該アクセス先のアドレスを含むテーブルデータが前記テーブル記憶装置に記憶されている場合、該アクセス先のアドレスを含むテーブルデータに含まれるアクセス時間を、前記検出されたアクセスが行われたアクセス時間に書き換えることが好ましい。 Here, the monitoring device detects that the main memory is accessed from the cache memory at the second or subsequent system startup, and table data including the access destination address is stored in the table storage. When stored in the apparatus, it is preferable to rewrite the access time included in the table data including the access destination address to the access time when the detected access was performed.
また、本発明は、CPUと、該CPUが使用する読み出しデータが記憶された主記憶装置と、該主記憶装置から読み出した読み出しデータを前記CPUに供給するとともに、一時的に記憶するキャッシュメモリとを備えるシステムの起動高速化装置であって、
1回目のシステム起動時に、前記キャッシュメモリから前記主記憶装置へのアクセスを監視して、一定の時間毎に、アクセス先の前記主記憶装置のアドレスの一部のビットからなる各々のインデックスに含まれる複数のアドレスへのアクセス回数を取得する監視装置と、
電源投入から前記一定の時間毎までのアクセス時間と前記監視装置により取得されたアクセス回数が最大のインデックスをテーブルデータとして記憶するテーブル記憶装置とを備え、
前記監視装置は、2回目以降のシステム起動時に、前記テーブル記憶装置に記憶されたテーブルデータに含まれるアクセス時間の順序に従って、前記テーブルデータに含まれるインデックスに対応する前記主記憶装置の複数のアドレスから読み出しデータを読み出し、該読み出した複数の読み出しデータのうちの一部を前記キャッシュメモリに書き込むことを特徴とする起動高速化装置を提供する。
The present invention also provides a CPU, a main storage device in which read data used by the CPU is stored, a cache memory that supplies read data read from the main storage device to the CPU and temporarily stores the read data. A system startup acceleration device comprising:
When the system is started for the first time, the access from the cache memory to the main storage device is monitored, and is included in each index consisting of some bits of the address of the main storage device to be accessed at regular intervals. A monitoring device that obtains the number of accesses to a plurality of addresses,
A table storage device that stores, as table data, an access time from power-on to the predetermined time and an index with the maximum number of accesses acquired by the monitoring device;
The monitoring device has a plurality of addresses of the main storage device corresponding to the index included in the table data in accordance with the order of access times included in the table data stored in the table storage device at the second or subsequent system startup. There is provided a start-up acceleration device characterized in that read data is read from a plurality of read data and a part of the read data is written to the cache memory.
ここで、前記監視装置は、2回目以降のシステム起動時に、前記一定の時間毎に、前記テーブルデータに含まれるインデックスとは異なるインデックスに含まれる複数のアドレスへのアクセス回数が閾値を超えた場合、前記テーブルデータに含まれるインデックスを、前記閾値を超えたインデックスに書き換えることが好ましい。 In this case, when the system is started for the second time or later, the number of accesses to a plurality of addresses included in an index different from the index included in the table data exceeds a threshold value for each predetermined time. Preferably, the index included in the table data is rewritten to an index exceeding the threshold value.
本発明によれば、初期化プログラムを2回目以降に実行する場合、監視装置が、前回の実行時に保存したテーブルデータに含まれるアクセス時間を参照して、順次、テーブルデータに含まれるアドレスに対応する主記憶装置のアドレスからデータを読み出してキャッシュメモリへ書き込む。そのため、基本的に、CPUから主記憶装置へのアクセスは発生せず、初期化プログラムの実行が高速化され、システムの起動時間を短縮することができる。 According to the present invention, when the initialization program is executed for the second time or later, the monitoring device refers to the access time included in the table data stored at the previous execution and sequentially corresponds to the address included in the table data. Data is read from the address of the main storage device and written to the cache memory. Therefore, basically, access from the CPU to the main storage device does not occur, the execution of the initialization program is accelerated, and the system startup time can be shortened.
また、本発明によれば、アクセスがあった毎にテーブルデータを記憶するのではなく、一定の時間毎にテーブルデータを記憶することもできる。そのため、必要となるテーブル記憶装置のメモリ容量を適宜低減することができる。 Further, according to the present invention, the table data can be stored at regular intervals instead of storing the table data every time access is made. Therefore, the required memory capacity of the table storage device can be appropriately reduced.
以下に、添付の図面に示す好適実施形態に基づいて、本発明の起動高速化装置を詳細に説明する。 DESCRIPTION OF EMBODIMENTS Hereinafter, a startup acceleration device of the present invention will be described in detail based on a preferred embodiment shown in the accompanying drawings.
図1は、本発明に関わる起動高速化装置を搭載する組み込みシステムの構成を表す一実施形態のブロック図である。同図に示す組み込みシステム10は、CPU12と、キャッシュメモリ14と、主記憶装置16と、監視装置18と、テーブル記憶装置20とによって構成されている。ここで、監視装置18およびテーブル記憶装置20は、本発明に関わる起動高速化装置を構成するものである。
FIG. 1 is a block diagram of an embodiment showing a configuration of an embedded system equipped with a startup acceleration device according to the present invention. The embedded
CPU12とキャッシュメモリ14は相互に接続されている。また、キャッシュメモリ14、主記憶装置16および監視装置18は、内部バス22を介して相互に接続されている。さらに、監視装置18とテーブル記憶装置20は相互に接続されている。
The
組み込みシステム10において、CPU12は、システム全体の動作を制御する制御手段であり、初期化プログラムを含む、各種のプログラム(ソフトウェア)をロードして、実行する。
In the embedded
ここで、初期化プログラムは、組み込みシステム10に電源が投入された時に、CPUが最初に実行することで組み込みシステム10を初期化するためのプログラムであり、あらかじめ主記憶装置16に記憶されている。
Here, the initialization program is a program for initializing the embedded
続いて、キャッシュメモリ14は、主記憶装置16と比べると容量は小さいが高速に動作する揮発性の半導体メモリである。キャッシュメモリ14は、内蔵されているキャッシュコントローラ(図示省略)の制御により、CPU12が使用する読み出しデータを主記憶装置16から内部バス22を介して読み出してCPU12に供給するとともに、キャッシュセット(キャッシュデータ)として一時的に記憶する。CPU12が同じ読み出しデータを再利用する場合、その読み出しデータがキャッシュメモリ14に記憶されていれば、主記憶装置16からではなく、キャッシュメモリ14に記憶されている読み出しデータがCPU12に供給されることにより、読み出し動作が高速化される。
Subsequently, the
主記憶装置16は、キャッシュメモリ14と比べると大容量であるが低速な揮発性の半導体メモリである。主記憶装置16には、初期化プログラムを含む、CPU12が使用する各種の読み出しデータが、電源投入直後にフラッシュメモリなどの不揮発性メモリ(図示省略)からコピーされることにより、あらかじめ記憶されている。
The
監視装置18は、1回目(初回)のシステム起動時に、CPU12(実際には、キャッシュメモリ14)から主記憶装置16へのアクセスを監視して、電源投入からアクセスが行われるまでのアクセス時間(本実施形態では、電源投入からのクロック数)と、アクセス先の主記憶装置16のアドレスを取得し、テーブルデータとしてテーブル記憶装置20に書き込む。また、監視装置18は、2回目以降のシステム起動時に、テーブル記憶装置20に記憶されたテーブルデータに含まれるアクセス時間の順序に従って、そのアクセス時間に到達するまでに、あるいは所定時間おきに、テーブルデータに含まれるアドレスに対応する主記憶装置16のアドレスから読み出しデータを読み出し、これをキャッシュセットとしてキャッシュメモリ14に書き込む。この様な処理を行うことにより、必要とするデータが必要な時刻までに効率よくキャッシュメモリ14に書き込まれる。監視装置18には初期化完了レジスタ24が設けられている。電源投入直後の初期化完了レジスタ24の初期値は、初期化が完了していないことを意味する‘0’であり、監視装置18は、初期化プログラム(すなわち、CPU12)によって、初期化完了レジスタ24が初期化完了を意味する‘1’に変更されるまで上記動作を続ける。
The
テーブル記憶装置20は、不揮発性の書き換え可能な半導体メモリであり、上記の通り、監視装置18により取得されたアクセス時間とアドレスをテーブルデータとして記憶する。テーブル記憶装置20には、CPU12が初期化プログラムを初めて実行したか否かを表す初回実行フラグレジスタ26が設けられている。初回実行フラグレジスタ26は、例えば、初期化プログラムが変更された場合等に、初期化プログラムのアップデートプログラム(すなわち、CPU12)によって、初期化プログラムの実行が1回目の実行であることを意味する‘1’に設定され、1回目の初期化プログラムの終了後、初期化プログラムの実行が1回目の実行ではない(2回目以降の実行である)ことを意味する‘0’に書き換えられる。
The
次に、キャッシュメモリ14について説明する。
Next, the
図2は、図1に示すキャッシュメモリ14の構成を表す概念図である。キャッシュメモリ14は、図2に示すように、複数のラインを備えており、1つのラインに4つまでのキャッシュセットが記憶できるように構成されている。キャッシュセットは、キャッシュメモリ14に読み出しデータを記憶する場合の最小単位である。各々のキャッシュセットが記憶されるメモリ領域はウェイ(Way)と呼ばれる。図2に示すキャッシュメモリ14は、各ラインが4つのウェイ(Way1〜4)によって構成されている。
FIG. 2 is a conceptual diagram showing the configuration of the
ここで、キャッシュセットについて説明する。
図3は、キャッシュメモリ14に記憶されるキャッシュセットの構成を表す概念図である。キャッシュセットは、図3に示すように、有効(Valid)ビット、ロック(Lock)ビット、および、データ(DATA)を含む。
Here, the cache set will be described.
FIG. 3 is a conceptual diagram showing the configuration of a cache set stored in the
ここで、有効ビットは、対応するキャッシュセットの記憶内容が利用可能な有効なものか、意味のない無効なものかを表す。有効ビットは、例えば、キャッシュセットが有効なものである時に‘1’に設定され、無効なものである時に‘0’に設定される。以下の説明では有効ビットの更新については言及しないが、有効ビットは、キャッシュコントローラもしくは監視装置18により随時更新(変更)される。
Here, the valid bit indicates whether the stored contents of the corresponding cache set are valid or usable and meaningless invalid. For example, the valid bit is set to “1” when the cache set is valid, and is set to “0” when the cache set is invalid. In the following description, updating of the valid bit is not mentioned, but the valid bit is updated (changed) as needed by the cache controller or the
ロックビットは、対応するキャッシュセットの内容を、CPU12もしくは監視装置18のどちらが変更できるかを表す。ロックビットは監視装置18により更新され、本実施形態では、ロックビットが‘0’に設定されると、CPU12がキャッシュセットの内容を変更することができ、‘1’に設定されると、監視装置18がキャッシュセットの内容を変更できる。なお、ロックビットによる制限はキャッシュセットの書き込みについてだけであり、その読み出しは制限されない。
The lock bit indicates whether the
データは、主記憶装置16からの読み出しデータであり、例えば、64ビットで構成される命令コード列またはデータ列を含む。また、データには、このデータが記憶されている主記憶装置16のアドレス(ADDRESS)も含まれる。
The data is read data from the
キャッシュメモリ14では、キャッシュセットに含まれるデータのアドレスのインデックス(アドレスの最上位ビットから一定のビット数で構成される部分)が同一の場合には、それらのキャッシュセットは同じラインに記憶される。例えば、アドレスが8ビットであり、インデックスがアドレスの上位5ビットで構成される場合、キャッシュメモリ14には、同一インデックスの8つ(残り3ビットに対応)のキャッシュセットのうちの4つまでのアドレスに対応するキャッシュセットが同じラインに記憶される。
In the
なお、例えば、ウェイの1つが利用不可能になったとしても、それは3つのウェイによって構成されるキャッシュメモリとして機能するだけであり、極端な性能の低下は発生しないことに留意すべきである。 It should be noted that, for example, even if one of the ways becomes unavailable, it only functions as a cache memory constituted by three ways, and no extreme performance degradation occurs.
次に、テーブル記憶装置20に記憶されるテーブルデータについて説明する。
図4は、テーブル記憶装置20に記憶されるテーブルデータの構成を表す概念図である。テーブルデータは、図4に示すように、アクセス時間(AccessTime)とアドレス(ADDRESS)を含む。
Next, table data stored in the
FIG. 4 is a conceptual diagram showing the configuration of table data stored in the
ここで、アクセス時間は、組み込みシステム10に電源が投入されてから、CPU12から主記憶装置16へのアクセスが発生するまでの時間である。図4の例では、アクセス時間はクロック数(clks)で表されている。clksは、CPU12の動作クロックである。また、アドレスは、キャッシュセットに含まれるデータが記憶されている主記憶装置16のアドレスである。なお、キャッシュセットに含まれるデータのアドレスと、これに対応するテーブルデータに含まれるアドレスは同じでものある。
Here, the access time is the time from when the power is turned on to the embedded
次に、図5に示すフローチャートに従って、組み込みシステム10の動作を説明する。
Next, the operation of the embedded
電源投入後(S1)、初期化完了レジスタ24は、初期化が完了していないことを意味する‘0’に設定される。また、初回実行フラグレジスタ26は、1回目の初期化プログラムの実行である場合には‘1’、2回目以降の実行である場合には‘0’に設定される。
After the power is turned on (S1), the initialization completion register 24 is set to “0” which means that the initialization is not completed. The first
また、電源投入後、監視装置18は、キャッシュメモリ14の4つのウェイ1〜4のうち、ウェイ1,2の全てのキャッシュセットのロックビットを‘0’、ウェイ3,4の全てのキャッシュセットのロックビットを‘1’に設定する(S2)。
After the power is turned on, the
これにより、ウェイ1,2はCPU12によってキャッシュセットの書き込みが管理され、ウェイ3,4は管理装置18によってキャッシュセットの書き込みが管理されることになる。
As a result, in the
続いて、監視装置18は、初回実行フラグレジスタ26の値を確認し、今回の初期化プログラムの実行が1回目の実行であるか否かを判断する(S3)。つまり、監視装置18は、初回実行フラグレジスタの値が‘1’であれば、今回の初期化プログラムの実行は1回目の実行であり、初回実行フラグレジスタの値が‘0’であれば、今回の初期化プログラムの実行が2回目以降の実行であると判断する。
Subsequently, the
ここで、今回の初期化プログラムの実行が1回目の実行である場合(S3で‘YES’)、ステップS5へ進む。 If the current initialization program is executed for the first time (“YES” in S3), the process proceeds to step S5.
一方、今回の初期化プログラムの実行が2回目以降の実行である場合(S3で‘NO’)、監視装置18は、テーブルデータに含まれるアクセス時間を参照して(アクセス時間が短いものから順に)、そのアクセス時間に到達するまでに、あるいは所定時間おきに、テーブル記憶装置20からテーブルデータを読み出し、読み出したテーブルデータに含まれるアドレスに対応する主記憶装置16のアドレスから所定ビット長の読み出しデータを読み出し、これをキャッシュセットとして、テーブルデータに含まれるアドレスに対応するキャッシュメモリ14のライン(インデックス)のウェイ3または4に書き込む(S4)。
On the other hand, when the initialization program is executed for the second time or later (“NO” in S3), the
上記のように、初期化プログラムを2回目以降に実行する場合、監視装置18が、前回の実行時に保存したテーブルデータに含まれるアクセス時間を参照して、順次、そのアクセス時間に到達するまでに、あるいは所定時間おきに、テーブルデータに含まれるアドレスに対応する主記憶装置16のアドレスからデータを読み出してキャッシュメモリ14へ書き込む。そのため、初期化プログラムの実行が高速化され、システムの起動時間を短縮することができる。
As described above, when the initialization program is executed for the second time or later, the
なお、キャッシュセットをウェイ3ないし4に上書きする時の制御方式は、何ら限定されず、例えば、LRU(Least Recently Used)制御でもよいし、単純にウェイ3とウェイ4に交互に上書きしてもよい。 Note that the control method for overwriting the cache set on the ways 3 to 4 is not limited in any way. For example, LRU (Least Recently Used) control may be used, or the ways 3 and 4 may be overwritten alternately. Good.
続いて、監視装置18は、CPU12から主記憶装置16へのアクセスがあったか否かを検出する(S5)。
Subsequently, the
ここで、CPU12から主記憶装置16へのアクセスがなかった場合(S5で‘NO’)、ステップS3へ戻り、監視装置18は前述の動作を繰り返す。
If there is no access from the
一方、CPU12から主記憶装置16へのアクセスがあった場合(S5で‘YES’)、監視装置18は、CPU12がアクセスした主記憶装置16のアドレスと同じアドレスを含むテーブルデータがテーブル記憶装置20に記憶されているか否かを検出する(S6)。
On the other hand, when there is an access from the
ここで、同じアドレスを含むテーブルデータが記憶されていない場合(S6で‘NO’)、監視装置18は、取得したアクセス時間とアドレスから新たなテーブルデータを作成し、これをテーブル記憶装置20に追加する(S7)。CPU12から主記憶装置16へのアクセスがあったということは、キャッシュメモリ14においてキャッシュミスが発生したということであるから、テーブル記憶装置20に同じアドレスを含むテーブルデータが記憶されていない場合、これを2回目以降の初期化プログラムの実行に備えてテーブル記憶装置20に記憶しておく必要がある。
If table data including the same address is not stored (“NO” in S6), the
一方、同じアドレスを含むテーブルデータが記憶されている場合(S6で‘YES’)、テーブル記憶装置20に記憶されているテーブルデータが効果的に機能していない(例えば、監視装置18によりキャッシュメモリ14にデータが書き込まれるのが遅かった)ということであるから、監視装置18は、アクセス先のアドレスを含むテーブルデータに含まれるアクセス時間を、検出されたアクセスが行われたアクセス時間に書き換える(アクセス時間を短縮する)(S8)。この場合、対応するテーブルデータ以後の全てのテーブルデータのアクセス時間を同様に書き換える必要がある。
On the other hand, when table data including the same address is stored (“YES” in S6), the table data stored in the
CPU12(実際にはキャッシュメモリ14)が主記憶装置16にアクセスする時間は、監視装置18が、主記憶装置16からキャッシュメモリ14へ読み出しデータを書き込んで(コピーして)おくことにより、キャッシュメモリ14から主記憶装置16へのアクセスがなくなるため短縮される。このため、テーブルデータに設定されたアクセス時間を、2回目以降の初期化プログラムの実行時に、適宜調整する(アクセス時間を書き換える)必要がある。
The time for the CPU 12 (actually the cache memory 14) to access the
ここで、アクセス時間を調整する方法は、何ら限定されないが、例えば、各々のテーブルデータの前(各々のテーブルデータに含まれるアクセス時間よりも短いアクセス時間を含むテーブルデータ)に存在するテーブルデータの個数を計算しておき、計算したテーブルデータの個数とテーブルデータ1つ当たりの推定高速化時間とを乗算して累積高速化時間を算出し、算出した累積高速化時間を、現在のアクセス時間から減算したものを新たなアクセス時間として設定する方法を例示することができる。 Here, the method for adjusting the access time is not limited at all, but for example, the table data existing before each table data (table data including an access time shorter than the access time included in each table data). Calculate the cumulative speedup time by multiplying the calculated number of table data and the estimated speedup time per table data, and calculate the cumulative speedup time from the current access time. A method of setting the subtracted value as a new access time can be exemplified.
続いて、監視装置18は、初期化完了レジスタ24の値を確認し、初期化プログラムによるシステムの初期化が完了したか否か(初期化完了レジスタ24が‘1’にセットされたか否か)を検出する(S9)。
Subsequently, the
ここで、初期化完了レジスタ24が‘0’の場合(S9で‘NO’)、初期化が完了していないことを意味するから、ステップS3へ戻り、監視装置18は前述の動作を繰り返す。
Here, if the initialization completion register 24 is “0” (“NO” in S9), it means that the initialization has not been completed. Therefore, the process returns to step S3, and the
一方、初期化完了レジスタ24が‘1’の場合(S9で‘YES’)、初期化が完了したことを意味するから、監視装置18は、キャッシュメモリ14のウェイ3,4の全てのキャッシュセットのロックビットを‘0’に設定して動作を終了する(S10)。
On the other hand, if the initialization completion register 24 is “1” (“YES” in S9), it means that the initialization is completed, and the
ここで、本実施形態によるシステムの起動高速化の効果を具体的に考えてみる。例えば、ある初期化プログラムの実行時に、以下のような命令が実行されるものとする。 Here, the effect of increasing the startup speed of the system according to the present embodiment will be specifically considered. For example, assume that the following instruction is executed when an initialization program is executed.
繰り返しのない命令 − 一定時間当たりCseq回
繰り返しのある命令 − 一定時間当たりCrpt回
平均繰り返し回数 − Rrpt回
1回の命令を主記憶装置16から読み出すための時間 − Fmain
1回の命令をキャッシュメモリ14から読み出すための時間 − Fcache
Instructions without repetition − Cseq times per fixed time Instructions with repetition − Crpt times per fixed time Average number of repetitions − Rrpt times Time to read one instruction from the
Time to read one instruction from the cache memory 14-Fcache
この場合、組み込みシステム10の高速化率は以下の計算式で表される。
In this case, the speed-up rate of the embedded
ここで、Cseq、Crpt、Rrpt、Fmain、Fcacheの回数として、例えば、表1に示すような数値を仮に考えてみる。 Here, for example, numerical values as shown in Table 1 are considered as the number of times of Cseq, Crpt, Rrpt, Fmain, Fcache.
表1の値を前述の計算式に代入して高速化率を計算すると約72%となる。つまり、本実施形態の組み込みシステム10は、本発明を適用していない従来の組み込みシステムと比べて3倍以上高速化され、十分な効果を期待できることが分かる。
Substituting the values in Table 1 into the above formula, the speed-up rate is calculated to be about 72%. That is, it can be seen that the embedded
なお、この計算結果は理想値であり、実際にはCPU12による命令実行が高速で行われた場合、主記憶装置16からキャッシュメモリ14への読み出しデータの転送が間に合わないことにより、最大限の効果を発揮できない場合も考えられなくはない。しかし、この点を考慮しても十分な高速化が期待できるといえる。また、この場合でも、図2のウェイ1,2に代表されるように、CPU12が管理するキャッシュ領域での高速化も見込めるため、大きな速度低下にはならない。
This calculation result is an ideal value. Actually, when the instruction execution by the
次に、別の実施形態を挙げて、本発明に関わる起動高速化装置を説明する。 Next, a startup acceleration device according to the present invention will be described with another embodiment.
本実施形態の組み込みシステムは、図1に示すものと同じ構成のものであるが、監視装置18とテーブル記憶装置20の機能が異なっている。
The embedded system of this embodiment has the same configuration as that shown in FIG. 1, but the functions of the
本実施形態において、監視装置18は、1回目のシステム起動時に、キャッシュメモリ14から主記憶装置16へのアクセスを監視して、一定の時間毎に、アクセス先の主記憶装置16のアドレスのインデックスと、各々のインデックスに含まれる複数のアドレスへのアクセス回数を取得し、テーブル記憶装置20に、電源投入から一定の時間毎までのアクセス時間と、監視装置18により取得されたアクセス回数が最大のインデックスをテーブルデータとして記憶させる。また、監視装置18は、2回目以降のシステム起動時に、テーブル記憶装置20に記憶されたテーブルデータに含まれるアクセス時間の順序に従って、例えば、所定時間おきに、テーブルデータに含まれるインデックスに対応する主記憶装置16の複数のアドレスから読み出しデータを読み出し、読み出した複数の読み出しデータのうちの一部をキャッシュメモリ14に書き込む。
In this embodiment, the
テーブル記憶装置20に記憶されるテーブルデータは、図4とは異なる形式のものである。本実施形態で使用するテーブルデータは、図6に示すように、アクセス時間(AccessTime)とインデックス(Index)を含む。
The table data stored in the
ここで、アクセス時間は、組み込みシステム10に電源が投入されてから、一定の時間毎までの時間である。図6の例では、アクセス時間は、クロック数(1Mclks)で表されている。1Mclksは、CPU12の動作クロックを基準とし、そのクロックが100万回発振するまでの時間である。また、インデックスは、キャッシュメモリ14で使用されているインデックスよりも、そのビット数(アドレスの上位ビット側のビット数)が少ないものである。
Here, the access time is the time from when power is turned on to the embedded
例えば、アドレスが8ビットの場合を考える。キャッシュメモリ14で使用されるインデックスがアドレスの上位5ビットで構成される場合、1つのインデックスには8つ(残り3ビット相当)のアドレスが含まれる。図7に示すように、キャッシュメモリ14で使用されるインデックスが、例えば、10000XXX(インデックス10000は、2進数表示)の場合、このインデックスに含まれるアドレスは、XXX=000〜111(XXXは2進数表示)までの複数(8つ)のアドレスを含む。
For example, consider the case where the address is 8 bits. When an index used in the
一方、テーブルデータで使用されるインデックスがアドレスの上位4ビットで構成される場合、1つのインデックスに16個のアドレスが含まれる。同様に、図7に示すように、テーブルデータで使用されるインデックスが、例えば、1000XXXXの場合、このインデックスに含まれるアドレスは、XXXX=0000〜1111までの複数(16個)のアドレスを含む。 On the other hand, when the index used in the table data is composed of the upper 4 bits of the address, 16 addresses are included in one index. Similarly, as shown in FIG. 7, when the index used in the table data is, for example, 1000XXXX, the addresses included in this index include a plurality (16) of addresses from XXXX = 0000 to 1111.
つまり、テーブルデータで使用されるインデックスは、キャッシュメモリ14で使用されるインデックスと比べて、1つのインデックスに含まれるアドレスの数が多くなるように設定されている。
That is, the index used in the table data is set so that the number of addresses included in one index is larger than the index used in the
本実施形態では、初期化プログラムを1回目に実行する時に、テーブルデータとして、100万回に1回(1Mclks)、言い換えると、1Mclksの整数倍の時間毎に、1つのインデックスを記憶する。 In the present embodiment, when the initialization program is executed for the first time, one index is stored as table data once per million times (1 Mclks), in other words, every time that is an integral multiple of 1 Mclks.
次に、図8に示すフローチャートに従って、組み込みシステム10の動作を説明する。
Next, the operation of the embedded
ステップS11からステップS13までの動作は、図5におけるステップS1からステップS3までの動作と同じである。 The operation from step S11 to step S13 is the same as the operation from step S1 to step S3 in FIG.
ここで、今回の初期化プログラムの実行が1回目の実行である場合(S13で‘YES’)、監視装置18は、次の1Mclksの間に、CPU12から主記憶装置16へのアクセスがあった時のインデックスとそのアクセス回数を取得する(S14)。
Here, when the execution of the initialization program this time is the first execution (“YES” in S13), the
続いて、監視装置18は、次の1Mclksの境界に到達したか否かを検出する(S15)。
Subsequently, the
ここで、次の1Mclksの境界に到達していない場合(S15で‘NO’)、ステップS14へ戻り、監視装置18は前述の動作を繰り返す。
If the next 1 Mclks boundary has not been reached (NO in S15), the process returns to step S14, and the
一方、次の1Mclksの境界に到達した場合(S15で‘YES’)、監視装置18は、その時のアクセス時間と、取得したインデックスのうち、最もアクセス回数が多かったものを代表インデックスとしてテーブル記憶装置20に記憶する(S16)。
On the other hand, when the next 1Mclks boundary is reached (“YES” in S15), the
一方、今回の初期化プログラムの実行が2回目以降の実行である場合(S13で‘NO’)、監視装置18は、テーブルデータのアクセス時間を参照して(アクセス時間が短いものから順に)、所定時間おきに、テーブル記憶装置20からテーブルデータを読み出し、読み出したテーブルデータに含まれるインデックスに対応する主記憶装置16の複数のアドレスから所定ビット長の読み出しデータを読み出し、これら複数のアドレスの読み出しデータのうちの2つの読み出しデータを、キャッシュセットとして、テーブルデータのインデックスに対応するキャッシュメモリ14のライン(キャッシュメモリ14のインデックス)のウェイ3または4に書き込む(S17)。
On the other hand, when the current initialization program is executed for the second time or later (“NO” in S13), the
ステップS18,S19の動作は、ステップS14,S15の動作と同じである。 The operations in steps S18 and S19 are the same as the operations in steps S14 and S15.
続いて、監視装置18は、CPU12から主記憶装置16への他のインデックス(対応するアクセス時間のテーブルデータに含まれるインデックスとは異なるインデックスに含まれる複数のアドレス)へのアクセス回数が閾値を超えたか否かを検出する(S20)。閾値は、対応するアクセス時間のテーブルデータに含まれるインデックスを取得した時に検出したアクセス回数以上の値に設定することが望ましい。
Subsequently, in the
ここで、他のインデックスへのアクセス回数が閾値を超えていない場合(S20で‘NO’)、ステップS22へ進む。閾値を超えていないということは、ステップS17でキャッシュメモリ14に書き込んだキャッシュセットが効果的に機能しており、キャッシュメモリ14で発生したキャッシュミスは閾値よりも少ないということであるから、キャッシュメモリ14に書き込んだキャッシュセットを入れ替える必要はない。
If the number of accesses to other indexes does not exceed the threshold (“NO” in S20), the process proceeds to step S22. The fact that the threshold value is not exceeded means that the cache set written to the
一方、アクセス回数が閾値を超えた場合(S20で‘YES’)、監視装置18は、対応するアクセス時間のテーブルデータに含まれるインデックスを、閾値を超えたインデックスに書き換える(S21)。閾値を超えたということは、ステップS17でキャッシュメモリ14に書き込んだキャッシュセットが効果的に機能しておらず、キャッシュメモリ14で閾値を超える回数のキャッシュミスが発生したということであるから、テーブルデータに含まれるインデックスを、閾値を超えたインデックスに書き換える必要がある。
On the other hand, when the access count exceeds the threshold (“YES” in S20), the
このため、テーブルデータに設定されたインデックスを、2回目以降の初期化プログラムの実行時に、適宜調整する(代表インデックスを適宜変更する)。 For this reason, the index set in the table data is appropriately adjusted (the representative index is appropriately changed) when the initialization program is executed for the second and subsequent times.
これにより、次回の初期化プログラムの実行時に、対応するテーブルデータのインデックスに応じて、このインデックスに対応する複数のアドレスの中から所定のアドレス(本実施形態の場合、先頭の2つのアドレスあるいは所定間隔があいたアドレス等)に対応するキャッシュセットがキャッシュメモリ14に書き込まれる。
Accordingly, when the initialization program is executed next time, a predetermined address (in the case of this embodiment, the first two addresses or a predetermined address) is selected from a plurality of addresses corresponding to the index of the corresponding table data. A cache set corresponding to an interval or the like is written in the
これ以後のステップS22,S23の動作は、図5におけるステップS9,S10の動作と同じである。 The subsequent operations in steps S22 and S23 are the same as the operations in steps S9 and S10 in FIG.
図4に示すテーブルデータを使用する実施形態では、全てのアクセスについてテーブルデータを記憶するため、大きなメモリ容量のテーブル記憶装置20を必要とする。これに対し、本実施形態では、1Mclksという一定の時間毎にテーブルデータを記憶するため、必要となるテーブル記憶装置20のメモリ容量を適宜低減することができる。なお、一定の時間は、高速化率とメモリ容量とを考慮して適宜設定することが望ましい。
In the embodiment using the table data shown in FIG. 4, the
その一方で、本実施形態では、主記憶装置16から16個のうちの2個の1/8と全ての読み出しデータをキャッシュすることはできないため、図4に示すテーブルデータを使用する実施形態の場合と比べると高速化率は低下する。しかしこの場合も、キャッシュできるデータ数を増やすことは可能であり、また、監視装置18によってキャッシュされないものについては、CPU12が管理するキャッシュメモリによってキャッシュが行われるはずであるから、高速化率は十分に得られる。
On the other hand, in the present embodiment, two 1/8 out of 16 from the
なお、本発明は、組み込みシステムに限らず、CPUと、主記憶装置と、両者の間に接続されたキャッシュメモリとを備える様々なシステムに適用可能である。また、監視装置の具体的な構成は何ら限定されず、同様の機能を果たすものであれば、どのような構成のものであっても利用可能である。また、テーブルデータに含まれるアクセス時間は、クロック数で表すことに限定されず、電源投入からの時間を表すことができれば、どのような表現方法を用いてもよい。 The present invention is not limited to an embedded system, but can be applied to various systems including a CPU, a main storage device, and a cache memory connected between the two. In addition, the specific configuration of the monitoring device is not limited at all, and any configuration can be used as long as it has a similar function. Further, the access time included in the table data is not limited to the number of clocks, and any expression method may be used as long as the time from power-on can be expressed.
本発明は、基本的に以上のようなものである。
以上、本発明について詳細に説明したが、本発明は上記実施形態に限定されず、本発明の主旨を逸脱しない範囲において、種々の改良や変更をしてもよいのはもちろんである。
The present invention is basically as described above.
Although the present invention has been described in detail above, the present invention is not limited to the above-described embodiment, and it is needless to say that various improvements and modifications may be made without departing from the gist of the present invention.
10 組み込みシステム
12 CPU
14 キャッシュメモリ
16 主記憶装置
18 監視装置
20 テーブル記憶装置
22 内部バス
24 初期化完了レジスタ
26 初回実行フラグレジスタ
10 Embedded
14
Claims (4)
1回目のシステム起動時に、前記キャッシュメモリから前記主記憶装置へのアクセスを監視して、電源投入から前記アクセスが行われるまでのアクセス時間とアクセス先の前記主記憶装置のアドレスを取得する監視装置と、
前記監視装置により取得されたアクセス時間とアドレスをテーブルデータとして記憶するテーブル記憶装置とを備え、
前記監視装置は、2回目以降のシステム起動時に、前記テーブル記憶装置に記憶されたテーブルデータに含まれるアクセス時間の順序に従って、該アクセス時間到達までに、前記テーブルデータに含まれるアドレスに対応する前記主記憶装置のアドレスから読み出しデータを読み出し、該読み出した読み出しデータを前記キャッシュメモリに書き込むことを特徴とする起動高速化装置。 High-speed startup of a system comprising a CPU, a main storage device storing read data used by the CPU, and a cache memory for temporarily supplying the read data read from the main storage device to the CPU Device.
A monitoring device that monitors the access from the cache memory to the main storage device at the first system startup, and obtains the access time from power-on to the access and the address of the access destination main storage device When,
A table storage device for storing the access time and address acquired by the monitoring device as table data;
The monitoring device corresponds to the address corresponding to the address included in the table data before reaching the access time according to the order of the access time included in the table data stored in the table storage device at the second or subsequent system startup. A start-up acceleration device characterized in that read data is read from an address of a main storage device, and the read data is written to the cache memory.
1回目のシステム起動時に、前記キャッシュメモリから前記主記憶装置へのアクセスを監視して、一定の時間毎に、アクセス先の前記主記憶装置のアドレスの一部のビットからなる各々のインデックスに含まれる複数のアドレスへのアクセス回数を取得する監視装置と、
電源投入から前記一定の時間毎までのアクセス時間と前記監視装置により取得されたアクセス回数が最大のインデックスをテーブルデータとして記憶するテーブル記憶装置とを備え、
前記監視装置は、2回目以降のシステム起動時に、前記テーブル記憶装置に記憶されたテーブルデータに含まれるアクセス時間の順序に従って、前記テーブルデータに含まれるインデックスに対応する前記主記憶装置の複数のアドレスから読み出しデータを読み出し、該読み出した複数の読み出しデータのうちの一部を前記キャッシュメモリに書き込むことを特徴とする起動高速化装置。 High-speed startup of a system comprising a CPU, a main storage device storing read data used by the CPU, and a cache memory for temporarily supplying the read data read from the main storage device to the CPU Device.
When the system is started for the first time, the access from the cache memory to the main storage device is monitored, and is included in each index consisting of some bits of the address of the main storage device to be accessed at regular intervals. A monitoring device that obtains the number of accesses to a plurality of addresses,
A table storage device that stores, as table data, an access time from power-on to the predetermined time and an index with the maximum number of accesses acquired by the monitoring device;
The monitoring device has a plurality of addresses of the main storage device corresponding to the index included in the table data in accordance with the order of access times included in the table data stored in the table storage device at the second or subsequent system startup. Read start data is read out, and a part of the read out read data is written in the cache memory.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009081059A JP2010231701A (en) | 2009-03-30 | 2009-03-30 | Apparatus for quickly starting system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009081059A JP2010231701A (en) | 2009-03-30 | 2009-03-30 | Apparatus for quickly starting system |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2010231701A true JP2010231701A (en) | 2010-10-14 |
Family
ID=43047420
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009081059A Withdrawn JP2010231701A (en) | 2009-03-30 | 2009-03-30 | Apparatus for quickly starting system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2010231701A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2016033745A (en) * | 2014-07-31 | 2016-03-10 | 京セラドキュメントソリューションズ株式会社 | Information processor and information processing program |
US9442724B2 (en) | 2011-01-31 | 2016-09-13 | Socionext Inc. | Start control apparatus for controlling a start of an information device by using an interrupt generation code, information device, and start control method |
-
2009
- 2009-03-30 JP JP2009081059A patent/JP2010231701A/en not_active Withdrawn
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9442724B2 (en) | 2011-01-31 | 2016-09-13 | Socionext Inc. | Start control apparatus for controlling a start of an information device by using an interrupt generation code, information device, and start control method |
JP2016033745A (en) * | 2014-07-31 | 2016-03-10 | 京セラドキュメントソリューションズ株式会社 | Information processor and information processing program |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3880581B2 (en) | Streaming data using cache locks | |
US20050086435A1 (en) | Cache memory controlling apparatus, information processing apparatus and method for control of cache memory | |
JP5030796B2 (en) | System and method for restricting access to cache during data transfer | |
JP2002514819A (en) | A data processing circuit having a cache memory. | |
JP2009098934A (en) | Processor and cache memory | |
JP2010198610A (en) | Data processing apparatus and method | |
US20110167224A1 (en) | Cache memory, memory system, data copying method, and data rewriting method | |
US8856453B2 (en) | Persistent prefetch data stream settings | |
US20130311751A1 (en) | System and data loading method | |
JP2006516168A (en) | How to use a cache miss pattern to address the stride prediction table | |
JP4008947B2 (en) | Cache memory and control method thereof | |
US7526615B2 (en) | Compressed victim cache | |
JP4009306B2 (en) | Cache memory and control method thereof | |
JP2008186233A (en) | Instruction cache pre-fetch control method and device thereof | |
JP5159258B2 (en) | Arithmetic processing unit | |
US20170262328A1 (en) | Information processing system, information processing apparatus, information processing method, and computer-readable non-transitory storage medium | |
JP5045163B2 (en) | Arithmetic processing device and control method of arithmetic processing device | |
JP2010231701A (en) | Apparatus for quickly starting system | |
JP5298826B2 (en) | Cache memory and prefetch method | |
JP2006350633A (en) | Data management method and data management system | |
US8436866B2 (en) | Inter-frame texel cache | |
WO2016122657A1 (en) | Ordering updates for nonvolatile memory accesses | |
JP2008257508A (en) | Cache control method, cache device, and microcomputer | |
US7376797B2 (en) | Cache memory system and method using reference bits | |
JP4008946B2 (en) | Cache memory and control method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20120605 |