JP2010033420A - Cache circuit and cache memory control method - Google Patents
Cache circuit and cache memory control method Download PDFInfo
- Publication number
- JP2010033420A JP2010033420A JP2008196377A JP2008196377A JP2010033420A JP 2010033420 A JP2010033420 A JP 2010033420A JP 2008196377 A JP2008196377 A JP 2008196377A JP 2008196377 A JP2008196377 A JP 2008196377A JP 2010033420 A JP2010033420 A JP 2010033420A
- Authority
- JP
- Japan
- Prior art keywords
- data
- address
- cache
- read
- 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.)
- Withdrawn
Links
Images
Landscapes
- Image Input (AREA)
- Memory System Of A Hierarchy Structure (AREA)
- Storing Facsimile Image Data (AREA)
Abstract
Description
この発明は、キャッシュ回路及びキャッシュメモリ制御方法に関するものであり、特に画像データ処理に用いられるキャッシュ回路と、このキャッシュ回路に用いて好適なキャッシュメモリ制御方法に関する。 The present invention relates to a cache circuit and a cache memory control method, and more particularly to a cache circuit used for image data processing and a cache memory control method suitable for use in the cache circuit.
図1を参照して、画像データ処理回路について説明する。図1は、画像データ処理回路を説明するための概略図である。画像データ処理回路は、アドレス計算手段10、外部メモリ20、画像データ処理手段30及びキャッシュ回路100を備えて構成される。
The image data processing circuit will be described with reference to FIG. FIG. 1 is a schematic diagram for explaining an image data processing circuit. The image data processing circuit includes an
この画像データ処理回路は、ソース画像に回転等の画像処理を行って、画像処理後のデスティネーション画像を描画させる処理に用いられる。例えば、ソース画像を回転させる場合は、デスティネーション画像の1画素のデータを生成するために、ソース画像の4画素分のデータが必要になる。 This image data processing circuit is used for a process of drawing a destination image after image processing by performing image processing such as rotation on the source image. For example, when the source image is rotated, data for four pixels of the source image is required to generate data for one pixel of the destination image.
図2を参照して、ソース画像とデスティネーション画像の関係について説明する。図2は、ソース画像とデスティネーション画像の関係を説明するための模式図である。 The relationship between the source image and the destination image will be described with reference to FIG. FIG. 2 is a schematic diagram for explaining the relationship between the source image and the destination image.
デスティネーション画像の画素aのデータは、ソース画像の画素1−1、2−1、1−2及び2−2のデータで生成される。同様に、デスティネーション画像の画素bのデータは、ソース画像の画素1−2、2−2、1−3及び2−3のデータで生成され、デスティネーション画像の画素cのデータは、ソース画像の画素2−3、3−3、2−4及び3−4のデータで生成される。 The data of the pixel a of the destination image is generated by the data of the pixels 1-1, 2-1, 1-2, and 2-2 of the source image. Similarly, the data of the pixel b of the destination image is generated by the data of the pixels 1-2, 2-2, 1-3, and 2-3 of the source image, and the data of the pixel c of the destination image is the source image. Are generated with the data of the pixels 2-3, 3-3, 2-4 and 3-4.
アドレス計算手段10には、デスティネーション画像の1画素のアドレス(デスティネーションアドレス)が入力される。アドレス計算手段10は、デスティネーションアドレスが示すデータを生成するために必要な、入力アドレス1〜4を計算する。この入力アドレス1〜4は、キャッシュ回路100に送られる。
The address calculation means 10 receives an address (destination address) of one pixel of the destination image. The address calculation means 10 calculates
キャッシュ回路100は、入力アドレス1〜4が示す画素のデータを、内部のキャッシュメモリ又は外部メモリ20から読み込む。キャッシュ回路100は、読み出したデータ(出力データ1〜4)を、画像データ処理手段30に送る。
The
なお、外部メモリからのデータの読み込みにあたっては、複数の画素のデータを1つのブロックとして読み込む方法が提案されている(例えば、特許文献1参照)。 For reading data from an external memory, a method of reading data of a plurality of pixels as one block has been proposed (for example, see Patent Document 1).
画像データ処理手段30は、出力データ1〜4を用いて、デスティネーションアドレスが示す画素のデータを計算し、処理済データとして描画手段(図示を省略する。)に送る。
しかしながら、図1を参照して説明した従来構成では、1つのデスティネーションアドレスに対して、入力アドレス1〜4に従って外部メモリから4回のデータの読み込みを行う必要がある。ここで、外部メモリ20を、FlashROMあるいはSDRAMなどを用いて構成すると、FlashROM及びSDRAMは、キャッシュ回路100がその内部に有しているキャッシュメモリよりもデータの読出し処理に要する時間が長い。
However, in the conventional configuration described with reference to FIG. 1, it is necessary to read data from an external memory four times for one destination address according to
そこで、この出願に係る発明者が鋭意研究を行ったところ、一度、外部メモリから読み込んだのと同じアドレスのデータを再度用いる場合には、外部メモリにアクセスすることなく、キャッシュメモリに格納されたデータを参照する動作を効率的に行うことで、外部メモリへのアクセス回数を削減することができ、処理時間を短縮することができることを見出した。 Therefore, when the inventor of this application conducted intensive research, when data at the same address that was once read from the external memory was used again, it was stored in the cache memory without accessing the external memory. It has been found that by efficiently performing the operation of referring to data, the number of accesses to the external memory can be reduced, and the processing time can be reduced.
この発明は、上述の問題点に鑑みてなされたものであり、この発明の目的は、外部メモリへのアクセス回数を削減することができ、処理時間を短縮することができるキャッシュ回路を提供することである。 The present invention has been made in view of the above-described problems, and an object of the present invention is to provide a cache circuit that can reduce the number of accesses to an external memory and can shorten the processing time. It is.
上述した目的を達成するために、この発明のキャッシュ回路は、複数の領域のそれぞれにアドレス及びアドレスが示す画素のデータが格納されるキャッシュメモリを有し、入力された複数の入力アドレスがそれぞれ示す画素のデータを、キャッシュメモリから読み出して出力する。 In order to achieve the above-described object, the cache circuit of the present invention has a cache memory in which a pixel data indicated by an address and an address is stored in each of a plurality of areas, and each of a plurality of inputted input addresses indicates Pixel data is read from the cache memory and output.
キャッシュ回路は、リード制御部、アドレス選択部、キャッシュヒット判定部、キャッシュヒットデータ選択部、メモリ制御部、ライトデータ判定部及びライト領域選択部を具えて構成される。 The cache circuit includes a read control unit, an address selection unit, a cache hit determination unit, a cache hit data selection unit, a memory control unit, a write data determination unit, and a write area selection unit.
リード制御部は、キャッシュメモリの1つの領域を選択する選択信号を生成する。アドレス選択部は、複数の入力アドレスから1の選択アドレスを選択する。キャッシュヒット判定部は、選択アドレスが示す画素のデータがキャッシュメモリに格納されているか否かを判定して、判定結果を示すキャッシュヒット判定信号、及び、格納されている領域を示すキャッシュヒット信号を生成する。キャッシュヒットデータ選択部は、選択アドレスが示す画素のデータがキャッシュメモリに格納されているとき、キャッシュヒット信号が示す領域のデータをキャッシュヒットデータとして選択する。メモリ制御部は、選択アドレスが示す画素のデータがキャッシュメモリに格納されていないとき、選択アドレスが示す画素のデータを、当該キャッシュ回路の外部に設けられた外部メモリからリードデータとして読み出す。ライトデータ判定部は、選択アドレスが示す画素のデータがキャッシュメモリに格納されているとき、キャッシュヒットデータをライトデータとして選択し、選択アドレスが示す画素のデータがキャッシュメモリに格納されていないとき、リードデータをライトデータとして選択し、ライトデータをキャッシュメモリに送るとともに、ライトデータが使用可能であることを示すライトデータ判定信号を生成する。ライト領域選択部は、ライトデータ判定信号が、ライトデータが使用可能であることを示す場合に、選択信号が選択するキャッシュメモリの領域を書き込み可能とするライトイネーブル信号を生成してキャッシュメモリに送る。 The read control unit generates a selection signal for selecting one area of the cache memory. The address selection unit selects one selected address from a plurality of input addresses. The cache hit determination unit determines whether or not the pixel data indicated by the selected address is stored in the cache memory, and outputs a cache hit determination signal indicating the determination result and a cache hit signal indicating the stored area. Generate. When the pixel data indicated by the selected address is stored in the cache memory, the cache hit data selection unit selects the data in the area indicated by the cache hit signal as the cache hit data. When the pixel data indicated by the selected address is not stored in the cache memory, the memory control unit reads the pixel data indicated by the selected address as read data from an external memory provided outside the cache circuit. The write data determination unit selects cache hit data as write data when the pixel data indicated by the selected address is stored in the cache memory, and when the pixel data indicated by the selected address is not stored in the cache memory, The read data is selected as write data, the write data is sent to the cache memory, and a write data determination signal indicating that the write data can be used is generated. When the write data determination signal indicates that the write data is usable, the write area selection unit generates a write enable signal that enables writing to the area of the cache memory selected by the selection signal and sends the write enable signal to the cache memory .
この発明のキャッシュ回路によれば、キャッシュヒットした場合には、外部メモリにアクセスすることなく、キャッシュメモリに格納されたデータを参照する。この結果、外部メモリへのアクセス回数を削減することができ、処理時間を短縮することができる。 According to the cache circuit of the present invention, when a cache hit occurs, the data stored in the cache memory is referred to without accessing the external memory. As a result, the number of accesses to the external memory can be reduced, and the processing time can be shortened.
以下、図を参照して、この発明の実施の形態について説明するが、この発明が理解できる程度に概略的に示したものに過ぎない。また、以下、この発明の好適な構成例につき説明するが、単なる好適例にすぎない。従って、この発明は以下の実施の形態に限定されるものではなく、この発明の構成の範囲を逸脱せずにこの発明の効果を達成できる多くの変更又は変形を行うことができる。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. However, the embodiments are merely schematically shown to the extent that the present invention can be understood. In the following, a preferred configuration example of the present invention will be described, but it is merely a preferred example. Therefore, the present invention is not limited to the following embodiments, and many changes or modifications that can achieve the effects of the present invention can be made without departing from the scope of the configuration of the present invention.
(第1実施形態)
図3〜10を参照して、第1実施形態のキャッシュ回路について説明する。図3は、第1実施形態のキャッシュ回路を説明するための概略図である。
(First embodiment)
The cache circuit of the first embodiment will be described with reference to FIGS. FIG. 3 is a schematic diagram for explaining the cache circuit of the first embodiment.
なお、このキャッシュ回路100は、図1を参照して説明した従来の画像データ処理回路で用いることができるので、図1も合わせて参照して説明する。以下の説明では、キャッシュ回路100にソース画像の4画素分のアドレス(入力アドレス1〜4)を入力し、キャッシュ回路100から4画素分のデータ(出力データ1〜4)が出力される例について説明するが、入力アドレス及び出力データの個数については、画像処理の方法に応じた個数にすることができる。
The
キャッシュ回路100は、キャッシュメモリ300、リード制御部120、アドレス選択部130、キャッシュヒット判定部140、キャッシュヒットデータ選択部150、メモリ制御部160、ライトデータ判定部170、ライト領域選択部180及び出力データ選択部190を備えて構成される。
The
キャッシュ回路100に入力された入力アドレス1〜4は、キャッシュメモリ300及びアドレス選択部130に送られる。
キャッシュメモリ300には、キャッシュ回路100に入力された入力アドレス1〜4、リード制御部120で生成された選択信号1〜4、ライト領域選択部180で生成されたライトイネーブル信号1〜4、及びライトデータ判定部170で選択されたライトデータが入力される。また、キャッシュメモリ300からは、有効ビット1〜4及び上位アドレス1〜4が、キャッシュヒット判定部140に送られ、下位アドレス1〜4が、出力データ選択部190に送られ、キャッシュデータ1〜4が、キャッシュヒットデータ選択部150及び出力データ選択部190に送られる。
The
図4を参照して、キャッシュメモリについて説明する。図4は、キャッシュメモリの概略図である。 The cache memory will be described with reference to FIG. FIG. 4 is a schematic diagram of the cache memory.
キャッシュメモリ300は、複数の領域を有している。キャッシュメモリ300が有する領域の数は、少なくとも入力アドレスと同じ個数有れば良く、ここでは、キャッシュメモリ300が有する領域を4個としている。キャッシュメモリ300の各領域には、有効ビット欄330、上位アドレス欄332、下位アドレス欄334及びキャッシュデータ欄336が設けられていて、それぞれ、有効ビット、上位アドレス、下位アドレス及びキャッシュデータが格納される。
The
以下の説明では、第1〜4の領域311〜314に格納される、有効ビット、上位アドレス、下位アドレス及びキャッシュデータをそれぞれ区別して、有効ビット1〜4、アドレス1〜4及びキャッシュデータ1〜4と表すこともある。
In the following description, valid bits, upper addresses, lower addresses and cache data stored in the first to
ここで有効ビットは、その有効ビットが格納されている領域が有効であるか否か、すなわち、当該領域のキャッシュデータ欄336にキャッシュデータが格納されているか否かを示す。ここでは、当該領域が有効であるとき、有効ビットを“1”とし、当該領域が無効であるとき、有効ビットを“0”とする。
Here, the valid bit indicates whether or not the area in which the valid bit is stored is valid, that is, whether or not cache data is stored in the
上位アドレス及び下位アドレスは、ソース画像の画素のアドレスを示している。なお、キャッシュメモリ300の1つの領域には、複数の連続する画素を1つの単位(ブロック)としてキャッシュデータが格納できる。この場合、上位アドレスが、各ブロックの位置(アドレス)を示し、下位アドレスは、各ブロック内での画素の位置を示す。
The upper address and the lower address indicate pixel addresses of the source image. Note that cache data can be stored in one area of the
入力アドレス1〜4の中で、ブロックの位置を示す上位アドレスがキャッシュメモリ300の上位アドレス欄332に送られる。また、ブロック内の位置を示す下位アドレスがキャッシュメモリ300の下位アドレス欄334に送られる。
Among the input addresses 1 to 4, the upper address indicating the block position is sent to the
選択信号1〜4は、キャッシュメモリ300の各領域に設けられている、上位アドレス欄332及び下位アドレス欄334のライトイネーブル端子(we)に、それぞれ入力される。選択信号1〜4が“1”であるとき、入力アドレス1〜4の上位アドレス及び下位アドレスが、キャッシュメモリ300の上位アドレス欄332及び下位アドレス欄334にそれぞれ格納される。
The selection signals 1 to 4 are input to the write enable terminals (we) of the
ライトデータは、キャッシュメモリ300の各領域311〜314のキャッシュデータ欄336に送られる。また、ライトイネーブル信号が、キャッシュメモリ300のキャッシュデータ欄336のライトイネーブル端子(we)に入力される。ライトイネーブル信号1〜4が“1”であるとき、キャッシュメモリ300のキャッシュデータ欄336にライトデータが格納される。
The write data is sent to the
また、ライトイネーブル信号1〜4は、各領域311〜314の有効ビット欄330にそれぞれ送られる。有効ビット1〜4が“0”であるとき、ライトイネーブル信号1〜4が“1”になると、有効ビット1〜4が“1”になる。なお、初期状態では、有効ビットは全て“0”であるが、一度、有効ビットが“1”になると、そのビットについては、再度初期化が行われるまで、“1”が維持される。
The write enable
リード制御部120は、キャッシュメモリ300の第1〜4の領域311〜314の1つを選択する選択信号1〜4を生成する。ここで、選択信号1〜4は、いずれか1つだけが“1”となり、それ以外は“0”を示す。選択信号1〜4により、第1〜4の領域311〜314が順に選択される。選択信号1〜4は、キャッシュメモリ300、アドレス選択部130及びライト領域選択部180に送られる。
The
アドレス選択部130は、選択信号1〜4を用いて、入力アドレス1〜4の中から、1のアドレスを選択アドレスとして選択する。例えば、選択信号1が、“1”であり、選択信号2〜4が“0”であるとき、入力アドレス1が選択アドレスとして選択される。
The
図5を参照して、アドレス選択部の構成例について説明する。図5は、アドレス選択部の概略構成図である。 A configuration example of the address selection unit will be described with reference to FIG. FIG. 5 is a schematic configuration diagram of the address selection unit.
この構成例のアドレス選択部130は、第1〜4のAND演算部132−1〜4とOR演算部134を備える構成とすることができる。この構成では、第1〜4のAND演算部132−1〜4でそれぞれ演算された、入力アドレス1〜4と、選択信号1〜4との論理積(AND)1〜4が、OR演算部134に送られて論理和(OR)演算される。
The
選択信号1〜4は、いずれか1つのみが“1”となるので、AND1〜4は、いずれか1つが入力アドレスを示し、それ以外は“0”となる。従って、AND1〜4の論理和は、入力アドレス1〜4のいずれか1つのアドレスを示す選択アドレスとなる。選択アドレスは、キャッシュヒット判定部140及びメモリ制御部160に送られる。
Since only one of the selection signals 1 to 4 is “1”, any one of the
キャッシュヒット判定部140は、選択アドレスが示す画素のデータがキャッシュメモリ300に格納されているか否かを判定し、判定結果を示すキャッシュヒット判定信号と、選択アドレスが示す画素のデータが格納されている領域を示すキャッシュヒット信号を生成する。
The cache hit
図6を参照して、キャッシュヒット判定部の構成例について説明する。図6は、キャッシュヒット判定部の概略構成図である。 A configuration example of the cache hit determination unit will be described with reference to FIG. FIG. 6 is a schematic configuration diagram of the cache hit determination unit.
キャッシュヒット判定部140は、第1〜4の比較演算部142−1〜4と、第1〜4のAND演算部144−1〜4と、OR演算部146とを備えている。第1〜4の比較演算部142−1〜4は、選択アドレスの上位アドレスと、キャッシュメモリ300の上位アドレス欄332に格納されている上位アドレス1〜4とをそれぞれ比較する。比較した結果、一致している場合は、第1〜4の比較演算部142−1〜4の出力である比較結果1〜4は、“1”となり、不一致の場合は、比較結果1〜4は、“0”となる。
The cache hit
第1〜4のAND演算部144−1〜4には、それぞれ比較結果1〜4と、キャッシュメモリ300の有効ビット欄330に格納されている有効ビット1〜4とが入力される。第1〜4のAND演算部144−1〜4は、それぞれ有効ビット1〜4と、比較結果1〜4との論理積(AND)演算を行い、その結果をキャッシュヒット信号1〜4とする。
キャッシュヒット信号1〜4は、データが有効であり、かつ、選択アドレスの上位アドレスとキャッシュメモリ300の上位アドレス欄332に格納されている上位アドレスとが一致している場合に“1”となる。例えば、有効ビット3が“1”であり、比較結果3が“1”である場合、キャッシュヒット信号3が“1”となる。すなわち、キャッシュヒット信号1〜4は、選択アドレスの上位アドレスと等しい上位アドレスが格納されている、キャッシュメモリ300の領域を示す。キャッシュヒット信号1〜4は、キャッシュヒットデータ選択部150に送られる。
The cache hit
また、キャッシュヒット信号1〜4は、OR演算部146にも送られる。OR演算部146は、キャッシュヒット信号1〜4について、論理和(OR)演算を行う。論理和演算の結果であるキャッシュヒット判定信号は、選択アドレスと等しいアドレスのデータが、キャッシュメモリ300内に格納されている場合は“1”となり、それ以外の場合は“0”となる。このキャッシュヒット判定信号は、メモリ制御部160及びライトデータ判定部170に送られる。
The cache hit
キャッシュヒットデータ選択部150は、選択アドレスが示す画素のデータがキャッシュメモリ300に格納されているとき、キャッシュヒット信号1〜4が示す領域のキャッシュデータをキャッシュヒットデータとして選択する。
When the pixel data indicated by the selected address is stored in the
図7を参照して、キャッシュヒットデータ選択部の構成例について説明する。図7は、キャッシュヒットデータ選択部の概略構成図である。 A configuration example of the cache hit data selection unit will be described with reference to FIG. FIG. 7 is a schematic configuration diagram of the cache hit data selection unit.
この構成例のキャッシュヒットデータ選択部150は、第1〜4のAND演算部152−1〜4とOR演算部154を備えて構成されている。この構成では、第1〜4のAND演算部152−1〜4でそれぞれ演算された、キャッシュデータ1〜4の各ビットと、キャッシュヒット信号1〜4との論理積(AND)1〜4が演算され、OR演算部154においてAND演算部152−1〜4から出力される複数ビットのデータ毎の論理和(OR)が演算される。
The cache hit
キャッシュヒット信号1〜4は、いずれか1つのみが“1”となるので、AND1〜4は、いずれか1つがキャッシュデータを示し、それ以外は“0”となる。従って、AND1〜4の論理和は、キャッシュデータ1〜4のいずれか1つのデータを示すキャッシュヒットデータとなる。例えば、キャッシュヒット信号3が“1”のとき、キャッシュデータ3がキャッシュヒットデータとして選択される。キャッシュヒットデータは、ライトデータ判定部170に送られる。
Since only one of the cache hit signals 1 to 4 is “1”, one of the AND 1 to 4 indicates cache data, and “0” otherwise. Accordingly, the logical sum of AND1 to AND4 becomes cache hit data indicating any one of the
メモリ制御部160は、キャッシュ回路100の外部に設けられた外部メモリ20に対して、この外部メモリ20内に格納されているデータを読み出す機能を有している。
The
メモリ制御部160には、アドレス選択部130で選択された選択アドレスが入力されるともに、キャッシュヒット判定部140で生成されたキャッシュヒット判定信号が反転入力される。メモリ制御部160は、キャッシュヒット判定信号が“0”の場合、すなわち、キャッシュメモリ300に選択アドレスに対応するデータがキャッシュメモリ300に格納されていないとき、外部メモリ20から選択アドレスが示す画素のデータを読み込む。一方、キャッシュヒット判定信号が“1”の場合は、外部メモリ20からの読み込みは行わない。
The
メモリ制御部160は、外部メモリ20から読み込んだデータをリードデータとしてライトデータ判定部170に送る。また、リードデータが使用可能であることを示すリードデータイネーブル信号もライトデータ判定部170に送る。ここでは、リードデータが使用可能であるとき、リードデータイネーブル信号を“1”とし、リードデータが使用不可能であるとき、リードデータイネーブル信号を“0”とする。
The
ライトデータ判定部170は、選択アドレスが示す画素のデータがキャッシュメモリ300に格納されているとき、キャッシュヒットデータをライトデータとして選択し、選択アドレスが示す画素のデータがキャッシュメモリ300に格納されていないとき、リードデータをライトデータとして選択する。ライトデータ判定部170は、ライトデータをキャッシュメモリ300に送るとともに、ライトデータが使用可能であることを示すライトデータ判定信号を生成して、ライト領域選択部180に送る。
When the pixel data indicated by the selected address is stored in the
図8を参照して、ライトデータ判定部の構成例について説明する。図8は、ライトデータ判定部の概略構成図である。 A configuration example of the write data determination unit will be described with reference to FIG. FIG. 8 is a schematic configuration diagram of the write data determination unit.
ライトデータ判定部170は、選択演算部172と、OR演算部174とを備えている。選択演算部172には、キャッシュヒットデータとリードデータが入力される。選択演算部172には、制御信号としてキャッシュヒット判定信号が入力される。選択演算部172は、キャッシュヒット判定信号の値に応じて、キャッシュヒットデータとリードデータのいずれか一方を選択して出力する。
The write
この構成では、キャッシュヒット判定信号が“1”の場合、すなわち、キャッシュメモリに選択アドレスが示す画素のデータが格納されている場合は、選択演算部172は、キャッシュヒットデータをライトデータとして選択する。一方、キャッシュヒット判定信号が“0”の場合、すなわち、キャッシュメモリに選択アドレスが示す画素のデータが格納されていない場合は、選択演算部172は、リードデータをライトデータとして選択する。
In this configuration, when the cache hit determination signal is “1”, that is, when the pixel data indicated by the selected address is stored in the cache memory, the
またOR演算部174には、キャッシュヒット判定信号とリードデータイネーブル信号が入力される。OR演算部174は、キャッシュヒット判定信号とリードデータイネーブル信号の論理積(OR)をライトデータ判定信号としてライト領域選択部180に送る。ライトデータ判定信号は、ライトデータが使用可能である場合、すなわち、キャッシュメモリに選択アドレスに対応するデータがあるか、もしくは、リードデータの読み込みが完了した場合は、“1”を示し、それ以外の場合は“0”となる。
The OR
ライト領域選択部180は、ライトデータが使用可能である場合に、選択信号が選択するキャッシュメモリ300の領域を書き込み可能とするライトイネーブル信号を生成して、キャッシュメモリ300に送る。また、ライトイネーブル信号を生成するたびに、ライト完了信号をリード制御部120に送る。
When the write data is usable, the write
図9を参照して、ライト領域選択部の構成例について説明する。図9は、ライト領域選択部の概略構成図である。 A configuration example of the write area selection unit will be described with reference to FIG. FIG. 9 is a schematic configuration diagram of the write area selection unit.
ライト領域選択部180は、第1〜4のAND演算部182−1〜4と、OR演算部184とを備えている。第1〜4のAND演算部182−1〜4には、それぞれ選択信号1〜4と、ライトデータ判定信号とが入力される。第1〜4のAND演算部182−1〜4は、それぞれ選択信号1〜4と、ライトデータ判定信号との論理積(AND)演算を行う。
The write
論理積演算の結果であるライトイネーブル信号1〜4は、ライトデータが書き込み可能である領域を示す。例えば、選択信号1が“1”であり、ライトデータ判定信号が“1”である場合、ライトイネーブル信号1が“1”となる。この場合、キャッシュメモリ300の第1の領域311が、書込み可能になる。ライトイネーブル信号1〜4は、キャッシュメモリ300に送られる。
Write enable
また、ライトイネーブル信号1〜4は、OR演算部184に送られる。OR演算部184は、ライトイネーブル信号1〜4の論理和(OR)をライト完了信号として生成する。すなわち、ライト完了信号は、ライトイネーブル信号が生成されるたびに “1”となり、それ以外の場合は“0”となる。このライト完了信号は、リード制御部120に送られる。
The write enable
リード制御部120は、ライト完了信号が“1”になるたびに、選択する領域を変更した選択信号を生成する。例えば、選択信号1が“1”であり、選択信号2〜4が“0”であった場合、ライト完了信号が“1”になると、選択信号1が“0”となり、選択信号2が“1”となる。この後、ライトイネーブル信号2が“1”となると、選択信号2が“0”となり、選択信号3が“1”となる。最終的に、ライトイネーブル信号4が“1”となり、全てのデータが格納されると、出力データ準備完了フラグを“1”とする。なお、出力データ準備完了フラグは、RAMなどのキャッシュ回路100内の任意好適な記憶手段に読み出し及び書き換え自在に格納されている。
The
出力データ選択部190は、出力データ準備完了フラグが“1”になると、キャッシュメモリ300に格納されているキャッシュデータを出力データとして出力し、画像データ処理手段30に送る。
When the output data preparation completion flag becomes “1”, the output
図10を参照して、出力データ選択部の構成例について説明する。図10は、出力データ選択部の概略構成図である。 A configuration example of the output data selection unit will be described with reference to FIG. FIG. 10 is a schematic configuration diagram of the output data selection unit.
出力データ選択部190は、第1〜4の選択演算部192−1〜4を有している。キャッシュデータ1〜4は、それぞれ第1〜4の選択演算部192−1〜4に送られる。また、これら第1〜4の選択演算部192−1〜4には、下位アドレス1〜4が、制御信号として入力される。第1〜4の選択演算部192−1〜4は、それぞれキャッシュデータ1〜4から、下位アドレス1〜4が示す位置のデータを出力データとして選択して出力する。出力データ1〜4の出力が完了した後、出力データ準備完了フラグが“0”となり、このとき、アドレスリクエストが前段のアドレス計算手段10に送られる。
The output
なお、上述したキャッシュ回路100の各構成要素は、例えば、中央処理装置(CPU:Central Processing Unit)が所定のプログラムを実行することにより、各機能手段として実現される。
Each component of the
(第1実施形態の動作)
図11を参照して、上述したキャッシュ回路の動作について、説明する。図11は、第1実施形態のキャッシュ回路の動作、すなわち、キャッシュメモリ制御方法を説明するための概略図である。図11(A)〜(H)は、それぞれキャッシュメモリの各欄に格納された情報を示している。
(Operation of the first embodiment)
The operation of the cache circuit described above will be described with reference to FIG. FIG. 11 is a schematic diagram for explaining the operation of the cache circuit of the first embodiment, that is, the cache memory control method. 11A to 11H show information stored in each column of the cache memory.
ここでは、キャッシュメモリの1つの領域に2画素分のデータが書き込まれるものとする。また、図2を参照して説明した、ソース画像とデスティネーション画像の関係の例について説明する。 Here, it is assumed that data for two pixels is written in one area of the cache memory. An example of the relationship between the source image and the destination image described with reference to FIG. 2 will be described.
初期状態では、キャッシュメモリ300の内部は全て“0”である(図11(A))。
In the initial state, all the contents of the
入力アドレス1〜4として、画素1−1、1−2、2−1及び2−2のアドレスが入力される。 As the input addresses 1 to 4, the addresses of the pixels 1-1, 1-2, 2-1, and 2-2 are input.
選択信号1が“1”となると、第1の領域がライトイネーブルとなり、上位アドレス1に画素1−1のアドレス(ソースアドレス1−1と称することもある。)と、下位アドレスに1番目の画素であることを示すアドレス(0)が書き込まれる。また、アドレス選択部120ではソースアドレス1−1が選択アドレスとして選択される。
When the
ここでは有効ビット1〜4が全て0であるため、キャッシュヒット信号1〜4は全て“0”となり、キャッシュヒット判定信号も“0”となる。この結果、メモリ制御部160がソースアドレス1−1及び1−2のデータ(d1−1及びd1−2)をリードデータとして読出し、第1の領域に書き込む。このとき、有効ビット1は“1”となる(図11(B))。
Here, since the
次に、選択信号2が“1”となると、キャッシュメモリ300の第2の領域312がライトイネーブルとなり、上位アドレス2に、ソースアドレス2−1と、下位アドレス2に1番目の画素であることを示すアドレス(0)が書き込まれる。また、アドレス選択部120ではソースアドレス2−1が選択アドレスとして選択される。
Next, when the
ここでは有効ビット1が1であり、有効ビット2〜4が0である。選択アドレスの上位アドレスとキャッシュメモリ300から読み出された上位アドレス1とが異なるため、キャッシュヒット信号1〜4は全て“0”となり、キャッシュヒット判定信号も“0”となる。この結果、メモリ制御部160がソースアドレス2−1及び2−2のデータ(d2−1及びd2−2)をリードデータとして読出し、第2の領域312に書き込む。このとき、有効ビット2は“1”となる(図11(C))。
Here,
次に、選択信号3が“1”となると、キャッシュメモリ300の第3の領域313がライトイネーブルとなり、上位アドレス3に、ソースアドレス1−1と、下位アドレスに2番目の画素であることを示すアドレス(1)が書き込まれる。また、アドレス選択部120ではソースアドレス1−1が選択アドレスとして選択される。
Next, when the selection signal 3 becomes “1”, the
ここでは有効ビット1及び有効ビット2が1であり、有効ビット3及び有効ビット4が0である。選択アドレスと上位アドレス1とがともに、ソースアドレス1−1となり一致するので、キャッシュヒット信号1が“1”となり、キャッシュヒット判定信号も“1”となる。この結果、キャッシュヒットデータ選択部150は、データ1(d1−1及びd1−2)をキャッシュヒットデータとして選択して、ライトデータ判定部170に送る。ライトデータ判定部170は、キャッシュヒットデータをキャッシュメモリ300に送り、キャッシュヒットデータは、第3の領域に書き込まれる(図11(D))。
Here, the
次に、選択信号4が“1”となると、キャッシュメモリ300の第4の領域314がライトイネーブルとなり、上位アドレス3に、ソースアドレス2−1と、下位アドレスに2番目の画素であることを示すアドレス(1)が書き込まれる。また、アドレス選択部ではソースアドレス2−1が選択アドレスとして選択される。
Next, when the
このとき、有効ビット1〜3が1であり、有効ビット4が0である。選択アドレスと上位アドレス2とがともに、ソースアドレス2−1となり一致するので、キャッシュヒット信号2が“1”となり、キャッシュヒット判定信号も“1”となる。この結果、キャッシュヒットデータ選択部150は、データ2(d2−1及びd2−2)をキャッシュヒットデータとして選択して、ライトデータ判定部170に送る。ライトデータ判定部170は、キャッシュヒットデータをキャッシュメモリ300に送り、キャッシュヒットデータは、第4の領域に書き込まれる(図11(E))。
At this time, the
第4の領域までデータが書き込まれた後、データが出力される。ここでは、下位アドレス1が0であるので、キャッシュデータのd1−1が出力データ1として選択され、下位アドレス2が0であるので、キャッシュデータのd2−1が出力データ2として選択され、下位アドレス2が1であるので、キャッシュデータのd1−2が出力データ3として選択され、及び、下位アドレス4が1であるので、キャッシュデータのd2−2が出力データ4として選択される。これら、出力データ1〜4が出力されると、アドレス計算手段に対して、次のアドレスリクエストを送る。
After the data is written up to the fourth area, the data is output. Here, since the
アドレスリクエストを受けた、アドレス計算手段10は、デスティネーションアドレスbに対して、入力アドレス1〜4として、画素1−2、2−2、1−3及び2−3のアドレスを送る。 Upon receiving the address request, the address calculation means 10 sends the addresses of the pixels 1-2, 2-2, 1-3, and 2-3 as the input addresses 1 to 4 to the destination address b.
この場合、入力アドレス1(画素1−2)及び入力アドレス2(画素2−2)のときは、キャッシュヒットするので、キャッシュメモリから読みだされたキャッシュデータがライトデータとして、格納される(図11(F))。 In this case, since the cache hit occurs at the input address 1 (pixel 1-2) and the input address 2 (pixel 2-2), the cache data read from the cache memory is stored as write data (see FIG. 11 (F)).
一方、入力アドレス3(画素1−3)及び入力アドレス4(画素2−3)のときはキャッシュヒットしないので、外部メモリから読みだされたリードデータが、ライトデータとして、格納される(図11(G))。 On the other hand, since there is no cache hit at the input address 3 (pixel 1-3) and the input address 4 (pixel 2-3), the read data read from the external memory is stored as write data (FIG. 11). (G)).
第4の領域までデータが書き込まれた後、データが出力される。ここでは、下位アドレス1が1であるので、キャッシュデータ1のd1−2が出力データ1として選択され、下位アドレス2が1であるので、キャッシュデータ2のd2−2が出力データ2として選択され、下位アドレス3が0であるので、キャッシュデータのd1−3が出力データ3として選択され、及び、下位アドレス4が0であるので、キャッシュデータのd2−3が出力データ4として選択される。これら、出力データ1〜4が出力されると、アドレス計算手段に対して、次のアドレスリクエストを送る。
After the data is written up to the fourth area, the data is output. Here, since
アドレスリクエストを受けた、アドレス計算手段10は、デスティネーションアドレスcに対して、入力アドレス1〜4として、画素2−3、3−3、2−4及び3−4のアドレスを送る。 Upon receiving the address request, the address calculation means 10 sends the addresses of the pixels 2-3, 3-3, 2-4, and 3-4 as the input addresses 1 to 4 to the destination address c.
この場合、入力アドレス1(画素2−3)及び入力アドレス3(画素2−4)のときは、キャッシュヒットし、入力アドレス2(画素3−3)及び入力アドレス4(画素3−4)のときはキャッシュヒットしないので、外部メモリから読みだされたリードデータが、ライトデータとして、格納される(図11(H))。 In this case, at the input address 1 (pixel 2-3) and the input address 3 (pixel 2-4), a cache hit occurs and the input address 2 (pixel 3-3) and the input address 4 (pixel 3-4) Since no cache hit occurs, read data read from the external memory is stored as write data (FIG. 11 (H)).
第4の領域までデータが書き込まれた後、データが出力される。ここでは、下位アドレス1が0であるので、キャッシュデータ1のd2−3が出力データ1として選択され、下位アドレス2が0であるので、キャッシュデータ2のd3−3が出力データ2として選択され、下位アドレス3が1であるので、キャッシュデータ3のd2−4が出力データ3として選択され、及び、下位アドレス4が0であるので、キャッシュデータ4のd3−4が出力データ4として選択される。これら、出力データ1〜4が出力されると、アドレス計算手段に対して、次のアドレスリクエストを送る。
After the data is written up to the fourth area, the data is output. Here, since
上述したように、この第1実施形態の構成によれば、キャッシュヒットした場合には、外部メモリにアクセスすることなく、キャッシュメモリに格納されたデータを参照する。この結果、外部メモリへのアクセス回数を削減することができ、処理時間を短縮することができる。また、本発明では、デスティネーションアドレスが示すデータのためにアクセスが必要となるアドレスの特徴を考慮している。このため、特許文献1のようなブロック単位でのキャッシュメモリへのデータの取り込みを行うものに比べて、キャッシュメモリ内に格納したデータを効率よく利用できることから、高速化やキャッシュメモリの容量の増大を抑えることができる効果も奏する。
As described above, according to the configuration of the first embodiment, when a cache hit occurs, the data stored in the cache memory is referred to without accessing the external memory. As a result, the number of accesses to the external memory can be reduced, and the processing time can be shortened. Further, the present invention takes into consideration the characteristics of the address that needs to be accessed for the data indicated by the destination address. For this reason, the data stored in the cache memory can be used more efficiently than in the case where data is fetched into the cache memory in block units as in
(第2実施形態)
図12を参照して、第2実施形態のキャッシュ回路について説明する。図12は、第2実施形態のキャッシュ回路を説明するための概略図である。
(Second Embodiment)
A cache circuit according to the second embodiment will be described with reference to FIG. FIG. 12 is a schematic diagram for explaining the cache circuit of the second embodiment.
キャッシュ回路101は、キャッシュメモリ301、リード制御部120、アドレス選択部130、キャッシュヒット判定部140、キャッシュヒットデータ選択部150、メモリ制御部160、ライトデータ判定部171、ライト領域選択部181、出力データ選択部190、完了ビット判定部200、リード番号選択部210、リード番号決定部220およびリードデータ選択部230を備えて構成される。
The
キャッシュ回路101に入力された入力アドレス1〜4は、キャッシュメモリ301及びアドレス選択部130に送られる。
Input addresses 1 to 4 input to the
キャッシュメモリ301には、キャッシュ回路101に入力された入力アドレス1〜4、リード制御部120で生成された選択信号1〜4、ライト領域選択部181で生成されたライトイネーブル信号1〜4、ライトデータ判定部171で選択されたライトデータ、及び、リード番号決定部220で生成された決定リード番号が入力される。また、キャッシュメモリ301から、有効ビット1〜4及び上位アドレス1〜4がキャッシュヒット判定部140に送られ、下位アドレス1〜4が出力データ選択部190に送られる。また、キャッシュデータ1〜4は、キャッシュヒットデータ選択部150及び出力データ選択部190に送られる。完了ビット1〜4は、完了ビット判定部200及びリード番号選択部210に送られる。リード番号1〜4は、リード番号選択部210とリードデータ選択部230に送られる。
The
図13を参照して、キャッシュメモリについて説明する。図13は、キャッシュメモリの概略図である。 The cache memory will be described with reference to FIG. FIG. 13 is a schematic diagram of a cache memory.
キャッシュメモリ301は、複数の領域を有している。キャッシュメモリ301が有する領域の数は、少なくとも入力アドレスと同じ個数有れば良く、ここでは、キャッシュメモリ301が有する領域を4個としている。キャッシュメモリ301の各領域には、有効ビット欄330、上位アドレス欄332、下位アドレス欄334及びキャッシュデータ欄336、完了ビット欄338及びリード番号欄340が設けられていて、それぞれ、有効ビット、上位アドレス、下位アドレス、キャッシュデータ、完了ビット及びリード番号が格納される。
The
以下の説明では、第1〜4の領域321〜324に格納される、有効ビット、上位アドレス、下位アドレス、キャッシュデータ、完了ビット及びリード番号をそれぞれ区別して、有効ビット1〜4、上位アドレス1〜4、下位アドレス1〜4、キャッシュデータ1〜4、完了ビット1〜4及びリード番号1〜4と表すこともある。
In the following description, the valid bits, upper addresses, lower addresses, cache data, completion bits, and read numbers stored in the first to
ここで有効ビットは、その有効ビットが格納されている領域が有効であることを示す。当該領域が有効であるとき、有効ビットは“1”となる。一方、当該領域が無効であるとき、有効ビットは“0”となる。 Here, the valid bit indicates that the area in which the valid bit is stored is valid. When the area is valid, the valid bit is “1”. On the other hand, when the area is invalid, the valid bit is “0”.
上位アドレス、下位アドレス及びキャッシュデータは、第1実施形態と同様なので説明を省略する。また、完了ビット及びリード番号については後述する。 The upper address, the lower address, and the cache data are the same as those in the first embodiment, and a description thereof will be omitted. The completion bit and the read number will be described later.
入力アドレス1〜4の中で、上位アドレスがキャッシュメモリ301の上位アドレス欄332に送られ、下位アドレスがキャッシュメモリ301の下位アドレス欄334に送られる。
Among the input addresses 1 to 4, the upper address is sent to the
また、選択信号1〜4は、キャッシュメモリ301の上位アドレス欄332及び下位アドレス欄334のライトイネーブル端子(we)に入力される。選択信号1〜4が“1”であるとき、入力アドレス1〜4の上位アドレス及び下位アドレスが、キャッシュメモリ301の上位アドレス欄332及び下位アドレス欄334にそれぞれ書き込まれる。
The selection signals 1 to 4 are input to the write enable terminals (we) of the
ライトデータは、キャッシュメモリ301の各領域321〜324のキャッシュデータ欄336に送られる。また、ライトイネーブル信号が、キャッシュメモリ301のキャッシュデータ欄336のライトイネーブル端子(we)に入力される。ライトイネーブル信号1〜4が“1”であるとき、キャッシュメモリ301のキャッシュデータ欄336にライトデータが書き込まれる。
The write data is sent to the
また、ライトイネーブル信号1〜4は、完了ビット欄338にそれぞれ送られる。有効ビット1〜4が“0”であるとき、ライトイネーブル信号1〜4が“1”になると、有効ビット1〜4が“1”になる。なお、初期状態では、完了ビット欄338は全て“0”であるが、一度、完了ビットが“1”になると、そのビットについては、再度初期化が行われるまで、“1”を維持する。
The write enable
リード制御部120、アドレス選択部130、キャッシュヒットデータ選択部150及びメモリ制御部160の構成は、第1実施形態と同様なので説明を省略することもある。
なお、リード制御部120は、一定の時間Δtslが経過した後、選択する領域を変更した選択信号を生成する。例えば、選択信号1が“1”であり、選択信号2〜4が“0”であった場合、時間Δtslが経過すると、選択信号1が“0”となり、選択信号2が“1”となる。
Since the configurations of the read
Note that the
キャッシュヒット判定部140は、図6を参照して説明した第1実施形態と同様に構成することができる。なお、第2実施形態では、キャッシュヒット判定部140で生成されたキャッシュヒット信号は、キャッシュヒットデータ選択部150だけでなく、完了ビット判定部200及びリード番号選択部210に送られる。
The cache hit
キャッシュヒットデータ選択部150は、選択アドレスが示す画素のデータがキャッシュメモリ301に格納されているとき、キャッシュメモリ301の各領域321〜324に格納されているキャッシュデータを受け取り、キャッシュヒット信号1〜4が示す領域のデータをキャッシュヒットデータとして選択する。
When the pixel data indicated by the selected address is stored in the
図14を参照して、完了ビット判定部の構成例について説明する。図14は、完了ビット判定部の概略構成図である。 A configuration example of the completion bit determination unit will be described with reference to FIG. FIG. 14 is a schematic configuration diagram of the completion bit determination unit.
この構成例の完了ビット判定部200は、第1〜4のAND演算部202−1〜4とOR演算部204を備えて構成されている。この構成では、第1〜4のAND演算部202−1〜4でそれぞれ演算された、完了ビット1〜4と、キャッシュヒット信号1〜4との論理積(AND)1〜4が、OR演算部204において論理和(OR)演算される。
The completion
キャッシュヒット信号1〜4は、いずれか1つのみが“1”となるので、AND1〜4は、いずれか1つがキャッシュデータを示し、それ以外は“0”となる。従って、AND1〜4の論理和で与えられる完了ビット判定信号は、キャッシュヒット信号が示す領域の完了ビットとなる。完了ビット判定信号は、ライトデータ判定部171及びライト領域選択部181に送られる。
Since only one of the cache hit signals 1 to 4 is “1”, one of the AND 1 to 4 indicates cache data, and “0” otherwise. Therefore, the completion bit determination signal given by the logical sum of AND1 to AND4 becomes the completion bit of the area indicated by the cache hit signal. The completion bit determination signal is sent to the write
ライトデータ判定部171は、選択アドレスが示す画素のデータがキャッシュメモリ301に格納されているとき、キャッシュヒットデータをライトデータとして選択し、選択アドレスが示す画素のデータがキャッシュメモリ301に格納されていないとき、リードデータをライトデータとして選択する。ライトデータ判定部171は、ライトデータをキャッシュメモリ301に送る。
When the pixel data indicated by the selected address is stored in the
ライトデータ判定部171は、選択演算部173を備えている。選択演算部173には、キャッシュヒットデータとリードデータが入力される。選択演算部173には、制御信号として完了ビット判定信号が入力される。選択演算部173は、完了ビット判定信号の値に応じて、キャッシュヒットデータとリードデータのいずれか一方を選択して出力する。
The write
この構成では、完了ビット判定信号が“1”の場合、すなわち、キャッシュメモリに選択アドレスに対応するデータが格納されている場合は、選択演算部173は、キャッシュヒットデータをライトデータとして選択する。一方、完了ビット判定信号が“0”の場合、すなわち、キャッシュメモリに選択アドレスに対応するデータがない場合は、選択演算部173は、リードデータをライトデータとして選択する。
In this configuration, when the completion bit determination signal is “1”, that is, when data corresponding to the selected address is stored in the cache memory, the
リード番号選択部210は、格納が未完了であり、キャッシュヒットしている場合、当該領域のリード番号を選択リード番号として選択する。
When the storage has not been completed and the cache hit has occurred, the read
図15を参照して、リード番号選択部の構成例について説明する。図15は、リード番号選択部の概略構成図である。 A configuration example of the lead number selection unit will be described with reference to FIG. FIG. 15 is a schematic configuration diagram of the lead number selection unit.
リード番号選択部210は、第1〜4の第1段AND演算部212−1〜4と、第1〜4の第2段AND演算部214−1〜4と、OR演算部216とを具えている。
The lead
第1〜4の第1段AND演算部212−1〜4は、それぞれ、キャッシュヒット信号1〜4と、完了ビット1〜4を論理反転した反転信号1〜4の論理積(AND)演算を行う。第1〜4の第2段AND演算部214−1〜4は、第1〜4の第1段AND演算部212−1〜4での論理積演算の結果と、リード番号1〜4の論理積演算を行う。OR演算部216は、第1〜4の第2段AND演算部214−1〜4の論理積演算の結果に対して、論理和演算を行う。
The first to fourth first-stage AND operation units 212-1 to 41-4 perform a logical product (AND) operation of the cache hit signals 1 to 4 and the
第1〜4の第1段AND演算部212−1〜4は、キャッシュヒット信号が“1”であり、完了ビットが“0”、すなわち、格納が完了していない場合に1となる。第1〜4の第2段AND演算部214−1〜4とOR演算部216により、AND1〜4が“1”である領域のリード番号が選択されて、選択リード番号として出力される。
The first to fourth first-stage AND operation units 212-1 to 212-4 are set to 1 when the cache hit signal is “1” and the completion bit is “0”, that is, the storage is not completed. The first to fourth second-stage AND operation units 214-1 to 214-4 and the
この選択リード番号はリード番号決定部220に送られる。
This selected lead number is sent to the lead
リード番号決定部220は、リクエストカウンタ222と選択演算部224を具えて構成される。リクエストカウンタ222には、キャッシュヒット判定信号が、論理反転された後、入力される。したがって、このリクエストカウンタ222は、キャッシュヒットしなかった回数を計数する。リクエストカウンタ222で計数されたリクエスト計数値と、リード番号選択部210で選択されたリード選択番号は、選択演算部224に送られる。選択演算部224には、制御信号としてキャッシュヒット判定信号が入力される。キャッシュヒット判定信号が“1”のとき、すなわち、キャッシュヒットした場合は、選択リード番号を決定リード番号として出力し、キャッシュヒット判定信号が“0”のとき、すなわち、キャッシュヒットしていない場合は、リクエスト計数値を決定リード番号として出力する。
The lead
このリード番号決定部220から出力される決定リード番号は、キャッシュメモリ301に送られる。
The determined read number output from the read
図16を参照して、リードデータ選択部の構成例について説明する。図16は、リードデータ選択部の概略構成図である。 A configuration example of the read data selection unit will be described with reference to FIG. FIG. 16 is a schematic configuration diagram of the read data selection unit.
リードデータ選択部230は、メモリ制御部160からリードデータの読み出した回数をリードカウンタ値として計数し、リードカウンタ値とリード番号とが一致している場合には、リードカウンタ値と一致したリード番号が格納されている領域にリードデータ選択信号を送る。
The read
リードデータ選択部230は、リードデータカウンタ232、第1〜4の比較演算部234−1〜4、第1〜4のAND演算部236−1〜4を備えて構成される。
The read
リードデータカウンタ232には、メモリ制御部160からリードデータイネーブル信号が入力される。リードデータカウンタ232は、メモリ制御部160からリードデータの読み出した回数をリードデータ計数値として計数する。このリードデータ計数値は、第1〜4の比較演算部234−1〜4に送られる。第1〜4の比較演算部234−1〜4には、リードデータ計数値とリード番号1〜4が入力され、これらの比較を行う。第1〜4の比較演算部234−1〜4は、それぞれリード番号1〜4がリードデータ計数値と等しい場合、“1”を出力し、等しくない場合は“0”を出力する。第1〜4のAND演算部236−1〜4は、第1〜4の比較演算部234−1〜4における比較演算結果と、リードデータイネーブル信号の論理積演算を行う。
A read data enable signal is input from the
この第1〜4のAND演算部236−1〜4における演算結果であるリードデータ選択信号1〜4は、リード番号がリードデータ計数値と等しい領域に対して、リードデータが利用可能であるか否かを示す。例えば、リードデータ選択信号2が“1”の場合、領域2のリード番号がリードデータ計数値と等しく、領域2に格納するリードデータが利用可能であることを示している。
In the first to fourth AND operation units 236-1 to 236-4, read data selection signals 1 to 4 are read data usable for an area where the read number is equal to the read data count value. Indicates whether or not. For example, when the read
リード選択信号1〜4はライト領域選択部181に送られる。
The
図17を参照して、ライト領域選択部の構成例について説明する。図17は、ライト領域選択部の概略構成図である。 A configuration example of the write area selection unit will be described with reference to FIG. FIG. 17 is a schematic configuration diagram of the write area selection unit.
ライト領域選択部181は、第1〜4のAND演算部183−1〜4及び第1〜4のOR演算部186−1〜4を備えている。第1〜4のAND演算部183−1〜4には、選択信号1〜4と、完了ビット判定信号が入力される。第1〜4のAND演算部183−1〜4の出力であるAND1〜4は、第1〜4のOR演算部186−1〜4に送られる。第1〜4のOR演算部186−1〜4は、AND1〜4と、リード選択信号1〜4との論理和演算を行い、その結果を、ライトイネーブル信号1〜4として、キャッシュメモリ301に送る。すなわち、ライト領域選択部181は、選択信号1〜4が指定する領域について、完了ビットが“1”である場合、あるいは、リード番号に等しい計数値のリードデータが読み込まれているときに、キャッシュメモリ301への書き込みを行う。
The write
(第2実施形態の動作)
図18を参照して、上述したキャッシュ回路の動作について、説明する。図18は、第2実施形態のキャッシュ回路の動作、すなわち、キャッシュメモリ制御方法を説明するための概略図である。図18(A)〜(G)は、それぞれキャッシュメモリの各欄に格納された情報を示している。ここでは、キャッシュメモリの1つの領域に2画素分のデータが書き込まれるものとする。また、図2を参照して説明した、ソース画像とデスティネーション画像の関係の例について説明する。
(Operation of Second Embodiment)
The operation of the cache circuit described above will be described with reference to FIG. FIG. 18 is a schematic diagram for explaining the operation of the cache circuit of the second embodiment, that is, the cache memory control method. FIGS. 18A to 18G show information stored in each column of the cache memory. Here, it is assumed that data for two pixels is written in one area of the cache memory. An example of the relationship between the source image and the destination image described with reference to FIG. 2 will be described.
初期状態では、キャッシュメモリ301の内部は全て“0”とする(図18(A))。
In the initial state, all the contents of the
入力アドレス1〜4として、ソースアドレス1−1、1−2、2−1及び2−2が入力される。 Source addresses 1-1, 1-2, 2-1, and 2-2 are input as input addresses 1-4.
アドレス選択部130ではソースアドレス1−1が選択アドレスとして選択される。キャッシュヒット判定部140では、キャッシュメモリ301への格納が完了する前に、キャッシュヒットの判定が行われるため、キャッシュヒット信号1〜4は全て“0”となり、また、キャッシュヒット判定信号も“0”となる。
The
選択信号1が“1”となると、第1の領域がライトイネーブルとなり、上位アドレス1にソースアドレス1−1と、下位アドレスに1番目の画素であることを示すアドレス(0)が書き込まれる。また、有効ビット1が“1”になる。
When the
この段階で、メモリ制御部160は、外部メモリからの読み出しを開始する。
At this stage, the
また、リクエストカウンタ222が計数を行い、その計数結果である“1”をリード番号欄に書き込む(図18(B))。
Further, the
この読み出しを行っている間に、選択信号2が“1”になる。
During this reading, the
アドレス選択部130ではソースアドレス2−1が選択アドレスとして選択される。キャッシュヒット判定部140では、キャッシュメモリへの格納が完了する前に、キャッシュヒットの判定が行われるため、キャッシュヒット信号1〜4は全て“0”となり、また、キャッシュヒット判定信号も“0”となる。
In the
選択信号2が“1”となると、第2の領域がライトイネーブルとなり、上位アドレス2にソースアドレス2−1と、下位アドレスに1番目の画素であることを示すアドレス(0)が書き込まれる。また、有効ビット2が“1”になる。
When the
この段階で、メモリ制御部160は、外部メモリからの読み出しを開始する。
At this stage, the
また、リクエストカウンタ222が計数を行い、その計数結果である“2”が、リード番号欄に書き込まれる(図18(C))。
Further, the
次に、選択信号3が“1”になる。この場合、キャッシュヒット信号1が“1”となり、キャッシュヒット判定信号は“1”となる。第1の領域に書き込まれていないときは、完了ビット1が“0”であるため、リード番号1が選択され、この値がリード番号3に書き込まれる。すなわち、リード番号3が1となる(図18(D))。
Next, the selection signal 3 becomes “1”. In this case, the cache hit
次に、選択信号4が“1”になる。この場合、キャッシュヒット信号2が“1”となり、キャッシュヒット判定信号は“1”となる。第2の領域に書き込まれていないときは、完了ビット2が“0”であるため、リード番号2が選択され、この値がリード番号4に書き込まれる。すなわち、リード番号4が2となる(図18(E))。
Next, the
その後、1つ目のデータの読み込みが完了すると、リードデータカウンタが1加算され、“1”となる。リードデータ選択部230では、リード番号1〜4とリードデータ計数値の比較を常時行っているので、リードデータ計数値が“1”になると、比較結果1及び3が“1”となる。データの読み込みが完了すると、リードデータイネーブル信号が“1”となるので、リードデータ選択信号1及び3が“1”となり、ライト領域選択部181に送られる。
Thereafter, when the reading of the first data is completed, the read data counter is incremented by 1 and becomes “1”. Since the read
ライト領域選択部181では、ライトイネーブル信号1及び3を1として、第1の領域と第3の領域にリードデータを書き込む(図18(F))。
The write
次に、2つ目のデータの読み込みが完了すると、リードデータカウンタが1加算され、リードデータ計数値が“2”となる。リードデータ選択部230では、リード番号1〜4とリードデータ計数値の比較を常時行っているので、リードデータ計数値が“2”になると、比較結果2及び4が“1”となる。データの読み込みが完了すると、リードデータイネーブル信号が“1”となるので、リードデータ選択信号2及び4が“1”となり、ライト領域選択部181に送られる。
Next, when the reading of the second data is completed, the read data counter is incremented by 1, and the read data count value becomes “2”. Since the read
ライト領域選択部181では、ライトイネーブル信号2及び4を1として、第2の領域と第4の領域にリードデータが書き込まれる(図18(G))。
In the write
第4の領域までデータが書き込まれた後、データが出力される。この動作は第1実施形態と同様である。 After the data is written up to the fourth area, the data is output. This operation is the same as in the first embodiment.
図19は、第1実施形態と第2実施形態の動作の違いを説明するための模式図である。図19(A)〜(D)は第1実施形態の選択信号1〜4を示している。図19(E)は、外部メモリ20からの読み込み処理を示している。また、図19(F)〜(I)は第2実施形態の選択信号1〜4を示している。図19(J)は、外部メモリ20からの読み込み処理を示している。
FIG. 19 is a schematic diagram for explaining a difference in operation between the first embodiment and the second embodiment. FIGS. 19A to 19D show selection signals 1 to 4 of the first embodiment. FIG. 19E shows a read process from the
ここでは、入力アドレス1に対して、外部メモリ20からデータd1−1及びd1−2を読み込み、入力アドレス2に対して、外部メモリ20からデータd2−1及びd2−2を読み込み、入力アドレス3及び4に対しては、キャッシュメモリから読み込む場合を例にとって説明する。
Here, the data d1-1 and d1-2 are read from the
第1実施形態の構成によれば、時刻t0で選択信号1が“1”になると、外部メモリの読込処理開始までにかかる時間Δtaを経過した後、外部メモリからデータd1−1及びd1−2の読み込み処理を行う。外部メモリからの読込処理が終了すると、選択信号1が“0”になるとともに、選択信号2が“1”になる。ここでは、外部メモリからの読込処理にかかる時間をΔtbとする。
According to the configuration of the first embodiment, when the
次に、選択信号2が“1”になると、外部メモリからデータd2−1及びd2−2の読込処理を行う。
Next, when the
データd2−1及びd2−2の読込処理が終了すると、選択信号2が“0”になるとともに、選択信号3が“1”になる。選択信号3が“1”のときは、外部メモリからの読込処理を行わないので、時間Δtslが経過した後、選択信号3が“0”になるとともに、選択信号4が“1”になる。
When the reading process of the data d2-1 and d2-2 is completed, the
選択信号4が“1”になった場合も、外部メモリからの読込処理を行わないので、時間Δtslが経過した後、時刻t1において、選択信号4が“0”となる。
Even when the
時刻t1において4つのアドレスに対するキャッシュ処理が終了して、出力処理に移る。 At time t1, the cache processing for the four addresses is completed, and the process proceeds to output processing.
これに対し、第2実施形態の構成によれば、選択信号1により、データd1−1及びd1−2の読み込みを行っている間であっても、時間Δtslが経過した時点で、選択信号1が“0”となり、選択信号2が“1”になる。このように、第2実施形態の構成では、時間Δtslが経過するたびに、リード制御部は、選択する領域を変更した選択信号を生成する。
On the other hand, according to the configuration of the second embodiment, even when the data d1-1 and d1-2 are being read by the
外部メモリからの読込処理については、データd1−1及びd1−2の読込処理が終了すると、所定の時間Δtcを経過した後、次のデータd2−1及びd2−2の読込処理を行う。なお、この所定の時間Δtcは、外部メモリからの読込処理が連続したときのインターバルである。 Regarding the reading process from the external memory, when the reading process of the data d1-1 and d1-2 is completed, the reading process of the next data d2-1 and d2-2 is performed after a predetermined time Δtc has elapsed. The predetermined time Δtc is an interval when the reading process from the external memory is continued.
このため、時刻t0で処理を開始した場合、第1実施形態では、時刻t1において4つのアドレスに対するキャッシュ処理が終了して、出力処理に移るのに対して、第2実施形態では、時刻t2において4つのアドレスに対するキャッシュ処理が終了して、出力処理に移ることができる。 Therefore, when processing is started at time t0, in the first embodiment, the cache processing for the four addresses ends at time t1 and proceeds to output processing, whereas in the second embodiment, at time t2, After the cache processing for the four addresses is completed, the output processing can be started.
上述したように、この第2実施形態の構成によれば、第1実施形態と同様にキャッシュヒットした場合には、外部メモリにアクセスすることなく、キャッシュメモリに格納されたデータを参照する。この結果、外部メモリへのアクセス回数を削減することができ、処理時間を短縮することができる。 As described above, according to the configuration of the second embodiment, when a cache hit occurs as in the first embodiment, the data stored in the cache memory is referred to without accessing the external memory. As a result, the number of accesses to the external memory can be reduced, and the processing time can be shortened.
また、さらに、外部メモリからのデータの読み込みが完了する前に、次のデータのキャッシュヒット判定を行う。このため、外部メモリからのデータの読み込みを連続して行うことができ、外部メモリの使用効率が上がり、画像データを転送する処理速度をさらに向上させることができる。 Further, before the reading of data from the external memory is completed, the cache hit determination of the next data is performed. Therefore, data can be continuously read from the external memory, the use efficiency of the external memory can be increased, and the processing speed for transferring image data can be further improved.
(第3実施形態)
図20を参照して、第3実施形態のキャッシュ回路について説明する。図20は、第3実施形態のキャッシュ回路を説明するための概略図である。
(Third embodiment)
A cache circuit according to the third embodiment will be described with reference to FIG. FIG. 20 is a schematic diagram for explaining the cache circuit of the third embodiment.
第3実施形態のキャッシュ回路102は、キャッシュメモリ302がA面とB面の2面を有している点が、第2実施形態のキャッシュ回路との主な相違点であり、それ以外の点は第2実施形態のキャッシュ回路と同様に構成される。従って、重複する説明は省略することもある。
The
第3実施形態のキャッシュメモリ302は、A面及びB面の2つの面を備えている。A面及びB面は、それぞれ、図13を参照して説明したキャッシュメモリ301と同じ構成である。すなわち、キャッシュメモリ302のA面及びB面は、複数の領域を有している。キャッシュメモリ302のA面及びB面がそれぞれ有する領域の数は、少なくとも入力アドレスと同じ個数有れば良く、ここでは、4個としている。キャッシュメモリ302のA面及びB面の各領域には、有効ビット欄330、上位アドレス欄332、下位アドレス欄334及びキャッシュデータ欄336、完了ビット欄338及びリード番号欄340が設けられていて、それぞれ、有効ビット、上位アドレス、下位アドレス、キャッシュデータ、完了ビット及びリード番号が格納される。
The
キャッシュメモリ302は、入力面切換部を有している。キャッシュメモリ302に送られた選択信号、入力アドレス及びライトイネーブル信号は、それぞれ入力面切換部で、送り先としてA面又はB面が選択される。また、リード番号の出力についても、入力面切換部において、送り元としてA面又はB面が選択される。この入力面切換部は、制御信号として入力される入力面切換信号によって、A面又はB面の切換えを行う。
The
入力面切換信号がA面を示す場合は、選択信号1〜4、入力アドレス1〜4及びライトイネーブル信号1〜4は、キャッシュメモリ302のA面に送られる。また、A面に格納されているリード番号がリード番号選択部211及びリードデータ選択部230に送られる。
When the input plane switching signal indicates the A plane, the selection signals 1 to 4, the input addresses 1 to 4, and the write enable
一方、入力面切換信号がB面を示す場合は、選択信号1〜4、入力アドレス1〜4及びライトイネーブル信号1〜4は、キャッシュメモリ302のB面に送られる。また、B面に格納されているリード番号がリード番号選択部211及びリードデータ選択部230に送られる。
On the other hand, when the input surface switching signal indicates the B surface, the selection signals 1 to 4, the input addresses 1 to 4, and the write enable
また、ライトデータ及びリード番号は、A面及びB面の各領域に送られる。 The write data and the read number are sent to each area of the A side and B side.
また、キャッシュメモリ302から、キャッシュヒット判定部141、キャッシュヒットデータ選択部151、完了ビット判定部201及びリード番号選択部211に送られる、有効ビット、上位アドレス、キャッシュデータ、完了ビットは、入力面切換信号に依存せず、キャッシュメモリのA面及びB面の双方に格納されているものである。
The valid bit, upper address, cache data, and completion bit sent from the
キャッシュヒット判定部141、完了ビット判定部201及びリード番号選択部211は、4系統の信号が8系統になることを除いては第2実施形態と同様に構成される。
The cache hit
リード番号選択部211は、キャッシュヒット信号入力面切換部と、完了ビット入力面切換部を備えている。キャッシュヒット信号入力面切換部、及び完了ビット入力面切換部には、制御信号として入力面切換信号が入力される。
The lead
キャッシュヒット信号出力面切換部、及び完了ビット出力面切換部は、入力面切換信号がA面を示す場合は、キャッシュメモリのA面に格納されているデータに対する信号を選択して出力し、入力面切換信号がB面を示す場合は、キャッシュメモリのB面に格納されているデータに対する信号を選択して出力する。以降の処理については、第2実施形態と同様である。 The cache hit signal output plane switching section and the completion bit output plane switching section select and output a signal for data stored in the A plane of the cache memory when the input plane switching signal indicates the A plane. When the surface switching signal indicates the B surface, a signal for data stored in the B surface of the cache memory is selected and output. The subsequent processing is the same as in the second embodiment.
出力データ選択部190は、出力面切換部を有している。出力面切換部には、制御信号として出力面切換信号が入力される。
The output
ここで、入力面切換信号と、出力面切換信号は相補的な信号であり、一方がA面を示す場合は、他方はB面を示す。出力面切換部は、出力面切換信号がA面を示す場合は、キャッシュメモリのA面に格納されているデータを選択して出力し、出力面切換信号がB面を示す場合は、キャッシュメモリのB面に格納されているデータを選択して出力する。 Here, the input surface switching signal and the output surface switching signal are complementary signals, and when one indicates the A surface, the other indicates the B surface. The output surface switching unit selects and outputs the data stored in the A surface of the cache memory when the output surface switching signal indicates the A surface, and the cache memory when the output surface switching signal indicates the B surface. The data stored in the B side is selected and output.
キャッシュメモリの面の切換えは、出力データ準備完了フラグの値に応じて行われる。図22を参照して、キャッシュメモリの面の切換えについて説明する。図22(A)は、キャッシュ処理を示し、図22(B)は、出力処理を示している。 The cache memory is switched according to the value of the output data preparation completion flag. With reference to FIG. 22, the switching of the cache memory plane will be described. FIG. 22A shows cache processing, and FIG. 22B shows output processing.
キャッシュメモリの面の切換えは、一方の面でのキャッシュ処理が完了し、かつ、他方の面からのデータの出力が完了した時点で行われる。 The cache memory plane is switched when the cache processing on one side is completed and the output of data from the other side is completed.
ここでは、各面からの出力の処理時間を一定とする。また、外部メモリ20からデータを読み出す処理が多い場合の処理時間は、出力の処理時間より長く、キャッシュメモリからデータを読み出す処理が多い場合の処理時間が出力の処理時間より短いものとする。
Here, the processing time of output from each surface is constant. The processing time when there are many processes for reading data from the
初期状態では、A面にキャッシュメモリにデータが格納されていないので、A面のキャッシュ処理時間は、長くなる。この間、B面からの出力は行わない。 In the initial state, since the data is not stored in the cache memory on the A side, the cache processing time on the A side becomes long. During this time, output from the B surface is not performed.
A面のキャッシュ処理が終了すると、入力面がA面からB面に切換えられるとともに、出力面がA面となる。その後、B面でキャッシュ処理を行うと同時に、A面からデータの出力がなされる。 When the A side cache processing is completed, the input surface is switched from the A surface to the B surface, and the output surface becomes the A surface. Thereafter, cache processing is performed on the B side, and at the same time, data is output from the A side.
この状態では、B面にキャッシュメモリにデータが格納されていないので、B面のキャッシュ処理時間は、長くなる。従って、A面からのデータの出力に要する処理時間よりも、B面でキャッシュ処理を行う時間が長くなる。A面からのデータの出力処理が完了した後、B面でのキャッシュ処理が完了すると、入力面がB面からA面に切換えられるとともに、出力面がA面からB面に切換えられる。 In this state, since the data is not stored in the cache memory on the B side, the cache processing time on the B side becomes long. Therefore, the time for performing the cache processing on the B side becomes longer than the processing time required for outputting the data from the A side. When the cache processing on the B surface is completed after the output processing of data from the A surface is completed, the input surface is switched from the B surface to the A surface, and the output surface is switched from the A surface to the B surface.
この状態では、A面にキャッシュメモリにデータが格納されているので、A面のキャッシュ処理時間は、出力の処理時間よりも短くなる。従って、B面からのデータの出力処理に要する時間よりも、A面でキャッシュ処理を行う時間が短くなる。A面でのキャッシュ処理が完了した後、B面でのデータの出力処理が完了すると、入力面がA面からB面に切換えられるとともに、出力面がB面からA面に切換えられる。 In this state, since the data is stored in the cache memory on the A side, the cache processing time on the A side is shorter than the output processing time. Therefore, the time for performing the cache process on the A side is shorter than the time required for the data output process from the B side. When the data output processing on the B surface is completed after the cache processing on the A surface is completed, the input surface is switched from the A surface to the B surface, and the output surface is switched from the B surface to the A surface.
以上説明したように、この構成によれば、A面及びB面の一方の面でキャッシュ処理を行っている間に、他方の面で出力処理を行うので、第2実施形態の構成に比べて、さらに、処理を効率的に行うことができる。 As described above, according to this configuration, output processing is performed on the other surface while cache processing is performed on one surface of the A surface and the B surface, so compared to the configuration of the second embodiment. In addition, the processing can be performed efficiently.
また、上述した各実施形態では、デスティネーション画像の1画素のデータを生成するために、ソース画像の4画素分のデータを用いる4点補間に用いる例について説明したが、4点補間に限定されるものではない。6点補間、8点補間など様々の補間方法に対しても、キャッシュメモリの領域の数を変更するだけで、同様の効果が得られる。 Further, in each of the above-described embodiments, an example of using four-point interpolation using data of four pixels of the source image to generate data of one pixel of the destination image has been described. However, the embodiment is limited to four-point interpolation. It is not something. The same effect can be obtained for various interpolation methods such as 6-point interpolation and 8-point interpolation only by changing the number of areas in the cache memory.
10 アドレス計算手段
20 外部メモリ
30 画像データ処理手段
100、101、102 キャッシュ回路
120 リード制御部
130 アドレス選択部
132、144、152、182、183、202、212、214、236 AND演算部
134、146、154、174、184、186、204、216 OR演算部
140 キャッシュヒット判定部
142、234 比較演算部
150 キャッシュヒットデータ選択部
160 メモリ制御部
170、171 ライトデータ判定部
172、173、192、224 選択演算部
180、181 ライト領域選択部
190 出力データ選択部
200 完了ビット判定部
210 リード番号選択部
220 リード番号決定部
222 リクエストカウンタ
230 リードデータ選択部
232 リードデータカウンタ
300、301、302 キャッシュメモリ
311、312、313、314、321、322、323、324 領域
330 有効ビット欄
332 上位アドレス欄
334 下位アドレス欄
336 キャッシュデータ欄
338 完了ビット欄
340 リード番号欄
DESCRIPTION OF
120
Claims (7)
前記キャッシュメモリの1つの領域を選択する選択信号を生成するリード制御部と、
前記複数の入力アドレスの1つを選択アドレスとして選択するアドレス選択部と、
前記選択アドレスが示す画素のデータが前記キャッシュメモリに格納されているか否かを判定して、判定結果を示すキャッシュヒット判定信号、及び、前記選択アドレスが示す画素のデータが格納されている領域を示すキャッシュヒット信号を生成するキャッシュヒット判定部と、
前記選択アドレスが示す画素のデータが前記キャッシュメモリに格納されているとき、前記キャッシュヒット信号が示す領域のデータをキャッシュヒットデータとして選択するキャッシュヒットデータ選択部と、
前記選択アドレスが示す画素のデータが前記キャッシュメモリに格納されていないとき、前記選択アドレスが示す画素のデータを、当該キャッシュ回路の外部に設けられた外部メモリからリードデータとして読み出すメモリ制御部と、
前記選択アドレスが示す画素のデータがキャッシュメモリに格納されているとき、前記キャッシュヒットデータをライトデータとして選択し、一方、前記選択アドレスが示す画素のデータがキャッシュメモリに格納されていないとき、前記リードデータをライトデータとして選択し、前記ライトデータを前記キャッシュメモリに送るとともに、前記ライトデータが使用可能であることを示すライトデータ判定信号を生成するライトデータ判定部と、
前記ライトデータ判定信号が、前記ライトデータが使用可能であることを示す場合に、前記選択信号が選択する前記キャッシュメモリの領域を書き込み可能とするライトイネーブル信号を生成して前記キャッシュメモリに送るライト領域選択部と
を備えることを特徴とするキャッシュ回路。 A cache circuit having a cache memory storing an address and pixel data indicated by the address in each of the plurality of areas, and reading out and outputting the pixel data indicated by each of the plurality of input addresses input from the cache memory Because
A read control unit for generating a selection signal for selecting one area of the cache memory;
An address selection unit that selects one of the plurality of input addresses as a selection address;
It is determined whether or not the pixel data indicated by the selection address is stored in the cache memory, and a cache hit determination signal indicating the determination result and an area where the pixel data indicated by the selection address is stored A cache hit determination unit for generating a cache hit signal indicating;
A cache hit data selection unit that selects data in an area indicated by the cache hit signal as cache hit data when pixel data indicated by the selection address is stored in the cache memory;
A memory control unit that reads out pixel data indicated by the selected address as read data from an external memory provided outside the cache circuit when data of the pixel indicated by the selected address is not stored in the cache memory;
When the pixel data indicated by the selected address is stored in the cache memory, the cache hit data is selected as write data, while when the pixel data indicated by the selected address is not stored in the cache memory, A write data determination unit that selects read data as write data, sends the write data to the cache memory, and generates a write data determination signal indicating that the write data is usable;
When the write data determination signal indicates that the write data can be used, a write enable signal that enables writing to the cache memory area selected by the selection signal is generated and sent to the cache memory A cache circuit comprising: an area selection unit.
前記キャッシュメモリの1つの領域を選択する選択信号を生成するリード制御部と、
前記複数の入力アドレスの1つを選択アドレスとして選択するアドレス選択部と、
前記選択アドレスと等しいアドレスが、前記キャッシュメモリの有効な領域に格納されているか否かを判定して、判定結果を示すキャッシュヒット判定信号、及び、格納されている場合には、格納されている領域を示すキャッシュヒット信号を生成するキャッシュヒット判定部と、
前記選択アドレスと等しいアドレスが、前記キャッシュメモリの有効な領域に格納されているとき、前記キャッシュヒット信号が示す領域のデータをキャッシュヒットデータとして選択するキャッシュヒットデータ選択部と、
前記選択アドレスと等しいアドレスが、前記キャッシュメモリの有効な領域に格納されていないとき、前記選択アドレスが示す画素のデータを、当該キャッシュ回路の外部に設けられた外部メモリからリードデータとして読み出すメモリ制御部と、
前記選択アドレスと等しいアドレスが、前記キャッシュメモリの有効な領域に格納されており、かつ、当該領域へのデータの格納が未完了である場合、当該領域のリード番号を選択リード番号として選択するリード番号選択部と、
前記選択アドレスと等しいアドレスが、前記キャッシュメモリの有効な領域に格納されており、かつ、当該領域へのデータの格納が完了している場合、完了ビット判定信号を出力する完了ビット判定部と、
前記メモリ制御部に対するリードデータのリクエスト回数をリクエストカウンタ値として計数し、キャッシュヒットしている場合は、選択リード番号を決定リード番号として選択し、キャッシュヒットしていない場合は、リクエストカウンタ値を決定リード番号として選択して、該決定リード番号を前記キャッシュメモリに送るリード番号決定部と、
前記メモリ制御部からリードデータの読み出した回数をリードカウンタ値として計数し、リードカウンタ値とリード番号とが一致している場合には、リードカウンタ値と一致したリード番号が格納されている領域にリードデータ選択信号を送るリードデータ選択部と、
前記選択アドレスが示す画素のデータのキャッシュメモリへの格納が完了している場合は、前記キャッシュヒットデータをライトデータとして選択し、前記選択アドレスが示す画素のデータのキャッシュメモリへの格納が未完了の場合、前記リードデータをライトデータとして選択し、前記ライトデータを前記キャッシュメモリに送るライトデータ判定部と、
前記ライトデータが使用可能である場合に、前記選択信号が選択する前記キャッシュメモリの領域を書き込み可能とするライトイネーブル信号を生成して前記キャッシュメモリに送るライト領域選択部と
を備えることを特徴とするキャッシュ回路。 In each of the plurality of areas, a valid bit indicating whether or not the area is valid, an address, pixel data indicated by the address, a completion bit indicating whether or not the data is stored, and a read number are stored. A cache circuit having a cache memory and reading out and outputting pixel data indicated by each of a plurality of input addresses from the cache memory;
A read control unit for generating a selection signal for selecting one area of the cache memory;
An address selection unit that selects one of the plurality of input addresses as a selection address;
It is determined whether or not an address equal to the selected address is stored in a valid area of the cache memory, and a cache hit determination signal indicating a determination result and, if stored, stored. A cache hit determination unit that generates a cache hit signal indicating an area;
A cache hit data selection unit that selects data in an area indicated by the cache hit signal as cache hit data when an address equal to the selected address is stored in an effective area of the cache memory;
Memory control for reading pixel data indicated by the selected address as read data from an external memory provided outside the cache circuit when an address equal to the selected address is not stored in a valid area of the cache memory And
When an address equal to the selected address is stored in a valid area of the cache memory and data storage in the area is incomplete, a read that selects the read number of the area as the selected read number A number selector,
An address equal to the selected address is stored in a valid area of the cache memory, and when the storage of data in the area is completed, a completion bit determination unit that outputs a completion bit determination signal;
The number of read data requests to the memory control unit is counted as a request counter value. If there is a cache hit, the selected read number is selected as the determined read number. If there is no cache hit, the request counter value is determined. A lead number determining unit that selects the lead number and sends the determined lead number to the cache memory;
The number of read data read from the memory control unit is counted as a read counter value. If the read counter value matches the read number, the read counter value that matches the read counter value is stored in the area. A read data selection section for sending a read data selection signal;
When the storage of the pixel data indicated by the selected address in the cache memory is completed, the cache hit data is selected as the write data, and the storage of the pixel data indicated by the selected address in the cache memory is not completed. In this case, a write data determination unit that selects the read data as write data and sends the write data to the cache memory;
A write area selection unit that generates a write enable signal that enables writing to the area of the cache memory selected by the selection signal and sends the write enable signal to the cache memory when the write data is usable; Cache circuit.
前記キャッシュメモリの領域には、複数の画素のデータ、及び、各領域に格納されているデータを選択する画素選択アドレスが格納されていて、
前記出力データ選択部は、前記キャッシュメモリに格納されている複数のデータから、前記選択アドレスが示す画素のデータを選択して出力する
ことを特徴とする請求項1又は2に記載のキャッシュ回路。 Furthermore, an output data selection unit is provided,
The area of the cache memory stores a plurality of pixel data and a pixel selection address for selecting data stored in each area.
The cache circuit according to claim 1, wherein the output data selection unit selects and outputs pixel data indicated by the selection address from a plurality of data stored in the cache memory.
前記キャッシュメモリの1つの領域を選択する選択信号を生成するリード制御部と、
前記複数の入力アドレスの1つを選択アドレスとして選択するアドレス選択部と、
前記選択アドレスと等しいアドレスが、前記キャッシュメモリの有効な領域に格納されているか否かを判定して、判定結果を示すキャッシュヒット判定信号、及び、格納されている場合には、格納されている領域を示すキャッシュヒット信号を生成するキャッシュヒット判定部と、
前記選択アドレスと等しいアドレスが、前記キャッシュメモリの有効な領域に格納されているとき、前記キャッシュヒット信号が示す領域のデータをキャッシュヒットデータとして選択するキャッシュヒットデータ選択部と、
前記選択アドレスと等しいアドレスが、前記キャッシュメモリの有効な領域に格納されていないとき、前記選択アドレスが示す画素のデータを、当該キャッシュ回路の外部に設けられた外部メモリからリードデータとして読み出すメモリ制御部と、
前記選択アドレスと等しいアドレスが、前記キャッシュメモリの有効な領域に格納されており、かつ、当該領域へのデータの格納が未完了である場合、当該領域のリード番号を選択リード番号として選択するリード番号選択部と、
前記選択アドレスと等しいアドレスが、前記キャッシュメモリの有効な領域に格納されており、かつ、当該領域へのデータの格納が完了している場合、完了ビット判定信号を出力する完了ビット判定部と、
前記メモリ制御部に対するリードデータのリクエスト回数をリクエストカウンタ値として計数し、キャッシュヒットしている場合は、選択リード番号を決定リード番号として選択し、キャッシュヒットしていない場合は、リクエストカウンタ値を決定リード番号して選択して、該決定リード番号をキャッシュメモリに送るリード番号決定部と、
前記メモリ制御部からリードデータの読み出した回数をリードカウンタ値として計数し、リードカウンタ値とリード番号とが一致している場合には、リードカウンタ値と一致したリード番号が格納されている領域にリードデータ選択信号を送るリードデータ選択部と、
前記選択アドレスが示す画素のデータのキャッシュメモリへの格納が完了している場合は、前記キャッシュヒットデータをライトデータとして選択し、前記選択アドレスが示す画素のデータのキャッシュメモリへの格納が未完了の場合、前記リードデータをライトデータとして選択し、前記ライトデータを前記キャッシュメモリに送るライトデータ判定部と、
前記ライトデータが使用可能である場合に、前記選択信号が選択する前記キャッシュメモリの領域を書き込み可能とするライトイネーブル信号を生成して前記キャッシュメモリに送るライト領域選択部と、
前記入力面切換信号と相補的な出力面切換信号により、前記キャッシュメモリの2つの面の一方を選択し、当該選択した面に格納されているデータを出力する出力データ選択部と
を備えることを特徴とするキャッシュ回路。 In each of the plurality of areas, a valid bit indicating whether or not the area is valid, an address, pixel data indicated by the address, a completion bit indicating whether or not the data is stored, and a read number are stored. A cache memory having two planes and an input plane switching unit that switches between the two planes in response to an input plane switching signal, and reading out pixel data indicated by each of a plurality of input addresses from the cache memory; A cache circuit for output,
A read control unit for generating a selection signal for selecting one area of the cache memory;
An address selection unit that selects one of the plurality of input addresses as a selection address;
It is determined whether or not an address equal to the selected address is stored in a valid area of the cache memory, and a cache hit determination signal indicating a determination result and, if stored, stored. A cache hit determination unit that generates a cache hit signal indicating an area;
A cache hit data selection unit that selects data in an area indicated by the cache hit signal as cache hit data when an address equal to the selected address is stored in an effective area of the cache memory;
Memory control for reading pixel data indicated by the selected address as read data from an external memory provided outside the cache circuit when an address equal to the selected address is not stored in a valid area of the cache memory And
When an address equal to the selected address is stored in a valid area of the cache memory and data storage in the area is incomplete, a read that selects the read number of the area as the selected read number A number selector,
An address equal to the selected address is stored in a valid area of the cache memory, and when the storage of data in the area is completed, a completion bit determination unit that outputs a completion bit determination signal;
The number of read data requests to the memory control unit is counted as a request counter value. If there is a cache hit, the selected read number is selected as the determined read number. If there is no cache hit, the request counter value is determined. A lead number determining unit that selects and selects the lead number and sends the determined lead number to the cache memory;
The number of read data read from the memory control unit is counted as a read counter value. If the read counter value matches the read number, the read counter value that matches the read counter value is stored in the area. A read data selection section for sending a read data selection signal;
When the storage of the pixel data indicated by the selected address in the cache memory is completed, the cache hit data is selected as the write data, and the storage of the pixel data indicated by the selected address in the cache memory is not completed. In this case, a write data determination unit that selects the read data as write data and sends the write data to the cache memory;
A write area selection unit that generates a write enable signal that enables writing to the area of the cache memory selected by the selection signal when the write data is usable, and sends the write enable signal to the cache memory;
An output data selection unit that selects one of the two surfaces of the cache memory by an output surface switching signal complementary to the input surface switching signal and outputs data stored in the selected surface; A characteristic cache circuit.
前記出力データ選択部は、前記キャッシュメモリに格納されている複数のデータから、前記画素選択アドレスが示すデータを選択して出力する
ことを特徴とする請求項4に記載のキャッシュ回路。 The area of the cache memory stores a plurality of pixel data and a pixel selection address for selecting data stored in each area.
5. The cache circuit according to claim 4, wherein the output data selection unit selects and outputs data indicated by the pixel selection address from a plurality of data stored in the cache memory.
前記キャッシュメモリの1つの領域を選択する選択信号を生成する過程と、
前記複数の入力アドレスから1の選択アドレスを選択する過程と、
前記選択アドレスが示す画素のデータがキャッシュメモリに格納されているか否かを判定する過程と、
前記選択アドレスが示す画素のデータがキャッシュメモリに格納されているとき、前記キャッシュメモリの複数の領域に格納されているデータを受け取り、前記選択信号が選択する領域に書き込む過程と、
前記選択アドレスが示す画素のデータがキャッシュメモリに格納されていないとき、前記選択アドレスが示すデータを、当該キャッシュ回路の外部に設けられた外部メモリからリードデータとして読み出して、前記選択信号が選択する領域に書き込む過程と
を有することを特徴とするキャッシュメモリ制御方法。 A cache circuit having a cache memory in which an address and pixel data indicated by each address are stored in each of a plurality of areas, and the pixel data indicated by each of a plurality of input addresses is read from the cache memory and output. Hits the,
Generating a selection signal for selecting one area of the cache memory;
Selecting one selected address from the plurality of input addresses;
Determining whether the pixel data indicated by the selected address is stored in a cache memory;
A process of receiving data stored in a plurality of areas of the cache memory when the pixel data indicated by the selection address is stored in a cache memory, and writing to the area selected by the selection signal;
When the pixel data indicated by the selection address is not stored in the cache memory, the data indicated by the selection address is read as read data from an external memory provided outside the cache circuit, and the selection signal selects the data. A cache memory control method comprising: writing to the area.
前記キャッシュメモリの1つの領域を選択する選択信号を生成する過程と、
前記複数の入力アドレスから1の選択アドレスを選択する過程と、
前記選択アドレスと等しいアドレスが格納されているか否かを判定する過程と
を備え、
前記選択アドレスと等しいアドレスが格納されていない場合は、
リクエストカウンタ値に1を加算する過程と、
前記選択アドレスが示すデータを、当該キャッシュ回路の外部に設けられた外部メモリからリードデータとして読み出す過程と、
リードカウンタ値に1を加算する過程と、
前記選択信号が選択する領域にリードデータ及びリードカウンタ値を書き込む過程と
を行い、
前記選択アドレスと等しいアドレスが格納されている場合は、さらに、完了ビットが格納完了済みであることを示しているか否かの判定を行い、
格納完了済みであるときは、前記キャッシュメモリの前記選択アドレスと等しいアドレスが格納されているデータを受け取り、前記選択信号が選択する領域に書き込み、
格納未完了であるときは、前記キャッシュメモリの前記選択アドレスと等しいアドレスが格納されている領域のリード番号を、前記選択信号が選択する領域に書き込み、さらに、リードカウンタ値が、リード番号と一致したときに、リードデータを格納する
ことを特徴とするキャッシュメモリ制御方法。 In each of the plurality of areas, the pixel data indicated by each of the plurality of input addresses input in the cache circuit having the cache memory in which the valid bit, the address, the pixel data indicated by the address, the completion bit, and the read number are stored. Is read from the cache memory and output,
Generating a selection signal for selecting one area of the cache memory;
Selecting one selected address from the plurality of input addresses;
Determining whether an address equal to the selected address is stored,
If an address equal to the selected address is not stored,
Adding 1 to the request counter value;
Reading the data indicated by the selected address as read data from an external memory provided outside the cache circuit;
Adding 1 to the read counter value;
The process of writing the read data and the read counter value in the area selected by the selection signal,
When an address equal to the selected address is stored, it is further determined whether or not the completion bit indicates that the storage has been completed,
When the storage is completed, data in which an address equal to the selection address of the cache memory is stored is received, and written to an area selected by the selection signal;
When the storage is incomplete, the read number of the area where the address equal to the selected address of the cache memory is stored is written to the area selected by the selection signal, and the read counter value matches the read number. A cache memory control method, wherein read data is stored when the cache data is read.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008196377A JP2010033420A (en) | 2008-07-30 | 2008-07-30 | Cache circuit and cache memory control method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008196377A JP2010033420A (en) | 2008-07-30 | 2008-07-30 | Cache circuit and cache memory control method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2010033420A true JP2010033420A (en) | 2010-02-12 |
Family
ID=41737790
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008196377A Withdrawn JP2010033420A (en) | 2008-07-30 | 2008-07-30 | Cache circuit and cache memory control method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2010033420A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102521793A (en) * | 2011-12-01 | 2012-06-27 | 福州瑞芯微电子有限公司 | Storage control device and method for realizing saving of image storage space |
WO2014105552A1 (en) * | 2012-12-27 | 2014-07-03 | Intel Corporation | Optimizing image memory access |
CN105988940A (en) * | 2015-02-12 | 2016-10-05 | 晨星半导体股份有限公司 | Circuit used for accessing memory, and relevant access method |
US9599829B2 (en) | 2010-12-27 | 2017-03-21 | Dic Corporation | Birefringent lens material for stereoscopic image display device and method for producing birefringent lens for stereoscopic image display device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0315989A (en) * | 1989-06-14 | 1991-01-24 | Hitachi Ltd | Picture data transforming device |
JPH07319768A (en) * | 1994-05-24 | 1995-12-08 | Fuji Xerox Co Ltd | Cache memory device |
JP2004214892A (en) * | 2002-12-27 | 2004-07-29 | Ricoh Co Ltd | Image forming apparatus |
JP2005266997A (en) * | 2004-03-17 | 2005-09-29 | Fujitsu Ltd | Instruction cache system |
-
2008
- 2008-07-30 JP JP2008196377A patent/JP2010033420A/en not_active Withdrawn
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0315989A (en) * | 1989-06-14 | 1991-01-24 | Hitachi Ltd | Picture data transforming device |
JPH07319768A (en) * | 1994-05-24 | 1995-12-08 | Fuji Xerox Co Ltd | Cache memory device |
JP2004214892A (en) * | 2002-12-27 | 2004-07-29 | Ricoh Co Ltd | Image forming apparatus |
JP2005266997A (en) * | 2004-03-17 | 2005-09-29 | Fujitsu Ltd | Instruction cache system |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9599829B2 (en) | 2010-12-27 | 2017-03-21 | Dic Corporation | Birefringent lens material for stereoscopic image display device and method for producing birefringent lens for stereoscopic image display device |
US9927625B2 (en) | 2010-12-27 | 2018-03-27 | Dic Corporation | Birefringent lens material for stereoscopic image display device and method for producing birefringent lens for stereoscopic image display device |
CN102521793A (en) * | 2011-12-01 | 2012-06-27 | 福州瑞芯微电子有限公司 | Storage control device and method for realizing saving of image storage space |
WO2014105552A1 (en) * | 2012-12-27 | 2014-07-03 | Intel Corporation | Optimizing image memory access |
CN105988940A (en) * | 2015-02-12 | 2016-10-05 | 晨星半导体股份有限公司 | Circuit used for accessing memory, and relevant access method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7452954B2 (en) | How a memory device's internal processing works | |
JP2008217353A (en) | Data processor and lead active control method for memory | |
JP2006268801A (en) | Memory access control circuit | |
JP2003044352A (en) | Data processor | |
JPH04343151A (en) | Memory access device | |
US7082499B2 (en) | External memory control device regularly reading ahead data from external memory for storage in cache memory, and data driven type information processing apparatus including the same | |
JP2010033420A (en) | Cache circuit and cache memory control method | |
CN115729861A (en) | In-memory association processing for vectors | |
CN115729625A (en) | In-memory associative processing system | |
US8868128B2 (en) | Image display systems and methods of processing image data | |
TWI801601B (en) | Database processing system and method for offloading database operations | |
US9116799B2 (en) | Method for detecting bank collision at a memory and device therefor | |
JP2006293538A (en) | Calculation system | |
TW202044247A (en) | Memory system and method for operating a memory system | |
JP2007200090A (en) | Semiconductor processor | |
JP5888177B2 (en) | Arithmetic processing device and control method of arithmetic processing device | |
JP2021506053A (en) | Data movement operation in non-volatile memory | |
US20080126756A1 (en) | Data processing apparatus and data processing method | |
US20240143277A1 (en) | Artificial intelligence accelerators | |
WO2024124807A1 (en) | Ai chip, tensor processing method, and electronic device | |
JP2010140306A (en) | Control system for boundary execution, control method for boundary execution, and control program for boundary execution | |
JP6316143B2 (en) | Semiconductor device, memory access control method, and semiconductor device system | |
JPH0553920A (en) | Structural address generator | |
JP5559932B2 (en) | Semiconductor device | |
JP2013161325A (en) | Simd (single instruction-stream multiple data-stream) type microprocessor, processor system and data processing method for simd type microprocessor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110624 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20130118 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20130122 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130325 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20130423 |
|
A761 | Written withdrawal of application |
Free format text: JAPANESE INTERMEDIATE CODE: A761 Effective date: 20130626 |