JP3795055B1 - Value prediction apparatus, multiprocessor system, and value prediction method - Google Patents

Value prediction apparatus, multiprocessor system, and value prediction method Download PDF

Info

Publication number
JP3795055B1
JP3795055B1 JP2005128312A JP2005128312A JP3795055B1 JP 3795055 B1 JP3795055 B1 JP 3795055B1 JP 2005128312 A JP2005128312 A JP 2005128312A JP 2005128312 A JP2005128312 A JP 2005128312A JP 3795055 B1 JP3795055 B1 JP 3795055B1
Authority
JP
Japan
Prior art keywords
prediction
value
circuit
update
history
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
JP2005128312A
Other languages
Japanese (ja)
Other versions
JP2006309335A (en
Inventor
大輔 田代
修一 坂井
Original Assignee
株式会社半導体理工学研究センター
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 株式会社半導体理工学研究センター filed Critical 株式会社半導体理工学研究センター
Priority to JP2005128312A priority Critical patent/JP3795055B1/en
Application granted granted Critical
Publication of JP3795055B1 publication Critical patent/JP3795055B1/en
Publication of JP2006309335A publication Critical patent/JP2006309335A/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Advance Control (AREA)

Abstract

【課題】 予測テーブルを参照して予測を行い、予測テーブルを更新する値予測装置および方法に関し、予測の結果が確定して予測テーブルが更新される前に、同一のエントリに対する連続した予測の要求が呈示された場合に、正しい予測を行うことを目的とする。
【解決手段】 予測の処理が完了していない予測の履歴を保持する予測履歴保持手段5と、予測の履歴に含まれる識別子と予測の処理の開始時に付与される識別子とを比較し、両方の識別子が一致する回数を計数する計数手段6とを備え、予測回路1が、予測回路の出力値を更新回路2に送出し、この更新回路は、予測回路の出力値を用いて予測テーブルの状態を仮想的に更新し、この予測テーブルの状態を予測回路に返送し、予測回路は、仮想的に更新された予測テーブルの状態を用いて再度予測の処理を行い、両方の識別子が一致する回数に応じて、予測回路および更新回路の動作を繰り返すように構成される。
【選択図】 図2
PROBLEM TO BE SOLVED: To provide a value prediction apparatus and method for performing prediction with reference to a prediction table and updating the prediction table, and requesting continuous prediction for the same entry before the prediction result is confirmed and the prediction table is updated. The purpose is to make a correct prediction when is presented.
SOLUTION: A prediction history holding unit 5 that holds a history of a prediction for which prediction processing has not been completed is compared with an identifier included in the prediction history and an identifier given at the start of the prediction processing. Counting means 6 for counting the number of times the identifiers match, and the prediction circuit 1 sends the output value of the prediction circuit to the update circuit 2, which uses the output value of the prediction circuit to state the prediction table Is updated, and the state of the prediction table is returned to the prediction circuit. The prediction circuit performs the prediction process again using the state of the virtually updated prediction table, and the number of times that both identifiers match. The operation of the prediction circuit and the update circuit is repeated according to the above.
[Selection] Figure 2

Description

本発明は、予測の要求に応じて入力されるエントリ(事象)の識別子(通常、IDと略記される)をもとに予測テーブルを参照してデータの値の予測を行い、予測テーブルを更新する機能を有する値予測装置に関する。   The present invention predicts a data value by referring to a prediction table based on an identifier (usually abbreviated as ID) of an entry (event) input in response to a prediction request, and updates the prediction table The present invention relates to a value prediction apparatus having a function to

また一方で、本発明は、当該値予測装置を使用してスレッド単位の値投機実行を行うマルチプロセッサシステム、および、予測の要求に応じて入力されるエントリの識別子をもとに予測テーブルを参照してデータの値の予測を行うための値予測方法に関する。   On the other hand, the present invention refers to a multiprocessor system that performs value speculation execution in units of threads using the value prediction device, and refers to a prediction table based on an identifier of an entry that is input in response to a prediction request. The present invention relates to a value prediction method for predicting data values.

一般に、コンピュータシステムの性能向上を図るために、プロセッサ等のデータ処理装置においては、入力されるエントリの内容に応じて対応するデータの値を前もって予測する機能を備えた値予測装置(値予測器とも呼ばれる)が設けられている。この値予測装置は、通常、予測テーブルを参照してデータの値を予測を行い、予測の成否が確定した時点で予測テーブルを更新するという構造になっている。このような構造の値予測装置は、通常、データ処理装置と共に、LSI(大規模集積回路)等の半導体集積回路により作製される。   In general, in order to improve the performance of a computer system, in a data processing apparatus such as a processor, a value prediction apparatus (value predictor) having a function of predicting corresponding data values in advance according to the contents of an input entry. Also called). This value prediction apparatus is generally configured to predict a data value by referring to a prediction table, and to update the prediction table when the success or failure of the prediction is confirmed. The value predicting device having such a structure is usually manufactured by a semiconductor integrated circuit such as an LSI (Large Scale Integrated Circuit) together with a data processing device.

図1は、従来の値予測装置の構成を示すブロック図である。ただし、ここでは、プロセッサ等のデータ処理装置に使用される従来の値予測装置100の構成を簡略化して示す。   FIG. 1 is a block diagram showing a configuration of a conventional value prediction apparatus. However, here, the configuration of a conventional value prediction apparatus 100 used in a data processing apparatus such as a processor is shown in a simplified manner.

図1の従来の値予測装置100は、基本的に、予測の要求に応じて入力されるエントリの識別子(図1のID)をもとに予測テーブル30を参照して対応するデータの値の予測を行う予測回路1と、この予測回路1による予測の成否が確定した時点で、上記予測回路1の出力値を予測値PVとして予測テーブル30内の対応するデータの値を更新する更新回路2とを備えている。   The conventional value prediction apparatus 100 in FIG. 1 basically refers to the prediction table 30 based on the identifier of the entry (ID in FIG. 1) input in response to a prediction request, and sets the value of the corresponding data. The prediction circuit 1 that performs the prediction, and the update circuit 2 that updates the value of the corresponding data in the prediction table 30 with the output value of the prediction circuit 1 as the prediction value PV when the prediction success or failure of the prediction circuit 1 is confirmed. And.

ここで、予測テーブル30は、通常、RAM(Random Access Memory:ランダム・アクセス・メモリ)等の予測テーブル保持部3に内蔵されている。予測回路1による予測が成功したか否かが確定して予測の処理が完了した時点で、予測回路1から出力される予測値PVに対応する更新値RVが更新回路2に送出され、この更新回路2の更新の処理によって予測テーブル30内の対応するデータの値が更新される(すなわち、更新値RVによって対応するデータの値が書き替えられる)ようになっている。   Here, the prediction table 30 is normally built in the prediction table holding unit 3 such as a RAM (Random Access Memory). When it is determined whether or not the prediction by the prediction circuit 1 is successful and the prediction process is completed, an update value RV corresponding to the prediction value PV output from the prediction circuit 1 is sent to the update circuit 2, and this update is performed. The value of the corresponding data in the prediction table 30 is updated by the update process of the circuit 2 (that is, the value of the corresponding data is rewritten by the update value RV).

さらに、図1の値予測装置100は、入力されるエントリの識別子(ID)に基づいて予測テーブル30を参照するためのインデックスを生成するハッシュ回路4を備えている。このハッシュ回路4では、入力されるエントリの識別子に基づいて、当該エントリに関するデータが予測テーブル30のどのアドレスに格納されているかを示すインデックスが生成される。   Furthermore, the value prediction apparatus 100 in FIG. 1 includes a hash circuit 4 that generates an index for referring to the prediction table 30 based on an identifier (ID) of an input entry. In the hash circuit 4, an index indicating which address in the prediction table 30 stores the data related to the entry is generated based on the identifier of the input entry.

図1の値予測装置100において、予測回路1および更新回路2の機能は、通常、コンピュータシステムの各種の制御を行うCPU(Central Processing Unit:中央演算処理装置)12により実現される。さらに、このCPU12においては、ROM(Read-only Memory:リード・オンリ・メモリ)またはRAM等の記憶部14が設けられている。この記憶部14は、予測回路1および更新回路2の機能を実行するためのプログラムを含む各種のプログラムが予め格納されている。なお、上記のROMまたはRAMとして、CPU12に内蔵のROMやRAMを用いることも可能である。   In the value prediction device 100 of FIG. 1, the functions of the prediction circuit 1 and the update circuit 2 are usually realized by a CPU (Central Processing Unit) 12 that performs various controls of the computer system. Further, the CPU 12 is provided with a storage unit 14 such as a ROM (Read-Only Memory) or a RAM. The storage unit 14 stores in advance various programs including programs for executing the functions of the prediction circuit 1 and the update circuit 2. Note that a ROM or RAM built in the CPU 12 can be used as the ROM or RAM.

さらに、図1の値予測装置100は、この値予測装置100を含むコンピュータシステムの各種の制御を行うCPU(Central Processing Unit :中央演算処理装置)12が設けられている。さらに、このCPU12においては、ROM(Read-only Memory:リード・オンリ・メモリ)またはRAM等の記憶部14が設けられている。この記憶部14には、コンピュータシステムの各種の制御を行うためのプログラムが予め格納されている。なお、上記のROMまたはRAMとして、CPU12に内蔵のROMやRAMを用いることも可能である。   Further, the value prediction apparatus 100 of FIG. 1 is provided with a CPU (Central Processing Unit) 12 that performs various controls of the computer system including the value prediction apparatus 100. Further, the CPU 12 is provided with a storage unit 14 such as a ROM (Read-Only Memory) or a RAM. The storage unit 14 stores in advance programs for performing various controls of the computer system. Note that a ROM or RAM built in the CPU 12 can be used as the ROM or RAM.

上記の予測回路1および更新回路2は、通常、演算回路やレジスタ等を含むハードウェア回路により構成される。しかしながら、予測回路1および更新回路2の機能をCPU12により実現することも可能である。この場合は、前述のような予測回路1および更新回路2の機能を実行するためのプログラムが、記憶部14に格納されている。CPU12により記憶部14から当該プログラムを読み出して実行させることによって、予測回路1および更新回路2の機能がソフトウェアにより実現されることになる。   The prediction circuit 1 and the update circuit 2 are usually configured by a hardware circuit including an arithmetic circuit and a register. However, the functions of the prediction circuit 1 and the update circuit 2 can be realized by the CPU 12. In this case, a program for executing the functions of the prediction circuit 1 and the update circuit 2 as described above is stored in the storage unit 14. By reading the program from the storage unit 14 and executing it by the CPU 12, the functions of the prediction circuit 1 and the update circuit 2 are realized by software.

前述のように、図1の従来の値予測装置100では、入力されるエントリの識別子をもとに予測テーブル30を参照して対応するデータの値の予測を行い、予測結果が確定して予測の処理が完了した時点で、予測回路1の出力値を予測値PV(すなわち、更新値RV)として予測テーブル30内の対応するデータの値を更新するような構造になっている。   As described above, the conventional value prediction apparatus 100 of FIG. 1 performs prediction of the value of the corresponding data by referring to the prediction table 30 based on the identifier of the input entry, and the prediction result is confirmed and predicted. When the above process is completed, the output value of the prediction circuit 1 is set as the predicted value PV (that is, the update value RV), and the value of the corresponding data in the prediction table 30 is updated.

それゆえに、入力されるエントリの識別子をもとに予測テーブル30を参照してデータの値の予測を行い、予測結果が確定して予測テーブル30が更新される前に、続けて同一のエントリに対して予測を行おうとする場合には、予測テーブル30内の対応するデータの値が更新されていないという事態が生ずる。この場合、予測テーブル30内のデータの値が更新後の適切な値になっていないので、同一のエントリに対して正しい予測を行うことができないという問題が発生する。   Therefore, the prediction of the data value is performed by referring to the prediction table 30 based on the identifier of the input entry, and before the prediction result is confirmed and the prediction table 30 is updated, the same entry is continuously recorded. On the other hand, when the prediction is to be performed, a situation occurs in which the value of the corresponding data in the prediction table 30 is not updated. In this case, since the value of the data in the prediction table 30 is not an appropriate value after the update, a problem that correct prediction cannot be performed on the same entry occurs.

換言すれば、従来の値予測装置では、1回目の予測の要求に応じて入力されるエントリに対する予測を行うタイミングと、予測結果が確定して予測テーブルを更新するタイミングとの間の期間では、同一のエントリに対する2回目またはそれ以上の予測の要求がなされても正しい予測を行うことができないようになっている。したがって、従来の値予測装置では、入力されるエントリに対し予測テーブルを参照して予測動作を実行した後に、予測テーブルを更新することにより更新動作を完了させることが必要であり、上記の予測動作と更新動作との間に、同一のエントリに対する連続した予測の要求が呈示されても適切に対応することができない。   In other words, in the conventional value prediction apparatus, in a period between the timing of performing the prediction on the entry input in response to the first prediction request and the timing of updating the prediction table after the prediction result is confirmed, Even if a second or more prediction request is made for the same entry, correct prediction cannot be performed. Therefore, in the conventional value predicting apparatus, it is necessary to complete the update operation by updating the prediction table after executing the prediction operation with reference to the prediction table for the input entry. Even if a continuous prediction request for the same entry is presented between the update operation and the update operation, it cannot be appropriately handled.

従来の値予測装置を用いてデータの値の予測を行う場合、予測テーブルを参照して予測を行ってから予測テーブル内のデータの値を更新するまでの時間が比較的短いケース、あるいは、予測テーブルの更新によって予測テーブル内のデータの値が大幅に変化しないケースでは、上記の問題はそれほど大きくならずに済む。しかしながら、特に、スレッド単位の値予測による値投機実行を行う場合等のように比較的粗い単位で複雑な予測を行う場合には、予測テーブルを参照して予測を行ってから予測テーブルを更新するまでの時間が長期化し、上記のような問題が深刻になってくる。   When predicting the value of data using a conventional value prediction device, the time from when the prediction is made with reference to the prediction table until the value of the data in the prediction table is updated is relatively short, or prediction In the case where the value of data in the prediction table does not change significantly by updating the table, the above problem does not become so large. However, in particular, when performing complex prediction in a relatively coarse unit, such as when performing value speculation by thread unit value prediction, the prediction table is updated after performing prediction with reference to the prediction table. The above time becomes longer and the above problems become serious.

ここで、参考のため、前述のような従来の値予測装置に関連した下記の特許文献1〜7を先行技術文献として呈示する。特に、特許文献5〜8では、値予測装置によるスレッド単位の値予測を利用したスレッド投機実行装置を例示している。   Here, for reference, the following patent documents 1 to 7 related to the conventional value predicting apparatus as described above are presented as prior art documents. In particular, Patent Documents 5 to 8 exemplify thread speculative execution apparatuses that use value prediction in units of threads by a value prediction apparatus.

特許文献1では、分岐予測を行う場合に、過去の分岐の履歴を用いて予測を行うのではなく、データ値予測器により算出した予測データ値を用いて実際に分岐命令を実行して予測を行うプロセッサが開示されている。   In Patent Document 1, when branch prediction is performed, prediction is performed by actually executing a branch instruction using a prediction data value calculated by a data value predictor, instead of performing prediction using a history of past branches. A processor for performing is disclosed.

特許文献2では、命令の一部に値予測を行うべきか否かを指示するフィールドを設け、このフィールドに基づいて、値予測により性能向上が図れる命令にのみ値予測を適用するための命令または命令キャッシュを用意することで、不必要な値予測による性能低下を抑制すると共に、値予測を行う際の予測精度を向上させるようにしたプロセッサが開示されている。   In Patent Document 2, a field for instructing whether or not to perform value prediction is provided in a part of an instruction, and an instruction for applying value prediction only to an instruction whose performance can be improved by value prediction based on this field or A processor has been disclosed in which an instruction cache is prepared to suppress performance degradation due to unnecessary value prediction and to improve prediction accuracy when performing value prediction.

特許文献3では、プロセッサがメモリ操作命令を実行する際に、過去における投機実行の成否結果の履歴を参照して、データ投機実行が成功するか否かを予測し、成功が予測される場合、メモリ操作命令を非プログラム順序でデータ依存に関して投機的に実行し、失敗が予測される場合、メモリ操作命令をプログラム順序で確定的に実行することによって、データ依存投機実行の失敗確率を低減させ、プログラムの実行性能を向上させるようにしたデータ依存投機実行制御装置が開示されている。このようなデータ依存投機実行制御装置では、データ投機実行の成否の予測に際して、ロード命令の対象アドレスは、例えば、ハッシュ関数回路により、投機実行成否履歴テーブルの特定のエントリに重複を許して割り当てるようにしている。   In Patent Literature 3, when a processor executes a memory operation instruction, it refers to a history of success / failure results of speculative execution in the past, predicts whether data speculative execution is successful, and if success is predicted, If the memory operation instruction is speculatively executed with respect to data dependency in a non-program order and a failure is predicted, the failure probability of the data dependency speculative execution is reduced by executing the memory operation instruction deterministically in the program order, A data-dependent speculative execution control device that improves the execution performance of a program is disclosed. In such a data-dependent speculative execution control device, when predicting the success or failure of data speculative execution, the target address of the load instruction is assigned to a specific entry in the speculative execution success / failure history table with duplication, for example, by a hash function circuit. I have to.

特許文献4では、PHT(Pattern History Table )を用いた分岐予測方式において、タグ付きPHTユニットを複数のユニットに分割し、可能な限り小さなメモリ容量を使用しながらエントリ干渉を回避して分岐予測の精度を向上させるようにした分岐予測装置が開示されている。   In Patent Document 4, in a branch prediction method using PHT (Pattern History Table), a tagged PHT unit is divided into a plurality of units, and entry interference is avoided while using as little memory capacity as possible to perform branch prediction. A branch prediction apparatus that improves accuracy is disclosed.

特許文献5では、マルチプロセッサシステムにおいて選択的値予測による予測値に基づいてタスクレベルの命令を投機的に実行するプロセッサと、このプロセッサに接続され、値予測の検証を行う検証装置とを備え、プロセッサからの検証要求によってプロセッサの実行状態を監視し、予測が外れていた場合はプロセッサに割り込みを発生させるようにした投機的実行装置が開示されている。   Patent Document 5 includes a processor that speculatively executes a task level instruction based on a predicted value by selective value prediction in a multiprocessor system, and a verification device that is connected to the processor and performs verification of value prediction. A speculative execution device is disclosed in which the execution state of a processor is monitored by a verification request from the processor and an interrupt is generated in the processor if the prediction is not correct.

特許文献6では、複数のスレッドに属する命令群を単一の命令処理装置内で並列に実行するための制御手段を有し、スレッド分割手段で同一のスレッドに属しデータの生成と使用の依存関係にある命令のペアを認識して複数のスレッドに分割し、データ値が実際に生成される前に値予測手段でデータ値を予測し、上記制御手段は、値予測手段で予測した値に基づいて、上記データを使用する命令を別スレッドとして、命令実行手段で投機的に実行することによって、同一のスレッドに属しデータの生成と使用の依存関係にある命令のペアを並列に実行することができるようにした投機実行型のプロセッサが開示されている。   In Patent Document 6, there is a control unit for executing a group of instructions belonging to a plurality of threads in parallel in a single instruction processing device, and the dependency of generation and use of data belonging to the same thread by a thread dividing unit The instruction pair is recognized and divided into a plurality of threads, and the data value is predicted by the value prediction unit before the data value is actually generated. The control unit is based on the value predicted by the value prediction unit. By executing the instruction using the data as a separate thread and speculatively executing by the instruction execution means, it is possible to execute in parallel a pair of instructions belonging to the same thread and having a dependency on generation and use of data. There is disclosed a speculative execution type processor that can be used.

特許文献7では、プログラムを複数のスレッドに分割し、これらのスレッドを複数のプロセッサに割り当てて投機的に実行させる場合、各々のプロセッサの動作を制御するスレッドマネージャにより、投機実行状態にある少なくとも一部のプロセッサを用いて、プログラム内の複数の実行経路を同時に投機的に実行させるようにした投機的マルチスレッド処理装置が開示されている。   In Patent Document 7, when a program is divided into a plurality of threads and these threads are allocated to a plurality of processors and executed speculatively, at least one in a speculative execution state is executed by a thread manager that controls the operation of each processor. A speculative multi-thread processing device is disclosed in which a plurality of execution paths in a program are speculatively executed at the same time using a certain processor.

特許文献8では、複数のスレッド実行部を有する並列処理装置上のスレッド実行部を有効に利用して、条件分岐命令以降の命令で分岐側と非分岐側の両者を投機的に実行し、条件分岐命令が確定した時点で、誤った側の実行を取り消すことにより、実質的に分岐予測が外れることなく実行を継続することを可能にするような並列処理装置が開示されている。   In Patent Document 8, a thread execution unit on a parallel processing device having a plurality of thread execution units is effectively used, and both branch side and non-branch side are speculatively executed by an instruction after a conditional branch instruction. A parallel processing device is disclosed that allows execution to be continued without substantially deviating from branch prediction by canceling execution on the wrong side when a branch instruction is determined.

しかしながら、特許文献1〜8のいずれにおいても、入力されるエントリに対し予測テーブルを参照してデータの値の予測を行い、予測結果が確定して予測テーブルが更新される前に、同一のエントリに対する連続した予測の要求が呈示された場合の対処方法に関しては一切言及していない。それゆえに、特許文献1〜8のいずれにおいても、前述のような従来の値予測装置と同様の問題が発生する。   However, in any of Patent Documents 1 to 8, the same entry is entered before prediction of the data value is performed by referring to the prediction table for the input entry, and the prediction result is confirmed and the prediction table is updated. No mention is made as to what to do when a request for continuous prediction is presented. Therefore, in any of Patent Documents 1 to 8, a problem similar to that of the conventional value prediction apparatus as described above occurs.

特開2000−132390号公報JP 2000-132390 A 特開2002−312162号公報JP 2002-312162 A 特開2002−351657号公報JP 2002-351657 A 特開2003−5956号公報Japanese Patent Laid-Open No. 2003-5956 特開2001−75802号公報JP 2001-75802 A 特開2001−356904号公報JP 2001-356904 A 特開2000−47887号公報JP 2000-47887 A 特開平11−96005号公報Japanese Patent Laid-Open No. 11-96005

本発明は上記問題点に鑑みてなされたものであり、入力されるエントリに対するデータの値の予測を行い、予測結果が確定して予測テーブルが更新される前に、同一のエントリに対する連続した予測の要求が呈示された場合に、正しい予測を行うことができるような値予測装置、マルチプロセッサシステムおよび値予測方法を提供することを目的とするものである。   The present invention has been made in view of the above problems, and predicts data values for an input entry, and continuously predicts the same entry before the prediction result is confirmed and the prediction table is updated. It is an object of the present invention to provide a value predicting apparatus, a multiprocessor system, and a value predicting method capable of performing correct prediction when the above request is presented.

上記問題点を解決するために、本発明の値予測装置は、予測の対象であるエントリが入力される度に、上記エントリの識別子に基づいて予測テーブルに既に保存されているデータを参照し、上記データの値の予測を行う予測回路と、上記予測回路による予測の処理が完了した時点で、上記予測回路の出力値を予測値として上記予測テーブル内の対応するデータの値を更新する更新回路とを有し、さらに、予測の処理が現在進行中で完了していない予測の履歴を一時的に保持する予測履歴保持手段と、上記予測の履歴に含まれる識別子と、上記予測の処理の開始時に付与される識別子とを比較し、両方の識別子が互いに一致する回数を計数する計数手段とを備え、上記両方の識別子が一致する回数が存在する場合、上記予測回路は、上記予測の処理を行って得られる上記予測回路の出力値を上記更新回路に送出し、上記更新回路は、上記予測回路の出力値を用いて上記予測テーブルの状態を仮想的に更新し、仮想的に更新された上記予測テーブルの状態を上記予測回路に返送し、上記予測回路は、仮想的に更新された上記予測テーブルの状態を用いて再度予測の処理を行い、上記両方の識別子が一致する回数に応じて、上記予測テーブルを実際に更新することなく上記予測回路および上記更新回路の動作を繰り返し、これによって得られる上記予測回路の出力値を最終的な予測値とするように構成される。   In order to solve the above problem, the value prediction apparatus of the present invention refers to data already stored in the prediction table based on the identifier of the entry every time an entry to be predicted is input, A prediction circuit that predicts the value of the data, and an update circuit that updates the value of the corresponding data in the prediction table using the output value of the prediction circuit as a prediction value when the prediction process by the prediction circuit is completed And a prediction history holding means for temporarily holding a prediction history that is currently in progress and is not completed, an identifier included in the prediction history, and start of the prediction processing Counting means for comparing the identifiers given at times and counting the number of times both identifiers match each other, and when there is a number of times that both identifiers match, the prediction circuit The output value of the prediction circuit obtained by performing processing is sent to the update circuit, and the update circuit virtually updates the state of the prediction table using the output value of the prediction circuit, and virtually updates The predicted state of the prediction table is returned to the prediction circuit, and the prediction circuit performs a prediction process again using the virtually updated state of the prediction table, and determines the number of times that both the identifiers match. Accordingly, the operation of the prediction circuit and the update circuit is repeated without actually updating the prediction table, and the output value of the prediction circuit obtained thereby is used as the final prediction value.

好ましくは、本発明の値予測装置において、上記両方の識別子が一致する回数が存在しない場合、上記予測回路は、一回だけ上記予測の処理を行い、これによって得られる上記予測回路の出力値を最終的な予測値とするようになっている。   Preferably, in the value predicting device of the present invention, when there is no number of times that the two identifiers match, the prediction circuit performs the prediction process only once, and obtains the output value of the prediction circuit obtained thereby. The final predicted value is used.

好ましくは、本発明の値予測装置において、上記両方の識別子が一致する回数が2以上である場合、上記予測回路および上記更新回路の動作が繰り返される間、仮想的に更新された上記予測テーブルの状態を一時的に保持するバッファ回路を設けている。   Preferably, in the value predicting apparatus of the present invention, when the number of times that both the identifiers match is 2 or more, the prediction table updated virtually while the operations of the prediction circuit and the update circuit are repeated. A buffer circuit for temporarily holding the state is provided.

好ましくは、本発明の値予測装置と、複数のプロセッサとを有するマルチプロセッサシステムにおいて、単一のスレッドのプログラムを複数のスレッドに分割し、上記複数のプロセッサによりスレッド単位の値予測による値投機実行を行う場合、上記複数のプロセッサにより処理されるべき上記複数のスレッドが上記エントリとして上記値予測装置に入力されるときに、上記複数のスレッドが上記値予測装置に入力される順番が入れ替わっても、それぞれの上記スレッドに対して正しい値予測を行うことが可能になる。   Preferably, in a multiprocessor system having the value predicting apparatus of the present invention and a plurality of processors, a program of a single thread is divided into a plurality of threads, and value speculation is performed by the plurality of processors by value prediction in units of threads. When the plurality of threads to be processed by the plurality of processors are input as the entry to the value prediction device, the order in which the plurality of threads are input to the value prediction device is switched. It is possible to perform correct value prediction for each of the above threads.

また一方で、本発明の値予測方法は、入力されるエントリの識別子をもとに予測テーブルに既に保存されているデータを参照して上記データの値の予測を行い、上記予測の処理が完了した時点で、上記予測の処理結果として得られる値を予測値として上記予測テーブル内の対応するデータの値を更新する場合、予測の処理が現在進行中で完了していない予測の履歴を一時的に保持するステップと、上記予測の履歴に含まれる識別子と、上記予測の処理の開始時に付与される識別子とを比較し、両方の識別子が互いに一致する回数を計数するステップと、上記両方の識別子が一致する回数が存在する場合、上記予測の処理結果として得られる値を用いて上記予測テーブルの状態を仮想的に更新し、仮想的に更新された上記予測テーブルの状態を用いて再度予測の処理を行うステップと、上記両方の識別子が一致する回数に応じて、上記予測テーブルを実際に更新することなく上記予測の処理を繰り返し、これによって得られる値を最終的な予測値とするステップとを有する。   On the other hand, the value prediction method of the present invention predicts the value of the data by referring to the data already stored in the prediction table based on the identifier of the input entry, and the prediction process is completed. When updating the value of the corresponding data in the prediction table using the value obtained as a result of the prediction process as a prediction value at the time of the prediction, the prediction history that is currently in progress and has not been completed is temporarily stored. And the step of comparing the identifiers included in the prediction history with the identifiers given at the start of the prediction process, counting the number of times both identifiers match each other, and both the identifiers Are present, the state of the prediction table is virtually updated using the value obtained as a result of the prediction process, and the state of the prediction table virtually updated is updated. The prediction process is repeated and the prediction process is repeated without actually updating the prediction table according to the number of times that both the identifiers match and the step of performing the prediction process again. And a step.

要約すれば、本発明では、入力されるエントリに対する識別子(ID)をもとにデータの値の予測を行ってから、予測の処理が現在進行中で予測テーブル内の対応するデータの値が更新されていない場合、以前の予測の履歴を予測履歴レジスタ等に一時的に保持し、予測の履歴に含まれる識別子と、予測の処理の開始時に付与される識別子とを比較し、両方の識別子が互いに一致する回数を計数している。   In summary, according to the present invention, after predicting the data value based on the identifier (ID) for the input entry, the prediction process is currently in progress and the corresponding data value in the prediction table is updated. If not, the previous prediction history is temporarily stored in the prediction history register, etc., and the identifier included in the prediction history is compared with the identifier given at the start of the prediction process. Counts the number of matches.

さらに、上記両方の識別子が一致する回数が存在する場合、予測の処理結果として得られる値を用いて予測テーブルの状態を仮想的に更新し、仮想的に更新された予測テーブルの状態を用いて再度予測の処理を行い、上記両方の識別子が一致する回数に応じて、予測テーブルを実際に更新することなく予測の処理を繰り返し、これによって得られる値を最終的な予測値として正しい予測を実現するようにしている。   Further, when there is a number of times that both of the above identifiers match, the state of the prediction table is virtually updated using a value obtained as a prediction processing result, and the state of the prediction table virtually updated is used. The prediction process is performed again, and the prediction process is repeated without actually updating the prediction table according to the number of times the above two identifiers match, and the correct prediction is realized using the resulting value as the final predicted value. Like to do.

それゆえに、本発明によれば、入力されるエントリに対するデータの値の予測を行った後に、以前の予測が進行中で予測テーブルが更新されていない状態で、同一のエントリに対する連続した予測の要求が呈示された場合でも、以前の予測の履歴により仮想的に更新された予測テーブルの状態を用いて、同一のエントリに対する以前の予測の処理を繰り返し行うことによって、最終的な予測値に基づいて正しい予測を行うことができるようになる。   Therefore, according to the present invention, after predicting the value of data for an input entry, a request for consecutive predictions for the same entry in a state where the previous prediction is in progress and the prediction table is not updated. Is presented based on the final predicted value by repeatedly processing the previous prediction for the same entry using the state of the prediction table virtually updated with the history of the previous prediction. The correct prediction can be made.

特に、本発明の値予測装置を含むマルチプロセッサシステムにおいて、スレッド単位の値予測による値投機実行を行う場合、本発明の値予測装置により仮想的に更新された予測テーブルの状態を用いて複数のスレッドを同時に実行することによって、複数のスレッドが値予測装置に入力される順番が入れ替わっても各々のスレッドに対して正しい値予測を行うことが可能になる。   In particular, in a multiprocessor system including the value prediction device of the present invention, when performing value speculation execution by value prediction in a thread unit, a plurality of prediction table states virtually updated by the value prediction device of the present invention are used. By executing the threads simultaneously, correct value prediction can be performed for each thread even if the order in which the plurality of threads are input to the value prediction device is changed.

以下、添付図面(図2〜図8)を参照しながら、本発明の好ましい実施例の構成および動作等を説明する。   Hereinafter, the configuration and operation of the preferred embodiments of the present invention will be described with reference to the accompanying drawings (FIGS. 2 to 8).

図2は、本発明の第1の実施例に係る値予測装置の構成を示すブロック図である。ただし、ここでは、プロセッサ等のデータ処理装置に使用されるような本発明の第1の実施例に係る値予測装置10の構成を簡略化して示す。なお、これ以降、前述した構成要素と同様のものについては、同一の参照番号を付して表すこととする。   FIG. 2 is a block diagram showing the configuration of the value prediction apparatus according to the first example of the present invention. However, here, the configuration of the value predicting apparatus 10 according to the first embodiment of the present invention used in a data processing apparatus such as a processor is shown in a simplified manner. Hereinafter, the same components as those described above are denoted by the same reference numerals.

図2の第1の実施例に係る値予測装置10は、前述の従来の値予測装置(図1参照)の場合と同様に、予測の要求に応じて入力されるエントリの識別子(ID)をもとに予測テーブル30を参照して対応するデータの値の予測を行う予測回路1と、この予測回路1による予測の成否が確定した時点で、上記予測回路1の出力値を予測値PVとして予測テーブル30内の対応するデータの値を更新する更新回路2とを備えている。ここで、予測テーブル30を参照して対応するデータの値の予測を行った後に、この予測回路1による予測の成否が確定している場合、更新値RVは予測値PVと同じ値になる。   As in the case of the above-described conventional value prediction apparatus (see FIG. 1), the value prediction apparatus 10 according to the first embodiment of FIG. 2 uses the identifier (ID) of the entry input in response to the prediction request. Based on the prediction circuit 1 that predicts the value of the corresponding data with reference to the prediction table 30 and the success or failure of the prediction by the prediction circuit 1 is determined, the output value of the prediction circuit 1 is used as the prediction value PV. And an update circuit 2 that updates the value of the corresponding data in the prediction table 30. Here, after the prediction of the value of the corresponding data with reference to the prediction table 30, if the success or failure of the prediction by the prediction circuit 1 is confirmed, the update value RV becomes the same value as the prediction value PV.

図2の第1の実施例に係る値予測装置10においても、予測テーブル30は、RAM等の予測テーブル保持部3に内蔵されている。予測回路1による予測が成功したか否かが確定して予測の処理が完了した時点で、予測回路1から出力される予測値PVに対応する更新値RVが更新回路2に送出され、この更新回路2の更新の処理によって予測テーブル30内の対応するデータの値が更新されるようになっている。   Also in the value prediction apparatus 10 according to the first example of FIG. 2, the prediction table 30 is built in the prediction table holding unit 3 such as a RAM. When it is determined whether or not the prediction by the prediction circuit 1 is successful and the prediction process is completed, an update value RV corresponding to the prediction value PV output from the prediction circuit 1 is sent to the update circuit 2, and this update is performed. The value of the corresponding data in the prediction table 30 is updated by the update process of the circuit 2.

さらに、図2の第1の実施例に係る値予測装置10は、前述の従来の値予測装置(図1参照)の場合と同様に、入力されるエントリの識別子に基づいて予測テーブル30を参照するためのインデックスを生成するハッシュ回路4を備えている。このハッシュ回路4では、入力されるエントリの識別子に基づいて、当該エントリに関するデータが予測テーブル30のどのアドレスに格納されているかを示すインデックスが生成される。   Further, the value prediction apparatus 10 according to the first embodiment of FIG. 2 refers to the prediction table 30 based on the identifier of the input entry as in the case of the conventional value prediction apparatus (see FIG. 1) described above. A hash circuit 4 is provided for generating an index for this purpose. In the hash circuit 4, an index indicating which address in the prediction table 30 stores the data related to the entry is generated based on the identifier of the input entry.

さらに、図2の値予測装置10は、前述の従来の値予測装置(図1参照)の場合と同様に、予測装置10を含むコンピュータシステムの各種の制御を行うCPU12が設けられている。さらに、このCPU12においては、ROMまたはRAM等の記憶部14が設けられている。この記憶部14は、コンピュータシステムの各種の制御を行うためのプログラムが予め格納されている。なお、上記のROMまたはRAMとして、CPU12に内蔵のROMやRAMを用いることも可能である。   Further, the value predicting device 10 in FIG. 2 is provided with a CPU 12 that performs various controls of the computer system including the predicting device 10 as in the case of the above-described conventional value predicting device (see FIG. 1). Further, the CPU 12 is provided with a storage unit 14 such as a ROM or a RAM. The storage unit 14 stores in advance programs for performing various controls of the computer system. Note that a ROM or RAM built in the CPU 12 can be used as the ROM or RAM.

上記の予測回路1および更新回路2は、前述の従来の値予測装置(図1参照)の場合と同様に、演算回路やレジスタ等を含むハードウェア回路により構成される。しかしながら、予測回路1および更新回路2の機能をCPU12により実現することも可能である。この場合は、前述のような予測回路1および更新回路2の機能を実行するためのプログラムが、記憶部14に格納されている。CPU12により記憶部14から当該プログラムを読み出して実行させることによって、予測回路1および更新回路2の機能がソフトウェアにより実現されることになる。   The prediction circuit 1 and the update circuit 2 are configured by a hardware circuit including an arithmetic circuit, a register, and the like, as in the case of the conventional value prediction apparatus (see FIG. 1) described above. However, the functions of the prediction circuit 1 and the update circuit 2 can be realized by the CPU 12. In this case, a program for executing the functions of the prediction circuit 1 and the update circuit 2 as described above is stored in the storage unit 14. By reading the program from the storage unit 14 and executing it by the CPU 12, the functions of the prediction circuit 1 and the update circuit 2 are realized by software.

さらに、図2の第1の実施例に係る値予測装置10は、予測の処理が現在進行中で完了していない予測の履歴を一時的に保持する予測履歴レジスタ5と、予測の履歴に含まれる識別子と、予測の処理の開始時に付与される識別子とを比較し、両方の識別子が互いに一致する回数を計数する計数回路6とを備えている。これらの予測履歴レジスタ5および計数回路6は、本発明の予測履歴保持手段および計数手段にそれぞれ対応している。上記の予測履歴レジスタ5および計数回路6を含む追加回路15が、本発明の特徴を表すハードウェア回路として値予測装置10に設けられている。上記の予測履歴レジスタ5は、予測の対象であるエントリの識別子を予測の処理の開始時に追加し、予測の処理の終了時に削除する。   Furthermore, the value prediction apparatus 10 according to the first embodiment of FIG. 2 includes a prediction history register 5 that temporarily holds a prediction history that is currently in progress and is not completed, and a prediction history. And a counting circuit 6 that compares the identifier given at the start of the prediction process and counts the number of times that both identifiers match each other. The prediction history register 5 and the counting circuit 6 correspond to the prediction history holding unit and the counting unit of the present invention, respectively. An additional circuit 15 including the prediction history register 5 and the counting circuit 6 is provided in the value prediction apparatus 10 as a hardware circuit that represents the feature of the present invention. The prediction history register 5 adds an identifier of an entry to be predicted at the start of the prediction process and deletes it at the end of the prediction process.

ここで、図2の値予測装置10において予測の要求に応じてデータの値の予測値を算出する動作を概略的に説明する。予測回路1によりデータの値の予測値を算出する場合、ハッシュ回路4にてエントリの識別子(ID)に基づいてハッシュ値(インデックス)を生成し、このハッシュ値をもとに参照された予測テーブル30内のエントリを用いて、予測回路1によりデータの値の予測値の計算を行うようにしている。   Here, the operation of calculating the predicted value of the data value in response to the prediction request in the value prediction apparatus 10 of FIG. 2 will be schematically described. When the prediction circuit 1 calculates a predicted value of the data value, the hash circuit 4 generates a hash value (index) based on the identifier (ID) of the entry, and a prediction table referred to based on the hash value The prediction circuit 1 calculates the predicted value of the data value using the entries in 30.

ここでは、予測履歴レジスタ5および計数回路6により得られる予測の数(すなわち、予測の履歴に含まれる識別子と予測の処理の開始時に付与される識別子とが互いに一致する回数)であって同一のエントリの識別子について処理が完了していない予測の数だけ、予測回路1および更新回路2を周回するようになっている。この場合、更新回路2は、予測回路1から出力される予測値を更新値とし、予測テーブル30は更新せずに、予測回路1に更新すべき予測テーブルの状態を送出する。これによって、予測テーブルの更新がなされていない状態で、先行する予測によって後に更新されるテーブルの状態が仮想的かつ一時的に生成され、正確な予測が実現される。   Here, the number of predictions obtained by the prediction history register 5 and the counting circuit 6 (that is, the number of times that the identifier included in the prediction history matches the identifier given at the start of the prediction process) is the same. The prediction circuit 1 and the update circuit 2 are circulated as many times as the number of predictions for which the process of the identifier of the entry has not been completed. In this case, the update circuit 2 uses the prediction value output from the prediction circuit 1 as an update value, and sends the state of the prediction table to be updated to the prediction circuit 1 without updating the prediction table 30. Thereby, in a state where the prediction table has not been updated, the state of the table to be updated later by the preceding prediction is virtually and temporarily generated, and accurate prediction is realized.

現在進行中の予測の全てまたはその一部が、予測の失敗を含め何らかの理由で取り消された場合には、予測履歴レジスタ5から取り消された予測のエントリの識別子が削除される。このとき、予測テーブル30は変更されない。上記の処理によって、予測テーブル30および予測履歴レジスタ5の状態が予測の実行の取り消しに追随し、値予測装置10は正しく動作する。   When all or part of the prediction currently in progress is canceled for some reason, including a prediction failure, the identifier of the canceled prediction entry is deleted from the prediction history register 5. At this time, the prediction table 30 is not changed. With the above processing, the state of the prediction table 30 and the prediction history register 5 follows the cancellation of the execution of prediction, and the value prediction device 10 operates correctly.

つぎに、図2の値予測装置10における予測回路1および更新回路2の動作をより詳しく説明する。予測テーブル30において、既に処理が完了した予測についての更新しか行われておらず、処理が未完了の先行する予測が存在する場合は、この先行する予測によって更新される予測テーブルの状態が、新たな要求の予測を行うために必要となる。ここで、先行する予測が全て成功する場合には、予測値と更新値とが同じ値を取る。このため、先行する予測について、その予測値を更新値と仮定することで、その予測によって更新される予測テーブルの状態を生成することができる。先行する予測が2つ以上存在する場合にも、この処理を複数回繰り返すことで目的とする予測テーブルの状態を生成することができる。   Next, operations of the prediction circuit 1 and the update circuit 2 in the value prediction apparatus 10 of FIG. 2 will be described in more detail. In the prediction table 30, if only the prediction that has already been processed has been updated and there is a preceding prediction that has not been processed yet, the state of the prediction table updated by this preceding prediction is new. It is necessary to make a prediction of a new request. Here, when all preceding predictions are successful, the predicted value and the updated value take the same value. For this reason, about the preceding prediction, the state of the prediction table updated by the prediction can be produced | generated by assuming the prediction value as an update value. Even when there are two or more preceding predictions, the state of the target prediction table can be generated by repeating this process a plurality of times.

先行する予測が存在しない場合、すなわち、予測の履歴に含まれる識別子と予測の処理の開始時に付与される識別子とが互いに一致する回数が0である場合は、従来の値予測装置(図1参照)の場合と同様に予測回路1を一回だけ動作させて新たな予測の処理を行う。この場合、上記の処理によって得られる予測回路1の出力値が予測値になる。   When there is no preceding prediction, that is, when the number of times the identifier included in the prediction history and the identifier given at the start of the prediction process match each other is 0, a conventional value prediction device (see FIG. 1) As in the case of), the prediction circuit 1 is operated only once to perform a new prediction process. In this case, the output value of the prediction circuit 1 obtained by the above processing becomes the predicted value.

先行する予測が存在している場合、すなわち、予測の履歴に含まれる識別子と予測の処理の開始時に付与される識別子とが互いに一致する回数が1以上である場合、予測回路1は、その回数だけ予測の処理を行って得られる予測回路1の出力値を更新回路2に送出する。更新回路2は、予測回路1の出力値を用いて予測テーブルの状態を更新値として予測テーブルを仮想的に更新し、その更新結果を予測テーブル30には反映させず、仮想的に更新された予測テーブルの状態を予測回路1に返送する。この仮想的に更新された予測テーブルの状態は、RAM11に一時的に保持される。なお、図2の値予測装置10では、予測回路1にRAM11が設けられているが、予測回路1に内蔵のRAMを用いることも可能である。予測回路1は、仮想的に更新された予測テーブルの状態を用いて再度動作し、予測の処理を行う。この動作に必要な回数だけ(すなわち、予測の履歴に含まれる識別子と予測の処理の開始時に付与される識別子とが互いに一致する回数だけ)、上記の予測回路1および更新回路2の動作を繰り返した上で得られた予測回路1の出力値が、最終的な予測値となる。   When the preceding prediction exists, that is, when the number of times the identifier included in the prediction history and the identifier given at the start of the prediction process match each other is 1 or more, the prediction circuit 1 The output value of the prediction circuit 1 obtained by performing only the prediction process is sent to the update circuit 2. The update circuit 2 virtually updates the prediction table using the output value of the prediction circuit 1 as the update value and updates the prediction table without reflecting the update result in the prediction table 30. The state of the prediction table is returned to the prediction circuit 1. The state of the virtually updated prediction table is temporarily stored in the RAM 11. In the value prediction apparatus 10 of FIG. 2, the prediction circuit 1 is provided with the RAM 11, but the prediction circuit 1 may be provided with a built-in RAM. The prediction circuit 1 operates again using the virtually updated state of the prediction table, and performs prediction processing. The operations of the prediction circuit 1 and the update circuit 2 are repeated as many times as necessary for this operation (that is, the number of times that the identifier included in the prediction history and the identifier given at the start of the prediction process match each other). The output value of the prediction circuit 1 obtained after that is the final predicted value.

先行する予測が完了した時点で、従来の値予測装置(図1参照)の場合と同様に、最終的な予測値に対応する更新値を用いて、更新回路2により予測テーブル30内の対応するデータの値が更新される。また一方で、何らかの理由で先行する予測の取り消しが発生した場合は、予測回路1、更新回路2および予測テーブル30には影響を与えない。   When the preceding prediction is completed, as in the case of the conventional value prediction device (see FIG. 1), an update value corresponding to the final prediction value is used by the update circuit 2 to correspond in the prediction table 30. The data value is updated. On the other hand, if the preceding prediction is canceled for some reason, the prediction circuit 1, the update circuit 2, and the prediction table 30 are not affected.

既に述べたように、図2の値予測装置10において、予測履歴レジスタ5および計数回路6はハードウェア回路により構成されている。しかしながら、予想回路1および更新回路2の機能と共に、予測履歴レジスタ5および計数回路6の機能をCPU12のソフトウェアにより実現することも可能である。ROMまたはRAM等の記憶部14は、予測回路1、更新回路2、予測履歴レジスタ5および計数回路6の機能を実行するためのプログラムを予め格納しておくことが可能である。   As already described, in the value prediction apparatus 10 of FIG. 2, the prediction history register 5 and the counting circuit 6 are configured by hardware circuits. However, the functions of the prediction history register 5 and the counting circuit 6 as well as the functions of the prediction circuit 1 and the update circuit 2 can be realized by software of the CPU 12. The storage unit 14 such as a ROM or a RAM can store in advance programs for executing the functions of the prediction circuit 1, the update circuit 2, the prediction history register 5, and the counting circuit 6.

例えば、記憶部14に格納されているプログラムは、予測の処理が現在進行中で完了していない予測の履歴を一時的に保持するステップと、予測の履歴に含まれる識別子と、予測の処理の開始時に付与される識別子とを比較し、両方の識別子が互いに一致する回数を計数するステップと、両方の識別子が一致する回数が存在する場合、予測の処理結果として得られる値を用いて予測テーブルの状態を仮想的に更新し、仮想的に更新された予測テーブルの状態を用いて再度予測の処理を行うステップと、上記両方の識別子が一致する回数に応じて、予測テーブルを実際に更新することなく予測の処理を繰り返し、これによって得られる値を最終的な予測値とするステップとを含む。   For example, the program stored in the storage unit 14 includes a step of temporarily holding a prediction history that is currently in progress and a prediction process, an identifier included in the prediction history, and a prediction process. A step of comparing the identifiers given at the start, counting the number of times both identifiers match each other, and if there is a number of times both identifiers match, a prediction table using a value obtained as a prediction processing result The state is updated virtually, and the prediction table is actually updated according to the number of times that both of the identifiers coincide with the step of performing the prediction process again using the virtually updated state of the prediction table Without repeating the prediction process, and using the value obtained thereby as the final predicted value.

さらに、図2の第1の実施例では、コンピュータ読み取り可能な記憶媒体(または記録媒体)を使用してCPU12を動作させる場合、前述のようなプログラムの内容を保持している記憶媒体(例えば、ディスク装置等の外部記憶装置16内のハードディスクH)を用意することが好ましい。なお、上記第1の実施例の記憶媒体は、上記したものに限らず、フロッピィディスクやMO(Magneto-Optical Disk:光磁気ディスク)やCD−R(Compact Disk-Recordable)やCD−ROM(Compact Disk Read-only Memory)等の可搬形媒体、その他の固定形媒体など種々の記憶媒体の形態で提供可能なものである。   Further, in the first embodiment shown in FIG. 2, when the CPU 12 is operated using a computer-readable storage medium (or recording medium), a storage medium (for example, holding the contents of the program as described above) It is preferable to prepare a hard disk H) in the external storage device 16 such as a disk device. The storage medium of the first embodiment is not limited to the above-described one, but a floppy disk, an MO (Magneto-Optical Disk), a CD-R (Compact Disk-Recordable), a CD-ROM (Compact). It can be provided in the form of various storage media such as portable media such as Disk Read-only Memory) and other fixed media.

上記第1の実施例によれば、入力されるエントリに対するデータの値の予測を行った後に、先行する予測が進行中で予測テーブルが更新されていない状態で、同一のエントリに対する連続した予測の要求が呈示された場合でも、先行する予測の履歴により仮想的に更新された予測テーブルの状態を用いて、先行する予測の処理を繰り返し行うことによって、最終的な予測値に基づいて正しい予測を行うことができるようになる。   According to the first embodiment, after the prediction of the data value for the input entry, the continuous prediction for the same entry is performed in the state where the preceding prediction is in progress and the prediction table is not updated. Even when a request is presented, it is possible to make a correct prediction based on the final predicted value by repeatedly performing the process of the preceding prediction using the state of the prediction table virtually updated by the history of the preceding prediction. Will be able to do.

図3は、図2の予測履歴レジスタおよび計数回路の具体例を示す回路ブロック図である。ここでは、図2の値予測装置10における追加回路15内の予測履歴レジスタ5および計数回路6の具体的な回路構成例が図示されている。   FIG. 3 is a circuit block diagram showing a specific example of the prediction history register and the counting circuit of FIG. Here, a specific circuit configuration example of the prediction history register 5 and the counting circuit 6 in the additional circuit 15 in the value prediction apparatus 10 of FIG. 2 is illustrated.

図3に示すように、予測履歴レジスタ5(図2参照)は、処理が未完了の先行する予測の履歴をシリアル形式で保持するキューレジスタ50の構造を有している。このキューレジスタ50は、予測の要求が呈示される度に、予測テーブルの参照に用いられる識別子(ハッシュ回路4より送出される予測の対象であるエントリのID)を末尾に追加する。また一方で、予測の処理が完了し、予測テーブル内のデータの値が更新されると同時に、このデータに対応する識別子をキューレジスタ50の先頭部から削除し、キューレジスタ全体をシフトする。キューレジスタ50には、予測の処理が開始されてから、未だ完了せずに予測テーブルの更新がなされていない予測の識別子が時刻順に存在する。   As shown in FIG. 3, the prediction history register 5 (see FIG. 2) has a structure of a queue register 50 that holds a history of preceding predictions that have not been processed yet in a serial format. Each time a request for prediction is presented, the queue register 50 adds an identifier used for referring to the prediction table (the ID of the entry to be predicted sent from the hash circuit 4) to the end. On the other hand, the prediction process is completed and the value of the data in the prediction table is updated. At the same time, the identifier corresponding to this data is deleted from the head of the queue register 50, and the entire queue register is shifted. In the queue register 50, there are prediction identifiers in order of time that have not yet been completed since the prediction process is started and the prediction table has not been updated.

また一方で、計数回路6(図2参照)は、コンパレータ60および計数カウンタ61により構成される。コンパレータ60は、予測履歴レジスタの各々のエントリについて、これまでの予測の履歴に含まれる識別子(ID)と、予測の要求時に付与される識別子(ID)とを比較し、上記エントリの中の有効なエントリについて、両方の識別子が互いに一致する回数を出力する。計数カウンタ61は、コンパレータ60から出力される両方の識別子が互いに一致する回数を計数して累積する。このようにして累積された回数は、同一の識別子に対して処理が進行中の予測の数を示す。   On the other hand, the counting circuit 6 (see FIG. 2) includes a comparator 60 and a counting counter 61. For each entry in the prediction history register, the comparator 60 compares the identifier (ID) included in the prediction history so far with the identifier (ID) given at the time of the prediction request, and the valid in the entry. For the correct entry, the number of times that both identifiers match each other is output. The count counter 61 counts and accumulates the number of times that both identifiers output from the comparator 60 match each other. The number of times accumulated in this way indicates the number of predictions that are being processed for the same identifier.

現在進行中の予測の全てまたはその一部が取り消された場合には、取り消された予測について、対応する識別子を予測履歴レジスタ30(図2参照)から削除し、エントリを無効化する。   When all or a part of the prediction currently in progress is cancelled, the corresponding identifier is deleted from the prediction history register 30 (see FIG. 2) for the canceled prediction, and the entry is invalidated.

図4は、予測と更新との間の時間的な関係を説明するためのタイムチャートである。図4の(a)では、従来の方式の値予測装置(例えば、図1参照)において、入力されるエントリに対する予測を行う時刻と、予測テーブルを更新する時刻との間の時間(t)に対する関係が図示されており、図4の(b)では、本発明の方式の値予測装置(例えば、図2参照)において、入力されるエントリに対する予測を行う時刻と、予測テーブルを更新する時刻との間の時間(t)に対する関係が図示されている。   FIG. 4 is a time chart for explaining the temporal relationship between prediction and update. In FIG. 4A, in a conventional value predicting apparatus (for example, see FIG. 1), the time (t) between the time when the input entry is predicted and the time when the prediction table is updated is shown. In FIG. 4B, in the value prediction apparatus of the method of the present invention (see, for example, FIG. 2), the time when the input entry is predicted, and the time when the prediction table is updated The relationship between and for time (t) is shown.

図4の(a)に示すような従来の方式の値予測装置に関しては、入力されるエントリに対し予測テーブルを参照して予測動作を実行した後に、更新動作が完了した時点で予測テーブルを更新することが必要であり、予測動作と更新動作との順番を入れ替えることができない。   For the value prediction apparatus of the conventional method as shown in FIG. 4A, the prediction table is updated when the update operation is completed after the prediction operation is executed with reference to the prediction table for the input entry. And the order of the prediction operation and the update operation cannot be changed.

これに対し、図4の(b)に示すような本発明の方式の値予測装置に関しては、入力されるエントリに対し予測テーブルを参照して1回目の予測動作を実行した後に、この1回目の予測動作が進行中で予測テーブルが更新されていない状態で、同一のエントリに対する連続した予測の要求が呈示された場合(例えば、予測テーブルの更新の時刻よりも早い予測の要求が3回呈示された場合)でも、先行する予測の履歴により仮想的に更新された予測テーブルの状態を用いて、先行する予測の処理を繰り返し行うことによって(例えば、3回繰り返し行うことによって)、最終的な予測値に基づいて正しい予測を行うことができるようになる。   On the other hand, in the value prediction apparatus of the method of the present invention as shown in FIG. 4B, the first prediction operation is performed after referring to the prediction table for the input entry and executing the first prediction operation. When a prediction request for the same entry is presented in a state where the prediction operation is in progress and the prediction table has not been updated (for example, three prediction requests earlier than the prediction table update time are presented) Even if it is performed), the process of the preceding prediction is repeated by using the state of the prediction table virtually updated by the history of the preceding prediction (for example, by repeating three times) to obtain the final result. A correct prediction can be performed based on the predicted value.

図5は、本発明の第2の実施例に係る値予測装置の構成を示すブロック図である。ただし、ここでは、プロセッサ等のデータ処理装置に使用されるような本発明の第2の実施例に係る値予測装置10aの構成を簡略化して示す。   FIG. 5 is a block diagram showing the configuration of the value prediction apparatus according to the second example of the present invention. However, here, the configuration of the value predicting apparatus 10a according to the second embodiment of the present invention used in a data processing apparatus such as a processor is shown in a simplified manner.

図5の第2の実施例に係る値予測装置10aは、前述の第1の実施例に係る値予測装置10(図2参照)とほぼ同じ構成を有しているが、更新回路2にバッファ回路20を設けている点が、前述の第1の実施例に係る値予測装置10と異なっている。   The value predicting device 10a according to the second embodiment of FIG. 5 has almost the same configuration as the value predicting device 10 (see FIG. 2) according to the first embodiment described above, but the update circuit 2 has a buffer. The point where the circuit 20 is provided is different from the value prediction apparatus 10 according to the first embodiment described above.

図5の第2の実施例に係る値予測装置10aにおいて、予測の要求に応じて予測回路1によりデータの値の予測値を算出する場合、前述の第1の実施例に係る値予測装置10の場合と同様に、ハッシュ回路4にてエントリの識別子(ID)に基づいてハッシュ値を生成し、このハッシュ値をもとに参照された予測テーブル30内のエントリを用いて、予測回路1によりデータの値の予測値の計算を行うようにしている。   In the value prediction apparatus 10a according to the second embodiment of FIG. 5, when the prediction value of the data value is calculated by the prediction circuit 1 in response to a prediction request, the value prediction apparatus 10 according to the first embodiment described above. As in the case of the above, the hash value is generated by the hash circuit 4 based on the identifier (ID) of the entry, and the prediction circuit 1 uses the entry in the prediction table 30 referred to based on this hash value. The predicted value of the data value is calculated.

ここで、先行する予測の数が1以上である場合、すなわち、予測の履歴に含まれる識別子と予測の処理の開始時に付与される識別子とが互いに一致する回数が1以上である場合、予測回路1は、その回数だけ予測の処理を行って得られる予測回路1の出力値を更新回路2に送出する。更新回路2は、予測回路1の出力値を用いて予測テーブルの状態を更新値として予測テーブルを仮想的に更新し、その更新結果を予測テーブル30には反映させず、仮想的に更新された予測テーブルの状態を予測回路1に返送する。予測回路1は、仮想的に更新された予測テーブルの状態を用いて再度動作し、予測の処理を行う。この動作に必要な回数だけ、上記の予測回路1および更新回路2の動作を繰り返した上で得られた予測回路1の出力値が、最終的な予測値となる。   Here, when the number of preceding predictions is 1 or more, that is, when the number of times the identifier included in the prediction history and the identifier given at the start of the prediction process match each other is 1 or more, the prediction circuit 1 sends the output value of the prediction circuit 1 obtained by performing the prediction process the same number of times to the update circuit 2. The update circuit 2 virtually updates the prediction table using the output value of the prediction circuit 1 as the update value and updates the prediction table without reflecting the update result in the prediction table 30. The state of the prediction table is returned to the prediction circuit 1. The prediction circuit 1 operates again using the virtually updated state of the prediction table, and performs prediction processing. The output value of the prediction circuit 1 obtained after repeating the operations of the prediction circuit 1 and the update circuit 2 as many times as necessary for this operation becomes the final prediction value.

特に、先行する予測の数が2以上である場合、予測回路1および更新回路2の繰り返し動作の間、仮想的に更新された予想テーブルの状態を一時的に保持することが必要になる。このため、図5の第2の実施例に係る値予測装置10aでは、予測回路1および更新回路2の繰り返し動作の間、仮想的に更新された予測テーブルの状態を一時的に保持するバッファ回路20を更新回路2に設けている。   In particular, when the number of preceding predictions is 2 or more, it is necessary to temporarily hold the state of the virtually updated prediction table during the repeated operation of the prediction circuit 1 and the update circuit 2. Therefore, in the value predicting apparatus 10a according to the second embodiment of FIG. 5, the buffer circuit that temporarily holds the state of the virtually updated prediction table during the repetitive operations of the prediction circuit 1 and the update circuit 2. 20 is provided in the update circuit 2.

図5の第2の実施例に係る値予測装置によれば、上記の繰り返し動作の中で1回目の動作により得られた値をバッファ回路20に保存しておき、2回目以降の動作を行う際にその値をバッファ回路20から読み出して有効に利用することができるので、予測回路1および更新回路2の繰り返し動作により予測値を算出する際の効率が良くなる。   According to the value predicting apparatus according to the second embodiment of FIG. 5, the value obtained by the first operation in the above repetitive operations is stored in the buffer circuit 20 and the second and subsequent operations are performed. In this case, the value can be read from the buffer circuit 20 and used effectively, so that the efficiency in calculating the predicted value by the repeated operation of the prediction circuit 1 and the update circuit 2 is improved.

図6は、本発明の実施例による予測動作および更新動作の処理フローを説明するためのフローチャートである。ここでは、CPU12(例えば、図2参照)の制御により予測回路1、更新回路2、予測履歴レジスタ5および計数回路6のハードウェア回路を動作させて本発明の予測動作および更新動作を実行させる場合の処理フローを順次説明する。
図6は、本発明の実施例による予測動作および更新動作の処理フローを説明するためのフローチャートである。ここでは、CPU12(例えば、図2参照)を動作させて本発明の予測動作および更新動作を実行させる場合の処理フローを順次説明する。
FIG. 6 is a flowchart for explaining the processing flow of the prediction operation and the update operation according to the embodiment of the present invention. Here, when the prediction circuit 1, the update circuit 2, the prediction history register 5, and the hardware circuit of the counting circuit 6 are operated by the control of the CPU 12 (for example, see FIG. 2), the prediction operation and the update operation of the present invention are executed. The processing flow will be described sequentially.
FIG. 6 is a flowchart for explaining the processing flow of the prediction operation and the update operation according to the embodiment of the present invention. Here, the processing flow when the CPU 12 (see, for example, FIG. 2) is operated to execute the prediction operation and the update operation of the present invention will be sequentially described.

入力されるエントリの識別子をもとに予測テーブルを参照してデータの値の予測を行う場合、まず、ステップS1において、予測の処理が現在進行中で完了していない予測の履歴を、予測履歴レジスタに一時的に保持するようにしている。   When predicting the data value by referring to the prediction table based on the identifier of the input entry, first, in step S1, the prediction history that is currently in progress and is not completed is calculated as the prediction history. It keeps temporarily in the register.

つぎに、ステップS2において、予測履歴レジスタの各々のエントリについて、これまでに保持された予測の履歴に含まれる識別子(ID)と、予測の処理の開始時に付与される識別子(ID)との比較を行うようにしている。   Next, in step S2, for each entry in the prediction history register, a comparison is made between the identifier (ID) included in the prediction history held so far and the identifier (ID) given at the start of the prediction process. Like to do.

さらに、ステップS3において、先行する予測の数、すなわち、予測の履歴に含まれる識別子と予測の処理の開始時に付与される識別子とが互いに一致する回数が存在するか否かを判定するようにしている。   Further, in step S3, it is determined whether or not there is a number of times that the number of preceding predictions, that is, the identifier included in the prediction history and the identifier given at the start of the prediction process match each other. Yes.

さらに、ステップS4において、先行する予測が存在しないと判定された場合、すなわち、予測の履歴に含まれる識別子と予測の処理の開始時に付与される識別子とが互いに一致する回数が0であると判定された場合、従来の値予測装置(例えば、図1参照)の場合と同様に予測回路を一回だけ動作させて新たな予測の処理を行うようにしている。   Furthermore, when it is determined in step S4 that there is no preceding prediction, that is, it is determined that the number of times that the identifier included in the prediction history and the identifier given at the start of the prediction process match each other is 0. In such a case, as in the case of a conventional value prediction apparatus (for example, see FIG. 1), the prediction circuit is operated only once to perform a new prediction process.

先行する予測が存在していると判定された場合、すなわち、予測の履歴に含まれる識別子と予測の処理の開始時に付与される識別子とが互いに一致する回数が1以上であると判定された場合、ステップS5において、予測回路は、その回数だけ予測の処理を行って得られる予測回路の出力値を更新回路に送出するようにしている。   When it is determined that the preceding prediction exists, that is, when it is determined that the number of times that the identifier included in the prediction history and the identifier given at the start of the prediction process match each other is 1 or more In step S5, the prediction circuit sends the output value of the prediction circuit obtained by performing the prediction process the same number of times to the update circuit.

さらに、ステップS6において、更新回路は、予測回路の出力値を更新値として予測テーブルを仮想的に更新し、仮想的に更新された予測テーブルの状態を予測回路に返送するようにしている。   Further, in step S6, the update circuit virtually updates the prediction table using the output value of the prediction circuit as the update value, and returns the virtually updated state of the prediction table to the prediction circuit.

さらに、ステップS7において、予測回路は、仮想的に更新された予測テーブルの状態を用いて再度動作し、予測の処理を行うようにしている。この動作に必要な回数だけ、予測回路および更新回路の動作を繰り返した上で得られた予測回路の出力値が、最終的な予測値となる。   Further, in step S7, the prediction circuit operates again using the virtually updated state of the prediction table to perform prediction processing. The output value of the prediction circuit obtained after repeating the operations of the prediction circuit and the update circuit as many times as necessary for this operation becomes the final prediction value.

なお、図6のフローチャートでは、予測回路1、更新回路2、予測履歴レジスタ5および計数回路6がハードウェア回路により構成される場合の処理フローを説明しているが、予測回路1、更新回路2、予測履歴レジスタ5および計数回路6の機能をCPU12により実現する場合にも、ソフトウェア(記憶部14に格納されているプログラム)により前述の処理フローとほぼ同様の処理フローを遂行することが可能である。   In the flowchart of FIG. 6, the processing flow in the case where the prediction circuit 1, the update circuit 2, the prediction history register 5, and the counting circuit 6 are configured by hardware circuits is described. Even when the functions of the prediction history register 5 and the counting circuit 6 are realized by the CPU 12, it is possible to perform a processing flow almost the same as the above-described processing flow by software (a program stored in the storage unit 14). is there.

図7は、本発明の値予測装置の適用例の構成を示すブロック図であり、図8は、図7において予測と更新との間で入れ替わりが発生した状況を示す模式図である。ここでは、スレッド単位の値予測による値投機実行を行う場合に、スレッド投機実行を行うマルチプロセッサシステム80に対して本発明の値予測装置10(例えば、図2参照)を適用した例が図示されている。   FIG. 7 is a block diagram showing a configuration of an application example of the value prediction apparatus of the present invention, and FIG. 8 is a schematic diagram showing a situation in which a change occurs between prediction and update in FIG. Here, an example is shown in which the value prediction apparatus 10 (see, for example, FIG. 2) of the present invention is applied to a multiprocessor system 80 that performs thread speculation execution when performing value speculation execution by thread unit value prediction. ing.

図7のマルチプロセッサシステム80は、本発明の値予測装置10(例えば、図2参照)と、複数のプロセッサ(例えば、第1のプロセッサ7−1〜第nのプロセッサ7−n(nは2以上の任意の正の整数))と、スレッド投機実行を遂行するためのスレッド制御を行うスレッド制御ユニット8とを備えている。   The multiprocessor system 80 of FIG. 7 includes a value prediction apparatus 10 (see, for example, FIG. 2) of the present invention and a plurality of processors (for example, a first processor 7-1 to an nth processor 7-n (n is 2). The above-described arbitrary positive integer))) and a thread control unit 8 that performs thread control for executing thread speculative execution are provided.

ここで、値予測装置10は、前述の第1の実施例に係る値予測装置(図2参照)と同じ構成を有しているので、ここでは、値予測装置10に関する再度の説明を省略する。   Here, since the value prediction apparatus 10 has the same configuration as the value prediction apparatus (see FIG. 2) according to the first embodiment described above, the re-explanation regarding the value prediction apparatus 10 is omitted here. .

図7のマルチプロセッサシステム80においては、単一の半導体集積回路のチップ上に複数のプロセッサ(第1のプロセッサ7−1〜第nのプロセッサ7−n)を配置し、単一のスレッドのプログラムを複数のスレッドTH(図8参照)に分割し、チップ内のスレッド制御ユニット8によって複数のプロセッサで並列にスレッド投機を実行するような構成になっている。   In the multiprocessor system 80 of FIG. 7, a plurality of processors (first processor 7-1 to n-th processor 7-n) are arranged on a single semiconductor integrated circuit chip, and a single thread program is executed. Is divided into a plurality of threads TH (see FIG. 8), and thread speculation is executed in parallel by a plurality of processors by the thread control unit 8 in the chip.

この半導体集積回路のチップ内で、本発明の値予測装置10が、スレッドレベルの値予測装置として搭載される。スレッドレベルの値の予測では、スレッドの開始時にそのスレッドで使用される値を予測して値投機実行を行い、この値投機実行の結果の成否が確定した時点で予測テーブルを更新する。ここで、各々のスレッドは並列に実行され、かつ、各々のスレッドの予測について、その成否が確定するまでの時間が命令レベルの値予測に比べて長くなる。   In the chip of this semiconductor integrated circuit, the value predicting device 10 of the present invention is mounted as a thread level value predicting device. In the prediction of the thread level value, the value used in the thread is predicted at the start of the thread, the value speculation execution is performed, and the prediction table is updated when the success or failure of the result of the value speculation execution is determined. Here, each thread is executed in parallel, and the time until the success or failure of each thread is predicted becomes longer than the instruction level value prediction.

それゆえに、図8の模式図に示すように、プログラムのループの部分に関してループの各々のイテレーションをスレッドTHとして並列の値投機実行を行うと、同じ識別子を有するスレッドが複数同時に実行され、予測テーブルが更新される前に、同じ識別子を有するスレッドに関する値予測の要求が発生する。   Therefore, as shown in the schematic diagram of FIG. 8, when parallel value speculative execution is performed with each iteration of the loop as a thread TH with respect to the loop portion of the program, a plurality of threads having the same identifier are simultaneously executed, and the prediction table Before is updated, a request for value prediction for threads having the same identifier occurs.

このような順序で予測の要求が発生すると、従来の値予測装置(図1参照)では対処することができないため、スレッドに関する値予測を行うことが不可能になる。しかしながら、本発明の値予測装置10(例えば、図2参照)を用いることによって、図8のように複数のスレッドTHに対する並列の値投機実行を行う状況においても、各々のスレッドに対して正しい値予測を行うことが可能になる。   When prediction requests are generated in this order, the conventional value prediction apparatus (see FIG. 1) cannot cope with it, so that it is impossible to perform value prediction regarding threads. However, by using the value predicting apparatus 10 of the present invention (see, for example, FIG. 2), the correct value for each thread can be obtained even in a situation where parallel value speculative execution is performed for a plurality of threads TH as shown in FIG. It is possible to make a prediction.

より詳しく説明すると、図7のマルチプロセッサシステム80において、複数のプロセッサにより処理されるべき複数のスレッドがエントリとして値予測装置10に入力されるときに、図8の右側の予測および更新と時間(t)との関係に示されるように、入力されるスレッドの予測と更新との順番が入れ替わっても、先行する予測の履歴により仮想的に更新された予測テーブルの状態を用いて、先行する予測の処理を繰り返し行うことによって、各々のスレッドに対する正確な値予測が実現されるようになる。   More specifically, in the multiprocessor system 80 of FIG. 7, when a plurality of threads to be processed by a plurality of processors are input as entries to the value prediction apparatus 10, the prediction and update and time (on the right side of FIG. t), as shown in the relationship with t), even if the order of prediction and update of the input thread is switched, the preceding prediction is made using the state of the prediction table virtually updated by the history of the preceding prediction. By repeating this process, accurate value prediction for each thread is realized.

(付記1)予測の対象であるエントリが入力される度に、前記エントリの識別子に基づいて予測テーブルに既に保存されているデータを参照し、前記データの値の予測を行う予測回路と、前記予測回路による予測の処理が完了した時点で、前記予測回路の出力値を予測値として前記予測テーブル内の対応するデータの値を更新する更新回路とを有する値予測装置において、
予測の処理が現在進行中で完了していない予測の履歴を一時的に保持する予測履歴保持手段と、
前記予測の履歴に含まれる識別子と、前記予測の処理の開始時に付与される識別子とを比較し、両方の識別子が互いに一致する回数を計数する計数手段とを備え、
前記両方の識別子が一致する回数が存在する場合、前記予測回路は、前記予測の処理を行って得られる前記予測回路の出力値を前記更新回路に送出し、前記更新回路は、前記予測回路の出力値を用いて前記予測テーブルの状態を仮想的に更新し、仮想的に更新された前記予測テーブルの状態を前記予測回路に返送し、前記予測回路は、仮想的に更新された前記予測テーブルの状態を用いて再度予測の処理を行い、
前記両方の識別子が一致する回数に応じて、前記予測テーブルを実際に更新することなく前記予測回路および前記更新回路の動作を繰り返し、これによって得られる前記予測回路の出力値を最終的な予測値とすることを特徴とする値予測装置。
(Supplementary Note 1) Each time an entry to be predicted is input, a prediction circuit that refers to data already stored in a prediction table based on an identifier of the entry and predicts a value of the data; In a value prediction device having an update circuit that updates the value of the corresponding data in the prediction table using the output value of the prediction circuit as a prediction value when the prediction processing by the prediction circuit is completed,
Prediction history holding means for temporarily holding a prediction history that is currently in progress and is not completed,
A counter for comparing the identifier included in the prediction history with the identifier given at the start of the prediction process, and counting the number of times both identifiers match each other;
When there is a number of times that both the identifiers match, the prediction circuit sends the output value of the prediction circuit obtained by performing the prediction process to the update circuit, and the update circuit The state of the prediction table is virtually updated using an output value, the state of the virtually updated prediction table is returned to the prediction circuit, and the prediction circuit is virtually updated with the prediction table Perform the prediction process again using the state of
The operation of the prediction circuit and the update circuit is repeated without actually updating the prediction table according to the number of times the two identifiers match, and the output value of the prediction circuit obtained thereby is the final predicted value. A value predicting device characterized by that.

(付記2)前記両方の識別子が一致する回数が存在しない場合、前記予測回路は、一回だけ前記予測の処理を行い、これによって得られる前記予測回路の出力値を最終的な予測値とすることを特徴とする付記1記載の値予測装置。   (Supplementary Note 2) When there is no number of times that the two identifiers match, the prediction circuit performs the prediction process only once, and the output value of the prediction circuit obtained thereby is used as a final prediction value. The value predicting device according to supplementary note 1, wherein:

(付記3)前記両方の識別子が一致する回数が2以上である場合、前記予測回路および前記更新回路の動作が繰り返される間、仮想的に更新された前記予測テーブルの状態を一時的に保持するバッファ回路を設けることを特徴とする付記1記載の値予測装置。   (Supplementary Note 3) When the number of times the two identifiers match is 2 or more, the state of the virtually updated prediction table is temporarily held while the operations of the prediction circuit and the update circuit are repeated. The value predicting apparatus according to appendix 1, wherein a buffer circuit is provided.

(付記4)予測の処理が現在進行中で完了していない予測が取り消される場合、取り消されるべき前記予測に対応する識別子を前記予測の履歴から削除し、前記識別子を有するエントリを無効化することを特徴とする付記1記載の値予測装置。   (Supplementary note 4) When a prediction process that is currently in progress and is not completed is canceled, an identifier corresponding to the prediction to be canceled is deleted from the prediction history, and an entry having the identifier is invalidated. The value predicting device according to supplementary note 1, characterized by:

(付記5)付記1から4のいずれか一項に記載の値予測装置と、複数のプロセッサとを有するマルチプロセッサシステムにおいて、
単一のスレッドのプログラムを複数のスレッドに分割し、前記複数のプロセッサによりスレッド単位の値予測による値投機実行を行う場合、前記複数のプロセッサにより処理されるべき前記複数のスレッドが前記エントリとして前記値予測装置に入力されるときに、前記複数のスレッドが前記値予測装置に入力される順番が入れ替わっても、それぞれの前記スレッドに対して正しい値予測を行うことが可能であることを特徴とするマルチプロセッサシステム。
(Additional remark 5) In the multiprocessor system which has a value prediction apparatus as described in any one of additional remarks 1 to 4, and a plurality of processors,
When dividing a program of a single thread into a plurality of threads and performing value speculation execution by value prediction on a thread basis by the plurality of processors, the plurality of threads to be processed by the plurality of processors are the entries. Even when the order in which the plurality of threads are input to the value prediction device is switched when input to the value prediction device, it is possible to perform correct value prediction for each of the threads. A multiprocessor system.

(付記6)入力されるエントリの識別子をもとに、予測テーブルに既に保存されているデータを参照して前記データの値の予測を行い、前記予測の処理が完了した時点で、前記予測の処理結果として得られる値を予測値として前記予測テーブル内の対応するデータの値を更新するための値予測方法において、
予測の処理が現在進行中で完了していない予測の履歴を一時的に保持するステップと、
前記予測の履歴に含まれる識別子と、前記予測の処理の開始時に付与される識別子とを比較し、両方の識別子が互いに一致する回数を計数するステップと、
前記両方の識別子が一致する回数が存在する場合、前記予測の処理結果として得られる値を用いて前記予測テーブルの状態を仮想的に更新し、仮想的に更新された前記予測テーブルの状態を用いて再度予測の処理を行うステップと、
前記両方の識別子が一致する回数に応じて、前記予測テーブルを実際に更新することなく前記予測の処理を繰り返し、これによって得られる値を最終的な予測値とするステップとを有することを特徴とする値予測方法。
(Supplementary Note 6) Based on the identifier of the input entry, the value of the data is predicted with reference to the data already stored in the prediction table, and when the prediction process is completed, the prediction In the value prediction method for updating the value of the corresponding data in the prediction table using the value obtained as the processing result as the predicted value,
Temporarily holding a history of predictions that are currently in progress and not complete,
Comparing the identifier included in the prediction history with the identifier given at the start of the prediction process, and counting the number of times both identifiers match each other;
When there is a number of times that both the identifiers match, the state of the prediction table is virtually updated using the value obtained as a result of the prediction process, and the state of the prediction table virtually updated is used. The step of performing the prediction process again,
Repeating the prediction process without actually updating the prediction table according to the number of times the two identifiers match, and setting a value obtained thereby as a final predicted value. Value prediction method.

(付記7)前記値予測方法が、さらに、
前記両方の識別子が一致する回数が存在しない場合、一回だけ前記予測の処理を行い、これによって得られる値を最終的な予測値とするステップを有することを特徴とする付記6記載の値予測方法。
(Supplementary Note 7) The value prediction method further includes:
The value prediction according to claim 6, further comprising a step of performing the prediction process only once when the number of times that both the identifiers match does not exist, and setting a value obtained thereby as a final prediction value Method.

(付記8)入力されるエントリの識別子をもとに、予測テーブルに既に保存されているデータを参照して前記データの値の予測を行い、前記予測の処理が完了した時点で、前記予測の処理結果として得られる値を予測値として前記予測テーブル内の対応するデータの値を更新する場合、コンピュータに、
予測の処理が現在進行中で完了していない予測の履歴を一時的に保持し、
前記予測の履歴に含まれる識別子と、前記予測の処理の開始時に付与される識別子とを比較し、両方の識別子が互いに一致する回数を計数し、
前記両方の識別子が一致する回数が存在する場合、前記予測の処理結果として得られる値を用いて前記予測テーブルの状態を仮想的に更新し、仮想的に更新された前記予測テーブルの状態を用いて再度予測の処理を行い、
前記両方の識別子が一致する回数に応じて、前記予測テーブルを実際に更新することなく前記予測の処理を繰り返し、これによって得られる値を最終的な予測値とすることを実行させるためのプログラムを記憶したことを特徴とするコンピュータ読み取り可能な記憶媒体。
(Supplementary note 8) Based on the identifier of the input entry, the value of the data is predicted with reference to the data already stored in the prediction table, and when the prediction process is completed, the prediction When updating the value of the corresponding data in the prediction table using the value obtained as the processing result as the predicted value,
A temporary history of forecasts that are currently in progress and are not complete,
Comparing the identifier included in the prediction history with the identifier given at the start of the prediction process, counting the number of times both identifiers match each other,
When there is a number of times that both the identifiers match, the state of the prediction table is virtually updated using the value obtained as a result of the prediction process, and the state of the prediction table virtually updated is used. And run the forecast again
A program for executing the process of repeating the prediction process without actually updating the prediction table according to the number of times the two identifiers match, and making a value obtained thereby as a final predicted value A computer-readable storage medium characterized by being stored.

本発明は、複数のプロセッサで複数のスレッドを並列に実行してスレッド単位の値予測による値投機実行を行う場合に、入力されるスレッドの予測と更新との順番が入れ替わっても、各々のスレッドに対して正しい値予測を行うことができるようなスレッド投機実行型のマルチプロセッサシステムに適用することが可能である。   In the present invention, when a plurality of threads are executed in parallel by a plurality of processors and value speculation execution is performed by value prediction in units of threads, even if the order of prediction and update of input threads is switched, each thread Therefore, the present invention can be applied to a multi-processor system of a thread speculative execution type that can perform correct value prediction.

従来の値予測装置の構成を示すブロック図である。It is a block diagram which shows the structure of the conventional value prediction apparatus. 本発明の第1の実施例に係る値予測装置の構成を示すブロック図である。It is a block diagram which shows the structure of the value prediction apparatus which concerns on 1st Example of this invention. 図2の予測履歴レジスタおよび計数回路の具体例を示す回路ブロック図である。FIG. 3 is a circuit block diagram illustrating a specific example of a prediction history register and a counting circuit in FIG. 2. 予測と更新との間の時間的な関係を説明するためのタイムチャートである。It is a time chart for demonstrating the temporal relationship between prediction and update. 本発明の第2の実施例に係る値予測装置の構成を示すブロック図である。It is a block diagram which shows the structure of the value prediction apparatus which concerns on 2nd Example of this invention. 本発明の実施例による予測動作および更新動作の処理フローを説明するためのフローチャートである。It is a flowchart for demonstrating the processing flow of the prediction operation | movement and update operation | movement by the Example of this invention. 本発明の値予測装置の適用例の構成を示すブロック図である。It is a block diagram which shows the structure of the example of application of the value prediction apparatus of this invention. 図7において予測と更新との間で入れ替わりが発生した状況を示す模式図である。FIG. 8 is a schematic diagram illustrating a situation in which a change occurs between prediction and update in FIG. 7.

符号の説明Explanation of symbols

1 予測回路
2 更新回路
3 予測テーブル
4 ハッシュ回路
5 予測履歴レジスタ
6 計数回路
7−1〜7−n 複数のプロセッサ
8 スレッド制御ユニット
10 値予測装置
10a 値予測装置
11 RAM
12 CPU
14 記憶部
15 追加回路
16 外部記憶装置
20 バッファ回路
30 予測テーブル保持部
50 キューレジスタ
60 コンパレータ
61 計数カウンタ
80 マルチプロセッサシステム
100 値予測装置
DESCRIPTION OF SYMBOLS 1 Prediction circuit 2 Update circuit 3 Prediction table 4 Hash circuit 5 Prediction history register 6 Count circuit 7-1 to 7-n Multiple processors 8 Thread control unit 10 Value prediction device 10a Value prediction device 11 RAM
12 CPU
DESCRIPTION OF SYMBOLS 14 Memory | storage part 15 Additional circuit 16 External memory | storage device 20 Buffer circuit 30 Prediction table holding | maintenance part 50 Queue register 60 Comparator 61 Count counter 80 Multiprocessor system 100 Value prediction apparatus

Claims (5)

予測の対象であるエントリが入力される度に、前記エントリの識別子に基づいて予測テーブルに既に保存されているデータを参照し、前記データの値の予測を行う予測回路と、前記予測回路による予測の処理が完了した時点で、前記予測回路の出力値を予測値として前記予測テーブル内の対応するデータの値を更新する更新回路とを有する値予測装置において、
予測の処理が現在進行中で完了していない予測の履歴を一時的に保持する予測履歴保持手段と、
前記予測の履歴に含まれる識別子と、前記予測の処理の開始時に付与される識別子とを比較し、両方の識別子が互いに一致する回数を計数する計数手段とを備え、
前記両方の識別子が一致する回数が存在する場合、前記予測回路は、前記予測の処理を行って得られる前記予測回路の出力値を前記更新回路に送出し、前記更新回路は、前記予測回路の出力値を用いて前記予測テーブルの状態を仮想的に更新し、仮想的に更新された前記予測テーブルの状態を前記予測回路に返送し、前記予測回路は、仮想的に更新された前記予測テーブルの状態を用いて再度予測の処理を行い、
前記両方の識別子が一致する回数に応じて、前記予測テーブルを実際に更新することなく前記予測回路および前記更新回路の動作を繰り返し、これによって得られる前記予測回路の出力値を最終的な予測値とすることを特徴とする値予測装置。
A prediction circuit that predicts a value of the data by referring to data already stored in a prediction table based on the identifier of the entry each time an entry to be predicted is input, and a prediction by the prediction circuit In the value prediction device having an update circuit that updates the value of the corresponding data in the prediction table using the output value of the prediction circuit as the prediction value at the time when the processing of is completed,
Prediction history holding means for temporarily holding a prediction history that is currently in progress and is not completed,
A counter for comparing the identifier included in the prediction history with the identifier given at the start of the prediction process, and counting the number of times both identifiers match each other;
When there is a number of times that both the identifiers match, the prediction circuit sends the output value of the prediction circuit obtained by performing the prediction process to the update circuit, and the update circuit The state of the prediction table is virtually updated using an output value, the state of the virtually updated prediction table is returned to the prediction circuit, and the prediction circuit is virtually updated with the prediction table Perform the prediction process again using the state of
The operation of the prediction circuit and the update circuit is repeated without actually updating the prediction table according to the number of times the two identifiers match, and the output value of the prediction circuit obtained thereby is the final predicted value. A value predicting device characterized by that.
前記両方の識別子が一致する回数が存在しない場合、前記予測回路は、一回だけ前記予測の処理を行い、これによって得られる前記予測回路の出力値を最終的な予測値とすることを特徴とする請求項1記載の値予測装置。   When there is no number of times that the two identifiers match, the prediction circuit performs the prediction process only once, and an output value of the prediction circuit obtained thereby is used as a final prediction value, The value prediction apparatus according to claim 1. 前記両方の識別子が一致する回数が2以上である場合、前記予測回路および前記更新回路の動作が繰り返される間、仮想的に更新された前記予測テーブルの状態を一時的に保持するバッファ回路を設けることを特徴とする請求項1記載の値予測装置。   When the number of coincidence of both identifiers is 2 or more, a buffer circuit is provided that temporarily holds the state of the virtually updated prediction table while the operations of the prediction circuit and the update circuit are repeated. The value prediction apparatus according to claim 1, wherein: 請求項1から3のいずれか一項に記載の値予測装置と、複数のプロセッサとを有するマルチプロセッサシステムにおいて、
単一のスレッドのプログラムを複数のスレッドに分割し、前記複数のプロセッサによりスレッド単位の値予測による値投機実行を行う場合、前記複数のプロセッサにより処理されるべき前記複数のスレッドが前記エントリとして前記値予測装置に入力されるときに、前記複数のスレッドが前記値予測装置に入力される順番が入れ替わっても、それぞれの前記スレッドに対して正しい値予測を行うことが可能であることを特徴とするマルチプロセッサシステム。
In the multiprocessor system which has a value prediction device according to any one of claims 1 to 3, and a plurality of processors,
When dividing a program of a single thread into a plurality of threads and performing value speculation execution by value prediction on a thread basis by the plurality of processors, the plurality of threads to be processed by the plurality of processors are the entries. Even when the order in which the plurality of threads are input to the value prediction device is switched when input to the value prediction device, it is possible to perform correct value prediction for each of the threads. A multiprocessor system.
入力されるエントリの識別子をもとに予測テーブルに既に保存されているデータを参照して前記データの値の予測を行い、前記予測の処理が完了した時点で、前記予測の処理結果として得られる値を予測値として前記予測テーブル内の対応するデータの値を更新するための値予測方法において、
予測の処理が現在進行中で完了していない予測の履歴を一時的に保持するステップと、
前記予測の履歴に含まれる識別子と、前記予測の処理の開始時に付与される識別子とを比較し、両方の識別子が互いに一致する回数を計数するステップと、
前記両方の識別子が一致する回数が存在する場合、前記予測の処理結果として得られる値を用いて前記予測テーブルの状態を仮想的に更新し、仮想的に更新された前記予測テーブルの状態を用いて再度予測の処理を行うステップと、
前記両方の識別子が一致する回数に応じて、前記予測テーブルを実際に更新することなく前記予測の処理を繰り返し、これによって得られる値を最終的な予測値とするステップとを有することを特徴とする値予測方法。
The value of the data is predicted by referring to the data already stored in the prediction table based on the identifier of the input entry, and obtained as the prediction processing result when the prediction processing is completed In a value prediction method for updating a value of corresponding data in the prediction table using a value as a predicted value,
Temporarily holding a history of predictions that are currently in progress and not complete,
Comparing the identifier included in the prediction history with the identifier given at the start of the prediction process, and counting the number of times both identifiers match each other;
When there is a number of times that both the identifiers match, the state of the prediction table is virtually updated using the value obtained as a result of the prediction process, and the state of the prediction table virtually updated is used. The step of performing the prediction process again,
Repeating the prediction process without actually updating the prediction table according to the number of times the two identifiers match, and setting a value obtained thereby as a final predicted value. Value prediction method.
JP2005128312A 2005-04-26 2005-04-26 Value prediction apparatus, multiprocessor system, and value prediction method Expired - Fee Related JP3795055B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005128312A JP3795055B1 (en) 2005-04-26 2005-04-26 Value prediction apparatus, multiprocessor system, and value prediction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005128312A JP3795055B1 (en) 2005-04-26 2005-04-26 Value prediction apparatus, multiprocessor system, and value prediction method

Publications (2)

Publication Number Publication Date
JP3795055B1 true JP3795055B1 (en) 2006-07-12
JP2006309335A JP2006309335A (en) 2006-11-09

Family

ID=36739888

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005128312A Expired - Fee Related JP3795055B1 (en) 2005-04-26 2005-04-26 Value prediction apparatus, multiprocessor system, and value prediction method

Country Status (1)

Country Link
JP (1) JP3795055B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI338916B (en) * 2007-06-08 2011-03-11 Univ Nat Cheng Kung Dual-phase virtual metrology method

Also Published As

Publication number Publication date
JP2006309335A (en) 2006-11-09

Similar Documents

Publication Publication Date Title
US7870369B1 (en) Abort prioritization in a trace-based processor
US20080077928A1 (en) Multiprocessor system
US7539851B2 (en) Using register readiness to facilitate value prediction
JP6546584B2 (en) Data processing apparatus and method for controlling the execution of speculative vector operations
US6687812B1 (en) Parallel processing apparatus
US20130036426A1 (en) Information processing device and task switching method
US7028167B2 (en) Core parallel execution with different optimization characteristics to decrease dynamic execution path
KR20210018415A (en) Secondary branch prediction storage to reduce latency for predictive failure recovery
US20240152360A1 (en) Branch Prediction Using loop Iteration Count
JP2000322257A (en) Speculative execution control method for conditional branch instruction
JP4170364B2 (en) Processor
JP2001195304A (en) Cache storage device
JP2004038323A (en) Branch estimation system and method
JP3800533B2 (en) Program counter control method and processor
JP3795055B1 (en) Value prediction apparatus, multiprocessor system, and value prediction method
JP2020091751A (en) Operation processing device and method for controlling the same
US7681016B2 (en) Microprocessor instruction execution method for exploiting parallelism by time ordering operations in a single thread at compile time
JP2002014868A (en) Microprocessor having memory referring operation detecting mechanism and compile method
JP5240200B2 (en) Data processing apparatus and method
JP3998686B2 (en) CPU usage time counting method and job control apparatus using this CPU usage time
JPH10340197A (en) Cashing control method and microcomputer
JP2023540036A (en) Alternate path for branch prediction redirection
US7783863B1 (en) Graceful degradation in a trace-based processor
US20230393907A1 (en) Arithmetic processing apparatus and arithmetic processing method
JP2007293814A (en) Processor device and processing method therefor

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060411

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20090421

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20100421

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20110421

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees