JP3895314B2 - Data processing apparatus, data processing program, and recording medium on which data processing program is recorded - Google Patents

Data processing apparatus, data processing program, and recording medium on which data processing program is recorded Download PDF

Info

Publication number
JP3895314B2
JP3895314B2 JP2003322090A JP2003322090A JP3895314B2 JP 3895314 B2 JP3895314 B2 JP 3895314B2 JP 2003322090 A JP2003322090 A JP 2003322090A JP 2003322090 A JP2003322090 A JP 2003322090A JP 3895314 B2 JP3895314 B2 JP 3895314B2
Authority
JP
Japan
Prior art keywords
storage means
output
item
input
data processing
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
JP2003322090A
Other languages
Japanese (ja)
Other versions
JP2005092354A (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.)
Japan Science and Technology Agency
National Institute of Japan Science and Technology Agency
Original Assignee
Japan Science and Technology Agency
National Institute of Japan Science and Technology Agency
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 Japan Science and Technology Agency, National Institute of Japan Science and Technology Agency filed Critical Japan Science and Technology Agency
Priority to JP2003322090A priority Critical patent/JP3895314B2/en
Publication of JP2005092354A publication Critical patent/JP2005092354A/en
Application granted granted Critical
Publication of JP3895314B2 publication Critical patent/JP3895314B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

本発明は、主記憶手段から命令区間を読み出し、演算処理を行った結果を主記憶手段に書き込む処理を行うデータ処理装置に関するものである。   The present invention relates to a data processing apparatus that performs a process of reading an instruction section from a main storage unit and writing a result of an arithmetic process into the main storage unit.

従来、CPU(Central Processing Unit)を始めとするマイクロプロセッサにおいて、演算速度の高速化技術に関する研究開発が盛んに行われている。高速化技術としては、例えばパイプライン、スーパースケーラ、アウトオブオーダー実行、および、レジスタリネーミングなどが挙げられる。   2. Description of the Related Art Conventionally, research and development relating to a technique for increasing the operation speed of a microprocessor such as a CPU (Central Processing Unit) has been actively conducted. Examples of the speed-up technology include pipeline, superscaler, out-of-order execution, and register renaming.

パイプラインは、命令の実行処理を数段階に分解し、複数の命令を流れ作業的に同時処理を行う技術である。スーパースケーラは、命令の実行回路を2組以上用意し、複数の命令を同時に並行して実行する技術である。アウトオブオーダー実行は、命令の記述順序を無視して、いくつかの連続する命令の中から先に実行可能なものを探して先行処理を行う技術である。レジスタリネーミングは、例えばCISC(Complex Instruction Set Computer)タイプのプロセッサにおいて、従来のプロセッサにおける命令の互換性を保ちながら、汎用レジスタの数を増やすことによって並行処理が行われる確率を増大させる技術である。   Pipeline is a technique that decomposes instruction execution processing into several stages, and flows a plurality of instructions and performs simultaneous processing. Superscaler is a technology that prepares two or more instruction execution circuits and executes a plurality of instructions simultaneously in parallel. Out-of-order execution is a technique for ignoring the description order of instructions and searching for the first executable instruction among several consecutive instructions and performing a preceding process. Register renaming is a technique for increasing the probability that parallel processing is performed by increasing the number of general-purpose registers while maintaining compatibility of instructions in a conventional processor, for example, in a CISC (Complex Instruction Set Computer) type processor. .

このように、マイクロプロセッサにおける演算速度の高速化を図る際には、命令の実行を並行して行うことが重要となっている。しかしながら、プログラム中には、ある命令の結果に応じて異なる命令が行われるような依存関係、言い換えれば分岐が含まれている場合がほとんどである。このような分岐が含まれている場合、並行処理によって先行して処理を行っていると、分岐の結果によって先行処理した内容が無駄になるという状況が発生することになり、演算速度の高速化の効果が小さくなるという問題がある。   Thus, in order to increase the calculation speed in the microprocessor, it is important to execute instructions in parallel. However, most of the programs include a dependency relationship in which different instructions are executed depending on the result of a certain instruction, in other words, a branch. When such a branch is included, if processing is performed in advance by parallel processing, a situation occurs in which the content of the preceding processing is wasted depending on the result of the branch, and the calculation speed is increased. There is a problem that the effect of.

そこで、プログラム中に分岐がある場合に、分岐先を予測することによって先行処理が無駄になる確率を低減し、並行処理の効果を向上させる技術、いわゆる分岐予測に関する研究が数多く行われている。   Therefore, when there is a branch in the program, many studies have been made on a technique for reducing the probability that the preceding process is wasted by predicting the branch destination and improving the effect of parallel processing, so-called branch prediction.

しかしながら、分岐予測に基づいて投機的先行処理を行う場合には、一般的に次のような問題がある。第1の問題としては、予測の正当性を常に検証する必要があるので、先行命令列の実行時間そのものを削減することはできない、という点である。第2の問題としては、誤った予測に基づく一連の先行演算結果を全て無効化する必要があるので、一度に投機的先行処理できる命令数を多くするには、相応のハードウェアコストを要する、という点である。第3の問題としては、命令間の依存関係が多いほど、多重に投機的先行処理をする必要が生じ、予測の正当性の検証処理、および誤った予測に基づく処理の無効化処理が極めて複雑になる、という点である。   However, when speculative preceding processing is performed based on branch prediction, there are generally the following problems. The first problem is that the execution time of the preceding instruction sequence itself cannot be reduced because it is necessary to always verify the correctness of the prediction. As a second problem, since it is necessary to invalidate a series of predecessor operation results based on erroneous prediction, in order to increase the number of instructions that can be speculatively processed at once, a corresponding hardware cost is required. That is the point. As the third problem, the more the dependency between instructions, the more it becomes necessary to carry out speculative predecessor processing, and the verification validity verification process and the invalidation process based on erroneous prediction are extremely complicated. Is that it becomes.

一方、分岐予測とは異なる高速化技術として、値再利用という技術も提案されている。この値再利用とは、プログラムの一部分に関する入力値および出力値を再利用表に登録しておき、同じ箇所を再度実行する際に、入力値が再利用表に登録されているものである場合には、登録されている出力値を出力する、という技術である。この値再利用による効果としては次のようなものが挙げられる。(1)入力値が、再利用表に登録されている入力値と一致すれば、実行結果を検証する必要がない。(2)入力値および出力値の総数によってのみハードウェアコストが決定され、省略可能な命令列の長さが制約されない。(3)命令間の依存関係の多少は、再利用機構の複雑さに影響を与えない。(4)冗長なロード/ストア命令を削減することができるとともに、これに伴う消費電力の削減も実現される。   On the other hand, a technique called value reuse has also been proposed as a speed-up technique different from branch prediction. In this value reuse, input values and output values related to a part of the program are registered in the reuse table, and when the same part is executed again, the input values are registered in the reuse table. Is a technique of outputting a registered output value. The effects of this value reuse include the following. (1) If the input value matches the input value registered in the reuse table, there is no need to verify the execution result. (2) The hardware cost is determined only by the total number of input values and output values, and the length of the instruction sequence that can be omitted is not restricted. (3) The degree of dependency between instructions does not affect the complexity of the reuse mechanism. (4) Redundant load / store instructions can be reduced, and power consumption can be reduced accordingly.

後記する非特許文献1には、プログラムにおける関数に関して値再利用を行う技術が示されている。この従来技術では、一般的にロードモジュールがABI(Application Binary Interface)に従って作られることを利用しており、特に、SPARC(Scalable Processor ARChitecture) ABIを利用している。そして、このABIにおいて関数の入出力を特定することによって値再利用を実現している。すなわち、値再利用のためのコンパイラによる専用命令の埋め込みが不要となっており、既存ロードモジュールへの適用が可能となっている。   Non-Patent Document 1, which will be described later, shows a technique for reusing values for functions in a program. In this prior art, a load module is generally used in accordance with ABI (Application Binary Interface), and in particular, SPARC (Scalable Processor ARChitecture) ABI is used. Then, value reuse is realized by specifying input / output of a function in this ABI. That is, it is not necessary to embed a dedicated instruction by a compiler for value reuse, and application to an existing load module is possible.

また、関数の多重構造を動的に把握することにより、関数内局所レジスタやスタック上の局所変数を値再利用における入出力値から除外するようにしており、これによって効率を向上させている。特に関数については、関数の複雑さに拘わらず、最大6のレジスタ入力、最大4のレジスタ出力、および、局所変数を含まない最小限の主記憶値の登録による再利用および事前実行が可能となっている。この従来技術について以下に詳細に説明する。   Also, by dynamically grasping the multiplex structure of functions, local registers in the function and local variables on the stack are excluded from input / output values in value reuse, thereby improving efficiency. For functions in particular, regardless of the complexity of the function, reuse and pre-execution are possible by registering a maximum of 6 register inputs, a maximum of 4 register outputs, and a minimum main memory value that does not include local variables. ing. This prior art will be described in detail below.

まず、単一の関数を対象として、何が入力で何が出力であるかを明らかにし、1レベルの再利用を行うために必要な機構について説明する。プログラムにおいては、一般的に関数は多重構造を形成している。関数A(Function-A)が関数B(Function-B)を呼び出す構造を図10(a)に示す。   First, for a single function, we will clarify what is input and what is output, and explain the mechanism required to perform one-level reuse. In a program, functions generally form multiple structures. FIG. 10A shows a structure in which the function A (Function-A) calls the function B (Function-B).

大域変数(Globals)は、関数Aの入出力(Ain/Aout)および関数Bの入出力(Bin/Bout)になりうるものである。関数Aの局所変数(Locals-A)は、関数Aの入出力ではないが、ポインタを通じてBの入出力になりうるものである。また、関数Aから関数Bへの引数(Args)は、関数Bへの入力となりうるものであり、関数Bから関数Aの返り値(Ret.Val.)は、関数Bからの出力となりうるものである。なお、関数Bの局所変数(Locals-B)は、関数Aおよび関数Bの入出力には含まれない。   The global variable (Globals) can be an input / output (Ain / Aout) of the function A and an input / output (Bin / Bout) of the function B. The local variable (Locals-A) of the function A is not an input / output of the function A, but can be an input / output of B through a pointer. An argument (Args) from function A to function B can be an input to function B, and a return value (Ret.Val.) From function B to function A can be an output from function B. It is. The local variable (Locals-B) of the function B is not included in the input / output of the function A and the function B.

コンテクストに依存せずに関数Bを再利用するには、関数Bの実行時に、関数Bの入出力Bin/Boutのみを入出力として登録しなければならない。ここで、図10(a)に示すプログラム構造を実行する際の主記憶におけるメモリマップを図10(b)に示す。このメモリマップにおいて、Bin/Boutを含まない領域はLocals-Bのみとなっている。よって、Bin/Boutを識別するには、GlobalsとLocals-Bとの境界、および、Locals-BとLocals-Aとの境界をそれぞれ確定しなければならない。前者については、一般的にOS(Operating System)が実行時のデータサイズおよびスタックサイズの上限を決めることを利用し、OSが設定する境界(LIMIT)に基づいてGlobalsとLocals-Bとの境界を確定することができる。後者については、Bが呼び出される直前のスタックポインタの値(SP in A)を用いることによって、Locals-BとLocals-Aとの境界を確定することができる。   In order to reuse the function B without depending on the context, only the input / output Bin / Bout of the function B must be registered as the input / output when the function B is executed. Here, a memory map in the main memory when executing the program structure shown in FIG. 10A is shown in FIG. In this memory map, only the Locals-B area does not include Bin / Bout. Therefore, in order to identify Bin / Bout, the boundary between Globals and Locals-B and the boundary between Locals-B and Locals-A must be determined, respectively. For the former, the OS (Operating System) generally determines the upper limit of the data size and stack size at the time of execution, and the boundary between Globals and Locals-B is determined based on the boundary (LIMIT) set by the OS. It can be confirmed. For the latter, the boundary between Locals-B and Locals-A can be determined by using the value of the stack pointer (SP in A) immediately before B is called.

次に、与えられた主記憶アドレスが、大域変数であるか、または、どの関数の局所変数であるかを識別する方法について説明する。ロードモジュールは、SPARC ABIに規定されている以下の条件を満たすと仮定する。なお、%fpはフレームポインタ、%spはスタックポインタを意味するものとする。
(1)%sp以上の領域のうち、%sp+0〜63はレジスタ退避領域、%sp+68〜91は引数退避領域であり、いずれも関数の入出力ではない。
(2)構造体を返す場合の暗黙的引数(Implicit Arg.)は%sp+64〜67に格納される。
(3)明示的引数(Explicit Arg.)はレジスタ%o0〜5、%sp+92以上の領域に置かれる。
Next, a method for identifying whether a given main memory address is a global variable or a local variable of which function will be described. It is assumed that the load module satisfies the following conditions specified in SPARC ABI. Note that% fp means a frame pointer, and% sp means a stack pointer.
(1) Of the areas above% sp,% sp + 0 to 63 are register save areas, and% sp + 68 to 91 are argument save areas, which are not function inputs / outputs.
(2) An implicit argument (Implicit Arg.) For returning a structure is stored in% sp + 64 to 67.
(3) An explicit argument (Explicit Arg.) Is placed in an area of registers% o0 to 5 and% sp + 92 or more.

まず、大域変数と局所変数とを区別するために、一般的に、OSが実行時のデータサイズおよびスタックサイズの上限を決めることを利用し、次の事項を仮定する。
(1)大域変数はLIMIT未満の領域に置かれる。
(2)%spは、LIMIT以下になることはなく、LIMIT〜%spの領域は無効である。
First, in order to distinguish between a global variable and a local variable, generally, the OS determines the upper limit of the data size and stack size at the time of execution, and assumes the following matters.
(1) Global variables are placed in the area below LIMIT.
(2)% sp never falls below LIMIT, and the area from LIMIT to% sp is invalid.

以上の条件を満たしながら、関数Aが関数Bを呼び出す場合の、メモリマップにおける引数およびフレームの概要を図11に示す。同図を参照しながら、以下にAの局所変数およびBの局所変数を区別する方法について説明する。   FIG. 11 shows an outline of arguments and frames in the memory map when the function A calls the function B while satisfying the above conditions. A method for distinguishing the local variable A and the local variable B will be described below with reference to FIG.

同図において、(a)はA実行中の状態を示している。LIMIT未満の太枠部分に命令(Instructions)および大域変数(Global Vars.)が格納され、%sp以上に有効な値が格納されている。%sp+64には、Bが構造体を返り値とする場合の暗黙的引数として、構造体の先頭アドレスが格納される。Bに対する明示的引数の先頭6ワードはレジスタ%o0〜5、第7ワード以降は%sp+92以上に格納される。ベースレジスタを%spとするオペランド%sp+92が出現した場合、この領域は引数の第7ワードすなわちBの局所変数である。一方、オペランド%sp+92が出現しない場合、この領域はAの局所変数である。このように、(a)の状態では、オペランドを検証することによってAの局所変数とBの局所変数とを区別することができる。   In the figure, (a) shows a state in which A is being executed. Instructions (Instructions) and global variables (Global Vars.) Are stored in a thick frame part less than LIMIT, and valid values are stored above% sp. In% sp + 64, the head address of the structure is stored as an implicit argument when B returns the structure. The first 6 words of the explicit argument for B are stored in registers% o0 to 5 and the seventh and subsequent words are stored in% sp + 92 or more. When an operand% sp + 92 having a base register% sp appears, this area is the seventh word of the argument, that is, a local variable of B. On the other hand, if the operand% sp + 92 does not appear, this area is a local variable of A. Thus, in the state (a), the local variable of A and the local variable of B can be distinguished by verifying the operand.

一方、(b)はB実行中の状態を示している。引数が入力、返り値が出力、大域変数およびAの局所変数が入出力となりうる。ただし、Bは可変長引数を受け入れる場合があるので、一般に%fp+92以上の領域がAの局所変数の領域となるかBの局所変数の領域となるかは判断できない。   On the other hand, (b) shows a state in which B is being executed. Arguments can be input, return values can be output, global variables and A local variables can be input / output. However, since B may accept a variable-length argument, it is generally impossible to determine whether the area of% fp + 92 or more is the local variable area of A or the local variable area of B.

局所変数を区別するには、まず、(a)の時点において引数の第7ワード以降を検出した関数呼び出しは再利用の対象外とし、第7ワード以降を検出しない関数呼び出しに関して、直前に%sp+92の値を記録しておくようにする。なお、第7ワード以降を使用する関数呼び出しの出現頻度が低いと予想されることから、第7ワード以降を使用する関数を再利用の対象外とする制限による性能低下は軽微なものと考える。   In order to distinguish local variables, first, the function call that detects the seventh word and the following of the argument at the time of (a) is excluded from the reuse target, and the function call that does not detect the seventh word and later is immediately before% sp + 92. Record the value of. In addition, since the appearance frequency of function calls using the seventh word and later is expected to be low, it is considered that the performance degradation due to the restriction that the function using the seventh word and later is excluded from reuse.

以上の準備により、(b)における主記憶参照アドレスが、予め記録した%sp+92の値以上の場合はAの局所変数、小さい場合はBの局所変数であることがわかる。B実行時には、Bの局所変数を除外しながら、大域変数およびAの局所変数を再利用表へ登録する。   From the above preparation, it can be seen that when the main memory reference address in (b) is greater than or equal to the previously recorded value of% sp + 92, it is a local variable of A, and if it is smaller, it is a local variable of B. At the time of execution of B, the global variable and the local variable of A are registered in the reuse table while excluding the local variable of B.

再利用の際は、Bの局所変数は入出力から除外されるので、Bの局所変数のアドレスが一致している必要がない。このため、いかなるコンテクストであっても、入力さえ一致すれば、再利用することが可能である。ただし、Bが参照する大域変数やAの局所変数については、アドレスおよびデータの両方が再利用表の内容と完全に一致する必要がある。すなわち、Bを実行する前に、どのようにして比較すべき主記憶アドレスを網羅するかがポイントになる。   At the time of reuse, since the local variable of B is excluded from input / output, the address of the local variable of B does not need to match. Therefore, any context can be reused as long as the input matches. However, for the global variable referenced by B and the local variable of A, both the address and data need to completely match the contents of the reuse table. That is, the point is how to cover the main memory addresses to be compared before executing B.

Bが参照する大域変数やAの局所変数のアドレスは、そもそもBにおいて生成されるアドレス定数や、大域変数/引数を起源とするポインタに基づいているものである。よって、まず引数が完全に一致する再利用表中のエントリを選択した後に、関連する主記憶アドレスをすべて参照して一致比較を行うことにより、Bが参照すべき主記憶アドレスを網羅することができる。そして、全ての入力が一致した場合にのみ、登録済の出力(返り値、大域変数、およびAの局所変数)を再利用することができる。   The address of the global variable referred to by B or the local variable of A is originally based on an address constant generated in B or a pointer originating from the global variable / argument. Therefore, first, by selecting an entry in the reuse table whose arguments completely match, by referring to all the related main memory addresses and performing a matching comparison, it is possible to cover the main memory addresses that B should refer to. it can. The registered output (return value, global variable, and A local variable) can be reused only when all the inputs match.

関数再利用を実現するために、再利用表として、関数管理表(RF)および入出力記録表(RB)を設けることにする。1つの関数を再利用するために必要なハードウェア構成を図12に示す。複数の関数を再利用可能とするには、この構成を複数組用意することになる。   In order to realize function reuse, a function management table (RF) and an input / output record table (RB) are provided as reuse tables. A hardware configuration necessary for reusing one function is shown in FIG. To make a plurality of functions reusable, a plurality of sets of this configuration are prepared.

この表において、RFおよびRBに保持されるVは、エントリが有効であるか否かを示すフラグであり、LRU(least recently used)は、エントリ入れ替えのヒントを示している。RFは、上記のVおよびLRUの他に、関数の先頭アドレス(Start)、および参照すべき主記憶アドレス(Read/Write)を保持する。RBは、上記のVおよびLRUの他に、関数呼び出し直前の%sp(SP)、引数(Args.)(V:有効エントリ、Val.:値)、主記憶値(Mask:Read/Writeアドレスの有効バイト、Value:値)、および、返り値(Return Values)(V:有効エントリ、Val.:値)を保持する。   In this table, V held in RF and RB is a flag indicating whether or not an entry is valid, and LRU (least recently used) indicates a hint for entry replacement. In addition to the above V and LRU, the RF holds the start address (Start) of the function and the main memory address (Read / Write) to be referred to. In addition to the above V and LRU, RB includes% sp (SP) immediately before the function call, argument (Args.) (V: valid entry, Val .: value), main memory value (Mask: Read / Write address) Holds valid byte, Value: value), and Return Values (V: valid entry, Val .: value).

返り値は、%i0〜1(リーフ関数では%o0〜1に読み替える)または%f0〜1に格納され、%f2〜3を使用する返り値(拡張倍精度浮動小数点数)は対象プログラムには存在しないものと仮定する。ReadアドレスはRFが一括管理し、MaskおよびValueはRBが管理することにより、Readアドレスの内容とRBの複数エントリをCAM(content-addressable memory)により一度に比較する構成を可能としている。   The return value is stored in% i0 to 1 (read as% o0 to 1 in the leaf function) or% f0 to 1, and the return value using% f2 to 3 (extended double precision floating point number) is not included in the target program. Assume that it does not exist. The read address is collectively managed by the RF, and the mask and value are managed by the RB, thereby enabling a configuration in which the contents of the read address and a plurality of entries of the RB are compared at once by a CAM (content-addressable memory).

単一の関数を再利用するには、まず、関数実行時に、局所変数を除外しながら、引数、返り値、大域変数および上位関数の局所変数に関する入出力情報を再利用表に登録していく。ここで、読み出しが先行した引数レジスタは関数の入出力として、また、返り値レジスタへの書き込みは関数の出力として登録する。その他のレジスタ参照は登録する必要がない。主記憶参照も同様に、読み出しが先行したアドレスについては入力、書き込みは出力として登録する。   To reuse a single function, first, input / output information related to arguments, return values, global variables, and local variables of higher-level functions is registered in the reuse table while excluding local variables when the function is executed. . Here, the argument register preceded by reading is registered as the input / output of the function, and the writing to the return value register is registered as the output of the function. Other register references do not need to be registered. Similarly, in the main memory reference, an address preceded by reading is registered as input and writing as output.

関数から復帰するまでに次の関数を呼び出した場合、または、登録すべき入出力が再利用表の容量を超える、引数の第7ワードを検出する、途中でシステムコールや割り込みが発生する、などの擾乱が発生しなかった場合、復帰命令を実行した時点で、登録中の入出力表エントリを有効にする。   When the next function is called before returning from the function, or the input / output to be registered exceeds the capacity of the reuse table, the seventh word of the argument is detected, a system call or interrupt occurs in the middle, etc. If no disturbance occurs, the registered I / O table entry is validated when the return instruction is executed.

以降、図12を参照しながら説明すると、関数を呼び出す前に、(1)関数先頭アドレスを検索し、(2)引数が完全に一致するエントリを選択し、(3)関連する主記憶アドレスすなわち少なくとも1つのMaskが有効であるReadアドレスをすべて参照して、(4)一致比較を行う。全ての入力が一致した場合に、(5)登録済の出力(返り値、大域変数、およびAの局所変数)を書き戻すことによって、関数の実行を省略することができる。
情報処理学会論文誌:ハイパフォーマンスコンピューティングシステム,HPS5,pp.1-12,Sep.(2002),"関数値再利用および並列事前実行による高速化技術"(中島康彦、緒方勝也、正西申悟、五島正裕、森眞一郎、北村俊明、富田眞治)(発行日2002年9月15日)
Hereinafter, with reference to FIG. 12, before calling a function, (1) a function head address is searched, (2) an entry whose arguments completely match is selected, and (3) an associated main memory address, that is, All read addresses for which at least one mask is valid are referred to, and (4) match comparison is performed. When all the inputs match, the execution of the function can be omitted by writing back the registered output (return value, global variable, and A local variable).
IPSJ Transactions: High Performance Computing System, HPS5, pp.1-12, Sep. (2002), "High-speed technology using function value reuse and parallel pre-execution" (Yasuhiko Nakajima, Katsuya Ogata, Shingo Masanishi) Masahiro Goto, Junichiro Mori, Toshiaki Kitamura, Junji Tomita) (issued on September 15, 2002)

上記の従来技術では、RBにおいて、各エントリにおける項目数(横の長さ)は固定となっている。よって、登録されている項目以外の項目を追加することはできないようになっている。また、逆に、使用しない項目に対応するメモリ領域は空き領域となるが、これを有効利用することはできない。   In the above prior art, in RB, the number of items (horizontal length) in each entry is fixed. Therefore, items other than the registered items cannot be added. On the other hand, the memory area corresponding to the item that is not used is an empty area, but this cannot be used effectively.

また、各エントリは、1つの項目でも内容が異なれば、それぞれ別のエントリとして登録する必要がある。よって、RBにおけるメモリの利用効率は良くないことになる。   Also, each entry must be registered as a separate entry if the contents of even one item are different. Therefore, the memory utilization efficiency in the RB is not good.

本発明は上記の問題点を解決するためになされたもので、その目的は、値再利用を行う際に用いられる命令区間記憶手段において、記憶内容の冗長性を低減することによってメモリ利用効率を向上させることが可能なデータ処理装置、データ処理プログラム、およびデータ処理プログラムを記録した記録媒体を提供することにある。   The present invention has been made to solve the above-described problems, and its purpose is to reduce memory redundancy by reducing the redundancy of stored contents in an instruction interval storage means used for value reuse. An object of the present invention is to provide a data processing apparatus, a data processing program, and a recording medium on which the data processing program is recorded.

本発明に係るデータ処理装置は、上記課題を解決するために、主記憶手段から命令区間を読み出し、演算処理を行った結果を主記憶手段に書き込む処理を行うデータ処理装置において、上記主記憶手段から読み出した命令区間に基づく演算を行う第1の演算手段と、上記第1の演算手段による上記主記憶手段に対する読み出しおよび書き込み時に用いられるレジスタと、複数の命令区間に関する入力パターンおよび出力パターンを記憶する命令区間記憶手段とを備え、上記第1の演算手段が、命令区間を実行する際に、該命令区間の入力パターンと、上記命令区間記憶手段に記憶されている入力パターンとが一致した場合、該入力パターンと対応して上記命令区間記憶手段に記憶されている出力パターンをレジスタおよび/または主記憶手段に出力する再利用処理を行い、上記命令区間記憶手段が、複数の上記入力パターンを、一致比較すべき項目をノードとみなした木構造として記憶する入力パターン記憶手段を備えていることを特徴としている。   In order to solve the above problems, the data processing apparatus according to the present invention is a data processing apparatus for performing a process of reading a command section from a main storage unit and writing a result of arithmetic processing into the main storage unit. Storing a first calculation means for performing an operation based on an instruction section read from a register, a register used when reading and writing to the main storage means by the first calculation means, and an input pattern and an output pattern for a plurality of instruction sections When the first calculation means executes the instruction section, the input pattern of the instruction section matches the input pattern stored in the instruction section storage means. The output pattern stored in the instruction section storage means corresponding to the input pattern is stored in a register and / or main storage means The command section storage means includes input pattern storage means for storing a plurality of input patterns as a tree structure in which items to be matched are regarded as nodes. .

また、本発明に係るデータ処理装置は、上記の構成において、上記入力パターン記憶手段が、上記入力パターンにおいて一致比較すべき項目の値と、次に比較すべき項目とを対応させて格納することによって、上記木構造を実現する構成としてもよい。   Further, in the data processing apparatus according to the present invention, in the above configuration, the input pattern storage means stores the value of the item to be compared and matched in the input pattern in correspondence with the item to be compared next. Therefore, the above tree structure may be realized.

また、本発明に係るデータ処理装置は、上記の構成において、上記入力パターン記憶手段が、連想検索手段と、付加記憶手段とを備え、上記連想検索手段が、一致比較すべき項目の値を格納する値格納領域と、該項目を識別するキーを格納するキー格納領域とを有する1つ以上の検索対象ラインを備え、上記付加記憶手段が、上記検索対象ラインに対応した対応ラインごとに、次に連想検索を行うべき項目を格納する検索項目指定領域を有している構成としてもよい。   In the data processing device according to the present invention, in the above configuration, the input pattern storage means includes an associative search means and an additional storage means, and the associative search means stores the values of items to be matched and compared. One or more search target lines each having a value storage area for storing the key for identifying the item, and the additional storage means performs the following for each corresponding line corresponding to the search target line: It is good also as a structure which has the search item designation | designated area | region which stores the item which should perform an associative search.

また、本発明に係るデータ処理装置は、上記の構成において、上記付加記憶手段が、上記対応ラインごとに、次に連想検索を行うべき項目がないことを示す終端フラグを格納する終端提示領域をさらに有している構成としてもよい。   In the data processing apparatus according to the present invention, in the above configuration, the additional storage unit includes a termination presentation area for storing a termination flag indicating that there is no item to be subjected to associative search next for each of the corresponding lines. Furthermore, it is good also as a structure which has.

また、本発明に係るデータ処理装置は、上記の構成において、上記付加記憶手段が、上記対応ラインごとに、上記検索項目指定領域で指定されている項目に関して、値の一致比較を行う必要があることを示す比較要フラグを格納する比較要提示領域をさらに有している構成としてもよい。   Further, in the data processing apparatus according to the present invention, in the above configuration, the additional storage means needs to perform a value comparison for the item designated in the search item designation area for each corresponding line. It may be configured to further include a comparison required presentation area for storing a comparison required flag indicating that.

また、本発明に係るデータ処理装置は、上記の構成において、上記付加記憶手段が、上記対応ラインごとに、次に値の一致比較を行うべき項目を示す比較要項目指定領域と、次に値の一致比較を行うべき項目を識別するキーを格納する比較要キー指定領域とをさらに有している構成としてもよい。   Further, in the data processing device according to the present invention, in the above configuration, the additional storage means includes a comparison required item designation area indicating an item to be subjected to a next value comparison for each corresponding line, and a value next. It may be configured to further include a comparison-required key designation area for storing a key for identifying an item to be compared.

また、本発明に係るデータ処理装置は、上記の構成において、上記付加記憶手段が、上記対応ラインごとに、直前に連想検索が行われた上記検索対象ラインを示す親ノード格納領域をさらに有している構成としてもよい。   In the data processing apparatus according to the present invention, in the above configuration, the additional storage unit further includes a parent node storage area indicating the search target line for which the associative search was performed immediately before for each corresponding line. It is good also as composition which has.

また、本発明に係るデータ処理装置は、上記課題を解決するために、主記憶手段から命令区間を読み出し、演算処理を行った結果を主記憶手段に書き込む処理を行うデータ処理装置において、上記主記憶手段から読み出した命令区間に基づく演算を行う第1の演算手段と、上記第1の演算手段による上記主記憶手段に対する読み出しおよび書き込み時に用いられるレジスタと、複数の命令区間に関する入力パターンおよび出力パターンを記憶する命令区間記憶手段とを備え、上記第1の演算手段が、命令区間を実行する際に、該命令区間の入力パターンと、上記命令区間記憶手段に記憶されている入力パターンとが一致した場合、該入力パターンと対応して上記命令区間記憶手段に記憶されている出力パターンをレジスタおよび/または主記憶手段に出力する再利用処理を行い、上記命令区間記憶手段が、上記各出力パターンを、出力すべき項目ごとに格納するとともに、出力すべき項目ごとに、次に出力すべき項目が格納されている位置を特定する情報が格納されている第1出力パターン記憶手段を備えていることを特徴としている。   In order to solve the above problems, the data processing apparatus according to the present invention is a data processing apparatus that performs processing for reading a command section from a main storage means and writing a result of arithmetic processing into the main storage means. A first arithmetic unit that performs an operation based on an instruction interval read from the storage unit; a register that is used when the first arithmetic unit reads from and writes to the main storage unit; and an input pattern and an output pattern that relate to a plurality of instruction intervals Instruction section storage means for storing the instruction section, and when the first calculation means executes the instruction section, the input pattern of the instruction section matches the input pattern stored in the instruction section storage means In this case, the output pattern stored in the instruction section storage means corresponding to the input pattern is stored in the register and / or main memory. The command section storage means stores each output pattern for each item to be output, and stores the next item to be output for each item to be output. A first output pattern storage means for storing information for specifying the position where the current position is stored.

また、本発明に係るデータ処理装置は、上記の構成において、上記命令区間記憶手段が、複数の上記入力パターンに1対1で対応して、上記出力パターンにおける出力すべき項目を格納する第2出力パターン記憶手段をさらに備えており、上記第1出力パターン記憶手段は、上記第2出力パターン記憶手段に格納し切れなかった項目を格納する構成としてもよい。   In the data processing device according to the present invention, in the above configuration, the command section storage unit stores the items to be output in the output pattern in a one-to-one correspondence with the plurality of input patterns. An output pattern storage unit may be further provided, and the first output pattern storage unit may store items that could not be stored in the second output pattern storage unit.

また、本発明に係るデータ処理装置は、上記の構成において、上記命令区間記憶手段が、上記各出力パターンを、出力すべき項目ごとに格納するとともに、出力すべき項目ごとに、次に出力すべき項目が格納されている位置を特定する情報が格納されている第1出力パターン記憶手段を備えている構成としてもよい。   In the data processing device according to the present invention, in the above configuration, the command section storage unit stores each output pattern for each item to be output, and outputs the next for each item to be output. It is good also as a structure provided with the 1st output pattern memory | storage means in which the information which specifies the position where the power item is stored is stored.

また、本発明に係るデータ処理装置は、上記の構成において、上記命令区間記憶手段が、複数の上記入力パターンに1対1で対応して、上記出力パターンにおける出力すべき項目を格納する第2出力パターン記憶手段をさらに備えており、上記第1出力パターン記憶手段は、上記第2出力パターン記憶手段に格納し切れなかった項目を格納する構成としてもよい。   In the data processing device according to the present invention, in the above configuration, the command section storage unit stores the items to be output in the output pattern in a one-to-one correspondence with the plurality of input patterns. An output pattern storage unit may be further provided, and the first output pattern storage unit may store items that could not be stored in the second output pattern storage unit.

また、本発明に係るデータ処理装置は、上記の構成において、上記入力パターンが、命令区間の先頭を特定するプログラムカウント値、該命令区間の実行時に上記レジスタに入力されるレジスタ入力値、および/または、該命令区間の実行時に上記主記憶手段に入力される主記憶入力値を上記項目として含んでおり、上記出力パターンが、上記命令区間の実行時に上記レジスタに出力されるレジスタ出力値、および/または、該命令区間の実行時に上記主記憶手段に出力される主記憶出力値を上記項目として含んでいる構成としてもよい。   In the data processing device according to the present invention, in the above configuration, the input pattern includes a program count value that specifies a head of an instruction interval, a register input value that is input to the register during execution of the instruction interval, and / or Or a main memory input value input to the main memory means when the instruction section is executed as the item, and the output pattern is a register output value output to the register when the instruction section is executed, and Alternatively, the main memory output value output to the main memory means during execution of the instruction section may be included as the item.

また、本発明に係るデータ処理装置は、上記の構成において、上記第1の演算手段が、命令区間を実行する際に、上記入力パターン記憶手段に記憶されている入力パターンにおける各項目の比較順序に従って、該命令区間の入力パターンの各項目を一致比較していき、一致しない項目が出現した時点で、再利用処理を行わずに演算処理を行うとともに、一致しない項目について、上記入力パターン記憶手段に登録し、演算処理結果としての出力パターンを命令区間記憶手段に登録する構成としてもよい。   In the data processing apparatus according to the present invention, in the above configuration, when the first arithmetic unit executes the instruction section, the comparison order of each item in the input pattern stored in the input pattern storage unit In accordance with the above, each item of the input pattern of the command section is matched and compared, and when an unmatched item appears, an arithmetic process is performed without performing a reuse process. And an output pattern as a result of the arithmetic processing may be registered in the instruction section storage means.

また、本発明に係るデータ処理装置は、上記の構成において、上記第1の演算手段が、上記レジスタまたは上記主記憶手段における値が変更されたことを検出した場合に、値が変更された項目が、上記入力パターン記憶手段に入力パターンの項目として記憶されているものであると、上記付加記憶手段において、該項目に関して、上記比較要フラグを比較要としてセットする構成としてもよい。   Further, in the data processing apparatus according to the present invention, in the above configuration, when the first arithmetic unit detects that the value in the register or the main storage unit is changed, the item whose value is changed However, if the item is stored as an input pattern item in the input pattern storage unit, the additional storage unit may set the comparison flag as a comparison item for the item.

また、本発明に係るデータ処理装置は、上記の構成において、少なくとも1つの第2の演算手段をさらに備え、上記第2の演算手段が、上記第1の演算手段によって処理が行われている命令区間に関して、今後入力が予想される予測入力値に基づいて該命令区間の演算を行い、その結果を上記命令区間記憶手段に対して登録する構成としてもよい。   Further, the data processing apparatus according to the present invention further includes at least one second calculation means in the above configuration, wherein the second calculation means is an instruction that is processed by the first calculation means. Regarding the section, the instruction section may be calculated based on a predicted input value expected to be input in the future, and the result may be registered in the instruction section storage means.

本発明に係るデータ処理装置は、以上のように、第1の演算手段が命令区間を実行する際に、該命令区間の入力パターンと、上記命令区間記憶手段に記憶されている入力パターンとが一致した場合、該入力パターンと対応して上記命令区間記憶手段に記憶されている出力パターンをレジスタおよび/または主記憶手段に出力する再利用処理を行う構成となっている。そして、命令区間記憶手段に、複数の入力パターンを、一致比較すべき項目をノードとみなした木構造として記憶する入力パターン記憶手段が備えられている構成となっている。よって、複数の入力パターンにおいて共通する項目については1つのノードとして記憶することが可能となるので、入力パターン記憶手段における記憶内容の冗長性を低減することが可能となる。したがって、命令区間記憶手段に必要とされる記憶容量を低減することができるので、データ処理装置自体のコストを低減することが可能となる。   As described above, the data processing apparatus according to the present invention, when the first arithmetic means executes an instruction interval, the input pattern of the instruction interval and the input pattern stored in the instruction interval storage means are When they match, the recycle processing is performed to output the output pattern stored in the instruction section storage means corresponding to the input pattern to the register and / or the main storage means. The instruction section storage means is provided with input pattern storage means for storing a plurality of input patterns as a tree structure in which items to be matched and compared are regarded as nodes. Therefore, items that are common in a plurality of input patterns can be stored as one node, so that the redundancy of the stored contents in the input pattern storage means can be reduced. Therefore, since the storage capacity required for the instruction section storage means can be reduced, the cost of the data processing apparatus itself can be reduced.

また、本発明に係るデータ処理装置は、以上のように、入力パターン記憶手段が、入力パターンにおいて一致比較すべき項目の値と、次に比較すべき項目とを対応させて格納してもよい。この場合、一致比較すべき項目に関して順に一致比較していくことが可能となるので、一致比較すべき項目をノードとみなした木構造として入力パターンを記憶することを実現することが可能となる。   In the data processing apparatus according to the present invention, as described above, the input pattern storage means may store the value of the item to be compared and matched with the next item to be compared in the input pattern. . In this case, since it is possible to sequentially match and compare items to be matched, it is possible to realize storing an input pattern as a tree structure in which the items to be matched and compared are regarded as nodes.

また、本発明に係るデータ処理装置は、以上のように、入力パターン記憶手段が、連想検索手段と、付加記憶手段とを備えた構成となっていてもよい。そして、連想検索手段が、値格納領域とキー格納領域とを有する1つ以上の検索対象ラインを備えるとともに、付加記憶手段が、検索項目指定領域を対応ラインごとに有している構成となっていてもよい。この場合、一致比較すべき項目の値が連想検索手段に入力されると、値とキーとが一致する検索対象ラインがシングルマッチし、シングルマッチした検索対象ラインに対応する付加記憶手段における対応ラインによって、次に連想検索を行うべき項目が確定するようになる。   In the data processing apparatus according to the present invention, as described above, the input pattern storage unit may include an associative search unit and an additional storage unit. The associative search means has one or more search target lines each having a value storage area and a key storage area, and the additional storage means has a search item designation area for each corresponding line. May be. In this case, when the value of the item to be matched and compared is input to the associative search means, the search target line whose value and key match is single matched, and the corresponding line in the additional storage means corresponding to the single match search target line Thus, the item to be subjected to the associative search next is determined.

ここで、各入力パターンは、一致比較すべき項目をノードとみなした木構造として記憶しているので、連想検索手段において、ある項目に関して一致する検索対象は、上記のように1つとなる(シングルマッチ)。シングルマッチ機構のみを有する連想検索メモリは一般的に市販されている一方、マルチマッチを、シングルマッチと同一性能によって報告可能な連想検索メモリは一般的には市販されていない。すなわち、上記の構成によれば、市販の連想検索メモリを連想検索手段として利用することができるので、より短期間かつ低コストで、本発明に係るデータ処理装置を実現することが可能となる。   Here, since each input pattern is stored as a tree structure in which items to be matched and compared are regarded as nodes, in the associative search means, there is one search target that matches for a certain item as described above (single Match). While an associative search memory having only a single match mechanism is generally marketed, an associative search memory that can report multimatches with the same performance as a single match is generally not commercially available. That is, according to the above configuration, since a commercially available associative search memory can be used as an associative search means, the data processing device according to the present invention can be realized in a shorter period of time and at a lower cost.

また、本発明に係るデータ処理装置は、以上のように、付加記憶手段が、対応ラインごとに、次に連想検索を行うべき項目がないことを示す終端フラグを格納する終端提示領域をさらに有している構成となっていてもよい。この場合、各入力パターンの項目の数は、終端フラグを設定することによって可変とすることができる。すなわち、入力パターンにおいて、一致比較すべき項目が多い場合にも少ない場合にも、柔軟に対応することが可能となる。また、入力パターンの項目の数が固定である場合には、一致比較すべき項目が少ない場合に、利用されないメモリ領域が無駄に存在することによってメモリの利用効率が悪くなるという問題があったが、上記の構成によれば、このような問題を解消することができる。   In addition, as described above, the data processing apparatus according to the present invention further includes a termination presentation area in which the additional storage unit stores a termination flag indicating that there is no item to be searched next for each corresponding line. It may be the composition which is doing. In this case, the number of items of each input pattern can be made variable by setting a termination flag. That is, in the input pattern, it is possible to flexibly cope with a case where there are many items to be compared and a few items. In addition, when the number of input pattern items is fixed, there is a problem in that when there are few items to be matched and compared, there is a waste of memory areas that are not used, resulting in poor memory use efficiency. According to the above configuration, such a problem can be solved.

また、本発明に係るデータ処理装置は、以上のように、付加記憶手段が、対応ラインごとに、上記検索項目指定領域で指定されている項目に関して、値の一致比較を行う必要があることを示す比較要フラグを格納する比較要提示領域をさらに有している構成となっていてもよい。この場合、比較要フラグが設定されている項目に関してのみ、値の一致比較を行えばよいことが明確となるので、必要以上に値の一致比較を行うことがなくなる。よって、処理効率を向上させることができる。   In addition, as described above, the data processing apparatus according to the present invention requires that the additional storage means perform value matching comparison for the items specified in the search item specification area for each corresponding line. It may be configured to further include a comparison required presentation area for storing a comparison required flag. In this case, it is clear that the value matching comparison should be performed only for the item for which the comparison required flag is set, so that the value matching comparison is not performed more than necessary. Therefore, processing efficiency can be improved.

また、本発明に係るデータ処理装置は、以上のように、付加記憶手段が、対応ラインごとに、比較要項目指定領域と、比較要キー指定領域とをさらに有している構成となっていてもよい。この場合、比較要項目指定領域において指定されている項目に関する値と、比較要キー指定領域において指定されているキーとを用いて、上記連想検索手段における連想検索を行うことが可能となる。   In the data processing device according to the present invention, as described above, the additional storage means further includes a comparison item specification area and a comparison key specification area for each corresponding line. Also good. In this case, it is possible to perform an associative search in the associative search means by using the value related to the item specified in the comparison required item specifying area and the key specified in the comparison required key specifying area.

ここで、これらの比較要項目指定領域および比較要キー指定領域が設けられていない場合、次のような問題が生じる。すなわち、対応ラインにおいて比較要フラグが設定されていない場合、連想検索手段において値の一致比較を行うことなく連想検索が行われ、この処理が比較要フラグが設定されている対応ラインまで繰り返されることになる。これに対して、上記のように、対応ラインごとに、比較要項目指定領域と、比較要キー指定領域とが設けられることによって、上記のような値の一致比較を行わない連想検索動作を行うことなしに、入力パターンの一致比較を行うことが可能となる。よって、処理速度を向上させることができる。   Here, when these comparison required item designation area and comparison required key designation area are not provided, the following problem occurs. That is, when the comparison required flag is not set in the corresponding line, the associative search is performed without performing a value match comparison in the associative search means, and this process is repeated until the corresponding line for which the comparison required flag is set. become. On the other hand, as described above, an associative search operation that does not perform a coincidence comparison of values as described above is performed by providing a comparison required item specifying area and a comparison required key specifying area for each corresponding line. Without this, it is possible to perform matching comparison of input patterns. Therefore, the processing speed can be improved.

また、本発明に係るデータ処理装置は、以上のように、付加記憶手段が、上記対応ラインごとに、直前に連想検索が行われた上記検索対象ラインを示す親ノード格納領域をさらに有している構成となっていてもよい。この場合、ある入力パターンにおける項目に関して、例えばレジスタや主記憶手段における値に変更があったなどの理由によって、値の一致比較を行う必要がない状態から、値の一致比較を行う必要がある状態に変更した場合に、親ノードに対応する対応ラインにおける比較要項目指定領域および比較要キー指定領域に、該当項目および該当キーを登録する処理を行うことが可能となる。   In the data processing apparatus according to the present invention, as described above, the additional storage means further includes a parent node storage area indicating the search target line for which the associative search was performed immediately before for each corresponding line. It may be the composition which is. In this case, for an item in a certain input pattern, for example, a value match comparison is not necessary because of a change in a value in a register or main storage means. In this case, it is possible to perform processing for registering the corresponding item and the corresponding key in the comparison required item specifying area and the comparison required key specifying area in the corresponding line corresponding to the parent node.

また、本発明に係るデータ処理装置は、以上のように、命令区間記憶手段が、出力すべき項目ごとに、次に出力すべき項目が格納されている位置を特定する情報が格納されている第1出力パターン記憶手段を備えている構成となっていてもよい。この場合、出力すべき項目を、第1出力パターン記憶手段の任意の位置に記憶していくことが可能となる。よって、出力パターンの各項目を例えば1つのラインに対応させて格納させる構成と比較して、メモリ利用効率を向上させることができる。   In addition, as described above, the data processing device according to the present invention stores, for each item to be output, information specifying the position where the item to be output next is stored for each item to be output. The first output pattern storage unit may be provided. In this case, items to be output can be stored at arbitrary positions in the first output pattern storage means. Therefore, the memory utilization efficiency can be improved as compared with a configuration in which each item of the output pattern is stored in association with, for example, one line.

また、本発明に係るデータ処理装置は、以上のように、命令区間記憶手段が、複数の上記入力パターンに1対1で対応して、上記出力パターンにおける出力すべき項目を格納する第2出力パターン記憶手段をさらに備えており、この第1出力パターン記憶手段は、上記第2出力パターン記憶手段に格納し切れなかった項目を格納する構成となっていてもよい。この場合、出力パターンの項目が少ない場合には第2出力パターン記憶手段のみの利用により処理の高速性を実現するとともに、出力パターンの項目が多い場合には、項目の数を可変とすることが可能な第1出力パターン記憶手段を用いることによって対応している。よって、上記の構成によれば、処理の高速性とメモリ利用効率の向上とを実現することができる。   In the data processing device according to the present invention, as described above, the command section storage means stores the items to be output in the output pattern in one-to-one correspondence with the plurality of input patterns. Pattern storage means is further provided, and the first output pattern storage means may be configured to store items that could not be stored in the second output pattern storage means. In this case, when the number of output pattern items is small, the high-speed processing is realized by using only the second output pattern storage means, and when the number of output pattern items is large, the number of items can be made variable. This is dealt with by using possible first output pattern storage means. Therefore, according to the above configuration, it is possible to realize high-speed processing and improvement in memory utilization efficiency.

また、本発明に係るデータ処理装置は、以上のように、命令区間の先頭を特定するプログラムカウント値、該命令区間の実行時に上記レジスタに入力されるレジスタ入力値、および/または、該命令区間の実行時に上記主記憶手段に入力される主記憶入力値を上記項目として含んでおり、上記出力パターンが、上記命令区間の実行時に上記レジスタに出力されるレジスタ出力値、および/または、該命令区間の実行時に上記主記憶手段に出力される主記憶出力値を上記項目として含んでいる構成としてもよい。この場合、命令区間が関数である場合にもループである場合にも、的確に再利用処理を行うことが可能となる。   In addition, as described above, the data processing apparatus according to the present invention includes a program count value that identifies the beginning of an instruction interval, a register input value that is input to the register when the instruction interval is executed, and / or the instruction interval. The main memory input value that is input to the main memory means at the time of execution is included as the item, and the output pattern is a register output value that is output to the register at the time of execution of the instruction interval, and / or the instruction The main memory output value output to the main memory means at the time of execution of the section may be included as the item. In this case, it is possible to accurately perform the reuse process regardless of whether the instruction section is a function or a loop.

また、本発明に係るデータ処理装置は、以上のように、第1の演算手段が、命令区間を実行する際に、上記入力パターン記憶手段に記憶されている入力パターンにおける各項目の比較順序に従って、該命令区間の入力パターンの各項目を一致比較していき、一致しない項目が出現した時点で、再利用処理を行わずに演算処理を行うとともに、一致しない項目について、上記入力パターン記憶手段に登録し、演算処理結果としての出力パターンを命令区間記憶手段に登録する構成となっていてもよい。この場合、入力パターンを入力パターン記憶手段に登録する際に、すでに登録されている項目と異なる項目が出現した時点からの入力パターンの項目が登録されていくことになる。よって、入力パターンを、一致比較すべき項目をノードとみなした木構造として記憶させることが可能となる。   In addition, as described above, the data processing apparatus according to the present invention follows the comparison order of each item in the input pattern stored in the input pattern storage unit when the first calculation unit executes the instruction section. The items of the input pattern in the command section are compared and compared, and when an unmatched item appears, the calculation process is performed without performing the reuse process, and the unmatched item is stored in the input pattern storage means. It may be configured to register and register an output pattern as a calculation processing result in the instruction section storage means. In this case, when the input pattern is registered in the input pattern storage means, the input pattern items from the time when an item different from the already registered items appears are registered. Therefore, the input pattern can be stored as a tree structure in which items to be matched and compared are regarded as nodes.

また、本発明に係るデータ処理装置は、以上のように、第1の演算手段が、上記レジスタまたは上記主記憶手段における値が変更されたことを検出した場合に、値が変更された項目が、上記入力パターン記憶手段に入力パターンの項目として記憶されているものであると、上記付加記憶手段において、該項目に関して、上記比較要フラグを比較要としてセットする構成となっていてもよい。   In addition, as described above, when the first arithmetic unit detects that the value in the register or the main storage unit has been changed, the data processing device according to the present invention displays the item whose value has been changed. If the input pattern is stored as an input pattern item in the input pattern storage means, the additional storage means may be configured to set the comparison required flag as a comparison required for the item.

ここで、入力パターン記憶手段に登録されている項目の値に変更が行われた場合には、入力パターン記憶手段に登録されている値と、実際に該当項目に記憶されている値とが異なる状態となる。このような状態となった場合には、該当項目の比較を行わないで命令区間の再利用を行うと、誤った演算結果を出力してしまうおそれがある。これに対して上記の構成によれば、上記のような状態となった際には、該当項目に対応する比較要フラグが比較要としてセットされることになる。よって、入力パターンの各項目の一致比較を必要時にのみ的確に行うことが可能となる。   Here, when the value of the item registered in the input pattern storage unit is changed, the value registered in the input pattern storage unit is different from the value actually stored in the corresponding item. It becomes a state. In such a state, if the instruction section is reused without comparing the corresponding items, an erroneous calculation result may be output. On the other hand, according to the above configuration, when the above state is reached, the comparison required flag corresponding to the corresponding item is set as a comparison required. Therefore, it is possible to accurately perform matching comparison of each item of the input pattern only when necessary.

また、本発明に係るデータ処理装置は、以上のように、第2の演算手段が、上記第1の演算手段によって処理が行われている命令区間に関して、今後入力が予想される予測入力値に基づいて該命令区間の演算を行い、その結果を上記命令区間記憶手段に対して登録する構成となっていてもよい。この場合、第2の演算手段によって、その時点で第1の演算手段によって処理が行われている命令区間に関して、予測入力値に基づく演算が行われ、その結果が命令区間記憶手段に記憶されることになる。よって、次に、同じ命令区間が出現し、予測入力値と同じ入力が行われた場合には、命令区間記憶手段に記憶されている値を再利用することが可能となる。例えば、入力値が単調に変化するような命令区間の場合には、予測入力値が的中する可能性が高いので、上記の構成による効果は高くなる。   In the data processing apparatus according to the present invention, as described above, the second calculation means sets the predicted input value that is expected to be input in the future with respect to the instruction section being processed by the first calculation means. On the basis of the calculation of the instruction section, the result may be registered in the instruction section storage means. In this case, the second arithmetic unit performs an operation based on the predicted input value for the instruction interval currently being processed by the first arithmetic unit, and the result is stored in the instruction interval storage unit. It will be. Therefore, next, when the same command section appears and the same input as the predicted input value is made, the value stored in the command section storage means can be reused. For example, in the case of an instruction interval in which the input value changes monotonously, the predicted input value is likely to be correct, so the effect of the above configuration is high.

本発明の実施の一形態について図1ないし図9に基づいて説明すれば、以下のとおりである。   An embodiment of the present invention will be described below with reference to FIGS.

(データ処理装置の構成)
本実施形態に係るデータ処理装置の概略構成を図2示す。同図に示すように、該データ処理装置は、MSP(Main Stream Processor)1A、SSP(Shadow Stream Processor)1B、再利用表としての命令区間記憶部(命令区間記憶手段)2、および主記憶(主記憶手段)3を備えた構成となっており、主記憶3に記憶されているプログラムデータなどを読み出して各種演算処理を行い、演算結果を主記憶3に書き込む処理を行うものである。なお、同図に示す構成では、SSP1Bを1つ備えた構成となっているが、2つ以上備えた構成となっていてもよい。また、同図に示す構成では、SSP1Bを備えた構成となっているが、SSP1Bを備えていない構成としてもかまわない。SSP1Bを備えた場合の作用・効果については、後述する。
(Configuration of data processing device)
FIG. 2 shows a schematic configuration of the data processing apparatus according to the present embodiment. As shown in the figure, the data processing apparatus includes an MSP (Main Stream Processor) 1A, an SSP (Shadow Stream Processor) 1B, an instruction interval storage unit (instruction interval storage means) 2 as a reuse table, and a main memory ( Main storage means) 3 is provided, which reads out program data and the like stored in the main memory 3, performs various arithmetic processes, and performs a process of writing the arithmetic results into the main memory 3. In the configuration shown in the figure, the configuration includes one SSP 1B, but the configuration may include two or more. Moreover, although the configuration shown in FIG. 6 is provided with the SSP 1B, it may be configured without the SSP 1B. Operations and effects when the SSP 1B is provided will be described later.

命令区間記憶部2は、プログラムにおける関数やループなどの命令区間を再利用するためのデータを格納するメモリ手段である。この命令区間記憶部2の詳細については後述する。   The instruction section storage unit 2 is memory means for storing data for reusing instruction sections such as functions and loops in a program. Details of the command section storage unit 2 will be described later.

主記憶3は、MSP1AおよびSSP1Bの作業領域としてのメモリであり、例えばRAM(Random Access Memory)などによって構成されるものである。例えばハードディスクなどの外部記憶手段や、外部のI/O(input/output)装置などの外部装置からプログラムやデータなどが主記憶3に読み出され、MSP1AおよびSSP1Bは、主記憶3に読み出されたデータに基づいて演算を行うことになる。また、MSP1Aによる演算結果が主記憶3に書き込まれ、この演算結果が上記外部装置に送出されることになる。   The main memory 3 is a memory as a work area of the MSP 1A and the SSP 1B, and is constituted by, for example, a RAM (Random Access Memory). For example, programs and data are read to the main memory 3 from an external storage means such as a hard disk or an external device such as an external input / output (I / O) device, and the MSP 1A and SSP 1B are read to the main memory 3. The calculation is performed based on the obtained data. Also, the calculation result by the MSP 1A is written in the main memory 3, and the calculation result is sent to the external device.

MSP1Aは、再利用記憶手段としてのRW(第1の演算手段)4A、演算器(第1の演算手段)5A、レジスタ6A、およびCache7Aを備えた構成となっている。また、SSP1Bは、同様に、再利用記憶手段としてのRW(第2の演算手段)4B、演算器(第2の演算手段)5B、レジスタ6B、およびCache/Local7Bを備えた構成となっている。   The MSP 1A includes a RW (first arithmetic means) 4A, a computing unit (first arithmetic means) 5A, a register 6A, and a Cache 7A as reuse storage means. Similarly, the SSP 1B includes an RW (second arithmetic unit) 4B, a calculator (second arithmetic unit) 5B, a register 6B, and a Cache / Local 7B as reuse storage units. .

RW4A・4Bは、再利用ウィンドウであり、現在実行中かつ登録中であるRF(付加記憶手段)およびRB(連想検索手段)(後述する)の各ラインをリング構造のスタックとして保持するものである。このRW4A・4Bは、実際のハードウェア構造としては、命令区間記憶部2における特定のラインをアクティブにする制御線の集合によって構成される。   RW4A and 4B are reuse windows, and hold each line of RF (additional storage means) and RB (associative search means) (to be described later) currently being executed and registered as a ring structure stack. . The actual hardware structure of the RWs 4A and 4B includes a set of control lines that activate a specific line in the instruction section storage unit 2.

演算器5A・5Bは、レジスタ6A・6Bに保持されているデータに基づいて演算処理を行うものであり、ALU(arithmetic and logical unit)と呼ばれるものである。レジスタ6A・6Bは、演算器5A・5Bによって演算を行うためのデータを保持する記憶手段である。なお、本実施形態では、演算器5A・5B、およびレジスタ6A・6Bは、SPARCアーキテクチャに準じたものとする。Cache7A・7Bは、主記憶3と、MSP1AおよびSSP1Bとの間でのキャッシュメモリとして機能するものである。なお、SSP1Bでは、Cache7Bには、局所メモリとしてのLocal7Bが含まれているものとする。   The arithmetic units 5A and 5B perform arithmetic processing based on the data held in the registers 6A and 6B, and are called ALUs (arithmetic and logical units). The registers 6A and 6B are storage means for holding data for performing calculations by the calculators 5A and 5B. In this embodiment, it is assumed that the arithmetic units 5A and 5B and the registers 6A and 6B conform to the SPARC architecture. The Caches 7A and 7B function as cache memories between the main memory 3 and the MSP 1A and SSP 1B. In SSP1B, Cache7B includes Local7B as a local memory.

(命令区間記憶部の構成)
図1は、本実施形態における命令区間記憶部2によって実現される再利用表を示している。同図に示すように、命令区間記憶部2は、RB、RF、RO1(第2出力パターン記憶手段)、およびRO2(第1出力パターン記憶手段)を備えた構成となっている。
(Configuration of instruction section storage)
FIG. 1 shows a reuse table realized by the instruction interval storage unit 2 in the present embodiment. As shown in the figure, the instruction interval storage unit 2 includes RB, RF, RO1 (second output pattern storage means), and RO2 (first output pattern storage means).

RBは、比較すべき値であるレジスタ値または主記憶入力値を格納するValue(値格納領域)、およびキー番号を格納するKey(キー格納領域)を備えており、ValueおよびKeyの組み合わせのラインを複数備えている。   The RB includes a value (value storage area) for storing a register value or a main memory input value, which is a value to be compared, and a key (key storage area) for storing a key number. There are multiple.

RFは、次に比較すべきレジスタ番号または主記憶アドレスがないことを示す終端フラグE、次に比較すべきレジスタ番号または主記憶アドレスの内容が更新されたことを示す比較要フラグ、次に比較すべき対象がレジスタか主記憶かを示すR/M、次に比較すべきレジスタ番号または主記憶アドレスを示すAdr.(検索項目指定領域)、直前に参照したライン番号を示すUP(親ノード格納領域)、次に比較すべきレジスタ番号または主記憶アドレスよりも優先して比較すべきレジスタ番号または主記憶アドレスを示すAlt.(比較要項目指定領域)、および、優先して比較する際に必要なキーを示すDN(比較要キー指定領域)を備えており、これらはRBにおける各ラインに対応して設けられている。   RF is an end flag E indicating that there is no register number or main memory address to be compared next, a comparison required flag indicating that the contents of the register number or main memory address to be compared next is updated, and then comparing R / M indicating whether the object to be registered is a register or main memory, Adr. (Search item designation area) indicating the register number or main memory address to be compared next, UP indicating the line number referenced immediately before (stored in parent node) Area), Alt. (Comparison item specification area) indicating the register number or main memory address to be compared with priority over the register number or main memory address to be compared next, and necessary for priority comparison DN (comparison key designation area) indicating a correct key is provided corresponding to each line in the RB.

RO1およびRO2は、RBおよびRFによる検索結果により、再利用が可能であると判定された場合に、主記憶および/またはレジスタに出力する出力値を格納するものである。RO1は、RFの各ラインに1対1で対応して出力値および出力すべきアドレスを格納している。RO2は、RO1のみでは出力値を格納しきれない場合に、格納しきれない分の出力値および出力すべきアドレスを格納している。RO2からも出力値を読み出す必要がある場合には、RO1における該当ラインに、RO2における出力値が格納されているポインタが示されており、このポインタを用いてRO2から出力値の読み出しが行われる。   RO1 and RO2 store an output value to be output to the main memory and / or a register when it is determined that reuse is possible based on the search results by RB and RF. RO1 stores an output value and an address to be output in one-to-one correspondence with each line of RF. RO2 stores output values and addresses to be output when the output values cannot be stored by RO1 alone. When it is necessary to read the output value from RO2, a pointer storing the output value at RO2 is shown in the corresponding line at RO1, and the output value is read from RO2 using this pointer. .

また、RBおよびRFは、それぞれCAM(content-addressable memory)およびRAM(Random Access Memory)によって構成されている。一般的に、アドレスが与えられると、そのアドレスに格納された値を参照することができるメモリは、RAMと呼ばれるメモリである。一方、上記のCAMとは、連想メモリと呼ばれるメモリであり、検索すべき内容が与えられると、その内容に一致するラインが選択されるようになっている。通常は、CAMはRAMとセットにして用いられる。   Further, the RB and the RF are configured by a CAM (content-addressable memory) and a RAM (Random Access Memory), respectively. Generally, when an address is given, a memory that can refer to a value stored at the address is a memory called a RAM. On the other hand, the CAM is a memory called an associative memory, and when a content to be searched is given, a line that matches the content is selected. Normally, CAM is used as a set with RAM.

ここで、CAMとRAMとの連携動作について、具体例を挙げて説明する。CAMに、「5,5,5,5,5」、「1,3,1,1,1」、「1,3,3,5,2」、「6,6,6,6,6」というデータ列がエントリとして登録されており、RAMに、CAMにおける各データ列に対応して、「5,5」、「1,1」、「1,2」、「6,6」というデータが登録されているとする。ここで、検索すべきデータ列として、「1,3,3,5,2」をCAMに入力すると、一致するエントリがONとなり、RAMに登録されている該当するデータ「1,2」が出力されることになる。この具体例と同様の構成および動作によって、上記RBおよびRFが実現されることになる。   Here, the cooperative operation between the CAM and the RAM will be described with a specific example. "5, 5, 5, 5, 5", "1, 3, 1, 1, 1", "1, 3, 3, 5, 2", "6, 6, 6, 6, 6" The data strings “5, 5”, “1, 1”, “1, 2”, “6, 6” are stored in the RAM corresponding to the data strings in the CAM. Suppose that it is registered. Here, when “1, 3, 3, 5, 2” is input to the CAM as the data string to be searched, the matching entry is turned ON, and the corresponding data “1, 2” registered in the RAM is output. Will be. The above RB and RF are realized by the same configuration and operation as this specific example.

(比較例)
ここで、比較例として、図8に示すような構成のRFおよびRBによる動作について説明する。同図に示すように、RFは、エントリが有効であるか否かを示す状態表示フラグV、エントリ入れ替えのヒントを示すLRU、関数とループとを区別するF/L、命令区間の先頭アドレスを示すStart、命令区間の終了アドレスを示すEnd、参照すべき主記憶入力アドレスに関する情報を示すRead、および、参照すべき主記憶出力アドレスに関する情報を示すWriteを保持している。
(Comparative example)
Here, as a comparative example, the operation by the RF and RB having the configuration shown in FIG. 8 will be described. As shown in the figure, RF indicates a status display flag V indicating whether or not an entry is valid, an LRU indicating an entry replacement hint, an F / L for distinguishing a function from a loop, and a head address of an instruction section. And Start indicating the end address of the instruction section, Read indicating information related to the main memory input address to be referred to, and Write indicating information related to the main memory output address to be referred to.

また、RBは、エントリが有効であるか否かを示す状態表示フラグV、エントリ入れ替えのヒントを示すLRU、命令区間を呼び出す際の直前のスタックポイント%spを示すSP、ループの終了アドレス(End)、ループ終了時の分岐方向を示すtaken/not、レジスタ入力値としての引数(Args.)(V:有効エントリ、Val.:値)および引数以外のレジスタ入力値および条件コード(Regs.,CC)、主記憶入力有効バイトMask、主記憶入力値Value、主記憶出力有効バイトMask、主記憶出力値Value、および、レジスタ出力値としての返り値Return Valuesおよび返り値以外のレジスタ出力値および条件コードRegs.,CC(V:有効エントリ、Val.:値)を保持している。   RB is a status display flag V indicating whether the entry is valid, an LRU indicating an entry replacement hint, an SP indicating the stack point% sp immediately before calling the instruction section, an end address of the loop (End ), Taken / not indicating the branch direction at the end of the loop, argument (Args.) (V: valid entry, Val .: value) as register input value, and register input value and condition code other than argument (Regs., CC) ), Main memory input valid byte Mask, Main memory input value Value, Main memory output valid byte Mask, Main memory output value Value, Return value Return value as register output value, and register output value and condition code other than return value Regs., CC (V: Valid entry, Val .: Value) are held.

関数またはループを実行する際に、以前に実行した命令区間が再利用可能であるか否かを判断する際には、次の手順で行われる。まず、(1)RFに登録されている関数またはループのエントリの先頭アドレスStartに、該当関数またはループの先頭アドレスと一致するものがあるかを検索する。一致するものがある場合には、(2)RBに登録されている該当エントリのうち、有効エントリを示す状態表示フラグVが登録済状態にセットされているエントリであって、かつ、該エントリにおける引数args.およびRegs.,CCが、呼び出す関数またはループの対応する値と完全に一致するエントリを1つまたは複数選択する。そして、選択したエントリにおいて、(3)関連する主記憶アドレス、すなわち、少なくとも1つのMaskが有効であるReadアドレスを用いて主記憶を順に参照し、(4)該当関数またはループの主記憶入力値と、RBに登録されている主記憶入力値との比較を行う。そして、全ての入力が一致する場合に、(5)RBに記憶されているReturn Valuesをレジスタに書き込み、主記憶出力アドレスに対して、順次、各有効フラグMaskがセットされている主記憶出力値Valueを書き込む。以上により、関数またはループの再利用が実現されることになる。   When a function or loop is executed, it is determined in the following procedure when it is determined whether or not a previously executed instruction section can be reused. First, (1) a search is made as to whether a start address Start of a function or loop entry registered in RF matches the start address of the corresponding function or loop. If there is a match, (2) among the corresponding entries registered in the RB, an entry whose status display flag V indicating a valid entry is set to the registered state, and in the entry Selects one or more entries whose arguments args. And Regs., CC exactly match the corresponding value of the function or loop to call. In the selected entry, (3) the main memory is sequentially referred to using the relevant main memory address, that is, the read address where at least one mask is valid, and (4) the main memory input value of the corresponding function or loop. And the main memory input value registered in the RB. When all inputs match, (5) Return Values stored in the RB are written to the register, and the main memory output value in which each valid flag Mask is sequentially set for the main memory output address. Write Value. As described above, the reuse of the function or loop is realized.

以上のような比較例における動作を、図9を参照しながらより具体的に説明する。まず、プログラムカウンタ(PC)と、RFに登録された命令区間先頭アドレス(Region)とが比較され、さらに、レジスタの内容(Reg.)と、RBに登録されているレジスタ入力値(Args.、Regs.,CC)とを比較する。この時点で、RBにおけるエントリ01〜04のうち、エントリ03およびエントリ04が一致すると判定されたとする。すなわち、この時点では、マルチマッチとなっている。   The operation in the comparative example as described above will be described more specifically with reference to FIG. First, the program counter (PC) and the instruction section start address (Region) registered in the RF are compared, and the register contents (Reg.) And the register input values (Args.,. Regs., CC). At this time, it is assumed that entry 03 and entry 04 are determined to match among entries 01 to 04 in RB. That is, at this point, it is a multi-match.

次に、主記憶アドレスA1に関して比較することになるが、主記憶アドレスA1に対しては、RFにおいて、一致比較を行う必要がないことを示すフラグ(0)が示されているので、一致比較は行われない。すなわち、エントリ03およびエントリ04が候補として残ったままとなる。   Next, comparison is made with respect to the main memory address A1, but for the main memory address A1, a flag (0) indicating that it is not necessary to perform a coincidence comparison is shown in RF. Is not done. That is, entry 03 and entry 04 remain as candidates.

次に、主記憶アドレスA2に関して比較が行われる。ここで、RFにおいて、主記憶アドレスA2に関しては一致比較を行う必要があることを示すフラグ(1)が示されているので、一致比較が行われる。この結果、内容が「00」であるエントリ03のみが候補として残ることになる。その後、一致比較を行う項目として主記憶アドレスA3およびA4があるが、これらはどちらも一致比較を行う必要がないことを示すフラグが示されているので、エントリ03は、比較が必要な全ての項目が一致したことになる。よって、エントリ03に対応する出力値としての主記憶出力値およびレジスタ出力値が主記憶およびレジスタに出力される。   Next, a comparison is made with respect to the main memory address A2. Here, in the RF, the flag (1) indicating that it is necessary to perform a coincidence comparison with respect to the main memory address A2 is shown, so the coincidence comparison is performed. As a result, only the entry 03 whose content is “00” remains as a candidate. Thereafter, there are main memory addresses A3 and A4 as items to be subjected to coincidence comparison. However, since both of them indicate a flag indicating that it is not necessary to perform coincidence comparison, entry 03 includes all of the items requiring comparison. The item matches. Therefore, the main memory output value and the register output value as the output values corresponding to the entry 03 are output to the main memory and the register.

この比較例における動作のポイントは次の通りである。(a)RBに登録されている各値と再利用対象となっている関数またはループにおける対応する値とを比較する際に、RBにおける縦の列を順に一致確認していくことになるが、内容が一致するエントリが複数存在する(マルチマッチ)ことを許容している。(b)検索途中においてマルチマッチを許容しているが、最終的に1つのエントリが選択されればよい。(c)RBにおける列を一致確認していく順番は任意であるので、例えばレジスタ入力値を最初にまとめて比較する、ということを行うことが可能である。   The points of operation in this comparative example are as follows. (A) When comparing each value registered in the RB with the corresponding value in the function or loop to be reused, the vertical columns in the RB are sequentially checked for coincidence. It is allowed that multiple entries with the same content exist (multi-match). (B) Although multi-matching is permitted during the search, one entry may be finally selected. (C) Since the order in which the columns in the RBs are checked for coincidence is arbitrary, it is possible to compare, for example, register input values together first.

また、この比較例の場合、次のような問題がある。(d)RBにおいて、各エントリにおける項目数(横の長さ)は固定となっている。よって、登録されている項目以外の項目を追加することはできないようになっている。また、逆に、使用しない項目に対応するメモリ領域は空き領域となるが、これを有効利用することはできない。(e)各エントリは、1つの項目でも内容が異なれば、それぞれ別のエントリとして登録する必要がある。よって、RBにおけるメモリの利用効率は良くないことになる。   In addition, this comparative example has the following problems. (D) In RB, the number of items (horizontal length) in each entry is fixed. Therefore, items other than the registered items cannot be added. On the other hand, the memory area corresponding to the item that is not used is an empty area, but this cannot be used effectively. (E) Each entry must be registered as a separate entry if the contents of one item are different. Therefore, the memory utilization efficiency in the RB is not good.

なお、以上のような比較例の場合、RFおよびRBを構成するメモリとしては、構造が横長のものとなる。例えばこのメモリ容量を2Mbyteとした場合、横が2Kword、縦を256エントリとすることになる。   In the case of the comparative example as described above, the memory constituting the RF and RB has a horizontally long structure. For example, if this memory capacity is 2 Mbytes, the horizontal width is 2 Kwords and the vertical length is 256 entries.

(本実施形態における連想検索動作)
次に、本実施形態における命令区間記憶部2における連想検索動作について説明する。上記の比較例では、RBにおける各エントリとしての横の行は、一致比較を行うべき入力値の項目を全て含んだものとなっている。すなわち、全ての入力パターンをそれぞれ1つのエントリとしてRBに登録するようになっている。
(Associative search operation in this embodiment)
Next, an associative search operation in the instruction interval storage unit 2 in the present embodiment will be described. In the above comparative example, the horizontal row as each entry in the RB includes all items of input values to be subjected to matching comparison. That is, all input patterns are registered in the RB as one entry.

これに対して、本実施形態では、一致比較を行うべき入力値の項目を短い単位に区切り、それぞれの比較単位をノードとしてとらえ、入力パターンを木構造としてRFおよびRBに登録するようになっている。そして、再利用を行う際には、一致するノードを順次選択することによって、最終的に再利用可能かを判断するようになっている。別の言い方をすれば、複数の入力パターンに共通する部分を1つにまとめて、RFおよびRBの1行に対応づけるようになっている。   On the other hand, in this embodiment, items of input values to be subjected to matching comparison are divided into short units, each comparison unit is regarded as a node, and an input pattern is registered in RF and RB as a tree structure. Yes. Then, when reusing, by sequentially selecting matching nodes, it is determined whether or not reusable is finally possible. In other words, portions common to a plurality of input patterns are combined into one and associated with one line of RF and RB.

これにより、冗長性をなくし、命令区間記憶部2を構成するメモリの利用効率を向上させることが可能となる。また、入力パターンを木構造としているので、1つの入力パターンをRBにおける1つの行としてのエントリに対応付ける必要がないことになる。よって、一致比較を行うべき入力値の項目の数を可変にすることが可能となっている。   As a result, redundancy can be eliminated and the utilization efficiency of the memory constituting the instruction section storage unit 2 can be improved. Also, since the input pattern has a tree structure, it is not necessary to associate one input pattern with an entry as one row in the RB. Therefore, it is possible to vary the number of input value items to be subjected to coincidence comparison.

また、RFおよびRBは、入力パターンを木構造として登録しているので、一致比較を行う際には、マルチマッチが行われないことになる。つまり、命令区間記憶部2としては、シングルマッチ機構を有する連想検索メモリであれば実現可能となる。ここで、シングルマッチ機構のみを有する連想検索メモリは一般的に市販されている一方、マルチマッチをシングルマッチと同一性能によって報告可能な連想検索メモリは一般的には市販されていない。すなわち、本実施形態における命令区間記憶部2によれば、市販の連想検索メモリを利用することができるので、より短期間かつ低コストで、本実施形態に係るデータ処理装置を実現することが可能となる。   Also, since RF and RB register their input patterns as a tree structure, multimatching is not performed when matching comparison is performed. That is, the instruction interval storage unit 2 can be realized as long as it is an associative search memory having a single match mechanism. Here, while an associative search memory having only a single match mechanism is generally marketed, an associative search memory capable of reporting multimatches with the same performance as a single match is not generally marketed. That is, according to the instruction section storage unit 2 in the present embodiment, a commercially available associative search memory can be used, so that the data processing apparatus according to the present embodiment can be realized in a shorter period of time and at a lower cost. It becomes.

次に、図3を参照しながら、本実施形態における命令区間記憶部2における連想検索動作の具体例について説明する。まず、命令区間の実行が検出されると、プログラムカウンタ(PC)およびレジスタの内容(Reg.)がRBに入力される。そして、RBにおいて、連想検索により、入力されたこれらの値と、RBのValueの列に登録されている命令区間先頭アドレスおよびレジスタ値とが比較され、値が一致する唯一の行(ライン)が候補(マッチライン)として選択される。この例では、RBにおける「01」のラインがマッチラインとして選択される。   Next, a specific example of the associative search operation in the instruction interval storage unit 2 in the present embodiment will be described with reference to FIG. First, when execution of an instruction interval is detected, a program counter (PC) and register contents (Reg.) Are input to the RB. Then, in the RB, these values inputted by the associative search are compared with the instruction section start address and the register value registered in the Value column of the RB, and the only line (line) in which the values match is found. Selected as a candidate (match line). In this example, the “01” line in the RB is selected as the match line.

次に、マッチラインとして選択されたラインのRBにおける番地である「01」が、エンコード結果としてRFに伝達され、キー01に対応するRFにおけるラインが参照される。キー01に対応するRFにおけるラインでは、比較要フラグが「0」であり、比較すべき主記憶アドレスがA1となっている。すなわち、主記憶アドレスA1に関しては、一致比較を行う必要はないことになる。   Next, “01”, which is the address in the RB of the line selected as the match line, is transmitted to the RF as an encoding result, and the line in the RF corresponding to the key 01 is referred to. In the RF line corresponding to the key 01, the comparison required flag is “0”, and the main storage address to be compared is A1. That is, it is not necessary to perform a coincidence comparison on the main memory address A1.

次に、キー01を用いて、RBにおけるKeyの列に対して検索が行われる。この例では、RBにおける「03」のラインがマッチラインとして選択される。そして、エンコード結果としてキー03がRFに伝達され、キー03に対応するRFにおけるラインが参照される。キー03に対応するRFにおけるラインでは、比較要フラグが「1」であり、比較すべき主記憶アドレスがA2となっている。すなわち、主記憶アドレスA2に関しては、一致比較を行う必要があることになる。ここで、主記憶3における主記憶アドレスA2の値がCache7Aを介して読み出され、RBにおいて、Valueが主記憶3から読み出された値であり、かつ、Keyが「03」となっているラインが検索される。図3に示す例では、Keyが「03」となっているラインは「04」および「05」の2つあるが、主記憶3から読み出された値が「00」であるので、「05」のラインがマッチラインとして選択され、RFに対して、エンコード結果としてキー05が伝達される。   Next, using the key 01, a search is performed on the Key column in the RB. In this example, the line “03” in RB is selected as the match line. Then, the key 03 is transmitted to the RF as an encoding result, and the line in the RF corresponding to the key 03 is referred to. In the RF line corresponding to the key 03, the comparison required flag is “1”, and the main storage address to be compared is A2. That is, it is necessary to perform a coincidence comparison on the main memory address A2. Here, the value of the main memory address A2 in the main memory 3 is read via the Cache 7A, and in RB, the value is the value read from the main memory 3, and the key is “03”. A line is searched. In the example shown in FIG. 3, there are two lines “04” and “05” whose Key is “03”. However, since the value read from the main memory 3 is “00”, “05” "Is selected as a match line, and the key 05 is transmitted to the RF as an encoding result.

以上のような処理が繰り返され、RFにおいて、次に比較すべきレジスタ番号または主記憶アドレスがないことを示す終端フラグEが検出された場合、入力パターンが全て一致したと判定され、該当命令区間は再利用可能と判断される。そして、終端フラグEが検出されたラインから「Select Output」信号が出力され、RO1およびRO2に格納されている、該ラインに対応する出力値がレジスタ6Aおよび主記憶3に対して出力される。   When the above processing is repeated and a termination flag E indicating that there is no register number or main memory address to be compared next is detected in RF, it is determined that all the input patterns match, and the corresponding instruction section Is determined to be reusable. Then, a “Select Output” signal is output from the line in which the termination flag E is detected, and output values corresponding to the lines stored in RO1 and RO2 are output to the register 6A and the main memory 3.

以上のように、本実施形態における命令区間記憶部2による連想検索動作は、次のような特徴を有している。まず、内容が一致したことを示すマッチラインは、RBにおいて1つのラインのみとなるので、検索動作を次列へ伝搬する際にエンコードした結果を1つ伝送すればよいことになる。したがって、RBとRFとの間を接続する信号線は、アドレスのエンコード結果である1組(N本)でよいことになる。これに対して、上記した比較例では、RBにおいてマルチマッチが許容されているので、RBにおける各列同士を接続する信号線は、各ラインごとに設ける(2N本)必要があることになる。すなわち、本実施形態の構成によれば、命令区間記憶部2を構成する連想検索メモリにおける信号線の数を大幅に低減することが可能となる。 As described above, the associative search operation by the instruction interval storage unit 2 in the present embodiment has the following characteristics. First, since there is only one match line in the RB indicating that the contents match, it is only necessary to transmit one encoded result when propagating the search operation to the next column. Therefore, one set (N) of signal lines connecting the RB and the RF may be sufficient as the result of address encoding. On the other hand, in the comparative example described above, since multi-matching is allowed in the RB, the signal lines that connect the columns in the RB must be provided for each line (2 N lines). . That is, according to the configuration of the present embodiment, the number of signal lines in the associative search memory constituting the instruction interval storage unit 2 can be significantly reduced.

また、検索途中ではシングルマッチのみが許容されるようになっているので、比較すべき項目の比較順番は、木構造における参照順に限定されることになる。すなわち、レジスタ値とメモリ内容とは、参照順に混在させながら比較する必要がある。   Further, since only a single match is allowed during the search, the comparison order of items to be compared is limited to the reference order in the tree structure. That is, it is necessary to compare the register value and the memory contents while mixing them in the reference order.

入力パターンは、各項目を参照すべきKeyという形でリンクさせることにより、木構造によってRBおよびRFに登録されている。また、入力パターンの項目は、終端フラグによってその終端が示されるようになっている。よって、入力パターンの項目数を可変とすることができるので、再利用表に登録すべき命令区間の状態に応じて、柔軟に入力パターンの項目数を設定することが可能となる。また、入力パターンの項目数が固定でないことによって、利用しない項目が無駄にメモリ領域を占有することがなくなるので、メモリ領域の利用効率を向上させることができる。   The input pattern is registered in RB and RF by a tree structure by linking each item in the form of Key to be referred to. Further, the end of the input pattern item is indicated by the end flag. Therefore, since the number of input pattern items can be made variable, the number of input pattern items can be flexibly set in accordance with the state of the command section to be registered in the reuse table. In addition, since the number of items in the input pattern is not fixed, the unused area does not occupy the memory area unnecessarily, and the use efficiency of the memory area can be improved.

また、木構造によって入力パターンが登録されるので、項目の内容が重複する部分については、複数の入力パターンで1つのラインを共有することが可能となっている。よって、メモリ領域の利用効率をさらに向上させることができる。   In addition, since the input pattern is registered by the tree structure, it is possible to share one line with a plurality of input patterns for portions where the contents of the items overlap. Therefore, the utilization efficiency of the memory area can be further improved.

なお、以上のような構成の場合、RFおよびRBを構成するメモリとしては、構造が縦長のものとなる。例えばこのメモリ容量を2Mbyteとした場合、横が8word、縦を65536ラインとすることになる。   In the case of the above configuration, the memory constituting the RF and RB has a vertically long structure. For example, when the memory capacity is 2 Mbytes, the horizontal is 8 words and the vertical is 65536 lines.

(連想検索動作の別の例)
上記の例では、図1に示したRFにおいて、UP、Alt.、およびDNの項目は利用していないことになる。すなわち、上記の例では、RFにおいて、これらの項目を設ける必要はないことになる。これに対して、UP、Alt.、およびDNの項目を利用することによって、連想検索動作をさらに高速化する構成および動作について以下に説明する。
(Another example of associative search)
In the above example, the items UP, Alt., And DN are not used in the RF shown in FIG. That is, in the above example, it is not necessary to provide these items in the RF. On the other hand, a configuration and operation for further speeding up the associative search operation by using items of UP, Alt., And DN will be described below.

まず、図4(b)に、プログラムカウンタ(PC)およびレジスタの内容(Reg.)のみを比較し、これらが一致した場合は、主記憶値を比較することなく、区間の再利用が可能であると判断できる場合の状態を示す。この状態では、まず、RBの「01」のラインにおいて、PCおよびReg.がValueに登録されており、RFの「01」のラインにおいて、終端フラグが「E」、比較要フラグが「0」、比較すべき主記憶アドレスが「A1」、親ノード番号を示すUPが「FF」となっている。また、RBの「03」のラインでは、Value値なしで、Keyが「01」となっており、RFの「03」のラインでは、終端フラグが「E」、比較要フラグが「0」、比較すべき主記憶アドレスが「A2」、親ノード番号を示すUPが「FF」となっている。以降、同様に、RBおよびRFにおける「05」のラインおよび「07」のラインが登録されており、それぞれ終端フラグが「E」、比較要フラグが「0」となっている。   First, in FIG. 4B, only the program counter (PC) and the register contents (Reg.) Are compared, and if they match, the section can be reused without comparing the main memory values. The state when it can be determined that it exists is shown. In this state, first, PC and Reg. Are registered in Value in the RB “01” line. In the RF “01” line, the termination flag is “E” and the comparison required flag is “0”. The main storage address to be compared is “A1”, and the UP indicating the parent node number is “FF”. In the RB “03” line, the Key is “01” without the Value value, and in the RF “03” line, the termination flag is “E”, the comparison required flag is “0”, The main storage address to be compared is “A2”, and the UP indicating the parent node number is “FF”. Thereafter, similarly, the “05” line and the “07” line in the RB and RF are registered, the termination flag is “E”, and the comparison required flag is “0”, respectively.

この状態で、ある命令区間の実行が検出されると、PCおよびReg.がRBに入力され、マッチラインとして、RBにおける「01」のラインが選択される。そして、マッチラインとして選択されたラインのRBにおける番地である「01」が、エンコード結果としてRFに伝達され、キー01に対応するRFにおけるラインが参照される。キー01に対応するRFにおけるラインでは、終端フラグが「E」となっているので、次に比較すべき主記憶アドレスがないことがわかる。また、比較要フラグ「0」となっているので、主記憶アドレスA1について比較を行う必要はないことがわかる。   In this state, when execution of a certain instruction section is detected, PC and Reg. Are input to the RB, and the line “01” in the RB is selected as a match line. Then, “01” which is the address in the RB of the line selected as the match line is transmitted to the RF as an encoding result, and the line in the RF corresponding to the key 01 is referred to. Since the end flag is “E” in the line corresponding to the key 01, it can be seen that there is no main memory address to be compared next. Further, since the comparison required flag is “0”, it can be seen that it is not necessary to compare the main memory address A1.

したがって、図4(a)の木構造に示すように、PCおよびReg.の一致がS1において確認されると、Tr1に示すノードのように、主記憶アドレスA1、A2、A3における比較を行うことなく、対応する出力値が出力されることになる。   Therefore, as shown in the tree structure of FIG. 4A, when the coincidence of PC and Reg. Is confirmed in S1, comparison is performed at main memory addresses A1, A2, and A3 as in the node indicated by Tr1. Instead, the corresponding output value is output.

RFおよびRBがこの状態である場合に、主記憶アドレスA2に対して書き込みが行われたとする。この場合、RFおよびRBにおける入力パターンの登録時には主記憶アドレスA2の一致比較を行う必要はない状態であったが、主記憶アドレスA2が変更されることによって、主記憶アドレスA2の一致比較を行う必要が生じることになる。したがって、この場合には、図5(b)に示すようにRFおよびRBが変更されることになる。   When RF and RB are in this state, it is assumed that writing has been performed on the main memory address A2. In this case, it is not necessary to perform a coincidence comparison of the main memory address A2 at the time of registering the input pattern in the RF and RB. There will be a need. Therefore, in this case, RF and RB are changed as shown in FIG.

まず、内容が変更された主記憶アドレスであるA2をキーにして、RFにおけるAdr.
の列に対して検索がかけられる。これによって、RFにおける「03」のラインが選択される。そして、選択された「03」のラインにおいて、比較要フラグが「1」に設定されるとともに、終端フラグ「E」が削除される。
First, using A2 which is the main memory address whose contents are changed as a key, Adr.
A search is performed on the columns. As a result, the line “03” in RF is selected. Then, in the selected line “03”, the comparison required flag is set to “1” and the end flag “E” is deleted.

次に、「03」のラインにおけるUPを参照することによって、親ノードとしての「01」のラインが認識される。そして、「01」のラインにおいて、次に比較すべき主記憶アドレスよりも優先して比較すべき主記憶アドレスを示すAlt.に、内容が変更された主記憶アドレスであるA2を書き込まれるとともに、終端フラグ「E」が削除される。さらに、「01」のラインにおいて、優先して比較する際に必要なキーを示すDNに「03」が書き込まれる。   Next, by referring to the UP in the “03” line, the “01” line as the parent node is recognized. In the line “01”, A2 which is the main storage address whose contents are changed is written to Alt. Indicating the main storage address to be compared with priority over the main storage address to be compared next. The termination flag “E” is deleted. Further, in the “01” line, “03” is written in the DN indicating the key required for the priority comparison.

以上のようにRFおよびRBが書き換えられた場合の連想検索動作は次のようになる。ある命令区間が検出された際に、まず、PCおよびReg.がRBに入力される。そして、RBにおいて、連想検索により、入力されたこれらの値と、RBのValueの列に登録されている命令区間先頭アドレスおよびレジスタ値とが比較され、RBにおける「01」のラインがマッチラインとして選択される。   The associative search operation when RF and RB are rewritten as described above is as follows. When a certain instruction section is detected, first, PC and Reg. Are input to RB. Then, in the RB, these values input by the associative search are compared with the instruction section start address and register value registered in the Value column of the RB, and the “01” line in the RB is used as a match line. Selected.

次に、マッチラインとして選択されたラインのRBにおける番地である「01」が、エンコード結果としてRFに伝達され、キー01に対応するRFにおけるラインが参照される。キー01に対応するRFにおけるラインでは、比較要フラグが「0」であり、比較すべき主記憶アドレスがA1となっている。すなわち、主記憶アドレスA1に関しては、一致比較を行う必要はないことがわかる。   Next, “01”, which is the address in the RB of the line selected as the match line, is transmitted to the RF as an encoding result, and the line in the RF corresponding to the key 01 is referred to. In the RF line corresponding to the key 01, the comparison required flag is “0”, and the main storage address to be compared is A1. That is, it can be seen that it is not necessary to perform a coincidence comparison with respect to the main memory address A1.

また、次に比較すべき主記憶アドレスよりも優先して比較すべき主記憶アドレスを示すAlt.に、主記憶アドレスA2が登録されており、優先して比較する際に必要なキーを示すDNに「03」が登録されていることが確認される。この場合、主記憶3における主記憶アドレスA2の値がCache7Aを介して読み出され、RBにおいて、Valueが主記憶3から読み出された値であり、かつ、Keyが、DNに示されている「03」となっているラインが検索される。   Also, the main memory address A2 is registered in Alt. Indicating the main memory address to be compared with priority over the main memory address to be compared next, and DN indicating the key required for the priority comparison It is confirmed that “03” is registered in. In this case, the value of the main memory address A2 in the main memory 3 is read through the Cache 7A, and in RB, Value is the value read from the main memory 3, and Key is indicated in DN. A line with “03” is searched.

図5(b)に示す例では、Keyが「03」となっているラインは「04」および「05」の2つあるが、主記憶3から読み出された値が「00」であるので、「05」のラインがマッチラインとして選択され、RFに対して、エンコード結果としてキー05が伝達される。キー05に対応するRFにおけるラインでは、終端フラグが「E」となっているので、入力パターンが全て一致したと判定され、該当命令区間は再利用可能と判断される。そして、終端フラグEが検出されたラインから「Select Output」信号が出力され、RO1およびRO2に格納されている、該ラインに対応する出力値がレジスタ6Aおよび主記憶3に対して出力される。   In the example shown in FIG. 5B, there are two lines “04” and “05” with Key “03”, but the value read from the main memory 3 is “00”. , “05” is selected as a match line, and key 05 is transmitted to RF as an encoding result. In the line in RF corresponding to the key 05, since the termination flag is “E”, it is determined that all the input patterns match, and the corresponding command section is determined to be reusable. Then, a “Select Output” signal is output from the line in which the termination flag E is detected, and output values corresponding to the lines stored in RO1 and RO2 are output to the register 6A and the main memory 3.

以上のような連想検索動作によれば、RFにおいて、次に比較すべき主記憶アドレスよりも優先して比較すべき主記憶アドレスを示すAlt.、および、優先して比較する際に必要なキーを示すDNが設けられているので、主記憶アドレスA1の内容とキー01による検索をスキップして、主記憶アドレスA2の内容とキー03による検索が可能となる。したがって、検索動作の処理ステップを低減することができるので、処理の高速化を図ることができる。   According to the associative search operation as described above, in RF, Alt. Indicating the main memory address to be compared with priority over the main memory address to be compared next, and the key necessary for the priority comparison Therefore, it is possible to skip the search by the contents of the main storage address A1 and the key 01 and the search by the contents of the main storage address A2 and the key 03. Accordingly, the processing steps of the search operation can be reduced, and the processing speed can be increased.

(出力値の格納手段)
上記では、命令区間の入力パターンをRFおよびRBに登録し、連想検索動作を行うことについて説明したが、以下では、入力パターンの一致が確認された後に、再利用として出力される出力値を格納する手段について説明する。上記において図1を参照しながら説明したように、命令区間記憶部2には、再利用が可能であると判定された場合に、主記憶および/またはレジスタに出力する出力値を格納する出力値格納手段として、RO1およびRO2が設けられている。
(Output value storage means)
In the above description, the input pattern of the instruction section is registered in RF and RB, and the associative search operation is performed. However, in the following, the output value output as reuse is stored after the input pattern match is confirmed. The means to do will be described. As described above with reference to FIG. 1, the instruction interval storage unit 2 stores an output value for storing an output value to be output to the main memory and / or the register when it is determined that reuse is possible. RO1 and RO2 are provided as storage means.

出力値は、RFおよびRBから出力されるアドレスに基づいて、出力値を記憶するRAMなどの記憶手段を参照することによって得ることが可能である。しかしながら、入力パターンと同様に、出力パターンについても、出力値の項目数を可変とすることが好ましいので、出力値の格納方法に関して工夫が必要である。   The output value can be obtained by referring to storage means such as a RAM for storing the output value based on the address output from the RF and RB. However, like the input pattern, it is preferable that the number of output value items be variable for the output pattern, and thus a device for storing the output value needs to be devised.

入力パターンに関しては、RFおよびRBにおいて木構造によって登録されている。そして、木構造の末端となっているライン、すなわち、終端フラグEが登録されているラインにおいて、再利用が可能であると判定されることになる。したがって、終端フラグEが登録されている各ラインに、出力すべき出力値を格納する出力値格納手段におけるポインタを登録しておくことによって、再利用の際の出力動作を行うことが可能となる。   The input pattern is registered in a tree structure in RF and RB. Then, it is determined that reuse is possible in the line that is the end of the tree structure, that is, the line in which the end flag E is registered. Therefore, by registering a pointer in the output value storage means for storing the output value to be output in each line in which the termination flag E is registered, it is possible to perform an output operation at the time of reuse. .

しかしながら、入力パターンが全て一致したことが確認された時点で、出力値が格納されているポインタに基づいて出力値格納手段における格納位置が特定される場合、ポインタに基づいて格納位置を特定するという変換処理が必要となり、処理速度を低下させる要因となる。   However, when the storage position in the output value storage unit is specified based on the pointer storing the output value when it is confirmed that all the input patterns match, the storage position is specified based on the pointer. Conversion processing is required, which causes a reduction in processing speed.

そこで、本実施形態では、出力値格納手段として、RO1およびRO2の2つの記憶手段を設けている。そして、RO1は、RFの各ラインに1対1で対応して出力値および出力すべきアドレスを格納している。すなわち、終端フラグEが登録されているRFのラインにおいて再利用が可能であると判定された場合には、そのラインに対応するRO1のラインが選択され、出力値が出力される。   Therefore, in the present embodiment, two storage means, RO1 and RO2, are provided as output value storage means. RO1 stores an output value and an address to be output in a one-to-one correspondence with each line of RF. That is, when it is determined that the RF line in which the termination flag E is registered can be reused, the RO1 line corresponding to the line is selected and the output value is output.

しかしながら、このように、出力値格納手段を、RFの各ラインに1対1で対応して出力値および出力すべきアドレスを格納している場合、RFにおける、終端フラグEが登録されていないRFのラインに対しても、RO1においてメモリ領域が確保されることになる。また、終端フラグEが登録されているRFの全てのラインに対応して、RO1において出力値を格納するので、同じ内容が複数箇所で記憶されている、というような冗長性が存在することになる。したがって、RO1は、高速に処理を行うという面では優れているが、メモリの利用効率としてはよくないことになる。   However, in this way, when the output value storage means stores the output value and the address to be output in one-to-one correspondence with each line of the RF, the RF in which the termination flag E is not registered in the RF A memory area is secured in RO1 for these lines. Further, since the output value is stored in RO1 corresponding to all the lines of the RF in which the termination flag E is registered, there is a redundancy that the same contents are stored in a plurality of places. Become. Therefore, RO1 is excellent in terms of processing at high speed, but it is not good in terms of memory utilization efficiency.

この問題を解消するために、RO1に登録可能な項目数、すなわち出力値と出力アドレスとの組の数を少なめに設定する(図1の例では2つ)とともに、RO1に登録しきれない出力値および出力アドレスの組については、ポインタを用いて格納領域が指示される構成のRO2に登録するようにしている。   In order to solve this problem, the number of items that can be registered in RO1, that is, the number of pairs of output values and output addresses is set to be small (two in the example of FIG. 1), and output that cannot be registered in RO1. A set of a value and an output address is registered in RO2 having a configuration in which a storage area is designated using a pointer.

RO2においては、ポインタによって格納領域が指示されるので、使用されないメモリ領域はほとんど生じないことになる。また、複数の出力値および出力アドレスの組を登録する場合には、順次ポインタを用いてつなげていくことができるので、登録可能な出力値および出力アドレスの組の数を可変にすることが可能である。さらに、RO1における複数のラインから、RO2における同じ格納位置を示すポインタを指示することも可能となるので、RO2における格納情報を、RO1における複数のラインで共有することも可能となる。よって、RO2においては、格納内容の冗長性を低くすることができる。   In RO2, since the storage area is indicated by the pointer, there is almost no unused memory area. Also, when registering multiple sets of output values and output addresses, you can connect them sequentially using pointers, so the number of sets of output values and output addresses that can be registered can be made variable. It is. Furthermore, since a pointer indicating the same storage position in RO2 can be designated from a plurality of lines in RO1, storage information in RO2 can also be shared by a plurality of lines in RO1. Therefore, in RO2, the redundancy of stored contents can be reduced.

以上のように、出力値格納手段としてRO1およびRO2の2つを設けることによって、出力値の項目が少ない場合にはRO1のみの利用により処理の高速性を実現するとともに、出力値の項目が多い場合には、項目の数を可変とすることが可能なRO2を用いることによって対応している。よって、上記の構成によれば、処理の高速性とメモリ利用効率の向上とを実現することができる。   As described above, by providing two output value storage units, RO1 and RO2, when the number of output value items is small, the processing speed can be increased by using only RO1, and the number of output value items is large. The case is dealt with by using RO2, which can change the number of items. Therefore, according to the above configuration, it is possible to realize high-speed processing and improvement in memory utilization efficiency.

(命令区間記憶部に対する登録処理)
上記では、ある命令区間の実行に際して再利用を行う場合の動作について説明した。以下では、ある命令区間の実行に際して、再利用が行えないと判断された場合に、該命令区間による入出力をRF、RB、RO1、およびRO2に登録する際の動作について説明する。
(Registration processing for the command section storage unit)
In the above, the operation in the case of reusing when executing a certain instruction section has been described. In the following, an operation when registering input / output in an instruction section in RF, RB, RO1, and RO2 when it is determined that reuse cannot be performed when executing a certain instruction section will be described.

まず、ある命令区間の実行が検出されると、PCおよびReg.の値がRBに入力される。そして、RBにおいて、連想検索により、入力されたこれらの値と、RBのValueの列に登録されている命令区間先頭アドレスおよびレジスタ値とが比較される。ここで、RBのValueの列に、入力された値と一致するものがないと判定された場合、該命令区間は、再利用が不可能であると判定され、演算器5Aによる演算処理が行われる。そして、該当命令区間の演算処理が終了するまでに用いられるレジスタ入力値、主記憶入力値、主記憶出力値、およびレジスタ出力値が、RB、RF、RO1、必要に応じてRO2に登録される。ここで、RBおよびRFに登録を行う際には、上記で示したような木構造となるように、各項目が1つのラインに対応するように登録が行われる。そして、登録すべき入力パターンの最後の項目が登録されたラインにおいて、RFの終端フラグを「E」とし、入力パターンの登録を終了する。   First, when execution of a certain instruction section is detected, the values of PC and Reg. Are input to RB. Then, in the RB, these values inputted by the associative search are compared with the instruction section start address and the register value registered in the Value column of the RB. Here, if it is determined that there is no RB Value column that matches the input value, it is determined that the instruction section cannot be reused, and the arithmetic unit 5A performs arithmetic processing. Is called. Then, the register input value, the main memory input value, the main memory output value, and the register output value that are used until the calculation process of the corresponding instruction section is completed are registered in RB, RF, RO1, and RO2 as necessary. . Here, when registering in RB and RF, registration is performed so that each item corresponds to one line so as to have the tree structure as described above. Then, in the line where the last item of the input pattern to be registered is registered, the RF termination flag is set to “E”, and the registration of the input pattern is completed.

一方、入力されたPCおよびReg.の値に一致するものが、RBのValueの列に登録されている場合には、上記した連想検索動作と同様にして、次の一致比較すべき項目についての一致比較が行われる。このようにして、RBおよびRFに登録されている入力パターンと、該当命令区間における入力パターンとの一致比較を継続していき、一致しない項目が生じた時点で、新たにノードを追加する形で、その一致しない項目についてRBおよびRFに登録が行われる。そして、登録すべき入力パターンの最後の項目が登録されたラインにおいて、RFの終端フラグを「E」とし、入力パターンの登録を終了する。   On the other hand, if an item that matches the entered PC and Reg. Values is registered in the RB Value column, the next item to be compared is compared in the same manner as the associative search operation described above. A match comparison is performed. In this way, the comparison between the input pattern registered in RB and RF and the input pattern in the corresponding instruction section is continued, and a new node is added when an unmatched item occurs. Then, registration is performed in the RB and RF for the mismatched items. Then, in the line where the last item of the input pattern to be registered is registered, the RF termination flag is set to “E”, and the registration of the input pattern is completed.

入力パターンの登録が終了すると、終端フラグを「E」としたRFにおけるラインに対応する、RO1におけるラインに、出力値および出力アドレスの登録を行う。そして、出力値として登録すべき項目がRO1に登録しきれない場合には、ポインタを用いてRO2に対して登録が行われる。以上により、命令区間の登録処理が完了する。   When the registration of the input pattern is completed, the output value and the output address are registered in the line in RO1 corresponding to the line in RF whose end flag is “E”. When items to be registered as output values cannot be registered in RO1, registration is performed for RO2 using a pointer. Thus, the instruction section registration process is completed.

(レジスタ値の詳細)
レジスタ入出力値としては、引数、返り値(Args.)、および、引数および返り値以外のレジスタおよび条件コード(Regs.,CC)が挙げられる。本実施形態では、SPARCアーキテクチャレジスタのうち、汎用レジスタ%g0-7、%o0-7、%l0-7、%i0-7、浮動小数点レジスタ%f0-31、条件コードレジスタICC、浮動小数点条件コードレジスタFCCを用いるようになっている(詳細は後述する)。このうち、リーフ関数の入力は汎用レジスタ%o0-5、出力は汎用レジスタ%o0-1または%f0-1、また、非リーフ関数の入力は汎用レジスタ%i0-5、出力は汎用レジスタ%i0-1または%f0-1、になり、入力は、arg[0-5]、出力は、rti[0-1] または%rtf[0-1]に登録される。SPARC−ABIの規定では、これら以外のレジスタは関数の入出力にはならないので、関数に関しては、レジスタ入出力値としては、Args.がRB、およびRO1/RO2に登録されることになる。
(Details of register values)
Register input / output values include arguments, return values (Args.), And registers and condition codes (Regs., CC) other than arguments and return values. In the present embodiment, among the SPARC architecture registers, general-purpose registers% g0-7,% o0-7,% l0-7,% i0-7, floating point register% f0-31, condition code register ICC, floating point condition code The register FCC is used (details will be described later). Of these, the leaf function input is general-purpose register% o0-5, the output is general-purpose register% o0-1 or% f0-1, the non-leaf function input is general-purpose register% i0-5, and the output is general-purpose register% i0 -1 or% f0-1, and the input is registered in arg [0-5] and the output is registered in rti [0-1] or% rtf [0-1]. According to the SPARC-ABI regulations, registers other than these are not input / output of functions, and therefore, for functions, Args. Is registered in RB and RO1 / RO2 as register input / output values.

一方、SPARC−ABIの規定では、ループの入出力に関しては、用いられるレジスタの種類を特定することはできないので、ループの入出力を特定するには、全ての種類のレジスタに関してRBに登録する必要がある。よって、ループに関しては、レジスタ入出力値として、Regs.,CCに相当する、%g0-7、%o0-7、%l0-7、%i0-7、%f0-31、ICC、FCCが登録されることになる。   On the other hand, according to the SPARC-ABI rules, the type of register used cannot be specified for loop input / output. Therefore, in order to specify loop input / output, all types of registers must be registered in the RB. There is. Therefore, for the loop, register input / output values corresponding to Regs., CC,% g0-7,% o0-7,% l0-7,% i0-7,% f0-31, ICC, FCC are registered. Will be.

(多重再利用)
1レベルで上記のような再利用機構を用いた場合、図10(a)に示した例で言えば、リーフ関数としての関数Bや、関数Bの内部にあるループCなどをそれぞれ再利用することが可能となる。これに対して、ある関数を一度実行しただけで、その関数の内部に含まれる関数やループを含む全ての命令区間が再利用可能となるように登録を行う仕組みが多重再利用である。例えば上記の例で言えば、多重再利用によれば、関数Aを一度実行しただけで、入れ子関係にあるA,B,Cの全ての命令区間が再利用可能となる。以下に、多重再利用を実現する上で必要とされる機能拡張について説明する。
(Multiple reuse)
When the reuse mechanism as described above is used at one level, in the example shown in FIG. 10A, the function B as the leaf function, the loop C inside the function B, etc. are reused. It becomes possible. On the other hand, multiple reuse is a mechanism for performing registration so that all instruction sections including functions and loops included in the function can be reused by executing a function once. For example, in the above example, according to multiple reuse, all the instruction sections of A, B, and C that are nested can be reused by executing the function A once. The function expansion required for realizing multiple reuse will be described below.

図6に、一例として、関数Aおよび関数Dの概念的な構造を示す。同図に示す例では、関数Aの内部にループBが存在しており、ループBの内部にループCが存在しており、ループCにおいて関数Dが呼び出されるようになっている。そして、関数Dの内部にループEが存在しており、ループEの内部にループFが存在している。   FIG. 6 shows a conceptual structure of the function A and the function D as an example. In the example shown in the figure, a loop B exists inside the function A, a loop C exists inside the loop B, and the function D is called in the loop C. A loop E exists inside the function D, and a loop F exists inside the loop E.

図7は、図6に示す関数A,DおよびループB,C,E,Fの入れ子構造において、内側の構造のレジスタ入出力(太枠セル領域)が、外側の構造のレジスタ入出力となる影響範囲(矢印)について示している。例えば、ループFの内部において入力として参照された%i0〜5は、ループEおよび関数Dに対する入力でもあり、さらに、関数Dを呼び出したループCおよびループBに対する入力(ただし%o0〜5に読み替える)でもある。一方、関数Aにとって%o0〜5は局所変数に相当するので、%i0〜5(%o0〜5)は、関数Aに対してのレジスタ入力とはならない。すなわち、%i0〜5(%o0〜5)の影響範囲はループBまでとなる。別の見方をすれば、関数Dの内部で%i0〜5が参照された場合には、ループBが直接的に%o0〜5を参照しなくても、%o0〜5をループBの入力値として登録する必要がある。ループF内部において出力された%i0〜1についても同様である。   7, in the nested structure of functions A and D and loops B, C, E, and F shown in FIG. 6, the register input / output (thick frame cell region) of the inner structure becomes the register input / output of the outer structure. The influence range (arrow) is shown. For example,% i0 to 5 referred to as an input in the loop F is also an input to the loop E and the function D, and further, an input to the loop C and the loop B that called the function D (but replaced with% o0 to 5) It is also. On the other hand, for function A,% o0 to 5 correspond to local variables, so% i0 to 5 (% o0 to 5) are not register inputs for function A. That is, the influence range of% i0 to 5 (% o0 to 5) is up to loop B. From another point of view, if% i0-5 is referenced inside function D,% o0-5 is input to loop B even if loop B does not directly reference% o0-5. Must be registered as a value. The same applies to% i0-1 output in the loop F.

浮動小数点レジスタはレジスタウィンドウに含まれないので、出力された%f0〜1は、関数Aを含む全階層の出力となる。一方、その他のレジスタ入出力は、関数を超えて影響がおよぶことはない。すなわち、ループF内部における入出力、すなわち、レジスタ入力としての%i6〜7、%g,l,o、%f0〜31、%icc、%fcc、およびレジスタ出力としての%I2〜7、%g,l,o、%f2〜31、%icc、%fccの影響範囲はループEまでとなる。主記憶に対する入出力については、前述した、関数呼び出し直前の%sp(SP)と比較する方法を入れ子の全階層に対して適用することにより、影響範囲を特定することができる。   Since the floating point register is not included in the register window, the output% f0 to 1 is output of all layers including the function A. On the other hand, other register inputs and outputs have no effect beyond functions. That is, input / output in the loop F, that is,% i6-7,% g, l, o,% f0-31,% icc,% fcc as register inputs, and% I2-7,% g as register outputs , l, o,% f2 to 31,% icc,% fcc range up to loop E. For the input / output to / from the main memory, the influence range can be specified by applying the above-described method of comparison with% sp (SP) immediately before the function call to all nested hierarchies.

ここで、上記のようなRW4A、RW4B、および命令区間記憶部2の構成によれば、複数の命令区間の入出力を個別に記録することが可能であるので、多重再利用を実現することが可能となる。   Here, according to the configuration of the RW 4A, the RW 4B, and the instruction section storage unit 2 as described above, input / output of a plurality of instruction sections can be individually recorded, so that multiple reuse can be realized. It becomes possible.

(並列事前実行)
以上に述べた、関数やループの多重再利用では、同一パラメータが出現する間隔が長い場合や、パラメータが単調に変化し続ける場合には全く効果がないことになる。すなわち、RBエントリの生存時間よりも同一パラメータが出現する間隔が長い場合には、ある関数またはループがRBに登録されたとしても、その登録された関数またはループに関して同一パラメータが次に出現した際には、すでにその関数またはループがRBエントリから消えていることになり、再利用できないことになる。また、パラメータが単調に変化し続ける場合には、該当する関数やループがRBに登録されていても、パラメータが異なることによって再利用できないことになる。
(Parallel pre-execution)
The multiple reuse of functions and loops described above has no effect when the interval at which the same parameter appears is long or when the parameter continues to change monotonously. That is, when the same parameter appears longer than the lifetime of the RB entry, even when a certain function or loop is registered in the RB, the same parameter appears next for the registered function or loop. The function or loop has already disappeared from the RB entry and cannot be reused. In addition, when the parameter continues to change monotonously, even if the corresponding function or loop is registered in the RB, the parameter cannot be reused because the parameter is different.

これに対して、多重再利用を行うプロセッサとしてのMSP1Aとは別に、命令区間の事前実行によってRBエントリを有効にするプロセッサとしてのSSP1Bを複数個設けることによって、さらなる高速化を図ることができる。   On the other hand, by providing a plurality of SSP1Bs as processors that enable the RB entry by pre-execution of the instruction section separately from the MSP1A as a processor that performs multiple reuse, it is possible to further increase the speed.

並列事前実行機構を行うためのハードウェア構成は、前記した図2に示すような構成となる。同図に示すように、RW4A・4B、演算器5A・5B、レジスタ6A・6B、キャッシュ7A・7Bは、各プロセッサごとに独立して設けられている一方、命令区間記憶部2、および主記憶3は全てのプロセッサが共有するようになっている。同図において、破線は、MSP1AおよびSSP1Bが命令区間記憶部2に対して入出力を登録するパスを示している。   The hardware configuration for performing the parallel pre-execution mechanism is as shown in FIG. As shown in the figure, the RWs 4A and 4B, the arithmetic units 5A and 5B, the registers 6A and 6B, and the caches 7A and 7B are provided independently for each processor, while the instruction section storage unit 2 and the main memory 3 is shared by all processors. In the figure, the broken lines indicate paths through which MSP 1A and SSP 1B register input / output to / from the instruction section storage unit 2.

ここで、並列事前実行を実現する上での課題は、(1)どのように主記憶一貫性を保つか、(2)どのように入力を予測するか、の2点が挙げられる。以下に、これらの課題に対する解決手法について説明する。   Here, there are two problems in realizing parallel pre-execution: (1) how to maintain main memory consistency, and (2) how to predict input. Below, the solution method with respect to these subjects is demonstrated.

(主記憶一貫性に関する課題の解決方法)
まず、上記の課題(1)どのように主記憶一貫性を保つかについて説明する。特に予測した入力パラメータに基づいて命令区間を実行する場合、主記憶に書き込む値がMSP1AとSSP1Bとで異なることになる。これを解決するために、図2に示すように、SSP1Bは、RBへの登録対象となる主記憶参照には命令区間記憶部2、また、その他の局所的な参照にはSSP1Bごとに設けた局所メモリとしてのLocal7Bを使用することとし、Cache7Bおよび主記憶3への書き込みを不要としている。なお、MSP1Aが主記憶3に対して書き込みを行った場合には、対応するSSP1Bのキャッシュラインが無効化される。
(Solutions to main memory consistency issues)
First, the above problem (1) how to maintain main memory consistency will be described. In particular, when an instruction interval is executed based on a predicted input parameter, the value to be written to the main memory is different between MSP1A and SSP1B. In order to solve this, as shown in FIG. 2, the SSP 1B is provided for the instruction section storage unit 2 for the main memory reference to be registered in the RB and for each SSP 1B for other local references. Local 7B is used as a local memory, and writing to Cache 7B and main memory 3 is unnecessary. When the MSP 1A writes to the main memory 3, the corresponding SSP 1B cache line is invalidated.

具体的には、命令区間記憶部2への登録対象のうち、読み出しが先行するアドレスについては主記憶3を参照し、MSP1Aと同様にアドレスおよび値をRBへ登録する。以後、主記憶3ではなく命令区間記憶部2を参照することによって、他のプロセッサからの上書きによる矛盾の発生を避けることができる。局所的な参照については、読み出しが先行するということは、変数を初期化せずに使うことに相当し、値は不定でよいことになるので、主記憶3を参照する必要はない。   Specifically, the address and value are registered in the RB in the same manner as the MSP 1A with reference to the main memory 3 for the address preceded by the reading among the registration targets in the instruction section storage unit 2. Thereafter, by referring to the instruction section storage unit 2 instead of the main memory 3, it is possible to avoid the occurrence of contradiction due to overwriting from another processor. As for local reference, the fact that reading precedes corresponds to using a variable without initializing it, and the value may be indefinite, so it is not necessary to refer to the main memory 3.

なお、局所メモリとしてのLocal7Bの容量は有限であり、関数フレームの大きさがLocal7Bの容量を超えた場合など、実行を継続できない場合は、事前実行を打ち切るようにする。また、事前実行の結果は主記憶3に書き込まれないので、事前実行結果を使って、さらに次の事前実行を行うことはできない。   Note that the capacity of the Local 7B as a local memory is finite, and if the execution cannot be continued, such as when the size of the function frame exceeds the capacity of the Local 7B, the pre-execution is aborted. Further, since the result of the pre-execution is not written to the main memory 3, the next pre-execution cannot be performed using the pre-execution result.

(入力の予測方法)
次に、上記の課題(2)どのように入力を予測するかについて説明する。事前実行に際しては、命令区間記憶部2の使用履歴に基づいて将来の入力を予測し、SSP1Bへ渡す必要がある。このために、命令区間記憶部2に記憶されている各入力パターンごとに小さなプロセッサを設け、MSP1AやSSP1Bとは独立して入力予測値を求めるようにする。
(Input prediction method)
Next, the problem (2) how to predict the input will be described. In advance execution, it is necessary to predict a future input based on the usage history of the instruction section storage unit 2 and pass it to the SSP 1B. For this purpose, a small processor is provided for each input pattern stored in the instruction section storage unit 2, and an input predicted value is obtained independently of the MSP 1A and SSP 1B.

具体的には、最後に出現した引数(B)および最近出現した2組の引数の差分(D)に基づいて、ストライド予測を行う。なお、B+Dに基づく命令区間の実行はMSP1Aがすでに開始していると考える。SSP1BがN台の場合には、用意する入力予測値は、B+D×2からB+D×(N+1)までの範囲とする。   Specifically, stride prediction is performed based on the last appearing argument (B) and the difference (D) between the two most recently appearing arguments. Note that the execution of the instruction interval based on B + D is considered to have already started by MSP 1A. When there are N SSPs 1B, the input predicted values to be prepared are in the range from B + D × 2 to B + D × (N + 1).

以上のように入力予測を行えば、上記した入力パラメータが単調に変化し続けるような場合に、事前に予測しておいた結果に基づいて効果的に再利用を行うことが可能となる。   If the input prediction is performed as described above, it is possible to effectively reuse the input parameter based on the result predicted in advance when the above-described input parameter continues to change monotonously.

本発明に係るデータ処理装置は、上記したようにSPARCプロセッサに適用することが可能である。また、SPARCプロセッサと同様に、32本以上の汎用レジスタを有する多くのRISCプロセッサにも適用することが可能である。   The data processing apparatus according to the present invention can be applied to the SPARC processor as described above. Further, like the SPARC processor, the present invention can be applied to many RISC processors having 32 or more general-purpose registers.

本発明の一実施形態に係るデータ処理装置が備える命令区間記憶部の概略構成を示す図である。It is a figure which shows schematic structure of the instruction area memory | storage part with which the data processor which concerns on one Embodiment of this invention is provided. 上記データ処理装置の概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the said data processor. 上記命令区間記憶部における連想検索動作の具体例を示す図である。It is a figure which shows the specific example of the associative search operation | movement in the said instruction area memory | storage part. 同図(b)は、上記命令区間記憶部における連想検索動作の他の具体例を示す図であり、同図(a)は、同図(b)における連想検索動作を木構造として示す図である。FIG. 5B is a diagram showing another specific example of the associative search operation in the instruction section storage unit, and FIG. 6A is a diagram showing the associative search operation in FIG. is there. 同図(b)は、上記命令区間記憶部における連想検索動作のさらに他の具体例を示す図であり、同図(a)は、同図(b)における連想検索動作を木構造として示す図である。FIG. 4B is a diagram showing still another specific example of the associative search operation in the instruction section storage unit, and FIG. 4A is a diagram showing the associative search operation in FIG. It is. 関数およびループが入れ子構造となっている状態の一例を示す図である。It is a figure which shows an example of the state where the function and the loop are nested. 関数の入れ子構造において、内側の構造のレジスタ入出力が、外側の構造のレジスタ入出力となる影響範囲を示す図である。It is a figure which shows the influence range from which the register input / output of an inner structure turns into the register input / output of an outer structure in the nested structure of a function. 比較例におけるRFおよびRBの概略構成を示す図である。It is a figure which shows schematic structure of RF and RB in a comparative example. 比較例における検索動作の例を示す図である。It is a figure which shows the example of the search operation in a comparative example. 同図(a)は、関数Aが関数Bを呼び出す構造を概念的に示す概念図であり、同図(b)は、同図(a)に示すプログラム構造を実行する際の主記憶におけるメモリマップを示す図である。FIG. 6A is a conceptual diagram conceptually showing a structure in which the function A calls the function B, and FIG. 6B is a memory in the main memory when executing the program structure shown in FIG. It is a figure which shows a map. 関数Aが関数Bを呼び出す場合の、メモリマップにおける引数およびフレームの概要を示す図である。It is a figure which shows the outline | summary of the argument and frame in a memory map when the function A calls the function B. 1つの関数を再利用するための従来の再利用表を示す図である。It is a figure which shows the conventional reuse table for reusing one function.

符号の説明Explanation of symbols

1A MSP
1B SSP
2 命令区間記憶部(命令区間記憶手段)
3 主記憶(主記憶手段)
4A・4B RW(第1・第2の演算手段)
5A・5B 演算器(第1・第2の演算手段)
6A・6B レジスタ
7A・7B Cache
1A MSP
1B SSP
2 Command section storage (command section storage means)
3 Main memory (main memory means)
4A / 4B RW (first and second calculation means)
5A / 5B computing unit (first and second computing means)
6A ・ 6B Register 7A ・ 7B Cache

Claims (14)

主記憶手段から命令区間を読み出し、演算処理を行った結果を主記憶手段に書き込む処理を行うデータ処理装置において、
上記主記憶手段から読み出した命令区間に基づく演算を行う第1の演算手段と、上記第1の演算手段による上記主記憶手段に対する読み出しおよび書き込み時に用いられるレジスタと、複数の命令区間に関する入力パターンおよび出力パターンを記憶する命令区間記憶手段とを備え、
上記第1の演算手段が、命令区間を実行する際に、該命令区間の入力パターンと、上記命令区間記憶手段に記憶されている入力パターンとが一致した場合、該入力パターンと対応して上記命令区間記憶手段に記憶されている出力パターンをレジスタおよび/または主記憶手段に出力する再利用処理を行い、
上記命令区間記憶手段が、複数の上記入力パターンを、一致比較すべき項目をノードとみなした木構造として記憶する入力パターン記憶手段を備え
上記入力パターン記憶手段が、上記入力パターンにおいて一致比較すべき項目の値と、次に比較すべき項目とを対応させて格納することによって、上記木構造を実現するとともに、
上記入力パターン記憶手段が、連想検索手段と、付加記憶手段とを備え、
上記連想検索手段が、一致比較すべき項目の値を格納する値格納領域と、該項目を識別するキーを格納するキー格納領域とを有する1つ以上の検索対象ラインを備え、
上記付加記憶手段が、上記検索対象ラインに対応した対応ラインごとに、次に連想検索を行うべき項目を格納する検索項目指定領域を有していることを特徴とするデータ処理装置。
In a data processing apparatus that reads a command section from a main storage means and performs a process of writing a result of arithmetic processing to the main storage means,
A first arithmetic unit that performs an operation based on an instruction section read from the main storage unit; a register used when reading and writing to the main storage unit by the first arithmetic unit; an input pattern for a plurality of instruction sections; Command section storage means for storing the output pattern,
When the first calculation means executes an instruction section, if the input pattern of the instruction section matches the input pattern stored in the instruction section storage means, the input section corresponds to the input pattern. Reuse processing for outputting the output pattern stored in the instruction section storage means to the register and / or main storage means,
The command section storage means includes an input pattern storage means for storing a plurality of the input patterns as a tree structure in which items to be matched are regarded as nodes ,
The input pattern storage means realizes the tree structure by storing the value of the item to be matched and compared in the input pattern in correspondence with the item to be compared next, and
The input pattern storage means includes an associative search means and an additional storage means,
The associative search means includes one or more search target lines each having a value storage area for storing a value of an item to be matched and a key storage area for storing a key for identifying the item,
The data processing apparatus , wherein the additional storage means has a search item designation area for storing an item to be subjected to an associative search next for each corresponding line corresponding to the search target line .
上記付加記憶手段が、上記対応ラインごとに、次に連想検索を行うべき項目がないことを示す終端フラグを格納する終端提示領域をさらに有していることを特徴とする請求項1記載のデータ処理装置。 2. The data according to claim 1, wherein the additional storage means further includes a terminal presentation area for storing a terminal flag indicating that there is no item to be searched next for each corresponding line. Processing equipment. 上記付加記憶手段が、上記対応ラインごとに、上記検索項目指定領域で指定されている項目に関して、値の一致比較を行う必要があることを示す比較要フラグを格納する比較要提示領域をさらに有していることを特徴とする請求項1または2記載のデータ処理装置。 The additional storage means further includes a comparison required presentation area for storing a comparison required flag indicating that it is necessary to perform a value matching comparison for the item specified in the search item specifying area for each corresponding line. The data processing apparatus according to claim 1, wherein the data processing apparatus is a data processing apparatus. 上記付加記憶手段が、上記対応ラインごとに、次に値の一致比較を行うべき項目を示す比較要項目指定領域と、次に値の一致比較を行うべき項目を識別するキーを格納する比較要キー指定領域とをさらに有していることを特徴とする請求項1〜3のいずれか一項に記載のデータ処理装置。 The additional storage means stores, for each of the corresponding lines, a comparison required item designating area indicating an item to be subjected to the next value matching comparison, and a comparison item for storing a key for identifying an item to be subjected to the next value matching comparison. The data processing apparatus according to claim 1, further comprising a key designation area . 上記付加記憶手段が、上記対応ラインごとに、直前に連想検索が行われた上記検索対象ラインを示す親ノード格納領域をさらに有していることを特徴とする請求項4記載のデータ処理装置。 5. The data processing apparatus according to claim 4, wherein the additional storage means further includes a parent node storage area indicating the search target line for which an associative search has been performed immediately before, for each corresponding line . 主記憶手段から命令区間を読み出し、演算処理を行った結果を主記憶手段に書き込む処理を行うデータ処理装置において、
上記主記憶手段から読み出した命令区間に基づく演算を行う第1の演算手段と、上記第1の演算手段による上記主記憶手段に対する読み出しおよび書き込み時に用いられるレジスタと、複数の命令区間に関する入力パターンおよび出力パターンを記憶する命令区間記憶手段とを備え、
上記第1の演算手段が、命令区間を実行する際に、該命令区間の入力パターンと、上記命令区間記憶手段に記憶されている入力パターンとが一致した場合、該入力パターンと対応して上記命令区間記憶手段に記憶されている出力パターンをレジスタおよび/または主記憶手段に出力する再利用処理を行い、
上記命令区間記憶手段が、上記各出力パターンを、出力すべき項目ごとに格納するとともに、出力すべき項目ごとに、次に出力すべき項目が格納されている位置を特定する情報が格納されている第1出力パターン記憶手段を備え、
上記命令区間記憶手段が、複数の上記入力パターンに1対1で対応して、上記出力パターンにおける出力すべき項目を格納する第2出力パターン記憶手段をさらに備えており、
上記第1出力パターン記憶手段は、上記第2出力パターン記憶手段に格納し切れなかった項目を格納することを特徴とするデータ処理装置。
In a data processing apparatus that reads a command section from a main storage means and performs a process of writing a result of arithmetic processing to the main storage means,
A first arithmetic unit that performs an operation based on an instruction section read from the main storage unit; a register used when reading and writing to the main storage unit by the first arithmetic unit; an input pattern for a plurality of instruction sections; Command section storage means for storing the output pattern,
When the first calculation means executes an instruction section, if the input pattern of the instruction section matches the input pattern stored in the instruction section storage means, the input section corresponds to the input pattern. Reuse processing for outputting the output pattern stored in the instruction section storage means to the register and / or main storage means,
The command section storage means stores each output pattern for each item to be output, and for each item to be output, information for specifying a position where an item to be output next is stored. First output pattern storage means,
The command section storage means further includes second output pattern storage means for storing items to be output in the output pattern in one-to-one correspondence with the plurality of input patterns.
The first output pattern storage means stores items that could not be stored in the second output pattern storage means .
上記命令区間記憶手段が、上記各出力パターンを、出力すべき項目ごとに格納するとともに、出力すべき項目ごとに、次に出力すべき項目が格納されている位置を特定する情報が格納されている第1出力パターン記憶手段を備えていることを特徴とする請求項1〜5のいずれか一項に記載のデータ処理装置。 The command section storage means stores each output pattern for each item to be output, and for each item to be output, information for specifying a position where an item to be output next is stored. 6. The data processing apparatus according to claim 1, further comprising first output pattern storage means . 上記命令区間記憶手段が、複数の上記入力パターンに1対1で対応して、上記出力パターンにおける出力すべき項目を格納する第2出力パターン記憶手段をさらに備えており、
上記第1出力パターン記憶手段は、上記第2出力パターン記憶手段に格納し切れなかった項目を格納することを特徴とする請求項7記載のデータ処理装置。
The command section storage means further includes second output pattern storage means for storing items to be output in the output pattern in one-to-one correspondence with the plurality of input patterns.
8. A data processing apparatus according to claim 7, wherein said first output pattern storage means stores items that could not be stored in said second output pattern storage means .
上記入力パターンが、命令区間の先頭を特定するプログラムカウント値、該命令区間の実行時に上記レジスタに入力されるレジスタ入力値、および/または、該命令区間の実行時に上記主記憶手段に入力される主記憶入力値を上記項目として含んでおり、
上記出力パターンが、上記命令区間の実行時に上記レジスタに出力されるレジスタ出力値、および/または、該命令区間の実行時に上記主記憶手段に出力される主記憶出力値を上記項目として含んでいることを特徴とする請求項1〜8のいずれか一項に記載のデータ処理装置。
The input pattern is input to the main memory means at the time of execution of the program count value specifying the head of the instruction interval, the register input value input to the register when the instruction interval is executed, and / or the instruction interval. The main memory input value is included as the above item,
The output pattern includes a register output value output to the register during execution of the instruction section and / or a main storage output value output to the main storage means during execution of the instruction section as the item. The data processing device according to claim 1, wherein the data processing device is a data processing device.
上記第1の演算手段が、命令区間を実行する際に、上記入力パターン記憶手段に記憶されている入力パターンにおける各項目の比較順序に従って、該命令区間の入力パターンの各項目を一致比較していき、一致しない項目が出現した時点で、再利用処理を行わずに演算処理を行うとともに、一致しない項目について、上記入力パターン記憶手段に登録し、演算処理結果としての出力パターンを命令区間記憶手段に登録することを特徴とする請求項1〜5、および7〜9のいずれか一項に記載のデータ処理装置。 When the first arithmetic means executes the instruction section, the items of the input pattern of the instruction section are compared and compared according to the comparison order of the items in the input pattern stored in the input pattern storage means. Then, when an unmatched item appears, the calculation process is performed without performing the reuse process, and the unmatched item is registered in the input pattern storage unit, and the output pattern as the calculation process result is stored in the instruction section storage unit. The data processing apparatus according to any one of claims 1 to 5 and 7 to 9 . 上記第1の演算手段が、上記レジスタまたは上記主記憶手段における値が変更されたことを検出した場合に、値が変更された項目が、上記入力パターン記憶手段に入力パターンの項目として記憶されているものであると、上記付加記憶手段において、該項目に関して、上記比較要フラグを比較要としてセットすることを特徴とする請求項3記載のデータ処理装置。 When the first calculation means detects that the value in the register or the main storage means has been changed, the item whose value has been changed is stored as an input pattern item in the input pattern storage means. 4. The data processing apparatus according to claim 3, wherein the additional storage means sets the comparison required flag as a comparison required for the item . 少なくとも1つの第2の演算手段をさらに備え、
上記第2の演算手段が、上記第1の演算手段によって処理が行われている命令区間に関して、今後入力が予想される予測入力値に基づいて該命令区間の演算を行い、その結果を上記命令区間記憶手段に対して登録することを特徴とする請求項1〜11のいずれか一項に記載のデータ処理装置。
At least one second computing means;
The second calculation means performs calculation of the instruction section based on a predicted input value that is expected to be input in the future with respect to the instruction section being processed by the first calculation means, and the result is used as the instruction section. The data processing apparatus according to any one of claims 1 to 11, wherein registration is performed with respect to the section storage unit .
請求項1ないし12のいずれか一項に記載のデータ処理装置が備える第1の演算手段が行う処理をコンピュータに実行させることを特徴とするデータ処理プログラム。13. A data processing program for causing a computer to execute a process performed by a first arithmetic means included in the data processing apparatus according to claim 1. 請求項13記載のデータ処理プログラムを記録したコンピュータ読み取り可能な記録媒体。A computer-readable recording medium on which the data processing program according to claim 13 is recorded.
JP2003322090A 2003-09-12 2003-09-12 Data processing apparatus, data processing program, and recording medium on which data processing program is recorded Expired - Fee Related JP3895314B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003322090A JP3895314B2 (en) 2003-09-12 2003-09-12 Data processing apparatus, data processing program, and recording medium on which data processing program is recorded

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003322090A JP3895314B2 (en) 2003-09-12 2003-09-12 Data processing apparatus, data processing program, and recording medium on which data processing program is recorded

Publications (2)

Publication Number Publication Date
JP2005092354A JP2005092354A (en) 2005-04-07
JP3895314B2 true JP3895314B2 (en) 2007-03-22

Family

ID=34453571

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003322090A Expired - Fee Related JP3895314B2 (en) 2003-09-12 2003-09-12 Data processing apparatus, data processing program, and recording medium on which data processing program is recorded

Country Status (1)

Country Link
JP (1) JP3895314B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007048411A (en) * 2005-08-12 2007-02-22 Kyoto Univ Content addressable memory system, method of controlling content adressable memory system, and data processor
CN102667715A (en) * 2009-08-13 2012-09-12 索尼公司 Data processing device, data processing method, program conversion processing device, and program conversion processing method, program conversion processing device, data processing device, program conversion processing method, and data processing me

Also Published As

Publication number Publication date
JP2005092354A (en) 2005-04-07

Similar Documents

Publication Publication Date Title
KR100877138B1 (en) Data processing device, data processing program, and recording medium containing the data processing program
US4725947A (en) Data processor with a branch target instruction storage
US5974538A (en) Method and apparatus for annotating operands in a computer system with source instruction identifiers
US20150186293A1 (en) High-performance cache system and method
JP3110404B2 (en) Microprocessor, software instruction speed-up method therefor, and recording medium recording control program therefor
US6052776A (en) Branch operation system where instructions are queued until preparations is ascertained to be completed and branch distance is considered as an execution condition
US20030191792A1 (en) High speed virtual machine and compiler
KR19990087940A (en) A method and system for fetching noncontiguous instructions in a single clock cycle
KR20000062468A (en) Aligned instruction cache handling of instruction fetches across multiple predicted branch instructions
US9753855B2 (en) High-performance instruction cache system and method
JP3678443B2 (en) Write buffer for super pipelined superscalar microprocessor
CN1347029A (en) Microprocessor and method for processing instruction thereby
US6772317B2 (en) Method and apparatus for optimizing load memory accesses
US6625725B1 (en) Speculative reuse of code regions
US6871343B1 (en) Central processing apparatus and a compile method
US6836841B1 (en) Predicting output of a reuse region using prior execution results associated with the reuse region
JP4254954B2 (en) Data processing device
JP3855076B2 (en) Data processing apparatus, data processing program, and recording medium on which data processing program is recorded
US6629314B1 (en) Management of reuse invalidation buffer for computation reuse
KR20010070434A (en) Microprocessor utilizing basic block cache
US7383543B2 (en) Management of reuse invalidation buffer for computation reuse
JP3895314B2 (en) Data processing apparatus, data processing program, and recording medium on which data processing program is recorded
JP3906363B2 (en) Clustered superscalar processor and intercluster communication control method in clustered superscalar processor
JP3855077B2 (en) Data processing apparatus, data processing program, and recording medium on which data processing program is recorded
JP4654433B2 (en) Data processing apparatus, data processing program, and recording medium on which data processing program is recorded

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060411

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20060411

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060912

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061107

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20061213

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees