JP2007293816A - Processor device and processing method therefor - Google Patents

Processor device and processing method therefor Download PDF

Info

Publication number
JP2007293816A
JP2007293816A JP2007029489A JP2007029489A JP2007293816A JP 2007293816 A JP2007293816 A JP 2007293816A JP 2007029489 A JP2007029489 A JP 2007029489A JP 2007029489 A JP2007029489 A JP 2007029489A JP 2007293816 A JP2007293816 A JP 2007293816A
Authority
JP
Japan
Prior art keywords
slack
instruction
predicted
value
execution
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.)
Pending
Application number
JP2007029489A
Other languages
Japanese (ja)
Inventor
Ryotaro Kobayashi
良太郎 小林
Hisahiro Hayashi
久紘 林
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.)
Semiconductor Technology Academic Research Center
Original Assignee
Semiconductor Technology Academic Research Center
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 Semiconductor Technology Academic Research Center filed Critical Semiconductor Technology Academic Research Center
Priority to JP2007029489A priority Critical patent/JP2007293816A/en
Priority to US11/717,063 priority patent/US20070234014A1/en
Publication of JP2007293816A publication Critical patent/JP2007293816A/en
Priority to US12/634,069 priority patent/US20100095151A1/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To execute instructions fast by predicting local slack with simpler constitution than conventional techniques. <P>SOLUTION: A processor predicts predicted slack which is a predicted value of local slack of an instruction to be executed and executes the instruction using the predicted slack. A slack table is referred to upon execution of an instruction to obtain predicted slack of the instruction and execution latency is increased by an amount equivalent to the obtained predicted slack. Then, it is estimated, based on behavior exhibited upon execution of the instruction, whether or not the predicted slack has reached target slack which is an appropriate value of current local slack of the instruction. The predicted slack is gradually increased each time the instruction is executed, until it is estimated that the predicted slack has reached the target slack. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、プロセッサで実行される命令のローカル・スラックを予測して命令を実行するプロセッサ装置と、当該プロセッサ装置の処理方法に関する。   The present invention relates to a processor device that predicts local slack of an instruction executed by a processor and executes the instruction, and a processing method of the processor device.

近年、クリティカル・パスに関する情報を用いた、マイクロプロセッサの高速化や消費電力の削減に関する研究が数多く行われている(例えば、非特許文献2,3,8,11,13参照。)。クリティカル・パスとは、プログラム全体の実行時間を決定する動的な命令列で構成されるパスである。クリティカル・パス上の命令の実行レイテンシをたとえ1サイクルでも増加させると、プログラム全体の実行サイクル数が増加する。しかし、クリティカル・パス情報は命令がクリティカル・パス上にあるかないかの2通りしかなく、命令は2種類にしか分類できない。また、クリティカル・パス上の命令数は非クリティカル・パス上の命令数よりも大幅に少なく、それぞれのカテゴリ毎に命令処理を分けた場合、負荷バランスが悪い。これらより、クリティカル・パス情報は、適用範囲が狭くなってしまう。   In recent years, many studies on speeding up of microprocessors and reduction of power consumption using information on critical paths have been conducted (for example, see Non-Patent Documents 2, 3, 8, 11, and 13). A critical path is a path composed of a dynamic instruction sequence that determines the execution time of the entire program. If the execution latency of instructions on the critical path is increased even by one cycle, the number of execution cycles of the entire program increases. However, there are only two types of critical path information, whether the instruction is on the critical path or not, and the instruction can only be classified into two types. In addition, the number of instructions on the critical path is significantly smaller than the number of instructions on the non-critical path, and when the instruction processing is divided for each category, the load balance is poor. Therefore, the application range of critical path information becomes narrow.

これに対し、クリティカル・パスの代わりに、命令のスラックを用いる手法が提案されている(例えば、非特許文献4,5参照。)。命令のスラックとは、プログラム全体の実行サイクル数を増加させることなく、その命令の実行レイテンシを増加させることのできるサイクル数である。命令のスラックが分かれば、各命令がクリティカル・パス上にあるかどうかだけでなく、クリティカル・パス上にない命令の実行レイテンシを、プログラムの実行に影響しない範囲で、どの程度増加させられるのかが分かる。従って、スラックを用いれば、命令を3種類以上のカテゴリに分けることができ、さらに、各カテゴリに属する命令数の不均衡を緩和することもできる。   On the other hand, a technique using instruction slack instead of the critical path has been proposed (see, for example, Non-Patent Documents 4 and 5). The slack of an instruction is the number of cycles that can increase the execution latency of the instruction without increasing the number of execution cycles of the entire program. Knowing the instruction slack, not only whether each instruction is on the critical path, but also how much the execution latency of instructions not on the critical path can be increased without affecting program execution. I understand. Therefore, if slack is used, the instructions can be divided into three or more categories, and further, the imbalance in the number of instructions belonging to each category can be alleviated.

各動的命令のスラックは、ある範囲を持った値である。スラックの最小値は常に0である。一方、スラックの最大値(グローバル・スラック(例えば、非特許文献5参照。))は動的に決まる。スラックを最大限利用するためには、グローバル・スラックを求める必要がある。しかし、ある命令のグローバル・スラックを求めるためには、実行レイテンシの増加がプログラム全体の実行サイクル数に与える影響を、プログラムの実行中に調べなければならない。そのため、グローバル・スラックを求めるのは非常に難しい。   The slack of each dynamic instruction is a value having a certain range. The minimum value of slack is always 0. On the other hand, the maximum value of slack (global slack (see, for example, Non-Patent Document 5)) is dynamically determined. In order to make the best use of slack, it is necessary to seek global slack. However, in order to obtain the global slack of an instruction, the influence of the increase in execution latency on the number of execution cycles of the entire program must be examined during the execution of the program. Therefore, it is very difficult to seek global slack.

そこで、グローバル・スラックではなく、ローカル・スラック(例えば、非特許文献5参照。)を予測する手法が提案された(例えば、非特許文献6,10参照。)。命令のローカル・スラックとは、プログラム全体の実行サイクル数だけでなく、後続命令の実行にも影響を与えないスラックの最大値である。ある命令のローカル・スラックは、依存関係のある後続命令に着目するだけで、容易に求めることができる。従来手法では、ある命令がレジスタ・データ、あるいは、メモリ・データを定義した時刻と、そのデータを最初に参照した時刻の差から、当該命令のローカル・スラックを求め、それを基に、将来のローカル・スラックを予測する。   Therefore, a method for predicting local slack (for example, see Non-Patent Document 5) instead of global slack has been proposed (for example, see Non-Patent Documents 6 and 10). The local slack of an instruction is the maximum slack value that does not affect the execution of subsequent instructions as well as the number of execution cycles of the entire program. The local slack of a certain instruction can be easily obtained simply by paying attention to the succeeding instruction having a dependency relationship. In the conventional method, the local slack of the instruction is obtained from the difference between the time when the instruction defines the register data or memory data and the time when the data is first referenced. Predict local slack.

しかし、従来手法では、データを定義した時刻を保持するためのテーブルと、時刻の差を求めるための演算器を用意する必要がある。また、プログラムの実行と並列に、定義時刻を保持するテーブルの参照/更新や、時刻の引き算を行わなければならない。これらのコストが発生する原因は、データの定義/参照時刻を用いてローカル・スラックを直接計算することにある。   However, in the conventional method, it is necessary to prepare a table for holding the time at which the data is defined and an arithmetic unit for obtaining the time difference. In parallel with the execution of the program, it is necessary to refer to / update the table holding the defined time and subtract the time. The cause of these costs is the direct calculation of local slack using data definition / reference times.

次いで、スラックについて以下に説明する。   Next, slack will be described below.

図1(a)は従来技術に係るスラックを説明するために用いる複数の命令を含むプログラムの一例を示す図であり、図1(b)は上記プログラムの各命令をプロセッサ装置上で実行する過程を示すタイミングチャートである。図1(a)及び図1(b)において、ノードは命令を示し、エッジは命令間のデータ依存関係を示す。縦軸は命令を実行したサイクルを示す。ノードの長さは命令の実行レイテンシ(実行遅延時間をいう。)を示す。実行レイテンシは、命令i1と命令i4が2サイクル、その他の命令が1サイクルである。   FIG. 1A is a diagram showing an example of a program including a plurality of instructions used for explaining slack according to the prior art, and FIG. 1B is a process of executing each instruction of the program on a processor device. It is a timing chart which shows. In FIG. 1A and FIG. 1B, a node indicates an instruction, and an edge indicates a data dependency between instructions. The vertical axis indicates the cycle in which the instruction is executed. The length of the node indicates an instruction execution latency (referred to as an execution delay time). The execution latency is two cycles for the instruction i1 and the instruction i4, and one cycle for the other instructions.

ここで、命令i0のスラックについて考える。命令i0の実行レイテンシを3サイクル増加させた場合、それに直接的、間接的に依存する命令i3、i5の実行が遅れる。その結果、命令i5は、プログラム中、最も最後に実行される命令i6と同時刻に実行される。従って、命令i0の実行レイテンシをこれ以上増加させると、プログラム全体の実行サイクル数が増加する。つまり、命令i0のグローバル・スラックは3である。このように、ある命令のグローバル・スラックを求めるためには、その命令の実行レイテンシの増加が、プログラム全体の実行に与える影響を調べる必要がある。そのため、グローバル・スラックの判定は非常に難しい。   Here, the slack of the instruction i0 is considered. When the execution latency of the instruction i0 is increased by 3 cycles, execution of the instructions i3 and i5 that depend directly or indirectly on the instruction i0 is delayed. As a result, the instruction i5 is executed at the same time as the instruction i6 executed last in the program. Therefore, if the execution latency of the instruction i0 is further increased, the number of execution cycles of the entire program increases. That is, the global slack of the instruction i0 is 3. As described above, in order to obtain the global slack of a certain instruction, it is necessary to examine the influence of the increase in the execution latency of the instruction on the execution of the entire program. Therefore, it is very difficult to determine global slack.

一方、命令i0の実行を2サイクル増加させた場合、後続命令の実行に影響は与えない。しかし、これ以上実行レイテンシを増加させると、直接的、間接的に依存関係にある命令i3と命令i5の実行が遅れる。つまり、命令i0のローカル・スラックは2である。このように、ある命令のローカル・スラックを求めるには、その命令に依存する命令への影響に着目すれば良い。従って、ローカル・スラックは比較的容易に判定することができる。   On the other hand, when the execution of the instruction i0 is increased by two cycles, the execution of the subsequent instruction is not affected. However, if the execution latency is further increased, execution of the instructions i3 and i5 that are directly or indirectly dependent on each other is delayed. That is, the local slack of the instruction i0 is 2. Thus, in order to obtain the local slack of a certain instruction, attention should be paid to the influence on the instruction depending on the instruction. Therefore, local slack can be determined relatively easily.

次いで、従来技術に係るスラック予測方法について以下に説明する。例えば、図1(b)の命令i0がデータを定義した時刻0と、そのデータが命令i3によって最初に参照された時刻3との差から、さらに1を引き、命令i0のローカル・スラックは2であると計算する。そして、それを基に、命令i0を次に実行する場合のローカル・スラックは2であると予測する。   Next, a slack prediction method according to the prior art will be described below. For example, by subtracting 1 from the difference between time 0 when the instruction i0 in FIG. 1B defined data and time 3 when the data was first referred to by the instruction i3, the local slack of the instruction i0 is 2 Calculate that Based on this, the local slack in the next execution of the instruction i0 is predicted to be 2.

図2は、従来技術に係るローカル・スラック予測機構を備えたプロセッサ装置の構成を示すブロック図である。図2において、プロセッサ10は、主記憶装置9から命令をフェッチするフェッチ・ユニット11と、デコード・ユニット12と、命令ウィンドウ(I−win)13と、レジスタ・ファイル(RF)14と、複数の実行ユニット(EU)15、リオーダ・バッファ(ROB)16とを備えて構成される。プロセッサ10の右側において、従来技術に係るローカル・スラック予測機構を示す。ローカル・スラック予測機構は、レジスタ・データを定義した時刻を保持するためのレジスタ定義表2と、メモリ・データを定義した時刻を保持するためのメモリ定義表3と、これら2つの定義表2,3からの出力を選択的に切り換えて定義時刻を出力するマルチプレクサ4と、定義時刻と現在時刻との差を求めるための演算器である減算器5とを備える。さらに、ローカル・スラック予測機構は、各命令のローカル・スラックを保持するためのスラック表6を備える。ここで、レジスタ定義表2と、メモリ定義表3と、スラック表6とは、各テーブルを記憶するための記憶装置で構成される。   FIG. 2 is a block diagram illustrating a configuration of a processor device including a local slack prediction mechanism according to the related art. In FIG. 2, the processor 10 includes a fetch unit 11 that fetches an instruction from the main storage device 9, a decode unit 12, an instruction window (I-win) 13, a register file (RF) 14, and a plurality of An execution unit (EU) 15 and a reorder buffer (ROB) 16 are provided. On the right side of the processor 10, a local slack prediction mechanism according to the prior art is shown. The local slack prediction mechanism includes a register definition table 2 for holding a time at which register data is defined, a memory definition table 3 for holding a time at which memory data is defined, and these two definition tables 2, 3 includes a multiplexer 4 that selectively switches the output from 3 and outputs a defined time, and a subtractor 5 that is an arithmetic unit for obtaining a difference between the defined time and the current time. Further, the local slack prediction mechanism includes a slack table 6 for holding local slack for each instruction. Here, the register definition table 2, the memory definition table 3, and the slack table 6 are configured by a storage device for storing each table.

図1(b)の命令i0のローカル・スラックを例に、従来機構の動作を簡単に説明する。命令i0はデータを定義するときに、命令i0自身とともに現在時刻0を定義表に記録する。i3}はデータを使用するときに、データを定義した命令i0とデータを定義した時刻(定義時刻)0を、定義表2,3から得る。そして、現在時刻3と定義時刻0との差分からさらに1を引くことで、命令i0のローカル・スラック2を求める。求めたスラックは、スラック表6の命令i0に対応するエントリに記録する。命令i0をフェッチ・ユニット11により次にフェッチしたときに、スラック表6を参照し、得られたスラックから、命令i0のローカル・スラックは2であると予測する。   The operation of the conventional mechanism will be briefly described using local slack of the instruction i0 in FIG. 1B as an example. When the instruction i0 defines data, it records the current time 0 in the definition table together with the instruction i0 itself. i3} obtains the instruction i0 defining the data and the time (definition time) 0 defining the data from the definition tables 2 and 3 when using the data. Then, the local slack 2 of the instruction i0 is obtained by further subtracting 1 from the difference between the current time 3 and the definition time 0. The obtained slack is recorded in the entry corresponding to the instruction i0 in the slack table 6. When the instruction i0 is next fetched by the fetch unit 11, the slack table 6 is referred to, and the local slack of the instruction i0 is predicted to be 2 from the obtained slack.

以上のように、従来手法では、定義表2,3と減算器6を用意する必要があり、ハードウェア・コストが増大する。また、プログラムの実行と並列に、定義表2,3の参照及び更新と時刻の引き算を行わなければならないため、高速な動作を必要とし、それが消費電力に大きな影響を及ぼす可能性がある。こうした問題が発生する原因は、データの定義及び参照時刻に着目してローカル・スラックを直接計算することにある。   As described above, in the conventional method, it is necessary to prepare the definition tables 2 and 3 and the subtracter 6, which increases the hardware cost. In addition, since the definition tables 2 and 3 must be referred to and updated and the time is subtracted in parallel with the execution of the program, a high-speed operation is required, which may greatly affect power consumption. The cause of such a problem is that the local slack is directly calculated by paying attention to the definition of data and the reference time.

特開2000−353099号公報。JP 2000-353099 A. 特開2004−286381号公報。Japanese Patent Application Laid-Open No. 2004-286381. D. Burger et al., "The Simplescalar Tool Set Version 2.0", Technical Report 1342, Department of Computer Sciences, University of Wisconsin-Madison, June 1997。D. Burger et al., "The Simplescalar Tool Set Version 2.0", Technical Report 1342, Department of Computer Sciences, University of Wisconsin-Madison, June 1997. 千代延昭宏ほか,「低消費電力プロセッサアーキテクチャ向けクリティカルパス予測器の提案」,情報処理学会研究報告,2002−ARC−149,社団法人情報処理学会発行,2002年8月。Nobuhiro Chiyo et al., “Proposal of Critical Path Predictor for Low Power Consumption Processor Architecture”, Research Report of Information Processing Society of Japan, 2002-ARC-149, published by Information Processing Society of Japan, August 2002. B. Fields et al., "Focusing Processor Policies via Critical-Path Prediction", In Proceedings of ISCA-28, June 2001。B. Fields et al., “Focusing Processor Policies via Critical-Path Prediction”, In Proceedings of ISCA-28, June 2001. B. Fields et al., "Using Interaction Costs for Microarchitectural Bottleneck Analysis", In proceedings of MICRO-36, December 2003。B. Fields et al., "Using Interaction Costs for Microarchitectural Bottleneck Analysis", In proceedings of MICRO-36, December 2003. B. Fields et al., "Slack: Maximizing Performance under Technological Constraints", In Proceedings of ISCA-29, May 2002。B. Fields et al., “Slack: Maximizing Performance under Technological Constraints”, In Proceedings of ISCA-29, May 2002. 福山智久ほか,「スラック予測を用いた省電力アーキテクチャ向け命令スケジューリング」,先進的計算基盤システムシンポジウム,ACSIS2005, 2005年5月。Fukuyama Tomohisa et al., “Instruction Scheduling for Power Saving Architecture Using Slack Prediction”, Advanced Computational Infrastructure System Symposium, ACSIS 2005, May 2005. J. L. Hennessy et al., "Computer Architecture: A Quantitative Approach", 2nd Edition, Morgan Kaufmann Publishing Incorporated, San Francisco, California, U.S.A., 1996。J. L. Hennessy et al., "Computer Architecture: A Quantitative Approach", 2nd Edition, Morgan Kaufmann Publishing Incorporated, San Francisco, California, U.S.A., 1996. 小林良太郎ほか,「データフロー・グラフの最長パスに着目したクラスタ化スーパースカラ・プロセッサにおける命令発行機構」,2001年並列処理シンポジウムJSPP2001,2001年6月。Ryotaro Kobayashi et al., "Instruction Issuing Mechanism in Clustered Superscalar Processor Focusing on Longest Path of Dataflow Graph", 2001 Parallel Processing Symposium JSPP 2001, June 2001. M. Levy, "Samsung Twists ARM Past 1GHz", Microprocessor Report 2002-10-16, October 2002。M. Levy, "Samsung Twists ARM Past 1GHz", Microprocessor Report 2002-10-16, October 2002. 劉小路ほか,「クリティカリティ予測のためのスラック予測」,先進的計算基盤システムシンポジウムSACSIS2004,2004年5月。Liu Koji et al., “Slack Prediction for Criticality Prediction”, Advanced Computational Infrastructure System Symposium SACSIS 2004, May 2004. J. S. Seng et al., "Reducing Power with Dynamic Critical Path Information", In Proceedings of MICRO-34, December 2001。J. S. Seng et al., “Reducing Power with Dynamic Critical Path Information”, In Proceedings of MICRO-34, December 2001. P. Shivakumar et al., "CACTI 3.0: An Integrated Cache Timing and Power, and Area Model", Compaq WRL Report 2001/2, August 2001。P. Shivakumar et al., “CACTI 3.0: An Integrated Cache Timing and Power, and Area Model”, Compaq WRL Report 2001/2, August 2001. E. Tune et al., "Dynamic Prediction of Critical Path Instructions", In Proceedings of HPCA-7, January 2001。E. Tune et al., “Dynamic Prediction of Critical Path Instructions”, In Proceedings of HPCA-7, January 2001.

上述の従来技術に係る予測手法によれば、ある程度正確なローカル・スラックの予測が確かに可能ではあるが、スラック表に加え、2つの定義表と演算器とが必要であり、予測機構のハードウェア・コストは極めて高いものとなる。また、プログラムの実行と並行して、定義表の参照/更新、時刻の引き算を高速度で行わなければならず、予測機構の動作による消費電力の増大が無視し難いものとなるおそれもある。   According to the above-described prediction method according to the prior art, it is possible to accurately predict local slack to some extent. However, in addition to the slack table, two definition tables and a computing unit are necessary, and the prediction mechanism is hard. Wear costs are extremely high. In parallel with program execution, definition table reference / update and time subtraction must be performed at a high speed, and an increase in power consumption due to the operation of the prediction mechanism may be difficult to ignore.

また、実際のローカル・スラック(実スラック)は動的に変化する。そのため、この変化に対応する手法が提案されている(例えば、非特許文献6参照。)。しかし、実スラックの変化に十分追従できず、性能低下を招く可能性があるという問題点があった。   Also, actual local slack (actual slack) changes dynamically. Therefore, a method corresponding to this change has been proposed (see, for example, Non-Patent Document 6). However, there is a problem in that the actual slack change cannot be sufficiently followed and there is a possibility that the performance may be degraded.

本発明の目的は以上の問題点を解決し、従来技術に比較して簡単な構成で、ローカル・スラックの予測を行い、高速でプログラム命令の実行を行うことができるプロセッサ装置及びプロセッサ装置の処理方法を提供することにある。   SUMMARY OF THE INVENTION An object of the present invention is to solve the above-mentioned problems, and to perform prediction of local slack and execution of program instructions at high speed with a simple configuration compared to the prior art, and processing of the processor apparatus It is to provide a method.

第1の発明に係るプロセッサ装置は、プロセッサ装置で実行される命令のローカル・スラックの予測値である予測スラックを予測し、上記命令をその予測スラックを利用して実行するプロセッサ装置において、
上記予測スラックを含むスラック表を記憶する記憶手段と、
命令の実行に際して上記スラック表を参照して当該命令の予測スラックを取得するとともに、上記取得した予測スラックの分だけ実行レイテンシを増加させる設定手段と、
上記命令の実行時の振る舞いに基づき、当該命令の現状のローカル・スラックの適正値であるターゲット・スラックに上記予測スラックが到達したか否かを推定する推定手段と、
上記推定手段により上記予測スラックが上記ターゲット・スラックに到達したとの推定がなされるまで、上記予測スラックを上記命令の実行毎に徐々に増加させる更新手段とを備えたことを特徴とする。
According to a first aspect of the present invention, there is provided a processor device that predicts predicted slack, which is a predicted value of local slack of an instruction executed by the processor device, and executes the instruction using the predicted slack.
Storage means for storing a slack table including the predicted slack;
Setting means for acquiring predicted slack of the instruction with reference to the slack table upon execution of the instruction and increasing execution latency by the amount of the acquired predicted slack;
An estimation means for estimating whether or not the predicted slack has reached the target slack, which is an appropriate value of the current local slack of the instruction, based on the execution behavior of the instruction;
Update means for gradually increasing the predicted slack every time the instruction is executed until the estimated means estimates that the predicted slack has reached the target slack.

上記プロセッサ装置において、上記更新手段は、上記予測スラックの値に応じて、スラック命令数を維持したまま当該プロセッサ装置の性能低下を抑制するように、上記スラックの更新に用いるパラメータを変更することを特徴とする。   In the processor device, the updating means may change a parameter used for updating the slack according to the predicted slack value so as to suppress a decrease in performance of the processor device while maintaining the number of slack instructions. Features.

また、上記プロセッサ装置において、上記更新手段は、上記予測スラックが所定のしきい値以上であるか否かに応じて、上記スラックの更新に用いるパラメータを変更することを特徴とする。   Further, in the processor device, the updating means changes a parameter used for updating the slack according to whether or not the predicted slack is equal to or greater than a predetermined threshold value.

さらに、上記プロセッサ装置において、上記推定手段は、
(A)当該命令の実行時に分岐予測ミスが発生したこと、
(B)当該命令の実行時にキャッシュ・ミスが発生したこと、
(C)後続命令に対するオペランド・フォワーディングが発生したこと、
(D)後続命令に対するストアデータフォワーディングが発生したこと、
(E)当該命令が命令ウィンドウに存在する命令の中で最も古い命令となっていること、
(F)当該命令がリオーダ・バッファに存在する命令の中で最も古い命令となっていること、
(G)当該命令が、上記命令ウィンドウに存在する命令の中で最も古い命令に実行結果を渡す命令となっていること、
(H)当該命令が、同一のサイクルに実行される命令の中で最も多くの後続命令に実行結果を渡す命令となっていること、
(I)当該命令の実行結果を渡すことで、実行可能な状態となる後続命令の数が、予め定められた判定値以上となっていること
のうちの少なくとも1つを上記推定の成立条件として、上記ターゲット・スラックへの上記予測スラックの到達を推定することを特徴とする。
Furthermore, in the processor device, the estimation means includes
(A) A branch prediction error occurred during execution of the instruction,
(B) A cache miss occurred during execution of the instruction;
(C) Operand forwarding for the subsequent instruction has occurred,
(D) that store data forwarding has occurred for the subsequent instruction;
(E) the instruction is the oldest instruction in the instruction window;
(F) the instruction is the oldest instruction in the reorder buffer;
(G) The instruction is an instruction that passes the execution result to the oldest instruction in the instruction window.
(H) The instruction is an instruction that passes the execution result to the most subsequent instructions among the instructions executed in the same cycle;
(I) By passing the execution result of the instruction, at least one of the fact that the number of subsequent instructions that can be executed becomes equal to or greater than a predetermined determination value is used as a condition for establishing the above estimation The arrival of the predicted slack to the target slack is estimated.

またさらに、上記プロセッサ装置において、上記予測スラックが上記ターゲット・スラックに到達したとの推定の成立条件が成立となったときにそのカウンタ値が増加又は減少され、上記推定の成立条件が不成立となったときにそのカウンタ値が減少又は増加される信頼性カウンタをさらに備え、
上記更新手段は、上記信頼性カウンタのカウンタ値が増加判定値となったことを条件に上記予測スラックを増加させ、上記信頼性カウンタのカウンタ値が減少判定値となったことを条件に上記予測スラックを減少させることを特徴とする。
Furthermore, in the processor device, when a condition for establishing that the predicted slack has reached the target slack is satisfied, the counter value is increased or decreased, and the condition for establishing the estimation is not satisfied. Further comprising a reliability counter whose counter value is decreased or increased when
The updating means increases the prediction slack on the condition that the counter value of the reliability counter becomes an increase determination value, and the prediction on the condition that the counter value of the reliability counter becomes a decrease determination value. It is characterized by reducing slack.

また、上記プロセッサ装置において、上記信頼性カウンタでの上記推定の成立条件の成立時における上記カウンタ値の増加量又は減少量は、上記推定の成立条件の不成立時における上記カウンタ値の減少量又は増加量よりも大きく設定されたことを特徴とする。   In the processor device, the increment or decrement of the counter value when the condition for establishment of the estimation is satisfied in the reliability counter is the decrease or increase of the counter value when the condition for establishment of the estimation is not established. It is characterized by being set larger than the amount.

さらに、上記プロセッサ装置において、上記カウンタ値の増加量及び減少量は上記各命令の種別により異なるように設定されたことを特徴とする。   Further, in the processor device, the increment and decrement of the counter value are set to be different depending on the type of each instruction.

またさらに、上記プロセッサ装置において、上記更新手段による各命令の上記予測スラックの1回当たりの更新量は、上記各命令の種別によって異なるように設定されたことを特徴とする。   Still further, in the processor device, the amount of update of the predicted slack of each instruction by the update unit is set to be different depending on the type of each instruction.

また、上記プロセッサ装置において、上記更新手段によって更新される各命令の上記予測スラックには上限値が設定され、上記上限値は命令の種別によって異なるように設定されたことを特徴とする。   In the processor device, an upper limit value is set for the predicted slack of each instruction updated by the updating means, and the upper limit value is set differently depending on the type of instruction.

さらに、上記プロセッサ装置において、プログラムの分岐履歴が記録される分岐履歴レジスタをさらに備え、
上記スラック表は、上記分岐履歴レジスタを参照して得られる分岐パターンの別に上記命令の予測スラックを個別に記録することを特徴とする。
Further, the processor device further includes a branch history register for recording a branch history of the program,
In the slack table, predicted slack of the instruction is individually recorded in addition to a branch pattern obtained by referring to the branch history register.

第2の発明に係るプロセッサ装置の処理方法は、プロセッサ装置で実行される命令のローカル・スラックの予測値である予測スラックを予測し、上記命令をその予測スラックを利用して実行するプロセッサ装置の処理方法において、
プロセッサ装置で実行される命令を、上記予測スラックの値分だけその実行レイテンシを増加させて実行し、上記命令の実行時の振る舞いに基づいて、現状におけるローカル・スラックの適正値であるターゲット・スラックに上記予測スラックが到達したか否かを推定し、到達したとの推定がなされるまで上記予測スラックを上記命令の実行毎に徐々に増加させて行くように更新する制御ステップを含むことを特徴とする。
According to a second aspect of the present invention, there is provided a processing method of a processor device for predicting predicted slack, which is a predicted value of local slack of an instruction executed by the processor device, and executing the instruction using the predicted slack. In the processing method,
The instruction executed by the processor unit is executed with the execution latency increased by the value of the predicted slack, and the target slack which is the appropriate value of the current local slack based on the behavior at the time of execution of the instruction. Including a control step of estimating whether or not the predicted slack has been reached and updating the predicted slack so as to gradually increase each time the instruction is executed until it is estimated that the predicted slack has been reached. And

上記プロセッサ装置の処理方法において、上記制御ステップは、上記予測スラックの値に応じて、スラック命令数を維持したまま当該プロセッサ装置の性能低下を抑制するように、上記スラックの更新に用いるパラメータを変更することを特徴とする。   In the processing method of the processor device, the control step changes the parameter used for updating the slack so as to suppress the performance degradation of the processor device while maintaining the number of slack instructions according to the predicted slack value. It is characterized by doing.

また、上記プロセッサ装置の処理方法において、上記制御ステップは、上記予測スラックが所定のしきい値以上であるか否かに応じて、上記スラックの更新に用いるパラメータを変更することを特徴とする。   In the processing method of the processor device, the control step changes a parameter used for updating the slack according to whether or not the predicted slack is a predetermined threshold value or more.

さらに、上記プロセッサ装置の処理方法において、上記予測スラックが上記ターゲット・スラックに到達したとの推定の成立条件として、
(A)当該命令の実行時に分岐予測ミスが発生したこと、
(B)当該命令の実行時にキャッシュ・ミスが発生したこと、
(C)後続命令に対するオペランド・フォワーディングが発生したこと、
(D)後続命令に対するストアデータフォワーディングが発生したこと、
(E)当該命令が命令ウィンドウに存在する命令の中で最も古い命令となっていること、
(F)当該命令がリオーダ・バッファに存在する命令の中で最も古い命令となっていること、
(G)当該命令が、上記命令ウィンドウに存在する命令の中で最も古い命令に実行結果を渡す命令となっていること、
(H)当該命令が、同一のサイクルに実行される命令の中で最も多くの後続命令に実行結
果を渡す命令となっていること、
(I)当該命令の実行結果を渡すことで、実行可能な状態となる後続命令の数が、所定の判定値以上となっていること
のうちの少なくとも1つを含むことを特徴とする。
Further, in the processing method of the processor device, as a condition for establishing the estimation that the predicted slack has reached the target slack,
(A) A branch prediction error occurred during execution of the instruction,
(B) A cache miss occurred during execution of the instruction;
(C) Operand forwarding for the subsequent instruction has occurred,
(D) that store data forwarding has occurred for the subsequent instruction;
(E) the instruction is the oldest instruction in the instruction window;
(F) the instruction is the oldest instruction in the reorder buffer;
(G) The instruction is an instruction that passes the execution result to the oldest instruction in the instruction window.
(H) The instruction is an instruction that passes the execution result to the most subsequent instructions among the instructions executed in the same cycle;
(I) It is characterized in that at least one of the number of succeeding instructions that become executable by passing the execution result of the instruction is at least a predetermined determination value is included.

またさらに、上記プロセッサ装置の処理方法において、上記予測スラックが上記ターゲット・スラックに到達したとの推定がなされたときには上記予測スラックを減少させることを特徴とする。   Furthermore, in the processing method of the processor device, when it is estimated that the predicted slack has reached the target slack, the predicted slack is decreased.

また、上記プロセッサ装置の処理方法において、上記予測スラックの増加は、上記予測スラックが上記ターゲット・スラックに到達したとの推定の成立条件の不成立回数が規定の回数となったことを条件に行われ、上記予測スラックの減少は、上記成立条件の成立回数が規定の回数となったことを条件に行われることを特徴とする。   Further, in the processing method of the processor device, the increase in the predicted slack is performed on the condition that the number of times that the estimated condition that the predicted slack has reached the target slack has not been satisfied is a specified number. The decrease in the predicted slack is performed under the condition that the number of times the satisfaction condition is satisfied reaches a specified number.

さらに、上記プロセッサ装置の処理方法において、上記予測スラックを増加させるために必要な上記成立条件の不成立回数を、上記予測スラックを減少させるために必要な上記成立条件の成立回数よりも大きく設定したことを特徴とする。   Further, in the processing method of the processor device, the number of times that the satisfaction condition is not satisfied to increase the predicted slack is set to be greater than the number of times that the satisfaction condition is required to decrease the predicted slack. It is characterized by.

またさらに、上記プロセッサ装置の処理方法において、上記予測スラックの増加は、上記予測スラックが上記ターゲット・スラックに到達したとの推定の成立条件の不成立回数が規定の回数となったことを条件に行われ、上記予測スラックの減少は、上記成立条件の成立を条件に行われることを特徴とする。   Still further, in the processing method of the processor device, the increase in the predicted slack is performed on the condition that the number of times that the estimated condition that the predicted slack has reached the target slack has not been satisfied becomes a specified number. The decrease in the predicted slack is performed on the condition that the satisfaction condition is satisfied.

また、上記プロセッサ装置の処理方法において、上記規定の回数を、上記命令の種別により異なるように設定したことを特徴とする。   In the processing method of the processor device, the prescribed number of times is set to be different depending on the type of the instruction.

さらに、上記プロセッサ装置の処理方法において、上記命令の種別により、1回当たりの予測スラックの更新量を異なるように設定されたことを特徴とする。   Furthermore, in the processing method of the processor device, the amount of update of predicted slack per time is set differently depending on the type of the instruction.

またさらに、上記プロセッサ装置の処理方法において、上記予測スラックの上限値を、上記命令の種別により異なるように設定されたことを特徴とする。   Still further, in the processing method of the processor device, the upper limit value of the predicted slack is set to be different depending on the type of the instruction.

本発明に係るプロセッサ装置とその処理方法によれば、命令の実行に際して上記スラック表を参照して当該命令の予測スラックを取得するとともに、上記取得した予測スラックの分だけ実行レイテンシを増加させ、上記命令の実行時の振る舞いに基づき、当該命令の現状のローカル・スラックの適正値であるターゲット・スラックに上記予測スラックが到達したか否かを推定し、上記予測スラックが上記ターゲット・スラックに到達したとの推定がなされるまで、上記予測スラックを上記命令の実行毎に徐々に増加させる。従って、命令のローカル・スラックの予測値(予測スラック)を計算で直接的に求めるのではなく、命令の実行時の振る舞いを観測しながら、適正値に到達するまで予測スラックを徐々に増加させることで求めているので、予測スラックの直接演算に要する複雑な機構は不要であり、より簡易な構成でローカル・スラックの予測を行うことができる。   According to the processor device and the processing method thereof according to the present invention, when executing an instruction, the predicted slack of the instruction is acquired with reference to the slack table, the execution latency is increased by the acquired predicted slack, Based on the behavior at the time of execution of the instruction, it is estimated whether the predicted slack has reached target slack, which is the appropriate value of the current local slack of the instruction, and the predicted slack has reached the target slack. The estimated slack is gradually increased for each execution of the instruction until it is estimated. Therefore, instead of directly calculating the predicted value of local slack of the instruction (predicted slack), the predicted slack is gradually increased until the appropriate value is reached while observing the behavior at the time of execution of the instruction. Therefore, a complicated mechanism required for direct calculation of predicted slack is not required, and local slack can be predicted with a simpler configuration.

また、ローカル・スラックの値に応じて、スラックの更新に用いるパラメータを変更するようにしたので、スラック命令数を維持したまま、性能低下を抑制できるようになる。それ故、従来技術に比較して簡単な構成で、ローカル・スラックの予測を行い、さらに高速でプログラム命令の実行を行うことができる。   Further, since the parameters used for slack update are changed according to the value of local slack, it is possible to suppress performance degradation while maintaining the number of slack instructions. Therefore, it is possible to perform local slack prediction and execute program instructions at a higher speed with a simpler configuration as compared with the prior art.

以下、本発明に係る実施形態について図面を参照して説明する。なお、以下の各実施形態において、同様の構成要素については同一の符号を付している。また、章及び節の番号は、各実施形態毎に独立に付している。   Hereinafter, embodiments according to the present invention will be described with reference to the drawings. In addition, in each following embodiment, the same code | symbol is attached | subjected about the same component. Also, chapter and section numbers are assigned independently for each embodiment.

第1の実施形態.
本発明に係る第1の実施形態では、発見的手法に基づいてローカル・スラックを予測する機構を提案する。この機構では、命令実行時の振る舞いを観測しながら、試行錯誤的にローカル・スラックを予測して行く。これにより、ローカル・スラックを直接計算する必要がなくなる。さらに、本実施形態では、応用例として、ローカル・スラックを用いた機能ユニットの低消費電力化手法を取り上げ、提案機構の効果について評価を行う。
First embodiment.
In the first embodiment according to the present invention, a mechanism for predicting local slack based on a heuristic technique is proposed. In this mechanism, local slack is predicted by trial and error while observing the behavior during instruction execution. This eliminates the need to calculate local slack directly. Furthermore, in the present embodiment, as an application example, a method for reducing the power consumption of functional units using local slack is taken up and the effect of the proposed mechanism is evaluated.

1.ローカル・スラックを発見的に予測する手法.
従来手法に対し、本実施形態では、ローカル・スラックを発見的に予測する手法を提案する。この手法では、命令実行時の振る舞いを観測しながら、予測するローカル・スラック(以下、予測スラックという。)を増減させ、予測スラックを実際のローカル・スラック(以下、ターゲット・スラックという。)に近づけて行く。試行錯誤的に予測を行うため、従来手法のようにローカル・スラックを直接計算する必要はない。
1. A method for heuristic prediction of local slack.
In contrast to the conventional method, this embodiment proposes a method for heuristically predicting local slack. In this method, while observing the behavior during instruction execution, the predicted local slack (hereinafter referred to as predicted slack) is increased or decreased to bring the predicted slack closer to actual local slack (hereinafter referred to as target slack). Go. Since prediction is performed by trial and error, it is not necessary to directly calculate local slack as in the conventional method.

以下では、説明を簡単にするために、まず、提案手法の基本的な動作を説明する。その後、ターゲット・スラックの動的な変化に対応するための修正を加える。最後に提案手法の構成について説明する。   In the following, in order to simplify the description, first, the basic operation of the proposed method will be described. Then, modifications are made to accommodate the dynamic change in target slack. Finally, the configuration of the proposed method will be described.

1.1.基本動作.
まず、本実施形態に係る提案手法の基本動作を示す。命令フェッチ時にローカル・スラックを予測し、予測スラックに基づいて命令の実行レイテンシを増加させる。どの命令に対しても、それを初めてフェッチするときには、ローカル・スラックは0であると予測する。つまり、予測スラックの初期値は0とする。その後は、命令実行時の振る舞いを観測しながら、予測スラックを、ターゲット・スラックに到達するまで、徐々に増加させて行く。
1.1. basic action.
First, the basic operation of the proposed method according to this embodiment is shown. Local slack is predicted at the time of instruction fetch, and instruction execution latency is increased based on the predicted slack. For any instruction, the first time it is fetched, local slack is expected to be zero. That is, the initial value of predicted slack is 0. After that, while observing the behavior at the time of instruction execution, the predicted slack is gradually increased until the target slack is reached.

すなわち、本予測方法では、具体的には、まず、命令のフェッチに際してその命令の予測スラックを取得し、その取得した予測スラックの分だけその命令の実行レイテンシを増加させる。例えば実行レイテンシが本来「1サイクル」の命令について、その予測スラックが「2」であったときには、その命令の実行レイテンシは「3サイクル」に増加させる。なお、何れの命令についても、プログラムの開始後にその命令が始めてフェッチされたときには、そのローカル・スラックは「0」と予測する。すなわち、すべての命令についてその予測スラックの初期値は「0」に設定されている。その後、実行時における命令の振る舞いを観測し、予測スラックがターゲット・スラックに到達したと推定されるまで、予測スラックを徐々に増加させて行く。   That is, in this prediction method, specifically, at the time of fetching an instruction, first, predicted slack of the instruction is acquired, and the execution latency of the instruction is increased by the acquired predicted slack. For example, for an instruction whose execution latency is originally “1 cycle”, when the predicted slack is “2”, the execution latency of the instruction is increased to “3 cycles”. For any instruction, when the instruction is fetched for the first time after the start of the program, the local slack is predicted to be “0”. That is, the initial value of the predicted slack is set to “0” for all instructions. Thereafter, the behavior of the instruction at the time of execution is observed, and the predicted slack is gradually increased until it is estimated that the predicted slack has reached the target slack.

次に、基本動作において、命令実行時の振る舞いを基に、予測スラックがターゲット・スラックに到達したかどうかを判定する方法を説明する。ここで、ある命令の予測スラックを増加させていき、その値がターゲット・スラックに到達したという状況を考える。このとき、当該命令は、実行レイテンシを1サイクルでも増加させると、それに依存する命令の実行を遅れさせてしまう状態にある。また、命令間の依存関係として、制御依存、キャッシュ・ラインを介した依存、レジスタ・データ依存、メモリ・データ依存をあげることができる。従って、予測スラックがターゲット・スラックに到達した命令は、以下のいずれかの振る舞いを見せると考えられる。   Next, a method of determining whether or not predicted slack has reached target slack based on the behavior at the time of instruction execution in the basic operation will be described. Here, let us consider a situation where the predicted slack of an instruction is increased and the value reaches the target slack. At this time, if the execution latency is increased even by one cycle, the instruction is in a state in which the execution of the instruction depending on the instruction is delayed. Further, as the dependency relationship between instructions, control dependency, dependency via a cache line, register data dependency, and memory data dependency can be given. Therefore, an instruction in which predicted slack reaches target slack is considered to exhibit one of the following behaviors.

(a)分岐予測ミス、
(b)キャッシュ・ミス、
(c)後続命令に対するオペランド・フォワーディング、及び
(d)後続命令に対するストアデータフォワーディング。
(A) branch misprediction,
(B) cash miss,
(C) Operand forwarding for subsequent instructions, and (d) Store data forwarding for subsequent instructions.

まず、上記(a)の分岐予測ミスについて説明する。パイプライン処理を行うプロセッサは、多数の命令を流れ作業的に同時に実行するため、分岐命令で以後に実行される命令列が変更されると、既に処理を開始した後続命令をすべて破棄しなくてはならず、処理効率が低下する。これを防ぐため、以前に当該分岐命令が実行されたときの分岐の発生状況から命令が分岐するか否かを予測し、その予測結果に従って分岐予測先の命令を投機実行するようにしている。ここで予測スラックがターゲット・スラックを上回った状況を考える。こうした状況では、先行命令の実行レイテンシが過剰に増加されて、それに依存する後続命令の実行に遅延が生じる。このような場合、適正な分岐予測ができなくなり、分岐の予測結果を誤り易くなる。そのため、分岐予測ミスが発生したときには、予測スラックがターゲット・スラックを上回ってしまっている可能性が高いと考えることができる。   First, the branch prediction error (a) will be described. Since a processor that performs pipeline processing simultaneously executes a large number of instructions in a work flow, if the instruction sequence that is subsequently executed by a branch instruction is changed, all subsequent instructions that have already started processing must be discarded. In other words, the processing efficiency decreases. In order to prevent this, it is predicted whether or not the instruction will branch based on the state of occurrence of the branch when the branch instruction was previously executed, and the branch prediction destination instruction is speculatively executed according to the prediction result. Consider the situation where predicted slack exceeds target slack. In such a situation, the execution latency of the preceding instruction is excessively increased, causing a delay in the execution of the succeeding instruction that depends on it. In such a case, proper branch prediction cannot be performed, and branch prediction results are likely to be erroneous. For this reason, when a branch prediction error occurs, it can be considered that there is a high possibility that the predicted slack exceeds the target slack.

次に、上記(b)のキャッシュ・ミスについて説明する。多くのプロセッサでは、使用頻度の高いデータ等を、高速なキャッシュ・メモリに蓄積しておくことで、低速な記憶装置へのアクセスを低減し、プロセッサの処理を高速化するようにしている。先行命令の予測スラックがターゲット・スラックを上回った状態となると、こうしたキャッシュ動作を適正に行うことができなくなり、キャッシュ・ミスが発生し易くなる。従って、キャッシュ・ミスが発生したときにも、予測スラックがターゲット・スラックを上回ってしまっている可能性が高いと考えることができる。   Next, the cache miss (b) will be described. In many processors, frequently used data and the like are stored in a high-speed cache memory, thereby reducing access to a low-speed storage device and increasing the processing speed of the processor. If the predicted slack of the preceding instruction exceeds the target slack, such a cache operation cannot be performed properly, and a cache miss is likely to occur. Therefore, it can be considered that there is a high possibility that the predicted slack exceeds the target slack even when a cache miss occurs.

続いて、上記(c)及び(d)の後続命令に対するオペランド・フォワーディング及びストアデータフォワーディングについて説明する。先行命令とその先行命令の定義したデータを参照する後続命令との実行間隔が短いと、データの書き込み完了前に後続命令がそのデータを読み込もうとしてデータ・ハザードが発生してしまうことがある。そのため、多段パイプラインを有するプロセッサの多くでは、バイパス回路を設けて、書き込み前のデータを後続命令に直接与えるオペランド・フォワーディングやストアデータフォワーディングを行うことで、そうしたデータ・ハザードを回避するようにしている。こうしたフォワーディングは、先行命令の定義したデータを参照する後続命令が、先行命令の直後に連続して実行されるときに発生する。従って、オペランド・フォワーディングやストアデータフォワーディングが発生したときには、予測スラックがターゲット・スラックと一致していると判断することができる。   Next, operand forwarding and store data forwarding for the subsequent instructions (c) and (d) will be described. If the execution interval between the preceding instruction and the subsequent instruction that refers to the data defined by the preceding instruction is short, a data hazard may occur when the subsequent instruction tries to read the data before the data writing is completed. Therefore, in many processors with multistage pipelines, a bypass circuit is provided to avoid such data hazards by performing operand forwarding or store data forwarding that directly gives the data before writing to subsequent instructions. Yes. Such forwarding occurs when a subsequent instruction that refers to data defined by the preceding instruction is executed immediately after the preceding instruction. Therefore, when operand forwarding or store data forwarding occurs, it can be determined that the predicted slack matches the target slack.

本予測方法では、命令実行時の振る舞いが、上記(a)〜(d)のいずれかに該当するとき、予測スラックがターゲット・スラックに到達したと推定し、そうでないときには未到達であると判定するようにしている。こうした予測スラックがターゲット・スラックに到達したとの推定の成立条件を上記(a)〜(d)の論理和条件とし、「ターゲット・スラック到達条件」と呼ぶこととする。なお、上記(a)〜(d)のような命令実行時の振る舞いを検出する機構は、分岐予測、キャッシュ、フォワーディングを行うプロセッサであれば、通常、元より備えられている。そのため、ローカル・スラック予測のためにそうした検出機構を新規追加せずとも、上記到達条件の成立の有無を確認することが可能である。   In this prediction method, when the behavior at the time of instruction execution corresponds to one of the above (a) to (d), it is estimated that the predicted slack has reached the target slack, and otherwise it is determined that it has not been reached. Like to do. The condition for establishing that such predicted slack has reached target slack is defined as the logical sum condition (a) to (d) above, and is referred to as “target slack arrival condition”. Note that a mechanism for detecting the behavior at the time of instruction execution as described in the above (a) to (d) is usually provided from the beginning as long as it is a processor that performs branch prediction, cache, and forwarding. Therefore, it is possible to confirm whether or not the arrival condition is satisfied without newly adding such a detection mechanism for local slack prediction.

図3(a)は本発明の第1の実施形態に係るローカル・スラックを発見的に予測する手法を用いたプロセッサ装置の基本動作であって、第1回目の実行動作を示すタイミングチャートであり、図3(b)は上記プロセッサ装置の基本動作であって、第2回目の実行動作を示すタイミングチャートであり、図3(c)は上記プロセッサ装置の基本動作であって、第3回目の実行動作を示すタイミングチャートである。すなわち、上記提案手法の基本動作に基づいて、図1(a)のプログラムを繰り返し実行する過程を図3(a)、図3(b)及び図3(c)に示す。図3(a)、図3(b)及び図3(c)において、各ノードのハッチング部分は、予測スラックに応じて増加させた実行レイテンシを示す。図3(a)、図3(b)及び図3(c)では、説明を簡単にするため、命令i0のローカル・スラックのみを予測の対象とし、予測スラックは1回につき1ずつ増加させるとする。   FIG. 3 (a) is a basic operation of the processor device using the method for heuristically predicting local slack according to the first embodiment of the present invention, and is a timing chart showing the first execution operation. FIG. 3B is a timing chart showing the basic operation of the processor device and the second execution operation, and FIG. 3C is the basic operation of the processor device, and shows the third operation. It is a timing chart which shows execution operation. That is, the process of repeatedly executing the program of FIG. 1A based on the basic operation of the proposed method is shown in FIGS. 3A, 3B, and 3C. In FIG. 3A, FIG. 3B, and FIG. 3C, the hatched portion of each node indicates the execution latency increased according to the predicted slack. 3 (a), 3 (b), and 3 (c), for the sake of simplicity, only local slack of the instruction i0 is targeted for prediction, and predicted slack is increased by 1 at a time. To do.

図3(a)の1回目の実行では、命令i0の予測スラックは0である。この場合、命令i0の実行時の振る舞いは、ターゲット・スラック到達条件のいずれにも該当しないので、予測スラックはターゲット・スラックに未だ到達していない。そこで、命令i0の予測スラックを1だけ増加させる。その結果、図3(b)の2回目の実行では、命令i0の予測スラックは1となる。この場合も、予測スラックはターゲット・スラックに到達していない。そこで、命令i0の予測スラックをさらに1だけ増加させる。これにより、図3(c)の3回目の実行では、命令i0の予測スラックは2となる。その結果命令i0は後続命令に対しオペランド・フォワーディングを行う。これにより、ターゲット・スラック到達条件を満たす。予測スラックはターゲット・スラックに到達したので、これ以上増加させない。以上のようにして命令i0のローカル・スラックを予測する。   In the first execution of FIG. 3A, the predicted slack of the instruction i0 is zero. In this case, since the behavior at the time of executing the instruction i0 does not correspond to any of the target slack arrival conditions, the predicted slack has not yet reached the target slack. Therefore, the predicted slack of the instruction i0 is increased by 1. As a result, the predicted slack of the instruction i0 is 1 in the second execution of FIG. Again, the predicted slack has not reached the target slack. Therefore, the predicted slack of the instruction i0 is further increased by 1. Thereby, in the third execution of FIG. 3C, the predicted slack of the instruction i0 is 2. As a result, the instruction i0 performs operand forwarding on the subsequent instruction. This satisfies the target slack arrival condition. The predicted slack has reached the target slack and will not be increased any further. The local slack of the instruction i0 is predicted as described above.

1.2.ターゲット・スラックの動的な変化への対応.
基本動作では、ターゲット・スラックの動的な変化に十分に対応することができない。ターゲット・スラックが動的に変化しても、それが予測スラックよりも大きいのであれば、予測スラックは新たなターゲット・スラックを目指して増加するだけなので、問題はない。しかし、ターゲット・スラックが予測スラックより小さくなると、予測スラックは変化することなく、そのままの値を維持するので、ターゲット・スラックを上回った分(スラック予測ミスペナルティ)だけ、後続命令の実行を遅れさせてしまう。これが、性能に悪影響を及ぼす可能性がある。
1.2. Response to dynamic changes in target slack.
The basic operation cannot sufficiently cope with the dynamic change of the target slack. Even if the target slack changes dynamically, if it is larger than the predicted slack, there is no problem because the predicted slack only increases toward the new target slack. However, if the target slack becomes smaller than the predicted slack, the predicted slack remains unchanged and maintains the same value. Therefore, the execution of the subsequent instruction is delayed by the amount exceeding the target slack (slack predicted mispenalty). End up. This can adversely affect performance.

この問題に対し、まず、ターゲット・スラックが予測スラックよりも小さくなったら、予測スラックを減らすという解決手法を提案する。しかし、ターゲット・スラックが急速に増減を繰り返す場合、この手法を導入しても、予測スラックをターゲット・スラックに追従させることはできない。その結果、ターゲット・スラックが予測スラックよりも小さくなるという状況が頻繁に発生する。そこでさらに、信頼性を導入して、予測スラックの増加は慎重に行い、予測スラックの減少は迅速に行うという解決手法を提案する。   To solve this problem, a solution is proposed in which the predicted slack is reduced when the target slack becomes smaller than the predicted slack. However, when the target slack repeatedly increases and decreases, even if this method is introduced, the predicted slack cannot follow the target slack. As a result, a situation occurs frequently in which the target slack is smaller than the predicted slack. Therefore, we propose a solution method that introduces reliability, increases predicted slack carefully, and reduces predicted slack quickly.

以下では、上記2つの解決方法について詳しく説明する。   Hereinafter, the above two solutions will be described in detail.

1.2.1.予測スラックの減少.
予測スラックの減少を実現する方法として、スラック予測を行わなかった場合の後続命令の実行時刻(後続命令の本来実行されるべき時刻)を利用するという方法が考えられる。後続命令の本来実行されるべき時刻が分かれば、スラック予測のミスにより後続命令の実行時刻が遅れたかどうかを調べることができる。あるいは、ターゲット・スラックを直接計算し、予測スラックと比較することもできる。しかし、いずれにしても、命令の実行時刻を決定しうる様々な要素(資源制約、データ依存、制御依存など)を考慮して、後続命令の本来実行されるべき時刻を計算しなければならないので、簡単に実現することはできない。
1.2.1. Reduced predicted slack.
As a method for realizing the reduction of the predicted slack, a method of using the execution time of the subsequent instruction when the slack prediction is not performed (the time when the subsequent instruction should be executed) can be considered. If the time at which the subsequent instruction should be executed is known, it can be checked whether the execution time of the subsequent instruction is delayed due to a slack prediction error. Alternatively, target slack can be calculated directly and compared to predicted slack. However, in any case, it is necessary to calculate the time when the subsequent instruction should be executed in consideration of various factors (resource constraints, data dependency, control dependency, etc.) that can determine the execution time of the instruction. Can't be realized easily.

そこで本発明者は、上述した「ターゲット・スラック到着条件」に着目する。この条件を用いれば、予測スラックがターゲット・スラックを下回っていることと、ターゲット・スラックに到着したことが容易に分かる。この特徴を利用し、予測スラックがターゲット・スラックに到着したら、その後は逆に、ターゲット・スラックを下回るまで予測スラックを減少させることとする。こうすることにより、非常に簡単な修正で、ターゲット・スラックの動的な減少に対応できるようになる。ターゲット・スラックを下回る分の予測スラックが無駄になるが、十分に許容できると考える。   Therefore, the present inventor pays attention to the above-mentioned “target slack arrival condition”. Using this condition, it is easy to see that the predicted slack is below the target slack and that it has arrived at the target slack. Using this feature, when predicted slack arrives at the target slack, the predicted slack is decreased until it falls below the target slack. This makes it possible to cope with a dynamic reduction in target slack with very simple modifications. The predicted slack below the target slack is wasted, but is considered well tolerated.

図4(a)及び図4(b)を用いて、上記基本動作の問題点と、その解決手法について説明する。図4(a)は図3の基本動作の問題点を説明するためのサイクル対スラック特性を示すグラフであり、図4(b)はその問題点の解決手法を説明するためのサイクル対スラック特性を示すグラフである。すなわち、図4(a)及び(b)は、ターゲット・スラックが動的に減少した場合に、予測スラックがどのように変化するのかを示す例である。図4(a)及び(b)において、縦軸はスラックを示し、横軸は時刻を示す。折れ線グラフは、点線がターゲット・スラックの場合、実線が予測スラックの場合である。ハッチング部分は、予測スラックがターゲット・スラックを超えてしまう箇所を示す。図4(a)は上記基本動作の場合、図4(b)は本項で提案する解決手法を導入した場合である。   With reference to FIGS. 4A and 4B, the problem of the basic operation and the solution thereof will be described. FIG. 4A is a graph showing the cycle-to-slack characteristics for explaining the problem of the basic operation of FIG. 3, and FIG. 4B is the cycle-to-slack characteristic for explaining a solution to the problem. It is a graph which shows. That is, FIGS. 4A and 4B are examples showing how predicted slack changes when target slack dynamically decreases. 4A and 4B, the vertical axis indicates slack, and the horizontal axis indicates time. In the line graph, the dotted line is the target slack, and the solid line is the predicted slack. The hatched portion indicates a portion where the predicted slack exceeds the target slack. 4A shows the case of the basic operation, and FIG. 4B shows the case where the solution proposed in this section is introduced.

図4(a)において、予測スラックはターゲット・スラックに到達するまで増加して行く。その後、ターゲット・スラックが減少し、予測スラックより小さくなる。しかし、予測スラックはそのままの値を維持し、後続命令の実行を継続的に遅れさせてしまう。   In FIG. 4A, the predicted slack increases until reaching the target slack. Thereafter, the target slack decreases and becomes smaller than the predicted slack. However, the predicted slack maintains the value as it is, and continuously delays the execution of subsequent instructions.

一方、図4(b)に示すように、修正後の動作では、まず、予測スラックはターゲット・スラックに到達するまで増加して行く。到着後、予測スラックは減少するが、ターゲット・スラックを下回るので、即座に増加に転じ、再びターゲット・スラックに到達する。この変化を、しばらくの間繰り返す。その後、ターゲット・スラックが減少すると、予測スラックは、ターゲット・スラックを下回るまで減少していき、再び増減を繰り返す。こうして、ターゲット・スラックの減少にあわせて予測スラックを減らすことができるようになる。   On the other hand, as shown in FIG. 4B, in the operation after correction, first, the predicted slack increases until reaching the target slack. After arrival, the predicted slack decreases but falls below the target slack, so it immediately starts increasing and reaches the target slack again. This change is repeated for a while. Thereafter, when the target slack decreases, the predicted slack decreases until it falls below the target slack, and increases and decreases again. Thus, the predicted slack can be reduced in accordance with the reduction of the target slack.

1.2.2.信頼性の導入.
ターゲット・スラックの急速な変化に対応するため、基本動作をさらに修正する。まず、予測スラック毎に信頼性カウンタを導入する。カウンタ値は、命令がターゲット・スラック到達条件を満たしていれば減少させ、そうでなければ増加させる。そして、カウンタ値が0になったら予測スラックを減少させ、カウンタ値があるしきい値以上になったら予測スラックを増加させる。
1.2.2. Introduction of reliability.
Further modifications to basic behavior to accommodate rapid changes in target slack. First, a reliability counter is introduced for each predicted slack. The counter value is decreased if the instruction satisfies the target slack arrival condition, and is increased otherwise. Then, the predicted slack is decreased when the counter value becomes 0, and the predicted slack is increased when the counter value exceeds a certain threshold value.

予測スラックの増加を慎重に行うため、予測スラックを増加させる際に、カウンタ値を0にリセットすることとする。また、予測スラックの減少を迅速に行うため、命令が「ターゲット・スラック到達条件」を満たしていれば、カウンタ値を0にリセットすることとする。   In order to carefully increase the predicted slack, the counter value is reset to 0 when increasing the predicted slack. In order to reduce predicted slack quickly, if the instruction satisfies the “target slack arrival condition”, the counter value is reset to zero.

図5(a)は図4の解決手法の問題点を説明するためのサイクル対スラック特性を示すグラフであり、図5(b)はその問題点の解決手法を説明するためのサイクル対スラック特性を示すグラフである。図5(a)及び(b)を用いて、前項で示した解決手法の問題点と、それを解決するための手法について説明する。図5(a)及び(b)は、ターゲット・スラックが急速に増減を繰り返した場合に、予測スラックがどのように変化するのかを示す例であり、図5(a)は、基本動作に予測スラックの減少を導入した場合を示し、図5(b)は、さらに信頼性も導入した場合を示す。   FIG. 5A is a graph showing cycle-to-slack characteristics for explaining the problem of the solution method of FIG. 4, and FIG. 5B is a cycle-to-slack characteristic for explaining the solution method of the problem. It is a graph which shows. With reference to FIGS. 5A and 5B, the problem of the solution method described in the previous section and a method for solving the problem will be described. FIGS. 5A and 5B are examples showing how the predicted slack changes when the target slack rapidly increases and decreases, and FIG. 5A shows the basic operation. FIG. 5 (b) shows the case where the slack reduction is introduced, and FIG. 5 (b) shows the case where the reliability is further introduced.

図5(a)において、予測スラックはターゲット・スラックを目指して変化しようとするが、急速な変化に追従できず、頻繁にターゲット・スラックを超えてしまうことが分かる。一方、図5(b)に示すように、信頼性を導入すると、予測スラックはターゲット・スラックを目指して緩やかに増加していき、ターゲット・スラックに到達する(あるいはそれを超える)と即座に減少するという変化を繰り返す。これにより、予測スラックがターゲット・スラックを超える頻度を下げることができる。   In FIG. 5A, it can be seen that predicted slack tries to change toward the target slack, but cannot follow the rapid change and frequently exceeds the target slack. On the other hand, as shown in Fig. 5 (b), when reliability is introduced, the predicted slack gradually increases toward the target slack and decreases immediately when the target slack is reached (or exceeded). Repeat the change. As a result, the frequency at which the predicted slack exceeds the target slack can be reduced.

1.3.ハードウェア構成.
図6は、本発明の第1の実施形態に係るスラック表20を備えたプロセッサ10の構成を示すブロック図である。図6において、プロセッサ10の右側部分は、本発明者の提案するローカル・スラック予測機構であり、提案機構は、予測スラックを保持するためのスラック表20で構成される。スラック表20は記憶装置で構成され、命令のプログラム・カウンタ値(PC:その命令を記憶する主記憶装置9のメモリ・アドレスをいう。)をインデクスとし、各エントリは対応する命令の予測スラックと、ターゲット・スラック到達条件の信頼性を保持する。
1.3. Hardware configuration.
FIG. 6 is a block diagram illustrating a configuration of the processor 10 including the slack table 20 according to the first embodiment of the present invention. In FIG. 6, the right portion of the processor 10 is a local slack prediction mechanism proposed by the present inventor, and the proposed mechanism is composed of a slack table 20 for holding predicted slack. The slack table 20 includes a storage device, and uses an instruction program counter value (PC: a memory address of the main storage device 9 that stores the instruction) as an index, and each entry includes predicted slack of the corresponding instruction. And maintain the reliability of the target slack arrival conditions.

図6において、プロセッサ10は、フェッチ・ユニット11と、デコード・ユニット12と、命令ウィンドウ(I−win)13と、レジスタ・ファイル(RF)14と、実行ユニット(EU)15と、リオーダ・バッファ(ROB)16とを備えて構成されている。プロセッサ10を構成する各ユニットの機能は次の通りである。フェッチ・ユニット11は、主記憶装置9からの命令の読み込みを行う。デコード・ユニット12は、読み込まれた命令の内容の解析(デコード)し、命令ウィンドウ13及びリオーダ・バッファ16にそれぞれ格納する。命令ウィンドウ13は、実行前の命令を一時的に格納するバッファ(メモリ)であり、プロセッサ10の制御回路は、命令ウィンドウ13のバッファから命令を取り出して、実行ユニット15に順次投入する。一方、リオーダ・バッファ16は、命令を格納するFIFO(First-In First-Out)式のスタックメモリであり、格納された命令の中で格納の順が最も早い命令の実行が終了すると、その命令が取り出される(コミットされる)。ここで、コミットとは、実行結果によってプロセッサ状態を更新することをいう。また、FIFO17は、スラック表20からフェッチ・ユニット11により取得された後、デコード・ユニット12から出力される予測スラッグと信頼性を各タイミングでセットとして入力し記憶しスラック表20に出力する。なお、レジスタ・ファイル14は、命令の実行に必要なデータや命令の実行結果、実行中、実行予定の命令のアドレス・インデクス等をそれぞれ格納する各種レジスタの実体となっている。   In FIG. 6, a processor 10 includes a fetch unit 11, a decode unit 12, an instruction window (I-win) 13, a register file (RF) 14, an execution unit (EU) 15, and a reorder buffer. (ROB) 16. The function of each unit constituting the processor 10 is as follows. The fetch unit 11 reads an instruction from the main storage device 9. The decode unit 12 analyzes (decodes) the content of the read instruction and stores it in the instruction window 13 and the reorder buffer 16, respectively. The instruction window 13 is a buffer (memory) that temporarily stores instructions before execution. The control circuit of the processor 10 takes out instructions from the buffer of the instruction window 13 and sequentially inputs them to the execution unit 15. On the other hand, the reorder buffer 16 is a first-in first-out (FIFO) type stack memory for storing instructions. When the execution of the instruction having the earliest storage order is completed, Is retrieved (committed). Here, commit refers to updating the processor state according to the execution result. Further, the FIFO 17 is obtained by the fetch unit 11 from the slack table 20, and then the predicted slug and reliability output from the decode unit 12 are input as a set at each timing, stored, and output to the slack table 20. Note that the register file 14 is an entity of various registers for storing data necessary for execution of instructions, execution results of instructions, addresses and indexes of instructions that are being executed and scheduled to be executed, and the like.

命令は、フェッチ時にプログラム・カウンタ値(PC)をインデクスとしてスラック表を参照し、対応するエントリから予測スラックを得る。そして、コミットするときに、命令実行時の振る舞いを基にしてスラック表を更新する。スラック表の更新に関係するパラメータとその内容を以下に示す。ただし、予測スラックの最小値Vmin=0、信頼性の最小値Cmin=0である。   The instruction refers to the slack table with the program counter value (PC) as an index when fetching, and obtains predicted slack from the corresponding entry. Then, when committing, the slack table is updated based on the behavior when the instruction is executed. The parameters and contents related to the slack table update are shown below. However, the predicted slack minimum value Vmin = 0 and the reliability minimum value Cmin = 0.

(1)Vmax:予測スラックの最大値、
(2)Vmin:予測スラックの最小値(=0)、
(3)Vinc:予測スラックの1回あたりの増加量、
(4)Vdec:予測スラックの1回あたりの減少量、
(5)Cmax:信頼性の最大値、
(6)Cmin:信頼性の最小値(=0)、
(7)Cth:信頼性のしきい値、
(8)Cinc:信頼性の1回あたりの増加量、及び
(9)Cdec:信頼性の1回あたりの減少量。
(1) Vmax: Maximum value of predicted slack,
(2) Vmin: Minimum value of predicted slack (= 0),
(3) Vinc: Increase amount of predicted slack per time,
(4) Vdec: decrease amount of predicted slack per time,
(5) Cmax: maximum reliability,
(6) Cmin: minimum value of reliability (= 0),
(7) Cth: threshold of reliability,
(8) Cinc: the amount of increase in reliability per time, and (9) Cdec: the amount of decrease in reliability per time.

スラック表20の更新の流れを以下に示す。上述のターゲット・スラック到達条件が成立していれば信頼性を0にリセットし、そうでなければ、増加量Cincだけ増加させる。信頼性がしきい値Cth以上になったら、予測スラックを増加量Vincだけ増加させ、信頼性を0にリセットする。一方、信頼性が0になったら、予測スラックを減少量Vdecだけ減少させる。なお、1.2.節において、ターゲット・スラック到達条件が成立すれば信頼性を0にリセットするとしたので、Cdec=Cthである。さらに、予測スラックを増加させる際に、信頼性を0にリセットするとしたので、Cmax=Cthである。   The flow of updating the slack table 20 is shown below. If the above-described target slack arrival condition is satisfied, the reliability is reset to 0. Otherwise, the reliability is increased by the increase amount Cinc. When the reliability exceeds the threshold Cth, the predicted slack is increased by the increase amount Vinc, and the reliability is reset to zero. On the other hand, when the reliability becomes 0, the predicted slack is decreased by the decrease amount Vdec. In addition, 1.2. In the clause, since the reliability is reset to 0 when the target slack arrival condition is satisfied, Cdec = Cth. Further, since the reliability is reset to 0 when the predicted slack is increased, Cmax = Cth.

5.スラック予測機構の評価.
本章では、まず評価モデル、評価環境について述べる。次に、評価結果について述べる。
5). Evaluation of slack prediction mechanism.
In this chapter, we first describe the evaluation model and the evaluation environment. Next, evaluation results will be described.

5.1.評価モデル.
以下のモデルについて評価した。
5.1. Evaluation model.
The following models were evaluated.

(1)NO−DELAYモデル:予測スラックに基づいた実行レイテンシの増加を行わないモデルである。
(2)Bモデル:提案手法の基本動作のみ行うモデルである。
(3)BCnモデル:提案手法の基本動作に、信頼性を導入したモデルである。モデルに付加した数値nは、信頼性のしきい値Cthを表す。
(4)BDモデル:提案手法の基本動作に、予測スラックの減少を導入したモデルである。
(5)BDCnモデル:提案手法の基本動作に、予測スラックの減少と信頼性を導入したモデルである。モデルに付加した数値nは、信頼性のしきい値Cthを表す。
(1) NO-DELAY model: A model that does not increase execution latency based on predicted slack.
(2) B model: A model that performs only the basic operation of the proposed method.
(3) BCn model: This model introduces reliability into the basic operation of the proposed method. A numerical value n added to the model represents a reliability threshold value Cth.
(4) BD model: This model introduces a reduction in predicted slack into the basic operation of the proposed method.
(5) BDCn model: This model introduces the prediction slack reduction and reliability into the basic operation of the proposed method. A numerical value n added to the model represents a reliability threshold value Cth.

Bモデル、BCnモデル、BDモデル、BDCnモデルは、提案方式を基にしたモデルであるため、これらを提案モデルと呼ぶこととする。   Since the B model, the BCn model, the BD model, and the BDCn model are models based on the proposed method, they are referred to as a proposed model.

2.2.評価環境.
シミュレータには、公知のSimple Scalar Tool Set(例えば、非特許文献1参照。)のスーパースカラ・プロセッサ用シミュレータを用い、提案方式を組み込んで評価した。命令セットには公知のMIPSR10000を拡張した公知のSimpleScalar/PISAを用いた。ベンチマーク・プログラムは、公知のSPECint2000のbzip2、gcc、gzip、mcf、parser、perlbmk、vortex、vprの8本を使用した。gccでは1G命令、その他では2G命令をスキップした後、100M命令を実行した。測定条件を表1に示す。従来方式との比較のため、スラック表のエントリ数は、従来方式(例えば、非特許文献10参照。)と同一とした。
2.2. Evaluation environment.
As a simulator, a simulator for a super scalar processor of a well-known Simple Scalar Tool Set (see, for example, Non-Patent Document 1) was used, and the proposed method was incorporated and evaluated. For the instruction set, a known SimpleScalar / PISA that is an extension of the known MIPSR10000 was used. As the benchmark program, eight known SPECint2000 bzip2, gcc, gzip, mcf, parser, perlbmk, vortex, and vpr were used. After skipping the 1G instruction in gcc and the 2G instruction in others, a 100M instruction was executed. Table 1 shows the measurement conditions. For comparison with the conventional method, the number of entries in the slack table is the same as that in the conventional method (for example, see Non-Patent Document 10).

Figure 2007293816
Figure 2007293816

スラック表の更新に関するパラメータおいて、変化させ得るものは、最大値Vmax、増加量Vinc、減少量Vdec、しきい値Cth、増加量Cincである。これらの組合せは膨大な数になるので、幾つかのパラメータをある値に固定する。まず、増加量Cincとしきい値Cthの比はスラックを増加させる頻度を表すので、増加量Cinc=1に固定し、しきい値Cthだけを変化させることとする。次に、予測スラックをできるだけターゲット・スラックに近づけるために、増加量Vinc=1に固定する。最後に、予測スラックをできるだけ早く減少させるために、減少量Vdec=Vmaxに固定する。以上より、本章では、最大値Vmaxとしきい値Cthだけを変化させて、提案方式の評価を行うこととする。ただし、比較を容易にするため、しきい値Cthは、5、15の2通りに、最大値Vmaxは、1、5、15の3通りに制限する。   Among the parameters relating to the update of the slack table, the maximum value Vmax, the increase amount Vinc, the decrease amount Vdec, the threshold value Cth, and the increase amount Cinc can be changed. Since these combinations are enormous numbers, some parameters are fixed to certain values. First, since the ratio between the increase amount Cinc and the threshold value Cth represents the frequency of increasing slack, the increase amount Cinc = 1 is fixed and only the threshold value Cth is changed. Next, in order to make the predicted slack as close as possible to the target slack, the increase amount Vinc = 1 is fixed. Finally, in order to reduce the predicted slack as soon as possible, the reduction amount is fixed at Vdec = Vmax. As described above, in this chapter, only the maximum value Vmax and the threshold value Cth are changed, and the proposed method is evaluated. However, in order to facilitate the comparison, the threshold value Cth is limited to two ways of 5 and 15, and the maximum value Vmax is restricted to three ways of 1, 5, and 15.

2.3.スラック予測精度.
ここでは、まず、各動的実行命令に対し、実際のスラック(以下、実スラックという。)を測定する。具体的には、NO−DELAYモデルにおいて、ある命令がレジスタ・データ、あるいは、メモリ・データを定義した時刻と、そのデータを最初に参照した時刻の差から、当該命令のローカル・スラックを求める。そのため、データを定義しない命令(分岐命令)のスラックは無限大となる。
2.3. Slack prediction accuracy.
Here, first, actual slack (hereinafter referred to as actual slack) is measured for each dynamic execution instruction. Specifically, in the NO-DELAY model, the local slack of the instruction is obtained from the difference between the time when an instruction defines register data or memory data and the time when the data is first referred to. Therefore, the slack of an instruction (branch instruction) that does not define data is infinite.

図7は、図6の提案機構の実施例のシミュレーション結果であって、各プログラムにおける実スラックに対する実行命令数に占める割合を示すグラフである。すなわち、図7に実スラックの累積分布を示す。図7の縦軸は、全実行命令数に占める割合を示し、その横軸は実スラックを示す。折れ線グラフは、実線がベンチマーク平均を示し、点線が各ベンチマークを示す。実スラックが32サイクルの点において、上から順にvpr、bzip、gzip、parser、平均、perlbmk、gcc、vortex、mcfの場合である。   FIG. 7 is a graph showing the simulation result of the embodiment of the proposed mechanism of FIG. 6 and the ratio of each program to the number of executed instructions with respect to actual slack. That is, FIG. 7 shows the cumulative distribution of actual slack. The vertical axis in FIG. 7 indicates the ratio of the total number of executed instructions, and the horizontal axis indicates actual slack. In the line graph, the solid line indicates the benchmark average, and the dotted line indicates each benchmark. This is the case of vpr, bzip, gzip, parser, average, perlbmk, gcc, vortex, mcf in order from the top at the point where the actual slack is 32 cycles.

図7に示すように、実スラック0の命令は平均52.7%存在する。実スラックが増えるにつれて、実行命令数に占める割合は徐々に飽和して行く。また、実スラックが、30サイクル以上存在する命令は平均28.9%存在することが分かる。しかし、通常のプロセッサで、命令の実行レイテンシを数十サイクル以上増加させると、それらの命令がプロセッサ内のバッファ(リオーダ・バッファ(ROB)16、命令ウィンドウ(I−win)13等)を占有するため、性能が大幅に低下する(例えば、非特許文献10参照。)。こうした大きなスラックをどのように利用するのかは、今のところ十分には検討されていない。   As shown in FIG. 7, there is an average of 52.7% of actual slack 0 instructions. As the actual slack increases, the ratio to the number of executed instructions gradually saturates. In addition, it can be seen that there are 28.9% of instructions that have actual slack of 30 cycles or more. However, when the instruction execution latency is increased by several tens of cycles or more in a normal processor, these instructions occupy buffers (reorder buffer (ROB) 16, instruction window (I-win) 13, etc.) in the processor. Therefore, the performance is greatly reduced (see, for example, Non-Patent Document 10). How to use such large slack has not been studied enough.

図8、図9及び図10はそれぞれ、図6の提案機構の実施例のシミュレーション結果であって、予測スラックの最大値Vmax=1,5,15における各モデルに対する実行命令数に占める割合(スラック予測精度)を示すグラフである。すなわち、図8乃至図10において、各提案モデルのスラック予測精度を測定した結果をベンチマーク平均で示す。図8乃至図10の縦軸は全実行命令数に占める割合を示し、その横軸はモデルを示す。棒グラフは、6つの部分からなり、上の4つが、スラックをn(nは1以上)と予測した場合、下の2つが、スラックを0と予測した場合である。スラックをnと予測した場合、上から順に、予測スラックnが実スラックm(mは1以上)を超えた場合(n>m)、実スラック0を超えた場合(n>0)、実スラックを下回った場合(n<m)、実スラックと一致した場合(n=m)である。一方、スラックを0と予測した場合、上から順に、実スラックを下回った場合(0<m)、実スラックと一致した場合(0=m)である。ただし、予測スラックの最大値Vmax=1の場合、予測スラックnが実スラックmを上回る場合はないので、棒グラフは5つの部分からなる。これ以降、予測スラックと実スラックが一致することを、予測がヒットすると呼ぶ。   8, 9, and 10 are simulation results of the embodiment of the proposed mechanism of FIG. 6, and the ratio of the predicted slack maximum value Vmax = 1, 5, 15 to the number of executed instructions for each model (slack It is a graph which shows prediction accuracy. That is, in FIG. 8 thru | or FIG. 10, the result of having measured the slack prediction precision of each proposal model is shown by a benchmark average. The vertical axis in FIGS. 8 to 10 represents the ratio of the total number of executed instructions, and the horizontal axis represents the model. The bar graph is composed of six parts. The upper four predict the slack as n (n is 1 or more) and the lower two predict the slack as 0. When slack is predicted as n, in order from the top, when predicted slack n exceeds actual slack m (m is 1 or more) (n> m), exceeds actual slack 0 (n> 0), actual slack Is less than (n <m), and is coincident with actual slack (n = m). On the other hand, when slack is predicted to be 0, in order from the top, it is below actual slack (0 <m), and when it is coincident with real slack (0 = m). However, when the maximum value of predicted slack Vmax = 1, predicted slack n does not exceed actual slack m, so the bar graph is composed of five parts. Hereinafter, when the predicted slack and the actual slack coincide with each other, the prediction hits.

図8乃至図10より、予測がヒットする割合はBモデルが最も低いことが分かる。これに対し、予測スラックの減少を導入したモデル(BDモデル)と、信頼性を導入したモデル(BCnモデル)は、どちらもヒット率向上に効果があることが分かる。また、両者をともに導入したモデル(BDCnモデル)は、さらに高い効果が得られる。信頼性を導入したモデルの場合、信頼性のしきい値(モデルに付加した数字)が高い程、ヒット率は高くなる。なお、予測がヒットするのは、予測スラックの最大値Vmax=1のBモデルを除くと、実スラックが0の場合がほとんどである。この場合、スラックは利用できない。   From FIG. 8 to FIG. 10, it can be seen that the ratio of prediction hits is the lowest in the B model. On the other hand, it can be seen that both the model in which the decrease in predicted slack (BD model) and the model in which reliability is introduced (BCn model) are effective in improving the hit rate. Further, a model in which both are introduced (BDCn model) can obtain a higher effect. In the case of a model in which reliability is introduced, the higher the reliability threshold (number added to the model), the higher the hit rate. Note that the prediction hits in most cases when the actual slack is 0, except for the B model with the predicted slack maximum value Vmax = 1. In this case, slack is not available.

予測スラックが実スラックを上回る場合、実スラックを超えるスラックを利用してしまうことになる。従って、予測ミスによるペナルティが発生する。図8乃至図10より、予測ミスペナルティの発生率は、ヒット率が高いほど下げることができる。一方、予測スラックが実スラックを下回る場合、予測ミスペナルティは発生しない。この場合、予測スラックが1以上あれば、スラックを利用することができる。図8乃至図10より、予測ミスペナルティを発生させることなく、スラックを利用できる割合は、ヒット率が高いほど下がってしまうが、その変化は比較的緩やかである。これらより、提案機構は、予測スラックが1以上となる割合を単純に減少させようとしているのではなく、主に予測ミスペナルティの発生率が減少するように、予測スラックを変化させていることが分かる。   If predicted slack exceeds actual slack, slack exceeding actual slack is used. Therefore, a penalty due to a misprediction occurs. From FIG. 8 to FIG. 10, the occurrence rate of the prediction miss penalty can be lowered as the hit rate is higher. On the other hand, if the predicted slack is lower than the actual slack, the predicted miss penalty does not occur. In this case, if the predicted slack is 1 or more, slack can be used. From FIG. 8 to FIG. 10, the rate at which slack can be used without generating a prediction mispenalty decreases as the hit rate increases, but the change is relatively gradual. Therefore, the proposed mechanism does not simply reduce the rate at which the predicted slack is 1 or more, but rather changes the predicted slack so that the incidence of the predicted mispenalty is reduced. I understand.

次に、予測スラックの最大値Vmaxの影響について考察する。図8乃至図10より、予測スラックの最大値Vmaxを変化させた場合、予測スラックが0である割合、及び、1以上である割合はあまり変化しない。このことから、スラックが1以上ある(又はスラックがない)と予測する命令の数は、予測スラックの最大値Vmaxにあまり依存していないことが分かる。また、予測スラックが1以上である命令の内訳は、予測スラックの最大値Vmaxを1から5に増加させたときには変化するものの、予測スラックの最大値Vmaxを5から15に増加させたときには、あまり変化しないことが分かる。これらより、予測スラックの最大値Vmaxがある程度大きくなると、予測スラックと実スラックの大小関係はあまり変化しなくなることが分かる。   Next, the influence of the maximum value Vmax of predicted slack will be considered. From FIG. 8 to FIG. 10, when the maximum value Vmax of predicted slack is changed, the ratio that the predicted slack is 0 and the ratio that is 1 or more do not change much. From this, it can be seen that the number of instructions predicted to have one or more slack (or no slack) does not depend much on the maximum value Vmax of predicted slack. The breakdown of instructions with predicted slack of 1 or more changes when the maximum predicted slack value Vmax is increased from 1 to 5, but is not so much when the maximum predicted slack value Vmax is increased from 5 to 15. It turns out that it does not change. From these, it can be seen that when the maximum value Vmax of predicted slack increases to some extent, the magnitude relationship between predicted slack and actual slack does not change much.

2.4.実スラックと予測スラックの差.
前節の評価により、実スラックと予測スラックの大小関係を知ることができた。しかし、これだけでは、両者の差が実際にどの程度あるのかが分からない。そこで、実スラックから予測スラックを引いた値の累積分布を測定する。測定では、まず、NO−DELAYモデルにおいて、各動的実行命令の実スラックをすべて採取する。そして、各提案モデルにおいて、採取した実スラックから、これに対応する予測スラックを引いた値を求める。
2.4. Difference between actual slack and predicted slack.
From the evaluation in the previous section, we were able to know the magnitude relationship between actual slack and predicted slack. However, this alone does not reveal how much the difference between the two is actually. Therefore, a cumulative distribution of values obtained by subtracting predicted slack from actual slack is measured. In the measurement, first, all the actual slack of each dynamic execution instruction is collected in the NO-DELAY model. In each proposed model, a value obtained by subtracting predicted slack corresponding to the collected actual slack is obtained.

図11、図12及び図13はそれぞれ、図6の提案機構の実施例のシミュレーション結果であって、予測スラックの最大値Vmax=1,5,15において各モデルにおける実スラックと予測スラックの差に対する実行命令数に占める割合を示すグラフである。図11乃至図13の縦軸は、全実行命令数に占める割合をベンチマーク平均で示し、その横軸は実スラックから予測スラックを引いた値を示す。この値が負の場合、予測スラックが実スラックを上回っていることを示す。0の場合、スラック予測がヒットしていることを示す。正の場合、予測スラックが実スラックを下回っていることを示す。横軸の最小値は、実スラックの最小値0から、予測スラックの最大値Vmaxを引いた値となる。図11において、折れ線グラフは、一番上のグラフがBモデル、ほぼ重なっているグラフがBC15モデルとBDモデル、一番下のグラフがBDC15モデルの場合である。一方、図12及び図13において、折れ線グラフは、上から順に、Bモデル、BC15モデル、BDモデル、BDC15モデルの場合である。各モデルの比較を容易にするため、しきい値Cth=5の場合の結果は省略する。   FIGS. 11, 12 and 13 are simulation results of the embodiment of the proposed mechanism of FIG. 6, and show the difference between actual slack and predicted slack in each model at the maximum predicted slack value Vmax = 1, 5, and 15. It is a graph which shows the ratio which occupies for the number of execution instructions. The vertical axis in FIGS. 11 to 13 indicates the ratio of the total number of executed instructions to the benchmark average, and the horizontal axis indicates a value obtained by subtracting predicted slack from actual slack. If this value is negative, it indicates that the predicted slack exceeds the actual slack. 0 indicates that slack prediction is hit. A positive value indicates that predicted slack is below actual slack. The minimum value on the horizontal axis is a value obtained by subtracting the maximum value Vmax of predicted slack from the minimum value 0 of actual slack. In FIG. 11, the line graph is the case where the top graph is the B model, the nearly overlapping graphs are the BC15 model and the BD model, and the bottom graph is the BDC15 model. On the other hand, in FIG.12 and FIG.13, a line graph is a case of B model, BC15 model, BD model, and BDC15 model in an order from the top. In order to facilitate the comparison of the models, the results when the threshold value Cth = 5 are omitted.

図11乃至図13から明らかなように、予測スラックの減少や信頼性の導入を行うと、予測ミスペナルティの発生率だけでなく、予測ミスペナルティの大きさも抑制できることが分かる。また、各モデルの差は、正の領域よりも、負の領域の方が大きい。これは、予測スラックを大きくする効果の差よりも、予測ミスペナルティを小さくする効果の差の方が大きいことを示している。このことから、予測スラックの減少の導入と、信頼性の導入は、目的通り、スラック予測ミスペナルティを削減できていることが分かる。さらに、どのモデルにおいても、予測スラックの最大値Vmaxが大きくなる程、予測ミスペナルティが大きくなることが分かる。この原因は、実スラックが大幅に低下する命令が数多く存在することにある。例えば、予測スラックの最大値Vmax=15の場合、予測スラックの増減しか行わないBモデルにおいて、差が−15サイクルになる命令は、31.1%となる。これは、実スラックが15サイクル以上減少した命令が、31.1%存在していることを示す。   As is apparent from FIGS. 11 to 13, it can be seen that if the prediction slack is reduced or the reliability is introduced, not only the occurrence rate of the prediction miss penalty but also the size of the prediction miss penalty can be suppressed. Further, the difference between the models is larger in the negative region than in the positive region. This indicates that the difference in the effect of reducing the prediction miss penalty is larger than the difference in the effect of increasing the prediction slack. From this, it can be seen that the introduction of the decrease in predicted slack and the introduction of reliability can reduce the slack prediction miss penalty as intended. Furthermore, in any model, it can be seen that as the maximum value Vmax of predicted slack increases, the predicted miss penalty increases. This is due to the fact that there are a large number of instructions whose actual slack is greatly reduced. For example, when the maximum value of predicted slack Vmax = 15, in the B model in which only predicted slack is increased / decreased, the instruction with a difference of −15 cycles is 31.1%. This indicates that there are 31.1% of instructions whose actual slack has decreased by 15 cycles or more.

2.5.性能に与える影響.
図14は図6の提案機構の実施例のシミュレーション結果であって、各モデルにおける正規化されたIPC(Instructions Per Clock cycle:1クロック当りに処理できる平均命令数)を示すグラフである。図14の縦軸は、NO−DELAYモデルの場合で正規化したIPCを、ベンチマーク平均で示す。図14の横軸はモデルを示す。3本で組になった棒グラフは、左から順に、予測スラックの最大値Vmaxが1、5、15の場合である。図14より、予測スラックの最大値Vmaxが同一であるモデル同士を比較すると、IPCはBモデルが最も低いことが分かる。また、予測スラックの減少や信頼性を単独で導入したモデルよりも、これらを組み合わせたモデル(BDCnモデル)の方が高い性能を達成することが分かる。なお、信頼性を導入したモデルの場合、信頼性のしきい値(モデルに付加した数字)が高い程、性能は高くなる。
2.5. Effect on performance.
FIG. 14 is a graph showing simulation results of the embodiment of the proposed mechanism of FIG. 6 and showing normalized IPC (Instructions Per Clock cycle: average number of instructions that can be processed per clock) in each model. The vertical axis in FIG. 14 shows the IPC normalized in the case of the NO-DELAY model as a benchmark average. The horizontal axis of FIG. 14 shows the model. The three bar graphs are the cases where the maximum value Vmax of predicted slack is 1, 5, and 15 in order from the left. FIG. 14 shows that when models having the same predicted slack maximum value Vmax are compared, the IPC has the lowest B model. In addition, it can be seen that a model (BDCn model) combining them achieves higher performance than a model in which reduction of predicted slack and reliability are independently introduced. In the case of a model incorporating reliability, the higher the reliability threshold (the number added to the model), the higher the performance.

各モデルの性能が低下する原因は、スラック予測ミスペナルティの発生にある。そこで、上記の結果と、スラック予測精度を示した図8乃至図10を比べると、予測スラックの最大値Vmaxが同一であれば、予測スラックが実スラックを上回る(予測ミスペナルティが発生する)割合が低いモデル程、性能が高くなっていることが分かる。   The cause of the performance degradation of each model is the occurrence of slack prediction miss penalty. Therefore, comparing the above results with FIGS. 8 to 10 showing the slack prediction accuracy, if the maximum value Vmax of predicted slack is the same, the ratio of predicted slack exceeding actual slack (occurrence of predicted mispenalty) It can be seen that the lower the model, the higher the performance.

図14より、各モデルにおいては、予測スラックの最大値Vmaxを増加させるほど、IPCが低下することが分かる。しかし、IPCが高いモデル程、IPCの低下率を抑制できることが分かる。この理由は、図11乃至図13から分かるように、予測スラックの減少や信頼性の導入を行うと、予測ミスペナルティの発生率だけでなく、予測ミスペナルティの大きさも抑制できるからである。   FIG. 14 shows that in each model, the IPC decreases as the maximum value Vmax of predicted slack increases. However, it can be seen that the higher the IPC, the more the IPC can be reduced. The reason for this is that, as can be seen from FIG. 11 to FIG. 13, when the prediction slack is reduced or the reliability is introduced, not only the occurrence rate of the prediction mispenalty but also the size of the prediction mispenalty can be suppressed.

図15は図6の提案機構の実施例のシミュレーション結果であって、各モデルにおけるスラック命令数の割合を示すグラフである。図16は図6の提案機構の実施例のシミュレーション結果であって、各モデルにおける平均予測スラックを示すグラフである。すなわち、図15及び図16に、各モデルの予測スラックを評価した結果を示す。図15は、「スラック命令」の数を示す。ここで、「スラック命令」とは、予測スラックに基づいて実行レイテンシを1サイクル以上増加させた命令である。図15の縦軸は、全実行命令数に占めるスラック命令数の割合をベンチマーク平均で示し、その横軸はモデルを示す。一方、図16は、「平均予測スラック」を示す。ここで、「平均予測スラック」とは、予測スラックの合計を、スラック命令数で割ることにより得られる値である。図16の縦軸は、予測スラックの平均値をベンチマーク平均で示し、その横軸はモデルを示す。これらの図15及び図16より、実行レイテンシを増加させることのできた命令の割合と、それらの命令に対して、増加させることのできた実行レイテンシの平均を知ることができる。   FIG. 15 is a graph showing the simulation result of the embodiment of the proposed mechanism of FIG. 6 and showing the ratio of the number of slack instructions in each model. FIG. 16 is a graph showing simulation results of the embodiment of the proposed mechanism of FIG. 6 and showing average predicted slack in each model. That is, FIG. 15 and FIG. 16 show the results of evaluating the predicted slack of each model. FIG. 15 shows the number of “slack instructions”. Here, the “slack instruction” is an instruction that increases the execution latency by one cycle or more based on the predicted slack. The vertical axis in FIG. 15 indicates the ratio of the number of slack instructions to the total number of executed instructions as a benchmark average, and the horizontal axis indicates the model. On the other hand, FIG. 16 shows “average predicted slack”. Here, “average predicted slack” is a value obtained by dividing the total predicted slack by the number of slack instructions. The vertical axis in FIG. 16 indicates the average value of predicted slack as a benchmark average, and the horizontal axis indicates a model. From these FIG. 15 and FIG. 16, it is possible to know the ratio of the instructions that could increase the execution latency and the average of the execution latencies that could be increased for those instructions.

図15より、スラック命令数は、モデルの種類や信頼性の閾値に依存し、IPCが高いモデルほど少なくなるが、予測スラックの最大値Vmaxにほとんど依存しない。一方、図16より、平均予測スラックは、予測スラックの最大値Vmaxが高いほど大きくなるが、モデルの種類や信頼性のしきい値によって変化することはあまりない。これらより、予測スラックの最大値Vmaxが同一であるモデル同士を比較すると、増加させた実行レイテンシの合計は、予測スラックの減少や信頼性を導入することで減少し、BDCnモデルにおいて最も少なくなる。また、信頼性を導入したモデルの場合、信頼性のしきい値が高いほど、増加させた実行レイテンシの合計は少なくなる。   From FIG. 15, the number of slack instructions depends on the model type and the reliability threshold, and the number of slack instructions decreases as the IPC increases, but hardly depends on the maximum value Vmax of predicted slack. On the other hand, as shown in FIG. 16, the average predicted slack increases as the maximum value Vmax of predicted slack increases, but does not change much depending on the type of model and the reliability threshold value. Accordingly, when models having the same predicted slack maximum value Vmax are compared, the increased total execution latency is reduced by introducing a reduction in predicted slack and reliability, and is the smallest in the BDCn model. In the case of a model incorporating reliability, the higher the reliability threshold, the smaller the total execution latency increased.

しかし、BDCnモデルは、予測スラックの最大値Vmaxの増加によるIPCの低下を最も抑制できる。そのため、性能をあまり低下させること無く、他のモデルよりも予測スラックを増やすことができる場合がある。例えば、IPCの低下が80%程度まで許されるような状況において、BC15モデル、BDモデル、BDC15モデルは、予測スラックの最大値Vmaxをそれぞれ、5、5、15まで増加させることができる。このとき、BDC15モデルは、増加させることのできた実行レイテンシの合計が、BC15モデルよりも15.6%、BDモデルよりも32.6%だけ多くなる。   However, the BDCn model can most suppress the decrease in IPC due to the increase in the maximum value Vmax of predicted slack. Therefore, there is a case where the predicted slack can be increased more than other models without significantly reducing the performance. For example, in a situation where IPC reduction is allowed to about 80%, the BC15 model, BD model, and BDC15 model can increase the maximum value Vmax of predicted slack to 5, 5, and 15, respectively. At this time, in the BDC15 model, the total execution latency that can be increased is 15.6% higher than that of the BC15 model and 32.6% higher than that of the BD model.

非特許文献10では、従来手法によってローカル・スラックを予測し、それに基づいて命令の実行レイテンシを1サイクル増加させた場合の性能、及びスラック命令数を測定している。それによると、従来手法では、性能の低下が2.8サイクルのときに、スラック命令数の割合が26.7%になる。   In Non-Patent Document 10, local slack is predicted by a conventional method, and the performance and the number of slack instructions when the instruction execution latency is increased by one cycle based on the prediction are measured. According to this, in the conventional method, when the performance degradation is 2.8 cycles, the ratio of the number of slack instructions is 26.7%.

一方、上記の研究とはベンチマーク・プログラムやプロセッサ構成が異なるものの、本実施形態で最も近い評価を行っているのは、BDC15モデルにおいて、予測スラックの最大値Vmax=1とした場合である。この場合、性能の低下が2.5サイクルのときに、スラック命令数の割合が31.6%となる。これより、提案手法は、従来手法と同様の結果を示すことが分かる。   On the other hand, although the benchmark program and the processor configuration are different from the above research, the closest evaluation in the present embodiment is performed when the maximum value of predicted slack Vmax = 1 in the BDC15 model. In this case, when the performance degradation is 2.5 cycles, the ratio of the number of slack instructions is 31.6%. From this, it can be seen that the proposed method shows the same result as the conventional method.

図17は図6の提案機構の別の実施例のシミュレーション結果であって、予測スラックの最大値Vmaxの各値に対するスラック命令数とIPCとの関係を示すグラフである。図18は図6の提案機構の別の実施例のシミュレーション結果であって、IPCに対する予測スラックの総積算値を示すグラフである。   FIG. 17 is a graph showing a simulation result of another embodiment of the proposed mechanism of FIG. 6 and showing the relationship between the number of slack instructions and the IPC for each value of the maximum value Vmax of predicted slack. FIG. 18 is a graph showing simulation results of another example of the proposed mechanism of FIG. 6 and showing the total integrated value of predicted slack with respect to IPC.

すなわち、図17は、評価におけるスラック命令数とIPCの測定結果を示している。図17の縦軸は、最大値Vmax及びしきい値Cthの値の各組合せにおける、全実行命令数に対するスラック命令数の比率と、スラック予測を一切行わなかったときのIPCに対する測定IPCの比率とを示している。また最大値Vmaxの各値(「1」、「5」、「10」、「15」)のそれぞれにおける4本組の縦棒は、図中左側からそれぞれしきい値Cthが「1」、「5」、「10」、「15」の場合での測定結果をそれぞれ表す。   That is, FIG. 17 shows the number of slack instructions and the measurement result of IPC in the evaluation. The vertical axis in FIG. 17 represents the ratio of the number of slack instructions to the total number of executed instructions in each combination of the maximum value Vmax and the threshold value Cth, and the ratio of the measured IPC to the IPC when no slack prediction is performed. Is shown. In addition, the four vertical bars in each of the maximum values Vmax (“1”, “5”, “10”, “15”) have thresholds Cth of “1”, “ The measurement results in the cases of “5”, “10”, and “15” are respectively shown.

図17に示されるように、しきい値Cthを増加させるとスラック命令数は減少する。これはしきい値Cthの増加により、予測スラックの増加条件が厳しくなり、予測スラックの増加頻度が低くなるためである。ただし、しきい値Cthを増加すれば、予測スラックがターゲット・スラックを上回る頻度が低くなるため、IPCは向上するようになる。この結果から、上記信頼性の導入によって、上記スラック予測ミスのペナルティによる命令処理性能の低下を抑えられることが確認された。一方、予測スラックの最大値Vmaxを増加させると、予測スラックがより大きい値を取ることが可能となるため、スラック予測ミスのペナルティが大きくなり、処理性能(IPC)は低下するようになる。   As shown in FIG. 17, when the threshold value Cth is increased, the number of slack instructions decreases. This is because the increase condition of the predicted slack becomes stricter due to the increase of the threshold value Cth, and the increase frequency of the predicted slack becomes lower. However, if the threshold value Cth is increased, the frequency at which predicted slack exceeds target slack decreases, and IPC is improved. From this result, it was confirmed that the introduction of the reliability can suppress a decrease in instruction processing performance due to the slack prediction miss penalty. On the other hand, if the maximum value Vmax of predicted slack is increased, the predicted slack can take a larger value, so that the penalty for slack prediction mistakes increases and the processing performance (IPC) decreases.

図18に、上記測定結果での予測スラックとIPCとの関係を示す。なお、図18の縦軸は、パラメータ(Vmax,Cth)=(1,1)の場合を基準(100)とした予測スラックの総積算値のベンチマーク平均値の比率を示し、その横軸は、スラック予測を一切行わなかったときを基準(100)としたIPCのベンチマーク平均値の比率をそれぞれ示している。なお、図18の各点に付された数字は、しきい値Cthの値を示している。   FIG. 18 shows the relationship between predicted slack and IPC in the above measurement results. The vertical axis in FIG. 18 indicates the ratio of the benchmark average value of the total integrated value of predicted slack with the parameter (Vmax, Cth) = (1, 1) as the reference (100), and the horizontal axis is The ratios of IPC benchmark average values based on the standard (100) when no slack prediction is performed are shown. Note that the numbers given to the points in FIG. 18 indicate the value of the threshold value Cth.

図18に示されるように、予測スラックの最大値Vmaxを増加させると、処理性能は低下するが、予測スラックは大幅に増大する。また最大値Vmaxとともにしきい値Cthを増加させることで、IPCがほとんど低下せずに、予測スラックが増加するパラメータの組合せも幾つか確認された。例えばパラメータ(Vmax,Cth)=(1,1)の場合に対して、パラメータ(Vmax,Cth)=(5,15)の場合には、IPCの低下をわずか0.3%に留めながらも、予測スラックは約2.2倍となっている。   As shown in FIG. 18, when the maximum value Vmax of predicted slack is increased, the processing performance is reduced, but the predicted slack is greatly increased. In addition, by increasing the threshold value Cth together with the maximum value Vmax, some combinations of parameters that increase predicted slack without substantially decreasing IPC were confirmed. For example, in the case of the parameter (Vmax, Cth) = (1, 1), when the parameter (Vmax, Cth) = (5, 15), the decrease in IPC is only 0.3%, The predicted slack is about 2.2 times.

以上の結果から明らかなように、処理性能は、スラック命令数や予測スラックとトレード・オフの関係にあり、適用対象での要求に応じて、各パラメータの最適値は異なることとなる。   As is clear from the above results, the processing performance is in a trade-off relationship with the number of slack instructions and predicted slack, and the optimum value of each parameter varies depending on the request of the application target.

3.スラック予測機構のハードウェアに関する評価.
本実施形態において提案するスラック予測機構のハードウェア量、アクセス時間、消費電力を従来機構と比較する。
3. Evaluation of hardware for slack prediction mechanism.
The hardware amount, access time, and power consumption of the slack prediction mechanism proposed in this embodiment are compared with those of the conventional mechanism.

3.1.ハードウェア構成.
プロセッサ構成は、前章の評価環境と同じものを用いる。すなわち、図2の従来機構を用い、また、提案機構として前章で評価した図6のBDCモデルを用いる。まず、図2の従来機構で必要となるハードウェアを以下に示す。
3.1. Hardware configuration.
The processor configuration is the same as the evaluation environment in the previous chapter. That is, the conventional mechanism of FIG. 2 is used, and the BDC model of FIG. 6 evaluated in the previous chapter is used as the proposed mechanism. First, hardware necessary for the conventional mechanism of FIG. 2 is shown below.

(1)テーブルは、スラック表20、メモリ定義表3及びレジスタ定義表2を備える(図2参照)。
(2)演算器は、図2の減算器5(スラック値の計算)、比較器(アドレスの比較)及び比較器(物理レジスタ番号の比較)を備える。なお、2個の比較器は、詳細後述するように、テーブルをパイプライン化したときに必要なハードウェアであって、図2において図示していない。
(1) The table includes a slack table 20, a memory definition table 3, and a register definition table 2 (see FIG. 2).
(2) The computing unit includes the subtracter 5 (calculation of slack value), the comparator (address comparison), and the comparator (physical register number comparison) shown in FIG. Note that the two comparators are hardware necessary when the table is pipelined, as will be described in detail later, and are not shown in FIG.

図2の従来機構において、スラック表20は、命令のスラック値を保持しており、プログラム・カウンタ値(PC)をインデクスとして、フェッチ時に参照し、実行時に更新する。メモリ定義表3は、メモリ・アドレスをインデクスとし、対応するメモリ・アドレスにデータをストアした命令のプログラム・カウンタ値(PC)と、そのデータの定義時刻を保持する。メモリ定義表3は、ストア・アドレスで更新し、ロード・アドレスで参照する。レジスタ定義表2は、物理レジスタ番号をインデクスとし、対応する物理レジスタにデータを書き込んだ命令のプログラム・カウンタ値(PC)とそのデータの定義時刻を保持する。レジスタ定義表2は、命令の実行直前に、命令のソース・レジスタに対応する物理レジスタ番号で参照し、デスティネーション・レジスタに対応する物理レジスタ番号で更新する。減算器5は、定義表から得られた定義時刻と現在時刻との差分をとり、実行した命令のスラックを計算する。比較器(アドレスの比較)と比較器(物理レジスタ番号の比較)はそれぞれ、メモリ定義表3及びレジスタ定義表2を、高速動作のためにパイプライン化したときに必要となる。メモリ定義表3及びレジスタ定義表2のテーブルをパイプライン化した場合、定義時刻の更新が完了する前に、その定義時刻の参照が発生すると、当該テーブルから正しい定義時刻を得ることができない。この問題を解決するためには、定義時刻のフォワーディングを行う必要がある。具体的には、まず、更新に用いるアドレスと参照に用いるアドレスの比較、更新に用いるデスティネーション・レジスタと参照に用いるソース・レジスタの物理レジスタ番号の比較を行う。そして、アドレス、あるいは、物理レジスタ番号が一致すると、それぞれメモリ定義時刻、レジスタ定義時刻のフォワーディングを行う。   In the conventional mechanism of FIG. 2, the slack table 20 holds the slack value of an instruction, and refers to the program counter value (PC) as an index at the time of fetch and updates at the time of execution. The memory definition table 3 stores the program counter value (PC) of the instruction that stores the data at the corresponding memory address and the definition time of the data, with the memory address as an index. The memory definition table 3 is updated with the store address and referenced with the load address. The register definition table 2 uses a physical register number as an index, and holds a program counter value (PC) of an instruction that writes data to a corresponding physical register and a definition time of the data. The register definition table 2 is referred to by the physical register number corresponding to the source register of the instruction and updated with the physical register number corresponding to the destination register immediately before execution of the instruction. The subtracter 5 calculates the slack of the executed instruction by taking the difference between the definition time obtained from the definition table and the current time. The comparator (address comparison) and the comparator (physical register number comparison) are respectively required when the memory definition table 3 and the register definition table 2 are pipelined for high-speed operation. When the tables of the memory definition table 3 and the register definition table 2 are pipelined, if the definition time is referenced before the update of the definition time is completed, the correct definition time cannot be obtained from the table. To solve this problem, it is necessary to forward the defined time. Specifically, first, an address used for update and an address used for reference are compared, and a physical register number of a destination register used for update and a source register used for reference is compared. When the address or the physical register number matches, the memory definition time and the register definition time are forwarded, respectively.

次に、提案機構で必要となるハードウェアを以下に示す。   Next, the hardware required for the proposed mechanism is shown below.

(1)テーブルは、図6に示すように、スラック表20と、信頼性と予測スラックを記録するFIFO17とを備える。
(2)演算器は、図19及び図46に示すように、信頼性加算器40と、信頼性比較器(図19のアンドゲート31及び図46の比較器94に対応し、以下、信頼性比較器94という。)と、予測スラック加算器50と、予測スラック比較器(図19のアンドゲート35及び図46の予測スラック比較器112に対応し、以下、予測スラック比較器112という。)を備える。
(1) As shown in FIG. 6, the table includes a slack table 20 and a FIFO 17 that records reliability and predicted slack.
(2) As shown in FIGS. 19 and 46, the computing unit corresponds to the reliability adder 40 and the reliability comparator (corresponding to the AND gate 31 in FIG. 19 and the comparator 94 in FIG. A comparator 94), a predicted slack adder 50, and a predicted slack comparator (corresponding to the AND gate 35 in FIG. 19 and the predicted slack comparator 112 in FIG. 46, hereinafter referred to as a predicted slack comparator 112). Prepare.

提案機構において、スラック表20は、あるプログラム・カウンタ値(PC)のスラック値と信頼性を保持しており、フェッチ時に参照し、コミット時に更新する。FIFO17は、スラック表20から得た信頼性と予測スラックを命令フェッチ順に保持するFIFOであり、ディスパッチ時に書き込み、コミット時に読み出す。これらの値は、スラック表20の更新データを計算するために用いる。このFIFO17は、ROB16と同一エントリとし、命令をROB16に書き込むと同時に、同一のインデクスを用いて、その命令の信頼性と予測スラックがこのFIFO17に書き込まれ、命令をROB16からコミットすると同時に、同一のインデクスを用いて、その命令の信頼性と予測スラックをFIFO17から読み出してスラック表20に出力する。   In the proposed mechanism, the slack table 20 holds the slack value and reliability of a certain program counter value (PC), and is referred to when fetched and updated when committed. The FIFO 17 is a FIFO that holds the reliability and predicted slack obtained from the slack table 20 in the order of instruction fetch, and writes at the time of dispatch and reads at the time of commit. These values are used to calculate the update data of the slack table 20. The FIFO 17 has the same entry as the ROB 16 and writes the instruction to the ROB 16. At the same time, the reliability of the instruction and the predicted slack are written to the FIFO 17 using the same index, and at the same time the instruction is committed from the ROB 16. Using the index, the reliability and predicted slack of the instruction are read from the FIFO 17 and output to the slack table 20.

演算器は予測スラック及び信頼性の更新のために用いる。信頼性加算器40は、信頼性を増加量Cincだけ増加させるために用いる。信頼性比較器94は、増加させた信頼性がしきい値Cth以上になったかどうかを調べるために用いる。予測スラック加算器50は、予測スラックを増加量Vincだけ増加させるために用いる。予測スラック比較器112は、増加させた予測スラックがVmaxを超えたかどうかを調べるために用いる。予測スラックがその最大値Vmaxを超えていたら、予測スラックはその最大値Vmaxにセットされる。なお、信頼性を減少させるときは、0にリセットするだけなので、信頼性を減算するための演算器、及び、信頼性が最小値Cmin以下になったかどうかを調べるための比較器は必要ない。また、本評価では、Vdec=Vmaxとしており、予測スラックを減少させるときは、0にリセットするだけなので、予測スラックを減算するための演算器、及び、予測スラックがVmin以下になったかどうかを調べるための比較器も必要ない。   The computing unit is used for predictive slack and reliability update. The reliability adder 40 is used to increase the reliability by the increase amount Cinc. The reliability comparator 94 is used to check whether or not the increased reliability is equal to or higher than the threshold value Cth. The predicted slack adder 50 is used to increase the predicted slack by the increase amount Vinc. The predicted slack comparator 112 is used to check whether the increased predicted slack exceeds Vmax. If the predicted slack exceeds its maximum value Vmax, the predicted slack is set to its maximum value Vmax. Note that when the reliability is reduced, the resetting is simply reset to 0, so that there is no need for an arithmetic unit for subtracting the reliability and a comparator for checking whether the reliability is equal to or lower than the minimum value Cmin. Further, in this evaluation, Vdec = Vmax is set, and when the predicted slack is decreased, it is only reset to 0. Therefore, an arithmetic unit for subtracting the predicted slack and whether the predicted slack is equal to or lower than Vmin are checked. There is no need for a comparator.

増加量Cincと増加量Vincはともに1なので、提案機構の加算器40,50は、信頼性、あるいは、予測スラックだけを入力とし、その入力に1を加えるという非常に単純な操作を行うだけでよい。具体的には、入力の第0ビットから第n−1ビットがすべて1であれば、入力の第nビットを反転したものを、出力の第nビットとし、そうでなければ入力の第nビットをそのまま出力の第nビットとする。従って、従来機構の減算器5とは異なり、非常に簡単に実現できる。   Since the increase amount Cinc and the increase amount Vinc are both 1, the adders 40 and 50 of the proposed mechanism perform only a very simple operation of inputting only 1 to the reliability or predicted slack and adding 1 to the input. Good. Specifically, if the 0th bit to the (n-1) th bit of the input are all 1, the inverted nth bit of the input is the nth bit of the output, otherwise the nth bit of the input Is the nth bit of the output. Therefore, unlike the subtracter 5 of the conventional mechanism, it can be realized very easily.

増加量CincとVincが、ともに1であることを利用すれば、提案機構の比較器94,112も、簡単化できる。提案機構の加算器40(又は50)は、信頼性(又は予測スラック)に1を加えるだけである。従って、比較器94,112は、加算器40(又は50)の入力データが、Cth−1(又はVmax)と一致するのであれば、加算器40(又は50)の出力がしきい値Cth以上になる(又は最大値Vmaxを超える)と判断することができる。   By utilizing that the increments Cinc and Vinc are both 1, the comparators 94 and 112 of the proposed mechanism can be simplified. The proposed mechanism adder 40 (or 50) only adds 1 to the reliability (or predicted slack). Therefore, if the input data of the adder 40 (or 50) matches Cth−1 (or Vmax), the comparators 94 and 112 output the adder 40 (or 50) with the threshold value Cth or more. (Or exceeding the maximum value Vmax).

従来機構と提案機構を正確に比較するためには、それぞれの機構において、スラック予測精度がほとんど変化せず、アクセス時間と消費電力ができるだけ少なくなるようなテーブル構成(エントリ数、連想度、ラインサイズ、ポート数)を知る必要がある。しかし、従来機構において、テーブル(スラック表20、メモリ定義表3、及びレジスタ定義表2)の構成がスラック予測精度に与える影響は、未だ十分に調査されていない。   In order to accurately compare the conventional mechanism with the proposed mechanism, the table structure (number of entries, association degree, line size) in which the slack prediction accuracy hardly changes in each mechanism and the access time and power consumption are minimized. Need to know the number of ports). However, in the conventional mechanism, the influence of the configuration of the tables (slack table 20, memory definition table 3, and register definition table 2) on the slack prediction accuracy has not been sufficiently investigated yet.

そこで、本章では、従来機構と提案機構の精度が同程度になるテーブル構成を用いる。具体的には、スラック表20に関しては、前章の評価で用いた構成(エントリ数8K、連想度2)を用いる。しきい値Cthと最大値Vmaxは、どちらも、前章の評価において用いた値において、提案機構のハードウェア量が最も大きくなる値である、15を仮定する。メモリ定義表3とレジスタ定義表2に関しては、前章で精度を比較するために引用した非特許文献10で仮定されている構成を用いる。具体的には、メモリ定義表3はエントリ数が8K、連想度が4、レジスタ定義表2はエントリ数が64、連想度が64とする。   Therefore, in this chapter, a table configuration is used in which the accuracy of the conventional mechanism and the proposed mechanism is comparable. Specifically, for the slack table 20, the configuration (number of entries 8K, association degree 2) used in the evaluation in the previous chapter is used. Both the threshold value Cth and the maximum value Vmax are assumed to be 15 which is the value at which the hardware amount of the proposed mechanism is the largest among the values used in the evaluation in the previous chapter. Regarding the memory definition table 3 and the register definition table 2, the configuration assumed in Non-Patent Document 10 cited for comparison of accuracy in the previous chapter is used. Specifically, the memory definition table 3 has an entry number of 8K and an association degree of 4, and the register definition table 2 has an entry number of 64 and an association degree of 64.

非特許文献10によれば、定義表3,2はプログラム・カウンタ値(PC)の一部を保持する。また、前章の評価結果からも分かるように、動的実行命令のうち、実スラックが30%以下である命令は約7割存在するため、定義時刻を表すために必要なビット数を少なくできる可能性がある。しかし、非特許文献10において、これらの数値に関する具体的な議論は行われていない。そこで、本章では、スラック予測精度を重視し、定義表3,2にはプログラム・カウンタ値(PC)をすべて保持すると仮定する。また、定義時刻を表すために必要なビット数の削減は行わないと仮定する。従って、定義表3,2の各データ・フィールドは、最悪のケースを想定した設定となる。   According to Non-Patent Document 10, the definition tables 3 and 2 hold a part of the program counter value (PC). In addition, as can be seen from the evaluation results in the previous chapter, there are about 70% of dynamic execution instructions with actual slack of 30% or less, so the number of bits required to represent the definition time can be reduced. There is sex. However, in Non-Patent Document 10, there is no specific discussion regarding these numerical values. In this chapter, therefore, slack prediction accuracy is emphasized, and it is assumed that definition tables 3 and 2 hold all program counter values (PC). Further, it is assumed that the number of bits necessary for representing the definition time is not reduced. Therefore, the data fields in the definition tables 3 and 2 are set assuming the worst case.

上記のテーブル構成は、スラック予測精度を重視した構成であるため、アクセス時間と消費電力が過大になる可能性がある。しかし、精度がほぼ同一になることが判明しているテーブル構成を用いて、アクセス時間と消費電力を比較できるという利点がある。   Since the above-described table configuration emphasizes slack prediction accuracy, the access time and power consumption may be excessive. However, there is an advantage that the access time and the power consumption can be compared using a table configuration that has been found to have substantially the same accuracy.

3.2.ハードウェア量の比較.
ハードウェア量の比較は、必要となるテーブルの保持するメモリ・セル数、及び、演算器の入力ビット数と個数を基にして行う。テーブルにおいて、ハードウェア量の大部分を占めるのは、タグ・アレイとデータ・アレイである。そこで、テーブルのハードウェア量を、タグ・アレイとデータ・アレイの保持するメモリ・セル数によって見積もる。表2に、必要となるテーブルのメモリ・セル数とポート数を示す。表2(a)は従来機構の場合を示し、表2(b)は提案機構の場合を示す。
3.2. Comparison of hardware amount.
The hardware amount is compared based on the number of memory cells held in the necessary table and the number and number of input bits of the arithmetic unit. In the table, a tag array and a data array occupy most of the hardware amount. Therefore, the hardware amount of the table is estimated by the number of memory cells held by the tag array and the data array. Table 2 shows the required number of memory cells and ports in the table. Table 2 (a) shows the case of the conventional mechanism, and Table 2 (b) shows the case of the proposed mechanism.

Figure 2007293816
Figure 2007293816

表2には、まず、各テーブルのエントリ数を示し、次に、1エントリあたりのメモリ・セル数を、タグ・フィールドとデータ・フィールドに分けて示す。エントリ数と、1エントリあたりのメモリ・セル数の積が、テーブルの総メモリ・セル数となる。また、表には、各テーブルのポート数も示す。ポート数は、後ほどアクセス時間と消費電力について評価するために用いる。表2では、スラック表20、メモリ定義表3、レジスタ定義表2のエントリ数をそれぞれEslack、Emdef、Erdefと表し、連想度をそれぞれ、Aslack、Amdef、Ardefと表す。同じ条件で比較するため、スラック表のエントリ数と連想度は、提案機構と従来機構で同一としている。Nfetch、Nissue、Ndcport、Ncommitはそれぞれ、フェッチ幅、発行幅、データキャッシュのポート数、コミット幅を表す。Nfetch、Nissue、Ncommitは同一と仮定する。Erobは、ROBのエントリ数を表す。前章の評価環境より、Nfetch=8、EROB=256とする。 Table 2 shows the number of entries in each table, and then shows the number of memory cells per entry divided into a tag field and a data field. The product of the number of entries and the number of memory cells per entry is the total number of memory cells in the table. The table also shows the number of ports in each table. The number of ports will be used later to evaluate access time and power consumption. In Table 2, the slack table 20, a memory definition table 3, expressed register definition table 2 number of entries each E slack, E mdef, and E RDEF, respectively associativity, A slack, A mdef, represented as A RDEF. In order to make a comparison under the same conditions, the number of entries in the slack table and the degree of association are the same in the proposed mechanism and the conventional mechanism. N fetch , N issue , N dcport , and N commit represent the fetch width, issue width, number of data cache ports, and commit width, respectively. N fetch , N issue , and N commit are assumed to be the same. Erob represents the number of ROB entries. From the evaluation environment of the previous chapter, N fetch = 8 and E ROB = 256.

時間Tcsは、コンテキスト・スイッチ間隔をサイクル単位で表した値である。従来機構では、時刻を用いてスラックを計算する。スケジューラによって選択されたプロセスが実行を開始した時刻を0とすると、その時刻は、プロセスがコンテキスト・スイッチによってプロセッサ上から退避されるまでカウントされる。従って、時刻を正しく表すためには、log(Tcs)ビット必要となる。LinuxOSにおいて、コンテキスト・スイッチの間隔はmsecオーダーなので、時間Tcsを1msec程度と仮定する。また、非特許文献9に示された、0.13μmプロセス時のARMコアの動作周波数より、プロセッサの動作周波数を1.2GHzと仮定する。これらより、時刻を表現するにはほぼ20ビット必要となる。そこで、以降は、log(Tcs)=20とする。 The time T cs is a value representing the context switch interval in units of cycles. In the conventional mechanism, slack is calculated using time. When the time when the process selected by the scheduler starts execution is set to 0, the time is counted until the process is saved from the processor by the context switch. Therefore, log 2 (T cs ) bits are required to correctly represent the time. In Linux OS, since the interval between context switches is on the order of msec, it is assumed that the time T cs is about 1 msec. Further, it is assumed that the operating frequency of the processor is 1.2 GHz from the operating frequency of the ARM core at the time of the 0.13 μm process shown in Non-Patent Document 9. Therefore, approximately 20 bits are required to express the time. Therefore, hereinafter, log 2 (T cs ) = 20.

従来機構と提案機構のスラック表20を比較すると、従来機構は、データ・フィールドのメモリ・セル数がlog(Cth+1)ビット多くなる。しかし、スラック表20以外にもテーブルは存在するので、スラック表20だけでは全テーブルのハードウェア量の大小を判断できない。 Comparing the slack table 20 between the conventional mechanism and the proposed mechanism, the conventional mechanism increases the number of memory cells in the data field by log 2 (Cth + 1) bits. However, since there are tables other than the slack table 20, the size of the hardware amount of all the tables cannot be determined only by the slack table 20.

そこで、テーブルの各変数に値を代入して全テーブルのハードウェア量を計算する。提案機構のメモリ・セル数は、スラック表の場合229376、FIFOの場合2048となり、合計すると231424となる。一方、従来機構のメモリ・セル数は、スラック表20の場合196608、メモリ定義表3の場合598016、レジスタ定義表2の場合3840となり、合計すると798464となる。従って、提案機構の方が、メモリ・セル数が少なくなる。   Therefore, the hardware amount of all tables is calculated by substituting values for each variable of the table. The number of memory cells of the proposed mechanism is 229376 for the slack table, 2048 for the FIFO, and a total of 231424. On the other hand, the number of memory cells of the conventional mechanism is 196608 for the slack table 20, 598016 for the memory definition table 3, and 3840 for the register definition table 2, and the total is 798464. Therefore, the number of memory cells is smaller in the proposed mechanism.

なお、上記の評価において、従来機構の定義表は、各データ・フィールドのサイズが、最悪のケースを想定した設定となっているが、このサイズが半分になったとしても、提案機構のメモリ・セル数の方が少ないという結論は変わらない。ただし、前節で説明した通り、正確な比較を行うためには、十分なスラック予測精度が得られるテーブル構成を知る必要があり、今後の課題である。   In the above evaluation, the definition table of the conventional mechanism is set assuming that the size of each data field is the worst case, but even if this size is halved, the memory / The conclusion that there are fewer cells remains the same. However, as explained in the previous section, in order to perform an accurate comparison, it is necessary to know a table configuration that can provide sufficient slack prediction accuracy, which is a future problem.

次に、演算器のハードウェア量を比較する。表3に、演算器の入力ビット数と個数を示す。表3(a)は従来機構の場合、表3(b)は提案機構の場合である。   Next, the hardware amount of the computing unit is compared. Table 3 shows the number of input bits and the number of arithmetic units. Table 3 (a) shows the case of the conventional mechanism, and Table 3 (b) shows the case of the proposed mechanism.

Figure 2007293816
Figure 2007293816

入力ビット数は、演算器の各入力のビット数を合計したものである。なお、比較器94,112の個数は、定義時刻のフォワーディングを行うパイプライン段数が1段の場合の値である。段数が増加すれば、それに比例して、比較器94,112の個数も増加するが、フォワーディングを行う必要がなければ、比較器も必要ない。   The number of input bits is the total number of bits of each input of the arithmetic unit. Note that the number of comparators 94 and 112 is a value when the number of pipeline stages that perform forwarding at the defined time is one. If the number of stages increases, the number of comparators 94 and 112 increases in proportion to the number of stages. However, if it is not necessary to perform forwarding, a comparator is not necessary.

従来機構と提案機構の演算器を比較する。ここでは、提案機構の方が確実にハードウェア量が少なくなることを示すため、従来機構において、定義時刻のフォワーディングは行う必要がない場合を考える。   Compare the calculator of the conventional mechanism and the proposed mechanism. Here, in order to show that the proposed mechanism surely reduces the amount of hardware, consider the case where the conventional mechanism does not need to forward the defined time.

issue=Ncommit=8なので、提案機構は、従来機構よりも、演算器の数が24個、多くなってしまうことが分かる。しかし、提案機構の演算器は、上述したように、非常に簡単に実現できるため、単純に演算器の個数だけに着目して、ハードウェア量を比較することはできない。そこで、各演算器の構成について詳しく検討する。まず、従来機構の減算器は、log(Tcs)=20なので、入力が20ビットとなる。基本的な回路構成は、入力が20ビットの加算器とほぼ同様である。この加算器を8倍したものが、従来機構のハードウェア量となる。 Since N issue = N commit = 8, it can be seen that the proposed mechanism has 24 more arithmetic units than the conventional mechanism. However, since the arithmetic unit of the proposed mechanism can be realized very easily as described above, it is not possible to compare hardware amounts by simply focusing on the number of arithmetic units. Therefore, the configuration of each arithmetic unit will be examined in detail. First, since the subtracter of the conventional mechanism has log 2 (T cs ) = 20, the input is 20 bits. The basic circuit configuration is almost the same as an adder with an input of 20 bits. A hardware amount of the conventional mechanism is obtained by multiplying the adder by 8 times.

次に、提案機構の演算器の構成について詳しく検討する。まず、しきい値Cthと最大値Vmaxを、先ほどと同様、どちらも15と仮定すると、提案機構の各演算器は、入力が4ビットとなる。   Next, the configuration of the calculator of the proposed mechanism will be examined in detail. First, if the threshold value Cth and the maximum value Vmax are both assumed to be 15 as before, each arithmetic unit of the proposed mechanism has an input of 4 bits.

図19は本発明の第1の実施形態に係る更新ユニット30の構成を示すブロック図である。ここで、図19は、コミットする命令1つあたりに必要となる演算器(これらで構成される回路を更新ユニット30という。)の回路構成を示す。当該更新ユニット30の回路を8倍したものが、提案機構のハードウェア量となる。図19の到達条件フラグRflagは、ターゲット・スラック到達条件が成立しているときに1となり、そうでないときに0となるフラグである。図19の中央のアンドゲート31,35がそれぞれ信頼性比較器94、予測スラック比較器112を構成し、点線で囲われた各部分が加算器40,50を構成し、その他の素子(オアゲート33,37及びマルチプレクサ34,38,39)が制御用の回路である。ここで、入力ビット数が4ビットの場合、信頼性比較器94及び予測スラック比較器112はそれぞれ、入力値の各ビットを、そのまま、あるいは、反転したものを入力とする、4入力のアンドゲート31、アンドゲート35で実現できる。また、提案機構の各加算器40,50は、2個のアンドゲート(41−42;51−52)、4個のインバータ(43−46;53−56)、3つのマルチプレクサ(47−49;57−59)で実現できる。従って、従来機構で必要となる20ビットの減算器よりも十分少ないハードウェア量で実現できるといえる。   FIG. 19 is a block diagram showing the configuration of the update unit 30 according to the first embodiment of the present invention. Here, FIG. 19 shows a circuit configuration of an arithmetic unit (a circuit constituted by these is referred to as an update unit 30) required for one instruction to be committed. A hardware amount of the proposed mechanism is eight times the circuit of the update unit 30. The arrival condition flag Rflag in FIG. 19 is 1 when the target slack arrival condition is satisfied, and 0 when it is not. The central AND gates 31 and 35 in FIG. 19 constitute a reliability comparator 94 and a prediction slack comparator 112, respectively, and the portions surrounded by dotted lines constitute adders 40 and 50, and other elements (OR gate 33). 37 and multiplexers 34, 38, 39) are control circuits. Here, when the number of input bits is 4 bits, the reliability comparator 94 and the prediction slack comparator 112 each have a 4-input AND gate that inputs each bit of the input value as it is or an inverted version. 31 and the AND gate 35. Each adder 40, 50 of the proposed mechanism has two AND gates (41-42; 51-52), four inverters (43-46; 53-56), and three multiplexers (47-49; 57-59). Therefore, it can be said that it can be realized with a hardware amount sufficiently smaller than that of the 20-bit subtractor required in the conventional mechanism.

3.3.アクセス時間と消費電力に関する比較.
本節では、テーブルのアクセス時間と、1アクセスあたりの消費エネルギーを求めるために、キャッシュ・シミュレータである公知のCACTI(例えば、非特許文献12参照。)を用いる。CACTIによる評価では、非特許文献9のARMコアのデータを基に、プロセスを0.13μm、電源電圧を1.1Vと仮定する。CACTIではテーブルのラインサイズをバイト単位で入力する必要がある。しかし、従来機構のスラック表は、データ・フィールドが4ビットであるため、ラインサイズが1バイトに満たない。そこで、CACTIで評価する場合に限り、データ・フィールドを8ビットと仮定する。しかし、この仮定によって、従来機構のスラック表の規模だけが2倍になってしまうため、このままでは公平な比較ができない。そこで、CACTIで提案機構を評価する場合、スラック値を保持するテーブルである、スラック表20とFIFO17のデータ・フィールドを、8ビットから、16ビットに増加させる。なお、メモリ定義表3とレジスタ定義表2は、スラック値を保持しないので、データ・フィールドの変更は行わない。
3.3. Comparison of access time and power consumption.
In this section, in order to obtain the access time of the table and the energy consumption per access, a known CATTI that is a cache simulator (for example, see Non-Patent Document 12) is used. In the evaluation by CACTI, it is assumed that the process is 0.13 μm and the power supply voltage is 1.1 V based on the ARM core data of Non-Patent Document 9. In CACTI, it is necessary to input the line size of the table in bytes. However, in the slack table of the conventional mechanism, since the data field is 4 bits, the line size is less than 1 byte. Therefore, the data field is assumed to be 8 bits only when the evaluation is performed by the CACTI. However, this assumption only doubles the size of the slack table of the conventional mechanism, so a fair comparison cannot be made as it is. Therefore, when the proposed mechanism is evaluated by CACTI, the data fields of the slack table 20 and the FIFO 17 which are tables holding slack values are increased from 8 bits to 16 bits. Since the memory definition table 3 and the register definition table 2 do not hold slack values, the data field is not changed.

上記の仮定によって、提案機構のスラック表20は、アクセス時間が4.1%、消費エネルギーが23%増加する。このことから、従来機構のスラック表20の評価結果も、同程度の誤差が生じていると考えられる。また、提案機構のFIFO17はアクセス時間が4.2%減少し、消費エネルギーが116%増加する。そこで、比較を行う際には、この誤差の影響を考慮する。なお、FIF27Oのアクセス時間が減少する理由は、CACTIが、テーブル構成によって、データ・アレイの分割方法を変えることにある。   Based on the above assumption, the slack table 20 of the proposed mechanism increases the access time by 4.1% and the energy consumption by 23%. From this, it can be considered that a similar error has occurred in the evaluation result of the slack table 20 of the conventional mechanism. In addition, the FIFO 17 of the proposed mechanism reduces the access time by 4.2% and increases the energy consumption by 116%. Therefore, the effect of this error is taken into account when making the comparison. The reason why the access time of the FIFO 27O is reduced is that CACTI changes the data array dividing method depending on the table configuration.

まず、提案機構と従来機構のアクセス時間を比較する。既に示したように、スラック予測機構で使用される演算器の規模は、ALU(Arithmetic Logical Unit)よりも小さい。一方、テーブルに関しては、プロセッサ中で用いられるデータキャッシュと同程度(あるいはそれ以上)の規模のものが存在する。そのため、提案機構と従来機構のアクセス時間は、テーブルのアクセス時間で決まると考えることができる。そこで、テーブルのアクセス時間を比較する。   First, the access time of the proposed mechanism and the conventional mechanism are compared. As already indicated, the scale of the arithmetic unit used in the slack prediction mechanism is smaller than ALU (Arithmetic Logical Unit). On the other hand, there is a table of the same size (or more) as the data cache used in the processor. Therefore, it can be considered that the access time of the proposed mechanism and the conventional mechanism is determined by the access time of the table. Therefore, the table access times are compared.

表4にCACTIで測定した、テーブルのアクセス時間を示す。表4(a)が従来機構の場合、表4(b)は提案機構の場合である。   Table 4 shows the access time of the table measured by CACTI. When Table 4 (a) is a conventional mechanism, Table 4 (b) is a case of a proposed mechanism.

Figure 2007293816
Figure 2007293816

表4より、スラック表20は、メモリ定義表3に比べ、ハードウェア量が少ないにも関わらず、アクセス時間が非常に長くなっていることが分かる。この理由は、テーブルのアクセス時間が、ハードウェア量ではなく、テーブル構成(エントリ数、連想度、ラインサイズ、ポート数など)で決まることにある。   From Table 4, it can be seen that the slack table 20 has a much longer access time than the memory definition table 3, although the amount of hardware is small. This is because the table access time is determined not by the amount of hardware but by the table configuration (number of entries, associativeness, line size, number of ports, etc.).

また、動作周波数は1.2GHz(サイクル時間0.83nsec)を仮定しているので、スラック表20、メモリ定義表3、及びレジスタ定義表2に対して高速にアクセスするためには、それぞれを、6段、3段、2段程度にパイプライン化する必要があることが分かる。スラック表20のアクセス時間の測定誤差を考慮したとしても、この段数が減ることはない。しかし、これらのテーブル3,2を6段にパイプライン化したとしても、フェッチした命令の予測スラックを得るために要するサイクル数が非常に長く、それを利用することは困難である。また、メモリ定義表3、及びレジスタ定義表2をパイプライン化すると、定義時刻のフォワーディングを行うために、消費電力が増加してしまうという問題がある。しかし、本節では、これらのテーブル3,2を上記のようにパイプライン化したとして議論をすすめ、これらの問題については、次節で議論する。   Since the operating frequency is assumed to be 1.2 GHz (cycle time 0.83 nsec), in order to access the slack table 20, the memory definition table 3, and the register definition table 2 at high speed, It can be seen that it is necessary to pipeline into 6 stages, 3 stages and 2 stages. Even if the measurement error of the access time in the slack table 20 is taken into consideration, the number of stages does not decrease. However, even if these tables 3 and 2 are pipelined into six stages, the number of cycles required to obtain the predicted slack of the fetched instruction is very long, and it is difficult to use it. In addition, when the memory definition table 3 and the register definition table 2 are pipelined, there is a problem that power consumption increases because of forwarding of the definition time. However, in this section, discussions are made assuming that these tables 3 and 2 are pipelined as described above, and these problems will be discussed in the next section.

さらに、表4より、どちらの機構においてもスラック表20のアクセス時間が最も長いことが分かる。従って、アクセス時間は、提案機構の方が長いことが分かる。スラック表20のアクセス時間には測定誤差があるが、どちらの機構においてもアクセス時間は同程度増加すると考えられるので、この結論に影響はない。   Furthermore, it can be seen from Table 4 that the access time of the slack table 20 is the longest in either mechanism. Therefore, it can be seen that the access time is longer in the proposed mechanism. Although there is a measurement error in the access time of the slack table 20, the access time is considered to increase to the same extent in either mechanism, so this conclusion is not affected.

次に、消費電力の比較を行う。ただし、前章の評価結果より、従来機構と提案機構の実行時間はほぼ同一となるので、消費エネルギーを比較すればよい。回路の全消費エネルギーは、1回の動作あたりに必要な消費エネルギーと、動作回数の積で表される。   Next, power consumption is compared. However, from the evaluation results in the previous chapter, the execution time of the conventional mechanism and the proposed mechanism is almost the same, so energy consumption should be compared. The total energy consumption of the circuit is represented by the product of the energy consumption required per operation and the number of operations.

各回路の動作回数は、前章の評価環境を用いて計測する。前章で用いたシミュレータに従来機構は組み込まれていないので、従来機構の各回路の動作回数は、プロセッサ10の動作から推測する。具体的には、スラック表20の場合、フェッチ時に参照し、命令実行時に更新するので、フェッチした命令数と機能ユニットで実行した命令数の和を動作回数とする。メモリ定義表3の場合、ロード命令の実行時に参照し、ストア命令の実行時に更新するので、ロード/ストア命令の実行回数を、動作回数とする。レジスタ定義表2の場合、実行する命令のソース・レジスタに対応する物理レジスタ番号で参照し、デスティネーション・レジスタに対応する物理レジスタ番号で更新するので、機能ユニット15で実行した命令のソース・レジスタ数とデスティネーション・レジスタ数の和を、動作回数とする。減算器5の場合、時刻からスラックを計算する可能性のある命令、つまり、機能ユニット15で実行した、デスティネーション・レジスタを持つ命令とストア命令の数の和を、動作回数とする。従来機構の比較器については、パイプライン化されたメモリ定義表3及びレジスタ定義表2が存在すると仮定して、各サイクルにおいて、どの命令がどのテーブルの参照/更新を行っているのかをシミュレーションする。そして、同じテーブルに対して参照/更新を行う命令間で、定義時刻のフォワーディングのために必要となる、メモリ・アドレスの比較、あるいは、物理レジスタ番号の比較を行い、その比較回数をそれぞれ、アドレス用比較器、レジスタ番号用比較器の動作回数とする。サイクル時間は0.83nsecを仮定しているので、表4より、メモリ定義表3とレジスタ定義表2はそれぞれ、3段、2段にパイプライン化すると仮定する。   The number of operations of each circuit is measured using the evaluation environment in the previous chapter. Since the conventional mechanism is not incorporated in the simulator used in the previous chapter, the number of operations of each circuit of the conventional mechanism is estimated from the operation of the processor 10. Specifically, in the case of the slack table 20, since it is referred to when fetched and updated when an instruction is executed, the sum of the number of fetched instructions and the number of instructions executed by the functional unit is set as the number of operations. In the case of the memory definition table 3, since it is referenced when a load instruction is executed and updated when a store instruction is executed, the number of executions of the load / store instruction is set as the number of operations. In the case of the register definition table 2, since the physical register number corresponding to the source register of the instruction to be executed is referred to and updated with the physical register number corresponding to the destination register, the source register of the instruction executed by the functional unit 15 The number of operations is the sum of the number and the number of destination registers. In the case of the subtracter 5, the number of operations is the sum of the number of instructions that may calculate slack from the time, that is, the instruction having the destination register and the store instruction executed by the functional unit 15. As for the comparator of the conventional mechanism, it is assumed that the pipelined memory definition table 3 and the register definition table 2 exist, and which instruction references and updates which table in each cycle is simulated. . Then, between instructions that reference / update the same table, the memory address comparison or physical register number comparison required for forwarding at the defined time is performed, and the number of comparisons is assigned to each address. The number of operations of the comparator for register and the comparator for register number. Since the cycle time is assumed to be 0.83 nsec, it is assumed from Table 4 that the memory definition table 3 and the register definition table 2 are pipelined in three stages and two stages, respectively.

1動作あたりの消費エネルギーは、テーブルの場合CACTIを用いて測定する。一方、演算器の場合、前節で示したハードウェア量を基に、どちらの消費エネルギーの方が大きくなるのかを検討する。   In the case of a table, the energy consumption per operation is measured using CACTI. On the other hand, in the case of computing units, we will consider which energy consumption will be larger based on the hardware amount shown in the previous section.

表5に、各回路の動作回数のベンチマーク平均と、テーブルの1動作あたりの消費エネルギーを示す。表5(a)は従来機構の場合を示し、表5(b)は提案機構の場合を示す。   Table 5 shows the benchmark average of the number of operations of each circuit and the energy consumption per operation of the table. Table 5 (a) shows the case of the conventional mechanism, and Table 5 (b) shows the case of the proposed mechanism.

Figure 2007293816
Figure 2007293816

まず、演算器の消費エネルギーを比較する。ここで、演算器の1動作あたりの消費エネルギーは、1回の動作で充放電する負荷容量の平均と、電源電圧の2乗の積で表される。電源電圧は一定である。一方、充放電する負荷容量は、動作時にスイッチしたノードの全容量で表される。この値を正確に求めるためには、演算器を設計し、与えられた入力に対してどのノードがスイッチしたかを調べる必要があり、容易に評価することができない。そこで本節では、比較を簡単に行うために、ハードウェア量が多いほど充放電する負荷容量も増えると仮定する。そして、前節で示したハードウェア量を基に、演算器の1動作あたりの消費エネルギーを比較する。   First, the energy consumption of computing units is compared. Here, the energy consumption per operation of the arithmetic unit is represented by the product of the average of the load capacity charged and discharged in one operation and the square of the power supply voltage. The power supply voltage is constant. On the other hand, the load capacity to be charged / discharged is represented by the total capacity of the node switched during operation. In order to obtain this value accurately, it is necessary to design an arithmetic unit and check which node is switched with respect to a given input, which cannot be easily evaluated. Therefore, in this section, to simplify the comparison, it is assumed that the load capacity for charging / discharging increases as the amount of hardware increases. Then, the energy consumption per operation of the computing unit is compared based on the hardware amount shown in the previous section.

前節より、提案機構の演算器(更新ユニット30)のハードウェア量は、従来機構の減算器よりも十分少ない。そのため、提案機構の演算器を1回動作させるために必要な消費エネルギーも少ないと判定することができる。また、表5より、演算器の動作回数は提案機構の方が少ない。これらより、提案機構の演算器の全消費エネルギーは、従来機構の減算器よりも少なくなると考えられる。   From the previous section, the hardware amount of the calculator (update unit 30) of the proposed mechanism is sufficiently smaller than the subtractor of the conventional mechanism. Therefore, it can be determined that less energy is required to operate the computing unit of the proposed mechanism once. Also, from Table 5, the number of operations of the computing unit is smaller in the proposed mechanism. From these, it is considered that the total energy consumption of the calculator of the proposed mechanism is smaller than that of the subtractor of the conventional mechanism.

さらに、従来機構では、定義時刻のフォワーディングを行う必要がある。具体的には、配線を用いて、比較値(アドレス又はレジスタ番号)と定義時刻をブロードキャストし、比較器を用いて、アドレス比較、又はレジスタ番号比較を行い、比較結果が一致すれば、マルチプレクサ4を介して、対応する定義時刻を減算器5に供給するという操作を行う。そのため、1動作あたりの消費エネルギーは無視できないレベルになると考えられる。また、表5より、アドレスの比較回数とレジスタ番号の比較回数はそれぞれ、27M、488Mと多い。   Further, in the conventional mechanism, it is necessary to perform forwarding at a defined time. Specifically, the comparison value (address or register number) and the definition time are broadcast using wiring, the address comparison or register number comparison is performed using the comparator, and if the comparison results match, the multiplexer 4 Then, an operation of supplying the corresponding definition time to the subtracter 5 is performed. Therefore, the energy consumption per operation is considered to be a level that cannot be ignored. From Table 5, the number of address comparisons and the number of register number comparisons are 27M and 488M, respectively.

これらより、提案機構の演算器の全消費エネルギーは、従来機構の演算器(減算器、比較器、及び、ブロードキャスト用の配線)の全消費エネルギーよりも、かなり少なくなると考えることができる。   From these, it can be considered that the total energy consumption of the calculator of the proposed mechanism is considerably smaller than the total energy consumption of the calculators of the conventional mechanism (subtractor, comparator, and broadcast wiring).

次に、テーブルの消費エネルギーを比較する。役割がほぼ同じであるスラック表20において、1動作あたりの消費エネルギーは、従来機構の方が少なく、動作回数は、提案機構の方が少ないが、スラック表20の全消費エネルギーは、従来機構の方が少なくなる。しかし、テーブル全体の消費エネルギーを合計すると、従来機構の場合1.76J、提案機構の場合1.62Jとなり、提案機構の方が少なくなることが分かる。   Next, the energy consumption of the tables is compared. In the slack table 20 whose roles are almost the same, the energy consumption per operation is smaller in the conventional mechanism and the number of operations is smaller in the proposed mechanism, but the total energy consumption in the slack table 20 is the same as that of the conventional mechanism. Will be less. However, the total energy consumption of the entire table is 1.76 J in the case of the conventional mechanism and 1.62 J in the case of the proposed mechanism, which indicates that the number of the proposed mechanism is smaller.

ここで、CACTIの測定誤差の影響について考える。スラック表20の消費エネルギーには測定誤差があるが、どちらの機構においても消費エネルギーは同程度増加すると考えられるので、スラック表20の比較結果に影響はないといえる。また、測定誤差によってFIFOの消費エネルギーはより大きく見積もられるが、メモリ定義表3とレジスタ定義表2の消費エネルギーに測定誤差は生じない。これらより、テーブル全体の消費エネルギーに与える影響を考えると、発生する測定誤差は、提案機構に対してより不利に働く。従って、提案機構の消費エネルギーの方が小さいという結論は変わらないといえる。   Here, the influence of the measurement error of CACTI is considered. Although there is a measurement error in the energy consumption of the slack table 20, it can be said that the energy consumption of both mechanisms increases to the same extent, so that the comparison result of the slack table 20 is not affected. Further, although the consumed energy of the FIFO is estimated to be larger due to the measurement error, no measurement error occurs in the consumed energy of the memory definition table 3 and the register definition table 2. Therefore, considering the influence on the energy consumption of the entire table, the generated measurement error is more disadvantageous for the proposed mechanism. Therefore, it can be said that the conclusion that the energy consumption of the proposed mechanism is smaller does not change.

以上より、消費エネルギーは、演算器とテーブル、いずれにおいても、従来機構の方が大きくなると考えられる。   From the above, it is considered that the energy consumption of the conventional mechanism is larger in both the calculator and the table.

従来機構のスラック表20は、提案機構よりも消費エネルギーが小さい。そのため、スラック予測精度を低下させることなく、メモリ定義表3とレジスタ定義表2の消費エネルギーを削減することができれば、全テーブルの消費エネルギーを提案機構よりも小さくできる可能性がある。この目的を達成するアプローチとして、回路中で用いられるトランジスタのサイズを小さくし、充放電する負荷容量を減らすという方法が考えられる。この方法では、テーブル構成を変えなくてもよいため、スラック予測精度を低下させることなく、消費エネルギーを削減できる。   The slack table 20 of the conventional mechanism consumes less energy than the proposed mechanism. Therefore, if the energy consumption of the memory definition table 3 and the register definition table 2 can be reduced without reducing the slack prediction accuracy, the energy consumption of all the tables may be made smaller than that of the proposed mechanism. As an approach to achieve this object, a method of reducing the size of the transistor used in the circuit and reducing the load capacity for charging and discharging can be considered. In this method, since it is not necessary to change the table configuration, energy consumption can be reduced without reducing slack prediction accuracy.

しかし、このアプローチでは、トランジスタのサイズを小さくするので、メモリ定義表3とレジスタ定義表2のアクセス時間が長くなってしまう。その結果、これらのテーブルは、パイプライン段数が増加し、定義時刻のフォワーディングに要する消費エネルギーが増加してしまう。このように、高速アクセスに必要となる、定義時刻のフォワーディングは、演算器の消費エネルギーを増大させるだけでなく、上記アプローチによる消費エネルギーの削減も妨げていることが分かる。   However, in this approach, the transistor size is reduced, so that the access time of the memory definition table 3 and the register definition table 2 becomes long. As a result, the number of pipeline stages in these tables increases, and the energy consumption required for forwarding at the defined time increases. Thus, it can be seen that the forwarding at the defined time required for high-speed access not only increases the energy consumption of the computing unit, but also prevents the energy consumption from being reduced by the above approach.

3.4.参照の局所性を利用したテーブル構成の最適化.
前節で用いたテーブル構成は、アクセス時間が非常に長くなるため、予測スラックの利用を困難にするという問題と、定義時刻のフォワーディングに関する消費エネルギーを増加させるという問題を引き起こす。これらの問題を解決するためには、テーブル構成(エントリ数、連想度、ラインサイズ、ポート数)を変更する必要がある。しかし、3.1.節で述べた通り、従来機構において、テーブル構成がスラック予測精度に与える影響は明らかにされていない。そのため、テーブル構成を単純に変化させて、アクセス時間や消費電力を測定することはあまり意味が無い。
3.4. Optimization of table structure using locality of reference.
The table configuration used in the previous section causes a problem of making it difficult to use the predicted slack because the access time becomes very long, and a problem of increasing the energy consumption related to the forwarding at the defined time. In order to solve these problems, it is necessary to change the table configuration (number of entries, association degree, line size, number of ports). However, 3.1. As described in the section, the influence of the table configuration on the slack prediction accuracy is not clarified in the conventional mechanism. Therefore, it does not make much sense to simply change the table configuration and measure the access time and power consumption.

そこで、本節では、前節で用いたテーブル構成に対して、スラック予測精度に与える影響が少ないと考えられる変更のみを行い、アクセス時間と消費電力がどのように改善されるのかを評価する。なお、提案機構のFIFO17は、他のテーブルよりもアクセス時間が十分に短いため、構成は変更しない。   Therefore, in this section, only the changes that are considered to have little effect on slack prediction accuracy are made to the table configuration used in the previous section, and how the access time and power consumption are improved is evaluated. The FIFO 17 of the proposed mechanism does not change the configuration because the access time is sufficiently shorter than other tables.

この目的のために、本発明者は、各テーブルのアクセス・パターンに着目する。まず、スラック表20について、データの参照時と更新時のパターンに分けて考える。スラック表20の参照では、フェッチする命令のプログラム・カウンタ値(PC)をインデクスとして用いる。そのため、命令キャッシュと同様、インデクスとして用いるプログラム・カウンタ値(PC)は、taken(テイクン:「分岐」)と予測した分岐に到達するまで連続しており、参照の局所性が非常に高い。   For this purpose, the inventors pay attention to the access pattern of each table. First, the slack table 20 is considered separately for data reference patterns and update patterns. In referring to the slack table 20, the program counter value (PC) of the instruction to be fetched is used as an index. Therefore, like the instruction cache, the program counter value (PC) used as an index is continuous until the branch predicted as “taken” (taken: “branch”) is reached, and the locality of reference is very high.

一方、スラック表20の更新では、従来機構の場合、機能ユニット15で実行した命令のプログラム・カウンタ値(PC)をインデクスとして用いる。従って、インデクスとして用いるプログラム・カウンタ値(PC)は、アウト・オブ・オーダー実行によって不連続になるものの、順番が入れ替わる範囲はプロセッサ10内の命令に限られるので、依然として参照の局所性は高いといえる。また、提案機構の場合、ROB16からコミットした命令のプログラム・カウンタ値(PC)をインデクスとして用いる。従って、インデクスとして用いるプログラム・カウンタ値(PC)は、taken分岐に到達するまで連続しており、更新の局所性は非常に高い。   On the other hand, in updating the slack table 20, in the case of the conventional mechanism, the program counter value (PC) of the instruction executed by the functional unit 15 is used as an index. Therefore, although the program counter value (PC) used as an index becomes discontinuous due to out-of-order execution, the range in which the order is changed is limited to the instructions in the processor 10, so that the locality of reference is still high. I can say that. In the case of the proposed mechanism, the program counter value (PC) of the instruction committed from the ROB 16 is used as an index. Therefore, the program counter value (PC) used as an index is continuous until reaching the taken branch, and the locality of the update is very high.

以上より、スラック表20においては、スラック予測精度にほとんど影響を与えることなく、ラインサイズを増やすことができると考えられる。ただし、キャッシュと同様、ラインサイズを増やしすぎると、ラインの利用効率が下がり、テーブルのミス率が増加するので、そのことを考慮して、ラインサイズを決定する必要がある。   From the above, in the slack table 20, it is considered that the line size can be increased with little influence on the slack prediction accuracy. However, as with the cache, if the line size is increased too much, the line utilization efficiency decreases and the table miss rate increases. Therefore, it is necessary to determine the line size in consideration of this fact.

さらに、インデクスとして用いるプログラム・カウンタ値(PC)が連続していることを利用し、ライン単位で参照/更新を行うようにすれば、リード・ポートとライト・ポートの削減ができると考えられる。   Furthermore, it is considered that the read port and the write port can be reduced by using the fact that the program counter value (PC) used as an index is continuous and performing the reference / update in line units.

ここで、スラック表20のラインサイズを増やし、1ライン上に2命令分のスラック値を保持した場合、ライン単位で参照/更新を行うと、リード・ポートとライト・ポートがどれだけ削減できるかを考える。本節で想定しているプロセッサ10では、Nfetch=8なので、ライン単位で参照/更新を行うのであれば、ポート数は10本(リード・ポート5本、ライト・ポート5本)まで削減できる。それ以上ポートが存在しても、使用することはできない。また、参照/更新の対象となるスラック値は、必ずしもラインの先頭から順番に並んでいる訳ではないので、ポート数をさらに8本まで減らと、参照/更新に失敗する場合が発生してしまう。これらより、ラインサイズが決まれば、削減できるポート数は一意に決まることが分かる。 Here, if the line size of the slack table 20 is increased and the slack value for two instructions is held on one line, how much the read port and the write port can be reduced by referring / updating in line units. think of. In the processor 10 assumed in this section, since N fetch = 8, the number of ports can be reduced to 10 (5 read ports, 5 write ports) if reference / update is performed in line units. Even if there are more ports, they cannot be used. In addition, since the slack values to be referenced / updated are not necessarily arranged in order from the beginning of the line, if the number of ports is further reduced to 8, the reference / update may fail. . From these, it can be seen that if the line size is determined, the number of ports that can be reduced is uniquely determined.

同様にして、さらにラインサイズを増加させた場合について考えると、1ライン上に4命令分、8命令分のスラック値を保持した場合、ポート数はそれぞれ、6本、4本となることが分かる。ただし、それを超えてラインサイズを増やしても、参照/更新の対象となるスラック値は2つのラインに分かれて存在する可能性があるため、ポート数を4本よりも小さくすることはできない。なお、従来機構の場合、更新時にインデクスとして用いるPCは連続していないので、ライン単位で更新を行ってもライト・ポートの削減はできない。しかし、更新データをバッファに蓄え、そこからフェッチ順に更新して行くという変更を加えれば、比較的容易に更新データの整列ができると考えられる。そこで本節では、従来機構においても、ライト・ポートの削減は可能であると仮定する。   Similarly, when the line size is further increased, it is understood that the number of ports becomes 6 and 4 respectively when the slack values for 4 instructions and 8 instructions are held on one line. . However, even if the line size is increased beyond this, the slack value to be referenced / updated may exist in two lines, so the number of ports cannot be made smaller than four. In the case of the conventional mechanism, since the PCs used as indexes at the time of updating are not continuous, the number of write ports cannot be reduced even if updating is performed in line units. However, it can be considered that update data can be aligned relatively easily if a change is made such that update data is stored in a buffer and then updated in the order of fetching. Therefore, in this section, it is assumed that the number of write ports can be reduced even in the conventional mechanism.

図20は従来技術に係る従来機構のシミュレーション結果であって、ラインサイズに対するスラック長のアクセス時間を示すグラフである。図21は図19の更新ユニット30を備えた提案機構のシミュレーション結果であって、ラインサイズに対するスラック長のアクセス時間を示すグラフである。すなわち、図20及び図21にそれぞれ、従来機構と提案機構において、スラック表20のラインサイズを、2倍(1≦n≦7)に増加させて、アクセス時間を評価した結果を示す。評価にはCACTIを用いる。前節で説明したように、従来機構のスラック表20は、データ・フィールドが4ビットであるため、ラインサイズを増加させない場合、CACTIで評価できない。しかし、上記のようにラインサイズを増加させれば、ラインサイズはバイト単位で増加して行くため、CACTIで評価できるようになる。そこで、本節では、前節とは異なり、データ・フィールドのビット数を変更せずに評価を行う。これにより、前節よりも正確に従来機構と提案機構の比較ができるようになる。 FIG. 20 is a graph showing the result of simulation of the conventional mechanism according to the prior art and showing the access time of the slack length with respect to the line size. FIG. 21 is a graph showing simulation results of the proposed mechanism including the update unit 30 of FIG. 19 and showing the access time of the slack length with respect to the line size. That is, FIG. 20 and FIG. 21 show the results of evaluating the access time by increasing the line size of the slack table 20 by 2 n times (1 ≦ n ≦ 7) in the conventional mechanism and the proposed mechanism, respectively. CACTI is used for evaluation. As described in the previous section, since the data field of the slack table 20 of the conventional mechanism is 4 bits, it cannot be evaluated by CACTI unless the line size is increased. However, if the line size is increased as described above, the line size increases in units of bytes, so that the evaluation can be performed using CACTI. Therefore, in this section, unlike the previous section, evaluation is performed without changing the number of bits in the data field. As a result, the conventional mechanism and the proposed mechanism can be compared more accurately than in the previous section.

図20及び図21の縦軸は、アクセス時間を示し、その横軸はラインサイズを示す。折れ線グラフは、上側がポート数を削減しない場合、下側がポート数を削減する場合である。図20及び図21から分かるように、ポート数を減らすとアクセス時間が短くなることが分かる。一方、アクセス時間は、ラインサイズの増加にともない最初は減少するが、しばらくすると、逆に増加して行くという傾向にあることが分かる。従って、アクセス時間を減らすのであれば、ポート数を減らし、1ライン上に8命令分か16命令分のスラック値を保持すればよいことが分かる。しかし、1ライン上に、16命令分以上のスラック値を保持しても、これらがすべて同時に必要になることはなく、ラインの利用効率が下がる。そこで、本節では、スラック表20のラインサイズを、8命令分のスラック値を保持できるサイズに変更し、ポート数を削減する。具体的には、従来機構の場合4B(Bはバイトであり、以下同様である。)、提案機構の場合8Bとする。この時、いずれの機構においても、ポート数は4本に削減できる。   20 and 21, the vertical axis represents access time, and the horizontal axis represents line size. In the line graph, the upper side does not reduce the number of ports, and the lower side shows a case where the number of ports is reduced. As can be seen from FIGS. 20 and 21, it can be seen that the access time is shortened when the number of ports is reduced. On the other hand, it can be seen that the access time decreases at the beginning as the line size increases, but tends to increase after a while. Therefore, it can be seen that if the access time is reduced, the number of ports should be reduced and a slack value for 8 instructions or 16 instructions may be held on one line. However, even if slack values of 16 instructions or more are held on one line, they are not all required at the same time, and the line utilization efficiency is lowered. Therefore, in this section, the line size in the slack table 20 is changed to a size that can hold the slack value for 8 instructions, and the number of ports is reduced. Specifically, it is 4B in the case of the conventional mechanism (B is a byte, the same applies hereinafter), and is 8B in the case of the proposed mechanism. At this time, in any mechanism, the number of ports can be reduced to four.

次に、メモリ定義表3について考える。メモリ定義表3は、ロード・アドレスとストア・アドレスをインデクスとしてそれぞれ、参照して更新を行う。従って、データキャッシュと同様、参照の局所性が高いといえる。そのため、スラック予測精度にほとんど影響を与えることなく、ラインサイズを増やすことができると考えられる。ただし、先程と同様、ラインサイズを増やしすぎないようにする必要がある。   Next, consider the memory definition table 3. The memory definition table 3 is updated by referring to the load address and the store address as indexes. Therefore, like the data cache, it can be said that the locality of reference is high. Therefore, it is considered that the line size can be increased with little influence on the slack prediction accuracy. However, as before, it is necessary not to increase the line size too much.

図22は図19の更新ユニット30を備えた提案機構のシミュレーション結果であって、ラインサイズに対するメモリ定義表のアクセス時間を示すグラフである。すなわち、図22に、メモリ定義表3のラインサイズを変化させて、アクセス時間を評価した結果を示す。図22の縦軸はアクセス時間を示し、図22の横軸はラインサイズを示す。図22から分かるように、アクセス時間は、ラインサイズの増加に伴い減少するが、28Bの時点で減少しなくなり、112B以上では増加してしまうことが分かる。従って、アクセス時間を減らすのであれば、56Bを超えないようにラインサイズを増やせばよいことが分かる。   FIG. 22 is a graph showing a simulation result of the proposed mechanism including the update unit 30 of FIG. 19 and showing the access time of the memory definition table with respect to the line size. That is, FIG. 22 shows the result of evaluating the access time by changing the line size of the memory definition table 3. The vertical axis in FIG. 22 indicates access time, and the horizontal axis in FIG. 22 indicates line size. As can be seen from FIG. 22, the access time decreases as the line size increases, but does not decrease at 28B, and increases at 112B or higher. Therefore, it can be seen that if the access time is reduced, the line size should be increased so as not to exceed 56B.

しかし、ラインサイズを増やしすぎると、ラインの利用効率が下がり、テーブルのミス率が増加してしまう可能性がある。非特許文献7によれば、容量が1K〜256KBのデータキャッシュにおいて、ラインサイズを16Bから256Bまで増加させていった場合、32Bまでであれば、どの容量においても、キャッシュ・ミス率が低下して行くことが示されている。この場合、最小のブロックは4Bなので、ラインサイズが32Bの場合、1ライン上に8ブロック分のデータを保持することを意味する。ベンチマーク等の評価環境が異なるが、本節では、この結果を参考に、テーブルのミス率を増加させないラインサイズの範囲を仮定する。具体的には、メモリ定義表3では、最小のブロックは7B(PC+定義時刻)なので、56B以下のラインサイズであれば、テーブルのミス率は増加しないと仮定する。以上より、本節では、メモリ定義表3のラインサイズを56Bに変更する。   However, if the line size is increased too much, the line utilization efficiency decreases, and the table error rate may increase. According to Non-Patent Document 7, when the line size is increased from 16B to 256B in a data cache having a capacity of 1K to 256KB, the cache miss rate decreases at any capacity up to 32B. It is shown to go. In this case, since the minimum block is 4B, when the line size is 32B, it means that data for 8 blocks is held on one line. Although the evaluation environment such as the benchmark is different, this section assumes the line size range that does not increase the table miss rate, referring to this result. Specifically, in the memory definition table 3, since the smallest block is 7B (PC + definition time), it is assumed that the table miss rate does not increase if the line size is 56B or less. As described above, in this section, the line size of the memory definition table 3 is changed to 56B.

最後に、レジスタ定義表2について考える。レジスタ定義表2は、命令に割り当てられた物理レジスタ番号をインデクスとして、命令の実行直前に参照し更新する。従って、スラック表20や、メモリ定義表3のような参照の局所性はない。そのため、本節では、レジスタ定義表2の構成は変更しない。   Finally, consider register definition table 2. The register definition table 2 is updated by referring to the physical register number assigned to the instruction as an index immediately before execution of the instruction. Therefore, there is no locality of reference like the slack table 20 and the memory definition table 3. Therefore, in this section, the configuration of the register definition table 2 is not changed.

表6に、参照の局所性に着目して、テーブル構成を最適化した場合の、アクセス時間と1動作あたりの消費エネルギーを示す。なお、本節では、CACTIで評価する際に、前節で行ったようなデータ・フィールドのビット数の変更を行う必要がない。そこで、そのような変更を行わなかった場合のFIFO17についても、アクセス時間と1動作あたりの消費エネルギーを示す。   Table 6 shows the access time and energy consumption per operation when the table configuration is optimized focusing on the locality of reference. In this section, it is not necessary to change the number of bits of the data field as in the previous section when evaluating with CACTI. Therefore, the access time and energy consumption per operation are also shown for the FIFO 17 when such a change is not made.

Figure 2007293816
Figure 2007293816

表6より、従来機構と提案機構のスラック表は、どちらも、アクセス時間が大幅に減少し、仮定しているサイクル時間0.83nsecと非常に近い値となることが分かる。これにより、パイプライン段数は、従来機構の場合1段に、提案機構の場合2段に減少するので、フェッチした命令のスラック値を利用することは十分可能になる。また、メモリ定義表のアクセス時間が減少し、パイプライン段数が3段から2段になる。これにより、アドレス用比較器の数が段数分減少し、この比較器を動作させる回数が27Mから13Mに減少する。しかし、依然として定義時刻のフォワーディングは必要であり、演算器の全消費エネルギーは、従来機構の方が大きくなる。また、表6より、スラック表20とメモリ定義表3のどちらにおいても、1動作あたりの消費エネルギーが削減されていることが分かる。   From Table 6, it can be seen that both the slack tables of the conventional mechanism and the proposed mechanism have a significantly reduced access time, which is very close to the assumed cycle time of 0.83 nsec. As a result, the number of pipeline stages is reduced to one in the case of the conventional mechanism and to two in the case of the proposed mechanism, so that the slack value of the fetched instruction can be used sufficiently. Also, the access time of the memory definition table is reduced, and the number of pipeline stages is changed from three to two. As a result, the number of address comparators is reduced by the number of stages, and the number of times this comparator is operated is reduced from 27M to 13M. However, forwarding at the defined time is still necessary, and the total energy consumption of the arithmetic unit is larger in the conventional mechanism. Table 6 also shows that the energy consumption per operation is reduced in both the slack table 20 and the memory definition table 3.

次に、スラック予測機構全体のアクセス時間と消費エネルギーについて考える。表4及び表6より、スラック表20のアクセス時間が減少したことによって、従来機構のアクセス時間の方が、提案機構よりも長くなったことが分かる。   Next, consider the access time and energy consumption of the overall slack prediction mechanism. From Tables 4 and 6, it can be seen that the access time of the conventional mechanism is longer than that of the proposed mechanism because the access time of the slack table 20 is reduced.

表5及び表6を用いて、テーブル構成を最適化した後の消費エネルギーを計算する。なお、スラック表20には、ライン単位で参照/更新を行い、ポート数を4分の1にするという変更が加えられているので、スラック表の動作回数は、表5に示された値の4分の1になると仮定して計算を行う。計算の結果、テーブル全体の消費エネルギーは、従来機構の場合0.37J、提案機構の場合0.06Jとなり、どちらも大幅に減少していることが分かる。なお、前節と同様、スラック表20の消費エネルギーは従来機構の方が小さくなり、テーブル全体の消費エネルギーは提案機構の方が小さくなる。   Using Tables 5 and 6, the energy consumption after the table configuration is optimized is calculated. Note that the slack table 20 has been changed so that the number of ports is reduced to 1/4 by referring / updating on a line basis, so the number of operations of the slack table is equal to the value shown in Table 5. The calculation is performed assuming that it is 1/4. As a result of calculation, the energy consumption of the entire table is 0.37 J in the case of the conventional mechanism and 0.06 J in the case of the proposed mechanism, and it can be seen that both are greatly reduced. As in the previous section, the energy consumption of the slack table 20 is smaller in the conventional mechanism, and the energy consumption of the entire table is smaller in the proposed mechanism.

以上より、参照の局所性を利用して、テーブル構成を最適化することで、スラック表20のアクセス時間に関する問題は解決できることが分かる。また、スラック予測機構の消費エネルギーを大幅に削減できることが分かる。   From the above, it can be seen that the problem related to the access time of the slack table 20 can be solved by optimizing the table configuration using the locality of reference. Moreover, it turns out that the energy consumption of a slack prediction mechanism can be reduced significantly.

4.機能ユニットの消費電力の削減.
ローカル・スラック予測の応用例として、予測スラックが1以上ある命令を、より低速でより消費電力の低い機能ユニットで実行することで、性能を大きく低下させることなく機能ユニットの低消費電力化をはかる研究が行われている(例えば、非特許文献6参照。)。そこで、本実施形態においても、上記の低消費電力化を応用例として取り上げ、提案手法の効果を評価する。
4). Reduction of power consumption of functional units.
As an application example of local slack prediction, an instruction having one or more predicted slacks is executed by a functional unit that is slower and consumes less power, thereby reducing the power consumption of the functional unit without greatly degrading the performance. Research has been carried out (for example, see Non-Patent Document 6). Therefore, also in this embodiment, the reduction in power consumption is taken as an application example, and the effect of the proposed method is evaluated.

4.1.評価環境.
2章で述べた評価環境との違いについて述べる。図23は本発明の第1の実施形態の第1の変形例に係る、スラック表20を備えたプロセッサ10Aの構成を示すブロック図である。
4.1. Evaluation environment.
The differences from the evaluation environment described in Chapter 2 are described. FIG. 23 is a block diagram showing a configuration of a processor 10A having a slack table 20 according to a first modification of the first embodiment of the present invention.

整数演算用の機能ユニット(iALU)として、高速なものと低速なものを2種類用意する。図23において、15aは高速で動作する機能ユニットであり、15bは低速で動作する機能ユニットである。非特許文献9によると、0.13μmプロセスにおけるARMコアは、動作周波数が1.2GHz、600MHzの場合、電源電圧がそれぞれ、1.1V、0.7Vであることが示されている。これを基に、プロセッサの動作周波数を1.2GHz(サイクル時間0.83nsec)とし、高速なiALUと低速なiALUは、実行レイテンシがそれぞれ1サイクル、2サイクル、電源電圧がそれぞれ1.1V、0.7Vとする。評価では、高速なiALUをn個持つモデルを、(nf,(6−n)s)モデルと呼ぶこととする。   Two types of function units (iALU) for integer operations are prepared, high speed and low speed. In FIG. 23, 15a is a functional unit that operates at a high speed, and 15b is a functional unit that operates at a low speed. Non-Patent Document 9 shows that the ARM core in the 0.13 μm process has a power supply voltage of 1.1 V and 0.7 V, respectively, when the operating frequency is 1.2 GHz and 600 MHz. Based on this, the operating frequency of the processor is 1.2 GHz (cycle time 0.83 nsec), and the high-speed iALU and the low-speed iALU have an execution latency of 1 cycle and 2 cycles, respectively, and the power supply voltage is 1.1 V and 0, respectively. .7V. In the evaluation, a model having n high-speed iALUs is referred to as an (nf, (6-n) s) model.

提案手法を用いてローカル・スラックを予測する。従来手法に近い条件で評価を行うため、予測スラックの最大値Vmax=1、しきい値Cth=15とし、スラック表20のパラメータをすべて固定する。命令スケジューラが、オペランドの揃った命令から、iALUで実行する命令を選択した後、選択した命令において、予測スラックが1である命令を低速なiALUに、予測スラックが0である命令を高速なiALUに割り当てる。ただし、低速なiALUに空きがなければ高速なiALUに、高速なiALUに空きがなければ低速なiALUに命令を割り当てる。予測スラックは、命令をiALUに割り当てるときにのみ利用し、その他の処理では利用しない。例えば、命令スケジューラが、iALUで実行する命令を選択する際に、予測スラックを利用することはない。また、命令をiALUに割り当てる順番は、命令スケジューラが命令を選択した順番に従っており、予測スラックを利用することはない。   Predict local slack using the proposed method. In order to perform the evaluation under conditions close to those of the conventional method, the maximum value of predicted slack Vmax = 1 and the threshold value Cth = 15, and all parameters of the slack table 20 are fixed. After the instruction scheduler selects an instruction to be executed by the iALU from the instructions having the operands, the instruction having a predicted slack of 1 is selected as a low-speed iALU and the instruction having a predicted slack of 0 is selected as a high-speed iALU. Assign to. However, an instruction is assigned to a high-speed iALU if there is no free space in the low-speed iALU, and to a low-speed iALU if there is no free space in the high-speed iALU. Predictive slack is used only when an instruction is assigned to an iALU, and is not used in other processes. For example, the instruction scheduler does not use predicted slack when selecting an instruction to be executed by an iALU. Also, the order in which instructions are assigned to iALUs is in accordance with the order in which instructions are selected by the instruction scheduler, and predicted slack is not used.

上記の手法では、低速なiALUで命令を実行することで、iALUの消費エネルギーを削減する。しかし、予測スラックが実スラックを上回っている場合は、プロセッサ性能に悪影響を与えてしまう。プロセッサ10において、性能は非常に重要な要素である。そこで、消費エネルギー削減効果と、プロセッサ性能への悪影響を同時に考慮できる指標として、消費エネルギーと、プロセッサの実行時間の積(EDP:Energy Delay Product)を測定する。   In the above method, the energy consumption of the iALU is reduced by executing the instruction with the low-speed iALU. However, if the predicted slack exceeds the actual slack, the processor performance is adversely affected. In the processor 10, performance is a very important factor. Therefore, the product of energy consumption and processor execution time (EDP: Energy Delay Product) is measured as an index that can simultaneously consider the effect of reducing energy consumption and adverse effects on processor performance.

プロセッサ10の実行時間は、実行サイクル数とサイクル時間(動作周波数の逆数)の積で表すことができる。一方、機能ユニット15a,15bの消費エネルギーは、iALUで命令を実行した回数と、1実行あたりの消費エネルギーの積で表すことができる。1実行あたりの消費エネルギーは、1回の実行で充放電する負荷容量の平均と、電源電圧の2乗の積で表すことができる。従って、EDPは、次式(1)で表される。   The execution time of the processor 10 can be represented by the product of the number of execution cycles and the cycle time (reciprocal of the operating frequency). On the other hand, the energy consumption of the functional units 15a and 15b can be represented by the product of the number of times an instruction is executed by iALU and the energy consumption per execution. The energy consumption per execution can be expressed by the product of the average of the load capacity charged and discharged in one execution and the square of the power supply voltage. Therefore, EDP is expressed by the following equation (1).

[数1]
EDP=(C・V ・N+C・V ・N)・N/f (1)
[Equation 1]
EDP = (C f · V f 2 · N f + C s · V s 2 · N s) · N c / f (1)

ここで、C、Cはそれぞれ、高速なiALU、低速なiALUにおいて、1実行あたりに充放電される負荷容量である。V、Vはそれぞれ、高速なiALU、低速なiALUの電源電圧である。N、Nはそれぞれ、高速なiALU、低速なiALUにおいて命令を実行した回数であり、Ncは実行サイクル数である。fは動作周波数である。 Here, C f and C s are load capacities that are charged and discharged per execution in the high-speed iALU and the low-speed iALU, respectively. V f and V s are the power supply voltages of the fast iALU and the slow iALU, respectively. N f and N s are the number of times instructions are executed in the high-speed iALU and low-speed iALU, respectively, and Nc is the number of execution cycles. f is the operating frequency.

パラメータVf、Vs、fは先程仮定した値を用いる。パラメータN、N、Nは、シミュレーションによって求める。高速なiALUと低速なiALUは、動作周波数と電源電圧が異なるが、実行できる命令の種類は同じである。そこで本節では、ある動的命令をどちらのiALUで実行したとしても、その命令の実行を完了するまでに充放電する負荷容量(動作時にスイッチするノードの全容量)は同じであると仮定し、C=Cとする。 As the parameters Vf, Vs, f, values assumed previously are used. The parameters N f , N s , and N c are obtained by simulation. The high-speed iALU and the low-speed iALU have different operating frequencies and power supply voltages, but the types of instructions that can be executed are the same. Therefore, in this section, it is assumed that, regardless of which iALU a dynamic instruction is executed, the load capacity (the total capacity of nodes that are switched during operation) to be charged and discharged until the execution of the instruction is completed is the same. Let C f = C s .

なお、厳密には、回路中でスイッチするノードは、演算の種類(加算、シフト等)や入力値に依存するため、これらが異なると、1回の実行で充放電する負荷容量も変わる。この値を正確に求めるためには、演算器を設計し、与えられた入力に対してどのノードがスイッチしたかを調べる必要があり、容易ではない。そのため、本節の評価では、演算の種類や入力値の違いで発生する負荷容量の変化は考慮しない。   Strictly speaking, since the node to be switched in the circuit depends on the type of operation (addition, shift, etc.) and the input value, if these are different, the load capacity to be charged / discharged in one execution changes. In order to accurately obtain this value, it is necessary to design an arithmetic unit and check which node has switched for a given input, which is not easy. For this reason, the evaluation in this section does not consider changes in load capacity that occur due to differences in the types of calculations and input values.

4.2.評価結果
図24は図23のプロセッサ10Aの実施例のシミュレーション結果であって、各プログラムに対する正規化されたIPCを示すグラフである。図25は図23のプロセッサ10Aの実施例のシミュレーション結果であって、各プログラムに対する正規化されたEDP(Energy Delay Product:消費エネルギーと、プロセッサ10Aの実行時間の積)を示すグラフである。すなわち、図24及び図25にそれぞれ、各ベンチマークのIPCとEDPを示す。6本で組になっている棒グラフは、左から順に、(5f/1s)、(4f/2s)、(3f/3s)、(2f/4s)、(1f/5s)、(0f/6s)モデルの場合である。図24の縦軸は(6f/0s)モデル(すべてのiALUが高速なモデル)のIPCで正規化したIPCを示し、図25の縦軸は、(6f/0s)モデルのEDPで正規化したEDPを示す。
4.2. Evaluation Results FIG. 24 is a graph showing simulation results of the embodiment of the processor 10A of FIG. 23 and showing normalized IPC for each program. FIG. 25 is a graph showing simulation results of the embodiment of the processor 10A of FIG. 23 and showing normalized EDP (Energy Delay Product: product of consumed energy and execution time of the processor 10A) for each program. That is, FIG. 24 and FIG. 25 show IPC and EDP of each benchmark, respectively. The bar graphs made up of six lines are (5f / 1s), (4f / 2s), (3f / 3s), (2f / 4s), (1f / 5s), (0f / 6s) in order from the left. This is the case with a model. The vertical axis of FIG. 24 shows the IPC normalized by the IPC of the (6f / 0s) model (a model in which all iALUs are high-speed), and the vertical axis of FIG. 25 is normalized by the EDP of the (6f / 0s) model. EDP is shown.

図24及び図25より、どのベンチマークにおいても、ほぼ同様の傾向を示すことが分かる。高速なiALUの数を減少させると、ほとんどの場合、EDPは単調に減少して行く。しかし、提案手法は予測スラックに基づいて命令をスケジューリングするため、IPCの減少を抑制できている。(0f/6s)モデル(すべてのiALUが低速なモデル)は、平均でIPCの低下が20.2%、EDPの削減率が41.6%となる。これに対し、(1f/5s)モデルは、EDPの削減率が34.5%もあるにも関わらず、IPCの低下を10.5%まで改善することができる。また、(3f/3s)モデルは、IPCの低下がわずか3.8%であるにも関わらず、EDPの削減率が20.3%にもなる。   From FIG. 24 and FIG. 25, it is understood that almost the same tendency is shown in any benchmark. When the number of fast iALUs is reduced, in most cases the EDP decreases monotonically. However, since the proposed method schedules instructions based on the predicted slack, it can suppress the decrease in IPC. In the (0f / 6s) model (a model in which all iALUs are low speed), the IPC reduction is 20.2% and the EDP reduction rate is 41.6% on average. On the other hand, the (1f / 5s) model can improve the IPC reduction to 10.5% despite the EDP reduction rate of 34.5%. In addition, the (3f / 3s) model has an EDP reduction rate of 20.3% even though the IPC reduction is only 3.8%.

非特許文献6では、本実施形態とはベンチマーク・プログラムやプロセッサ構成が異なるものの、スラック予測機構として従来手法を用いて、(3f/3s)モデルを評価している。その結果、4.5%のIPCの低下で、19%のEDPを削減できることを示している。これより、提案手法は、従来手法と同様の結果を示すことが分かる。   In Non-Patent Document 6, although a benchmark program and a processor configuration are different from the present embodiment, a (3f / 3s) model is evaluated using a conventional method as a slack prediction mechanism. As a result, it is shown that EDP can be reduced by 19% with a decrease in IPC of 4.5%. From this, it can be seen that the proposed method shows the same result as the conventional method.

以上の評価では、機能ユニットの消費電力にのみ着目している。スラック表の消費電力も考慮すると、プロセッサ全体の消費電力は低下しない可能性が十分あり、今後の課題である。しかし、現状においても、機能ユニットの消費電力を抑えることで、チップ上のホットスポットを削減できるという効果が得られると考える。   The above evaluation focuses only on the power consumption of the functional unit. Considering the power consumption of the slack table, there is a possibility that the power consumption of the entire processor will not decrease, which is a future issue. However, even in the present situation, it is considered that the effect of reducing hot spots on the chip can be obtained by suppressing the power consumption of the functional unit.

4.3.予測スラックの最大値Vmaxを2以上とした場合の応用例.
前節で評価した応用例では、各命令を実行する際の緊急度を3種類以上に分ける事ができるというスラックの利点が活かされていない。そこで、提案するスラック予測機構において、予測スラックの最大値Vmaxを2以上とした場合の応用例を示す。
4.3. Application example when the maximum value Vmax of predicted slack is 2 or more.
In the application example evaluated in the previous section, the advantage of slack that the degree of urgency when executing each instruction can be divided into three or more types is not utilized. Therefore, an application example in the case where the maximum value Vmax of predicted slack is 2 or more in the proposed slack prediction mechanism will be described.

応用例として、機能ユニットの低消費電力化を行ったプロセッサの性能低下を抑制することが考えられる。例えば、予測スラックの最大値Vmax=2とした(3f/3s)モデルにおいて、命令スケジューラが選択した命令を以下のようにiALUに割り当てる。まず、予測スラックが0である命令を高速なiALUに割り当てる。高速なiALUに空きがない場合は、低速なiALUに割り当てる。次に、予測スラックが2である命令を低速なiALUに割り当てる。低速なiALUに空きがない場合は、高速なiALUに割り当てる。最後に、予測スラックが1である命令を低速なiALUに割り当てる。低速なiALUに空きがない場合は、高速なiALUに割り当てる。これにより、予測スラックが1、あるいは、2である命令の総数が、低速なiALUの数を上回った場合に、緊急度がより高い(予測スラックが1である)命令を優先的に高速なiALUに割り当てることができる。   As an application example, it is conceivable to suppress a decrease in performance of a processor that has reduced power consumption of a functional unit. For example, in the (3f / 3s) model with the maximum predicted slack value Vmax = 2, the instruction selected by the instruction scheduler is assigned to the iALU as follows. First, an instruction whose predicted slack is 0 is assigned to a high-speed iALU. If there is no space in the high-speed iALU, it is assigned to the low-speed iALU. Next, an instruction with a predicted slack of 2 is assigned to a slow iALU. If the low-speed iALU has no free space, it is assigned to the high-speed iALU. Finally, an instruction with a predicted slack of 1 is assigned to a slow iALU. If the low-speed iALU has no free space, it is assigned to the high-speed iALU. As a result, when the total number of instructions with predicted slack of 1 or 2 exceeds the number of low-speed iALUs, instructions with higher urgency (predicted slack of 1) are preferentially fast iALU. Can be assigned to.

上記以外にも、予測スラックを基に命令スケジューリングを行い、性能向上をはかるという応用例が考えられる。例えば、Vmax=2とした(3f/3s)モデルにおいて、命令スケジューラに次の修正を加える。すなわち、オペランドの揃った命令から、予測スラックの小さい順に命令を選択し、選択しなかった命令の予測スラックが1か2であれば、それを1だけ減らす。なお、選択されなかった命令の予測スラックを1だけ減らすのは、選択されないことで、その命令の実行開始が1サイクル遅れるからである。この修正により、予測スラックがnである命令の代わりに、予測スラックがn+1以上である命令を選択してしまうということがなくなる。その結果、緊急度に応じた順番で、命令を実行できるようになるため、低消費電力化による性能低下を緩和できる可能性がある。   In addition to the above, an application example in which instruction scheduling is performed based on predicted slack to improve performance can be considered. For example, in the (3f / 3s) model with Vmax = 2, the following modification is added to the instruction scheduler. In other words, instructions are selected in ascending order of predicted slack from the instructions with the same operand, and if the predicted slack of the instruction not selected is 1 or 2, it is reduced by 1. The reason why the predicted slack of the instruction that has not been selected is reduced by 1 is because the execution start of the instruction is delayed by one cycle because it is not selected. With this modification, an instruction with predicted slack of n + 1 or more is not selected instead of an instruction with predicted slack of n. As a result, instructions can be executed in the order according to the degree of urgency, which may reduce performance degradation due to low power consumption.

5.まとめ.
今回、本発明者は発見的手法によってスラックを予測する機構を提案した。命令の振る舞いから間接的にスラックを予測するため、従来手法に対しより単純なハードウェアで実現できる。評価の結果、スラック表の信頼性のしきい値が15の場合、わずか2.5%のIPC低下で、31.6%の命令について実行レイテンシを1サイクル増加させることができると分かった。また、機能ユニットの低消費電力化を行った場合、わずか3.8%のIPC低下で、EDPを20.3%削減できることが分かった。
5). Summary.
The present inventor has proposed a mechanism for predicting slack by a heuristic technique. Since slack is indirectly estimated from the behavior of instructions, it can be realized with simpler hardware than conventional methods. As a result of the evaluation, it was found that when the reliability threshold value of the slack table is 15, the execution latency can be increased by one cycle for 31.6% of the instructions with a decrease of IPC of only 2.5%. Further, it was found that when the power consumption of the functional unit is reduced, the EDP can be reduced by 20.3% with an IPC reduction of only 3.8%.

6.別の実施例のシミュレーション結果
さらに、別の実施例のシミュレーション結果について以下に説明する。
6). Simulation Results of Another Example Further, simulation results of another example will be described below.

図26は図23のプロセッサ10Aの別の実施例のシミュレーション結果であって、各プログラムに対する正規化されたIPCを示すグラフである。図27は図23のプロセッサ10Aの別の実施例のシミュレーション結果であって、各プログラムに対する正規化されたEDP(Energy Delay Product:消費エネルギーと、プロセッサの実行時間の積)を示すグラフである。すなわち、図26及び図27に、各モデルでの各ベンチマークでの正規化IPC及び正規化EDPの測定結果を示す。図26の縦軸は、(6f,0s)モデル(全iALUが高速なモデル)でのIPCを基準(100)としたIPCの比率を、図27の縦軸は、同じく(6f,0s)モデル(全iALUが高速なモデル)でのEDPを基準(100)としたEDPの比率をそれぞれ示している。また、図26及び図27における各ベンチマーク・プログラムにおける6本組の縦棒は、図中左側から(5f,1s),(4f,2s),(3f,3s),(2f,4s),(1f,5s),(0f,6s)の各モデルでの測定結果をそれぞれ表すものとなっている。   FIG. 26 is a graph showing simulation results of another embodiment of the processor 10A of FIG. 23 and showing normalized IPC for each program. FIG. 27 is a graph showing simulation results of another example of the processor 10A of FIG. 23 and showing normalized EDP (Energy Delay Product: product of consumed energy and processor execution time) for each program. That is, FIG. 26 and FIG. 27 show the measurement results of normalized IPC and normalized EDP in each benchmark in each model. The vertical axis in FIG. 26 represents the ratio of IPCs based on the IPC in the (6f, 0s) model (all iALU is a high-speed model) as the reference (100), and the vertical axis in FIG. The ratio of EDP with EDP as a reference (100) in (all iALU is a high-speed model) is shown. 26 and 27, the six vertical bars in each benchmark program are (5f, 1s), (4f, 2s), (3f, 3s), (2f, 4s), ( 1f, 5s) and (0f, 6s), the measurement results for the respective models are shown.

図26及び図27に示されるように、いずれのベンチマーク・プログラムでも、同様の傾向が見られる。すなわち、高速なiALUの数を減少させると、ほとんどの場合、EDPは単調に減少してゆくようになる。ただし、ローカル・スラックの予測結果に基づいて命令の振り分けを行ったことで、高速なiALUの数の減少に伴うIPCの低下は好適に抑制されている。例えば(0f,6s)モデル、すなわち全iALUが低速なモデルでは、ベンチマーク平均のIPCの低下が20.2%、EDPの削減率は41.6%となっている。これに対して(1f,6s)モデルでは、EDPの削減率が34.5%もあるにも拘わらず、IPCの低下は10.5%に留まっている。さらに(3f,3s)モデルでは、IPCの低下をわずか3.8%としながらも、EDPの削減率は20.3%にもなる。   As shown in FIGS. 26 and 27, the same tendency can be seen in any of the benchmark programs. That is, when the number of high-speed iALUs is decreased, in most cases, EDP decreases monotonously. However, since the instructions are distributed based on the prediction result of local slack, the decrease in IPC accompanying the decrease in the number of high-speed iALUs is suitably suppressed. For example, in the (0f, 6s) model, that is, a model in which all iALUs are low speed, the benchmark average IPC decrease is 20.2%, and the EDP reduction rate is 41.6%. On the other hand, in the (1f, 6s) model, although the EDP reduction rate is 34.5%, the decrease in IPC is only 10.5%. Furthermore, in the (3f, 3s) model, the reduction rate of EDP is 20.3% while the decrease in IPC is only 3.8%.

なお、上記評価では、機能ユニット15の消費電力のみに着目しており、スラック表20の動作に要する消費電力については全く考慮していないため、プロセッサ全体の消費電力の削減効果は上記の結果よりは低くなる。ただし、スラック表20の動作に要する消費電力を十分に低く抑えることさえできれば、プロセッサ全体の消費電力の削減にも十分な効果を期待することができる。最も、機能ユニット15はチップ上における代表的なホットスポットの一つであり、たとえプロセッサ全体の消費電力の削減が適わずとも、機能ユニットの消費電力が抑えられれば、チップ上のホットスポットの分散させることができるという効果は得ることができる。   In the above evaluation, only the power consumption of the functional unit 15 is focused, and the power consumption required for the operation of the slack table 20 is not considered at all. Therefore, the effect of reducing the power consumption of the entire processor is based on the above result. Becomes lower. However, as long as the power consumption required for the operation of the slack table 20 can be kept sufficiently low, a sufficient effect can be expected for reducing the power consumption of the entire processor. However, the functional unit 15 is one of the typical hot spots on the chip. Even if the power consumption of the entire processor is not suitable, if the power consumption of the functional unit can be suppressed, the distribution of hot spots on the chip is possible. The effect that it can be made can be acquired.

なお、本実施形態のローカル・スラック予測機構では、フェッチ・ユニット11は、上記実行レイテンシ設定手段としての機能も兼ねている。またスラック表20(厳密にはそのエントリの更新に係る動作回路)が、上記推定手段及び予測スラック更新手段としての機能も兼ね備えるようにしている。   In the local slack prediction mechanism of this embodiment, the fetch unit 11 also functions as the execution latency setting unit. In addition, the slack table 20 (strictly, the operation circuit related to the update of the entry) also has the functions as the estimation means and the predicted slack update means.

以上説明した本実施形態のローカル・スラックの予測方法、及びローカル・スラック予測機構によれば、次の効果を奏することができる。
(1)予測スラックを計算で直接的に求めるのではなく、命令の実行時の振る舞いを観測しながら、ターゲット・スラックに到達するまで予測スラックを徐々に増加させることで求めているため、予測スラックの直接演算に要する複雑な機構は不要であり、より簡易な構成でローカル・スラックの予測を行うことができる。
(2)プロセッサが元より備える検出機構で検出可能な上記条件(A)〜(D)の命令実行時の振る舞いをローカル・スラック到達条件としたため、ローカル・スラック予測のために格別な検出機構を追加設置せずとも、予測スラックのターゲット・スラックへの到達を確認することができる。
(3)ターゲット・スラック到達条件の成立をもって、予測スラックを減少させるようにしているため、予測スラックの過剰評価による後続命令の実行遅延の発生を好適に抑制することができる。
(4)信頼性カウンタを設置し、予測スラックの増加は慎重に、減少は迅速に行うようにしているため、ターゲット・スラックが頻繁に増減を繰り返す場合にも、予測スラックの過剰評価による後続命令の実行遅延が発生する頻度を低く抑えることができる。
According to the local slack prediction method and local slack prediction mechanism of the present embodiment described above, the following effects can be obtained.
(1) Predicted slack is not calculated directly by calculation, but is calculated by gradually increasing the predicted slack until the target slack is reached while observing the behavior during execution of the instruction. The complicated mechanism required for the direct calculation is not required, and local slack can be predicted with a simpler configuration.
(2) Since the behavior at the time of instruction execution of the above conditions (A) to (D) that can be detected by the detection mechanism provided by the processor is the local slack arrival condition, a special detection mechanism is provided for local slack prediction. Even without additional installation, the arrival of the predicted slack to the target slack can be confirmed.
(3) Since the predicted slack is reduced when the target slack arrival condition is satisfied, it is possible to suitably suppress the execution delay of the subsequent instruction due to the excessive evaluation of the predicted slack.
(4) Since a reliability counter is installed and the predicted slack is carefully increased and decreased rapidly, the subsequent instruction due to overestimation of the predicted slack even when the target slack repeatedly increases and decreases The frequency of occurrence of execution delay can be kept low.

7.スラック表のインデクス手法の拡張
次いで、上記ローカル・スラックの予測方法、及び予測機構の更なる機能の拡張について説明する。プログラム内の分岐命令の振る舞いは多くの場合、その分岐を実行するまでに、どのような関数や命令を実行してきたか(以下、制御フローという。)に依存する。この性質を利用して、分岐命令の結果をより高い精度で予測する手法が提案されている。従来、こうした分岐予測手法は、命令の投機実行の精度向上に利用されているが、ローカル・スラックの予測においても、同様の原理を導入することで、予測精度の更なる向上を期待できる。以下、制御フローを考慮して、スラック予測をさらに精度良く行う手法について説明する。
7). Extension of Slack Table Indexing Method Next, the local slack prediction method and the extension of further functions of the prediction mechanism will be described. In many cases, the behavior of a branch instruction in a program depends on what function or instruction has been executed (hereinafter referred to as a control flow) before the branch is executed. A technique for predicting the result of a branch instruction with higher accuracy using this property has been proposed. Conventionally, such a branch prediction method has been used to improve the accuracy of speculative execution of instructions. However, in the prediction of local slack, further improvement of the prediction accuracy can be expected by introducing the same principle. Hereinafter, a method for performing slack prediction with higher accuracy in consideration of the control flow will be described.

プログラムは、分岐命令を用いて、どのような関数や命令を実行するのかを決定しているため、プログラム中の分岐条件に着目することで制御フローを単純化することが可能である。具体的には、分岐条件が成立したなら「1」、成立しなかったら「0」として、プログラム中の分岐条件の成立、不成立の履歴(分岐履歴)を記録する。例えば分岐条件がフェッチ順に、成立(1)→成立(1)→不成立(0)→成立(1)であったときの分岐履歴は、新しいもの程下位に記録した場合に「1101」と表される。分岐履歴をスラック予測に利用するために、分岐履歴とその命令のPCとからスラック表へのインデクスを生成する。このようにすれば、プログラム・カウンタ値(PC)と制御フローの双方を考慮して、スラックを予測することができるようになる。例えば、プログラム・カウンタ値(PC)が同じでも、制御フローが異なれば、スラック表の別々のエントリを使用するので、制御フローに応じた予測ができるようになる。   Since the program uses a branch instruction to determine what function or instruction is executed, the control flow can be simplified by paying attention to the branch condition in the program. Specifically, “1” is recorded if the branch condition is satisfied, and “0” is stored if the branch condition is not satisfied. For example, the branch history when the branch condition is established (1) → established (1) → not established (0) → established (1) in the fetch order is expressed as “1101” when the newer one is recorded in the lower order. The In order to use the branch history for slack prediction, an index to the slack table is generated from the branch history and the PC of the instruction. In this way, slack can be predicted in consideration of both the program counter value (PC) and the control flow. For example, even if the program counter value (PC) is the same, if the control flow is different, different entries in the slack table are used, so that prediction according to the control flow can be performed.

図28は本発明の第1の実施形態の第2の変形例に係る、スラック表20及び2個のインデクス生成回路22A,22Bを備えたプロセッサ10の構成を示すブロック図である。即ち、図28に、制御フローを考慮したスラック予測を行うローカル・スラック予測機構のハードウェア構成の一例を示す。この構成では、図6に例示のものに加え、さらに分岐履歴レジスタ21A、分岐履歴レジスタ21B、及び2つのインデクス生成回路22A,22Bが新たに追加されている。分岐履歴レジスタ21A及び分岐履歴レジスタ21Bは分岐履歴を記録するレジスタである。   FIG. 28 is a block diagram showing a configuration of the processor 10 including the slack table 20 and the two index generation circuits 22A and 22B according to the second modification of the first embodiment of the present invention. That is, FIG. 28 shows an example of a hardware configuration of a local slack prediction mechanism that performs slack prediction in consideration of the control flow. In this configuration, in addition to the example shown in FIG. 6, a branch history register 21A, a branch history register 21B, and two index generation circuits 22A and 22B are newly added. The branch history register 21A and the branch history register 21B are registers for recording a branch history.

また、インデクス生成回路22A,22Bは、入力の違いを除いて同一の回路構成とされている。命令のフェッチ時には、分岐履歴レジスタ21Aからの分岐履歴レジスタ値と、その命令のプログラム・カウンタ値(PC)とを入力として、インデクス生成回路22Aがスラック表20へのインデクスを生成し、スラック表20の参照を行う。一方、命令のコミット時には、分岐履歴レジスタ21Bからの分岐履歴レジスタ値と、その命令のプログラム・カウンタ値(PC)とを入力として、インデクス生成回路22Bがスラック表20へのインデクスを生成し、スラック表20のエントリの更新を行う。以下、これら分岐履歴レジスタ21A,21B及びインデクス生成回路22A,22Bについてさらに詳細に説明する。   The index generation circuits 22A and 22B have the same circuit configuration except for the difference in input. At the time of fetching an instruction, the branch history register value from the branch history register 21A and the program counter value (PC) of the instruction are input, and the index generation circuit 22A generates an index to the slack table 20, and the slack table 20 Reference. On the other hand, when the instruction is committed, the branch history register value from the branch history register 21B and the program counter value (PC) of the instruction are input, and the index generation circuit 22B generates an index to the slack table 20, and the slack The entries in Table 20 are updated. Hereinafter, the branch history registers 21A and 21B and the index generation circuits 22A and 22B will be described in more detail.

まず、分岐履歴レジスタ21A,21Bの分岐履歴の更新動作について説明する。分岐履歴レジスタ21Aは、プロセッサの分岐予測結果に基づき分岐履歴を記録する。具体的な更新動作は、分岐命令がフェッチされると分岐履歴レジスタ21Aの保持する値を1ビット左にシフトするとともに、フェッチ・ユニット11においてその分岐命令の分岐条件が成立と予測されていれば「1」を、不成立と予測されていれば「0」を、分岐履歴レジスタ21Aの最下位ビットに書き込む、という手順で行われる。   First, the branch history update operation of the branch history registers 21A and 21B will be described. The branch history register 21A records a branch history based on the branch prediction result of the processor. Specifically, when a branch instruction is fetched, the value held in the branch history register 21A is shifted to the left by one bit, and if the branch condition of the branch instruction is predicted to be satisfied in the fetch unit 11 If “1” is predicted to be not established, “0” is written in the least significant bit of the branch history register 21A.

一方、分岐履歴レジスタ21Bは、プロセッサの分岐実行結果をもとにして、分岐履歴を記録する。具体的な更新動作は、分岐命令がコミットされると、分岐履歴レジスタ21Bの保持する値を1ビット左にシフトし、その分岐命令の分岐条件が成立したならば「1」を、不成立ならば「0」を、分岐履歴レジスタ21Bの最下位ビットに書き込む、という手順で行われる。   On the other hand, the branch history register 21B records the branch history based on the branch execution result of the processor. Specifically, when the branch instruction is committed, the value held in the branch history register 21B is shifted to the left by 1 bit. If the branch condition of the branch instruction is satisfied, “1” is set. This is performed by a procedure of writing “0” to the least significant bit of the branch history register 21B.

このように、分岐履歴の取り方が2通り存在する理由は、スラックの参照をフェッチ時に行い、スラック表の更新をコミット時に行うという、両分岐履歴レジスタ21A、21Bの分岐履歴を利用する時期の違いにある。フェッチ時には、分岐命令は未だ実行されておらず、プロセッサは、分岐条件が成立するかしないかを予測して、命令をメモリから読み出している。そのため、フェッチ時に使用される分岐履歴レジスタ21Aには、分岐予測に基づいて分岐履歴を記録して行くしかない。一方、コミット時には、分岐命令は既に実行されており、実行結果に基づいて分岐の履歴を記録することができる。   As described above, there are two ways of taking the branch history. The reason for using the branch history of both branch history registers 21A and 21B is that the slack reference is performed at the fetch time and the slack table is updated at the commit time. There is a difference. At the time of fetching, the branch instruction has not been executed yet, and the processor predicts whether or not the branch condition is satisfied and reads the instruction from the memory. Therefore, the branch history register 21A used at the time of fetching can only record the branch history based on the branch prediction. On the other hand, at the time of commit, the branch instruction has already been executed, and the branch history can be recorded based on the execution result.

次に、図29乃至図31を参照して、インデクス生成回路22A,22Bによるインデクス生成態様の詳細を説明する。   Next, the details of the index generation mode by the index generation circuits 22A and 22B will be described with reference to FIGS.

図29は第1の実施形態に係るスラック予測機構において、制御フローを考慮せずにスラック予測を行うときの動作例を示す図である。すなわち、図29は上記実施形態でのインデクス生成、すなわち命令のPCのみを使用したインデクス生成手法を示している。この場合、プログラム・カウンタ値(PC)の一部のビットを切り出して、それをスラック表20へのインデクスとして使用するようにしている。   FIG. 29 is a diagram illustrating an operation example when performing slack prediction without considering the control flow in the slack prediction mechanism according to the first embodiment. That is, FIG. 29 shows the index generation method in the above embodiment, that is, the index generation method using only the instruction PC. In this case, some bits of the program counter value (PC) are cut out and used as an index to the slack table 20.

図30は図28のスラック予測機構において、制御フローを考慮してスラック予測を行うときの第1の動作例を示す図である。図31は図28のスラック予測機構において、制御フローを考慮してスラック予測を行うときの第2の動作例を示す図である。すなわち、図30は、分岐履歴とプログラム・カウンタ値(PC)とを使用したインデクス生成の一例を示し、図31は同じく分岐履歴とプログラム・カウンタ値(PC)とを使用したインデクス生成のもう一つの例をそれぞれ示す。なお、実際のプロセッサ10への搭載に際しては、双方のインデクス生成回路22A,22Bで共通のインデクス生成手法を採用する必要がある。その理由は、双方のインデクス生成回路22A,22Bで別々のインデクス生成手法を採用すると、スラック表20の更新時と参照時で別々のインデクスが生成されてしまい、スラックを正しく予測できないためである。   FIG. 30 is a diagram illustrating a first operation example when performing slack prediction in consideration of the control flow in the slack prediction mechanism of FIG. FIG. 31 is a diagram showing a second operation example when performing slack prediction in consideration of the control flow in the slack prediction mechanism of FIG. 30 shows an example of index generation using the branch history and the program counter value (PC), and FIG. 31 shows another example of index generation using the branch history and the program counter value (PC). Each example is shown below. In mounting on the actual processor 10, it is necessary to adopt a common index generation method for both index generation circuits 22A and 22B. The reason is that if different index generation methods are employed in both index generation circuits 22A and 22B, different indexes are generated when the slack table 20 is updated and when the slack table 20 is referenced, and slack cannot be correctly predicted.

図30の場合には、分岐履歴のi個のビットとプログラム・カウンタ値(PC)から切り出したj個のビットとを連結して、インデクスを生成するようにしている。一方、図31の場合には、分岐履歴のi個のビットとPCから切り出した同数(i個)のビットとの排他論理和(EXOR)を排他的論理和ゲート120によりビット毎に取るとともに、そのビット列とプログラム・カウンタ値(PC)からさらに切り出したj個のビットとを連結して、インデクスを生成するようにしている。   In the case of FIG. 30, the index is generated by concatenating i bits of the branch history and j bits cut out from the program counter value (PC). On the other hand, in the case of FIG. 31, the exclusive OR (EXOR) of i bits of the branch history and the same number (i) of bits extracted from the PC is taken for each bit by the exclusive OR gate 120. The bit string and j bits further extracted from the program counter value (PC) are concatenated to generate an index.

なお、図31のように、分岐履歴が単調な場合(すべて成立、あるいは、すべて不成立)でも、PCから切り出したビットとの排他的論理和を取ることで、インデクスの上位ビットが単調とはならないようにすることができ、スラック表20のエントリを有効に活用できるようになる。   As shown in FIG. 31, even when the branch history is monotonous (all established or all not established), the upper bits of the index do not become monotonous by taking the exclusive OR with the bits cut out from the PC. Thus, the entries in the slack table 20 can be used effectively.

例えば、図30及び図31に示されるように、分岐履歴を4ビットとし、プログラム・カウンタ値(PC)から切り出す下位ビットを2ビットとする場合で、プログラム・カウンタ値(PC)から切り出す下位2ビットだけが同じとなる2つの命令(命令1、命令2)のスラックを更新する場合を考えてみる。なお、以下の説明では、命令1及び命令2のPCのうち、インデクスの生成に関係ないビットを省略して表し、また省略しないビットのうちの上位4ビットと下位2ビットとをスペースで区切って表示する。ここで命令1のPCが「…001101…」であり、命令2のPCが「…110001…」であったとする。命令1と命令2の分岐履歴がいずれもすべて成立(1111)となった場合、図30の手法では、スラック表20へのインデクスが、両命令で同じ値(111101)となってしまう。一方、図31の手法では、スラック表20へのインデクスは、命令1では「110001」と、命令2では「001101」と、この場合にも異なった値となる。   For example, as shown in FIG. 30 and FIG. 31, when the branch history is 4 bits and the lower bit cut out from the program counter value (PC) is 2 bits, the lower 2 cut out from the program counter value (PC) Consider a case in which the slack of two instructions (instruction 1 and instruction 2) having the same bit only is updated. In the following description, among the PCs of instruction 1 and instruction 2, bits not related to index generation are omitted, and the upper 4 bits and lower 2 bits of the bits not omitted are separated by a space. indicate. Here, it is assumed that the PC of instruction 1 is “... 101101..., And the PC of instruction 2 is“. If all branch histories of instruction 1 and instruction 2 are established (1111), the method of FIG. 30 causes the index to the slack table 20 to be the same value (111101) for both instructions. On the other hand, in the method of FIG. 31, the index to the slack table 20 is “110001” for the instruction 1 and “001101” for the instruction 2, and in this case also, the index is different.

このように、図31の手法の方が、エントリを有効活用する上で有利ではあるが、余分な計算が必要されるため、スラック表への要求、すなわちスラック予測のより高い精度を所望するか、機構の簡易さを所望するかによって採用する手法を選択する。いずれにせよ、制御フローを考慮した分岐パターン別の予測スラックを個別記録を行えば、スラック予測の精度をさらに向上可能となる。   As described above, the method of FIG. 31 is more advantageous for effective use of the entry. However, since an extra calculation is required, a request to the slack table, that is, whether higher accuracy of slack prediction is desired. The method to be adopted is selected depending on whether the simplicity of the mechanism is desired. In any case, the accuracy of slack prediction can be further improved by separately recording predicted slack for each branch pattern in consideration of the control flow.

8.ターゲット・スラック到達条件の拡張
ターゲット・スラック到達条件として使用可能な命令実行時の振る舞いとしては、上述した到達条件(A)〜(D)以外にも、例えば以下に列記する(E)〜(I)が考えられる。これらの一部又は全部を、ターゲット・スラック到達条件に追加することで、スラックの予測をより正確に行える可能性がある。
(E)当該命令が、命令ウィンドウ13(図6及び図28参照)において最も古い命令となる(当該命令が命令ウィンドウ13内に最も長い間、留まっている)こと。
(F)リオーダ・バッファ16(図6及び図28参照)において最も古い命令となる(当該命令がROB内に最も長い間、留まっている)こと。
(G)当該命令が、前記命令ウィンドウに存在する命令の中で最も古い命令に実行結果を渡す命令となっていること。
(H)当該命令が、同一のサイクルに実行される命令の中で最も多くの後続命令に実行結果を渡す命令となっていること。例えば同一のサイクルに2つの命令が実行され、そのうちの一方が2つの後続命令に実行結果を渡し、残りが5つの後続命令に実行結果を渡したのであれば、後者の命令がターゲット・スラック到達条件を満たしていると判定される。
(I)当該命令の実行結果を渡すことで、実行可能な状態となる後続命令の数が、予め定められた判定値以上となっていること。ここでの実行可能な状態とは、入力データが揃い、いつでも実行を開始できる状態をいう。
8). Expansion of target slack arrival conditions In addition to the above-mentioned arrival conditions (A) to (D), for example, the following (E) to (I) are listed as behaviors during instruction execution that can be used as target slack arrival conditions. ) Is considered. By adding some or all of these to the target slack arrival condition, there is a possibility that slack can be predicted more accurately.
(E) The instruction becomes the oldest instruction in the instruction window 13 (see FIGS. 6 and 28) (the instruction remains in the instruction window 13 for the longest time).
(F) The oldest instruction in the reorder buffer 16 (see FIGS. 6 and 28) (the instruction remains in the ROB for the longest time).
(G) The instruction is an instruction that passes the execution result to the oldest instruction among the instructions existing in the instruction window.
(H) The instruction is an instruction that passes the execution result to the largest number of subsequent instructions among the instructions executed in the same cycle. For example, if two instructions are executed in the same cycle and one of them passes the execution result to two subsequent instructions and the other passes the execution result to five subsequent instructions, the latter instruction reaches the target slack. It is determined that the condition is satisfied.
(I) The number of subsequent instructions that can be executed by passing the execution result of the instruction is equal to or greater than a predetermined determination value. The executable state here means a state where input data is ready and execution can be started at any time.

これらの到達条件(E)〜(I)について次の命令i1〜i6、すなわち、
命令i1:A=5+3;
命令i2:B=8−3;
命令i3:C=3+A;
命令i4:D=A+C;
命令i5:E=9+B;及び
命令i6:F=7−B;
を実行する場合を例に説明する。
For these arrival conditions (E) to (I), the following instructions i1 to i6, that is,
Instruction i1: A = 5 + 3;
Instruction i2: B = 8-3;
Instruction i3: C = 3 + A;
Instruction i4: D = A + C;
Instruction i5: E = 9 + B; and Instruction i6: F = 7−B;
An example of executing is described.

まず、最初のサイクルで命令i1と命令i2とが同時に実行されたとすると、命令i1は命令i3と命令i4に実行結果を渡し、命令i2は命令i5と命令i6に実行結果を渡す。そのため、実行結果を渡す後続命令数はどちらも2つとなるが、命令i4は未だ入力データが揃っていないので、命令i1の実行結果によって実行可能な状態になった命令数は1つ、命令i2の実行結果によって実行可能な状態になった命令数は2つである。なお、上記条件(I)での判定値が「1」であれば、上記条件(I)を満たすのは命令i1と命令i2、判定値が「2」であれば、命令i2のみとなる。   First, if the instruction i1 and the instruction i2 are simultaneously executed in the first cycle, the instruction i1 passes the execution result to the instruction i3 and the instruction i4, and the instruction i2 passes the execution result to the instruction i5 and the instruction i6. Therefore, the number of subsequent instructions that pass the execution result is two, but since the input data of the instruction i4 has not been prepared yet, the number of instructions that can be executed by the execution result of the instruction i1 is one, the instruction i2 The number of instructions that can be executed by the execution result of is two. If the determination value under the condition (I) is “1”, the instruction (i) and the instruction i2 satisfy the condition (I). If the determination value is “2”, only the instruction i2 is satisfied.

これらの条件(E)〜(I)は、従来、クリティカル・パスを検出するための条件としての使用が提案されたものであるが、ローカル・スラック到達条件としても、十分に利用可能なものである。   These conditions (E) to (I) have been proposed to be used as conditions for detecting a critical path in the past, but can be sufficiently used as local slack arrival conditions. is there.

9.スラック表の更新に関するパラメータの拡張
上記実施形態では、スラック表の更新に係るパラメータのうち、予測スラック及び信頼性カウンタの1回あたりの減少量Vdec,Cdecをそれぞれ予測スラックの最大値Vmax及びしきい値Cthと同値に固定していた。また予測スラック及び信頼性カウンタの1回あたりの増加量Vinc,Cincをともに「1」に固定するようにしていた。しかしながら、性能低下を抑えることが重要な場合や、予測できるスラックの量をできるだけ大きくしたい場合など、状況に応じて上記パラメータの最適値は変わる。そのため、必ずしも上記のようにパラメータを固定する必要はなく、スラック予測の適用される分野に応じて適宜決定することが望ましい。
9. Expansion of parameters related to slack table update In the above-described embodiment, among the parameters related to slack table update, the amount of decrease Vdec and Cdec per time of predicted slack and reliability counter is set to the maximum value Vmax and the threshold value of predicted slack, respectively. It was fixed to the same value as the value Cth. Further, the increments Vinc and Cinc of the predicted slack and reliability counter per time are both fixed to “1”. However, the optimum value of the parameter varies depending on the situation, for example, when it is important to suppress performance degradation or when it is desired to increase the amount of slack that can be predicted as much as possible. Therefore, it is not always necessary to fix the parameters as described above, and it is desirable to appropriately determine the parameters according to the field to which slack prediction is applied.

上記実施形態では、上記スラック表の更新に係る各パラメータはそれぞれ、命令の種別に依らず、一律の値とされていた。例えば、ロード命令であっても、分岐命令であっても、信頼性のしきい値Cthには同じ値が用いられている。しかしながら、実際には、命令の種別によっては、動的な変化度合やその変化の頻度などのローカル・スラックの挙動に違いがある。典型的な例として分岐命令をあげることができる。分岐命令は、他の命令と比べ、ローカル・スラックの変化する量が非常に激しい。分岐予測が成功したときには、後続命令への影響は非常に小さく、ローカル・スラックは大きくなる傾向にあるが、分岐予測が失敗したときには、誤って実行してしまった命令はすべて破棄され、非常に大きなペナルティを被るため、ローカル・スラックが「0」となる。これは、分岐予測の成功と失敗が入れ替わると、ローカル・スラックが急激に変化することを意味する。従って、分岐命令の場合、信頼性カウンタのしきい値Cthや1回当たりの減少量Cdecは他の命令よりも大きくすることが望ましい。   In the above embodiment, each parameter related to the update of the slack table is a uniform value regardless of the type of instruction. For example, the same value is used for the reliability threshold Cth regardless of whether it is a load instruction or a branch instruction. However, in practice, depending on the type of instruction, there is a difference in local slack behavior such as the dynamic change degree and the frequency of the change. A typical example is a branch instruction. Branch instructions have a much more variable amount of local slack than other instructions. When branch prediction is successful, the impact on subsequent instructions is very small and local slack tends to be large, but when branch prediction is unsuccessful, all instructions that were executed in error are discarded and very Because it incurs a large penalty, the local slack is “0”. This means that the local slack changes rapidly when the success and failure of branch prediction are switched. Therefore, in the case of a branch instruction, it is desirable to make the threshold value Cth of the reliability counter and the amount of decrease Cdec per time larger than other instructions.

また、分岐命令以外の種別に属する命令においても、プロセッサ内での動作に特徴があれば、その特徴に適したパラメータの適正値が種別毎にそれぞれ存在すると考えられる。そこで、命令をいくつかのカテゴリにわけ、カテゴリ毎にスラック表の更新に係るパラメータを個別に設定することで、予測精度がさらに向上する可能性がある。例えば、プロセッサ内での動作の違いに着目すると、命令を次の4つのカテゴリ、すなわちロード命令のカテゴリ、ストア命令のカテゴリ、分岐命令のカテゴリ、及びその他命令のカテゴリに分類することができる。   In addition, if an instruction belonging to a type other than the branch instruction has a characteristic in the operation in the processor, it is considered that an appropriate value of a parameter suitable for the characteristic exists for each type. Therefore, there is a possibility that the prediction accuracy is further improved by dividing the instructions into several categories and individually setting the parameters related to the slack table update for each category. For example, focusing on the difference in operation within the processor, the instructions can be classified into the following four categories: a load instruction category, a store instruction category, a branch instruction category, and other instruction categories.

こうして分類した命令の各カテゴリについて、それぞれパラメータを個別に設定する。更新時にはまず、その命令がどのカテゴリに属するかを判定する。この判定は、命令のオペコードを見れば容易に行うことができる。そして、その命令が属するカテゴリの固有のパラメータを用いて、スラック表を更新する。なお、命令のカテゴリの分類態様としては、ロード命令とストア命令とを同じカテゴリとしたり、加算と減算を別々のカテゴリに分けるようにしたり、といった態様も考えられる。命令のどの様に分類するかは、スラック予測の適用される範囲によって変わってくる。なお、このように命令の種別毎に個別のパラメータを使用することとすると、ローカル・スラック予測機構の構成が複雑化するため、これを抑えるには、カテゴリの数を必要最小限まで減らす必要がある。   Parameters are individually set for each category of instructions thus classified. When updating, it is first determined to which category the instruction belongs. This determination can be easily made by looking at the operation code of the instruction. Then, the slack table is updated using the parameters specific to the category to which the instruction belongs. In addition, as a classification mode of the instruction category, a mode in which the load instruction and the store instruction are set to the same category, and addition and subtraction are divided into different categories is also conceivable. How instructions are classified depends on the range to which slack prediction is applied. If individual parameters are used for each type of instruction in this way, the configuration of the local slack prediction mechanism becomes complicated. To suppress this, it is necessary to reduce the number of categories to the minimum necessary. is there.

10.第1の実施形態のまとめ.
以下、本実施形態において、解題を解決するための手段について要約すると、以下のようになる。
10. Summary of the first embodiment.
Hereinafter, in this embodiment, the means for solving the problem will be summarized as follows.

本実施形態に係るローカル・スラックの予測方法では、プロセッサで実行される命令を、その命令のローカル・スラックの予測値である予測スラックの値分だけその実行レイテンシを増加させて実行するとともに、前記命令の実行時の振る舞いに基づいて、現状におけるローカル・スラックの適正値であるターゲット・スラックに前記予測スラックが到達したか否かを推定し、到達したとの推定がなされるまで前記予測スラックを前記命令の実行毎に徐々に増加させて行くようにしている。   In the local slack prediction method according to the present embodiment, the instruction executed by the processor is executed with the execution latency increased by the predicted slack value that is the predicted value of the local slack of the instruction, and Based on the behavior at the time of execution of the instruction, it is estimated whether or not the predicted slack has reached the target slack which is an appropriate value of the current local slack, and the predicted slack is estimated until it is estimated that the target slack has been reached. Each time the instruction is executed, it is gradually increased.

上記予測方法では、命令のローカル・スラックの予測値(予測スラック)がその実行毎に徐々に増加されてゆく。こうして予測スラックを増加して行けば、その値はやがては、現状のローカル・スラックの適正値(ターゲット・スラック)に到達するようになる。一方、命令の実行時のプロセッサの振る舞いから、予測スラックのターゲット・スラックへの到達を推定するとともに、その到達したとの推定が成立した時点で、予測スラックの増加が止められる。その結果、予測スラックを直接的に計算せずとも、ローカル・スラックを予測することができるようになる。   In the prediction method, the predicted value of local slack (predicted slack) of an instruction is gradually increased every time the instruction is executed. If the predicted slack is increased in this way, the value eventually reaches the appropriate value (target slack) of the current local slack. On the other hand, the arrival of predicted slack to the target slack is estimated from the behavior of the processor at the time of execution of the instruction, and the increase in predicted slack is stopped at the time when it is estimated that the arrival has been reached. As a result, local slack can be predicted without directly calculating predicted slack.

なお、上記のようなターゲット・スラックへの予測スラックの到達の推定は、その推定の成立条件として、
(A)当該命令の実行時に分岐予測ミスが発生したこと、
(B)当該命令の実行時にキャッシュ・ミスが発生したこと、
(C)後続命令に対するオペランド・フォワーディングが発生したこと、
(D)後続命令に対するストアデータフォワーディングが発生したこと、
(E)当該命令が命令ウィンドウに存在する命令の中で最も古い命令となっていること、
(F)当該命令がリオーダ・バッファに存在する命令の中で最も古い命令となっていること、
(G)当該命令が、前記命令ウィンドウに存在する命令の中で最も古い命令に実行結果を渡す命令となっていること、
(H)当該命令が、同一のサイクルに実行される命令の中で最も多くの後続命令に実行結果を渡す命令となっていること、
(I)当該命令の実行結果を渡すことで、実行可能な状態となる後続命令の数が、予め定められた判定値以上となっていること、
のうちのいずれかを含めるようにしている。
In addition, the estimation of the arrival of predicted slack to the target slack as described above is a condition for establishing the estimation,
(A) A branch prediction error occurred during execution of the instruction,
(B) A cache miss occurred during execution of the instruction;
(C) Operand forwarding for the subsequent instruction has occurred,
(D) that store data forwarding has occurred for the subsequent instruction;
(E) the instruction is the oldest instruction in the instruction window;
(F) the instruction is the oldest instruction in the reorder buffer;
(G) The instruction is an instruction that passes an execution result to the oldest instruction among the instructions existing in the instruction window;
(H) The instruction is an instruction that passes the execution result to the most subsequent instructions among the instructions executed in the same cycle;
(I) The number of subsequent instructions that can be executed by passing the execution result of the instruction is equal to or greater than a predetermined determination value.
One of them is included.

ここで、上記(A)、(B)の振る舞いは、予測スラックがターゲット・スラックを上回り、後続命令の実行が遅延した状態で観測される。また上記(C)、(D)の振る舞いは、予測スラックがターゲット・スラックと一致したときに観測される。よってこれらの振る舞いが観測されたときには、予測スラックがターゲット・スラックに到達したと推定することができる。   Here, the behaviors of (A) and (B) are observed in a state where the predicted slack exceeds the target slack and the execution of the subsequent instruction is delayed. The behaviors (C) and (D) are observed when the predicted slack matches the target slack. Therefore, when these behaviors are observed, it can be estimated that the predicted slack has reached the target slack.

一方、上記(E)〜(I)の振る舞いは、従来より、命令がクリティカル・パス上にあるか否かの判定条件として用いられている。予測スラックがターゲット・スラックに到達すると、命令の実行レイテンシをそれ以上1サイクルでも増加させると後続命令の実行に遅延が生じるという、クリティカル・パス上の命令と似た状況となるため、上記到達の推定条件としても用いることが可能である。   On the other hand, the above behaviors (E) to (I) are conventionally used as a determination condition as to whether or not an instruction is on the critical path. When the predicted slack reaches the target slack, if the instruction execution latency is further increased by one cycle, the execution of subsequent instructions will be delayed, resulting in a situation similar to the instruction on the critical path. It can also be used as an estimation condition.

なお、それまで予測スラックがターゲット・スラックに一致した状況となっているときにターゲット・スラックが動的に減少すると、予測スラックがターゲット・スラックを上回ってしまい、後続命令の実行が遅延されるという予測ミスのペナルティが発生してしまう。その点、予測スラックがターゲット・スラックに到達したとの推定がなされたときには同予測スラックを減少させるようにすれば、そうしたターゲット・スラックの動的な減少にも対応することができるようになる。   If the target slack decreases dynamically when the predicted slack matches the target slack until then, the predicted slack exceeds the target slack, and the execution of subsequent instructions is delayed. A misprediction penalty occurs. In this regard, if it is estimated that predicted slack has reached target slack, it is possible to cope with such a dynamic decrease in target slack by reducing the predicted slack.

上記推定の成立、不成立をもって直ちに予測スラックを増加・減少させると、ターゲット・スラックが頻繁に増減を繰り返す場合に予測ミスのペナルティの発生頻度が高くなる虞がある。そうした場合にも、予測スラックがターゲット・スラックに到達したとの推定の成立条件の不成立回数が規定の回数となったことを条件に予測スラックを増加させ、同成立条件の成立回数が規定の回数となったことを条件に予測スラックを減少させるようにすれば、ターゲット・スラックが頻繁に増減したときの予測ミスペナルティの頻度の増加を抑えることができる。   If the predicted slack is increased or decreased immediately after the above estimation is established or not established, there is a risk that the frequency of occurrence of a misprediction penalty increases when the target slack frequently increases and decreases. Even in such a case, the predicted slack is increased on the condition that the number of times that the estimated condition that the predicted slack has reached the target slack is not satisfied is the specified number of times. If the predicted slack is decreased on the condition that the target slack is increased, it is possible to suppress an increase in the frequency of the predicted mispenalty when the target slack frequently increases or decreases.

この場合、予測スラックを増加させるために必要な成立条件の不成立回数を、同予測スラックを減少させるために必要な成立条件の成立回数よりも大きく設定すれば、予測スラックの増加は慎重に、その減少は迅速に行われるようになる。そのため、ターゲット・スラックが頻繁に増減を繰り返したときの予測ミスペナルティの頻度の増加を効果的に抑制することができる。こうした効果は、予測スラックがターゲット・スラックに到達したとの推定の成立条件の不成立回数が規定の回数となったことを条件に予測スラックを増加させる一方、予測スラックの減少は、成立条件の成立を条件に行うようにしても、同様に得ることができる。   In this case, if the number of times that the satisfaction condition necessary to increase the predicted slack is set to be greater than the number of times the satisfaction condition required to decrease the predicted slack is set, the increase in predicted slack The reduction will be done quickly. Therefore, it is possible to effectively suppress an increase in the frequency of the prediction mispenalty when the target slack is frequently increased and decreased. These effects increase the predicted slack on the condition that the number of times that the estimated condition that the predicted slack has reached the target slack has not been satisfied is the specified number of times, while the decrease in the predicted slack indicates that the satisfied condition is satisfied Even if it is performed under the condition, it can be obtained similarly.

なお、命令の種別によっては、動的な変化度合やその変化の頻度などのローカル・スラックの挙動に違いがある。そこでローカル・スラックをより精度良く予測するには、予測スラックの上限値や、その1回当たりの更新量(増加量や減少量)を、命令の種別毎に異ならせることが望ましい。また、上記推定の成立条件の成立回数、又は不成立回数が規定の回数となったことを条件に予測スラックを更新する場合には、そうした規定の回数を命令の種別毎に異ならせることで、より高い精度で予測を行うことができるようになる。ちなみに、そうした命令の種別としては、例えば、ロード命令、ストア命令、分岐命令及びその他命令の4つのカテゴリに分けることが考えられる。   Depending on the type of instruction, there is a difference in local slack behavior such as the dynamic change degree and the frequency of the change. Therefore, in order to predict local slack with higher accuracy, it is desirable that the upper limit value of predicted slack and the update amount (increase amount or decrease amount) per time differ for each instruction type. In addition, when updating the predicted slack on condition that the number of times the established condition is satisfied or the number of times it is not satisfied is a specified number of times, it is more Predictions can be made with high accuracy. Incidentally, the types of such instructions may be classified into four categories, for example, load instructions, store instructions, branch instructions, and other instructions.

ところで、命令のローカル・スラックは、その命令の実行に至るまでのプログラムの分岐経路によって大きく変化することがある。その点、当該命令の実行に至るプログラムの分岐パターンの別に予測スラックを個別に設定するようにすれば、命令の実行に至るまでのプログラムの分岐経路毎に個別にローカル・スラックが予測されることとなり、ローカル・スラックをより高い精度で予測することができるようになる。   By the way, the local slack of an instruction may change greatly depending on the branch path of the program leading to the execution of the instruction. In that respect, if the predicted slack is set separately for each branch pattern of the program leading to the execution of the instruction, local slack is predicted for each branch path of the program leading to the execution of the instruction. Thus, local slack can be predicted with higher accuracy.

一方、上記課題を解決するため、本実施形態に係るローカル・スラック予測機構では、プロセッサで実行される命令のローカル・スラックを予測する機構として、各命令のローカル・スラックの予測値である予測スラックが記録保持されるスラック表と、命令の実行に際して前記スラック表を参照してその命令の前記予測スラックを取得するとともに、その取得した予測スラックの分だけ実行レイテンシを増加させる実行レイテンシ設定手段と、前記命令の実行時の振る舞いに基づき、同命令の現状のローカル・スラックの適正値であるターゲット・スラックに前記予測スラックが到達したか否かを推定する推定手段と、前記推定手段により前記予測スラックが前記ターゲット・スラックに到達したとの推定がなされるまで、前記予測スラックを前記命令の実行毎に徐々に増加させる予測スラック更新手段と、を備えるようにしている。   On the other hand, in order to solve the above-described problem, the local slack prediction mechanism according to the present embodiment uses predicted slack that is a predicted value of local slack of each instruction as a mechanism for predicting local slack of instructions executed by the processor. A slack table in which is recorded and held, an execution latency setting means for acquiring the predicted slack of the instruction with reference to the slack table upon execution of the instruction, and increasing the execution latency by the acquired predicted slack, and Based on the behavior at the time of execution of the instruction, estimation means for estimating whether the predicted slack has reached target slack, which is an appropriate value of the current local slack of the instruction, and the predicted slack by the estimation means Until the estimated slack reaches the target slack. The so that and an predicted slack update means gradually increasing for each execution of the instruction.

上記構成では、予測スラック更新手段によって命令の予測スラックが、その命令の実行毎に徐々に増加され、実行レイテンシ設定手段によってその命令の実行レイテンシもその実行毎に同様に徐々に増加される。こうして予測スラックがターゲット・スラックに到達すると、命令の実行時のプロセッサの振る舞いがそれを示すものとなり、推定手段によりその旨の推定がなされ、その結果、上記予測スラック更新手段による予測スラックの増加が止められるようになる。そして以上により、直接計算することなく、予測スラックが求められる。   In the above configuration, the predicted slack of the instruction is gradually increased by the predicted slack updating means every time the instruction is executed, and the execution latency of the instruction is also gradually increased by the execution latency setting means every time the instruction is executed. When the predicted slack reaches the target slack in this way, the behavior of the processor at the time of execution of the instruction indicates that, and the estimation means estimates that. As a result, the predicted slack update means increases the predicted slack. You can stop. As described above, predicted slack is obtained without performing direct calculation.

なお、推定手段によるターゲット・スラックへの予測スラックの到達の推定は、例えば、上記(A)〜(I)のいずれか1つ、あるいはそのうちの複数を(すなわち、少なくとも1つを)その推定の成立条件とすることで行うことができる。   Note that the estimation of the arrival of predicted slack to the target slack by the estimating means is, for example, the estimation of any one of the above (A) to (I) or a plurality thereof (that is, at least one). This can be done by establishing the conditions for establishment.

また、予測スラックがターゲット・スラックに到達したとの推定の成立条件が成立となったときにそのカウンタ値が増加/減少され、推定の成立条件が不成立となったときにそのカウンタ値が減少/増加される信頼性カウンタを設けるとともに、前記信頼性カウンタのカウンタ値が増加判定値となったことを条件に前記予測スラックを増加させ、同信頼性カウンタのカウンタ値が減算判定値となったことを条件に前記予測スラックを減少させるように予測スラック更新手段をすれば、ターゲット・スラックが頻繁に増減を繰り返したときの予測ミスペナルティの発生頻度の増加を好適に抑制することができる。なお、そうした状態での予測ミスペナルティの発生頻度の増大をより効果的に抑制するには、信頼性カウンタでの推定の成立条件の成立時におけるカウンタ値の増加/減少量を、同推定の成立条件の不成立時における同カウンタ値の減少/増加量よりも大きく設定することが望ましい。   Also, the counter value is increased / decreased when the condition for establishing the estimation that the predicted slack has reached the target slack is satisfied, and the counter value is decreased / decreased when the condition for establishing the estimation is not satisfied. A reliability counter to be increased is provided, and the predicted slack is increased on the condition that the counter value of the reliability counter becomes an increase determination value, and the counter value of the reliability counter becomes a subtraction determination value. If the predicted slack updating means reduces the predicted slack on the condition of the above, it is possible to suitably suppress an increase in the occurrence frequency of the predicted mispenalty when the target slack is repeatedly increased and decreased. In order to more effectively suppress an increase in the frequency of occurrence of prediction mispenalties in such a state, the increment / decrement amount of the counter value when the condition for establishment of the estimation in the reliability counter is satisfied can be established. It is desirable to set a larger value than the decrease / increase amount of the counter value when the condition is not satisfied.

さらに、命令の種別によるローカル・スラックの動的変化の様相の差違に対応してより精度良くローカル・スラックの予測を行うには、更新手段による各命令の予測スラックの1回当たりの更新量(増加量、減少量)を、その命令の種別によって異ならせることが望ましい。また更新手段によって更新される各命令の前記予測スラックには上限値を設定する場合には、その上限値を命令の種別によって異ならせることも有効である。さらには、信頼性カウンタが設けられる場合には、カウンタ値の増加量及び減少量を命令の種別により異ならせることが有効である。ちなみに命令の種別としては、ロード命令、ストア命令、分岐命令及びその他命令の4つのカテゴリに分類することが考えられる。   Furthermore, in order to more accurately predict local slack in response to differences in the dynamic change of local slack depending on the type of instruction, the amount of update of predicted slack for each instruction by the updating means ( It is desirable to vary the amount of increase or decrease) depending on the type of instruction. When an upper limit value is set for the predicted slack of each instruction updated by the updating means, it is also effective to make the upper limit value different depending on the type of instruction. Furthermore, when a reliability counter is provided, it is effective to vary the increment and decrement of the counter value depending on the type of instruction. Incidentally, the types of instructions can be classified into four categories: load instructions, store instructions, branch instructions, and other instructions.

また、プログラムの分岐履歴を記録する分岐履歴レジスタを設けるとともに、その分岐履歴レジスタを参照して得られる分岐パターンの別に命令の予測スラックをスラック表に個別に記録するようにすることも、予測精度の向上には有効である。   In addition to providing a branch history register that records the branch history of a program, it is also possible to record the predicted slack of instructions separately in the slack table for each branch pattern obtained by referring to the branch history register. It is effective to improve

本実施形態に係るローカル・スラックの予測方法及び予測機構によれば、命令のローカル・スラックの予測値(予測スラック)を計算で直接的に求めるのではなく、命令の実行時の振る舞いを観測しながら、適正値に到達するまで予測スラックを徐々に増加させることで求めている。そのため、予測スラックの直接演算に要する複雑な機構は不要であり、より簡易な構成でローカル・スラックの予測を行うことができる。   According to the local slack prediction method and prediction mechanism according to the present embodiment, instead of directly calculating the predicted value of local slack (predicted slack) of an instruction, the behavior at the time of execution of the instruction is observed. However, it is obtained by gradually increasing the predicted slack until it reaches an appropriate value. Therefore, a complicated mechanism required for direct calculation of predicted slack is unnecessary, and local slack can be predicted with a simpler configuration.

第2の実施形態.
第2の実施形態では、スラック予測を利用してメモリの曖昧性を除去する手法を提案する。スラックとは、他の命令に影響を与えることなく、その命令の実行レイテンシを増加させることのできるサイクル数である。提案機構では、スラックが予め定めたしきい値以上になったストア命令は、後続するロード命令と依存しないと予測し、ロード命令を投機的に実行する。これにより、ストア命令のスラックを利用しても、後続のロードの実行が遅れることがなくなる。
Second embodiment.
The second embodiment proposes a method for removing memory ambiguity using slack prediction. Slack is the number of cycles that can increase the execution latency of an instruction without affecting other instructions. In the proposed mechanism, a store instruction whose slack exceeds a predetermined threshold is predicted not to depend on a subsequent load instruction, and the load instruction is speculatively executed. Thus, even if the slack of the store instruction is used, the subsequent load execution is not delayed.

1.第1の実施形態及び従来技術の問題点.
上述のように、ロード/ストア命令間には、メモリの曖昧性が存在するため、予測に基づいてストア命令のスラックを利用すると、後続のロードの実行が遅れ、プロセッサの性能に悪影響を与えるという問題点がある。ここで、メモリの曖昧性とは、アクセスするメモリ・アドレスが分かるまで、ロード/ストア命令間の依存関係が分からないことをいう。
1. Problems of the first embodiment and the prior art.
As described above, since there is a memory ambiguity between load / store instructions, the use of store instruction slack based on prediction delays the execution of subsequent loads, which adversely affects the performance of the processor. There is a problem. Here, memory ambiguity means that the dependency between load / store instructions is not known until the memory address to be accessed is known.

そこで、本実施形態では、スラックを利用して、ストア命令とロード命令のデータ依存関係を予測し、メモリの曖昧性を投機的に取り除く機構を提案する。この機構では、スラックが予め定めたしきい値以上になったストア命令は、後続するロード命令と依存しないと予測し、ロード命令を投機的に実行する。これにより、ストア命令のスラックを利用しても、後続のロードの実行が遅れることがなくなる。   Therefore, this embodiment proposes a mechanism that speculatively removes memory ambiguity by predicting the data dependency between store instructions and load instructions using slack. In this mechanism, a store instruction in which slack exceeds a predetermined threshold is predicted not to depend on a subsequent load instruction, and the load instruction is speculatively executed. Thus, even if the slack of the store instruction is used, the subsequent load execution is not delayed.

2.スラック.
スラックに関しては、従来技術及び第1の実施形態において説明した通りであり、ローカル・スラックは、グローバル・スラックとは異なり、求めることだけでなく、利用することも容易である。そこで、本実施形態では、これ以降、「ローカル・スラック」を対象として議論を進める。また、「ローカル・スラック」を、単に、「スラック」と表記する。
2. slack.
Regarding slack, as described in the prior art and the first embodiment, unlike global slack, local slack is not only obtained but also easy to use. Therefore, in the present embodiment, the discussion will proceed with “local slack” as a target. Further, “local slack” is simply expressed as “slack”.

3.メモリの曖昧性がスラックの利用に与える影響.
本章では、ストア命令のスラックを利用したときに、メモリの曖昧性が原因で発生する問題について説明する。
3. The effect of memory ambiguity on slack usage.
This chapter explains the problems that occur due to memory ambiguity when using slack for store instructions.

図32(a)は、従来技術においてストア命令のスラックを利用したときにメモリの曖昧性が原因で発生する問題点を説明するための図であって、デコード前のプログラムを示す図であり、図32(b)は、従来技術においてストア命令のスラックを利用したときにメモリの曖昧性が原因で発生する問題点を説明するための図であって、デコード後のプログラムを示す図である。   FIG. 32A is a diagram for explaining a problem that occurs due to the ambiguity of the memory when the slack of the store instruction is used in the prior art, and shows a program before decoding. FIG. 32B is a diagram for explaining a problem that occurs due to the ambiguity of the memory when the slack of the store instruction is used in the prior art, and shows a program after decoding.

図32(a)において、r1,r2,…はそれぞれ、1番レジスタ、2番レジスタ、…を示す。ストア命令i1は、レジスタr4の値を、レジスタr1の値と3を足して得られるメモリ・アドレスにストアする。ロード命令i5は、レジスタr2の値と8を足して得られるメモリ・アドレスからロードした値を、レジスタr7に書き込む。ロード命令i6は、レジスタr3の値と8を足して得られるメモリ・アドレスからロードした値を、レジスタr8に書き込む。命令i7は、レジスタr7の値と5を足して得られる値を、レジスタr9に書き込む。命令i8は、レジスタr9の値と8を足して得られる値を、レジスタr10に書き込む。   In FIG. 32A, r1, r2,... Indicate the first register, the second register,. The store instruction i1 stores the value of the register r4 at a memory address obtained by adding 3 to the value of the register r1. The load instruction i5 writes the value loaded from the memory address obtained by adding the value of the register r2 and 8 to the register r7. The load instruction i6 writes the value loaded from the memory address obtained by adding the value of the register r3 and 8 to the register r8. The instruction i7 writes a value obtained by adding 5 to the value of the register r7 into the register r9. The instruction i8 writes a value obtained by adding the value of the register r9 and 8 to the register r10.

命令i5は命令i1に依存せず、命令i6は命令i1に依存すると仮定する。ただし、プロセッサ10B(図35参照。)内では、メモリの曖昧性のため、アドレス計算が終るまで、それらの依存関係は不明であることに注意されたい。また、命令i7は命令i5で得られた値を、命令i8は命令i7で得られた値をそれぞれ必要とする。   It is assumed that the instruction i5 does not depend on the instruction i1, and the instruction i6 depends on the instruction i1. However, it should be noted that in the processor 10B (see FIG. 35), due to the ambiguity of the memory, their dependency relationship is not known until the address calculation is completed. Further, the instruction i7 requires the value obtained by the instruction i5, and the instruction i8 requires the value obtained by the instruction i7.

ロード/ストア命令を効率的にスケジューリングする方式として、分離ロード/ストア方式を用いることを仮定する。この方式では、メモリ命令を、アドレス計算部分とメモリアクセス部分の2つに分離し、これらを別々にスケジューリングする。そして、スケジューリングには、ロード及びストアキュー(以下、LSQという。)62と呼ばれる専用のバッファメモリを用いる。なお、アドレス計算にはレジスタ依存しかないので、リザベーション・ステーション14Aを用いてスケジューリングする。一方、メモリアクセスはメモリ依存を満足するようにスケジューリングする。   Assume that a separate load / store scheme is used as a scheme for efficiently scheduling load / store instructions. In this method, a memory instruction is divided into two parts, an address calculation part and a memory access part, and these are scheduled separately. For scheduling, a dedicated buffer memory called a load and store queue (hereinafter referred to as LSQ) 62 is used. Since address calculation has only register dependence, scheduling is performed using the reservation station 14A. On the other hand, the memory access is scheduled to satisfy the memory dependence.

分離ロード/ストア方式を用いるプロセッサにおいて、図32(a)のプログラムをデコードした後のプログラムを、図32(b)に示す。図32(a)及び(b)において、メモリ命令は、アドレス計算命令(名前にaが付加された命令)とメモリアクセス命令(名前にmが付加された命令)に分離されている。   FIG. 32B shows a program after decoding the program of FIG. 32A in the processor using the separate load / store system. In FIGS. 32A and 32B, the memory instruction is separated into an address calculation instruction (an instruction with a added to the name) and a memory access instruction (an instruction with m added to the name).

図33(a)は、プロセッサの処理において、メモリの曖昧性がスラックの利用に与える影響を説明するために用いる図であって、スラックを利用しない場合のプログラムを実行する過程を示すタイミングチャートであり、図33(b)は、プロセッサの処理において、メモリの曖昧性がスラックの利用に与える影響を説明するために用いる図であって、スラックを利用する場合のプログラムを実行する過程を示すタイミングチャートである。   FIG. 33A is a diagram used for explaining the influence of the ambiguity of the memory on the use of slack in the processing of the processor, and is a timing chart showing the process of executing the program when slack is not used. FIG. 33B is a diagram used for explaining the influence of the ambiguity of the memory on the use of slack in the processing of the processor, and is a timing showing the process of executing the program when using the slack It is a chart.

図32(a)及び(b)に示すプログラムを実行する過程を図33(a)及び(b)に示す。図33(a)及び(b)において、縦軸はサイクル数を示し、実線で囲われた矩形部分が、そのサイクルで実行された命令とその実行の内容を示す。   The process of executing the program shown in FIGS. 32 (a) and (b) is shown in FIGS. 33 (a) and 33 (b). In FIGS. 33A and 33B, the vertical axis indicates the number of cycles, and a rectangular portion surrounded by a solid line indicates an instruction executed in the cycle and the content of the execution.

図33(a)は、スラックを利用しない場合の例である。この例では、命令i1a、i5a、i7、i8、i6aはそれぞれ、0、2、5、6サイクル目で実行結果が得られると仮定する。   FIG. 33A shows an example in which slack is not used. In this example, it is assumed that the execution results of the instructions i1a, i5a, i7, i8, i6a are obtained in the 0th, 2, 5th, and 6th cycles, respectively.

0サイクル目で、命令i1のアドレスが判明するため、1サイクル目で命令i1のメモリアクセスができる。次に、2サイクル目で、命令i5のアドレスが判明する。この時点で命令i5は、先行ストアである命令i1に依存しないことが判明する。そのため、3サイクル目に、命令i5がメモリアクセスを行う。4サイクル目に、命令i5でロードした値を用いて加算を行う。5サイクル目に、命令i7で求めた値を用いて加算を行う。6サイクル目に、命令i6が、先行ストアである命令i1に依存することが判明する。この時点で命令i1は実行を終了しているため、それに依存している命令i6も実行を開始できる。9サイクル目に、命令i1から、それに依存する命令i6に、ストアデータがフォワーディングされる。   Since the address of the instruction i1 is found in the 0th cycle, the memory access of the instruction i1 can be performed in the 1st cycle. Next, in the second cycle, the address of the instruction i5 is determined. At this point, it becomes clear that the instruction i5 does not depend on the instruction i1, which is the preceding store. Therefore, the instruction i5 performs memory access in the third cycle. In the fourth cycle, addition is performed using the value loaded by the instruction i5. In the fifth cycle, addition is performed using the value obtained by the instruction i7. In the sixth cycle, it is found that the instruction i6 depends on the instruction i1, which is the preceding store. At this point, since the instruction i1 has finished executing, the instruction i6 depending on it can also start executing. In the ninth cycle, the store data is forwarded from the instruction i1 to the instruction i6 depending on the instruction i1.

一方、図33(b)は、命令i1のスラックを利用した場合である。この場合、スラックを5と予測し、命令i1aの実行レイテンシを5サイクル増加させたと仮定する。命令i1のスラックを利用したことにより、図33(b)では、命令i1aの実行結果が得られるサイクルが、図33(a)の場合よりも5サイクル遅れる。   On the other hand, FIG. 33B shows a case where slack of the instruction i1 is used. In this case, it is assumed that slack is predicted to be 5 and the execution latency of the instruction i1a is increased by 5 cycles. By using the slack of the instruction i1, in FIG. 33B, the cycle in which the execution result of the instruction i1a is obtained is delayed by 5 cycles compared to the case of FIG.

2サイクル目で、命令i5のアドレスが判明する。しかし、この時点では、先行ストアである命令i1のアドレスが不明である。自身のアドレスが判明したにも関わらず、先行ストアに依存しているかどうかがわからないため、メモリにアクセスすることができず、実行が遅れてしまう。5サイクル目で、命令i1のアドレスが判明すると、ようやく、命令i5は命令i1に依存していないことが判明する。そのため、6サイクル目で、命令i5がメモリアクセスを行う。これは無駄な実行の遅れとなり、性能に悪影響を与える。   In the second cycle, the address of the instruction i5 is determined. However, at this time, the address of the instruction i1, which is the preceding store, is unknown. Even though its own address is known, it is not known whether it depends on the preceding store, so the memory cannot be accessed and execution is delayed. When the address of the instruction i1 is found in the fifth cycle, it is finally found that the instruction i5 does not depend on the instruction i1. Therefore, the instruction i5 performs memory access in the sixth cycle. This is a wasteful execution delay and adversely affects performance.

4.スラック予測を利用したメモリの曖昧性の投機的除去.
ストア命令のスラックの利用が、それとは依存関係のないロード命令の実行に与える悪影響を緩和するため、従来手法におけるストア命令のスラックの求め方に着目する。従来手法において、ストア命令のスラックは、当該ストアと依存関係のあるロードにのみ着目して求められる。そのため、ストア命令のスラックがn(n>0)である場合、当該ストアが実行されたnサイクル後に、それに依存するロード命令が実行されることが分かる。
4). Speculative removal of memory ambiguity using slack prediction.
In order to mitigate the adverse effect of the use of the slack of the store instruction on the execution of the load instruction that does not depend on the slack of the store instruction, attention is paid to how to determine the slack of the store instruction in the conventional method. In the conventional method, the slack of a store instruction is obtained by paying attention only to a load having a dependency relationship with the store. Therefore, when the slack of the store instruction is n (n> 0), it can be seen that a load instruction depending on the n instruction is executed after n cycles when the store is executed.

このことから、メモリ命令をアドレス計算とメモリアクセスに分離すると、次の順番で、依存関係のあるストア/ロード命令が実行される可能性が高いと考えられる。まず、ストア命令のアドレスが計算される。その後、ストア命令のメモリアクセスが行われる。そのn−1サイクル後に、それに依存するロード命令のアドレス計算が行われ、その次のサイクルで、メモリアクセスが行われる。   From this, it can be considered that when a memory instruction is separated into address calculation and memory access, a store / load instruction having a dependency relationship is likely to be executed in the following order. First, the address of the store instruction is calculated. Thereafter, the memory access of the store instruction is performed. After n-1 cycles, the address calculation of the load instruction depending on it is performed, and the memory access is performed in the next cycle.

上記の順番でメモリ命令が実行される場合、ストア命令がアドレス計算を行ってから、少なくともnサイクルの間は、ストア命令に依存するロード命令がアドレス計算を行うことはない。従って、その間にアドレスが判明したロード命令は、アドレスを比較しなくても、当該ストア命令に依存しないことが分かる。   When the memory instructions are executed in the above order, the load instruction depending on the store instruction does not perform address calculation for at least n cycles after the store instruction performs address calculation. Therefore, it can be seen that the load instruction whose address is found during that time does not depend on the store instruction without comparing the addresses.

以上より、スラックがn(>0)であるストア命令の実行レイテンシを増加させた結果、当該ストア命令のアドレス計算がnサイクル遅れたとしても、その間にアドレスの判明したロード命令は、当該ストア命令に依存しない可能性が高いと考えることができる。   As described above, even if the address calculation of the store instruction is delayed by n cycles as a result of increasing the execution latency of the store instruction whose slack is n (> 0), the load instruction whose address is found in the meantime is It can be considered that there is a high possibility of not depending on

そこで、本発明者は、アドレスの判明したロード命令は、スラックがn(>0)である先行ストア命令に依存しないと予測し、それらのストア命令に関するメモリの曖昧性を投機的に除去する手法を提案する。これにより、ストア命令のスラックの利用が、それとは依存関係のないロード命令の実行に与える悪影響を緩和することができる。   Therefore, the present inventor predicts that the load instruction whose address has been found does not depend on the preceding store instruction whose slack is n (> 0), and speculatively removes the memory ambiguity related to the store instruction. Propose. As a result, the adverse effect of the use of the slack of the store instruction on the execution of the load instruction that does not depend on the slack can be reduced.

図34は本発明の第2の実施形態に係る、メモリの曖昧性の投機的除去を示すタイミングチャートである。ここで、図34を用いて、提案手法の目的とする動作を説明する。すなわち、図34は提案手法を用いて、図32に示すプログラムを実行するときの過程を示す。図33(b)と同様に、命令i1aのスラックを5と予測し、命令i1aの実行レイテンシを5サイクル増加させる。しかし、図33(b)とは異なり、スラックを用いて、命令i1に関するメモリの曖昧性を投機的に除去する。   FIG. 34 is a timing chart showing speculative removal of memory ambiguity according to the second embodiment of the present invention. Here, the target operation of the proposed method will be described with reference to FIG. That is, FIG. 34 shows a process when the program shown in FIG. 32 is executed using the proposed method. Similar to FIG. 33B, the slack of the instruction i1a is predicted to be 5, and the execution latency of the instruction i1a is increased by 5 cycles. However, unlike FIG. 33B, the ambiguity of the memory related to the instruction i1 is speculatively removed using slack.

2サイクル目で、命令i5のアドレスが判明する。この時点では、先行ストアである命令i1のアドレスが不明である。しかし、命令i1はスラックが0よりも大きい(スラックを持つ)ので、命令i5は命令i1に依存しないと予測する。そして、3サイクル目に、命令i5が投機的にメモリアクセスを行う。以上のようにして、スラックを利用したストア命令とは依存関係のないロード命令の実行が遅れることを防ぐ。   In the second cycle, the address of the instruction i5 is determined. At this time, the address of the instruction i1, which is the preceding store, is unknown. However, since the instruction i1 has a slack larger than 0 (has slack), it is predicted that the instruction i5 does not depend on the instruction i1. In the third cycle, the instruction i5 speculatively accesses the memory. As described above, execution of a load instruction that does not depend on a store instruction using slack is prevented from being delayed.

しかし、スラックは予測によって求めるため、メモリ依存関係の予測に失敗する可能性がある。失敗時のペナルティは大きいため、できるだけ慎重に予測を行う必要がある。そこで、ストア命令のスラックがあるしきい値Vth以上になった場合のみ、後続するロード命令は、当該ストア命令に依存しないと予測することとする。   However, since slack is obtained by prediction, there is a possibility that prediction of memory dependency may fail. The penalty for failure is large, so you need to make your predictions as carefully as possible. Therefore, only when the slack of the store instruction exceeds a certain threshold value Vth, it is predicted that the subsequent load instruction does not depend on the store instruction.

5.提案機構.
本章では4章で示した提案手法を実現する機構について説明する。
5). Proposed mechanism.
This chapter describes the mechanism that implements the proposed method shown in Chapter 4.

5.1.提案機構の概要.
図35は図34のメモリの曖昧性の投機的除去機構(以下、提案機構という。)を備えたプロセッサ10Bの構成を示すブロック図である。図35において、プロセッサ10Bの上側と下側にはそれぞれ、命令キャッシュ11A、データキャッシュ63を示す。プロセッサ20の右側は、フェッチした命令のスラックを予測するスラック予測機構60を示す。プロセッサ10Bの内部は大きく、フロントエンド7、実行コア1A、バックエンド8に分けて構成される。
5.1. Overview of the proposed mechanism.
FIG. 35 is a block diagram showing a configuration of a processor 10B including the memory ambiguity speculative removal mechanism (hereinafter referred to as a proposed mechanism) in FIG. In FIG. 35, an instruction cache 11A and a data cache 63 are shown above and below the processor 10B, respectively. The right side of the processor 20 shows a slack prediction mechanism 60 that predicts the slack of fetched instructions. The inside of the processor 10B is large, and is divided into a front end 7, an execution core 1A, and a back end 8.

命令キャッシュ11Aは主記憶装置9からの命令を一時的に記憶した後、デコード・ユニット12に出力する。デコード・ユニット12は命令デコード部12aとタグ割当部12bとから構成され、入力される命令をデコードしかつタグ割り当てした後、実行コア1Aのリザベーション・ステーション14Aに出力する。   The instruction cache 11A temporarily stores the instruction from the main storage device 9 and then outputs it to the decoding unit 12. The decode unit 12 includes an instruction decode unit 12a and a tag assignment unit 12b. The decode unit 12 decodes an input instruction and assigns a tag, and then outputs the instruction to the reservation station 14A of the execution core 1A.

実行コア1Aでは、リザベーション・ステーション14Aを用いてアドレス計算をスケジューリングし、機能ユニット61(実行ユニット15に対応する。)でアドレスを計算してLSQ62及びバックエンド8のROB16に出力する。また、実行コア1Aでは、LSQ62を用いてロード命令及び/又はストア命令をスケジューリングし、ロード要求及び/又はストア要求をデータキャッシュ63へと送出する。再オーダ時に、ROB16から出力されるアドレスは、レジスタ・ファイル14を介してリザベーション・ステーション14Aに入力される。   The execution core 1A schedules the address calculation using the reservation station 14A, calculates the address by the functional unit 61 (corresponding to the execution unit 15), and outputs it to the LSQ 62 and the ROB 16 of the back end 8. In addition, the execution core 1A schedules a load instruction and / or a store instruction using the LSQ 62 and sends the load request and / or the store request to the data cache 63. At the time of reordering, the address output from the ROB 16 is input to the reservation station 14A via the register file 14.

図35の提案機構はLSQ62において実現され、主に、メモリ依存予測機構と、予測ミスからの回復機構に分けることができる。メモリ依存予測機構は、スラックに基づいて、メモリ依存関係を予測し、ロード命令を投機的に実行する。一方、回復機構は、メモリ依存予測の成否を確認し、メモリ依存予測にミスした状態からプロセッサ状態を回復させる。   The proposed mechanism shown in FIG. 35 is implemented in the LSQ 62, and can be mainly divided into a memory-dependent prediction mechanism and a recovery mechanism from a prediction error. The memory dependence prediction mechanism predicts memory dependence based on slack and speculatively executes a load instruction. On the other hand, the recovery mechanism confirms the success or failure of the memory dependence prediction, and recovers the processor state from a state in which the memory dependence prediction is missed.

以下では、まず、メモリ依存予測機構について説明し、その後、回復機構について説明する。   In the following, the memory dependence prediction mechanism will be described first, and then the recovery mechanism will be described.

5.2.メモリ依存予測機構.
本実施形態に係る提案機構は、LSQ62に簡単な修正を加えることで、メモリ依存予測機構を実現している。まず、修正後のLSQ62の構成について説明する。
5.2. Memory dependent prediction mechanism.
The proposed mechanism according to the present embodiment realizes a memory-dependent prediction mechanism by adding simple modifications to the LSQ 62. First, the configuration of the modified LSQ 62 will be described.

図36は図35のロード及びストアキュー(LSQ)62にエントリされる修正された命令データのフォーマットを示す図である。図36の命令データにおいて、オペコード71、メモリ・アドレス73、タグ75及びストアデータ76に加えて、3個のフラグ72,74,77が追加される。ここで、RaとRdはそれぞれ、アドレス、ストアデータが利用可能であることを示すフラグである。Sflagは提案機構を導入するために新たに追加したストア命令の予測スラックの判定フラグであって、ストア命令の予測スラックがしきい値Vth以上であるかどうかを示すフラグである。ロード命令の場合、フラグSflagに意味はない。フラグSflagは、ストア命令の予測スラックがしきい値Vth以上であれば1にセットし、そうでなければ0にリセットする。フラグSflagのセット/リセットは、ストア命令をLSQ62に割り当てるときに機能ユニット61により行われる。   FIG. 36 is a diagram showing a format of the modified instruction data entered in the load and store queue (LSQ) 62 of FIG. 36, in addition to the operation code 71, the memory address 73, the tag 75, and the store data 76, three flags 72, 74, and 77 are added. Here, Ra and Rd are flags indicating that an address and store data are available. Sflag is a flag for predicting the predicted slack of a store instruction newly added to introduce the proposed mechanism, and indicates whether the predicted slack of the store instruction is equal to or greater than a threshold value Vth. In the case of a load instruction, the flag Sflag has no meaning. The flag Sflag is set to 1 if the predicted slack of the store instruction is equal to or greater than the threshold value Vth, and is reset to 0 otherwise. Setting / resetting of the flag Sflag is performed by the functional unit 61 when a store instruction is assigned to the LSQ 62.

次に、修正後のLSQ62の動作について説明する。通常のLSQ62では、ロード命令は、自身のアドレスと先行するすべてのストア命令のアドレスが判明すると、アドレスの比較を行う。そして、先行ストアに依存しないことが判明すれば、メモリアクセスを行い、そうでなければ、依存するストアからフォワーディングによってデータを得る。   Next, the operation of the LSQ 62 after correction will be described. In the normal LSQ 62, when the load instruction finds its own address and the addresses of all preceding store instructions, it compares the addresses. Then, if it is found that it does not depend on the preceding store, memory access is performed. Otherwise, data is obtained from the dependent store by forwarding.

一方、修正後のLSQ62では、ロード命令は、自身のアドレスが判明し、さらに、先行するストア命令が、もれなく、以下いずれかの条件を満たすと、アドレスの比較を行う。
(1)アドレスが判明している。
(2)アドレスが判明していないが、フラグSflagが1である。
On the other hand, in the modified LSQ 62, the load instruction finds its own address, and if the preceding store instruction does not leak and satisfies any of the following conditions, it compares the addresses.
(1) The address is known.
(2) Although the address is not known, the flag Sflag is 1.

ただし、アドレス比較は、アドレスが判明しているストア命令に対してのみ行う。アドレスが判明しておらず、かつ、フラグSflagが1であるストア命令に対しては、依存関係がないと予測する。アドレス比較の結果、依存するストア命令がないことが判明すれば、メモリアクセスを行い、そうでなければ、依存するストアからフォワーディングによってデータを得る。メモリ依存関係を予測していれば、ロード命令は投機的に実行されたことになる。   However, address comparison is performed only for store instructions whose addresses are known. It is predicted that there is no dependency for a store instruction whose address is not known and the flag Sflag is 1. As a result of the address comparison, if it is found that there is no dependent store instruction, a memory access is performed. Otherwise, data is obtained from the dependent store by forwarding. If the memory dependency is predicted, the load instruction is speculatively executed.

5.3.回復機構.
本実施形態に係る提案機構は、メモリ依存関係の予測が正しいかどうかを調べるため、予測の対象となった可能性のあるストア命令、つまり、フラグSflagが1のストア命令は、アドレスが判明した後、予測の成否を確認する。具体的には、当該ストア命令のアドレスと、実行を完了した後続ロード命令のアドレスを比較する。
5.3. Recovery mechanism.
Since the proposed mechanism according to the present embodiment examines whether or not the prediction of the memory dependency relationship is correct, the address of the store instruction that may have been subject to the prediction, that is, the store instruction with the flag Sflag being 1 is found. Later, the success or failure of the prediction is confirmed. Specifically, the address of the store instruction is compared with the address of the subsequent load instruction that has been executed.

アドレスが一致しなければ、メモリ依存予測は成功である。ストア命令のスラックの利用によって、当該ストア命令とは依存関係のないロード命令の実行が遅れるのを防ぐことができる。一方、アドレスが一致すれば、メモリ依存予測は失敗である。アドレスが一致したロード命令とそれ以降の命令をプロセッサからフラッシュし、実行をやり直す。実行をやり直すために必要なサイクルが、予測ミスペナルティとなる。   If the addresses do not match, the memory dependence prediction is successful. By using the slack of the store instruction, it is possible to prevent the execution of the load instruction that does not depend on the store instruction from being delayed. On the other hand, if the addresses match, the memory dependence prediction fails. The load instruction with the matching address and subsequent instructions are flushed from the processor, and the execution is restarted. The cycle required to redo execution is the prediction miss penalty.

6.LSQ62の処理フロー.
図37はロード命令に対する図35のLSQ62の処理を示すフローチャートである。図37において、従来機構に比較して追加ステップについては、ステップ番号の後に(*)を付加しており、図37では、ステップS7の処理を追加している。なお、図37では、説明を分かりやすくするため、ステップS2からステップS8までの至る部分をループ処置にしているが、通常、この部分は並列に処理される。また、図37及び図38において、アドレスとは、各命令が記憶されている主記憶装置9のメモリ・アドレスをいう。
6). Processing flow of LSQ62.
FIG. 37 is a flowchart showing the processing of the LSQ 62 of FIG. 35 for a load instruction. In FIG. 37, (*) is added after the step number for the additional step as compared with the conventional mechanism, and in FIG. 37, the process of step S7 is added. In FIG. 37, in order to make the explanation easy to understand, the part from step S2 to step S8 is set as a loop treatment, but this part is usually processed in parallel. In FIG. 37 and FIG. 38, the address means a memory address of the main storage device 9 in which each instruction is stored.

図37において、まず、ステップS1において、ロード命令がLSQ62とROB16に書き込まれる。次いで、ステップS1Aでは、LSQ62に書き込まれたロード命令のアドレスが判明したか否かが判断され、YESのときはステップS2に進む一方、NOのときはステップS10に進む。ステップS2では、次の先行ストア命令を取得し、ステップS3において先行ストア命令のアドレスが判明したか否かが判断され、YESのときはステップS4に進む一方、NOのときはステップS7に進む。ステップS4では、ロード命令と先行ストア命令のアドレスを比較し、ステップS5においてこれらのアドレスが一致しているか否かが判断され、YESのときはステップS6に進む一方、NOのときはステップS8に進む。ステップS6では、「ストアデータフォワーディング」が実行された後、当該LSQ62の処理を終了する。   In FIG. 37, first, in step S1, a load instruction is written to the LSQ 62 and the ROB 16. Next, in step S1A, it is determined whether or not the address of the load instruction written in the LSQ 62 has been determined. If YES, the process proceeds to step S2, while if NO, the process proceeds to step S10. In step S2, the next preceding store instruction is acquired. In step S3, it is determined whether or not the address of the preceding store instruction has been found. If YES, the process proceeds to step S4. If NO, the process proceeds to step S7. In step S4, the addresses of the load instruction and the preceding store instruction are compared. In step S5, it is determined whether or not these addresses match. If YES, the process proceeds to step S6. If NO, the process proceeds to step S8. move on. In step S6, after “store data forwarding” is executed, the processing of the LSQ 62 is terminated.

ステップS7では、先行ストア命令のフラグSflagが1であるか否か、すなわち、予測スラックがしきい値Vth以上であるが判断され、YESのときはステップS8に進む一方、NOのときはステップS10に戻る。ステップS10では、1サイクルだけ待機した後、ステップS1Aに戻る。ステップS8では、ロード命令と、先行するすべてのストア命令とのアドレス比較が終了したか否かが判断され、NOのときはステップS2に戻る一方、YESのときはメモリアクセスを行った後、当該LSQ62の処理を終了する。   In step S7, it is determined whether or not the flag Sflag of the preceding store instruction is 1, that is, whether the predicted slack is equal to or greater than the threshold value Vth. If YES, the process proceeds to step S8. If NO, step S10 is performed. Return to. In step S10, after waiting for one cycle, the process returns to step S1A. In step S8, it is determined whether or not the address comparison between the load instruction and all preceding store instructions has been completed. If NO, the process returns to step S2, while if YES, the memory access is performed, and then The process of LSQ 62 is terminated.

なお、ステップS6における「ストアデータフォワーディング」とは以下の処理をいう。ロード命令が要求するデータが、ストアキュー又はLSQ62などのバッファ枚の先行するストア命令のデータである場合、通常、そのストア命令がリタイアしデータキャッシュ63に書き込みを行い、メモリ依存が解消するのを待つ必要がある。もしもバッファから必要なストアデータが得られれば、この無駄な待ち時間がなくなる。データキャッシュ63に書き込まれる前に、バッファからストアデータを供給することを、「ストアデータフォワーディング」という。これは、実行アドレスによるバッファの連想検索の結果、一致するエントリが見つかった場合、対応するストアデータを出力するようにバッファを修正することにより実現できる。   Note that “store data forwarding” in step S6 refers to the following processing. When the data requested by the load instruction is data of a store instruction preceding a store queue or a buffer sheet such as the LSQ 62, normally, the store instruction is retired and written to the data cache 63, and the memory dependence is resolved. I need to wait. If the necessary store data can be obtained from the buffer, this useless waiting time is eliminated. Supplying store data from the buffer before it is written to the data cache 63 is called “store data forwarding”. This can be realized by modifying the buffer so as to output the corresponding store data when a matching entry is found as a result of the associative search of the buffer by the execution address.

図38はストア命令に対する図35のLSQ62の処理を示すフローチャートである。図38において、従来機構に比較して追加ステップについては、ステップ番号の後に(*)を付加しており、図38では、ステップS14及びS20−S22の処理を追加している。   FIG. 38 is a flowchart showing the processing of the LSQ 62 of FIG. 35 for a store instruction. In FIG. 38, (*) is added after the step number for the additional steps as compared with the conventional mechanism. In FIG. 38, the processes of steps S14 and S20-S22 are added.

図38において、まず、ステップS11において、ストア命令がLSQ62及びROB16に書き込まれた後、ステップS12においてストア命令のアドレスが判明したか否かが判断され、NOのときはステップS13に戻る一方、YESのときはステップS14に進む。ステップS13では、1サイクルだけ待機した後、ステップS12に戻る。ステップS14では、ストア命令のフラグSflagが0であるか否か、すなわち、当該ストア命令の予測スラックがしきい値Vth以上であるか否かが判断され、YESのときはステップS15に進む一方、NOのときはステップS20に進む。ステップS20では、ストア命令と後続するすべてのロード命令のアドレスを比較し、アドレスが一致するロード命令があるか否かは判断され、YESのときはステップS22に進む一方、NOのときはステップS15に進む。ステップS22では、ロード命令とそれ以降の命令をプロセッサ10からフラッシュし(命令データをクリアし)、これらの命令の実行をやり直した後、ステップS15に進む。   38, first, in step S11, after the store instruction is written to the LSQ 62 and ROB 16, it is determined in step S12 whether or not the address of the store instruction has been found. If NO, the process returns to step S13, while YES. In this case, the process proceeds to step S14. In step S13, after waiting for one cycle, the process returns to step S12. In step S14, it is determined whether or not the flag Sflag of the store instruction is 0, that is, whether or not the predicted slack of the store instruction is greater than or equal to the threshold value Vth. If YES, the process proceeds to step S15. If NO, the process proceeds to step S20. In step S20, the store instruction is compared with the addresses of all subsequent load instructions, and it is determined whether or not there is a load instruction with the same address. If YES, the process proceeds to step S22. Proceed to In step S22, the load instruction and subsequent instructions are flushed from the processor 10 (instruction data is cleared), the execution of these instructions is performed again, and the process proceeds to step S15.

ステップS15では、ストア命令のデータが得られているか否かが判断され、YESのときはステップS17に進む一方、NOのときはステップS16に進む。ステップS16では、1サイクルだけ待機した後、ステップS15に戻る。ステップS17では、ストア命令がROB16からリタイアするか否かが判断され、YESのときはステップS19に進む一方、NOのときはステップS18に進む。ステップS18では、1サイクル待機した後、ステップS17に戻る。ステップS19では、メモリアクセスを行った後、当該LSQ62の処理を終了する。   In step S15, it is determined whether or not store instruction data has been obtained. If YES, the process proceeds to step S17. If NO, the process proceeds to step S16. In step S16, after waiting for one cycle, the process returns to step S15. In step S17, it is determined whether or not the store instruction is retired from the ROB 16. If YES, the process proceeds to step S19. If NO, the process proceeds to step S18. In step S18, after waiting for one cycle, the process returns to step S17. In step S19, after performing memory access, the processing of the LSQ 62 is terminated.

なお、リタイアとは、バックエンド8での処理が終了し、プロセッサ10Bから命令がなくなることをいう。   Note that “retirement” means that processing in the back end 8 ends and instructions are no longer sent from the processor 10B.

7.第2の実施形態の効果.
以上説明したように、本発明の第2の実施形態に係るプロセッサとその処理方法によれば、所定のしきい値以上の予測スラックを有するストア命令を、当該ストア命令に後続するロード命令とデータの依存関係がないと予測して判断し、当該ストア命令のメモリ・アドレスが判明していなくても上記後続するロード命令を投機的に実行する。従って、予測が正しければ、ストア命令のスラックの利用によって、当該ストア命令とはデータ依存関係がないロード命令の実行が遅延することはなく、プロセッサ装置の性能への悪影響を抑制することができる。また、スラック予測機構の出力結果を利用するために、ストア命令とロード命令間の依存関係を予測するためのハードウェアを新たに用意する必要がない。それ故、従来技術に比較して簡単な構成で、ローカル・スラックの予測を行い、高速でプログラム命令の実行を行うことができる。
7). Effects of the second embodiment.
As described above, according to the processor and the processing method thereof according to the second embodiment of the present invention, a store instruction having predicted slack equal to or greater than a predetermined threshold value is loaded with the load instruction and data following the store instruction. Therefore, even if the memory address of the store instruction is not known, the subsequent load instruction is speculatively executed. Therefore, if the prediction is correct, the use of the slack of the store instruction does not delay the execution of the load instruction having no data dependency with the store instruction, and the adverse effect on the performance of the processor device can be suppressed. In addition, in order to use the output result of the slack prediction mechanism, it is not necessary to prepare new hardware for predicting the dependency between the store instruction and the load instruction. Therefore, local slack can be predicted and program instructions can be executed at a high speed with a simpler configuration compared to the prior art.

第3の実施形態.
本実施形態では、依存関係に基づいてローカル・スラックを共有化する手法を提案する。ローカル・スラックとは、他の命令に影響を与えることなく、その命令の実行レイテンシを増加させることのできるサイクル数である。本実施形態に係る提案機構では、ある命令の持つローカル・スラックを、依存関係のある命令間で共有する。これにより、ローカル・スラックを持たない命令が、スラックを利用できるようになる。
Third embodiment.
In the present embodiment, a method for sharing local slack based on the dependency relationship is proposed. Local slack is the number of cycles that can increase the execution latency of an instruction without affecting other instructions. In the proposed mechanism according to the present embodiment, local slack possessed by a certain instruction is shared among instructions having a dependency relationship. As a result, instructions that do not have local slack can use slack.

1.従来技術及び第1の実施形態の問題点.
上述のように、従来技術及び第1の実施形態に係る手法では、ローカル・スラックが1以上存在すると予測できる命令の数(スラック命令数)が少なく、スラックを利用できる機会が十分に確保できない。
1. Problems of the prior art and the first embodiment.
As described above, with the technique according to the conventional technique and the first embodiment, the number of instructions that can be predicted to have one or more local slacks (the number of slack instructions) is small, and a sufficient opportunity to use slack cannot be secured.

そこで、本実施形態では、ある命令の持つローカル・スラックを、依存関係のある複数の命令間で共有する手法を提案する。この提案機構では、ローカル・スラックを持つ命令を始点として、ローカル・スラックスを持たない命令間で、依存先から依存元へと、共有可能なスラックが存在するという情報を伝搬させて行く。そしてこの情報を元に、発見的な手法を用いて、各命令が利用するスラックの量を決定する。これにより、ローカル・スラックを持たない命令が、スラックを利用できるようになる。   Therefore, this embodiment proposes a method of sharing local slack possessed by a certain instruction among a plurality of dependent instructions. In this proposed mechanism, an instruction having local slack is used as a starting point, and information that there is sharable slack is propagated from an dependence destination to a dependence source between instructions having no local slack. Based on this information, the amount of slack used by each instruction is determined using a heuristic technique. As a result, instructions that do not have local slack can use slack.

2.スラック.
図39は、従来技術に係るスラックの説明に用いるプログラムを示すタイミングチャートである。図39において、ノードは命令を示し、エッジは命令間のデータ依存関係を示す。図39の縦軸は命令を実行したサイクルを示す。ノードの長さは命令の実行レイテンシ(実行遅延時間をいう。)を示す。実行レイテンシは、命令i1、i4、i5、i6、i9が2サイクル、その他の命令が1サイクルである。
2. slack.
FIG. 39 is a timing chart showing a program used to explain slack according to the prior art. In FIG. 39, nodes indicate instructions, and edges indicate data dependency between instructions. The vertical axis in FIG. 39 indicates the cycle in which the instruction is executed. The length of the node indicates an instruction execution latency (referred to as an execution delay time). The execution latency is two cycles for the instructions i1, i4, i5, i6, and i9, and one cycle for the other instructions.

まず、命令i3のグローバル・スラックについて考える。命令i3の実行レイテンシを7サイクル増加させた場合、それに直接的、間接的にそれぞれ依存する命令i8、命令i10の実行が遅れる。その結果、命令i10は、プログラム中最も最後に実行される命令i11と同時刻に実行される。従って、命令i3の実行レイテンシをこれ以上増加させると、プログラム全体の実行サイクル数が増加する。つまり、命令i3のグローバル・スラックは7である。このように、ある命令のグローバル・スラックを求めるためには、その命令の実行レイテンシの増加が、プログラム全体の実行に与える影響を調べる必要がある。そのため、グローバル・スラックの判定は非常に難しい。   First, consider global slack of instruction i3. When the execution latency of the instruction i3 is increased by 7 cycles, the execution of the instruction i8 and the instruction i10 that depend on it directly and indirectly is delayed. As a result, the instruction i10 is executed at the same time as the instruction i11 executed last in the program. Therefore, if the execution latency of the instruction i3 is further increased, the number of execution cycles of the entire program increases. That is, the global slack of the instruction i3 is 7. As described above, in order to obtain the global slack of a certain instruction, it is necessary to examine the influence of the increase in the execution latency of the instruction on the execution of the entire program. Therefore, it is very difficult to determine global slack.

ここで、命令i3に加え、命令i3と間接的に依存関係のある、命令i0のグローバル・スラックに着目する。上記と同様にして、命令i0のグローバル・スラックも7であることが分かる。そこで、これらの命令が、グローバル・スラックを利用して、実行レイテンシを7サイクル増加させると、命令i10は、プログラム中最も最後に実行されるよりも、7サイクル後に実行されてしまう。このように、ある命令がグローバル・スラックを利用すると、他の命令がグローバル・スラックを利用できなくなる可能性がある。そのため、グローバル・スラックは、利用することも難しいといえる。   Here, in addition to the instruction i3, attention is focused on the global slack of the instruction i0 that is indirectly dependent on the instruction i3. In the same manner as described above, it can be seen that the global slack of the instruction i0 is also 7. Therefore, when these instructions use global slack to increase the execution latency by 7 cycles, the instruction i10 is executed after 7 cycles rather than the last execution in the program. Thus, when one instruction uses global slack, another instruction may not use global slack. Therefore, it can be said that global slack is difficult to use.

次に、命令i3のローカル・スラックについて考える。   Next, consider local slack of instruction i3.

命令i3の実行を6サイクル増加させた場合、後続命令の実行に影響は与えない。しかし、これ以上実行レイテンシを増加させると、命令i3に直接依存する命令i8の実行が遅れる。つまり、命令i3のローカル・スラックは6である。このように、ある命令のローカル・スラックを求めるには、その命令に依存する命令への影響に着目すれば良い。従って、ローカル・スラックは比較的容易に判定することができる。   When the execution of the instruction i3 is increased by 6 cycles, the execution of the subsequent instruction is not affected. However, if the execution latency is further increased, the execution of the instruction i8 that directly depends on the instruction i3 is delayed. That is, the local slack of the instruction i3 is 6. Thus, in order to obtain the local slack of a certain instruction, attention should be paid to the influence on the instruction depending on the instruction. Therefore, local slack can be determined relatively easily.

ここで、命令i3と間接的に依存関係のある、命令i10のローカル・スラックに着目する。上記と同様にして、命令i10のローカル・スラックは1であることが分かる。3がローカル・スラックを利用したとしても、それに直接依存する命令に影響を与えることはないので、命令i10はローカル・スラックを利用することができる。グローバル・スラックとは異なり、ある命令がローカル・スラックを利用しても、それとは関係なく、他の命令はローカル・スラックを利用することができる。   Here, attention is focused on the local slack of the instruction i10 that is indirectly dependent on the instruction i3. Similarly to the above, it can be seen that the local slack of the instruction i10 is 1. Even if 3 uses local slack, it does not affect instructions that depend directly on it, so instruction i10 can use local slack. Unlike global slack, if one instruction uses local slack, other instructions can use local slack regardless.

以上のように、ローカル・スラックは、グローバル・スラックとは異なり、求めることが容易なだけではなく、利用することも容易である。そこで、本実施形態では、これ以降、ローカル・スラックを対象として議論を進める。   As described above, unlike global slack, local slack is not only easy to find but also easy to use. Therefore, in the present embodiment, the discussion will proceed with respect to local slack thereafter.

3.従来のスラック予測機構.
従来機構の概要について述べる。詳細については、従来技術及び第1の実施形態において詳細説明した。時刻に基づく機構では、ある命令がデータを定義した時刻と、そのデータが他の命令によって参照された時刻の差からローカル・スラックを計算し、次回実行時のローカル・スラックは、計算によって得たローカル・スラックと同じになると予測する。一方、発見的手法に基づく機構では、分岐予測ミスや、フォワーディングといった、命令実行時の振る舞いを観測しながら、予測するローカル・スラック(予測スラック)を増減させ、予測スラックを実際のローカル・スラック(実スラック)に近づけて行く。
3. Conventional slack prediction mechanism.
The outline of the conventional mechanism will be described. Details have been described in the related art and the first embodiment. In a time-based mechanism, local slack is calculated from the difference between the time when an instruction defines data and the time when the data is referenced by another instruction, and the local slack at the next execution is obtained by calculation. Expect to be the same as local slack. On the other hand, the mechanism based on the heuristic method increases or decreases the predicted local slack (predicted slack) while observing the behavior at the time of instruction execution such as branch misprediction and forwarding, and the predicted slack is changed to the actual local slack ( Move closer to the actual slack).

どちらの手法も、同程度の予測精度を達成できるが、スラック命令数が少ないという問題点がある。例えば、発見的手法では、4命令発行のプロセッサにおいて、性能低下を10%未満に抑えつつ、予測可能なスラック命令数は、最大で、全実行命令の3〜5割程度である。スラック命令数が少なければ、スラックを利用する機会も制限されてしまう。そこで、スラック命令数を増加させる方策を考えることが重要となる。   Both methods can achieve the same level of prediction accuracy, but have a problem that the number of slack instructions is small. For example, in the heuristic method, in a processor that issues four instructions, the number of slack instructions that can be predicted is about 30 to 50% of the total execution instructions while suppressing the performance degradation to less than 10%. If the number of slack instructions is small, the opportunity to use slack is also limited. Therefore, it is important to consider measures to increase the number of slack instructions.

4.スラック命令数を増加させる手法.
本章では、ある命令の持つローカル・スラックを、当該命令だけでなく、それ以外の命令も利用する(共有化する)手法を提案する。スラックの共有化によって、ローカル・スラックを持たなかった命令が、スラックを利用できるようにすることができれば、スラック命令数を増加させることができる。
4). A technique to increase the number of slack instructions.
In this chapter, we propose a method of using (sharing) local slack of an instruction not only for the instruction but also for other instructions. If the slack sharing can make slack available to instructions that do not have local slack, the number of slack instructions can be increased.

まず、スラックを共有化する命令間には、どのような関係が成り立つのかについて考える。   First, let us consider what kind of relationship holds between instructions that share slack.

ローカル・スラックを持たない命令が、実行レイテンシを増加させれば、それに依存する命令の実行に影響を与える。その結果、ある命令の持っていたローカル・スラックが減少したとすれば、これらの命令は、スラックを共有していると考えることができる。このことから本発明者は、スラックを共有化できる命令は、ローカル・スラックを持つ命令の実行に影響を与えうる命令、つまり、直接的、間接的にオペランドを供給する命令であると考えた。   If an instruction without local slack increases the execution latency, it affects the execution of the instruction that depends on it. As a result, if the local slack possessed by a certain instruction is reduced, it can be considered that these instructions share slack. Therefore, the present inventor has considered that an instruction that can share slack is an instruction that can affect the execution of an instruction having local slack, that is, an instruction that directly or indirectly supplies an operand.

例えば、図39において、命令i3はローカル・スラックを持つ命令である。そして、命令i0、i2は、命令i3に直接的、間接的にオペランドを共有する命令である。これらの命令の実行レイテンシを増加させると、命令i3の利用可能なローカル・スラックは減少する。従って、命令i3の持つローカル・スラックは、命令i0、i2、i3の間で共有化できるということになる。   For example, in FIG. 39, the instruction i3 is an instruction having local slack. The instructions i0 and i2 are instructions that share operands directly and indirectly with the instruction i3. Increasing the execution latency of these instructions decreases the available local slack for instruction i3. Therefore, the local slack of the instruction i3 can be shared between the instructions i0, i2, and i3.

図40(a)は従来技術の手法に係るスラックの利用を説明するプログラムを示すタイミングチャートであり、図40(b)は本発明の第2の実施形態に係る、スラック命令数を増加させる手法に係るスラックの利用を説明するプログラムを示すタイミングチャートである。   FIG. 40A is a timing chart showing a program for explaining the use of slack according to the conventional technique, and FIG. 40B is a technique for increasing the number of slack instructions according to the second embodiment of the present invention. It is a timing chart which shows the program explaining utilization of the slack concerning.

図40(a)及び(b)を用いて、従来手法と、本実施形態に係る共有化手法について説明する。この図40(a)及び(b)は、図39のプログラムにおいて、命令i3のローカル・スラックを利用した場合の動作を示す。図40(a)の従来手法では、命令i3のローカル・スラックを利用するのは、命令i3のみである。一方、図40(b)の提案手法では、命令i3のローカル・スラックを、命令i0、i2、i3の間で共有化していることが分かる。これにより、スラック命令数が増加する。なお、共有化によって、1命令あたりのスラックは減少する。そのため、共有化は、1命令毎に多くのスラックを必要とする応用には向いていないことに注意する必要がある。   The conventional method and the sharing method according to the present embodiment will be described with reference to FIGS. FIGS. 40A and 40B show the operation when local slack of the instruction i3 is used in the program of FIG. In the conventional method of FIG. 40A, only the instruction i3 uses the local slack of the instruction i3. On the other hand, in the proposed method of FIG. 40B, it can be seen that the local slack of the instruction i3 is shared between the instructions i0, i2, and i3. This increases the number of slack instructions. Note that slack per instruction is reduced by sharing. Therefore, it should be noted that sharing is not suitable for applications that require a lot of slack per instruction.

次に、スラックを共有化する命令を求める方法について考える。   Next, consider a method for obtaining an instruction to share slack.

共有化を実現する手法として、命令間の依存関係を示すデータフローグラフ(DFG:Data Flow Graph)を利用するという方法が考えられる。データフローグラフが分かれば、ある命令の持つローカル・スラックに対し、直接的、間接的にオペランドを供給する命令、つまり、共有化を行う命令を求めることができる。その後は、これらの命令間で、スラックを均等に割る、など、状況に応じて、スラックの分配方法を決めれば良い。しかし、命令間の依存関係は複雑で、さらに、分岐によってその関係が動的に変化するため、データフローグラフを作成するのは容易ではないと考えられる。   As a technique for realizing sharing, a method of using a data flow graph (DFG: Data Flow Graph) indicating dependency relation between instructions can be considered. If the data flow graph is known, it is possible to obtain an instruction for supplying operands directly or indirectly, that is, an instruction for sharing, to local slack of a certain instruction. Thereafter, the slack distribution method may be determined according to the situation, such as evenly dividing slack between these instructions. However, since the dependency relationship between instructions is complicated and the relationship dynamically changes by branching, it is not easy to create a data flow graph.

そこで、本発明者は、ローカル・スラックを持つ命令を始点とし、依存先から依存元へと依存関係を逆にたどりながら、共有可能なスラックが存在するという情報(共有化情報)を伝搬させて行くこととする。例えば、図39では、共有化情報は、ローカル・スラックを持つ命令i3から命令i2へと伝搬し、その後、命令i2から命令i0へと伝搬することになる。各命令は、自身が直接依存する、スラックを持たない命令に対して、共有化情報を伝搬させるだけで良いため、データフローグラフを作成する方法に比べ、実現ははるかに容易である。   Therefore, the present inventor propagates information (shared information) that there is sharable slack, starting from an instruction having local slack, and tracing the dependency relationship from the dependency destination to the dependency source in reverse. Let's go. For example, in FIG. 39, the sharing information is propagated from the instruction i3 having local slack to the instruction i2, and then from the instruction i2 to the instruction i0. Since each instruction only needs to propagate shared information to an instruction that directly depends on itself and does not have slack, it is much easier to implement than a method of creating a data flow graph.

さらに、ローカル・スラックの動的に変化するため、共有化情報の伝搬の速度を変化させることができるようにする。具体的には、命令は、自身の予測スラックがあるしきい値(伝搬のしきい値)以上になったら、共有化情報を伝搬させることとする。これ以降、伝搬のしきい値のことを、伝搬しきい値Pthという。   Furthermore, since the local slack changes dynamically, the propagation speed of the shared information can be changed. Specifically, the instruction propagates the shared information when its predicted slack exceeds a certain threshold (propagation threshold). Hereinafter, the propagation threshold is referred to as a propagation threshold Pth.

最後に、スラックの予測方法について考える。予測には2種類ある。ローカル・スラックの予測と、共有化情報を受け取った命令が利用するスラックの予測である。   Finally, consider the slack prediction method. There are two types of prediction. The prediction of local slack and the prediction of slack used by the instruction that receives the sharing information.

ローカル・スラックは動的に変化する。共有化を行うと、1命令あたりのスラックは減少するので、ローカル・スラックの動的な変化はさらに複雑になる。この変化に対応するために、ローカル・スラックの予測手法として、予測スラックの増減の緩急を制御できる、発見的ローカル・スラック予測(第1の実施形態参照。)を用いることとする。   Local slack changes dynamically. When sharing is performed, the slack per instruction is reduced, and the dynamic change of local slack is further complicated. In order to cope with this change, heuristic local slack prediction (see the first embodiment) capable of controlling the rate of increase / decrease in predicted slack is used as a local slack prediction method.

共有化できるスラックは動的に変化する。また、共有化情報を受け取った命令は、スラックを共有化できるということしか分からない。これは、発見的ローカル・スラック予測において、予測するスラックは動的に変化し、各命令は予測スラックが実スラックに到達したかどうかしか分からないという状況に非常に似ている。そこで、共有化情報を受け取った命令に対しても、発見的にスラックを予測することとする。   The slack that can be shared changes dynamically. Also, the instruction that receives the sharing information only knows that slack can be shared. This is very similar to the situation in heuristic local slack prediction where the predicted slack changes dynamically and each instruction only knows whether the predicted slack has reached actual slack. Therefore, slack is predicted heuristically even for an instruction that receives shared information.

具体的には、以下のようにする。まず、予測スラック毎に信頼性カウンタを導入する。実行時に、共有化情報を受け取った場合、予測スラックは利用可能なスラックに未だ到達していないと判定し、信頼性カウンタを増加させる。そうでなかった場合、予測スラックは利用可能なスラックに到達したと判定し、信頼性カウンタを減少させる。そして、カウンタ値が0になったら予測スラックを減少させ、カウンタ値があるしきい値以上になったら予測スラックを増加させる。   Specifically, it is as follows. First, a reliability counter is introduced for each predicted slack. When sharing information is received at the time of execution, it is determined that predicted slack has not yet reached available slack, and the reliability counter is incremented. If not, the predicted slack determines that available slack has been reached and decrements the reliability counter. Then, the predicted slack is decreased when the counter value becomes 0, and the predicted slack is increased when the counter value exceeds a certain threshold value.

5.提案機構
本章では前章で示した提案手法を実現する機構について説明する。まず、提案機構の概要について述べる。次に、提案機構の各構成要素について説明する。最後に、全体の動作について詳しく説明する。
5). Proposed mechanism This chapter describes the mechanism that implements the proposed method described in the previous section. First, the outline of the proposed mechanism is described. Next, each component of the proposed mechanism will be described. Finally, the overall operation will be described in detail.

5.1.提案機構の構成.
図41は、本発明の第3の実施形態に係る、スラック伝搬表80などを備えたプロセッサ10である提案機構の構成を示すブロック図である。本節の説明には関係しないため、プロセッサ10及び更新ユニット30の内部は省略するが、プロセッサ10の詳細構成は図6又は図35に図示され、更新ユニット30の詳細構成は図19又は図46に図示されている。ここで、提案機構は、プロセッサ10に加えて、以下3つの構成要素をさらに備えて構成される。
(1)スラック表20A、
(2)スラック伝搬表80、及び
(3)更新ユニット30。
5.1. Configuration of the proposed mechanism.
FIG. 41 is a block diagram illustrating a configuration of a proposed mechanism that is the processor 10 including the slack propagation table 80 and the like according to the third embodiment of the present invention. Since it is not related to the description in this section, the inside of the processor 10 and the update unit 30 is omitted, but the detailed configuration of the processor 10 is illustrated in FIG. 6 or FIG. 35, and the detailed configuration of the update unit 30 is illustrated in FIG. It is shown in the figure. Here, the proposed mechanism is configured to further include the following three components in addition to the processor 10.
(1) Slack table 20A,
(2) Slack propagation table 80, and (3) Update unit 30.

スラック表20Aは例えばハードディスクメモリなどの記憶装置に格納され、命令毎に、伝搬フラグPflag、予測スラック、信頼性を保持する。プロセッサ10は、主記憶装置9から命令をフェッチすると、フェッチ時にスラック表20Aを参照し、スラック表20Aから得られた予測スラックを、自身の予測スラックとして用いる。伝搬フラグPflagはローカル・スラックの予測の内容を示す。伝搬フラグPflagが0の場合、従来のローカル・スラック予測を行っていることを示し、伝搬フラグPflagが1の場合、共有化情報に基づくスラック予測を行っていることを示す。ローカル・スラックを予測した後でなければ、共有化情報は伝搬できないため、伝搬フラグPflagの初期値は0にセットされる。   The slack table 20A is stored in a storage device such as a hard disk memory, and holds a propagation flag Pflag, predicted slack, and reliability for each instruction. When the processor 10 fetches an instruction from the main storage device 9, the processor 10 refers to the slack table 20A at the time of fetching, and uses the predicted slack obtained from the slack table 20A as its own predicted slack. The propagation flag Pflag indicates the content of local slack prediction. When the propagation flag Pflag is 0, it indicates that the conventional local slack prediction is being performed. When the propagation flag Pflag is 1, it indicates that the slack prediction based on the sharing information is being performed. The shared information cannot be propagated until local slack is predicted, so the initial value of the propagation flag Pflag is set to zero.

スラック伝搬表80は、各命令の持つ共有化情報を、自身が直接依存する、ローカル・スラックを持たない命令に伝搬させるために用いる。このスラック伝搬表80は、命令のデスティネーション・レジスタ番号をインデクスとする。各エントリは、命令毎にローカル・スラックを持たない命令のプログラム・カウンタ値(PC)、予測スラック、信頼性を保持する。また、更新ユニット30は、命令実行時の振る舞いや、共有化情報に基づいて、コミットした命令の予測スラックと信頼性を計算するために用いる。更新ユニット30で計算された値は、スラック表20Aに書き込まれる。   The slack propagation table 80 is used for propagating the shared information of each instruction to an instruction that does not have local slack, which is directly dependent on the information. This slack propagation table 80 uses the destination register number of the instruction as an index. Each entry holds the program counter value (PC), predicted slack, and reliability of an instruction that does not have local slack for each instruction. The update unit 30 is used to calculate the predicted slack and reliability of the committed instruction based on the behavior at the time of executing the instruction and the sharing information. The value calculated by the update unit 30 is written in the slack table 20A.

5.2.構成要素の詳細.
プロセッサ10は命令をフェッチすると、フェッチ時にスラック表20Aを参照し、スラック表20Aから自身の予測スラックを得る。そして、命令のコミット時に、伝搬フラグPflag、信頼性、予測スラック、実行時の振る舞いが、更新ユニット30に送られる。命令の伝搬フラグPflagが0であれば、発見的ローカル・スラック予測手法に基づいて、信頼性と予測スラックが計算し、スラック表20Aを更新する。このとき、伝搬フラグPflagを変更しない。
5.2. Details of the components.
When the processor 10 fetches an instruction, it refers to the slack table 20A at the time of fetching, and obtains its own predicted slack from the slack table 20A. Then, when the instruction is committed, the propagation flag Pflag, reliability, predicted slack, and execution behavior are sent to the update unit 30. If the instruction propagation flag Pflag is 0, the reliability and predicted slack are calculated based on the heuristic local slack prediction method, and the slack table 20A is updated. At this time, the propagation flag Pflag is not changed.

次に、計算によって得たローカル・スラックを用いて、スラック伝搬表80の更新/参照を行う。ここで、伝搬フラグPflagが0で、予測スラックが1以上の場合、命令はローカル・スラックを持つ。また、伝搬フラグPflagが0で、予測スラックが0の場合であっても、信頼性が1以上であれば、命令は次回実行時にローカル・スラックを持つ可能性がある。そこで、これらの場合は、スラック伝搬表80のデスティネーション・レジスタに対応するエントリをクリアする。一方、上記のいずれにも該当しない場合、命令はローカル・スラックを持たず、次回実行時にローカル・スラックを持つ可能性は無いといえる。そこで、この場合は、スラック伝搬表80のデスティネーション・レジスタに対応するエントリに、その命令のプログラム・カウンタ値(PC)、予測スラック、信頼性を書き込む。   Next, the slack propagation table 80 is updated / referenced using the local slack obtained by the calculation. Here, when the propagation flag Pflag is 0 and the predicted slack is 1 or more, the instruction has local slack. Even if the propagation flag Pflag is 0 and the predicted slack is 0, if the reliability is 1 or more, the instruction may have local slack at the next execution. Therefore, in these cases, the entry corresponding to the destination register in the slack propagation table 80 is cleared. On the other hand, if none of the above applies, it can be said that the instruction does not have local slack, and there is no possibility of having local slack at the next execution. Therefore, in this case, the program counter value (PC), predicted slack, and reliability of the instruction are written in the entry corresponding to the destination register of the slack propagation table 80.

命令がローカル・スラックを持つ場合、あるいは、共有化によってスラックを利用できるようになった場合、スラックを伝搬しきい値Pthと比較する。スラックが伝搬しきい値Pth未満である場合、ソース・レジスタ番号でスラック伝搬表80を参照する。参照した結果得られる命令は、共有化情報を受け取らないことが分かる。そこで、この情報に基づき、命令のスラックを予測するとともに、参照したエントリをクリアする。スラックが伝搬しきい値Pth以上である場合、ソース・レジスタ番号に対応する命令は、当該命令から共有化情報を受け取ることが分かる。しかし、当該命令の後続命令からは共有化情報を受け取ることができない可能性がある。そのため、この時点では何も行わない。その後、対応するエントリを再定義する命令をコミットするときに、そのエントリの命令は、依存するすべての命令から、共有化情報を受け取ることが分かる。そこで、この情報に基づき、命令のスラックを予測する。   When the instruction has local slack, or when slack becomes available due to sharing, the slack is compared with the propagation threshold value Pth. When the slack is less than the propagation threshold value Pth, the slack propagation table 80 is referred to by the source register number. It can be seen that the instruction obtained as a result of the reference does not receive shared information. Therefore, based on this information, the slack of the instruction is predicted and the referenced entry is cleared. When the slack is equal to or greater than the propagation threshold value Pth, it can be seen that the instruction corresponding to the source register number receives the sharing information from the instruction. However, there is a possibility that shared information cannot be received from the instruction following the instruction. So do nothing at this point. Then, when committing an instruction that redefines the corresponding entry, it can be seen that the instruction of that entry receives sharing information from all the instructions it depends on. Therefore, the slack of the instruction is predicted based on this information.

最後に、共有化情報に基づくスラック予測について説明を行う。共有化情報に基づくスラック予測では、共有化情報を受け取ったかどうかという情報に基づいて、信頼性と予測スラックが計算し、スラック表20Aを更新する。基本的に、発見的ローカル・スラック予測手法と同じ考え方を用いて更新データの計算を行うが、ターゲット・スラック到達条件ではなく、共有化情報を基にしている点が異なる。   Finally, slack prediction based on shared information will be described. In slack prediction based on shared information, reliability and predicted slack are calculated based on information indicating whether shared information has been received, and the slack table 20A is updated. Basically, update data is calculated using the same concept as the heuristic local slack prediction method, except that it is based on shared information rather than target slack arrival conditions.

以下に、スラック表の更新に関係するパラメータとその内容を示す。なお、予測スラックの最小値Vmin_s=0、信頼性の最小値Cmin_s=0である。   The parameters related to updating the slack table and their contents are shown below. Note that the predicted slack minimum value Vmin_s = 0 and the reliability minimum value Cmin_s = 0.

(1)Vmax_s:予測スラックの最大値、
(2)Vmin_s:予測スラックの最小値(=0)、
(3)Vinc_s:予測スラックの1回あたりの増加量、
(4)Vdec_s:予測スラックの1回あたりの減少量、
(5)Cmin_s:信頼性の最小値(=0)、
(6)Cth_s:信頼性のしきい値、
(7)Cinc_s:信頼性の1回あたりの増加量、及び
(8)Cdec_s:信頼性の1回あたりの減少量。
(1) Vmax_s: the maximum value of predicted slack,
(2) Vmin_s: the minimum value of predicted slack (= 0),
(3) Vinc_s: the amount of increase in predicted slack per time,
(4) Vdec_s: the amount of decrease in predicted slack per time,
(5) Cmin_s: minimum value of reliability (= 0),
(6) Cth_s: threshold value of reliability,
(7) Cinc_s: increase amount of reliability per time, and (8) Cdec_s: decrease amount of reliability per time.

パラメータの種類と内容は、ローカル・スラック予測の場合と同じである。ただし、共有化情報の伝搬には時間がかかるので、パラメータの取るべき値は必ずしも同じになる訳ではない点に注意されたい。   The types and contents of parameters are the same as in local slack prediction. However, since it takes time to propagate the shared information, it should be noted that the values to be taken by the parameters are not necessarily the same.

上記のパラメータを用いて、スラック表の更新の流れを説明する。命令が共有化情報を受け取れば信頼性を増加量Cinc_sだけ増加させ、そうでなければ信頼性を減少量Cdec_sだけ減少させる。信頼性がしきい値Cths以上になったら、予測スラックを増加量Vinc_sだけ増加させ、信頼性を0にリセットする。一方、信頼性が0になったら、予測スラックを減少量Vdec_sだけ減少させる。   The flow of updating the slack table will be described using the above parameters. If the instruction receives the shared information, the reliability is increased by the increase amount Cinc_s, otherwise the reliability is decreased by the decrease amount Cdec_s. When the reliability exceeds the threshold Cths, the predicted slack is increased by the increase amount Vinc_s, and the reliability is reset to zero. On the other hand, when the reliability becomes 0, the predicted slack is decreased by the decrease amount Vdec_s.

上記の操作によって、伝搬フラグPflagが0であった命令の予測スラックが1以上になったら、共有化によってスラックが利用できるようになったということなので、伝搬フラグPflagを1とする。逆に、伝搬フラグPflagが1であった命令の予測スラックが0になったら、スラックの共有化ができなくなったということなので、伝搬フラグPflagを0とする。   When the predicted slack of the instruction whose propagation flag Pflag is 0 becomes 1 or more by the above operation, it means that the slack can be used by sharing, so the propagation flag Pflag is set to 1. On the contrary, if the predicted slack of the instruction whose propagation flag Pflag is 1 becomes 0, it means that the slack cannot be shared, so the propagation flag Pflag is set to 0.

図42は、図41の更新ユニット30によって実行されるローカル・スラック予測処理を示すフローチャートである。なお、ステップS32,S41については新規な処理であり、ステップ番号の後ろに(*)を付している。ここで、予測スラックと信頼性の数値範囲は、0≦信頼性≦Cth_l,0≦予測スラック≦Vmax_lである。到達条件フラグRflagは第1の実施形態において用いたフラグであって、ターゲット・スラック到達条件が成立しているときに1となり、そうでないときに0となるフラグである。また、判定フラグSflagは第2の実施形態において新たに追加したストア命令の予測スラックの判定フラグであって、ストア命令の予測スラックがしきい値Vth以上であるかどうかを示すフラグである。ここで、ロード命令の場合、フラグSflagに意味はない。フラグSflagは、ストア命令の予測スラックがしきい値Vth以上であれば1にセットし、そうでなければ0にリセットする。フラグSflagのセット/リセットは、ストア命令をLSQ62に割り当てるときに機能ユニット61により行われる。   FIG. 42 is a flowchart showing local slack prediction processing executed by the update unit 30 of FIG. Steps S32 and S41 are new processes, and (*) is added after the step number. Here, the numerical ranges of predicted slack and reliability are 0 ≦ reliability ≦ Cth_l, 0 ≦ predicted slack ≦ Vmax_l. The arrival condition flag Rflag is a flag used in the first embodiment, and is 1 when the target slack arrival condition is satisfied, and 0 when it is not. The determination flag Sflag is a determination flag for predicted slack of a store instruction newly added in the second embodiment, and indicates whether the predicted slack of the store instruction is equal to or greater than a threshold value Vth. Here, in the case of a load instruction, the flag Sflag has no meaning. The flag Sflag is set to 1 if the predicted slack of the store instruction is equal to or greater than the threshold value Vth, and is reset to 0 otherwise. Setting / resetting of the flag Sflag is performed by the functional unit 61 when a store instruction is assigned to the LSQ 62.

図42において、まず、ステップS31においてコミットした命令を取得し、ステップS32において伝搬フラグPflag=0であるか否かが判断され、YESのときはステップS33に進む一方、NOのときはステップS41に進む。ステップS33において到達条件フラグRflag=0であるか否かが判断され、YESのときはステップS34に進む一方、NOのときはステップS37に進む。ステップS34において信頼性の値に増加量Cinc_lを加算し、加算結果を信頼性の値として挿入し、ステップS35において信頼性≧Cth_lであるか否かが判断され、YESのときはステップS36に進む一方、NOのときはステップS40に進む。ステップS36では、信頼性の値を0にリセットし、予測スラックの値に増加量Vinc_lを加算し、加算結果を予測スラックの値として挿入した後、ステップS40に進む。一方、ステップS37において信頼性の値から減少量Cdec_lを減算し、減算結果を信頼性の値として挿入した後、ステップS38において信頼性=0であるか否かが判断され、YESのときはステップS39に進む一方、NOのときはステップS40に進む。ステップS39では、信頼性の値を0にリセットし、予測スラックの値に減少量Vdec_lを減算し、減算結果を予測スラックの値として挿入した後、ステップS40に進む。ステップS40において上記の演算結果に基づいてスラック表を更新し、ステップS41において図43の共有化情報の伝搬処理を実行した後、当該ローカル・スラック予測処理を終了する。   42, first, the instruction committed in step S31 is acquired. In step S32, it is determined whether or not the propagation flag Pflag = 0, and if YES, the process proceeds to step S33. If NO, the process proceeds to step S41. move on. In step S33, it is determined whether or not the reaching condition flag Rflag = 0. If YES, the process proceeds to step S34. If NO, the process proceeds to step S37. In step S34, the increase amount Cinc_l is added to the reliability value, and the addition result is inserted as the reliability value. In step S35, it is determined whether or not reliability ≧ Cth_l. If YES, the process proceeds to step S36. On the other hand, if NO, the process proceeds to step S40. In step S36, the reliability value is reset to 0, the increase amount Vinc_l is added to the predicted slack value, and the addition result is inserted as the predicted slack value. Then, the process proceeds to step S40. On the other hand, after subtracting the decrease amount Cdec_l from the reliability value in step S37 and inserting the subtraction result as the reliability value, it is determined in step S38 whether or not reliability = 0. While the process proceeds to S39, the process proceeds to Step S40 if NO. In step S39, the reliability value is reset to 0, the decrease amount Vdec_l is subtracted from the predicted slack value, and the subtraction result is inserted as the predicted slack value. Then, the process proceeds to step S40. In step S40, the slack table is updated based on the above calculation result, and in step S41, the sharing information propagation process of FIG. 43 is executed, and then the local slack prediction process is terminated.

図43は、図42のサブルーチンであって、共有化情報の伝搬処理(S41)を示すフローチャートである。   FIG. 43 is a flowchart showing the sharing information propagation process (S41) in the subroutine of FIG.

ステップS42において、コミットした命令の予測スラックを伝搬しきい値Pthと比較し、ステップS43において予測スラック≧Pthであるか否かが判断され、YESのときはステップS44に進む一方、NOのときはステップS52に進む。ステップS44においてコミットした命令のデスティネーション・レジスタ番号でスラック伝搬表80を参照し、ステップS45において参照したスラック伝搬表80のエントリからコミットした命令と同じレジスタを定義する先行命令のプログラム・カウンタ値(PC)、予測スラック及び信頼性を読み出し、ステップS46において読み出した情報が有効であるか(クリアされていないか)であるか否かが判断される。ステップS46において、YESのときはステップS47に進む一方、NOのときはステップS49に進む。ステップS47においてコミットした命令と同じレジスタを定義する先行命令のフラグSflagを1にセットし、ステップS48においてコミットした命令と同じレジスタを定義する先行命令のプログラム・カウンタ値(PC)、予測スラック、信頼性及びフラグSflagを更新ユニット30へ送り、ステップS49に進む。   In step S42, the predicted slack of the committed instruction is compared with the propagation threshold value Pth. In step S43, it is determined whether or not predicted slack ≧ Pth. If YES, the process proceeds to step S44, while if NO, Proceed to step S52. Refer to the slack propagation table 80 by the destination register number of the instruction committed in step S44, and the program counter value of the preceding instruction that defines the same register as the committed instruction from the entry of the slack propagation table 80 referenced in step S45 ( PC), predicted slack and reliability are read, and it is determined whether or not the information read in step S46 is valid (is not cleared). If YES in step S46, the process proceeds to step S47. If NO, the process proceeds to step S49. The flag Sflag of the preceding instruction that defines the same register as the committed instruction in step S47 is set to 1, and the program counter value (PC), predicted slack, and reliability of the preceding instruction that defines the same register as the committed instruction in step S48 The property and flag Sflag are sent to the update unit 30, and the process proceeds to step S49.

一方、ステップS52では、コミットした命令のソース・レジスタ番号でスラック伝搬表80を参照し、ステップS53において参照したスラック伝搬表80のエントリからコミットした命令の依存元のプログラム・カウンタ値(PC)、予測スラック及び信頼性を読み出す。次いで、ステップS54において、参照したスラック伝搬表80のエントリをクリアし、ステップS55において、コミットした命令の依存元のフラグSflagを0にリセットした後、ステップS56においてコミットした命令の依存元のプログラム・カウンタ値(PC)、予測スラック、信頼性及びフラグSflagを更新ユニット30に送り、ステップS44に進む。   On the other hand, in step S52, the slack propagation table 80 is referred to by the source register number of the committed instruction, and the program counter value (PC) of the dependency source of the committed instruction from the entry of the slack propagation table 80 referenced in step S53, Read predicted slack and reliability. Next, in step S54, the entry of the referenced slack propagation table 80 is cleared, and in step S55, the dependency source flag Sflag of the committed instruction is reset to 0, and then the dependency source program of the committed instruction in step S56. The counter value (PC), predicted slack, reliability, and flag Sflag are sent to the update unit 30, and the process proceeds to step S44.

さらに、ステップS49においてコミットした命令の伝搬フラグPflag=1、又はコミットした命令の伝搬フラグPflag=予測スラック=信頼性=0であるか否かが判断され、YESのときはステップS50に進む一方、NOのときはステップS51に進む。ステップS50において参照したスラック伝搬表80のエントリにコミットした命令のPC、予測スラック及び信頼性を書き込み、元のメインルーチンに戻る。一方、ステップS51において参照したスラック伝搬表80のエントリをクリアし、元のメインルーチンに戻る。   Further, it is determined whether or not the propagation flag Pflag = 1 of the committed instruction in step S49 or the propagation flag Pflag = predicted slack = reliability = 0 of the committed instruction. If YES, the process proceeds to step S50. If NO, the process proceeds to step S51. The PC, predicted slack, and reliability of the committed instruction are written in the entry of the slack propagation table 80 referred to in step S50, and the process returns to the original main routine. On the other hand, the entry of the slack propagation table 80 referred to in step S51 is cleared, and the process returns to the original main routine.

図44は、新規な制御フローであって、図41の更新ユニット30によって実行される共有化スラックの予測処理を示すフローチャートである。ここで、予測スラックと信頼性の数値範囲は、0≦信頼性≦Cth_s,0≦予測スラック≦Vmax_sである。   FIG. 44 is a flow chart showing a shared slack prediction process executed by the update unit 30 of FIG. 41, which is a new control flow. Here, the numerical ranges of predicted slack and reliability are 0 ≦ reliability ≦ Cth_s, 0 ≦ predicted slack ≦ Vmax_s.

ステップS61において、まず、共有化情報の伝搬処理により、更新ユニット30へ送られてきた命令を取得し、ステップS62においてフラグSflag=1であるか否かが判断され、YESのときはステップS63に進む一方、NOのときはステップS66に進む。ステップS63において信頼性の値に増加量Cinc_sを加算し、加算結果を信頼性の値に挿入し、ステップS64において信頼性≧Cth_s(しきい値)であるか否かが判断され、YESのときはステップS65に進む一方、NOのときはステップS69に進む。ステップS65において信頼性の値を0にリセットし、予測スラックの値に増加量Vinc_sを加算し、加算結果を予測スラックの値として挿入した後、ステップS69に進む。一方、ステップS66において信頼性の値から減少量Cdec_sを減算し、減算結果を信頼性の値として挿入し、ステップS67において信頼性=0であるか否かが判断され、YESのときはステップS68に進む一方、NOのときはステップS69に進む。ステップS68において信頼性の値を0にリセットし、予測スラックの値から減少量Vdec_sを減算し、減算結果を予測スラックの値として挿入した後、ステップS69に進む。ステップS69では、信頼性≧1又は予測スラック≧1であるか否かが判断され、YESのときはステップS70に進む一方、NOのときはステップS71に進む。ステップS70において伝搬フラグPflagを1にセットし、ステップS72に進む。一方、ステップS71では、伝搬フラグPflagを0にリセットし、ステップS72に進む。ステップS72では、上記の演算結果に基づいてスラック表20Aを更新し、当該強化スラックの予測処理を終了する。   In step S61, first, the command sent to the update unit 30 is acquired by the sharing information propagation process. In step S62, it is determined whether or not the flag Sflag = 1. If YES, the process proceeds to step S63. On the other hand, if NO, the process proceeds to step S66. In step S63, the increase amount Cinc_s is added to the reliability value, and the addition result is inserted into the reliability value. In step S64, it is determined whether or not reliability ≧ Cth_s (threshold value). Advances to step S65, while if NO, advances to step S69. In step S65, the reliability value is reset to 0, the increment Vinc_s is added to the predicted slack value, and the addition result is inserted as the predicted slack value. Then, the process proceeds to step S69. On the other hand, the reduction amount Cdec_s is subtracted from the reliability value in step S66, and the subtraction result is inserted as the reliability value. In step S67, it is determined whether or not reliability = 0. If YES, step S68 is determined. On the other hand, if NO, the process proceeds to step S69. In step S68, the reliability value is reset to 0, the decrease amount Vdec_s is subtracted from the predicted slack value, and the subtraction result is inserted as the predicted slack value. Then, the process proceeds to step S69. In step S69, it is determined whether or not reliability ≧ 1 or predicted slack ≧ 1, and if YES, the process proceeds to step S70, and if NO, the process proceeds to step S71. In step S70, the propagation flag Pflag is set to 1, and the process proceeds to step S72. On the other hand, in step S71, the propagation flag Pflag is reset to 0, and the process proceeds to step S72. In step S72, the slack table 20A is updated based on the calculation result, and the prediction process of the enhanced slack is terminated.

以上説明したように、第3の実施形態によれば、共有化情報に基づくスラック予測方法である第2の予測方法を用いて、ローカル・スラックを持つ命令に基づいて、ローカル・スラックを持たない命令間で依存先から依存元へと共有可能なスラックが存在するという共有化情報を伝搬させて行き、当該共有化情報に基づいて所定の発見的な手法を用いて各命令が利用するローカル・スラックの量を決定し、ローカル・スラックを持たない命令がローカル・スラックを利用することができるように制御する。従って、ローカル・スラックを持たない命令がローカル・スラックを利用することができるようになり、従来技術に比較して簡単な構成で、ローカル・スラックを有効にかつ十分に利用してローカル・スラックの予測を行い、高速でプログラム命令の実行を行うことができる。   As described above, according to the third embodiment, the second prediction method, which is a slack prediction method based on shared information, is used, and no local slack is provided based on an instruction having local slack. Propagate shared information that there is slack that can be shared from the dependency destination to the dependency source between the instructions, and use the local heuristics that each instruction uses by using a predetermined heuristic based on the shared information The amount of slack is determined and controlled so that instructions without local slack can use local slack. Therefore, an instruction having no local slack can use the local slack, and the local slack can be used effectively and sufficiently with a simple configuration as compared with the prior art. Predictions can be performed and program instructions can be executed at high speed.

第4の実施形態.
本実施形態では、スラックの分布に着目して、予測精度を向上する手法を提案する。発見的手法を用いてローカル・スラックを予測する機構を提案する。ローカル・スラックとは、他の命令に影響を与えることなく、その命令の実行レイテンシを増加させることのできるサイクル数である。本実施形態に係る提案機構は、分岐予測ミスやオペランド・フォワーディングなど命令実行時の振る舞いを観測しながら、予測するローカル・スラックを増減させ、実際のローカル・スラックに近づけて行くことを特徴とする。
Fourth embodiment.
In the present embodiment, a method for improving the prediction accuracy is proposed by paying attention to the slack distribution. A mechanism to predict local slack using heuristics is proposed. Local slack is the number of cycles that can increase the execution latency of an instruction without affecting other instructions. The proposed mechanism according to the present embodiment is characterized in that the local slack to be predicted is increased or decreased while observing the behavior at the time of instruction execution such as a branch prediction error or operand forwarding, and is brought closer to the actual local slack. .

1.従来技術及び第1の実施形態の問題点.
実際のローカル・スラック(実スラック)は動的に変化する。そのため、この変化に対応する手法が提案されている(例えば、非特許文献6及び第1の実施形態参照。)。しかし、実スラックの変化に十分追従できず、性能低下を招く可能性がある。これを防ぐため、予測スラックの増加を緩やかにする手法が提案されている(第1の実施形態参照。)が、スラックが1以上存在すると予測できる命令の数(スラック命令数)が減少してしまうという問題点があった。
1. Problems of the prior art and the first embodiment.
Actual local slack (actual slack) changes dynamically. Therefore, a method corresponding to this change has been proposed (see, for example, Non-Patent Document 6 and the first embodiment). However, the change in actual slack cannot be sufficiently followed, and there is a possibility that performance will be degraded. In order to prevent this, a method of moderately increasing the predicted slack has been proposed (see the first embodiment), but the number of instructions that can be predicted to have one or more slack (the number of slack instructions) is reduced. There was a problem of end.

そこで、本実施形態では、スラックの分布に着目して、予測精度を向上する手法を提案する。この手法では、従来機構に修正を加え、スラックの値に応じて、スラックの更新に用いるパラメータを変更できるようにする。こうすることにより、スラック命令数を維持したまま、性能低下を抑制できるようになる。   Therefore, in the present embodiment, a method for improving the prediction accuracy is proposed by paying attention to the slack distribution. In this method, the conventional mechanism is modified so that the parameters used for slack updating can be changed according to the slack value. By doing so, it is possible to suppress the performance degradation while maintaining the number of slack instructions.

2.スラック.
スラックに関しては、従来技術及び第1の実施形態において詳述した。第1の実施形態において述べた通り、ローカル・スラックは、グローバル・スラックとは異なり、求めることだけでなく、利用することも容易である。そこで、本実施形態では、これ以降、「ローカル・スラック」を対象として議論を進める。また、「ローカル・スラックを」、単に、「スラック」と表記する。
2. slack.
The slack has been described in detail in the related art and the first embodiment. As described in the first embodiment, unlike the global slack, the local slack is not only obtained but also easy to use. Therefore, in the present embodiment, the discussion will proceed with “local slack” as a target. Also, “local slack” is simply expressed as “slack”.

3.第1の実施形態のスラック予測機構.
第1の実施形態に係るスラック予測機構(以下、比較例機構という。)の概要とその問題点について述べる。比較例機構の詳細については、第1の実施形態において詳述した。
3. The slack prediction mechanism of the first embodiment.
The outline and problems of the slack prediction mechanism (hereinafter referred to as a comparative example mechanism) according to the first embodiment will be described. Details of the comparative example mechanism have been described in detail in the first embodiment.

時刻に基づく機構では、ある命令がデータを定義した時刻と、そのデータが他の命令によって参照された時刻の差からスラックを計算し、次回実行時のスラックは計算によって得たスラックと同じになると予測する。一方、発見的手法に基づく機構では、分岐予測ミスや、フォワーディングといった、命令実行時の振る舞いを観測しながら、予測スラックを増減させ、予測スラックを実スラックに近づけて行く。どちらの手法も同程度の予測精度を達成できる。   In the mechanism based on time, slack is calculated from the difference between the time at which an instruction defines data and the time at which the data is referenced by another instruction, and the slack at the next execution is the same as the slack obtained by the calculation. Predict. On the other hand, in the mechanism based on the heuristic method, the predicted slack is increased or decreased while observing the behavior at the time of instruction execution such as a branch prediction error or forwarding, and the predicted slack is made closer to the actual slack. Both methods can achieve the same level of prediction accuracy.

従来手法は、過去のスラックを元にして、次回実行時のスラックを予測する。実際のスラック(実スラック)が動的に変化し、予測したスラック(予測スラック)を下回ると、性能に悪影響を与える。そのため、従来手法は、実スラックの変化に対応する機構を幾つか備えている。しかし、実スラックが急速に増減を繰り返す場合、その変化に十分追従することができない。そこでさらに、発見的手法に基づく機構では、予測スラックの増加を慎重に行い、予測スラックの減少を迅速に行うことで、予測スラックが実スラックをできるだけ超えないようにしている(第1の実施形態参照。)。   The conventional method predicts the slack at the next execution based on the past slack. When actual slack (actual slack) changes dynamically and falls below predicted slack (predicted slack), performance is adversely affected. For this reason, the conventional method includes several mechanisms that respond to changes in actual slack. However, when actual slack repeatedly increases and decreases, the change cannot be sufficiently followed. Therefore, in the mechanism based on the heuristic method, the predicted slack is carefully increased and the predicted slack is rapidly reduced, so that the predicted slack does not exceed the actual slack as much as possible (first embodiment). reference.).

しかし、性能低下を防ぐために、予測スラックの増加を緩やかにすると、スラックが1以上あると予測できる命令の数(スラック命令数)が減少してしまうという問題がある。スラック命令数の減少は、スラックを利用する機会の減少を意味する。そのため、スラック命令数を維持しつつ、性能低下を防ぐ仕組みを構築することが重要となる。   However, if the increase in predicted slack is moderated to prevent performance degradation, there is a problem that the number of instructions that can be predicted to have one or more slacks (the number of slack instructions) decreases. A decrease in the number of slack instructions means a decrease in the opportunity to use slack. Therefore, it is important to build a mechanism that prevents performance degradation while maintaining the number of slack instructions.

4.スラックの予測精度を向上させる手法.
スラックの分布には偏りがある。具体的には、スラックの分布は、0が最も多く、それ以降の値は急速に少なくなるという特徴を持つ。本発明者は、この性質に基づいて、予測スラックの増減の緩急を制御することで、スラック命令数をできるだけ維持しつつ、性能低下を抑制できるのではないかと考えた。本章では、まずスラックの分布について述べ、次にこの分布を利用した、スラックの予測方法を提案する。
4). A technique to improve slack prediction accuracy.
There is a bias in the distribution of slack. Specifically, the distribution of slack has a feature that 0 is the largest and the values thereafter are rapidly reduced. Based on this property, the present inventor has thought that by controlling the increase / decrease in predicted slack increase / decrease, it is possible to suppress performance degradation while maintaining the number of slack instructions as much as possible. In this chapter, we first describe the slack distribution, and then propose a slack prediction method using this distribution.

4.1.スラックの分布.
本発明者は、スラックの分布を調査するため、プロセッサシミュレータ上で公知のSPECint20のベンチマークを実行し、ある命令がデータを定義した時刻と、そのデータが他の命令によって参照された時刻の差からスラックを計算した。以下では、まず調査環境の詳細を示し、その後、調査結果について述べる。
4.1. Slack distribution.
In order to investigate the distribution of slack, the present inventor executes a known SPECint20 benchmark on a processor simulator, and calculates the difference between the time when an instruction defines data and the time when the data is referenced by another instruction. The slack was calculated. Below, the details of the survey environment are shown first, and then the survey results are described.

4.1.1.測定環境.
スラックの分布を調査するために用いた環境について述べる。シミュレータには、公知のSimpleSalr Toolのスーパースカラ・プロセッサ用シミュレータを用いた。命令セットには公知のMIPSR10を拡張したSimpleSalr/PISAを用いた。ベンチマーク・プログラムは、公知のSPECint2000のbzip2、gcc、gzip、mcf、parser、perlbmk、vortex、vprの8本を使用した。プログラムgccでは1G命令、その他のプログラムでは2G命令をスキップした後、10M命令を実行した。表7に測定条件を示す。
4.1.1. Measurement environment.
The environment used to investigate the slack distribution is described. A simulator for a super scalar processor of the known Simple Salr Tool was used as the simulator. As the instruction set, SimpleSalr / PISA, which is an extension of the well-known MIPSR10, was used. As the benchmark program, eight known SPECint2000 bzip2, gcc, gzip, mcf, parser, perlbmk, vortex, and vpr were used. After skipping the 1G instruction in the program gcc and the 2G instruction in the other programs, the 10M instruction was executed. Table 7 shows the measurement conditions.

Figure 2007293816
Figure 2007293816

4.1.2.調査結果.
図45は、本発明者の調査結果に係る、実スラックに対する実行命令数に占める割合を示すグラフである。図45では調査結果をベンチマーク平均で示す。図45の横軸は全実行命令に占める割合であり、その縦軸はスラックである。図45より、スラックが0である命令の割合が最も多く、スラックが大きくなるに連れて命令の割合は急速に低下して行くことが分かる。
4.1.2. Investigation result.
FIG. 45 is a graph showing a ratio of the number of executed instructions to actual slack according to the investigation result of the present inventors. FIG. 45 shows the survey results as a benchmark average. The horizontal axis in FIG. 45 is the ratio of all execution instructions, and the vertical axis is slack. From FIG. 45, it can be seen that the ratio of instructions having slack of 0 is the highest, and the ratio of instructions decreases rapidly as the slack increases.

4.2.スラックの分布を利用した予測精度向上手法.
調査結果より、ランダムに値が変化すると仮定すると、スラック予測の成功率は、予測したスラックの値が小さい程高いと考えられる。つまり、予測成功率は、予測スラックが0の場合が最も高く、予測スラックの値が大きくなる程、予測成功率は低くなって行くと考えられる。
4.2. A prediction accuracy improvement method using slack distribution.
From the survey results, assuming that the value changes randomly, the success rate of slack prediction is considered to be higher as the predicted slack value is smaller. That is, the predicted success rate is highest when the predicted slack is 0, and the predicted success rate is considered to decrease as the predicted slack value increases.

そこで、従来の発見的手法に基づく機構に修正を加え、スラックの値に応じて、予測スラックの更新方法を変更できるようにする。例えば、予測スラックは、0から1に増加させる場合は迅速に変化させ、1以上の値から増加させる場合は慎重に行うようにする。これにより、成功する確率を考慮して予測スラックの更新方法を決定できるようになるため、スラック命令数の維持と、性能低下の抑制を同時に実現することができるようになる。また、予測スラックの更新方法の変更は、スラック値に応じて更新パラメータを切り替えるだけで済むため、実現は容易である。なお、更新パラメータを切り替えるポイントは、多数設定することが可能であるが、多くなる程、ハードウェアは複雑度になるので、それを考慮して、設定する必要がある。   Therefore, the mechanism based on the conventional heuristic method is modified so that the predicted slack update method can be changed according to the slack value. For example, the predicted slack changes rapidly when increasing from 0 to 1, and is carefully performed when increasing from a value of 1 or more. As a result, it becomes possible to determine the update method of predicted slack in consideration of the probability of success, so that it is possible to simultaneously maintain the number of slack instructions and suppress performance degradation. Further, the change of the update method of the predicted slack is easy to implement because it is only necessary to switch the update parameter according to the slack value. Note that a large number of points for switching update parameters can be set. However, as the number of update parameters increases, the hardware becomes more complex. Therefore, it is necessary to set the points in consideration thereof.

5.提案機構の構成.
図46は、第1の実施形態に係る更新ユニット30を備えたプロセッサ10の構成を示すブロック図である。図46は、図19の概要を示すものである。
5). Configuration of the proposed mechanism.
FIG. 46 is a block diagram illustrating a configuration of the processor 10 including the update unit 30 according to the first embodiment. FIG. 46 shows an outline of FIG.

図46において、更新ユニット30は、2個の加算器40,50と、3個のマルチプレクサ91,92,110と、4個の比較器93,94,111,112とを備えて構成される。ここで、各マルチプレクサ91,92,110及び各比較器94,112に入力される各パラメータは第1の実施形態において説明したものである。プロセッサ10から出力される信頼性は、加算器40の第1の入力端子に入力され、プロセッサ10から出力される到達条件フラグRflagはマルチプレクサ91の切り替え制御信号として入力され、マルチプレクサ91は、到達条件フラグRflag=0のとき増加量Cincを選択して加算器40の第2の入力端子に出力する一方、到達条件フラグRflag=1のとき減少量Cdecにマイナスを付加してなる−Cdecを選択して加算器40の第2の入力端子に出力する。加算器40は入力される2つのデータ値を加算し、加算結果のデータ値を信頼性の更新値としてスラック表20に出力するとともに、比較器93及び94に出力する。さらに、プロセッサ10からの予測スラックは、加算器50の第2の入力端子に入力される。   46, the update unit 30 includes two adders 40 and 50, three multiplexers 91, 92, and 110, and four comparators 93, 94, 111, and 112. Here, the parameters input to the multiplexers 91, 92, 110 and the comparators 94, 112 are the same as those described in the first embodiment. The reliability output from the processor 10 is input to the first input terminal of the adder 40, the arrival condition flag Rflag output from the processor 10 is input as a switching control signal for the multiplexer 91, and the multiplexer 91 When the flag Rflag = 0, the increase amount Cinc is selected and output to the second input terminal of the adder 40, while when the arrival condition flag Rflag = 1, −Cdec is selected by adding a minus to the decrease amount Cdec. Output to the second input terminal of the adder 40. The adder 40 adds the two input data values, and outputs the data value of the addition result to the slack table 20 as a reliability update value, and outputs it to the comparators 93 and 94. Further, the predicted slack from the processor 10 is input to the second input terminal of the adder 50.

比較器93は、入力されるデータ値を0と比較し、0以下のときデータ値1をマルチプレクサ92の第2の制御信号入力端子に出力する一方、1以上のときデータ値0をマルチプレクサ92の第2の制御信号入力端子に出力する。また、比較器94は、入力されるデータ値をしきい値Cthと比較し、入力データ値≧Cthのときデータ値1をマルチプレクサ92の第1の制御信号入力端子に出力する一方、入力データ値<Cthのときデータ値0をマルチプレクサ92の第1の制御信号入力端子に出力する。ここで、マルチプレクサ92への各制御信号入力端子への制御信号をCS91(A,B)で表し、Aは第1の制御信号端子への入力値であり、Bは第2の制御信号入力端子への入力値である。マルチプレクサ110への各制御信号入力端子への制御信号も同様にCS110(A,B)で表す。マルチプレクサ92は制御信号CS92(0,0)のときデータ値0を選択して加算器50の第1の入力端子に出力し、制御信号CS92(0,1)のとき減少量Vdecにマイナスを付加してなるデータ値−Vdecを選択して加算器50の第1の入力端子に出力し、制御信号CS92(1,*)(ここで、*は不定値をいう。以下、同様である。)のとき増加量Vincを選択して加算器50の第1の入力端子に出力する。加算器50は入力される2つのデータ値を加算し、加算結果のデータ値を比較器111,112及びマルチプレクサ110の第3の入力端子に出力する。   The comparator 93 compares the input data value with 0, and outputs a data value 1 to the second control signal input terminal of the multiplexer 92 when it is 0 or less, while outputs a data value 0 of the multiplexer 92 when it is 1 or more. Output to the second control signal input terminal. The comparator 94 compares the input data value with the threshold value Cth, and when the input data value ≧ Cth, the comparator 94 outputs the data value 1 to the first control signal input terminal of the multiplexer 92, while the input data value When <Cth, the data value 0 is output to the first control signal input terminal of the multiplexer 92. Here, a control signal to each control signal input terminal to the multiplexer 92 is represented by CS 91 (A, B), A is an input value to the first control signal terminal, and B is a second control signal input terminal. Input value to. A control signal to each control signal input terminal to the multiplexer 110 is similarly represented by CS 110 (A, B). The multiplexer 92 selects the data value 0 when the control signal CS92 (0, 0) is selected and outputs it to the first input terminal of the adder 50, and adds a minus to the decrease amount Vdec when the control signal CS92 (0, 1). The data value -Vdec is selected and output to the first input terminal of the adder 50, and the control signal CS92 (1, *) (where * indicates an indefinite value; the same applies hereinafter). At this time, the increase amount Vinc is selected and output to the first input terminal of the adder 50. The adder 50 adds the two input data values, and outputs the added data value to the comparators 111 and 112 and the third input terminal of the multiplexer 110.

比較器111は入力されるデータ値を0と比較し、入力データ値≦0であるとき、データ値1を出力する一方、そうでないときにデータ値0を出力する。比較器112は入力されるデータ値を最大値Vmaxと比較し、入力データ値≧Vmaxであるとき、データ値1を出力する一方、そうでないときにデータ値0を出力する。マルチプレクサ110は制御信号CS110(0,0)のときにデータ値0を選択して予測スラックの更新値としてスラック表20に出力し、制御信号CS110(1,*)のときに最大値Vmaxを選択して予測スラックの更新値としてスラック表20に出力し、制御信号CS110(0,1)のときに加算器50からのデータ値を選択して予測スラックの更新値としてスラック表20に出力する。   The comparator 111 compares the input data value with 0. When the input data value ≦ 0, the comparator 111 outputs the data value 1, while when not, it outputs the data value 0. The comparator 112 compares the input data value with the maximum value Vmax. When the input data value ≧ Vmax, the comparator 112 outputs the data value 1, while otherwise, outputs the data value 0. The multiplexer 110 selects the data value 0 when the control signal CS110 (0, 0) and outputs it to the slack table 20 as the updated value of the predicted slack, and selects the maximum value Vmax when the control signal CS110 (1, *). Then, the updated value of predicted slack is output to the slack table 20, and the data value from the adder 50 is selected and output to the slack table 20 as the updated value of predicted slack when the control signal CS110 (0, 1).

図48は第1の実施形態に係るローカル・スラック予測処理を示すフローチャートである。ここで、予測スラックと信頼性の数値範囲は、0≦信頼性≦Cth,0≦予測スラック≦Vmaxである。   FIG. 48 is a flowchart showing local slack prediction processing according to the first embodiment. Here, the numerical range of predicted slack and reliability is 0 ≦ reliability ≦ Cth, 0 ≦ predicted slack ≦ Vmax.

図48において、ステップS80においてコミットした命令を取得し、ステップS81において到達条件フラグRflag=0であるか否かが判断され、YESのときはステップS82に進む一方、NOのときはステップS85に進む。ステップS82において信頼性の値に増加量Cincを加算し、加算結果を信頼性として挿入し、ステップS83において信頼性≧Cth(しきい値)であるか否かが判断される。ステップS83において、YESのときはステップS84に進む一方、NOのときはステップS88に進む。ステップS84において信頼性を0にリセットし、予測スラックの値に増加量Vincを加算し、加算結果を予測スラックに挿入し、ステップS88に進む。一方、ステップS85において信頼性の値から減少量Cdecを減算し、減算結果を信頼性に挿入し、ステップS86において信頼性=0であるか否かが判断される。ステップS86において、YESのときはステップS87に進む一方、NOのときはステップS88に進む。ステップS87において信頼性を0にリセットし、予測スラックの値から減少量Vdecを減算し、減算結果を予測スラックに挿入した後、ステップS88に進む。そして、ステップS88では、上記の演算結果に基づいてスラック表20を更新し、当該ローカル・スラック予測処理を終了する。   In FIG. 48, the committed instruction is acquired in step S80, and it is determined in step S81 whether the reaching condition flag Rflag = 0 or not. If YES, the process proceeds to step S82, and if NO, the process proceeds to step S85. . In step S82, the increase amount Cinc is added to the reliability value, and the addition result is inserted as reliability. In step S83, it is determined whether or not reliability ≧ Cth (threshold value). If YES in step S83, the process proceeds to step S84. If NO, the process proceeds to step S88. In step S84, the reliability is reset to 0, the increment Vinc is added to the predicted slack value, the addition result is inserted into the predicted slack, and the process proceeds to step S88. On the other hand, the reduction amount Cdec is subtracted from the reliability value in step S85, and the subtraction result is inserted into the reliability. In step S86, it is determined whether or not reliability = 0. If YES in step S86, the process proceeds to step S87. If NO, the process proceeds to step S88. In step S87, the reliability is reset to 0, the decrease amount Vdec is subtracted from the predicted slack value, and the subtraction result is inserted into the predicted slack. Then, the process proceeds to step S88. In step S88, the slack table 20 is updated based on the calculation result, and the local slack prediction process is terminated.

図47は、本発明の第4の実施形態に係る更新ユニット30Aを備えたプロセッサ10の構成を示すブロック図である。第4の実施形態に係る提案機構は、プロセッサ10に対して、スラック表20と更新ユニット30Aをさらに備えて構成されたことを特徴とする。ここで、スラック表20は命令毎の予測スラックと信頼性を保持する。更新ユニット30Aは、スラック表20の予測スラックと信頼性を更新するための論理回路である。図47の提案機構は、図46の比較機構に比較して、更新ユニット30Aの構成が以下のように異なることを特徴としている。
(1)比較器100をさらに備える。
(2)比較器100と、マルチプレクサ91との間に、2個のマルチプレクサ101,102を備える。
(3)比較器100と、比較器94との間に、マルチプレクサ103を備える。
(4)比較器100と、マルチプレクサ92との間に2個のマルチプレクサ104,105を備える。
FIG. 47 is a block diagram showing a configuration of the processor 10 including the update unit 30A according to the fourth embodiment of the present invention. The proposed mechanism according to the fourth embodiment is characterized in that the processor 10 is further provided with a slack table 20 and an update unit 30A. Here, the slack table 20 holds the predicted slack and reliability for each instruction. The update unit 30A is a logic circuit for updating the predicted slack and reliability of the slack table 20. The proposed mechanism of FIG. 47 is characterized in that the configuration of the update unit 30A is different from that of the comparison mechanism of FIG. 46 as follows.
(1) A comparator 100 is further provided.
(2) Two multiplexers 101 and 102 are provided between the comparator 100 and the multiplexer 91.
(3) A multiplexer 103 is provided between the comparator 100 and the comparator 94.
(4) Two multiplexers 104 and 105 are provided between the comparator 100 and the multiplexer 92.

プロセッサ10は、主記憶装置9からの命令のフェッチ時に、スラック表20にアクセスし、その命令の予測スラックと信頼性を得る。命令実行時に以下の振る舞いが観測されると、予測スラックが実スラックに到達したと判断して、その命令に対応する到達条件フラグRflagを1にセットする。分岐予測ミス、キャッシュミス、フォワーディング。命令コミット時に、コミットした命令の予測スラック、到達条件フラグRflag、信頼性を更新ユニット30Aに送る。更新ユニット30Aは、プロセッサ10から受け取ったこれらの値を入力として、新たな予測スラックと信頼性を計算し、スラック表20を更新する。スラック表20は、命令毎に予測スラックと信頼性を保持する。本実施形態では、命令実行時の振舞を観測して、予測スラックが実スラックよりも小さいかどうかを判定する。信頼性は、この判定がどの程度信頼できるかを示している。   The processor 10 accesses the slack table 20 when fetching an instruction from the main storage device 9, and obtains the predicted slack and reliability of the instruction. When the following behavior is observed when an instruction is executed, it is determined that the predicted slack has reached the actual slack, and the arrival condition flag Rflag corresponding to the instruction is set to 1. Branch misprediction, cache miss, forwarding. At the time of instruction commit, the predicted slack, arrival condition flag Rflag, and reliability of the committed instruction are sent to the update unit 30A. The update unit 30A uses these values received from the processor 10 as inputs, calculates new predicted slack and reliability, and updates the slack table 20. The slack table 20 holds predicted slack and reliability for each instruction. In this embodiment, the behavior at the time of instruction execution is observed to determine whether the predicted slack is smaller than the actual slack. Reliability indicates how reliable this determination is.

本実施形態では、更新ユニット30Aの構成をできるだけ簡潔にするため、更新パラメータを切り替えるしきい値Sthを1箇所に限定する。従って、各更新パラメータは、スラックがこのしきい値Sth未満のときに用いるパラメータと、しきい値Sth以上のときに用いるパラメータの2種類に分かれる。図47において、各パラメータには、前者の場合s0が、後者の場合s1が付加されている。   In the present embodiment, in order to simplify the configuration of the update unit 30A as much as possible, the threshold value Sth for switching update parameters is limited to one location. Therefore, each update parameter is divided into two types: a parameter used when slack is less than the threshold value Sth and a parameter used when the slack is equal to or greater than the threshold value Sth. In FIG. 47, s0 is added to each parameter in the former case, and s1 is added in the latter case.

更新ユニット30は、比較器100を用いて、予測スラックとしきい値Sthの大小関係を調べる。そして、その結果に基づき、マルチプレクサ91,92,101−105を用いて、更新に用いるパラメータを選択する。選択されたパラメータを用いて、信頼性と予測スラックを計算する。具体的に述べると、信頼性は、到達条件フラグRflagが0のとき増加量Cinc_s0(Cinc_s1)だけ増加させ、到達条件フラグRflagが1の場合減少量Cdec_s0(Cdec_s1)だけ減少させる。そして、予測スラックは、信頼性がしきい値Cth_s0(Cth_s1)以上であれば増加量Vinc_s0(Vinc_s1)増加させ、信頼性が0であれば減少量Vdec_s0(Vdec_s1)だけ減少させる。どちらでもなければそのままの値を維持する。なお、ここで、( )内は上述の後者の場合である。   The update unit 30 uses the comparator 100 to check the magnitude relationship between the predicted slack and the threshold value Sth. Based on the result, the multiplexers 91, 92, and 101-105 are used to select parameters for updating. Calculate reliability and predicted slack using selected parameters. Specifically, the reliability is increased by an increase amount Cinc_s0 (Cinc_s1) when the arrival condition flag Rflag is 0, and is decreased by a decrease amount Cdec_s0 (Cdec_s1) when the arrival condition flag Rflag is 1. The predicted slack is increased by an increase amount Vinc_s0 (Vinc_s1) if the reliability is equal to or higher than the threshold value Cth_s0 (Cth_s1), and is decreased by a decrease amount Vdec_s0 (Vdec_s1) if the reliability is zero. If neither, keep the value as it is. Here, the inside of () is the latter case described above.

図47の構成について、図46との相違点について以下詳細説明する。図47において、比較器100はプロセッサ10から入力される予測スラックを所定のしきい値Sthと比較し、予測スラック≧Sthであるときデータ値1をマルチプレクサ101,102,103,104の各制御信号入力端子に出力する一方、そうでないとき、データ値0を同様に出力する。マルチプレクサ101は制御信号のデータ値0のとき増加量Cinc_s0を選択してマルチプレクサ91の第1の入力端子に出力する一方、制御信号のデータ値1のとき増加量Cinc_s1を選択してマルチプレクサ91の第1の入力端子に出力する。マルチプレクサ102は制御信号のデータ値0のとき減少量のマイナス値−Cdec_s0を選択してマルチプレクサ91の第2の入力端子に出力する一方、制御信号のデータ値1のとき減少量のマイナス値−Cdec_s1を選択してマルチプレクサ91の第2の入力端子に出力する。マルチプレクサ103は制御信号のデータ値0のときしきい値Cth_s0を選択して比較器94の制御信号入力端子に出力する一方、制御信号のデータ値1のときしきい値Cth_s1を選択して比較器94の制御信号入力端子に出力する。マルチプレクサ104は制御信号のデータ値0のとき増加量Vinc_s0を選択してマルチプレクサ92の第1の入力端子に出力する一方、制御信号のデータ値1のとき増加量Vinc_s1を選択してマルチプレクサ92の第1の入力端子に出力する。マルチプレクサ105は制御信号のデータ値0のとき減少量のマイナス値−Vdec_s0を選択してマルチプレクサ92の第2の入力端子に出力する一方、制御信号のデータ値1のとき減少量のマイナス値−Vdec_s1を選択してマルチプレクサ92の第2の入力端子に出力する。   With respect to the configuration of FIG. 47, differences from FIG. 46 will be described in detail below. In FIG. 47, the comparator 100 compares the predicted slack input from the processor 10 with a predetermined threshold value Sth, and when the predicted slack ≧ Sth, the data value 1 is assigned to each control signal of the multiplexers 101, 102, 103, 104. While outputting to the input terminal, otherwise, the data value 0 is output similarly. The multiplexer 101 selects the increase amount Cinc_s0 when the data value of the control signal is 0 and outputs it to the first input terminal of the multiplexer 91, while selecting the increase amount Cinc_s1 when the data value of the control signal is 1 and selects the increase amount Cinc_s1. 1 to the input terminal. The multiplexer 102 selects the minus value −Cdec_s0 of the decrease amount when the data value of the control signal is 0 and outputs it to the second input terminal of the multiplexer 91, while the minus value −Cdec_s1 of the decrease amount when the data value of the control signal is 1. Is output to the second input terminal of the multiplexer 91. The multiplexer 103 selects the threshold value Cth_s0 when the data value of the control signal is 0 and outputs it to the control signal input terminal of the comparator 94, while selecting the threshold value Cth_s1 when the data value of the control signal is 1, the comparator 103 It outputs to 94 control signal input terminals. The multiplexer 104 selects the increase amount Vinc_s0 when the data value of the control signal is 0 and outputs it to the first input terminal of the multiplexer 92, while selecting the increase amount Vinc_s1 when the data value of the control signal is 1 and selects the increase amount Vinc_s1. 1 to the input terminal. The multiplexer 105 selects the minus value −Vdec_s0 of the decrease amount when the data value of the control signal is 0 and outputs it to the second input terminal of the multiplexer 92, while the minus value −Vdec_s1 of the decrease amount when the data value of the control signal is 1. Is output to the second input terminal of the multiplexer 92.

第4の実施形態において、調整に関係する更新パラメータとその内容を以下に再掲する。
Vmax:予測スラックの最大値、
Vmin:予測スラックの最小値(=0)、
Vinc:予測スラックの1回あたりの増加量、
Vdec:予測スラックの1回あたりの減少量、
Vmax:信頼性の最大値(=Cth)、
Cmin:信頼性の最小値(=0)、
Cth:信頼性のしきい値、
Cinc:信頼性の1回あたりの増加量、及び
Cdec:信頼性の1回あたりの減少量。
In the fourth embodiment, update parameters related to the adjustment and their contents are listed below.
Vmax: the maximum value of predicted slack,
Vmin: the minimum value of predicted slack (= 0),
Vinc: Increase in predicted slack per time,
Vdec: the amount of decrease in predicted slack per time,
Vmax: maximum value of reliability (= Cth),
Cmin: minimum value of reliability (= 0),
Cth: threshold of reliability,
Cinc: the amount of increase in reliability per time, and Cdec: the amount of decrease in reliability per time.

ただし、常に、最大値Vmin=0、最小値Cmin=0である。また、信頼性は、しきい値Cth以上になると0にリセットされるので、常に、最大値Cmax=Cthである。従って、変更することのできる更新パラメータは以下の6種類となる:Vmax,Vinc,Vdec,Cth,Cinc,Cdec。   However, the maximum value Vmin = 0 and the minimum value Cmin = 0 are always set. Further, since the reliability is reset to 0 when the threshold value is equal to or greater than the threshold value Cth, the maximum value Cmax is always Cth = Cth. Therefore, there are six types of update parameters that can be changed: Vmax, Vinc, Vdec, Cth, Cinc, Cdec.

図48のフローチャートには、信頼性と予測スラックを計算する手順を示しおり、図48に示したように、コミットした命令のターゲット・スラック到達条件が成立していなければ(すなわち、到達条件フラグRflagが0であれば)、信頼性を増加量Cincだけ増加させ、成立していれば(すなわち、到達条件フラグRflagが1であれば)、減少量Cdecだけ減少させる。信頼性がしきい値Cth以上になったら、予測スラックを増加量Vincだけ増加させ、信頼性を0にリセットする。一方、信頼性が0になったら、予測スラックを減少量Vdecだけ減少させる。   The flowchart of FIG. 48 shows a procedure for calculating reliability and predicted slack. As shown in FIG. 48, if the target slack arrival condition of the committed instruction is not satisfied (that is, the arrival condition flag Rflag). If it is 0), the reliability is increased by the increase amount Cinc, and if it is satisfied (that is, if the reaching condition flag Rflag is 1), the reliability is decreased by the decrease amount Cdec. When the reliability exceeds the threshold Cth, the predicted slack is increased by the increase amount Vinc, and the reliability is reset to zero. On the other hand, when the reliability becomes 0, the predicted slack is decreased by the decrease amount Vdec.

そして、更新パラメータが、信頼性や予測スラックの更新にどのように影響するかを定性的に説明する。図49は、第4の実施形態に係る手法による効果を示す図であって、更新パラメータと予測スラックの変化との関係を示すグラフである。すなわち、図49に説明の理解を容易にするため、予測スラックの変化の仕方と更新パラメータとの関係を示す。簡単のため、一定サイクル毎に同じ命令が実行されるプログラムを仮定する。このサイクルをαとする。図49において、縦軸はスラックを示し、横軸は時刻を示す。折れ線グラフは、点線が実スラックの場合、実線が予測スラックの場合である。   Then, how the update parameter affects the reliability and the update of the predicted slack will be described qualitatively. FIG. 49 is a graph showing the effect of the technique according to the fourth embodiment, and is a graph showing the relationship between the update parameter and the predicted slack change. That is, FIG. 49 shows the relationship between how the predicted slack changes and the update parameters in order to facilitate understanding of the description. For simplicity, assume a program in which the same instruction is executed every certain cycle. Let this cycle be α. In FIG. 49, the vertical axis indicates slack, and the horizontal axis indicates time. In the line graph, the dotted line is real slack and the solid line is predicted slack.

予測スラックの最大値Vmaxを増加させると、予測スラックの平均(平均予測スラック)が大きくなる。その結果、スラック命令数も増加する。しかし、予測ミス(ここでは予測スラックが実スラックを上回ること)の発生する確率が高くなり、性能が低くなる。   When the maximum value Vmax of predicted slack is increased, the average of predicted slack (average predicted slack) increases. As a result, the number of slack instructions also increases. However, the probability of occurrence of a misprediction (here, predicted slack exceeds actual slack) increases and performance decreases.

増加量Vincを増加させると、平均予測スラックが大きくなる。その結果、スラック命令数も増加する。しかし、予測ミスの発生率が高くなり、性能が低下する。また、予測スラックの増加量を細かく制御できなくなるため、収束性が悪くなる。ここでは予測スラックの取りうる値が実スラックと一致しない場合が増えることを指す。   When the increase amount Vinc is increased, the average predicted slack increases. As a result, the number of slack instructions also increases. However, the rate of occurrence of mispredictions increases and performance decreases. In addition, since the amount of increase in predicted slack cannot be finely controlled, convergence is deteriorated. Here, it indicates that the number of predicted slack values that do not match actual slack increases.

減少量Vdecを増加させると、予測ミスの発生率が低くなり、性能が向上する。しかし、平均予測スラックは小さくなる。その結果、スラック命令数も減少する。また、予測スラックの減少量を細かく制御できなくなるため、収束性が悪くなる。   When the decrease amount Vdec is increased, the occurrence rate of a prediction error is lowered and the performance is improved. However, the average predicted slack becomes smaller. As a result, the number of slack instructions is also reduced. In addition, since the amount of decrease in predicted slack cannot be finely controlled, convergence is deteriorated.

しきい値Cthは、増加量Cinc及び減少量Cdecと関連が強いため、これらと組み合わせて説明する。しきい値Cthと増加量Cincの比であるCth/Cincを増加させると、予測スラックを増加させる間隔(図49における、Cth/Cinc×α)が広くなる。つまり、予測スラックを増加させる頻度が低くなる。これにより、予測ミスの発生率が低くなり、性能が向上する。しかし、平均予測スラックは小さくなる。その結果、スラック命令数も減少する。   The threshold value Cth is strongly related to the increase amount Cinc and the decrease amount Cdec, and will be described in combination with them. When Cth / Cinc, which is the ratio between the threshold value Cth and the increase amount Cinc, is increased, the interval for increasing the predicted slack (Cth / Cinc × α in FIG. 49) becomes wider. That is, the frequency of increasing the predicted slack is reduced. As a result, the occurrence rate of prediction errors is reduced, and the performance is improved. However, the average predicted slack becomes smaller. As a result, the number of slack instructions is also reduced.

しきい値Cthと減少量Cdecの比であるCth/Cdecを増加させると、予測スラックを減少させる間隔(図49における、Cth/Cdec×α)が広くなる。つまり、予測スラックを減少させる頻度が低くなる。これにより、平均予測スラックは大きくなる。その結果、スラック命令数も増加する。しかし、予測ミスの発生率が高くなり、性能が低下する。   When Cth / Cdec, which is the ratio between the threshold value Cth and the reduction amount Cdec, is increased, the interval (Cth / Cdec × α in FIG. 49) at which the predicted slack is decreased becomes wider. In other words, the frequency of decreasing the predicted slack is reduced. This increases the average predicted slack. As a result, the number of slack instructions also increases. However, the rate of occurrence of mispredictions increases and performance decreases.

以上説明したように、本実施形態によれば、命令の実行に際して上記スラック表を参照して当該命令の予測スラックを取得するとともに、上記取得した予測スラックの分だけ実行レイテンシを増加させ、上記命令の実行時の振る舞いに基づき、当該命令の現状のローカル・スラックの適正値であるターゲット・スラックに上記予測スラックが到達したか否かを推定し、上記予測スラックが上記ターゲット・スラックに到達したとの推定がなされるまで、上記予測スラックを上記命令の実行毎に徐々に増加させる。従って、命令のローカル・スラックの予測値(予測スラック)を計算で直接的に求めるのではなく、命令の実行時の振る舞いを観測しながら、適正値に到達するまで予測スラックを徐々に増加させることで求めているので、予測スラックの直接演算に要する複雑な機構は不要であり、より簡易な構成でローカル・スラックの予測を行うことができる。   As described above, according to the present embodiment, the instruction slack is obtained by referring to the slack table at the time of executing the instruction, and the execution latency is increased by the amount of the obtained predicted slack. Based on the execution behavior of the instruction, it is estimated whether or not the predicted slack has reached the target slack that is the appropriate value of the current local slack of the instruction, and the predicted slack has reached the target slack. Until the above estimation is made, the predicted slack is gradually increased for each execution of the instruction. Therefore, instead of directly calculating the predicted value of local slack of the instruction (predicted slack), the predicted slack is gradually increased until the appropriate value is reached while observing the behavior at the time of execution of the instruction. Therefore, a complicated mechanism required for direct calculation of predicted slack is not required, and local slack can be predicted with a simpler configuration.

また、ローカル・スラックの値に応じて、スラックの更新に用いるパラメータを変更するようにしたので、スラック命令数を維持したまま、性能低下を抑制できるようになる。それ故、従来技術に比較して簡単な構成で、ローカル・スラックの予測を行い、さらに高速でプログラム命令の実行を行うことができる。   Further, since the parameters used for slack update are changed according to the value of local slack, it is possible to suppress performance degradation while maintaining the number of slack instructions. Therefore, it is possible to perform local slack prediction and execute program instructions at a higher speed with a simpler configuration as compared with the prior art.

本発明に係るプロセッサ装置とその処理方法によれば、所定のしきい値以上の予測スラックを有するストア命令を、当該ストア命令に後続するロード命令とデータの依存関係がないと予測して判断し、当該ストア命令のメモリ・アドレスが判明していなくても上記後続するロード命令を投機的に実行する。従って、予測が正しければ、ストア命令のスラックの利用によって、当該ストア命令とはデータ依存関係がないロード命令の実行が遅延することはなく、プロセッサ装置の性能への悪影響を抑制することができる。また、スラック予測機構の出力結果を利用するために、ストア命令とロード命令間の依存関係を予測するためのハードウェアを新たに用意する必要がない。それ故、従来技術に比較して簡単な構成で、ローカル・スラックの予測を行い、高速でプログラム命令の実行を行うことができる。   According to the processor device and the processing method thereof according to the present invention, a store instruction having predicted slack equal to or greater than a predetermined threshold is determined by predicting that there is no dependency between the load instruction and data following the store instruction. Even if the memory address of the store instruction is not known, the subsequent load instruction is speculatively executed. Therefore, if the prediction is correct, the use of the slack of the store instruction does not delay the execution of the load instruction having no data dependency with the store instruction, and the adverse effect on the performance of the processor device can be suppressed. In addition, in order to use the output result of the slack prediction mechanism, it is not necessary to prepare new hardware for predicting the dependency between the store instruction and the load instruction. Therefore, local slack can be predicted and program instructions can be executed at a high speed with a simpler configuration compared to the prior art.

また、本発明に係るプロセッサ装置とその処理方法によれば、共有化情報に基づくスラック予測方法である第2の予測方法を用いて、ローカル・スラックを持つ命令に基づいて、ローカル・スラックを持たない命令間で依存元から依存先へと共有可能なスラックが存在するという共有化情報を伝搬させて行き、当該共有化情報に基づいて所定の発見的な手法を用いて各命令が利用するローカル・スラックの量を決定し、ローカル・スラックを持たない命令がローカル・スラックを利用することができるように制御する。従って、ローカル・スラックを持たない命令がローカル・スラックを利用することができるようになり、従来技術に比較して簡単な構成で、ローカル・スラックを有効にかつ十分に利用してローカル・スラックの予測を行い、高速でプログラム命令の実行を行うことができる。   Further, according to the processor device and the processing method thereof according to the present invention, the second prediction method, which is the slack prediction method based on the shared information, is used to have local slack based on an instruction having local slack. Propagating shared information that there is slack that can be shared from the dependency source to the dependency destination among the non-instructions, and using each of the instructions using a predetermined heuristic based on the sharing information Determine the amount of slack and control so that instructions without local slack can use local slack. Therefore, an instruction having no local slack can use the local slack, and the local slack can be used effectively and sufficiently with a simple configuration as compared with the prior art. Predictions can be performed and program instructions can be executed at high speed.

さらに、本発明に係るプロセッサ装置とその処理方法によれば、命令の実行に際して上記スラック表を参照して当該命令の予測スラックを取得するとともに、上記取得した予測スラックの分だけ実行レイテンシを増加させ、上記命令の実行時の振る舞いに基づき、当該命令の現状のローカル・スラックの適正値であるターゲット・スラックに上記予測スラックが到達したか否かを推定し、上記予測スラックが上記ターゲット・スラックに到達したとの推定がなされるまで、上記予測スラックを上記命令の実行毎に徐々に増加させる。従って、命令のローカル・スラックの予測値(予測スラック)を計算で直接的に求めるのではなく、命令の実行時の振る舞いを観測しながら、適正値に到達するまで予測スラックを徐々に増加させることで求めているので、予測スラックの直接演算に要する複雑な機構は不要であり、より簡易な構成でローカル・スラックの予測を行うことができる。   Further, according to the processor device and the processing method thereof according to the present invention, when executing an instruction, the predicted slack of the instruction is acquired by referring to the slack table, and the execution latency is increased by the acquired predicted slack. Based on the behavior at the time of execution of the instruction, it is estimated whether the predicted slack has reached target slack, which is an appropriate value of the current local slack of the instruction, and the predicted slack reaches the target slack. The predicted slack is gradually increased with each execution of the instruction until it is estimated that the instruction has been reached. Therefore, instead of directly calculating the predicted value of local slack of the instruction (predicted slack), the predicted slack is gradually increased until the appropriate value is reached while observing the behavior at the time of execution of the instruction. Therefore, a complicated mechanism required for direct calculation of predicted slack is not required, and local slack can be predicted with a simpler configuration.

また、ローカル・スラックの値に応じて、スラックの更新に用いるパラメータを変更するようにしたので、スラック命令数を維持したまま、性能低下を抑制できるようになる。それ故、従来技術に比較して簡単な構成で、ローカル・スラックの予測を行い、さらに高速でプログラム命令の実行を行うことができる。   Further, since the parameters used for slack update are changed according to the value of local slack, it is possible to suppress performance degradation while maintaining the number of slack instructions. Therefore, it is possible to perform local slack prediction and execute program instructions at a higher speed with a simpler configuration as compared with the prior art.

(a)は従来技術に係るスラックを説明するために用いる複数の命令を含むプログラムの一例を示す図であり、(b)は上記プログラムの各命令をプロセッサ装置上で実行する過程を示すタイミングチャートである。(A) is a figure which shows an example of the program containing several instructions used in order to demonstrate the slack based on a prior art, (b) is a timing chart which shows the process in which each instruction | indication of the said program is performed on a processor apparatus. It is. 従来技術に係るローカル・スラック予測機構を備えたプロセッサ装置の構成を示すブロック図である。It is a block diagram which shows the structure of the processor apparatus provided with the local slack prediction mechanism based on a prior art. (a)は本発明の第1の実施形態に係るローカル・スラックを発見的に予測する手法を用いたプロセッサ装置の基本動作であって、第1回目の実行動作を示すタイミングチャートであり、(b)は上記プロセッサ装置の基本動作であって、第2回目の実行動作を示すタイミングチャートであり、(c)は上記プロセッサ装置の基本動作であって、第3回目の実行動作を示すタイミングチャートである。(A) is a basic operation of the processor device using the method for heuristically predicting local slack according to the first embodiment of the present invention, and is a timing chart showing the first execution operation; b) is a basic operation of the processor device, and is a timing chart showing a second execution operation, and (c) is a basic operation of the processor device, and a timing chart showing a third execution operation. It is. (a)は図3の基本動作の問題点を説明するためのサイクル対スラック特性を示すグラフであり、(b)はその問題点の解決手法を説明するためのサイクル対スラック特性を示すグラフである。(A) is a graph showing the cycle-to-slack characteristics for explaining the problems of the basic operation of FIG. 3, and (b) is a graph showing the cycle-to-slack characteristics for explaining a solution to the problems. is there. (a)は図4の解決手法の問題点を説明するためのサイクル対スラック特性を示すグラフであり、(b)はその問題点の解決手法を説明するためのサイクル対スラック特性を示すグラフである。(A) is a graph showing the cycle vs. slack characteristics for explaining the problem of the solution method of FIG. 4, and (b) is a graph showing the cycle vs. slack characteristic for explaining the solution method of the problem. is there. 本発明の第1の実施形態に係るスラック表20を備えたプロセッサ10の構成を示すブロック図である。It is a block diagram which shows the structure of the processor 10 provided with the slack table | surface 20 which concerns on the 1st Embodiment of this invention. 図6の提案機構の実施例のシミュレーション結果であって、各プログラムにおける実スラックに対する実行命令数に占める割合を示すグラフである。It is a simulation result of the Example of the proposal mechanism of FIG. 6, Comprising: It is a graph which shows the ratio which occupies for the number of execution instructions with respect to the actual slack in each program. 図6の提案機構の実施例のシミュレーション結果であって、予測スラックの最大値Vmax=1における各モデルに対する実行命令数に占める割合(スラック予測精度)を示すグラフである。FIG. 7 is a graph showing a simulation result of the embodiment of the proposed mechanism of FIG. 6 and showing a ratio (slack prediction accuracy) in the number of executed instructions with respect to each model at a predicted slack maximum value Vmax = 1. 図6の提案機構の実施例のシミュレーション結果であって、予測スラックの最大値Vmax=5における各モデルに対する実行命令数に占める割合(スラック予測精度)を示すグラフである。FIG. 7 is a graph showing a simulation result of the embodiment of the proposed mechanism of FIG. 6 and showing a ratio (slack prediction accuracy) in the number of execution instructions for each model at a predicted slack maximum value Vmax = 5. 図6の提案機構の実施例のシミュレーション結果であって、予測スラックの最大値Vmax=15における各モデルに対する実行命令数に占める割合(スラック予測精度)を示すグラフである。FIG. 7 is a graph showing a simulation result of the embodiment of the proposed mechanism of FIG. 6 and showing a ratio (slack prediction accuracy) in the number of execution instructions for each model at a maximum predicted slack value Vmax = 15. 図6の提案機構の実施例のシミュレーション結果であって、予測スラックの最大値Vmax=1において各モデルにおける実スラックと予測スラックの差に対する実行命令数に占める割合を示すグラフである。FIG. 7 is a graph showing a simulation result of the embodiment of the proposed mechanism of FIG. 6 and showing a ratio of the number of executed instructions to a difference between actual slack and predicted slack in each model at the maximum predicted slack value Vmax = 1. 図6の提案機構の実施例のシミュレーション結果であって、予測スラックの最大値Vmax=5において各モデルにおける実スラックと予測スラックの差に対する実行命令数に占める割合を示すグラフである。FIG. 7 is a graph showing a simulation result of the embodiment of the proposed mechanism of FIG. 6 and showing a ratio of the number of executed instructions to a difference between actual slack and predicted slack in each model at the maximum predicted slack value Vmax = 5. 図6の提案機構の実施例のシミュレーション結果であって、予測スラックの最大値Vmax=15において各モデルにおける実スラックと予測スラックの差に対する実行命令数に占める割合を示すグラフである。FIG. 7 is a graph showing a simulation result of the embodiment of the proposed mechanism of FIG. 6 and showing a ratio of the number of executed instructions to a difference between actual slack and predicted slack in each model at the maximum predicted slack value Vmax = 15. 図6の提案機構の実施例のシミュレーション結果であって、各モデルにおける正規化されたIPC(Instructions Per Clock cycle:1クロック当りに処理できる平均命令数)を示すグラフである。It is a simulation result of the Example of the proposal mechanism of FIG. 6, Comprising: It is a graph which shows IPC (Instructions Per Clock cycle: average number of instructions which can be processed per clock) in each model normalized. 図6の提案機構の実施例のシミュレーション結果であって、各モデルにおけるスラック命令数の割合を示すグラフである。It is a simulation result of the Example of the proposal mechanism of FIG. 6, Comprising: It is a graph which shows the ratio of the number of slack instructions in each model. 図6の提案機構の実施例のシミュレーション結果であって、各モデルにおける平均予測スラックを示すグラフである。It is a simulation result of the Example of the proposal mechanism of FIG. 6, Comprising: It is a graph which shows the average prediction slack in each model. 図6の提案機構の別の実施例のシミュレーション結果であって、予測スラックの最大値Vmaxの各値に対するスラック命令数とIPCとの関係を示すグラフである。It is a simulation result of another Example of the proposal mechanism of FIG. 6, Comprising: It is a graph which shows the relationship between the number of slack instructions with respect to each value of the maximum value Vmax of prediction slack, and IPC. 図6の提案機構の別の実施例のシミュレーション結果であって、IPCに対する予測スラックの総積算値を示すグラフである。It is a simulation result of another Example of the proposal mechanism of FIG. 6, Comprising: It is a graph which shows the total integrated value of the prediction slack with respect to IPC. 本発明の第1の実施形態に係る更新ユニット30の構成を示すブロック図である。It is a block diagram which shows the structure of the update unit 30 which concerns on the 1st Embodiment of this invention. 従来技術に係る従来機構のシミュレーション結果であって、ラインサイズに対するスラック長のアクセス時間を示すグラフである。It is a simulation result of the conventional mechanism which concerns on a prior art, Comprising: It is a graph which shows the access time of slack length with respect to line size. 図19の更新ユニット30を備えた提案機構のシミュレーション結果であって、ラインサイズに対するスラック長のアクセス時間を示すグラフである。It is a simulation result of the proposed mechanism provided with the update unit 30 of FIG. 19, Comprising: It is a graph which shows the access time of slack length with respect to line size. 図19の更新ユニット30を備えた提案機構のシミュレーション結果であって、ラインサイズに対するメモリ定義表のアクセス時間を示すグラフである。It is a simulation result of the proposed mechanism provided with the update unit 30 of FIG. 19, Comprising: It is a graph which shows the access time of the memory definition table with respect to line size. 本発明の第1の実施形態の第1の変形例に係る、スラック表20を備えたプロセッサ10Aの構成を示すブロック図である。It is a block diagram showing the composition of processor 10A provided with slack table 20 concerning the 1st modification of a 1st embodiment of the present invention. 図23のプロセッサ10Aの実施例のシミュレーション結果であって、各プログラムに対する正規化されたIPCを示すグラフである。It is a simulation result of the Example of the processor 10A of FIG. 23, Comprising: It is a graph which shows the normalized IPC with respect to each program. 図23のプロセッサ10Aの実施例のシミュレーション結果であって、各プログラムに対する正規化されたEDP(Energy Delay Product:消費エネルギーと、プロセッサ10Aの実行時間の積)を示すグラフである。FIG. 24 is a graph showing simulation results of the example of the processor 10A of FIG. 23 and showing normalized EDP (Energy Delay Product: product of energy consumption and execution time of the processor 10A) for each program; 図23のプロセッサ10Aの別の実施例のシミュレーション結果であって、各プログラムに対する正規化されたIPCを示すグラフである。FIG. 24 is a graph showing simulation results of another example of the processor 10 </ b> A of FIG. 23 and showing normalized IPC for each program. FIG. 図23のプロセッサ10Aの別の実施例のシミュレーション結果であって、各プログラムに対する正規化されたEDP(Energy Delay Product:消費エネルギーと、プロセッサの実行時間の積)を示すグラフである。It is a simulation result of another Example of the processor 10A of FIG. 23, Comprising: It is a graph which shows the normalized EDP (Energy Delay Product: product of consumption energy and processor execution time) with respect to each program. 本発明の第1の実施形態の第2の変形例に係る、スラック表20及び2個のインデクス生成回路22A,22Bを備えたプロセッサ10の構成を示すブロック図である。It is a block diagram which shows the structure of the processor 10 provided with the slack table | surface 20 and two index production | generation circuits 22A and 22B based on the 2nd modification of the 1st Embodiment of this invention. 第1の実施形態に係るスラック予測機構において、制御フローを考慮せずにスラック予測を行うときの動作例を示す図である。It is a figure which shows the operation example when performing slack prediction in the slack prediction mechanism which concerns on 1st Embodiment, without considering a control flow. 図28のスラック予測機構において、制御フローを考慮してスラック予測を行うときの第1の動作例を示す図である。FIG. 29 is a diagram illustrating a first operation example when slack prediction is performed in consideration of the control flow in the slack prediction mechanism of FIG. 28. 図28のスラック予測機構において、制御フローを考慮してスラック予測を行うときの第2の動作例を示す図である。It is a figure which shows the 2nd operation example when performing slack prediction in consideration of a control flow in the slack prediction mechanism of FIG. (a)は、従来技術においてストア命令のスラックを利用したときにメモリの曖昧性が原因で発生する問題点を説明するための図であって、デコード前のプログラムを示す図であり、(b)は、従来技術においてストア命令のスラックを利用したときにメモリの曖昧性が原因で発生する問題点を説明するための図であって、デコード後のプログラムを示す図である。(A) is a figure for demonstrating the problem which arises by the ambiguity of memory when the slack of a store instruction is used in a prior art, Comprising: It is a figure which shows the program before decoding, (b) ) Is a diagram for explaining a problem that occurs due to the ambiguity of the memory when the slack of the store instruction is used in the prior art, and shows a program after decoding. (a)は、プロセッサの処理において、メモリの曖昧性がスラックの利用に与える影響を説明するために用いる図であって、スラックを利用しない場合のプログラムを実行する過程を示すタイミングチャートであり、(b)は、プロセッサの処理において、メモリの曖昧性がスラックの利用に与える影響を説明するために用いる図であって、スラックを利用する場合のプログラムを実行する過程を示すタイミングチャートである。(A) is a diagram used to explain the influence of memory ambiguity on the use of slack in the processing of the processor, and is a timing chart showing the process of executing a program when slack is not used; (B) is a diagram used for explaining the influence of memory ambiguity on the use of slack in the processing of the processor, and is a timing chart showing the process of executing a program when using slack. 本発明の第2の実施形態に係る、メモリの曖昧性の投機的除去を示すタイミングチャートである。6 is a timing chart showing speculative removal of memory ambiguity, according to a second embodiment of the present invention. 図34のメモリの曖昧性の投機的除去機構を備えたプロセッサ10Bの構成を示すブロック図である。It is a block diagram which shows the structure of the processor 10B provided with the speculative removal mechanism of the memory ambiguity of FIG. 図35のロード及びストアキュー(LSQ)62にエントリされるデータのフォーマットを示す図である。It is a figure which shows the format of the data entered into the load and store queue (LSQ) 62 of FIG. ロード命令に対する図35のLSQ62の処理を示すフローチャートである。It is a flowchart which shows the process of LSQ62 of FIG. 35 with respect to a load instruction. ストア命令に対する図35のLSQ62の処理を示すフローチャートである。It is a flowchart which shows the process of LSQ62 of FIG. 35 with respect to a store instruction. 従来技術に係るスラックの説明に用いるプログラムを示すタイミングチャートである。It is a timing chart which shows the program used for description of the slack concerning a prior art. (a)は従来技術の手法に係るスラックの利用を説明するプログラムを示すタイミングチャートであり、(b)は本発明の第2の実施形態に係る、スラック命令数を増加させる手法に係るスラックの利用を説明するプログラムを示すタイミングチャートである。(A) is a timing chart which shows the program explaining utilization of the slack which concerns on the technique of a prior art, (b) is the slack of the technique which increases the number of slack instructions based on the 2nd Embodiment of this invention. It is a timing chart which shows the program explaining utilization. 本発明の第3の実施形態に係る、スラック伝搬表80などを備えたプロセッサ10の構成を示すブロック図である。It is a block diagram which shows the structure of the processor 10 provided with the slack propagation | transmission table | surface 80 etc. based on the 3rd Embodiment of this invention. 図41の更新ユニット30によって実行されるローカル・スラック予測処理を示すフローチャートである。42 is a flowchart showing a local slack prediction process executed by the update unit 30 of FIG. 41. 図42のサブルーチンであって、共有化情報の伝搬処理(S41)を示すフローチャートである。FIG. 43 is a flowchart showing a sharing information propagation process (S41) in the subroutine of FIG. 42. FIG. 図41の更新ユニット30によって実行される共有化スラックの予測処理を示すフローチャートである。It is a flowchart which shows the prediction process of the shared slack performed by the update unit 30 of FIG. 本発明者の調査結果に係る、実スラックに対する実行命令数に占める割合を示すグラフである。It is a graph which shows the ratio which occupies for the number of execution instructions with respect to real slack based on the investigation result of this inventor. 第1の実施形態に係る更新ユニット30を備えたプロセッサ10の構成を示すブロック図である。It is a block diagram which shows the structure of the processor 10 provided with the update unit 30 which concerns on 1st Embodiment. 本発明の第4の実施形態に係る更新ユニット30Aを備えたプロセッサ10の構成を示すブロック図である。It is a block diagram which shows the structure of the processor 10 provided with the update unit 30A which concerns on the 4th Embodiment of this invention. 第1の実施形態に係るローカル・スラック予測処理を示すフローチャートである。It is a flowchart which shows the local slack prediction process which concerns on 1st Embodiment. 第4の実施形態に係る手法による効果を示す図であって、更新パラメータと予測スラックの変化との関係を示すグラフである。It is a figure which shows the effect by the method which concerns on 4th Embodiment, Comprising: It is a graph which shows the relationship between the update parameter and the change of prediction slack.

符号の説明Explanation of symbols

1,1A…実行コア、
2…レジスタ定義表、
3…メモリ定義表、
4…マルチプレクサ、
5…減算器、
6…スラック表、
7…フロントエンド、
8…バックエンド、
9…主記憶装置、
10,10A,10B…プロセッサ、
11…フェッチ・ユニット、
11A…命令キャッシュ、
12…デコード・ユニット、
12a…命令デコーダ部、
12b…タグ割当部、
13…命令ウィンドウ(I−win)、
14…レジスタ・ファイル(RF)、
14A…リザベーション・ステーション、
15,15a,15b,15A,15B…実行ユニット(EU)、
16…リオーダ・バッファ(ROB)、
17…FIFO、
20,20A…スラック表、
21A,21B…分岐履歴レジスタ、
22A,22B…インデクス生成回路、
30,30A…更新ユニット、
31,32、35,36…アンドゲート、
33,37…オアゲート、
34,38,39…マルチプレクサ、
40,50…加算器、
41,42,51,52…アンドゲート、
43,44,45,46,53,54,55,56…インバータ、
47,48,49,57,58,59…マルチプレクサ、
60…スラック予測機構、
61…機能ユニット、
62…ロード及びストアキュー(LSQ)、
63…データキャッシュ、
71…オペコード、
72,74,75,77…フラグ、
73…メモリ・アドレス、
76…ストアデータ、
80…スラック伝搬表、
91,95,101,102,103,104,105,110…マルチプレクサ、
92,96…加算器、
93,94,100、111,112…比較器、
120…排他的論理和ゲート。
1, 1A ... execution core,
2 ... Register definition table,
3 ... Memory definition table,
4 ... Multiplexer,
5 ... subtractor,
6 ... Slack table,
7 ... Front end,
8 ... Backend,
9 ... Main memory device,
10, 10A, 10B ... processor,
11: Fetch unit,
11A ... Instruction cache,
12 ... Decoding unit,
12a ... Instruction decoder unit,
12b ... tag allocation unit,
13 ... Instruction window (I-win),
14: Register file (RF),
14A ... Reservation Station,
15, 15a, 15b, 15A, 15B ... execution unit (EU),
16 ... Reorder buffer (ROB),
17 ... FIFO,
20, 20A ... Slack table,
21A, 21B ... branch history register,
22A, 22B ... Index generation circuit,
30, 30A ... Update unit,
31, 32, 35, 36 ... Andgate,
33,37 ... Or gate,
34, 38, 39 ... Multiplexer,
40, 50 ... adder,
41, 42, 51, 52 ... and gate,
43, 44, 45, 46, 53, 54, 55, 56 ... inverter,
47, 48, 49, 57, 58, 59 ... multiplexer,
60 ... Slack prediction mechanism,
61 ... Functional unit,
62 ... Load and store queue (LSQ),
63 ... data cache,
71 ... opcode,
72, 74, 75, 77 ... flags,
73: Memory address,
76 ... Store data,
80 ... Slack propagation table,
91,95,101,102,103,104,105,110 ... multiplexer,
92, 96 ... adder,
93, 94, 100, 111, 112 ... comparator,
120: Exclusive OR gate.

Claims (21)

プロセッサ装置で実行される命令のローカル・スラックの予測値である予測スラックを予測し、上記命令をその予測スラックを利用して実行するプロセッサ装置において、
上記予測スラックを含むスラック表を記憶する記憶手段と、
命令の実行に際して上記スラック表を参照して当該命令の予測スラックを取得するとともに、上記取得した予測スラックの分だけ実行レイテンシを増加させる設定手段と、
上記命令の実行時の振る舞いに基づき、当該命令の現状のローカル・スラックの適正値であるターゲット・スラックに上記予測スラックが到達したか否かを推定する推定手段と、
上記推定手段により上記予測スラックが上記ターゲット・スラックに到達したとの推定がなされるまで、上記予測スラックを上記命令の実行毎に徐々に増加させる更新手段とを備えたことを特徴とするプロセッサ装置。
In a processor device that predicts predicted slack, which is a predicted value of local slack of an instruction executed in the processor device, and executes the instruction using the predicted slack,
Storage means for storing a slack table including the predicted slack;
Setting means for acquiring predicted slack of the instruction with reference to the slack table upon execution of the instruction and increasing execution latency by the amount of the acquired predicted slack;
An estimation means for estimating whether or not the predicted slack has reached the target slack, which is an appropriate value of the current local slack of the instruction, based on the execution behavior of the instruction;
A processor apparatus comprising: update means for gradually increasing the predicted slack for each execution of the instruction until the estimated means has estimated that the predicted slack has reached the target slack. .
上記更新手段は、上記予測スラックの値に応じて、スラック命令数を維持したまま当該プロセッサ装置の性能低下を抑制するように、上記スラックの更新に用いるパラメータを変更することを特徴とする請求項1記載のプロセッサ装置。   The update means, according to the predicted slack value, changes a parameter used for updating the slack so as to suppress a decrease in performance of the processor device while maintaining the number of slack instructions. The processor device according to 1. 上記更新手段は、上記予測スラックが所定のしきい値以上であるか否かに応じて、上記スラックの更新に用いるパラメータを変更することを特徴とする請求項2記載のプロセッサ装置。   3. The processor device according to claim 2, wherein the updating unit changes a parameter used for updating the slack according to whether or not the predicted slack is equal to or greater than a predetermined threshold value. 上記推定手段は、
(A)当該命令の実行時に分岐予測ミスが発生したこと、
(B)当該命令の実行時にキャッシュ・ミスが発生したこと、
(C)後続命令に対するオペランド・フォワーディングが発生したこと、
(D)後続命令に対するストアデータフォワーディングが発生したこと、
(E)当該命令が命令ウィンドウに存在する命令の中で最も古い命令となっていること、
(F)当該命令がリオーダ・バッファに存在する命令の中で最も古い命令となっていること、
(G)当該命令が、上記命令ウィンドウに存在する命令の中で最も古い命令に実行結果を渡す命令となっていること、
(H)当該命令が、同一のサイクルに実行される命令の中で最も多くの後続命令に実行結果を渡す命令となっていること、
(I)当該命令の実行結果を渡すことで、実行可能な状態となる後続命令の数が、予め定められた判定値以上となっていること
のうちの少なくとも1つを上記推定の成立条件として、上記ターゲット・スラックへの上記予測スラックの到達を推定することを特徴とする請求項1乃至3のうちのいずれか1つに記載のプロセッサ装置。
The estimation means is
(A) A branch prediction error occurred during execution of the instruction,
(B) A cache miss occurred during execution of the instruction;
(C) Operand forwarding for the subsequent instruction has occurred,
(D) that store data forwarding has occurred for the subsequent instruction;
(E) the instruction is the oldest instruction in the instruction window;
(F) the instruction is the oldest instruction in the reorder buffer;
(G) The instruction is an instruction that passes the execution result to the oldest instruction in the instruction window.
(H) The instruction is an instruction that passes the execution result to the most subsequent instructions among the instructions executed in the same cycle;
(I) By passing the execution result of the instruction, at least one of the fact that the number of subsequent instructions that can be executed becomes equal to or greater than a predetermined determination value is used as a condition for establishing the above estimation 4. The processor device according to claim 1, wherein arrival of the predicted slack to the target slack is estimated.
上記予測スラックが上記ターゲット・スラックに到達したとの推定の成立条件が成立となったときにそのカウンタ値が増加又は減少され、上記推定の成立条件が不成立となったときにそのカウンタ値が減少又は増加される信頼性カウンタをさらに備え、
上記更新手段は、上記信頼性カウンタのカウンタ値が増加判定値となったことを条件に上記予測スラックを増加させ、上記信頼性カウンタのカウンタ値が減少判定値となったことを条件に上記予測スラックを減少させることを特徴とする請求項1乃至4のうちのいずれか1つに記載のプロセッサ装置。
The counter value is increased or decreased when the condition that the estimated slack has reached the target slack is satisfied, and the counter value is decreased when the estimated condition is not satisfied. Or further comprising an increased reliability counter;
The updating means increases the prediction slack on the condition that the counter value of the reliability counter becomes an increase determination value, and the prediction on the condition that the counter value of the reliability counter becomes a decrease determination value. 5. The processor device according to claim 1, wherein slack is reduced.
上記信頼性カウンタでの上記推定の成立条件の成立時における上記カウンタ値の増加量又は減少量は、上記推定の成立条件の不成立時における上記カウンタ値の減少量又は増加量よりも大きく設定されたことを特徴とする請求項5記載のプロセッサ装置。   The increment or decrement of the counter value when the estimation satisfaction condition is satisfied in the reliability counter is set larger than the decrease or increase of the counter value when the estimation satisfaction condition is not satisfied. 6. The processor device according to claim 5, wherein: 上記カウンタ値の増加量及び減少量は上記各命令の種別により異なるように設定されたことを特徴とする請求項5又は6記載のプロセッサ装置。   7. The processor device according to claim 5, wherein the increment and decrement of the counter value are set so as to differ depending on the type of each instruction. 上記更新手段による各命令の上記予測スラックの1回当たりの更新量は、上記各命令の種別によって異なるように設定されたことを特徴とする請求項1乃至7のうちのいずれか1つに記載のプロセッサ装置。   8. The update amount of each predicted instruction slack of each instruction by the updating means is set to be different depending on the type of each instruction. Processor unit. 上記更新手段によって更新される各命令の上記予測スラックには上限値が設定され、上記上限値は命令の種別によって異なるように設定されたことを特徴とする請求項1乃至8のうちのいずれか1つに記載のプロセッサ装置。   9. An upper limit value is set in the predicted slack of each instruction updated by the updating means, and the upper limit value is set so as to differ depending on the type of instruction. The processor device according to one. プログラムの分岐履歴が記録される分岐履歴レジスタをさらに備え、
上記スラック表は、上記分岐履歴レジスタを参照して得られる分岐パターンの別に上記命令の予測スラックを個別に記録することを特徴とする請求項1乃至9のうちのいずれか1つに記載のプロセッサ装置。
A branch history register for recording the branch history of the program;
10. The processor according to claim 1, wherein the slack table individually records predicted slack of the instruction separately from a branch pattern obtained by referring to the branch history register. apparatus.
プロセッサ装置で実行される命令のローカル・スラックの予測値である予測スラックを予測し、上記命令をその予測スラックを利用して実行するプロセッサ装置の処理方法において、
プロセッサ装置で実行される命令を、上記予測スラックの値分だけその実行レイテンシを増加させて実行し、上記命令の実行時の振る舞いに基づいて、現状におけるローカル・スラックの適正値であるターゲット・スラックに上記予測スラックが到達したか否かを推定し、到達したとの推定がなされるまで上記予測スラックを上記命令の実行毎に徐々に増加させて行くように更新する制御ステップを含むことを特徴とするプロセッサ装置の処理方法。
In a processing method of a processor device that predicts predicted slack, which is a predicted value of local slack of an instruction executed in the processor device, and executes the instruction using the predicted slack.
The instruction executed by the processor unit is executed with the execution latency increased by the value of the predicted slack, and the target slack which is the appropriate value of the current local slack based on the behavior at the time of execution of the instruction. Including a control step of estimating whether or not the predicted slack has been reached and updating the predicted slack so as to gradually increase each time the instruction is executed until it is estimated that the predicted slack has been reached. A processing method of the processor device.
上記制御ステップは、上記予測スラックの値に応じて、スラック命令数を維持したまま当該プロセッサ装置の性能低下を抑制するように、上記スラックの更新に用いるパラメータを変更することを特徴とする請求項11記載のプロセッサ装置の処理方法。   The control step is characterized in that, according to the predicted slack value, a parameter used for updating the slack is changed so as to suppress a decrease in performance of the processor device while maintaining the number of slack instructions. A processing method of the processor device according to 11. 上記制御ステップは、上記予測スラックが所定のしきい値以上であるか否かに応じて、上記スラックの更新に用いるパラメータを変更することを特徴とする請求項12記載のプロセッサ装置の処理方法。   13. The processing method of a processor device according to claim 12, wherein the control step changes a parameter used for updating the slack according to whether or not the predicted slack is equal to or greater than a predetermined threshold value. 上記予測スラックが上記ターゲット・スラックに到達したとの推定の成立条件として、
(A)当該命令の実行時に分岐予測ミスが発生したこと、
(B)当該命令の実行時にキャッシュ・ミスが発生したこと、
(C)後続命令に対するオペランド・フォワーディングが発生したこと、
(D)後続命令に対するストアデータフォワーディングが発生したこと、
(E)当該命令が命令ウィンドウに存在する命令の中で最も古い命令となっていること、
(F)当該命令がリオーダ・バッファに存在する命令の中で最も古い命令となっていること、
(G)当該命令が、上記命令ウィンドウに存在する命令の中で最も古い命令に実行結果を渡す命令となっていること、
(H)当該命令が、同一のサイクルに実行される命令の中で最も多くの後続命令に実行結
果を渡す命令となっていること、
(I)当該命令の実行結果を渡すことで、実行可能な状態となる後続命令の数が、所定の判定値以上となっていること
のうちの少なくとも1つを含むことを特徴とする請求項11乃至13のうちのいずれか1つに記載のプロセッサ装置の処理方法。
As a condition for the estimation that the predicted slack has reached the target slack,
(A) A branch prediction error occurred during execution of the instruction,
(B) A cache miss occurred during execution of the instruction;
(C) Operand forwarding for the subsequent instruction has occurred,
(D) that store data forwarding has occurred for the subsequent instruction;
(E) the instruction is the oldest instruction in the instruction window;
(F) the instruction is the oldest instruction in the reorder buffer;
(G) The instruction is an instruction that passes the execution result to the oldest instruction in the instruction window.
(H) The instruction is an instruction that passes the execution result to the most subsequent instructions among the instructions executed in the same cycle;
(I) including at least one of the number of succeeding instructions that can be executed by passing the execution result of the instruction being a predetermined determination value or more. The processing method of the processor apparatus as described in any one of 11 thru | or 13.
上記予測スラックが上記ターゲット・スラックに到達したとの推定がなされたときには上記予測スラックを減少させることを特徴とする請求項11乃至14のうちのいずれか1つに記載のプロセッサ装置の処理方法。   15. The processing method of a processor device according to claim 11, wherein the predicted slack is decreased when it is estimated that the predicted slack has reached the target slack. 上記予測スラックの増加は、上記予測スラックが上記ターゲット・スラックに到達したとの推定の成立条件の不成立回数が規定の回数となったことを条件に行われ、上記予測スラックの減少は、上記成立条件の成立回数が規定の回数となったことを条件に行われることを特徴とする請求項15記載のプロセッサ装置の処理方法。   The increase in the predicted slack is performed on the condition that the number of times that the estimated condition that the predicted slack has reached the target slack is not satisfied reaches the specified number of times. 16. The processing method of a processor device according to claim 15, wherein the processing is performed on condition that the number of times the condition is satisfied becomes a specified number. 上記予測スラックを増加させるために必要な上記成立条件の不成立回数を、上記予測スラックを減少させるために必要な上記成立条件の成立回数よりも大きく設定したことを特徴とする請求項16記載のプロセッサ装置の処理方法。   17. The processor according to claim 16, wherein the number of times that the satisfaction condition is not satisfied to increase the predicted slack is set to be greater than the number of times that the satisfaction condition is required to decrease the predicted slack. Device processing method. 上記予測スラックの増加は、上記予測スラックが上記ターゲット・スラックに到達したとの推定の成立条件の不成立回数が規定の回数となったことを条件に行われ、上記予測スラックの減少は、上記成立条件の成立を条件に行われることを特徴とする請求項15記載のプロセッサ装置の処理方法。   The increase in the predicted slack is performed on the condition that the number of times that the estimated condition that the predicted slack has reached the target slack is not satisfied reaches the specified number of times. 16. The processing method of a processor device according to claim 15, wherein the processing is performed on condition that the condition is satisfied. 上記規定の回数を、上記命令の種別により異なるように設定したことを特徴とする請求項16乃至18のうちのいずれか1つに記載のプロセッサ装置の処理方法。   19. The processing method of a processor device according to claim 16, wherein the prescribed number of times is set to be different depending on a type of the instruction. 上記命令の種別により、1回当たりの予測スラックの更新量を異なるように設定されたことを特徴とする請求項11乃至19のうちのいずれか1つに記載のプロセッサ装置の処理方法。   20. The processing method of the processor device according to claim 11, wherein the update amount of predicted slack per time is set to be different depending on the type of the instruction. 上記予測スラックの上限値を、上記命令の種別により異なるように設定されたことを特徴とする請求項11乃至20のうちのいずれか1つに記載のプロセッサ装置の処理方法。   21. The processing method of the processor device according to claim 11, wherein an upper limit value of the predicted slack is set to be different depending on a type of the instruction.
JP2007029489A 2006-03-28 2007-02-08 Processor device and processing method therefor Pending JP2007293816A (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2007029489A JP2007293816A (en) 2006-03-28 2007-02-08 Processor device and processing method therefor
US11/717,063 US20070234014A1 (en) 2006-03-28 2007-03-13 Processor apparatus for executing instructions with local slack prediction of instructions and processing method therefor
US12/634,069 US20100095151A1 (en) 2006-03-28 2009-12-09 Processor Apparatus for Executing Instructions with Local Slack Prediction of Instructions and Processing Method Therefor

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2006088454 2006-03-28
JP2007029489A JP2007293816A (en) 2006-03-28 2007-02-08 Processor device and processing method therefor

Publications (1)

Publication Number Publication Date
JP2007293816A true JP2007293816A (en) 2007-11-08

Family

ID=38764356

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007029489A Pending JP2007293816A (en) 2006-03-28 2007-02-08 Processor device and processing method therefor

Country Status (1)

Country Link
JP (1) JP2007293816A (en)

Similar Documents

Publication Publication Date Title
US20070234014A1 (en) Processor apparatus for executing instructions with local slack prediction of instructions and processing method therefor
KR100973951B1 (en) Unaligned memory access prediction
US9891923B2 (en) Loop predictor-directed loop buffer
US6178498B1 (en) Storing predicted branch target address in different storage according to importance hint in branch prediction instruction
JP4027620B2 (en) Branch prediction apparatus, processor, and branch prediction method
US8285937B2 (en) Fused store exclusive/memory barrier operation
US8316187B2 (en) Cache memory including a predict buffer
KR102271992B1 (en) A data processing apparatus and method for controlling performance of speculative vector operations
US20180349144A1 (en) Method and apparatus for branch prediction utilizing primary and secondary branch predictors
WO2022237585A1 (en) Processing method and apparatus, processor, electronic device, and storage medium
Butts et al. Characterizing and predicting value degree of use
US10007524B2 (en) Managing history information for branch prediction
Mittal A survey of value prediction techniques for leveraging value locality
CN110402434B (en) Cache miss thread balancing
EP1739549B1 (en) Branch prediction device, method thereof, and processor
Lee et al. On some implementation issues for value prediction on wide-issue ILP processors
Mutlu et al. Understanding the effects of wrong-path memory references on processor performance
JP2007293814A (en) Processor device and processing method therefor
CN116302106A (en) Apparatus, method, and system for facilitating improved bandwidth of branch prediction units
US20160092235A1 (en) Method and apparatus for improved thread selection
CN101916184B (en) Method for updating branch target address cache in microprocessor and microprocessor
JP2007293816A (en) Processor device and processing method therefor
JP2007293815A (en) Processor device and processing method therefor
Lee et al. On table bandwidth and its update delay for value prediction on wide-issue ILP processors
US20220075624A1 (en) Alternate path for branch prediction redirect

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090602

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090714

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20091208