JP2004234068A - Program performance evaluation method and profiler - Google Patents

Program performance evaluation method and profiler Download PDF

Info

Publication number
JP2004234068A
JP2004234068A JP2003018560A JP2003018560A JP2004234068A JP 2004234068 A JP2004234068 A JP 2004234068A JP 2003018560 A JP2003018560 A JP 2003018560A JP 2003018560 A JP2003018560 A JP 2003018560A JP 2004234068 A JP2004234068 A JP 2004234068A
Authority
JP
Japan
Prior art keywords
area
cycles
function
changed
change
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.)
Abandoned
Application number
JP2003018560A
Other languages
Japanese (ja)
Inventor
Shintaro Shimogoori
慎太郎 下郡
Katsutoshi Ishikawa
勝敏 石川
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.)
Pacific Design Inc
Original Assignee
Pacific Design Inc
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 Pacific Design Inc filed Critical Pacific Design Inc
Priority to JP2003018560A priority Critical patent/JP2004234068A/en
Publication of JP2004234068A publication Critical patent/JP2004234068A/en
Abandoned legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a program performance evaluation method capable of easily evaluating an operation simulation result from a plurality of view points in a processor designing process. <P>SOLUTION: A profiler 4 is provided with a first process (step 6) in which simulation is operated by an operation simulator 3 so that information contents are clearly displayed to a user on the basis of obtained profile information 5 for verification and evaluation. The profiler 4 is also provided with a step 6a for changing the displayed contents for further verification and the evaluation of the information contents and a second process (step 7) for performing virtual evaluation according to the changed contents. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、プロセッサの設計方法およびプロファイラに関するものである。
【0002】
【従来の技術】
従来、アセンブラやC/C++などのコンピュータ・プログラム記述言語を用いたハードウェア設計においては、設計目標となるハードウェア上での、プログラムの各ステップや各行の実行に要するCPU時間やクロック・サイクル数などの情報(以下、プロファイル情報と呼ぶ)が、ハードウェア全体の機能や性能に影響するため、それらプロファイル情報を動作シミュレーションにより設計段階で予め計測、取得し、プロファイラと呼ばれる分析ツールを用いて計測結果を記録、表示するなどの方法により、設計評価を行ってきた。
【0003】
近年、C言語で記述されたコンピュータ・プログラムにより与えられた仕様を実現するプロセッサを開発および設計する際に、その仕様全体を直にハードウェアに変換するのではなく、仕様の一部を専用プロセッサを介して動作するようにハードウェア化する方式が提案されている。このような場合においても同様に、仕様となるコンピュータ・プログラム全体について、実行に要するプロファイル情報を動作シミュレーションにより計測し、さらにプロファイラにより計測結果を表示して、例えば、多大なCPU時間やクロック・サイクル数を要する機能単位を見つけ出して抜き出し、専用プロセッサ化して全体の実行パフォーマンスを向上させるなどの方法が行われてきた。
【0004】
特開2002−55813号公報には、データ専用処理ユニットVUと、汎用データ処理ユニットPUとを備えたVUPUプロセッサが開示されている。
【0005】
【特許文献1】
特開2002−55813号公報
【0006】
【発明が解決しようとする課題】
前述のようなハードウェア設計におけるプロファイル情報評価の方式においては、プロファイル情報はプロファイラを用いて記録、表示するだけであるため、その時点での設計結果としてのプロファイル情報を目で見て、傾向や特徴から、問題点や改善点を局所的に予想することができるに過ぎず、例えば設計の修正や変更を行う場合に、その修正、変更対象個所が他の対象外の箇所からも呼び出され利用されていることもあり得るため、その影響も加味した全体的なプロファイル情報の変化を直感的に知ることができないという問題があった。
【0007】
また、全体の実行パフォーマンスを向上させるために、ある機能単位を抜き出して専用プロセッサ化するような設計方式においては、専用プロセッサ化前の設計段階のプロファイル情報から、例えば動作に要するCPUクロック・サイクル数などの負荷の多い部分などを見つけ出すことができても、実際にその部分を専用プロセッサ化して負荷を少なくした場合に、プロファイル情報の全体の傾向や特徴に対してどのように影響があるのかが直感的には分かりづらいという問題があった。
【0008】
この発明は上記のような問題に鑑みてなされたもので、ハードウェア設計におけるプロファイル情報を変更した際に、変更を加えた部分の情報と関連のある他の部分の情報の変化を自動的に導き出し、結果を表示することによって、設計の修正、変更、または部分的な専用プロセッサ化を想定した変更の、設計全体への影響を仮想評価できる環境を実現することを目的とする。そして、プロセッサの設計過程において、動作シミュレーション結果の評価を複数の視点から容易に行うことができるプログラム性能評価方法およびプロファイラ、さらに、プログラム性能評価プログラムを提供することを目的としている。
【0009】
【課題を解決するための手段】
本発明においては、コンピュータ・プログラムを、そのコンピュータ・プログラムを構成する少なくとも1つの構成要素の各単位のハードウェア上での実行に必要な第1のサイクル数を保持する第1の記録領域に基づきコンピュータ・プログラムの未変更の総サイクル数を求める第1の工程と、第1のサイクル数を代替する第2のサイクル数を保持する第2の記録領域に基づき、当該コンピュータ・プログラムの任意の箇所の第2のサイクル数を仮想的に変更した変更後の総サイクル数を求める第2の工程とを有するプログラム性能評価方法を提供する。
【0010】
第2の工程において、当該コンピュータ・プログラム、例えばソースプログラムの一部を切り出して別なハードウェアまたは別なソフトウェアとして動作させたときの第2のサイクル数から変更後の総サイクル数を求めることができ、当該コンピュータ・プログラムの全体の動作効率を向上させるために、任意の箇所のCPUクロック・サイクル数値を仮想的に変更し、変更した値を表示することで、切り出す箇所を判断できる。また、第1の記録領域に第1のサイクル数が保持されているので、いつでも変更前のサイクル数に戻すことができ、任意の箇所のサイクル数を自在に変更することができる。
【0011】
構成要素の1つの例は、コンピュータ・プログラムを記述する記述言語であり、C言語、またはC++言語、またはJava(登録商標)言語、またはアセンブリ言語がある。構成要素の他の例は、コンピュータ・プログラムを処理目的に応じてまとめた基本単位であり、関数あるいは関数階層がある。これらの構成要素の全てあるいはいずれかの組み合わせを用いることが望ましい。すなわち、本発明のプログラム性能評価方法においては、第1の構成要素の第1の記録領域および第2の記録領域を備えた第1のテーブルと、第2の構成要素の第1の記録領域および第2の記録領域を備えた第2のテーブルとを用意することにより、第1の工程では、第1および第2のテーブルのいずれかのテーブルの第1の記録領域に基づき未変更の総サイクル数が求められる。また、第2の工程では、第1および第2のテーブルのいずれかの第2の記録領域に基づき変更後の総サイクル数が求められる。複数の構成要素によりサイクル数の評価が可能となるので、複数の視点からプログラムの評価ができる。
【0012】
さらに、第1または第2のテーブルの一方のテーブルの第2の記録領域の第2のサイクル数を変更すると、他方のテーブルの対応関係にある第2の記録領域の第2のサイクル数を自動的に変更する工程を設けることにより、ユーザは種々の視点から仮想評価を行うことができ、また、種々の視点を混在させた仮想評価手法でプログラムを評価することができる。したがって、さらにフレキシブルにユーザの希望する方法でLSIあるいはプロセッサの仕様を示すソースプログラムを評価することができ、経済的で構成のプロセッサを更に容易に設計できるようになる。
【0013】
本発明のプログラム性能評価方法は、プロファイラとして提供することも可能である。本発明のプロファイラは、コンピュータ・プログラムを、そのコンピュータ・プログラムを構成する少なくとも1つ構成要素の各単位のハードウェア上での実行に必要な第1のサイクル数を保持する第1の記録領域に基づきコンピュータ・プログラムの未変更の総サイクル数を求める第1の手段と、第1のサイクル数を代替する第2のサイクル数を保持する第2の記録領域に基づき、当該コンピュータ・プログラムの任意の箇所の第2のサイクル数を仮想的に変更した変更後の総サイクル数を求める第2の手段とを有する。プロファイラは、第1または第2のテーブルの一方のテーブルの第2の記録領域の第2のサイクル数を変更すると、他方のテーブルの対応関係にある第2の記録領域の第2のサイクル数を自動的に変更する手段をさらに有することが望ましい。
【0014】
また、プロファイラは、上記の第1の工程と、第2の工程とをコンピュータで実行可能にする命令を有するプログラム性能評価プログラムとして適当な記録媒体に記録して提供することも可能である。
【0015】
【発明の実施の形態】
以下、図を用いて本発明の実施例を説明する。図1は、C言語やアセンブリ言語などのコンピュータ・プログラム記述言語で記述されたハードウェア設計あるいは設計仕様(以下、単にソースプログラムと呼ぶ)の初期の様子を示した図である。ソースプログラム1は、記述された動作が時系列的に上から下へひとつの流れとして表されている。
【0016】
元々のソースプログラム1のうちの一部を抜き出して専用プロセッサ化したプロセッサを設計することができる。例えば、図2に示すように、専用データ処理ユニットVU11と汎用データ処理ユニットPU12とを備えたVUPUプロセッサ10においては、VU11が専用プロセッサとなり、特定の処理を高速で実行できるようになっている。このVUPUプロセッサ10においては、PU12のフェッチユニットFU13がコードRAM19に格納されたプログラム19pから命令をフェッチする。フェッチされた命令が、PU12で実行する汎用命令(PU命令)であれば、その処理はPU12の実行ユニットEU14で実行され、VU11で実行する専用命令(VU命令)であればVU11に渡されてVU11で実行される。VUPU10は、複数のVU11を搭載することが可能であり、共通のデータRAM18などにアクセスしながら処理を進める。
【0017】
図3に、本発明における設計方式により、元々のソースプログラム1のうちの一部を抜き出して専用プロセッサ化した場合の動作の様子を示してある。ソースプログラム1は、専用プロセッサ、たとえば、VU11で実行するために抜き出した部分2bの前段階の動作の時系列的な上から下への流れ2aと、抜き出した部分の動作の時系列的な上から下へのひとつの流れ2bと、抜き出した部分2bの後段階の動作の時系列的な上から下へのひとつの流れ2cの3つに分けられている。したがって、ソースプログラム1の処理は、全体の動作の流れが前段階2aで始まり、途中から抜き出した部分2bに動作が移り、そしてまた後段階2cへと動作が移って終了する。
【0018】
図4に、本発明における設計方式を用いたハードウェア設計のワークフローを示してある。動作シミュレータ3は、ハードウェア設計、すなわち、ソースプログラム1または当該ハードウェア設計から変換された情報を読込み(矢印A)、設計内容に基づいてシミュレーション動作させることができる。プロファイラ4は、本発明における設計方式により、ソースプログラム1の一部を切り出して例えば専用プロセッサ化するための検証、評価を行う。プロファイラ4は、動作シミュレータ3によりシミュレーション動作させることにより得られた(矢印B)プロファイル情報5を基にして(矢印C)、情報内容をユーザに分かり易く表示し、検証、評価する第1の工程(ステップ6)を備えている。さらに、本例のプロファイラ4は、情報内容をさらに検証および評価するために表示内容を変更するステップ6aを備えており、変更された内容により仮想評価を行う第2の工程(ステップ7)を備えている。この仮想評価ステップ7では、図3に示したように、元々の設計の一部またはいくつかの部分を切り出して専用プロセッサ化した場合の状況変化を仮想的に評価することができる。仮想評価するための情報変更は、プロファイラ4の表示ステップ6で表示された情報を基に何度でも行うことができる(矢印D)。
【0019】
プロファイラ4において、プロファイル情報表示・変更ステップ6、仮想評価ステップ47を行った結果(矢印E)として、分割ステップ8において、専用プロセッサ化して抜き出し分割する最適な部分を見つけ出す。その結果、ステップ9において、ソースプログラム1を、分割ステップ8により見つけ出した分割部分の情報を基に複数の部分に分割する。
【0020】
図5および図6に、プロファイラ4をGUI(Graphical User Interface)プログラムとして提供したときのウィンドウ表示の幾つかの例を示してある。図5(a)は、未変更の総クロック・サイクル数(以下、単にサイクル数と呼ぶ)、および変更後の総サイクル数を表示するウィンドウ21であり、未変更時の総サイクル数を示す領域21aと、変更後の総サイクル数を示す領域21bを備えている。未変更時の総サイクル数を示す領域21aは、ソースプログラム1を動作シミュレータ3でシミュレーション動作させた場合に、全動作に要したサイクル数を表示している。変更後の総サイクル数を示す領域21bは、仮想評価ステップ7で仮想評価するために、プロファイル情報5を表示変更ステップ6で変更した場合に、全動作に要する総サイクル数を表示している。
【0021】
図5(b)は、ソースプログラム1の機能単位(以下、場合により関数と呼ぶ)ごとに、動作に要するサイクル数などの情報を表示するウィンドウ22であり、関数名領域22aと、call回数領域22bと、平均サイクル数領域22cと、単独サイクル数領域22dと、総合サイクル数領域22eを備えている。関数名領域22aには、ソースプログラム1に含まれる関数に付けられた名前が列挙されている。call回数領域22bには、各関数名(領域22a)ごとに、動作シミュレーションを通して当該関数が何回呼び出されたか、その回数が示されている。平均サイクル数領域22bには、各関数名(領域22a)ごとに、動作シミュレーション3を通して当該関数のみが要した総サイクル数の、1回呼び出しごとの平均値が示されている。
【0022】
単独サイクル数領域22dには、各関数名(領域22a)ごとに、動作シミュレーション3を通して当該関数のみが要した総サイクル数が示されている。図5(b)の例では、func2(領域22a)という名前の関数は、動作シミュレーション3を通して3回呼び出され(領域22b)、func2関数のみの動作に合計48サイクル(領域22c)を要しており、1回の呼出しに必要な平均サイクル数は16サイクル(領域22d)であることが読み取れる。
【0023】
総合サイクル数領域22eには、各関数名(領域22a)ごとに、動作シミュレーション3を通して当該関数が要した総サイクル数を、当該関数がさらに他の関数を呼び出すというような階層的動作に要するサイクル数も全て含めて示されている。図5(b)の例では、func2(領域22a)関数は、単独サイクル数として48サイクル(領域22d)、総合サイクル数として48サイクル(領域22e)を要しており、単独サイクル数と総合サイクル数が等しいことからfunc2関数はその動作の中で他の関数を呼び出してはいないことが分かる。一方、func1(領域22a)関数は、単独サイクル数として46サイクル(領域22d)、総合サイクル数として94サイクル(領域22e)を要しており、総合サイクル数が単独サイクル数よりも多いことからfunc1関数はその動作の中で他の何らかの関数を呼び出していることが読み取れる。
【0024】
図5(c)は、ソースプログラム1に含まれる関数呼出しの様子(以下、単に関数階層と呼ぶ)、および各関数の動作に要したサイクル数を表示するウィンドウ23であり、関数階層領域23aと、サイクル数領域23bとを備えている。関数階層領域23aは、ソースプログラム1の中の関数が他のどの関数を呼び出しているかを示している。図5(c)の例では、ソースプログラム1は、main関数の動作で始まり、main関数はfunc1、func3、func4各関数を順に呼び出して動作していることが表されている。また、さらにfunc1関数はfunc2関数を呼び出して動作し、func4関数はfunc5、func6関数を順に呼び出して動作していることが表されている。以下、このように、関数階層として表された、main関数、func1関数などの各要素を、関数階層要素と呼ぶ。
【0025】
サイクル数領域23bには、各関数階層要素ごとに、当該関数階層要素が他の関数階層要素呼出しも含めて階層的動作に要する合計サイクル数と、他の関数階層要素呼出しを一切含めない単独動作に要するサイクル数が表示されている。図5(c)の例では、func4関数階層要素は、func5、func6関数階層要素呼出しおよび実行を含めた全サイクル数として47サイクル、また関数階層要素呼出しを含めない単独動作に要するサイクル数としては16サイクルであることが表されている。
【0026】
図6(a)は、ソースプログラム1の内容をC言語で表示するウィンドウ24であり、プログラム領域24aと、サイクル数領域24bを備えている。プログラム領域24aには、ソースプログラム1の内容がC言語で表示されている。サイクル数領域24bには、であり、プログラム領域(領域24a)に表示されたC言語プログラムの各行が、動作シミュレーションを通して要したサイクル数が表示されている。
【0027】
図6(b)は、ソースプログラム1の内容をアセンブリ言語で表示するウィンドウ25であり、プログラム領域25aと、サイクル数領域25bを備えている。プログラム領域25aには、ソースプログラム1の内容がアセンブリ言語で表示されている。サイクル数領域25bには、プログラム領域(領域25a)に表示されたアセンブリ言語プログラムの各行が、動作シミュレーションを通して要したサイクル数が表示されている。
【0028】
図6(c)は、プロファイラ4のGUIとして表示されているサイクル数情報を、ステップ7において仮想評価するために値を変更するためのウィンドウ26であり、例えばプロファイラ4のGUIプログラム上に表示されたサイクル数のうち、ユーザが変更したい数値をコンピュータのマウスなどのポインティング・デバイスによりクリックすることで出現する。このウィンドウ26は、ユーザが値を変更する前の元々のサイクル数値が表示されるオリジナルサイクル領域26aと、ユーザがオリジナルサイクル(領域26a)の値を仮想評価(ステップ7)のために変更したいときに、コンピュータのキーボードなどの入力デバイスなどにより任意の値を入力する変更サイクル数領域26bを備えている。
【0029】
さらに、ウィンドウ26は、ユーザは変更サイクル数領域(領域26b)に任意の値を入力した後に、確定する場合に押下する決定ボタン26cと、ウィンドウ26で行われた操作を無効化して閉じる際に押下するキャンセルボタン26dを備えている。
【0030】
図7、図8および図9に、コンピュータのメモリなどの記憶装置内に配置された、プロファイラ4が利用する情報領域の様子を示している。図7(a)の情報テーブル(以下、単にアセンブラテーブルと呼ぶ)31は、ソースプログラム1の内容をウィンドウ25の領域25aにアセンブリ言語で表示する際に利用されるテーブルであり、アセンブリ言語の1行分の情報をひとつのアセンブラテーブル内に保持している。当該アセンブラテーブル31は、ソースプログラム1の全体をアセンブリ言語で表したときの行数分、その行番号順に並んで記憶装置内に連続的に配置されている。図7(b)のテーブル32は、ソースプログラム1をアセンブリ言語として表した場合の全行分の、アセンブラテーブル31についての情報を示している。
【0031】
図7(c)の情報テーブル(以下、単にCテーブルと呼ぶ)33は、ソースプログラム1の内容をウィンドウ24の領域24aにC言語で表示する際に利用する情報テーブルであり、C言語の1行分の情報をひとつのCテーブル33の内に保持している。当該Cテーブル33は、ソースプログラム1の全体をC言語で表したときの行数分、その行番号順に並んで記憶装置内に連続的に配置されている。図7(d)のテーブル34は、ソースプログラム1をC言語として表した場合の全行分の、Cテーブル33についての情報を示している。
【0032】
図8(a)の情報テーブル(以下、単に関数テーブルと呼ぶ)35は、ソースプログラム1に含まれる関数をウィンドウ22の上に表示する際に利用する情報テーブルであり、関数ひとつ分の情報をひとつの関数テーブル35の内に保持している。当該関数テーブル35は、ソースプログラム1に含まれる関数の個数分、任意の順番に並んで記憶装置内に連続的に配置されている。図8(b)のテーブル36は、ソースプログラム1に含まれる全関数分の、関数テーブルについての情報を示している。
【0033】
図9(a)のテーブル37は、関数階層要素ごとの情報テーブル(以下、単に関数階層テーブルと呼ぶ)であり、ソースプログラム1に含まれる全関数階層要素の個数分、任意の順番に並んで記憶装置内に連続的に配置されている。図9(b)のテーブル38は、全ての関数階層テーブル37についての情報を示している。
【0034】
図7(a)のアセンブラテーブル31の各領域について説明する。領域31−1は所属関数テーブル領域であり、対象アセンブリ言語1行が所属する関数について、当該関数の関数テーブル35が保存されている先頭位置(以下、情報が記憶装置内に保存されている先頭位置を、単にアドレスと呼ぶ)が保持されている。領域31−2は対応Cテーブル数領域であり、ソースプログラム1の内容をC言語で表した場合に、対象アセンブリ言語1行と対応するC言語1行のCテーブル33のアドレスが保持されている。
【0035】
領域31−3は呼び出し先関数階層テーブル数領域であり、対象アセンブリ言語1行が他の関数を呼び出すためのcall命令であった場合に、呼び出し先関数に対応した関数階層要素の数が保持されている。領域31−4および領域31−5は、呼び出し先関数階層テーブル領域であり、対象アセンブリ言語1行が他の関数を呼び出すためのcall命令であった場合に、呼び出し先関数に対応した関数階層テーブルが保持されている。呼び出し先関数に対応した関数階層テーブルは、呼び出し先関数階層テーブル数領域(領域31−3)に保持されている数の個数存在し、それに応じて領域31−4、領域31−5で示される呼び出し先関数階層テーブル領域の数は増減する。領域31−6はアセンブラテキスト領域であり、対象アセンブリ言語1行のテキスト情報が保持されている。このテキストは、ウィンドウ25の領域25aのプログラム領域に表示される。
【0036】
領域31−7はオリジナル単独サイクル数領域であり、ソースプログラム1を動作シミュレータ3でシミュレーション動作させた際に、対象アセンブリ言語1行実行に要したサイクル数が保持されている。当該オリジナル単独サイクル数には、対象アセンブリ言語1行が関数呼出しを行っていた場合、呼び出された関数内部の実行に要したサイクル数は含まれていない。領域31−8は変更単独サイクル数領域であり、ユーザが、例えばウィンドウ26を利用してオリジナル単独サイクル数(領域31−7)を変更した場合に、変更後の数値が保持されている。変更が一度も加えられていない場合に保持されている数値は、オリジナル単独サイクル数(領域31−7)と同じである。領域31−9は単独サイクル変更フラグ領域であり、オリジナル単独サイクル数(領域31−7)の変更が行われたか否かをフラグとして保持している。例えば、変更が加えられていない場合には数値0が保持されており、変更が加えられた場合には数値1が保持されている。
【0037】
領域31−10はオリジナル総サイクル数領域であり、ソースプログラム1を動作シミュレータ3でシミュレーション動作させた際に、対象アセンブリ言語1行の実行に要したサイクル数が保持されている。当該オリジナル総サイクル数には、対象アセンブリ言語1行が関数呼出しを行っていた場合、呼び出された関数内部の実行に要したサイクル数をも含んでいる。領域31−11は変更総サイクル数領域であり、ユーザが、例えばウィンドウ26を利用してオリジナル総サイクル数(領域31−10)を変更した場合に、変更後の数値が保持されている。変更が一度も加えられていない場合に保持されている数値は、オリジナル総サイクル数(領域31−10)と同じである。領域31−12は総サイクル変更フラグ領域であり、オリジナル総サイクル数(領域31−10)の変更が行われたか否かをフラグとして保持している。例えば、変更が加えられていない場合には数値0が保持されており、変更が加えられた場合には数値1が保持されている。
【0038】
図7(b)のテーブル32の各領域について説明する。領域32−1はアセンブラテーブル数領域であり、記憶装置内に保持しているアセンブラテーブルの個数を保持している。アセンブラテーブルはアセンブリ言語プログラム1行分の情報なので、当該アセンブラテーブル数は、ソースプログラム1をアセンブリ言語で表したときの行数と一致する。領域32−2はアセンブラテーブル先頭領域であり、記憶装置内に連続して配置された全アセンブラテーブルの先頭アドレスを保持している。
【0039】
図7(c)のCテーブル33の各領域について説明する。領域33−1は所属関数テーブル領域であり、Cテーブルの対象となるC言語1行が所属する関数について、当該関数の関数テーブル35のアドレスが保持されている。領域33−2は対応アセンブラテーブル数領域であり、ソースプログラム1の内容をアセンブリ言語で表した場合に、対象C言語1行と対応するアセンブリ言語の行数が保持されている。
【0040】
領域33−3および領域33−4は、対応アセンブラテーブル領域であり、ソースプログラム1の内容をアセンブリ言語で表した場合に、対象C言語1行と対応するアセンブリ言語の行について、当該アセンブリ言語の行のアセンブラテーブル31のアドレスが保持されている。対応するアセンブリ言語の行は、対応アセンブラテーブル数領域(領域33−2)に保持されている数の行数存在し、それに応じて領域33−3、領域33−4で示される対応アセンブラテーブル領域の数は増減する。
【0041】
領域33−5は対応関数階層数テーブル領域であり、対象C言語1行が、ウィンドウ23の領域23aに例として示されているような関数階層のうちの属している関数階層要素数が保持されている。図5(c)の例において、もしも対象C言語1行がfunc2関数階層要素に属しているならば、例ではfunc2関数階層要素はひとつしか存在しないので、対応関数階層テーブル領域(領域33−5)には数値1が保持される。
【0042】
領域33−6および領域33−7は、対応関数階層テーブル領域であり、対象C言語1行が属している関数階層要素についての、当該関数階層テーブル37のアドレスが保持されている。対応する関数階層テーブル37は、対応関数階層テーブル数領域(領域33−5)に保持されている数の個数存在し、それに応じて領域33−6、領域33−7で示される対応関数階層テーブル領域の数は増減する。
【0043】
領域33−8はCテキスト領域であり、対象C言語1行のテキスト情報が保持されている。このテキストは、ウィンドウ24の領域24aのプログラム領域に表示される。
【0044】
領域33−9はオリジナル単独サイクル数領域であり、ソースプログラム1を動作シミュレータ3でシミュレーション動作させた際に、対象C言語1行実行に要したサイクル数が保持されている。当該オリジナル単独サイクル数には、対象C言語1行が関数呼出しを行っていた場合、呼び出された関数内部の実行に要したサイクル数は含まれていない。領域33−10は変更単独サイクル数領域であり、ユーザが、例えばウィンドウ26を利用してオリジナル単独サイクル数(領域33−9)を変更した場合に、変更後の数値が保持されている。変更が一度も加えられていない場合に保持されている数値は、オリジナル単独サイクル数(領域33−9)と同じである。領域33−11は単独サイクル変更フラグ領域であり、オリジナル単独サイクル数(領域33−9)の変更が行われたか否かをフラグとして保持している。例えば、変更が加えられていない場合には数値0が保持されており、変更が加えられた場合には数値1が保持されている。
【0045】
領域33−12はオリジナル総サイクル数領域であり、ソースプログラム1を動作シミュレータ3でシミュレーション動作させた際に、対象C言語1行実行に要したサイクル数が保持されている。当該オリジナル総サイクル数には、対象C言語1行が関数呼出しを行っていた場合、呼び出された関数内部の実行に要したサイクル数をも含んでいる。領域33−13は変更総サイクル数領域であり、ユーザが、例えばウィンドウ26を利用してオリジナル総サイクル数(領域33−12)を変更した場合に、変更後の数値が保持されている。変更が一度も加えられていない場合に保持されている数値は、オリジナル総サイクル数(領域33−12)と同じである。領域33−14は総サイクル変更フラグ領域であり、オリジナル総サイクル数(領域33−12)の変更が行われたか否かをフラグとして保持している。例えば、変更が加えられていない場合には数値0が保持されており、変更が加えられた場合には数値1が保持されている。
【0046】
図7(d)のテーブル34の各領域について説明する。領域34−1はCテーブル数領域であり、記憶装置内に保持しているCテーブルの個数を保持している。CテーブルはC言語プログラム1行分の情報なので、当該Cテーブル数は、ソースプログラム1をC言語で表したときの行数と一致する。領域34−2はCテーブル先頭領域であり、記憶装置内に連続して配置された全Cテーブルの先頭アドレスを保持している。
【0047】
図8(a)の関数テーブル35の各領域について説明する。領域35−1は対応Cテーブル始点領域である。関数は通常、C言語やアセンブリ言語などのコンピュータ・プログラム記述言語を用いて複数行に渡って記述されたひとつの機能単位であり、当該対応Cテーブル始点領域は、対象関数をC言語で記述した場合の先頭行に対応する、Cテーブル33の先頭アドレスを保持している。領域35−2は対応Cテーブル終点領域であり、対象関数をC言語で記述した場合の最終行に対応するCテーブル33の先頭アドレスを保持している。
【0048】
領域35−3は対応アセンブラテーブル始点領域であり、対象関数をアセンブリ言語で記述した場合の先頭行に対応するアセンブラテーブル31の先頭アドレスを保持している。領域35−4は対応アセンブラテーブル終点領域であり、対象関数をアセンブリ言語で記述した場合の最終行に対応するアセンブラテーブル31の先頭アドレスを保持している。
【0049】
領域35−5は対応関数階層テーブル数領域であり、対象関数に対応する関数階層要素の数を保持している。領域35−6および領域35−7は対応関数階層テーブル領域であり、対象関数に対応する関数階層要素についての、当該関数階層テーブル37のアドレスが保持されている。対応する関数階層テーブルは、対応関数階層テーブル数領域(領域35−5)に保持されている数の個数存在し、それに応じて領域35−6、領域35−7で示される対応関数階層テーブル領域の数は増減する。
【0050】
領域35−8は子関数テーブル数領域であり、対象関数が直接呼び出している関数の個数を保持している。領域35−9および領域35−10は子関数テーブル領域であり、対象関数が直接呼び出している関数に対応した関数テーブルのアドレスを保持している。対象関数が直接呼び出している子関数は、子関数テーブル数領域(領域35−8)に保持されている数の個数存在し、それに応じて領域35−9、領域35−10で示される子関数テーブル領域の数は増減する。
【0051】
領域35−11は関数名領域であり、ウィンドウ22の領域22aの関数名領域に表示するための、対象関数の関数名を保持している。
【0052】
領域35−12はオリジナル単独サイクル数領域であり、ソースプログラム1を動作シミュレータ3でシミュレーション動作させた際に、対象関数実行に要したサイクル数が保持されている。当該オリジナル単独サイクル数には、対象関数が内部でさらに関数呼出しを行っていた場合、呼び出された関数内部の実行に要したサイクル数は含まれていない。領域35−13は変更単独サイクル数領域であり、ユーザが、例えばウィンドウ26を利用してオリジナル単独サイクル数(領域35−12)を変更した場合に、変更後の数値が保持されている。変更が一度も加えられていない場合に保持されている数値は、オリジナル単独サイクル数(領域35−12)と同じである。領域35−14は単独サイクル変更フラグ領域であり、オリジナル単独サイクル数(領域35−12)の変更が行われたか否かをフラグとして保持している。例えば、変更が加えられていない場合には数値0が保持されており、変更が加えられた場合には数値1が保持されている。
【0053】
領域35−15はオリジナル総サイクル数領域であり、ソースプログラム1を動作シミュレータ3でシミュレーション動作させた際に、対象関数実行に要したサイクル数が保持されている。当該オリジナル総サイクル数には、対象関数が内部でさらに関数呼出しを行っていた場合、呼び出された関数内部の実行に要したサイクル数をも含んでいる。領域35−16は変更総サイクル数領域であり、ユーザが、例えばウィンドウ26を利用してオリジナル総サイクル数(領域35−15)を変更した場合に、変更後の数値が保持されている。変更が一度も加えられていない場合に保持されている数値は、オリジナル総サイクル数(領域33−15)と同じである。領域35−17は総サイクル変更フラグ領域であり、オリジナル総サイクル数(領域35−15)の変更が行われたか否かをフラグとして保持している。例えば、変更が加えられていない場合には数値0が保持されており、変更が加えられた場合には数値1が保持されている。
【0054】
図8(b)のテーブル36の各領域について説明する。領域36−1は関数テーブル数領域であり、記憶装置内に保持している関数テーブルの個数を保持している。領域36−2は関数テーブル先頭領域であり、記憶装置内に連続して配置された全関数テーブルの先頭アドレスを保持している。
【0055】
図9(a)の関数階層テーブル37の各領域について説明する。領域37−1は子関数階層テーブル数領域であり、対象関数階層要素が直接呼び出している関数階層要素の個数を保持している。領域37−2および領域37−3は子関数階層テーブル領域であり、対象関数階層要素が直接呼び出している関数階層要素に対応した関数階層テーブルのアドレスを保持している。対象関数階層が直接呼び出している子関数階層要素は、子関数階層テーブル数領域(領域37−1)に保持されている数の個数存在し、それに応じて領域37−2、領域37−3で示される子関数階層テーブル領域の数は増減する。
【0056】
領域37−4は親関数階層テーブル領域であり、対象関数階層要素を呼び出した親関数階層要素に対応した関数階層テーブルのアドレスを保持している。領域37−5は対応関数テーブル領域であり、対象関数階層要素と対応した関数についての関数テーブルのアドレスを保持している。
【0057】
領域37−6は呼出し元アセンブラテーブル領域であり、対象関数階層要素を呼び出しているアセンブリ言語1行と対応したアセンブラテーブルのアドレスを保持している。領域37−7は関数階層要素名領域であり、対象関数階層要素の名前を保持している。この名前は、対象関数階層要素に対応した関数の関数名と同じであり、ウィンドウ23の領域23aに表示する名前として利用される。
【0058】
領域37−8はオリジナル単独サイクル数領域であり、ソースプログラム1を動作シミュレータ3でシミュレーション動作させた際に、対象関数階層要素実行に要したサイクル数が保持されている。当該オリジナル単独サイクル数には、対象関数階層要素が内部でさらに関数階層要素呼出しを行っていた場合、呼び出された関数階層要素内部の実行に要したサイクル数は含まれていない。領域37−9は変更単独サイクル数領域であり、ユーザが、例えばウィンドウ26を利用してオリジナル単独サイクル数(領域37−8)を変更した場合に、変更後の数値が保持されている。変更が一度も加えられていない場合に保持されている数値は、オリジナル単独サイクル数(領域37−8)と同じである。領域37−10は単独サイクル変更フラグ領域であり、オリジナル単独サイクル数(領域37−8)の変更が行われたか否かをフラグとして保持している。例えば、変更が加えられていない場合には数値0が保持されており、変更が加えられた場合には数値1が保持されている。
【0059】
領域37−11はオリジナル総サイクル数領域であり、ソースプログラム1を動作シミュレータ3でシミュレーション動作させた際に、対象関数階層要素実行に要したサイクル数が保持されている。当該オリジナル総サイクル数には、対象関数階層要素が内部でさらに関数階層要素呼出しを行っていた場合、呼び出された関数階層要素内部の実行に要したサイクル数をも含んでいる。領域37−12は変更総サイクル数領域であり、ユーザが、例えばウィンドウ26を利用してオリジナル総サイクル数(領域37−11)を変更した場合に、変更後の数値が保持されている。変更が一度も加えられていない場合に保持されている数値は、オリジナル総サイクル数(領域37−11)と同じである。領域37−13は総サイクル変更フラグ領域であり、オリジナル総サイクル数(領域37−11)の変更が行われたか否かをフラグとして保持している。例えば、変更が加えられていない場合には数値0が保持されており、変更が加えられた場合には数値1が保持されている。
【0060】
図9(b)のテーブル38の各領域について説明する。領域38−1は関数階層テーブル数領域であり、記憶装置内に保持している関数階層テーブルの個数を保持している。領域38−2は関数階層テーブル先頭領域であり、記憶装置内に連続して配置された全関数階層テーブルの先頭アドレスを保持している。
【0061】
図10に、プロファイラ4の全体の動作を示すフローチャートを示してある。プロファイラ4を起動すると、まず情報を表示するために入力データを読込む(ステップ40)。入力データは動作シミュレータ3によって生成されたプロファイル情報5である。
【0062】
次にプロファイラ4は、ステップ41において、プロファイル情報5に保存されているデータを読み込み、解析して各ウィンドウを表示する。全アセンブラテーブル31および32を読込み解析し、ウィンドウ25を表示する。全Cテーブル33および34を読込み解析し、ウィンドウ24を表示する。全関数テーブル35および36を読込み解析し、ウィンドウ22を表示する。全関数階層テーブル37および38を読込み解析し、ウィンドウ23を表示する。
【0063】
また、ステップ41において、対象とするソースプログラム1の実行に必要な全サイクル数を計算して表示する。ウィンドウ21の未変更時の総サイクル数を示す領域21aには、以下の式(1)により、全てのアセンブラテーブル31の領域31−7の総和を計算し、総サイクル数として表示する。
【0064】

Figure 2004234068
また、変更後の総サイクル数を示す領域21bには、以下の式(2)により、全てのアセンブラテーブル31の中の領域31−8の総和を計算し、変更後の総サイクル数として表示する。
【0065】
Figure 2004234068
最初の段階では、ユーザはまだサイクル数情報に関して何ら変更を加えていないので、領域21aおよび21bの値は同一となる。
【0066】
ユーザは、プロファイラ3により表示された各種情報を評価した後、プロファイラ3を終了することができる(ステップ42)。ユーザは、プロファイラ3により表示された各種情報を評価し、ステップ43において、サイクル数の変更を指示することができる。そして、ステップ44において、例えば実行に要するサイクル数が多いために専用プロセッサ化した方が良い部分を探し出し、該当部分2b(図3)を抜き出すと全体のサイクル数がどのように変化するかを評価できる。この評価のステップ44は、仮想評価のステップ7に相当する。
【0067】
ステップ44においては、該当部分のサイクル数を指定してウィンドウ26を開き、これを用いて変更することができる。プロファイラ4は、ユーザによりサイクル数変更が行われると影響する他の全ての部分のサイクル数を再計算する。そして、ステップ41に戻り、再び変更後のサイクル数値を表示する。変更後のサイクル数を表示する際、変更されたサイクル数の数値のみ、例えば字の色や背景色を変えたり、字の大きさや太さを変えたりするなど、ユーザが判り易いように表示する。この場合、サイクル数が変更されたか否かの情報は、単独サイクル数変更フラグ領域(領域31−9、領域33−11、領域35−14、領域37−9)、および総サイクル変更フラグ領域(領域31−12、領域33−14、領域35−17、領域37−13)に保持されている数値により判断することができ、本実施例においては、数値が1であるとき、それぞれのフラグ領域が属するテーブルが対象とするサイクル数に変更が加えられていることが判る。
【0068】
本発明のハードウェア設計方式、すなわち、プロファイラ4においては、このようにプロファイル情報5を表示するだけでなく、任意の箇所で変更することによって全体への影響を見る(仮想評価する)ことができることを特徴とし、その結果最適な抜き出し部分2bを見つけ出して、図4のステップ9のように、例えば専用プロセッサ化のための分割を行うことができる。
【0069】
このプロファイラ4においては、6つの異なる方法44a〜44fによりサイクル数を変更した評価を実行できる。第1の評価方法44aでは、ウィンドウ25の領域25bに表示されたアセンブリ言語の任意の行のサイクル数を変更し、それに対応する他の情報を自動変更してサイクル数の変動を評価する(ASM変更)。第2の評価方法44bでは、ウィンドウ24の領域24bに表示されたC言語の任意の行のサイクル数を変更し、対応する他の情報を自動変更してサイクル数の変動を評価する(C変更)。
【0070】
第3の評価方法44cでは、ウィンドウ23の領域23bに表示されたサイクル数のうち、任意の関数階層要素の、他の関数階層要素呼出しを一切含めない単独動作に要するサイクル数を変更し、それに対応する他の情報を自動変更してサイクル数の変動を評価する(HS変更)。第4の評価方法44dでは、ウィンドウ23の領域23bに表示されたサイクル数のうち、任意の関数階層要素の、他の関数階層要素呼出しも含めた階層的動作に要するサイクル数を変更し、それに対応する他の情報を自動変更してサイクル数の変動を評価する(HT変更)。
【0071】
第5の評価方法44eでは、ウィンドウ22の領域22dに表示された、任意の関数の、他の関数呼出しを一切含めない単独動作に要するサイクル数を変更し、対応する他の情報を自動変更してサイクル数の変動を評価する(FS変更)。第6の評価方法44fでは、ウィンドウ22の領域22dに表示された、任意の関数の、他の関数呼出しも含めた動作に要するサイクル数を変更し、対応する他の情報を自動変更してサイクル数の変動を評価する(FT変更)。
【0072】
図11にASM変更44aのフローチャートを示してある。この処理44aにおいては、ユーザがウィンドウ25の領域25bに表示されたアセンブリ言語の任意の行のサイクル数を変更した際に、対応する他の情報を自動変更する。まず、ステップ51において、ユーザが領域25bに表示された任意のサイクル数を変更した際、変更対象のアセンブラテーブル31の、対応Cテーブル(領域31−2)から、対応するC言語の行を対象としたCテーブルを取得し、その変更単独サイクル数(領域33−10)、変更総サイクル数(領域33−13)を計算する。
【0073】
Figure 2004234068
また、サイクル数に変更が加えられたことを示すために、Cテーブル33の単独サイクル変更フラグ(領域33−11)、総サイクル変更フラグ(領域33−14)の保持する値を1にする。
【0074】
次に、ステップ52において、変更対象のアセンブリ言語1行が他の関数を呼び出すcall命令でない(領域31−3呼び先関数階層テーブル数に保持されている数値が0)場合には、ステップ53において、対応関数階層チェックサブルーチン45により対応する関数階層テーブル等の情報を変更する。対応関数階層チェックサブルーチン45については、図17を参照して後に説明する。次にステップ53で、変更対象のアセンブラテーブル31の変更単独サイクル数(領域31−8)、変更総サイクル数(領域31−11)を計算する。
【0075】
Figure 2004234068
また、サイクル数に変更が加えられたことを示すために、アセンブラテーブルの単独サイクル変更フラグ(領域31−9)、総サイクル変更フラグ(領域31−12)の保持する値を1にする。
【0076】
次に、ステップ54において、変更対象のアセンブラテーブル(図10)の、所属関数テーブル(領域31−1)から、変更対象のアセンブリ言語1行が所属する関数の関数テーブル35を得て、その変更単独サイクル数(領域35−13)、変更総サイクル数(領域35−16)を計算する。
【0077】
Figure 2004234068
また、サイクル数に変更が加えられたことを示すために、関数テーブルの単独サイクル変更フラグ(領域35−14)、総サイクル変更フラグ(領域35−17)の保持する値を1にする。
【0078】
ステップ52において、変更対象のアセンブリ言語1行が他の関数を呼び出すcall命令であった(領域31−3呼び先関数階層テーブル数に保持されている数値が正の数)場合には、サイクル数値変更の差分は全て呼び出し先へ与える。ステップ55において、呼び出し先関数階層テーブル数(領域31−3)に保持されている数を基に、全ての呼び出し先関数階層テーブル(領域31−4以降、領域31−3に依る)から、それぞれの呼び出し先関数階層テーブルが持つ変更総サイクル数(領域37−12)の比率に応じて差分を分配して差分mを求め、その差分mを、各関数階層要素の他の関数階層要素呼出しも含めた階層的動作に要するサイクル数に与える意味でHT変更44dを呼び出してサイクル数を変更する。
【0079】
図12にC変更44bのフローチャートを示してある。この処理44bは、ユーザがウィンドウ24の領域24bに表示されたC言語の任意の行のサイクル数を変更した際に、対応する他の情報を自動変更する。ステップ61において、ユーザが領域24bに表示された任意のサイクル数を変更した際、変更対象のCテーブル33の、変更単独サイクル数(領域33−10)、変更総サイクル数(領域33−13)を計算する。
【0080】
(Cテーブルの変更単独サイクル数)=(ユーザの変更値) ・・・式(9)
(Cテーブルの変更総サイクル数)=(ユーザの変更値) ・・・式(10)
また、サイクル数に変更が加えられたことを示すために、Cテーブルの単独サイクル変更フラグ(領域33−11)、総サイクル変更フラグ(領域33−14)の保持する値を1にする。
【0081】
次に、変更対象のCテーブル33の、対応アセンブラテーブル数(領域33−2)を基に、全ての対応アセンブラテーブル(領域31−3以降、領域33−2に依る)を対象として、その各々に以下の対応関数階層チェックサブルーチン45、ステップ63、64、65およびHT変更44dの処理を行う。この際、各々の対応アセンブラテーブルのサイクル数について加算する差分aは、元々の変更対象のCテーブル33への差分を各々の対応アセンブラテーブルの変更総サイクル数(領域31−11)の比率に応じて分配したものとする。
【0082】
まず、ステップ62において、対応アセンブラテーブル31について、その対象アセンブリ言語1行が他の関数を呼び出すcall命令でない(領域31−3呼び先関数階層テーブル数に保持されている数値が0)場合には、対応関数階層サブルーチン45により対応する関数階層テーブル等の情報を変更し、次に、ステップ63において、変更対象のアセンブラテーブル31の変更単独サイクル数(領域31−8)、変更総サイクル数(領域31−11)を計算する。
【0083】
Figure 2004234068
また、サイクル数に変更が加えられたことを示すために、アセンブラテーブルの単独サイクル変更フラグ(領域31−9)、総サイクル変更フラグ(領域31−12)の保持する値を1にする。
【0084】
次に、ステップ64において、対応アセンブラテーブル31の、所属関数テーブル(領域31−1)から、対象のアセンブリ言語1行が所属する関数の関数テーブル35を得て、その変更単独サイクル数(領域35−13)、変更総サイクル数(領域35−16)を計算する。
【0085】
Figure 2004234068
また、サイクル数に変更が加えられたことを示すために、関数テーブルの単独サイクル変更フラグ(領域35−14)、総サイクル変更フラグ(領域35−17)の保持する値を1にする。
【0086】
ステップ62において、対応アセンブラテーブルの対象のアセンブリ言語1行が他の関数を呼び出すcall命令であった(領域31−3呼び先関数階層テーブル数に保持されている数値が正の数)場合には、サイクル数値変更の差分aは全て呼び出し先へ与える。ステップ65において、呼び出し先関数階層テーブル数(領域31−3)に保持されている数を基に、全ての呼び出し先関数階層テーブル(領域31−4以降、領域31−3に依る)から、それぞれの呼び出し先関数階層テーブルが持つ変更総サイクル数(領域37−12)の比率に応じて差分aを分配して差分bを求め、その差分bを、各関数階層要素の他の関数階層要素呼出しも含めた階層的動作に要するサイクル数に与える意味でHT変更44dを呼び出してサイクル数を変更する。
【0087】
図13にHS変更44cのフローチャートを示してある。この処理44cでは、ユーザがウィンドウ23の領域23bに表示された任意の関数階層要素の、他の関数階層要素呼出しを一切含めない単独動作に要するサイクル数を変更した際に、対応する他の情報を自動変更する。ステップ71において、ユーザが領域23bに表示されたサイクル数のうち、任意の、単独動作に要するサイクル数を変更した際、変更対象の関数階層テーブル37の、変更単独サイクル数(領域37−9)、変更総サイクル数(領域37−12)を計算する。
【0088】
Figure 2004234068
また、サイクル数に変更が加えられたことを示すために、関数階層テーブルの単独サイクル変更フラグ(領域37−10)、総サイクル変更フラグ(領域37−13)の保持する値を1にする。
【0089】
次に、ステップ72において、対応関数テーブル(領域37−5)から、対応アセンブラテーブル始点(領域35−3)および対応アセンブラテーブル終点(領域35−4)を得て、当該始点と終点の間のアドレスに配置されている全てのアセンブラテーブル31の変更単独サイクル数(領域31−8)、変更総サイクル数(領域31−11)を計算する。この際のサイクル数に加える差分cは、元々の差分を、アセンブラテーブル31の変更単独サイクル数(領域31−8)の比率に応じて分配する。
【0090】
Figure 2004234068
また、サイクル数に変更が加えられたことを示すために、アセンブラテーブルの単独サイクル変更フラグ(領域31−9)、総サイクル変更フラグ(領域31−12)の保持する値を1にする。
【0091】
さらに、ステップ73において、変更を加えた各々のアセンブラテーブル31について、対応Cテーブル(領域31−2)から得たCテーブル33の、変更単独サイクル数(領域33−10)、変更総サイクル数(領域33−13)を計算する。
【0092】
Figure 2004234068
また、サイクル数に変更が加えられたことを示すために、Cテーブルの単独サイクル変更フラグ(領域33−11)、総サイクル変更フラグ(領域33−14)の保持する値を1にする。
【0093】
さらに、ステップ74において、変更対象の関数階層テーブル37の呼出し元アセンブラテーブル(領域37−6)から得られるアセンブラテーブル31の変更総サイクル数(領域31−11)を計算して、その変更が加えられたことを示すために総サイクル変更フラグ(領域31−12)の保持する値を1にする。さらに変更したアセンブラテーブル31の対応Cテーブル(領域31−2)により、対応するCテーブル33の変更総サイクル数(領域33−13)も計算し、その変更が加えられたことを示すために総サイクル変更フラグ(領域33−14)の保持する値を1にする。ここまでのステップ74の操作は、親関数階層テーブル(領域37−4)から得られる関数階層テーブル37について再帰的に行う。
【0094】
Figure 2004234068
次に、ステップ75において、対応関数テーブル(領域37−5)から得られる関数テーブル35について、その変更単独サイクル数(領域35−13)、変更総サイクル数(領域35−16)を計算する。
【0095】
Figure 2004234068
また、サイクル数に変更が加えられたことを示すために、関数テーブルの単独サイクル変更フラグ(領域35−14)、総サイクル変更フラグ(領域35−17)の保持する値を1にする。
【0096】
ステップ76において、親関数階層テーブル(領域37−4)から親階層に関する関数階層テーブル37が得られる場合、ステップ77において、その親階層テーブル37の変更総サイクル数(領域37−12)を計算し、さらに親階層テーブルの対応関数テーブル(領域37−5)から得られる関数テーブル35の変更総サイクル数(領域35−16)を計算する操作を再帰的に行い、元々の変更対象の関数階層要素の全ての親階層について変更する。変更が加えられたことを示すため、変更したテーブルの総サイクル変更フラグ(領域37−13および領域35−17)の保持する値を1にする。
【0097】
Figure 2004234068
図14に、HT変更44dのフローチャートを示してある。この処理44dでは、ユーザがウィンドウ23の領域23bに表示された任意の関数階層要素の、他の関数階層要素呼出しを含めた階層的動作に要するサイクル数を変更した際に、対応する他の情報を自動変更する。
【0098】
ステップ81において、ユーザが領域23bに表示されたサイクル数のうち、任意の、階層的動作に要するサイクル数を変更した際、親関数階層テーブル(領域37−4)から親階層に関する関数階層テーブル37が得られる場合、ステップ82において、その親階層テーブル37の変更総サイクル数(領域37−12)を計算し、さらに親階層テーブルの対応関数テーブル(領域37−5)から得られる関数テーブル35の変更総サイクル数(領域35−16)を計算する操作を再帰的に行い、元々の変更対象の関数階層要素の全ての親階層について変更する。変更が加えられたことを示すため、変更したテーブルの総サイクル変更フラグ(領域37−13および領域35−17)の保持する値を1にする。計算は式(25)および式(26)を用いる。
【0099】
次に、差分dを、元々の変更対象の関数階層要素の変更総サイクル(領域37−12)に対する変更単独サイクル数(領域37−9)の比率で差分から求め、以下のステップ83、84、85、86の操作を行い、さらに子関数階層テーブル数(領域37−1)、および子関数階層テーブル(領域37−2以降、領域37−1に依る)から、変更対象の関数階層要素から呼び出された関数階層要素が存在する限り、差分dを同様に求めてステップ83、84、85および86の操作を繰り返す(ステップ87)。
【0100】
ステップ83においては、対応関数テーブル(領域37−5)から、対応アセンブラテーブル始点(領域35−3)および対応アセンブラテーブル終点(領域35−4)を得て、当該始点と終点の間のアドレスに配置されてる全てのアセンブラテーブル31の変更単独サイクル数(領域31−8)、変更総サイクル数(領域31−11)を計算する。この際のサイクル数に加える差分eは、元々の差分dを、アセンブラテーブル31の変更単独サイクル数(領域31−8)の比率に応じて分配する。
【0101】
Figure 2004234068
また、サイクル数に変更が加えられたことを示すために、アセンブラテーブルの単独サイクル変更フラグ(領域31−9)、総サイクル変更フラグ(領域31−12)の保持する値を1にする。
【0102】
ステップ84においては、さらに変更を加えた各々のアセンブラテーブル31について、対応Cテーブル(領域31−2)から得たCテーブル33の、変更単独サイクル数(領域33−10)、変更総サイクル数(領域33−13)を計算する。
【0103】
Figure 2004234068
また、サイクル数に変更が加えられたことを示すために、Cテーブルの単独サイクル変更フラグ(領域33−11)、総サイクル変更フラグ(領域33−14)の保持する値を1にする。
【0104】
次に、ステップ85において、対応関数テーブル(領域37−5)から得られる関数テーブル35について、その変更単独サイクル数(領域35−13)、変更総サイクル数(領域35−16)を計算する。
【0105】
Figure 2004234068
また、サイクル数に変更が加えられたことを示すために、関数テーブルの単独サイクル変更フラグ(領域35−14)、総サイクル変更フラグ(領域35−17)の保持する値を1にする。
【0106】
次に、ステップ86において、変更対象の関数階層テーブル37の、変更単独サイクル数(領域37−9)、変更総サイクル数(領域37−12)を計算する)。
【0107】
Figure 2004234068
また、サイクル数に変更が加えられたことを示すために、関数階層テーブルの単独サイクル変更フラグ(領域37−10)、総サイクル変更フラグ(領域37−13)の保持する値を1にする。
【0108】
最後に、ステップ87において、子階層があれば、ステップ88において、変更対象の関数階層テーブル37の呼出し元アセンブラテーブル(領域37−6)から得られるアセンブラテーブル31の変更総サイクル数(領域31−11)を計算して、その変更が加えられたことを示すために総サイクル変更フラグ(領域31−12)の保持する値を1にする。さらに変更したアセンブラテーブル31の対応Cテーブル(領域31−2)により、対応するCテーブル33の変更総サイクル数(領域33−13)も計算し、その変更が加えられたことを示すために総サイクル変更フラグ(領域33−14)の保持する値を1にする。計算には、式(21)および式(22)を用いる。
【0109】
図15にFS変更44eのフローチャートを示してある。この処理44eでは、ユーザがウィンドウ22の領域22dに表示された任意の関数の、他の関数呼出しを一切含めない単独サイクル数を変更した際に、対応する他の情報を自動変更する。ユーザが領域22dに表示された単独サイクル数を変更した際、まず、対応関数階層チェックサブルーチン45により対応する関数階層テーブル等の情報を変更し、ステップ91において、次に対象となる関数テーブル35の対応アセンブラテーブル始点(領域35−3)および対応アセンブラテーブル終点(領域35−4)を得て、当該始点と終点の間のアドレスに配置されている全てのアセンブラテーブル31の変更単独サイクル数(領域31−8)、変更総サイクル数(領域31−11)を計算する。この際のサイクル数に加える差分cは、元々の差分を、アセンブラテーブル31の変更単独サイクル数(領域31−8)の比率に応じて分配する。また、式(17)および式(18)により計算する。また、サイクル数に変更が加えられたことを示すために、アセンブラテーブルの単独サイクル変更フラグ(領域31−9)、総サイクル変更フラグ(領域31−12)の保持する値を1にする。
【0110】
さらに、ステップ92において、変更を加えた各々のアセンブラテーブル31について、対応Cテーブル(領域31−2)から得たCテーブル33の、変更単独サイクル数(領域33−10)、変更総サイクル数(領域33−13)を計算する。差分cにより、式(19)および式(20)で計算する。また、サイクル数に変更が加えられたことを示すために、Cテーブルの単独サイクル変更フラグ(領域33−11)、総サイクル変更フラグ(領域33−14)の保持する値を1にする。
【0111】
また、ステップ93において、変更対象の関数テーブル35の対応関数階層テーブル数(領域35−5)を基に全ての対応関数階層テーブル(領域35−6以降、領域35−5に依る)を得て、それぞれの関数階層テーブル37の呼出し元アセンブラテーブル(領域37−6)から得られるアセンブラテーブル31の変更総サイクル数(領域31−11)を計算して、その変更が加えられたことを示すために総サイクル変更フラグ(領域31−12)の保持する値を1にする。さらに変更したアセンブラテーブル31の対応Cテーブル(領域31−2)により、対応するCテーブル33の変更総サイクル数(領域33−13)も計算し、その変更が加えられたことを示すために総サイクル変更フラグ(領域33−14)の保持する値を1にする。ここまでのステップ93の操作は、親関数階層テーブル(領域37−4)から得られる関数階層テーブル37について再帰的に行う。計算は、元々の対象である関数テーブル35への差分により、式(21)および式(22)を用いる。
【0112】
最後に、ステップ94において、元々の対象である関数テーブル35の変更単独サイクル数(領域35−13)および変更総サイクル数(領域35−16)を式(7)および式(8)を用いて計算し、また、サイクル数に変更が加えられたことを示すために、関数テーブルの単独サイクル変更フラグ(領域35−14)、総サイクル変更フラグ(領域35−17)の保持する値を1にする。
【0113】
図16にFT変更44fのフローチャートを示してある。この処理44fは、ユーザがウィンドウ22の領域22dに表示された任意の関数の、他の関数呼出しを含めた総サイクル数を変更した際に、対応する他の情報を自動変更する。まず、ステップ101で、ユーザが領域22dに表示された総サイクル数を変更した際、対応関数階層テーブル数(領域35−5)より、対応する関数階層要素がひとつであるか、それとも複数個存在するかを調べる。複数個存在する場合には、以降の対応関数階層チェックサブルーチン45、ステップ102、103、104、105および106の操作を行い、またひとつであった場合には対応する関数階層要素に対して同じ差分によるサイクル数変更を行う意味で、HT変更44dを呼び出して関連する全てのサイクル数を変更する。
【0114】
ステップ101で、対応する関数階層要素がひとつであった場合、まず差分fを、対象とする関数テーブル35の変更総サイクル数(領域35−16)に対する変更単独サイクル数(領域35−13)の割合として元々の差分から求め、その差分fを用いて対応関数階層チェックサブルーチン45により対応する関数階層テーブル等の情報を変更する。次に、ステップ102において、対象となる関数テーブル35の対応アセンブラテーブル始点(領域35−3)および対応アセンブラテーブル終点(領域35−4)を得て、当該始点と終点の間のアドレスに配置されてる全てのアセンブラテーブル31の変更単独サイクル数(領域31−8)、変更総サイクル数(領域31−11)を計算する。この際のサイクル数に加える差分gは、元々の差分fを、アセンブラテーブル31の変更単独サイクル数(領域31−8)の比率に応じて分配する。
【0115】
Figure 2004234068
また、サイクル数に変更が加えられたことを示すために、アセンブラテーブルの単独サイクル変更フラグ(領域31−9)、総サイクル変更フラグ(領域31−12)の保持する値を1にする。
【0116】
さらに、ステップ103において、変更を加えた各々のアセンブラテーブル31について、対応Cテーブル(領域31−2)から得たCテーブル33の、変更単独サイクル数(領域33−10)、変更総サイクル数(領域33−13)を計算する。
【0117】
Figure 2004234068
また、サイクル数に変更が加えられたことを示すために、Cテーブルの単独サイクル変更フラグ(領域33−11)、総サイクル変更フラグ(領域33−14)の保持する値を1にする。
【0118】
また、ステップ104において、変更対象の関数テーブル35の対応関数階層テーブル数(領域35−5)を基に全ての対応関数階層テーブル(領域35−6以降、領域35−5に依る)を得て、それぞれの関数階層テーブル37の呼出し元アセンブラテーブル(領域37−6)から得られるアセンブラテーブル31の変更総サイクル数(領域31−11)を計算して、その変更が加えられたことを示すために総サイクル変更フラグ(領域31−12)の保持する値を1にする。さらに変更したアセンブラテーブル31の対応Cテーブル(領域31−2)により、対応するCテーブル33の変更総サイクル数(領域33−13)も計算し、その変更が加えられたことを示すために総サイクル変更フラグ(領域33−14)の保持する値を1にする。ここまでのステップ104の操作は、親関数階層テーブル(領域37−4)から得られる関数階層テーブル37について再帰的に行う。
【0119】
Figure 2004234068
次に、ステップ105において、元々の対象である関数テーブル35の変更単独サイクル数(領域35−13)および変更総サイクル数(領域35−16)を計算し、また、サイクル数に変更が加えられたことを示すために、関数テーブルの単独サイクル変更フラグ(領域35−14)、総サイクル変更フラグ(領域35−17)の保持する値を1にする。
【0120】
Figure 2004234068
ステップ106において、子関数テーブル数(領域35−8)により、対象とする関数が他の関数を呼び出していることによる子関数が存在する場合には、子関数テーブル(領域35−9以降、領域35−8に依る)により子関数に対応する関数テーブル35を得て、対象を、子関数に対応する関数テーブル35に切替えて、対応関数階層チェックサブルーチン45、ステップ102、103、104および105の操作を繰り返す。
【0121】
図17に、変更処理44a〜44fから呼び出される対応関数階層チェックサブルーチン45のフローチャートを示してある。この処理45においては、ステプ111において、対象とする関数テーブル35の対応関数階層テーブル数(領域35−5)を基に、全ての対応関数階層テーブル(領域35−6以降、領域35−5に依る)について、差分を全ての対応関数階層テーブルの変更単独サイクル数(領域37−9)の比率で分配して求めた差分hを用いて、変更単独サイクル数(領域37−9)および変更総サイクル数(領域37−12)を計算する。
【0122】
Figure 2004234068
また、サイクル数に変更が加えられたことを示すために、関数階層テーブルの単独サイクル変更フラグ(領域37−10)、総サイクル変更フラグ(領域37−13)の保持する値を1にする。
【0123】
また、ステップ112において、それぞれの対応関数階層テーブル37の親関数階層テーブル(領域37−4)により呼出し元の親関数階層要素を得る操作を再帰的に行い、親関数階層テーブルが存在する場合には、ステップ113において、全ての親関数階層要素の関数階層テーブル37について、変更総サイクル数(領域37−12)とその対応関数テーブル(領域37−5)から得られる対応する関数テーブル35の変更総サイクル数(領域35−16)に差分hを加える。
【0124】
Figure 2004234068
また、サイクル数に変更が加えられたことを示すために、関数階層テーブルの総サイクル変更フラグ(領域37−13)、および関数テーブルの総サイクル変更フラグ(領域35−17)の保持する値を1にする。
【0125】
以上に説明したように、本例のプロファイラ4は、動作シミュレータ4で得られたソースプログラム1の各行単位のハードウェア上での実行に必要なCPUクロック・サイクル数をプロファイル情報5として幾つかの単位で保持する。すなわち、プロファイル情報5を構成するアセンブラテーブル31はアセンブリ言語の1行の単位で、Cテーブル33はソースプログラム1のC言語の1行分の単位でハードウェア上での実行に必要なCPUクロック・サイクル数を保持する領域を備えている。したがって、これらのテーブル31および33は、異なる言語の各行単位でサイクル数を保持できる。
【0126】
また、関数テーブル35は関数ひとつ分の単位で、関数階層テーブル37は関数階層の単位でハードウェア上での実行に必要なCPUクロック・サイクル数を保持する領域を備えている。したがって、これらのテーブル35および37は、処理目的に応じてまとめた基本単位ごとに、ハードウェア上での実行に必要なCPUクロック・サイクル数を保持できる。さらに、これらのテーブル31、33、35および37は、それぞれのテーブルの単位で、その単位のサイクル数を代替する数値を保持する領域を備えている。
【0127】
したがって、仮想評価するステップ7において、ユーザが希望する幾つかの単位でソースプログラム1の一部を切り出し、別なハードウェアまたは別なソフトウェアとして動作させて、当該ソースプログラム1の全体の動作効率を向上させるために、任意の箇所のCPUクロック・サイクル数値を仮想的に変更することができる。そして、変更したサイクル数値を表示することで、切り出す箇所を判断でき、パフォーマンスを最も向上できる最適な部分を切り出して専用プロセッサ化し、経済的で、かつ処理速度も速い最適なプロセッサあるいはLSIを設計することができる。
【0128】
上記の例では、記述言語としては、C言語とアセンブリ言語とでソースプログラムを記述しているが、プロファイラ4において評価できる記述言語はこれに限定されることはなく、C++言語、Java(登録商標)言語などであっても良い。
【0129】
コンピュータ・プログラムを処理目的に応じてまとめた基本単位としては、関数と関数階層を単位とした例を示しているが、分割してコールされることのない処理単位を基本単位とすれば関数単位に限定されるものではない。
【0130】
さらに、アセンブリ言語の1行の単位でサイクル数を保持するアセンブラテーブル31と、C言語の1行分の単位でサイクル数を保持するCテーブル33と、関数ひとつ分の単位でサイクル数を保持する関数テーブル35と、関数階層の単位でサイクル数を保持する関数階層テーブル37とは、相互にサイクル数を換算できるように対応付けられている。そして、プロファイラ4は、仮想評価機能7を実現するサイクル数変更の処理(ステップ44)において、任意の単位で、任意の箇所のCPUクロック・サイクル数値が仮想的に変更されたときに、変更された箇所と対応関係のある、他のテーブルの対応箇所のサイクル数を自動的に変更する機能44a〜44fを備えている。したがって、ユーザは任意の単位でサイクル数を変更することにより、ソースプログラム1の変更前のサイクル数と、変更後のサイクル数を比較して、切り出す部分の適否を評価できる。すなわち、本発明のプロファイラ4においては、ソースプログラム1から切り出す部分の仮想評価を、複数の視点から行うことが可能であり、ユーザの目的に即した評価を得ることができる。
【0131】
また、本例のプロファイラ4はGUIプログラムとして実現されており、ウィンドウ21〜26により各単位でのサイクル数を表示すると共に、それぞれの単位でユーザが任意にサイクル数を変更できるようにしている。プロファイラ4としての機能を実現するプログラムは、上記のフローチャートに基づき説明した本発明のプログラム性能評価方法の各処理を適当なハードウェア資源を備えたコンピュータにおいて実行できる命令を備えたものであり、CD−ROMなどの適当な記録媒体に記録して提供することができる。また、インターネットなどのコンピュータネットワークを介しても提供できる。そして、適当なハードウェア資源を備えたコンピュータにインストールすることにより、プロファイラ4として機能させることができる。
【図面の簡単な説明】
【図1】ソースプログラムの初期の様子を示した図である。
【図2】VUPUプロセッサの概要を示す図である。
【図3】ソースプログラムの一部を抜き出して専用プロセッサ化した設計を示す図である。
【図4】本発明における設計方式を用いたハードウェア設計のワークフローを示す図である。
【図5】本発明のプロファイラをGUIプログラムとして提供したときのウィンドウ表示を示す図である。
【図6】本発明のプロファイラをGUIプログラムとして提供したときの上記と異なるウィンドウ表示を示す図である。
【図7】プロファイラが利用する情報テーブルを示す図であり、アセンブラテーブルおよびCテーブルを示す図である。
【図8】プロファイラが利用する情報テーブルを示す図であり、関数テーブルを示す図である。
【図9】プロファイラが利用する情報テーブルを示す図であり、関数階層テーブルを示す図である。
【図10】プロファイラの全体の動作を示すフローチャートである。
【図11】ASM変更の処理を示すフローチャートである。
【図12】C変更の処理を示すフローチャートである。
【図13】HS変更の処理を示すフローチャートである。
【図14】HT変更の処理を示すフローチャートである。
【図15】FS変更の処理を示すフローチャートである。
【図16】FT変更の処理を示すフローチャートである。
【図17】対応関数階層チェックサブリーチンの処理を示すフローチャートである。
【符号の説明】
1 コンピュータ・プログラム(ソースプログラム)
4 プロファイラ
5 プロファイル情報[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a processor design method and a profiler.
[0002]
[Prior art]
2. Description of the Related Art Conventionally, in hardware design using a computer program description language such as an assembler or C / C ++, the CPU time and the number of clock cycles required to execute each step or each line of a program on hardware as a design target. (Hereinafter referred to as profile information) affects the function and performance of the entire hardware, so the profile information is measured and acquired in advance at the design stage by operation simulation, and measured using an analysis tool called a profiler Design evaluation has been performed by recording and displaying the results.
[0003]
In recent years, when developing and designing a processor that realizes a specification given by a computer program described in C language, instead of directly converting the entire specification to hardware, a part of the specification is converted to a dedicated processor. There has been proposed a method of realizing hardware so as to operate via the Internet. In such a case, similarly, the profile information required for execution of the entire computer program as a specification is measured by an operation simulation, and the measurement result is displayed by a profiler. Methods of finding and extracting a number of functional units that need to be numbered and converting them to a dedicated processor to improve the overall execution performance have been performed.
[0004]
Japanese Patent Laying-Open No. 2002-55813 discloses a VUPU processor including a data dedicated processing unit VU and a general-purpose data processing unit PU.
[0005]
[Patent Document 1]
JP-A-2002-55813
[0006]
[Problems to be solved by the invention]
In the profile information evaluation method in the hardware design as described above, since the profile information is only recorded and displayed using the profiler, the profile information as the design result at that time is visually observed, and the tendency and From the characteristics, it is only possible to locally predict problems and improvements.For example, when modifying or changing the design, the part to be corrected or changed is called from another non-target part and used. However, there is a problem that it is not possible to intuitively know the change in the overall profile information in consideration of the influence.
[0007]
Also, in a design method in which a certain functional unit is extracted and made into a dedicated processor in order to improve the overall execution performance, for example, the number of CPU clock cycles required for operation is obtained from profile information in a design stage before the formation of the dedicated processor. Even if you can find a part with a heavy load such as, if the part is actually turned into a dedicated processor and the load is reduced, how the overall trend and characteristics of the profile information will be affected. There was a problem that it was hard to understand intuitively.
[0008]
The present invention has been made in view of the above-described problems, and when profile information in hardware design is changed, a change in information of another part related to information of the changed part is automatically changed. It is an object of the present invention to realize an environment that can virtually evaluate the influence of modification, change, or partial change to a dedicated processor on the entire design by deriving and displaying the result. It is another object of the present invention to provide a program performance evaluation method and a profiler capable of easily evaluating operation simulation results from a plurality of viewpoints in a processor design process, and a program performance evaluation program.
[0009]
[Means for Solving the Problems]
In the present invention, a computer program is stored on the basis of a first recording area holding a first cycle number necessary for executing at least one component constituting the computer program on hardware of each unit. An arbitrary portion of the computer program based on a first step of determining the total number of unchanged cycles of the computer program and a second recording area holding a second cycle number that substitutes for the first cycle number A second step of calculating the total number of cycles after the second number of cycles is virtually changed.
[0010]
In the second step, it is possible to obtain a total number of cycles after the change from the second number of cycles when a part of the computer program, for example, a source program is cut out and operated as another hardware or another software. In order to improve the overall operation efficiency of the computer program, it is possible to virtually change the CPU clock cycle value at an arbitrary position and display the changed value to determine the cutout position. Further, since the first cycle number is held in the first recording area, the cycle number before the change can be returned at any time, and the cycle number at an arbitrary position can be freely changed.
[0011]
One example of a component is a description language that describes a computer program, such as C, or C ++, or Java (registered trademark), or assembly language. Another example of a component is a basic unit in which a computer program is compiled according to a processing purpose, and there is a function or a function hierarchy. It is desirable to use all or any combination of these components. That is, in the program performance evaluation method of the present invention, a first table including a first recording area and a second recording area of a first component, a first recording area of a second component and By preparing a second table having a second recording area, in the first step, the total cycle that has not been changed based on the first recording area of one of the first and second tables is provided. A number is required. Further, in the second step, the total number of cycles after the change is obtained based on the second recording area of one of the first and second tables. Since the number of cycles can be evaluated by a plurality of components, the program can be evaluated from a plurality of viewpoints.
[0012]
Further, when the second cycle number of the second recording area of one of the first and second tables is changed, the second cycle number of the second recording area corresponding to the other table is automatically set. By providing the step of dynamically changing, the user can perform virtual evaluation from various viewpoints, and can evaluate the program by a virtual evaluation method in which various viewpoints are mixed. Therefore, the source program indicating the specifications of the LSI or the processor can be evaluated more flexibly by the method desired by the user, and the processor having an economical configuration can be more easily designed.
[0013]
The program performance evaluation method of the present invention can be provided as a profiler. The profiler of the present invention stores a computer program in a first recording area holding a first cycle number necessary for execution of at least one component constituting the computer program on hardware of each unit. First means for determining the total number of unchanged cycles of the computer program based on the first cycle number, and a second recording area holding a second cycle number which substitutes for the first cycle number. Second means for calculating the total number of changed cycles after virtually changing the second number of cycles at the location. When the profiler changes the second cycle number of the second recording area of one of the first or second tables, the profiler changes the second cycle number of the second recording area corresponding to the other table. It is desirable to further have means for automatically changing.
[0014]
Further, the profiler can also be provided as a program performance evaluation program having instructions for enabling the first and second steps to be executed by a computer in a suitable recording medium.
[0015]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a diagram showing an initial state of a hardware design or design specification (hereinafter, simply referred to as a source program) described in a computer program description language such as C language or assembly language. The described operation of the source program 1 is represented as one flow in a time series from top to bottom.
[0016]
It is possible to design a processor that extracts a part of the original source program 1 and turns it into a dedicated processor. For example, as shown in FIG. 2, in a VUPU processor 10 including a dedicated data processing unit VU11 and a general-purpose data processing unit PU12, the VU11 is a dedicated processor, and can execute a specific process at a high speed. In the VUPU processor 10, the fetch unit FU13 of the PU 12 fetches an instruction from the program 19p stored in the code RAM 19. If the fetched instruction is a general-purpose instruction (PU instruction) executed by the PU 12, the processing is executed by the execution unit EU14 of the PU 12, and if it is a dedicated instruction (VU instruction) executed by the VU 11, the processing is passed to the VU 11. It is executed by the VU11. The VUPU 10 can carry a plurality of VUs 11, and proceeds with processing while accessing a common data RAM 18 and the like.
[0017]
FIG. 3 shows an operation state when a part of the original source program 1 is extracted and made into a dedicated processor by the design method in the present invention. The source program 1 includes a time-series flow 2a from the top to the bottom of the operation of the stage preceding the part 2b extracted for execution by the dedicated processor, for example, the VU 11, and the time-series flow of the operation of the extracted part. The flow 2b is divided into three flows: one flow 2b from the bottom to the top, and one flow 2c from the top to the bottom in a time series of the subsequent operation of the extracted portion 2b. Accordingly, in the processing of the source program 1, the entire operation flow starts at the pre-stage 2a, the operation moves to the part 2b extracted from the middle, and the operation moves to the post-stage 2c, and ends.
[0018]
FIG. 4 shows a workflow of hardware design using the design method according to the present invention. The operation simulator 3 can read the hardware design, that is, the source program 1 or information converted from the hardware design (arrow A), and perform a simulation operation based on the design contents. The profiler 4 performs verification and evaluation for cutting out a part of the source program 1 and making it into a dedicated processor, for example, by the design method of the present invention. The profiler 4 displays the information contents in an easy-to-understand manner for the user based on the profile information 5 (arrow C) obtained by performing the simulation operation by the operation simulator 3 (arrow B), and verifies and evaluates the first step. (Step 6). Further, the profiler 4 of the present example includes a step 6a of changing display contents in order to further verify and evaluate the information contents, and includes a second process (step 7) of performing a virtual evaluation based on the changed contents. ing. In this virtual evaluation step 7, as shown in FIG. 3, it is possible to virtually evaluate a change in situation when a part or some of the original design is cut out and made into a dedicated processor. The information for virtual evaluation can be changed any number of times based on the information displayed in the display step 6 of the profiler 4 (arrow D).
[0019]
As a result (arrow E) of performing the profile information display / change step 6 and the virtual evaluation step 47 in the profiler 4, in the division step 8, an optimal part to be extracted and divided by using a dedicated processor is found. As a result, in step 9, the source program 1 is divided into a plurality of parts based on information on the divided parts found in the dividing step 8.
[0020]
5 and 6 show some examples of window display when the profiler 4 is provided as a GUI (Graphical User Interface) program. FIG. 5A shows a window 21 that displays the total number of clock cycles that have not been changed (hereinafter, simply referred to as the number of cycles) and the total number of cycles that have been changed. 21a and an area 21b indicating the total number of cycles after the change. An area 21a indicating the total number of cycles before change displays the number of cycles required for all operations when the source program 1 is simulated by the operation simulator 3. The area 21b indicating the total number of cycles after the change displays the total number of cycles required for all operations when the profile information 5 is changed in the display change step 6 for the virtual evaluation in the virtual evaluation step 7.
[0021]
FIG. 5B shows a window 22 for displaying information such as the number of cycles required for the operation for each functional unit (hereinafter, sometimes referred to as a function) of the source program 1, and includes a function name area 22 a and a call number area. 22b, an average cycle number area 22c, a single cycle number area 22d, and a total cycle number area 22e. The names assigned to the functions included in the source program 1 are listed in the function name area 22a. The number-of-calls area 22b shows, for each function name (area 22a), how many times the function was called through the operation simulation and the number of times. The average cycle number area 22b shows, for each function name (area 22a), an average value of the total number of cycles required only by the function through the operation simulation 3 for each call.
[0022]
The single cycle number area 22d shows, for each function name (area 22a), the total number of cycles required only by the function through the operation simulation 3. In the example of FIG. 5B, the function named func2 (area 22a) is called three times through the operation simulation 3 (area 22b), and the operation of only the func2 function requires a total of 48 cycles (area 22c). Thus, it can be seen that the average number of cycles required for one call is 16 cycles (area 22d).
[0023]
The total cycle number area 22e contains, for each function name (area 22a), the total number of cycles required by the function through the operation simulation 3, and the cycle required for a hierarchical operation such that the function calls another function. All numbers are shown. In the example of FIG. 5B, the func2 (region 22a) function requires 48 cycles (region 22d) as the number of single cycles and 48 cycles (region 22e) as the total number of cycles. Since the numbers are equal, it can be seen that the func2 function does not call another function in its operation. On the other hand, the func1 (region 22a) function requires 46 cycles (region 22d) as the number of single cycles and 94 cycles (region 22e) as the total number of cycles. It can be seen that the function calls some other function in its operation.
[0024]
FIG. 5C shows a window 23 for displaying a state of a function call included in the source program 1 (hereinafter simply referred to as a function hierarchy) and the number of cycles required for the operation of each function. , A cycle number area 23b. The function hierarchy area 23a indicates which function in the source program 1 calls another function. In the example of FIG. 5C, it is shown that the source program 1 starts with the operation of the main function, and the main function operates by sequentially calling the functions func1, func3, and func4. Further, it is shown that the func1 function operates by calling the func2 function, and the func4 function operates by sequentially calling the func5 and func6 functions. Hereinafter, each element such as the main function and the func1 function represented as a function hierarchy is referred to as a function hierarchy element.
[0025]
The cycle number area 23b includes, for each function hierarchy element, the total number of cycles that the function hierarchy element requires for hierarchical operation including the call of another function hierarchy element, and the single operation that does not include any other function hierarchy element call. The number of cycles required for is displayed. In the example of FIG. 5 (c), the func4 function hierarchy element has a total of 47 cycles including the func5 and func6 function hierarchy element calls and execution, and the number of cycles required for a single operation not including the function hierarchy element call. This indicates that there are 16 cycles.
[0026]
FIG. 6A shows a window 24 for displaying the contents of the source program 1 in C language, and includes a program area 24a and a cycle number area 24b. In the program area 24a, the contents of the source program 1 are displayed in C language. In the cycle number area 24b, the number of cycles required for each line of the C language program displayed in the program area (area 24a) through the operation simulation is displayed.
[0027]
FIG. 6B shows a window 25 for displaying the contents of the source program 1 in an assembly language, and includes a program area 25a and a cycle number area 25b. In the program area 25a, the contents of the source program 1 are displayed in an assembly language. In the cycle number area 25b, the number of cycles required for each line of the assembly language program displayed in the program area (area 25a) through the operation simulation is displayed.
[0028]
FIG. 6C shows a window 26 for changing the value of the cycle number information displayed as the GUI of the profiler 4 for virtual evaluation in step 7. For example, the window 26 is displayed on the GUI program of the profiler 4. The number of cycles appears when the user clicks a numerical value to be changed with a pointing device such as a mouse of a computer. This window 26 has an original cycle area 26a where the original cycle value before the user changes the value is displayed, and when the user wants to change the value of the original cycle (area 26a) for the virtual evaluation (step 7). And a change cycle number area 26b for inputting an arbitrary value using an input device such as a computer keyboard.
[0029]
Further, the window 26 includes a decision button 26c which is pressed when the user inputs an arbitrary value in the change cycle number area (area 26b) and then confirms the operation, and a button for disabling and closing the operation performed in the window 26. It has a cancel button 26d to be pressed.
[0030]
FIGS. 7, 8 and 9 show the state of the information area used by the profiler 4 arranged in a storage device such as a memory of a computer. The information table (hereinafter simply referred to as assembler table) 31 in FIG. 7A is a table used when displaying the contents of the source program 1 in the area 25a of the window 25 in the assembly language. Line information is stored in one assembler table. The assembler tables 31 are arranged continuously in the storage device in the order of the line numbers corresponding to the number of lines when the entire source program 1 is expressed in the assembly language. A table 32 in FIG. 7B shows information on the assembler table 31 for all lines when the source program 1 is expressed in assembly language.
[0031]
7C is an information table used when displaying the contents of the source program 1 in the area 24a of the window 24 in C language. Line information is held in one C table 33. The C table 33 is arranged continuously in the storage device by the number of lines when the entire source program 1 is expressed in the C language and arranged in the order of the line numbers. The table 34 in FIG. 7D shows information on the C table 33 for all lines when the source program 1 is expressed in C language.
[0032]
An information table (hereinafter, simply referred to as a function table) 35 in FIG. 8A is an information table used when displaying a function included in the source program 1 on the window 22 and stores information for one function. It is held in one function table 35. The function tables 35 corresponding to the number of functions included in the source program 1 are continuously arranged in the storage device in an arbitrary order. A table 36 in FIG. 8B shows information on the function table for all functions included in the source program 1.
[0033]
The table 37 in FIG. 9A is an information table for each function hierarchy element (hereinafter simply referred to as a function hierarchy table), and is arranged in an arbitrary order by the number of all function hierarchy elements included in the source program 1. They are continuously arranged in the storage device. The table 38 in FIG. 9B shows information on all the function hierarchy tables 37.
[0034]
Each area of the assembler table 31 of FIG. 7A will be described. The region 31-1 is a belonging function table region, and for a function to which one line of the target assembly language belongs, a head position where the function table 35 of the function is stored (hereinafter, a head position where information is stored in the storage device). (The position is simply called an address). An area 31-2 is an area corresponding to the number of corresponding C tables. When the contents of the source program 1 are expressed in C language, the address of the C table 33 of one line of C language corresponding to one line of the target assembly language is held. .
[0035]
The area 31-3 is an area for the number of callee function hierarchy tables, and holds the number of function hierarchy elements corresponding to the callee function when one line of the target assembly language is a call instruction for calling another function. ing. An area 31-4 and an area 31-5 are call destination function hierarchy table areas. When one line of the target assembly language is a call instruction for calling another function, a function hierarchy table corresponding to the call destination function is provided. Is held. The number of function hierarchy tables corresponding to the called function is the number of the number held in the called function hierarchy table number area (area 31-3), and is indicated by the area 31-4 and the area 31-5 accordingly. The number of callee function hierarchy table areas increases or decreases. The area 31-6 is an assembler text area, and holds text information of one line of the target assembly language. This text is displayed in the program area of the area 25a of the window 25.
[0036]
An area 31-7 is an original single cycle number area, and holds the number of cycles required for executing one line of the target assembly language when the source program 1 is simulated by the operation simulator 3. The original number of independent cycles does not include the number of cycles required for execution in the called function when one line of the target assembly language calls the function. An area 31-8 is a changed single cycle number area, and when the user changes the original single cycle number (area 31-7) using, for example, the window 26, the changed numerical value is held. The value held when no change has been made is the same as the original single cycle number (region 31-7). The area 31-9 is a single cycle change flag area, and holds as a flag whether or not the original single cycle number (area 31-7) has been changed. For example, when no change has been made, a numerical value 0 is held, and when a change is made, a numerical value 1 is held.
[0037]
An area 31-10 is an original total cycle number area, and holds the number of cycles required to execute one line of the target assembly language when the source program 1 is simulated by the operation simulator 3. The original total number of cycles includes the number of cycles required for execution in the called function when one line of the target assembly language calls the function. The area 31-11 is a changed total cycle number area, and when the user changes the original total cycle number (area 31-10) using, for example, the window 26, the changed numerical value is held. The value held when no change has been made is the same as the original total cycle number (region 31-10). The area 31-12 is a total cycle change flag area, and holds as a flag whether or not the original total cycle number (area 31-10) has been changed. For example, when no change has been made, a numerical value 0 is held, and when a change is made, a numerical value 1 is held.
[0038]
Each area of the table 32 in FIG. 7B will be described. The area 32-1 is an area for the number of assembler tables, and holds the number of assembler tables held in the storage device. Since the assembler table is information for one line of the assembly language program, the number of the assembler tables matches the number of lines when the source program 1 is expressed in the assembly language. The area 32-2 is the head area of the assembler table, and holds the head addresses of all the assembler tables continuously arranged in the storage device.
[0039]
Each area of the C table 33 in FIG. 7C will be described. The area 33-1 is a belonging function table area, and holds the address of the function table 35 of the function to which one line of the C language to be a target of the C table belongs. An area 33-2 is an area for the number of corresponding assembler tables. When the contents of the source program 1 are expressed in assembly language, the number of lines of assembly language corresponding to one line of the target C language is held.
[0040]
An area 33-3 and an area 33-4 are corresponding assembler table areas. When the contents of the source program 1 are expressed in an assembly language, one line of the target C language and a line of the assembly language corresponding to the target program are described. The address of the assembler table 31 of the row is held. The number of the corresponding assembly language lines is the number of lines held in the corresponding assembler table number area (area 33-2), and the corresponding assembler table areas indicated by the areas 33-3 and 33-4 accordingly. Increase or decrease.
[0041]
An area 33-5 is a corresponding function hierarchy number table area, in which one row of the target C language holds the number of function hierarchy elements to which the function hierarchy belongs as shown in the area 23a of the window 23 as an example. ing. In the example of FIG. 5C, if one line of the target C language belongs to the func2 function hierarchy element, there is only one func2 function hierarchy element in the example, so the corresponding function hierarchy table area (area 33-5) ) Holds the numerical value 1.
[0042]
The area 33-6 and the area 33-7 are corresponding function hierarchy table areas, and hold the address of the function hierarchy table 37 for the function hierarchy element to which one line of the target C language belongs. Corresponding function hierarchy tables 37 exist in the number stored in the corresponding function hierarchy table number area (area 33-5), and the corresponding function hierarchy tables indicated by the areas 33-6 and 33-7 accordingly. The number of regions increases or decreases.
[0043]
An area 33-8 is a C text area, and holds text information of one line of the target C language. This text is displayed in the program area of the area 24a of the window 24.
[0044]
The area 33-9 is an original single cycle number area, and holds the number of cycles required to execute one line of the target C language when the source program 1 is simulated by the operation simulator 3. The original single cycle count does not include the cycle count required for execution inside the called function when one line of the target C language calls the function. An area 33-10 is a changed single cycle number area, and when the user changes the original single cycle number (area 33-9) using, for example, the window 26, the changed numerical value is held. The value held when no change has been made is the same as the original single cycle number (region 33-9). The area 33-11 is a single cycle change flag area, and holds as a flag whether or not the change of the original single cycle number (area 33-9) has been performed. For example, when no change has been made, a numerical value 0 is held, and when a change is made, a numerical value 1 is held.
[0045]
An area 33-12 is an original total cycle number area, and holds the number of cycles required for executing one line of the target C language when the source program 1 is simulated by the operation simulator 3. The original total number of cycles includes the number of cycles required for execution in the called function when one line of the target C language calls the function. The area 33-13 is a changed total cycle number area, and when the user changes the original total cycle number (area 33-12) using, for example, the window 26, the changed numerical value is held. The value held when no change has been made is the same as the original total cycle number (region 33-12). The area 33-14 is a total cycle change flag area, and holds, as a flag, whether or not the original total cycle number (area 33-12) has been changed. For example, when no change has been made, a numerical value 0 is held, and when a change is made, a numerical value 1 is held.
[0046]
Each area of the table 34 in FIG. 7D will be described. An area 34-1 is an area for the number of C tables, and holds the number of C tables held in the storage device. Since the C table is information for one line of a C language program, the number of C tables matches the number of lines when the source program 1 is expressed in C language. The area 34-2 is a C table head area, and holds the head address of all the C tables continuously arranged in the storage device.
[0047]
Each area of the function table 35 in FIG. 8A will be described. The area 35-1 is a corresponding C table start point area. A function is usually one functional unit described over a plurality of lines using a computer program description language such as C language or assembly language, and the corresponding C table starting point area describes a target function in C language. The head address of the C table 33 corresponding to the head row of the case is held. The area 35-2 is an end point area of the corresponding C table, and holds the start address of the C table 33 corresponding to the last row when the target function is described in the C language.
[0048]
An area 35-3 is a corresponding assembler table start point area, and holds a head address of the assembler table 31 corresponding to a head line when the target function is described in the assembly language. An area 35-4 is a corresponding assembler table end point area, and holds a start address of the assembler table 31 corresponding to the last line when the target function is described in the assembly language.
[0049]
An area 35-5 is an area for the number of corresponding function hierarchy tables, and holds the number of function hierarchy elements corresponding to the target function. An area 35-6 and an area 35-7 are corresponding function hierarchy table areas, and hold the address of the function hierarchy table 37 for the function hierarchy element corresponding to the target function. The number of corresponding function hierarchy tables is the number held in the corresponding function hierarchy table number area (area 35-5), and the corresponding function hierarchy table area indicated by the area 35-6 and the area 35-7 accordingly. Increase or decrease.
[0050]
An area 35-8 is an area for the number of child function tables, and holds the number of functions directly called by the target function. The area 35-9 and the area 35-10 are child function table areas, and hold the address of the function table corresponding to the function directly called by the target function. The number of child functions directly called by the target function exists in the number of child functions stored in the child function table number area (area 35-8), and the child functions indicated in the areas 35-9 and 35-10 correspondingly. The number of table areas increases or decreases.
[0051]
An area 35-11 is a function name area, and holds the function name of the target function to be displayed in the function name area of the area 22a of the window 22.
[0052]
An area 35-12 is an original single cycle number area, and holds the number of cycles required to execute the target function when the source program 1 is simulated by the operation simulator 3. The original single cycle count does not include the cycle count required for execution inside the called function when the target function further calls the function internally. The area 35-13 is a changed single cycle number area, and when the user changes the original single cycle number (area 35-12) using, for example, the window 26, the changed numerical value is held. The numerical value retained when no change has been made is the same as the original single cycle number (region 35-12). The area 35-14 is a single cycle change flag area, and holds as a flag whether or not the number of original single cycles (area 35-12) has been changed. For example, when no change has been made, a numerical value 0 is held, and when a change is made, a numerical value 1 is held.
[0053]
An area 35-15 is an original total cycle number area, and holds the number of cycles required to execute the target function when the source program 1 is simulated by the operation simulator 3. The total number of original cycles includes the number of cycles required for execution in the called function when the target function further calls the function internally. The area 35-16 is a changed total cycle number area, and when the user changes the original total cycle number (area 35-15) using, for example, the window 26, the changed numerical value is held. The value held when no change has been made is the same as the original total cycle number (region 33-15). The area 35-17 is a total cycle change flag area, and holds, as a flag, whether or not the original total cycle number (area 35-15) has been changed. For example, when no change has been made, a numerical value 0 is held, and when a change is made, a numerical value 1 is held.
[0054]
Each area of the table 36 in FIG. 8B will be described. An area 36-1 is a function table number area, and holds the number of function tables held in the storage device. The area 36-2 is a function table head area, and holds the head addresses of all the function tables continuously arranged in the storage device.
[0055]
Each area of the function hierarchy table 37 in FIG. 9A will be described. The area 37-1 is a child function hierarchy table number area, and holds the number of function hierarchy elements directly called by the target function hierarchy element. The area 37-2 and the area 37-3 are child function hierarchy table areas, and hold addresses of the function hierarchy table corresponding to the function hierarchy element directly called by the target function hierarchy element. The number of child function hierarchy elements directly called by the target function hierarchy is equal to the number held in the child function hierarchy table number area (area 37-1), and accordingly, in the area 37-2 and the area 37-3. The number of child function hierarchy table areas shown increases or decreases.
[0056]
The area 37-4 is a parent function hierarchy table area, and holds the address of the function hierarchy table corresponding to the parent function hierarchy element that called the target function hierarchy element. An area 37-5 is a corresponding function table area, and holds an address of a function table for a function corresponding to the target function hierarchical element.
[0057]
An area 37-6 is a call source assembler table area, and holds an address of an assembler table corresponding to one line of the assembly language calling the target function hierarchical element. An area 37-7 is a function hierarchy element name area, and holds the name of the target function hierarchy element. This name is the same as the function name of the function corresponding to the target function hierarchy element, and is used as the name displayed in the area 23a of the window 23.
[0058]
An area 37-8 is an original single cycle number area, and holds the number of cycles required for executing the target function hierarchical element when the source program 1 is simulated by the operation simulator 3. In the case where the target function hierarchy element further calls the function hierarchy element internally, the original single cycle number does not include the number of cycles required for execution inside the called function hierarchy element. The area 37-9 is a changed single cycle number area, and when the user changes the original single cycle number (area 37-8) using, for example, the window 26, the changed numerical value is held. The numerical value retained when no change has been made is the same as the original single cycle number (region 37-8). The area 37-10 is a single cycle change flag area, and holds as a flag whether or not the change of the original single cycle number (area 37-8) has been performed. For example, when no change has been made, a numerical value 0 is held, and when a change is made, a numerical value 1 is held.
[0059]
An area 37-11 is an original total cycle number area, and holds the number of cycles required for executing the target function hierarchical element when the source program 1 is simulated by the operation simulator 3. The original total cycle number includes the number of cycles required for execution inside the called function hierarchy element when the target function hierarchy element further calls the function hierarchy element inside. An area 37-12 is a changed total cycle number area, and when the user changes the original total cycle number (area 37-11) using, for example, the window 26, the changed numerical value is held. The numerical value retained when no change has been made is the same as the original total cycle number (region 37-11). The area 37-13 is a total cycle change flag area, and holds as a flag whether or not the original total cycle number (area 37-11) has been changed. For example, when no change has been made, a numerical value 0 is held, and when a change is made, a numerical value 1 is held.
[0060]
Each area of the table 38 in FIG. 9B will be described. An area 38-1 is an area for the number of function hierarchy tables, and holds the number of function hierarchy tables held in the storage device. An area 38-2 is a function hierarchy table head area, and holds a head address of all the function hierarchy tables continuously arranged in the storage device.
[0061]
FIG. 10 is a flowchart showing the entire operation of the profiler 4. When the profiler 4 is started, first, input data is read to display information (step 40). The input data is profile information 5 generated by the operation simulator 3.
[0062]
Next, in step 41, the profiler 4 reads and analyzes the data stored in the profile information 5, and displays each window. All the assembler tables 31 and 32 are read and analyzed, and a window 25 is displayed. The entire C tables 33 and 34 are read and analyzed, and the window 24 is displayed. All the function tables 35 and 36 are read and analyzed, and the window 22 is displayed. It reads and analyzes all function hierarchy tables 37 and 38 and displays window 23.
[0063]
In step 41, the total number of cycles required for executing the target source program 1 is calculated and displayed. In the area 21a indicating the total number of cycles when the window 21 is not changed, the sum of the areas 31-7 of all the assembler tables 31 is calculated by the following equation (1) and displayed as the total number of cycles.
[0064]
Figure 2004234068
In the area 21b indicating the total number of cycles after the change, the sum of the areas 31-8 in all the assembler tables 31 is calculated by the following equation (2), and is displayed as the total number of cycles after the change. .
[0065]
Figure 2004234068
In the first stage, the values of the areas 21a and 21b are the same since the user has not made any change in the cycle number information yet.
[0066]
After evaluating the various information displayed by the profiler 3, the user can terminate the profiler 3 (step 42). The user can evaluate various information displayed by the profiler 3 and instruct the change of the cycle number in step 43. Then, in step 44, for example, a portion which is better to be made into a dedicated processor because the number of cycles required for execution is large is searched for, and how the total number of cycles changes when the corresponding portion 2b (FIG. 3) is extracted is evaluated. it can. Step 44 of this evaluation corresponds to step 7 of virtual evaluation.
[0067]
In step 44, the window 26 is opened by specifying the cycle number of the corresponding portion, and the change can be made using this window. The profiler 4 recalculates the number of cycles of all other parts that will be affected if the number of cycles is changed by the user. Then, the process returns to step 41, and the cycle numerical value after the change is displayed again. When displaying the cycle number after the change, only the numerical value of the changed cycle number is displayed in such a manner that the user can easily understand, for example, by changing the character color and the background color, and changing the character size and thickness. . In this case, information indicating whether or not the number of cycles has been changed includes a single cycle number change flag area (areas 31-9, 33-11, 35-14, and 37-9) and a total cycle change flag area ( The determination can be made based on the numerical values held in the areas 31-12, 33-14, 35-17, and 37-13). In this embodiment, when the numerical value is 1, each flag area is determined. It can be seen that the number of cycles targeted by the table to which has been changed has been changed.
[0068]
In the hardware design method of the present invention, that is, in the profiler 4, not only the profile information 5 is displayed as described above, but the influence on the whole can be seen (virtual evaluation) by changing the profile information at an arbitrary position. As a result, the optimum extracted portion 2b can be found out, and division can be performed, for example, for a dedicated processor, as in step 9 in FIG.
[0069]
In the profiler 4, evaluations with different numbers of cycles can be executed by six different methods 44a to 44f. In the first evaluation method 44a, the number of cycles in an arbitrary line of the assembly language displayed in the area 25b of the window 25 is changed, and other information corresponding thereto is automatically changed to evaluate the change in the number of cycles (ASM). Change). In the second evaluation method 44b, the number of cycles in an arbitrary line of the C language displayed in the region 24b of the window 24 is changed, and other corresponding information is automatically changed to evaluate the change in the number of cycles (C change). ).
[0070]
In the third evaluation method 44c, of the number of cycles displayed in the area 23b of the window 23, the number of cycles required for an independent operation of any function hierarchy element not including any other function hierarchy element call is changed, and The corresponding other information is automatically changed to evaluate the change in the number of cycles (HS change). In the fourth evaluation method 44d, of the number of cycles displayed in the area 23b of the window 23, the number of cycles required for a hierarchical operation of an arbitrary function hierarchical element including a call to another function hierarchical element is changed. The corresponding other information is automatically changed to evaluate the change in the number of cycles (HT change).
[0071]
In the fifth evaluation method 44e, the number of cycles required for a single operation of any function, which does not include any other function call, displayed in the area 22d of the window 22 is changed, and other corresponding information is automatically changed. To evaluate the change in the number of cycles (FS change). In the sixth evaluation method 44f, the number of cycles required for the operation of any function, including other function calls, displayed in the area 22d of the window 22 is changed, and other corresponding information is automatically changed to change the cycle. Evaluate the change in number (FT change).
[0072]
FIG. 11 shows a flowchart of the ASM change 44a. In this process 44a, when the user changes the cycle number of an arbitrary line of the assembly language displayed in the area 25b of the window 25, other corresponding information is automatically changed. First, in step 51, when the user changes an arbitrary number of cycles displayed in the area 25b, a corresponding C language line is selected from a corresponding C table (area 31-2) of the assembler table 31 to be changed. Is obtained, and the number of individual change cycles (area 33-10) and the total number of change cycles (area 33-13) are calculated.
[0073]
Figure 2004234068
Further, in order to indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 33-11) and the total cycle change flag (area 33-14) of the C table 33 is set to 1.
[0074]
Next, in step 52, if one line of the assembly language to be changed is not a call instruction for calling another function (the numerical value held in the area 31-3 called function hierarchy table number is 0), then in step 53 The corresponding function hierarchy check subroutine 45 changes the information such as the corresponding function hierarchy table. The corresponding function hierarchy check subroutine 45 will be described later with reference to FIG. Next, in step 53, the number of individual cycles of change (area 31-8) and the total number of changed cycles (area 31-11) of the assembler table 31 to be changed are calculated.
[0075]
Figure 2004234068
To indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 31-9) and the total cycle change flag (area 31-12) of the assembler table is set to 1.
[0076]
Next, in step 54, the function table 35 of the function to which one line of the assembly language to be changed belongs is obtained from the belonging function table (area 31-1) of the assembler table to be changed (FIG. 10). The number of single cycles (area 35-13) and the total number of changed cycles (area 35-16) are calculated.
[0077]
Figure 2004234068
To indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 35-14) and the total cycle change flag (area 35-17) in the function table is set to 1.
[0078]
In step 52, if one line of the assembly language to be changed is a call instruction for calling another function (the value held in the area 31-3 number of called function hierarchy tables is a positive number), the cycle number All changes are given to the callee. In step 55, based on the number held in the number of callee function hierarchy tables (area 31-3), each of the callee function hierarchy tables (areas 31-4 and thereafter, depending on area 31-3) is used. The difference m is obtained by distributing the difference in accordance with the ratio of the total number of changed cycles (area 37-12) of the call destination function hierarchy table, and the difference m is used to call other function hierarchy elements of each function hierarchy element. The HT change 44d is called to change the number of cycles required to include the number of cycles required for the hierarchical operation.
[0079]
FIG. 12 shows a flowchart of the C change 44b. This process 44b automatically changes other corresponding information when the user changes the cycle number of an arbitrary line of the C language displayed in the area 24b of the window 24. In step 61, when the user changes an arbitrary number of cycles displayed in the area 24b, the number of individual cycles (area 33-10) and the total number of changed cycles (area 33-13) of the C table 33 to be changed. Is calculated.
[0080]
(C-table change single cycle number) = (user change value) Expression (9)
(Total number of cycles of change of the C table) = (change value of the user) Expression (10)
To indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 33-11) and the total cycle change flag (area 33-14) of the C table is set to 1.
[0081]
Next, based on the number of corresponding assembler tables (area 33-2) of the C table 33 to be changed, all of the corresponding assembler tables (areas 31-3 and thereafter, depending on the area 33-2) are targeted. The following corresponding function hierarchy check subroutine 45, steps 63, 64, 65 and HT change 44d are performed. At this time, the difference a to be added with respect to the cycle number of each corresponding assembler table is obtained by dividing the difference to the original C table 33 to be changed according to the ratio of the total number of change cycles (area 31-11) of each corresponding assembler table. Shall be distributed.
[0082]
First, in step 62, if one line of the target assembly language of the corresponding assembler table 31 is not a call instruction that calls another function (the number held in the area 31-3 called function hierarchy table number is 0), The corresponding function hierarchy subroutine 45 is used to change the information of the corresponding function hierarchy table and the like. Then, in step 63, the number of single cycles of change (area 31-8) and the total number of changed cycles (area 31-11) is calculated.
[0083]
Figure 2004234068
To indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 31-9) and the total cycle change flag (area 31-12) of the assembler table is set to 1.
[0084]
Next, in step 64, the function table 35 of the function to which one line of the target assembly language belongs is obtained from the belonging function table (area 31-1) of the corresponding assembler table 31, and the number of changed single cycles (area 35) is obtained. -13), calculate the total number of changed cycles (area 35-16).
[0085]
Figure 2004234068
To indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 35-14) and the total cycle change flag (area 35-17) in the function table is set to 1.
[0086]
In step 62, if one line of the target assembly language of the corresponding assembler table is a call instruction for calling another function (the value held in the area 31-3 number of called function hierarchy tables is a positive number) , The difference a of the change of the cycle numerical value is all given to the call destination. In step 65, based on the number stored in the number of callee function hierarchy tables (area 31-3), each of the callee function hierarchy tables (areas 31-4 and thereafter, depending on area 31-3) is used. The difference a is distributed in accordance with the ratio of the total number of changed cycles (area 37-12) of the call destination function hierarchy table to obtain the difference b, and the difference b is used to call another function hierarchy element of each function hierarchy element. HT change 44d is called to change the number of cycles required to give to the number of cycles required for the hierarchical operation including the above.
[0087]
FIG. 13 shows a flowchart of the HS change 44c. In this process 44c, when the user changes the number of cycles required for a single operation of the arbitrary function hierarchy element displayed in the area 23b of the window 23 without including any other function hierarchy element call, other information corresponding to the change is obtained. To change automatically. In step 71, when the user changes the number of cycles required for a single operation out of the number of cycles displayed in the area 23b, the number of changed single cycles in the function hierarchy table 37 to be changed (area 37-9) , The total number of changed cycles (area 37-12).
[0088]
Figure 2004234068
Further, in order to indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 37-10) and the total cycle change flag (area 37-13) of the function hierarchy table is set to 1.
[0089]
Next, in step 72, the corresponding assembler table start point (area 35-3) and the corresponding assembler table end point (area 35-4) are obtained from the corresponding function table (area 37-5), and between the start point and the end point. The number of changed cycles (area 31-8) and the total number of changed cycles (area 31-11) of all the assembler tables 31 arranged at the addresses are calculated. The difference c added to the cycle number at this time distributes the original difference in accordance with the ratio of the change single cycle number (area 31-8) of the assembler table 31.
[0090]
Figure 2004234068
To indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 31-9) and the total cycle change flag (area 31-12) of the assembler table is set to 1.
[0091]
Further, in step 73, for each modified assembler table 31, the number of individual cycles (area 33-10) and the total number of changed cycles (area 33-10) of the C table 33 obtained from the corresponding C table (area 31-2) The area 33-13) is calculated.
[0092]
Figure 2004234068
To indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 33-11) and the total cycle change flag (area 33-14) of the C table is set to 1.
[0093]
Further, in step 74, the total number of change cycles (area 31-11) of the assembler table 31 obtained from the call source assembler table (area 37-6) of the function hierarchy table 37 to be changed is calculated, and the change is added. The value held by the total cycle change flag (area 31-12) is set to 1 to indicate that the change has been made. Further, based on the corresponding C table (area 31-2) of the changed assembler table 31, the total number of changed cycles (area 33-13) of the corresponding C table 33 is also calculated, and the total number of cycles is calculated to indicate that the change has been made. The value held by the cycle change flag (area 33-14) is set to 1. The operation of step 74 so far is performed recursively on the function hierarchy table 37 obtained from the parent function hierarchy table (area 37-4).
[0094]
Figure 2004234068
Next, in step 75, for the function table 35 obtained from the corresponding function table (area 37-5), the number of changed single cycles (area 35-13) and the total number of changed cycles (area 35-16) are calculated.
[0095]
Figure 2004234068
To indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 35-14) and the total cycle change flag (area 35-17) in the function table is set to 1.
[0096]
If the function hierarchy table 37 relating to the parent hierarchy is obtained from the parent function hierarchy table (area 37-4) in step 76, the total number of change cycles (area 37-12) of the parent hierarchy table 37 is calculated in step 77. Further, the operation of calculating the total number of change cycles (area 35-16) of the function table 35 obtained from the corresponding function table (area 37-5) of the parent hierarchy table is performed recursively, and the original function layer element to be changed Change for all parent hierarchies. In order to indicate that the change has been made, the value held by the total cycle change flag (areas 37-13 and 35-17) of the changed table is set to 1.
[0097]
Figure 2004234068
FIG. 14 shows a flowchart of the HT change 44d. In this process 44d, when the user changes the number of cycles required for a hierarchical operation including an invocation of another function hierarchy element of an arbitrary function hierarchy element displayed in the area 23b of the window 23, other information corresponding to the change is obtained. To change automatically.
[0098]
In step 81, when the user changes the number of cycles required for the hierarchical operation out of the number of cycles displayed in the area 23b, the function hierarchy table 37 relating to the parent hierarchy is changed from the parent function hierarchy table (area 37-4). Is obtained, in step 82, the total number of changed cycles of the parent hierarchy table 37 (area 37-12) is calculated. The operation of calculating the total number of change cycles (area 35-16) is recursively performed to change all parent layers of the original function layer element to be changed. In order to indicate that the change has been made, the value held by the total cycle change flag (areas 37-13 and 35-17) of the changed table is set to 1. The calculation uses the equations (25) and (26).
[0099]
Next, the difference d is obtained from the difference by the ratio of the number of single cycles of change (area 37-9) to the total change cycle (area 37-12) of the original function hierarchy element to be changed, and the following steps 83, 84, 85 and 86, and further called from the function hierarchy element to be changed from the number of child function hierarchy tables (area 37-1) and the child function hierarchy table (area 37-2 and subsequent areas, depending on area 37-1). As long as there is a function layer element obtained, the difference d is similarly obtained, and the operations of steps 83, 84, 85 and 86 are repeated (step 87).
[0100]
In step 83, the corresponding assembler table start point (area 35-3) and the corresponding assembler table end point (area 35-4) are obtained from the corresponding function table (area 37-5), and the address between the start point and the end point is obtained. The number of single cycles changed (area 31-8) and the total number of changed cycles (area 31-11) of all the assembler tables 31 arranged are calculated. The difference e added to the number of cycles at this time distributes the original difference d according to the ratio of the number of changed single cycles of the assembler table 31 (area 31-8).
[0101]
Figure 2004234068
To indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 31-9) and the total cycle change flag (area 31-12) of the assembler table is set to 1.
[0102]
In step 84, for each of the assembler tables 31 that have been further changed, the number of individual cycles (area 33-10) and the total number of changed cycles (area 33-10) of the C table 33 obtained from the corresponding C table (area 31-2) The area 33-13) is calculated.
[0103]
Figure 2004234068
To indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 33-11) and the total cycle change flag (area 33-14) of the C table is set to 1.
[0104]
Next, in step 85, for the function table 35 obtained from the corresponding function table (area 37-5), the number of changed single cycles (area 35-13) and the total number of changed cycles (area 35-16) are calculated.
[0105]
Figure 2004234068
To indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 35-14) and the total cycle change flag (area 35-17) in the function table is set to 1.
[0106]
Next, in step 86, the number of single cycles of change (area 37-9) and the total number of cycles of change (area 37-12) of the function hierarchy table 37 to be changed are calculated.
[0107]
Figure 2004234068
Further, in order to indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 37-10) and the total cycle change flag (area 37-13) of the function hierarchy table is set to 1.
[0108]
Lastly, in step 87, if there is a child hierarchy, in step 88, the total number of changed cycles of the assembler table 31 obtained from the calling source assembler table (area 37-6) of the function hierarchy table 37 to be changed (area 31- 11) is calculated, and the value held in the total cycle change flag (area 31-12) is set to 1 to indicate that the change has been made. Further, based on the corresponding C table (area 31-2) of the changed assembler table 31, the total number of changed cycles (area 33-13) of the corresponding C table 33 is also calculated, and the total number of cycles is calculated to indicate that the change has been made. The value held by the cycle change flag (area 33-14) is set to 1. Equations (21) and (22) are used for the calculation.
[0109]
FIG. 15 shows a flowchart of the FS change 44e. In this process 44e, when the user changes the single cycle number of any function displayed in the area 22d of the window 22 without including any other function call, other corresponding information is automatically changed. When the user changes the number of single cycles displayed in the area 22d, first, the corresponding function hierarchy check subroutine 45 changes the information of the corresponding function hierarchy table and the like. The corresponding assembler table start point (area 35-3) and the corresponding assembler table end point (area 35-4) are obtained, and the change single cycle number (area) of all assembler tables 31 arranged at addresses between the start point and the end point is obtained. 31-8), and calculate the total number of changed cycles (area 31-11). The difference c added to the cycle number at this time distributes the original difference in accordance with the ratio of the change single cycle number (area 31-8) of the assembler table 31. In addition, the calculation is performed using Expressions (17) and (18). To indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 31-9) and the total cycle change flag (area 31-12) of the assembler table is set to 1.
[0110]
Further, in step 92, for each of the changed assembler tables 31, in the C table 33 obtained from the corresponding C table (area 31-2), the number of changed cycles (area 33-10) and the total number of changed cycles (area 33-10) The area 33-13) is calculated. The difference c is calculated by the equations (19) and (20). To indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 33-11) and the total cycle change flag (area 33-14) of the C table is set to 1.
[0111]
In step 93, all the corresponding function hierarchy tables (areas 35-6 and thereafter, depending on the area 35-5) are obtained based on the number of corresponding function hierarchy tables (area 35-5) of the function table 35 to be changed. To calculate the total number of change cycles (area 31-11) of the assembler table 31 obtained from the call source assembler table (area 37-6) of each function hierarchy table 37 to indicate that the change has been made. The value held in the total cycle change flag (area 31-12) is set to 1. Further, based on the corresponding C table (area 31-2) of the changed assembler table 31, the total number of changed cycles of the corresponding C table 33 (area 33-13) is also calculated, and the total number of cycles is indicated to indicate that the change has been made. The value held by the cycle change flag (area 33-14) is set to 1. The operation of step 93 so far is performed recursively on the function hierarchy table 37 obtained from the parent function hierarchy table (area 37-4). The calculation uses the equations (21) and (22) based on the difference to the function table 35 which is the original target.
[0112]
Finally, in step 94, the number of single cycles to be changed (area 35-13) and the total number of cycles to be changed (area 35-16) of the function table 35 which is the original object are calculated by using equations (7) and (8). In order to calculate and indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 35-14) and the total cycle change flag (area 35-17) of the function table is set to 1. I do.
[0113]
FIG. 16 shows a flowchart of the FT change 44f. This process 44f automatically changes other corresponding information when the user changes the total number of cycles of another function displayed in the area 22d of the window 22, including the other function calls. First, in step 101, when the user changes the total number of cycles displayed in the area 22d, based on the number of corresponding function hierarchy tables (area 35-5), the number of corresponding function hierarchy elements is one or more. Find out what to do. If there are a plurality, the following corresponding function hierarchy check subroutine 45 and the operations of steps 102, 103, 104, 105 and 106 are performed. HT change 44d is called in order to change the cycle number according to the above.
[0114]
In step 101, if the number of the corresponding function hierarchy element is one, first, the difference f is calculated by calculating the difference single cycle number (area 35-13) with respect to the change total cycle number (area 35-16) of the target function table 35. The ratio is obtained from the original difference, and the information such as the corresponding function hierarchy table is changed by the corresponding function hierarchy check subroutine 45 using the difference f. Next, in step 102, the corresponding assembler table start point (area 35-3) and the corresponding assembler table end point (area 35-4) of the target function table 35 are obtained, and are arranged at addresses between the start point and the end point. Then, the number of individual cycles (area 31-8) and the total number of changed cycles (area 31-11) of all the assembler tables 31 are calculated. The difference g added to the cycle number at this time distributes the original difference f in accordance with the ratio of the change single cycle number (area 31-8) of the assembler table 31.
[0115]
Figure 2004234068
To indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 31-9) and the total cycle change flag (area 31-12) of the assembler table is set to 1.
[0116]
Further, in step 103, for each of the changed assembler tables 31, the number of individual cycles (area 33-10) and the total number of changed cycles (area 33-10) of the C table 33 obtained from the corresponding C table (area 31-2) The area 33-13) is calculated.
[0117]
Figure 2004234068
To indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 33-11) and the total cycle change flag (area 33-14) of the C table is set to 1.
[0118]
In step 104, all the corresponding function hierarchy tables (area 35-6 and subsequent areas, depending on the area 35-5) are obtained based on the number of corresponding function hierarchy tables (area 35-5) of the function table 35 to be changed. To calculate the total number of change cycles (area 31-11) of the assembler table 31 obtained from the call source assembler table (area 37-6) of each function hierarchy table 37 to indicate that the change has been made. The value held in the total cycle change flag (area 31-12) is set to 1. Further, based on the corresponding C table (area 31-2) of the changed assembler table 31, the total number of changed cycles of the corresponding C table 33 (area 33-13) is also calculated, and the total number of cycles is indicated to indicate that the change has been made. The value held by the cycle change flag (area 33-14) is set to 1. The operations in step 104 up to this point are performed recursively on the function hierarchy table 37 obtained from the parent function hierarchy table (area 37-4).
[0119]
Figure 2004234068
Next, in step 105, the number of single cycles of change (area 35-13) and the total number of changed cycles (area 35-16) of the function table 35 which is the original target are calculated, and the number of cycles is changed. In this case, the value held in the single cycle change flag (area 35-14) and the total cycle change flag (area 35-17) in the function table is set to 1.
[0120]
Figure 2004234068
In step 106, if there is a child function due to the target function calling another function based on the number of child function tables (area 35-8), the child function table (area 35-9 and subsequent areas, 35-8), the function table 35 corresponding to the child function is obtained, the object is switched to the function table 35 corresponding to the child function, and the corresponding function hierarchy check subroutine 45, steps 102, 103, 104 and 105 Repeat the operation.
[0121]
FIG. 17 shows a flowchart of the corresponding function hierarchy check subroutine 45 called from the change processes 44a to 44f. In this process 45, in step 111, based on the number of corresponding function hierarchy tables of the target function table 35 (area 35-5), all the corresponding function hierarchy tables (area 35-6 and thereafter, area 35-5) ), And using the difference h obtained by distributing the difference at the ratio of the number of changed single cycles (area 37-9) of all corresponding function hierarchy tables, the number of changed single cycles (area 37-9) and the total number of changed The number of cycles (region 37-12) is calculated.
[0122]
Figure 2004234068
Further, in order to indicate that the number of cycles has been changed, the value held in the single cycle change flag (area 37-10) and the total cycle change flag (area 37-13) of the function hierarchy table is set to 1.
[0123]
In step 112, the operation for obtaining the parent function hierarchy element of the caller is performed recursively by the parent function hierarchy table (area 37-4) of each corresponding function hierarchy table 37. If the parent function hierarchy table exists, In step 113, regarding the function hierarchy table 37 of all parent function hierarchy elements, the change total number of cycles (area 37-12) and the change of the corresponding function table 35 obtained from the corresponding function table (area 37-5) The difference h is added to the total number of cycles (area 35-16).
[0124]
Figure 2004234068
In order to indicate that the number of cycles has been changed, the values held by the total cycle change flag (area 37-13) of the function hierarchy table and the total cycle change flag (area 35-17) of the function table are changed. Set to 1.
[0125]
As described above, the profiler 4 of the present example uses the number of CPU clock cycles necessary for executing the source program 1 obtained by the operation simulator 4 on each line of hardware as profile information 5 as several pieces of profile information 5. Hold in units. That is, the assembler table 31 constituting the profile information 5 is a unit of one line of the assembly language, and the C table 33 is a unit of one line of the C language of the source program 1. An area for holding the number of cycles is provided. Therefore, these tables 31 and 33 can hold the number of cycles for each line in different languages.
[0126]
The function table 35 has an area for holding the number of CPU clock cycles required for execution on hardware in units of one function, and the function hierarchy table 37 has an area for holding in units of function hierarchy. Therefore, these tables 35 and 37 can hold the number of CPU clock cycles required for execution on hardware for each basic unit compiled according to the processing purpose. Further, each of the tables 31, 33, 35, and 37 has, in units of each table, an area for holding a numerical value that substitutes the cycle number of the unit.
[0127]
Therefore, in the virtual evaluation step 7, a part of the source program 1 is cut out in several units desired by the user, and is operated as different hardware or different software, so that the overall operation efficiency of the source program 1 is reduced. To improve, the CPU clock cycle value at any point can be virtually changed. Then, by displaying the changed cycle numerical value, it is possible to determine the cutout portion, cut out the optimum portion that can improve the performance the most, and use it as a dedicated processor, and design the optimum processor or LSI that is economical and has a high processing speed. be able to.
[0128]
In the above example, the source program is described in the C language and the assembly language as the description language, but the description language that can be evaluated by the profiler 4 is not limited to this, and the C ++ language, Java (registered trademark) ) Language may be used.
[0129]
As an example of a basic unit that compiles a computer program according to the processing purpose, a function and a function hierarchy are shown as an example. However, if a basic unit is a processing unit that is not divided and called, it is a function unit However, the present invention is not limited to this.
[0130]
Further, an assembler table 31 that holds the number of cycles in units of one line of assembly language, a C table 33 that holds the number of cycles in units of one line of C language, and a number of cycles that is held in units of one function The function table 35 and the function hierarchy table 37 that holds the number of cycles in units of function hierarchy are associated with each other so that the number of cycles can be converted. Then, the profiler 4 is changed when the CPU clock cycle numerical value at an arbitrary position in an arbitrary unit is virtually changed in an arbitrary unit in the process of changing the number of cycles for realizing the virtual evaluation function 7 (step 44). And a function 44a-44f for automatically changing the number of cycles of a corresponding location of another table which has a corresponding relationship with the selected location. Therefore, by changing the number of cycles in an arbitrary unit, the user can compare the number of cycles before the change of the source program 1 with the number of cycles after the change, and evaluate the suitability of the cutout portion. That is, in the profiler 4 of the present invention, it is possible to perform a virtual evaluation of a portion cut out from the source program 1 from a plurality of viewpoints, and it is possible to obtain an evaluation suitable for the purpose of the user.
[0131]
Further, the profiler 4 of this example is realized as a GUI program, displays the number of cycles in each unit through windows 21 to 26, and allows the user to arbitrarily change the number of cycles in each unit. The program for realizing the function as the profiler 4 is provided with an instruction capable of executing each processing of the program performance evaluation method of the present invention described with reference to the above-described flowchart on a computer having appropriate hardware resources. -It can be provided by being recorded on a suitable recording medium such as a ROM. Further, it can also be provided via a computer network such as the Internet. Then, by installing it on a computer having appropriate hardware resources, it can function as the profiler 4.
[Brief description of the drawings]
FIG. 1 is a diagram showing an initial state of a source program.
FIG. 2 is a diagram illustrating an outline of a VUPU processor.
FIG. 3 is a diagram showing a design in which a part of a source program is extracted and made into a dedicated processor.
FIG. 4 is a diagram showing a workflow of hardware design using a design method according to the present invention.
FIG. 5 is a view showing a window display when the profiler of the present invention is provided as a GUI program.
FIG. 6 is a view showing a window display different from the above when a profiler of the present invention is provided as a GUI program.
FIG. 7 is a diagram illustrating an information table used by the profiler, and is a diagram illustrating an assembler table and a C table.
FIG. 8 is a diagram illustrating an information table used by a profiler, and is a diagram illustrating a function table.
FIG. 9 is a diagram illustrating an information table used by the profiler, and is a diagram illustrating a function hierarchy table.
FIG. 10 is a flowchart showing the overall operation of the profiler.
FIG. 11 is a flowchart illustrating an ASM change process.
FIG. 12 is a flowchart showing a C change process.
FIG. 13 is a flowchart illustrating an HS change process.
FIG. 14 is a flowchart illustrating an HT change process.
FIG. 15 is a flowchart illustrating an FS change process.
FIG. 16 is a flowchart showing an FT change process.
FIG. 17 is a flowchart illustrating processing of a corresponding function hierarchy check sub-routine;
[Explanation of symbols]
1 computer program (source program)
4 Profiler
5 Profile information

Claims (11)

コンピュータ・プログラムを、そのコンピュータ・プログラムを構成する少なくとも1つの構成要素の各単位のハードウェア上での実行に必要な第1のサイクル数を保持する第1の記録領域に基づき前記コンピュータ・プログラムの未変更の総サイクル数を求める第1の工程と、
前記第1のサイクル数を代替する第2のサイクル数を保持する第2の記録領域に基づき、当該コンピュータ・プログラムの任意の箇所の前記第2のサイクル数を仮想的に変更した変更後の総サイクル数を求める第2の工程とを有するプログラム性能評価方法。
The computer program is executed based on a first recording area holding a first number of cycles required for execution of each unit of at least one component constituting the computer program on hardware. A first step of determining the total number of unchanged cycles;
Based on a second recording area holding a second cycle number that substitutes for the first cycle number, the changed total number of the second cycle number at any point in the computer program after the change is virtually changed A second step of calculating the number of cycles.
請求項1において、前記第1の工程では、第1の構成要素の前記第1の記録領域および第2の記録領域を備えた第1のテーブル、および第2の構成要素の前記第1の記録領域および第2の記録領域を備えた第2のテーブルのいずれかの前記第1の記録領域に基づき前記未変更の総サイクル数が求められ、
前記第2の工程では、前記第1および第2のテーブルのいずれかの前記第2の記録領域に基づき前記変更後の総サイクル数が求められるプログラム性能評価方法。
2. The method according to claim 1, wherein, in the first step, a first table including the first recording area and a second recording area of a first component, and the first recording of a second component. Determining the total number of unchanged cycles based on the first recording area of any of the second tables including the area and the second recording area;
In the second step, a program performance evaluation method wherein the total number of cycles after the change is obtained based on the second recording area of one of the first and second tables.
請求項2において、前記第1または第2のテーブルの一方のテーブルの前記第2の記録領域の前記第2のサイクル数を変更すると、他方のテーブルの対応関係にある前記第2の記録領域の前記第2のサイクル数を自動的に変更する工程を有するプログラム性能評価方法。3. The method according to claim 2, wherein when the second cycle number of the second recording area of one of the first or second tables is changed, the second cycle number of the second recording area corresponding to the other table is changed. A program performance evaluation method comprising a step of automatically changing the second cycle number. 請求項1において、前記構成要素は、前記コンピュータ・プログラムを記述する記述言語であり、前記第1および第2の記録領域には、その記述言語で記述した場合の各行単位のサイクル数が保持されるプログラム性能評価方法。2. The device according to claim 1, wherein the component is a description language that describes the computer program, and the first and second recording areas hold the number of cycles for each line when the description is made in the description language. Program performance evaluation method. 請求項1において、前記構成要素は、前記コンピュータ・プログラムを処理目的に応じてまとめた基本単位であり、前記第1および第2の記録領域には、その基本単位1つ毎のサイクル数が保持されるプログラム性能評価方法。2. The device according to claim 1, wherein the component is a basic unit in which the computer program is compiled according to a processing purpose, and the first and second recording areas hold the number of cycles for each basic unit. Program performance evaluation method used. コンピュータ・プログラムを、そのコンピュータ・プログラムを構成する少なくとも1つの構成要素の各単位のハードウェア上での実行に必要な第1のサイクル数を保持する第1の記録領域に基づき前記コンピュータ・プログラムの未変更の総サイクル数を求める第1の手段と、
前記第1のサイクル数を代替する第2のサイクル数を保持する第2の記録領域に基づき、当該コンピュータ・プログラムの任意の箇所の前記第2のサイクル数を仮想的に変更した変更後の総サイクル数を求める第2の手段とを有するプロファイラ。
The computer program is executed based on a first recording area holding a first number of cycles required for execution of each unit of at least one component constituting the computer program on hardware. A first means for determining the total number of unchanged cycles;
Based on a second recording area holding a second cycle number that substitutes for the first cycle number, the changed total number of the second cycle number at any point in the computer program after the change is virtually changed Second means for determining the number of cycles.
請求項6において、第1の構成要素の前記第1の記録領域および第2の記録領域を備えた第1のテーブルと、
第2の構成要素の前記第1の記録領域および第2の記録領域を備えた第2のテーブルとをさらに有し、
前記第1の手段は、前記第1および第2のテーブルのいずれかの前記第1の記録領域に基づき前記未変更の総サイクル数を求め、
前記第2の手段は、前記第1および第2のテーブルのいずれかの前記第2の記録領域に基づき前記変更後の総サイクル数を求めるプロファイラ。
7. A first table according to claim 6, comprising a first recording area and a second recording area of a first component,
A second table including a first recording area and a second recording area of a second component,
The first means obtains the total number of unchanged cycles based on the first recording area of one of the first and second tables,
The second means is a profiler that calculates the total number of cycles after the change based on the second recording area of one of the first and second tables.
請求項7において、前記第1または第2のテーブルの一方のテーブルの前記第2の記録領域の前記第2のサイクル数を変更すると、他方のテーブルの対応関係にある前記第2の記録領域の前記第2のサイクル数を自動的に変更する手段をさらに有するプロファイラ。8. The information processing apparatus according to claim 7, wherein when the second cycle number of the second recording area of one of the first and second tables is changed, the number of the second recording area corresponding to the other table is changed. A profiler further comprising means for automatically changing said second number of cycles. 請求項6において、前記構成要素は、前記コンピュータ・プログラムを記述する記述言語であり、前記第1および第2の記録領域には、その記述言語で記述した場合の各行単位のサイクル数が保持されるプロファイラ。7. The device according to claim 6, wherein the component is a description language that describes the computer program, and the first and second recording areas hold the number of cycles for each line when described in the description language. Profiler. 請求項6において、前記構成要素は、前記コンピュータ・プログラムを処理目的に応じてまとめた基本単位であり、前記第1および第2の記録領域には、その基本単位1つ毎のサイクル数が保持されるプロファイラ。7. The device according to claim 6, wherein the component is a basic unit in which the computer program is compiled according to a processing purpose, and the first and second recording areas hold the number of cycles for each basic unit. Profiler. コンピュータ・プログラムを、そのコンピュータ・プログラムを構成する少なくとも1つの構成要素の各単位のハードウェア上での実行に必要な第1のサイクル数を保持する第1の記録領域に基づき前記コンピュータ・プログラムの未変更の総サイクル数を求める第1の工程と、
前記第1のサイクル数を代替する第2のサイクル数を保持する第2の記録領域に基づき、当該コンピュータ・プログラムの任意の箇所の前記第2のサイクル数を仮想的に変更した変更後の総サイクル数を求める第2の工程とをコンピュータで実行可能にする命令を有するプログラム性能評価プログラム。
The computer program is executed based on a first recording area holding a first number of cycles required for execution of each unit of at least one component constituting the computer program on hardware. A first step of determining the total number of unchanged cycles;
Based on a second recording area holding a second cycle number that substitutes for the first cycle number, the changed total number of the second cycle number at any point in the computer program after the change is virtually changed A program performance evaluation program having instructions for enabling a computer to execute the second step of determining the number of cycles.
JP2003018560A 2003-01-28 2003-01-28 Program performance evaluation method and profiler Abandoned JP2004234068A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003018560A JP2004234068A (en) 2003-01-28 2003-01-28 Program performance evaluation method and profiler

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003018560A JP2004234068A (en) 2003-01-28 2003-01-28 Program performance evaluation method and profiler

Publications (1)

Publication Number Publication Date
JP2004234068A true JP2004234068A (en) 2004-08-19

Family

ID=32948655

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003018560A Abandoned JP2004234068A (en) 2003-01-28 2003-01-28 Program performance evaluation method and profiler

Country Status (1)

Country Link
JP (1) JP2004234068A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2006022204A1 (en) * 2004-08-23 2008-05-08 パシフィック・デザイン株式会社 Source program analysis apparatus and method
JP2012083804A (en) * 2010-10-06 2012-04-26 Fujitsu Ltd Simulation device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2006022204A1 (en) * 2004-08-23 2008-05-08 パシフィック・デザイン株式会社 Source program analysis apparatus and method
JP4866241B2 (en) * 2004-08-23 2012-02-01 株式会社ガイア・システム・ソリューション Source program analyzer
JP2012083804A (en) * 2010-10-06 2012-04-26 Fujitsu Ltd Simulation device

Similar Documents

Publication Publication Date Title
TWI453666B (en) Method and computer-readable storage medium for using collaborative development information in a team environment
WO2017159614A1 (en) Learning service provision device
US7729894B1 (en) Test postcondition items for automated analysis and test generation
JP6551715B2 (en) Expandable device
JP2005173788A (en) Autonomic computing system, execution environment control method, and program
JPWO2008038389A1 (en) Program performance analyzer
JPWO2017159638A1 (en) Capability grant data generator
JP2008517362A (en) Action on subject system
JP2011248918A (en) System and method for interactive wireless applications with conditional ui controls and screen navigation
US20200183658A1 (en) Identification and visualization of associations among code generated from a model and sources that affect code generation
Campos et al. GUIsurfer: A reverse engineering framework for user interface software
US7331039B1 (en) Method for graphically displaying hardware performance simulators
US8055598B1 (en) User configured optimizer
JP2004234068A (en) Program performance evaluation method and profiler
US7900191B1 (en) System and method of using an active link in a state programming environment to locate an element in a graphical programming environment
JP2008071075A (en) Program inspection device, program inspection method, and program inspection program
JP4660381B2 (en) Computer system performance evaluation apparatus, performance evaluation method, and performance evaluation program
JP2012068869A (en) Repeated symbolic execution method, program and device
Thüm et al. Performance analysis strategies for software variants and versions
CN115328772A (en) Learning method for excitation combination and module correlation and test script generation method
Tsai et al. Pewss: A platform of extensible workflow simulation service for workflow scheduling research
JP4673040B2 (en) Specification data generation method and apparatus
JP2007080049A (en) Built-in program generation method, built-in program development system and information table section
Koziolek et al. Empirical evaluation of model-based performance prediction methods in software development
WO2016001982A1 (en) Test data generation assistance device and test data generation assistance method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060123

A762 Written abandonment of application

Free format text: JAPANESE INTERMEDIATE CODE: A762

Effective date: 20060908