JP4131909B2 - Compile method - Google Patents

Compile method Download PDF

Info

Publication number
JP4131909B2
JP4131909B2 JP2001226244A JP2001226244A JP4131909B2 JP 4131909 B2 JP4131909 B2 JP 4131909B2 JP 2001226244 A JP2001226244 A JP 2001226244A JP 2001226244 A JP2001226244 A JP 2001226244A JP 4131909 B2 JP4131909 B2 JP 4131909B2
Authority
JP
Japan
Prior art keywords
object code
computer
instruction
amount
hardware
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
JP2001226244A
Other languages
Japanese (ja)
Other versions
JP2003044289A (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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2001226244A priority Critical patent/JP4131909B2/en
Publication of JP2003044289A publication Critical patent/JP2003044289A/en
Application granted granted Critical
Publication of JP4131909B2 publication Critical patent/JP4131909B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Devices For Executing Special Programs (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、コンパイル方法、コンパイラ、このコンパイラを格納した記録媒体、コンパイル方法により作成されたオブジェクトコードを格納した記憶装置およびこの記憶装置を備えるプロセッサに関し、特にプロセッサの発熱量が規定値を超えないようにユーザプログラムをオブジェクトコードに変換するコンパイラの機能を対象とする。
【0002】
【従来の技術】
マイクロプロセッサ等の半導体機器は、近年の高周波数化に伴い、素子から発生する熱の量が増大する傾向にある。素子の温度が上昇すると、半導体機器に対して一時的な動作不良や半永久的な故障を引き起こす場合がある。このような問題を回避するため、従来は、一般的に以下のような対策が講じられてきた。
【0003】
(1)半導体機器に十分な法熱処理を施したり放熱装置を設けることにより、素子からの発熱量が最大になったときにも、素子の温度が規定温度を超えないようにする。
(2)機器の放熱量が一定であるという制約の下で、素子の動作周波数を下げる。
(3)素子の温度上昇を監視し、規定温度以上にまで上昇した場合に機器の動作周波数をダイナミックに低減する。
【0004】
【発明が解決しようとする課題】
しかしながら、上述した対策にはそれぞれ以下のような問題があった。
即ち、対策(1)では、一般的にコストの上昇を伴うため、一般消費者向きの機器、特に家庭用ゲーム機に採用することは困難である。
【0005】
また、(2)、(3)の対策については、これを実現するハードウェアは従来から存在するものの、放熱量に応じた動作周波数をOSで管理しようとすると、その自由度が低下する一方、明示的に温度を制御するプログラムをユーザが作成することは過大な負担を強いることになるという問題点があった。
【0006】
本発明は上記事情に鑑みてなされたものであり、その目的は、素子または機器の発熱量が規定値以下となるようにユーザプログラムをオブジェクトコードに変換するコンパイル方法を提供することにある。
【0007】
【課題を解決するための手段】
本発明は、プロセッサおよびこれを含むシステムの発熱をソフトウェアにより静的に制御することにより上記課題の解決を図る。
【0008】
即ち、本発明の第1の態様によれば、
コンパイラプログラムが読み込まれたコンピュータを用いたコンパイル方法であって、コンピュータが、ユーザプログラムの入力を受けてターゲットとなるハードウェアが解釈可能な暫定オブジェクトコードを生成する手順と、 上記コンピュータが、上記暫定オブジェクトコードを上記ハードウェアが実行した場合に上記ハードウェアから生じる発熱量を、上記ハードウェアの発熱量と上記ユーザプログラム内の命令または命令列との関係を記述した第1のテーブルを参照しながら算出する手順と、上記コンピュータが、上記ハードウェアの熱に関する仕様範囲を記述した第2のテーブルを参照することにより、算出された上記発熱量が上記仕様範囲内にあるかどうかを判定する手順と、上記コンピュータが、算出された上記発熱量が上記仕様範囲内にあると判定した場合は上記暫定オブジェクトコードを最終オブジェクトコードとして出力する手順と、上記コンピュータが、算出された上記発熱量が上記仕様範囲を超えると判定した場合は上記暫定オブジェクトコード内で上記仕様範囲を超える発熱の原因となるコード部分を最適化対象部分として発見し、第3のテーブルに記述された低電力用の複数の命令または命令列を用いて上記最適化対象部分による温度上昇を考慮した最適化処理を実行する手順と、上記コンピュータが、上記最適化処理を実行した暫定オブジェクトコードを最終オブジェクトコードとして出力する手順と、を備え、上記ハードウェアは、使用を停止した場合の発熱量が、使用した場合の発熱量と比較して小さくなるように設定されている複数のパイプラインを備え、上記最適化処理を実行する手順は、上記コンピュータが、上記複数のパイプラインのうち一部のパイプラインへの命令発行を停止する手順を含む、コンパイル方法が提供される。
【0010】
また、本発明の第2の態様によれば、
コンパイラプログラムが読み込まれたコンピュータを用いたコンパイル方法であって、コンピュータが、ユーザプログラムの入力を受けてターゲットとなるハードウェアが解釈可能な暫定オブジェクトコードを生成する手順と、上記コンピュータが、上記暫定オブジェクトコードを上記ハードウェアが実行した場合に上記ハードウェアから生じる発熱量を、上記ハードウェアの発熱量と上記ユーザプログラム内の命令または命令列との関係を記述した第1のテーブルを参照しながら算出する手順と、上記コンピュータが、上記ハードウェアの熱に関する仕様範囲を記述した第2のテーブルを参照することにより、算出された上記発熱量が上記仕様範囲内にあるかどうかを判定する手順と、上記コンピュータが、算出された上記発熱量が上記仕様範囲内にあると判定した場合は上記暫定オブジェクトコードを最終オブジェクトコードとして出力する手順と、上記コンピュータが、算出された上記発熱量が上記仕様範囲を超えると判定した場合は上記暫定オブジェクトコード内で上記仕様範囲を超える発熱の原因となるコード部分を最適化対象部分として発見し、第3のテーブルに記述された低電力用の複数の命令または命令列を用いて上記最適化対象部分による温度上昇を考慮した最適化処理を実行する手順と、上記コンピュータが、上記最適化処理を実行した暫定オブジェクトコードを最終オブジェクトコードとして出力する手順と、を備え、上記ハードウェアは、マルチプロセッサシステムを備え、上記最適化対象部分は、処理時間が短いプロセッサが、処理時間の長いプロセッサの動作が終了するまで待機しなければならない部分に該当し、上記最適化処理を実行する手順は、上記コンピュータが、上記第3のテーブル内の上記複数の命令または命令列から、処理速度を犠牲にして発熱量が小さくなる命令または命令列を選択し、上記待機しなければならない部分の命令または命令列を、上記選択した命令または命令列に置換する手順を含む、コンパイル方法が提供される。
【0014】
【発明の実施の形態】
以下、本発明の実施の形態のいくつかについて図面を参照しながら説明する。
まず、本発明にかかるコンパイル方法の適用対象となる半導体機器の発熱態様の一例について図面を参照しながら説明する。
【0015】
図1は、あるゲーム機器に用いられる一半導体チップの単位サイクルごとの発熱量を示すグラフである。この半導体チップについては、同図に示すように、各タイムインターバルで許容される総発熱量H1と限界ピーク発熱量H2が設定されている。この半導体チップの場合、タイムインターバルTI0においては総発熱量が許容量H1を超過しており、また、タイムインターバルTI1内のある時間帯では発熱量が限界ピーク発熱量H2を超過している。このような状態を放置すれば、ゲーム機に一時的な動作不良が発生するおそれがあり、ひいては機器の故障の要因となる可能性があるため、チップの発熱を抑制する必要がある。本発明の一特徴は、ユーザプログラム内の命令または命令列(以下、命令等という)のそれぞれについて処理時間の裕度を判断し、その処理が時間的に余裕があり、かつ温度を抑制したい場合、例えば発熱を抑制する機能を起動する命令を追加し、また、例えば発熱量が少ないサブルーチンを選択する点にある。これにより、処理がクリティカルな部分では最高のパフォーマンスを得ると同時に、仕様に適合した範囲内となるように機器の温度を制御するものである。
【0016】
(1)コンパイラの実施形態
まず、本発明にかかるコンパイラの実施の一形態について図2を参照しながら説明する。
図2は、本発明にかかるコンパイラの一実施形態の概略機能を説明する模式図である。本実施形態のコンパイラ2は、補助記憶装置を備える図示しないコンピュータにより実行される。このコンピュータには、ライブラリL2〜L8が接続される。ライブラリL2は、コンパイル時に必要な各種のパラメータが格納されている。これらのパラメータは、ターゲットとするシステムの限界温度やプログラム実行時の期待温度を含む。ライブラリL4は、命令等を実行した場合にチップ内のプロセッサに発生する発熱量をCADツールやシミュレーションにより予め設計時に算出して得られた、発熱量対命令等のテーブルが格納される。ライブラリL6には、低電力のサブルーチンが格納され、また、ライブラリL8には、高速動作用のサブルーチンが格納される。高速動作用サブルーチンとしては、例えば画像処理において高品質の画像を提供するが発熱量が大きくなってしまう関数が挙げられる。低電力のサブルーチンとしては、例えば画像処理において画像の質は少々劣るが発熱量を抑えられる関数が挙げられる。また、プロセッサ自体がハードウェア上の機能を備える場合は、低電力用サブルーチンに、プロセッサの周波数や電源電圧を下げるような特殊命令や処理パイプの本数を少なくするような特殊命令を予め用意しても良い。これらのサブルーチンの取り扱いについては後に詳述する。
【0017】
コンパイラ2は、各種パラメータをライブラリL2から取り込み、ソースコードとしてのユーザプログラムSCに対して通常のアセンブラ列を作成し、暫定オブジェクトコードOC2として出力する。次に、コンパイラ2は、この暫定オブジェクトコードOC2を仮実行し、ライブラリL4の発熱量対命令等のテーブルを参照しながら、各命令に対応して発熱量を記述したプロファイルPFを作成する。このプロファイルPFに基づいてコンパイラ2は、暫定オブジェクトコードOC2内で、限界ピーク発熱量を超えて発熱する部分と、各インターバルで総発熱量を超えて発熱するコード部分(以下、最適化対象部分という)を発見する。プログラム内で処理速度よりも発熱量を重視することをユーザが予め明示的に指定している場合は、コンパイラ2は、最適化対象部分に対する最適化処理をユーザに促す。ユーザによる明示的な指定がない場合は、コンパイラ2は、ライブラリL6およびL8から各種のサブルーチンを取り出し、これらのサブルーチンを利用しながら最適化対象部分について発熱量を考慮した温度最適化処理を実行する。コンパイラ2は、以上の処理を暫定オブジェクトコードがターゲットとする素子等の温度条件を満たすまで繰り返し、温度条件を満たす暫定オブジェクトコードを最終的なオブジェクトコードOC4として出力する。
図2に示すコンパイラ2のより具体的な機能について本発明にかかるコンパイル方法の実施の形態のいくつかとして以下に説明する。
【0018】
(2)コンパイル方法の第1の実施形態
まず、本発明にかかるコンパイル方法の第1の実施の形態について図3〜図6を参照しながら説明する。図3は、本実施形態のコンパイル方法の概略手順を示すフローチャートである。
まず、コンパイラ2は、ライブラリL2およびL4から各種パラメータを取り込む(ステップS1)。つぎに、コンパイラ2は、ユーザプログラムSCに対して通常のアセンブラ列を作成して暫定オブジェクトコードOC2として出力する(ステップS2)。次に、コンパイラ2は、上述した発熱量対命令等のテーブルを参照しながら、暫定オブジェクトコードOC2を仮実行することにより、プロファイルPFを作成して出力する(ステップS3)。このプロファイルPFには、仮実行時に各サブルーチンに関連づけられた予測ピーク発熱量のデータや総発熱量のデータが記述されている。続いて、コンパイラ2は、このプロファイルPFに基づいて、作成したアセンブラ列が温度条件を満たすか否かを判定する(ステップS4)。温度条件を満たす場合は、オブジェクトコードの最適化処理を行う必要がないので、作成したアセンブラ列による処理が所定時間内に終了することを確認して(ステップS11)、このアセンブラ列を最終的なオブジェクトコードOC4として出力し、コンパイル動作を終了する。
【0019】
作成したアセンブラ列が温度条件を満たさない場合、コンパイラ2は、プロファイルPFに基づいて、暫定オブジェクトコードOC2内で最適化対象部分を発見する(ステップS5)。前述したとおり、ユーザが最適化対象部分を予め明示的に指定している場合は(ステップS6)、コンパイラ2がその最適化対象部分を指示し(ステップS7)、ユーザに最適化処理を促す(ステップS8)。ユーザにより指定された最適化対象部分の一具体例を図4に示す。同図に示すプログラム中、“begin low_power”と“end low_power”は、コンパイラディレクティブ(指示子)であり、これらに囲まれたプログラム部分“bar();”は、処理速度よりも温度を優先して最適化することを示す。最適化対象部分がユーザにより予め指定されていない場合にコンパイラ2が該当部分を発見する手法の一例を図5に示す。同図(a)は、ユーザプログラム中のmain関数の一例を示し、同図(b)は、プロファイルPF中で(a)に示すmain関数中の各関数ごとに関連づけられた各インターバルでの総発熱量の最高値を示す。図5(b)に示すように、bar関数の総発熱量の最高値は100、barbar関数の総発熱量の最高値は10、barbarbar関数の総発熱量の最高値は20と記述されている。ここで、例えば総発熱量100がプロセッサの許容総発熱量H1(図1参照)を越えている場合は、bar関数について処理速度よりも温度、即ち、発熱量の低さを優先するように命令を最適化することになる。
【0020】
図3を再び参照し、最適化対象部分がユーザにより予め明示的に指定されていない場合は(ステップS6)、コンパイラ2は、最適化対象部分についてその部分による温度上昇を考慮した最適化処理を実行する。即ち、コンパイラ2は、ステップS5で発見した最適化対象部分に対して、プロファイルPFに記述されたサブルーチンごとの予測ピーク発熱量および総発熱量のデータを参照し、ライブラリL6(図2参照)に格納された複数の低電力サブルーチンから最適のサブルーチンを選択する(ステップS9)。続いて、コンパイラ2は、各サブルーチンを、選択した低電力サブルーチンに置換することにより命令列を組み替える(ステップS10)。図6は、最適のサブルーチンを選択するための一具体例を説明する模式図である。本例は、プロセッサがsqrt(√)のような複雑な演算を処理する演算器を含む場合の例である。低電力用のライブラリL6(図2参照)には、演算精度を気にしない場合に用いられる単精度バージョンのサブルーチンが格納され、この一方、ライブラリL8(図2参照)には、演算精度を優先する場合の倍精度バージョンのサブルーチンが格納されている。コンパイラ2は、同図に示すように、状況に応じて最適のライブラリやサブルーチンを割り当てる。このようなマッピング処理は、グラフィックプロセッサの場合で、発熱量が許容値からみて厳しいが画像が少々粗くなっても良いような演算の場合に、特に有利である。
【0021】
図3に戻り、コンパイラ2は、組み替えた命令列に対して再度仮実行を行い、温度条件が満たされるまで上述した手順を繰り返す(ステップS3〜S10)。これらの手順により、温度条件が満たされるようになると(ステップS4)、コンパイラ2は、最後に組み替えた命令列による処理が所定時間内に終了することを確認する(ステップS11)。所定時間内に終了する場合は、処理速度と発熱の双方がプロセッサの仕様に合致するので、最後の命令列を最終のオブジェクトコードOC4として出力し、コンパイル動作を終了する。所定時間内に終了しない場合は、処理速度と発熱の双方がプロセッサの仕様を満足していないので、コンパイラ2は、最適化対象部分を指示してエラーを出力し(ステップS12)、動作を終了する。このように、処理速度および発熱量の双方でプロセッサの仕様を満足するオブジェクトコードが得られない場合であっても、問題となる最適化対象部分がユーザに示されるので、ユーザは、改めて問題部分を探索する必要なく、ユーザプログラムの見直しに着手することができる。なお、本実施形態では、サブルーチンによる最適化処理を実行する形態について説明したが、これに限ることなく、例えばサブルーチンよりも細かい粒度を用いて最適化しても良い。この点は、以下に述べる第2〜第4の実施形態についても同様である。
【0022】
(3)コンパイル方法の第2の実施形態
次に、本発明にかかるコンパイル方法の第2の実施の形態について図7および図8を参照しながら説明する。本実施形態は、オブジェクトコードを実行するプロセッサまたはこれを含むシステムに、周波数や電源電圧を低減させる機能が備えられている場合に好適な形態である。
図7は、本実施形態のコンパイル方法の概略手順を説明するフローチャートである。図3との対比において明らかなように、本実施形態の特徴は、プログラムの最適化処理手順を表わすステップS26にある。従って、以下ではステップS26を中心に説明する。
【0023】
即ち、第1の実施形態と同様に、各種パラメータを取り込み(ステップS11)、ユーザプログラムSCに対して通常のアセンブラ列を作成して暫定オブジェクトコードOC2を出力する(ステップS22)。次に、コンパイラ2は、発熱量対命令等のテーブルを参照しながら、暫定オブジェクトコードOC2を仮実行することにより、プロファイルPFを作成して出力する(ステップS23)。続いて、コンパイラ2は、このプロファイルPFに基づいて、作成したアセンブラ列が温度条件を満たすか否かを判定する(ステップS24)。作成したアセンブラ列が温度条件を満たさない場合、コンパイラ2は、出力したプロファイルPFに基づいて暫定オブジェクトコードOC2内で最適化対象部分を発見する(ステップS25)。
【0024】
本実施形態においては、発熱量を抑える命令等をコンパイラ2が自動的に挿入する(ステップS26)。図8は、コンパイラ2が発熱量を抑える命令等を挿入する一具体例を示す。同図の上部に示すブロックBL2は、bar関数内で発熱が問題となるブロックであり、コンパイラ2により発見された最適化対象部分の一例である。図8の下部に示すように、本実施形態において、コンパイラ2は、ブロックBL2のbar関数の入り口と出口に特殊命令lowpwr, normalを追加する。ここでlowpwr命令は、周波数や電源電圧を低減させるための命令であり、また、normal命令は、変更した周波数、電源電圧を元に戻す命令である。
このように、本実施形態によれば、プロセッサまたはシステムが、周波数や電源電圧を低減させる機能を備える場合は、発熱量を抑える命令等をアセンブラ列内に挿入するので、機器の発熱を容易に抑制することができる。
【0025】
(4)コンパイル方法の第3の実施形態
次に、本発明にかかるコンパイル方法の第3の実施の形態について図9〜図11を参照しながら説明する。本実施形態は、複数のパイプラインであって、かつ、使用を停止した場合の発熱量が、使用した場合の発熱量と比較して小さくなるように設定されているパイプラインを備えるプロセッサに好適な形態である。このようなプロセッサとしては、典型的にはスーパスカラプロセッサやVLIWプロセッサが挙げられる。
図9は、本実施形態のコンパイル方法の概略手順を説明するフローチャートである。前述した第3の実施形態と同様に、本実施形態の特徴は、プログラムの最適化処理手順を表わすステップS46にある。本実施形態のその他の手順は、図7に示す第2の実施形態と実質的に同一であるので、以下ではステップS46を中心に説明する。
【0026】
まず、第2の実施形態と同様に、コンパイラ2は、各種パラメータを取り込み(ステップS41)、ユーザプログラムSCに対して通常のアセンブラ列を作成して暫定オブジェクトコードOC2を出力した後に(ステップS42)、発熱量対命令等のテーブルを参照しながら、暫定オブジェクトコードOC2を仮実行し、プロファイルPFを作成して出力する(ステップS43)。続いて、コンパイラ2は、このプロファイルPFに基づいて、作成したアセンブラ列が温度条件を満たすか否かを判定する(ステップS44)。作成したアセンブラ列が温度条件を満たさない場合、コンパイラ2は、出力したプロファイルPFに基づいて暫定オブジェクトコードOC2内で最適化対象部分を発見する(ステップS45)。この結果、あるインターバルで発熱量が制限値を超えていることが判明した場合、コンパイラ2は、複数のパイプラインのうち一部のパイプラインへの命令発行を停止し、さらに、発熱を抑制する命令等を追加する(ステップS46)。図10および図11は、このステップ46の手順を具体的に説明するための模式図である。図10は、nop命令等を受けて発熱を抑制する機能を備えるプロセッサが有する2本のパイプライン(パイプ0およびパイプ1)の動作モードを表わし、これらのうち、パイプ1での処理により、タイムインターバルT2,T3で発熱量が制限値を超えていることがプロファイルPFの情報から判明すると、コンパイラ2は、パイプライン1への命令発行を停止して発熱を抑制する命令等を追加する。同図に示す具体例においては、コンパイラ2は、2つのパイプをそれぞれ独立に動作させる命令等を発行するデュアル・イシュー・モードから単一のパイプのみ動作させる命令等を発行するシングル・イシュー・モードへ命令を変更する。図11は、図10に示すパイプライン0,1の動作を示し、(a)はデュアル・イシュー・モードでの動作を表わし、(b)はシングル・イシュー・モードでの動作を表わし、さらに、(c)は、コンパイラ2によりnop命令が挿入された状態を表わす。
【0027】
このように、本実施形態のコンパイル方法によれば、使用停止中は通常使用時よりも発熱量が抑制されるパイプラインをターゲットのハードウェアが備える場合に、動作モードを変更する命令等を挿入するので、機器の発熱量を抑制するオブジェクトコードを容易に生成することができる。
【0028】
(5)コンパイル方法の第4の実施形態
次に、本発明にかかるコンパイル方法の第4の実施の形態について図12を参照しながら説明する。本実施形態は、図1に示す手順をマルチプロセッサシステムに適用した場合のコンパイル方法である。従って、その概略手順全体の説明は省略し、以下では最適化方法(図1のステップS9)を中心に説明する。
【0029】
通常、マルチプロセッサシステムでは、各プロセッサ毎に処理が異なり、このためプログラムの部分々々においてプロッセサ同士で同期を取る必要がある。従って、ある同期時点と次の同期時点との間に挟まれたプログラム部分では、処理の軽い(処理時間が短い)プロセッサは、同一のプログラム部分において処理が重い(処理時間が長い)プロセッサの動作が終了するまで待機しなければならない。このとき、処理の軽いプロセッサにおいて機器全体の正常動作に影響を及ぼすほど発熱量が大きい場合は、処理速度を重視する命令等よりも発熱量の小ささを重視するような命令等やサブルーチンを選択させることが望ましい。本実施形態のコンパイル方法の特徴は、最適化対象部分が同期待ちの部分に該当し、かつ、処理速度を落としても問題がない場合に、その部分の命令等を、発熱量を重視する命令等またはサブルーチンに置換する点にある。
【0030】
図12は、プロセッサA,B,Cを含むマルチプロセッサに、あるオブジェクトコードを実行させた場合に生ずる発熱量を最適化処理前と最適化処理後に対比させて表わす模式図である。同図左側に示すように、この例に示すマルチプロセッサではプロセッサB,Cは、プロセッサAと比較して処理が軽いために、プロセッサAの処理が終了するまで同期待ちしている。この一方、プロセッサB,Cの同期点間の発熱量は、同期待ちを含めてそれぞれ100,130となっており、これが機器全体の正常動作に影響を及ぼすものとする。
【0031】
コンパイラ2は、これらのプロセッサB,C用のユーザプログラムに対し、処理速度を犠牲にして発熱量が小さくなるように命令列を生成する。このような最適化処理後の発熱量を図12の右側に示す。最適化処理により、プロセッサB,Cの処理速度は遅くなったが、同期点間の発熱量は、それぞれ50,60となり、機器全体の発熱量が大幅に低減することが分かる。
【0032】
このように、本実施形態によれば、余計な同期待ちのプログラム部分に対し、処理速度よりも発熱量の小ささを優先してオブジェクトコードを生成するので、ハードウェア資源を有効に活用しながら発熱量を抑制するコンパイル方法が提供される。
【0033】
(6)記録媒体
上述したコンパイラは、フロッピーディスクやCD−ROM等の記憶媒体に収納し、コンピュータに読込ませて実行させても良い。これにより、本発明にかかるコンパイル方法を汎用コンピュータを用いて実現することができる。記録媒体は、磁気ディスクや光ディスク等の携帯可能なものに限定されず、ハードディスク装置やメモリなどの固定型の記憶媒体でも良い。また、上述したコンパイラをインターネット等の通信回線(無線通信を含む)を介して頒布しても良い。さらに、上述したコンパイラを暗号化したり、変調をかけたり、圧縮した状態で、インターネット等の有線回線や無線回線を介して、あるいは記憶媒体に収納して頒布しても良い。
【0034】
(7)記憶装置およびプロセッサ
上述したコンパイル方法またはコンパイラにより生成されたオブジェクトコードは、記憶装置に格納してプロセッサに実行させても良い。また、プロセッサが記憶装置を内蔵する場合は、この内部記憶装置に上述したコンパイル方法またはコンパイラにより生成されたオブジェクトコードを格納してプロセッサに実行させても良い。これにより、ハードウェア資源を有効に活用しながら発熱量を抑制できる記憶装置またはプロセッサが提供される。
【0035】
【発明の効果】
以上詳述したとおり、本発明は、以下の効果を奏する。
即ち、本発明によれば、ハードウェアからの発熱を抑制できるコンパイル方法、このコンパイル方法をコンピュータに実行させるコンパイラ、およびこれを格納した記録媒体が提供される。
【0036】
また、本発明によれば、上述したコンパイル方法により生成され最適化処理がされたオブジェクトコードを記憶するので、ハードウェアの発熱量をその仕様範囲内に抑制できる記憶装置が提供される。
【0037】
さらに、本発明によれば、上述した記憶装置を備えるので、仕様範囲を超えて発熱することなく安定して動作するプロセッサが提供される。
【図面の簡単な説明】
【図1】あるゲーム機器に用いられる一半導体チップの単位サイクルごとの発熱量を示すグラフである。
【図2】本発明にかかるコンパイラの一実施形態の概略機能を説明する模式図である。
【図3】本発明にかかるコンパイル方法の第1の実施の形態の概略手順を示すフローチャートである。
【図4】ユーザにより指定された最適化対象部分の一具体例を示す図である。
【図5】(a)は、ユーザプログラム中のmain関数の一例を示し、(b)は、(a)に示すmain関数中の各関数ごとに関連づけられた各インターバルでの総発熱量の最高値を示す。
【図6】最適のサブルーチンを選択するための一具体例を説明する模式図である。
【図7】本発明にかかるコンパイル方法の第2の実施の形態の概略手順を説明するフローチャートである。
【図8】図7に示すフローのうち、発熱量を抑える命令等を挿入するフローを具体的に説明する図である。
【図9】本発明にかかるコンパイル方法の第3の実施の形態の概略手順を説明するフローチャートである。
【図10】図9に示すコンパイル方法の要部を説明する模式図である。
【図11】図9に示すコンパイル方法の要部を説明する模式図である。
【図12】本発明にかかるコンパイル方法の第4の実施の形態を説明する模式図である。
【符号の説明】
2 コンパイラ
BL2 ブロック
L2,L4,L6,L8 ライブラリ
OC2,OC4 オブジェクトコード
PF プロファイル
SC ユーザプログラム
T0,T1,T2,T3 タイムインターバル
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a compiling method, a compiler, a recording medium storing the compiler, a storage device storing an object code created by the compiling method, and a processor including the storage device, and in particular, the amount of heat generated by the processor does not exceed a specified value. Thus, the compiler function for converting a user program into object code is targeted.
[0002]
[Prior art]
2. Description of the Related Art Semiconductor devices such as microprocessors tend to increase the amount of heat generated from elements as the frequency increases in recent years. When the temperature of the element rises, the semiconductor device may cause a temporary malfunction or a semi-permanent failure. In order to avoid such problems, conventionally, the following measures have been generally taken.
[0003]
(1) A sufficient heat treatment or a heat dissipation device is applied to the semiconductor device so that the temperature of the element does not exceed a specified temperature even when the amount of heat generated from the element becomes maximum.
(2) Lower the operating frequency of the element under the constraint that the heat dissipation of the device is constant.
(3) The temperature rise of the element is monitored, and the operating frequency of the device is dynamically reduced when the temperature rises above a specified temperature.
[0004]
[Problems to be solved by the invention]
However, each of the measures described above has the following problems.
That is, the measure (1) generally involves an increase in cost, so it is difficult to adopt it for a device intended for general consumers, particularly a consumer game machine.
[0005]
As for the countermeasures of (2) and (3), although hardware for realizing this has conventionally existed, if the OS tries to manage the operating frequency according to the amount of heat dissipation, the degree of freedom decreases. There is a problem that creating a program for explicitly controlling the temperature imposes an excessive burden on the user.
[0006]
The present invention has been made in view of the above circumstances, and an object of the present invention is to convert a user program into an object code so that the amount of heat generated by an element or device is a specified value or less. How to compile Is to provide.
[0007]
[Means for Solving the Problems]
The present invention solves the above problems by statically controlling the heat generation of the processor and the system including the processor by software.
[0008]
That is, according to the first aspect of the present invention,
A compiling method using a computer into which a compiler program has been read, wherein the computer receives input from a user program and generates a provisional object code that can be interpreted by the target hardware; The amount of heat generated from the hardware when the object code is executed by the hardware is referred to a first table that describes the relationship between the amount of heat generated by the hardware and an instruction or instruction sequence in the user program. A procedure for calculating, and a procedure for determining whether or not the calculated calorific value is within the specification range by referring to a second table in which the computer describes the specification range regarding the heat of the hardware. The computer calculates the calorific value calculated above. If the computer determines that the calculated calorific value exceeds the specified range, the procedure for outputting the provisional object code as the final object code when it is determined to be within the specified range. The code part that causes the heat generation exceeding the above specification range is found as an optimization target part, and the temperature by the optimization target part using a plurality of instructions or instruction sequences for low power described in the third table. A procedure for executing an optimization process in consideration of an increase, and a procedure for the computer to output the provisional object code that has executed the optimization process as a final object code. The hardware has a plurality of pipelines set so that the heat generation amount when the use is stopped is smaller than the heat generation amount when the use is stopped, and the procedure for executing the optimization process is as follows. The computer includes a procedure of stopping issuing instructions to some of the plurality of pipelines; A compilation method is provided.
[0010]
According to the second aspect of the present invention,
A compiling method using a computer into which a compiler program has been read, wherein the computer receives input from a user program and generates a provisional object code that can be interpreted by target hardware; The amount of heat generated from the hardware when the object code is executed by the hardware is referred to a first table that describes the relationship between the amount of heat generated by the hardware and an instruction or instruction sequence in the user program. A procedure for calculating, and a procedure for determining whether or not the calculated calorific value is within the specification range by referring to a second table in which the computer describes the specification range regarding the heat of the hardware. The computer calculates the calorific value calculated above. If it is determined that it is within the range, the provisional object code is output as the final object code. If the computer determines that the calculated heat generation amount exceeds the specification range, the provisional object code A code part that causes heat generation exceeding the specification range is found as an optimization target part, and a temperature rise due to the optimization target part using a plurality of instructions or instruction sequences for low power described in the third table And a procedure for executing an optimization process considering the above and a procedure for the computer to output the provisional object code that has executed the optimization process as a final object code, and the hardware includes a multiprocessor system, The optimization target part has a processor with a short processing time and a processor with a long processing time. The procedure for executing the optimization process corresponds to the part that must be waited until the operation is completed, and the computer sacrifices the processing speed from the plurality of instructions or instruction sequences in the third table. Compiling method including a procedure of selecting an instruction or instruction sequence that generates a small amount of heat and replacing the instruction or instruction sequence of the portion that must be waited with the selected instruction or instruction sequence Is provided.
[0014]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, some embodiments of the present invention will be described with reference to the drawings.
First, an example of a heat generation mode of a semiconductor device to which a compiling method according to the present invention is applied will be described with reference to the drawings.
[0015]
FIG. 1 is a graph showing the amount of heat generated per unit cycle of one semiconductor chip used in a certain game machine. For this semiconductor chip, as shown in the figure, a total heat generation amount H1 and a limit peak heat generation amount H2 allowed in each time interval are set. In the case of this semiconductor chip, the total heat generation amount exceeds the allowable amount H1 in the time interval TI0, and the heat generation amount exceeds the limit peak heat generation amount H2 in a certain time zone within the time interval TI1. If such a state is left unattended, there is a possibility that a temporary malfunction may occur in the game machine, which in turn may cause a failure of the device, so it is necessary to suppress the heat generation of the chip. One feature of the present invention is that the margin of processing time is determined for each instruction or instruction sequence (hereinafter referred to as an instruction or the like) in the user program, and the processing has a time margin and it is desired to suppress the temperature. For example, a command for starting a function for suppressing heat generation is added, and for example, a subroutine with a small amount of heat generation is selected. As a result, the temperature of the device is controlled so as to obtain the best performance in the critical part of the process and at the same time meet the specification.
[0016]
(1) Compiler embodiment
First, an embodiment of a compiler according to the present invention will be described with reference to FIG.
FIG. 2 is a schematic diagram for explaining the schematic function of an embodiment of the compiler according to the present invention. The compiler 2 of the present embodiment is executed by a computer (not shown) provided with an auxiliary storage device. Libraries L2-L8 are connected to this computer. The library L2 stores various parameters necessary for compilation. These parameters include the limit temperature of the target system and the expected temperature during program execution. The library L4 stores a table of calorific value vs. instruction and the like obtained by calculating in advance the design of the calorific value generated in the processor in the chip when executing an instruction or the like by a CAD tool or simulation. The library L6 stores low-power subroutines, and the library L8 stores high-speed subroutines. Examples of the high-speed operation subroutine include a function that provides a high-quality image in image processing but increases the amount of heat generation. An example of the low power subroutine is a function that can suppress the amount of heat generated although the image quality is slightly inferior in image processing. If the processor itself has hardware functions, a special instruction that lowers the frequency and power supply voltage of the processor and a special instruction that reduces the number of processing pipes are prepared in advance in the low power subroutine. Also good. The handling of these subroutines will be described in detail later.
[0017]
The compiler 2 fetches various parameters from the library L2, creates a normal assembler sequence for the user program SC as source code, and outputs it as a provisional object code OC2. Next, the compiler 2 provisionally executes the provisional object code OC2, and creates a profile PF in which the heat generation amount is described corresponding to each instruction while referring to a table of the heat generation amount versus instruction in the library L4. Based on this profile PF, the compiler 2 generates a portion that generates heat exceeding the limit peak heat generation amount and a code portion that generates heat exceeding the total heat generation amount in each interval (hereinafter referred to as an optimization target portion) in the provisional object code OC2. ) To discover. If the user explicitly specifies in advance that the heat generation amount is more important than the processing speed in the program, the compiler 2 prompts the user to perform optimization processing on the optimization target portion. If there is no explicit designation by the user, the compiler 2 takes out various subroutines from the libraries L6 and L8, and executes a temperature optimization process in consideration of the heat generation amount for the optimization target portion using these subroutines. . The compiler 2 repeats the above processing until the temperature condition of the element or the like targeted by the temporary object code is satisfied, and outputs the temporary object code that satisfies the temperature condition as the final object code OC4.
More specific functions of the compiler 2 shown in FIG. 2 will be described below as some embodiments of the compiling method according to the present invention.
[0018]
(2) First embodiment of compiling method
First, a first embodiment of a compiling method according to the present invention will be described with reference to FIGS. FIG. 3 is a flowchart showing a schematic procedure of the compiling method of the present embodiment.
First, the compiler 2 takes in various parameters from the libraries L2 and L4 (step S1). Next, the compiler 2 creates a normal assembler string for the user program SC and outputs it as the provisional object code OC2 (step S2). Next, the compiler 2 creates and outputs the profile PF by provisionally executing the provisional object code OC2 while referring to the above-described table of the amount of generated heat versus the instruction (step S3). In this profile PF, predicted peak heat generation data and total heat generation data associated with each subroutine at the time of provisional execution are described. Subsequently, the compiler 2 determines whether or not the created assembler string satisfies the temperature condition based on the profile PF (step S4). When the temperature condition is satisfied, it is not necessary to perform the object code optimization process. Therefore, it is confirmed that the processing by the created assembler sequence is completed within a predetermined time (step S11). The object code OC4 is output and the compilation operation is terminated.
[0019]
When the created assembler string does not satisfy the temperature condition, the compiler 2 finds an optimization target portion in the provisional object code OC2 based on the profile PF (step S5). As described above, when the user explicitly specifies the optimization target portion in advance (step S6), the compiler 2 instructs the optimization target portion (step S7), and prompts the user to perform optimization processing (step S7). Step S8). A specific example of the optimization target portion designated by the user is shown in FIG. In the program shown in the figure, “begin low_power” and “end low_power” are compiler directives (indicators), and the program part “bar ();” surrounded by these gives priority to temperature over processing speed. To optimize. FIG. 5 shows an example of a method in which the compiler 2 finds a corresponding portion when the optimization target portion is not designated in advance by the user. FIG. 5A shows an example of the main function in the user program, and FIG. 4B shows the total in each interval associated with each function in the main function shown in FIG. Indicates the maximum calorific value. As shown in FIG. 5B, the maximum total calorific value of the bar function is 100, the maximum total calorific value of the barbar function is 10, and the maximum total calorific value of the barbarbar function is 20. . Here, for example, when the total calorific value 100 exceeds the allowable total calorific value H1 (see FIG. 1) of the processor, a command is given to give priority to the temperature, ie, the low calorific value, over the processing speed for the bar function. Will be optimized.
[0020]
Referring to FIG. 3 again, when the optimization target portion is not explicitly specified in advance by the user (step S6), the compiler 2 performs an optimization process in consideration of the temperature rise due to the optimization target portion. Execute. That is, the compiler 2 refers to the data of the predicted peak heat generation amount and the total heat generation amount for each subroutine described in the profile PF with respect to the optimization target portion found in step S5, and stores it in the library L6 (see FIG. 2). An optimum subroutine is selected from the stored low power subroutines (step S9). Subsequently, the compiler 2 rearranges the instruction sequence by replacing each subroutine with the selected low-power subroutine (step S10). FIG. 6 is a schematic diagram for explaining a specific example for selecting the optimum subroutine. In this example, the processor includes an arithmetic unit that processes a complex operation such as sqrt (√). The low-power library L6 (see FIG. 2) stores a single-precision version of a subroutine used when calculation accuracy is not a concern, while the library L8 (see FIG. 2) gives priority to calculation accuracy. A double precision version of the subroutine is stored. As shown in the figure, the compiler 2 assigns an optimal library and subroutine according to the situation. Such a mapping process is particularly advantageous in the case of an operation in which the amount of heat generation is severe in view of the allowable value, but the image may be slightly rough, in the case of a graphic processor.
[0021]
Returning to FIG. 3, the compiler 2 performs provisional execution again on the rearranged instruction sequence, and repeats the above-described procedure until the temperature condition is satisfied (steps S3 to S10). When the temperature condition is satisfied by these procedures (step S4), the compiler 2 confirms that the processing by the last rearranged instruction sequence is completed within a predetermined time (step S11). When the processing ends within a predetermined time, both the processing speed and the heat generation meet the specifications of the processor, so the last instruction sequence is output as the final object code OC4, and the compiling operation ends. If the processing does not end within the predetermined time, both the processing speed and the heat generation do not satisfy the processor specifications, so the compiler 2 indicates an optimization target portion and outputs an error (step S12), and the operation ends. To do. As described above, even if the object code that satisfies the processor specifications in both the processing speed and the heat generation amount cannot be obtained, the optimization target part in question is shown to the user. The user program can be reviewed without the need to search for the program. In the present embodiment, the form in which the optimization process by the subroutine is executed has been described. However, the present invention is not limited to this. For example, the optimization may be performed using a finer granularity than the subroutine. This also applies to the second to fourth embodiments described below.
[0022]
(3) Second embodiment of compiling method
Next, a second embodiment of the compiling method according to the present invention will be described with reference to FIGS. This embodiment is a mode suitable for a case where a processor for executing object code or a system including the same is provided with a function for reducing frequency and power supply voltage.
FIG. 7 is a flowchart for explaining a schematic procedure of the compiling method of this embodiment. As is clear from the comparison with FIG. 3, the feature of the present embodiment is in step S26 representing the program optimization processing procedure. Therefore, hereinafter, step S26 will be mainly described.
[0023]
That is, as in the first embodiment, various parameters are fetched (step S11), a normal assembler string is created for the user program SC, and the provisional object code OC2 is output (step S22). Next, the compiler 2 creates and outputs a profile PF by provisionally executing the provisional object code OC2 while referring to a table of the amount of generated heat vs. instructions (step S23). Subsequently, the compiler 2 determines whether or not the created assembler string satisfies the temperature condition based on the profile PF (step S24). If the created assembler string does not satisfy the temperature condition, the compiler 2 finds an optimization target portion in the provisional object code OC2 based on the output profile PF (step S25).
[0024]
In the present embodiment, the compiler 2 automatically inserts an instruction or the like for suppressing the amount of generated heat (step S26). FIG. 8 shows a specific example in which the compiler 2 inserts an instruction or the like for suppressing the heat generation amount. A block BL2 shown in the upper part of the figure is a block in which heat generation is a problem in the bar function, and is an example of an optimization target portion discovered by the compiler 2. As shown in the lower part of FIG. 8, in this embodiment, the compiler 2 adds special instructions lowpwr and normal to the entrance and exit of the bar function of the block BL2. Here, the lowpwr instruction is an instruction for reducing the frequency and the power supply voltage, and the normal instruction is an instruction for restoring the changed frequency and power supply voltage.
As described above, according to the present embodiment, when the processor or system has a function of reducing the frequency and the power supply voltage, an instruction or the like for suppressing the amount of generated heat is inserted into the assembler row, so that the device can easily generate heat. Can be suppressed.
[0025]
(4) Third embodiment of compiling method
Next, a third embodiment of the compiling method according to the present invention will be described with reference to FIGS. The present embodiment is suitable for a processor including a plurality of pipelines and a pipeline that is set so that the heat generation amount when the use is stopped is smaller than the heat generation amount when the use is stopped. It is a form. Such a processor typically includes a superscalar processor and a VLIW processor.
FIG. 9 is a flowchart for explaining a schematic procedure of the compiling method of this embodiment. Similar to the third embodiment described above, the present embodiment is characterized in step S46 representing a program optimization process. Since the other procedures of this embodiment are substantially the same as those of the second embodiment shown in FIG. 7, the following description will focus on step S46.
[0026]
First, as in the second embodiment, the compiler 2 takes in various parameters (step S41), creates a normal assembler string for the user program SC, and outputs the provisional object code OC2 (step S42). Then, the provisional object code OC2 is provisionally executed while referring to the table of the heat generation amount instruction, etc., and the profile PF is created and output (step S43). Subsequently, the compiler 2 determines whether the created assembler string satisfies the temperature condition based on the profile PF (step S44). If the created assembler string does not satisfy the temperature condition, the compiler 2 finds an optimization target portion in the provisional object code OC2 based on the output profile PF (step S45). As a result, when it is found that the heat generation amount exceeds the limit value at a certain interval, the compiler 2 stops issuing instructions to some of the pipelines and further suppresses the heat generation. An instruction or the like is added (step S46). 10 and 11 are schematic diagrams for specifically explaining the procedure of step 46. FIG. 10 shows operation modes of two pipelines (pipe 0 and pipe 1) of a processor having a function of suppressing heat generation in response to a nop instruction or the like. If it is found from the information of the profile PF that the amount of heat generation exceeds the limit value at intervals T2 and T3, the compiler 2 adds an instruction or the like that stops issuing instructions to the pipeline 1 and suppresses heat generation. In the specific example shown in the figure, the compiler 2 issues a single issue mode for issuing an instruction for operating only a single pipe from a dual issue mode for issuing an instruction for operating two pipes independently. Change the order to 11 shows the operation of the pipelines 0 and 1 shown in FIG. 10, (a) shows the operation in the dual issue mode, (b) shows the operation in the single issue mode, (C) represents a state in which the nop instruction has been inserted by the compiler 2.
[0027]
As described above, according to the compiling method of the present embodiment, when the target hardware has a pipeline that suppresses the amount of heat generation during normal use, the instruction to change the operation mode is inserted. Therefore, the object code that suppresses the heat generation amount of the device can be easily generated.
[0028]
(5) Fourth embodiment of compiling method
Next, a fourth embodiment of the compiling method according to the present invention will be described with reference to FIG. This embodiment is a compiling method when the procedure shown in FIG. 1 is applied to a multiprocessor system. Therefore, description of the overall procedure is omitted, and the following description will focus on the optimization method (step S9 in FIG. 1).
[0029]
Usually, in a multiprocessor system, the processing is different for each processor, and therefore it is necessary to synchronize the processors in each part of the program. Therefore, in a program part sandwiched between a certain synchronization point and the next synchronization point, a processor with a light process (short processing time) operates a processor with a heavy process (long processing time) in the same program part. You have to wait until it finishes. At this time, if the amount of heat generation is large enough to affect the normal operation of the entire device in a lightly processed processor, select an instruction or subroutine that emphasizes a small amount of heat generation rather than an instruction that emphasizes processing speed. It is desirable to make it. The feature of the compiling method of this embodiment is that when the optimization target part corresponds to a part waiting for synchronization and there is no problem even if the processing speed is reduced, the instruction of that part is an instruction that places importance on the amount of heat generation. It is in the point of substituting with an equal or subroutine.
[0030]
FIG. 12 is a schematic diagram showing the amount of heat generated when an object code is executed by a multiprocessor including processors A, B, and C, before and after the optimization process. As shown on the left side of the figure, in the multiprocessor shown in this example, the processors B and C are waiting for synchronization until the processing of the processor A is completed because the processing is lighter than the processor A. On the other hand, the amount of heat generated between the synchronization points of the processors B and C is 100 and 130, respectively, including the synchronization wait, and this affects the normal operation of the entire device.
[0031]
The compiler 2 generates an instruction sequence for the user programs for the processors B and C so that the heat generation amount is reduced at the expense of the processing speed. The amount of heat generated after such optimization processing is shown on the right side of FIG. Although the processing speeds of the processors B and C are slowed down by the optimization processing, the heat generation amount between the synchronization points becomes 50 and 60, respectively, and it can be seen that the heat generation amount of the entire device is greatly reduced.
[0032]
As described above, according to the present embodiment, object code is generated by giving priority to the smaller amount of heat generation than the processing speed for the extra synchronization waiting program part, so that hardware resources can be used effectively. A compiling method for suppressing calorific value is provided.
[0033]
(6) Recording medium
The above-described compiler may be stored in a storage medium such as a floppy disk or a CD-ROM, and read by a computer and executed. Thereby, the compiling method concerning this invention is realizable using a general purpose computer. The recording medium is not limited to a portable medium such as a magnetic disk or an optical disk, but may be a fixed storage medium such as a hard disk device or a memory. Further, the compiler described above may be distributed via a communication line (including wireless communication) such as the Internet. Further, the above-described compiler may be distributed via a wired line or a wireless line such as the Internet or in a storage medium in a state where the compiler is encrypted, modulated, or compressed.
[0034]
(7) Storage device and processor
The object code generated by the above-described compiling method or compiler may be stored in a storage device and executed by a processor. Further, when the processor has a built-in storage device, the object code generated by the above-described compiling method or compiler may be stored in the internal storage device and executed by the processor. This provides a storage device or processor that can suppress the amount of heat generation while effectively utilizing hardware resources.
[0035]
【The invention's effect】
As described above in detail, the present invention has the following effects.
That is, according to the present invention, there are provided a compiling method capable of suppressing heat generation from hardware, a compiler for causing a computer to execute the compiling method, and a recording medium storing the compiling method.
[0036]
Further, according to the present invention, since the object code generated by the above-described compiling method and subjected to the optimization process is stored, a storage device capable of suppressing the heat generation amount of the hardware within the specification range is provided.
[0037]
Furthermore, according to the present invention, since the storage device described above is provided, a processor that operates stably without generating heat exceeding the specification range is provided.
[Brief description of the drawings]
FIG. 1 is a graph showing a heat generation amount per unit cycle of one semiconductor chip used in a certain game machine.
FIG. 2 is a schematic diagram illustrating a schematic function of an embodiment of a compiler according to the present invention.
FIG. 3 is a flowchart showing a schematic procedure of a first embodiment of a compiling method according to the present invention.
FIG. 4 is a diagram illustrating a specific example of an optimization target portion designated by a user.
FIG. 5A shows an example of a main function in a user program, and FIG. 5B shows a maximum total calorific value in each interval associated with each function in the main function shown in FIG. Indicates the value.
FIG. 6 is a schematic diagram for explaining a specific example for selecting an optimum subroutine.
FIG. 7 is a flowchart illustrating a schematic procedure of a second embodiment of a compiling method according to the present invention.
8 is a diagram for specifically explaining a flow for inserting a command or the like for suppressing the amount of generated heat in the flow shown in FIG. 7. FIG.
FIG. 9 is a flowchart illustrating a schematic procedure of a third embodiment of a compiling method according to the present invention.
10 is a schematic diagram for explaining a main part of the compiling method shown in FIG. 9. FIG.
11 is a schematic diagram for explaining a main part of the compiling method shown in FIG. 9;
FIG. 12 is a schematic diagram for explaining a fourth embodiment of a compiling method according to the present invention;
[Explanation of symbols]
2 Compiler
BL2 block
L2, L4, L6, L8 library
OC2, OC4 Object code
PF profile
SC user program
T0, T1, T2, T3 Time interval

Claims (2)

コンパイラプログラムが読み込まれたコンピュータを用いたコンパイル方法であって、
コンピュータが、ユーザプログラムの入力を受けてターゲットとなるハードウェアが解釈可能な暫定オブジェクトコードを生成する手順と、
前記コンピュータが、前記暫定オブジェクトコードを前記ハードウェアが実行した場合に前記ハードウェアから生じる発熱量を、前記ハードウェアの発熱量と前記ユーザプログラム内の命令または命令列との関係を記述した第1のテーブルを参照しながら算出する手順と、
前記コンピュータが、前記ハードウェアの熱に関する仕様範囲を記述した第2のテーブルを参照することにより、算出された前記発熱量が前記仕様範囲内にあるかどうかを判定する手順と、
前記コンピュータが、算出された前記発熱量が前記仕様範囲内にあると判定した場合は前記暫定オブジェクトコードを最終オブジェクトコードとして出力する手順と、
前記コンピュータが、算出された前記発熱量が前記仕様範囲を超えると判定した場合は前記暫定オブジェクトコード内で前記仕様範囲を超える発熱の原因となるコード部分を最適化対象部分として発見し、第3のテーブルに記述された低電力用の複数の命令または命令列を用いて前記最適化対象部分による温度上昇を考慮した最適化処理を実行する手順と、
前記コンピュータが、前記最適化処理を実行した暫定オブジェクトコードを最終オブジェクトコードとして出力する手順と、
を備え
前記ハードウェアは、使用を停止した場合の発熱量が、使用した場合の発熱量と比較して小さくなるように設定されている複数のパイプラインを備え、
前記最適化処理を実行する手順は、前記コンピュータが、前記複数のパイプラインのうち一部のパイプラインへの命令発行を停止する手順を含む、
コンパイル方法。
Compiling method using a computer loaded with a compiler program,
A procedure in which a computer receives input from a user program and generates provisional object code that can be interpreted by target hardware;
When the computer executes the provisional object code, the amount of heat generated from the hardware is described as a relationship between the amount of heat generated by the hardware and an instruction or instruction sequence in the user program. The procedure for calculating while referring to the table of
A step of determining whether or not the calculated calorific value is within the specification range by referring to a second table in which the computer describes a specification range regarding the heat of the hardware;
A step of outputting the provisional object code as a final object code when the computer determines that the calculated calorific value is within the specification range;
When the computer determines that the calculated amount of heat generation exceeds the specification range, the computer finds a code portion that causes heat generation that exceeds the specification range in the provisional object code as a portion to be optimized, and A procedure for performing optimization processing in consideration of a temperature increase due to the optimization target portion using a plurality of instructions or instruction sequences for low power described in the table of
The computer outputs a provisional object code that has executed the optimization process as a final object code;
Equipped with a,
The hardware includes a plurality of pipelines set so that the amount of heat generated when use is stopped is smaller than the amount of heat generated when used,
The procedure for executing the optimization process includes a procedure in which the computer stops issuing instructions to some of the plurality of pipelines.
Compilation method.
コンパイラプログラムが読み込まれたコンピュータを用いたコンパイル方法であって、
コンピュータが、ユーザプログラムの入力を受けてターゲットとなるハードウェアが解釈可能な暫定オブジェクトコードを生成する手順と、
前記コンピュータが、前記暫定オブジェクトコードを前記ハードウェアが実行した場合に前記ハードウェアから生じる発熱量を、前記ハードウェアの発熱量と前記ユーザプログラム内の命令または命令列との関係を記述した第1のテーブルを参照しながら算出する手順と、
前記コンピュータが、前記ハードウェアの熱に関する仕様範囲を記述した第2のテーブルを参照することにより、算出された前記発熱量が前記仕様範囲内にあるかどうかを判定する手順と、
前記コンピュータが、算出された前記発熱量が前記仕様範囲内にあると判定した場合は前記暫定オブジェクトコードを最終オブジェクトコードとして出力する手順と、
前記コンピュータが、算出された前記発熱量が前記仕様範囲を超えると判定した場合は前記暫定オブジェクトコード内で前記仕様範囲を超える発熱の原因となるコード部分を最適化対象部分として発見し、第3のテーブルに記述された低電力用の複数の命令または命令列を用いて前記最適化対象部分による温度上昇を考慮した最適化処理を実行する手順と、
前記コンピュータが、前記最適化処理を実行した暫定オブジェクトコードを最終オブジェクトコードとして出力する手順と、
を備え
前記ハードウェアは、マルチプロセッサシステムを備え、
前記最適化対象部分は、処理時間が短いプロセッサが、処理時間の長いプロセッサの動 作が終了するまで待機しなければならない部分に該当し、
前記最適化処理を実行する手順は、前記コンピュータが、前記第3のテーブル内の前記複数の命令または命令列から、処理速度を犠牲にして発熱量が小さくなる命令または命令列を選択し、前記待機しなければならない部分の命令または命令列を、前記選択した命令または命令列に置換する手順を含む、
コンパイル方法。
Compiling method using a computer loaded with a compiler program,
A procedure in which a computer receives input from a user program and generates provisional object code that can be interpreted by target hardware;
When the computer executes the provisional object code, the amount of heat generated from the hardware is described as a relationship between the amount of heat generated by the hardware and an instruction or instruction sequence in the user program. The procedure for calculating while referring to the table of
A step of determining whether or not the calculated calorific value is within the specification range by referring to a second table in which the computer describes a specification range regarding the heat of the hardware;
A step of outputting the provisional object code as a final object code when the computer determines that the calculated calorific value is within the specification range;
When the computer determines that the calculated amount of heat generation exceeds the specification range, the computer finds a code portion that causes heat generation that exceeds the specification range in the provisional object code as a portion to be optimized, and A procedure for performing optimization processing in consideration of a temperature increase due to the optimization target portion using a plurality of instructions or instruction sequences for low power described in the table of
The computer outputs a provisional object code that has executed the optimization process as a final object code;
Equipped with a,
The hardware comprises a multiprocessor system,
Wherein the optimization target portion, the processing time is short processors, it corresponds to the portion where operation of a long-processor processing time must wait until the end,
In the procedure for executing the optimization process, the computer selects, from the plurality of instructions or instruction sequences in the third table, an instruction or instruction sequence that generates a small amount of heat at the expense of processing speed, and Replacing a portion of the instruction or instruction sequence that must be waited with the selected instruction or instruction sequence;
Compilation method.
JP2001226244A 2001-07-26 2001-07-26 Compile method Expired - Fee Related JP4131909B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001226244A JP4131909B2 (en) 2001-07-26 2001-07-26 Compile method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001226244A JP4131909B2 (en) 2001-07-26 2001-07-26 Compile method

Publications (2)

Publication Number Publication Date
JP2003044289A JP2003044289A (en) 2003-02-14
JP4131909B2 true JP4131909B2 (en) 2008-08-13

Family

ID=19059095

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001226244A Expired - Fee Related JP4131909B2 (en) 2001-07-26 2001-07-26 Compile method

Country Status (1)

Country Link
JP (1) JP4131909B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4231516B2 (en) 2006-08-04 2009-03-04 株式会社日立製作所 Execution code generation method and program
WO2009081473A1 (en) * 2007-12-21 2009-07-02 Fujitsu Limited Image processing apparatus, image processing method, and image processing program
JP6933052B2 (en) * 2017-08-23 2021-09-08 富士通株式会社 Information processing equipment, compilation method and compilation program
WO2020163603A1 (en) * 2019-02-06 2020-08-13 Magic Leap, Inc. Target intent-based clock speed determination and adjustment to limit total heat generated by multiple processors
JP7552405B2 (en) 2021-02-08 2024-09-18 富士通株式会社 PROGRAM FOR DECIDING PROCESSING BLOCK TO BE OPTIMIZED AND METHOD FOR DECIDING PROCESSING BLOCK TO BE OPTIMIZED

Also Published As

Publication number Publication date
JP2003044289A (en) 2003-02-14

Similar Documents

Publication Publication Date Title
JP4339907B2 (en) Optimal code generation method and compiling device for multiprocessor
Warter et al. Enhanced modulo scheduling for loops with conditional branches
US7543282B2 (en) Method and apparatus for selectively executing different executable code versions which are optimized in different ways
Hwu et al. Compiler technology for future microprocessors
JP4082706B2 (en) Multiprocessor system and multigrain parallelizing compiler
JP4231516B2 (en) Execution code generation method and program
JP5283762B2 (en) Arithmetic processing apparatus, information processing apparatus and control method thereof
JP2921190B2 (en) Parallel execution method
US20020013937A1 (en) Register economy heuristic for a cycle driven multiple issue instruction scheduler
JP2007328416A (en) Global compiler for heterogeneous multiprocessor
JP4381459B1 (en) Information processing apparatus, granularity adjustment method, and program
Nagarajan et al. Static placement, dynamic issue (SPDI) scheduling for EDGE architectures
US8166321B2 (en) Method and apparatus to adapt the clock rate of a programmable coprocessor for optimal performance and power dissipation
JP4131909B2 (en) Compile method
Gyllenhaal et al. Optimization of machine descriptions for efficient use
JP2000284970A (en) Program converting device and processor
JP5576605B2 (en) Program conversion apparatus and program conversion method
JP4462676B2 (en) Program conversion device, compiler device, and computer-readable recording medium recording program conversion program
Maroun et al. Compiler-directed constant execution time on flat memory systems
JP4846226B2 (en) Information processing apparatus, information processing method, and program
Gomez et al. Optimizing the memory bandwidth with loop morphing
JPH10240704A (en) Multiprocessor system and instruction generating device
US10042645B2 (en) Method and apparatus for compiling a program for execution by a plurality of processing units
August Hyperblock performance optimizations for ILP processors
Gupta code Optimization as a side effect of instruction scheduling

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050309

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20071113

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071130

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080129

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080229

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080424

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20080523

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080529

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

Free format text: PAYMENT UNTIL: 20110606

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110606

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees