JP2010033420A - Cache circuit and cache memory control method - Google Patents

Cache circuit and cache memory control method Download PDF

Info

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
Application number
JP2008196377A
Other languages
Japanese (ja)
Inventor
Masahiko Hayano
昌彦 早野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lapis Semiconductor Co Ltd
Original Assignee
Oki Semiconductor Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oki Semiconductor Co Ltd filed Critical Oki Semiconductor Co Ltd
Priority to JP2008196377A priority Critical patent/JP2010033420A/en
Publication of JP2010033420A publication Critical patent/JP2010033420A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Image Input (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Storing Facsimile Image Data (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To reduce an access frequency to an external memory to reduce a processing time, when reading image data. <P>SOLUTION: In this cache circuit, one area of a cache memory is selected. One selection address is selected from a plurality of input addresses. It is decided whether data on a pixel shown by the selection address are stored in the cache memory or not. When the data on the pixel shown by the selection address are stored in the cache memory, data stored in a plurality of areas of the cache memory are received, and are written into the area selected by a selection signal. When the data on the pixel shown by the selection address are not stored in the cache memory, the data shown by the selection address are read from the external memory provided outside the cache circuit as read data, and are written into the area selected by the selection signal. <P>COPYRIGHT: (C)2010,JPO&INPIT

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 address calculation unit 10, an external memory 20, an image data processing unit 30, and a cache circuit 100.

この画像データ処理回路は、ソース画像に回転等の画像処理を行って、画像処理後のデスティネーション画像を描画させる処理に用いられる。例えば、ソース画像を回転させる場合は、デスティネーション画像の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 input addresses 1 to 4 necessary for generating data indicated by the destination address. The input addresses 1 to 4 are sent to the cache circuit 100.

キャッシュ回路100は、入力アドレス1〜4が示す画素のデータを、内部のキャッシュメモリ又は外部メモリ20から読み込む。キャッシュ回路100は、読み出したデータ(出力データ1〜4)を、画像データ処理手段30に送る。   The cache circuit 100 reads pixel data indicated by the input addresses 1 to 4 from the internal cache memory or the external memory 20. The cache circuit 100 sends the read data (output data 1 to 4) to the image data processing means 30.

なお、外部メモリからのデータの読み込みにあたっては、複数の画素のデータを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を用いて、デスティネーションアドレスが示す画素のデータを計算し、処理済データとして描画手段(図示を省略する。)に送る。
特開平5−53909号公報
The image data processing means 30 calculates the pixel data indicated by the destination address using the output data 1 to 4 and sends it to the drawing means (not shown) as processed data.
Japanese Patent Laid-Open No. 5-53909

しかしながら、図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 input addresses 1 to 4. Here, when the external memory 20 is configured by using a FlashROM, SDRAM, or the like, the FlashROM and SDRAM require a longer time to read data than the cache memory that the cache circuit 100 has.

そこで、この出願に係る発明者が鋭意研究を行ったところ、一度、外部メモリから読み込んだのと同じアドレスのデータを再度用いる場合には、外部メモリにアクセスすることなく、キャッシュメモリに格納されたデータを参照する動作を効率的に行うことで、外部メモリへのアクセス回数を削減することができ、処理時間を短縮することができることを見出した。   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 cache circuit 100 can be used in the conventional image data processing circuit described with reference to FIG. 1, and will be described with reference to FIG. In the following description, an example in which an address for four pixels (input addresses 1 to 4) of a source image is input to the cache circuit 100 and data for four pixels (output data 1 to 4) is output from the cache circuit 100 will be described. As will be described, the number of input addresses and output data can be set according to the image processing method.

キャッシュ回路100は、キャッシュメモリ300、リード制御部120、アドレス選択部130、キャッシュヒット判定部140、キャッシュヒットデータ選択部150、メモリ制御部160、ライトデータ判定部170、ライト領域選択部180及び出力データ選択部190を備えて構成される。   The cache circuit 100 includes a cache memory 300, a read control unit 120, an address selection unit 130, a cache hit determination unit 140, a cache hit data selection unit 150, a memory control unit 160, a write data determination unit 170, a write area selection unit 180, and an output. A data selection unit 190 is provided.

キャッシュ回路100に入力された入力アドレス1〜4は、キャッシュメモリ300及びアドレス選択部130に送られる。   Input addresses 1 to 4 input to the cache circuit 100 are sent to the cache memory 300 and the address selector 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 cache memory 300 includes input addresses 1 to 4 input to the cache circuit 100, selection signals 1 to 4 generated by the read control unit 120, write enable signals 1 to 4 generated by the write area selection unit 180, and The write data selected by the write data determination unit 170 is input. Further, from the cache memory 300, the valid bits 1 to 4 and the upper addresses 1 to 4 are sent to the cache hit determination unit 140, and the lower addresses 1 to 4 are sent to the output data selection unit 190. 4 is sent to the cache hit data selection unit 150 and the output data selection unit 190.

図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 cache memory 300 has a plurality of areas. The number of areas that the cache memory 300 has is at least the same as the number of input addresses. Here, the area that the cache memory 300 has is four. Each area of the cache memory 300 is provided with a valid bit column 330, a high-order address column 332, a low-order address column 334, and a cache data column 336, each storing a valid bit, a high-order address, a low-order address, and cache data. 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 fourth areas 311 to 314 are distinguished from each other, and valid bits 1 to 4, addresses 1 to 4 and cache data 1 to 4 are distinguished. 4 may also be expressed.

ここで有効ビットは、その有効ビットが格納されている領域が有効であるか否か、すなわち、当該領域のキャッシュデータ欄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 cache data column 336 of the area. Here, when the area is valid, the valid bit is “1”, and when the area is invalid, the valid bit is “0”.

上位アドレス及び下位アドレスは、ソース画像の画素のアドレスを示している。なお、キャッシュメモリ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 cache memory 300 with a plurality of consecutive pixels as one unit (block). In this case, the upper address indicates the position (address) of each block, and the lower address indicates the position of the pixel in each block.

入力アドレス1〜4の中で、ブロックの位置を示す上位アドレスがキャッシュメモリ300の上位アドレス欄332に送られる。また、ブロック内の位置を示す下位アドレスがキャッシュメモリ300の下位アドレス欄334に送られる。   Among the input addresses 1 to 4, the upper address indicating the block position is sent to the upper address column 332 of the cache memory 300. Further, the lower address indicating the position in the block is sent to the lower address column 334 of the cache memory 300.

選択信号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 upper address column 332 and the lower address column 334 provided in each area of the cache memory 300, respectively. When the selection signals 1 to 4 are “1”, the upper address and the lower address of the input addresses 1 to 4 are stored in the upper address column 332 and the lower address column 334 of the cache memory 300, respectively.

ライトデータは、キャッシュメモリ300の各領域311〜314のキャッシュデータ欄336に送られる。また、ライトイネーブル信号が、キャッシュメモリ300のキャッシュデータ欄336のライトイネーブル端子(we)に入力される。ライトイネーブル信号1〜4が“1”であるとき、キャッシュメモリ300のキャッシュデータ欄336にライトデータが格納される。   The write data is sent to the cache data column 336 of each area 311 to 314 of the cache memory 300. Further, the write enable signal is input to the write enable terminal (we) of the cache data column 336 of the cache memory 300. When the write enable signals 1 to 4 are “1”, the write data is stored in the cache data column 336 of the cache memory 300.

また、ライトイネーブル信号1〜4は、各領域311〜314の有効ビット欄330にそれぞれ送られる。有効ビット1〜4が“0”であるとき、ライトイネーブル信号1〜4が“1”になると、有効ビット1〜4が“1”になる。なお、初期状態では、有効ビットは全て“0”であるが、一度、有効ビットが“1”になると、そのビットについては、再度初期化が行われるまで、“1”が維持される。   The write enable signals 1 to 4 are sent to the effective bit column 330 of each area 311 to 314, respectively. When the valid bits 1 to 4 are “0” and the write enable signals 1 to 4 are “1”, the valid bits 1 to 4 are “1”. In the initial state, all the valid bits are “0”. However, once the valid bit becomes “1”, “1” is maintained until the bit is initialized again.

リード制御部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 read control unit 120 generates selection signals 1 to 4 for selecting one of the first to fourth areas 311 to 314 of the cache memory 300. Here, only one of the selection signals 1 to 4 is “1”, and the others are “0”. The first to fourth regions 311 to 314 are sequentially selected by the selection signals 1 to 4. The selection signals 1 to 4 are sent to the cache memory 300, the address selection unit 130, and the write area selection unit 180.

アドレス選択部130は、選択信号1〜4を用いて、入力アドレス1〜4の中から、1のアドレスを選択アドレスとして選択する。例えば、選択信号1が、“1”であり、選択信号2〜4が“0”であるとき、入力アドレス1が選択アドレスとして選択される。   The address selection unit 130 uses the selection signals 1 to 4 to select one address as the selection address from the input addresses 1 to 4. For example, when the selection signal 1 is “1” and the selection signals 2 to 4 are “0”, the input address 1 is selected as the selection address.

図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 address selection unit 130 of this configuration example may be configured to include first to fourth AND operation units 132-1 to 13-4 and an OR operation unit 134. In this configuration, logical products (AND) 1 to 4 of the input addresses 1 to 4 and the selection signals 1 to 4 calculated by the first to fourth AND operation units 132-1 to 13-4 are respectively OR operation units. And the logical sum (OR) is calculated.

選択信号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 ANDs 1 to 4 indicates an input address, and “0” otherwise. Accordingly, the logical sum of AND1 to AND4 becomes a selection address indicating any one of the input addresses 1 to 4. The selected address is sent to the cache hit determination unit 140 and the memory control unit 160.

キャッシュヒット判定部140は、選択アドレスが示す画素のデータがキャッシュメモリ300に格納されているか否かを判定し、判定結果を示すキャッシュヒット判定信号と、選択アドレスが示す画素のデータが格納されている領域を示すキャッシュヒット信号を生成する。   The cache hit determination unit 140 determines whether or not the pixel data indicated by the selected address is stored in the cache memory 300, and the cache hit determination signal indicating the determination result and the pixel data indicated by the selected address are stored. A cache hit signal indicating the area that is present is generated.

図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 determination unit 140 includes first to fourth comparison operation units 142-1 to 142-1, first to fourth AND operation units 144-1 to 144-1, and an OR operation unit 146. The first to fourth comparison operation units 142-1 to 14-4 compare the upper address of the selected address with the upper addresses 1 to 4 stored in the upper address column 332 of the cache memory 300, respectively. As a result of the comparison, if they match, the comparison results 1 to 4 that are the outputs of the first to fourth comparison operation units 142-1 to 14-4 are "1", and if they do not match, the comparison results 1 to 4 Becomes “0”.

第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とする。   Comparison results 1 to 4 and valid bits 1 to 4 stored in the valid bit column 330 of the cache memory 300 are input to the first to fourth AND operation units 144-1 to 144-4, respectively. The first to fourth AND operation units 144-1 to 144-4 perform logical product (AND) operations on the valid bits 1 to 4 and the comparison results 1 to 4, respectively, and set the results as cache hit signals 1 to 4. .

キャッシュヒット信号1〜4は、データが有効であり、かつ、選択アドレスの上位アドレスとキャッシュメモリ300の上位アドレス欄332に格納されている上位アドレスとが一致している場合に“1”となる。例えば、有効ビット3が“1”であり、比較結果3が“1”である場合、キャッシュヒット信号3が“1”となる。すなわち、キャッシュヒット信号1〜4は、選択アドレスの上位アドレスと等しい上位アドレスが格納されている、キャッシュメモリ300の領域を示す。キャッシュヒット信号1〜4は、キャッシュヒットデータ選択部150に送られる。   The cache hit signals 1 to 4 are “1” when the data is valid and the upper address of the selected address matches the upper address stored in the upper address column 332 of the cache memory 300. . For example, when the valid bit 3 is “1” and the comparison result 3 is “1”, the cache hit signal 3 is “1”. That is, the cache hit signals 1 to 4 indicate an area of the cache memory 300 in which an upper address equal to the upper address of the selected address is stored. The cache hit signals 1 to 4 are sent to the cache hit data selection unit 150.

また、キャッシュヒット信号1〜4は、OR演算部146にも送られる。OR演算部146は、キャッシュヒット信号1〜4について、論理和(OR)演算を行う。論理和演算の結果であるキャッシュヒット判定信号は、選択アドレスと等しいアドレスのデータが、キャッシュメモリ300内に格納されている場合は“1”となり、それ以外の場合は“0”となる。このキャッシュヒット判定信号は、メモリ制御部160及びライトデータ判定部170に送られる。   The cache hit signals 1 to 4 are also sent to the OR operation unit 146. The OR operation unit 146 performs a logical sum (OR) operation on the cache hit signals 1 to 4. The cache hit determination signal, which is the result of the logical sum operation, is “1” when data at an address equal to the selected address is stored in the cache memory 300, and “0” otherwise. The cache hit determination signal is sent to the memory control unit 160 and the write data determination unit 170.

キャッシュヒットデータ選択部150は、選択アドレスが示す画素のデータがキャッシュメモリ300に格納されているとき、キャッシュヒット信号1〜4が示す領域のキャッシュデータをキャッシュヒットデータとして選択する。   When the pixel data indicated by the selected address is stored in the cache memory 300, the cache hit data selection unit 150 selects the cache data in the area indicated by the cache hit signals 1 to 4 as the cache hit data.

図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 data selection unit 150 of this configuration example includes first to fourth AND operation units 152-1 to 152-1 to OR operation unit 154. In this configuration, the logical products (AND) 1 to 4 of the cache data 1 to 4 and the cache hit signals 1 to 4 calculated by the first to fourth AND operation units 152-1 to 15-4 are respectively calculated. The OR operation unit 154 calculates a logical sum (OR) for each of a plurality of bits of data output from the AND operation units 152-1 to 152-1-4.

キャッシュヒット信号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 cache data 1 to 4. For example, when the cache hit signal 3 is “1”, the cache data 3 is selected as the cache hit data. The cache hit data is sent to the write data determination unit 170.

メモリ制御部160は、キャッシュ回路100の外部に設けられた外部メモリ20に対して、この外部メモリ20内に格納されているデータを読み出す機能を有している。   The memory control unit 160 has a function of reading data stored in the external memory 20 with respect to the external memory 20 provided outside the cache circuit 100.

メモリ制御部160には、アドレス選択部130で選択された選択アドレスが入力されるともに、キャッシュヒット判定部140で生成されたキャッシュヒット判定信号が反転入力される。メモリ制御部160は、キャッシュヒット判定信号が“0”の場合、すなわち、キャッシュメモリ300に選択アドレスに対応するデータがキャッシュメモリ300に格納されていないとき、外部メモリ20から選択アドレスが示す画素のデータを読み込む。一方、キャッシュヒット判定信号が“1”の場合は、外部メモリ20からの読み込みは行わない。   The memory control unit 160 receives the selection address selected by the address selection unit 130 and the cache hit determination signal generated by the cache hit determination unit 140 by being inverted. When the cache hit determination signal is “0”, that is, when the data corresponding to the selected address is not stored in the cache memory 300, the memory control unit 160 stores the pixel indicated by the selected address from the external memory 20. Read data. On the other hand, when the cache hit determination signal is “1”, reading from the external memory 20 is not performed.

メモリ制御部160は、外部メモリ20から読み込んだデータをリードデータとしてライトデータ判定部170に送る。また、リードデータが使用可能であることを示すリードデータイネーブル信号もライトデータ判定部170に送る。ここでは、リードデータが使用可能であるとき、リードデータイネーブル信号を“1”とし、リードデータが使用不可能であるとき、リードデータイネーブル信号を“0”とする。   The memory control unit 160 sends the data read from the external memory 20 to the write data determination unit 170 as read data. In addition, a read data enable signal indicating that the read data is usable is also sent to the write data determination unit 170. Here, the read data enable signal is set to “1” when the read data is usable, and the read data enable signal is set to “0” when the read data is not usable.

ライトデータ判定部170は、選択アドレスが示す画素のデータがキャッシュメモリ300に格納されているとき、キャッシュヒットデータをライトデータとして選択し、選択アドレスが示す画素のデータがキャッシュメモリ300に格納されていないとき、リードデータをライトデータとして選択する。ライトデータ判定部170は、ライトデータをキャッシュメモリ300に送るとともに、ライトデータが使用可能であることを示すライトデータ判定信号を生成して、ライト領域選択部180に送る。   When the pixel data indicated by the selected address is stored in the cache memory 300, the write data determination unit 170 selects the cache hit data as write data, and the pixel data indicated by the selected address is stored in the cache memory 300. If not, read data is selected as write data. The write data determination unit 170 sends the write data to the cache memory 300, generates a write data determination signal indicating that the write data can be used, and sends the write data determination signal to the write area selection unit 180.

図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 data determination unit 170 includes a selection calculation unit 172 and an OR calculation unit 174. The selection calculation unit 172 receives cache hit data and read data. The selection calculation unit 172 receives a cache hit determination signal as a control signal. The selection calculator 172 selects and outputs either cache hit data or read data according to the value of the cache hit determination signal.

この構成では、キャッシュヒット判定信号が“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 selection calculation unit 172 selects the cache hit data as write data. . On the other hand, when the cache hit determination signal is “0”, that is, when the pixel data indicated by the selected address is not stored in the cache memory, the selection calculation unit 172 selects the read data as the write data.

またOR演算部174には、キャッシュヒット判定信号とリードデータイネーブル信号が入力される。OR演算部174は、キャッシュヒット判定信号とリードデータイネーブル信号の論理積(OR)をライトデータ判定信号としてライト領域選択部180に送る。ライトデータ判定信号は、ライトデータが使用可能である場合、すなわち、キャッシュメモリに選択アドレスに対応するデータがあるか、もしくは、リードデータの読み込みが完了した場合は、“1”を示し、それ以外の場合は“0”となる。   The OR operation unit 174 receives a cache hit determination signal and a read data enable signal. The OR operation unit 174 sends the logical product (OR) of the cache hit determination signal and the read data enable signal to the write area selection unit 180 as a write data determination signal. The write data determination signal indicates “1” when the write data is usable, that is, when there is data corresponding to the selected address in the cache memory or when the read data has been read, otherwise In this case, it is “0”.

ライト領域選択部180は、ライトデータが使用可能である場合に、選択信号が選択するキャッシュメモリ300の領域を書き込み可能とするライトイネーブル信号を生成して、キャッシュメモリ300に送る。また、ライトイネーブル信号を生成するたびに、ライト完了信号をリード制御部120に送る。   When the write data is usable, the write area selection unit 180 generates a write enable signal that enables writing in the area of the cache memory 300 selected by the selection signal, and sends the write enable signal to the cache memory 300. Each time a write enable signal is generated, a write completion signal is sent to the read control unit 120.

図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 area selection unit 180 includes first to fourth AND calculation units 182-1 to 182-1 to OR calculation unit 184. Selection signals 1 to 4 and a write data determination signal are input to the first to fourth AND operation units 182-1 to 182-1, respectively. The first to fourth AND operation units 182-1 to 182-1 perform logical product (AND) operations of the selection signals 1 to 4 and the write data determination signal, respectively.

論理積演算の結果であるライトイネーブル信号1〜4は、ライトデータが書き込み可能である領域を示す。例えば、選択信号1が“1”であり、ライトデータ判定信号が“1”である場合、ライトイネーブル信号1が“1”となる。この場合、キャッシュメモリ300の第1の領域311が、書込み可能になる。ライトイネーブル信号1〜4は、キャッシュメモリ300に送られる。   Write enable signals 1 to 4 that are the result of the logical product operation indicate areas in which write data can be written. For example, when the selection signal 1 is “1” and the write data determination signal is “1”, the write enable signal 1 is “1”. In this case, the first area 311 of the cache memory 300 becomes writable. The write enable signals 1 to 4 are sent to the cache memory 300.

また、ライトイネーブル信号1〜4は、OR演算部184に送られる。OR演算部184は、ライトイネーブル信号1〜4の論理和(OR)をライト完了信号として生成する。すなわち、ライト完了信号は、ライトイネーブル信号が生成されるたびに “1”となり、それ以外の場合は“0”となる。このライト完了信号は、リード制御部120に送られる。   The write enable signals 1 to 4 are sent to the OR operation unit 184. The OR operation unit 184 generates a logical sum (OR) of the write enable signals 1 to 4 as a write completion signal. That is, the write completion signal becomes “1” every time the write enable signal is generated, and becomes “0” otherwise. This write completion signal is sent to the read control unit 120.

リード制御部120は、ライト完了信号が“1”になるたびに、選択する領域を変更した選択信号を生成する。例えば、選択信号1が“1”であり、選択信号2〜4が“0”であった場合、ライト完了信号が“1”になると、選択信号1が“0”となり、選択信号2が“1”となる。この後、ライトイネーブル信号2が“1”となると、選択信号2が“0”となり、選択信号3が“1”となる。最終的に、ライトイネーブル信号4が“1”となり、全てのデータが格納されると、出力データ準備完了フラグを“1”とする。なお、出力データ準備完了フラグは、RAMなどのキャッシュ回路100内の任意好適な記憶手段に読み出し及び書き換え自在に格納されている。   The read control unit 120 generates a selection signal in which the region to be selected is changed every time the write completion signal becomes “1”. For example, if the selection signal 1 is “1” and the selection signals 2 to 4 are “0”, the selection signal 1 becomes “0” and the selection signal 2 becomes “0” when the write completion signal becomes “1”. 1 ". Thereafter, when the write enable signal 2 becomes “1”, the selection signal 2 becomes “0” and the selection signal 3 becomes “1”. Finally, when the write enable signal 4 becomes “1” and all data is stored, the output data preparation completion flag is set to “1”. The output data preparation completion flag is stored in any suitable storage means in the cache circuit 100 such as a RAM so that it can be read and rewritten.

出力データ選択部190は、出力データ準備完了フラグが“1”になると、キャッシュメモリ300に格納されているキャッシュデータを出力データとして出力し、画像データ処理手段30に送る。   When the output data preparation completion flag becomes “1”, the output data selection unit 190 outputs the cache data stored in the cache memory 300 as output data and sends it to the image data processing means 30.

図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 data selection unit 190 includes first to fourth selection calculation units 192-1 to 194-2. The cache data 1 to 4 are sent to the first to fourth selection arithmetic units 192-1 to 192-1, respectively. In addition, lower addresses 1 to 4 are input to these first to fourth selection calculation units 192-1 to 192-1 as control signals. The first to fourth selection calculators 192-1 to 19-4 select and output the data at the positions indicated by the lower addresses 1 to 4 as the output data from the cache data 1 to 4, respectively. After the output of the output data 1 to 4 is completed, the output data preparation completion flag becomes “0”. At this time, an address request is sent to the address calculation means 10 in the preceding stage.

なお、上述したキャッシュ回路100の各構成要素は、例えば、中央処理装置(CPU:Central Processing Unit)が所定のプログラムを実行することにより、各機能手段として実現される。   Each component of the cache circuit 100 described above is realized as each functional unit by, for example, a central processing unit (CPU: Central Processing Unit) executing a predetermined program.

(第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 cache memory 300 are “0” (FIG. 11A).

入力アドレス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 selection signal 1 is “1”, the first area is write enabled, the upper address 1 is the pixel 1-1 address (sometimes referred to as the source address 1-1), and the lower address is the first address. An address (0) indicating a pixel is written. The address selection unit 120 selects the source address 1-1 as the selection address.

ここでは有効ビット1〜4が全て0であるため、キャッシュヒット信号1〜4は全て“0”となり、キャッシュヒット判定信号も“0”となる。この結果、メモリ制御部160がソースアドレス1−1及び1−2のデータ(d1−1及びd1−2)をリードデータとして読出し、第1の領域に書き込む。このとき、有効ビット1は“1”となる(図11(B))。   Here, since the valid bits 1 to 4 are all 0, the cache hit signals 1 to 4 are all “0”, and the cache hit determination signal is also “0”. As a result, the memory control unit 160 reads the data (d1-1 and d1-2) of the source addresses 1-1 and 1-2 as read data and writes it in the first area. At this time, the effective bit 1 becomes “1” (FIG. 11B).

次に、選択信号2が“1”となると、キャッシュメモリ300の第2の領域312がライトイネーブルとなり、上位アドレス2に、ソースアドレス2−1と、下位アドレス2に1番目の画素であることを示すアドレス(0)が書き込まれる。また、アドレス選択部120ではソースアドレス2−1が選択アドレスとして選択される。   Next, when the selection signal 2 becomes “1”, the second area 312 of the cache memory 300 is write-enabled, and the upper address 2 is the source address 2-1 and the lower address 2 is the first pixel. The address (0) indicating is written. The address selection unit 120 selects the source address 2-1 as the selection address.

ここでは有効ビット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, valid bit 1 is 1, and valid bits 2 to 4 are 0. Since the upper address of the selected address is different from the upper address 1 read from the cache memory 300, the cache hit signals 1 to 4 are all “0” and the cache hit determination signal is also “0”. As a result, the memory control unit 160 reads the data (d2-1 and d2-2) of the source addresses 2-1 and 2-2 as read data and writes it in the second area 312. At this time, the effective bit 2 becomes “1” (FIG. 11C).

次に、選択信号3が“1”となると、キャッシュメモリ300の第3の領域313がライトイネーブルとなり、上位アドレス3に、ソースアドレス1−1と、下位アドレスに2番目の画素であることを示すアドレス(1)が書き込まれる。また、アドレス選択部120ではソースアドレス1−1が選択アドレスとして選択される。   Next, when the selection signal 3 becomes “1”, the third area 313 of the cache memory 300 is write-enabled, indicating that the upper address 3 is the source address 1-1 and the lower address is the second pixel. The indicated address (1) is written. The address selection unit 120 selects the source address 1-1 as the selection address.

ここでは有効ビット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 valid bit 1 and the valid bit 2 are 1, and the valid bit 3 and the valid bit 4 are 0. Since both the selected address and the higher address 1 become the source address 1-1 and coincide with each other, the cache hit signal 1 becomes “1” and the cache hit determination signal also becomes “1”. As a result, the cache hit data selection unit 150 selects the data 1 (d1-1 and d1-2) as the cache hit data and sends it to the write data determination unit 170. The write data determination unit 170 sends the cache hit data to the cache memory 300, and the cache hit data is written in the third area (FIG. 11D).

次に、選択信号4が“1”となると、キャッシュメモリ300の第4の領域314がライトイネーブルとなり、上位アドレス3に、ソースアドレス2−1と、下位アドレスに2番目の画素であることを示すアドレス(1)が書き込まれる。また、アドレス選択部ではソースアドレス2−1が選択アドレスとして選択される。   Next, when the selection signal 4 becomes “1”, the fourth area 314 of the cache memory 300 is write-enabled, indicating that the upper address 3 is the source address 2-1 and the lower address is the second pixel. The indicated address (1) is written. In the address selection unit, the source address 2-1 is selected as the selection address.

このとき、有効ビット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 valid bits 1 to 3 are 1 and the valid bit 4 is 0. Since both the selected address and the upper address 2 become the source address 2-1 and match, the cache hit signal 2 becomes “1” and the cache hit determination signal also becomes “1”. As a result, the cache hit data selection unit 150 selects the data 2 (d2-1 and d2-2) as the cache hit data and sends it to the write data determination unit 170. The write data determination unit 170 sends the cache hit data to the cache memory 300, and the cache hit data is written in the fourth area (FIG. 11E).

第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 lower address 1 is 0, the cache data d1-1 is selected as the output data 1, and since the lower address 2 is 0, the cache data d2-1 is selected as the output data 2. Since the address 2 is 1, the cache data d1-2 is selected as the output data 3, and since the lower address 4 is 1, the cache data d2-2 is selected as the output data 4. When these output data 1 to 4 are output, the next address request is sent to the address calculation means.

アドレスリクエストを受けた、アドレス計算手段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 lower address 1 is 1, d1-2 of cache data 1 is selected as output data 1, and since lower address 2 is 1, d2-2 of cache data 2 is selected as output data 2. Since the lower address 3 is 0, the cache data d1-3 is selected as the output data 3, and since the lower address 4 is 0, the cache data d2-3 is selected as the output data 4. When these output data 1 to 4 are output, the next address request is sent to the address calculation means.

アドレスリクエストを受けた、アドレス計算手段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 lower address 1 is 0, d2-3 of cache data 1 is selected as output data 1, and since lower address 2 is 0, d3-3 of cache data 2 is selected as output data 2. Since the lower address 3 is 1, d2-4 of the cache data 3 is selected as the output data 3, and since the lower address 4 is 0, d3-4 of the cache data 4 is selected as the output data 4. The When these output data 1 to 4 are output, the next address request is sent to the address calculation means.

上述したように、この第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 Patent Document 1, so that the speed is increased and the capacity of the cache memory is increased. There is also an effect that can be suppressed.

(第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 cache circuit 101 includes a cache memory 301, a read control unit 120, an address selection unit 130, a cache hit determination unit 140, a cache hit data selection unit 150, a memory control unit 160, a write data determination unit 171, a write area selection unit 181, and an output. A data selection unit 190, a completion bit determination unit 200, a lead number selection unit 210, a lead number determination unit 220, and a read data selection unit 230 are configured.

キャッシュ回路101に入力された入力アドレス1〜4は、キャッシュメモリ301及びアドレス選択部130に送られる。   Input addresses 1 to 4 input to the cache circuit 101 are sent to the cache memory 301 and the address selector 130.

キャッシュメモリ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 cache memory 301 includes input addresses 1 to 4 input to the cache circuit 101, selection signals 1 to 4 generated by the read control unit 120, write enable signals 1 to 4 generated by the write area selection unit 181, write The write data selected by the data determination unit 171 and the determined read number generated by the read number determination unit 220 are input. Further, the valid bits 1 to 4 and the upper addresses 1 to 4 are sent from the cache memory 301 to the cache hit determination unit 140, and the lower addresses 1 to 4 are sent to the output data selection unit 190. Further, the cache data 1 to 4 are sent to the cache hit data selection unit 150 and the output data selection unit 190. The completion bits 1 to 4 are sent to the completion bit determination unit 200 and the read number selection unit 210. The lead numbers 1 to 4 are sent to the lead number selection unit 210 and the read data selection unit 230.

図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 cache memory 301 has a plurality of areas. The number of areas that the cache memory 301 has is at least the same as the number of input addresses. Here, the area that the cache memory 301 has is four. Each area of the cache memory 301 is provided with a valid bit field 330, a high-order address field 332, a low-order address field 334, a cache data field 336, a completion bit field 338, and a read number field 340. Address, lower address, cache data, completion bit and read number are stored.

以下の説明では、第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 fourth areas 321 to 324 are distinguished from each other. -4, lower addresses 1 to 4, cache data 1 to 4, completion bits 1 to 4, and read numbers 1 to 4.

ここで有効ビットは、その有効ビットが格納されている領域が有効であることを示す。当該領域が有効であるとき、有効ビットは“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 upper address column 332 of the cache memory 301, and the lower address is sent to the lower address column 334 of the cache memory 301.

また、選択信号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 upper address column 332 and the lower address column 334 of the cache memory 301. When the selection signals 1 to 4 are “1”, the upper address and lower address of the input addresses 1 to 4 are written in the upper address column 332 and the lower address column 334 of the cache memory 301, respectively.

ライトデータは、キャッシュメモリ301の各領域321〜324のキャッシュデータ欄336に送られる。また、ライトイネーブル信号が、キャッシュメモリ301のキャッシュデータ欄336のライトイネーブル端子(we)に入力される。ライトイネーブル信号1〜4が“1”であるとき、キャッシュメモリ301のキャッシュデータ欄336にライトデータが書き込まれる。   The write data is sent to the cache data column 336 in each of the areas 321 to 324 of the cache memory 301. The write enable signal is input to the write enable terminal (we) of the cache data column 336 of the cache memory 301. When the write enable signals 1 to 4 are “1”, the write data is written in the cache data column 336 of the cache memory 301.

また、ライトイネーブル信号1〜4は、完了ビット欄338にそれぞれ送られる。有効ビット1〜4が“0”であるとき、ライトイネーブル信号1〜4が“1”になると、有効ビット1〜4が“1”になる。なお、初期状態では、完了ビット欄338は全て“0”であるが、一度、完了ビットが“1”になると、そのビットについては、再度初期化が行われるまで、“1”を維持する。   The write enable signals 1 to 4 are sent to the completion bit column 338, respectively. When the valid bits 1 to 4 are “0” and the write enable signals 1 to 4 are “1”, the valid bits 1 to 4 are “1”. In the initial state, the completion bit column 338 is all “0”, but once the completion bit becomes “1”, that bit is maintained at “1” until initialization is performed again.

リード制御部120、アドレス選択部130、キャッシュヒットデータ選択部150及びメモリ制御部160の構成は、第1実施形態と同様なので説明を省略することもある。
なお、リード制御部120は、一定の時間Δtslが経過した後、選択する領域を変更した選択信号を生成する。例えば、選択信号1が“1”であり、選択信号2〜4が“0”であった場合、時間Δtslが経過すると、選択信号1が“0”となり、選択信号2が“1”となる。
Since the configurations of the read control unit 120, the address selection unit 130, the cache hit data selection unit 150, and the memory control unit 160 are the same as those in the first embodiment, description thereof may be omitted.
Note that the read control unit 120 generates a selection signal in which the region to be selected is changed after a certain time Δtsl has elapsed. For example, if the selection signal 1 is “1” and the selection signals 2 to 4 are “0”, the selection signal 1 becomes “0” and the selection signal 2 becomes “1” when the time Δtsl elapses. .

キャッシュヒット判定部140は、図6を参照して説明した第1実施形態と同様に構成することができる。なお、第2実施形態では、キャッシュヒット判定部140で生成されたキャッシュヒット信号は、キャッシュヒットデータ選択部150だけでなく、完了ビット判定部200及びリード番号選択部210に送られる。   The cache hit determination unit 140 can be configured similarly to the first embodiment described with reference to FIG. In the second embodiment, the cache hit signal generated by the cache hit determination unit 140 is sent not only to the cache hit data selection unit 150 but also to the completion bit determination unit 200 and the read number selection unit 210.

キャッシュヒットデータ選択部150は、選択アドレスが示す画素のデータがキャッシュメモリ301に格納されているとき、キャッシュメモリ301の各領域321〜324に格納されているキャッシュデータを受け取り、キャッシュヒット信号1〜4が示す領域のデータをキャッシュヒットデータとして選択する。   When the pixel data indicated by the selected address is stored in the cache memory 301, the cache hit data selection unit 150 receives the cache data stored in each of the areas 321 to 324 of the cache memory 301, and receives the cache hit signals 1 to The data in the area indicated by 4 is selected as cache hit data.

図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 bit determination unit 200 of this configuration example includes first to fourth AND operation units 202-1 to 20-4 and an OR operation unit 204. In this configuration, logical products (AND) 1 to 4 of the completion bits 1 to 4 and the cache hit signals 1 to 4 calculated by the first to fourth AND operation units 202-1 to 20-4 are respectively ORed. The unit 204 performs a logical sum (OR) operation.

キャッシュヒット信号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 data determination unit 171 and the write area selection unit 181.

ライトデータ判定部171は、選択アドレスが示す画素のデータがキャッシュメモリ301に格納されているとき、キャッシュヒットデータをライトデータとして選択し、選択アドレスが示す画素のデータがキャッシュメモリ301に格納されていないとき、リードデータをライトデータとして選択する。ライトデータ判定部171は、ライトデータをキャッシュメモリ301に送る。   When the pixel data indicated by the selected address is stored in the cache memory 301, the write data determination unit 171 selects the cache hit data as write data, and the pixel data indicated by the selected address is stored in the cache memory 301. If not, read data is selected as write data. The write data determination unit 171 sends the write data to the cache memory 301.

ライトデータ判定部171は、選択演算部173を備えている。選択演算部173には、キャッシュヒットデータとリードデータが入力される。選択演算部173には、制御信号として完了ビット判定信号が入力される。選択演算部173は、完了ビット判定信号の値に応じて、キャッシュヒットデータとリードデータのいずれか一方を選択して出力する。   The write data determination unit 171 includes a selection calculation unit 173. The selection calculation unit 173 receives cache hit data and read data. The selection calculation unit 173 receives a completion bit determination signal as a control signal. The selection calculator 173 selects and outputs either cache hit data or read data according to the value of the completion bit determination signal.

この構成では、完了ビット判定信号が“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 selection calculation unit 173 selects the cache hit data as write data. On the other hand, when the completion bit determination signal is “0”, that is, when there is no data corresponding to the selected address in the cache memory, the selection calculation unit 173 selects read data as write data.

リード番号選択部210は、格納が未完了であり、キャッシュヒットしている場合、当該領域のリード番号を選択リード番号として選択する。   When the storage has not been completed and the cache hit has occurred, the read number selection unit 210 selects the read number of the area as the selected read number.

図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 number selection unit 210 includes first to fourth first-stage AND operation units 212-1 to 212-4, first to fourth second-stage AND operation units 214-1 to 214-4, and an OR operation unit 216. It is.

第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 inverted signals 1 to 4 obtained by logically inverting the completion bits 1 to 4, respectively. Do. The first to fourth second-stage AND operation units 214-1 to 214-4 perform the logical product operation in the first to fourth first-stage AND operation units 212-1 to 212-4 and the logic of the lead numbers 1 to 4. Perform product operation. The OR operation unit 216 performs a logical sum operation on the result of the logical product operation of the first to fourth second-stage AND operation units 214-1 to 214-4.

第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 OR operation unit 216 select the lead number of the area where ANDs 1 to 4 are “1”, and output the selected lead number.

この選択リード番号はリード番号決定部220に送られる。   This selected lead number is sent to the lead number determination unit 220.

リード番号決定部220は、リクエストカウンタ222と選択演算部224を具えて構成される。リクエストカウンタ222には、キャッシュヒット判定信号が、論理反転された後、入力される。したがって、このリクエストカウンタ222は、キャッシュヒットしなかった回数を計数する。リクエストカウンタ222で計数されたリクエスト計数値と、リード番号選択部210で選択されたリード選択番号は、選択演算部224に送られる。選択演算部224には、制御信号としてキャッシュヒット判定信号が入力される。キャッシュヒット判定信号が“1”のとき、すなわち、キャッシュヒットした場合は、選択リード番号を決定リード番号として出力し、キャッシュヒット判定信号が“0”のとき、すなわち、キャッシュヒットしていない場合は、リクエスト計数値を決定リード番号として出力する。   The lead number determination unit 220 includes a request counter 222 and a selection calculation unit 224. A cache hit determination signal is input to the request counter 222 after being logically inverted. Therefore, the request counter 222 counts the number of times that a cache hit has not occurred. The request count value counted by the request counter 222 and the lead selection number selected by the lead number selection unit 210 are sent to the selection calculation unit 224. The selection calculation unit 224 receives a cache hit determination signal as a control signal. When the cache hit determination signal is “1”, that is, when a cache hit occurs, the selected read number is output as the determined read number. When the cache hit determination signal is “0”, that is, when no cache hit occurs The request count value is output as the determined lead number.

このリード番号決定部220から出力される決定リード番号は、キャッシュメモリ301に送られる。   The determined read number output from the read number determining unit 220 is sent to the cache memory 301.

図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 data selection unit 230 counts the number of times the read data is read from the memory control unit 160 as a read counter value, and if the read counter value and the read number match, the read number that matches the read counter value A read data selection signal is sent to the area where is stored.

リードデータ選択部230は、リードデータカウンタ232、第1〜4の比較演算部234−1〜4、第1〜4のAND演算部236−1〜4を備えて構成される。   The read data selection unit 230 includes a read data counter 232, first to fourth comparison operation units 234-1 to 234-1, and first to fourth AND operation units 236-1 to 236-1.

リードデータカウンタ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 memory control unit 160 to the read data counter 232. The read data counter 232 counts the number of times read data is read from the memory control unit 160 as a read data count value. The read data count value is sent to the first to fourth comparison operation units 234-1 to 234-1. The read data count values and the lead numbers 1 to 4 are input to the first to fourth comparison operation units 234-1 to 234-4, and these are compared. The first to fourth comparison operation units 234-1 to 234-4 output “1” when the read numbers 1 to 4 are equal to the read data count value, and output “0” when they are not equal. The first to fourth AND operation units 236-1 to 236-4 perform a logical product operation of the comparison operation result in the first to fourth comparison operation units 234-1 to 234 and the read data enable signal.

この第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 data selection signal 2 is “1”, it indicates that the read number of the area 2 is equal to the read data count value and the read data stored in the area 2 can be used.

リード選択信号1〜4はライト領域選択部181に送られる。   The read selection signals 1 to 4 are sent to the write area selection unit 181.

図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 area selection unit 181 includes first to fourth AND operation units 183-1 to 183-4 and first to fourth OR operation units 186-1 to 186-1. The selection signals 1 to 4 and the completion bit determination signal are input to the first to fourth AND operation units 183-1 to 183-4. AND1 to AND4, which are outputs of the first to fourth AND operation units 183-1 to 183-4, are sent to the first to fourth OR operation units 186-1 to 186-1. The first to fourth OR operation units 186-1 to 186-4 perform a logical sum operation on the AND1 to 4 and the read selection signals 1 to 4, and the result is stored in the cache memory 301 as the write enable signals 1 to 4. send. That is, the write area selection unit 181 caches the area designated by the selection signals 1 to 4 when the completion bit is “1” or when read data having a count value equal to the read number is read. Write to the memory 301.

(第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 cache memory 301 are set to “0” (FIG. 18A).

入力アドレス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 address selection unit 130 selects the source address 1-1 as the selection address. Since the cache hit determination unit 140 determines a cache hit before the storage in the cache memory 301 is completed, the cache hit signals 1 to 4 are all “0”, and the cache hit determination signal is also “0”. "

選択信号1が“1”となると、第1の領域がライトイネーブルとなり、上位アドレス1にソースアドレス1−1と、下位アドレスに1番目の画素であることを示すアドレス(0)が書き込まれる。また、有効ビット1が“1”になる。   When the selection signal 1 becomes “1”, the first area is write-enabled, and the source address 1-1 is written in the upper address 1 and the address (0) indicating the first pixel is written in the lower address. Also, the effective bit 1 becomes “1”.

この段階で、メモリ制御部160は、外部メモリからの読み出しを開始する。   At this stage, the memory control unit 160 starts reading from the external memory.

また、リクエストカウンタ222が計数を行い、その計数結果である“1”をリード番号欄に書き込む(図18(B))。   Further, the request counter 222 performs counting and writes “1” as the counting result in the read number column (FIG. 18B).

この読み出しを行っている間に、選択信号2が“1”になる。   During this reading, the selection signal 2 becomes “1”.

アドレス選択部130ではソースアドレス2−1が選択アドレスとして選択される。キャッシュヒット判定部140では、キャッシュメモリへの格納が完了する前に、キャッシュヒットの判定が行われるため、キャッシュヒット信号1〜4は全て“0”となり、また、キャッシュヒット判定信号も“0”となる。   In the address selection unit 130, the source address 2-1 is selected as the selection address. Since the cache hit determination unit 140 determines a cache hit before the storage in the cache memory is completed, the cache hit signals 1 to 4 are all “0”, and the cache hit determination signal is also “0”. It becomes.

選択信号2が“1”となると、第2の領域がライトイネーブルとなり、上位アドレス2にソースアドレス2−1と、下位アドレスに1番目の画素であることを示すアドレス(0)が書き込まれる。また、有効ビット2が“1”になる。   When the selection signal 2 becomes “1”, the second area is write-enabled, and the source address 2-1 is written in the upper address 2 and the address (0) indicating the first pixel is written in the lower address. Further, the effective bit 2 becomes “1”.

この段階で、メモリ制御部160は、外部メモリからの読み出しを開始する。   At this stage, the memory control unit 160 starts reading from the external memory.

また、リクエストカウンタ222が計数を行い、その計数結果である“2”が、リード番号欄に書き込まれる(図18(C))。   Further, the request counter 222 performs counting, and “2” as the counting result is written in the read number column (FIG. 18C).

次に、選択信号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 signal 1 is “1” and the cache hit determination signal is “1”. When the writing is not performed in the first area, the completion number 1 is “0”, so that the lead number 1 is selected and this value is written into the lead number 3. That is, the lead number 3 is 1 (FIG. 18D).

次に、選択信号4が“1”になる。この場合、キャッシュヒット信号2が“1”となり、キャッシュヒット判定信号は“1”となる。第2の領域に書き込まれていないときは、完了ビット2が“0”であるため、リード番号2が選択され、この値がリード番号4に書き込まれる。すなわち、リード番号4が2となる(図18(E))。   Next, the selection signal 4 becomes “1”. In this case, the cache hit signal 2 is “1”, and the cache hit determination signal is “1”. When data is not written in the second area, since the completion bit 2 is “0”, the lead number 2 is selected and this value is written in the lead number 4. That is, the lead number 4 is 2 (FIG. 18E).

その後、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 data selection unit 230 constantly compares the read numbers 1 to 4 with the read data count value, when the read data count value is “1”, the comparison results 1 and 3 are “1”. When the data reading is completed, the read data enable signal becomes “1”, so that the read data selection signals 1 and 3 become “1” and are sent to the write area selection unit 181.

ライト領域選択部181では、ライトイネーブル信号1及び3を1として、第1の領域と第3の領域にリードデータを書き込む(図18(F))。   The write area selection unit 181 sets the write enable signals 1 and 3 to 1, and writes read data to the first area and the third area (FIG. 18F).

次に、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 data selection unit 230 constantly compares the read numbers 1 to 4 with the read data count value, when the read data count value is “2”, the comparison results 2 and 4 are “1”. When the data reading is completed, the read data enable signal becomes “1”, so that the read data selection signals 2 and 4 become “1” and are sent to the write area selection unit 181.

ライト領域選択部181では、ライトイネーブル信号2及び4を1として、第2の領域と第4の領域にリードデータが書き込まれる(図18(G))。   In the write area selection unit 181, the write enable signals 2 and 4 are set to 1, and the read data is written in the second area and the fourth area (FIG. 18G).

第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 external memory 20. FIGS. 19F to 19I show selection signals 1 to 4 of the second embodiment. FIG. 19J shows a process for reading from the external memory 20.

ここでは、入力アドレス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 external memory 20 for the input address 1, the data d2-1 and d2-2 are read from the external memory 20 for the input address 2, and the input address 3 For 4 and 4, an example of reading from the cache memory will be described.

第1実施形態の構成によれば、時刻t0で選択信号1が“1”になると、外部メモリの読込処理開始までにかかる時間Δtaを経過した後、外部メモリからデータd1−1及びd1−2の読み込み処理を行う。外部メモリからの読込処理が終了すると、選択信号1が“0”になるとともに、選択信号2が“1”になる。ここでは、外部メモリからの読込処理にかかる時間をΔtbとする。   According to the configuration of the first embodiment, when the selection signal 1 becomes “1” at time t0, the data d1-1 and d1-2 are read from the external memory after the time Δta required until the reading process of the external memory starts. Perform reading process. When the reading process from the external memory is completed, the selection signal 1 becomes “0” and the selection signal 2 becomes “1”. Here, the time required for the reading process from the external memory is represented by Δtb.

次に、選択信号2が“1”になると、外部メモリからデータd2−1及びd2−2の読込処理を行う。   Next, when the selection signal 2 becomes “1”, data d2-1 and d2-2 are read from the external memory.

データ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 selection signal 2 becomes “0” and the selection signal 3 becomes “1”. When the selection signal 3 is “1”, the reading process from the external memory is not performed. Therefore, after the time Δtsl has elapsed, the selection signal 3 becomes “0” and the selection signal 4 becomes “1”.

選択信号4が“1”になった場合も、外部メモリからの読込処理を行わないので、時間Δtslが経過した後、時刻t1において、選択信号4が“0”となる。   Even when the selection signal 4 becomes “1”, the reading process from the external memory is not performed, and therefore the selection signal 4 becomes “0” at time t1 after the time Δtsl has elapsed.

時刻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 selection signal 1, the selection signal 1 is obtained when the time Δtsl has elapsed. Becomes “0” and the selection signal 2 becomes “1”. As described above, in the configuration of the second embodiment, every time the time Δtsl elapses, the read control unit generates a selection signal in which the region to be selected is changed.

外部メモリからの読込処理については、データ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 cache circuit 102 according to the third embodiment is different from the cache circuit according to the second embodiment in that the cache memory 302 has two surfaces, an A surface and a B surface. Is configured similarly to the cache circuit of the second embodiment. Therefore, the overlapping description may be omitted.

第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 cache memory 302 according to the third embodiment includes two surfaces, an A surface and a B surface. The A side and the B side have the same configuration as the cache memory 301 described with reference to FIG. That is, the A side and the B side of the cache memory 302 have a plurality of areas. The number of areas that each of the A side and B side of the cache memory 302 has is at least the same as the number of input addresses, and is four here. Each area of the A side and the B side of the cache memory 302 is provided with an effective bit column 330, an upper address column 332, a lower address column 334, a cache data column 336, a completion bit column 338, and a read number column 340. Each stores a valid bit, an upper address, a lower address, cache data, a completion bit, and a read number.

キャッシュメモリ302は、入力面切換部を有している。キャッシュメモリ302に送られた選択信号、入力アドレス及びライトイネーブル信号は、それぞれ入力面切換部で、送り先としてA面又はB面が選択される。また、リード番号の出力についても、入力面切換部において、送り元としてA面又はB面が選択される。この入力面切換部は、制御信号として入力される入力面切換信号によって、A面又はB面の切換えを行う。   The cache memory 302 has an input surface switching unit. The selection signal, the input address, and the write enable signal sent to the cache memory 302 are respectively selected as the destination A side or B side by the input side switching unit. Also for the output of the lead number, the A side or B side is selected as the sending source in the input surface switching unit. The input surface switching unit switches the A surface or the B surface by an input surface switching signal input as a control signal.

入力面切換信号が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 signals 1 to 4 are sent to the A plane of the cache memory 302. In addition, the lead number stored in the A side is sent to the lead number selection unit 211 and the read data selection unit 230.

一方、入力面切換信号が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 signals 1 to 4 are sent to the B surface of the cache memory 302. Further, the lead number stored in the B side is sent to the lead number selection unit 211 and the read data selection unit 230.

また、ライトデータ及びリード番号は、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 cache memory 302 to the cache hit determination unit 141, cache hit data selection unit 151, completion bit determination unit 201, and read number selection unit 211 are It is stored on both the A and B sides of the cache memory without depending on the switching signal.

キャッシュヒット判定部141、完了ビット判定部201及びリード番号選択部211は、4系統の信号が8系統になることを除いては第2実施形態と同様に構成される。   The cache hit determination unit 141, the completion bit determination unit 201, and the read number selection unit 211 are configured in the same manner as in the second embodiment except that the four systems of signals are eight systems.

リード番号選択部211は、キャッシュヒット信号入力面切換部と、完了ビット入力面切換部を備えている。キャッシュヒット信号入力面切換部、及び完了ビット入力面切換部には、制御信号として入力面切換信号が入力される。   The lead number selection unit 211 includes a cache hit signal input surface switching unit and a completion bit input surface switching unit. An input surface switching signal is input as a control signal to the cache hit signal input surface switching unit and the completion bit input surface switching unit.

キャッシュヒット信号出力面切換部、及び完了ビット出力面切換部は、入力面切換信号が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 data selection unit 190 has an output surface switching unit. An output surface switching signal is input to the output surface switching unit as a control signal.

ここで、入力面切換信号と、出力面切換信号は相補的な信号であり、一方が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 external memory 20 is longer than the processing time for output, and the processing time when there are many processes for reading data from the cache memory is shorter than the processing time for output.

初期状態では、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.

画像データ処理回路の概略図である。It is the schematic of an image data processing circuit. ソース画像とデスティネーション画像の関係の模式図である。It is a schematic diagram of the relationship between a source image and a destination image. 第1実施形態のキャッシュ回路の概略図である。It is the schematic of the cache circuit of 1st Embodiment. 第1実施形態のキャッシュメモリの概略図である。It is the schematic of the cache memory of 1st Embodiment. アドレス選択部の概略構成図である。It is a schematic block diagram of an address selection part. キャッシュヒット判定部の概略構成図である。It is a schematic block diagram of a cache hit determination part. キャッシュヒットデータ選択部の概略構成図である。It is a schematic block diagram of a cache hit data selection part. ライトデータ判定部の概略構成図である。It is a schematic block diagram of a write data determination part. ライト領域選択部の概略構成図である。It is a schematic block diagram of a write area | region selection part. 出力データ選択部の概略構成図である。It is a schematic block diagram of an output data selection part. 第1実施形態のキャッシュメモリ制御方法を説明するための図である。It is a figure for demonstrating the cache memory control method of 1st Embodiment. 第2実施形態のキャッシュ回路の概略図である。It is the schematic of the cache circuit of 2nd Embodiment. 第2実施形態のキャッシュメモリの概略図である。It is the schematic of the cache memory of 2nd Embodiment. 完了ビット判定部の概略構成図である。It is a schematic block diagram of a completion bit determination part. リード番号選択部の概略構成図である。It is a schematic block diagram of a lead number selection part. リードデータ選択部の概略構成図である。It is a schematic block diagram of a read data selection part. ライト領域選択部の概略構成図である。It is a schematic block diagram of a write area | region selection part. 第2実施形態のキャッシュメモリ制御方法を説明するための図である。It is a figure for demonstrating the cache memory control method of 2nd Embodiment. 第1実施形態と第2実施形態のタイミング図である。It is a timing diagram of 1st Embodiment and 2nd Embodiment. 第3実施形態のキャッシュ回路を説明するための概略図である。It is the schematic for demonstrating the cache circuit of 3rd Embodiment. 第3実施形態のキャッシュメモリの概略図である。It is the schematic of the cache memory of 3rd Embodiment. 第3実施形態のキャッシュメモリ制御方法を説明するための図である。It is a figure for demonstrating the cache memory control method of 3rd Embodiment.

符号の説明Explanation of symbols

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 SYMBOLS 10 Address calculation means 20 External memory 30 Image data processing means 100, 101, 102 Cache circuit
120 Read control unit 130 Address selection unit 132, 144, 152, 182, 183, 202, 212, 214, 236 AND operation unit 134, 146, 154, 174, 184, 186, 204, 216 OR operation unit 140 Cache hit determination Unit 142, 234 Comparison operation unit 150 Cache hit data selection unit 160 Memory control unit 170, 171 Write data determination unit 172, 173, 192, 224 Selection operation unit 180, 181 Write area selection unit 190 Output data selection unit 200 Completion bit determination Unit 210 Read number selection unit 220 Read number determination unit 222 Request counter 230 Read data selection unit 232 Read data counter 300, 301, 302 Cache memory 311, 312, 313, 314, 321, 3 2,323,324 region 330 valid bit column 332 upper address field 334 lower address field 336 caches the data column 338 is complete bit field 340 leads number field

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.
複数の領域のそれぞれに、当該領域が有効か否かを示す有効ビット、アドレス、該アドレスが示す画素のデータ、該データが格納されているか否かを示す完了ビット、及びリード番号が格納される2つの面と、入力面切換信号により、前記2つの面を切換える入力面切換部を備えるキャッシュメモリを有し、入力された複数の入力アドレスがそれぞれ示す画素のデータを、前記キャッシュメモリから読み出して出力するキャッシュ回路であって、
前記キャッシュメモリの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.
JP2008196377A 2008-07-30 2008-07-30 Cache circuit and cache memory control method Withdrawn JP2010033420A (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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&#39;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