JP4799171B2 - Drawing apparatus and data transfer method - Google Patents

Drawing apparatus and data transfer method Download PDF

Info

Publication number
JP4799171B2
JP4799171B2 JP2005371738A JP2005371738A JP4799171B2 JP 4799171 B2 JP4799171 B2 JP 4799171B2 JP 2005371738 A JP2005371738 A JP 2005371738A JP 2005371738 A JP2005371738 A JP 2005371738A JP 4799171 B2 JP4799171 B2 JP 4799171B2
Authority
JP
Japan
Prior art keywords
data
entry
cache
preload
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.)
Expired - Fee Related
Application number
JP2005371738A
Other languages
Japanese (ja)
Other versions
JP2007172455A (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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2005371738A priority Critical patent/JP4799171B2/en
Priority to US11/644,200 priority patent/US20070165042A1/en
Publication of JP2007172455A publication Critical patent/JP2007172455A/en
Priority to US12/560,307 priority patent/US20100005243A1/en
Application granted granted Critical
Publication of JP4799171B2 publication Critical patent/JP4799171B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)
  • Image Generation (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Description

この発明は、描画装置及びデータ転送方法に関するもので、例えば複数のピクセルを同時に並列処理する画像処理LSIに関する。   The present invention relates to a drawing apparatus and a data transfer method, for example, an image processing LSI that simultaneously processes a plurality of pixels in parallel.

近年、CPU(Central Processing Unit)の動作の高速化に伴って、画像描画装置に対しても高速化の要求が高まってきている。   In recent years, with the speeding up of the operation of a CPU (Central Processing Unit), there has been an increasing demand for speeding up image drawing apparatuses.

画像描画装置は一般に、投入された図形をピクセルに分解する図形分解手段と、ピクセルに描画処理を加えるピクセル処理手段と、描画結果を読み書きする記憶手段とを備える。近年、CG(Computer Graphics)技術の進歩により、複雑なピクセル処理技術が頻繁に用いられるようになってきている。その結果ピクセル処理手段の負荷が大きくなるため、ピクセル処理手段を並列化することが行われている(例えば特許文献1参照)。   In general, an image drawing apparatus includes a graphic decomposing unit that decomposes an input graphic into pixels, a pixel processing unit that applies a drawing process to the pixels, and a storage unit that reads and writes the drawing result. In recent years, with the advancement of CG (Computer Graphics) technology, complex pixel processing technology has been frequently used. As a result, since the load on the pixel processing means increases, the pixel processing means are parallelized (see, for example, Patent Document 1).

しかしながら上記従来の構成であると、メインメモリ上のデータをキャッシュに読み出すために、種々のバッファメモリが必要であった。その結果、ハードウェアコストが上昇するという問題があった。
米国特許5,982,211号
However, with the above-described conventional configuration, various buffer memories are required to read data on the main memory into the cache. As a result, there is a problem that the hardware cost increases.
US Pat. No. 5,982,211

この発明は、上記事情に鑑みてなされたもので、その目的は、ハードウェアコストを削減出来る描画装置及びデータ転送方法を提供することにある。   The present invention has been made in view of the above circumstances, and an object thereof is to provide a drawing apparatus and a data transfer method capable of reducing hardware costs.

態様に係る描画装置は、画像データを保持するメインメモリと、前記メインメモリとの間で前記画像データの授受を行うキャッシュメモリと、前記メインメモリと前記キャッシュメモリとの間のデータ転送を管理すると共に、前記キャッシュメモリの状態に関する情報を保持する転送制御装置と、前記キャッシュメモリ内の前記画像データを用いて画像処理プログラムを実行し、前記画像処理プログラムを実行して得られた画像データを前記キャッシュメモリに保持させるプログラム実行部とを具備し、前記キャッシュメモリは、各々が前記画像データを保持可能な複数のエントリを含み、前記転送制御装置は、前記メインメモリから前記キャッシュメモリのエントリに転送される前記画像データの識別情報と、前記プログラム実行部で得られた前記画像データが前記エントリに保持されているか否かを示すデータ更新情報とを、前記エントリ毎に保持し、前記転送制御装置は、いずれかの前記エントリに対応した前記データ更新情報がアサートされている場合、該エントリ内の前記画像データを前記メインメモリに書き込む。 A rendering apparatus according to an aspect manages a main memory that holds image data, a cache memory that exchanges the image data with the main memory, and data transfer between the main memory and the cache memory And a transfer control device that holds information relating to the state of the cache memory, an image processing program executed using the image data in the cache memory, and image data obtained by executing the image processing program A program execution unit to be held in the cache memory, and the cache memory includes a plurality of entries each capable of holding the image data, and the transfer control device transfers the entries from the main memory to the cache memory. Identification information of the image data to be transferred and obtained by the program execution unit And said image data is data update information indicating whether it is held in the entry, and held for each of the entries, the transfer control device, the data update information asserted corresponding to one of said entry If so, the image data in the entry is written into the main memory.

この発明によれば、ハードウェアコストを削減出来る描画装置及びデータ転送方法を提供出来る。   According to the present invention, it is possible to provide a drawing apparatus and a data transfer method that can reduce hardware costs.

以下、この発明の実施形態を図面を参照して説明する。この説明に際し、全図にわたり、共通する部分には共通する参照符号を付す。   Embodiments of the present invention will be described below with reference to the drawings. In the description, common parts are denoted by common reference symbols throughout the drawings.

この発明の第1の実施形態に係るグラフィックプロセッサについて、図1を用いて説明する。図1は、本実施形態に係るグラフィックプロセッサのブロック図である。   A graphic processor according to a first embodiment of the present invention will be described with reference to FIG. FIG. 1 is a block diagram of a graphic processor according to the present embodiment.

図示するように、グラフィックプロセッサ10はラスタライザ(rasterizer)11、複数のピクセルシェーダ(pixel shader)12−0〜12−3、及びローカルメモリ13を備えている。なお、本実施形態ではピクセルシェーダ12の数は4個であるがこれは一例に過ぎず、8個、16個、32個等でも良く、その数は限定されるものではない。   As illustrated, the graphic processor 10 includes a rasterizer 11, a plurality of pixel shaders 12-0 to 12-3, and a local memory 13. In the present embodiment, the number of pixel shaders 12 is four, but this is only an example, and may be eight, sixteen, thirty-two, etc., and the number is not limited.

ラスタライザ11は、入力された図形情報に従ってピクセル(pixel)を生成する。ピクセルとは、所定の図形を描画する際に取り扱われる最小単位の領域のことであり、ピクセルの集合によって図形が描画される。生成されたピクセルはピクセルシェーダ12−0〜12−3へ投入される。   The rasterizer 11 generates pixels according to the input graphic information. A pixel is a minimum unit area that is handled when a predetermined figure is drawn, and a figure is drawn by a set of pixels. The generated pixels are input to the pixel shaders 12-0 to 12-3.

ピクセルシェーダ12−0〜12−3は、ラスタライザ11から投入されたピクセルにつき演算処理を行い、ローカルメモリ13上に画像データを生成する。ピクセルシェーダ12−0〜12−3の各々は、データ振り分け部20、テクスチャユニット(texture unit)23、及び複数のピクセルシェーダユニット24を備えている。   The pixel shaders 12-0 to 12-3 perform arithmetic processing on the pixels input from the rasterizer 11 and generate image data on the local memory 13. Each of the pixel shaders 12-0 to 12-3 includes a data distribution unit 20, a texture unit 23, and a plurality of pixel shader units 24.

データ振り分け部20はラスタライザ11からデータを受け取る。そして、受け取ったデータをピクセルシェーダ12−0〜12−3へ割り振る。   The data distribution unit 20 receives data from the rasterizer 11. Then, the received data is allocated to the pixel shaders 12-0 to 12-3.

テクスチャユニット23はローカルメモリ13からテクスチャデータを読み出し、テクスチャマッピングに必要な処理を行う。テクスチャマッピングとは、ピクセルシェーダユニット24で処理されたピクセルにテクスチャデータを貼り付ける処理のことであり、ピクセルシェーダユニット24において行われる。   The texture unit 23 reads texture data from the local memory 13 and performs processing necessary for texture mapping. Texture mapping is a process of pasting texture data on the pixels processed by the pixel shader unit 24 and is performed in the pixel shader unit 24.

ピクセルシェーダユニット24はシェーダエンジン部であり、ピクセルデータに対してシェーダプログラムを実行する。そしてピクセルシェーダユニット24のそれぞれはSIMD(Single Instruction Multiple Data)動作を行って、複数個のピクセルを同時に処理する。ピクセルシェーダユニット24はそれぞれ、命令制御部25、描画処理部26、及びデータ制御部27を備えている。これらの回路ブロック25〜27の詳細については後述する。   The pixel shader unit 24 is a shader engine unit, and executes a shader program for pixel data. Each of the pixel shader units 24 performs a single instruction multiple data (SIMD) operation to simultaneously process a plurality of pixels. Each pixel shader unit 24 includes an instruction control unit 25, a drawing processing unit 26, and a data control unit 27. Details of these circuit blocks 25 to 27 will be described later.

ローカルメモリ13は、例えばeDRAM(embedded DRAM)であり、ピクセルシェーダ12−0〜12−3で描画されたピクセルデータを記憶する。   The local memory 13 is eDRAM (embedded DRAM), for example, and stores pixel data drawn by the pixel shaders 12-0 to 12-3.

次に、本実施形態に係るグラフィックプロセッサにおける図形描画の概念について説明する。図2は、図形を描画すべき全体の空間を示す概念図である。なお、図2に示す描画領域は、ローカルメモリ内においてピクセルデータを保持するメモリ空間(以下、フレームバッファと呼ぶ)に相当する。   Next, the concept of graphic drawing in the graphic processor according to the present embodiment will be described. FIG. 2 is a conceptual diagram showing the entire space in which a figure is to be drawn. The drawing area shown in FIG. 2 corresponds to a memory space (hereinafter referred to as a frame buffer) that holds pixel data in the local memory.

図示するように、フレームバッファは、マトリクス状に配置された例えば(40×15)個のブロックBLK0〜BLK599を含んでいる。ブロックの数は一例に過ぎず、(40×15)個に限定されるものではない。ピクセルシェーダ12−0〜12−3は、ブロックBLK0〜BLK599順にピクセルを生成する。各ブロックBLK0〜BLK599はそれぞれ、マトリクス状に配置された32個のスタンプ(stamp)を含んで形成されている。図3は、図2に示された各ブロックが複数のスタンプを有する様子を示している。   As shown in the figure, the frame buffer includes, for example, (40 × 15) blocks BLK0 to BLK599 arranged in a matrix. The number of blocks is only an example, and is not limited to (40 × 15). The pixel shaders 12-0 to 12-3 generate pixels in the order of blocks BLK0 to BLK599. Each of the blocks BLK0 to BLK599 is formed to include 32 stamps arranged in a matrix. FIG. 3 shows how each block shown in FIG. 2 has a plurality of stamps.

各スタンプは、同一のピクセルシェーダによって描画される複数のピクセルの集合体である。本実施形態では1個のスタンプは(4×4)=16個のピクセルを含んでいるが、この数は例えば1個、4個、…等でも良く、限定されるものではない。図3において、各スタンプに記載された番号(=0〜31)を以下スタンプID(StID)と呼び、各ピクセルに記載された番号(=0〜15)を以下ピクセルID(PixID)と呼ぶ。また、各スタンプにおける(2×2)個のピクセルの集合をクアッド(quad)と呼ぶことにする。すなわち、1個のスタンプには(2×2)個のクアッドが含まれる。これらの4つのクアッドを、以下クアッドQ0〜Q3と呼ぶことにし、この数字をクアッドIDと呼ぶ。ブロックBLK0〜BLK599の各々には、上記スタンプが(4×8)=32個含まれている。従って、全体として(640×480)個のピクセルによって、図形を描画すべき空間が形成されている。   Each stamp is a collection of a plurality of pixels drawn by the same pixel shader. In this embodiment, one stamp includes (4 × 4) = 16 pixels, but this number may be one, four,..., For example, and is not limited. In FIG. 3, a number (= 0 to 31) described in each stamp is hereinafter referred to as a stamp ID (StID), and a number (= 0 to 15) described in each pixel is hereinafter referred to as a pixel ID (PixID). A set of (2 × 2) pixels in each stamp is referred to as a quad. That is, one stamp includes (2 × 2) quads. These four quads are hereinafter referred to as quads Q0 to Q3, and these numbers are referred to as quad IDs. Each of the blocks BLK0 to BLK599 includes (4 × 8) = 32 stamps. Accordingly, a space for drawing a graphic is formed by (640 × 480) pixels as a whole.

なおピクセルシェーダユニット24をピクセルシェーダ12−0〜12−3順に番号付けすると、その番号に等しいスタンプIDを有するスタンプが各ピクセルシェーダユニット24によって処理される。すなわち、各スタンプ内のピクセルは、その位置に応じて処理が行われるピクセルシェーダユニットが予め決められている。   If the pixel shader units 24 are numbered in the order of the pixel shaders 12-0 to 12-3, stamps having stamp IDs equal to the numbers are processed by each pixel shader unit 24. In other words, the pixel shader unit in which processing is performed in accordance with the position of the pixels in each stamp is determined in advance.

次に、上記フレームバッファに描画される図形に関して説明する。まず図形を描画するにあたって、ラスタライザ11に図形情報が入力される。図形情報は、例えば図形の頂点座標や色情報などである。ここで、例として三角形を描画する場合について説明する。ラスタライザ11に入力された三角形は、描画空間において図4に示すような位置を占めるとする。すなわち、三角形の3つの頂点座標が、ブロックBLK2におけるStID=31のスタンプ、ブロックBLK41におけるStID=15のスタンプ、及びブロックBLK43におけるStID=4のスタンプに位置すると仮定する。ラスタライザ11は、描画すべき三角形が占める位置に対応するスタンプを生成する。この様子を示しているのが図5である。生成されたスタンプデータは、それぞれ予め対応付けられたピクセルシェーダ12−0〜12−3に送られる。   Next, the graphic drawn in the frame buffer will be described. First, graphic information is input to the rasterizer 11 when drawing a graphic. The graphic information is, for example, the vertex coordinates or color information of the graphic. Here, a case where a triangle is drawn will be described as an example. It is assumed that the triangle input to the rasterizer 11 occupies a position as shown in FIG. 4 in the drawing space. That is, it is assumed that the three vertex coordinates of the triangle are located at the stamp of StID = 31 in the block BLK2, the stamp of StID = 15 in the block BLK41, and the stamp of StID = 4 in the block BLK43. The rasterizer 11 generates a stamp corresponding to the position occupied by the triangle to be drawn. This is shown in FIG. The generated stamp data is sent to the pixel shaders 12-0 to 12-3 associated in advance.

そしてピクセルシェーダ12−0〜12−3は、入力されたスタンプデータに基づいて、自らの担当するピクセルについて描画処理を行う。その結果、図5に示されるような三角形が、複数のピクセルによって描画される。ピクセルシェーダ12−0〜12−3によって描画されたピクセルデータは、スタンプ単位でローカルメモリに格納される。   Then, the pixel shaders 12-0 to 12-3 perform drawing processing on the pixels that they are responsible for based on the input stamp data. As a result, a triangle as shown in FIG. 5 is drawn by a plurality of pixels. Pixel data drawn by the pixel shaders 12-0 to 12-3 is stored in the local memory in units of stamps.

図6は、図5におけるブロックBLK2の拡大図である。図示するようにブロックBLK2に関して、ラスタライザ11は8個のスタンプを生成する。それらのスタンプIDはそれぞれStID=16、17、19、21、25〜27、31である。前述の通り、ラスタライザ11で生成されたスタンプの個々には(4×4)=16個のピクセルが含まれている。しかし、例えスタンプが発行されたとしても、図形によっては全てのピクセルに対して描画処理を行う必要はない。例えば図6において、StID=17、27のスタンプは三角形の内部にあるので、このスタンプ内に含まれる全てのピクセルに対して描画処理を行う必要がある。しかし、例えばStID=21のスタンプにおいては、PixID=0〜7、9、12〜15のピクセルは三角形の外部にあるため描画処理の必要はない。描画処理の必要なピクセルは、PixID=8、10、11のピクセルのみである。このように、描画処理すべきであることを以下では「バリッド(valid)である」と呼び、描画不要であることを「インバリッド(invalid)である」と呼ぶことにする。   FIG. 6 is an enlarged view of the block BLK2 in FIG. As illustrated, the rasterizer 11 generates eight stamps for the block BLK2. The stamp IDs are StID = 16, 17, 19, 21, 25-27, 31 respectively. As described above, each of the stamps generated by the rasterizer 11 includes (4 × 4) = 16 pixels. However, even if a stamp is issued, it is not necessary to perform drawing processing for all pixels depending on the figure. For example, in FIG. 6, since the stamps with StID = 17 and 27 are inside the triangle, it is necessary to perform drawing processing for all the pixels included in the stamp. However, in the stamp with StID = 21, for example, the pixels with PixID = 0-7, 9, and 12-15 are outside the triangle, so there is no need for drawing processing. Only pixels with PixID = 8, 10, and 11 need to be drawn. In this way, what is to be rendered is hereinafter referred to as “valid” and what is not necessary is referred to as “invalid”.

次に図1に戻ってピクセルシェーダユニット24の構成について説明する。図示するようにピクセルシェーダユニット24は、命令制御部25、描画処理部26、及びデータ制御部27を備えている。命令制御部25は、タスクの実行管理、スタンプデータの受信、クアッドマージ、サブパスの実行管理等を行う。描画処理部26は、ピクセルの演算処理を行う。データ制御部27はキャッシュメモリを備え、キャッシュメモリやローカルメモリ13へのデータアクセスの制御を行う。   Next, returning to FIG. 1, the configuration of the pixel shader unit 24 will be described. As illustrated, the pixel shader unit 24 includes an instruction control unit 25, a drawing processing unit 26, and a data control unit 27. The instruction control unit 25 performs task execution management, reception of stamp data, quad merge, sub-pass execution management, and the like. The drawing processing unit 26 performs pixel calculation processing. The data control unit 27 includes a cache memory and controls data access to the cache memory and the local memory 13.

命令制御部25の動作について以下説明する。命令制御部25はパイプライン動作を行う。命令制御部25は、データ振り分け部20から複数のデータを受け取り、保持する。そのデータとは、例えばスタンプのXY座標、描画方向、ポリゴンの面(face)情報、描画すべき図形の有するパラメータの代表値、図形の奥行き情報、またはピクセルがバリッドか否かを示す情報などである。また命令制御部25はクアッドマージを行う。クアッドマージとは、同一XY座標の連続する2つのスタンプを1つのスタンプにマージすることである。クアッドマージを行うことで、2つのスタンプのうちバリッドなクアッドを1つのスタンプに合成出来、一度に処理出来る。従って、描画処理すべきデータ量を圧縮出来る。クアッドマージの様子を図7に示す。   The operation of the instruction control unit 25 will be described below. The instruction control unit 25 performs a pipeline operation. The instruction control unit 25 receives and holds a plurality of data from the data distribution unit 20. The data includes, for example, the stamp's XY coordinates, drawing direction, polygon face information, representative values of parameters of the figure to be drawn, figure depth information, or information indicating whether or not the pixel is valid. is there. The instruction control unit 25 performs quad merge. The quad merge is to merge two consecutive stamps having the same XY coordinates into one stamp. By performing quad merge, a valid quad of two stamps can be combined into one stamp and processed at a time. Therefore, the amount of data to be drawn can be compressed. A state of the quad merge is shown in FIG.

2つの時間的に連続する2つのスタンプが、例えば図7に示すようであったとする。1つのスタンプに含まれる4つのクアッドをそれぞれクアッドQ0〜Q3と呼ぶことにする。まず始めにクアッドQ0、Q2がバリッドで且つクアッドQ1、Q3がインバリッドなスタンプ1が命令制御部25に入力され、引き続きクアッドQ1、Q2がバリッドで且つクアッドQ0、Q3がインバリッドなスタンプ2が入力された場合を考える。この場合、2つのスタンプ1、2をマージすることにより、スタンプ1のクアッドQ0、Q2と、スタンプ2のクアッドQ1、Q2とを含む新規なスタンプを生成する。この新規なスタンプを、クアッドマージ前のスタンプと区別するために以後スレッド(thread)と呼ぶことにする。クアッドマージにより生成されたスレッドは番号付けされ、その番号を以下スレッドID(TdID)と呼ぶことにする。そして命令制御部25は、生成されたスレッドに関する情報を保持する。スレッドに関する情報とは、例えばサブパスID、スレッドID、またスレッドに含まれる4つのクアッドのクアッドマージ前のスタンプ内における位置情報などである。サブパスIDは、現在実行中または次に実行すべきサブパス(sub-pass)番号である。サブパスについて以下説明する。   Assume that two time-sequential two stamps are as shown in FIG. 7, for example. Four quads included in one stamp are called quads Q0 to Q3, respectively. First, a stamp 1 in which quads Q0 and Q2 are valid and quads Q1 and Q3 are invalid is input to the instruction control unit 25. Subsequently, quads Q1 and Q2 are valid and quads Q0 and Q3 are invalid in stamp 2 are input. Consider the case. In this case, the two stamps 1 and 2 are merged to generate a new stamp including quads Q0 and Q2 of stamp 1 and quads Q1 and Q2 of stamp 2. This new stamp is hereinafter referred to as a thread in order to distinguish it from the stamp before the quad merge. The threads generated by the quad merge are numbered, and the number is hereinafter referred to as a thread ID (TdID). The instruction control unit 25 holds information regarding the generated thread. The information about the thread includes, for example, a sub-path ID, a thread ID, position information in a stamp before quad merge of four quads included in the thread, and the like. The sub-path ID is a sub-pass number that is currently being executed or to be executed next. The sub path will be described below.

命令制御部25は、各スレッドに対して、エンド信号を検出するまで所定の命令を実行する。実行される命令列は、図8に示すよう最大でX個の命令列に分割出来、分割されて出来た個々の命令列がサブパスである。個々のサブパスの最後にはイールド命令Yieldが配置され、最終のサブパスの最後にはイールド命令の代わりにエンド命令Endが配置されている。   The instruction control unit 25 executes a predetermined instruction for each thread until an end signal is detected. The instruction sequence to be executed can be divided into a maximum of X instruction sequences as shown in FIG. 8, and each instruction sequence formed by the division is a sub path. A yield instruction Yield is arranged at the end of each sub-pass, and an end instruction End is arranged at the end of the final sub-path instead of the yield instruction.

図9は、サブパスが実行される様子を時間と共に示した概念図である。図9において、スレッド5、6、7は同一のピクセルシェーダユニットによって処理される。図示するように、スレッドに対する処理はイールド命令によって一旦休止する。そして、代わりに他のスレッドに対する命令が実行される。休止したスレッドは、後に発行可能となった際に起動される。すなわち、2つのイールド命令間で実行される命令がサブパスである。そしてサブパスの単位でスレッドが実行され、その期間の処理は連続して実行される。   FIG. 9 is a conceptual diagram showing how sub-passes are executed over time. In FIG. 9, threads 5, 6, and 7 are processed by the same pixel shader unit. As shown in the figure, the processing for the thread is temporarily suspended by the yield instruction. Instead, an instruction for another thread is executed. The suspended thread is activated when it can be issued later. That is, an instruction executed between two yield instructions is a subpath. Then, a thread is executed in units of sub-passes, and processing during that period is executed continuously.

命令制御部25はサブパスの制御を行う。そして、スレッドとそれに対応するサブパスIDを保持し、いずれのスレッドが発行可能かを管理する。   The instruction control unit 25 controls the sub path. Then, the thread and the subpath ID corresponding to the thread are held, and which thread can be issued is managed.

更に命令制御部25は、データ振り分け部20から与えられる情報に基づいて、ピクセルデータを補間する。通常、ラスタライザによって生成されるピクセルは、スタンプあたり1個だけである。従って、このラスタライザ11によって生成されたピクセルデータに基づいた計算により、描画処理部26は同じスタンプ内の他のピクセルに関する情報を得る。   Further, the command control unit 25 interpolates the pixel data based on the information given from the data distribution unit 20. Typically, only one pixel per stamp is generated by the rasterizer. Accordingly, the drawing processing unit 26 obtains information on other pixels in the same stamp by calculation based on the pixel data generated by the rasterizer 11.

次にデータ制御部27について、図10及び図11を用いて説明する。図10はデータ制御部27のブロック図である。データ制御部27はパイプライン動作を行う。図11は、パイプライン動作の各ステージと関連付けて示したデータ制御部27のブロック図である。   Next, the data control unit 27 will be described with reference to FIGS. FIG. 10 is a block diagram of the data control unit 27. The data control unit 27 performs a pipeline operation. FIG. 11 is a block diagram of the data control unit 27 shown in association with each stage of the pipeline operation.

ピクセルシェーダユニットの各回路ブロックにおける処理は、第1乃至第3ステージの少なくとも3つのステージを有する。各ステージについて大まかに説明すると、第1ステージでは、命令制御部25が必要なデータの読み出しや、命令のプリフェッチ等を行う。またデータ制御部27では、データアクセスに必要なアドレス信号の生成や、プリロード(後述する)に関する制御を行う。第2ステージでは、命令制御部25がピクセルデータの補間を行い、データ制御部27がデータアクセスに必要な命令を生成する。そして第3ステージでは、命令制御部25及びデータ制御部27における処理結果に基づいて描画処理部26が描画処理を行う。なお、命令制御部25によるデータ振り分け部20からのデータの受信は、上記第1ステージの前の段階で行われる。   The processing in each circuit block of the pixel shader unit has at least three stages of first to third stages. The stages are roughly described. In the first stage, the instruction control unit 25 reads necessary data, prefetches instructions, and the like. The data control unit 27 performs control related to generation of address signals necessary for data access and preload (described later). In the second stage, the instruction control unit 25 interpolates pixel data, and the data control unit 27 generates an instruction necessary for data access. In the third stage, the drawing processing unit 26 performs drawing processing based on the processing results in the command control unit 25 and the data control unit 27. The instruction control unit 25 receives data from the data distribution unit 20 at a stage before the first stage.

データ制御部27の構成について説明する。図示するように、データ制御部27は、アドレス発生部40、キャッシュメモリ41、キャッシュ制御部42、及びプリロード制御部43を備えている。アドレス発生部40は、命令制御部25からロード/ストア命令が発行された際に、ローカルメモリ13において読み出すべきデータのアドレス、または書き込むべきデータのアドレスを生成する(以下これをロード/ストアアドレスと呼ぶ)。ロード/ストア命令とは、描画処理部26がピクセル処理を行う際に必要となるデータを読み出す命令(ロード)、または処理したデータを保持させる命令(ストア)である。より詳細には、ロード命令が発行されると、ピクセル描画処理に必要なデータが、キャッシュメモリ41から、描画処理部26内にあるレジスタに読み出される。必要なデータがキャッシュメモリ41に無い場合にはローカルメモリ13から読み出される。またストア命令が発行されると、描画処理部26内のレジスタに保持されているデータが、一時的にキャッシュメモリ41に書き込まれ、その後ローカルメモリ13に書き込まれる。   The configuration of the data control unit 27 will be described. As shown in the figure, the data control unit 27 includes an address generation unit 40, a cache memory 41, a cache control unit 42, and a preload control unit 43. When a load / store instruction is issued from the instruction control unit 25, the address generator 40 generates an address of data to be read or written in the local memory 13 (hereinafter referred to as a load / store address). Call). The load / store instruction is an instruction (load) for reading data required when the rendering processing unit 26 performs pixel processing or an instruction (store) for holding the processed data. More specifically, when a load command is issued, data necessary for pixel drawing processing is read from the cache memory 41 to a register in the drawing processing unit 26. If the necessary data is not in the cache memory 41, it is read from the local memory 13. When a store instruction is issued, data held in the register in the drawing processing unit 26 is temporarily written in the cache memory 41 and then written in the local memory 13.

キャッシュメモリ41は、ピクセルデータを一時的に保持する。描画処理部26は、キャッシュメモリ41に保持されるデータを用いてピクセル処理を行う。   The cache memory 41 temporarily holds pixel data. The drawing processing unit 26 performs pixel processing using data held in the cache memory 41.

キャッシュ制御部42は、ロード/ストア命令が発行された際における、キャッシュメモリ41に対するアクセスを制御する。キャッシュ制御部42は、キャッシュアクセス制御部44、キャッシュ管理部45、及びリクエスト発行制御部46を備えている。   The cache control unit 42 controls access to the cache memory 41 when a load / store instruction is issued. The cache control unit 42 includes a cache access control unit 44, a cache management unit 45, and a request issue control unit 46.

プリロード制御部43は、プリロード命令が発行された際における、キャッシュメモリ41に対するアクセスを制御する。プリロード制御部43はプリロードアドレス発生部47、プリロード保持部48、サブパス情報管理部49、及びアドレス保持部50を備えている。プリロード命令とは、次に実行されるであろうスレッドのサブパスで使用されるデータを、ローカルメモリからキャッシュメモリ41に予めプリフェッチするための命令である。   The preload control unit 43 controls access to the cache memory 41 when a preload instruction is issued. The preload control unit 43 includes a preload address generation unit 47, a preload holding unit 48, a subpath information management unit 49, and an address holding unit 50. The preload instruction is an instruction for prefetching data used in a sub-pass of a thread that will be executed next from the local memory to the cache memory 41 in advance.

またデータ制御部27は上記回路ブロックのいずれかにおいて、コンフィギュレーションレジスタを備える。コンフィギュレーションレジスタは、信号WIDTH、BASE、PRELOADを保持する。信号WIDTHは、ピクセルに関するフレームバッファのサイズを示す。BASEは、ローカルメモリ13に保持されるデータのベースアドレス(先頭アドレス)を、フレームバッファモード及びメモリレジスタモードの両方の場合について示す。PRELOADは、プリロードのON/OFFを設定するためのものである。   The data control unit 27 includes a configuration register in any of the circuit blocks. The configuration register holds signals WIDTH, BASE, and PRELOAD. Signal WIDTH indicates the size of the frame buffer for the pixel. BASE indicates the base address (start address) of data held in the local memory 13 in both the frame buffer mode and the memory register mode. PRELOAD is for setting ON / OFF of preload.

データ制御部27の内部の構成について、以下詳細に説明する。まずアドレス発生部40について説明する。図12はアドレス発生部40のブロック図であり、入出力信号を示している。図示するように、アドレス発生部40にはオフセットデータ、スレッドのXY座標、スレッドID、クアッドID、サブパスID、及びバッファモード信号が入力される。XY座標は命令制御部25から与えられる。スレッドID、クアッドID、及びサブパスIDは描画処理部26から与えられる。アドレス発生部40は、スレッドのX座標、Y座標と、コンフィギュレーションレジスタに保持されるWIDTHに基づいて、ロード/ストアアドレスを計算する。ロード/ストアアドレスは、上記情報から計算可能であれば良く、その計算式自体は特に限定されるものでは無い。下記に一例として、ピクセルシェーダユニットの数が4個であり、且つ1つのブロック内に32個のスタンプが含まれる場合のロード/ストアアドレスの計算方法を示す。   The internal configuration of the data control unit 27 will be described in detail below. First, the address generator 40 will be described. FIG. 12 is a block diagram of the address generator 40, showing input / output signals. As shown in the figure, offset data, thread XY coordinates, thread ID, quad ID, subpath ID, and buffer mode signal are input to the address generator 40. The XY coordinates are given from the command control unit 25. The thread ID, quad ID, and sub path ID are given from the drawing processing unit 26. The address generator 40 calculates a load / store address based on the X and Y coordinates of the thread and WIDTH held in the configuration register. The load / store address may be calculated from the above information, and the calculation formula itself is not particularly limited. As an example, a load / store address calculation method when the number of pixel shader units is four and 32 stamps are included in one block is shown below.

Block ID = X/16 + (Y/32) × (WIDTH/16)
Xr = (X/4) mod 16
Yr = (Y/4) mod 16
PUID[0] = Xr[1] ^Yr[1] = StID[0]
PUID[1] = (Xr[1] AND ~(Yr[1] ^Yr[2]) | (~Xr[1] AND Xr[2])) ^Xr[0] ^Yr[0]
= StID[1]
PUID[2] = (Xr[1] AND ~(Yr[1] ^Xr[2]) | (~Xr[1] AND Yr[2])) ^Xr[0] ^Yr[0]
= StID[2]
PUID[3] = Xr[3] = StID[3]
PUID[4] = Yr[3] = StID[4]
なお上式におけるBlockIDは図2で説明したBLK0〜BLK599の番号である。X、YはX座標及びY座標である。PUIDはピクセルシェーダユニット番号であり、ピクセルシェーダユニット24をピクセルシェーダ12−0〜12−3順に番号付けした際の番号である。ピクセルシェーダユニット番号は5ビットの信号であり、PUID[0]〜PUID[4]はその各ビットを示す。また上式の演算子は、modは剰余演算、ANDは論理積演算、^は排他的論理和演算、~は論理否定演算、|は論理和演算を表す。
Block ID = X / 16 + (Y / 32) × (WIDTH / 16)
Xr = (X / 4) mod 16
Yr = (Y / 4) mod 16
PUID [0] = Xr [1] ^ Yr [1] = StID [0]
PUID [1] = (Xr [1] AND ~ (Yr [1] ^ Yr [2]) | (~ Xr [1] AND Xr [2])) ^ Xr [0] ^ Yr [0]
= StID [1]
PUID [2] = (Xr [1] AND ~ (Yr [1] ^ Xr [2]) | (~ Xr [1] AND Yr [2])) ^ Xr [0] ^ Yr [0]
= StID [2]
PUID [3] = Xr [3] = StID [3]
PUID [4] = Yr [3] = StID [4]
BlockID in the above equation is the number of BLK0 to BLK599 described in FIG. X and Y are an X coordinate and a Y coordinate. PUID is a pixel shader unit number, and is a number when the pixel shader unit 24 is numbered in the order of the pixel shaders 12-0 to 12-3. The pixel shader unit number is a 5-bit signal, and PUID [0] to PUID [4] indicate the respective bits. In the above formula, mod represents a remainder operation, AND represents a logical product operation, ^ represents an exclusive OR operation, ~ represents a logical negation operation, and | represents a logical sum operation.

そしてアドレス発生部40は、上記計算結果とオフセットデータ、クアッドID、及びピクセルIDを図13または図14に示す順序に並べることによって、32ビットのロード/ストアアドレスを生成する。ローカルメモリ13は、2つのモードでデータを記憶することが可能であり、それぞれのモードをフレームバッファモード、メモリレジスタモードと呼ぶことにする。ロード/ストアアドレスは、ローカルメモリがフレームバッファモードで使用される場合にはスレッドのXY座標から求められ、図13のように配置することで得られる。他方、メモリレジスタモードで使用される場合にはスレッドIDによって求められ、図14のように配置することで得られる。なお、オフセットデータは命令制御部25から与えられる。また、フレームバッファモードとメモリレジスタモードのいずれを使用するかは、命令制御部25からバッファモード信号として与えられる。ピクセルIDは、XY座標から知ることが出来る。なぜなら、図3で説明したように、各ピクセルセルIDを有するピクセルのスタンプ内における位置は予め決められているからである。また同様の理由によりクアッドIDも知ることが出来る。   Then, the address generator 40 generates a 32-bit load / store address by arranging the calculation result, the offset data, the quad ID, and the pixel ID in the order shown in FIG. The local memory 13 can store data in two modes, and these modes are called a frame buffer mode and a memory register mode. The load / store address is obtained from the XY coordinates of the thread when the local memory is used in the frame buffer mode, and can be obtained by arranging as shown in FIG. On the other hand, when used in the memory register mode, it is obtained by the thread ID and obtained by arranging as shown in FIG. The offset data is given from the instruction control unit 25. Whether to use the frame buffer mode or the memory register mode is given as a buffer mode signal from the instruction control unit 25. The pixel ID can be known from the XY coordinates. This is because, as described with reference to FIG. 3, the position of the pixel having each pixel cell ID in the stamp is determined in advance. For the same reason, the quad ID can also be obtained.

アドレス発生部40は、図13または図14に示すアドレスを発生すると、そのうちの一部をキャッシュデータアドレス、キャッシュインデックスエントリ、及びキャッシュエントリとして出力する。これらの信号は、キャッシュメモリ41内のアドレスを示す信号であるが、その詳細は後述する。   When generating the addresses shown in FIG. 13 or FIG. 14, the address generator 40 outputs some of them as cache data addresses, cache index entries, and cache entries. These signals are signals indicating addresses in the cache memory 41, and details thereof will be described later.

次にキャッシュメモリ41について図15を用いて説明する。図15はキャッシュメモリ41のブロック図である。図示するようにキャッシュメモリ41は、例えば2つのメモリ51−0、51−1を備えている。メモリ51−0、51−1は例えばSRAMやまたはDRAMである。メモリ51−0、51−1の各々はM個のエントリ0〜(M−1)を備えている。各エントリ0〜(M−1)は、それぞれ独立したメモリ53−0〜53−(M−1)である。更に、エントリ0〜(M−1)の各々は、L個(Lは2以上の自然数)のサブエントリ0〜(L−1)を備えている。キャッシュメモリ41からデータが読み出される際には、メモリ51−0内のいずれかのエントリにおけるいずれかのサブエントリと、メモリ51−1内のいずれかのエントリにおけるいずれかのサブエントリとからそれぞれ、データがキャッシュリードデータとして読み出される。   Next, the cache memory 41 will be described with reference to FIG. FIG. 15 is a block diagram of the cache memory 41. As shown in the figure, the cache memory 41 includes, for example, two memories 51-0 and 51-1. The memories 51-0 and 51-1 are, for example, SRAM or DRAM. Each of the memories 51-0 and 51-1 includes M entries 0 to (M-1). Each entry 0 to (M-1) is an independent memory 53-0 to 53- (M-1). Furthermore, each of the entries 0 to (M−1) includes L (L is a natural number of 2 or more) subentries 0 to (L−1). When data is read from the cache memory 41, from any subentry in any entry in the memory 51-0 and any subentry in any entry in the memory 51-1, respectively. Data is read as cache read data.

なお、図15においてエントリ0〜(M−1)の各々がL個のサブエントリ0〜(L−1)を有している理由は、キャッシュメモリ41と外部とを接続するバスの転送可能データサイズが、メモリ51−0、51−1の各エントリサイズの(1/L)だからである。従って、バスの転送可能データサイズがエントリサイズ以上であれば、エントリがサブエントリを有する必要はなく、この場合にはエントリサイズでデータが外部へ読み出される。   In FIG. 15, each of entries 0 to (M−1) has L subentries 0 to (L−1) because the transferable data on the bus connecting the cache memory 41 and the outside This is because the size is (1 / L) of each entry size of the memories 51-0 and 51-1. Therefore, if the transferable data size of the bus is equal to or larger than the entry size, the entry does not need to have a subentry. In this case, data is read to the outside with the entry size.

また、図15においてはキャッシュメモリ41が2つのメモリ51−0、51−1を有する場合について示しているが、この数は一例に過ぎず、1個だけでも良いし、3つ以上であっても良い。キャッシュメモリ41に含まれる2つのメモリ51−0、51−1には、それぞれ識別番号としてインデックス0、インデックス1がそれぞれ割り当てられている。そして、図12乃至図14で説明したアドレス信号のうち、キャッシュインデックスエントリ及びキャッシュデータアドレスには、メモリ51−0、51−1に割り当てられたインデックス0、インデックス1のいずれを選択すべきかの情報が含まれる。またキャッシュエントリには、サブエントリ0〜(L−1)のいずれを選択すべきかの情報が含まれている。またキャッシュメモリ41に対しては、キャッシュイネーブル信号、キャッシュライトイネーブル信号、キャッシュライトデータ、及びキャッシュアドレスが、キャッシュアクセス制御部44から入力される。キャッシュイネーブル信号はキャッシュメモリ41をイネーブル状態にするための信号であり、キャッシュライトイネーブル信号はキャッシュメモリ41への書き込み動作をイネーブルにする信号であり、キャッシュライトデータはキャッシュメモリ41への書き込みデータであり、キャッシュアドレスはキャッシュメモリにおいてアクセスすべきアドレスを示す。   FIG. 15 shows the case where the cache memory 41 includes two memories 51-0 and 51-1, but this number is only an example, and only one or three or more may be used. Also good. Indexes 0 and 1 are assigned as identification numbers to the two memories 51-0 and 51-1 included in the cache memory 41, respectively. Information indicating which of index 0 and index 1 allocated to the memories 51-0 and 51-1 should be selected as the cache index entry and the cache data address among the address signals described with reference to FIGS. Is included. The cache entry includes information on which of sub-entries 0 to (L-1) should be selected. In addition, a cache enable signal, a cache write enable signal, cache write data, and a cache address are input from the cache access control unit 44 to the cache memory 41. The cache enable signal is a signal for enabling the cache memory 41, the cache write enable signal is a signal for enabling the write operation to the cache memory 41, and the cache write data is the write data to the cache memory 41. Yes, the cache address indicates an address to be accessed in the cache memory.

次にキャッシュ制御部42が備えるキャッシュアクセス制御部44、キャッシュ管理部45、及びリクエスト発行制御部46について説明する。まずリクエスト発行制御部46について図16を用いて説明する。図16はリクエスト発行制御部46のブロック図であり、入出力信号を示している。図示するようにリクエスト発行制御部46には、プリロード要求イネーブル信号、リフィル要求イネーブル信号、リフィルアドレス、リフィル要求ID、及びリフィルアクノリッジ信号が入力される。プリロード要求イネーブル信号はキャッシュ管理部45から与えられ、プリロード要求イネーブル信号プリロード要求が出力されるとアサートされる。リフィル要求イネーブル信号、リフィルアドレス、リフィル要求IDはキャッシュ管理部45から与えられ、それぞれリフィル要求のイネーブル信号、アドレス、リクエストIDを示す。ロード/ストア命令が発行された際に、該当するデータがキャッシュメモリ41内に存在しなかった場合、該当データをローカルメモリからキャッシュメモリ41へ読み出す必要がある。これをリフィル(refill)と呼ぶ。リフィルアクノリッジ信号はローカルメモリ13から与えられ、リフィル要求に関するアクノリッジ信号である。   Next, the cache access control unit 44, the cache management unit 45, and the request issue control unit 46 included in the cache control unit 42 will be described. First, the request issuance control unit 46 will be described with reference to FIG. FIG. 16 is a block diagram of the request issuance control unit 46, showing input / output signals. As shown in the figure, the request issuance control unit 46 receives a preload request enable signal, a refill request enable signal, a refill address, a refill request ID, and a refill acknowledge signal. The preload request enable signal is supplied from the cache management unit 45 and asserted when a preload request enable signal preload request is output. The refill request enable signal, refill address, and refill request ID are given from the cache management unit 45, and indicate the refill request enable signal, address, and request ID, respectively. If the corresponding data does not exist in the cache memory 41 when the load / store instruction is issued, it is necessary to read the corresponding data from the local memory to the cache memory 41. This is called refill. The refill acknowledge signal is provided from the local memory 13 and is an acknowledge signal related to the refill request.

リクエスト発行制御部46は、リフィル要求とプリロード要求の発行を制御する。具体的にはまず、ローカルメモリ13へのリフィル要求とプリロード要求の総数をカウントする。ローカルメモリ13からリフィルアクノリッジ信号が返ってくると、これらの要求数をカウントダウンする。これはローカルメモリ13が受け付けることの出来るリクエスト数に上限があるからである。またプリロードとリフィルとでは、優先度はリフィルの方が高い。従って、リフィル要求とプリロード要求とが同時に発行待ちとなっている場合は、リフィル要求が優先して発行される。そして適切なタイミングで、リフィル要求信号をローカルメモリ13へ出力する。またリクエスト発行制御部46は、ローカルメモリ13に対して発行待ちをしているリフィル要求の有無を、リフィルレディ信号としてアドレス保持部50へ出力する。更に、ローカルメモリ13におけるリクエストキューの有無、すなわちローカルメモリ13に対してリフィル要求及びプリロード要求を発行出来るか否かを、要求状況信号としてアドレス保持部50へ出力する。   The request issuance control unit 46 controls the issuance of refill requests and preload requests. Specifically, first, the total number of refill requests and preload requests to the local memory 13 is counted. When a refill acknowledge signal is returned from the local memory 13, the number of requests is counted down. This is because there is an upper limit on the number of requests that the local memory 13 can accept. In addition, in the preload and the refill, the priority is higher in the refill. Therefore, when the refill request and the preload request are waiting to be issued simultaneously, the refill request is issued with priority. Then, the refill request signal is output to the local memory 13 at an appropriate timing. Further, the request issuance control unit 46 outputs the presence or absence of a refill request waiting for issuance to the local memory 13 to the address holding unit 50 as a refill ready signal. Further, the presence / absence of a request queue in the local memory 13, that is, whether or not a refill request and a preload request can be issued to the local memory 13 is output to the address holding unit 50 as a request status signal.

次にキャッシュアクセス制御部44について図17を用いて説明する。図17はキャッシュアクセス制御部44のブロック図であり、入出力信号を示している。図示するようにキャッシュアクセス制御部44には、ストアデータ、キャッシュインデックスエントリ、キャッシュエントリ、ヒットエントリ番号、ロードイネーブル信号、ストアイネーブル信号、リフィルアクノリッジ信号、リフィル要求ID、リフィルデータ、ライトバックアクノリッジ信号、ライトバックID、及びキャッシュリードデータが入力される。   Next, the cache access control unit 44 will be described with reference to FIG. FIG. 17 is a block diagram of the cache access control unit 44, showing input / output signals. As shown in the figure, the cache access control unit 44 includes store data, cache index entry, cache entry, hit entry number, load enable signal, store enable signal, refill acknowledge signal, refill request ID, refill data, write back acknowledge signal, Write back ID and cache read data are input.

ストアデータはキャッシュメモリ41にストアすべきデータであり、描画処理部26から与えられる。ヒットエントリ番号はキャッシュ管理部45から与えられる。そしてロード/ストア命令が発行された際、該当データがキャッシュメモリ41にあるか否か、ある場合いずれのエントリにあるかを示す。ヒットエントリ番号については後に詳細に説明する。ロードイネーブル信号、ストアイネーブル信号はそれぞれ、キャッシュ管理部45及びシェーダプログラム実行部描画処理部26から与えられ、ロード要求及びストア要求が発行された際にアサートされる。リフィルアクノリッジ信号、リフィル要求ID、リフィルデータはローカルメモリ13から与えられる。ライトバックアクノリッジ信号、ライトバックIDはライトバック動作に関する信号であり、それぞれアクノリッジ信号及びIDを示し、ローカルメモリ13から与えられる。ライトバックとは、キャッシュメモリ41内のデータをローカルメモリへ書き込む動作のことであり、詳細は第2の実施形態で説明する。   The store data is data to be stored in the cache memory 41 and is given from the drawing processing unit 26. The hit entry number is given from the cache management unit 45. When a load / store instruction is issued, it indicates whether the corresponding data is in the cache memory 41, and if so, in which entry. The hit entry number will be described in detail later. The load enable signal and the store enable signal are respectively supplied from the cache management unit 45 and the shader program execution unit drawing processing unit 26, and are asserted when a load request and a store request are issued. The refill acknowledge signal, refill request ID, and refill data are given from the local memory 13. The write-back acknowledge signal and the write-back ID are signals related to the write-back operation. The write-back acknowledge signal and write-back ID indicate the acknowledge signal and ID, respectively, and are given from the local memory 13. The write back is an operation of writing data in the cache memory 41 to the local memory, and details will be described in the second embodiment.

またキャッシュアクセス制御部44は、ロードイネーブル信号、ライトバックデータ、キャッシュイネーブル信号、キャッシュライトデータ、キャッシュアドレス、及びリフィルアクノリッジIDを出力する。ロードイネーブル信号は描画処理部26に与えられる。ライトバックデータは、ライトバック時にキャッシュメモリ41へ書き込むべきデータであり、ローカルメモリ13へ与えられる。リフィルアクノリッジIDはリフィルのアクノリッジIDを示す信号であり、キャッシュ管理部45へ与えられる。   The cache access control unit 44 outputs a load enable signal, write back data, a cache enable signal, cache write data, a cache address, and a refill acknowledge ID. The load enable signal is given to the drawing processing unit 26. The write back data is data to be written to the cache memory 41 at the time of write back, and is given to the local memory 13. The refill acknowledge ID is a signal indicating the acknowledge ID of the refill and is given to the cache management unit 45.

キャッシュアクセス制御部44は、キャッシュメモリ41へのデータの書き込み、及びキャッシュメモリ41からのデータの読み出しを制御する。キャッシュメモリ41へのアクセスは、ロード、ストア、リフィル、及びライトバックの4種類がある。キャッシュメモリ41へアクセスがなされる際、キャッシュアクセス制御部44はキャッシュイネーブル信号をアサートする。   The cache access control unit 44 controls data writing to the cache memory 41 and data reading from the cache memory 41. There are four types of access to the cache memory 41: load, store, refill, and write back. When the cache memory 41 is accessed, the cache access control unit 44 asserts a cache enable signal.

リフィルを行う場合、リフィルアクノリッジ信号がキャッシュアクセス制御部44に到達してから一定時間後に、リフィルデータがローカルメモリ13からキャッシュアクセス制御部44に到達する。キャッシュアクセス制御部44はリフィルデータを一旦保持した後、キャッシュメモリ41へ書き込む。キャッシュメモリ41へリフィルデータを書き込む際には、キャッシュアクセス制御部44はキャッシュライトイネーブル信号をアサートし、キャッシュライトデータ及びキャッシュアドレスをキャッシュメモリ41に対して出力する。更にキャッシュアクセス制御部44は、ローカルメモリ13からリフィルアクノリッジ信号を受け取ると、リフィルアクノリッジIDをキャッシュ管理部45へ出力する。   When refilling is performed, the refill data reaches the cache access control unit 44 from the local memory 13 after a predetermined time from when the refill acknowledge signal reaches the cache access control unit 44. The cache access control unit 44 once holds the refill data and then writes it to the cache memory 41. When writing the refill data to the cache memory 41, the cache access control unit 44 asserts the cache write enable signal and outputs the cache write data and the cache address to the cache memory 41. Further, when receiving a refill acknowledge signal from the local memory 13, the cache access control unit 44 outputs a refill acknowledge ID to the cache management unit 45.

ライトバックを行う場合、キャッシュアクセス制御部44は、キャッシュメモリ41から読み出されたキャッシュリードデータを一旦保持した後、これをライトバックデータとしてローカルメモリ13へ出力する。   When performing a write back, the cache access control unit 44 temporarily holds the cache read data read from the cache memory 41 and then outputs this to the local memory 13 as write back data.

ストアを行う場合、ストアイネーブル信号がアサートされると共に、描画処理部26からストアデータが与えられる。そしてキャッシュアクセス制御部44は、このストアデータをキャッシュメモリ41に書き込む。   When storing, a store enable signal is asserted and store data is supplied from the drawing processing unit 26. Then, the cache access control unit 44 writes the store data in the cache memory 41.

ロードを行う場合、ロードイネーブル信号がアサートされる。そしてキャッシュアクセス制御部44は、キャッシュメモリ41からキャッシュリードデータを読み出す。このデータは同時に描画処理部26にも与えられる。   When loading, the load enable signal is asserted. Then, the cache access control unit 44 reads the cache read data from the cache memory 41. This data is also given to the drawing processing unit 26 at the same time.

次にキャッシュ管理部45について図18を用いて説明する。図18はキャッシュ管理部45のブロック図であり、入出力信号を示している。図示するようにキャッシュ管理部45には、ストール信号、キャッシュデータアドレス信号、ロード要求信号、ストア要求信号、エンド命令、イールド命令、サブパススタート信号、スレッドエントリ番号、フラッシュ要求信号、プリロードアドレス、プリロードスレッドID、プリロードイネーブル信号、リフィルアクノリッジ信号、ライトバックアクノリッジ信号、ライトバックアクノリッジID、リフィルアクノリッジIDが入力される。   Next, the cache management unit 45 will be described with reference to FIG. FIG. 18 is a block diagram of the cache management unit 45 showing input / output signals. As shown, the cache management unit 45 includes a stall signal, a cache data address signal, a load request signal, a store request signal, an end instruction, a yield instruction, a subpath start signal, a thread entry number, a flash request signal, a preload address, and a preload thread. An ID, a preload enable signal, a refill acknowledge signal, a write back acknowledge signal, a write back acknowledge ID, and a refill acknowledge ID are input.

ストール信号は描画処理部26から与えられる。ストールとは、何らかの原因によって命令が実行できず、実行を待っている状態のことである。ロード要求信号、ストア要求信号は描画処理部26から与えられる。エンド命令及びイールド命令は描画処理部26から与えられる。サブパススタート信号はサブパスが開始されたことを示す信号であり、描画処理部26から与えられる。フラッシュ要求信号は、キャッシュメモリ41のフラッシュを要求するための信号であり、描画処理部26から与えられる。   The stall signal is given from the drawing processing unit 26. A stall is a state where an instruction cannot be executed for some reason and is waiting for execution. The load request signal and the store request signal are given from the drawing processing unit 26. The end command and the yield command are given from the drawing processing unit 26. The sub-pass start signal is a signal indicating that the sub-pass has been started, and is given from the drawing processing unit 26. The flash request signal is a signal for requesting flash of the cache memory 41 and is given from the drawing processing unit 26.

プリロードアドレス、プリロードスレッドID、及びプリロードイネーブル信号はプリロードに関する信号であり、プリロード制御部43のアドレス保持部50から与えられる。   The preload address, preload thread ID, and preload enable signal are signals related to preload, and are given from the address holding unit 50 of the preload control unit 43.

またキャッシュ管理部45には、リフィルアクノリッジ信号、及びリフィルアクノリッジIDが、それぞれローカルメモリ13及びキャッシュアクセス制御部44から与えられる。更にライトバックアクノリッジ信号及びライトバックアクノリッジIDが、それぞれローカルメモリ13及びキャッシュアクセス制御部44から与えられる。   Further, the refill acknowledge signal and the refill acknowledge ID are given to the cache management unit 45 from the local memory 13 and the cache access control unit 44, respectively. Further, the write back acknowledge signal and the write back acknowledge ID are given from the local memory 13 and the cache access control unit 44, respectively.

キャッシュ管理部45は、キャッシュメモリ41のヒット判定、エントリのステータス管理、リクエスト発行エントリの決定、LRFの管理、及びキャッシュメモリ41のフラッシュ制御を行う。   The cache management unit 45 performs cache memory 41 hit determination, entry status management, request issue entry determination, LRF management, and cache memory 41 flush control.

キャッシュメモリ41のヒット判定について説明する。例えばロード命令が発行された場合、必要なデータをキャッシュメモリ41から描画処理部26へロードする必要がある。この時、必要なデータがキャッシュメモリ41に保持されていればよいが、保持されていない場合には当該データをローカルメモリからキャッシュメモリ41へ読み出す(リフィルする)必要がある。このように、必要なデータがキャッシュメモリ41内に保持されているか否かを判定することをヒット判定と呼ぶ。そしてヒット判定結果をヒットエントリ番号として、キャッシュアクセス制御部44へ出力する。   The hit determination of the cache memory 41 will be described. For example, when a load instruction is issued, it is necessary to load necessary data from the cache memory 41 to the drawing processing unit 26. At this time, it is sufficient that necessary data is held in the cache memory 41. However, when the data is not held, it is necessary to read (refill) the data from the local memory to the cache memory 41. In this way, determining whether or not necessary data is held in the cache memory 41 is called hit determination. The hit determination result is output to the cache access control unit 44 as a hit entry number.

ロード/ストア命令やプリロード命令がキャッシュミスした場合(キャッシュメモリ41に保持されていない場合)、キャッシュ管理部45はリフィル要求イネーブル信号及びリフィルアドレスをリクエスト発行制御部46へ出力する。   When a load / store instruction or a preload instruction causes a cache miss (when it is not held in the cache memory 41), the cache management unit 45 outputs a refill request enable signal and a refill address to the request issuance control unit 46.

またキャッシュ管理部45は、キャッシュメモリ41の各エントリのステータス管理を行う。そのためにキャッシュ管理部45は、キャッシュメモリ41の各エントリに対応して設けられ、ステータスフラグを保持するメモリ61を備えている。ステータスフラグは、キャッシュメモリ41において対応する各エントリの状態を示す。図19はメモリ61の概念図である。メモリ61は例えばSRAMやフリップフロップ等であり、メモリ51−0、51−1それぞれに対応して設けられる。図19では、メモリ51−0、51−1のいずれかに対応するステータスフラグのみを示している。   The cache management unit 45 manages the status of each entry in the cache memory 41. For this purpose, the cache management unit 45 includes a memory 61 provided corresponding to each entry in the cache memory 41 and holding a status flag. The status flag indicates the state of each corresponding entry in the cache memory 41. FIG. 19 is a conceptual diagram of the memory 61. The memory 61 is, for example, an SRAM or a flip-flop, and is provided corresponding to each of the memories 51-0 and 51-1. In FIG. 19, only the status flag corresponding to one of the memories 51-0 and 51-1 is shown.

図示するように、メモリ61はメモリ51−0、51−1と同様にM個のエントリ0〜(M−1)を備えている。そして各エントリはステータスフラグとして、タグT(Tag)、バリッドフラグV(Valid flag)、及びリフィルフラグR(Refill flag)を保持する。タグTは、対応するエントリに保持されるデータのアドレス信号に関する。より具体的には、図13で説明したアドレス信号に含まれるブロックIDと、ピクセルシェーダユニット番号の一部に対応する。また図14で説明したアドレス信号に含まれるスレッドIDに対応する。   As shown in the drawing, the memory 61 includes M entries 0 to (M−1) as in the memories 51-0 and 51-1. Each entry holds a tag T (Tag), a valid flag V (Valid flag), and a refill flag R (Refill flag) as status flags. The tag T relates to an address signal of data held in the corresponding entry. More specifically, it corresponds to a block ID included in the address signal described in FIG. 13 and a part of the pixel shader unit number. Further, it corresponds to the thread ID included in the address signal described in FIG.

バリッドフラグVは、対応するエントリに保持されるデータが有効(バリッド)か否かを示すフラグである。エントリは、リフィル要求が発行されるとバリッドとなり、フラッシュ(flush)されるとインバリッド(invalid)となる。   The valid flag V is a flag indicating whether or not the data held in the corresponding entry is valid (valid). An entry becomes valid when a refill request is issued, and becomes invalid when flushed.

リフィルフラグRは、リフィル要求を発行中であることを示すフラグである。リフィルフラグRは、リフィル要求を発行してから、実際にローカルメモリからキャッシュメモリ41へのデータ転送(これをリプレイス(replace)と呼ぶ)が完了されるまでアサートされ続ける。   The refill flag R is a flag indicating that a refill request is being issued. The refill flag R continues to be asserted after the refill request is issued until the data transfer from the local memory to the cache memory 41 is actually completed (this is called “replace”).

リクエスト発行エントリの決定とは、リフィルやプリロードを行う際に、キャッシュメモリ41においてデータを保持させるべきエントリを決定することであり、最も古くリフィルされたエントリから順に使用される。この点について図20を用いて説明する。発行エントリを決定するために、キャッシュ管理部45は、各々がMビットのエントリをM個有するメモリ62を備えている。メモリ62にLRFキュー(Least Recently Filled Queue)が保持される。LRFキューは、キャッシュメモリ41においてリフィルが行われた順序を示す。そしてメモリ62のエントリ0〜(M−1)の各ビットは、上位ビットから順にキャッシュメモリ41の各エントリ0〜(M−1)に対応し、メモリ62のエントリ0〜(M−1)の順にリフィルが行われた順序が古くなっていく。従って図20の例の場合、最近リフィルが行われたキャッシュメモリ41のエントリは、メモリ62のエントリ(M−1)に示されるようにエントリ3であり、次にエントリ1、エントリ5、…である。 キャッシュ管理部45は、図19に示したステータスフラグに基づいて、リクエスト発行可能エントリ信号を生成する。リクエスト発行可能エントリ信号は、現在リクエスト発行可能なエントリがいずれであるかを示す信号である。そして、上位ビットから順に、キャッシュメモリ41のエントリ0〜(M−1)に対応する。従って図20の例であると、キャッシュメモリ41のエントリ1、2、3がリクエスト発行可能であると分かる。   The determination of the request issue entry is to determine an entry to hold data in the cache memory 41 when refilling or preloading, and the entries are used in order from the oldest refilled entry. This point will be described with reference to FIG. In order to determine the issue entry, the cache management unit 45 includes a memory 62 having M entries each having M bits. An LRF queue (Least Recently Filled Queue) is held in the memory 62. The LRF queue indicates the order in which refilling is performed in the cache memory 41. The bits of entries 0 to (M−1) of the memory 62 correspond to the entries 0 to (M−1) of the cache memory 41 in order from the upper bit, and the entries 0 to (M−1) of the memory 62 The order in which refills were performed in order is getting older. Therefore, in the example of FIG. 20, the entry of the cache memory 41 that has been refilled recently is entry 3 as indicated by entry (M−1) of memory 62, and then entry 1, entry 5,. is there. The cache management unit 45 generates a request issuable entry signal based on the status flag shown in FIG. The request issuable entry signal is a signal indicating which entry is currently available for request issuance. The entries correspond to entries 0 to (M−1) in the cache memory 41 in order from the upper bit. Therefore, in the example of FIG. 20, it can be seen that entries 1, 2, and 3 in the cache memory 41 can issue requests.

そしてキャッシュ管理部45は、LRFキューとリクエスト発行可能エントリ信号との論理積演算を行う。(M−1)個のLRFキューとリクエスト発行可能エントリ信号との論理演算結果を順に並べることで、リクエスト発行キュー信号が得られる。リクエスト発行キュー信号は、LRFキューのいずれのエントリに基づいて発行エントリを決定すればよいかを示しており、上位ビットから順に、メモリ62のエントリ0〜(M−1)に対応している。従って図20の例であると、メモリ62のエントリ3、6、(M−1)に保持されたLRFキューに基づいて決めれば良いことが分かる。すると、キャッシュメモリ41において発行可能なエントリはエントリ1、2、3であるところ、これらのうちで最も昔にリフィルが行われたキャッシュメモリ41のエントリはエントリ2であることがLRFキューから分かる。従って、キャッシュメモリ41においてリクエスト発行エントリはエントリ2と決定される。これを示しているのがリクエスト発行エントリ信号である。この信号も、上位ビットから順にキャッシュメモリ41のエントリ0〜(M−1)に対応しており、“1”とされたビットに対応するエントリがリクエスト発行エントリである。なお図20に示す回路は、キャッシュメモリ41に含まれるメモリ51−0、51−1毎に設けられている。   Then, the cache management unit 45 performs an AND operation between the LRF queue and the request issuable entry signal. By arranging the logical operation results of (M−1) LRF queues and the request issuable entry signal in order, a request issuance queue signal is obtained. The request issue queue signal indicates which entry in the LRF queue should determine the issue entry, and corresponds to entries 0 to (M−1) of the memory 62 in order from the upper bit. Therefore, in the example of FIG. 20, it can be understood that the determination may be made based on the LRF queue held in the entries 3, 6, and (M-1) of the memory 62. Then, the entries that can be issued in the cache memory 41 are entries 1, 2, and 3. It can be seen from the LRF queue that the entry of the cache memory 41 that has been refilled earliest among these is the entry 2. Therefore, the request issue entry is determined as entry 2 in the cache memory 41. This is a request issue entry signal. This signal also corresponds to entries 0 to (M−1) in the cache memory 41 in order from the upper bit, and the entry corresponding to the bit set to “1” is the request issue entry. The circuit shown in FIG. 20 is provided for each of the memories 51-0 and 51-1 included in the cache memory 41.

次に図10におけるプリロード制御部43について説明する。プリロードアドレス発生部47は、プリロード時のアドレス信号を生成する。プリロード保持部48は、プリロード要求のなされたスレッドの管理を行う。サブパス情報管理部49は、サブパスでアクセスしたバッファに関する情報を記憶する。アドレス保持部50は、プリロードアドレス発生部47で生成されたアドレス信号を保持する。上記構成において、生成されたプリロードアドレスがキャッシュ管理部45に与えられる。プリロードに関しては第3の実施形態で詳細を説明する。   Next, the preload control unit 43 in FIG. 10 will be described. The preload address generator 47 generates an address signal at the time of preload. The preload holding unit 48 manages threads for which a preload request has been made. The subpath information management unit 49 stores information regarding the buffer accessed in the subpath. The address holding unit 50 holds the address signal generated by the preload address generation unit 47. In the above configuration, the generated preload address is given to the cache management unit 45. Details of the preload will be described in the third embodiment.

次に、上記データ制御部27の動作について説明する。データ制御部27は、キャッシュメモリ41、ローカルメモリ13、及び描画処理部26との間のデータの授受を管理する。これらの間のデータの授受は、図21に示すようにプリロード、ロード/ストア、リフィル、及びライトバックの4種類がある。本実施形態ではロード/ストア及びリフィルについて説明する。   Next, the operation of the data control unit 27 will be described. The data control unit 27 manages data exchange between the cache memory 41, the local memory 13, and the drawing processing unit 26. As shown in FIG. 21, there are four types of data exchange between these: preload, load / store, refill, and write back. In this embodiment, load / store and refill will be described.

まず、ロード/ストア命令が発行された際のロード動作について図22を用いて説明する。図22はピクセルシェーダユニットのブロック図である。ロードは、キャッシュメモリ41から描画処理部26へデータを転送する動作である。   First, a load operation when a load / store instruction is issued will be described with reference to FIG. FIG. 22 is a block diagram of the pixel shader unit. The load is an operation of transferring data from the cache memory 41 to the drawing processing unit 26.

まず描画処理部26からロード要求信号がキャッシュ管理部45に与えられる。またアドレス発生部40は、図13、図14で説明した方法によりアドレスを生成し、キャッシュデータアドレス信号をキャッシュ管理部45に与え、キャッシュインデックスエントリ信号及びキャッシュエントリ信号をキャッシュアクセス制御部44に与える。するとキャッシュ管理部45はヒット判定を行い、ヒットエントリ番号をキャッシュアクセス制御部44に与え、またロードイネーブル信号をキャッシュアクセス制御部44に与える。   First, a load request signal is given from the rendering processing unit 26 to the cache management unit 45. The address generation unit 40 generates an address by the method described with reference to FIGS. 13 and 14, provides a cache data address signal to the cache management unit 45, and provides a cache index entry signal and a cache entry signal to the cache access control unit 44. . Then, the cache management unit 45 performs hit determination, gives a hit entry number to the cache access control unit 44, and gives a load enable signal to the cache access control unit 44.

そしてキャッシュアクセス制御部44が、キャッシュイネーブル信号を発生してキャッシュメモリ41をイネーブルにする。更に、キャッシュメモリ41における、キャッシュインデックスエントリ信号及びキャッシュエントリ信号に対応したアドレスにアクセスし、キャッシュメモリ41からデータを読み出す。またキャッシュアクセス制御部44は、ロードイネーブル信号を描画処理部26に返す。キャッシュメモリ41から読み出されたキャッシュリードデータは描画処理部26へ転送される。
以上のようにして、キャッシュメモリ41内のデータ(キャッシュリードデータ)が描画処理部26へロードされる。
Then, the cache access control unit 44 enables the cache memory 41 by generating a cache enable signal. Further, the cache memory 41 accesses the cache index entry signal and the address corresponding to the cache entry signal, and reads data from the cache memory 41. Further, the cache access control unit 44 returns a load enable signal to the drawing processing unit 26. The cache read data read from the cache memory 41 is transferred to the drawing processing unit 26.
As described above, the data (cache read data) in the cache memory 41 is loaded into the drawing processing unit 26.

次にストア動作について図23を用いて説明する。図23はピクセルシェーダユニットのブロック図である。ストアは、描画処理部26で処理したデータをキャッシュメモリ41に保持させる動作である。   Next, the store operation will be described with reference to FIG. FIG. 23 is a block diagram of the pixel shader unit. The store is an operation for causing the cache memory 41 to hold the data processed by the drawing processing unit 26.

まず描画処理部26からストア要求信号がキャッシュ管理部45に与えられる。またアドレス発生部40はアドレスを生成し、キャッシュインデックスエントリ信号及びキャッシュエントリ信号をキャッシュアクセス制御部44に与える。更に描画処理部26からキャッシュアクセス制御部44へ、ストアイネーブル信号及びストアデータが与えられる。   First, a store request signal is given from the drawing processing unit 26 to the cache management unit 45. The address generator 40 generates an address, and provides the cache index entry signal and the cache entry signal to the cache access controller 44. Further, a store enable signal and store data are given from the drawing processing unit 26 to the cache access control unit 44.

そしてキャッシュアクセス制御部44が、キャッシュイネーブル信号を発生してキャッシュメモリ41をイネーブルにする。更にキャッシュアクセス制御部44は、キャッシュメモリ41にストアデータをキャッシュライトデータとして与える。またキャッシュアクセス制御部44は、キャッシュインデックスエントリ信号及びキャッシュエントリ信号によって示されるアドレスを、キャッシュアドレスとしてキャッシュメモリ41に与える。これにより、キャッシュメモリ41においてキャッシュアドレスに対応するエントリに、ストアデータが書き込まれる。
以上のようにして、描画処理部26内のデータがキャッシュメモリ41にストアされる。
Then, the cache access control unit 44 enables the cache memory 41 by generating a cache enable signal. Further, the cache access control unit 44 gives store data to the cache memory 41 as cache write data. In addition, the cache access control unit 44 provides the cache memory 41 with the cache index entry signal and the address indicated by the cache entry signal as a cache address. As a result, the store data is written to the entry corresponding to the cache address in the cache memory 41.
As described above, the data in the drawing processing unit 26 is stored in the cache memory 41.

次にリフィル動作について図24を用いて説明する。図24はピクセルシェーダユニットのブロック図である。リフィルは、描画処理部26からキャッシュメモリ41に対して要求されたデータがキャッシュメモリ41に存在しない場合に、該データをローカルメモリからキャッシュメモリ41に読み出す動作である。   Next, the refill operation will be described with reference to FIG. FIG. 24 is a block diagram of the pixel shader unit. The refill is an operation of reading data requested from the drawing processing unit 26 to the cache memory 41 when the data does not exist in the cache memory 41 from the local memory to the cache memory 41.

まず、キャッシュ管理部45においてヒット判定がミスした場合、換言すれば、ヒットエントリ番号が全ビットゼロであった場合、すなわち必要なデータがキャッシュメモリ41に無かった場合、キャッシュ管理部45はリフィル要求イネーブル信号、リフィルアドレス、及びリフィル要求IDをリクエスト発行制御部46へ出力する。これらの信号を受けて、リクエスト発行制御部46はリクエスト数をカウントアップする。またリクエスト発行制御部46は、ローカルメモリ13に対してリフィルをリクエストする(リフィル要求信号を出力する)。   First, when the hit determination is missed in the cache management unit 45, in other words, when the hit entry number is all bits zero, that is, when the necessary data is not in the cache memory 41, the cache management unit 45 sets the refill request enable. The signal, refill address, and refill request ID are output to the request issuance control unit 46. Upon receiving these signals, the request issuance control unit 46 counts up the number of requests. Further, the request issuance control unit 46 requests refilling from the local memory 13 (outputs a refill request signal).

リフィル要求を受けたローカルメモリ13は、キャッシュ管理部45、キャッシュアクセス制御部44、及びリクエスト発行制御部46に対して、リフィルアクノリッジ信号を出力する。リフィルアクノリッジ信号を受けたキャッシュアクセス制御部44は、キャッシュ管理部45に対してリフィルアクノリッジIDを出力する。これによりキャッシュ管理部45は、リフィル要求が確かに受け取られたことを認識する。リフィルアクノリッジ信号が出力された後、ローカルメモリ13からキャッシュアクセス制御部44に対してリフィルデータが出力される。するとキャッシュアクセス制御部44はストア動作と同じ要領により、リフィルデータをキャッシュメモリ41にリプレイスする。但し、リフィルに使用されるエントリは、図20で説明したLRFキューによって決定される。
以上のようにして、ローカルメモリ13からデータがキャッシュメモリ41にリフィルされる。
The local memory 13 that has received the refill request outputs a refill acknowledge signal to the cache management unit 45, the cache access control unit 44, and the request issuance control unit 46. Upon receiving the refill acknowledge signal, the cache access control unit 44 outputs a refill acknowledge ID to the cache management unit 45. As a result, the cache management unit 45 recognizes that the refill request has been received. After the refill acknowledge signal is output, the refill data is output from the local memory 13 to the cache access control unit 44. Then, the cache access control unit 44 replaces the refill data in the cache memory 41 in the same manner as the store operation. However, the entry used for refilling is determined by the LRF queue described with reference to FIG.
As described above, data is refilled from the local memory 13 to the cache memory 41.

上記のように、ロード/ストア命令が発行されると、キャッシュ管理部45がヒット判定を行ってキャッシュメモリ41のエントリをチェックする。ヒット判定がヒットした場合にはロード/ストア動作を行い、ミスした場合にはリフィルを行う。リフィルを行うエントリはLRFキューによって決定される。ミスした場合であっても、例えばローカルメモリ13のリクエストキューがフル(full)の場合や、キャッシュメモリ41に空きエントリが無い場合にはリフィル要求を発行することが出来ず、「待ち」の状態となる。従って、ロード/ストア命令が発行された場合、データ制御部27には、図25に示すように3つの状態を取り得る。図25はデータ制御部27の状態遷移図である。   As described above, when a load / store instruction is issued, the cache management unit 45 performs hit determination and checks an entry in the cache memory 41. When the hit determination is hit, a load / store operation is performed, and when it is missed, refill is performed. The entry to be refilled is determined by the LRF queue. Even if there is a miss, for example, if the request queue of the local memory 13 is full or if there is no free entry in the cache memory 41, the refill request cannot be issued, and the state is "waiting" It becomes. Therefore, when a load / store instruction is issued, the data control unit 27 can take three states as shown in FIG. FIG. 25 is a state transition diagram of the data control unit 27.

図示するように、データ制御部27は、「実行状態(Exec)」、「待ち状態(Wait)」、及び「フィル状態(Fill)」の3つの状態を取る。実行状態は、ヒット判定の結果ロード/ストア命令がヒットした場合であり、ピクセルシェーダユニットが動作している状態である。待ち状態は、ヒット判定の結果ロード/ストア命令がミスした場合であり、リフィル要求を発行しようとしている状態である。そしてこの状態ではピクセルシェーダユニットはストールしている。フィル状態は、ローカルメモリ13に対してリフィル要求が発行されている状態である。この状態でもピクセルシェーダユニットはストールしている。   As shown in the figure, the data control unit 27 takes three states of “execution state (Exec)”, “waiting state (Wait)”, and “fill state (Fill)”. The execution state is when the load / store instruction hits as a result of the hit determination, and is a state where the pixel shader unit is operating. The wait state is a state in which a load / store instruction misses as a result of hit determination, and is a state in which a refill request is about to be issued. In this state, the pixel shader unit is stalled. The fill state is a state in which a refill request has been issued to the local memory 13. Even in this state, the pixel shader unit is stalled.

上記3つの状態が変化するトリガは下記の通りである。各番号は、図25に記した状態遷移の番号に一致する。
1.実行状態から遷移しない:ロード/ストア命令がヒット
2.実行状態から待ち状態へ:ロード/ストア命令がミス
3.待ち状態からフィル状態へ:リフィル要求が発行される
4.フィル状態から実行状態へ:リフィルアクノリッジ信号が返される
5.待ち状態から遷移しない:ロード/ストア命令がミスしたが、リフィル要求を発行できない
6.フィル状態から遷移しない:リフィルアクノリッジ信号が返されない。
The triggers that change the above three states are as follows. Each number corresponds to the number of the state transition shown in FIG.
1. No transition from execution state: hit load / store instruction
2. From execution state to wait state: Missing load / store instruction
3. From wait state to fill state: A refill request is issued
4). From fill state to run state: A refill acknowledge signal is returned.
5. No transition from wait state: Load / store instruction missed but refill request cannot be issued
6). No transition from fill state: No refill acknowledge signal is returned.

次にロード/ストア命令が発行された際の動作の詳細について、図26及び図27を用いて説明する。図26はデータ制御部27の動作のフローチャートであり、図27は各種信号のタイミングチャートである。   Next, details of the operation when a load / store instruction is issued will be described with reference to FIGS. FIG. 26 is a flowchart of the operation of the data control unit 27, and FIG. 27 is a timing chart of various signals.

まずロードストア命令が描画処理部26から発行される(ステップS10)。すなわち図27の時刻t0においてロード要求信号が発行される。   First, a load store instruction is issued from the drawing processing unit 26 (step S10). That is, a load request signal is issued at time t0 in FIG.

すると、ロード要求信号に応答してキャッシュ管理部45がヒット判定を行う(ステップS11)。より具体的には、要求されたアドレスと、ステータスフラグ内のタグTとを比較する。   Then, the cache management unit 45 makes a hit determination in response to the load request signal (step S11). More specifically, the requested address is compared with the tag T in the status flag.

タグとアドレスとが一致すると(ステップS12)、次にキャッシュ管理部45はステータスフラグ内のリフィルフラグRをチェックする(ステップS13)。リフィルフラグRが“0”の場合(ステップS14)、当該エントリについてのリプレイスは完了しているから、そのデータを用いてロード/ストア命令を実行する(ステップS15)。   When the tag matches the address (step S12), the cache management unit 45 next checks the refill flag R in the status flag (step S13). When the refill flag R is “0” (step S14), since the replacement for the entry has been completed, a load / store instruction is executed using the data (step S15).

ステップS12でアドレスとタグTとが不一致だった場合、すなわちロード/ストア命令がミスした場合、リフィル要求発行可能なエントリがあるか否かをチェックする(ステップS16)。リフィル要求発行可能なエントリがある場合、キャッシュ管理部45はリフィル要求(リフィル要求イネーブル信号、時刻t2)を発行する(ステップS18)。またリクエスト発行制御部46もリフィル要求信号をローカルメモリ13に対して出力する。   If the address does not match the tag T in step S12, that is, if the load / store instruction misses, it is checked whether there is an entry that can issue a refill request (step S16). If there is an entry that can issue a refill request, the cache management unit 45 issues a refill request (refill request enable signal, time t2) (step S18). The request issuance control unit 46 also outputs a refill request signal to the local memory 13.

次のサイクルでキャッシュ管理部45は、対応するエントリのステータスフラグ内のタグTをリフィルデータに関する情報に書き換えると共に、リフィルフラグRを“1”とする(ステップS19、時刻t2)。そして、このロード/ストア命令はストール(stall)する(ステップS20)。ストールは、ローカルメモリ13からリフィルアクノリッジ信号が返ってくるまで続く。ストールした状態で、再度ロード/ストア命令が発行される(ステップS21)。すると、ヒット判定(ステップS11)ではアドレスとタグTとが一致するので(ステップS12)、次にリフィルフラグRをチェックする(ステップS14)。ローカルメモリ13からリフィルアクノリッジ信号が返ってきていればリフィルフラグRは“0”となる。従ってステップS15に進む。しかしローカルメモリ13からリフィルアクノリッジ信号が返ってきていなければリフィルフラグRは“1”のままなので、ステップS20に進んでストールが継続される。   In the next cycle, the cache management unit 45 rewrites the tag T in the status flag of the corresponding entry with information related to the refill data, and sets the refill flag R to “1” (step S19, time t2). This load / store instruction is stalled (step S20). The stall continues until a refill acknowledge signal is returned from the local memory 13. In a stalled state, a load / store instruction is issued again (step S21). Then, since the address and the tag T match in the hit determination (step S11) (step S12), the refill flag R is checked next (step S14). If the refill acknowledge signal is returned from the local memory 13, the refill flag R is "0". Accordingly, the process proceeds to step S15. However, if the refill acknowledge signal is not returned from the local memory 13, the refill flag R remains "1", so the process proceeds to step S20 and the stall is continued.

ステップS17でリフィル要求発行可能なエントリが無かった場合、エントリが空くまでストールを続け(ステップS22)、再度ロード/ストア命令を発行する(ステップS23)。ストールを続けていると、やがていずれかのエントリがリフィル要求発行可能となるので、そのエントリに対してリフィル要求が発行される(ステップS18)。   If there is no entry that can issue the refill request in step S17, the stall is continued until the entry becomes empty (step S22), and the load / store instruction is issued again (step S23). If the stall is continued, any of the entries can be refilled in a short time, and a refill request is issued for the entry (step S18).

次に、キャッシュ管理部45におけるヒット判定のための構成と、その方法について図28を用いて説明する。図28はキャッシュ管理部45の一部と、キャッシュメモリ41のブロック図である。   Next, the configuration and method for hit determination in the cache management unit 45 will be described with reference to FIG. FIG. 28 is a block diagram of a part of the cache management unit 45 and the cache memory 41.

図示するように、キャッシュ管理部45はメモリ61の他に、メモリ53−0〜53−(M−1)毎にそれぞれ設けられた選択回路65、比較回路66、及びANDゲート67を備えている。またキャッシュメモリ41は、選択回路68、69、及びメモリ70を備えている。   As illustrated, the cache management unit 45 includes a selection circuit 65, a comparison circuit 66, and an AND gate 67 provided for each of the memories 53-0 to 53- (M-1) in addition to the memory 61. . In addition, the cache memory 41 includes selection circuits 68 and 69 and a memory 70.

ヒット判定のためにキャッシュ管理部45には、キャッシュデータアドレス信号が入力される。キャッシュデータアドレス信号は、フレームバッファモードにおいてはブロックID、オフセットデータ、及びピクセルシェーダユニット番号を含む。そして、ブロックID及びピクセルシェーダユニット番号が対象データについてのタグ情報を示し、オフセットデータがインデックス情報を示す。メモリレジスタモードでは、キャッシュデータアドレス信号はスレッドID及びオフセットデータを含む。そして、スレッドIDがタグ情報を示し、オフセットデータがインデックス情報を示す。インデックス情報とは、メモリ51−0、51−1のいずれにアクセスすべきであるかを示す信号である。まず選択回路65は、アドレス信号のインデックス情報に基づいて、キャッシュメモリ41内のメモリ51−0、51−1のいずれかを選択する。次に比較回路66の各々は、選択回路65の各々で選択されたメモリ51−0または51−1におけるメモリ53−0〜53−(M−1)、すなわちエントリ0〜(M−1)に対応するタグTと、キャッシュデータアドレス信号から得られるタグ情報とを比較する。両者が一致した場合、比較回路66は“1”を出力し、不一致の場合には“0”を出力する。更にANDゲート67の各々は、選択回路65の各々で選択されたメモリ51−0または51−1におけるメモリ53−0〜53−(M−1)に対応するバリッドフラグVと、比較回路66の各々の出力とのAND演算を行う。このAND演算結果が信号ヒットエントリ番号となる。ヒットエントリ番号においていずれかのビットが“1”であるということは、そのビットに対応したメモリ53−0〜53−(M−1)のいずれかに該当データが保持されているということを意味する。   A cache data address signal is input to the cache management unit 45 for hit determination. The cache data address signal includes a block ID, offset data, and a pixel shader unit number in the frame buffer mode. The block ID and the pixel shader unit number indicate tag information about the target data, and the offset data indicates index information. In the memory register mode, the cache data address signal includes a thread ID and offset data. The thread ID indicates tag information, and the offset data indicates index information. The index information is a signal indicating which of the memories 51-0 and 51-1 should be accessed. First, the selection circuit 65 selects one of the memories 51-0 and 51-1 in the cache memory 41 based on the index information of the address signal. Next, each of the comparison circuits 66 enters the memories 53-0 to 53- (M-1) in the memories 51-0 or 51-1 selected by the selection circuits 65, that is, the entries 0 to (M-1). The corresponding tag T is compared with the tag information obtained from the cache data address signal. When the two match, the comparison circuit 66 outputs “1”, and when they do not match, outputs “0”. Further, each of the AND gates 67 includes a valid flag V corresponding to the memories 53-0 to 53- (M-1) in the memory 51-0 or 51-1 selected by each of the selection circuits 65, and the comparison circuit 66. An AND operation is performed on each output. The AND operation result becomes the signal hit entry number. If any bit in the hit entry number is “1”, it means that the corresponding data is held in any of the memories 53-0 to 53- (M−1) corresponding to the bit. To do.

選択回路68は、ヒットエントリ番号に基づいていずれかのメモリ0〜(M−1)、すなわちいずれかのエントリ0〜(M−1)を選択する。例えばヒットエントリ番号が(10000…)である場合には、エントリ0に該当データが保持されているということであるから、エントリ0を選択する。なお、前述の通り本実施形態の例であると、キャッシュメモリ41はサブエントリ単位で外部とデータの授受を行う。従って選択回路69は、選択回路68で選択されたエントリに含まれるL個のサブエントリ0〜(L−1)のいずれかを、キャッシュエントリ信号に基づいて選択する。キャッシュエントリ信号は、前述の通りクアッドIDとオフセットデータとを含む。そしてキャッシュエントリ信号は、各エントリ0〜(M−1)においていずれのサブエントリ0〜(L−1)にアクセスすべきかを示すエントリ情報となる。選択回路69によって選択された1サブエントリ分のデータが、キャッシュリードデータとなる。   The selection circuit 68 selects one of the memories 0 to (M−1), that is, one of the entries 0 to (M−1) based on the hit entry number. For example, when the hit entry number is (10000...), It means that the corresponding data is stored in entry 0, and therefore entry 0 is selected. As described above, in the example of this embodiment, the cache memory 41 exchanges data with the outside in units of subentries. Therefore, the selection circuit 69 selects any one of the L subentries 0 to (L−1) included in the entry selected by the selection circuit 68 based on the cache entry signal. As described above, the cache entry signal includes the quad ID and the offset data. The cache entry signal is entry information indicating which sub-entry 0 to (L-1) should be accessed in each entry 0 to (M-1). The data for one subentry selected by the selection circuit 69 is cache read data.

以上のように、この発明の第1の実施形態に係るグラフィックプロセッサによれば、下記(1)の効果を得ることが出来る。
(1)グラフィックプロセッサ内のハードウェアを削減出来る(その1)。
As described above, according to the graphic processor of the first embodiment of the present invention, the following effect (1) can be obtained.
(1) Hardware in the graphic processor can be reduced (part 1).

本実施形態によれば、キャッシュ管理部45はステータスフラグとして、リフィルRとタグTを保持している。そしてキャッシュ管理部45は、ヒット判定において当該ロード/ストア命令がミスした際には、まずリフィル要求を発行すると共にタグTを書き換える。この時点では、まだリプレイスは開始されていない。すなわち、タグTの示す情報と、キャッシュメモリ41の対応するエントリ内のデータとが不一致となる。従ってキャッシュ管理部45は、両者が一致しているか否かをリフィルRフラグによって管理している。その結果、グラフィックプロセッサのハードウェアを削減でき、製造コストを削減出来る。この点につき、以下詳細に説明する。   According to the present embodiment, the cache management unit 45 holds the refill R and the tag T as status flags. When the load / store instruction misses in the hit determination, the cache management unit 45 first issues a refill request and rewrites the tag T. At this point, the replacement has not yet started. That is, the information indicated by the tag T and the data in the corresponding entry of the cache memory 41 do not match. Therefore, the cache management unit 45 manages whether or not the two match with each other using the refill R flag. As a result, the hardware of the graphic processor can be reduced, and the manufacturing cost can be reduced. This point will be described in detail below.

図29はリフィルフラグRを使用しない場合に考え得るキャッシュ管理部45の構成を示すブロック図である。キャッシュ管理部45は、本実施形態に構成に加えて、更にロード/ストアミスキュー(load/store miss queue)71と、比較器72を備えている。ロード/ストアミスキュー71は、リプレイスが完了していないロード/ストア命令を保持する。   FIG. 29 is a block diagram showing a configuration of the cache management unit 45 that can be considered when the refill flag R is not used. The cache management unit 45 further includes a load / store miss queue 71 and a comparator 72 in addition to the configuration of the present embodiment. The load / store miss queue 71 holds a load / store instruction that has not been replaced.

図29においてロード/ストア命令が発行されると、まずヒット判定が行われる。すなわち、比較器66は、入力されたアドレスとタグTとを比較する。両者が一致しなかった場合、更に比較器72が、入力されたアドレスと、ロード/ストアミスキュー71とを比較する。比較器72において、両者が不一致だった場合には、当該ロード/ストア命令はロード/ストアミスキュー71に保持され、リフィル要求が発行される。比較器66、72の両方で比較結果がミスであった時にリフィル要求が発行される。リフィル要求が発行されてリプレイスが完了すると、この時点でタグTが書き換えられる。すなわち、タグTの示す情報と、キャッシュメモリ41内のデータとは常時一致している。   In FIG. 29, when a load / store instruction is issued, hit determination is first performed. That is, the comparator 66 compares the input address with the tag T. If they do not match, the comparator 72 further compares the input address with the load / store misqueue 71. If the comparator 72 does not match the load / store instruction, the load / store instruction is held in the load / store miss queue 71 and a refill request is issued. A refill request is issued when the comparison result is a mistake in both the comparators 66 and 72. When the refill request is issued and the replacement is completed, the tag T is rewritten at this point. That is, the information indicated by the tag T and the data in the cache memory 41 always match.

これに対して、本実施形態に係るキャッシュ管理部45の構成を簡略化して示したのが図30である。本実施形態では、比較器66においてアドレスとタグTとが一致しなかった場合、リフィル要求を発行し、この時点でタグTを書き換え、更にリフィルRフラグを“1”にする。その後、いずれかのタイミングでリプレイスを行う。リプレイスが完了すると、リフィルフラグRは“0”に戻る。比較器66においてアドレスとタグTとが一致した場合には、当該エントリがリプレイス中であるか否かをリフィルフラグRによってチェックする。そしてリプレイスが完了していない場合には当該ロード/ストア命令はストールされ、完了している場合にはロード/ストア命令を実行する。   On the other hand, FIG. 30 shows a simplified configuration of the cache management unit 45 according to the present embodiment. In the present embodiment, when the address does not match the tag T in the comparator 66, a refill request is issued, the tag T is rewritten at this point, and the refill R flag is set to “1”. Thereafter, the replacement is performed at any timing. When the replacement is completed, the refill flag R returns to “0”. When the address matches the tag T in the comparator 66, it is checked by the refill flag R whether or not the entry is being replaced. When the replacement is not completed, the load / store instruction is stalled. When the replacement is completed, the load / store instruction is executed.

このように、リフィル要求の発行と共にタグTを書き換えてしまうため、図29におけるロード/ストアミスキュー71が不要となる。更にリプレイスが完了したか否かをリフィルフラグによって管理している。そのため図29における比較器72も不要である。その結果、図29に示す構成に比べてハードウェアを削減でき、製造コストを削減出来る。
なお本実施形態では、図27に示すように、ロード/ストア命令は2周期に1度しか発行されない。そのため、リフィル要求と共にタグTの書き換えが可能となる。なぜなら、図27に示すように最初のサイクルでタグの読み出しとヒット判定を行い、次のサイクルでタグの書き換えを行う必要があるからである。
As described above, since the tag T is rewritten together with the issuance of the refill request, the load / store misqueue 71 in FIG. 29 is not necessary. Further, whether or not the replacement is completed is managed by a refill flag. Therefore, the comparator 72 in FIG. 29 is also unnecessary. As a result, the hardware can be reduced compared with the configuration shown in FIG. 29, and the manufacturing cost can be reduced.
In the present embodiment, as shown in FIG. 27, the load / store instruction is issued only once every two cycles. Therefore, the tag T can be rewritten together with the refill request. This is because, as shown in FIG. 27, it is necessary to perform tag reading and hit determination in the first cycle, and to rewrite the tag in the next cycle.

また、前述のようにアドレス信号の計算方法は上記実施形態で説明した方法に限定されることはなく、ブロック内に含まれるスタンプの数や、ピクセルシェーダユニット24の数などによって変化出来る。またアドレス信号の内部構成も図13、図14に示したものに限られない。図28に示すように、アドレス信号はタグ情報、インデックス情報、及びエントリ情報を含んでいれば足りる。更に、キャッシュメモリ41がメモリ51−0、51−1のいずれか一方しか含まない場合にはインデックス情報は不要であるし、キャッシュメモリ41のエントリサイズでデータ転送可能であればエントリ情報も不要であり、このような場合にはアドレス発生部40はタグ情報のみを生成すれば良い。そしてアドレス発生部40には、上記のようなアドレス信号を生成するための情報が与えられる必要がある。それらの情報として、本実施形態では図12に示すようにオフセットデータ、XY座標、スレッドID、クアッドID、サブパスID、及びバッファモード信号が与えられる場合について説明した。しかし、これらは一例に過ぎず、タグ情報と、その他の必要なアドレスとを生成するのに使用できる信号であれば限定されない。また本実施形態では、タグTが、スレッドIDやピクセルシェーダユニット番号の一部に対応する情報である場合を例に挙げて説明した。しかし、タグTとして用いる情報は、データを識別出来るものであれば良く、スレッドID及びピクセルシェーダユニット番号以外の情報であっても良い。   Further, as described above, the address signal calculation method is not limited to the method described in the above embodiment, and can be changed depending on the number of stamps included in the block, the number of pixel shader units 24, and the like. The internal configuration of the address signal is not limited to that shown in FIGS. As shown in FIG. 28, the address signal only needs to include tag information, index information, and entry information. Further, when the cache memory 41 includes only one of the memories 51-0 and 51-1, the index information is unnecessary, and the entry information is unnecessary if data transfer is possible with the entry size of the cache memory 41. In such a case, the address generation unit 40 may generate only tag information. The address generator 40 needs to be given information for generating the address signal as described above. In this embodiment, as the information, offset data, XY coordinates, thread ID, quad ID, sub path ID, and buffer mode signal are given as shown in FIG. However, these are only examples, and any signal that can be used to generate tag information and other necessary addresses is not limited. In the present embodiment, the case where the tag T is information corresponding to a part of the thread ID or the pixel shader unit number has been described as an example. However, the information used as the tag T may be information that can identify the data, and may be information other than the thread ID and the pixel shader unit number.

次に、この発明の第2の実施形態に係るグラフィックプロセッサについて説明する。本実施形態は、上記第1の実施形態で説明したグラフィックプロセッサにおけるライトバック動作に関するものである。   Next explained is a graphic processor according to the second embodiment of the invention. The present embodiment relates to a write back operation in the graphic processor described in the first embodiment.

本実施形態に係るキャッシュ管理部45は、上記第1の実施形態で説明した制御に加えて、更にライトバック動作を制御する。ライトバックとは、図21で説明したように、キャッシュメモリ41内のデータをローカルメモリに書き込むことである。描画処理部26からストア命令が発行された際、データはキャッシュメモリ41にのみ書き込まれる。すなわち、キャッシュメモリ41内のデータのみがアップデートされる。従って、キャッシュメモリ41内のデータとローカルメモリ内のデータとが一致しないことになる。このような状態でキャッシュメモリ41内のデータが失われることを避けるためにライトバックが行われる。なお、キャッシュメモリ41内にのみアップデートされたデータが保持されている状態を、以下ではダーティー(dirty)と呼ぶことにする。   In addition to the control described in the first embodiment, the cache management unit 45 according to the present embodiment further controls the write back operation. As described with reference to FIG. 21, the write-back means writing data in the cache memory 41 to the local memory. When a store instruction is issued from the drawing processing unit 26, data is written only in the cache memory 41. That is, only the data in the cache memory 41 is updated. Therefore, the data in the cache memory 41 and the data in the local memory do not match. In such a state, write back is performed to avoid losing data in the cache memory 41. A state in which updated data is held only in the cache memory 41 will be referred to as “dirty” below.

図31はキャッシュ管理部45の備えるメモリ61の概念図であり、ステータスフラグとしてタグT、バリッドフラグV、リフィルフラグRの他に、ダーティーフラグD及びライトバックフラグWを保持する。ダーティーフラグDは、対応するエントリがダーティーであるか否か、すなわち、エントリに対して描画処理部26からデータの書き込みがあったことを示す。そしてライトバックデータの読み出しを開始するまでアサートされる。ライトバックフラグWは、対応するエントリがライトバック要求を発行中であるか否かを示す。そしてライトバック要求が発行されてからライトバックデータの読み出しが開始されるまでアサートされる。   FIG. 31 is a conceptual diagram of the memory 61 included in the cache management unit 45. In addition to the tag T, the valid flag V, and the refill flag R, the dirty flag D and the write back flag W are held as status flags. The dirty flag D indicates whether or not the corresponding entry is dirty, that is, the drawing processing unit 26 has written data to the entry. The signal is asserted until reading of the write back data is started. The write back flag W indicates whether or not the corresponding entry is issuing a write back request. The signal is asserted after the write back request is issued until the reading of the write back data is started.

図32はキャッシュ管理部45において、ライトバック要求を発行するための構成のブロック図である。図示するようにキャッシュ管理部45は、カウンタ73と選択回路74を備えている。選択回路74は、カウンタ73におけるカウント数に応じたエントリのダーティーフラグDを選択する。   FIG. 32 is a block diagram of a configuration for issuing a write-back request in the cache management unit 45. As illustrated, the cache management unit 45 includes a counter 73 and a selection circuit 74. The selection circuit 74 selects the dirty flag D of the entry corresponding to the count number in the counter 73.

次にライトバック動作について図33を用いて説明する。図33はピクセルシェーダユニットのブロック図である。
まずキャッシュ管理部45からライトバック要求信号がローカルメモリ13へ出力される。ライトバック要求がローカルメモリ13にエンターされると、ローカルメモリ13からライトバックアクノリッジ信号がキャッシュ管理部45及びキャッシュアクセス制御部44へ出力され、またライトバックIDがキャッシュアクセス制御部44へ出力される。
Next, the write back operation will be described with reference to FIG. FIG. 33 is a block diagram of the pixel shader unit.
First, a write back request signal is output from the cache management unit 45 to the local memory 13. When the write back request is entered into the local memory 13, a write back acknowledge signal is output from the local memory 13 to the cache management unit 45 and the cache access control unit 44, and a write back ID is output to the cache access control unit 44. .

するとキャッシュアクセス制御部44はライトバックIDに基づいて、キャッシュメモリ41からデータ(キャッシュリードデータ)を読み出す。データをキャッシュメモリ41から読み出したキャッシュアクセス制御部44は、ライトバックアクノリッジIDをキャッシュ管理部45へ返すと共に、読み出しデータをライトバックデータとしてローカルメモリ13に書き込む。その後、キャッシュ管理部45はライトバックアクノリッジIDに応答して、対応するエントリのダーティーフラグD及びライトバックフラグWをデアサート(“0”に)する。   Then, the cache access control unit 44 reads data (cache read data) from the cache memory 41 based on the write back ID. The cache access control unit 44 that has read the data from the cache memory 41 returns the write back acknowledge ID to the cache management unit 45 and writes the read data to the local memory 13 as write back data. Thereafter, in response to the write-back acknowledge ID, the cache management unit 45 deasserts (sets to “0”) the dirty flag D and the write-back flag W of the corresponding entry.

次にキャッシュ管理部45における、ライトバックを行うエントリの選択方法について図34のフローチャートを用いて説明する。まずキャッシュ管理部45は現在のカウンタ73のカウンタ値に対応するエントリのダーティーフラグDをチェックする(ステップS30)。ダーティーフラグD=“1”であれば(ステップS31)、対応するエントリにつきライトバック要求を発行する(ステップS32)。ダーティーフラグD=“0”であれば発行しない。そしてカウンタ値が最終エントリに対応する値を示していた場合(ステップS33)、カウンタ値をリセットして(ステップS30)、ステップS30に戻る。カウンタ値が最終エントリに対応する値を示していない場合(ステップS33)には、カウンタ73はカウントアップしてステップS30に戻る。
すなわち、キャッシュメモリ41内の全エントリ0〜2(M−1)について、ダーティーフラグDを順番にチェックし、そのダーティーフラグDがアサートされていた場合にライトバック要求を発行する。
その他の構成及び動作は第1の実施形態と同様である。
Next, a method for selecting an entry to be written back in the cache management unit 45 will be described with reference to the flowchart of FIG. First, the cache management unit 45 checks the dirty flag D of the entry corresponding to the current counter value of the counter 73 (step S30). If the dirty flag D = “1” (step S31), a write-back request is issued for the corresponding entry (step S32). Not issued if dirty flag D = "0". If the counter value indicates the value corresponding to the last entry (step S33), the counter value is reset (step S30), and the process returns to step S30. If the counter value does not indicate a value corresponding to the last entry (step S33), the counter 73 counts up and returns to step S30.
That is, for all entries 0 to 2 (M−1) in the cache memory 41, the dirty flag D is checked in order, and if the dirty flag D is asserted, a write-back request is issued.
Other configurations and operations are the same as those in the first embodiment.

以上のように、この発明の第2の実施形態に係るグラフィックプロセッサによれば、第1の実施形態で説明した(1)の効果に加えて、下記(2)、(3)の効果を得ることが出来る。
(2)グラフィックプロセッサ内のハードウェアを削減出来る(その2)。
As described above, according to the graphic processor of the second embodiment of the present invention, the following effects (2) and (3) are obtained in addition to the effect (1) described in the first embodiment. I can do it.
(2) Hardware in the graphic processor can be reduced (part 2).

従来のライトバック手法は、ライトバックデータを一時的にバッファメモリに保持させ、その後、適当なタイミングでバッファメモリに保持させたライトバックデータをローカルメモリに書き込むことが通常であった。これは、ライトバック中にリフィル要求の発行が必要となった場合に、ライトバックが終了するまでリフィルが出来なくなるという状況が発生することを回避するために行われた手法である。この手法によれば、データをバッファに待避させておくことで、ライトバック中であってもそのエントリはリフィル要求を発行出来る。またライトバックは、キャッシュ管理部45外部からの何らかのトリガに応答してなされるか、またはキャッシュメモリにデータをストアすると同時に行われていた。   In the conventional write back method, the write back data is temporarily held in the buffer memory, and then the write back data held in the buffer memory is written in the local memory at an appropriate timing. This is a technique for avoiding a situation in which refilling is not possible until the write back is completed when a refill request needs to be issued during the write back. According to this method, by saving data in the buffer, the entry can issue a refill request even during write back. The write-back is performed in response to some trigger from the outside of the cache management unit 45 or is performed simultaneously with storing data in the cache memory.

これに対して本実施形態では、キャッシュ管理部45はステータスフラグとしてダーティーフラグDを保持し、いずれのキャッシュエントリがダーティーであるかを管理している。そして常にダーティーフラグDを監視し、いずれかのエントリがダーティーであり、且つライトバック要求発行可能限りは、そのタイミングでライトバックを行っている。従って、ダーティーなエントリの存在確率が従来に比べて圧倒的に低い。そのため、いずれかのエントリがライトバック中であっても、リフィル要求を発行可能なエントリが他に存在しやすい。よって、従来のようにデータをバッファに待避させる必要がなく、バッファが不要となる。従って、ハードウェアを削減でき、製造コストを低減できる。 On the other hand, in the present embodiment, the cache management unit 45 holds the dirty flag D as a status flag, and manages which cache entry is dirty. The dirty flag D is always monitored, and as long as one of the entries is dirty and a write back request can be issued, write back is performed at that timing. Therefore, the existence probability of dirty entries is overwhelmingly lower than before. Therefore, even if any entry is being written back, there are other entries that can issue a refill request. Therefore, it is not necessary to save data in the buffer as in the prior art, and the buffer is unnecessary. Therefore, hardware can be reduced and manufacturing cost can be reduced.

(3)キャッシュメモリを効率的に利用出来る(その1)。
上記(2)で説明したように、特に外部からの要求が無くてもライトバック要求が発行可能であれば、その時点でライトバックを行っている。従って、キャッシュメモリ41のエントリを有効に活用出来る。
(3) The cache memory can be used efficiently (part 1).
As described in (2) above, if a write-back request can be issued without any external request, write-back is performed at that time. Therefore, the entries in the cache memory 41 can be used effectively.

更に、ローカルメモリ13にeDRAM(embedded DRAM)を用い、且つそのレイテンシが長い場合には、本実施形態のように可能な時にライトバックを行うことで、ダーティーなエントリの存在を効果的に低減でき、グラフィックプロセッサの性能を向上出来る。   Further, when an eDRAM (embedded DRAM) is used for the local memory 13 and the latency is long, the presence of dirty entries can be effectively reduced by performing write back when possible as in the present embodiment. The performance of the graphic processor can be improved.

なお、キャッシュメモリ41のエントリサイズが大きい場合には、特に本実施形態の効果が顕著となる。なぜなら、エントリサイズが大きいほど、従来手法で必要なバッファサイズも大きくなるためであり、面積削減の効果が顕著となる。   Note that when the entry size of the cache memory 41 is large, the effect of the present embodiment is particularly remarkable. This is because the larger the entry size, the larger the buffer size required in the conventional method, and the effect of area reduction becomes remarkable.

また図35に示すように、キャッシュ管理部45はバス制御回路75からバスの状況をデータとして受け取っても良い。バス制御回路75は、各回路ブロック間のバスによる接続を制御する。ライトバックを行うためには、データ制御部27とローカルメモリとの間のバスが使用されていない必要がある。そこで、キャッシュ管理部45はバス制御回路75から現在のバスの使用状況を受け取り、バスが使用されていないことを認識した際に、ライトバック要求を発行する。これによりバスの使用効率を向上出来る。   As shown in FIG. 35, the cache management unit 45 may receive the bus status from the bus control circuit 75 as data. The bus control circuit 75 controls connection between each circuit block by a bus. In order to perform write back, the bus between the data control unit 27 and the local memory needs not to be used. Therefore, the cache management unit 45 receives the current bus use status from the bus control circuit 75, and issues a write-back request when recognizing that the bus is not used. As a result, the use efficiency of the bus can be improved.

次に、この発明の第3の実施形態に係るグラフィックプロセッサについて説明する。本実施形態は、上記第1、第2の実施形態で説明したグラフィックプロセッサにおけるプリロード動作に関するものである。   Next explained is a graphic processor according to the third embodiment of the invention. This embodiment relates to a preload operation in the graphic processor described in the first and second embodiments.

プリロード動作については、図10に示したプリロード制御部43が制御を行う。プリロード制御部43は、プリロードアドレス発生部47、プリロード保持部48、サブパス情報管理部49、及びアドレス保持部50を備えている。プリロード保持部48は、プリロード要求のあったスレッドの管理を行う。プリロード保持部48は、命令制御部25からスレッド単位でプリロード要求を受ける。このときプリロード保持部48は、スレッドのXY座標、スレッドID、及び実行するサブパス番号を同時に受け取って保持する。プリロード保持部48は内部に複数のエントリを有するメモリを備えており、プリロード要求をメモリのエントリに積んでいく。プリロード要求は、番号の若いエントリから優先的に発行される。そして、プリロード要求を発行するエントリを決定したら、サブパス情報管理部49に対して、プリロードスタート信号及びプリロードサブパス番号を出力する。プリロードスタート信号は新たなスレッドに関するプリロードの開始を示し、プリロードサブパス番号はプリロードされるサブパス番号である。   The preload control unit 43 shown in FIG. 10 controls the preload operation. The preload control unit 43 includes a preload address generation unit 47, a preload holding unit 48, a subpath information management unit 49, and an address holding unit 50. The preload holding unit 48 manages a thread for which a preload request has been made. The preload holding unit 48 receives a preload request from the instruction control unit 25 in units of threads. At this time, the preload holding unit 48 simultaneously receives and holds the XY coordinates of the thread, the thread ID, and the sub path number to be executed. The preload holding unit 48 includes a memory having a plurality of entries therein, and accumulates preload requests on the memory entries. The preload request is issued preferentially from the entry with the smallest number. When an entry for issuing a preload request is determined, a preload start signal and a preload subpath number are output to the subpath information management unit 49. The preload start signal indicates the start of preload for a new thread, and the preload subpath number is the subpath number to be preloaded.

次にサブパス情報管理部49について説明する。サブパス情報管理部49では、サブパスで使用されたバッファの情報を保持する制御と共に、プリロードのためのパラメータ出力の制御を行う。まずバッファの情報管理のために、サブパス情報管理部49は、図36に示すようなインストラクションテーブルを有している。インストラクションテーブルのエントリの各々は各サブパスに対応している。そしてサブパス情報管理部49は、ロード/ストア命令が発行される度に、当該命令に対応したモード情報をインストラクションテーブルに書き込む。これらの情報は、命令制御部25から、バッファバンクセレクト信号及びバッファモード信号として与えられる。これらの信号は、例えばローカルメモリがフレームバッファとして使用されているかメモリレジスタとして使用されているか、またデータ格納領域のベースアドレス(先頭アドレス)等の情報を含む。   Next, the sub path information management unit 49 will be described. The subpath information management unit 49 controls the output of parameters for preloading as well as the control for holding the buffer information used in the subpath. First, for buffer information management, the sub-path information management unit 49 has an instruction table as shown in FIG. Each entry in the instruction table corresponds to each subpath. Then, every time a load / store instruction is issued, the subpath information management unit 49 writes mode information corresponding to the instruction in the instruction table. These pieces of information are given from the instruction control unit 25 as a buffer bank select signal and a buffer mode signal. These signals include information such as whether the local memory is used as a frame buffer or a memory register, and the base address (start address) of the data storage area.

またサブパス情報管理部49は、プリロード命令が発行されると、プリロードスタート信号及びプリロードサブパス番号で指定されるサブパスに関する情報を、インストラクションテーブルから読み出す。そしてインストラクションテーブルから読み出したデータを、プリロードバンク信号としてプリロードアドレス発生部47へ出力する。またプリロードイネーブル信号をアサートする。   In addition, when a preload instruction is issued, the subpath information management unit 49 reads information on the subpath specified by the preload start signal and the preload subpath number from the instruction table. Then, the data read from the instruction table is output to the preload address generator 47 as a preload bank signal. Also, the preload enable signal is asserted.

次にプリロードアドレス発生部47について説明する。プリロードアドレス発生部47は、プリロードに必要なアドレス信号を生成する。アドレスの生成方法は、第1の実施形態で説明したアドレス発生部40と同様である(図13、図14参照)。上記のアドレス計算を行うための信号(プリロード用のXY座標、プリロード用のスレッドID、プリロードバンク信号)は、プリロード保持部48及びサブパス情報管理部49から常時与えられている。その状態で、プリロードイネーブル信号がアサートされると、それに応答してプリロードアドレス発生部47がアドレスの計算を開始する。得られたプリロードアドレスと、プリロードイネーブル信号はアドレス保持部50に出力される。   Next, the preload address generator 47 will be described. The preload address generation unit 47 generates an address signal necessary for preloading. The address generation method is the same as that of the address generation unit 40 described in the first embodiment (see FIGS. 13 and 14). Signals for performing the above address calculation (XY coordinates for preload, thread ID for preload, preload bank signal) are always given from the preload holding unit 48 and the subpath information management unit 49. In this state, when the preload enable signal is asserted, the preload address generation unit 47 starts calculating the address in response thereto. The obtained preload address and preload enable signal are output to the address holding unit 50.

次にアドレス保持部50について説明する。アドレス保持部50は、プリロード命令の発行がストールした場合に、当該命令に係るアドレスを保持しておくためのキューである。ローカルメモリ13のリクエストキューに空きが無い場合、キャッシュメモリ41にプリロード要求の発行可能なエントリが無い場合、及びリクエスト発行制御部46に発行待ちのリフィル要求がある場合には、プリロード命令はストールし、プリロードイネーブル信号デアサートする。これらの情報は、リクエスト発行制御部46からリフィルレディ信号及び要求状況信号として与えられる。   Next, the address holding unit 50 will be described. The address holding unit 50 is a queue for holding an address related to an instruction when the preload instruction issuance stalls. If there is no space in the request queue of the local memory 13, there is no entry that can issue a preload request in the cache memory 41, and there is a refill request waiting to be issued in the request issuance control unit 46, the preload instruction stalls. , Deassert the preload enable signal. These pieces of information are given from the request issuance control unit 46 as a refill ready signal and a request status signal.

またアドレス保持部50は、プリロード命令に関するヒット判定に必要なデータをキャッシュ管理部45に出力する。 The address holding unit 50 outputs data necessary for hit determination regarding the preload instruction to the cache management unit 45.

次に、本実施形態に係るグラフィックプロセッサのプリロード動作について図37及び図38を用いて説明する。図37はプリロード動作のフローチャートであり、図38は図37における各ステップと対応づけたデータ制御部27のブロック図である。まず命令制御部25からプリロード保持部48に対してプリロード要求が発行される(ステップS40)。この際、プリロード保持部48は、命令制御部25からプリロード要求信号の他にスレッド情報(XY座標、スレッドID、サブパスID)を受け取る(ステップS41)。   Next, the preload operation of the graphic processor according to the present embodiment will be described with reference to FIGS. FIG. 37 is a flowchart of the preload operation, and FIG. 38 is a block diagram of the data control unit 27 associated with each step in FIG. First, a preload request is issued from the instruction control unit 25 to the preload holding unit 48 (step S40). At this time, the preload holding unit 48 receives thread information (XY coordinates, thread ID, sub path ID) in addition to the preload request signal from the instruction control unit 25 (step S41).

そしてプリロード保持部48は、プリロードスタート信号とプリロードサブパス番号とをサブパス情報管理部49に出力する。サブパス情報管理部49は、受け取ったプリロードスタート信号とプリロードサブパス番号とに基づいて、インストラクションテーブルからロード/ストア命令に関する情報を読み出す(ステップS42)。読み出された情報(プリロードバンク信号)は、プリロードアドレス発生部47へ出力される。このロード/ストア命令に関する情報は、命令制御部25においてロード/ストア命令が発行された際に、サブパス情報管理部49のインストラクションテーブルに格納されたものである。更にサブパス情報管理部49は、プリロードイネーブル信号をアサートする。またプリロード保持部48は、スレッド情報(XY座標、スレッドID)をプリロードアドレス発生部47へ出力する。   Then, the preload holding unit 48 outputs the preload start signal and the preload subpath number to the subpath information management unit 49. Based on the received preload start signal and preload subpath number, the subpath information management unit 49 reads out information related to the load / store instruction from the instruction table (step S42). The read information (preload bank signal) is output to the preload address generator 47. The information related to the load / store instruction is stored in the instruction table of the subpath information management unit 49 when the instruction control unit 25 issues a load / store instruction. Further, the subpath information management unit 49 asserts a preload enable signal. Further, the preload holding unit 48 outputs thread information (XY coordinates, thread ID) to the preload address generating unit 47.

次にプリロードアドレス発生部47は、サブパス情報管理部49から与えられたロード/ストア命令に関する情報と、プリロード保持部48から与えられたスレッド情報とを用いてプリロードアドレスを計算する(ステップS43)。そしてプリロードアドレス発生部47は、計算により得られたプリロードアドレスをアドレス保持部50へ出力する。またプリロードアドレス発生部47は、プリロードイネーブル信号をアサートしてアドレス保持部へ出力する。   Next, the preload address generation unit 47 calculates the preload address using the information on the load / store instruction given from the subpath information management unit 49 and the thread information given from the preload holding unit 48 (step S43). Then, the preload address generation unit 47 outputs the preload address obtained by the calculation to the address holding unit 50. The preload address generation unit 47 asserts a preload enable signal and outputs it to the address holding unit.

更にこれらの情報はアドレス保持部50からキャッシュ管理部45へ出力される。そしてキャッシュ管理部45においてヒット判定が行われる(ステップS44)。ステップS44におけるヒット判定は、プリロードされるデータがキャッシュメモリ41内にすでに存在するか否かを判定する処理である。そして、第1の実施形態においてリフィル動作で説明したように、プリロードのヒット判定結果がミスだった場合に、キャッシュ管理部45はプリロード要求信号を発行する。またキャッシュ管理部45はリフィルID及びリフィルアドレスを発行し、プリロード要求信号と共にリクエスト発行制御部46へ出力する(ステップS45)。そしてキャッシュ管理部45はヒット判定を終了すると、ミス/ヒットにかかわらずプリロードヒット判定信号をアサートして、アドレス保持部50におけるプリロード情報をデアサートする。プリロードヒット判定信号は、キャッシュ管理部45におけるヒット判定が終了したか否かを示す信号である。   Further, these pieces of information are output from the address holding unit 50 to the cache management unit 45. Then, hit determination is performed in the cache management unit 45 (step S44). The hit determination in step S44 is a process for determining whether or not the preloaded data already exists in the cache memory 41. Then, as described in the refill operation in the first embodiment, when the preload hit determination result is a miss, the cache management unit 45 issues a preload request signal. Further, the cache management unit 45 issues a refill ID and a refill address, and outputs them together with a preload request signal to the request issuance control unit 46 (step S45). When the hit determination is completed, the cache management unit 45 asserts a preload hit determination signal regardless of a miss / hit, and deasserts the preload information in the address holding unit 50. The preload hit determination signal is a signal indicating whether or not the hit determination in the cache management unit 45 is completed.

そして、リクエスト発行制御部46が、ローカルメモリ25に対して正式にプリロード要求を発行する(リフィル要求信号を出力する、ステップS46)。その後は、リフィルと同様の要領によって、ローカルメモリ内のデータをキャッシュメモリ41へプリロードする。   Then, the request issuance control unit 46 officially issues a preload request to the local memory 25 (outputs a refill request signal, step S46). Thereafter, the data in the local memory is preloaded into the cache memory 41 in the same manner as the refill.

上記のように、この発明の第3の実施形態に係るグラフィックプロセッサによれば、第1、第2の実施形態で説明した(1)乃至(3)の効果に加えて、下記(4)の効果が得られる。
(4)キャッシュメモリを効率的に利用出来る(その2)。
本実施形態に係るグラフィックプロセッサでは、スレッド情報と、ロード/ストア命令に関する情報とを用いてプリロードアドレスを計算している。スレッド情報としては、X座標、Y座標、及びスレッドIDをプリロード保持部48から受け取る。またロード/ストア命令に関する情報として、コンフィギュレーションレジスタで参照すべきデータ、オフセット、及びベースアドレスをサブパス情報管理部49から受け取る。これらの情報を用いることによって、従来に比べてより正確にプリロードアドレスを算出出来る。より具体的には、ロード/ストア命令に関する情報から、WIDTHの値が分かる。WIDTHの値によって、同一XY座標であってもブロックIDは変化する。更にアドレス信号の先頭アドレスが分かる。またオフセットの値及びメモリの使用モード(フレームバッファモードかメモリレジスタモードか)が分かる。従って、第1の実施形態で説明したアドレス計算式に必要な全ての情報をプリロードアドレス発生部47は得られる。
プリロードとは、描画処理部27で必要になるであろうデータを、予めローカルメモリからキャッシュメモリ41に読み出しておく処理である。従って、プリロードはしたものの、実際にはそのデータは使われないこともありうる。
As described above, according to the graphic processor of the third embodiment of the present invention, in addition to the effects (1) to (3) described in the first and second embodiments, the following (4) An effect is obtained.
(4) The cache memory can be used efficiently (part 2).
In the graphic processor according to the present embodiment, the preload address is calculated using thread information and information related to the load / store instruction. As thread information, the X coordinate, the Y coordinate, and the thread ID are received from the preload holding unit 48. Further, as information related to the load / store instruction, data to be referred to in the configuration register, an offset, and a base address are received from the subpath information management unit 49. By using these pieces of information, the preload address can be calculated more accurately than in the prior art. More specifically, the value of WIDTH can be found from the information regarding the load / store instruction. Depending on the value of WIDTH, the block ID changes even with the same XY coordinates. Further, the head address of the address signal is known. In addition, the offset value and the memory use mode (frame buffer mode or memory register mode) can be known. Therefore, the preload address generation unit 47 can obtain all the information necessary for the address calculation formula described in the first embodiment.
The preload is a process of reading data that will be required by the drawing processing unit 27 from the local memory to the cache memory 41 in advance. Thus, although preloaded, the data may not actually be used.

しかし本実施形態では、ロード/ストア命令が発行された際に与えられた情報を用いてプリロードアドレスを計算、すなわちいずれのデータをプリロードするかを決定している。そのため、プリロードしたデータが使用される確率が高くなる。換言すれば、第1の実施形態で説明したヒット判定時に、プリロードデータがヒットする確率が向上する。これは、命令列は複数のスレッドの処理に用いられるので、実行する命令(サブパス)が分かれば、任意のスレッドが使用するデータが保持されているアドレスを求めることが可能となるからである。そこで、一度実行されたサブパスと同じサブパスを実行する異なるスレッドが起動された際に、以前トレースされた情報を元にプリフェッチを行う。よって、図39に示すように、本実施形態に係る方法によってプリロードアドレスを計算するためには、いずれかのスレッドでロード/ストア命令が発行される必要がある。図39では、スレッド0に関するサブパス0についてプリロードすることが出来ない。スレッド0に関するサブパス0でロード/ストア命令が発行されると、その時点でインストラクションテーブルが更新されるので、次のスレッド1についてプリロードが可能となる。   However, in the present embodiment, the preload address is calculated using the information given when the load / store instruction is issued, that is, which data is preloaded. Therefore, the probability that the preloaded data is used is increased. In other words, the probability that the preload data hits is improved at the time of hit determination described in the first embodiment. This is because an instruction sequence is used for processing of a plurality of threads, and if an instruction (subpath) to be executed is known, an address at which data used by an arbitrary thread can be obtained. Therefore, when a different thread that executes the same subpath as that executed once is started, prefetching is performed based on previously traced information. Therefore, as shown in FIG. 39, in order to calculate the preload address by the method according to this embodiment, it is necessary to issue a load / store instruction in any thread. In FIG. 39, it is not possible to preload sub-path 0 related to thread 0. When a load / store instruction is issued in subpath 0 related to thread 0, the instruction table is updated at that time, so that the next thread 1 can be preloaded.

従って、無駄なプリロード動作を削減し、同時にキャッシュメモリ41のエントリが無駄に占有されることを抑制出来る。よって、キャッシュメモリ41を効率的に使用でき、グラフィックプロセッサの性能を向上出来る。
次に、この発明の第4の実施形態に係るグラフィックプロセッサについて説明する。本実施形態は、上記第1乃至第3の実施形態で説明したグラフィックプロセッサにおいて、キャッシュ管理部45が更にエントリのリクエスト発行を制限するものである。
Therefore, useless preload operations can be reduced, and at the same time, it can be suppressed that entries in the cache memory 41 are used up. Therefore, the cache memory 41 can be used efficiently, and the performance of the graphic processor can be improved.
Next explained is a graphic processor according to the fourth embodiment of the invention. In the present embodiment, in the graphic processor described in the first to third embodiments, the cache management unit 45 further restricts entry request issuance.

図40はメモリ61の概念図であり、キャッシュ管理部45の備えるステータスフラグの様子を示している。図示するように、本実施形態に係るキャッシュ管理部45は、タグT、バリッドフラグV、リフィルフラグR、ライトバックフラグWの他に、ロックフラグ(lock flag)Lをステータスフラグとして保持する。ロックフラグLは2ビットのデータであり、L=“00”は対応するキャッシュメモリ41のエントリがフリーの状態を示す。この状態では、エントリはプリロード要求及びリフィル要求のいずれでも発行可能である。L=“01”は、エントリがプリロード要求を発行している状態を示す。この状態では、エントリはリフィル要求を発行することは可能であるが、プリロード要求は発行できない。L=“10”は、実行スレッドがエントリを使用している状態を示す。この状態では、エントリはリフィル要求もプリロード要求も発行することができない。   FIG. 40 is a conceptual diagram of the memory 61 and shows a status flag provided in the cache management unit 45. As shown in the drawing, the cache management unit 45 according to the present embodiment holds a lock flag L as a status flag in addition to the tag T, the valid flag V, the refill flag R, and the write back flag W. The lock flag L is 2-bit data, and L = “00” indicates that the corresponding cache memory 41 entry is free. In this state, the entry can be issued by either a preload request or a refill request. L = “01” indicates a state in which the entry issues a preload request. In this state, the entry can issue a refill request, but cannot issue a preload request. L = “10” indicates a state in which the execution thread uses the entry. In this state, the entry cannot issue a refill request or a preload request.

従って、キャッシュ管理部45はリフィル要求及びプリロード要求がなされた際に、図41に示すようにステータスフラグのロックフラグLをチェックする(ステップS50)。そしてL=“00”の場合(ステップS51)にはいずれかの要求を発行する(ステップS52)。L=“01”の場合(ステップS53)には、リフィル要求は発行できるが、プリロード要求はストールする(ステップS54)。L=“10”の場合(ステップS55)にはいずれの要求もストールする(ステップS56)。   Accordingly, when the refill request and the preload request are made, the cache management unit 45 checks the lock flag L of the status flag as shown in FIG. 41 (step S50). If L = “00” (step S51), one of the requests is issued (step S52). When L = “01” (step S53), the refill request can be issued, but the preload request is stalled (step S54). If L = “10” (step S55), all requests are stalled (step S56).

以上のように、ロックフラグL、リフィルフラグR、及びライトバックフラグWBによってキャッシュエントリは次の8つの状態を取りうる。
1.初期状態(Init:L=“00”、R=“0”、WB=“0”)
エントリがフリーの状態であり、プリロード要求もリフィル要求も受け付けることが可能な状態である。
2.レディ状態(Rdy:L=“01”、R=“0”、WB=“0”)
プリロードが完了し、そのエントリを使用するスレッドが実行されるのを待っている状態である。
3.実行状態(Exec:L=“10”、R=“0”、WB=“0”)
実行中のスレッドが該エントリを使用している状態である。
4.非使用状態(NoWake:L=“00”、R=“1”、WB=“0”)
プリロード中に対応するスレッドが実行されたが、該エントリに対するアクセスが無くサブパスが終了した際に生じる状態である。
5.プリロード状態(PreLd:L=“01”、R=“1”、WB=“0”)
プリロード要求を発行している状態である。
6.フィル状態(Fill:L=“10”、R=“1”、WB=“0”)
キャッシュミスによるリフィル要求が発行されている状態、もしくはプリロード要求発行中にそのエントリを使用するスレッドが実行された状態。
7.ライトバック状態(WrB:L=“00”or“01”、R=“0”、WB=“1”) ライトバック要求を発行している状態である。
As described above, the cache entry can take the following eight states by the lock flag L, the refill flag R, and the write back flag WB.
1. Initial state (Init: L = “00”, R = “0”, WB = “0”)
The entry is in a free state, and a preload request and a refill request can be accepted.
2. Ready state (Rdy: L = “01”, R = “0”, WB = “0”)
This is a state in which preloading is completed and a thread using the entry is waiting to be executed.
3. Execution state (Exec: L = “10”, R = “0”, WB = “0”)
The thread being executed is using the entry.
4). Non-use state (NoWake: L = “00”, R = “1”, WB = “0”)
This is a state that occurs when the corresponding thread is executed during preloading, but there is no access to the entry and the subpath is terminated.
5. Preload state (PreLd: L = “01”, R = “1”, WB = “0”)
A preload request is issued.
6). Fill state (Fill: L = “10”, R = “1”, WB = “0”)
A refill request is issued due to a cache miss, or a thread that uses the entry is executed while a preload request is issued.
7). Write-back state (WrB: L = “00” or “01”, R = “0”, WB = “1”) This is a state in which a write-back request is issued.

8.使用状態(WrBExec:L=“10”、R=“0”、WB=“1”)
ライトバック状態においてアクセスが生じたり、使用スレッドが実行されると使用状態に遷移する。使用状態は、ライトバック要求の発行中に実行スレッドが切り替わり、当該エントリが実行スレッドにより使用される状態である。
8). Usage state (WrBExec: L = “10”, R = “0”, WB = “1”)
When access occurs in the write-back state or when the use thread is executed, the state changes to the use state. The use state is a state in which the execution thread is switched while the write back request is issued, and the entry is used by the execution thread.

次に図42を用いて各状態間の遷移条件について説明する。図42において縦が遷移前の状態であり、横が遷移後の状態である。そして表中の数字は下記に記す状態変更イベントを示す。   Next, transition conditions between the states will be described with reference to FIG. In FIG. 42, the vertical is the state before the transition, and the horizontal is the state after the transition. The numbers in the table indicate the status change events described below.

1.プリロードがエントリにヒットした時
2.ロード/ストア命令がヒットした時
3.プリロードがミスヒットし、プリロード要求が発行された時
4.ロード/ストア命令がミスヒットし、リフィル要求が発行された時
5、10.ライトバックの実行を開始した時
6.ライトバックの実行開始と共にサブパスの実行が開始された時
7.実行スレッドのプリロードが行われたが、ロード/ストアアクセスされることなくサブパスが終了した時
8.プリロードされていたエントリを使用するスレッドが実行開始、またはロード/ストア命令がヒットした時
9.プリロードされていたエントリに対して、ロード/ストア命令ミスヒットによるリフィルを行った時
11.ライトバックの実行開始と共にサブパスの実行が開始、もしくはロード/ストア命令がヒットした時
12.エンド命令またはイールド命令が実行され、他のスレッドのプリロード要求が無い時
13.エンド命令またはイールド命令が実行され、他のスレッドのプリロード要求がある時
14.サブパススタートの次のタイミングでエンド命令またはイールド命令とライトバックとが実行される時に生じる
15.サブパスがスタートした直後にライトバックが開始された時
16、22.プリロードが完了した時
17.プリロードの完了と他のプリロードのヒットとが同時に生じた時
18.プリロードの完了と、ロード/ストア命令のヒットとが同時に生じた時
19.プリロード命令がヒットした時(但しプリロード要求発行中)
20.ロード/ストア命令がヒットした時(但しプリロード要求発行中)
21.実行スレッドのプリロードが行われたが、ロード/ストアアクセスされることなくサブパスが終了し、同時にプリロードも終了した時
23.プリロードの完了と共に、同時にサブパススタートが同時に生じた時
24.実行スレッドのプリロードが行われたが、ロード/ストアアクセスされることなくサブパスが終了し、同時にプリロード要求が未だに発行中である時
25.プリロード中のエントリを使用するスレッドの実行が開始された時、またはロード/ストア命令がヒットした時
26.プリロード状態からフィル状態へと状態遷移したが、ロード/ストアアクセスがなされることなくサブパスが終了すると同時にプリロードを完了した場合であり、他のスレッドのプリロード要求が無い時
27.プリロード状態からフィル状態へと状態遷移したが、ロード/ストアアクセスがなされることなくサブパスが終了すると同時にプリロードを完了した場合であり、他のスレッドのプリロード要求がある時
28.リフィルが完了した時
29.プリロード状態からフィル状態へと状態遷移したが、ロード/ストアアクセスの無いままサブパスが終了する時で、且つプリロードがまだ完了しておらず他のスレッドのプリロード要求が無い時
30.プリロードからフィルに状態遷移したが、ロード/ストアアクセスの無いままサブパスが終了する時で、且つプリロードがまだ完了しておらず他のスレッドおプリロード要求がある時
31.L=“00”でライトバックが完了した時
32.L=“01”でライトバックが完了した時
33.ライトバック終了と同時にロード/ストア命令がヒットした時
34.ライトバック中のエントリを使用するスレッドが実行された時
35.ライトバックの完了とエンド命令またはイールド命令とが同時に生じた時であり、他のスレッドのプリロード要求が無い時
36.ライトバックの完了とエンド命令またはイールド命令とが同時に生じた時であり、他のスレッドのプリロード要求がある時
37.L=“10”でライトバックが完了した時
38.エンド命令またはイールド命令によってサブパスが終了した時
以上の条件によって、キャッシュエントリは状態遷移する。
1. When preload hits entry
2. When a load / store instruction hits
3. When a preload misses and a preload request is issued
4). When a load / store instruction misses and a refill request is issued
5,10. When execution of write back is started
6). When sub-pass execution starts when write-back execution starts
7). When the execution thread is preloaded, but the subpath ends without being loaded / stored
8). When a thread that uses a preloaded entry starts execution or a load / store instruction hits
9. When refilling a preloaded entry due to a load / store instruction miss hit
11. When sub-pass execution starts or the load / store instruction hits at the same time as write-back execution starts
12 When an end instruction or yield instruction is executed and there is no preload request from another thread
13. When an end instruction or yield instruction is executed and there is a preload request from another thread
14 Occurs when an end instruction or yield instruction and writeback are executed at the next timing of sub-pass start
15. When write-back starts immediately after the sub-pass starts
16, 22. When preload is complete
17. When a preload completes and another preload hit occurs at the same time
18. When preload completion and load / store instruction hit occur simultaneously
19. When a preload instruction is hit (however, a preload request is being issued)
20. When a load / store instruction hits (however, a preload request is being issued)
21. When an execution thread is preloaded, but the subpath ends without being accessed for load / store, and at the same time the preload ends
23. When sub-pass start occurs simultaneously with completion of preload
24. When an execution thread is preloaded, but the subpath ends without being accessed for load / store and at the same time a preload request is still being issued
25. When execution of a thread that uses the preloading entry is started, or when a load / store instruction is hit
26. When the state transitions from the preload state to the fill state, but preloading is completed at the same time as the subpath ends without load / store access, and there is no preload request from another thread
27. When the state transitions from the preload state to the fill state, but preloading is completed at the same time as the subpath ends without load / store access, and there is a preload request from another thread
28. When refill is complete
29. When the state transitions from the preload state to the fill state, but when the subpath ends without load / store access, and when the preload has not yet been completed and there is no preload request from another thread
30. When the state transition from preload to fill occurs, but the subpath ends without load / store access, and when preload has not yet completed and there is another thread preload request
31. When L = "00" and write back is completed
32. When L = “01” and write back is completed
33. When a load / store instruction hits simultaneously with the end of write-back
34. When a thread that uses the entry being written back is executed
35. When write-back completion and end instruction or yield instruction occur at the same time, and there is no preload request from other threads
36. When write-back completion and end or yield instruction occur at the same time, and there is a preload request from another thread
37. When L = “10” and write back is completed
38. When a subpass is terminated by an end instruction or a yield instruction
Under the above conditions, the cache entry changes state.

上記のように、この発明の第4の実施形態に係るグラフィックプロセッサによれば、上記第1乃至第3の実施形態で説明した(1)乃至(4)の効果に加えて、下記(5)の効果が得られる。
(5)キャッシュメモリを効率的に利用出来る(その3)。
本実施形態に係るグラフィックプロセッサでは、ステータスフラグに複数のレベルを有するロックフラグLを設けている。そして、ロックフラグLによってキャッシュメモリ41のエントリの要求発行を制限している。より具体的には、ロックフラグLは3つのレベル(“00”、“01”、“10”)を含む。そしてL=“00”はエントリがロックされていない状態であり、キャッシュメモリ41のエントリは自由にプリロード要求やリフィル要求を発行出来る。L=“01”は弱いロック状態であり、キャッシュメモリ41のエントリはプリロード要求の発行を禁止される。L=“10”は強いロック状態であり、キャッシュメモリ41のエントリはプリロード要求だけでなくリフィル要求の発行も禁止される。
As described above, according to the graphic processor of the fourth embodiment of the present invention, in addition to the effects (1) to (4) described in the first to third embodiments, the following (5) The effect is obtained.
(5) The cache memory can be used efficiently (part 3).
In the graphic processor according to the present embodiment, the status flag is provided with a lock flag L having a plurality of levels. The lock flag L restricts the issue of entries in the cache memory 41. More specifically, the lock flag L includes three levels (“00”, “01”, “10”). L = “00” indicates that the entry is not locked, and the entry in the cache memory 41 can freely issue a preload request or a refill request. L = “01” is a weak lock state, and the entry of the cache memory 41 is prohibited from issuing a preload request. L = “10” is a strong lock state, and entry of the cache memory 41 is prohibited not only from a preload request but also from a refill request.

プリロードされたデータは、前述の通り実際の処理に先立ってキャッシュメモリ41に読み出されたデータである。これに対してリフィルされたデータは、ロード/ストア命令によって必要とされたデータである。従って、リフィルによってキャッシュメモリ41にリプレイスされたデータの方が、プリロードによって読み出されたデータよりも重要性が高く、保護すべき必要性も高い。   The preloaded data is data read into the cache memory 41 prior to actual processing as described above. In contrast, the refilled data is the data required by the load / store instruction. Therefore, the data replaced in the cache memory 41 by refilling is more important than the data read by preloading and needs to be protected.

そこで本実施形態ではステータスレジスタにロックフラグLを設け、リフィルが行われたエントリを強いロック状態として、プリロードや更なるリフィルによってデータが書き換えられることを防止している。そのため、必要なデータがキャッシュメモリ41から消失されることを防止出来、キャッシュメモリ41を効率的に使用出来る。   Therefore, in this embodiment, a lock flag L is provided in the status register so that the refilled entry is placed in a strong lock state to prevent data from being rewritten by preloading or further refilling. Therefore, necessary data can be prevented from being lost from the cache memory 41, and the cache memory 41 can be used efficiently.

またプリロードによって読み出されたデータに関しても、それ対応したサブパスが終了する等しない限りは、エントリを弱いロック状態とすることで、プリロードデータが書き換えられないようにしている。従って、プリロードデータを効率的に使用出来る。以上の結果、キャッシュメモリ41を効率良く使用でき、グラフィックプロセッサの性能を向上出来る。   Also, with respect to data read by preloading, the preload data is prevented from being rewritten by setting the entry in a weak lock state unless the corresponding subpath is terminated. Therefore, the preload data can be used efficiently. As a result, the cache memory 41 can be used efficiently and the performance of the graphic processor can be improved.

次に、この発明の第5の実施形態に係るグラフィックプロセッサについて説明する。本実施形態は、上記第1乃至第4の実施形態で説明したグラフィックプロセッサにおいて、キャッシュ管理部45が更にエントリ内のデータ情報を保持するものである。   Next explained is a graphic processor according to the fifth embodiment of the invention. In the present embodiment, in the graphic processor described in the first to fourth embodiments, the cache management unit 45 further holds data information in the entry.

図43はメモリ61の概念図であり、キャッシュ管理部45の備えるステータスフラグの様子を示している。図示するように、本実施形態に係るキャッシュ管理部45は、タグフラグT、バリッドフラグV、リフィルフラグR、ライトバックフラグW、ロックフラグLの他に、スレッドエントリフラグ(thread entry flag)TEをステータスフラグとして保持する。スレッドエントリフラグTEは、キャッシュメモリの対応するエントリが、どのスレッドに関するデータを保持するのかを示すフラグである。スレッドエントリフラグTEのビット数は、同時発行可能なスレッド数に等しい。   FIG. 43 is a conceptual diagram of the memory 61, and shows the status flags provided in the cache management unit 45. As shown in the figure, in addition to the tag flag T, valid flag V, refill flag R, write back flag W, lock flag L, the cache management unit 45 according to the present embodiment displays a thread entry flag TE. Hold as a flag. The thread entry flag TE is a flag indicating which thread the corresponding entry of the cache memory holds. The number of bits of the thread entry flag TE is equal to the number of threads that can be issued simultaneously.

スレッドエントリフラグTEとキャッシュメモリ41との関係について、図44を用いて説明する。図44はスレッドエントリフラグTEとキャッシュメモリの概念図である。   The relationship between the thread entry flag TE and the cache memory 41 will be described with reference to FIG. FIG. 44 is a conceptual diagram of the thread entry flag TE and the cache memory.

図示するようにスレッドエントリフラグTEは例えばNビットである。従って、最大でN個のスレッドが同時に生成される。そして上位ビットから各々、スレッド0〜スレッド(N−1)に対応する。例えばキャッシュメモリ41のエントリ(M−1)にはスレッド1、2、4、6のデータが保持されている。従って、キャッシュメモリ41のエントリ1に対応するスレッドエントリフラグTEのビット1、2、4、6が“1”である。またキャッシュメモリ41のエントリ4にはデータが保持されていない。従って、キャッシュメモリ41のエントリ4に対応するスレッドエントリフラグTEは、全ビットが“0”である。   As shown in the figure, the thread entry flag TE is, for example, N bits. Therefore, a maximum of N threads are generated simultaneously. And from the upper bits, it corresponds to thread 0 to thread (N-1), respectively. For example, the entry (M-1) of the cache memory 41 holds the data of threads 1, 2, 4, and 6. Therefore, bits 1, 2, 4, and 6 of the thread entry flag TE corresponding to entry 1 of the cache memory 41 are “1”. Data is not held in entry 4 of the cache memory 41. Accordingly, all bits of the thread entry flag TE corresponding to the entry 4 of the cache memory 41 are “0”.

次に、スレッドエントリフラグTEの書き込みタイミングとその際のエントリの状態について図45を用いて説明する。まずスレッドエントリフラグTEは、対応したエントリに関するプリロード命令、リフィル命令、またはロード/ストア命令が発行された際(ステップS50)に、該命令が実行されるスレッドに対応したビットが“1”とされる(ステップS51)。スレッドエントリフラグTEが“1”とされると、対応するエントリはデータのリプレイスもフラッシュ(flush:消去)も禁止される(ステップS52)。スレッドエントリフラグTEは、対応するスレッドがエンド命令またはイールド命令を実行した際に(ステップS53)、“0”にされる(ステップS54)。そして、スレッドエントリフラグTEの全ビットが“0”である場合(ステップS55)には、対応するエントリについてリプレイスとフラッシュが許可される。他方、スレッドエントリフラグTEが1ビットでも“1”であれば(ステップS55)、リプレイスとフラッシュは禁止される。   Next, the write timing of the thread entry flag TE and the entry state at that time will be described with reference to FIG. First, in the thread entry flag TE, when a preload instruction, refill instruction, or load / store instruction relating to the corresponding entry is issued (step S50), the bit corresponding to the thread in which the instruction is executed is set to “1”. (Step S51). When the thread entry flag TE is set to “1”, the corresponding entry is prohibited from being replaced or flushed (step S52). The thread entry flag TE is set to “0” (step S54) when the corresponding thread executes an end instruction or a yield instruction (step S53). When all the bits of the thread entry flag TE are “0” (step S55), replacement and flushing are permitted for the corresponding entry. On the other hand, if the thread entry flag TE is “1” even if it is 1 bit (step S55), the replace and flush are prohibited.

上記のように、この発明の第5の実施形態に係るグラフィックプロセッサによれば、上記第1乃至第4の実施形態で説明した(1)乃至(5)の効果に加えて、下記(6)の効果が得られる。
(6)キャッシュメモリを効率的に利用出来る(その4)。
本実施形態に係るグラフィックプロセッサであると、スレッドエントリフラグTEによってエントリのプリロード要求やリフィル要求を制限している。そのため、キャッシュエントリを効率的に使用出来、グラフィックプロセッサの性能を向上出来る。以下、本効果について詳細に説明する。
As described above, according to the graphic processor of the fifth embodiment of the present invention, in addition to the effects (1) to (5) described in the first to fourth embodiments, the following (6) The effect is obtained.
(6) The cache memory can be used efficiently (part 4).
In the graphic processor according to the present embodiment, entry preload requests and refill requests are limited by the thread entry flag TE. Therefore, the cache entry can be used efficiently and the performance of the graphic processor can be improved. Hereinafter, this effect will be described in detail.

キャッシュメモリ41とローカルメモリ13とは、勿論バスのサイズにもよるが、基本的にはキャッシュメモリ41のエントリサイズ単位でデータの授受を行う。データの消去も同じである。従って、キャッシュメモリ41にSRAMを用いること等によってキャッシュメモリ41のエントリサイズが大きい場合、キャッシュメモリ41の1つのエントリには複数のスレッドに関するデータが読み出される。   The cache memory 41 and the local memory 13 basically exchange data in units of the entry size of the cache memory 41, although it depends on the bus size. The same is true for erasing data. Therefore, when the entry size of the cache memory 41 is large by using an SRAM for the cache memory 41 or the like, data relating to a plurality of threads is read into one entry of the cache memory 41.

すると、あるエントリ内のスレッドについてサブパスが実行完了したとしても、同じエントリにある他のスレッドはその後に使用される可能性がある。すなわち、サブパスが完了することで、あるスレッドに関するデータは不要になったとしても、同一エントリにある別のスレッドに関するデータは、後に必要になるかもしれない。従って、あるスレッドが終了したからといってその他のスレッドに関するデータまで消してしまうのは非効率的である。   Then, even if the execution of the sub-pass is completed for a thread in an entry, another thread in the same entry may be used later. That is, even if data related to a certain thread is no longer necessary when the sub-pass is completed, data related to another thread in the same entry may be required later. Therefore, it is inefficient to erase data related to other threads just after a certain thread is terminated.

そこで本実施形態ではスレッドエントリフラグTEを用いることによって、サブパスが実行完了していないスレッドが保持されるエントリについては、データのリプレイス及びライトバック(またはフラッシュ)を禁じている。これにより、データがむやみに消去されることを防止できるので、キャッシュメモリ41のエントリを効率的に使用でき、グラフィックプロセッサの性能を向上出来る。   Therefore, in the present embodiment, by using the thread entry flag TE, data replacement and write back (or flush) are prohibited for an entry in which a thread whose sub-pass has not been executed is held. As a result, the data can be prevented from being erased unnecessarily, so that the entry of the cache memory 41 can be used efficiently, and the performance of the graphic processor can be improved.

なお、スレッドエントリフラグTEがアサートされるタイミングは、エントリに実際にデータがリプレイスされた後でなくても良く、リプレイス前であっても良い。すなわち、ロード/ストア命令がミスしてリフィル要求が発行された後で且つリプレイス前の段階や、プリロード要求が発行された後で且つデータ転送前であっても良い。この場合は、他のスレッドによってエントリが書き潰されないように、使用するエントリをスレッドエントリフラグTEにより予約することになる。   Note that the timing at which the thread entry flag TE is asserted may not be after the data is actually replaced in the entry, but may be before the replacement. That is, it may be after the load / store instruction is missed and the refill request is issued and before the replacement, or after the preload request is issued and before the data transfer. In this case, the entry to be used is reserved by the thread entry flag TE so that the entry is not overwritten by another thread.

次に、この発明の第6の実施形態に係るグラフィックプロセッサについて説明する。本実施形態は、ステージがストールした場合のデータの管理手法に係るものである。図46は、本実施形態に係るデータ管理手法の概念を示すための回路図である。   Next explained is a graphic processor according to the sixth embodiment of the invention. This embodiment relates to a data management method when a stage is stalled. FIG. 46 is a circuit diagram for illustrating the concept of the data management method according to the present embodiment.

図示するように、ある命令がステージA〜Fにおいて順番に実行され、且つステージA〜Fはパイプライン動作を行うとする。各ステージはF/Fを備えており、各ステージに達した命令はF/Fで保持される。更に、ステージDにはバッファメモリD1、D2が設けられている。ストール発生時、バッファメモリD1、D2はステージCのデータを保持し、ステージDはステージEのデータを保持する。そしてストール解消してリスタートする際には、バッファメモリD1、D2のデータがステージDに出力される。   As shown in the figure, it is assumed that a certain instruction is executed in order in stages A to F, and stages A to F perform a pipeline operation. Each stage has an F / F, and an instruction that reaches each stage is held in the F / F. Further, the stage D is provided with buffer memories D1 and D2. When a stall occurs, the buffer memories D1 and D2 hold stage C data, and the stage D holds stage E data. When the stall is resolved and restarted, the data in the buffer memories D1 and D2 are output to the stage D.

次に上記ステージの動作について説明する。まずストールが発生していない通常時の動作について図47を用いて説明する。図47は各ステージで実行される命令の時間変化を示す表である。実行される命令は命令0〜命令7まであるものと仮定する。   Next, the operation of the above stage will be described. First, the normal operation in which no stall has occurred will be described with reference to FIG. FIG. 47 is a table showing temporal changes in instructions executed in each stage. Assume that there are instructions 0 to 7 executed.

図示するように、時刻t0において命令0〜5がそれぞれステージF〜Aで実行されているとする。すると、次のサイクル(時刻t1)では、各命令1〜5は次のステージF〜Bで実行される。また新たな命令6がステージAに投入されて実行される。命令0は、時刻t0において最後のステージFで実行が完了したため、処理を終了する。このようにして、各命令0〜7はステージA〜Fの順にパイプライン処理される。   As illustrated, it is assumed that instructions 0 to 5 are executed in stages F to A at time t0. Then, in the next cycle (time t1), the instructions 1 to 5 are executed in the next stages F to B. A new instruction 6 is input to the stage A and executed. Since execution of the instruction 0 is completed at the last stage F at the time t0, the processing ends. In this way, the instructions 0 to 7 are pipelined in the order of stages A to F.

次にストールが発生した場合について図48を用いて説明する。図48も各ステージで実行される命令の時間変化を示す表であり、ここでは一例として命令3がステージEにおいてストールした場合について説明する。   Next, a case where a stall occurs will be described with reference to FIG. FIG. 48 is also a table showing temporal changes of instructions executed in each stage. Here, a case where the instruction 3 stalls in the stage E will be described as an example.

図示するように、時刻t0において命令0〜5がそれぞれステージF〜Aで実行され、時刻t1において命令1〜6がそれぞれステージF〜Aで実行され、時刻t2において命令2〜7がそれぞれステージF〜Aで実行されたとする。そして時刻t3で命令3がステージEでストールしたとする。すると、時刻t3では、本来は命令3〜7がステージF〜Bで実行されるはずである。しかしストールが発生したので、時刻t2でステージCに保持されていた命令5はバッファメモリD1に送られ、時刻t2でステージEに保持されていた命令3はステージDにフィードバックされる。   As illustrated, instructions 0 to 5 are executed in stages F to A at time t0, instructions 1 to 6 are executed in stages F to A at time t1, and instructions 2 to 7 are executed in stages F at time t2. Suppose that it is executed at ~ A. Assume that instruction 3 stalls at stage E at time t3. Then, at time t3, instructions 3 to 7 are supposed to be executed in stages F to B. However, since a stall has occurred, the instruction 5 held in the stage C at the time t2 is sent to the buffer memory D1, and the instruction 3 held in the stage E at the time t2 is fed back to the stage D.

次のサイクル(時刻t4)でも依然としてストールしていると、時刻t3でバッファメモリD1に保持されていた命令5はバッファメモリD2に送られ、時刻t3でステージCに保持されていた命令6はバッファメモリD1に送られ、時刻t3でステージEに保持されていた命令4はステージDにフィードバックされる。以降、ストールが継続する時刻t6までの期間、命令5はバッファメモリD2に保持され続け、命令6はバッファメモリD1に保持され続ける。そして命令3及び命令4は、ステージDとステージEとの間をループする。   If it is still stalled in the next cycle (time t4), the instruction 5 held in the buffer memory D1 at the time t3 is sent to the buffer memory D2, and the instruction 6 held in the stage C at the time t3 is buffered. The instruction 4 sent to the memory D1 and held in the stage E at time t3 is fed back to the stage D. Thereafter, during the period up to time t6 when the stall continues, the instruction 5 is kept in the buffer memory D2, and the instruction 6 is kept in the buffer memory D1. Instruction 3 and instruction 4 loop between stage D and stage E.

そして時刻t7でストールが解消すると、時刻t6でそれぞれステージE、D、バッファメモリD2、ステージCに保持されていた命令3〜5、7は、それぞれステージF、E、D、Cで実行される。時刻t6でバッファメモリD1に保持されていた命令6は、時刻t7でバッファメモリD2に送られ、更に時刻t8において、ステージDで実行される。   When the stall is resolved at time t7, the instructions 3 to 5 and 7 held in the stages E and D, the buffer memory D2 and the stage C at the time t6 are executed in the stages F, E, D and C, respectively. . The instruction 6 held in the buffer memory D1 at time t6 is sent to the buffer memory D2 at time t7, and is further executed at stage D at time t8.

上記のデータ管理手法を、第1乃至第5の実施形態で説明したグラフィックプロセッサに適用した場合について図49を用いて説明する。図49はキャッシュ管理部45の一部領域の回路図である。図22を用いて説明したように、ロード命令が発行された際、キャッシュ管理部45にはアドレス発生部40からキャッシュデータアドレス信号が与えられる。また図38を用いて説明したように、プリロード時にはプリロードプリロードアドレスが与えられる。   A case where the above data management technique is applied to the graphic processor described in the first to fifth embodiments will be described with reference to FIG. FIG. 49 is a circuit diagram of a partial area of the cache management unit 45. As described with reference to FIG. 22, when a load instruction is issued, a cache data address signal is given to the cache management unit 45 from the address generation unit 40. As described with reference to FIG. 38, a preload preload address is given at the time of preload.

キャッシュ管理部45は図11で説明したように第2ステージにおいて動作する。そして第2ステージの内部において、少なくとも4つの動作ステージ(2−1)〜(2−4)を含む。すなわちアドレス管理部45は、ステージ(2−1)においてロード/ストア及びプリロードのヒット判定を行う。ステージ(2−2)では、リフィル及びプリロードのエントリを、LRFキューを用いて選択する。ステージ(2−3)では、キャッシュミスや、ヒットしたエントリがリフィル中である等の場合にストール信号をアサートする。そしてステージ(2−4)でキャッシュ制御部へ信号を転送する。   The cache management unit 45 operates in the second stage as described with reference to FIG. The second stage includes at least four operation stages (2-1) to (2-4). That is, the address management unit 45 performs load / store and preload hit determination in the stage (2-1). In stage (2-2), refill and preload entries are selected using the LRF queue. In the stage (2-3), a stall signal is asserted when a cache miss or a hit entry is being refilled. Then, in stage (2-4), the signal is transferred to the cache control unit.

図49においてステージ(2−2)からステージ(2−1)へのループパスは、ステージ(2−2)またはステージ(2−1)でストールが発生した際に用いられる。この状態においては、描画処理部26によってストール信号がアサートされる。   In FIG. 49, the loop path from the stage (2-2) to the stage (2-1) is used when a stall occurs in the stage (2-2) or the stage (2-1). In this state, the stall signal is asserted by the drawing processing unit 26.

ステージ(2−4)からステージ(2−3)へのループパスは、ステージ(2−4)またはステージ(2−3)でストールが発生していた状態において、ステージ(2−2)またはステージ(2−1)でストールが発生した際に用いられる。従ってこの場合、ステージ(2−2)からステージ(2−1)との間のループパスと、ステージ(2−4)からステージ(2−3)ステージへのループパスとが有効となる。   The loop path from the stage (2-4) to the stage (2-3) is the stage (2-2) or stage (2-3) in the state where the stall has occurred in the stage (2-4) or the stage (2-3). Used when a stall occurs in 2-1. Therefore, in this case, the loop path from the stage (2-2) to the stage (2-1) and the loop path from the stage (2-4) to the stage (2-3) stage are effective.

ステージ(2−4)からステージ(2−1)へのループパスは、ステージ(2−4)またはステージ(2−3)でストールが発生した場合に用いられる。この場合にはストール信号がアサートされているので、この信号によってステージ(2−4)からステージ(2−1)へのループパスが有効とされる。また、ステージ(2−2)とステージ(2−1)との間のループパスと、ステージ(2−4)からステージ(2−3)へのループパスが有効になっていれば、ストール信号がデアサートされたタイミングにおいても、このループパスが有効とされる。   The loop path from the stage (2-4) to the stage (2-1) is used when a stall occurs in the stage (2-4) or the stage (2-3). In this case, since the stall signal is asserted, the loop path from the stage (2-4) to the stage (2-1) is validated by this signal. If the loop path between the stage (2-2) and the stage (2-1) and the loop path from the stage (2-4) to the stage (2-3) are valid, the stall signal is deasserted. This loop path is also valid at the determined timing.

バッファメモリ80は、例えば5つのエントリを有している。そして、ストール信号がアサートされて以降に入力されるアドレスを保持する。これは、ストール信号が第3ステージ(図11参照)まで伝搬された後に、アドレス発生部40がアドレスの投入を停止するからである。従って、ストールが発生している期間に入力されるアドレスを有効に保持するために、バッファメモリ80が使用される。   The buffer memory 80 has, for example, five entries. Then, the address input after the stall signal is asserted is held. This is because the address generation unit 40 stops the input of the address after the stall signal has been propagated to the third stage (see FIG. 11). Accordingly, the buffer memory 80 is used to effectively hold the address input during the period in which the stall occurs.

以上のように、この発明の第6の実施形態に係るグラフィックプロセッサであると、上記第1乃至第5の実施形態で説明した(1)乃至(6)の効果に加えて、下記(7)の効果が得られる。
(7)ストール後におけるグラフィックプロセッサの処理効率を向上出来る。
本実施形態に係るグラフィックプロセッサは、実行すべき命令がストールした際に、命令を緊急避難的に保持するバッファメモリを有している。従って、ストール解消後は、バッファメモリ内のデータを用いて処理を開始出来るため、グラフィックプロセッサの処理効率を向上出来る。この点につき以下説明する。
As described above, the graphic processor according to the sixth embodiment of the present invention has the following (7) in addition to the effects (1) to (6) described in the first to fifth embodiments. The effect is obtained.
(7) The processing efficiency of the graphic processor after the stall can be improved.
The graphic processor according to the present embodiment includes a buffer memory that holds an instruction in an emergency manner when an instruction to be executed stalls. Therefore, since processing can be started using data in the buffer memory after the stall is eliminated, the processing efficiency of the graphic processor can be improved. This point will be described below.

図50は、バッファメモリを設けない場合に図47と同様に命令を実行する際の、命令とステージとの関係を示す表である。そして、図48と同様に命令3がステージEでストールした場合を考える。ストールが発生した場合、その瞬間にパイプラインを停止することは困難である。すると図50の場合、時刻t3では時刻t3の状態を保持する必要があるにもかかわらず、ステージA〜Dの命令7〜命令4がステージB〜ステージEにオーバーランする。その結果、ストールしているステージEには、命令3を保持しているにもかかわらずステージDの命令4が入力され、命令3が潰される。このような事態を避けるために、時刻t3では各ステージA〜Fの命令を全てフラッシュする必要がある。少なくとも、ストールしたステージよりも上流のステージ(ステージEでストールした場合にはステージA〜D)の命令をフラッシュする必要がある。しかし、命令を全てフラッシュしてしまうために、時刻t4で処理をリスタートする場合には、また最初から命令を改めて投入する必要がある。すると、ストールする度に命令を投入しなければならず、グラフィックプロセッサの性能が大幅に低下する。   FIG. 50 is a table showing the relationship between instructions and stages when instructions are executed in the same way as in FIG. 47 when no buffer memory is provided. Then, consider a case where instruction 3 stalls at stage E as in FIG. When a stall occurs, it is difficult to stop the pipeline at that moment. Then, in the case of FIG. 50, although it is necessary to hold the state at time t3 at time t3, instructions 7 to 4 in stages A to D overrun stage B to stage E. As a result, the stage 4 instruction 4 is input to the stalled stage E even though the instruction 3 is held, and the instruction 3 is crushed. In order to avoid such a situation, it is necessary to flush all the instructions of the stages A to F at time t3. At least the instruction of the stage upstream from the stalled stage (stages A to D when stalled at stage E) needs to be flushed. However, in order to flush all instructions, when restarting the process at time t4, it is necessary to input the instructions again from the beginning. Then, an instruction must be input every time the stall occurs, and the performance of the graphic processor is greatly reduced.

しかし本実施形態に係る構成であると、ストールが解消した際にはバッファメモリ80に保持されているデータを用いてリスタート出来る。従って、改めて命令を投入する必要が無いため、グラフィックプロセッサの性能低下を抑制出来る。これはグラフィックプロセッサの動作周波数が高い場合(例えば数GHz)や、ステージが非常に深い場合に有効である。なぜなら、このような場合にはストール発生が検出された後に実際のパイプラインを停止させるのに数サイクルを要するからである。   However, with the configuration according to the present embodiment, when the stall is resolved, the data can be restarted using the data held in the buffer memory 80. Accordingly, since it is not necessary to input an instruction again, it is possible to suppress the performance degradation of the graphic processor. This is effective when the operating frequency of the graphic processor is high (for example, several GHz) or when the stage is very deep. This is because in such a case, several cycles are required to stop the actual pipeline after the occurrence of a stall is detected.

特に本実施形態に係る構成の場合、図11に示すように、アドレス発生部40から出力されたアドレス信号は、数段の処理ステージを含む第2ステージを経た後にキャッシュメモリ41に達する。このようにパイプラインが深い理由は、命令制御部25における処理を待つ必要があるからである。1つのピクセルシェーダ24では一度に例えば(4×4)個のピクセルを一括して処理する。この際、ピクセルを生成するのが命令制御部25である。ところが、データ振り分け部20から命令制御部25に与えられる情報は、代表点となるあるピクセル1個分のデータと、その他のピクセルについての代表点からの差分値のみである。この情報から、命令制御部25は代表点以外の15個のピクセルデータを生成する。これにより、データを保持するレジスタ数を削減できる。キャッシュ管理部45は、このピクセルデータの計算処理を待つ必要があるため、図11に示すようにパイプラインが深くなる。   In particular, in the case of the configuration according to the present embodiment, as shown in FIG. 11, the address signal output from the address generation unit 40 reaches the cache memory 41 after passing through the second stage including several processing stages. The reason why the pipeline is so deep is that it is necessary to wait for processing in the instruction control unit 25. One pixel shader 24 processes, for example, (4 × 4) pixels at a time. At this time, the instruction control unit 25 generates the pixels. However, the information given from the data distribution unit 20 to the instruction control unit 25 is only data for one pixel as a representative point and a difference value from the representative point for other pixels. From this information, the command control unit 25 generates 15 pixel data other than the representative points. Thereby, the number of registers holding data can be reduced. Since the cache management unit 45 needs to wait for this pixel data calculation process, the pipeline becomes deeper as shown in FIG.

しかし、このようにパイプラインが深くなったとしても、ストールされた際においてステージに保持されるデータを、バッファメモリ80に待避させ、リスタートする際にはバッファメモリ80内のデータを使用出来るため、処理効率の低下を効果的に抑制出来る。   However, even if the pipeline becomes deeper in this way, the data held in the stage when stalled is saved in the buffer memory 80, and the data in the buffer memory 80 can be used when restarting. , It is possible to effectively suppress a decrease in processing efficiency.

なお、上記第1乃至第6の実施形態に係るグラフィックプロセッサは、例えばゲーム機、ホームサーバー、テレビ、または携帯情報端末などに搭載することが出来る。図51は上記第1乃至第6の実施形態に係るグラフィックプロセッサを備えたデジタルテレビの備えるデジタルボードのブロック図である。デジタルボードは、画像・音声などの通信情報を制御するためのものである。図示するように、デジタルボード1000は、フロントエンド部1100、画像描画プロセッサシステム1200、デジタル入力部1200、A/Dコンバータ1400、1800、ゴーストリダクション部1500、三次元YC分離部1600、カラーデコーダ1700、LAN処理LSI1900、LAN端子2000、ブリッジメディアコントローラ2100、カードスロット2200、フラッシュメモリ1000、及び大容量メモリ(例えばDRAM)1100を備えている。フロントエンド部1100は、デジタルチューナーモジュール1110、1120、OFDM(Orthogonal Frequency Division Multiplex)復調部1120、QPSK(Quadrature Phase Shift Keying)復調部1140を備えている。   The graphic processor according to the first to sixth embodiments can be mounted on, for example, a game machine, a home server, a television, or a portable information terminal. FIG. 51 is a block diagram of a digital board provided in a digital television provided with the graphic processor according to the first to sixth embodiments. The digital board is for controlling communication information such as images and sounds. As illustrated, the digital board 1000 includes a front end unit 1100, an image drawing processor system 1200, a digital input unit 1200, A / D converters 1400 and 1800, a ghost reduction unit 1500, a three-dimensional YC separation unit 1600, a color decoder 1700, A LAN processing LSI 1900, a LAN terminal 2000, a bridge media controller 2100, a card slot 2200, a flash memory 1000, and a large-capacity memory (for example, DRAM) 1100 are provided. The front end unit 1100 includes digital tuner modules 1110 and 1120, an OFDM (Orthogonal Frequency Division Multiplex) demodulator 1120, and a QPSK (Quadrature Phase Shift Keying) demodulator 1140.

画像描画プロセッサシステム1200は、送受信回路1210、MPEG2デコーダ1220、グラフィックエンジン1100、デジタルフォーマットコンバータ1110、及びプロセッサ1120を備えている。そして、例えばグラフィックエンジン1100及びプロセッサ1120が、上記第1乃至第6の実施形態で説明したグラフィックプロセッサに対応する。   The image drawing processor system 1200 includes a transmission / reception circuit 1210, an MPEG2 decoder 1220, a graphic engine 1100, a digital format converter 1110, and a processor 1120. For example, the graphic engine 1100 and the processor 1120 correspond to the graphic processor described in the first to sixth embodiments.

上記構成において、地上デジタル放送波、BSデジタル放送波、及び110°CSデジタル放送波は、フロントエンド部1100で復調される。また地上アナログ放送波及びDVD/VTR信号は、3次元YC分離部1600及びカラーデコーダ1700でデコードされる。これらの信号は、画像描画プロセッサシステム1200に入力され、送受信回路1210で、映像・音声・データに分離される。そして、映像に関しては、MPEG2デコーダ1220を介してグラフィックエンジン1100に映像情報が入力される。するとグラフィックエンジン1100は、上記実施形態で説明したようにして図形を描画する。   In the above configuration, the terrestrial digital broadcast wave, the BS digital broadcast wave, and the 110 ° CS digital broadcast wave are demodulated by the front end unit 1100. The terrestrial analog broadcast wave and the DVD / VTR signal are decoded by a three-dimensional YC separation unit 1600 and a color decoder 1700. These signals are input to the image drawing processor system 1200 and separated into video / audio / data by the transmission / reception circuit 1210. As for the video, video information is input to the graphic engine 1100 via the MPEG2 decoder 1220. Then, the graphic engine 1100 draws a graphic as described in the above embodiment.

図52は、上記第1乃至第6の実施形態に係るグラフィックプロセッサを備えた録画再生機器のブロック図である。図示するように、録画再生機器3000はヘッドアンプ3100、モータードライバ3200、メモリ3300、画像情報制御回路3400、ユーザI/F用CPU3500、フラッシュメモリ3600、ディスプレイ3700、ビデオ出力部3800、及びオーディオ出力部3900を備えている。   FIG. 52 is a block diagram of a recording / playback apparatus including the graphic processor according to the first to sixth embodiments. As shown in the figure, the recording / playback device 3000 includes a head amplifier 3100, a motor driver 3200, a memory 3300, an image information control circuit 3400, a user I / F CPU 3500, a flash memory 3600, a display 3700, a video output unit 3800, and an audio output unit. 3900.

画像情報制御回路3400は、メモリインターフェース3410、デジタル信号プロセッサ3420、プロセッサ3430、映像処理用プロセッサ3450、及びオーディオ処理用プロセッサ3440を備えている。そして、例えば映像処理用プロセッサ3450及びデジタル信号プロセッサ3420が、上記第1及び第2の実施形態で説明したグラフィックプロセッサに対応する。   The image information control circuit 3400 includes a memory interface 3410, a digital signal processor 3420, a processor 3430, a video processing processor 3450, and an audio processing processor 3440. For example, the video processing processor 3450 and the digital signal processor 3420 correspond to the graphic processor described in the first and second embodiments.

上記構成において、ヘッドアンプ3100で読み出された映像データが画像情報制御回路3400に入力される。そして、デジタル信号処理プロセッサ3420から映像情報用プロセッサ3450に図形情報が入力される。すると映像情報用プロセッサ3450は、上記実施形態で説明したようにして図形を描画する。   In the above configuration, video data read by the head amplifier 3100 is input to the image information control circuit 3400. Then, graphic information is input from the digital signal processor 3420 to the video information processor 3450. Then, the video information processor 3450 draws a graphic as described in the above embodiment.

なお、本願発明は上記実施形態に限定されるものではなく、実施段階ではその要旨を逸脱しない範囲で種々に変形することが可能である。更に、上記実施形態には種々の段階の発明が含まれており、開示される複数の構成要件における適宜な組み合わせにより種々の発明が抽出されうる。例えば、実施形態に示される全構成要件からいくつかの構成要件が削除されても、発明が解決しようとする課題の欄で述べた課題が解決でき、発明の効果の欄で述べられている効果が得られる場合には、この構成要件が削除された構成が発明として抽出されうる。   Note that the present invention is not limited to the above-described embodiment, and various modifications can be made without departing from the scope of the invention in the implementation stage. Furthermore, the above embodiments include inventions at various stages, and various inventions can be extracted by appropriately combining a plurality of disclosed constituent elements. For example, even if some constituent requirements are deleted from all the constituent requirements shown in the embodiment, the problem described in the column of the problem to be solved by the invention can be solved, and the effect described in the column of the effect of the invention Can be extracted as an invention.

この発明の第1の実施形態に係るグラフィックプロセッサのブロック図。1 is a block diagram of a graphic processor according to a first embodiment of the present invention. この発明の第1の実施形態に係るグラフィックプロセッサにおけるフレームバッファの概念図。The conceptual diagram of the frame buffer in the graphic processor which concerns on 1st Embodiment of this invention. この発明の第1の実施形態に係るグラフィックプロセッサにおけるフレームバッファの概念図。The conceptual diagram of the frame buffer in the graphic processor which concerns on 1st Embodiment of this invention. この発明の第1の実施形態に係るグラフィックプロセッサにおけるフレームバッファの概念図。The conceptual diagram of the frame buffer in the graphic processor which concerns on 1st Embodiment of this invention. この発明の第1の実施形態に係るグラフィックプロセッサにおけるフレームバッファの概念図。The conceptual diagram of the frame buffer in the graphic processor which concerns on 1st Embodiment of this invention. この発明の第1の実施形態に係るグラフィックプロセッサにおけるフレームバッファの概念図。The conceptual diagram of the frame buffer in the graphic processor which concerns on 1st Embodiment of this invention. この発明の第1の実施形態に係るグラフィックプロセッサの行うクアッドマージの概念図。The conceptual diagram of the quad merge which the graphic processor which concerns on 1st Embodiment of this invention performs. この発明の第1の実施形態に係るグラフィックプロセッサにおいて実行される命令列の概念図。The conceptual diagram of the command sequence performed in the graphic processor which concerns on 1st Embodiment of this invention. この発明の第1の実施形態に係るグラフィックプロセッサにおいて実行されるサブパスの様子を示すタイミングチャート。4 is a timing chart showing the state of sub-paths executed in the graphic processor according to the first embodiment of the present invention. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部のブロック図。The block diagram of the data control part with which the graphic processor which concerns on 1st Embodiment of this invention is provided. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部のブロック図。The block diagram of the data control part with which the graphic processor which concerns on 1st Embodiment of this invention is provided. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するアドレス発生部のブロック図。The block diagram of the address generation part which the data control part with which the graphic processor which concerns on 1st Embodiment of this invention is provided has. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するアドレス発生部が生成するアドレス信号の概念図。The conceptual diagram of the address signal which the address generation part which the data control part with which the graphic processor which concerns on 1st Embodiment of this invention has has has is produced | generated. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するアドレス発生部が生成するアドレス信号の概念図。The conceptual diagram of the address signal which the address generation part which the data control part with which the graphic processor which concerns on 1st Embodiment of this invention has has has is produced | generated. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するキャッシュメモリのブロック図。The block diagram of the cache memory which the data control part with which the graphic processor which concerns on 1st Embodiment of this invention has is provided. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するリクエスト発行制御部のブロック図。The block diagram of the request issue control part which the data control part with which the graphic processor which concerns on 1st Embodiment of this invention has is provided. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するキャッシュアクセス制御部のブロック図。The block diagram of the cache access control part which the data control part with which the graphic processor which concerns on 1st Embodiment of this invention is provided has. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するキャッシュ管理部のブロック図。The block diagram of the cache management part which the data control part with which the graphic processor which concerns on 1st Embodiment of this invention is provided has. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するキャッシュ管理部内のステータスフラグとキャッシュメモリとの関係を示す概念図。The conceptual diagram which shows the relationship between the status flag and cache memory in the cache management part which the data control part with which the graphic processor which concerns on 1st Embodiment of this invention has is provided. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するキャッシュ管理部の回路図。The circuit diagram of the cache management part which the data control part with which the graphic processor which concerns on 1st Embodiment of this invention is provided has. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部の状態遷移図。The state transition diagram of the data control part with which the graphic processor which concerns on 1st Embodiment of this invention is provided. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部のブロック図であり、ロード時の様子を示す図。It is a block diagram of the data control part with which the graphic processor which concerns on 1st Embodiment of this invention is provided, and shows the mode at the time of loading. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部のブロック図であり、ストア時の様子を示す図。It is a block diagram of the data control part with which the graphic processor which concerns on 1st Embodiment of this invention is provided, and shows the mode at the time of a store. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部のブロック図であり、リフィル時の様子を示す図。It is a block diagram of the data control part with which the graphic processor which concerns on 1st Embodiment of this invention is provided, and shows the mode at the time of refill. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部の状態遷移図。The state transition diagram of the data control part with which the graphic processor which concerns on 1st Embodiment of this invention is provided. この発明の第1の実施形態に係るグラフィックプロセッサのロード/ストア及びリフィル時の動作を示すフローチャート。6 is a flowchart showing an operation at the time of load / store and refill of the graphic processor according to the first embodiment of the present invention; この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部のロード/ストア及びリフィル時における各種信号のタイミングチャート。4 is a timing chart of various signals during load / store and refill of the data control unit included in the graphic processor according to the first embodiment of the present invention. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するキャッシュ管理部の回路図。The circuit diagram of the cache management part which the data control part with which the graphic processor which concerns on 1st Embodiment of this invention is provided has. グラフィックプロセッサの備えるデータ制御部のブロック図であり、ロード/ストア命令のヒット判定のための構成を示すブロック図。It is a block diagram of the data control part with which a graphic processor is provided, and is a block diagram which shows the structure for hit determination of a load / store instruction. この発明の第1の実施形態に係るグラフィックプロセッサの備えるデータ制御部のブロック図であり、ロード/ストア命令のヒット判定のための構成を示すブロック図。It is a block diagram of the data control part with which the graphic processor which concerns on 1st Embodiment of this invention is provided, and is a block diagram which shows the structure for the hit determination of a load / store instruction. この発明の第2の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するキャッシュ管理部内のステータスフラグの概念図。The conceptual diagram of the status flag in the cache management part which the data control part with which the graphic processor which concerns on 2nd Embodiment of this invention has is provided. この発明の第2の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するキャッシュ管理部の回路図。The circuit diagram of the cache management part which the data control part with which the graphic processor which concerns on 2nd Embodiment of this invention is provided has. この発明の第2の実施形態に係るグラフィックプロセッサの備えるデータ制御部のブロック図であり、ライトバック時の様子を示す図。It is a block diagram of the data control part with which the graphic processor which concerns on 2nd Embodiment of this invention is provided, and shows the mode at the time of write-back. この発明の第2の実施形態に係るグラフィックプロセッサのライトバック時の動作を示すフローチャート。The flowchart which shows the operation | movement at the time of the write-back of the graphic processor which concerns on 2nd Embodiment of this invention. この発明の第2の実施形態に係るグラフィックプロセッサのブロック図。The block diagram of the graphic processor which concerns on 2nd Embodiment of this invention. この発明の第3の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するサブパス情報管理部におけるインストラクションテーブルの概念図。The conceptual diagram of the instruction table in the subpath information management part which the data control part with which the graphic processor which concerns on 3rd Embodiment of this invention has is provided. この発明の第3の実施形態に係るグラフィックプロセッサのプリロード時の動作を示すフローチャート。The flowchart which shows the operation | movement at the time of the preload of the graphic processor which concerns on 3rd Embodiment of this invention. この発明の第3の実施形態に係るグラフィックプロセッサの備えるデータ制御部のブロック図であり、プリロード時の様子を示す図。It is a block diagram of the data control part with which the graphic processor which concerns on 3rd Embodiment of this invention is provided, and shows the mode at the time of preload. この発明の第3の実施形態に係るグラフィックプロセッサにおいて実行されるサブパスの様子を示すタイミングチャート。The timing chart which shows the mode of the subpass performed in the graphic processor which concerns on the 3rd Embodiment of this invention. この発明の第4の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するキャッシュ管理部内のステータスフラグの概念図。The conceptual diagram of the status flag in the cache management part which the data control part with which the graphic processor which concerns on 4th Embodiment of this invention has is provided. この発明の第4の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するキャッシュ管理部において、ロックフラグに応じたエントリの制御方法を示すフローチャート。The flowchart which shows the control method of the entry according to a lock flag in the cache management part which the data control part with which the graphic processor concerning 4th Embodiment of this invention is provided has. この発明の第4の実施形態に係るグラフィックプロセッサの備えるデータ制御部取り得る状態を示す図。The figure which shows the state which can take the data control part with which the graphic processor which concerns on 4th Embodiment of this invention is provided. この発明の第5の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するキャッシュ管理部内のステータスフラグの概念図。The conceptual diagram of the status flag in the cache management part which the data control part with which the graphic processor which concerns on 5th Embodiment of this invention has is provided. この発明の第5の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するキャッシュ管理部内のステータスフラグとキャッシュメモリとの関係を示す概念図。The conceptual diagram which shows the relationship between the status flag and cache memory in the cache management part which the data control part with which the graphic processor concerning 5th Embodiment of this invention has is provided. この発明の第5の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するキャッシュ管理部において、スレッドエントリフラグに応じたエントリの制御方法を示すフローチャート。The flowchart which shows the control method of the entry according to the thread entry flag in the cache management part which the data control part with which the graphic processor which concerns on 5th Embodiment of this invention has is provided. この発明の第6の実施形態に係るグラフィックプロセッサの一部領域のブロック図。The block diagram of the partial area | region of the graphic processor which concerns on 6th Embodiment of this invention. この発明の第6の実施形態に係るグラフィックプロセッサにおいて実行される命令とステージとの関係図。FIG. 16 is a diagram showing the relationship between instructions executed in a graphic processor according to a sixth embodiment of the present invention and stages. この発明の第6の実施形態に係るグラフィックプロセッサにおいて実行される命令とステージとの関係図であり、ストールが発生した際の様子を示す図。FIG. 16 is a diagram showing the relationship between instructions executed in a graphic processor according to a sixth embodiment of the present invention and a stage, and showing a situation when a stall occurs. この発明の第6の実施形態に係るグラフィックプロセッサの備えるデータ制御部の有するキャッシュ管理部の回路図。The circuit diagram of the cache management part which the data control part with which the graphic processor concerning 6th Embodiment of this invention is provided has. グラフィックプロセッサにおいて実行される命令とステージとの関係図であり、ストールが発生した際の様子を示す図。FIG. 4 is a diagram illustrating a relationship between an instruction executed in a graphic processor and a stage, and shows a state when a stall occurs. この発明の第1乃至第6の実施形態に係るグラフィックプロセッサを備えたデジタルテレビの有するデジタルボードのブロック図。The block diagram of the digital board which the digital television provided with the graphic processor which concerns on the 1st thru | or 6th embodiment of this invention has. この発明の第1乃至第6の実施形態に係るグラフィックプロセッサを備えた録画再生機器のブロック図。The block diagram of the recording / reproducing apparatus provided with the graphic processor which concerns on the 1st thru | or 6th embodiment of this invention.

符号の説明Explanation of symbols

10…グラフィックプロセッサ、11…ラスタライザ、12−0〜12−3…ピクセルシェーダ、13…ローカルメモリ、20…データ振り分け部、23…テクスチャユニット、24…ピクセルシェーダユニット、25…命令制御部、26…描画処理部、27…データ制御部、40…アドレス発生部、41…キャッシュメモリ、42…キャッシュ制御部、43…プリロード制御部、44…キャッシュアクセス制御部、45…キャッシュ管理部、46…リクエスト発行制御部、47…プリロードアドレス発生部、48…プリロード保持部、49…サブパス情報管理部、50…アドレス保持部、51〜62、71…メモリ、65、68、69、74…選択回路、66、72…比較器、67…ANDゲート、73…カウンタ、75…バス制御部、80…バッファメモリ   DESCRIPTION OF SYMBOLS 10 ... Graphic processor, 11 ... Rasterizer, 12-0 to 12-3 ... Pixel shader, 13 ... Local memory, 20 ... Data distribution part, 23 ... Texture unit, 24 ... Pixel shader unit, 25 ... Instruction control part, 26 ... Drawing processing unit, 27 ... data control unit, 40 ... address generation unit, 41 ... cache memory, 42 ... cache control unit, 43 ... preload control unit, 44 ... cache access control unit, 45 ... cache management unit, 46 ... issue request Control unit 47... Preload address generation unit 48. Preload holding unit 49. Subpath information management unit 50. Address holding unit 51 to 62 71 71 Memory 65, 68, 69, 74 Selection circuit 66 72 ... Comparator, 67 ... AND gate, 73 ... Counter, 75 ... Bus controller, 8 ... buffer memory

Claims (5)

画像データを保持するメインメモリと、
前記メインメモリとの間で前記画像データの授受を行うキャッシュメモリと、
前記メインメモリと前記キャッシュメモリとの間のデータ転送を管理すると共に、前記キャッシュメモリの状態に関する情報を保持する転送制御装置と、
前記キャッシュメモリ内の前記画像データを用いて画像処理プログラムを実行し、前記画像処理プログラムを実行して得られた画像データを前記キャッシュメモリに保持させるプログラム実行部と
を具備し、前記キャッシュメモリは、各々が前記画像データを保持可能な複数のエントリを含み、
前記転送制御装置は、前記メインメモリから前記キャッシュメモリのエントリに転送される前記画像データの識別情報と、前記プログラム実行部で得られた前記画像データが前記エントリに保持されているか否かを示すデータ更新情報とを、前記エントリ毎に保持し、
前記転送制御装置は、いずれかの前記エントリに対応した前記データ更新情報がアサートされている場合、該エントリ内の前記画像データを前記メインメモリに書き込む
ことを特徴とする描画装置。
A main memory for storing image data;
A cache memory for transferring the image data to and from the main memory;
A transfer control device that manages data transfer between the main memory and the cache memory, and holds information about the state of the cache memory;
A program execution unit that executes an image processing program using the image data in the cache memory, and holds the image data obtained by executing the image processing program in the cache memory; Each including a plurality of entries capable of holding the image data;
The transfer control device indicates whether the image data identification information transferred from the main memory to the cache memory entry and the image data obtained by the program execution unit are held in the entry. Data update information is held for each entry,
When the data update information corresponding to any of the entries is asserted, the transfer control device writes the image data in the entry to the main memory.
前記転送制御装置は、定期的に、前記データ更新情報に基づいて、前記キャッシュメモリから前記メインメモリへのデータ転送を実行する  The transfer control device periodically performs data transfer from the cache memory to the main memory based on the data update information
ことを特徴とする請求項1記載の描画装置。  The drawing apparatus according to claim 1.
前記転送制御装置はカウンタを有し、前記カウンタのカウンタ値で指定される前記エントリの前記データ更新情報がアサートされているか否かを確認する  The transfer control device has a counter, and checks whether the data update information of the entry specified by the counter value of the counter is asserted.
ことを特徴とする請求項1または2記載の描画装置。  The drawing apparatus according to claim 1 or 2, wherein
画像データを保持するメインメモリと、複数のエントリを有し、前記メインメモリとの間で前記画像データの授受を行うキャッシュメモリと、前記メインメモリと前記キャッシュメモリとの間のデータ転送を管理すると共に、前記キャッシュメモリの状態に関する情報を保持する転送制御装置と、前記キャッシュメモリ内の前記画像データを用いて画像処理プログラムを実行するプログラム実行部とを具備する描画装置のデータ転送方法であって、
前記プログラム実行部が、前記画像処理プログラムを実行することにより得られた新たな画像データをいずれかの前記エントリに保持させるステップと、
前記新たな画像データが前記エントリに保持された際に、前記転送制御装置が該エントリに関する更新情報をアサートするステップと、
前記転送制御装置が、前記更新情報がアサートされた前記エントリの有無を検出するステップと、
前記更新情報がアサートされた前記エントリが検出された際、前記転送制御装置が、該エントリに保持される前記画像データを前記メインメモリに転送するステップと
を具備することを特徴とするデータ転送方法。
A main memory that holds image data, a cache memory that has a plurality of entries and exchanges the image data with the main memory, and manages data transfer between the main memory and the cache memory And a data transfer method for a drawing apparatus, comprising: a transfer control device that holds information about the state of the cache memory; and a program execution unit that executes an image processing program using the image data in the cache memory. ,
The program execution unit holding new image data obtained by executing the image processing program in any of the entries;
When the new image data is held in the entry, the transfer control device asserts update information regarding the entry;
The transfer control device detecting the presence or absence of the entry for which the update information is asserted;
When the entry for which the update information is asserted is detected, the transfer control device comprises a step of transferring the image data held in the entry to the main memory. .
前記転送制御装置は、定期的に、前記データ更新情報に基づいて、前記画像データの前記メインメモリへの転送を実行する  The transfer control device periodically transfers the image data to the main memory based on the data update information
ことを特徴とする請求項4記載のデータ転送方法。  5. The data transfer method according to claim 4, wherein:
JP2005371738A 2005-12-26 2005-12-26 Drawing apparatus and data transfer method Expired - Fee Related JP4799171B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2005371738A JP4799171B2 (en) 2005-12-26 2005-12-26 Drawing apparatus and data transfer method
US11/644,200 US20070165042A1 (en) 2005-12-26 2006-12-22 Rendering apparatus which parallel-processes a plurality of pixels, and data transfer method
US12/560,307 US20100005243A1 (en) 2005-12-26 2009-09-15 Rendering Apparatus Which Parallel-Processes a Plurality of Pixels, and Data Transfer Method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005371738A JP4799171B2 (en) 2005-12-26 2005-12-26 Drawing apparatus and data transfer method

Publications (2)

Publication Number Publication Date
JP2007172455A JP2007172455A (en) 2007-07-05
JP4799171B2 true JP4799171B2 (en) 2011-10-26

Family

ID=38298905

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005371738A Expired - Fee Related JP4799171B2 (en) 2005-12-26 2005-12-26 Drawing apparatus and data transfer method

Country Status (1)

Country Link
JP (1) JP4799171B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9177368B2 (en) * 2007-12-17 2015-11-03 Nvidia Corporation Image distortion correction
JP5533109B2 (en) * 2010-03-24 2014-06-25 セイコーエプソン株式会社 Image display device, projector, and data acquisition method in image display device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3097955B2 (en) * 1994-12-01 2000-10-10 富士通株式会社 Information processing apparatus and information processing method
US6608625B1 (en) * 1998-10-14 2003-08-19 Hitachi, Ltd. Three dimensional graphic processor
JP3889195B2 (en) * 1999-02-03 2007-03-07 株式会社東芝 Image processing apparatus, image processing system, and image processing method

Also Published As

Publication number Publication date
JP2007172455A (en) 2007-07-05

Similar Documents

Publication Publication Date Title
US20100005243A1 (en) Rendering Apparatus Which Parallel-Processes a Plurality of Pixels, and Data Transfer Method
US7999819B2 (en) Systems and methods for managing texture descriptors in a shared texture engine
US9298632B2 (en) Hybrid cache state and filter tracking of memory operations during a transaction
US9529594B2 (en) Miss buffer for a multi-threaded processor
US7533236B1 (en) Off-chip out of order memory allocation for a unified shader
KR101139565B1 (en) In-memory, in-page directory cache coherency scheme
US20110161616A1 (en) On demand register allocation and deallocation for a multithreaded processor
JP2007323192A (en) Cache memory device and processing method
TW201423404A (en) System cache with data pending state
US20100205609A1 (en) Using time stamps to facilitate load reordering
JP2005346168A (en) Cache memory, system, and data storage method
US8244985B2 (en) Store performance in strongly ordered microprocessor architecture
JP4799171B2 (en) Drawing apparatus and data transfer method
US7451274B2 (en) Memory control device, move-in buffer control method
JP2007172456A (en) Plotting device
US9053040B2 (en) Filtering mechanism for render target line modification
JP2007172457A (en) Plotting device
US11176039B2 (en) Cache and method for managing cache
JP3767521B2 (en) Cache fill control method and CPU
JP3295728B2 (en) Update circuit of pipeline cache memory
TWI739430B (en) Cache and method for managing cache
US20240111420A1 (en) Speculative dram request enabling and disabling
CN111506252B (en) Cache memory and management method thereof
JP2023542862A (en) Method and apparatus for providing persistence to remote non-volatile memory
JP4718992B2 (en) Drawing apparatus and drawing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20080728

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20101213

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20110104

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20110307

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110802

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

Free format text: PAYMENT UNTIL: 20140812

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20140812

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees