JP4297211B2 - Function simulation method of system composed of hardware and software - Google Patents
Function simulation method of system composed of hardware and software Download PDFInfo
- Publication number
- JP4297211B2 JP4297211B2 JP2002192372A JP2002192372A JP4297211B2 JP 4297211 B2 JP4297211 B2 JP 4297211B2 JP 2002192372 A JP2002192372 A JP 2002192372A JP 2002192372 A JP2002192372 A JP 2002192372A JP 4297211 B2 JP4297211 B2 JP 4297211B2
- Authority
- JP
- Japan
- Prior art keywords
- hardware
- function
- architecture
- class
- time
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Description
【0001】
本発明は、ハードウェアとソフトウェアとで構成されるシステムの機能シミュレーション方法に関する。
【0002】
【従来の技術】
例えばワンチップマイクロコンピュータに周辺半導体装置が接続されたシステムを機能設計しこれを評価する場合、従来では図6に示すような処理が行われていた。すなわち、ワンチップマイクロコンピュータのソフトウエアモデル10と周辺半導体装置のハードウエアモデル11とを別々にプログラムで作成し、シミュレータ12によりソフトウエアモデル10とハードウエアモデル11とを連動させ、その結果に基づいてシステムを評価し、リーズナブルでなければソフトウエアモデル10とハードウエアモデル11とを修正してシミュレーションを再度行なうという動作を繰り返していた。
【0003】
【発明が解決しようとする課題】
しかしながら、ソフトウエアモデル10とハードウエアモデル11とが別体であるため、これらの一方を修正するとそれに合わせて他方を修正しなければならず、煩雑であった。例えば製品価格を下げるためにハードウエアの一部をソフトウエアで置き換える場合、ハードウエアモデル11を修正し、これに合わせて、ソフトウエアモデル10を修正しなければならなかった。処理速度が仕様を満たさず、ソフトウエアの一部をハードウエアで置き換える場合についても同様であった。モデルに対しこのような修正が頻繁に行なわれるので、システムの開発期間が長くなる原因となっていた。
【0004】
本発明の目的は、このような問題点に鑑み、修正が容易な、ハードウェアとソフトウェアとで構成されるシステムの機能シミュレーション方法を提供することにある。
【0005】
【課題を解決するための手段及びその作用効果】
本発明による、機能シミュレーション対象の、ハードウェアとソフトウエアとで構成されるシステムモデルをコンピュータプログラムで作成する方法の一態様では、該コンピュータプログラムは、
演算子を多重定義する演算子関数と演算対象の変数とを含み該関数に所定時間を費やす演算コスト関数の呼び出しを含むアーキテクチャクラスを宣言し該演算子関数及び該演算コスト関数を定義するアーキテクチャ定義部と、
該クラスのオブジェクトを作成する宣言部と、
該システムの動作を表すためにオブジェクト間の演算を行う処理部と、
を有し、該所定時間はソフトウエア又はハードウエアの演算実行時間に相当し、該システムのアーキテクチャに応じて該所定時間が異なり、該システムのアーキテクチャ変更に対し該処理部の内容を変えずに該所定時間の値を変更する。
【0006】
この構成によれば、該システムモデルのシミュレーション結果に基づいてハードウエアの一部とソフトウエアの一部を一方から他方へ置き換えたり、ハードウエアの一部又は全部の処理速度を変更したりするアーキテクチャ変更に対し、該処理部の内容を変えずに該所定時間の値を変更すればよいので、該システムモデルの修正が容易である。
【0007】
本発明による機能シミュレーション対象モデル作成方法の他の態様では、該システムのアーキテクチャに応じて該所定時間が互いに異なる該クラスを同一演算子に対し複数有し、
該システムのアーキテクチャ変更に対し該処理部の内容を変えずに該宣言部の記述を変更する。
【0008】
この構成によれば、該宣言部の記述を変更することにより処理部での処理時間を変更することができるので、該システムモデルを容易に修正することが可能となる。
【0009】
本発明による機能シミュレーション対象モデル作成方法のさらに他の態様では、該アーキテクチャ定義部はさらに、該演算コスト関数を含む基本クラスの宣言と、該所定時間を定めるために該基本クラスに対し該演算コスト関数を上書きする、該所定時間の値毎の派生クラスの宣言とを含み、
アーキテクチャに応じた所定時間をもつ演算コスト関数の呼び出しを行うオブジェクトが該宣言部で作成されるように派生クラスのオブジェクトを指定する呼び出し関数指定部をさらに有する。
【0010】
この構成によれば、1つのクラスを複数の処理時間に対応させることができるので、アーキテクチャ定義部の構成が簡単になる。
【0011】
本発明の他の目的、構成及び効果は以下の説明から明らかになる。
【0012】
【発明の実施の形態】
以下、図面を参照して本発明の一実施形態を説明する。
【0013】
図2は、機能設計対象の、ハードウエアとソフトウエアとからなるシステムの構成例を示す概略ブロック図である。
【0014】
このシステムは、ワンチップマイクロコンピュータ20と、その周辺装置とで構成されている。ワンチップマイクロコンピュータ20は、MPU21にメモリ22、I/Oインタフェース23及び24がバスで接続されている。I/Oインタフェース23にはハードウエアブロック25〜28が接続され、I/Oインタフェース24にはハードウエアブロック29が接続されている。
【0015】
各ハードウエアブロックは、機能ブロックであり、ハードウエアブロックによる処理とソフトウエアによる処理との違いは、処理時間のみである。
【0016】
このシステムの開発において、機能モデルを作成し、その評価のためにシミュレーションを行なう場合、ワンチップマイクロコンピュータ20のモデルは、処理時間を考慮した、メモリ22に格納されるプログラムで表される。ハードウエアブロック25〜29も同様に、処理時間を考慮した、それぞれの機能を果たすプログラムで表される。
【0017】
したがって、システム全体のモデルを1つのプログラムで表してこのプログラムを動作させることにより、シミュレーションを行うことができる。この場合、プログラム中の各処理部はモデル構成部分のハーウエア構成の違いによる実行時間を考慮する必要がある。シミュレーション結果に基づきハードウエアの一部を省略してソフトウエアでその機能を実現したり、逆に、ソフトウエアの一部をハードウエアで置き換えたり、ハードウエアの処理速度を変更したりするする場合には、ソフトウエア又はハードウエアの処理速度に応じて、処理に必要なプログラム実行時間を変更すればよい。並列処理は、ソフトウエアとハードウエアによる処理を区別せずに、マルチタスク処理で表すことができる。マルチタスク処理は、例えば、マルチスレッド方式により実行される。
【0018】
しかしながら、ワンチップマイクロコンピュータ20による処理とハードウエアブロック25〜29による処理とが混在しているので、プログラムの各部で処理時間を考慮しなければならず、また、モデルの一部修正に対しプログラム全体にわたって処理時間を変更しなければならない。そこで、処理時間の表現方法を工夫して煩雑さを避ける必要がある。
【0019】
図1は、本発明の原理構成を示すブロック図である。
【0020】
プログラムで作成された上述のシステムモデル13は、シミュレータ12Aにより動作され、その結果に基づいてシステムを評価し、リーズナブルでなければシステムモデル13を修正してシミュレーションを行なうという動作を繰り返し行う。
【0021】
システムモデル13は、そのアーキテクチャの各要素を抽象的に定義するアーキテクチャ定義ファイル30と、これを具体化すると共にモデルの動作を表すソースコードファイル31とからなる。以下においては、プログラム言語がC++である場合について説明する。
【0022】
アーキテクチャ定義ファイル30は、クラスの宣言と、クラスのメンバー関数の定義とからなる。ソースコードファイル31は、クラスのオブジェクトを作成するオブジェクト作成部32と、作成されたオブジェクトに対して処理を行なうデータ処理部33とからなる。
【0023】
図3は、アーキテクチャ定義ファイル30及びソースコードファイル31のより具体的な構成例を示す。
【0024】
アーキテクチャ定義ファイル30は、アーキテクチャ定義部301〜304を備えている。アーキテクチャ定義部301は、32ビット整数の加算と、その実行に要する時間とを定義するものであり、クラスInt32の宣言と、このクラスのメンバー関数である‘+’演算子関数の定義とからなる。この関数内では、他の関数spend_time(10)を呼び出している。
【0025】
spend_time(10)は、シミュレータ12Aに対し長さ10の時間(時間10)だけ費やす関数であり、この時間はシミュレーションにおける加算実行時間である。加算自体の演算時間は、シミュレータ12Aにより0とみなされる。この点は、関数spend_time以外の他の処理についても同様である。時間の単位は、シミュレータ12Aがシステムモデル13を動作させる単位であり、マルチスレッド方式によるマルチタスクにおいて、各タスクを単位時間だけ動作させた後に、シミュレーション時間を1だけインクリメントするという処理が繰り返される。
【0026】
クラスInt32の宣言の具体例は、次の通りである。
ソースコードファイル31のクラスInt32のオブジェクト作成部321では、クラスInt32のオブジェクトを作成する。クラスInt32のオブジェクト作成部321は、例えば
Int32 d, e, f;
と記述される。これにより、クラスInt32のオブジェクトd、e及びfが作成される。
【0027】
データ処理部331は作成されたオブジェクトに対するデータ処理であり、例えば
d = e + f;
と記述される。
【0028】
この加算を実行すると、クラスInt32の定義部301により通常の加算が行なわれ、さらにspend_time(10)が読み出されるので、これをハードウエアブロックまたはソフトウエアによる加算時間に対応させることができる。
【0029】
オブジェクト作成後は、どの箇所で該オブジェクトに対し加算演算を行なってもspend_time(10)が実行され、ソースコードファイル31に関数spend_timeを直接記述する必要がない。また、シミュレーション結果に基づいて上述のように処理をハードウエアの一部とソフトウエアの一部を一方から他方へ置き換えたり、ハードウエアの一部又は全部の処理速度を変更したりする場合には、関数spend_time(x)の引数値xを変えるだけでよい。したがって、モデルの作成及び修正が容易になる。
【0030】
同様に、アーキテクチャ定義部302は、64ビット整数の加算と、その実行に要する時間とを定義するものであり、クラスInt64の宣言と、このクラスのメンバー関数である‘+’演算子関数の定義とからなる。この関数内では、関数spend_time(20)を呼び出している。
【0031】
この引数値がアーキテクチャ定義部301のそれと異なるので、アーキテクチャ定義部302をアーキテクチャ定義部301とは異なるハードウエアブロックの処理に対応させることができる。また、クラスInt32のオブジェクト作成部321を、クラスInt64のオブジェクト作成部に変更すれば、データ処理部331での処理時間が変わる。したがって、オブジェクト作成部を変更するだけでモデルを容易に修正することが可能となる。
【0032】
上記同様に、アーキテクチャ定義部303は、32ビット浮動小数点数の乗算とその実行に要する時間とを定義するものであり、アーキテクチャ定義部304は、64ビット浮動小数点数の乗算とその実行に要する時間とを定義するものである。
【0033】
図3ではクラスInt32のオブジェクト作成部321とクラスFlt32のオブジェクト作成部322とを分離して記述しているが、両オブジェクト作成部を纏めて1ヵ所に記述してもよいことは勿論である。
【0034】
図3の例では、加算演算に対し異なる引数値xのspend_time(x)を対応させるために、引数値xの数だけ同様のクラスを宣言しそのメンバ関数を定義しなければならない。
【0035】
次に、図4を参照して、1つのクラスInt32の宣言で複数の引数値xのspend_time(x)を間接的かつ選択的に呼び出す場合を説明する。
【0036】
この場合、クラスInt32とは別に、引数値xの異なるspend_time(x)を呼び出す複数のクラスを宣言しておき、これらのクラスの1つをポインタで指定することにより、1つのクラスInt32の定義で複数の引数値xのspend_time(x)を間接的かつ選択的に呼び出す。
【0037】
アーキテクチャ定義ファイル30Aのアーキテクチャ定義部301Aにおいて、クラスInt32が宣言され、‘+’演算子関数が定義され、この関数内でポインタを使って基本クラスArcのメンバ関数f()を呼び出している。f()=0の‘=0’は仮想関数であることを示している。この関数内には、関数spend_time(x)の呼び出しは無く、基本クラスArcに対する派生クラスArc1及びArc2の各々において、互いに異なる引数値xをもつspend_time(x)を呼び出している。
【0038】
ソースコードファイル31Aの派生クラス指定・オブジェクト作成部321Aにおいて、基本クラスArcの静的メンバであるポインタに派生クラスArc2のアドレスを格納することにより派生クラスArc2を指定し、クラスInt32のオブジェクトを作成する。これにより、ソースコードファイル31Aのデータ処理部331での加算において、spend_time(40)が実行される。
【0039】
アーキテクチャ定義部301Aの具体例は次の通りである。
上記関数Int32_Add_Cost()は、図4中の関数f()に対応している。
【0040】
基本クラスArcの宣言部41の具体例は次の通りである。
上記具体例において、std::map< Task*, Arch* > task_arch_mapは、Taskクラスあるいはその派生クラスオブジェクトへのポインタと、Archクラスあるいはその派生クラスオブジェクトへのポインタとの関連を格納するテーブルであり、各タスクがある時点で利用しているアーキテクチャを記録する。
【0041】
task_arch_map(Task::crnt_task()) = archは、これを実行しているタスクをスレッド管理機能から入手し、そのタスクとarchで示すアーキテクチャとの関連をテーブルに格納することを意味している。
【0042】
派生クラスArc1の宣言部42及び派生クラスArc2の宣言部43の具体例は次の通りである。
クラスInt32のオブジェクト作成部321の具体例は次の通りである。
データ処理部331の具体例は次の通りである。
【0043】
d = e + f;
次に、他の具体例を説明する。
【0044】
以上の例を拡張して、データ処理部33に演算式を記述するだけで、データを受信し演算する処理又はデータを演算しその結果を転送する処理、例えば図2のハードウエアブロック26と27との間、ハードウエアブロック25と28の間、又は、ハードウエアブロック25と29との間で所定量のデータを送受しその後で演算を行う処理を表すことができる。この場合、演算子関数において、どのハードウエアブロック間であるかにより異なるデータ送受時間に対応したspend_time(x)を呼び出す。引数値xは、予め設定しておいたArch間の関連から得るためのテーブルに格納している。以下にその具体例を示す。
【0045】
アーキテクチャ定義ファイル301Aのクラス宣言部の具体例は次の通りである。
上記具体例において、‘=’演算子関数operator=は、左辺値の存在するArchを最新のArchに設定することを意味している。これにより、=の左辺のオブジェクトが、それを呼び出したアーキテクチャに設定される。
【0046】
std::map< Arch*, int > transfer_cost_tableは、各アーキテクチャ(ハードウエアブロック)毎に持っている、他アーキテクチャとの間の通信コスト(通信時間)を格納するテーブルであり、Archクラスあるいはその派生クラスオブジェクトへのポインタを与えることで通信コストを得ることができる。
【0047】
transfer_cost_table[a] = cは、各アーキテクチャ毎に持っている、他アーキテクチャとの間の通信コスト(通信時間)格納テーブルに対し、アーキテクチャaとの通信コストがcであることを設定している。
【0048】
crnt_arch()は、Archクラスの静的メンバ関数であり、それを呼び出したタスクをスレッド管理機能から得、それとArchクラスの静的メンバであるtask_arch_mapとから、呼び出したタスクがその時点で利用しているアーキテクチャを得るために用いる。
【0049】
データ処理部331の具体例は次の通りである。
上記具体例において、B.Set_Trans_Cost(&A, 100)は、通信コストテーブルに、アーキテクチャBのアーキテクチャAとの通信コストが100であることを設定している。
【0050】
次に、システムモデル13の評価方法について説明する。
【0051】
システムモデル13には、互いに並列処理されるタスクが記述されており、シミュレータ12Aはこれに基づいてマルチタスクを実行するシミュレーションを行う。モデルのソースコードファイル31において、各ハードウエアブロックの動作開始及び終了時点でそのブロック名をメモリに格納しておき、シミュレーション終了後にこれを読み出すことにより図5に示すような並列処理結果が得られる。
【0052】
図5中のA〜Cは、図2中のハードウエアブロックに記載した記号であり、例えばブロックAの矩形はブロックAの動作期間を示している。ブロックA〜Cの同時刻最大使用数はそれぞれ2、2及び1であり、ブロックのA〜Cのハードウエア価格をそれぞれ例えば100、2000及び10とすると、周辺装置の価格見積値は100×2+2000×2+10×1=4210となる。この価格と、処理時間25の要求値に対する%とから、システムの構成がリーズナブルであるかどうかを評価することができる。
【0053】
また、ブロックA〜Cの使用電力をそれぞれ例えば10W、200W及び1Wとすると、システムの最大使用電力見積値は400Wとなり、これと、処理時間25の要求値に対する%とから、システムの構成がリーズナブルであるかどうかを評価することができる。最大使用電力の替わりに、平均電力を用いてもよい。
【0054】
以上の説明から明らかなように、本発明には以下の付記が含まれる。
【0055】
(付記1)機能シミュレーション対象の、ハードウェアとソフトウエアとで構成されるシステムモデルをコンピュータプログラムで作成する方法であって、該コンピュータプログラムは、
演算子を多重定義する演算子関数と演算対象の変数とを含み該関数に所定時間を費やす演算コスト関数の呼び出しを含むアーキテクチャクラスを宣言し該演算子関数及び該演算コスト関数を定義するアーキテクチャ定義部と、
該クラスのオブジェクトを作成する宣言部と、
該システムの動作を表すためにオブジェクト間の演算を行う処理部と、
を有し、該所定時間はソフトウエア又はハードウエアの演算実行時間に相当し、該システムのアーキテクチャに応じて該所定時間が異なり、該システムのアーキテクチャ変更に対し該処理部の内容を変えずに該所定時間の値を変更することを特徴とする機能シミュレーション対象モデル作成方法。(1)
(付記2)該システムのアーキテクチャに応じて該所定時間が互いに異なる該クラスを同一演算子に対し複数有し、
該システムのアーキテクチャ変更に対し該処理部の内容を変えずに該宣言部の記述を変更することを特徴とする付記1記載の機能シミュレーション対象モデル作成方法。(2)
(付記3)該アーキテクチャ定義部はさらに、該演算コスト関数を含む基本クラスの宣言と、該所定時間を定めるために該基本クラスに対し該演算コスト関数を上書きする、該所定時間の値毎の派生クラスの宣言とを含み、
アーキテクチャに応じた所定時間をもつ演算コスト関数の呼び出しを行うオブジェクトが該宣言部で作成されるように派生クラスのオブジェクトを指定する呼び出し関数指定部をさらに有することを特徴とする付記1記載の機能シミュレーション対象モデル作成方法。(3)
(付記4)該アーキテクチャクラスはさらに、データ転送時間に対応した所定時間を費やす転送コスト関数の呼び出しを含み、
該オブジェクトの間の演算を、データを受信して演算し又はデータを演算して送信する動作に対応させることを特徴とする付記1乃至3のいずれか1つに記載の機能シミュレーション対象モデル作成方法。(4)
(付記5)該プログラムの言語はC++であることを特徴とする付記1乃至4のいずれか1つに記載の機能シミュレーション対象モデル作成方法。
【0056】
(付記6)該コンピュータプログラムは、並列処理される複数のタスクを有することを特徴とする付記1乃至5のいずれか1つに記載の機能シミュレーション対象モデル作成方法。
【0057】
(付記7)各タスクは、使用中のハードウエア構成ブロックの種別を示すデータを出力するコードを含むことを特徴とする付記6記載の機能シミュレーション対象モデル作成方法。
【0058】
(付記8)(a)付記7記載の方法で作成された該システムモデルをシミュレータで所定期間動作させ、動作中に出力される、該使用中のハードウエア構成ブロックの種別を示すデータを記憶装置に格納しておき、
(b)該所定期間経過後に該データを該記憶装置から読み出して、各時刻で使用中のハードウエア構成ブロックの種別と数を求め、
(c)該種別と数とに基づいて該アーキテクチャを評価することを特徴とする機能シミュレーション対象モデル評価方法。(5)
(付記9)該ステップ(c)では、同時に使用される同種ハードウエア構成ブロックの最大個数を求め、ハードウエア構成ブロックの種別毎の価格と該種別のハードウエア構成ブロックの同時使用最大個数との積の総和を該システムのハードウェア価格と見積もることを特徴とする付記8記載の機能シミュレーション対象モデル評価方法。
【0059】
(付記10)該記憶装置には、ハードウエア構成ブロックの種別毎の消費電力値が格納されており、
該ステップ(c)では、各時刻で使用されているハードウエア構成ブロックの種別と個数と消費電力値とに基づいて該ハードウェアの消費電力を評価値として見積もることを特徴とする付記8記載の機能シミュレーション対象モデル評価方法。
【図面の簡単な説明】
【図1】本発明の、機能設計されたハードウエアとソフトウエアとからなるシステムモデルの評価説明図である。
【図2】該ハードウエアとソフトウエアとからなるシステムの構成例を示す概略ブロック図である。
【図3】アーキテクチャ定義ファイル及びソースコードファイルのより具体的な構成例を示す図である。
【図4】演算子関数を含む1つのクラスで複数の引数値xの関数spend_time(x)を間接的かつ選択的に呼び出す場合を説明する図である。
【図5】マルチタスク実行結果に対するモデル評価説明図である。
【図6】従来の、機能設計されたハードウエアとソフトウエアとからなるシステムモデルの評価説明図である。
【符号の説明】
10 ソフトウエアモデル
11 ハードウエアモデル
12、12A シミュレータ
13 システムモデル
20 ワンチップマイクロコンピュータ
21 MPU
22 メモリ
23、24 I/Oインタフェース
25〜29 ハードウエアブロック
30、30A アーキテクチャ定義ファイル
31、31A ソースコードファイル
32 オブジェクト作成部
33 データ処理部
301、301A クラスInt32の定義部
302 クラスInt64の定義部
303 クラスFlt32の定義部
304 クラスFlt64の定義部
321 クラスInt32のオブジェクト作成部
321A 派生クラス指定及びクラスInt32のオブジェクト作成部
322 クラスFlt32のオブジェクト作成部
331、332 データ処理部
41 基本クラスArcの定義部
42 派生クラスArc1の定義部
43 派生クラスArc2の定義部[0001]
The present invention relates to a function simulation how the system consisting of hardware and software.
[0002]
[Prior art]
For example, when functionally designing and evaluating a system in which a peripheral semiconductor device is connected to a one-chip microcomputer, processing as shown in FIG. 6 has been conventionally performed. That is, the
[0003]
[Problems to be solved by the invention]
However, since the
[0004]
SUMMARY OF THE INVENTION In view of such problems, correction is easy to provide a functional simulation how the system composed of hardware and software.
[0005]
[Means for solving the problems and their effects]
In one aspect of the method of creating a system model composed of hardware and software, which is a function simulation target, according to the present invention, the computer program includes:
An architecture definition that declares an architecture class that includes an operator function that overloads an operator and a variable to be operated and includes a call to an operation cost function that spends a predetermined time on the function, and defines the operator function and the operation cost function And
A declaration part for creating an object of the class;
A processing unit that performs operations between objects to represent the operation of the system;
The predetermined time corresponds to an operation execution time of software or hardware, the predetermined time varies depending on the architecture of the system, and the contents of the processing unit are not changed in response to a change in the architecture of the system. The value of the predetermined time is changed.
[0006]
According to this configuration, an architecture that replaces part of the hardware and part of the software from one to the other based on the simulation result of the system model, or changes the processing speed of part or all of the hardware. In response to the change, the value of the predetermined time may be changed without changing the contents of the processing unit, so that the correction of the system model is easy.
[0007]
In another aspect of the function simulation target model creation method according to the present invention, a plurality of the classes having the predetermined times different from each other according to the architecture of the system are provided for the same operator.
The description of the declaration unit is changed without changing the contents of the processing unit in response to a change in the architecture of the system.
[0008]
According to this configuration, since the processing time in the processing unit can be changed by changing the description of the declaration unit, the system model can be easily corrected.
[0009]
In still another aspect of the method for creating a functional simulation target model according to the present invention, the architecture definition unit further includes a declaration of a basic class including the calculation cost function and the calculation cost for the basic class to determine the predetermined time. Including a declaration of a derived class for each value of the predetermined time, overwriting the function,
It further has a calling function specifying unit that specifies an object of a derived class so that an object that calls an operation cost function having a predetermined time according to the architecture is created in the declaration unit.
[0010]
According to this configuration, one class can correspond to a plurality of processing times, so that the configuration of the architecture definition unit is simplified.
[0011]
Other objects, configurations and effects of the present invention will become apparent from the following description.
[0012]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
[0013]
FIG. 2 is a schematic block diagram illustrating a configuration example of a system including hardware and software, which is a function design target.
[0014]
This system is composed of a one-
[0015]
Each hardware block is a functional block, and the difference between the processing by the hardware block and the processing by the software is only the processing time.
[0016]
In the development of this system, when a functional model is created and simulation is performed for the evaluation, the model of the one-
[0017]
Therefore, a simulation can be performed by representing a model of the entire system as one program and operating the program. In this case, each processing unit in the program needs to consider the execution time due to the difference in the hardware configuration of the model component. When a part of the hardware is omitted based on the simulation result and the function is realized by software, or conversely, a part of the software is replaced by hardware or the processing speed of the hardware is changed In this case, the program execution time required for processing may be changed according to the processing speed of software or hardware. Parallel processing can be represented by multitask processing without distinguishing between processing by software and hardware. The multitask process is executed by, for example, a multithread method.
[0018]
However, since the processing by the one-
[0019]
FIG. 1 is a block diagram showing the principle configuration of the present invention.
[0020]
The above-described
[0021]
The
[0022]
The
[0023]
FIG. 3 shows a more specific configuration example of the
[0024]
The
[0025]
The send_time (10) is a function that spends a time of 10 length (time 10) for the
[0026]
A specific example of the declaration of class Int32 is as follows.
The
Int32 d, e, f;
Is described. As a result, objects d, e, and f of class Int32 are created.
[0027]
The
d = e + f;
Is described.
[0028]
When this addition is executed, normal addition is performed by the definition unit 301 of the class Int32, and the send_time (10) is read out. This can correspond to the addition time by the hardware block or software.
[0029]
After the object is created, the send_time (10) is executed no matter where the addition operation is performed on the object, and it is not necessary to directly describe the function send_time in the
[0030]
Similarly, the
[0031]
Since this argument value is different from that of the architecture definition unit 301, the
[0032]
Similarly to the above, the architecture definition unit 303 defines the multiplication of 32-bit floating point numbers and the time required for execution thereof, and the
[0033]
In FIG. 3, the
[0034]
In the example of FIG. 3, in order to associate a send_time (x) of different argument values x with the addition operation, the same class as the number of argument values x must be declared and its member function must be defined.
[0035]
Next, with reference to FIG. 4, a case will be described in which send_time (x) of a plurality of argument values x is indirectly and selectively called with a declaration of one class Int32.
[0036]
In this case, apart from the class Int32, a plurality of classes that call the send_time (x) having different argument values x are declared, and one of these classes is designated by a pointer, thereby defining one class Int32. Calls send_time (x) of multiple argument values x indirectly and selectively.
[0037]
In the
[0038]
In the derived class designation / object creation unit 321A of the source code file 31A, the derived class Arc2 is designated by storing the address of the derived class Arc2 in the pointer that is a static member of the base class Arc, and an object of the class Int32 is created. . As a result, the send_time (40) is executed in the addition of the source code file 31A by the
[0039]
A specific example of the
The function Int32_Add_Cost () corresponds to the function f () in FIG.
[0040]
A specific example of the
In the above example, std :: map <Task *, Arch *> task_arch_map is a table that stores the association between the pointer to the Task class or its derived class object and the pointer to the Arch class or its derived class object. Record the architecture that each task uses at a certain point.
[0041]
task_arch_map (Task :: crnt_task ()) = arch means that the task executing this is obtained from the thread management function, and the relationship between the task and the architecture indicated by arch is stored in the table.
[0042]
Specific examples of the
A specific example of the
A specific example of the
[0043]
d = e + f;
Next, another specific example will be described.
[0044]
Extending the above example, simply writing an arithmetic expression in the
[0045]
A specific example of the class declaration part of the
In the above specific example, the '=' operator function operator = means that the Arch having the left-side value is set to the latest Arch. This sets the object on the left side of = to the architecture that called it.
[0046]
std :: map <Arch *, int> transfer_cost_table is a table that stores the communication cost (communication time) with other architectures for each architecture (hardware block). Arch class or its derivatives The communication cost can be obtained by giving a pointer to the class object.
[0047]
transfer_cost_table [a] = c sets that the communication cost with the architecture a is c with respect to the communication cost (communication time) storage table with each other architecture for each architecture.
[0048]
crnt_arch () is a static member function of the Arch class, and the task that called it is obtained from the thread management function, and the called task is used at that point from task_arch_map, which is the static member of the Arch class. Used to obtain the architecture
[0049]
A specific example of the
In the above specific example, B.Set_Trans_Cost (& A, 100) sets that the communication cost of the architecture B with the architecture A is 100 in the communication cost table.
[0050]
Next, a method for evaluating the
[0051]
The
[0052]
A to C in FIG. 5 are symbols described in the hardware block in FIG. 2. For example, a rectangle of the block A indicates an operation period of the block A. The maximum number of blocks A to C used at the same time is 2, 2 and 1, respectively. If the hardware prices of the blocks A to C are 100, 2000 and 10, for example, the estimated price of the peripheral device is 100 × 2 + 2000. × 2 + 10 × 1 = 4210. Whether the system configuration is reasonable can be evaluated from this price and the% of the required
[0053]
Further, assuming that the power consumption of the blocks A to C is 10 W, 200 W, and 1 W, respectively, the estimated maximum power consumption of the system is 400 W, and the system configuration is reasonable because of the percentage of the required value for the
[0054]
As is clear from the above description, the present invention includes the following supplementary notes.
[0055]
(Supplementary note 1) A method of creating a system model composed of hardware and software, which is a target of functional simulation, using a computer program,
An architecture definition that declares an architecture class that includes an operator function that overloads an operator and a variable to be operated and includes a call to an operation cost function that spends a predetermined time on the function, and defines the operator function and the operation cost function And
A declaration part for creating an object of the class;
A processing unit that performs operations between objects to represent the operation of the system;
The predetermined time corresponds to an operation execution time of software or hardware, the predetermined time varies depending on the architecture of the system, and the contents of the processing unit are not changed in response to a change in the architecture of the system. A function simulation target model creation method, wherein the value of the predetermined time is changed. (1)
(Supplementary note 2) A plurality of the classes having the predetermined times different from each other according to the architecture of the system for the same operator,
The function simulation target model creation method according to appendix 1, wherein the description of the declaration unit is changed without changing the contents of the processing unit in response to the architecture change of the system. (2)
(Supplementary Note 3) The architecture definition unit further declares a basic class including the calculation cost function, and overwrites the calculation cost function with respect to the basic class to determine the predetermined time. Including declarations of derived classes,
The function according to supplementary note 1, further comprising a call function specifying unit that specifies an object of a derived class so that an object that calls an operation cost function having a predetermined time according to the architecture is created in the declaration unit Simulation target model creation method. (3)
(Supplementary note 4) The architecture class further includes a call to a transfer cost function that spends a predetermined time corresponding to the data transfer time,
The function simulation target model creation method according to any one of appendices 1 to 3, wherein the computation between the objects corresponds to an operation of receiving and calculating data or calculating and transmitting data . (4)
(Supplementary note 5) The function simulation target model creation method according to any one of supplementary notes 1 to 4, wherein the language of the program is C ++.
[0056]
(Supplementary note 6) The function simulation target model creation method according to any one of supplementary notes 1 to 5, wherein the computer program has a plurality of tasks to be processed in parallel.
[0057]
(Additional remark 7) Each task contains the code | cord | chord which outputs the data which show the classification of the hardware structural block in use, The function simulation object model preparation method of Additional remark 6 characterized by the above-mentioned.
[0058]
(Supplementary Note 8) (a) The system model created by the method described in Supplementary Note 7 is operated for a predetermined period by a simulator, and data indicating the type of hardware configuration block in use, which is output during the operation, is stored. Stored in the
(B) After the predetermined period has elapsed, the data is read from the storage device, and the type and number of hardware constituent blocks in use at each time are obtained.
(C) A function simulation target model evaluation method characterized by evaluating the architecture based on the type and number. (5)
(Supplementary Note 9) In the step (c), the maximum number of the same type of hardware configuration blocks used at the same time is obtained, and the price for each type of hardware configuration block and the maximum number of simultaneous use of the hardware configuration block of the type are calculated. 9. The function simulation target model evaluation method according to appendix 8, wherein a sum of products is estimated as a hardware price of the system.
[0059]
(Supplementary Note 10) The storage device stores a power consumption value for each type of hardware configuration block.
9. In the step (c), the power consumption of the hardware is estimated as an evaluation value based on the type and number of hardware configuration blocks used at each time and the power consumption value. Function simulation target model evaluation method.
[Brief description of the drawings]
FIG. 1 is an evaluation explanatory view of a system model composed of hardware and software whose functions are designed according to the present invention.
FIG. 2 is a schematic block diagram illustrating a configuration example of a system including the hardware and software.
FIG. 3 is a diagram illustrating a more specific configuration example of an architecture definition file and a source code file.
FIG. 4 is a diagram for explaining a case where a function send_time (x) of a plurality of argument values x is indirectly and selectively called in one class including an operator function.
FIG. 5 is an explanatory diagram of model evaluation for a multitask execution result.
FIG. 6 is an evaluation explanatory diagram of a conventional system model composed of hardware and software whose functions are designed.
[Explanation of symbols]
10 Software Model 11
22
Claims (6)
該コンピュータが、
(a)クラスのオブジェクトを作成し、オブジェクト間の演算を行うことにより、該システムモデルを動作させ、各ブロックの動作開始及び終了時点で、ハードウェアを構成する該ブロックの種別及び経過時間を示すデータを記憶装置に格納し、
(b)シミュレーション実行後に該データを該記憶装置から読み出し、
(c)読み出されたデータに基づいて該アーキテクチャを評価し、その結果を出力し、
該ステップ(a)において、該システムモデルをマルチスレッドで動作させることにより、ハードウェアを構成する複数のブロックを並列動作させ又はハードウェアを構成するブロックとソフトウェアとを並列動作させることを特徴とする機能シミュレーション方法。A function simulation method for causing a computer to operate a system model composed of hardware and software described in a computer program, the computer program comprising an operator function overloading an operator and a variable to be operated on And a plurality of architecture classes including a call to an operation cost function that consumes a predetermined time in the operator function, and the predetermined time corresponds to an operation execution time of a block or software constituting the hardware,
The computer
(A) Create an object of the class, by performing calculation between objects, to operate the system model, in the operation start and end of each block, indicating the type and age of the blocks constituting the hardware Store the data in a storage device,
(B) Read the data from the storage device after the simulation is executed,
(C) evaluating the architecture based on the read data and outputting the result;
In the step (a), by operating the system model in multithread, a plurality of blocks constituting the hardware are operated in parallel, or the blocks constituting the hardware and the software are operated in parallel. Function simulation method.
該ステップ(c)では、各時刻で使用されているハードウェア構成ブロックの種別と個数と消費電力値とに基づいて該ハードウェアの消費電力を評価値として見積もることを特徴とする請求項1記載の機能シミュレーション方法。The storage device stores a power consumption value for each type of hardware configuration block,
In the step (c), according to claim 1, wherein the power estimation of the hardware as an evaluation value based on the power consumption value and type and number of the hardware building blocks used at each time Function simulation method.
アーキテクチャ変更に対応して該所定時間を変更することを特徴とする請求項1乃至3のいずれかに記載の機能シミュレーション方法。According to the architecture of the hardware building block of the system model, the predetermined time has a plurality of classes different for the same operator,
4. The function simulation method according to claim 1, wherein the predetermined time is changed in response to an architecture change .
該ステップ(a)において、該複数の派生クラスのうち1つを指定してそのオブジェクトを作成することにより、アーキテクチャに応じた所定時間をもつ演算コスト関数の呼び出しを行うことを特徴とする請求項1記載の機能シミュレーション方法。The plurality of architecture classes include a base class including the operation cost function and a plurality of derived classes having different predetermined times from each other, overwriting the operation cost function with respect to the base class to determine the predetermined time. ,
The operation cost function having a predetermined time corresponding to the architecture is called by designating one of the plurality of derived classes and creating the object in the step (a). The function simulation method according to 1.
該オブジェクトの間の演算を、データを受信して演算し又はデータを演算して送信する動作に対応させることを特徴とする請求項1乃至5のいずれか1つに記載の機能シミュレーション方法。The architecture class further includes a call to a transfer cost function that spends a predetermined time corresponding to the data transfer time;
6. The function simulation method according to claim 1, wherein the calculation between the objects corresponds to an operation of receiving and calculating data or calculating and transmitting data.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002192372A JP4297211B2 (en) | 2002-07-01 | 2002-07-01 | Function simulation method of system composed of hardware and software |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002192372A JP4297211B2 (en) | 2002-07-01 | 2002-07-01 | Function simulation method of system composed of hardware and software |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2004038390A JP2004038390A (en) | 2004-02-05 |
| JP4297211B2 true JP4297211B2 (en) | 2009-07-15 |
Family
ID=31701664
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2002192372A Expired - Fee Related JP4297211B2 (en) | 2002-07-01 | 2002-07-01 | Function simulation method of system composed of hardware and software |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4297211B2 (en) |
-
2002
- 2002-07-01 JP JP2002192372A patent/JP4297211B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2004038390A (en) | 2004-02-05 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5867726A (en) | Microcomputer | |
| US5182811A (en) | Exception, interrupt, and trap handling apparatus which fetches addressing and context data using a single instruction following an interrupt | |
| US5201039A (en) | Multiple address-space data processor with addressable register and context switching | |
| JP4050764B2 (en) | Compilation system | |
| RU2193228C2 (en) | Addressing registers in data processing device | |
| WO2006041993A1 (en) | Application program interface for multi-pass shaders | |
| EP2439635A2 (en) | System and method for fast branching using a programmable branch table | |
| Agner | Optimizing software in C++: An optimization guide for Windows, Linux and Mac platforms | |
| US20120011490A1 (en) | Development system | |
| JPH01161442A (en) | Register save and recovery system | |
| EP1143333A2 (en) | Microprocessor for supporting reduction of program codes in size | |
| CN112306539A (en) | Method, system, terminal and medium for developing application layer of single chip microcomputer | |
| US9830172B2 (en) | Implementing functional kernels using compiled code modules | |
| JPH081604B2 (en) | Microprocessor | |
| JP4297211B2 (en) | Function simulation method of system composed of hardware and software | |
| JP3727395B2 (en) | Microcomputer | |
| JP5082797B2 (en) | Software partial test system | |
| US7107435B2 (en) | System and method for using hardware assist functions to process multiple arbitrary sized data elements in a register | |
| JPH0528431B2 (en) | ||
| JPH03208187A (en) | Interface for graphic processor sub- system | |
| JP4898365B2 (en) | Embedded program development apparatus and program automatic generation method | |
| JP3841820B2 (en) | Microcomputer | |
| US11327758B2 (en) | Non-transitory computer-readable recording medium, assembly instruction conversion method and information processing apparatus | |
| JP3733137B2 (en) | Microcomputer | |
| US20070055847A1 (en) | Operational processor with a status information register serving as a data register |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20050627 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20080208 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20080219 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20080414 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20080701 |
|
| A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20080728 |
|
| A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20081118 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20081218 |
|
| A911 | Transfer to examiner for re-examination before appeal (zenchi) |
Free format text: JAPANESE INTERMEDIATE CODE: A911 Effective date: 20090128 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20090303 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20090309 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20090407 |
|
| R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120424 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120424 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120424 Year of fee payment: 3 |
|
| S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
| S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120424 Year of fee payment: 3 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130424 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130424 Year of fee payment: 4 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140424 Year of fee payment: 5 |
|
| S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313111 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| LAPS | Cancellation because of no payment of annual fees |