JP3112861B2 - Microprocessor - Google Patents

Microprocessor

Info

Publication number
JP3112861B2
JP3112861B2 JP09128875A JP12887597A JP3112861B2 JP 3112861 B2 JP3112861 B2 JP 3112861B2 JP 09128875 A JP09128875 A JP 09128875A JP 12887597 A JP12887597 A JP 12887597A JP 3112861 B2 JP3112861 B2 JP 3112861B2
Authority
JP
Japan
Prior art keywords
instruction
instructions
execution
microprocessor
program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP09128875A
Other languages
Japanese (ja)
Other versions
JPH10320196A (en
Inventor
広樹 高橋
聡 多賀谷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP09128875A priority Critical patent/JP3112861B2/en
Publication of JPH10320196A publication Critical patent/JPH10320196A/en
Application granted granted Critical
Publication of JP3112861B2 publication Critical patent/JP3112861B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、複数の命令からな
るプログラムをパイプライン実行するマイクロプロセッ
サの方式に関し、かつ、上記マイクロプロセッサが実行
するプログラムに含まれる命令の実行順序を、その命令
のデータ依存性を参照することで、プログラムの記載順
序以外の順序で実行するマイクロプロセッサであって、
しかも、同時あるいは近傍時間にデータ依存性が解決さ
れた複数の命令をスーパースケーラ実行するプロセッサ
の実行順序を決定する方式および構成に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microprocessor system for executing a program consisting of a plurality of instructions in a pipeline, and the order of execution of instructions contained in the program executed by the microprocessor is stored in the data of the instruction A microprocessor that executes in an order other than the order in which the programs are described by referring to the dependencies,
In addition, the present invention relates to a method and a configuration for determining the execution order of a processor that performs a superscalar execution of a plurality of instructions whose data dependencies have been solved at the same time or near time.

【0002】[0002]

【従来の技術】命令レベルの並列性を抽出しながら並列
実行を行う汎用のマイクロプロセッサにおいては、命令
が必要とする入力データが揃ったかどうかを確認して、
その静的順序に関わらず依存性が解決されたものから動
的に実行順を決定し実行するOutOfOrder実行
形式が一般的である。また、ある時点で実行可能な命令
が使用するリソースの数以上あった場合、実行する命令
の選択方法は、一般的に「古い命令から選択していく」
方法が一般的であり、広く用いられている。
2. Description of the Related Art In a general-purpose microprocessor that performs parallel execution while extracting parallelism at an instruction level, it is necessary to confirm whether input data required by an instruction has been prepared.
Regardless of the static order, an OutOfOrder execution form that dynamically determines and executes the execution order from the one whose dependency has been resolved is general. When an instruction executable at a certain time is equal to or more than the number of resources to be used, the method of selecting an instruction to be executed is generally “select from old instructions”.
The method is general and widely used.

【0003】例えば、図2に示すようにプログラム中に
命令I1〜I10が存在し、そのプログラム内の命令の
静的順序は古い順からI1,I2,I3,I4,I5,
……I10であったとする。また、そのデータ依存性は
図2中に矢印で示された方向に存在するとする。即ち、
矢印で指された命令は、その矢印の元が接続されている
命令が実行を終了すると、実行可能となることを示して
いる。複数の矢印から指されている命令は、指し側の命
令がすべて終了して始めて実行可能となることを示して
いる。また、図2中の命令I9は実行終了までに20ク
ロックかかる命令であると仮定し、その他の命令は実行
に1クロックしかかからないと仮定する。また、このプ
ログラムを実行するマイクロプロセッサは同時に2つの
命令を実行できる2ウエイのスーパースケーラ実行が可
能なマイクロプロセッサである。
For example, as shown in FIG. 2, there are instructions I1 to I10 in a program, and the static order of the instructions in the program is from I1, I2, I3, I4, I5 to oldest.
... Assume I10. It is also assumed that the data dependency exists in the direction indicated by the arrow in FIG. That is,
The instruction pointed by the arrow indicates that the instruction connected to the origin of the arrow is executable when the execution of the instruction ends. The instruction pointed to by a plurality of arrows indicates that the instruction can be executed only after all the instructions on the pointing side have been completed. It is also assumed that the instruction I9 in FIG. 2 takes 20 clocks to complete execution, and the other instructions take only one clock to execute. The microprocessor that executes this program is a microprocessor that can execute two instructions at the same time and can execute a two-way superscalar.

【0004】この例において、命令I1が実行される
と、命令I1が実行を終了すると命令I2,I3及び命
令I9が実行可能となる。「古い命令から選択してい
く」方法に準拠すると、次に実行するべく選択される命
令はI2,I3となる。命令I2,I3の実行が終了す
ると、次に実行可能な命令は命令I4,I5,I9であ
るが、やはり古い命令から順に選択していくと命令I
4,I5を実行する。命令I4,I5が実行を終わる
と、命令I6,I7,I9が実行可能となり、命令I
6,I7が実行される。命令I6,I7が実行を終える
と、命令I8,I9が実行可能となり、実行される。
In this example, when the instruction I1 is executed, the instructions I2, I3 and the instruction I9 become executable when the execution of the instruction I1 is completed. According to the "select from old instructions" method, the instructions selected to be executed next are I2 and I3. When the execution of the instructions I2 and I3 is completed, the next executable instructions are the instructions I4, I5 and I9.
4. Execute I5. When the instructions I4 and I5 have been executed, the instructions I6, I7 and I9 become executable and the instruction I
6, I7 are executed. After the execution of the instructions I6 and I7, the instructions I8 and I9 become executable and executed.

【0005】この場合、命令I10は命令I8,I9が
終了するまで実行を始めることができないが、命令I9
は20クロックかかる命令であるため、I10もまたそ
の実行開始を20クロック待たされることになる。即
ち、命令I9の大きなレイテンシがプログラムの実行時
間に見えてしまい、性能に大きな影響を与える。具体的
には、上記プログラムでI1からI10までの実行時間
は25クロックであり、命令I9のレイテンシ20クロ
ックが全体の実行時間の大きな割合をしめている。
In this case, the instruction I10 cannot start executing until the instructions I8 and I9 are completed.
Is an instruction that takes 20 clocks, so that I10 is also delayed by 20 clocks before its execution starts. In other words, the large latency of the instruction I9 appears in the execution time of the program, which greatly affects the performance. Specifically, in the above program, the execution time from I1 to I10 is 25 clocks, and the latency of 20 clocks of the instruction I9 accounts for a large proportion of the entire execution time.

【0006】即ち上述の例に挙げるように、ある時点に
おいて実行可能な命令が複数ある場合、その実行順序を
「古いものから順に選択する」一般的な方法では、大き
なレイテンシを伴う命令の実行時間が隠蔽できないケー
スが存在し、性能低下を引き起こす。
That is, as described in the above example, when there are a plurality of instructions that can be executed at a certain point in time, the general method of selecting the execution order from the oldest one is the execution time of the instruction with a large latency. However, there are cases in which it cannot be hidden, causing a decrease in performance.

【0007】この問題に対して、特開平4−25233
6においてプログラムの実行順序を最適化し、パイプラ
イン処埋を行うプロセッサによる実行に最適化する方法
が提案されている。これは、命令の実行順序によっては
生じる可能性のある命令待ち合わせ時間、いわゆるパイ
プラインブレークを、適当な命令を挿入し実行順序を変
更することによつて減少させ、実行時間の最適化を行う
ものである。
To solve this problem, Japanese Patent Application Laid-Open No. Hei 4-25233
No. 6, a method for optimizing the execution order of programs and optimizing the execution order by a processor that performs pipeline processing is proposed. This is to optimize the execution time by reducing the instruction waiting time that may occur depending on the execution order of instructions, so-called pipeline break, by inserting an appropriate instruction and changing the execution order. It is.

【0008】この装置は命令列の依存関係を静的に解
析、命令の処理に関して重み付けを行い、命令列の再構
成を行うが、あくまで静的な解析によって行うものであ
るため、実行中に動的に発生するレイテンシ(メモリア
クセス命令がキャッシュミスしフィル処理を行う場合
や、値によって処理時間が変化する演算命令など)には
対応できない。また、ソフト互換性はあるが、ハード的
に互換性のないプロセッサに対しては、それぞれのプロ
セッサに関して処理の重み付けが変化するため、プログ
ラムをそれぞれのプロセッサ用に最適化してやる必要が
あり、非効率的である。
This apparatus statically analyzes the dependence of an instruction sequence, performs weighting on instruction processing, and reconstructs an instruction sequence. However, since this apparatus performs static analysis, it does not operate during execution. Latency (such as when a memory access instruction causes a cache miss and performs a fill process, or an operation instruction whose processing time varies depending on the value) cannot be handled. In addition, for processors that have software compatibility but are not hardware compatible, the processing weighting for each processor changes, so it is necessary to optimize programs for each processor. It is a target.

【0009】[0009]

【発明が解決しようとする課題】第一の問題点は、0u
t0f0rder実行を行うマイクロプロセッサにおい
て、プログラム実行中のある時点で、データ依存性が解
消された(即ち実行可能と判断される)ものが同時に複
数あった場合、従来の「古いものから順に選択して実行
する」という選択方法では、大きなオーバヘッドを生じ
る可能性があり、性能低下を引き起こすことである。そ
の理由は、あるプログラムが完成したとすると、そのプ
ログラムに内在するデータ依存関係は固定のものであ
り、そのデータ依存関係に基づきプログラムの並列性を
抽出しながら0ut0f0rder実行できる一般的な
マイクロプロセッサで実行したとすれば、その実行順序
は複数存在することになり、その実行方法でプログラム
の実行時間が変化するためである。
The first problem is that 0u
In a microprocessor that executes t0f0rder execution, if there is a plurality of microprocessors at the same time during execution of a program, the data dependency of which has been eliminated (that is, determined to be executable) at the same time. The "execute" selection method can result in significant overhead, causing performance degradation. The reason is that when a certain program is completed, the data dependency inherent in the program is fixed, and a general microprocessor that can execute 0ut0f0rder while extracting the parallelism of the program based on the data dependency is used. If they are executed, there will be a plurality of execution orders, and the execution time of the program will change depending on the execution method.

【0010】第二の問題点は、命令実行順序を完全に指
定することで第一の問題点を解決するため、プログラム
中に含まれる依存関係を、コンパイル時その他に静的に
解析できたとしても、プログラムの実行順序を完全に最
適化することは非効率かつ困難であることである。その
理由は、同一のソフトウエアが動作するが、アーキテク
チャが異なる複数のマイクロプロセッサにおいては、そ
れらの命令実行時間は一般に異なるために、一つのプロ
グラムをそれぞれのマイクロプロセッサに対応するよう
に静的に解析し最適化をする必要があり、非効率的であ
る。また、たとえ対象のマイクロプロセッサが一つであ
ったとしても、命令のうちには実行時に実行時間が動的
に変化するものがあるため(例:メモリアクセス命令の
キャッシュミスに伴うキャッシュフィル処理)、静的に
解析することが極めて困難だからである。
The second problem is that, in order to solve the first problem by completely specifying the order of instruction execution, it is assumed that dependencies included in a program can be statically analyzed at compile time or the like. However, it is inefficient and difficult to completely optimize the execution order of a program. The reason is that the same software operates, but in a plurality of microprocessors having different architectures, their instruction execution times are generally different. Therefore, one program is statically assigned so as to correspond to each microprocessor. It needs to be analyzed and optimized, which is inefficient. Even if the number of target microprocessors is one, there are some instructions whose execution time dynamically changes at the time of execution (eg, cache fill processing due to a cache miss of a memory access instruction). This is because it is extremely difficult to perform static analysis.

【0011】本発明は上記のような従来のものの欠点を
除去すべくなされたもので、レイテンシを伴う命令実行
時のレイテンシを隠蔽するため、命令実行時の履歴を保
管し、その履歴に基づき命令実行順を実行時に動的に決
定するための機構を備えたマイクロプロセッサを提供す
ることを目的とする。この機構は実行時に動的に実行順
序を決定するため、プログラムの事前の静的解析や最適
化の必要がない。
SUMMARY OF THE INVENTION The present invention has been made to eliminate the above-mentioned drawbacks of the prior art. In order to conceal the latency at the time of executing an instruction with a latency, a history at the time of executing the instruction is stored, and the instruction is stored based on the history. It is an object of the present invention to provide a microprocessor having a mechanism for dynamically determining an execution order at the time of execution. Since this mechanism dynamically determines the execution order at the time of execution, there is no need for prior static analysis or optimization of the program.

【0012】[0012]

【課題を解決するための手段】本発明におけるマイクロ
プロセッサは、命令フェッチを行う命令フェッチ機構
(図1のF0)、フェッチした命令のデコードを行う命
令デコード機構(図1のD0)、命令を実際に実行する
命令実行機構(図1のE0)、実行後の後処理を行う実
行後処理部(図1のW0)を備え、マイクロプロセッサ
内あるいはその近傍に、前述の性能低下状態を検出する
性能監視機構(図1のP0)と、性能低下を引き起こす
可能性のあるレイテンシを伴う命令に関して、その情報
を格納する記億装置である履歴管理メモリ(図1のH
0)を備え、また、この記億装置に格納された命令の履
歴から命令の実行順を決定する選択手段を持った命令実
行制御部(図1のA0)を備えることを特徴とする。
A microprocessor according to the present invention comprises an instruction fetch mechanism (F0 in FIG. 1) for fetching instructions, an instruction decode mechanism (D0 in FIG. 1) for decoding fetched instructions, and And a post-execution processing unit (W0 in FIG. 1) for performing post-execution post-processing. The performance of detecting the above-mentioned performance degradation state in or near the microprocessor is provided. A monitoring mechanism (P0 in FIG. 1) and a history management memory (H in FIG. 1) which is a storage device for storing information on instructions with a latency that may cause performance degradation.
0), and further includes an instruction execution control unit (A0 in FIG. 1) having a selection means for determining the order of execution of instructions from the history of instructions stored in the storage device.

【0013】[0013]

【発明の実施の形態】次に、本発明の一実施形態につい
て図面を参照して説明する。図1は本発明の一実施形態
の構成を示すブロック図である。図中のF0は命令フェ
ッチ機構、D0は命令デコード機構であり、実行される
と予測される複数の命令を同時にデコードする。E0は
命令実行機構であり、同時に複数の命令を実行する。W
0は実行後処理部である。また、A0は命令実行制御部
であり、依存性が解消された命令のうち、命令実行機構
E0で次に実行する命令を選択する。性能監視機構P0
はマイクロプロセッサの稼働率を監視する。履歴管理メ
モリH0は、長いレイテンシでプロセッサの稼働率を下
げた履歴のある命令に関する情報を格納する。命令フェ
ッチ機構F0,命令デコード機構D0,実行後処理部W
0,命令実行制御部A0,性能監視機構P0,履歴管理
メモリH0はすべてパイプライン処理を行うものとす
る。
Next, an embodiment of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing the configuration of one embodiment of the present invention. In the figure, F0 is an instruction fetch mechanism, and D0 is an instruction decode mechanism, which simultaneously decodes a plurality of instructions predicted to be executed. E0 is an instruction execution mechanism that executes a plurality of instructions at the same time. W
0 is a post-execution processing unit. A0 is an instruction execution control unit that selects an instruction to be executed next by the instruction execution unit E0 among instructions whose dependencies have been eliminated. Performance monitoring mechanism P0
Monitors microprocessor utilization. The history management memory H0 stores information related to instructions having a history in which the operation rate of the processor has been lowered with a long latency. Instruction fetch mechanism F0, instruction decode mechanism D0, post-execution processing unit W
0, the instruction execution control unit A0, the performance monitoring mechanism P0, and the history management memory H0 all perform pipeline processing.

【0014】図2に示すプログラムを図1に示す構成で
実行した時の例を示す。まず、マイクロプロセッサMP
の命令フェッチ機構F0がメモリM0から複数の実行す
る命令I1をフェッチする。メモリM0はマイクロプロ
セッサMP内に設置されることもある。命令デコード機
構D0はフェッチしてきた命令をマイクロプロセッサが
実行可能な信号にデコードする。また、デコード対象の
命令について過去に低稼働率状態クロックが登録されて
いれば、履歴管理メモリH0から読み出す。
An example when the program shown in FIG. 2 is executed with the configuration shown in FIG. First, the microprocessor MP
Instruction fetch mechanism F0 fetches a plurality of instructions I1 to be executed from the memory M0. The memory M0 may be provided in the microprocessor MP. The instruction decode mechanism D0 decodes the fetched instruction into a signal executable by the microprocessor. If a low operation rate state clock has been registered for the instruction to be decoded in the past, the instruction is read from the history management memory H0.

【0015】命令実行制御部A0はデコード時に参照し
た履歴管理メモリH0の内容を参照し、デコードした命
令I1が過去に命令I1自身のレイテンシでプロセッサ
の稼働率を低下させたことがないかを調べる。もし過去
にそのような履歴があった場合、その命令を優先的に実
行する。この例では命令I1にはそのような履歴がな
く、履歴管理メモリH0に登録されていないので、通常
の「古いものから選択する」方法で選択する。
The instruction execution control unit A0 refers to the contents of the history management memory H0 referenced at the time of decoding, and checks whether or not the decoded instruction I1 has previously reduced the operating rate of the processor due to the latency of the instruction I1 itself. . If there is such a history in the past, the instruction is executed with priority. In this example, since the instruction I1 has no such history and is not registered in the history management memory H0, the instruction I1 is selected by the usual “select from oldest” method.

【0016】命令実行制御部A0によって発行(選択)
された命令は、命令実行機構E0において実行される。
命令実行機構E0に対して、性能監視機構P0は実行中
の命令I1のアドレスを保持し、その命令が命令実行機
構E0内に存在する時に、命令実行機構E0に存在する
命令数を計数し(命令実行機構E0が命令Ixしか実行
していない時は、その命令数は1)、その命令数が事前
に設定した命令数T0以下の状態のクロック数をカウン
トする。ここで、アドレスIxの命令が命令実行機構E
0に存在するときの低稼働率状態クロック数をC(I
x)と定義する。なお命令実行機構E0の稼働率はその
時に命令実行機構E0にいる命令数を基準とし、T0=
1とする。そのカウント値が事前に決めておいたクロッ
ク数T1よりも大きかったら、履歴管理メモリH0に命
令アドレスとその低稼働率状態のクロック数を格納す
る。この例ではT1=5とする。命令I1における低稼
働率状態クロック数C(I1)=1でT1よりも小さ
く、履歴管理メモリH0に対する登録は行わない。
Issued (selected) by the instruction execution control unit A0
The executed instruction is executed in the instruction execution unit E0.
For the instruction execution unit E0, the performance monitoring unit P0 holds the address of the instruction I1 being executed, and when the instruction exists in the instruction execution unit E0, counts the number of instructions existing in the instruction execution unit E0 ( When the instruction execution unit E0 is executing only the instruction Ix, the number of instructions is 1), and the number of clocks in a state where the number of instructions is equal to or less than the preset instruction number T0 is counted. Here, the instruction at the address Ix is the instruction execution unit E
The number of low operation rate state clocks when they are at 0 is represented by C (I
x). The operation rate of the instruction execution unit E0 is based on the number of instructions in the instruction execution unit E0 at that time.
Let it be 1. If the count value is larger than the predetermined number of clocks T1, the instruction address and the number of clocks in the low operation rate state are stored in the history management memory H0. In this example, T1 = 5. The number of clocks in the low operation rate state C (I1) = 1 in the instruction I1 is smaller than T1 and is not registered in the history management memory H0.

【0017】履歴管理メモリH0は命令アドレスIxを
キーとして参照する連想記憶として構成し、その内容は
低稼働率状態クロック数C(Ix)を格納する。さて図
2において、命令I1からI7の実行はそれぞれ1クロ
ックで終了するため、性能監視機構P0は低稼働率状態
を検出することはなく、したがって履歴管理メモリH0
にも命令I1からI7までの情報は書き込まれない。
The history management memory H0 is configured as an associative memory which refers to the instruction address Ix as a key, and stores the number C (Ix) of the low operation rate state clocks. In FIG. 2, since the execution of the instructions I1 to I7 is completed in one clock, the performance monitoring mechanism P0 does not detect the low operation rate state, and therefore, the history management memory H0
No information from the instructions I1 to I7 is written.

【0018】しかし、命令I8,I9が実行されると、
最初の1クロックは命令I8,I9が一緒に実行されて
いるため命令実行機構E0の稼働率は2であるが、次の
クロックでは命令I8の実行は終了しているため、命令
I9だけが残りの19クロックにわたり命令実行機構E
0に残って処理を続けることになる。この場合、稼働命
令数は1であるため、性能監視機構P0は命令I9に対
するC(I9)を19までカウントアップすることにな
る。C(I9)はT1よりも大きいため、履歴管理メモ
リH0に命令I9のアドレスとC(I9)=19が書き
込まれる。
However, when the instructions I8 and I9 are executed,
In the first one clock, the operation rates of the instruction execution unit E0 are 2 because the instructions I8 and I9 are executed together, but in the next clock, the execution of the instruction I8 has been completed, so that only the instruction I9 remains. Instruction execution mechanism E over 19 clocks
The process remains at 0. In this case, since the number of operating instructions is 1, the performance monitoring mechanism P0 counts up C (I9) for the instruction I9 to 19. Since C (I9) is larger than T1, the address of the instruction I9 and C (I9) = 19 are written in the history management memory H0.

【0019】以上のプロセスでは命令I1からI10ま
での実行時間は25クロックかかる。その後プログラム
の実行が進み、再び命令I1が実行されると、実行可能
命令はI2,I3,I9となる。命令デコード機構D0
から命令実行制御部A0に制御が移ると、命令実行制御
部A0は履歴管理メモリH0を参照して、過去に命令I
9が19クロックの低稼働率状態を引き起こしたことを
検出する。これを検出すると命令実行制御部A0は優先
的に命令I9を選択する。もう一つは古い方の命令I2
を選択する。そして、命令実行機構E0において命令I
2,I9が実行を開始する。
In the above process, the execution time of the instructions I1 to I10 takes 25 clocks. Thereafter, the execution of the program proceeds, and when the instruction I1 is executed again, the executable instructions are I2, I3, and I9. Instruction decode mechanism D0
From the control to the instruction execution control unit A0, the instruction execution control unit A0 refers to the history management memory H0,
9 detects that it has caused a 19 clock low availability condition. When this is detected, the instruction execution control unit A0 preferentially selects the instruction I9. The other is the older instruction I2
Select Then, the instruction I
2, I9 starts execution.

【0020】命令I9が実行されている間、I2,I
3,I4,I5,I6,I7,I8の順に一つづつ命令
が命令実行機構E0で実行される。命令I9はその後1
3クロックの間、稼動命令数1の状態が続く。性能監視
機構P0においてC(I9)=13までカウントアップ
される。T1よりも大きな値であるが、以前のC(I
9)=19よりも小さいため、履歴管理メモリH0の値
を変更しない。もし以前の値よりもC(I9)が大きく
なったならば、履歴管理メモリH0にC(I9)とアド
レスを登録する。そして命令I9が実行を終えると、初
めて命令I10が実行可能となり、命令実行機構E0で
実行される。
While instruction I9 is being executed, I2, I
Instructions are executed by the instruction execution unit E0 one by one in the order of 3, I4, I5, I6, I7, and I8. Instruction I9 is then 1
During three clocks, the state of the number of operating instructions 1 continues. The performance monitoring mechanism P0 counts up to C (I9) = 13. Although it is a value larger than T1, the C (I
9) Since the value is smaller than = 19, the value of the history management memory H0 is not changed. If C (I9) is larger than the previous value, register C (I9) and the address in the history management memory H0. When the execution of the instruction I9 is completed, the instruction I10 becomes executable for the first time, and is executed by the instruction execution mechanism E0.

【0021】2回目のプロセスでは、命令I1からI1
0までの実行時間は22クロックとなり、3クロックの
性能向上が実現された。以上示したように本実施形態に
よれば、複数の実行可能な命令について、その履歴を参
照することによって、レイテンシを伴う可能性のある命
令かどうかを実行時に動的に知ることが出来る。また、
これを命令発行の選択に用いることにより、命令レイテ
ンシによって実行部の稼働率が低下する状態のクロック
数を減少させ、命令の処理効率を向上させることができ
るといった効果がある。
In the second process, the instructions I1 to I1
The execution time up to 0 is 22 clocks, and the performance improvement of 3 clocks has been realized. As described above, according to the present embodiment, by referring to the histories of a plurality of executable instructions, it is possible to dynamically know at execution time whether or not the instructions may have a latency. Also,
By using this for selecting instruction issuance, the number of clocks in a state where the operation rate of the execution unit is reduced due to instruction latency can be reduced, and the processing efficiency of instructions can be improved.

【0022】次に、本発明におけるマイクロプロセッサ
の一実施形態を図3に示して説明する。図3の1,2は
それぞれ命令デコード機構D0からデコードされた2命
令のアドレスである。H0は履歴管理メモリである。こ
の構成ではCAM構造をとり、そのエントリ数は256
エントリである。しかし、一般的にはセットアソシアテ
ィブ構成やダイレクトマップ構成も考えられる。エント
リ数は多いほうが望ましい。本実施形態では、同時にデ
コードする2つの命令のアドレスによって同時に値を参
照できるよう、2つのリードポートを持つメモリとして
構成する。その内容は、前述の低稼働率状態クロック数
をしめす8bitのデータである。
Next, an embodiment of the microprocessor according to the present invention will be described with reference to FIG. Reference numerals 1 and 2 in FIG. 3 denote addresses of two instructions decoded from the instruction decode mechanism D0, respectively. H0 is a history management memory. This configuration has a CAM structure and the number of entries is 256.
Entry. However, in general, a set associative configuration or a direct map configuration is also conceivable. It is desirable that the number of entries be large. In the present embodiment, a memory having two read ports is configured so that a value can be referred to at the same time by the addresses of two instructions to be decoded at the same time. The content is 8-bit data indicating the number of low operation rate state clocks.

【0023】アドレス1,2によってそれぞれ履歴管理
メモリH0から読まれたデータ10,11は命令同期機
構20に送られる。これはデコードした命令の依存関係
を調べるための同期機構であり、一般的なマイクロプロ
セッサに搭載されているものと同様のものである。命令
同期機構20において命令の依存性が解決されたと判断
された命令はメモリ14に書き込まれる。メモリ14に
はその命令の情報と、その命令に対応する低稼働率クロ
ック数を格納する。この例では(8bitの低稼働率状
態クロック数+発行する命令の情報)×6エントリ分を
用意する。
The data 10 and 11 read from the history management memory H0 by the addresses 1 and 2 are sent to the instruction synchronization mechanism 20. This is a synchronization mechanism for examining the dependencies of decoded instructions, and is the same as that mounted on a general microprocessor. The instruction determined to have the instruction dependency resolved by the instruction synchronization mechanism 20 is written to the memory 14. The memory 14 stores information on the instruction and the number of low operation rate clocks corresponding to the instruction. In this example, (8-bit low operation rate state clock number + information of issued instruction) × 6 entries are prepared.

【0024】比較器15によってメモリ14に格納され
ている6命令のうち、1番目と2番目に多い低稼働率状
態クロック数の命令を選択する。その2つの命令は命令
実行機構E0によって実行される。性能監視機構P0は
命令実行機構E0の状態を監視し、低稼働率状態クロッ
ク数が前述T1よりも大きくかつデコード時にメモリ1
4から得られた過去の値よりも大きかった場合に、メモ
リ14に対してそのクロック数を書き込む。
The comparator 15 selects the first and second largest number of low operation rate state clocks among the six instructions stored in the memory 14. The two instructions are executed by the instruction execution unit E0. The performance monitoring mechanism P0 monitors the state of the instruction execution mechanism E0, and the number of low operation rate state clocks is larger than the above-described T1 and the memory 1 is decoded.
If the number of clocks is larger than the past value obtained from 4, the number of clocks is written to the memory 14.

【0025】次に、性能監視機構(図1のP0)の監視
および登録に関する部分の一実施形態を図4に示して説
明する。図4のE0は命令実行機構であり、この実施形
態では2つの命令を同時に実行できるように、命令実行
部E01,E02を備えている。この図において命令実
行機構E0以外が性能監視機構(図1のP0)の一部を
構成している。
Next, an embodiment relating to monitoring and registration of the performance monitoring mechanism (P0 in FIG. 1) will be described with reference to FIG. E0 in FIG. 4 is an instruction execution mechanism. In this embodiment, instruction execution units E01 and E02 are provided so that two instructions can be executed simultaneously. In this figure, parts other than the instruction execution mechanism E0 constitute a part of the performance monitoring mechanism (P0 in FIG. 1).

【0026】命令実行部に与える2つの命令の命令実行
開始信号3,4と、命令実行部E01,E02が命令実
行の終了時に発行する命令実行終了信号111,11
2、および命令実行機構に現在いる命令数100をみ
て、カウンタA13,A14は「それぞれの命令が開始
してから終了するまでの間、命令実行機構にいる命令数
がT0(本実施形態では1)以下の状態」をカウントす
る。このカウントした値が、それぞれの命令に対する
「低稼働率状態クロック数」である。
Instruction execution start signals 3 and 4 of two instructions given to the instruction execution unit, and instruction execution end signals 111 and 11 issued by the instruction execution units E01 and E02 at the end of instruction execution.
2 and the number of instructions 100 currently in the instruction execution unit, the counters A13 and A14 indicate that “the number of instructions in the instruction execution unit is T0 (1 in this embodiment) from the start to the end of each instruction. ) The following states are counted. The counted value is the “number of low operation rate state clocks” for each instruction.

【0027】カウントが終了すると、検出器A15,A
16でそれぞれの命令に対して、「過去に履歴管理メモ
リ(図1のH0)に登録されておらずかつその命令に対
して今回カウントした低稼働率状態クロック数がT1
(本実施形態では5)以上である、あるいは今回カウン
トした低稼働率状態クロック数が過去に履歴管理メモリ
(図1のH0)に登録されていた値よりも大きい」とい
う状態を検出する。それぞれの命令についてこの状態が
検出されると、信号線18あるいは19上に低稼働率状
態クロック数の履歴管理メモリ(図1のH0)に対する
登録指示が出される。これを参照して性能監視機構(図
1のP0)は履歴管理メモリ(図1のH0)に対する登
録を行う。
When the counting is completed, the detectors A15, A15
For each instruction at 16, "the number of low operation rate state clocks that have not been registered in the history management memory (H0 in FIG.
(In this embodiment, 5) or more, or the number of low operation rate state clocks counted this time is larger than the value registered in the history management memory (H0 in FIG. 1) in the past. " When this state is detected for each instruction, an instruction to register the low operation rate state clock number in the history management memory (H0 in FIG. 1) is issued on the signal line 18 or 19. By referring to this, the performance monitoring mechanism (P0 in FIG. 1) registers in the history management memory (H0 in FIG. 1).

【0028】以上、この発明の実施形態を図面を参照し
て詳述してきたが、具体的な構成はこの実施形態に限ら
れるものではなく、この発明の要旨を逸脱しない範囲の
設計の変更等があってもこの発明に含まれる。
The embodiment of the present invention has been described in detail with reference to the drawings. However, the specific configuration is not limited to this embodiment, and a design change or the like may be made without departing from the gist of the present invention. Even if there is, it is included in the present invention.

【0029】[0029]

【発明の効果】第一の効果は、プログラム実行において
最適な命令実行スケジューリングが行えることである。
これによって、マイクロプロセッサのプログラム実行性
能が向上する。その理由は、一度オーバヘッドが発生し
たことが検出されると、2度目以降にはより適した方法
でスケジューリングを行うため、最適な命令実行スケジ
ューリングを行うようになるためである。第二の効果
は、第一の効果を、プログラムの静的解析や事前の最適
化なしに高速化を行えることである。これにより、冗長
なプログラム変換の必要がない。実行時に動的に履歴を
登録し、動的に参照しながらスケジューリングを行って
実行を行うためである。
The first effect is that optimal instruction execution scheduling can be performed in program execution.
Thereby, the program execution performance of the microprocessor is improved. The reason is that, once the occurrence of the overhead is detected, the scheduling is performed by a more suitable method for the second and subsequent times, so that the optimal instruction execution scheduling is performed. The second effect is that the first effect can be accelerated without static analysis of the program or prior optimization. This eliminates the need for redundant program conversion. This is because a history is dynamically registered at the time of execution and scheduling is performed while dynamically referring to the history.

【図面の簡単な説明】[Brief description of the drawings]

【図1】 本発明の概略を示す構成図である。FIG. 1 is a configuration diagram showing an outline of the present invention.

【図2】 命令実行の順番によってはオーバーヘッドが
大きくなるプログラムの例である。
FIG. 2 is an example of a program in which overhead increases depending on the order of instruction execution.

【図3】 本発明の一実施形態を示す構成図である。FIG. 3 is a configuration diagram showing an embodiment of the present invention.

【図4】 本発明の一実施形態における命令実行機構と
性能監視機構の一部である。
FIG. 4 shows a part of an instruction execution mechanism and a performance monitoring mechanism according to an embodiment of the present invention.

【符号の説明】[Explanation of symbols]

M0……メモリ、 MP……マイクロプロセッサ、F0
……命令フェッチ機構、 D0……命令デコード機構、
A0……命令実行制御部、 E0……命令実行機構、W
0……実行後処理部、 P0……性能監視機構、H0…
…履歴管理メモリ
M0: Memory, MP: Microprocessor, F0
...... Instruction fetch mechanism, D0 ... Instruction decode mechanism,
A0: Instruction execution control unit, E0: Instruction execution mechanism, W
0: Post-execution processing unit, P0: Performance monitoring mechanism, H0:
… History management memory

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 平6−95862(JP,A) 特開 平9−120359(JP,A) 特開 平4−252336(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 9/38 G06F 11/28 - 11/34 ────────────────────────────────────────────────── ─── Continuation of the front page (56) References JP-A-6-95862 (JP, A) JP-A-9-120359 (JP, A) JP-A-4-252336 (JP, A) (58) Field (Int.Cl. 7 , DB name) G06F 9/38 G06F 11/28-11/34

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 プログラム中の命令をメモリからフェッ
チし、同時に複数個の命令デコードを行い、同時に複数
個の命令を実行できるマイクロプロセッサであり、かつ
命令のデータ依存性を参照することでプログラムの命令
の静的な順番以外の順番で命令の実行を行うことのでき
るマイクロプロセッサであって、マイクロプロセッサが有する複数の実行部のうち、ある
実行部が使用されていない状態 と、前記状態を引き起こ
した特定の命令とを検出する手段をもったことを特徴と
するマイクロプロセッサ。
1. A microprocessor which fetches instructions in a program from a memory, decodes a plurality of instructions simultaneously, and can execute a plurality of instructions at the same time. A microprocessor capable of executing instructions in an order other than the static order of instructions, wherein the microprocessor includes a plurality of execution units.
A microprocessor having means for detecting a state in which an execution unit is not used and a specific instruction that caused the state .
【請求項2】 請求項1記載のマイクロプロセッサにお
いて、前記マイクロプロセッサが有する複数の実行部のうち、
ある実行部が使用されていない状態 のクロック数を計数
する性能監視機構をもったことを特徴とするマイクロプ
ロセッサ。
2. The microprocessor according to claim 1, wherein said microprocessor includes a plurality of execution units.
A microprocessor having a performance monitoring mechanism for counting the number of clocks when a certain execution unit is not used .
【請求項3】 請求項2記載のマイクロプロセッサにお
いて、 前記状態を引き起こした命令と該状態のクロック数と
関連付けて登録するための記憶装置である履歴管理メモ
リと前記履歴管理メモリヘの登録手段を備え、 プログラム中の命令のアドレスにより特定される命令に
ついて、前記記億装置から登録された情報を取り出す手
段をもったことを特徴とするマイクロプロセッサ。
3. A microprocessor according to claim 2, the registration means in the history management memory and the history management Memorihe is a storage device for registering in association with the clock number of instructions and the condition that caused the state A microprocessor comprising: means for extracting information registered from the storage device for an instruction specified by an address of an instruction in a program.
【請求項4】 請求項3記載のマイクロプロセッサにお
いて、 プログラム実行時の任意の時点に実行可能と判断される
命令群から、前記記憶装置から取り出した前記命令群の
各命令に対応する情報に基づき、実行する命令実行順を
決定する手段と、 前記実行順にしたがって命令の実行を行う命令実行手段
をもったことを特徴とするマイクロプロセッサ。
4. The microprocessor according to claim 3, wherein a group of instructions determined to be executable at any time during execution of the program is determined based on information corresponding to each instruction of the group of instructions extracted from the storage device. And a means for determining an order of executing instructions to be executed, and an instruction executing means for executing instructions according to the order of execution.
JP09128875A 1997-05-19 1997-05-19 Microprocessor Expired - Fee Related JP3112861B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP09128875A JP3112861B2 (en) 1997-05-19 1997-05-19 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP09128875A JP3112861B2 (en) 1997-05-19 1997-05-19 Microprocessor

Publications (2)

Publication Number Publication Date
JPH10320196A JPH10320196A (en) 1998-12-04
JP3112861B2 true JP3112861B2 (en) 2000-11-27

Family

ID=14995527

Family Applications (1)

Application Number Title Priority Date Filing Date
JP09128875A Expired - Fee Related JP3112861B2 (en) 1997-05-19 1997-05-19 Microprocessor

Country Status (1)

Country Link
JP (1) JP3112861B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4892387B2 (en) * 2007-03-30 2012-03-07 財団法人福岡県産業・科学技術振興財団 Execution path detection apparatus, information processing apparatus, execution path detection method, program, and recording medium

Also Published As

Publication number Publication date
JPH10320196A (en) 1998-12-04

Similar Documents

Publication Publication Date Title
US8539485B2 (en) Polling using reservation mechanism
US6295600B1 (en) Thread switch on blocked load or store using instruction thread field
EP1562109B1 (en) Thread id propagation in a multithreaded pipelined processor
US5584037A (en) Entry allocation in a circular buffer
US6687809B2 (en) Maintaining processor ordering by checking load addresses of unretired load instructions against snooping store addresses
JP2889955B2 (en) Branch prediction method and apparatus therefor
US5611063A (en) Method for executing speculative load instructions in high-performance processors
US6415380B1 (en) Speculative execution of a load instruction by associating the load instruction with a previously executed store instruction
JP5323936B2 (en) Apparatus and method for speculative interrupt vector prefetch
JP2504830Y2 (en) Data processing device
US9740553B2 (en) Managing potentially invalid results during runahead
US20030135719A1 (en) Method and system using hardware assistance for tracing instruction disposition information
US10628160B2 (en) Selective poisoning of data during runahead
EP0394624B1 (en) Multiple sequence processor system
EP1562108A1 (en) Program tracing in a multithreaded processor
WO2007038800A2 (en) Profiling using a user-level control mechanism
US6470445B1 (en) Preventing write-after-write data hazards by canceling earlier write when no intervening instruction uses value to be written by the earlier write
CA2056715A1 (en) Overlapped serialization
EP2220556B1 (en) A method and a system for accelerating procedure return sequences
JP2596712B2 (en) System and method for managing execution of instructions, including adjacent branch instructions
US5802340A (en) Method and system of executing speculative store instructions in a parallel processing computer system
US20090172361A1 (en) Completion continue on thread switch mechanism for a microprocessor
US7831979B2 (en) Processor with instruction-based interrupt handling
JP3112861B2 (en) Microprocessor
US6651164B1 (en) System and method for detecting an erroneous data hazard between instructions of an instruction group and resulting from a compiler grouping error

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20000905

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20080922

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20080922

Year of fee payment: 8

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

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

Free format text: PAYMENT UNTIL: 20080922

Year of fee payment: 8

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313117

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

Free format text: PAYMENT UNTIL: 20080922

Year of fee payment: 8

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20080922

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20090922

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20090922

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20100922

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees