JP6933001B2 - Parallelization method, parallelization tool - Google Patents

Parallelization method, parallelization tool Download PDF

Info

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
Application number
JP2017109497A
Other languages
Japanese (ja)
Other versions
JP2017224288A (en
Inventor
憲一 峰田
憲一 峰田
貴之 永井
貴之 永井
祐 中川
祐 中川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to DE102017209697.7A priority Critical patent/DE102017209697A1/en
Priority to US15/618,320 priority patent/US10379828B2/en
Publication of JP2017224288A publication Critical patent/JP2017224288A/en
Application granted granted Critical
Publication of JP6933001B2 publication Critical patent/JP6933001B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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 Patent Document 1 as an example of a parallelization method for generating a parallel program for a multi-core microcomputer from a single program for a single-core microcomputer.

この並列化コンパイル方法では、シングルプログラムのソースコードを字句解析や構文解析を行って中間言語を生成し、この中間言語を用いて、複数のマクロタスク(以下、処理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.

特開2015−1807号公報Japanese Unexamined Patent Publication No. 2015-1807

しかしながら、シングルプログラムの処理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.

実施形態におけるコンピュータの概略構成を示すブロック図である。It is a block diagram which shows the schematic structure of the computer in embodiment. 実施形態における車載装置の概略構成を示すブロック図である。It is a block diagram which shows the schematic structure of the vehicle-mounted device in an embodiment. 実施形態におけるコンピュータの機能を示すブロック図である。It is a block diagram which shows the function of the computer in embodiment. 実施形態におけるコンピュータの処理を示すフローチャートである。It is a flowchart which shows the processing of the computer in embodiment. 実施形態における処理単位によって依存関係を指定する依存関係情報を示すイメージ図である。It is an image diagram which shows the dependency information which specifies the dependency by the processing unit in embodiment. 変形例1におけるリソースによって依存関係を指定する依存関係情報を示すイメージ図である。It is an image diagram which shows the dependency information which specifies the dependency by the resource in the modification 1. 変形例2における処理単位の一例を示すイメージ図である。It is an image diagram which shows an example of the processing unit in the modification 2. 変形例2における依存関係情報の一例を示すイメージ図である。It is an image diagram which shows an example of the dependency relation information in the modification 2. 変形例5におけるコンピュータの処理を示すフローチャートである。It is a flowchart which shows the processing of the computer in the modification 5. 変形例2における並列化後の処理単位を示すイメージ図である。It is an image diagram which shows the processing unit after parallelization in the modification 2. 変形例3における処理単位とリソースの関係を示すイメージ図である。It is an image diagram which shows the relationship between the processing unit and a resource in the modification 3. 変形例3における処理単位によって依存関係を指定する依存関係情報を示すイメージ図である。It is an image diagram which shows the dependency information which specifies the dependency by the processing unit in the modification 3. 変形例3におけるリソースによって依存関係を指定する依存関係情報を示すイメージ図である。It is an image diagram which shows the dependency information which specifies the dependency by the resource in the modification 3. 変形例4における処理単位とリソースの関係を示すイメージ図である。It is an image diagram which shows the relationship between the processing unit and a resource in the modification 4. 変形例4におけるリソースによって依存関係を指定する依存関係情報を示すイメージ図である。It is an image diagram which shows the dependency information which specifies the dependency by the resource in the modification 4. 変形例4におけるリソースとモジュールが紐付けられた依存関係情報を示すイメージ図である。It is an image diagram which shows the dependency information which the resource and the module are associated with in the modification 4. 変形例5における処理単位を示すイメージである。It is an image which shows the processing unit in the modification 5.

以下において、図面を参照しながら、発明を実施するための複数の形態を説明する。各形態において、先行する形態で説明した事項に対応する部分には同一の参照符号を付して重複する説明を省略する場合がある。各形態において、構成の一部のみを説明している場合は、構成の他の部分については先行して説明した他の形態を参照し適用することができる。 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 multi-core processor 21 having a first core 21c and a second core 21d from a plurality of processing units in a single program for a single-core microcomputer having one core. Is adopted. The processor can be rephrased as a microcomputer. Therefore, the multi-core processor can be rephrased as a multi-core microcomputer.

上記処理単位とは、各コアに割り振る際の最小単位であるコア配置単位や、関数である。コア配置単位は、処理ブロックやマクロタスクや処理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 multi-core processor 21 becomes mainstream due to an increase in the amount of heat generated by the processor, an increase in power consumption, and a problem of a clock frequency limit. The multi-core processor 21 also needs to be applied in the field of in-vehicle devices. Further, the parallel program 21a1 is required to be highly reliable and capable of executing processing at high speed while suppressing the development period and development cost of software.

ここで、図1を用いて、コンピュータ10の構成に関して説明する。コンピュータ10は、並列化方法を実行する並列化ツールに相当し、並列プログラム21a1を生成する。コンピュータ10は、ディスプレイ11、HDD12、CPU13、ROM14、RAM15、入力装置16、読取部17などを備えて構成されている。また、コンピュータ10は、記憶媒体18に記憶された記憶内容を読み取り可能に構成されている。この記憶媒体18には、自動並列化コンパイラ1が記憶されている。 Here, the configuration of the computer 10 will be described with reference to FIG. The computer 10 corresponds to a parallelization tool that executes the parallelization method, and generates a parallel program 21a1. The computer 10 includes a display 11, an HDD 12, a CPU 13, a ROM 14, a RAM 15, an input device 16, a reading unit 17, and the like. Further, the computer 10 is configured to be able to read the stored contents stored in the storage medium 18. The automatic parallelizing compiler 1 is stored in the storage medium 18.

コンピュータ10及び記憶媒体18の構成は、特開2015−1807号公報に記載されたパーソナルコンピュータ100及び記憶媒体180を参照されたい。なお、自動並列化コンパイラ1は、特開2015−1807号公報に記載されたものに加えて、図3に示すように、読み取り部10aなどを含んでいる。この読み取り部10aに関しては、後程説明する。 For the configurations of the computer 10 and the storage medium 18, refer to the personal computer 100 and the storage medium 180 described in Japanese Patent Application Laid-Open No. 2015-1807. The automatic parallelizing compiler 1 includes a reading unit 10a and the like as shown in FIG. 3 in addition to those described in Japanese Patent Application Laid-Open No. 2015-1807. The reading unit 10a will be described later.

自動並列化コンパイラ1は、並列プログラム21a1を生成するための手順を含んでいる。よって、自動並列化コンパイラ1は、並列化方法に相当する。つまり、自動並列化コンパイラ1は、並列化方法を含むプログラムである。コンピュータ10は、自動並列化コンパイラ1を実行することで、並列プログラム21a1を生成する。 The automatic parallelizing compiler 1 includes a procedure for generating the parallel program 21a1. Therefore, the automatic parallelization compiler 1 corresponds to the parallelization method. That is, the automatic parallelization compiler 1 is a program including a parallelization method. The computer 10 generates the parallel program 21a1 by executing the automatic parallelization compiler 1.

例えば、コンピュータ10は、C言語で記述されたソースコードであるシングルプログラムから、C言語で記述されたソースコードである並列プログラム21a1を生成する。しかしながら、本発明は、これに限定されない。シングルプログラムは、C言語とは異なるプログラミング言語で記述されていてもよい。同様に、並列プログラム21a1は、C言語とは異なるプログラミング言語で記述されていてもよい。 For example, the computer 10 generates a parallel program 21a1 which is a source code written in C language from a single program which is a source code written in C language. However, the present invention is not limited to this. The single program may be written in a programming language different from C language. Similarly, the parallel program 21a1 may be written in a programming language different from the C language.

なお、並列プログラム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 different cores 21c and 21d of the multi-core processor 21. In other words, it analyzes the program written for the single-core microcomputer and generates software that parallelizes the processing MT that can be parallelized for the multi-core microcomputer. Allocating can be rephrased as arranging, allocating, or allocating.

割り当てる際には、複数の処理MTの依存関係を維持しつつ、複数の処理MTの夫々を第1コア21cと第2コア21dとに割り当てる。この点に関しては、特開2015−1807号公報を参照されたい。 When allocating, each of the plurality of processing MTs is assigned to the first core 21c and the second core 21d while maintaining the dependency of the plurality of processing MTs. Regarding this point, refer to Japanese Patent Application Laid-Open No. 2015-1807.

依存関係とは、例えば、ある処理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 dependency analysis unit 10b in the computer 10 described later is impossible or difficult. This impossible processing includes, for example, a pointer-related processing MT. The reason is that it cannot be completely analyzed without the value estimation (behavior estimation) of the variable. However, the impossible processing is not limited to the pointer-related processing MT. Among the processing MTs of the single program, the processing MT capable of analyzing the dependency relationship by the dependency analysis unit 10b is referred to as a possible processing.

このように、不能処理は、依存関係解析部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 dependency analysis unit 10b cannot analyze the dependency. When the impossible processing cannot be parallelized, the parallel program 21a1 has only the possible processing in the single program parallelized. In the parallel program 21a1 in which only the possible processing is parallelized, the number of processing MTs that can be executed in parallel by the first core 21c and the second core 21d is smaller than in the case where the possible processing and the impossible processing are parallelized. Therefore, the parallel program 21a1 in which only the possible processing is parallelized cannot operate the first core 21c and the second core 21d more efficiently than in the case where the possible processing and the impossible processing are parallelized. Therefore, the computer 10 also determines the dependency relationship with respect to the impossible processing by using the dependency information 30 indicating the dependency relationship in the impossible processing. The dependency information 30 will be described later.

コンピュータ10は、図3に示すように、機能ブロックとして、上記読み取り部10aや依存関係解析部10bに加えて、処理時間解析部10c、コア割付部10d、スケジューリング部1eを備えている。なお、図示や説明は省略するが、コンピュータ10は、周知の字句解析部などを備えて構成されている。 As shown in FIG. 3, the computer 10 includes a processing time analysis unit 10c, a core allocation unit 10d, and a scheduling unit 1e in addition to the reading unit 10a and the dependency analysis unit 10b as functional blocks. Although illustration and description are omitted, the computer 10 is configured to include a well-known lexical analysis unit and the like.

読み取り部10aは、不能処理における依存関係を判断するために、依存関係情報30を読み取る。つまり、コンピュータ10は、依存関係情報30が入力される。読み取り部10aは、特許請求の範囲の取得部に相当する。なお、コンピュータ10は、自動並列化コンパイラ1を実行することで依存関係情報30を読み取る。このため、読み取り部10aは、特許請求の範囲の取得手順にも相当するとみなせる。 The reading unit 10a reads the dependency information 30 in order to determine the dependency in the impossible processing. That is, the computer 10 is input with the dependency information 30. The reading unit 10a corresponds to an acquisition unit within the scope of claims. The computer 10 reads the dependency information 30 by executing the automatic parallelizing compiler 1. Therefore, the reading unit 10a can be regarded as corresponding to the procedure for acquiring the claims.

依存関係情報30は、上記のように不能処理における依存関係を判断するための情報であり、例えばシングルプログラムを設計する際に用いられた情報の一部である。よって、依存関係情報30は、設計情報と言い換えることもできる。 The dependency information 30 is information for determining the dependency in the impossible processing as described above, and is a part of the information used when designing a single program, for example. Therefore, the dependency information 30 can be rephrased as design information.

特に、本実施形態の依存関係情報30は、不能処理と依存関係がある処理MTを示す情報である。言い換えると、依存関係情報30は、依存関係解析部10bでは依存関係の解析ができないが、実際は依存関係がある複数の処理MTに関して、依存関係があることを示す情報である。つまり、本実施形態の依存関係情報30は、不能処理と、その不能処理と依存関係がある処理MTとが直接的に紐付けられている。よって、依存関係情報30は、直接型情報30と言い換えることもできる。 In particular, the dependency information 30 of the present embodiment is information indicating a processing MT having a dependency relationship with the impossible processing. In other words, the dependency information 30 is information indicating that there is a dependency relationship with respect to a plurality of processing MTs having the dependency relationship, although the dependency relationship analysis unit 10b cannot analyze the dependency relationship. That is, in the dependency information 30 of the present embodiment, the impossible processing and the processing MT having a dependency relationship with the impossible processing are directly linked. Therefore, the dependency information 30 can be rephrased as the direct type information 30.

直接型情報30は、例えば、不能処理と依存関係がある処理MTの名称を含んでいる。つまり、直接型情報30は、不能処理の名称と、不能処理と依存関係がある処理MTの名称とを含んでおり、依存関係がある処理MTどうしの名称が紐付けされている。 The direct type information 30 includes, for example, the name of the processing MT that has a dependency relationship with the impossible processing. That is, the direct type information 30 includes the name of the impossible process and the name of the processing MT having a dependency relationship with the impossible process, and the names of the processing MTs having a dependency relationship are associated with each other.

なお、不能処理の名称と、不能処理と依存関係がある処理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 dependency information 30 includes a list for each impossible process. Then, when the dependency information 30 is read, the dependency information 30 reads the list corresponding to the impossible processing. That is, the dependency information 30 reads a list of target impossible processes from the dependency information 30 including a plurality of lists.

ここで、図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 dependency analysis unit 10b cannot determine whether or not the variables V1 and 0x000000AA have the same data. In the direct type information 30 in this case, the name of the first processing MT and the name of the second processing MT are associated with each other. Therefore, the computer 10 can determine that there is a dependency relationship between the first processing MT and the second processing MT by using the direct type information 30.

依存関係解析部10bは、可能処理に関して、依存関係を解析する。言い換えると、依存関係解析部10bは、可能処理の依存関係を解析することで、可能処理における依存関係を判断するための情報を抽出する。なお、依存関係解析部10bは、周知技術である。このため、依存関係解析部10bの詳しい説明は、省略する。この依存関係解析部10bは、特許請求の範囲の解析部に相当する。なお、コンピュータ10は、自動並列化コンパイラ1を実行することで依存関係を解析する。このため、依存関係解析部10bは、特許請求の範囲の解析手順にも相当するとみなせる。 The dependency analysis unit 10b analyzes the dependency with respect to the possible processing. In other words, the dependency analysis unit 10b extracts information for determining the dependency in the possible processing by analyzing the dependency in the possible processing. The dependency analysis unit 10b is a well-known technique. Therefore, a detailed description of the dependency analysis unit 10b will be omitted. The dependency analysis unit 10b corresponds to an analysis unit within the scope of claims. The computer 10 analyzes the dependency by executing the automatic parallelizing compiler 1. Therefore, the dependency analysis unit 10b can be regarded as corresponding to the analysis procedure of the claims.

コア割付部10dは、読み取り部10aで取得した依存関係情報30と、依存関係解析部10bで解析した解析結果とに基づいて、不能処理と可能処理を、依存関係を満たしつつ各コア21c、21dに割り当てる。上記のように、コンピュータ10は、依存関係情報30を取得するため、不能処理に関しても依存関係を判断できる。よって、コア割付部10dは、可能処理だけではなく、不能処理に関しても、各コア21c、21dに割り当てることができる。 The core allocation unit 10d performs impossible processing and possible processing based on the dependency information 30 acquired by the reading unit 10a and the analysis result analyzed by the dependency analysis unit 10b, while satisfying the dependency relationships, respectively, for the cores 21c and 21d. Assign to. As described above, since the computer 10 acquires the dependency information 30, the dependency can be determined even for the impossible processing. Therefore, the core allocation unit 10d can be assigned to the cores 21c and 21d not only for possible processing but also for impossible processing.

このコア割付部10dは、特許請求の範囲の割り当て部に相当する。なお、コンピュータ10は、自動並列化コンパイラ1を実行することで、各処理MTを各コアへ割り当てる。このため、コア割付部10dは、特許請求の範囲の割り当て手順にも相当するとみなせる。 The core allocation portion 10d corresponds to the allocation portion in the claims. The computer 10 allocates each processing MT to each core by executing the automatic parallelizing compiler 1. Therefore, the core allocation unit 10d can be regarded as corresponding to the procedure for allocating the claims.

なお、処理時間解析部10c及びスケジューリング部10eは、周知技術である。このため、処理時間解析部10c及びスケジューリング部10eに関する詳しい説明は、省略する。 The processing time analysis unit 10c and the scheduling unit 10e are well-known techniques. Therefore, detailed description of the processing time analysis unit 10c and the scheduling unit 10e will be omitted.

次に、図4を用いて、コンピュータ10が自動並列化コンパイラ1を実行した際の処理動作に関して説明する。コンピュータ10は、自動並列化コンパイラ1を実行することで並列プログラム21a1を生成する。なお、図4の各ステップは、自動並列化コンパイラ1における手順に相当するとみなすこともできる。 Next, with reference to FIG. 4, the processing operation when the computer 10 executes the automatic parallelizing compiler 1 will be described. The computer 10 generates the parallel program 21a1 by executing the automatic parallelization compiler 1. It should be noted that each step in FIG. 4 can be regarded as corresponding to the procedure in the automatic parallelizing compiler 1.

ステップS10では、未解析の処理MTをサーチする。コンピュータ10は、シングルプログラムにおける複数の処理MTの夫々を対象として、個別に図4の処理を実行する。つまり、コンピュータ10は、ステップS10において、シングルプログラムにおける複数の処理MTのうち、ステップS12以降の処理を行っていない処理MTをサーチする。言い換えると、コンピュータ10は、シングルプログラムにおける複数の処理MTから、ステップS12以降の処理を行っていない処理MTを抽出する。 In step S10, the unanalyzed processed MT is searched. The computer 10 individually executes the processing of FIG. 4 for each of the plurality of processing MTs in the single program. That is, in step S10, the computer 10 searches for the processing MT that has not been processed after step S12 among the plurality of processing MTs in the single program. In other words, the computer 10 extracts the processed MTs that have not been processed after step S12 from the plurality of processed MTs in the single program.

なお、今回のステップ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 computer 10 determines whether or not the processing MT associated with the target MT extracted in step S10 is included in the direct type information 30. If the computer 10 determines that the direct type information 30 includes the target MT, the computer 10 proceeds to step S16, and if it determines that the direct type information 30 includes the target MT, the computer 10 proceeds to step S14.

ステップ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 dependency analysis unit 10b of the computer 10 extracts the dependency of each target MT as is well known. In other words, in step S14, the dependency analysis unit 10b of the computer 10 extracts information for determining the dependency in each target MT, that is, the access destination resource and the processing content for the resource. Then, the dependency analysis unit 10b of the computer 10 extracts the processing MT having a dependency relationship with the target MT.

なお、アクセス先のリソースとは、処理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 direct type information 30. That is, the computer 10 makes the processing MT associated with the target MT in the direct type information 30 a dependency relationship of the target MT. In other words, the computer 10 sets the processing MT associated with the target MT in the direct type information 30 as the processing MT having a dependency relationship with the target MT.

コンピュータ10は、ステップS10〜S16を繰り返し実行することで、シングルプログラムにおける全ての処理MTを対象として図4のフローチャートを実行する。そして、コンピュータ10は、依存関係情報と、依存関係解析部10bで解析した解析結果とに基づいて、不能処理と可能処理を、依存関係を満たしつつ各コアに割り当てる。 By repeatedly executing steps S10 to S16, the computer 10 executes the flowchart of FIG. 4 for all the processing MTs in the single program. Then, the computer 10 allocates impossible processing and possible processing to each core while satisfying the dependency relationship, based on the dependency information and the analysis result analyzed by the dependency analysis unit 10b.

なお、並列プログラム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 separate cores 21c and 21d. Therefore, in the parallel program 21a1, when two processing MTs having a dependency relationship are arranged in different cores 21c and 21d, the parallel program 21a1 waits for the processing order assigned to the other cores to complete the execution of the previous processing MT. , Includes synchronous processing to execute later processing MT in the processing order. That is, when the execution of the processing MT assigned to the own core is completed, the parallel program 21a1 waits for the execution of the processing MT assigned to the other core to be completed, and then waits for the execution of the processing MT assigned to the own core to be completed, and then the next processing assigned to the own core. It includes a synchronization process to execute MT. The processing MT allocated to the other core here has a dependency relationship with the next processing MT allocated to the own core, and the execution order is earlier than the next processing MT allocated to the own core.

このため、第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 first core 21c and the second core 21d is completed in order to perform the synchronization processing, the first core 21c and the second core 21d access the RAM 21b and indicate that they are waiting for synchronization (information indicating that they are waiting for synchronization ( Hereinafter, completion information) is stored in the RAM 21b. Then, the own core waiting for the completion of execution of the processing MT having a dependency in the other core periodically accesses the RAM 21b without executing the processing MT, and whether or not the completion information is stored in the RAM 21b. To confirm. That is, the own core waiting for the completion of execution of the processing MT having a dependency in the other core operates periodically during non-operation, accesses the RAM 21b, and confirms whether or not the completion information is stored. .. In this way, the first core 21c and the second core 21d execute the processing MT while waiting for each other, in other words, synchronizing with each other. Therefore, the synchronization process can also be called a wait process. The parallel program 21a1 includes a program executed by the first core 21c and a program executed by the second core 21d.

次に、車載装置20の構成に関して説明する。車載装置20は、図2に示すように、マルチコアプロセッサ21、通信部22、センサ部23、入出力ポート24を備えて構成されている。また、マルチコアプロセッサ21は、ROM21a、RAM21b、第1コア21c、第2コア21dを備えて構成されている。車載装置20は、例えば、自動車に搭載されたエンジン制御装置やハイブリッド制御装置などに適用できる。ここでは、一例として、車載装置20をエンジン制御装置に適用した例を採用する。この場合、並列プログラム21a1は、エンジン制御などの自動車制御プログラムと言える。しかしながら、並列プログラム21a1は、これに限定されない。なお、コアは、プロセッサエレメントとも称することができる。 Next, the configuration of the in-vehicle device 20 will be described. As shown in FIG. 2, the in-vehicle device 20 includes a multi-core processor 21, a communication unit 22, a sensor unit 23, and an input / output port 24. Further, the multi-core processor 21 includes a ROM 21a, a RAM 21b, a first core 21c, and a second core 21d. The in-vehicle device 20 can be applied to, for example, an engine control device or a hybrid control device mounted on an automobile. Here, as an example, an example in which the in-vehicle device 20 is applied to the engine control device is adopted. In this case, the parallel program 21a1 can be said to be an automobile control program such as engine control. However, the parallel program 21a1 is not limited to this. The core can also be referred to as a processor element.

第1コア21cと第2コア21dは、並列プログラム21a1を実行することで、エンジン制御を行う。詳述すると、第1コア21cと第2コア21dは、並列プログラム21a1のうち自身に割り当てられた処理MTを実行するとともに待合せ処理などを実行することでエンジン制御を行う。RAM21b、通信部22、センサ部23、入出力ポート24は、特開2015−1807号公報に記載されたRAM420、通信部430、センサ部450、入出力ポート460を参照されたい。 The first core 21c and the second core 21d control the engine by executing the parallel program 21a1. More specifically, the first core 21c and the second core 21d perform engine control by executing the processing MT assigned to themselves in the parallel program 21a1 and executing the waiting process and the like. For the RAM 21b, the communication unit 22, the sensor unit 23, and the input / output port 24, refer to the RAM 420, the communication unit 430, the sensor unit 450, and the input / output port 460 described in Japanese Patent Application Laid-Open No. 2015-1807.

以上のように、コンピュータ10では、依存関係の解析が不能な不能処理であっても、不能処理の依存関係を示す直接型情報30を取得できる。そして、コンピュータ10では、直接型情報30と、可能処理における解析結果とに基づいて、不能処理と可能処理とを各コア21c、21dに割り当てる。このため、コンピュータ10では、可能処理に加えて、不能処理も並列化できる。従って、コンピュータ10では、より多くの処理MTが並列化された並列プログラム21a1を作成できる。つまり、コンピュータ10は、可能処理だけが並列化された並列プログラムよりも、多くの処理MTが並列化された並列プログラム21a1を作成できる。 As described above, the computer 10 can acquire the direct type information 30 indicating the dependency of the impossible process even if the dependency cannot be analyzed. Then, the computer 10 allocates the impossible process and the possible process to the cores 21c and 21d based on the direct type information 30 and the analysis result in the possible process. Therefore, in the computer 10, in addition to the possible processing, the impossible processing can be parallelized. Therefore, the computer 10 can create a parallel program 21a1 in which more processing MTs are parallelized. That is, the computer 10 can create a parallel program 21a1 in which more processing MTs are parallelized than a parallel program in which only possible processes are parallelized.

なお、コンピュータ10は、自動並列化コンパイラ1を実行することで依存関係を解析する。このため、自動並列化コンパイラ1は、コンピュータ10と同様の効果を奏することができる。 The computer 10 analyzes the dependency by executing the automatic parallelizing compiler 1. Therefore, the automatic parallelizing compiler 1 can have the same effect as the computer 10.

さらに、車載装置20は、より多くの処理MTが並列化された並列プログラム21a1を含んでいる。このため、車載装置20は、各処理MTを最適に実行できる。つまり、車載装置20は、並列プログラム21a1を含んでいるため、第1コア21cと第2コア21dを有効に活用できると言える。言い換えると、車載装置20は、可能処理だけが並列化された並列プログラムを含んでいる場合よりも、第1コア21cと第2コア21dを備えたマルチコアプロセッサ21の性能を発揮しやすい。 Further, the in-vehicle device 20 includes a parallel program 21a1 in which more processing MTs are parallelized. Therefore, the in-vehicle device 20 can optimally execute each processing MT. That is, since the in-vehicle device 20 includes the parallel program 21a1, it can be said that the first core 21c and the second core 21d can be effectively utilized. In other words, the in-vehicle device 20 is more likely to exhibit the performance of the multi-core processor 21 including the first core 21c and the second core 21d than when the in-vehicle device 20 includes a parallel program in which only possible processing is parallelized.

以上、本発明の好ましい実施形態について説明した。しかしながら、本発明は、上記実施形態に何ら制限されることはなく、本発明の趣旨を逸脱しない範囲において、種々の変形が可能である。以下に、本発明のその他の形態として、変形例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, modifications 1 to 5 will be described as other embodiments of the present invention. The above-described embodiments and modifications 1 to 5 can be carried out individually, but can also be carried out in combination as appropriate. The present invention is not limited to the combinations shown in the embodiments, but can be implemented by various combinations.

(変形例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 dependency analysis unit 10b cannot determine whether or not the variables V1 and 0x000000AA have the same data. In the indirect type information 31 in this case, the name of the variable V1 and the name of 0x000000AA are associated with each other. That is, the indirect type information 31 includes information (list) indicating that the variable V1 and 0x000000AA are the same data. Further, the indirect type information 31 is information indicating that the variable V1 and 0x000000AA are the same resource.

このため、コンピュータ10は、間接型情報31を用いることで、第1処理MTと第2処理MTとに依存関係があると判定できる。なお、リソースと、他のリソースとが同じリソースであることを示す各情報は、リストと称することができる。よって、依存関係情報31は、リソース毎のリストを含んでいると言える。 Therefore, the computer 10 can determine that there is a dependency relationship between the first processing MT and the second processing MT by using the indirect type information 31. Note that each information indicating that the resource and other resources are the same resource can be referred to as a list. Therefore, it can be said that the dependency information 31 includes a list for each resource.

変形例1のコンピュータ10は、上記実施形態と同様の効果を奏することができる。同様に、変形例1の自動並列化コンパイラ1及び車載装置20は、上記実施形態と同様の効果を奏することができる。 The computer 10 of the first modification can exert the same effect as that of the above embodiment. Similarly, the automatic parallelizing compiler 1 and the in-vehicle device 20 of the modification 1 can achieve the same effect as that of the above embodiment.

(変形例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 dependency analysis unit 10b can analyze the dependency of the funcA () function, the funcC () function, and the funcD () function. Therefore, the funcA () function, funcC () function, and funcD () function can be regarded as possible processing.

しかしながら、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 dependency analysis unit 10b cannot grasp the resource. Therefore, the dependency analysis unit 10b cannot analyze the dependency of the funcB () function. Therefore, the funcB () function can be regarded as an impossible process. Note that p = 0x ... Is the address of the variable W. That is, the funcB () function is the writing of the variable W and has nothing to do with the variables X, Y, and Z.

この場合、依存関係情報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 computer 10 can grasp the resource to be accessed when each impossible process is executed. Therefore, the computer 10 can grasp the function having the dependency with the impossible processing by referring to the dependency information 32.

なお、図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 computer 10 in the modification 2 executes the automatic parallelizing compiler 1 will be described. The computer 10 generates the parallel program 21a1 by executing the automatic parallelization compiler 1. It should be noted that each step in FIG. 9 can be regarded as corresponding to the procedure in the automatic parallelizing compiler 1.

ステップS20では、未解析の関数をサーチする。コンピュータ10は、シングルプログラムにおける複数の関数の夫々を対象として、個別に図9の処理を実行する。つまり、コンピュータ10は、ステップS20において、シングルプログラムにおける複数の関数のうち、ステップS22以降の処理を行っていない関数をサーチする。言い換えると、コンピュータ10は、シングルプログラムにおける複数の関数から、ステップS12以降の処理を行っていない関数を抽出する。 In step S20, an unanalyzed function is searched. The computer 10 individually executes the process of FIG. 9 for each of the plurality of functions in the single program. That is, in step S20, the computer 10 searches for a function that has not been processed after step S22 among the plurality of functions in the single program. In other words, the computer 10 extracts the functions that have not been processed after step S12 from the plurality of functions in the single program.

なお、今回のステップ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 computer 10 determines whether or not the resource information of the target function extracted in step S20 is included in the dependency information 32. When the dependency information 32 includes the resource information of the target function, the computer 10 considers that the dependency information 32 has the target function and proceeds to step S26. On the contrary, when the dependency information 32 does not include the resource information of the target function, the computer 10 considers that the dependency information 32 does not have the target function and proceeds to step S24.

ステップ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 dependency analysis unit 10b of the computer 10 extracts the dependency of the target function as is well known. In other words, in step S24, the dependency analysis unit 10b of the computer 10 extracts information for determining the dependency in each target function, that is, the access destination resource and the processing content for the resource. Then, the dependency analysis unit 10b of the computer 10 extracts the processing MT having a dependency relationship with the target function.

一方、ステップ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 computer 10 uses the information related to the target process included in the dependency information 32 as the information for analyzing the dependency. In other words, the computer 10 extracts from the dependency information 32 information for determining the dependency in the target function, that is, the resource to be accessed and the processing content for the resource. For example, when the target function is the funcB () function, the computer 10 adopts the writing of the variable W as the information for analyzing the dependency in the funcB () function. That is, the computer 10 extracts from the dependency information 32 the information about the funcB () function, that is, the writing of the variable W.

ステップ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 computer 10 adds the information for analyzing the dependency extracted in step S24 and the information for analyzing the dependency extracted in step S26 to the processing MT to which each target function belongs.

コンピュータ10は、ステップS20〜S28を繰り返し実行することで、シングルプログラムにおける全ての処理MTを対象として図9のフローチャートを実行する。そして、コンピュータ10は、依存関係情報と、依存関係解析部10bで解析した解析結果とに基づいて、不能処理と可能処理を、依存関係を満たしつつ各コアに割り当てる。この結果、funcA()関数〜funcD()関数は、図10に示すように並列化される。なお、図10では、各処理MTに、関数として一つの関数のみが含まれている例を採用している。 By repeatedly executing steps S20 to S28, the computer 10 executes the flowchart of FIG. 9 for all the processing MTs in the single program. Then, the computer 10 allocates impossible processing and possible processing to each core while satisfying the dependency relationship, based on the dependency information and the analysis result analyzed by the dependency analysis unit 10b. As a result, the funcA () and funcD () functions are parallelized as shown in FIG. In FIG. 10, an example is adopted in which each processing MT includes only one function as a function.

変形例2のコンピュータ10は、上記実施形態と同様の効果を奏することができる。同様に、変形例2の自動並列化コンパイラ1及び車載装置20は、上記実施形態と同様の効果を奏することができる。さらに、処理MTよりも細かい単位で分担してソフト開発している場合であっても、変形例2のコンピュータ10及び自動並列化コンパイラ1は、上記実施形態と同様の効果を奏することができる。 The computer 10 of the second modification can exert the same effect as that of the above embodiment. Similarly, the automatic parallelizing compiler 1 and the in-vehicle device 20 of the second modification can achieve the same effects as those of the above embodiment. Further, even when the software is developed in units smaller than the processing MT, the computer 10 and the automatic parallelizing compiler 1 of the modification 2 can achieve the same effect as that of the above embodiment.

(変形例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 dependency information 33, which is the direct type information shown in FIG. 12, and the dependency information 34, which is the indirect type information shown in FIG. 13, can be adopted. In the dependency information 33, the twelfth processing MT and the thirteenth processing MT are associated with the eleventh processing MT as the processing MT names having a dependency relationship. Further, in the dependency information 33, the 11th processing MT is associated with the 12th processing MT and the 13th processing MT as the processing MT names having a dependency relationship. The dependency information 33 includes a case where each item is managed as a separate list.

一方、依存関係情報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 dependency information 34, the variable V1 which is the access destination resource in the 11th processing MT and the Write which is the processing content for the variable V1 of the 11th processing MT are associated with the 11th processing MT. There is. Further, the 11th processing MT is associated with the variable V2 which is the access destination resource in the 11th processing MT and the Write which is the processing content for the variable V2 of the 11th processing MT.

さらに、依存関係情報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 dependency information 34, the variable V1 which is the access destination resource in the 12th processing MT and the Read which is the processing content for the variable V1 of the 12th processing MT are associated with the 12th processing MT. There is. Further, in the dependency information 34, the variable V2, which is the access destination resource in the 13th processing MT, and the Read, which is the processing content for the variable V2 of the 13th processing MT, are associated with the 13th processing MT. There is. The dependency information 34 includes a case where the dependency information 34 is managed as a separate list for each processing MT.

変形例3のコンピュータ10は、上記実施形態と同様の効果を奏することができる。同様に、変形例3の自動並列化コンパイラ1及び車載装置20は、上記実施形態と同様の効果を奏することができる。 The computer 10 of the third modification can exert the same effect as that of the above embodiment. Similarly, the automatic parallelizing compiler 1 and the in-vehicle device 20 of the modification 3 can exert the same effect as that of the above embodiment.

(変形例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 dependency information 35 which is the indirect type information shown in FIG. 15 and the dependency information 36 which is the indirect type information shown in FIG. 16 can be adopted.

依存関係情報35は、図13と同様に、各処理単位に対して、各処理単位におけるアクセス先のリソースと、各処理単位のアクセス先であるリソースに対する処理内容とが紐付けられている。さらに、依存関係情報35は、同一のリソースを示す複数の名称どうしが紐付けられている。例えば、図15に示すように、依存関係情報35は、0xFFFF0000とUnknown2とが紐付けられており、Unknown3とUnknown4とが紐付けされている。このようにすることで、コンピュータ10は、同じリソースであるにもかかわらず、各処理単位で異なる名称が定義されていた場合であっても依存関係を解析できる。さらに、コンピュータ10は、各処理単位で定義されたリソース名の整合をとらなくてもよい。 In the dependency information 35, as in FIG. 13, for each processing unit, the resource of the access destination in each processing unit and the processing content for the resource that is the access destination of each processing unit are associated with each other. Further, the dependency information 35 is associated with a plurality of names indicating the same resource. For example, as shown in FIG. 15, in the dependency information 35, 0xFFFF0000 and Unknown2 are associated with each other, and Unknown3 and Unknown4 are associated with each other. By doing so, the computer 10 can analyze the dependency even if different names are defined for each processing unit even though the resources are the same. Further, the computer 10 does not have to make the resource names defined in each processing unit consistent.

依存関係情報36は、同一のリソースを示す複数の名称どうしが紐付けられており、且つ、その名称と、名称のリソースが定義されたモジュールとが紐付けられている。例えば、図16に示すように、第1モジュールに変数V1が紐付けされている。また、第2モジュールには、Unknown2が紐付けされている。 In the dependency information 36, a plurality of names indicating the same resource are associated with each other, and the name and the module in which the resource of the name is defined are associated with each other. For example, as shown in FIG. 16, the variable V1 is associated with the first module. In addition, Unknown2 is associated with the second module.

変形例4のコンピュータ10は、上記実施形態と同様の効果を奏することができる。同様に、変形例4の自動並列化コンパイラ1及び車載装置20は、上記実施形態と同様の効果を奏することができる。 The computer 10 of the modified example 4 can exert the same effect as that of the above embodiment. Similarly, the automatic parallelizing compiler 1 and the in-vehicle device 20 of the modified example 4 can achieve the same effect as that of the above embodiment.

(変形例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 computer 10 that is assigned to each core while satisfying the dependency is adopted for each processing MT including at least one function. Therefore, the automatic parallelizing compiler 1 includes a procedure of allocating to each core while satisfying the dependency for each processing MT including at least one function. Further, in the modification 5, as shown in FIG. 17, a single program including the 21st processing MT, the 22nd processing MT, and the like is adopted.

コンピュータ10は、並列化解析の対象である処理全体の関数コール関係を抽出する。コンピュータ10は、関数コール関係に沿って関数をサーチする。コンピュータ10は、対象関数内のリスト入力の対象処理の有無を判断する。コンピュータ10は、対象関数内のリソースアクセスを解析する。コンピュータ10は、リスト入力の対象範囲を特定する。なお、このリスト入力の対象範囲とは、リソースアクセスのリストに書かれる関数を指している。つまり、リストにより、リソースアクセスが紐付けられる処理単位(MTや関数)のことである。 The computer 10 extracts the function call relationship of the entire process that is the target of the parallel analysis. The computer 10 searches for a function according to the function call relationship. The computer 10 determines whether or not there is a target process for list input in the target function. The computer 10 analyzes the resource access in the target function. The computer 10 specifies the target range of the list input. The target range of this list input refers to the function written in the resource access list. In other words, it is a processing unit (MT or function) to which resource access is associated with a list.

コンピュータ10は、依存関係情報からリストを読み取る。コンピュータ10は、対象関数内の処理において、対象範囲については取得したリストをソースアクセス情報として記憶し、対象外についてはリソースアクセス解析結果を対象関数のリソースアクセス情報として記憶する。コンピュータ10は、各対象関数の記憶結果を関数コール関係に従い、処理MTとなるまで親関数の情報としてマージする。よって、上位の関数である上位関数と上位関数にコールされる下位の関数である下位関数とを含む処理MTの依存関係情報は、処理MTに含まれている最上位の上位関数の情報としてマージされている。 Computer 10 reads the list from the dependency information. In the processing in the target function, the computer 10 stores the acquired list as the source access information for the target range, and stores the resource access analysis result as the resource access information of the target function for the non-target function. The computer 10 merges the storage result of each target function as the information of the parent function until the processing MT is reached according to the function call relationship. Therefore, the dependency information of the processing MT 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 processing MT. Has been done.

つまり、コンピュータ10は、処理MT内における不能処理と可能処理とを判定する。なお、ここでの不能処理は、人間が不能処理と判断してリソースアクセスリストを入力した処理を指している。一方、ここでの可能処理は、不能処理以外の処理を指している。そして、コンピュータ10は、依存関係情報から不能処理に対応するリソースアクセス情報を取得して記憶するとともに、可能処理のリソースアクセス情報を記憶する。さらに、コンピュータ10は、記憶したリソースアクセス情報を、処理MTにおける最上位の関数(親関数)のリソースアクセス情報としてマージする。よって、この処理MTの依存関係情報、すなわちリソースアクセス情報は、処理MT内の不能処理のリソースアクセス情報と、可能処理のリソースアクセス情報とがマージされた情報となっている。 That is, the computer 10 determines the impossible processing and the possible processing in the processing MT. The impossible process here refers to a process in which a human determines that the process is impossible and inputs a resource access list. On the other hand, the possible processing here refers to processing other than the impossible processing. Then, the computer 10 acquires and stores the resource access information corresponding to the impossible processing from the dependency information, and also stores the resource access information of the possible processing. Further, the computer 10 merges the stored resource access information as the resource access information of the highest-level function (parent function) in the processing MT. Therefore, the dependency information of the processing MT, that is, the resource access information is the information obtained by merging the resource access information of the impossible processing in the processing MT and the resource access information of the possible processing.

なお、対象範囲は、処理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 computer 10 does not analyze (extract) the resource access information in the function F2, but acquires and stores the resource access information from the dependency information. For example, the resource access information of the function F2 is a write to the variable y. Further, the computer 10 moves on to the analysis of the subfunction F4 of the function F2.

また、コンピュータ10は、関数F3が変数xにWriteしている可能処理であるため、依存関係情報からリソースアクセス情報を取得しない。そして、コンピュータ10は、変数xにWriteしていることを、関数F3のリソースアクセス情報として記憶する。 Further, since the computer 10 is a possible process in which the function F3 writes to the variable x, the computer 10 does not acquire the resource access information from the dependency information. Then, the computer 10 stores that the variable x is being written as the resource access information of the function F3.

さらに、コンピュータ10は、指示子の指定範囲のリソースアクセス情報を解析(抽出)せず、依存関係情報からリソースアクセス情報を取得して記憶する。例えば、指示子の指定範囲のリソースアクセス情報は、第3モジュールに定義されているUnknown4というリソースへのWriteである。 Further, the computer 10 does not analyze (extract) the resource access information in the specified range of the indicator, but acquires and stores the resource access information from the dependency information. For example, the resource access information in the specified range of the specifier is a write to the resource called Unknown4 defined in the third module.

そして、コンピュータ10は、上記のように記憶した複数のリソースアクセス情報を、関数F1のリソースアクセス情報としてマージする。つまり、第21処理MT配下の関数のリソースアクセス情報をマージした結果、第21処理MTは、変数x、変数y、変数v、変数w、及び第3モジュールに定義されているUnknown5というリソースに対して書込みを行う処理となる。コンピュータ10は、依存関係の解析時に、マージしたリソースアクセス情報を用いる。なお、第21処理MTは、上記のリソース(データ等)に対して同様にアクセスを行う他の処理MTとの間に依存関係が発生する。 Then, the computer 10 merges the plurality of resource access information stored as described above as the resource access information of the function F1. That is, as a result of merging the resource access information of the functions under the 21st processing MT, the 21st processing MT has a variable x, a variable y, a variable v, a variable w, and a resource called Unknown5 defined in the third module. It is a process of writing. The computer 10 uses the merged resource access information when analyzing the dependency. The 21st processing MT has a dependency relationship with other processing MTs that similarly access the above resources (data, etc.).

変形例5のコンピュータ10は、上記実施形態と同様の効果を奏することができる。同様に、変形例5の自動並列化コンパイラ1及び車載装置20は、上記実施形態と同様の効果を奏することができる。 The computer 10 of the modified example 5 can exert the same effect as that of the above embodiment. Similarly, the automatic parallelizing compiler 1 and the in-vehicle device 20 of the modified example 5 can achieve the same effect as that of the above embodiment.

さらに、変形例5のコンピュータ10は、各関数毎(ソフト開発担当者毎)に解析可否判断(解析できない部分の明確化)及び解析不能部分の情報を取得できる。よって、変形例5のコンピュータ10は、従来の解析不能部分も含めて依存関係の解析と並列化が可能となる。 Further, the computer 10 of the modified example 5 can determine whether or not analysis is possible (clarification of the part that cannot be analyzed) and information on the part that cannot be analyzed for each function (for each person in charge of software development). Therefore, the computer 10 of the modified example 5 can analyze and parallelize the dependency relationship including the conventional unanalyzable part.

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)

コアが一つであるシングルコアマイコン用のシングルプログラムにおける複数の処理単位の依存関係を解析して、前記シングルプログラムから複数の前記コア(21c、21d)を有するマルチコアマイコン(21)用の並列プログラム(21a1)を生成する並列化方法であって、
複数の前記処理単位における前記依存関係の解析が不能な不能処理に対する、前記依存関係を判断するための依存関係情報を取得する取得手順(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.
前記依存関係情報は、前記不能処理と前記依存関係がある前記処理単位の名称を含んでいる請求項1に記載の並列化方法。 The parallelization method according to claim 1, wherein the dependency information includes the name of the processing unit having the dependency relationship with the impossible processing. 前記依存関係情報は、前記不能処理が実行される際にアクセスされるリソースの名称を含んでいる請求項1に記載の並列化方法。 The parallelization method according to claim 1, wherein the dependency information includes a name of a resource to be accessed when the impossible processing is executed. 同一の前記リソースへのアクセスを示す複数の前記処理単位の夫々において、前記リソースに対して異なる名称が定義されている場合、前記依存関係情報は、同一の前記リソースを示す複数の前記名称どうしが紐付けられている請求項3に記載の並列化方法。 When different names are defined for the resource in each of the plurality of processing units indicating access to the same resource, the dependency information includes the plurality of the names indicating the same resource. The parallelization method according to claim 3, which is linked. 前記シングルプログラムが複数の翻訳単位を含んで構成されており、各翻訳単位は、他の翻訳単位と重複することなく前記リソースが定義されるものであって、
前記依存関係情報は、同一の前記リソースを示す複数の前記名称どうしが紐付けられており、且つ、前記名称と、前記名称の前記リソースが定義された前記翻訳単位とが紐付けられている請求項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.
コアが一つであるシングルコアマイコン用のシングルプログラムにおける複数の処理単位の依存関係を解析して、前記シングルプログラムから複数の前記コア(21c、21d)を有するマルチコアマイコン(21)用の並列プログラム(21a1)を生成する、コンピュータを含む並列化ツールであって、
複数の前記処理単位における前記依存関係の解析が不能な不能処理に対する、前記依存関係を判断するための依存関係情報を取得する取得部(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.
前記依存関係情報は、前記不能処理と依存関係がある前記処理単位の名称を含んでいる請求項に記載の並列化ツール。 The parallelization tool according to claim 6 , wherein the dependency information includes a name of the processing unit that has a dependency relationship with the impossible processing. 前記依存関係情報は、前記不能処理が実行される際にアクセスされるリソースの名称を含んでいる請求項に記載の並列化ツール。 The parallelization tool according to claim 6 , wherein the dependency information includes a name of a resource to be accessed when the impossible processing is executed. 同一の前記リソースへのアクセスを示す複数の前記処理単位の夫々において、前記リソースに対して異なる名称が定義されている場合、前記依存関係情報は、同一の前記リソースを示す複数の前記名称どうしが紐付けられている請求項に記載の並列化ツール。 When different names are defined for the resource in each of the plurality of processing units indicating access to the same resource, the dependency information includes the plurality of the names indicating the same resource. The parallelization tool according to claim 8 , which is linked. 前記シングルプログラムが複数の翻訳単位を含んで構成されており、各翻訳単位は、他の翻訳単位と重複することなく前記リソースが定義されるものであって、
前記依存関係情報は、同一の前記リソースを示す複数の前記名称どうしが紐付けられており、且つ、前記名称と、前記名称の前記リソースが定義された前記翻訳単位とが紐付けられている請求項に記載の並列化ツール。
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.
JP2017109497A 2016-06-13 2017-06-01 Parallelization method, parallelization tool Active JP6933001B2 (en)

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)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7095513B2 (en) * 2018-02-21 2022-07-05 株式会社デンソー Multi-core microcomputers and in-vehicle devices

Also Published As

Publication number Publication date
JP2017224288A (en) 2017-12-21

Similar Documents

Publication Publication Date Title
US10095657B2 (en) Processor, accelerator, and direct memory access controller within a core reading/writing local synchronization flag area for parallel
JP6018022B2 (en) Parallel compilation method, parallel compiler, parallel compilation device, and in-vehicle device
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
JP6427055B2 (en) Parallelizing compilation method and parallelizing compiler
Carle et al. Predicate-aware, makespan-preserving software pipelining of scheduling tables
US11915056B2 (en) Combination of multiple data processing and machine learning frameworks for a target hardware
Pinho et al. High Performance Embedded Computing
JP6933001B2 (en) Parallelization method, parallelization tool
Amiri et al. FLOWER: A comprehensive dataflow compiler for high-level synthesis
JP2016192152A (en) Juxtaposed compilation method, juxtaposed compiler, and on-vehicle device
JP2016143378A (en) Parallelization compilation method, parallelization compiler, and electronic device
Janik et al. An overview of altera sdk for opencl: A user perspective
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
JP6933063B2 (en) Parallelization method, parallelization tool, in-vehicle device
JP7059776B2 (en) Parallelization method, parallelization tool, and multi-core microcontroller

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 Written amendment

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