JP5402210B2 - Image processing device - Google Patents

Image processing device Download PDF

Info

Publication number
JP5402210B2
JP5402210B2 JP2009106733A JP2009106733A JP5402210B2 JP 5402210 B2 JP5402210 B2 JP 5402210B2 JP 2009106733 A JP2009106733 A JP 2009106733A JP 2009106733 A JP2009106733 A JP 2009106733A JP 5402210 B2 JP5402210 B2 JP 5402210B2
Authority
JP
Japan
Prior art keywords
data
page
cache
memory
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.)
Active
Application number
JP2009106733A
Other languages
Japanese (ja)
Other versions
JP2010257237A (en
Inventor
佳司 吉田
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.)
Yamaha Corp
Original Assignee
Yamaha Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yamaha Corp filed Critical Yamaha Corp
Priority to JP2009106733A priority Critical patent/JP5402210B2/en
Publication of JP2010257237A publication Critical patent/JP2010257237A/en
Application granted granted Critical
Publication of JP5402210B2 publication Critical patent/JP5402210B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Description

この発明は、アミューズメント機器等に好適な画像処理装置に関する。   The present invention relates to an image processing apparatus suitable for an amusement device or the like.

ゲーム機等のアミューズメント機器では、パターンメモリに記憶された各種のパターンデータを読み出して、静止画や動画を表示装置に表示させる。なお、この種のアミューズメント機器に好適な画像処理装置に関する特許文献のうち本願発明者によるものとして特許文献1〜6がある。   In an amusement device such as a game machine, various pattern data stored in a pattern memory are read and a still image or a moving image is displayed on a display device. Among patent documents relating to an image processing apparatus suitable for this type of amusement device, there are Patent Documents 1 to 6 by the inventors of the present application.

特開2003−163811号公報JP 2003-163811 A 特開2004−233747号公報JP 2004-233747 A 特開2004−233748号公報JP 2004-233748 A 特開2005−241797号公報JP 2005-241797 A 特開2006−18382号公報JP 2006-18382 A 特開2007−187882号公報JP 2007-187882 A

アミューズメント機器において、スピード感に溢れる多彩な表示を実現するためには、パターンメモリからデータを効率的に読み出す能力が求められる。そのため、従来、アミューズメント機器のパターンメモリには、ランダムアクセスレイテンシーの小さいマスクROMやNOR型フラッシュROM等が使用されていた。しかし、近年、アミューズメント機器では、動画コンテンツが多用され、かつ、高画質が求められるようになってきたため、パターンメモリとして大容量のものが必要になってきた。このような状況において、マスクROMやNOR型フラッシュROMをパターンメモリとして使用すると、コストが増加する問題がある。そこで、対策として、大容量で安価なNAND型フラッシュROMとともに、不良ブロック発生の対策としてのECC(Error Correction Coding)等の専用回路を含んだROMモジュールをパターンメモリとして採用することが考えられる。しかし、NAND型フラッシュROMにおけるデータアクセスは、512、1024、2048ワードを1ページとするページ単位のアクセスとなり、ランダムアクセスレイテンシーが大きい。また、NAND型フラッシュROMと上記専用回路を含んだROMモジュールは、データ読み出しの際にECC処理を行うので、ランダムアクセスレイテンシーがさらに大きくなる。このため、ROMモジュールの帯域が狭くなり、アクセス効率が低下する。   In order to realize a variety of displays full of a sense of speed in an amusement machine, the ability to efficiently read data from the pattern memory is required. Therefore, conventionally, a mask ROM, a NOR flash ROM, or the like with a small random access latency has been used as a pattern memory of an amusement device. In recent years, however, amusement devices have frequently used moving image contents and have been required to have high image quality, so that a large capacity pattern memory has been required. In such a situation, when a mask ROM or a NOR flash ROM is used as a pattern memory, there is a problem that the cost increases. Therefore, as a countermeasure, it is conceivable to adopt a ROM module including a dedicated circuit such as ECC (Error Correction Coding) as a countermeasure against the occurrence of a defective block together with a large-capacity and inexpensive NAND flash ROM as a pattern memory. However, data access in the NAND flash ROM is page-by-page access with 512, 1024, and 2048 words as one page, and the random access latency is large. In addition, since the ROM module including the NAND flash ROM and the dedicated circuit performs ECC processing when reading data, the random access latency is further increased. For this reason, the bandwidth of the ROM module is narrowed, and the access efficiency is lowered.

この発明は、以上説明した事情に鑑みてなされたものであり、パターンメモリとしてランダムアクセスレイテンシーが大きく安価なメモリを使用する場合でも、効率的にパターンメモリからデータを読み出して処理を行うことができる画像処理装置を提供することを目的とする。   The present invention has been made in view of the circumstances described above, and even when an inexpensive memory having a large random access latency is used as a pattern memory, data can be efficiently read from the pattern memory and processed. An object is to provide an image processing apparatus.

この発明は、画像処理を行うモジュールを含む複数のモジュールと、前記複数のモジュールの処理対象となるデータを記憶したパターンメモリと前記複数のモジュールとの間のデータの授受を仲介するメモリインタフェースとを具備し、前記メモリインタフェースは、前記パターンメモリから読み出されたデータを格納する複数ページ分の記憶エリアを有するキャッシュメモリと、前記複数のモジュールの中のいずれかのモジュールから前記キャッシュメモリに格納されたデータを対象とするリードリクエストが与えられた場合には、そのリードリクエストの対象であるデータを前記キャッシュメモリから読み出して当該モジュールに対して出力し、前記キャッシュメモリに格納されていないデータを対象とするリードリクエストが与えられた場合には、前記キャッシュメモリ内において書き換え対象の記憶エリアを決定し、前記リードリクエストの対象であるデータを含む1ページ分のデータを前記パターンメモリから読み出して前記書き換え対象の記憶エリアに格納するとともに、前記リードリクエストの対象であるデータを当該モジュールに対して出力する手段であり、前記リードリクエストの対象であるデータに連続するデータが前記キャッシュメモリのいずれかの記憶エリアに格納されている場合に、当該記憶エリアを書き換え対象とするキャッシュ制御手段とを具備することを特徴とする画像処理装置を提供する。   The present invention includes a plurality of modules including a module that performs image processing, a pattern memory that stores data to be processed by the plurality of modules, and a memory interface that mediates data exchange between the plurality of modules. The memory interface includes a cache memory having a storage area for a plurality of pages for storing data read from the pattern memory, and is stored in the cache memory from any one of the plurality of modules. If a read request for the read data is given, the data that is the target of the read request is read from the cache memory and output to the module, and the data that is not stored in the cache memory is the target Is given a read request In this case, the storage area to be rewritten is determined in the cache memory, and data for one page including the data to be read is read from the pattern memory and stored in the storage area to be rewritten. , Means for outputting the data that is the object of the read request to the module, and data that is continuous with the data that is the object of the read request is stored in any storage area of the cache memory And an image processing apparatus characterized by comprising cache control means for rewriting the storage area.

かかる発明によれば、メモリインタフェースは、キャッシュ記憶機能を備えている。このため、パターンメモリが安価でランダムアクセスレイテンシーの大きなNAND型フラッシュROM等であっても、各モジュールはメモリインタフェースを介してパターンメモリから効率的にデータを読み出すことができる。また、メモリインタフェースのキャッシュ制御手段は、キャッシュメモリに格納されていないデータを対象とするリードリクエストが与えられ、リードリクエストの対象であるデータに連続するデータがキャッシュメモリ内に格納されている場合に、その連続するデータを格納している記憶エリアを書き換え対象とする。このようなリードリクエストの対象であるデータに連続するデータは、再度のリードリクエストが発生する可能性が極めて低いので、このようなデータを格納している記憶エリアは書き換え対象とするのに最適である。従って、この発明によれば、キャッシュメモリのページ数が少ない小規模な構成でも、キャッシュヒット率を向上させ、パターンメモリから効率的なデータ読み出しを行うことができる。   According to this invention, the memory interface has a cache storage function. Therefore, each module can efficiently read data from the pattern memory via the memory interface even if the pattern memory is an inexpensive NAND flash ROM or the like having a large random access latency. Further, the cache control means of the memory interface is provided when a read request for data not stored in the cache memory is given and data continuous to the data that is the target of the read request is stored in the cache memory. The storage area storing the continuous data is the target of rewriting. Since data that is continuous with the data that is the target of such a read request is very unlikely to cause another read request, the storage area that stores such data is optimal for rewriting. is there. Therefore, according to the present invention, the cache hit rate can be improved and efficient data reading can be performed from the pattern memory even in a small-scale configuration in which the number of pages of the cache memory is small.

この発明による画像処理装置の一実施形態である画像表示LSI(Large ScaleIntegrated circuit)の構成を示すブロック図である。1 is a block diagram showing a configuration of an image display LSI (Large Scale Integrated circuit) which is an embodiment of an image processing apparatus according to the present invention. FIG. 同画像表示LSIにおけるROMインタフェースの構成例を示すブロック図である。It is a block diagram which shows the structural example of the ROM interface in the image display LSI. 同ROMインタフェースにおけるキャッシュ制御回路の処理内容を示すフローチャートである。It is a flowchart which shows the processing content of the cache control circuit in the ROM interface. 同ROMインタフェースにおいて各種の方法によりリプレースメントを行った場合におけるキャッシュメモリの記憶内容の変遷を示す図である。It is a figure which shows the transition of the memory content of the cache memory at the time of performing replacement by various methods in the ROM interface.

以下、図面を参照し、この発明の実施の形態を説明する。
図1は、この発明による画像処理装置の一実施形態である画像表示LSI100の構成を示すブロック図である。なお、図1では、画像表示LSI100の機能の理解を容易にするため、画像表示LSI100の外部のCPU201、表示装置202、SDRAM(Synchronous Dynamic Random Access Memory)203、パターンROM204およびデジタルアンプ205も併せて図示されている。
Embodiments of the present invention will be described below with reference to the drawings.
FIG. 1 is a block diagram showing a configuration of an image display LSI 100 which is an embodiment of an image processing apparatus according to the present invention. In FIG. 1, in order to facilitate understanding of the function of the image display LSI 100, a CPU 201, a display device 202, an SDRAM (Synchronous Dynamic Random Access Memory) 203, a pattern ROM 204, and a digital amplifier 205 are also included. It is shown.

本実施形態による画像表示LSI100は、アミューズメント機器に搭載されるLSIであり、CPU201からの指示に従い、パターンROM204から必要なデータを読み出して、その処理を行い、静止画や動画を表示装置202に表示させ、デジタルアンプ205を駆動して音楽や各種の効果音を発生させるものである。   The image display LSI 100 according to the present embodiment is an LSI mounted on an amusement device. In accordance with an instruction from the CPU 201, necessary image data is read from the pattern ROM 204, processed, and a still image or a moving image is displayed on the display device 202. The digital amplifier 205 is driven to generate music and various sound effects.

この画像表示LSI100の構成は次の通りである。まず、クロックジェネレータ101は、画像表示LSI100内の各部の動作タイミングを制御するクロックを発生する回路である。CPUインタフェース102は、CPU201と画像表示LSI100内の各部との間で行われるコマンドや制御情報の授受を仲介する装置である。汎用メモリ103は、RAM等により構成されており、画像表示LSI100内の各部間の制御情報の引き渡し等に用いられる。SDRAMインタフェース104は、動画デコーダ111、静止画デコーダ112、描画エンジン113および音源114からSDRAM203へのアクセスを仲介する装置である。動画デコーダ111、静止画デコーダ112、描画エンジン113および音源114は、このSDRAMインタフェース104を介してSDRAM203にアクセスし、SDRAM203をワークエリアとして使用する。   The configuration of the image display LSI 100 is as follows. First, the clock generator 101 is a circuit that generates a clock for controlling the operation timing of each unit in the image display LSI 100. The CPU interface 102 is a device that mediates exchange of commands and control information performed between the CPU 201 and each unit in the image display LSI 100. The general-purpose memory 103 is configured by a RAM or the like, and is used for delivery of control information between each unit in the image display LSI 100. The SDRAM interface 104 is a device that mediates access to the SDRAM 203 from the moving picture decoder 111, the still picture decoder 112, the drawing engine 113, and the sound source 114. The moving picture decoder 111, the still picture decoder 112, the drawing engine 113, and the sound source 114 access the SDRAM 203 via the SDRAM interface 104 and use the SDRAM 203 as a work area.

ROMインタフェース105は、動画デコーダ111、静止画デコーダ112、描画エンジン113、音源114およびCPUインタフェース102からパターンROM204へのアクセスを仲介する装置である。   The ROM interface 105 is a device that mediates access to the pattern ROM 204 from the moving image decoder 111, the still image decoder 112, the drawing engine 113, the sound source 114, and the CPU interface 102.

本実施形態では、パターンROM204として、ページ単位でのアクセスを受け付ける不揮発性メモリ、具体的にはNAND型フラッシュROMとECCのための専用回路とが組み込まれたROMモジュールが用いられている。図1に示すように、このパターンROM204には、動画エンコードデータ、静止画エンコードデータ、スプライト属性データ、動画アルファチャネルデータ、静止画アルファチャネルデータ、音源データ等の各種のデータが記憶されている。動画デコーダ111は、CPU201からの指示に従い、パターンROM204内の動画エンコードデータを読み出してデコードし、動画を構成する各フレームの画像データを描画エンジン113に引き渡す。また、静止画デコーダ112は、CPU201からの指示に従い、パターンROM204内のスプライトの静止画エンコードデータを読み出してデコードし、スプライトの画像データをスプライトバッファ115に一時格納し、描画エンジン113に引き渡す。   In this embodiment, a non-volatile memory that accepts access in page units, specifically, a ROM module incorporating a NAND flash ROM and a dedicated circuit for ECC is used as the pattern ROM 204. As shown in FIG. 1, the pattern ROM 204 stores various data such as moving image encoded data, still image encoded data, sprite attribute data, moving image alpha channel data, still image alpha channel data, and sound source data. The moving picture decoder 111 reads out and decodes the moving picture encoded data in the pattern ROM 204 in accordance with an instruction from the CPU 201, and delivers the image data of each frame constituting the moving picture to the drawing engine 113. Further, the still image decoder 112 reads and decodes the sprite still image encoded data in the pattern ROM 204 in accordance with an instruction from the CPU 201, temporarily stores the sprite image data in the sprite buffer 115, and delivers it to the drawing engine 113.

描画エンジン113は、動画デコーダ111から引き渡される動画の画像データおよび静止画デコーダ112から引き渡されるスプライトの画像データをフレームバッファ116に格納することによりレンダリングを行う。CPU201は、描画エンジン113にスプライトの画像データのレンダリングを行わせる場合、そのスプライトのフレーム内での位置情報等を定義したスプライト属性データをパターンROM204から読み出して汎用メモリ103に格納する。描画エンジン113は、この汎用メモリ103内のスプライト属性データを参照して、スプライトの画像データのレンダリングを行う。なお、描画エンジン113は、レンダリングの際に、動画エンコードデータおよび静止画エンコードデータの一部にランダムアクセスする場合がある。表示コントローラ117は、一定のフレーム周期毎にフレームバッファ116内の画像データを読み出して表示装置202に表示させる。   The rendering engine 113 performs rendering by storing, in the frame buffer 116, moving image data transferred from the moving image decoder 111 and sprite image data transferred from the still image decoder 112. When the CPU 201 causes the rendering engine 113 to render sprite image data, the CPU 201 reads sprite attribute data defining position information and the like within the frame of the sprite from the pattern ROM 204 and stores it in the general-purpose memory 103. The drawing engine 113 refers to the sprite attribute data in the general-purpose memory 103 and renders the sprite image data. Note that the rendering engine 113 may randomly access a part of the moving image encoded data and still image encoded data during rendering. The display controller 117 reads out the image data in the frame buffer 116 and displays it on the display device 202 at regular frame periods.

動画デコーダ111による動画エンコードデータのデコードおよび静止画デコーダ112による静止画エンコードデータのデコードは、デコード結果である画像データが16×16ドットのマクロとなるようなデータ量単位で逐次実行される。そして、動画デコーダ111および静止画デコーダ112は、パターンROM204内にまとまって格納された動画エンコードデータまたは静止画エンコードデータを一方向的かつ連続的(例えばアドレスおよびページが順次増加する方向)に順次読み出し、そのデコードを行う。   The decoding of the moving image encoded data by the moving image decoder 111 and the decoding of the still image encoded data by the still image decoder 112 are sequentially executed in units of data amount such that the image data as a decoding result becomes a macro of 16 × 16 dots. Then, the moving picture decoder 111 and the still picture decoder 112 sequentially read out the moving picture encoded data or the still picture encoded data collectively stored in the pattern ROM 204 in one direction and continuously (for example, the direction in which addresses and pages sequentially increase). Decode it.

このデコードの対象である動画エンコードデータおよび静止画エンコードデータが動画アルファチャネルデータや静止画アルファチャネルデータを伴う場合がある。ここで、動画アルファチャネルデータおよび静止画アルファチャネルデータは、描画エンジン113が動画またはスプライトの画像データをフレームバッファ116内の背景画像の画像データにレンダリングする場合に、背景画像をどの程度透かして見せるかを指示するデータのエンコードデータである。   The moving image encoded data and still image encoded data to be decoded may be accompanied by moving image alpha channel data and still image alpha channel data. Here, the moving image alpha channel data and the still image alpha channel data indicate how much the background image is watermarked when the rendering engine 113 renders the moving image or sprite image data into the image data of the background image in the frame buffer 116. This is the encoded data of the data for instructing.

デコード対象である動画エンコードデータがこの動画アルファチャネルデータを伴う場合、動画デコーダ111は、あるマクロに対応した動画エンコードデータを読み出してデコードした後、同マクロに対応した動画アルファチャネルデータを読み出してデコードする、という具合に、マクロ単位で、動画エンコードデータの読み出しおよびデコードと動画アルファチャネルデータの読み出しおよびデコードとを交互に繰り返す。   When the video encoding data to be decoded is accompanied by this video alpha channel data, the video decoder 111 reads and decodes the video encoding data corresponding to a certain macro, and then reads and decodes the video alpha channel data corresponding to the macro. In other words, reading and decoding of moving image encoded data and reading and decoding of moving image alpha channel data are alternately repeated in macro units.

この場合において、動画エンコードデータと動画アルファチャネルデータは図1にも示すようにパターンROM204内の互いに離れたエリアに格納されている。従って、動画デコーダ111が動画エンコードデータを継続的に読み出している期間および動画アルファチャネルデータを継続的に読み出している期間では、読み出しアドレスは連続的に変化するが、動画エンコードデータを読み出す期間および動画アルファチャネルデータを読み出す期間の一方から他方へ、他方から一方へ切り換わるとき、読み出しアドレスは飛躍的に変化することとなる。しかしながら、動画エンコードデータの読み出しアドレスおよび動画アルファチャネルデータの読み出しアドレスの各々を独立に観測すると、各読み出しアドレスは、上述したように一方向的かつ連続的に変化する。静止画エンコードデータおよび静止画アルファチャネルデータについても同様である。   In this case, the moving image encoded data and the moving image alpha channel data are stored in areas separated from each other in the pattern ROM 204 as shown in FIG. Accordingly, during the period in which the moving picture decoder 111 continuously reads the moving picture encoded data and the period in which the moving picture alpha channel data is continuously read, the read address continuously changes, but the period in which the moving picture encoded data is read and the moving picture When the alpha channel data is read from one side to the other and from the other side, the read address changes drastically. However, when the moving image encoded data read address and the moving image alpha channel data read address are observed independently, each read address changes unidirectionally and continuously as described above. The same applies to still image encoded data and still image alpha channel data.

CPUインタフェース102は、CPU201からの指示に従い、パターンROM204内の動画エンコードデータや静止画エンコードデータを帯域の広いSDRAM203にDMA(Direct Memory Access)転送させ、動画デコーダ111や静止画デコーダ112にこのSDRAM203内の動画エンコードデータや静止画エンコードデータのデコードを行わせる場合がある。この場合のパターンROM204からSDRAM203への動画エンコードデータや静止画エンコードデータのDMA転送では、パターンROM204内の連続したアドレスにある動画エンコードデータまたは静止画エンコードデータが一方向的かつ連続的に順次アクセス対象となる。   In accordance with an instruction from the CPU 201, the CPU interface 102 transfers the moving image encoded data and still image encoded data in the pattern ROM 204 to the SDRAM 203 having a wide bandwidth, and transfers the moving image decoder 111 and the still image decoder 112 to the SDRAM 203 in the SDRAM 203. In some cases, the video encoding data and still image encoding data are decoded. In this case, in the DMA transfer of moving image encoded data or still image encoded data from the pattern ROM 204 to the SDRAM 203, the moving image encoded data or still image encoded data at consecutive addresses in the pattern ROM 204 are sequentially and sequentially accessed. It becomes.

音源114は、CPU201からの指示に従い、パターンROM204内の音源データを読み出してデジタルアンプ205を駆動する。この場合において、パターンROM204内において連続したアドレスを持った一連の音源データが一方向的かつ連続的に音源114のアクセス対象となる。   The sound source 114 reads the sound source data in the pattern ROM 204 and drives the digital amplifier 205 in accordance with an instruction from the CPU 201. In this case, a series of sound source data having continuous addresses in the pattern ROM 204 becomes the access target of the sound source 114 in one direction and continuously.

以上説明した画像表示LSI100において、動画デコーダ111、静止画デコーダ112、CPUインタフェース102、音源114の各モジュールに着目すると、これらの各モジュールは、パターンROM204内において連続したアドレスを持った一連のデータを一方向的かつ連続的に順次アクセス対象とすることが多い。本実施形態の特徴は、この点を活かして、各モジュールが必要とするデータを効率的にパターンROM204から読み出して各モジュールに提供するROMインタフェース105の構成にある。   In the image display LSI 100 described above, paying attention to the modules of the moving picture decoder 111, the still picture decoder 112, the CPU interface 102, and the sound source 114, each of these modules stores a series of data having continuous addresses in the pattern ROM 204. In many cases, the access target is sequentially one-way and continuously. The feature of the present embodiment is the configuration of the ROM interface 105 that takes advantage of this point and efficiently reads out the data required by each module from the pattern ROM 204 and provides it to each module.

図2は本実施形態におけるROMインタフェース105の構成を示すブロック図である。本実施形態におけるROMインタフェース105は、キャッシュ記憶機能を備えたメモリインタフェースであり、図2に示すように、キャッシュメモリ51と、キャッシュ制御回路52とを有する。ここで、キャッシュメモリ51は、パターンROM204から読み出されたデータを記憶するためのNページ分の記憶エリアを有するメモリであり、SRAM(Static Random Access Memory)等のランダムアクセスレイテンシーの小さな書き換え可能なメモリにより構成されている。本実施形態におけるパターンROM204は、NAND型フラッシュROMであるため、ROMインタフェース105は、パターンROM204に対してページ単位のアクセスを行う必要がある。このため、キャッシュメモリ51における1ページ分の記憶容量は、パターンROM204のアクセス単位である1ページ分のデータ量と同じ量になっている。本実施形態では、複数のモジュールからのパターンROM204へのアクセスが競合する。従って、キャッシュヒット率を向上させるために、パターンROM204にアクセスするモジュール毎にキャッシュメモリを設ける構成も考えられる。しかし、全てのモジュールが常に動作してパターンROM204にアクセスする訳ではないので、モジュール毎にキャッシュメモリを設けるのは無駄が多く不経済である。そこで、本実施形態では、1個のキャッシュメモリ51のみがROMインタフェース105に設けられている。   FIG. 2 is a block diagram showing the configuration of the ROM interface 105 in this embodiment. The ROM interface 105 in the present embodiment is a memory interface having a cache storage function, and includes a cache memory 51 and a cache control circuit 52 as shown in FIG. Here, the cache memory 51 is a memory having a storage area for N pages for storing data read from the pattern ROM 204, and is rewritable with a small random access latency such as SRAM (Static Random Access Memory). It is composed of memory. Since the pattern ROM 204 in this embodiment is a NAND flash ROM, the ROM interface 105 needs to access the pattern ROM 204 in units of pages. For this reason, the storage capacity for one page in the cache memory 51 is the same as the data amount for one page which is an access unit of the pattern ROM 204. In this embodiment, access to the pattern ROM 204 from a plurality of modules competes. Therefore, in order to improve the cache hit rate, a configuration in which a cache memory is provided for each module that accesses the pattern ROM 204 is also conceivable. However, since not all modules always operate to access the pattern ROM 204, providing a cache memory for each module is wasteful and uneconomical. Therefore, in the present embodiment, only one cache memory 51 is provided in the ROM interface 105.

キャッシュ制御回路52は、必要に応じてキャッシュメモリ51の書き換えを行いつつ、画像表示LSI100内のモジュールからのリードリクエストの対象であるデータをキャッシュメモリ51から読み出して当該モジュールに提供する回路である。キャッシュ制御回路52は、キャッシュメモリ51の書き換えに関連する機能として、4つの主要な機能を有している。第1の機能は、画像表示LSI100内のいずれかのモジュールからパターンROM204内のデータに対するリードリクエストが与えられた場合に、そのリードリクエストの対象であるデータがキャッシュメモリ51に格納されているか否か、すなわち、キャッシュヒットかキャッシュミスかを判断するキャッシュヒット判断機能である。第2の機能は、キャッシュヒットが発生した場合に、リードリクエストの対象であるデータのキャッシュメモリ51内での所在を示すアクセスアドレスを生成するアクセスアドレス生成機能である。第3の機能は、キャッシュミスが発生した場合に、リードリクエストの対象であるデータを含む1ページ分のデータを格納する書き換え対象の記憶エリアを決定するリプレース先決定機能である。第4の機能は、キャッシュミスが発生した場合に、リードリクエストの対象であるデータを含む1ページ分のデータをパターンROM204から読み出して、キャッシュメモリ51における書き換え対象の記憶エリアに格納する(リプレースする)機能である。   The cache control circuit 52 is a circuit that reads the data that is the target of a read request from the module in the image display LSI 100 from the cache memory 51 and provides it to the module while rewriting the cache memory 51 as necessary. The cache control circuit 52 has four main functions as functions related to rewriting of the cache memory 51. The first function is whether or not data that is the target of the read request is stored in the cache memory 51 when a read request for data in the pattern ROM 204 is given from any module in the image display LSI 100. That is, it is a cache hit determination function for determining whether a cache hit or a cache miss. The second function is an access address generation function that generates an access address indicating the location in the cache memory 51 of the data that is the target of the read request when a cache hit occurs. The third function is a replacement destination determination function that determines a rewrite target storage area that stores data for one page including data that is the target of a read request when a cache miss occurs. The fourth function reads out data for one page including data that is a target of a read request from the pattern ROM 204 and stores it in a storage area to be rewritten in the cache memory 51 when a cache miss occurs (replaces). ) Function.

キャッシュ記憶に関する技術において、キャッシュミス発生時における書き換え対象の記憶エリアの決定方法の1つとして、LRU(Least Recently Used)ルールがよく用いられる。これはキャッシュメモリの各記憶エリア毎にアクセス履歴を管理し、最も古くアクセスされた記憶エリアを書き換え対象とするルールである。このLRUルールは、キャッシュヒット率を高めることができるルールではあるが、キャッシュメモリの各記憶エリア毎にアクセス履歴を管理しなければならず、その管理負担が大きいという問題がある。そこで、本実施形態では、以下説明するように、キャッシュ制御回路52がFIFO(First In First Out)ルールと本実施形態独自の新規なルールを組み合わせたルールによりキャッシュミス発生時における書き換え対象の記憶エリアを決定する。   In the technology related to cache storage, an LRU (Least Recently Used) rule is often used as one method for determining a storage area to be rewritten when a cache miss occurs. This is a rule for managing the access history for each storage area of the cache memory and rewriting the oldest accessed storage area. Although this LRU rule is a rule that can increase the cache hit rate, the access history must be managed for each storage area of the cache memory, and there is a problem that the management burden is large. Therefore, in the present embodiment, as will be described below, the cache control circuit 52 uses a rule that combines a first in first out (FIFO) rule and a new rule unique to the present embodiment to rewrite a storage area when a cache miss occurs. To decide.

図3は、キャッシュ制御回路52の処理内容を示すフローチャートである。キャッシュ制御回路52は、キャッシュメモリ51のページ1〜Nの各記憶エリアに格納された各データのパターンROM204内でのページアドレスを記憶している。そして、画像表示LSI100内のいずれかのモジュール(例えば動画デコーダ111)からリードリクエストが与えられた場合、そのリードリクエストに含まれるリクエストアドレスとN個の記憶したページアドレスとを比較し、リクエストアドレスに対してヒットするデータがキャッシュメモリ51のいずれかのページの記憶エリアに格納されているか否かの判断、すなわち、キャッシュヒットまたはキャッシュミスのいずれが発生したかの判断を行う(ステップS1)。キャッシュヒットが発生した場合(ステップS1=「YES」)、キャッシュ制御回路52は、リクエストアドレスに対応したデータのキャッシュメモリ51内での所在を示すアクセスアドレスを生成し、このアクセスアドレスに対応したデータを読み出して、リードリクエストの発生元のモジュールであるマスタモジュールに供給する(ステップS2)。   FIG. 3 is a flowchart showing the processing contents of the cache control circuit 52. The cache control circuit 52 stores the page address in the pattern ROM 204 of each data stored in each storage area of the pages 1 to N of the cache memory 51. When a read request is given from any module (for example, the video decoder 111) in the image display LSI 100, the request address included in the read request is compared with the N stored page addresses, and the request address is set. On the other hand, it is determined whether or not hit data is stored in the storage area of any page of the cache memory 51, that is, whether a cache hit or a cache miss has occurred (step S1). When a cache hit occurs (step S1 = “YES”), the cache control circuit 52 generates an access address indicating the location in the cache memory 51 of the data corresponding to the request address, and the data corresponding to this access address. Are supplied to the master module, which is the module that generated the read request (step S2).

一方、キャッシュミスが発生した場合(ステップS1=「NO」)、キャッシュ制御回路52は、キャッシュメモリ51のページ1〜Nの各記憶エリアの中にキャッシュミスを発生させたリクエストアドレスの対象であるデータに連続するデータを格納しているものがあるか否か、より具体的にはそれらの記憶エリアの格納データの中にパターンROM204内でのページアドレスがキャッシュミスを発生させたリクエストアドレスに連続するものがあるか否かを判断する(ステップS3)。この判断結果が「YES」である場合、キャッシュ制御回路52は、本実施形態独自の新規な方法によりキャッシュメモリ51における書き換え対象の記憶エリアを決定する。さらに詳述すると、例えばキャッシュメモリ51のページkの記憶エリアの格納データのパターンROM204内でのページアドレスがキャッシュミスを発生させたリクエストアドレスに連続する場合、キャッシュ制御回路52は、ページkの記憶エリアを書き換え対象とする。そして、リクエストアドレスに対応するデータを含む1ページ分のデータをパターンROM204から読み出し、書き換え対象であるキャッシュメモリ51のページkの記憶エリアにリプレースする(ステップS4)。すなわち、キャッシュメモリ51のページkの記憶エリアのデータは、パターンROM204内のページk+1のデータで書き換えられる。また、キャッシュ制御回路52は、このページkの記憶エリアに格納されたデータのうちリクエストアドレスに対応したデータをマスタモジュールに供給する。   On the other hand, when a cache miss occurs (step S1 = “NO”), the cache control circuit 52 is the target of the request address that caused the cache miss in each of the storage areas of the pages 1 to N of the cache memory 51. Whether there is data that stores continuous data, more specifically, in the storage data of those storage areas, the page address in the pattern ROM 204 is continuous to the request address that caused the cache miss. It is determined whether there is something to be performed (step S3). When the determination result is “YES”, the cache control circuit 52 determines a rewrite target storage area in the cache memory 51 by a novel method unique to the present embodiment. More specifically, for example, when the page address in the pattern ROM 204 of the data stored in the storage area of page k of the cache memory 51 is consecutive to the request address that caused the cache miss, the cache control circuit 52 stores the page k. Rewrite the area. Then, one page of data including data corresponding to the request address is read from the pattern ROM 204 and replaced with the storage area of the page k of the cache memory 51 to be rewritten (step S4). That is, the data in the storage area of page k of the cache memory 51 is rewritten with the data of page k + 1 in the pattern ROM 204. Further, the cache control circuit 52 supplies data corresponding to the request address among the data stored in the storage area of the page k to the master module.

ステップS3において、キャッシュメモリ51のページ1〜Nの各記憶エリアの格納データのパターンROM204内での各ページアドレスの中にキャッシュミスを発生させたリクエストアドレスに連続するものがない場合、キャッシュ制御回路52は、FIFOルールに従ってリプレースメントを実行する(ステップS5)。すなわち、キャッシュ制御回路52は、このステップS5に進む度に、書き換え対象である記憶エリアを指示するFIFOポインタをページ1→ページ2→…→ページN→ページ1という具合に1ページずつ巡回的かつ順次に進め、FIFOポインタが指示するページを書き換え対象とする。そして、リクエストアドレスに対応するデータを含む1ページ分のデータをパターンROM204から読み出してキャッシュメモリ51の書き換え対象の記憶エリアにリプレースする。
以上が本実施形態におけるROMインタフェース105の構成および処理内容の詳細である。
If, in step S3, the page address in the storage ROM pattern 204 of each storage area of pages 1 to N of the cache memory 51 does not have a continuous address to the request address causing the cache miss, the cache control circuit 52 executes the replacement according to the FIFO rule (step S5). That is, each time the processing proceeds to step S5, the cache control circuit 52 sets the FIFO pointer indicating the storage area to be rewritten to page 1 → page 2 →... → page N → page 1 one page at a time. Proceeding sequentially, the page indicated by the FIFO pointer is to be rewritten. Then, the data for one page including the data corresponding to the request address is read from the pattern ROM 204 and replaced in the storage area to be rewritten in the cache memory 51.
The above is the details of the configuration and processing contents of the ROM interface 105 in the present embodiment.

本実施形態の特徴は、キャッシュミス発生時におけるリプレースメントの処理内容、より具体的には上述したステップS3〜S5の処理内容にある。このようなリプレースメントを行うのは、キャッシュメモリ51のページ数を増加させることなく、キャッシュヒット率を向上させ、安価であり、かつ、効率的なパターンROM204のアクセスを実現するためである。以下、その詳細を説明する。   The feature of this embodiment is the processing content of the replacement when a cache miss occurs, more specifically, the processing content of steps S3 to S5 described above. Such replacement is performed in order to improve the cache hit rate without increasing the number of pages of the cache memory 51, to realize inexpensive and efficient access to the pattern ROM 204. Details will be described below.

キャッシュメモリ51のページ数を増加させることなく、キャッシュミスを少なくしてキャッシュヒット率を向上させるためには、キャッシュミスが発生してリプレースメントを行う場合に、さらなるキャッシュミスの発生を回避すること、すなわち、その後発生するリクエストアドレスに対応したデータが格納されている記憶エリアをリプレースメントの際の書き換え対象になるべくしないことが必要である。この要求を満たすため、本実施形態では、キャッシュミスが発生してリプレースメントを行う場合に、その後、リクエストアドレスが発生するとは考えにくいデータを格納している記憶エリアを書き換え対象にする。   In order to reduce the cache miss and improve the cache hit rate without increasing the number of pages of the cache memory 51, avoid the occurrence of a further cache miss when a replacement occurs due to a cache miss. That is, it is necessary that the storage area in which data corresponding to the request address generated thereafter is stored should not be rewritten at the time of replacement. In order to satisfy this requirement, in this embodiment, when a cache miss occurs and replacement is performed, a storage area storing data that is unlikely to generate a request address is set as a rewrite target.

上述したように、画像表示LSI100内の各モジュールがROMインタフェース105を介してパターンROM204内のデータにアクセスするとき、通常は、パターンROM204内の連続したアドレスにある一連のデータを一方向的かつ連続的にアクセス対象とし、アクセス対象が後戻りすることはない。従って、パターンROM204内のあるページ(以下、先行ページという)のデータに対するアクセスが終了したとき、次のページ(以下、後続ページという)のデータがキャッシュメモリ51に格納されておらず、キャッシュミスが発生した場合に、先行ページのデータはキャッシュミスを発生させたモジュールにとって用済みであるといえる。そこで、本実施形態では、あるリクエストアドレスに対してキャッシュミスが発生してリプレースメントを行う場合において、そのリクエストアドレスの対象であるデータに連続するデータがキャッシュメモリ51のいずれかのページの記憶エリアに格納されている場合、その連続するデータを格納している記憶エリアを書き換え対象とするのである。このようにすることで、リクエストアドレスとして上記後続ページのデータのアドレスが与えられてキャッシュミスが発生したとき、上記先行ページのデータを記憶している記憶エリアが書き換え対象となる。このため、本実施形態では、キャッシュメモリ51のページ数を増加させなくてもキャッシュヒット率を向上させることができる。   As described above, when each module in the image display LSI 100 accesses data in the pattern ROM 204 via the ROM interface 105, normally, a series of data at consecutive addresses in the pattern ROM 204 is unidirectionally and continuously. The access target is not automatically returned. Therefore, when access to the data of a certain page (hereinafter referred to as the preceding page) in the pattern ROM 204 is completed, the data of the next page (hereinafter referred to as the subsequent page) is not stored in the cache memory 51, and a cache miss occurs. When it occurs, it can be said that the data of the preceding page is used for the module that caused the cache miss. Therefore, in the present embodiment, when a cache miss occurs for a certain request address and replacement is performed, data continuous to the data that is the target of the request address is stored in the storage area of any page of the cache memory 51. If it is stored, the storage area storing the continuous data is to be rewritten. In this manner, when a cache miss occurs when the address of the subsequent page data is given as the request address, the storage area storing the data of the previous page becomes a rewrite target. For this reason, in this embodiment, the cache hit rate can be improved without increasing the number of pages of the cache memory 51.

ここで、具体例を挙げて、本実施形態の作用効果を説明する。図4(a)〜(d)は、各種の方法によりキャッシュメモリ51のリプレースメントを行った場合のキャッシュメモリ51の記憶内容の変遷を各々例示するものある。これらの各例では、簡単のため、キャッシュメモリ51が4ページ分の記憶エリアを有する場合を想定している。また、これらの各例において、A(k)、B(m)、C(n)、D(p)等の各々は、画像表示LSI100内のモジュールA、B、C、D(これらの各々は動画デコーダ111であってもよく、静止画デコーダ112等の他のモジュールであってもよい。)の各々からのリードリクエストによりキャッシュメモリ51に格納された1ページ分のデータであり、A(k)、B(m)、C(n)、D(p)等の括弧内にあるk、m、n、p等のインデックスは、パターンROM204内において当該データが所在するページを示している。また、各例において、モジュールA、B、C、Dは、A>B>D>Cの順で高い帯域を必要とし、アクセスの頻度もA>B>D>Cの順になっているものとする。   Here, a specific example is given and the effect of this embodiment is demonstrated. FIGS. 4A to 4D illustrate transitions of the storage contents of the cache memory 51 when the cache memory 51 is replaced by various methods. In each of these examples, for simplicity, it is assumed that the cache memory 51 has a storage area for four pages. In each of these examples, each of A (k), B (m), C (n), D (p), etc. is a module A, B, C, D in the image display LSI 100 (each of these is 1 page of data stored in the cache memory 51 by a read request from each of the video decoder 111 and other modules such as the still image decoder 112), and A (k ), B (m), C (n), D (p), etc., the indices such as k, m, n, p, etc. indicate the page where the data is located in the pattern ROM 204. In each example, the modules A, B, C, and D require high bandwidths in the order of A> B> D> C, and the access frequencies are also in the order of A> B> D> C. To do.

図4(a)に示す例では、ROMインタフェース105のキャッシュ制御回路52に、上述した本実施形態によるリプレースメントの代わりに通常のFIFOルールによるリプレースメントを行わせている。この例において、最初、キャッシュメモリ51のページ4の記憶エリアにはパターンROM204のページkのデータA(k)が格納されており、モジュールAはこのデータA(k)を読み出してその処理を行っている。この時点においてFIFOポインタはページ4を指示している。モジュールAは、処理に必要なデータA(k)の全てを読み出し終えると、次のページk+1に属するデータに対するリードリクエストを発生する。しかし、このページk+1のデータはキャッシュメモリ51内にないのでキャッシュミスとなり、キャッシュ制御回路52は、FIFOポインタをページ1に進め、リードリクエストに対応したデータを含むパターンROM204のページk+1のデータA(k+1)を読み出してキャッシュメモリ51のページ1の記憶エリアにリプレースする。   In the example shown in FIG. 4A, the cache control circuit 52 of the ROM interface 105 is made to perform a replacement based on a normal FIFO rule instead of the replacement according to the present embodiment described above. In this example, first, the data A (k) of page k of the pattern ROM 204 is stored in the storage area of page 4 of the cache memory 51, and the module A reads this data A (k) and processes it. ing. At this point, the FIFO pointer points to page 4. When module A has finished reading all the data A (k) required for processing, it generates a read request for data belonging to the next page k + 1. However, since the data of this page k + 1 is not in the cache memory 51, a cache miss occurs, and the cache control circuit 52 advances the FIFO pointer to page 1, and the data A (page k + 1 of the pattern ROM 204 including the data corresponding to the read request). k + 1) is read and replaced with the storage area of page 1 of the cache memory 51.

その後、モジュールAは、このキャッシュメモリ51のページ1の記憶エリアからデータA(k+1)を読み出して処理を実行するが、モジュールAが処理に必要なデータA(k+1)の全てのデータを読み出し終える前に、他のモジュールBからパターンROM204のページm〜m+5までの各記憶エリアに記憶された一連のデータを対象とした一連のリードリクエストが連続して発生される。キャッシュ制御回路52は、これらの一連のリードリクエストの処理を行う。この一連のリードリクエストの発生に伴って6回のキャッシュミスが発生し、FIFOルールによる6回のリプレースメントが行われる。前半の3回のキャッシュミスの発生時には、パターンROM204のページm〜m+2の各データB(m)〜B(m+2)が順次読み出され、キャッシュメモリ51のページ2〜4の各記憶エリアに順次リプレースされている。そして、後半の3回のキャッシュミス発生時には、パターンROM204のページm+3〜m+5の各データB(m+3)〜B(m+5)が順次読み出され、FIFOルールに従い、キャッシュメモリ51のページ1〜3の各記憶エリアに順次リプレースされる。   Thereafter, the module A reads the data A (k + 1) from the storage area of page 1 of the cache memory 51 and executes the process, but the module A finishes reading all the data A (k + 1) necessary for the process. Previously, a series of read requests for a series of data stored in each storage area from the other module B to pages m to m + 5 of the pattern ROM 204 are continuously generated. The cache control circuit 52 processes these series of read requests. With this series of read requests, six cache misses occur, and six replacements are performed according to the FIFO rule. When the first three cache misses occur, the data B (m) to B (m + 2) of the pages m to m + 2 of the pattern ROM 204 are sequentially read and sequentially stored in the storage areas of the pages 2 to 4 of the cache memory 51. It has been replaced. When three cache misses occur in the latter half, the data B (m + 3) to B (m + 5) of the pages m + 3 to m + 5 of the pattern ROM 204 are sequentially read out, and the pages 1 to 3 of the cache memory 51 are read according to the FIFO rule. It is sequentially replaced in each storage area.

その後、モジュールAはパターンROM204のページk+1のデータA(k+1)のうち読み出し未了のデータについてのリードリクエストを発生させるが、このとき既にキャッシュメモリ51のページ1の記憶エリアにはデータB(m+3)が上書きされており、キャッシュメモリ51にデータA(k+1)は存在せず、キャッシュミスとなる。そこで、キャッシュ制御回路52は、パターンROM204のページk+1のデータA(k+1)を再び読み出し、FIFOルールに従い、キャッシュメモリ51のページ4の記憶エリアにリプレースする。   Thereafter, the module A generates a read request for unread data among the data A (k + 1) of the page k + 1 of the pattern ROM 204. At this time, the data B (m + 3) is already stored in the storage area of the page 1 of the cache memory 51. ) Is overwritten, and the data A (k + 1) does not exist in the cache memory 51, resulting in a cache miss. Therefore, the cache control circuit 52 reads the data A (k + 1) of the page k + 1 of the pattern ROM 204 again and replaces it in the storage area of the page 4 of the cache memory 51 according to the FIFO rule.

このFIFOルールによるリプレースメントを実行した場合には、以上のような同一ページの再読み出しが頻発する。図4(a)に示す例では、太枠で囲ったデータB(m+5)、C(n)がキャッシュメモリ51から全て読み出される前に他のデータによって上書きされ、その後発生するリードリクエストにより再びパターンROM204から読み出されている。   When the replacement based on the FIFO rule is executed, the same page as described above is frequently read again. In the example shown in FIG. 4A, the data B (m + 5) and C (n) surrounded by a thick frame are overwritten by other data before being read from the cache memory 51, and the pattern is again generated by a read request generated thereafter. It is read from the ROM 204.

図4(b)に示す例において、ROMインタフェース105のキャッシュ制御回路52はキャッシュミス発生時に上述した本実施形態による方法でリプレースメントを行っている。この例においても、図4(a)の場合と同様なリードリクエストが同じ順序で発生している。   In the example shown in FIG. 4B, the cache control circuit 52 of the ROM interface 105 performs replacement by the method according to this embodiment described above when a cache miss occurs. Also in this example, read requests similar to those in FIG. 4A are generated in the same order.

図4(b)に示す例において、最初、モジュールAは、キャッシュメモリ51のページ4の記憶エリアにあるデータA(k)を読み出して処理を行っている。この時点において、FIFOポインタはページ4を指示している。モジュールAは、キャッシュメモリ51のページ4の記憶エリアにあるデータA(k)を全て読み出すと、次のページk+1に属するデータに対するリードリクエストを発生する。このページk+1のデータはキャッシュメモリ51内にないのでキャッシュミスとなる。その際、キャッシュ制御回路52は、パターンROM204内においてリードリクエストに含まれるリクエストアドレスに連続するページアドレスのデータがキャッシュメモリ51に記憶されているか否かを判断する。この場合、リクエストアドレスがページk+1のものであるのに対し、キャッシュメモリ51のページ4の記憶エリアには、このページk+1に連続するページkのデータA(k)が格納されている。そして、このデータA(k)は、モジュールAにとって用済みのデータであり、キャッシュメモリ51に残しておいてもさらなるキャッシュヒットを期待することができない。そこで、キャッシュ制御回路52は、キャッシュメモリ51においてデータA(k)が格納されたページ4の記憶エリアを書き換え対象とし、パターンROM204からページk+1のデータA(k+1)を読み出して、キャッシュメモリ51のページ4の記憶エリアにリプレースする。   In the example shown in FIG. 4B, first, the module A reads and processes the data A (k) in the storage area of page 4 of the cache memory 51. At this point, the FIFO pointer points to page 4. When module A reads all data A (k) in the storage area of page 4 of cache memory 51, module A generates a read request for data belonging to the next page k + 1. Since the data of page k + 1 is not in the cache memory 51, a cache miss occurs. At this time, the cache control circuit 52 determines whether or not the cache memory 51 stores the data of the page address continuous to the request address included in the read request in the pattern ROM 204. In this case, the request address is that of page k + 1, whereas the data A (k) of page k continuous to page k + 1 is stored in the storage area of page 4 of cache memory 51. This data A (k) is used data for the module A, and even if it remains in the cache memory 51, no further cache hit can be expected. Thus, the cache control circuit 52 sets the storage area of page 4 in which the data A (k) is stored in the cache memory 51 as a rewrite target, reads the data A (k + 1) of page k + 1 from the pattern ROM 204, and stores the data in the cache memory 51. Replace the page 4 storage area.

その後、モジュールAは、このキャッシュメモリ51のページ4の記憶エリアからデータA(k+1)を読み出して処理を実行するが、処理に必要なデータA(k+1)の全てのデータを読み出し終える前に、他のモジュールBからパターンROM204のページm〜m+5までの各記憶エリアに記憶された一連のデータを対象とした一連のリードリクエストが連続して発生される。キャッシュ制御回路52は、これらの一連のリードリクエストの処理を行う。   Thereafter, the module A reads out the data A (k + 1) from the storage area of the page 4 of the cache memory 51 and executes the process. Before all the data A (k + 1) necessary for the process is read out, A series of read requests for a series of data stored in each storage area from the other modules B to pages m to m + 5 of the pattern ROM 204 are continuously generated. The cache control circuit 52 processes these series of read requests.

この一連のリードリクエストの発生に伴って6回のキャッシュミスが発生し、その都度、リプレースメントが行われる。最初のキャッシュミスの発生時には、パターンROM204のページmに連続するデータがキャッシュメモリ51に格納されていないので、キャッシュ制御回路52は、FIFOルールに従い、FIFOポインタを1だけ進めてページ1を指示させ、キャッシュメモリ51においてFIFOポインタが指示するページ1の記憶エリアを書き換え対象として選択し、パターンROM204のページmのデータB(m)を読み出してキャッシュメモリ51のページ1の記憶エリアにリプレースする。その後、ページm+1のデータに対するリードリクエストが発生してキャッシュミスが発生する。このとき、キャッシュメモリ51のページ1の記憶エリアにはリードリクエストの対象であるページm+1に連続するページmのデータB(m)が格納されている。そこで、キャッシュ制御回路52は、キャッシュメモリ51のページ1の記憶エリアを書き換え対象とし、パターンROM204のページm+1のデータB(m+1)を読み出してキャッシュメモリ51のページ1の記憶エリアにリプレースする。このリプレースメントは、FIFOルールによるものではないので、この時点でFIFOポインタの更新はなく、FIFOポインタの指示はページ1のままである。その後、パターンROM204のページm+2〜m+5を対象としたリードリクエストが発生してキャッシュミスが発生するとき、いずれの場合においても、リードリクエストの対象であるリクエストアドレスに連続するデータを格納しているキャッシュメモリ51のページ1の記憶エリアが書き換え対象となる。このため、キャッシュミス発生の都度、パターンROM204のページm+2〜m+5の各データB(m+2)〜B(m+5)が順次読み出され、キャッシュメモリ51のページ1の記憶エリアにリプレースされる。この間、FIFOポインタの更新はない。   With this series of read requests, six cache misses occur, and replacement is performed each time. When the first cache miss occurs, data continuous to page m of the pattern ROM 204 is not stored in the cache memory 51. Therefore, the cache control circuit 52 advances the FIFO pointer by 1 to point to page 1 according to the FIFO rule. Then, the page 1 storage area indicated by the FIFO pointer in the cache memory 51 is selected as a rewrite target, and the data B (m) of page m in the pattern ROM 204 is read and replaced with the page 1 storage area in the cache memory 51. Thereafter, a read request for the data of page m + 1 occurs and a cache miss occurs. At this time, data B (m) of page m continuous with page m + 1, which is the target of the read request, is stored in the storage area of page 1 of the cache memory 51. Therefore, the cache control circuit 52 sets the storage area of page 1 of the cache memory 51 as a rewrite target, reads the data B (m + 1) of page m + 1 of the pattern ROM 204, and replaces it with the storage area of page 1 of the cache memory 51. Since this replacement is not based on the FIFO rule, the FIFO pointer is not updated at this point, and the instruction of the FIFO pointer remains at page 1. Thereafter, when a read request for the pages m + 2 to m + 5 of the pattern ROM 204 occurs and a cache miss occurs, in any case, a cache storing continuous data at the request address that is the target of the read request. The storage area of page 1 of the memory 51 is to be rewritten. For this reason, each time a cache miss occurs, the data B (m + 2) to B (m + 5) of the pages m + 2 to m + 5 of the pattern ROM 204 are sequentially read and replaced with the storage area of page 1 of the cache memory 51. During this time, there is no FIFO pointer update.

その後、モジュールAがパターンROM204のページkのデータA(k+1)のうち読み出し未了のデータについてのリードリクエストを発生させるが、このときキャッシュメモリ51のページ4の記憶エリアにはデータA(k+1)が残っており、キャッシュヒットとなる。このため、パターンROM204のページk+1のデータA(k+1)の再度の読み出しは行われない。   Thereafter, the module A generates a read request for unread data among the data A (k + 1) of the page k of the pattern ROM 204. At this time, the data A (k + 1) is stored in the storage area of the page 4 of the cache memory 51. Remains, and it becomes a cache hit. For this reason, the data A (k + 1) of page k + 1 in the pattern ROM 204 is not read again.

その後、モジュールAがパターンROM204のページqのデータについてのリードリクエストを発生させると、このページqのデータがキャッシュメモリ51に格納されていないことからキャッシュミスとなる。また、このページqのデータに連続するデータは、キャッシュメモリ51のいずれのページにも格納されていない。このため、キャッシュ制御回路52は、FIFOルールによるリプレースメントを行う。すなわち、FIFOポインタの指示をページ1からページ2に更新し、キャッシュメモリ51におけるページ2の記憶エリアを書き換え対象とし、パターンROM204のページqのデータA(q)を読み出してキャッシュメモリ51のページ2の記憶エリアにリプレースする。以下同様であり、キャッシュミスが発生した場合において、パターンROM204内においてそのキャッシュミスを発生させたリクエストアドレスに連続するページのデータがキャッシュメモリ51のいずれの記憶エリアにも格納されていない場合には、FIFOポインタが1ページだけ進められ、FIFOポインタが指示するページの記憶エリアが書き換え対象となる。   Thereafter, when the module A generates a read request for the data of page q in the pattern ROM 204, a cache miss occurs because the data of page q is not stored in the cache memory 51. Further, data continuous to the data of page q is not stored in any page of the cache memory 51. For this reason, the cache control circuit 52 performs replacement according to the FIFO rule. That is, the instruction of the FIFO pointer is updated from page 1 to page 2, the storage area of page 2 in the cache memory 51 is targeted for rewriting, the data A (q) of page q in the pattern ROM 204 is read, and page 2 of the cache memory 51 is read. To the storage area. The same applies to the following. In the case where a cache miss occurs, the data of the page that continues to the request address that caused the cache miss in the pattern ROM 204 is not stored in any storage area of the cache memory 51. The FIFO pointer is advanced by one page, and the storage area of the page indicated by the FIFO pointer is the target of rewriting.

以上のように、本実施形態によれば、キャッシュミスの発生時、パターンROM204内においてそのキャッシュミスを発生させたリクエストアドレスに連続するページのデータがキャッシュメモリ51のいずれかの記憶エリアに格納されている場合には、FIFOポインタの更新は行われず、その連続するページのデータが格納されている記憶エリアが書き換え対象とされる。また、キャッシュミスの発生時、パターンROM204内においてそのキャッシュミスを発生させたリクエストアドレスに連続するページのデータがキャッシュメモリ51のいずれの記憶エリアにも格納されていない場合には、FIFOポインタが1ページだけ進められ、FIFOポインタが指示する記憶エリアが書き換え対象とされる。従って、本実施形態によれば、FIFOポインタの更新速度が低下するため、キャッシュッモリ51においてキャッシュヒットの可能性のある記憶エリアが、FIFOルールによるリプレースメントによって上書きされるのを抑制し、パターンROM204における同一ページの再読み出しの発生頻度を低下させることができる。図4(b)に示す例は、図4(a)と同様なリードリクエストが発生する場合を想定しているが、パターンROM204における同一ページの再読み出しは1回も発生していない。   As described above, according to the present embodiment, when a cache miss occurs, the data of the page continuous to the request address that caused the cache miss in the pattern ROM 204 is stored in any storage area of the cache memory 51. If it is, the FIFO pointer is not updated, and the storage area in which the data of the continuous pages is stored is to be rewritten. Further, when a cache miss occurs, if the data of the page continuous to the request address causing the cache miss in the pattern ROM 204 is not stored in any storage area of the cache memory 51, the FIFO pointer is set to 1. Only the page is advanced, and the storage area indicated by the FIFO pointer is the target of rewriting. Therefore, according to the present embodiment, the FIFO pointer update speed is reduced, so that the memory area that may cause a cache hit in the cache memory 51 is prevented from being overwritten by the replacement according to the FIFO rule, and the pattern ROM 204 The frequency of occurrence of re-reading of the same page can be reduced. The example shown in FIG. 4B assumes a case where a read request similar to that in FIG. 4A occurs, but the same page in the pattern ROM 204 has not been read again.

図4(c)に示す例では、ROMインタフェース105のキャッシュ制御回路52に、キャッシュミス発生時に上述した本実施形態によるリプレースメントの代わりに通常のLRUルールによるリプレースメントを行わせている。そして、この例では、D(p)、D(p+1)、D(p+2)、B(m)、C(n)、A(k)、B(m+1)、B(m+2)、B(m+3)、C(n)、A(k+1)、D(p+2)の順に各々を対象としたリードリクエストが発生し、キャッシュ制御回路52がその処理を行っている。この例の場合、発生頻度によって太線枠で囲ったD(p+2)、C(n)の再読み出しが行われる可能性がある。   In the example shown in FIG. 4C, the cache control circuit 52 of the ROM interface 105 is caused to perform a replacement according to a normal LRU rule instead of the replacement according to the present embodiment described above when a cache miss occurs. In this example, D (p), D (p + 1), D (p + 2), B (m), C (n), A (k), B (m + 1), B (m + 2), B (m + 3) , C (n), A (k + 1), and D (p + 2) in the order of read requests are generated, and the cache control circuit 52 performs the processing. In the case of this example, D (p + 2) and C (n) may be reread according to the occurrence frequency.

それに対して、図4(d)に示す本実施形態の方式では、ROMインタフェース105のキャッシュ制御回路52は、キャッシュミス発生時、リクエストアドレスに連続するページのデータがキャッシュメモリ51に格納されている場合には、その連続するページのデータの記憶エリアを書き換え対象とし、リクエストアドレスに連続するページのデータがキャッシュメモリ51に格納されていない場合には、通常のFIFOルールによるリプレースメントを行っているので、D(p)、D(p+1)、D(p+2)、B(m)、C(n)、A(k)、B(m+1)、B(m+2)、B(m+3)、C(n)、A(k+1)、D(p+2)の順に各々を対象としたリードリクエストが発生した場合、図4(c)の場合と異なり、同一ページの再読み出しは発生しない。このように本実施形態によれば、通常のLRUよりもキャッシュヒット率を向上させることができる。さらにLRUルールによるリプレースメントを行うためには、モジュール毎にパターンROM204へのアクセス頻度を管理する回路を設けなければならないため、その分だけ回路規模が大型化する。従って、回路全体を小型化する観点からは本実施形態によるリプレースメント方法を採用することが好ましい。   On the other hand, in the method of this embodiment shown in FIG. 4D, the cache control circuit 52 of the ROM interface 105 stores the page data continuous to the request address in the cache memory 51 when a cache miss occurs. In this case, the storage area of the continuous page data is to be rewritten, and if the page data continuous to the request address is not stored in the cache memory 51, the replacement is performed according to the normal FIFO rule. , D (p), D (p + 1), D (p + 2), B (m), C (n), A (k), B (m + 1), B (m + 2), B (m + 3), C (n) , A (k + 1), and D (p + 2) in the order of read requests, unlike the case of FIG. 4C, Reading does not occur. As described above, according to the present embodiment, the cache hit rate can be improved as compared with the normal LRU. Furthermore, in order to perform replacement according to the LRU rule, it is necessary to provide a circuit for managing the access frequency to the pattern ROM 204 for each module, so that the circuit scale increases accordingly. Therefore, it is preferable to employ the replacement method according to the present embodiment from the viewpoint of downsizing the entire circuit.

以上のように、本実施形態によれば、キャッシュメモリ51のページ数を増加させなくてもキャッシュヒット率を向上させて、パターンROM204について効率的なデータ読み出しを行うことができる。   As described above, according to the present embodiment, it is possible to improve the cache hit rate without increasing the number of pages of the cache memory 51, and to perform efficient data reading from the pattern ROM 204.

<他の実施形態>
以上、この発明の実施形態を説明したが、この発明には、他にも各種の実施形態が考えられる。例えば次の通りである。
<Other embodiments>
As mentioned above, although embodiment of this invention was described, various other embodiment can be considered to this invention. For example:

(1)上記実施形態では、ROMインタフェース105を1個だけ画像表示LSI100に設けたが、複数個設けてもよい。 (1) In the above embodiment, only one ROM interface 105 is provided in the image display LSI 100, but a plurality of ROM interfaces 105 may be provided.

(2)上記実施形態では、画像表示LSI100内のモジュールがパターンROM204内において複数ページに跨る一連のデータを読み出す場合に、ページ1、ページ2、…という具合に昇順にアクセスしてゆくことを前提とした。しかし、このように昇順にアクセスするモジュールと、ページ10、ページ9、…という具合に降順にアクセスしてゆくモジュールとが画像表示LSI100内に混在する場合や、同一のモジュールが複数の連続したページを昇順にアクセスしてゆく過程と降順にアクセスしてゆく過程を交互に繰り返すようなアプリケーションも考えられる。そのような態様では、キャッシュ制御回路52は、上述したステップS3において、キャッシュメモリ51のページ1〜Nの各記憶エリアの中にパターンROM204においてキャッシュミスを発生させたリクエストアドレスが属するページの後のページまたは前のページのデータを格納しているものがあるか否かを判断すればよい。 (2) In the above embodiment, when the module in the image display LSI 100 reads out a series of data across a plurality of pages in the pattern ROM 204, it is assumed that the pages are accessed in ascending order such as page 1, page 2,. It was. However, the module that accesses the ascending order and the module that accesses the descending order such as page 10, page 9,... Are mixed in the image display LSI 100, or the same module includes a plurality of continuous pages. There may be an application that alternately repeats the process of accessing in ascending order and the process of accessing in descending order. In such an aspect, the cache control circuit 52 performs the subsequent processing of the page to which the request address that caused the cache miss in the pattern ROM 204 belongs to each of the storage areas of the pages 1 to N of the cache memory 51 in step S3 described above. What is necessary is just to judge whether there exists what has stored the data of the page or the previous page.

(3)キャッシュミスを発生させたリードリクエストの対象であるデータとキャッシュメモリ51の各ページの記憶エリア内のデータが連続するものであるか否かは、キャッシュミスを発生させたキャッシュリクエストの発生元であるモジュールの処理との関係で定まる。例えば、あるモジュールがパターンROM204のページ1、2、3、…の各データを順次読み出して処理する場合、ページ1とページ2のデータは連続するデータ、ページ2とページ3のデータは連続するデータである。しかし、他のモジュールがパターンROM204のページ1、9、17、…の各データを順次読み出して処理する場合、ページ1とページ9のデータは連続するデータ、ページ9とページ17のデータは連続するデータである。そこで、モジュール毎に、リクエストアドレスと、このリクエストアドレスの対象であるデータに連続するデータのページアドレスとの対応関係を定義する情報を用意しておき、上述したステップS3では、キャッシュミスを発生させたモジュールに対応した定義情報を選択して、書き換え対象を決定するための判断に用いてもよい。あるいは、このような定義情報を幾つか用意しておき、画像表示LSI100の外部から定義情報の選択指示をキャッシュ制御回路52に与え、キャッシュ制御回路52は、指示された定義情報を用いてステップS3の判断を行うように構成してもよい。 (3) Whether or not the data that is the target of the read request that caused the cache miss and the data in the storage area of each page of the cache memory 51 is continuous is the occurrence of the cache request that caused the cache miss It is determined in relation to the processing of the original module. For example, when a certain module sequentially reads and processes the data of pages 1, 2, 3,... Of the pattern ROM 204, the data of page 1 and page 2 is continuous data, and the data of page 2 and page 3 is continuous data. It is. However, when other modules sequentially read and process the data of pages 1, 9, 17,... Of the pattern ROM 204, the data of page 1 and page 9 are continuous data, and the data of page 9 and page 17 are continuous. It is data. Therefore, for each module, information that defines the correspondence relationship between the request address and the page address of the data continuous to the data that is the target of the request address is prepared. In step S3 described above, a cache miss occurs. The definition information corresponding to each module may be selected and used for determination to determine the rewrite target. Alternatively, some of such definition information is prepared, and a definition information selection instruction is given to the cache control circuit 52 from the outside of the image display LSI 100, and the cache control circuit 52 uses the instructed definition information to perform step S3. You may comprise so that judgment may be performed.

100……画像表示LSI、101……クロックジェネレータ、102……CPUインタフェース、103……汎用メモリ、104……SDRAMインタフェース、105……ROMインタフェース、111……動画デコーダ、112……静止画デコーダ、113……描画エンジン、114……音源、117……表示コントローラ、115……スプライトバッファ、116……フレームバッファ、201……CPU、202……表示装置、203……SDRAM、204……パターンROM、51……キャッシュメモリ、52……キャッシュ制御回路。 DESCRIPTION OF SYMBOLS 100 ... Image display LSI, 101 ... Clock generator, 102 ... CPU interface, 103 ... General-purpose memory, 104 ... SDRAM interface, 105 ... ROM interface, 111 ... Movie decoder, 112 ... Still picture decoder, 113 ... Drawing engine, 114 ... Sound source, 117 ... Display controller, 115 ... Sprite buffer, 116 ... Frame buffer, 201 ... CPU, 202 ... Display device, 203 ... SDRAM, 204 ... Pattern ROM , 51... Cache memory, 52... Cache control circuit.

Claims (2)

画像処理を行うモジュールを含む複数のモジュールと、
前記複数のモジュールの処理対象となるデータを記憶したパターンメモリと前記複数のモジュールとの間のデータの授受を仲介するメモリインタフェースとを具備し、
前記メモリインタフェースは、前記パターンメモリから読み出されたデータを格納する複数ページ分の記憶エリアを有するキャッシュメモリと、
前記複数のモジュールの中のいずれかのモジュールから前記キャッシュメモリに格納されたデータを対象とするリードリクエストが与えられた場合には、そのリードリクエストの対象であるデータを前記キャッシュメモリから読み出して当該モジュールに対して出力し、前記キャッシュメモリに格納されていないデータを対象とするリードリクエストが与えられた場合には、前記キャッシュメモリ内において書き換え対象の記憶エリアを決定し、前記リードリクエストの対象であるデータを含む1ページ分のデータを前記パターンメモリから読み出して前記書き換え対象の記憶エリアに格納するとともに、前記リードリクエストの対象であるデータを当該モジュールに対して出力する手段であり、前記リードリクエストの対象であるデータが前記キャッシュメモリに格納されておらず、かつ、前記パターンメモリにおいて前記リードリクエストの対象であるデータが属するページと連続するページのデータが前記キャッシュメモリのいずれかの記憶エリアに格納されている場合に、当該記憶エリアを書き換え対象とし、前記リードリクエストの対象であるデータが前記キャッシュメモリに格納されておらず、かつ、前記パターンメモリにおいて前記リードリクエストの対象であるデータが属するページと連続するページのデータが前記キャッシュメモリのいずれの記憶エリアにも格納されていない場合に、前記キャッシュメモリの複数の記憶エリアを所定の順序で巡回的かつ順次に選択して書き換え対象とするキャッシュ制御手段と
を具備することを特徴とする画像処理装置。
A plurality of modules including modules for image processing;
A pattern memory that stores data to be processed by the plurality of modules, and a memory interface that mediates data exchange between the plurality of modules;
The memory interface includes a cache memory having a storage area for a plurality of pages for storing data read from the pattern memory;
When a read request for data stored in the cache memory is given from any one of the plurality of modules, the target data of the read request is read from the cache memory and When a read request is output to the module and the target data is not stored in the cache memory, a storage area to be rewritten is determined in the cache memory, and the read request target stores the data of one page containing some data in the storage area of the rewritten is read from the pattern memory, the data is the read request target a unit to be output to the module, the read request The data that is the target of When the data of the page that is not stored in the cache memory and is continuous with the page to which the data that is the target of the read request belongs in the pattern memory is stored in any storage area of the cache memory The memory area is a target for rewriting, the data that is the target of the read request is not stored in the cache memory, and the page that is continuous with the page to which the data that is the target of the read request belongs in the pattern memory A cache control means for selecting a plurality of storage areas of the cache memory cyclically and sequentially in a predetermined order to be rewritten when data is not stored in any storage area of the cache memory; An image processing apparatus.
前記パターンメモリは、ページ単位でのアクセスを受け付ける不揮発性メモリであることを特徴とする請求項1に記載の画像処理装置。The image processing apparatus according to claim 1, wherein the pattern memory is a non-volatile memory that accepts access in units of pages.
JP2009106733A 2009-04-24 2009-04-24 Image processing device Active JP5402210B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009106733A JP5402210B2 (en) 2009-04-24 2009-04-24 Image processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009106733A JP5402210B2 (en) 2009-04-24 2009-04-24 Image processing device

Publications (2)

Publication Number Publication Date
JP2010257237A JP2010257237A (en) 2010-11-11
JP5402210B2 true JP5402210B2 (en) 2014-01-29

Family

ID=43318064

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009106733A Active JP5402210B2 (en) 2009-04-24 2009-04-24 Image processing device

Country Status (1)

Country Link
JP (1) JP5402210B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1061449A4 (en) * 1998-02-04 2005-12-21 Hitachi Ltd Disk cache control method, disk array device, and storage device
US6223258B1 (en) * 1998-03-31 2001-04-24 Intel Corporation Method and apparatus for implementing non-temporal loads
TW501011B (en) * 1998-05-08 2002-09-01 Koninkl Philips Electronics Nv Data processing circuit with cache memory

Also Published As

Publication number Publication date
JP2010257237A (en) 2010-11-11

Similar Documents

Publication Publication Date Title
US10032246B2 (en) Approach to caching decoded texture data with variable dimensions
JP5914148B2 (en) SSD (solid state drive) device
JP2009134391A (en) Stream processor, stream processing method, and data processing system
JP2001216194A (en) Arithmetic processor
JP2008033688A (en) Cache memory control method and device
CN115809028B (en) Cache data replacement method and device, graphics processing system and electronic equipment
US20180260333A1 (en) Systems and methods for addressing a cache with split-indexes
JP2009128920A (en) Information processing apparatus and method for controlling information processing apparatus
CN101212680B (en) Image data storage access method and system
KR102619668B1 (en) Apparatus and method of using a slice update map
JP4982354B2 (en) Information processing device
JP2009116661A (en) Storage device, storage method and program
JP5402210B2 (en) Image processing device
US6560686B1 (en) Memory device with variable bank partition architecture
US6914605B2 (en) Graphic processor and graphic processing system
JP2007189687A (en) Apparatus and method of video decoding to alternatively store lines of screen in pixels, and method of storing reference screen
JP5071977B2 (en) System and method for managing cache memory
JP2007233838A (en) Control method for memory system
JP3772569B2 (en) Image processing apparatus and image processing method
JP2007226330A5 (en)
JP2008282065A (en) Semiconductor device equipped with address conversion memory access mechanism
JP2004246889A (en) Computer system for incorporating sequential buffer and improving dsp data access performance, and access method therefor
JP3747213B1 (en) NAND flash memory device and controller for sequential ROM interface
US10802712B2 (en) Information processing apparatus and method of processing information
JP6424330B2 (en) INFORMATION PROCESSING APPARATUS AND INFORMATION PROCESSING METHOD

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120221

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130627

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130716

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130821

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130906

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20131001

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20131014

R150 Certificate of patent or registration of utility model

Ref document number: 5402210

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150