JP6933001B2 - Parallelization method, parallelization tool - Google Patents
Parallelization method, parallelization tool Download PDFInfo
- Publication number
- JP6933001B2 JP6933001B2 JP2017109497A JP2017109497A JP6933001B2 JP 6933001 B2 JP6933001 B2 JP 6933001B2 JP 2017109497 A JP2017109497 A JP 2017109497A JP 2017109497 A JP2017109497 A JP 2017109497A JP 6933001 B2 JP6933001 B2 JP 6933001B2
- Authority
- JP
- Japan
- Prior art keywords
- dependency
- processing
- core
- function
- information
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims description 101
- 238000012545 processing Methods 0.000 claims description 286
- 230000006870 function Effects 0.000 claims description 144
- 238000013519 translation Methods 0.000 claims description 12
- 238000012986 modification Methods 0.000 description 35
- 230000004048 modification Effects 0.000 description 35
- 238000010586 diagram Methods 0.000 description 14
- 239000000284 extract Substances 0.000 description 14
- 230000000694 effects Effects 0.000 description 12
- 238000004891 communication Methods 0.000 description 4
- 238000011161 development Methods 0.000 description 2
- 238000005352 clarification Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Landscapes
- Devices For Executing Special Programs (AREA)
Description
本発明は、シングルコアマイコン用のシングルプログラムから、マルチコアマイコン用の並列プログラムを生成する並列化方法、並列化ツール、及び並列化方法で生成された並列プログラムを実装した車載装置に関する。 The present invention relates to a parallelization method for generating a parallel program for a multi-core microcomputer from a single program for a single-core microcomputer, a parallelization tool, and an in-vehicle device equipped with a parallel program generated by the parallelization method.
従来、シングルコアマイコン用のシングルプログラムから、マルチコアマイコン用の並列プログラムを生成する並列化方法の一例として特許文献1に開示された並列化コンパイル方法がある。
Conventionally, there is a parallel compilation method disclosed in
この並列化コンパイル方法では、シングルプログラムのソースコードを字句解析や構文解析を行って中間言語を生成し、この中間言語を用いて、複数のマクロタスク(以下、処理MT)の依存関係の解析や最適化等を行う。また、並列化コンパイル方法では、各処理MTの依存関係や処理MT毎の実行時間を基にスケジューリングを行って並列プログラムを生成する。 In this parallel compilation method, the source code of a single program is lexically analyzed and parsed to generate an intermediate language, and the intermediate language is used to analyze the dependencies of multiple macro tasks (hereinafter referred to as processing MT). Perform optimization, etc. Further, in the parallel compilation method, a parallel program is generated by scheduling based on the dependency of each processing MT and the execution time of each processing MT.
しかしながら、シングルプログラムの処理MTや関数である処理単位には、依存関係の解析が不能な処理単位である不能処理も含まれている。マルチコアマイコンは、この不能処理を並列実行した場合、適切に動作できない可能性がある。このため、並列化コンパイル方法では、不能処理を並列化できない。 However, the processing MT of a single program and the processing unit that is a function also include impossible processing that is a processing unit that cannot analyze the dependency. A multi-core microcomputer may not operate properly if this impossible process is executed in parallel. Therefore, the parallel compilation method cannot parallelize impossible processing.
本発明は、上記問題点に鑑みなされたものであり、より多くの処理単位が並列化された並列プログラムを作成できる並列化方法、並列化ツール、及びより多くの処理単位が並列化された並列プログラムを実行可能な車載装置を提供することを目的とする。 The present invention has been made in view of the above problems, and is a parallelization method capable of creating a parallel program in which more processing units are parallelized, a parallelization tool, and parallelism in which more processing units are parallelized. An object of the present invention is to provide an in-vehicle device capable of executing a program.
上記目的を達成するために本開示の一つは、
コアが一つであるシングルコアマイコン用のシングルプログラムにおける複数の処理単位の依存関係を解析して、シングルプログラムから複数のコア(21c、21d)を有するマルチコアマイコン(21)用の並列プログラム(21a1)を生成する並列化方法であって、
複数の処理単位における依存関係の解析が不能な不能処理に対する、依存関係を判断するための依存関係情報を取得する取得手順(10a)と、
複数の処理単位における依存関係の解析が可能な可能処理に関して、依存関係を解析する解析手順(10b)と、
取得手順で取得した依存関係情報と、解析手順で解析した解析結果とに基づいて、不能処理と可能処理を、依存関係を満たしつつ各コアに割り当てる割り当て手順(10d)と、を備え、
処理単位は、関数であり、
割り当て手順は、関数を少なくとも一つ含むコア配置単位毎に、依存関係を満たしつつ各コアに割り当てるものであり、
上位の関数である上位関数と上位関数にコールされる下位の関数である下位関数とを含むコア配置単位の依存関係情報は、コア配置単位に含まれている最上位の上位関数の情報としてマージされている。
To achieve the above objectives, one of the present disclosures is
A parallel program (21a1) for a multi-core microcomputer (21) having a plurality of cores (21c, 21d) from a single program is analyzed by analyzing the dependency of a plurality of processing units in a single program for a single-core microcomputer having one core. ) Is a parallelization method that generates
The acquisition procedure (10a) for acquiring the dependency information for determining the dependency for the impossible process for which the dependency cannot be analyzed in a plurality of processing units, and the acquisition procedure (10a).
It is possible to analyze dependencies in multiple processing units. Analysis procedure (10b) for analyzing dependencies and analysis procedure (10b) for processing that can be analyzed.
Based on the dependency information acquired in the acquisition procedure and the analysis result analyzed in the analysis procedure, an allocation procedure (10d) for allocating impossible processing and possible processing to each core while satisfying the dependency is provided .
The processing unit is a function
The allocation procedure is to allocate to each core while satisfying the dependency for each core placement unit including at least one function.
The dependency information of the core placement unit including the upper function which is the upper function and the lower function which is the lower function called by the upper function is merged as the information of the uppermost upper function included in the core arrangement unit. Has been done.
このように、並列化方法では、依存関係の解析が不能な不能処理であっても、不能処理の依存関係を判断するための依存関係情報を取得できる。そして、並列化方法では、依存関係情報と、可能処理における解析結果とに基づいて、不能処理と可能処理とを各コアに割り当てる。このため、並列化方法では、可能処理に加えて、不能処理も並列化できる。従って、並列化方法では、より多くの処理単位が並列化された並列プログラムを作成できる。 In this way, in the parallelization method, even if the dependency cannot be analyzed, the dependency information for determining the dependency of the impossible process can be acquired. Then, in the parallelization method, impossible processing and possible processing are assigned to each core based on the dependency information and the analysis result in the possible processing. Therefore, in the parallelization method, not only possible processing but also impossible processing can be parallelized. Therefore, in the parallelization method, it is possible to create a parallel program in which more processing units are parallelized.
本開示の他の一つは、
コアが一つであるシングルコアマイコン用のシングルプログラムにおける複数の処理単位の依存関係を解析して、シングルプログラムから複数のコア(21c、21d)を有するマルチコアマイコン(21)用の並列プログラム(21a1)を生成する、コンピュータを含む並列化ツールであって、
複数の処理単位における依存関係の解析が不能な不能処理に対する、依存関係を判断するための依存関係情報を取得する取得部(10a)と、
複数の処理単位における依存関係の解析が可能な可能処理に関して、依存関係を解析する解析部(10b)と、
取得部で取得した依存関係情報と、解析部で解析した解析結果とに基づいて、不能処理と可能処理を、依存関係を満たしつつ各コアに割り当てる割り当て部(10d)と、を備え、
処理単位は、関数であり、
割り当て部は、関数を少なくとも一つ含むコア配置単位毎に、依存関係を満たしつつ各コアに割り当てるものであり、
上位の関数である上位関数と上位関数にコールされる下位の関数である下位関数とを含むコア配置単位の依存関係情報は、コア配置単位に含まれている最上位の上位関数の情報としてマージされている。
The other one of this disclosure is
A parallel program (21a1) for a multi-core microcomputer (21) having a plurality of cores (21c, 21d) from a single program is analyzed by analyzing the dependency of a plurality of processing units in a single program for a single-core microcomputer having one core. ), A parallelization tool that includes a computer,
An acquisition unit (10a) for acquiring dependency information for determining a dependency for an impossible process for which it is impossible to analyze the dependency in a plurality of processing units.
It is possible to analyze the dependency relationship in multiple processing units. Regarding the processing, the analysis unit (10b) that analyzes the dependency relationship and
It is provided with an allocation unit (10d) that allocates impossible processing and possible processing to each core while satisfying the dependency relationship based on the dependency information acquired by the acquisition unit and the analysis result analyzed by the analysis unit.
The processing unit is a function
The allocation unit is assigned to each core while satisfying the dependency for each core placement unit including at least one function.
The dependency information of the core placement unit including the upper function which is the upper function and the lower function which is the lower function called by the upper function is merged as the information of the uppermost upper function included in the core arrangement unit. Has been done.
このように、並列化ツールでは、上記並列化方法と同様に、より多くの処理単位が並列化された並列プログラムを作成できる。 In this way, the parallelization tool can create a parallel program in which more processing units are parallelized, similar to the above parallelization method.
なお、特許請求の範囲、及びこの項に記載した括弧内の符号は、一つの態様として後述する実施形態に記載の具体的手段との対応関係を示すものであって、発明の技術的範囲を限定するものではない。 The scope of claims and the reference numerals in parentheses described in this section indicate, as one embodiment, the correspondence with the specific means described in the embodiments described later, and define the technical scope of the invention. It is not limited.
以下において、図面を参照しながら、発明を実施するための複数の形態を説明する。各形態において、先行する形態で説明した事項に対応する部分には同一の参照符号を付して重複する説明を省略する場合がある。各形態において、構成の一部のみを説明している場合は、構成の他の部分については先行して説明した他の形態を参照し適用することができる。 Hereinafter, a plurality of modes for carrying out the invention will be described with reference to the drawings. In each form, the same reference numerals may be given to the parts corresponding to the matters described in the preceding forms, and duplicate explanations may be omitted. In each form, when only a part of the configuration is described, the other parts of the configuration can be applied with reference to the other forms described above.
本実施形態では、コアが一つであるシングルコアマイコン用のシングルプログラムにおける複数の処理単位から第1コア21cと第2コア21dを有するマルチコアプロセッサ21用に並列化した並列プログラム21a1を生成する例を採用する。なお、プロセッサは、マイコンと言い換えることができる。よって、マルチコアプロセッサは、マルチコアマイコンと言い換えることができる。
In the present embodiment, an example of generating a parallel program 21a1 parallelized for a
上記処理単位とは、各コアに割り振る際の最小単位であるコア配置単位や、関数である。コア配置単位は、処理ブロックやマクロタスクや処理MTなどと言い換えることができる。これらの処理単位の関係は、コア配置単位≧関数である。つまり、関数は、コア配置単位自体である場合や、コア配置単位に含まれる親関数やサブ関数の場合がある。なお、本実施形態では、処理単位として処理MTを採用する。 The processing unit is a core placement unit or a function, which is the minimum unit when allocating to each core. The core placement unit can be rephrased as a processing block, a macro task, a processing MT, or the like. The relationship between these processing units is core placement unit ≥ function. That is, the function may be the core placement unit itself, or may be a parent function or a subfunction included in the core placement unit. In this embodiment, the processing MT is adopted as the processing unit.
このように、並列プログラム21a1を生成する背景としては、プロセッサの発熱量増大や消費電力増加、クロック周波数の限界問題から、マルチコアプロセッサ21が主流になることなどがあげられる。そして、マルチコアプロセッサ21は、車載装置の分野においても適用が必要となっている。また、並列プログラム21a1としては、ソフトの開発期間や開発費を抑えつつ、信頼性が高く高速に処理の実行が可能なものが求められる。
As described above, the background for generating the parallel program 21a1 is that the
ここで、図1を用いて、コンピュータ10の構成に関して説明する。コンピュータ10は、並列化方法を実行する並列化ツールに相当し、並列プログラム21a1を生成する。コンピュータ10は、ディスプレイ11、HDD12、CPU13、ROM14、RAM15、入力装置16、読取部17などを備えて構成されている。また、コンピュータ10は、記憶媒体18に記憶された記憶内容を読み取り可能に構成されている。この記憶媒体18には、自動並列化コンパイラ1が記憶されている。
Here, the configuration of the
コンピュータ10及び記憶媒体18の構成は、特開2015−1807号公報に記載されたパーソナルコンピュータ100及び記憶媒体180を参照されたい。なお、自動並列化コンパイラ1は、特開2015−1807号公報に記載されたものに加えて、図3に示すように、読み取り部10aなどを含んでいる。この読み取り部10aに関しては、後程説明する。
For the configurations of the
自動並列化コンパイラ1は、並列プログラム21a1を生成するための手順を含んでいる。よって、自動並列化コンパイラ1は、並列化方法に相当する。つまり、自動並列化コンパイラ1は、並列化方法を含むプログラムである。コンピュータ10は、自動並列化コンパイラ1を実行することで、並列プログラム21a1を生成する。
The
例えば、コンピュータ10は、C言語で記述されたソースコードであるシングルプログラムから、C言語で記述されたソースコードである並列プログラム21a1を生成する。しかしながら、本発明は、これに限定されない。シングルプログラムは、C言語とは異なるプログラミング言語で記述されていてもよい。同様に、並列プログラム21a1は、C言語とは異なるプログラミング言語で記述されていてもよい。
For example, the
なお、並列プログラム21a1を生成する際には、シングルプログラムにおける複数の処理MTの依存関係を解析して、複数の処理MTをマルチコアプロセッサ21の異なるコア21c、21dに割り振る。言い換えると、シングルコアマイコン用に記述されたプログラムを解析し、マルチコアマイコン用に並列化可能な処理MTを並列化したソフトウェアを生成する。割り振ることは、配置するや、割り当てるや、割り付けると言い替えることもできる。
When the parallel program 21a1 is generated, the dependencies of the plurality of processing MTs in the single program are analyzed, and the plurality of processing MTs are allocated to the
割り当てる際には、複数の処理MTの依存関係を維持しつつ、複数の処理MTの夫々を第1コア21cと第2コア21dとに割り当てる。この点に関しては、特開2015−1807号公報を参照されたい。
When allocating, each of the plurality of processing MTs is assigned to the
依存関係とは、例えば、ある処理MTが、自身よりも先に実行された処理MTで更新されたデータを参照するなどの関係である。つまり、複数の処理MTは、シングルプログラムにおける実行順序が先である先行処理と、先行処理の実行が完了した後に実行させる後行処理とを含んでいる。そして、後行処理は、先行処理の影響を受ける処理MTであり、例えば、先行処理で内容が更新される可能性があるデータなどを用いる処理MTである。さらに詳述するならば、先行処理も後行処理もデータを参照するだけの場合、2つの処理順序を入れ替えても処理結果が変わらず、このような場合には依存関係はないと言える。 The dependency relationship is, for example, a relationship in which a certain processing MT refers to data updated by a processing MT executed before itself. That is, the plurality of processing MTs include a predecessor process in which the execution order in the single program is first, and a subsequent process to be executed after the execution of the predecessor process is completed. The subsequent processing is a processing MT that is affected by the preceding processing, and is, for example, a processing MT that uses data whose contents may be updated in the preceding processing. More specifically, when both the preceding processing and the succeeding processing only refer to the data, the processing result does not change even if the two processing orders are exchanged, and it can be said that there is no dependency in such a case.
しかしながら、シングルプログラムには、依存関係の解析が不能もしくは困難な処理MTである不能処理も含まれている。また、依存関係の解析が不能もしくは困難とは、後程説明するコンピュータ10における依存関係解析部10bでの依存関係の解析が不能もしくは困難であることを意味している。この不能処理には、例えばポインタ関連の処理MTがある。理由は、変数の値推測(動作推測)を伴わないと完全に解析不可能なためである。しかしながら、不能処理は、ポインタ関連の処理MTに限定されない。なお、シングルプログラムの処理MTのうち、依存関係解析部10bでの依存関係の解析が可能な処理MTは、可能処理と称する。
However, the single program also includes impossible processing, which is a processing MT in which dependency analysis is impossible or difficult. Further, the fact that the dependency analysis is impossible or difficult means that the dependency analysis by the
このように、不能処理は、依存関係解析部10bによる依存関係の解析ができないため、並列化できない。不能処理が並列化できない場合、並列プログラム21a1は、シングルプログラムにおける可能処理のみが並列化されたものとなる。可能処理のみが並列化された並列プログラム21a1は、可能処理と不能処理とが並列化された場合よりも、第1コア21cと第2コア21dとによって並列実行できる処理MTが少なくなる。よって、可能処理のみが並列化された並列プログラム21a1は、可能処理と不能処理とが並列化された場合よりも、効率よく第1コア21cと第2コア21dを動作させることができない。そこで、コンピュータ10は、不能処理における依存関係を示す依存関係情報30を用いて、不能処理に関しても依存関係を判断する。この依存関係情報30に関しては、後程説明する。
As described above, the impossible processing cannot be parallelized because the
コンピュータ10は、図3に示すように、機能ブロックとして、上記読み取り部10aや依存関係解析部10bに加えて、処理時間解析部10c、コア割付部10d、スケジューリング部1eを備えている。なお、図示や説明は省略するが、コンピュータ10は、周知の字句解析部などを備えて構成されている。
As shown in FIG. 3, the
読み取り部10aは、不能処理における依存関係を判断するために、依存関係情報30を読み取る。つまり、コンピュータ10は、依存関係情報30が入力される。読み取り部10aは、特許請求の範囲の取得部に相当する。なお、コンピュータ10は、自動並列化コンパイラ1を実行することで依存関係情報30を読み取る。このため、読み取り部10aは、特許請求の範囲の取得手順にも相当するとみなせる。
The
依存関係情報30は、上記のように不能処理における依存関係を判断するための情報であり、例えばシングルプログラムを設計する際に用いられた情報の一部である。よって、依存関係情報30は、設計情報と言い換えることもできる。
The
特に、本実施形態の依存関係情報30は、不能処理と依存関係がある処理MTを示す情報である。言い換えると、依存関係情報30は、依存関係解析部10bでは依存関係の解析ができないが、実際は依存関係がある複数の処理MTに関して、依存関係があることを示す情報である。つまり、本実施形態の依存関係情報30は、不能処理と、その不能処理と依存関係がある処理MTとが直接的に紐付けられている。よって、依存関係情報30は、直接型情報30と言い換えることもできる。
In particular, the
直接型情報30は、例えば、不能処理と依存関係がある処理MTの名称を含んでいる。つまり、直接型情報30は、不能処理の名称と、不能処理と依存関係がある処理MTの名称とを含んでおり、依存関係がある処理MTどうしの名称が紐付けされている。
The
なお、不能処理の名称と、不能処理と依存関係がある処理MTの名称とが紐付けられた各情報は、リストと称することができる。よって、依存関係情報30は、不能処理毎のリストを含んでいると言える。そして、依存関係情報30は、依存関係情報30を読み取る際に、不能処理に対応したリストを読み取る。つまり、依存関係情報30は、複数のリストを含む依存関係情報30から、対象の不能処理のリストを読み取る。
Each information in which the name of the impossible process and the name of the process MT having a dependency relationship with the impossible process are associated with each other can be referred to as a list. Therefore, it can be said that the
ここで、図5に示す例を用いて説明する。第1処理MTは、変数V1にWrite(書き込み)する。第2処理MTは、0x000000AAにRead(読出し)する。そして、変数V1と0x000000AAとが同じデータである。この場合、第1処理MTと第2処理MTは、依存関係がある。しかしながら、依存関係解析部10bでは、変数V1と0x000000AAとが同じデータであるか否かを判定できない。この場合の直接型情報30は、第1処理MTの名称と、第2処理MTの名称とが紐付けられている。このため、コンピュータ10は、直接型情報30を用いることで、第1処理MTと第2処理MTとに依存関係があると判定できる。
Here, it will be described with reference to the example shown in FIG. The first processing MT writes to the variable V1. The second processing MT reads to 0x000000AA. And the variable V1 and 0x000000AA are the same data. In this case, the first processing MT and the second processing MT have a dependency relationship. However, the
依存関係解析部10bは、可能処理に関して、依存関係を解析する。言い換えると、依存関係解析部10bは、可能処理の依存関係を解析することで、可能処理における依存関係を判断するための情報を抽出する。なお、依存関係解析部10bは、周知技術である。このため、依存関係解析部10bの詳しい説明は、省略する。この依存関係解析部10bは、特許請求の範囲の解析部に相当する。なお、コンピュータ10は、自動並列化コンパイラ1を実行することで依存関係を解析する。このため、依存関係解析部10bは、特許請求の範囲の解析手順にも相当するとみなせる。
The
コア割付部10dは、読み取り部10aで取得した依存関係情報30と、依存関係解析部10bで解析した解析結果とに基づいて、不能処理と可能処理を、依存関係を満たしつつ各コア21c、21dに割り当てる。上記のように、コンピュータ10は、依存関係情報30を取得するため、不能処理に関しても依存関係を判断できる。よって、コア割付部10dは、可能処理だけではなく、不能処理に関しても、各コア21c、21dに割り当てることができる。
The
このコア割付部10dは、特許請求の範囲の割り当て部に相当する。なお、コンピュータ10は、自動並列化コンパイラ1を実行することで、各処理MTを各コアへ割り当てる。このため、コア割付部10dは、特許請求の範囲の割り当て手順にも相当するとみなせる。
The
なお、処理時間解析部10c及びスケジューリング部10eは、周知技術である。このため、処理時間解析部10c及びスケジューリング部10eに関する詳しい説明は、省略する。
The processing
次に、図4を用いて、コンピュータ10が自動並列化コンパイラ1を実行した際の処理動作に関して説明する。コンピュータ10は、自動並列化コンパイラ1を実行することで並列プログラム21a1を生成する。なお、図4の各ステップは、自動並列化コンパイラ1における手順に相当するとみなすこともできる。
Next, with reference to FIG. 4, the processing operation when the
ステップS10では、未解析の処理MTをサーチする。コンピュータ10は、シングルプログラムにおける複数の処理MTの夫々を対象として、個別に図4の処理を実行する。つまり、コンピュータ10は、ステップS10において、シングルプログラムにおける複数の処理MTのうち、ステップS12以降の処理を行っていない処理MTをサーチする。言い換えると、コンピュータ10は、シングルプログラムにおける複数の処理MTから、ステップS12以降の処理を行っていない処理MTを抽出する。
In step S10, the unanalyzed processed MT is searched. The
なお、今回のステップS10で抽出された不能処理は、対象MTとも称する。例えば、第1処理MT、第2処理MT、第n処理MTを含むシングルプログラムにおいて、今回のステップS10で第2処理MTが抽出された場合、対象MTは第2処理MTである。nは3以上の自然数である。 The impossible process extracted in step S10 this time is also referred to as a target MT. For example, in a single program including the first processed MT, the second processed MT, and the nth processed MT, when the second processed MT is extracted in step S10 this time, the target MT is the second processed MT. n is a natural number of 3 or more.
ステップS12では、依存関係情報(直接型情報30)に対象MTがあるか否かを判定する。コンピュータ10は、ステップS10で抽出した対象MTに紐付けられた処理MTが、直接型情報30に含まれているか否かを判定する。コンピュータ10は、直接型情報30に対象MTが含まれていると判定した場合はステップS16へ進み、直接型情報30に対象MTが含まれていると判定した場合はステップS14へ進む。
In step S12, it is determined whether or not there is a target MT in the dependency information (direct type information 30). The
ステップS14では、対象MT内のコードを解析して依存関係を抽出する。つまり、コンピュータ10の依存関係解析部10bは、周知のように各対象MTの依存関係を抽出する。言い換えると、コンピュータ10の依存関係解析部10bは、ステップS14において、各対象MTにおける依存関係を判断するための情報、すなわち、アクセス先のリソースとリソースに対する処理内容を抽出する。そして、コンピュータ10の依存関係解析部10bは、対象MTと依存関係がある処理MTを抽出する。
In step S14, the code in the target MT is analyzed to extract the dependency. That is, the
なお、アクセス先のリソースとは、処理MTが実行された際にコアによってアクセスされるリソースである。また、リソースに対する処理内容とは、リソースに対する書き込み、又は読出しである。さらに、リソースとは、データやレジスタや順序制約を含む。そして、処理単位におけるアクセス先のリソースと、処理単位のリソースに対する処理内容とが紐付けられた情報は、リソースアクセス情報とも言える。 The access destination resource is a resource accessed by the core when the processing MT is executed. The processing content for the resource is writing or reading for the resource. In addition, resources include data, registers, and order constraints. Then, the information in which the access destination resource in the processing unit and the processing content for the resource in the processing unit are associated with each other can be said to be resource access information.
一方、ステップS16では、直接型情報30に基づいて対象MTの依存関係とする。つまり、コンピュータ10は、直接型情報30で対象MTに紐付けされた処理MTを対象MTの依存関係とする。言い換えると、コンピュータ10は、対象MTに対して、直接型情報30で対象MTに紐付けされた処理MTを依存関係がある処理MTとする。
On the other hand, in step S16, the dependency relationship of the target MT is set based on the
コンピュータ10は、ステップS10〜S16を繰り返し実行することで、シングルプログラムにおける全ての処理MTを対象として図4のフローチャートを実行する。そして、コンピュータ10は、依存関係情報と、依存関係解析部10bで解析した解析結果とに基づいて、不能処理と可能処理を、依存関係を満たしつつ各コアに割り当てる。
By repeatedly executing steps S10 to S16, the
なお、並列プログラム21a1は、依存関係がある二つの処理MTが別々のコア21c、21dに配置されることもある。よって、並列プログラム21a1は、依存関係がある二つの処理MTが別々のコア21c、21dに配置される場合、他コアに割り振られた処理順序が先の処理MTの実行が完了するのを待って、処理順序が後の処理MTを実行する同期処理を含んでいる。つまり、並列プログラム21a1は、自コアに割り振られた処理MTの実行が完了した場合に、他コアに割り振られた処理MTの実行が完了するのを待って、自コアに割り振られた次の処理MTを実行させる同期処理を含んでいる。そして、ここでの他コアに割り振られた処理MTは、自コアに割り振られた次の処理MTと依存関係があり、自コアに割り振られた次の処理MTよりも実行順序が先である。
In the parallel program 21a1, two processing MTs having a dependency relationship may be arranged in
このため、第1コア21cと第2コア21dは、同期処理を行うために、自身に割り振られた処理MTの実行が完了した場合、RAM21bにアクセスして、同期待ちであることを示す情報(以下、完了情報)をRAM21bに記憶する。そして、他コアにおける依存関係がある処理MTの実行完了を待っている自コアは、処理MTを実行することなく、定期的にRAM21bにアクセスして、RAM21bに完了情報が記憶されているか否かを確認する。つまり、他コアにおける依存関係がある処理MTの実行完了を待っている自コアは、非動作中に定期的に動作して、RAM21bにアクセスし、完了情報が記憶されているか否かを確認する。このように、第1コア21cと第2コア21dは、お互いに待合せをしながら、言い換えると同期を取りながら、処理MTの実行を行う。よって、同期処理は、待合わせ処理と言うこともできる。なお、並列プログラム21a1は、第1コア21cが実行するプログラムと、第2コア21dが実行するプログラムとを含んでいる。
Therefore, when the execution of the processing MT assigned to the
次に、車載装置20の構成に関して説明する。車載装置20は、図2に示すように、マルチコアプロセッサ21、通信部22、センサ部23、入出力ポート24を備えて構成されている。また、マルチコアプロセッサ21は、ROM21a、RAM21b、第1コア21c、第2コア21dを備えて構成されている。車載装置20は、例えば、自動車に搭載されたエンジン制御装置やハイブリッド制御装置などに適用できる。ここでは、一例として、車載装置20をエンジン制御装置に適用した例を採用する。この場合、並列プログラム21a1は、エンジン制御などの自動車制御プログラムと言える。しかしながら、並列プログラム21a1は、これに限定されない。なお、コアは、プロセッサエレメントとも称することができる。
Next, the configuration of the in-
第1コア21cと第2コア21dは、並列プログラム21a1を実行することで、エンジン制御を行う。詳述すると、第1コア21cと第2コア21dは、並列プログラム21a1のうち自身に割り当てられた処理MTを実行するとともに待合せ処理などを実行することでエンジン制御を行う。RAM21b、通信部22、センサ部23、入出力ポート24は、特開2015−1807号公報に記載されたRAM420、通信部430、センサ部450、入出力ポート460を参照されたい。
The
以上のように、コンピュータ10では、依存関係の解析が不能な不能処理であっても、不能処理の依存関係を示す直接型情報30を取得できる。そして、コンピュータ10では、直接型情報30と、可能処理における解析結果とに基づいて、不能処理と可能処理とを各コア21c、21dに割り当てる。このため、コンピュータ10では、可能処理に加えて、不能処理も並列化できる。従って、コンピュータ10では、より多くの処理MTが並列化された並列プログラム21a1を作成できる。つまり、コンピュータ10は、可能処理だけが並列化された並列プログラムよりも、多くの処理MTが並列化された並列プログラム21a1を作成できる。
As described above, the
なお、コンピュータ10は、自動並列化コンパイラ1を実行することで依存関係を解析する。このため、自動並列化コンパイラ1は、コンピュータ10と同様の効果を奏することができる。
The
さらに、車載装置20は、より多くの処理MTが並列化された並列プログラム21a1を含んでいる。このため、車載装置20は、各処理MTを最適に実行できる。つまり、車載装置20は、並列プログラム21a1を含んでいるため、第1コア21cと第2コア21dを有効に活用できると言える。言い換えると、車載装置20は、可能処理だけが並列化された並列プログラムを含んでいる場合よりも、第1コア21cと第2コア21dを備えたマルチコアプロセッサ21の性能を発揮しやすい。
Further, the in-
以上、本発明の好ましい実施形態について説明した。しかしながら、本発明は、上記実施形態に何ら制限されることはなく、本発明の趣旨を逸脱しない範囲において、種々の変形が可能である。以下に、本発明のその他の形態として、変形例1〜5に関して説明する。上記実施形態及び変形例1〜5は、夫々単独で実施することも可能であるが、適宜組み合わせて実施することも可能である。本発明は、実施形態において示された組み合わせに限定されることなく、種々の組み合わせによって実施可能である。
The preferred embodiment of the present invention has been described above. However, the present invention is not limited to the above-described embodiment, and various modifications can be made without departing from the spirit of the present invention. Hereinafter,
(変形例1)
変形例1の依存関係情報31は、図6に示すように、不能処理が実行される際にアクセスされるリソースの名称を含んでいる。つまり、依存関係情報31は、名称は不明であるが、同じデータを示すリソースどうしが紐付けられている。言い換えると、依存関係情報31は、不能処理と、その不能処理と依存関係がある処理MTとがリソースを介して間接的に紐付けられている。よって、依存関係情報31は、間接型情報31と言える。
(Modification example 1)
As shown in FIG. 6, the dependency information 31 of the first modification includes the name of the resource to be accessed when the impossible process is executed. That is, although the name of the dependency information 31 is unknown, resources indicating the same data are associated with each other. In other words, in the dependency information 31, the impossible processing and the processing MT having a dependency relationship with the impossible processing are indirectly associated with each other via a resource. Therefore, the dependency information 31 can be said to be indirect information 31.
ここで、図6に示す例を用いて説明する。第1処理MTは、変数V1にWrite(書き込み)する。第2処理MTは、0x000000AAにRead(読出し)する。そして、変数V1と0x000000AAとが同じデータである。この場合、第1処理MTと第2処理MTは、依存関係がある。しかしながら、依存関係解析部10bでは、変数V1と0x000000AAとが同じデータであるか否かを判定できない。この場合の間接型情報31は、変数V1の名称と、0x000000AAの名称とが紐付けられている。つまり、間接型情報31は、変数V1と0x000000AAとが同じデータであることを示す情報(リスト)を含んでいる。さらに、間接型情報31は、変数V1と0x000000AAとが同じリソースであることを示す情報である。
Here, it will be described with reference to the example shown in FIG. The first processing MT writes to the variable V1. The second processing MT reads to 0x000000AA. And the variable V1 and 0x000000AA are the same data. In this case, the first processing MT and the second processing MT have a dependency relationship. However, the
このため、コンピュータ10は、間接型情報31を用いることで、第1処理MTと第2処理MTとに依存関係があると判定できる。なお、リソースと、他のリソースとが同じリソースであることを示す各情報は、リストと称することができる。よって、依存関係情報31は、リソース毎のリストを含んでいると言える。
Therefore, the
変形例1のコンピュータ10は、上記実施形態と同様の効果を奏することができる。同様に、変形例1の自動並列化コンパイラ1及び車載装置20は、上記実施形態と同様の効果を奏することができる。
The
(変形例2)
変形例2では、図7、図8、図9に示すように、処理単位として関数を採用する。関数は、処理MTに含まれる。また、処理MTには、複数の関数を含んでいるものもある。
(Modification 2)
In the second modification, as shown in FIGS. 7, 8 and 9, a function is adopted as the processing unit. The function is included in the processing MT. In addition, some processing MTs include a plurality of functions.
図7に示すように、funcA()関数は、変数Xの書き込みである。funcC()関数は、変数Yの書き込みである。funcD()関数は、変数Xの読み込み、変数Yの読み込み、及び変数Zの書き込みである。よって、依存関係解析部10bは、funcA()関数、funcC()関数、funcD()関数に関して、依存関係の解析が可能である。このため、funcA()関数、funcC()関数、funcD()関数は、可能処理とみなすことができる。
As shown in FIG. 7, the funcA () function is the writing of the variable X. The funcC () function writes the variable Y. The funcD () function reads the variable X, reads the variable Y, and writes the variable Z. Therefore, the
しかしながら、funcB()関数は、依存関係解析部10bがリソースを把握できないp=0x…を含んでいる。よって、依存関係解析部10bは、funcB()関数に関して、依存関係の解析ができない。このため、funcB()関数は、不能処理とみなすことができる。なお、p=0x…は、変数Wのアドレスである。つまり、funcB()関数は、変数Wの書き込みであり、変数X、変数Y、変数Zとは関係がない。
However, the funcB () function includes p = 0x ..., In which the
この場合、依存関係情報32は、図8に示すように、funcB()関数のリソース情報として、変数Wの書き込み(W)であることを示す情報を含んでいる。このように、依存関係情報32は、不能処理に対して、不能処理におけるアクセス先のリソースと、不能処理のリソースに対する処理内容とが紐付けられている。なお、不能処理と、不能処理におけるアクセス先のリソースと、不能処理のリソースに対する処理内容とが紐付けられている各情報は、リストと称することができる。よって、依存関係情報32は、不能処理毎のリストを含んでいると言える。 In this case, as shown in FIG. 8, the dependency information 32 includes information indicating that the variable W is written (W) as the resource information of the funcB () function. In this way, in the dependency information 32, the resource of the access destination in the impossible process and the processing content for the resource of the impossible process are associated with the impossible process. It should be noted that each information in which the impossible processing, the resource of the access destination in the impossible processing, and the processing content for the resource of the impossible processing are associated with each other can be referred to as a list. Therefore, it can be said that the dependency information 32 includes a list for each impossible process.
言い換えると、依存関係情報32は、不能処理と、その不能処理と依存関係がある関数とをリソースを介して間接的に紐付けることができる情報である。よって、依存関係情報32は、間接型情報と言える。 In other words, the dependency information 32 is information that can indirectly associate the impossible process with the function having the dependency relationship with the impossible process via the resource. Therefore, the dependency information 32 can be said to be indirect information.
コンピュータ10は、依存関係情報32を参照することで、各不能処理が実行された際にアクセスされるリソースを把握できる。従って、コンピュータ10は、依存関係情報32を参照することで、不能処理と依存関係がある関数を把握できる。
By referring to the dependency information 32, the
なお、図8に示すように、依存関係情報32は、各処理単位の依存関係を判断するための情報に加えて、リソースの定義を示すリソースリストを含んでいてもよい。また、リソースリストは、関数毎のリソースアクセス情報とセットであってもよい。この場合、どこの関数のリソースと同一のリソースであるかという紐付け情報をリソースリストに付加する。 As shown in FIG. 8, the dependency information 32 may include a resource list indicating the definition of the resource in addition to the information for determining the dependency of each processing unit. Further, the resource list may be a set with the resource access information for each function. In this case, the association information indicating which function's resource is the same as the resource is added to the resource list.
また、自関数からコールする別モジュールの関数の情報は、自動並列化時に解析する。コール関係を基にコール元の処理(コア配置単位)にマージして解析することで、コア配置時に必要な情報を得ることができる。 In addition, the information of the function of another module called from the own function is analyzed at the time of automatic parallelization. Information required at the time of core placement can be obtained by merging and analyzing the call source processing (core placement unit) based on the call relationship.
次に、図9を用いて、変形例2におけるコンピュータ10が自動並列化コンパイラ1を実行した際の処理動作に関して説明する。コンピュータ10は、自動並列化コンパイラ1を実行することで並列プログラム21a1を生成する。なお、図9の各ステップは、自動並列化コンパイラ1における手順に相当するとみなすこともできる。
Next, with reference to FIG. 9, the processing operation when the
ステップS20では、未解析の関数をサーチする。コンピュータ10は、シングルプログラムにおける複数の関数の夫々を対象として、個別に図9の処理を実行する。つまり、コンピュータ10は、ステップS20において、シングルプログラムにおける複数の関数のうち、ステップS22以降の処理を行っていない関数をサーチする。言い換えると、コンピュータ10は、シングルプログラムにおける複数の関数から、ステップS12以降の処理を行っていない関数を抽出する。
In step S20, an unanalyzed function is searched. The
なお、今回のステップS20で抽出された不能処理は、対象関数とも称する。例えば、funcA()関数〜funcD()関数を含むシングルプログラムにおいて、今回のステップS20でfuncB()関数が抽出された場合、対象関数はfuncB()関数である。 The impossible processing extracted in step S20 this time is also referred to as a target function. For example, in a single program including the funcA () function to the funcD () function, when the funcB () function is extracted in step S20 this time, the target function is the funcB () function.
ステップS22では、依存関係情報32に対象関数があるか否かを判定する。つまり、コンピュータ10は、ステップS20で抽出した対象関数のリソース情報が依存関係情報32に含まれているか否かを判定する。コンピュータ10は、依存関係情報32に対象関数のリソース情報が含まれていた場合に、依存関係情報32に対象関数があるとみなしてステップS26へ進む。逆に、コンピュータ10は、依存関係情報32に対象関数のリソース情報が含まれていなかった場合に、依存関係情報32に対象関数がないとみなしてステップS24へ進む。
In step S22, it is determined whether or not the dependency information 32 has the target function. That is, the
ステップS24では、対象関数内のコードを解析して依存関係を抽出する。つまり、コンピュータ10の依存関係解析部10bは、周知のように対象関数の依存関係を抽出する。言い換えると、コンピュータ10の依存関係解析部10bは、ステップS24において、各対象関数における依存関係を判断するための情報、すなわち、アクセス先のリソースとリソースに対する処理内容を抽出する。そして、コンピュータ10の依存関係解析部10bは、対象関数と依存関係がある処理MTを抽出する。
In step S24, the code in the target function is analyzed to extract the dependency. That is, the
一方、ステップS26では、依存関係情報32に基づいて対象関数の依存関係とする。つまり、コンピュータ10は、依存関係情報32に含まれる対象処理に関する情報を、依存関係を解析するための情報とする。言い換えると、コンピュータ10は、依存関係情報32から、対象関数における依存関係を判断するための情報、すなわち、アクセス先のリソースとリソースに対する処理内容を抽出する。例えば、対象関数がfuncB()関数の場合、コンピュータ10は、funcB()関数における依存関係を解析するための情報として、変数Wの書き込みを採用する。つまり、コンピュータ10は、依存関係情報32からfuncB()関数に関する情報、すなわち変数Wの書き込みであることを抽出する。
On the other hand, in step S26, the dependency of the target function is set based on the dependency information 32. That is, the
ステップS28では、対象関数の依存関係を対象関数が属するMTの依存関係に追加する。コンピュータ10は、ステップS24で抽出した依存関係を解析するための情報と、ステップS26で抽出した依存関係を解析するための情報を、各対象関数が属する処理MTに追加する。
In step S28, the dependency of the target function is added to the dependency of the MT to which the target function belongs. The
コンピュータ10は、ステップS20〜S28を繰り返し実行することで、シングルプログラムにおける全ての処理MTを対象として図9のフローチャートを実行する。そして、コンピュータ10は、依存関係情報と、依存関係解析部10bで解析した解析結果とに基づいて、不能処理と可能処理を、依存関係を満たしつつ各コアに割り当てる。この結果、funcA()関数〜funcD()関数は、図10に示すように並列化される。なお、図10では、各処理MTに、関数として一つの関数のみが含まれている例を採用している。
By repeatedly executing steps S20 to S28, the
変形例2のコンピュータ10は、上記実施形態と同様の効果を奏することができる。同様に、変形例2の自動並列化コンパイラ1及び車載装置20は、上記実施形態と同様の効果を奏することができる。さらに、処理MTよりも細かい単位で分担してソフト開発している場合であっても、変形例2のコンピュータ10及び自動並列化コンパイラ1は、上記実施形態と同様の効果を奏することができる。
The
(変形例3)
図11、図12、図13を用いて、変形例3に関して説明する。変形例3では、図11に示すように、処理単位として処理MTである第11処理MT、第12処理MT、第13処理MTを採用する。また、第11処理MTは、変数V1への書き込み、及び変数V2の書き込みを行う。第12処理MTは、変数V1の読み込みを行う。第13処理MTは、変数V2の読み込みを行う。
(Modification example 3)
A modification 3 will be described with reference to FIGS. 11, 12, and 13. In the third modification, as shown in FIG. 11, the eleventh processing MT, the twelfth processing MT, and the thirteenth processing MT, which are the processing MTs, are adopted as the processing units. Further, the eleventh processing MT writes to the variable V1 and writes to the variable V2. The twelfth processing MT reads the variable V1. The thirteenth processing MT reads the variable V2.
変形例3では、図12に示す直接型情報である依存関係情報33や、図13に示す間接型情報である依存関係情報34を採用できる。依存関係情報33では、第11処理MTに対して、依存関係のある処理MT名として第12処理MTと第13処理MTとが紐付けされている。さらに、依存関係情報33では、第12処理MT及び第13処理MTに対して、依存関係のある処理MT名として第11処理MTが紐付けされている。なお、依存関係情報33は、各項目が別々のリストとして管理されている場合を含む。
In the third modification, the
一方、依存関係情報34では、第11処理MTに対して、第11処理MTにおけるアクセス先のリソースである変数V1と、第11処理MTの変数V1に対する処理内容であるWriteとが紐付けられている。また、第11処理MTに対しては、第11処理MTにおけるアクセス先のリソースである変数V2と、第11処理MTの変数V2に対する処理内容であるWriteとが紐付けられている。
On the other hand, in the
さらに、依存関係情報34では、第12処理MTに対して、第12処理MTにおけるアクセス先のリソースである変数V1と、第12処理MTの変数V1に対する処理内容であるReadとが紐付けられている。また、依存関係情報34では、第13処理MTに対して、第13処理MTにおけるアクセス先のリソースである変数V2と、第13処理MTの変数V2に対する処理内容であるReadとが紐付けられている。なお、依存関係情報34は、処理MT毎に別々のリストとして管理されている場合を含む。
Further, in the
変形例3のコンピュータ10は、上記実施形態と同様の効果を奏することができる。同様に、変形例3の自動並列化コンパイラ1及び車載装置20は、上記実施形態と同様の効果を奏することができる。
The
(変形例4)
図14、図15、図16を用いて、変形例4に関して説明する。変形例4では、図14に示すように、処理単位として関数であるfunc1a関数、func2a関数、func3a関数を採用する。また、func1a関数は、0xFFFF0000への書き込み、及びポインタアクセス*Pへの書き込みを行う。ポインタアクセス*Pは、指先解析不能である。func2a関数は、変数V1の読み込みを行う。func3a関数は、0xFFFF0004の読み込みを行う。
(Modification example 4)
A modified example 4 will be described with reference to FIGS. 14, 15, and 16. In the modified example 4, as shown in FIG. 14, the func1a function, the func2a function, and the func3a function, which are functions, are adopted as the processing unit. The func1a function writes to 0xFFFF0000 and writes to pointer access * P. Pointer access * P cannot analyze fingertips. The func2a function reads the variable V1. The func3a function reads 0xFFFF0004.
なお、ここでは、同一のリソースへのアクセスを示す複数の関数の夫々において、リソースに対して異なる名称が定義されている場合を採用する。例えば、0xFFFF0000と変数V1とは、同一のリソースを示すものである。しかしながら、func1a関数では、0xFFFF0000がUnknown2と定義されている。また、ポインタアクセス*Pと0xFFFF0004とは同一のリソースを示すものである。しかしながら、func1a関数では、ポインタアクセス*PがUnknown3と定義されている。一方、func3a関数では、0xFFFF0004がUnknown4と定義されている。 Here, the case where different names are defined for the resources is adopted in each of the plurality of functions indicating access to the same resource. For example, 0xFFFF0000 and the variable V1 indicate the same resource. However, in the func1a function, 0xFFFF0000 is defined as Unknown2. Also, pointer access * P and 0xFFFF0004 indicate the same resource. However, in the func1a function, pointer access * P is defined as Unknown3. On the other hand, in the func3a function, 0xFFFF0004 is defined as Unknown4.
さらに、0xFFFF0000及び変数V1は、第1Moduleに定義されたデータである。そして、ポインタアクセス*P及び0xFFFF0004は、第2Moduleに定義されたデータである。以下においては、Moduleをモジュールとも記載する。 Further, 0xFFFF0000 and the variable V1 are the data defined in the first Module. The pointer access * P and 0xFFFF0004 are the data defined in the second module. In the following, Module is also referred to as a module.
なお、モジュールとは、機能の単位で、ソフトウェアの開発単位である。また、モジュールは、翻訳単位とも称することができ、一つのソースファイルを一つの翻訳単位に対応させることで実現されている。ただし、ヘッダファイルのインクルードの処理があるので、厳密には、一つのソースファイルに前処理を行った後のプログラムテキストが翻訳単位になる。そして、モジュールは、この翻訳単位に相当する。また、各モジュールは、他のモジュールと重複することなくリソースが定義されている。 A module is a unit of function and a unit of software development. A module can also be referred to as a translation unit, and is realized by associating one source file with one translation unit. However, since there is a header file include process, strictly speaking, the program text after preprocessing one source file becomes the translation unit. And the module corresponds to this translation unit. In addition, resources are defined for each module without duplication with other modules.
変形例3では、図15に示す間接型情報である依存関係情報35や、図16に示す間接型情報である依存関係情報36を採用できる。
In the third modification, the
依存関係情報35は、図13と同様に、各処理単位に対して、各処理単位におけるアクセス先のリソースと、各処理単位のアクセス先であるリソースに対する処理内容とが紐付けられている。さらに、依存関係情報35は、同一のリソースを示す複数の名称どうしが紐付けられている。例えば、図15に示すように、依存関係情報35は、0xFFFF0000とUnknown2とが紐付けられており、Unknown3とUnknown4とが紐付けされている。このようにすることで、コンピュータ10は、同じリソースであるにもかかわらず、各処理単位で異なる名称が定義されていた場合であっても依存関係を解析できる。さらに、コンピュータ10は、各処理単位で定義されたリソース名の整合をとらなくてもよい。
In the
依存関係情報36は、同一のリソースを示す複数の名称どうしが紐付けられており、且つ、その名称と、名称のリソースが定義されたモジュールとが紐付けられている。例えば、図16に示すように、第1モジュールに変数V1が紐付けされている。また、第2モジュールには、Unknown2が紐付けされている。
In the
変形例4のコンピュータ10は、上記実施形態と同様の効果を奏することができる。同様に、変形例4の自動並列化コンパイラ1及び車載装置20は、上記実施形態と同様の効果を奏することができる。
The
(変形例5)
図17を用いて、変形例5に関して説明する。ここでは、関数を少なくとも一つ含む処理MT毎に、依存関係を満たしつつ各コアに割り当てるコンピュータ10を採用する。よって、自動並列化コンパイラ1は、関数を少なくとも一つ含む処理MT毎に、依存関係を満たしつつ各コアに割り当てる手順を含んでいる。また、変形例5では、図17に示すように、第21処理MT、第22処理MTなどを含んでいるシングルプログラムを採用する。
(Modification 5)
A modified example 5 will be described with reference to FIG. Here, a
コンピュータ10は、並列化解析の対象である処理全体の関数コール関係を抽出する。コンピュータ10は、関数コール関係に沿って関数をサーチする。コンピュータ10は、対象関数内のリスト入力の対象処理の有無を判断する。コンピュータ10は、対象関数内のリソースアクセスを解析する。コンピュータ10は、リスト入力の対象範囲を特定する。なお、このリスト入力の対象範囲とは、リソースアクセスのリストに書かれる関数を指している。つまり、リストにより、リソースアクセスが紐付けられる処理単位(MTや関数)のことである。
The
コンピュータ10は、依存関係情報からリストを読み取る。コンピュータ10は、対象関数内の処理において、対象範囲については取得したリストをソースアクセス情報として記憶し、対象外についてはリソースアクセス解析結果を対象関数のリソースアクセス情報として記憶する。コンピュータ10は、各対象関数の記憶結果を関数コール関係に従い、処理MTとなるまで親関数の情報としてマージする。よって、上位の関数である上位関数と上位関数にコールされる下位の関数である下位関数とを含む処理MTの依存関係情報は、処理MTに含まれている最上位の上位関数の情報としてマージされている。
つまり、コンピュータ10は、処理MT内における不能処理と可能処理とを判定する。なお、ここでの不能処理は、人間が不能処理と判断してリソースアクセスリストを入力した処理を指している。一方、ここでの可能処理は、不能処理以外の処理を指している。そして、コンピュータ10は、依存関係情報から不能処理に対応するリソースアクセス情報を取得して記憶するとともに、可能処理のリソースアクセス情報を記憶する。さらに、コンピュータ10は、記憶したリソースアクセス情報を、処理MTにおける最上位の関数(親関数)のリソースアクセス情報としてマージする。よって、この処理MTの依存関係情報、すなわちリソースアクセス情報は、処理MT内の不能処理のリソースアクセス情報と、可能処理のリソースアクセス情報とがマージされた情報となっている。
That is, the
なお、対象範囲は、処理MTの全体又は一部である。リストには、対象範囲の処理がアクセスするRAMのシンボル名を含んでいる。リストには、対象範囲の処理がアクセスするリソースの名前を含んでいる。リソースの名前は、プログラム全体で一意の処理単位名に紐付けられている。 The target range is the whole or a part of the processing MT. The list contains the symbol names of the RAMs that the processing in the scope accesses. The list contains the names of the resources that the scoped operations access. The resource name is associated with a processing unit name that is unique throughout the program.
ここで、一例として、図17に示すシングルプログラムを用いて説明する。図17における各関数の内容は、点線の吹き出しで示している。このシングルプログラムでは、第21処理MTをサーチした結果、関数F1が対象関数となる。この関数F1は、不能処理である関数F2と、可能処理である関数F3と、不能処理であるロジックを指示する指示子を含んでいる。 Here, as an example, the single program shown in FIG. 17 will be used for description. The contents of each function in FIG. 17 are indicated by dotted line balloons. In this single program, as a result of searching the 21st processing MT, the function F1 becomes the target function. This function F1 includes a function F2 which is an impossible process, a function F3 which is a possible process, and an indicator which indicates a logic which is an impossible process.
コンピュータ10は、関数F2内のリソースアクセス情報を解析(抽出)せず、依存関係情報からリソースアクセス情報を取得して記憶する。例えば、関数F2のリソースアクセス情報は、変数yへのWriteである。さらに、コンピュータ10は、関数F2のサブ関数F4の解析に移る。
The
また、コンピュータ10は、関数F3が変数xにWriteしている可能処理であるため、依存関係情報からリソースアクセス情報を取得しない。そして、コンピュータ10は、変数xにWriteしていることを、関数F3のリソースアクセス情報として記憶する。
Further, since the
さらに、コンピュータ10は、指示子の指定範囲のリソースアクセス情報を解析(抽出)せず、依存関係情報からリソースアクセス情報を取得して記憶する。例えば、指示子の指定範囲のリソースアクセス情報は、第3モジュールに定義されているUnknown4というリソースへのWriteである。
Further, the
そして、コンピュータ10は、上記のように記憶した複数のリソースアクセス情報を、関数F1のリソースアクセス情報としてマージする。つまり、第21処理MT配下の関数のリソースアクセス情報をマージした結果、第21処理MTは、変数x、変数y、変数v、変数w、及び第3モジュールに定義されているUnknown5というリソースに対して書込みを行う処理となる。コンピュータ10は、依存関係の解析時に、マージしたリソースアクセス情報を用いる。なお、第21処理MTは、上記のリソース(データ等)に対して同様にアクセスを行う他の処理MTとの間に依存関係が発生する。
Then, the
変形例5のコンピュータ10は、上記実施形態と同様の効果を奏することができる。同様に、変形例5の自動並列化コンパイラ1及び車載装置20は、上記実施形態と同様の効果を奏することができる。
The
さらに、変形例5のコンピュータ10は、各関数毎(ソフト開発担当者毎)に解析可否判断(解析できない部分の明確化)及び解析不能部分の情報を取得できる。よって、変形例5のコンピュータ10は、従来の解析不能部分も含めて依存関係の解析と並列化が可能となる。
Further, the
1…自動並列化コンパイラ、10…コンピュータ、10a…読み取り部、10b…依存関係解析部、10c…処理時間解析部、10d…コア割付部、10e…スケジューリング部、11…ディスプレイ、12…HDD、13…CPU、14…ROM、15…RAM、16…入力装置、17…読取部、18…記憶媒体、20…車載装置、21…マルチコアプロセッサ、21a…ROM、21a1…並列プログラム、21b…RAM、21c…第1コア、21d…第2コア、22…通信部、23…センサ部、24…入出力ポート、30〜36…依存関係情報 1 ... Automatic parallelizing compiler, 10 ... Computer, 10a ... Reading unit, 10b ... Dependency analysis unit, 10c ... Processing time analysis unit, 10d ... Core allocation unit, 10e ... Scheduling unit, 11 ... Display, 12 ... HDD, 13 ... CPU, 14 ... ROM, 15 ... RAM, 16 ... input device, 17 ... reader, 18 ... storage medium, 20 ... in-vehicle device, 21 ... multi-core processor, 21a ... ROM, 21a1 ... parallel program, 21b ... RAM, 21c ... 1st core, 21d ... 2nd core, 22 ... Communication unit, 23 ... Sensor unit, 24 ... Input / output port, 30-36 ... Dependency information
Claims (10)
複数の前記処理単位における前記依存関係の解析が不能な不能処理に対する、前記依存関係を判断するための依存関係情報を取得する取得手順(10a)と、
複数の前記処理単位における前記依存関係の解析が可能な可能処理に関して、前記依存関係を解析する解析手順(10b)と、
前記取得手順で取得した前記依存関係情報と、前記解析手順で解析した解析結果とに基づいて、前記不能処理と前記可能処理を、前記依存関係を満たしつつ各コアに割り当てる割り当て手順(10d)と、を備え、
前記処理単位は、関数であり、
前記割り当て手順は、前記関数を少なくとも一つ含むコア配置単位毎に、前記依存関係を満たしつつ各コアに割り当てるものであり、
上位の前記関数である上位関数と前記上位関数にコールされる下位の前記関数である下位関数とを含む前記コア配置単位の前記依存関係情報は、前記コア配置単位に含まれている最上位の前記上位関数の情報としてマージされている並列化方法。 A parallel program for a multi-core microcomputer (21) having a plurality of the cores (21c, 21d) from the single program by analyzing the dependency of a plurality of processing units in a single program for a single-core microcomputer having one core. This is a parallelization method for generating (21a1).
The acquisition procedure (10a) for acquiring the dependency information for determining the dependency for the impossible process in which the dependency cannot be analyzed in the plurality of processing units, and the acquisition procedure (10a).
An analysis procedure (10b) for analyzing the dependency relationship and an analysis procedure (10b) for analyzing the dependency relationship in a plurality of processing units capable of analyzing the dependency relationship.
Based on the dependency information acquired in the acquisition procedure and the analysis result analyzed in the analysis procedure, the allocation procedure (10d) in which the impossible process and the possible process are assigned to each core while satisfying the dependency relationship. , With
The processing unit is a function and
In the allocation procedure, each core placement unit including at least one of the functions is assigned to each core while satisfying the dependency.
The dependency information of the core arrangement unit including the upper function which is the upper function and the lower function which is the lower function called by the upper function is the highest-level information included in the core arrangement unit. The parallelization method that is merged as the information of the superordinate function.
前記依存関係情報は、同一の前記リソースを示す複数の前記名称どうしが紐付けられており、且つ、前記名称と、前記名称の前記リソースが定義された前記翻訳単位とが紐付けられている請求項4に記載の並列化方法。 The single program is composed of a plurality of translation units, and each translation unit defines the resource without overlapping with other translation units.
The dependency information is a claim in which a plurality of the names indicating the same resource are associated with each other, and the name is associated with the translation unit in which the resource of the name is defined. Item 4. The parallelization method according to Item 4.
複数の前記処理単位における前記依存関係の解析が不能な不能処理に対する、前記依存関係を判断するための依存関係情報を取得する取得部(10a)と、
複数の前記処理単位における前記依存関係の解析が可能な可能処理に関して、前記依存関係を解析する解析部(10b)と、
前記取得部で取得した前記依存関係情報と、前記解析部で解析した解析結果とに基づいて、前記不能処理と前記可能処理を、前記依存関係を満たしつつ各コアに割り当てる割り当て部(10d)と、を備え、
前記処理単位は、関数であり、
前記割り当て部は、前記関数を少なくとも一つ含むコア配置単位毎に、前記依存関係を満たしつつ各コアに割り当てるものであり、
上位の前記関数である上位関数と前記上位関数にコールされる下位の前記関数である下位関数とを含む前記コア配置単位の前記依存関係情報は、前記コア配置単位に含まれている最上位の前記上位関数の情報としてマージされている並列化ツール。 A parallel program for a multi-core microcomputer (21) having a plurality of the cores (21c, 21d) from the single program by analyzing the dependency of a plurality of processing units in a single program for a single-core microcomputer having one core. A parallelization tool that includes a computer to generate (21a1).
An acquisition unit (10a) for acquiring dependency information for determining the dependency for an impossible process in which the dependency cannot be analyzed in a plurality of processing units.
With respect to possible processing capable of analyzing the dependency relationship in a plurality of the processing units, an analysis unit (10b) for analyzing the dependency relationship and
Based on the dependency information acquired by the acquisition unit and the analysis result analyzed by the analysis unit, the allocation unit (10d) that allocates the impossible process and the possible process to each core while satisfying the dependency relationship. , With
The processing unit is a function and
The allocation unit allocates to each core while satisfying the dependency for each core arrangement unit including at least one of the functions.
The dependency information of the core arrangement unit including the upper function which is the upper function and the lower function which is the lower function called by the upper function is the highest-level information included in the core arrangement unit. A parallelization tool that has been merged as information on the superordinate function.
前記依存関係情報は、同一の前記リソースを示す複数の前記名称どうしが紐付けられており、且つ、前記名称と、前記名称の前記リソースが定義された前記翻訳単位とが紐付けられている請求項9に記載の並列化ツール。 The single program is composed of a plurality of translation units, and each translation unit defines the resource without overlapping with other translation units.
The dependency information is a claim in which a plurality of the names indicating the same resource are associated with each other, and the name is associated with the translation unit in which the resource of the name is defined. Item 9. The parallelization tool according to Item 9.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
DE102017209697.7A DE102017209697A1 (en) | 2016-06-13 | 2017-06-08 | Parallelization method, parallelization tool and in-vehicle device |
US15/618,320 US10379828B2 (en) | 2016-06-13 | 2017-06-09 | Parallelization method, parallelization tool, and in-vehicle device |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016117247 | 2016-06-13 | ||
JP2016117247 | 2016-06-13 |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2017224288A JP2017224288A (en) | 2017-12-21 |
JP6933001B2 true JP6933001B2 (en) | 2021-09-08 |
Family
ID=60686011
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2017109497A Active JP6933001B2 (en) | 2016-06-13 | 2017-06-01 | Parallelization method, parallelization tool |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6933001B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7095513B2 (en) * | 2018-02-21 | 2022-07-05 | 株式会社デンソー | Multi-core microcomputers and in-vehicle devices |
-
2017
- 2017-06-01 JP JP2017109497A patent/JP6933001B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2017224288A (en) | 2017-12-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6018022B2 (en) | Parallel compilation method, parallel compiler, parallel compilation device, and in-vehicle device | |
US10095657B2 (en) | Processor, accelerator, and direct memory access controller within a core reading/writing local synchronization flag area for parallel | |
US8799880B2 (en) | Parallelization of PLC programs for operation in multi-processor environments | |
JP6319880B2 (en) | Parallelism extraction method and program creation method | |
JP4931978B2 (en) | Parallelization processing method, system, and program | |
US20100229161A1 (en) | Compile method and compiler | |
US10296316B2 (en) | Parallelization method, parallelization tool, and in-vehicle apparatus | |
US9830157B2 (en) | System and method for selectively delaying execution of an operation based on a search for uncompleted predicate operations in processor-associated queues | |
JP2017228029A (en) | Parallelization method, parallelization tool, on-vehicle device | |
Carle et al. | Predicate-aware, makespan-preserving software pipelining of scheduling tables | |
Pinho et al. | High Performance Embedded Computing | |
JP6427055B2 (en) | Parallelizing compilation method and parallelizing compiler | |
Amiri et al. | FLOWER: A comprehensive dataflow compiler for high-level synthesis | |
JP6933001B2 (en) | Parallelization method, parallelization tool | |
Bloom et al. | Real-time systems development with RTEMs and multicore processors | |
US11915056B2 (en) | Combination of multiple data processing and machine learning frameworks for a target hardware | |
JP2016192152A (en) | Parallelizing compilation method, parallelizing compiler, and in-vehicle device | |
CN108536696A (en) | A kind of database personalized self-service query platform and method | |
JP6488738B2 (en) | Parallelizing compilation method and parallelizing compiler | |
JP6558310B2 (en) | Parallelization method, parallelization tool | |
US10379828B2 (en) | Parallelization method, parallelization tool, and in-vehicle device | |
Schmidhuber et al. | Towards the derivation of guidelines for the deployment of real-time tasks on a multicore processor | |
Wu et al. | A design tool for high performance image processing on multicore platforms | |
JP7059776B2 (en) | Parallelization method, parallelization tool, and multi-core microcontroller | |
JP6933063B2 (en) | Parallelization method, parallelization tool, in-vehicle device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20200513 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20210325 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20210406 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20210426 |
|
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: 20210720 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20210802 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 6933001 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |