JP2005258607A - Processor capable of executing software short of synchronization instruction - Google Patents
Processor capable of executing software short of synchronization instruction Download PDFInfo
- Publication number
- JP2005258607A JP2005258607A JP2004066544A JP2004066544A JP2005258607A JP 2005258607 A JP2005258607 A JP 2005258607A JP 2004066544 A JP2004066544 A JP 2004066544A JP 2004066544 A JP2004066544 A JP 2004066544A JP 2005258607 A JP2005258607 A JP 2005258607A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- processor
- writing
- synchronous
- synchronization
- 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
Links
Images
Landscapes
- Multi Processors (AREA)
- Memory System Of A Hierarchy Structure (AREA)
Abstract
Description
本発明は,電子回路の一種であるマイクロプロセッサに関する。 The present invention relates to a microprocessor which is a kind of electronic circuit.
キャッシュメモリを搭載するプロセッサを使って,マルチプロセッサ構成のコンピュータシステムを実現する場合に解決すべき問題に,キャッシュメモリの不整合がある。キャッシュメモリとは,プロセッサのメモリ参照を高速化するための記憶領域である。プロセッサがメモリ参照をおこなうにあたって,主記憶を参照すると,主記憶の記憶素子は大容量である代わりに動作が低速であることから,長い時間がかかる.そこで昨今のプロセッサは,メモリ参照を高速化するために,キャッシュメモリという高速小容量の記憶素子を搭載し,キャッシュメモリに主記憶の記憶内容の一部をコピーしておく。そして,メモリ参照にあたっては,まずキャッシュメモリに,参照したいアドレスに格納してある値のコピーがあるか調べ,あるならば高速なキャッシュメモリから値を読み取り,なければ低速な主記憶を参照する。主記憶を参照した際には,参照した値をキャッシュメモリに記憶し,次に同じアドレスを参照したときに,キャッシュメモリから参照できるようにする。参照した値をキャッシュメモリに記憶する際には,キャッシュメモリのどこかの領域を書き潰すことになる。書き潰した領域が主記憶のアドレスαに記憶してあった内容のコピーを保持していたとすると,書潰しの結果,プロセッサは次にアドレスαを参照するときには主記憶を参照することになる。キャッシュメモリに新しく値を書きこみ,古い値を書き潰すことを,キャッシュメモリの内容の入れ換えと呼ぶことにする。 A problem to be solved when implementing a multiprocessor computer system using a processor equipped with a cache memory is inconsistency in the cache memory. The cache memory is a storage area for speeding up the memory reference of the processor. When the processor performs memory reference, it takes a long time to refer to the main memory because the memory element of the main memory is slow in operation instead of having a large capacity. Therefore, recent processors have a high-speed and small-capacity storage element called a cache memory in order to speed up memory reference, and a part of the stored contents of the main memory is copied to the cache memory. When referring to the memory, first, the cache memory is checked for a copy of the value stored at the address to be referred to. If there is, the value is read from the high-speed cache memory, and if not, the low-speed main memory is referenced. When the main memory is referenced, the referenced value is stored in the cache memory so that it can be referenced from the cache memory the next time the same address is referenced. When the referenced value is stored in the cache memory, some area of the cache memory is overwritten. Assuming that the erasure area holds a copy of the contents stored at the address α in the main memory, as a result of the erasure, the processor will refer to the main memory the next time it refers to the address α. Writing a new value into the cache memory and crushing the old value is referred to as replacing the contents of the cache memory.
マルチプロセッサ構成のコンピュータで問題となるキャッシュメモリの不整合とは,個々のプロセッサが同じ主記憶のアドレスに記憶してある値として,それぞれのキャッシュメモリに,互いに異なる値を記憶した場合に発生する。この問題が発生する例を次に示す。まず,プロセッサAとプロセッサBからなるコンピュータシステムにおいて,プロセッサAが主記憶のアドレスαにある値をキャッシュメモリに記憶していたとする。ここでプロセッサBがアドレスαに値を書き込むと,次の条件が満たされた場合に,キャッシュメモリの不整合から問題が発生する。 Cache memory inconsistency, which is a problem in computers with multiple processors, occurs when different values are stored in each cache memory as values stored in the same main memory address by each processor. . The following is an example of this problem. First, in the computer system composed of the processor A and the processor B, it is assumed that the processor A stores the value at the address α in the main memory in the cache memory. Here, if the processor B writes a value at the address α, a problem occurs due to inconsistency of the cache memory when the following condition is satisfied.
条件とは,プロセッサBが値の書込みをキャッシュメモリに対してのみおこなうことである。昨今のプロセッサは,メモリへの書込みを高速化するために,メモリへの書込みを一旦,キャッシュメモリに対してのみおこない,キャッシュメモリの内容を入れ換える際に主記憶への書込みを実施する場合がある。こうすると,たとえば同じアドレスへの書込みが立て続けに発生した場合,主記憶への書込みは,最後に書き込んだ値のみで済むため,主記憶への書込みを減らし,メモリ参照を高速化できる。一方で主記憶への書込みを遅延すると,値を書き込んだことが他のプロセッサに伝わらないため,キャッシュメモリの不整合が発生する。キャッシュメモリの不整合は,解消しないとプログラムの実行結果がおかしくなりうるので,必ず解消する必要がある。 The condition is that the processor B only writes a value to the cache memory. In recent years, in order to speed up writing to the memory, the processor may write to the memory only once and then write to the main memory when replacing the contents of the cache memory. . In this way, for example, when writing to the same address occurs in succession, writing to the main memory requires only the last written value, so writing to the main memory can be reduced and memory reference can be speeded up. On the other hand, if the writing to the main memory is delayed, the fact that the value has been written is not transmitted to other processors, so that inconsistency of the cache memory occurs. If the cache memory inconsistency is not resolved, the execution result of the program may be wrong.
キャッシュメモリの不整合を解消するには,プロセッサBが値を主記憶に書きこめばよい。プロセッサに主記憶への書込みを強制するには,「書き側の同期命令」という命令を実行させればよい。書き側の同期命令はキャッシュのみに書き込んだ値を主記憶に書き出す役割を果たす。昨今のプロセッサは主記憶への参照を覗き見(スヌープ)する機能を備えているのが一般的であり,あるプロセッサが書き側の同期命令を実行し,主記憶への書出しを実施すると,他のプロセッサはスヌープ機能によって書出しを検知して,キャッシュメモリに書出し前の古い値を保持しているか調べ,保持していたら,古い値を棄てる。この結果,キャッシュメモリの不整合が解消される。 In order to eliminate the inconsistency of the cache memory, the processor B has only to write the value into the main memory. In order to force the processor to write to the main memory, an instruction “synchronous instruction on the writing side” may be executed. The synchronous instruction on the writing side plays a role of writing the value written only in the cache to the main memory. Modern processors generally have a function of peeping (snooping) references to main memory. When one processor executes a write-side synchronization instruction and writes to main memory, The processor detects the writing by the snoop function, checks whether the old value before writing is held in the cache memory, and discards the old value if held. As a result, the cache memory inconsistency is resolved.
なお,同期命令という語は,マルチプロセッサ構成のコンピュータシステムにおいて,プロセッサ間の相互干渉から発生する問題の解決を目的とする命令全般を指す。同期命令には様々な実装があり,キャッシュメモリの不整合を解消する「書き側の同期命令」の他に,「読み側の同期命令」を提供するプロセッサもある。 The term “synchronous instruction” refers to all instructions for the purpose of solving problems arising from mutual interference between processors in a multiprocessor computer system. There are various implementations of synchronous instructions, and there are processors that provide "synchronous instructions on the read side" in addition to "synchronous instructions on the write side" that resolve cache memory inconsistencies.
読み側の同期命令とは,命令のアウトオブオーダ実行から発生する問題の回避を目的としたものである。アウトオブオーダ実行とは,命令列に並ぶ命令を,並び順とは異なる順序で実行することを意味する。たとえば,命令列m1,m2をアウトオブオーダ実行すると,先にm2を実行して,あとからm1を実行することがある。アウトオブオーダ実行から発生する問題について,図1のプログラムを用いて説明する。図1のプログラムはプロセッサ間の通信を目的としたもので,変数dataに通信内容にあたるデータを書く側と,読む側に分かれている。データを書く側のプログラムでは,変数dataにデータを書き込んだら,書き側の同期命令syncを実行して,読む側のプロセッサに書き込んだデータを伝え,続いて変数flagをたて,データの読み込みを許可する。一方,読む側のプログラムは,変数flagを参照して,変数flagがたつまで待ち,たったら変数dataに書いてあるデータを読み取る。 The synchronous instruction on the reading side is intended to avoid problems that arise from out-of-order execution of instructions. Out-of-order execution means that instructions arranged in an instruction sequence are executed in an order different from the order of arrangement. For example, if instruction sequences m1 and m2 are executed out of order, m2 may be executed first and m1 may be executed later. Problems that arise from out-of-order execution will be described using the program of FIG. The program of FIG. 1 is intended for communication between processors, and is divided into a side for writing data corresponding to communication contents in a variable data and a side for reading. In the program that writes data, after writing data to the variable data, execute the synchronous instruction sync on the write side to transmit the written data to the processor on the reading side, and then set the variable flag to read the data. to approve. On the other hand, the reading program refers to the variable flag, waits until the variable flag is reached, and then reads the data written in the variable data.
図1のプログラムを,アウトオブオーダ実行をおこなう機能をもっているプロセッサで実行すると,書く側が書き込んだデータが,書き込んだ順番通りに読む側に伝わらないことがある。その原因は,アウトオブオーダ実行の結果,読む側において,変数flagを参照するより前に変数dataを参照しうることにある。具体的には,メモリの参照順序が図2の通りであるとき,読む側は,書く側がデータを書き込む前の変数dataの内容を参照してしまい,書く側が書き込んだデータは読む側に伝わらない。 When the program shown in FIG. 1 is executed by a processor having a function for executing out-of-order execution, data written by the writing side may not be transmitted to the reading side in the order of writing. The cause is that, as a result of out-of-order execution, the reader can refer to the variable data before referring to the variable flag. Specifically, when the memory reference order is as shown in FIG. 2, the reading side refers to the contents of the variable data before the data is written, and the data written by the writing side is not transmitted to the reading side. .
図1のプログラムにおいて,書く側が変数dataに書いた内容を確実に読む側に伝える方法はプロセッサによって異なる。読む側の同期命令を提供するプロセッサ(非特許文献1)向けの問題解決方法は,図1の読み側のプログラムについて,変数flagの読込みと変数dataの読込みの間に,読む側の同期命令を挿入することである。読む側の同期命令には命令のアウトオブオーダ実行を抑止する効果があり,変数flagの読込みと変数dataの読込みの間に挿入すれば,変数dataの読込みの実行が先になることを保証し,これにより書く側が変数dataに書いた内容を,読む側に確実に伝えることができる。 In the program shown in FIG. 1, the method in which the writing side reliably transmits the content written in the variable data to the reading side differs depending on the processor. The problem-solving method for the processor (Non-Patent Document 1) that provides the synchronization instruction on the reading side is that the synchronization instruction on the reading side is read between the reading of the variable flag and the reading of the variable data. Is to insert. The synchronous instruction on the reading side has the effect of suppressing the out-of-order execution of the instruction, and if it is inserted between the reading of the variable flag and the reading of the variable data, it guarantees that the reading of the variable data will be executed first. Thus, the content written in the variable data by the writer can be surely transmitted to the reader.
一方,読む側の同期命令を提供しないプロセッサ(非特許文献2)では,図1のプログラムに何の改変を加えなくても,書く側が変数dataに書いた内容は,読む側に確実に伝わる。これは読む側の同期命令を提供しないプロセッサでは,書く側の同期命令に,読む側のアウトオブオーダ実行をキャンセルする効果があるからである。 On the other hand, in a processor (Non-Patent Document 2) that does not provide a synchronous instruction on the reading side, the contents written in the variable data are surely transmitted to the reading side without any modification to the program of FIG. This is because in a processor that does not provide a reading-side synchronization instruction, the writing-side synchronization instruction has the effect of canceling the reading-side out-of-order execution.
プロセッサごとに同期命令の実現が異なることは,異なるプロセッサ向けにソフトウェアを移植する際に障害となる。具体的には,書く側の同期命令だけを提供するプロセッサ向けに開発したソフトウェアを,読む側と書く側(両側)の同期命令を提供するプロセッサ向けに移植する際に,読み側に同期命令を挿入し忘れることがある。たとえば,書く側の同期命令だけを提供するプロセッサ向けに開発した図1のプログラムを移植する際に,フラグの読込みとデータの読込みの間に読む側の同期命令を挿入し忘れる。この挿入し忘れの発生は、読む側の同期命令を挿入すべきプログラム中の位置を自動的に検出して挿入するといった自動処理が困難で、膨大な行数のプログラムに対して人手で挿入箇所を決めていることに起因する。同期命令を挿入し忘れても,ソフトウェアは一見正常に動作することが多い。なぜなら同期命令の挿入忘れから障害が発生するか否かは,タイミングによるところが大きいからである。たとえば図1のプログラムから問題が発生するためには,図2のタイミングでメモリ参照が起きる必要がある。 Different implementations of synchronous instructions for each processor is an obstacle to porting software to different processors. Specifically, when porting software developed for a processor that provides only a synchronous instruction on the writing side to a processor that provides a synchronous instruction on the reading side and the writing side (both sides), the synchronous instruction is sent to the reading side. You may forget to insert. For example, when porting the program of FIG. 1 developed for a processor that provides only the synchronization instruction on the writing side, forgetting to insert the synchronization instruction on the reading side between reading the flag and reading the data. This forgetting to insert is difficult to automatically detect and insert the position in the program where the reading-side synchronization instruction should be inserted. Due to the decision. Even if you forget to insert a synchronization command, the software often works normally. This is because whether or not a failure occurs due to forgetting to insert a synchronous instruction depends largely on the timing. For example, in order to cause a problem from the program of FIG. 1, it is necessary to refer to the memory at the timing of FIG.
同期命令を挿入し忘れたソフトウェアが,一見正常に動作した結果,ソフトウェアを移植した企業の品質検査をパスして販売され,該ソフトウェアを購入した企業が,該ソフトウェアを長期間運用して初めて問題が露見するケースがままある。運用を開始したソフトウェアに欠陥が見つかると,修正までの期間,運用を停止することから,膨大な経済的損失が発生しうる。このため,同期命令の挿入忘れのように,運用が始まるまで見つかりにくい問題については,問題が露見した場合に,迅速に対処するための対策が重要になる。 As a result of software that has forgotten to insert a synchronization instruction at first glance functioning normally, it is sold after passing the quality inspection of the company that transplanted the software. There are still some cases where the If a defect is found in the software that has started operation, the operation is stopped during the period until the correction, and a huge economic loss can occur. For this reason, for problems that are difficult to find until operation begins, such as forgetting to insert a synchronous instruction, it is important to take measures to quickly deal with the problem when it is revealed.
本発明の目的は読み側の同期命令を挿入し忘れたソフトウェアを正常に実行できるプロセッサを提供することにある。 An object of the present invention is to provide a processor that can normally execute software for which a synchronization instruction on the reading side is forgotten to be inserted.
両側の同期命令を提供するプロセッサにおいて,書き側の同期命令の挙動を可変にし,書き側の同期命令の挙動を変更することにより,書き側にだけ同期命令があれば,読み側の同期命令が欠落していても,ソフトウェアを正常に実行可能にする(読み側の同期命令が欠落していない場合と同様に動作するようにする)。具体的には,書き側の同期命令に2つの動作モードを設け,その一方(通常の動作モード)では読み書き双方に同期命令がある場合にのみソフトウェアを正常に実行でき,もう一方(緊急動作モード)では書き側にだけ同期命令があればソフトウェアを正常に実行できるようにする。ソフトウェアに,読み側の同期命令が欠落している欠陥が見つかった場合には,ユーザの指定によりプロセッサの動作モードを緊急動作モードに切り替える。書き側の同期命令の挙動を可変にするために,プロセッサ内部に書き側の同期命令の挙動を指定する記憶領域を設ける。プロセッサは書き側の同期命令を実行する際に,該記憶領域を参照し,記憶領域の値が緊急動作モードであった場合には,書き側の同期命令の実行を完了するまでの遅延を延長する。
ここで、書き側の同期命令の実行を完了するまでの遅延とは、書き側の同期命令に関して,その実行を開始してから,実行が完了するまでに経過する時間(何クロック経過するか)を指し、その長さが動作モードによって変わる。本発明では、「緊急動作モード」に設定されている場合の遅延は、「通常の動作モード」に設定されている場合の遅延よりも長く設定される。
In a processor that provides synchronous instructions on both sides, by changing the behavior of the synchronous instruction on the writing side and changing the behavior of the synchronous instruction on the writing side, if there is a synchronous instruction only on the writing side, the synchronous instruction on the reading side Make the software run correctly even if it is missing (make sure it works as if the synchronization instruction on the reading side is not missing). Specifically, there are two operation modes for the write side synchronous instruction, and one (normal operation mode) can execute the software normally only when there is a synchronous instruction for both reading and writing, and the other (emergency operation mode). ) If there is a synchronization instruction only on the writing side, the software can be executed normally. If a defect is found in the software that is missing the synchronization instruction on the reading side, the processor operation mode is switched to the emergency operation mode as specified by the user. In order to make the behavior of the synchronous instruction on the writing side variable, a storage area for specifying the behavior of the synchronous instruction on the writing side is provided in the processor. The processor refers to the storage area when executing the write side synchronous instruction, and if the value of the storage area is in the emergency operation mode, the delay until the execution of the write side synchronous instruction is extended. To do.
Here, the delay until the execution of the write side synchronous instruction is completed, the time elapsed from the start of execution of the write side synchronous instruction until the execution is completed (how many clocks are passed) And its length varies depending on the operation mode. In the present invention, the delay when the “emergency operation mode” is set is set longer than the delay when the “normal operation mode” is set.
遅延の延長により,キャッシュメモリがスヌープ機構を備えていれば,書き込んだ値が他プロセッサのキャッシュメモリに伝わるまでの時間を確保し,キャッシュメモリの整合性を保つことが可能になる。また,遅延の延長により,他のプロセッサがアウトオブオーダ実行している読込み命令の実行完了を待つことが可能になる。この結果,読み側の同期命令が欠落したソフトウェアを実行した際にも,読み側の同期命令がある場合と同じ実行結果を取得可能になる。 By extending the delay, if the cache memory has a snoop mechanism, it is possible to secure the time until the written value is transmitted to the cache memory of another processor and to maintain the consistency of the cache memory. Further, due to the extension of the delay, it becomes possible to wait for the completion of the execution of the read instruction being executed out of order by another processor. As a result, even when software that lacks the synchronization instruction on the reading side is executed, it is possible to obtain the same execution result as when there is a synchronization instruction on the reading side.
同期命令を挿入し忘れたソフトウェアを正常に実行可能になる。 Software that has forgotten to insert a synchronization instruction can be executed normally.
プロセッサにおいて、同期命令を挿入し忘れたソフトウェアを正常に実行可能にするため、書き側の同期命令の挙動を可変とする。 In the processor, the behavior of the synchronous instruction on the writing side is made variable so that the software that has forgotten to insert the synchronous instruction can be executed normally.
図3に本発明のプロセッサ301を含むコンピュータの例を示す。図3のコンピュータでは,バス302上にプロセッサ301と主記憶303,DVD−ROM読取装置304など外部記憶装置が接続されており,DVD−ROM305など外部記憶に記録してあるプログラムを,バス302を経由して主記憶303に読みこみ,プロセッサ301で実行する。
FIG. 3 shows an example of a computer including the
プロセッサ301の中にはメモリインタフェース306や命令解釈部307,レジスタ群308,命令実行部309がある。プロセッサはこれらの要素を使い,次の手順でプログラムの実行を進める。まず,命令解釈部307は次に実行すべき命令のアドレスを保持するレジスタPC310が格納する値を,配線311を経由して取得し,取得したアドレスにある命令をメモリインタフェース306経由で取得する。そして取得した命令の内容を解釈し,その内容に応じて,命令実行部309にある論理回路に命令を実行するよう指示して,命令の実行完了報告を待つ。たとえば命令が,同期命令の動作を指定する記憶領域に,値を記録する命令であれば,命令実行部309の中にある,同期モード指定命令実行回路312に命令の実行を命じる。同期モード指定命令実行回路312は,レジスタに値を読み込む命令を実行する既存の論理回路と同様の論理回路で実現できる。同期モード指定命令実行回路312は,配線313経由で同期モード指定レジスタ314,つまり前述の記憶領域に値を設定する。本実施例では、書き側の同期命令に2つの動作モード(通常の動作モード、緊急動作モード)を設ける構成とするため、同期モード指定レジスタ314は、1ビット情報が格納できる記憶領域であればよい。
The
命令解釈部307は,取得した命令が,書き側の同期命令syncであれば命令実行部309の中にある,書き側の同期命令実行回路315に命令の実行を命じる。書き側の同期命令実行回路315は,配線313経由で,本発明の同期モード指定レジスタ314の値を参照してその動作を変更する。
If the acquired instruction is a synchronous instruction sync on the writing side, the
図4、図5を用いて、本実施例の書き側の同期命令実行回路315の実現方法を、それぞれ説明する。
A method for realizing the synchronous
まず,書き側の同期命令実行回路315の動作内容(同期命令の実行を完了するまでの遅延を変更する機能の動作内容)を,図4に示す。図4において,書き側の同期命令実行回路315は,まず,同期モード指定レジスタ314の値に依存しない処理401を実行し,次に,同期モード指定レジスタ314の値に依存する,本発明の処理402を実行する。依存しない処理401の動作内容は,既存の両側の同期命令を提供するプロセッサにおける,書き側の同期命令を実行する際の処理内容と同一である。同期モード指定レジスタ314の値に依存する,本発明の処理402では,まず,判断403で同期モード指定レジスタ314の値を参照し,値が通常か否か判定し,通常であれば動作を終了し,通常でなければ遅延処理404を実行する。同期モード指定レジスタ314の値を設定するには,同期モード指定レジスタ314を含むプロセッサの内部状態を設定する命令を実行する。遅延処理404では,まず処理405で遅延カウンタcの値を遅延クロック数に初期化する。遅延クロック数はプロセッサに固有な値で,プロセッサがメモリへの書込み命令を実施してから,該書込みが他プロセッサに伝わり,他プロセッサが次に読込命令を実施する際に,書込み前の古い値を読み込まないと保証できるまでにかかる最悪クロック数として与えられる。次に判断406でカウンタcの値が0より大きいか調べ,大きければ処理407に進み,大きくなければ遅延処理404を終了する。処理407ではカウンタcの値を1減じ,続く処理408でクロック線316を参照して次のクロックを待ってから,判断406に戻る。なお,本発明の処理402は単純な順序回路で実現できる。
First, the operation content of the write side synchronous instruction execution circuit 315 (the operation content of the function for changing the delay until the execution of the synchronous instruction is completed) is shown in FIG. In FIG. 4, the synchronous
図4の動作をおこなう同期命令実行回路315を持つ本発明のプロセッサ101では,同期モード指定レジスタ314の値を緊急動作モードにした状態ならば,図1のプログラムにおいて,書く側が変数dataに書込んだデータを読む側に確実に伝えることができる。なぜなら,図1のプログラムにおいて,書く側が変数dataに書込んだデータが読む側に伝わらない条件は,図2の順番で読み書きが発生することだが,緊急動作モードでは図2の順番で読み書きが発生しないからである。図2では,まず読む側がアウトオブオーダ実行により,変数dataの中身を読み(処理201),次に書く側が2つの書込みを実施するが(処理202、処理203),2つの書込みの間には,書く側の同期命令syncがある。緊急動作モードであれば,syncの終了までに長い時間がかかるので,syncが終了する前に,必ず読む側が変数flagの読込みを完了する。この緊急動作モードの場合におけるメモリ参照の順序を図8に示す。まず読む側が、アウトオブオーダ実行により変数dataからデータを読み込み(処理801)、書く側が、変数dataに書込みを実行する(処理802)。その後、書く側の同期命令syncが実行されるが、この同期命令はプロセッサ毎に設定された遅延カウンタcだけ遅延され、この間に読む側の変数flagの読込みは必ず完了される(処理804)。このとき読む側が読み込んだ変数flagの値はfalseである。図1のプログラムから判るように,読み込んだ変数flagの値がfalseであるということは、読む側がまだ変数dataの値を読むことを許可されていないことを意味する。そこで読む側のプログラムは再び変数flagを参照しにゆく。さて、図8に戻り、書く側のプログラムは遅延カウンタcに基づく所定の時間経過後に、書く側は変数flagに真値を書き込む(処理803)。そのあとで読む側のプログラムがアウトオブオーダ実行されている場合は、読む側が変数dataの値を読み込み(処理805)、読む側は変数flagの値を読み込む(処理806)。読む側が変数flagの値を読み込むと(処理806)、その値が真値になっているが、このとき読む側が処理805で読み込んだ変数dataの値は、確かに書き側が処理802で書き込んだ値になっている。アウトオブオーダ実行により、処理805の命令が処理803の命令より前に実行された場合でも、読む側が処理805で読み込む変数dataの値は、書き側が処理802で書き込んだ値となり、正しく動作する。
In the processor 101 of the present invention having the synchronous
この結果として,図2のタイミングで読み書きが発生することはなくなり,書く側が変数dataに書込んだデータを読む側に確実に伝わる。 As a result, reading / writing does not occur at the timing of FIG. 2, and the writing side is surely transmitted to the reading side of the data written in the variable data.
なお,図4の処理404では,定数(遅延クロック数)回のクロック分だけ遅延を発生するが,遅延の長さはプロセッサ間で調停して決めることもできる。たとえば,syncを実行するプロセッサが,バス302を経由して他のプロセッサに,アウトオブオーダ実行中の読込み命令が終了したら返信してくれるよう依頼し,返信を受けた段階でsyncの実行を完了することもできる。
In the
次に,書き側の同期命令実行回路315の動作内容(ハードウェアトラップを発生する機能の動作内容)を,図5に示す。 Next, FIG. 5 shows the operation content of the write side synchronous instruction execution circuit 315 (operation content of a function that generates a hardware trap).
図5は,図4の遅延処理404を,トラップ発生処理504に変えたものである。トラップ発生処理504の実現は,トラップを発生する命令の既存の実現に準じる。図5の動作をおこなう書き側の同期命令実行回路315は,同期モード指定レジスタ314の値が通常でなければトラップを発生する。トラップを発生した際に,オペレーティングシステムがトラップを捕捉し,遅延を発生させるなどしたあとで,トラップを発生したsyncの次の命令から実行を再開すれば,図5の動作による同期命令実行回路315の実現でも,読み側の同期命令の不足から問題が発生することはなくなる。
FIG. 5 is obtained by replacing the
次に、同期命令の動作を指定する記憶領域に,値を記録するソフトウェアの実施例を図6に示す。図6のソフトウェアは初期化処理601と残りの処理602からなり,初期化処理601の内部にコマンドラインオプション解析処理603がある。コマンドラインオプション解析処理603の内部にある同期モード指定処理604において,同期命令の動作を指定する記憶領域に動作モードを示す値を記録させる命令(同期モード指定命令)を実行する。同期モード指定処理604の実施例を図7に示す。図7の処理では,まず判断701で,ユーザがアプリケーションの起動時にコマンドラインオプション-Emergencyを指定したか検査し,指定していたら処理702に進んで同期モード指定命令を使って同期モード指定レジスタの値を「緊急」にセットし,指定していなかったら処理703に進んで,同期モード指定命令を使って同期モード指定レジスタの値を「通常」にセットする。図7の処理を実行した結果,ユーザがアプリケーションの起動時にコマンドラインオプション-Emergencyを指定していたならば,図6の処理602の内部に読み側の同期命令を挿入し忘れている箇所があったとしても,図6のソフトウェアは読み側の同期命令がきちんと挿入してある場合と同様の動作をおこなうことが可能になる。
Next, FIG. 6 shows an embodiment of software for recording a value in a storage area for designating the operation of the synchronous instruction. The software shown in FIG. 6 includes an
サーバにおいて,本発明を利用することで,ソフトウエアの欠陥を修復可能になる。 By utilizing the present invention in the server, it becomes possible to repair software defects.
301 プロセッサ
302 バス
303 主記憶
304 DVD−ROM読取装置
305 DVD−ROM
306 メモリインタフェース
307 命令解釈部
308 レジスタ群
309 命令実行部
310 プログラムカウンタPC
311 配線
312 同期命令実行回路
313 配線
314 同期モード指定レジスタ
315 クロック信号線
306
311
Claims (7)
前記同期命令の動作を指定する記憶領域に,値を記録する命令を提供し,該命令を実行する機能を有するプロセッサ。 The processor of claim 1, wherein
A processor having a function of providing an instruction for recording a value in a storage area for designating the operation of the synchronous instruction and executing the instruction.
同期命令の実行にあたり,前記記憶領域を参照し,該記憶領域に記録してある値により,同期命令の実行を完了するまでの遅延を変更する機能を有するプロセッサ。 The processor of claim 1, wherein
A processor having a function of referring to the storage area when executing a synchronous instruction and changing a delay until the execution of the synchronous instruction is completed according to a value recorded in the storage area.
同期命令の実行にあたり,前記記憶領域を参照し,該記憶領域に記録してある値により,ハードウェアトラップを発生する機能を有するプロセッサ。 The processor of claim 1, wherein
A processor having a function of referring to the storage area and generating a hardware trap according to a value recorded in the storage area when executing a synchronous instruction.
前記同期命令の動作は複数モードあり、それぞれの動作モードにおける同期処理に必要なサイクル数が異なることを特徴とするプロセッサ。 The processor of claim 1, wherein
2. The processor according to claim 1, wherein the operation of the synchronization instruction has a plurality of modes, and the number of cycles required for the synchronization processing in each operation mode is different.
前記同期命令の動作は複数モードあり、そのうちの1つの動作モードでは、同期処理に要するサイクル数が可変であることを特徴とするプロセッサ。
The processor of claim 1, wherein
The operation of the synchronous command has a plurality of modes, and in one of the operation modes, the number of cycles required for the synchronous processing is variable.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004066544A JP2005258607A (en) | 2004-03-10 | 2004-03-10 | Processor capable of executing software short of synchronization instruction |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004066544A JP2005258607A (en) | 2004-03-10 | 2004-03-10 | Processor capable of executing software short of synchronization instruction |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2005258607A true JP2005258607A (en) | 2005-09-22 |
Family
ID=35084284
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004066544A Pending JP2005258607A (en) | 2004-03-10 | 2004-03-10 | Processor capable of executing software short of synchronization instruction |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2005258607A (en) |
-
2004
- 2004-03-10 JP JP2004066544A patent/JP2005258607A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6223228B1 (en) | Apparatus for synchronizing multiple processors in a data processing system | |
US20070101318A1 (en) | Multi-core-model simulation method, multi-core model simulator, and computer product | |
WO2016106935A1 (en) | Flash memory controller and control method for flash memory controller | |
JP6312550B2 (en) | Semiconductor device | |
JP2007257441A (en) | Processor and processor control method | |
JP5811245B1 (en) | Information processing apparatus, memory order guarantee method, and program | |
JP2006113689A (en) | Bus bridge device and data transfer method | |
JP2006079345A (en) | Microcomputer | |
JP5578811B2 (en) | Information processing apparatus, information processing apparatus control method, and program | |
US6249880B1 (en) | Method and apparatus for exhaustively testing interactions among multiple processors | |
US6230263B1 (en) | Data processing system processor delay instruction | |
JP4382833B2 (en) | Processor | |
JP2005258607A (en) | Processor capable of executing software short of synchronization instruction | |
JPH07182170A (en) | Microprocessor | |
JP2017146703A (en) | Shared memory control circuit and shared memory control method | |
JP4806577B2 (en) | Trace data recording device | |
JP2005165825A (en) | Trace information recorder | |
JP3067408B2 (en) | Diagnosis method of memory access control device | |
JP5850732B2 (en) | Semiconductor device and control method thereof | |
JP2007213131A (en) | Microprocessor and memory access system | |
JP6645467B2 (en) | Microcomputer | |
JP2008003786A (en) | Logic simulation method and its device | |
JPH0784827A (en) | Trace device | |
JP2024111758A (en) | Information processing device and information processing program | |
JP5121134B2 (en) | Simulation apparatus and simulation method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD04 | Notification of resignation of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7424 Effective date: 20060424 |