JP2017091098A - Parallelization method, parallelization tool, and car onboard device - Google Patents

Parallelization method, parallelization tool, and car onboard device Download PDF

Info

Publication number
JP2017091098A
JP2017091098A JP2015218667A JP2015218667A JP2017091098A JP 2017091098 A JP2017091098 A JP 2017091098A JP 2015218667 A JP2015218667 A JP 2015218667A JP 2015218667 A JP2015218667 A JP 2015218667A JP 2017091098 A JP2017091098 A JP 2017091098A
Authority
JP
Japan
Prior art keywords
core
microcomputer
assembly language
program
analysis
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.)
Pending
Application number
JP2015218667A
Other languages
Japanese (ja)
Inventor
憲一 峰田
Kenichi Mineda
憲一 峰田
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 JP2015218667A priority Critical patent/JP2017091098A/en
Priority to DE102016221570.1A priority patent/DE102016221570A1/en
Publication of JP2017091098A publication Critical patent/JP2017091098A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/45Exploiting coarse grain parallelism in compilation, i.e. parallelism between groups of instructions
    • G06F8/451Code distribution

Abstract

PROBLEM TO BE SOLVED: To provide a parallelization method and a parallelization tool with which it is possible to create a parallel program that allows a multicore microcomputer to execute each MT at fastest speed, and an on-vehicle device that allows a multicore microcomputer to execute each MT at fastest speed.SOLUTION: A computer 10 expands a single program into an assembly language, and analyzes the dependency relation of each process in the assembly language (10a-10c). The computer 10 expands the single program into the assembly language by a second compiler 10g that is capable of expanding into the assembly language that includes special instructions peculiar to a multicore processor 21. Meanwhile, the computer 10 estimates an execution time in each process on the basis of the number of execution cycles of each instruction included in the assembly language expanded by the second compiler 10g. Then, on the basis of the analyzed dependency relation and the estimated execution time, the computer 10 allocates each process to each core and generates a parallel program so that each process satisfies the dependency relation.SELECTED DRAWING: Figure 3

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 on which the parallel program generated by the parallelization method is mounted.

従来、シングルコアマイコン用のシングルプログラムから、マルチコアマイコン用の並列プログラムを生成する並列化方法の一例として特許文献1に開示された並列化コンパイル方法がある。   Conventionally, there is a parallel compilation method disclosed in Patent Document 1 as an example of a parallel 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, an intermediate language is generated by performing lexical analysis and syntactic analysis on the source code of a single program, and using this intermediate language, dependency analysis and optimization of multiple macro tasks (hereinafter referred to as processing MTs) are performed. To make it. In the parallel compilation method, scheduling is performed based on the dependency relationship of each process MT and the execution time for each process MT to generate a parallel program, and the parallel program is converted into binary data.

特開2015−1807号公報Japanese Patent Laid-Open No. 2015-1807

ところで、通常、マルチコアマイコンなどのマイコンは、機種や仕様すなわち種類によって、機能や性能などが異なる。このため、従来技術ではないが、並列化ツールで並列プログラムのソースコードを生成し、このソースコードを並列化ツールとは別体に設けられたコンパイラでバイナリデータに変換することも考えられる。つまり、このコンパイラは、汎用的な命令に加えて、対象のマイコンが実行可能な特殊命令を考慮し、ソースコードをアセンブリ言語に展開するなどしてバイナリデータを生成する。よって、このコンパイラは、対象のマイコンに特化したものが多く汎用性が低い。なお、対象のマイコンとは、コンパイルしたプログラムを実行するマイコンである。一方、並列化ツールは、汎用的な命令には対応しているものの、特殊命令には対応していないことが考えられる。   By the way, normally, a microcomputer such as a multi-core microcomputer has different functions and performance depending on the model and specifications, that is, the type. For this reason, although it is not a prior art, it is also conceivable to generate a parallel program source code with a parallelization tool and convert the source code into binary data with a compiler provided separately from the parallelization tool. That is, the compiler generates binary data by developing a source code into an assembly language in consideration of special instructions that can be executed by the target microcomputer in addition to general-purpose instructions. Therefore, many of these compilers are specialized for the target microcomputer and have low versatility. The target microcomputer is a microcomputer that executes a compiled program. On the other hand, it can be considered that the parallelization tool supports general-purpose instructions but does not support special instructions.

よって、並列化ツールでは、シングルプログラムのソースコードからアセンブリ言語に展開した際に、特殊命令を含んでいないアセンブリ言語に展開することになる。このように、並列化ツールでは、シングルプログラムのソースコードを字句解析や構文解析を行って展開したアセンブリ言語における命令が、マイコンで実際に実行される命令と異なることがある。つまり、比較例の並列化ツールでは、並列化ツールで生成したアセンブリ言語における命令が、コンパイラで生成したアセンブリ言語における命令と異なることがある。   Therefore, in the parallelization tool, when the source code of the single program is expanded to the assembly language, it is expanded to an assembly language that does not include special instructions. As described above, in the parallelization tool, an instruction in an assembly language obtained by developing a single program source code through lexical analysis or syntax analysis may be different from an instruction actually executed by a microcomputer. That is, in the parallelization tool of the comparative example, the instruction in the assembly language generated by the parallelization tool may be different from the instruction in the assembly language generated by the compiler.

このため、この並列化ツールは、汎用的な命令の実行サイクル数を考慮して各処理MTの実行時間を見積もることはできるものの、特殊命令まで考慮して各処理MTの実行時間を見積もることができない。また、各命令の実行サイクル数は、マイコンの機能や性能によって異なる。   Therefore, although this parallelization tool can estimate the execution time of each process MT in consideration of the number of execution cycles of general-purpose instructions, it can estimate the execution time of each process MT in consideration of special instructions. Can not. In addition, the number of execution cycles of each instruction varies depending on the function and performance of the microcomputer.

従って、この並列化ツールでは、各処理MTにおける実行時間の推定値が、実際にマイコンで各処理MTを実行した場合の実行時間と異なることとなり、最適にスケジューリングできないということが起こりうる。よって、比較例の並列化ツールでは、マルチコアマイコンが各処理MTを最速で実行できない並列プログラムを生成してしまうという問題がある。   Therefore, in this parallelization tool, the estimated value of the execution time in each process MT is different from the execution time when each process MT is actually executed by the microcomputer, and it may occur that scheduling cannot be performed optimally. Therefore, the parallelization tool of the comparative example has a problem that the multicore microcomputer generates a parallel program that cannot execute each processing MT at the highest speed.

本発明は、上記問題点に鑑みなされたものであり、マルチコアマイコンが各処理MTを最速で実行可能な並列プログラムを作成できる並列化方法、並列化ツール、及びマルチコアマイコンが各処理MTを最速で実行可能な車載装置を提供することを目的とする。   The present invention has been made in view of the above problems, and a parallelization method, a parallelization tool, and a multicore microcomputer capable of creating a parallel program that allows a multicore microcomputer to execute each process MT at the highest speed. An object is to provide an in-vehicle device that can be executed.

上記目的を達成するために本発明は、
コアが一つであるシングルコアマイコン用のシングルプログラムにおける命令を少なくとも一つ含む複数の処理(MT0〜MT11)から、複数のコア(21c、21d)を有するマルチコアマイコン(21)用に並列化した並列プログラム(21a1)を生成する並列化方法であって、
並列プログラムは、マルチコアマイコンに対応したマイコン用コンパイラによって、字句解析及び構文解析が行われてアセンブリ言語に展開されてバイナリデータにコンパイルされるものであり、
シングルプログラムの字句解析及び構文解析を行いアセンブリ言語に展開する第1展開手順(10a、10b)と、
第1展開手順で展開されたアセンブリ言語における各処理の依存関係を解析する解析手順(10c)と、
シングルプログラムをマイコン用コンパイラによって字句解析及び構文解析を行いアセンブリ言語に展開する第2展開手順(10g1〜10g3)を含み、
第2展開手順で展開されたアセンブリ言語に含まれる各命令の実行サイクル数に基づいて、各処理における実行時間を見積る見積手順(10d)と、
解析手順によって解析された依存関係と、見積手順によって見積られた実行時間とに基づいて、各処理が依存関係を満たすように、各処理を各コアに割り付けて並列プログラムを生成するスケジューリング手順(10e、10f)と、を備えていることを特徴とする。
In order to achieve the above object, the present invention provides:
A plurality of processes (MT0 to MT11) including at least one instruction in a single program for a single core microcomputer having one core are parallelized for a multicore microcomputer (21) having a plurality of cores (21c, 21d). A parallelization method for generating a parallel program (21a1),
A parallel program is a program for a microcomputer that is compatible with a multi-core microcomputer, is subjected to lexical analysis and syntax analysis, expanded into assembly language, and compiled into binary data.
A first expansion procedure (10a, 10b) for performing lexical analysis and syntax analysis of a single program and expanding it into an assembly language;
An analysis procedure (10c) for analyzing the dependency of each process in the assembly language expanded in the first expansion procedure;
Including a second expansion procedure (10g1 to 10g3) for expanding a single program into assembly language by performing lexical analysis and syntax analysis by a compiler for a microcomputer;
An estimation procedure (10d) for estimating the execution time in each process based on the number of execution cycles of each instruction included in the assembly language expanded in the second expansion procedure;
A scheduling procedure (10e) that allocates each process to each core and generates a parallel program so that each process satisfies the dependency, based on the dependency analyzed by the analysis procedure and the execution time estimated by the estimation procedure. 10f).

このように、本発明は、マルチコアマイコンに対応したマイコン用コンパイラによってシングルプログラムを字句解析及び構文解析を行いアセンブリ言語に展開する。そして、本発明は、このアセンブリ言語に含まれる各命令の実行サイクル数に基づいて、各処理における実行時間を見積る。よって、本発明は、実際にマルチコアマイコンが実行する命令の実行サイクル数に基づいて、実行時間を見積ることができる。このため、本発明は、見積った各処理の実行時間が、実際にマルチコアマイコンで各処理を実行した場合の実行時間と異なることを抑制できる。   As described above, according to the present invention, a single program is subjected to lexical analysis and syntax analysis by a microcomputer compiler corresponding to a multi-core microcomputer, and is expanded into an assembly language. The present invention estimates the execution time in each process based on the number of execution cycles of each instruction included in the assembly language. Therefore, the present invention can estimate the execution time based on the number of execution cycles of instructions actually executed by the multi-core microcomputer. For this reason, this invention can suppress that the execution time of each estimated process differs from the execution time at the time of actually performing each process with a multi-core microcomputer.

そして、本発明は、この実行時間と依存関係とに基づいて、複数の処理の夫々が依存関係を満たすように、複数の処理の夫々を各コアに割り付けて並列プログラムを生成する。よって、本発明は、マルチコアマイコンが各処理を最速で実行可能な並列プログラムを作成できる。   Then, the present invention generates a parallel program by allocating each of the plurality of processes to each core so that each of the plurality of processes satisfies the dependency based on the execution time and the dependency. Therefore, the present invention can create a parallel program that allows the multi-core microcomputer to execute each process at the highest speed.

また、本発明のさらなる特徴は、
コアが一つであるシングルコアマイコン用のシングルプログラムにおける命令を少なくとも一つ含む複数の処理(MT0〜MT11)から、複数のコア(21c、21d)を有するマルチコアマイコン(21)用に並列化した並列プログラム(21a1)を生成する、コンピュータを含む並列化ツールであって、
並列プログラムは、マルチコアマイコンに対応したマイコン用コンパイラによって、字句解析及び構文解析が行われてアセンブリ言語に展開されてバイナリデータにコンパイルされるものであり、
シングルプログラムの字句解析及び構文解析を行いアセンブリ言語に展開する第1展開部(10a、10b)と、
第1展開手順で展開されたアセンブリ言語における各処理の依存関係を解析する解析部(10c)と、
シングルプログラムをマイコン用コンパイラによって字句解析及び構文解析を行いアセンブリ言語に展開する第2展開部(10g1〜10g3)を含み、
第2展開手順で展開されたアセンブリ言語に含まれる各命令の実行サイクル数に基づいて、各処理における実行時間を見積る見積部(10d)と、
解析部によって解析された依存関係と、見積部によって見積られた実行時間とに基づいて、各処理が依存関係を満たすように、各処理を各コアに割り付けて並列プログラムを生成するスケジューリング部(10e、10f)と、を備えている点にある。
Further features of the invention include
A plurality of processes (MT0 to MT11) including at least one instruction in a single program for a single core microcomputer having one core are parallelized for a multicore microcomputer (21) having a plurality of cores (21c, 21d). A parallelization tool including a computer for generating a parallel program (21a1),
A parallel program is a program for a microcomputer that is compatible with a multi-core microcomputer, is subjected to lexical analysis and syntax analysis, expanded into assembly language, and compiled into binary data.
A first expansion unit (10a, 10b) that performs lexical analysis and syntax analysis of a single program and expands the assembly language;
An analysis unit (10c) for analyzing the dependency of each process in the assembly language expanded in the first expansion procedure;
Including a second expansion unit (10g1 to 10g3) for analyzing a lexical analysis and a syntax analysis of a single program by a compiler for a microcomputer into an assembly language,
An estimation unit (10d) for estimating an execution time in each process based on the number of execution cycles of each instruction included in the assembly language expanded in the second expansion procedure;
Based on the dependency relationship analyzed by the analysis unit and the execution time estimated by the estimation unit, a scheduling unit (10e) that allocates each process to each core and generates a parallel program so that each process satisfies the dependency relationship 10f).

これによって、上記と同様に、マルチコアマイコンが各処理を最速で実行可能な並列プログラムを作成できる。   As a result, similarly to the above, it is possible to create a parallel program that allows the multi-core microcomputer to execute each process at the fastest speed.

また、本発明のさらなる特徴は、
複数のコア(21c、21d)を有するマルチコアマイコン(21)と、コアが一つであるシングルコアマイコン用のシングルプログラムにおける命令を少なくとも一つ含む複数の処理(MT0〜MT11)からマルチコアマイコン用に並列化された並列プログラム(21a1)と、を備えた車載装置であって、
並列プログラムは、マルチコアマイコンに対応したマイコン用コンパイラによって、字句解析及び構文解析が行われてアセンブリ言語に展開されてバイナリデータにコンパイルされたものであり、
シングルプログラムの字句解析及び構文解析を行い展開されたアセンブリ言語における各処理の依存関係が解析され、
シングルプログラムをマイコン用コンパイラによって字句解析及び構文解析を行い展開されたアセンブリ言語に含まれる各命令の実行サイクル数に基づいて、各処理における実行時間が見積られ、
依存関係と実行時間とに基づいて、各処理が依存関係を満たすように、複数の処理の夫々を各コアに割り付けており、
マルチコアマイコンは、各コアが自身に割り付けられた処理を実行する点にある。
Further features of the invention include
A multi-core microcomputer (21) having a plurality of cores (21c, 21d) and a plurality of processes (MT0 to MT11) including at least one instruction in a single program for a single-core microcomputer having one core are used for a multi-core microcomputer. A parallelized parallel program (21a1), and an in-vehicle device comprising:
The parallel program is a lexical analysis and syntactic analysis performed by a microcomputer compiler that supports multi-core microcomputers, expanded into assembly language, and compiled into binary data.
The dependency of each process in the expanded assembly language is analyzed by lexical analysis and syntax analysis of a single program,
The execution time in each process is estimated based on the number of execution cycles of each instruction included in the assembly language expanded by analyzing the lexical analysis and syntax analysis of the single program by the compiler for microcomputers.
Based on the dependency and execution time, each processing is assigned to each core so that each processing satisfies the dependency.
The multi-core microcomputer is that each core executes a process assigned to itself.

これによって、本発明は、上記のように、マルチコアマイコンが各処理を最速で実行可能な並列プログラムを含んでいる。このため、このように、本発明は、各処理を最速で実行できる。   Thus, as described above, the present invention includes a parallel program that allows the multi-core microcomputer to execute each process at the highest speed. Therefore, in this way, the present invention can execute each process at the fastest speed.

なお、特許請求の範囲、及びこの項に記載した括弧内の符号は、ひとつの態様として後述する実施形態に記載の具体的手段との対応関係を示すものであって、発明の技術的範囲を限定するものではない。   The reference numerals in parentheses described in the claims and in this section indicate the correspondence with the specific means described in the embodiments described later as one aspect, and the technical scope of the invention is as follows. It is not limited.

第1実施形態におけるコンピュータの概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the computer in 1st Embodiment. 第1実施形態における車載装置の概略構成を示すブロック図である。It is a block diagram which shows schematic structure of the vehicle-mounted apparatus in 1st Embodiment. 実施形態におけるコンピュータの機能を示すブロック図である。It is a block diagram which shows the function of the computer in embodiment. 実施形態におけるシングルプログラムを示すイメージ図である。It is an image figure which shows the single program in embodiment. 実施形態における並列プログラムを示すイメージ図である。It is an image figure which shows the parallel program in embodiment.

以下において、図面を参照しながら、発明を実施するための形態を説明する。本実施形態では、コアが一つであるシングルコアマイコン用のシングルプログラムにおける複数の処理MT0〜MT11などから第1コア21cと第2コア21dを有するマルチコアプロセッサ21用に並列化した並列プログラム21a1を生成する例を採用する。この処理は、処理ブロックやマクロタスクなどと言い換えることができる。また、この処理は、第1コア21cや第2コア21dが実行可能な命令を少なくとも一つ含んでいる。なお、プロセッサは、マイコンと言い換えることができる。よって、マルチコアプロセッサは、マルチコアマイコンと言い換えることができる。   Hereinafter, embodiments for carrying out the invention will be described with reference to the drawings. In the present embodiment, a parallel program 21a1 parallelized for a multicore processor 21 having a first core 21c and a second core 21d from a plurality of processes MT0 to MT11 in a single program for a single core microcomputer having one core is provided. Take the example of generating. This process can be paraphrased as a process block or a macro task. In addition, this process includes at least one instruction that can be executed by the first core 21c and the second core 21d. The processor can be rephrased as a microcomputer. Therefore, the multi-core processor can be rephrased as a multi-core microcomputer.

このように、並列プログラム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 limit problem of the clock frequency. The multi-core processor 21 needs to be applied also in the field of in-vehicle devices. In addition, the parallel program 21a1 is required to have a highly reliable and high-speed process execution while suppressing the software development period and development cost.

なお、並列プログラム21a1を生成する際には、シングルプログラムにおける複数の処理MT0〜MT11の依存関係を解析して、複数の処理MT0〜MT11をマルチコアプロセッサ21の異なるコア21c、21dに割り振る(言い換えると、割り付ける)。この点に関しては、特開2015−1807号公報を参照されたい。なお、本実施形態では、一例として、C言語で記述されたシングルプログラムを採用する。しかしながら、本発明は、これに限定されない。シングルプログラムは、C言語とは異なるプログラミング言語で記述されていてもよい。   When the parallel program 21a1 is generated, the dependency relationship between the processes MT0 to MT11 in the single program is analyzed, and the processes MT0 to MT11 are allocated to the different cores 21c and 21d of the multicore processor 21 (in other words, , Assign). Regarding this point, refer to JP-A-2015-1807. In this embodiment, as an example, a single program written in C language is adopted. However, the present invention is not limited to this. The single program may be described in a programming language different from the C language.

本実施形態では、図4に示すように、シングルプログラムの一例として、第1処理MT0〜第12処理MT11を備えたものを採用する。この複数の処理MT0〜MT11は、お互いに依存関係がある処理MTが含まれている。図4では、依存関係がある処理同士を矢印で繋いで図示している。よって、本実施形態では、例えば第1処理MT0と第4処理MT3などが、依存関係がある。   In the present embodiment, as shown in FIG. 4, as an example of a single program, a program including a first process MT0 to a twelfth process MT11 is employed. The plurality of processes MT0 to MT11 include processes MT that are dependent on each other. In FIG. 4, processes having dependency relationships are shown connected by arrows. Therefore, in the present embodiment, for example, the first process MT0 and the fourth process MT3 have a dependency relationship.

依存関係とは、例えば、ある処理が、自身よりも先に実行された処理で更新されたデータを参照するなどの関係である。つまり、複数の処理は、シングルプログラムにおける実行順序が先である先行処理と、先行処理の実行が完了した後に実行させる後行処理とを含んでいる。そして、後行処理は、先行処理の影響を受ける処理であり、例えば、先行処理で内容が更新される可能性があるデータなどを用いる処理である。   The dependency relationship is, for example, a relationship in which a certain process refers to data updated by a process executed before itself. That is, the plurality of processes includes a preceding process whose execution order in the single program is first, and a succeeding process that is executed after the execution of the preceding process is completed. The succeeding process is a process that is affected by the preceding process, for example, a process that uses data or the like whose contents may be updated by the preceding process.

ここで、図1を用いて、コンピュータ10の構成に関して説明する。コンピュータ10は、並列化方法を実行する並列化ツールに相当し、並列プログラム21a1を生成する。コンピュータ10は、ディスプレイ11、HDD12、CPU13、ROM14、RAM15、入力装置16、読取部17などを備えて構成されている。また、コンピュータ10は、記憶媒体18に記憶された記憶内容を読み取り可能に構成されている。この記憶媒体18には、自動並列化コンパイラ1が記憶されている。なお、HDDは、hard disk driveの略称である。CPUは、Central Processing Unitの略称である。ROMは、Read Only Memoryの略称である。RAMは、Random Access Memoryの略称である。コンピュータ10及び記憶媒体18の構成は、特開2015−1807号公報に記載されたパーソナルコンピュータ100及び記憶媒体180を参照されたい。   Here, the configuration of the computer 10 will be described with reference to FIG. The computer 10 corresponds to a parallelization tool that executes a 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. The computer 10 is configured to be able to read the storage contents stored in the storage medium 18. The storage medium 18 stores the automatic parallelizing compiler 1. HDD is an abbreviation for hard disk drive. CPU is an abbreviation for Central Processing Unit. ROM is an abbreviation for Read Only Memory. RAM is an abbreviation for Random Access Memory. 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 JP-A-2015-1807.

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

なお、自動並列化コンパイラ1は、特開2015−1807号公報に記載されたものに加えて、第2展開手順を含んでいる。第2展開手順は、後程説明する。また、自動並列化コンパイラ1は、特開2015−1807号公報に記載されたものと、見積部10dの内容が異なる。   Note that the automatic parallelizing compiler 1 includes a second expansion procedure in addition to the one described in JP-A-2015-1807. The second deployment procedure will be described later. Further, the automatic parallelizing compiler 1 is different from that described in Japanese Patent Laid-Open No. 2015-1807 in the content of the estimation unit 10d.

次に、車載装置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 illustrated 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. 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 an 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を実行することで、エンジン制御を行う。RAM21b、通信部22、センサ部23、入出力ポート24は、特開2015−1807号公報に記載されたRAM420、通信部430、センサ部450、入出力ポート460を参照されたい。   The first core 21c and the second core 21d execute engine control by executing the parallel program 21a1. 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.

ROM21aには、コンピュータ10が自動並列化コンパイラ1に従い生成した並列プログラム21a1が書き込まれて記憶されている。詳述すると、コンピュータ10は、C言語で記述されたソースコードであるシングルプログラムから、C言語で記述されたソースコードである並列プログラム21a1を生成する。そして、C言語で記述された並列プログラム21a1は、第1コンパイラ40によってバイナリデータなどの機械語で構成された並列プログラム21a1に変換される。よって、ROM21aには、バイナリデータで構成された、すなわち各コア21c、21dで実行可能な形式の並列プログラム21a1が記憶されている。このように、第1コンパイラ40で変換される前の並列プログラム21a1と、ROM21aに記憶された並列プログラム21a1は、記述方式が異なるだけであり、同等のプログラムと言える。   In the ROM 21a, a parallel program 21a1 generated by the computer 10 according to the automatic parallelizing compiler 1 is written and stored. More specifically, the computer 10 generates a parallel program 21a1 that is source code written in C language from a single program that is source code written in C language. Then, the parallel program 21a1 written in the C language is converted by the first compiler 40 into a parallel program 21a1 composed of a machine language such as binary data. Therefore, the ROM 21a stores a parallel program 21a1 composed of binary data, that is, in a format executable by each of the cores 21c and 21d. Thus, the parallel program 21a1 before being converted by the first compiler 40 and the parallel program 21a1 stored in the ROM 21a differ only in the description method and can be said to be equivalent programs.

第1コンパイラ40は、字句解析部、構文意味解析部、アセンブラ展開部などを含んで構成されている。そして、第1コンパイラ40は、C言語で記述された並列プログラム21a1をコンパイルしてアセンブリ言語に展開するなどしてバイナリデータに変換する。   The first compiler 40 includes a lexical analyzer, a syntax and semantic analyzer, an assembler expansion unit, and the like. Then, the first compiler 40 compiles the parallel program 21a1 described in the C language and converts it into binary data, for example, by developing it into an assembly language.

アセンブリ言語は、ニーモニックとオペランドを含んで構成される。ニーモニックは、第1コア21cや第2コア21dなどの演算部が実行する命令である。オペランドは、ニーモニックの対象を示すものである。   The assembly language includes mnemonics and operands. The mnemonic is an instruction executed by an arithmetic unit such as the first core 21c or the second core 21d. The operand indicates the target of the mnemonic.

ニーモニックは、例えば、ADD、LD、ST、AND、NOPなどと記述されている。なお、ADDは、加算を示す命令である。LDは、ロードを示す命令である。STはストアを示す命令である。ANDは、論理積を示す命令である。NOPは、何もしないことを意味する命令である。さらに、ニーモニックには、これらの汎用的な命令だけでなく、汎用性が乏しい特殊な命令(以下、特殊命令)もある。この特殊命令とは、あるプロセッサに特有の命令である。よって、特殊命令は、あるプロセッサでは実行可能であるが、他のプロセッサでは実行できないことがある。   The mnemonic is described as, for example, ADD, LD, ST, AND, NOP and the like. Note that ADD is an instruction indicating addition. LD is an instruction indicating a load. ST is an instruction indicating a store. AND is an instruction indicating a logical product. NOP is an instruction that means do nothing. Furthermore, mnemonics include not only these general-purpose instructions, but also special instructions (hereinafter referred to as special instructions) that lack generality. This special instruction is an instruction peculiar to a certain processor. Thus, special instructions may be executable on some processors but not on other processors.

第1コンパイラ40は、マルチコアプロセッサ21に対応した構成を有している。言い換えると、第1コンパイラ40は、マルチコアプロセッサ21専用のコンパイラである。よって、第1コンパイラ40は、シングルプログラムをアセンブリ言語に展開する際に、マルチコアプロセッサ21に特有の特殊命令を含むアセンブリ言語に展開できる。この第1コンパイラ40は、マイコン用コンパイラに相当する。   The first compiler 40 has a configuration corresponding to the multi-core processor 21. In other words, the first compiler 40 is a compiler dedicated to the multi-core processor 21. Therefore, the first compiler 40 can develop a single program into an assembly language including special instructions peculiar to the multi-core processor 21 when developing the single program into the assembly language. The first compiler 40 corresponds to a microcomputer compiler.

また、並列プログラム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 different cores 21c and 21d. Therefore, the parallel program 21a1 waits for the processing order allocated to the other cores to complete the execution of the previous processing MT when two processing MTs having dependencies are arranged in different cores 21c and 21d. The process order includes a synchronization process for executing the later process MT. In other words, when the execution of the process MT allocated to the own core is completed, the parallel program 21a1 waits for the execution of the process MT allocated to the other core to be completed, and then performs the next process allocated to the own core. A synchronization process for executing MT is included. The process MT allocated to the other core here is dependent on the next process MT allocated to the own core, and the execution order is ahead of the next process 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が実行するプログラムとを含んでいる。   For this reason, when the execution of the process MT allocated to the first core 21c and the second core 21d is completed, the first core 21c and the second core 21d access the RAM 21b and indicate that they are waiting for synchronization ( Hereinafter, the completion information) is stored in the RAM 21b. Then, the self-core waiting for the completion of the execution of the process MT having the dependency in the other core periodically accesses the RAM 21b without executing the process MT, and whether or not the completion information is stored in the RAM 21b. Confirm. That is, the own core waiting for the completion of execution of the process MT having a dependency relationship in another core periodically operates during non-operation, accesses the RAM 21b, and checks whether completion information is stored. . As described above, the first core 21c and the second core 21d execute the processing MT while waiting for each other, in other words, while synchronizing. Therefore, it can be said that the synchronization process is a waiting process. The parallel program 21a1 includes a program executed by the first core 21c and a program executed by the second core 21d.

次に、図3〜図5を用いて、コンピュータ10が自動並列化コンパイラ1を実行した際の処理動作に関して説明する。コンピュータ10は、自動並列化コンパイラ1を実行することで並列プログラム21a1を生成する。なお、上記のように、コンピュータ10は、C言語で記述された並列プログラム21a1を生成する。   Next, processing operations when the computer 10 executes the automatic parallelizing compiler 1 will be described with reference to FIGS. The computer 10 generates the parallel program 21a1 by executing the automatic parallelizing compiler 1. As described above, the computer 10 generates the parallel program 21a1 described in C language.

図3は、コンピュータ10の処理を機能ブロックで表した図面である。コンピュータ10は、第1字句解析部10a、第1構文解析部10b、依存関係解析部10c、見積部10d、コア割付部10e、スケジューリング部10fを含んで構成されている。さらに、コンピュータ10は、第2コンパイラ10gを含んで構成されている。   FIG. 3 is a diagram showing the processing of the computer 10 as functional blocks. The computer 10 includes a first lexical analysis unit 10a, a first syntax analysis unit 10b, a dependency relationship analysis unit 10c, an estimation unit 10d, a core allocation unit 10e, and a scheduling unit 10f. Furthermore, the computer 10 includes a second compiler 10g.

第1字句解析部10a及び第1構文解析部10bは、C言語で記述されたシングルプログラムのソースコードを対象として、字句解析や、構文と意味の解析を行い、アセンブリ言語に展開する。つまり、第1字句解析部10a及び第1構文解析部10bは、第1コンパイラ40と同様に、C言語で記述されたソースコードをアセンブリ言語に展開する。しかしながら、第1字句解析部10a及び第1構文解析部10bは、第1コンパイラ40と異なり、マルチコアプロセッサ21専用ではない。このため、第1字句解析部10a及び第1構文解析部10bで展開されたアセンブリ言語は、汎用的な命令は含んでいるものの、マルチコアプロセッサ21に特有の特殊命令は含んでいない。第1字句解析部10a及び第1構文解析部10bは、第1展開部に相当する。なお、第1字句解析部10a及び第1構文解析部10bは、特開2015−1807号公報のFEに相当するため、特開2015−1807号公報を参照されたい。   The first lexical analyzer 10a and the first syntactic analyzer 10b perform lexical analysis and syntax and semantic analysis on the source code of a single program written in C language, and develop it into an assembly language. That is, like the first compiler 40, the first lexical analyzer 10a and the first syntax analyzer 10b expand source code written in C language into assembly language. However, unlike the first compiler 40, the first lexical analyzer 10a and the first syntax analyzer 10b are not dedicated to the multi-core processor 21. For this reason, the assembly language developed by the first lexical analyzer 10a and the first syntax analyzer 10b includes general-purpose instructions, but does not include special instructions specific to the multi-core processor 21. The first lexical analyzer 10a and the first syntax analyzer 10b correspond to a first expansion unit. The first lexical analysis unit 10a and the first syntax analysis unit 10b correspond to the FE of Japanese Patent Application Laid-Open No. 2015-1807, so refer to Japanese Patent Application Laid-Open No. 2015-1807.

依存関係解析部10cは、シングルプログラムを解析し、並列実行可能な処理を抽出する。つまり、依存関係解析部10cは、シングルプログラムにおける複数の処理MT0〜MT11の依存関係を解析して、並列実行可能な処理を抽出する。また、依存関係解析部10cは、第1字句解析部10a及び第1構文解析部10bでアセンブリ言語に展開されたシングルプログラムを対象として、依存関係を解析して、並列実行可能な処理を抽出する。依存関係解析部10cは、解析部に相当する。この点に関しては、特開2015−1807号公報を参照されたい。   The dependency relationship analysis unit 10c analyzes a single program and extracts processes that can be executed in parallel. That is, the dependency relationship analysis unit 10c analyzes the dependency relationship between the plurality of processes MT0 to MT11 in the single program, and extracts processes that can be executed in parallel. In addition, the dependency relationship analysis unit 10c analyzes the dependency relationship for the single program developed in the assembly language by the first lexical analysis unit 10a and the first syntax analysis unit 10b, and extracts processes that can be executed in parallel. . The dependency relationship analysis unit 10c corresponds to an analysis unit. Regarding this point, refer to JP-A-2015-1807.

ここで、見積部10d及びコア割付部10eを説明する前に、第2コンパイラ10gに関して説明する。第2コンパイラ10gは、第2字句解析部10g1と第2構文解析部10g2とアセンブラ展開部10g3とを含んで構成されている。第2コンパイラ10gは、第1字句解析部10a及び第1構文解析部10bと同様に、シングルプログラムをアセンブリ言語に展開する。しかしながら、第2コンパイラ10gは、第1字句解析部10a及び第1構文解析部10bと異なり、マルチコアプロセッサ21専用である。よって、第2コンパイラ10gは、第1コンパイラ40と同様に、マルチコアプロセッサ21に特有の特殊命令を含むアセンブリ言語に展開できる。従って、コンピュータ10は、シングルプログラムを第1コンパイラ40によって字句解析及び構文解析を行いアセンブリ言語に展開すると言える。第2コンパイラ10gは、第2展開部に相当する。   Here, before describing the estimation unit 10d and the core allocation unit 10e, the second compiler 10g will be described. The second compiler 10g includes a second lexical analyzer 10g1, a second syntax analyzer 10g2, and an assembler expansion unit 10g3. Similar to the first lexical analyzer 10a and the first syntax analyzer 10b, the second compiler 10g expands the single program into assembly language. However, unlike the first lexical analyzer 10a and the first syntax analyzer 10b, the second compiler 10g is dedicated to the multi-core processor 21. Therefore, the second compiler 10g can be developed into an assembly language including special instructions unique to the multi-core processor 21, like the first compiler 40. Therefore, it can be said that the computer 10 expands the single program into assembly language by performing lexical analysis and syntax analysis by the first compiler 40. The second compiler 10g corresponds to a second expansion unit.

なお、第2コンパイラ10gは、コンピュータ10と別体に設けられていてもよい。この場合は、コンピュータ10は、自身と別体に設けられた第2コンパイラ10gによってシングルプログラムをアセンブリ言語に展開された結果を取得する。   Note that the second compiler 10g may be provided separately from the computer 10. In this case, the computer 10 acquires the result of developing the single program into assembly language by the second compiler 10g provided separately from the computer 10 itself.

見積部10dは、第2コンパイラ10gで展開されたアセンブリ言語に含まれる各命令の実行サイクル数に基づいて、各処理MT0〜MT11における実行時間を見積る。見積部10dは、見積手順に相当する。   The estimation unit 10d estimates the execution time in each process MT0 to MT11 based on the number of execution cycles of each instruction included in the assembly language expanded by the second compiler 10g. The estimation unit 10d corresponds to an estimation procedure.

実行時間とは、マルチコアプロセッサ21が処理MT0〜MT11の夫々の実行を完了するのに要する時間であり、処理時間と言い換えることもできる。また、実行時間は、各処理MT0〜MT11に含まれる命令の実行サイクル数に相当する。例えば、処理MT0が命令Xと命令Yを含んでいた場合を考える。この場合、処理MT0の実行時間は、命令Xの実行サイクル数と命令Yの実行サイクル数を加算した値である。   The execution time is the time required for the multi-core processor 21 to complete the execution of the processes MT0 to MT11, and can also be referred to as the processing time. The execution time corresponds to the number of execution cycles of instructions included in each process MT0 to MT11. For example, consider a case where the process MT0 includes an instruction X and an instruction Y. In this case, the execution time of the process MT0 is a value obtained by adding the number of execution cycles of the instruction X and the number of execution cycles of the instruction Y.

例えば、見積部10dは、マイコン情報30から得た情報を用いて、各処理MT0〜MT11における実行時間を見積る。そして、マイコン情報30は、マルチコアプロセッサ21で実行される特殊命令を含む各命令の実行サイクル数を含んでいる。また、マイコン情報30は、各命令がマルチコアプロセッサ21によって実際に実行される際の実行サイクル数を含んでいる。つまり、マイコン情報30における実行サイクル数は、マルチコアプロセッサ21の機能や性能に応じた各命令の実行サイクル数である。   For example, the estimation unit 10d estimates the execution time in each process MT0 to MT11 using information obtained from the microcomputer information 30. The microcomputer information 30 includes the number of execution cycles of each instruction including a special instruction executed by the multi-core processor 21. The microcomputer information 30 includes the number of execution cycles when each instruction is actually executed by the multi-core processor 21. That is, the number of execution cycles in the microcomputer information 30 is the number of execution cycles of each instruction according to the function and performance of the multi-core processor 21.

コア割付部10eは、複数の処理MT0〜MT11をマルチコアプロセッサ21の異なるコア21c、21dに割り付ける。そして、スケジューリング部10fは、各処理MT0〜MT11のスケジューリングを行うことで、各処理MT0〜MT11を並び替えたりする。詳述すると、コア割付部10eとスケジューリング部10fは、依存関係解析部10cで解析された依存関係と、見積部10dで見積られた実行時間とに基づいて、各処理MT0〜MT11をコア21c、21dのいずれかに割り付ける。このとき、コア割付部10eとスケジューリング部10fは、各処理MT0〜MT11が依存関係を満たすように割り付けて並列プログラム21a1を生成する。このようにして、シングルプログラムは、図5に示すような、処理MT0〜MT11の夫々が第1コア21cと第2コア21dの夫々に割り付けられた並列プログラム21a1になる。コア割付部10eとスケジューリング部10fに関しては、特開2015−1807号公報を参照されたい。このコア割付部10e及びスケジューリング部10fは、スケジューリング部に相当する。   The core allocation unit 10e allocates a plurality of processes MT0 to MT11 to different cores 21c and 21d of the multicore processor 21. And the scheduling part 10f rearranges each process MT0-MT11 by scheduling each process MT0-MT11. More specifically, the core allocating unit 10e and the scheduling unit 10f assign the processes MT0 to MT11 to the core 21c, based on the dependency analyzed by the dependency analyzing unit 10c and the execution time estimated by the estimating unit 10d. 21d is assigned. At this time, the core allocation unit 10e and the scheduling unit 10f allocate the processes MT0 to MT11 so as to satisfy the dependency, and generate the parallel program 21a1. In this way, the single program becomes a parallel program 21a1 in which the processes MT0 to MT11 are respectively assigned to the first core 21c and the second core 21d as shown in FIG. Regarding the core allocation unit 10e and the scheduling unit 10f, refer to Japanese Unexamined Patent Application Publication No. 2015-1807. The core allocation unit 10e and the scheduling unit 10f correspond to a scheduling unit.

なお、コンピュータ10は、自動並列化コンパイラ1を実行することで、上記のように動作して並列プログラム21a1を生成する。よって、第1字句解析部10a及び第1構文解析部10bは、第1展開手順に相当すると言える。また、第2字句解析部10g1と第2構文解析部10g2とアセンブラ展開部10g3は、第2展開手順に相当すると言える。依存関係解析部10cは、解析手順に相当すると言える。第2コンパイラ10gは、第2展開手順に相当すると言える。見積部10dは、見積手順に相当すると言える。コア割付部10e及びスケジューリング部10fは、スケジューリング手順に相当すると言える。   The computer 10 operates as described above by executing the automatic parallelizing compiler 1 to generate the parallel program 21a1. Therefore, it can be said that the first lexical analyzer 10a and the first syntax analyzer 10b correspond to the first expansion procedure. Further, it can be said that the second lexical analyzer 10g1, the second syntax analyzer 10g2, and the assembler expansion unit 10g3 correspond to a second expansion procedure. It can be said that the dependency relationship analysis unit 10c corresponds to an analysis procedure. It can be said that the second compiler 10g corresponds to a second expansion procedure. It can be said that the estimation unit 10d corresponds to an estimation procedure. It can be said that the core allocation unit 10e and the scheduling unit 10f correspond to a scheduling procedure.

また、車載装置20は、このようにして生成された並列プログラム21a1を実行することで、エンジン制御を行う。つまり、第1コア21cは、第2処理MT1、第4処理MT3、第7処理MT6、第9処理MT8、第10処理MT9を実行する。一方、第2コア21dは、第1処理MT0、第3処理MT2、第5処理MT4、第8処理MT7、第11処理MT10、第12処理MT11、第6処理MT5を実行する。   Moreover, the vehicle-mounted apparatus 20 performs engine control by executing the parallel program 21a1 generated in this way. That is, the first core 21c executes the second process MT1, the fourth process MT3, the seventh process MT6, the ninth process MT8, and the tenth process MT9. On the other hand, the second core 21d executes a first process MT0, a third process MT2, a fifth process MT4, an eighth process MT7, an eleventh process MT10, a twelfth process MT11, and a sixth process MT5.

このように、コンピュータ10は、マルチコアプロセッサ21に対応した第2コンパイラ10gによってシングルプログラムを字句解析及び構文解析を行いアセンブリ言語に展開する。そして、コンピュータ10は、このアセンブリ言語に含まれる各命令の実行サイクル数に基づいて、各処理MT0〜MT11における実行時間を見積る。よって、コンピュータ10は、実際にマルチコアプロセッサ21が実行する命令の実行サイクル数に基づいて、実行時間を見積ることができる。このため、コンピュータ10は、見積った各処理MT0〜MT11の実行時間が、実際にマルチコアプロセッサ21で各処理MT0〜MT11を実行した場合の実行時間と異なることを抑制できる。   As described above, the computer 10 performs lexical analysis and syntax analysis on the single program by the second compiler 10g corresponding to the multi-core processor 21, and expands it into an assembly language. Then, the computer 10 estimates the execution time in each process MT0 to MT11 based on the number of execution cycles of each instruction included in the assembly language. Therefore, the computer 10 can estimate the execution time based on the number of execution cycles of instructions actually executed by the multi-core processor 21. For this reason, the computer 10 can suppress that the estimated execution time of each process MT0 to MT11 is different from the execution time when each process MT0 to MT11 is actually executed by the multi-core processor 21.

そして、コンピュータ10は、この実行時間と依存関係とに基づいて、複数の処理MT0〜MT11の夫々が依存関係を満たすように、複数の処理MT0〜MT11の夫々を各コア21c、21dに割り付けて並列プログラムを生成する。よって、コンピュータ10は、マルチコアプロセッサ21が各処理MT0〜MT11を最速で実行可能な並列プログラム21a1を作成できる。さらに、コンピュータ10は、各種マイコンに対応しつつ、すなわち汎用性を維持しつつ、マルチコアプロセッサ21が各処理MT0〜MT11を最速で実行可能な並列プログラムを作成できる。   Then, the computer 10 allocates each of the plurality of processes MT0 to MT11 to each of the cores 21c and 21d so that each of the plurality of processes MT0 to MT11 satisfies the dependency relation based on the execution time and the dependency relation. Generate a parallel program. Therefore, the computer 10 can create the parallel program 21a1 in which the multi-core processor 21 can execute the processes MT0 to MT11 at the highest speed. Furthermore, the computer 10 can create a parallel program that allows the multi-core processor 21 to execute the processes MT0 to MT11 at the highest speed while supporting various microcomputers, that is, maintaining versatility.

言い換えると、コンピュータ10は、マルチコアプロセッサ21に対応して、各処理MT0〜MT11の実行時間を見積ることができる。このため、コンピュータ10は、他コアにおける依存関係がある処理MTの実行完了を待っている時間が長くることを抑制可能な並列プログラム21a1を生成できる。同様に、コンピュータ10は、実際は二つの処理MT間に、ある処理MTを配置できたにもかかわらず、その処理MTを配置できていない並列プログラム21a1を生成することを抑制できる。   In other words, the computer 10 can estimate the execution time of each process MT0 to MT11 corresponding to the multi-core processor 21. For this reason, the computer 10 can generate the parallel program 21a1 that can prevent the time waiting for the completion of the execution of the process MT having the dependency in the other cores from being increased. Similarly, the computer 10 can suppress the generation of the parallel program 21a1 in which a certain process MT is actually not arranged even though a certain process MT can be arranged between the two processes MT.

なお、実行時間を見積って、並列プログラムを生成する技術の一例としては、実際に、各処理をマルチコアプロセッサで実行させて実行時間を計測し、計測した実行時間をフィードバックして並列プログラムを生成することも考えられる。この技術は、実行時間として、マルチコアプロセッサに対応した正確な値を採用できる。しかしながら、この技術では、マルチコアプロセッサの実機がないと適用できない。よって、この技術は、自動並列化コンパイラと車載装置を並行して開発する場合には適用できない。また、この技術では、計測した実行時間に基づいて、再度スケジューリングする必要があり、開発効率が悪いという問題がある。   As an example of a technique for estimating the execution time and generating a parallel program, actually, each process is executed by a multi-core processor, the execution time is measured, and the measured execution time is fed back to generate a parallel program. It is also possible. This technology can adopt an accurate value corresponding to the multi-core processor as the execution time. However, this technology cannot be applied without an actual multi-core processor. Therefore, this technique cannot be applied when developing an automatic parallelizing compiler and an in-vehicle device in parallel. In addition, this technique has a problem that development efficiency is poor because it is necessary to schedule again based on the measured execution time.

これに対して、コンピュータ10は、マルチコアプロセッサ21の実機がなくても、マイコン情報30を用いるため、実行時間として、マルチコアプロセッサ21に対応した正確な値を採用できる。また、コンピュータ10は、スケジューリングをし直す必要もなく、効率が悪くなることを抑制できる。   On the other hand, since the computer 10 uses the microcomputer information 30 without an actual machine of the multi-core processor 21, an accurate value corresponding to the multi-core processor 21 can be adopted as the execution time. In addition, the computer 10 does not need to perform scheduling again and can suppress the deterioration of efficiency.

また、自動並列化コンパイラ1は、上記コンピュータ10と同様の効果を奏することができる。さらに、車載装置20は、並列プログラム21a1を実行するため、マルチコアプロセッサ21が各処理MT0〜MT11を最速で実行できる。   The automatic parallelizing compiler 1 can achieve the same effects as the computer 10. Furthermore, since the in-vehicle device 20 executes the parallel program 21a1, the multi-core processor 21 can execute the processes MT0 to MT11 at the fastest speed.

以上、本発明の好ましい実施形態について説明した。しかしながら、本発明は、上記実施形態に何ら制限されることはなく、本発明の趣旨を逸脱しない範囲において、種々の変形が可能である。   The preferred embodiments of the present invention have been described above. However, the present invention is not limited to the above embodiment, and various modifications can be made without departing from the spirit of the present invention.

なお、本実施形態では、二つの第1コア21cと第2コア21dを備えた車載装置20を採用した。しかしながら、本発明は、これに限定されず、三つ以上のコアを備えた車載装置であっても採用できる。よって、本発明は、シングルプログラムから、三つ以上のコアに対応した並列プログラムを生成するためのコンピュータ及び自動並列化コンパイラであっても採用できる。   In the present embodiment, the in-vehicle device 20 including the two first cores 21c and the second core 21d is employed. However, the present invention is not limited to this, and an on-vehicle device having three or more cores can be adopted. Therefore, the present invention can be adopted even in a computer and an automatic parallelizing compiler for generating a parallel program corresponding to three or more cores from a single program.

1 自動並列化コンパイラ、10 コンピュータ、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 入出力ポート   1 automatic parallelizing compiler, 10 computer, 11 display, 12 HDD, 13 CPU, 14 ROM, 15 RAM, 16 input device, 17 reading unit, 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 part, 23 sensor part, 24 I / O port

Claims (6)

コアが一つであるシングルコアマイコン用のシングルプログラムにおける命令を少なくとも一つ含む複数の処理(MT0〜MT11)から、複数の前記コア(21c、21d)を有するマルチコアマイコン(21)用に並列化した並列プログラム(21a1)を生成する並列化方法であって、
前記並列プログラムは、前記マルチコアマイコンに対応したマイコン用コンパイラによって、字句解析及び構文解析が行われてアセンブリ言語に展開されてバイナリデータにコンパイルされるものであり、
前記シングルプログラムの字句解析及び構文解析を行いアセンブリ言語に展開する第1展開手順(10a、10b)と、
前記第1展開手順で展開されたアセンブリ言語における各前記処理の依存関係を解析する解析手順(10c)と、
前記シングルプログラムを前記マイコン用コンパイラによって字句解析及び構文解析を行いアセンブリ言語に展開する第2展開手順(10g1〜10g3)を含み、
前記第2展開手順で展開されたアセンブリ言語に含まれる各前記命令の実行サイクル数に基づいて、各前記処理における実行時間を見積る見積手順(10d)と、
前記解析手順によって解析された前記依存関係と、前記見積手順によって見積られた前記実行時間とに基づいて、各前記処理が前記依存関係を満たすように、各前記処理を各コアに割り付けて前記並列プログラムを生成するスケジューリング手順(10e、10f)と、を備えている並列化方法。
Parallel processing for a multi-core microcomputer (21) having a plurality of cores (21c, 21d) from a plurality of processes (MT0 to MT11) including at least one instruction in a single program for a single-core microcomputer having one core A parallelization method for generating the parallel program (21a1),
The parallel program is a compiler for a microcomputer corresponding to the multi-core microcomputer, is subjected to lexical analysis and syntax analysis, is expanded into an assembly language, and is compiled into binary data,
A first expansion procedure (10a, 10b) for performing lexical analysis and syntax analysis of the single program and expanding the assembly program into assembly language;
An analysis procedure (10c) for analyzing the dependency of each of the processes in the assembly language developed in the first development procedure;
A second expansion procedure (10g1 to 10g3) for performing lexical analysis and syntax analysis on the single program by the microcomputer compiler and expanding the assembly into assembly language;
An estimation procedure (10d) for estimating an execution time in each process based on the number of execution cycles of each instruction included in the assembly language expanded in the second expansion procedure;
Based on the dependency relationship analyzed by the analysis procedure and the execution time estimated by the estimation procedure, the parallel processing is performed by assigning the processing to each core so that the processing satisfies the dependency relationship. And a scheduling procedure (10e, 10f) for generating a program.
前記第2展開手順は、前記マルチコアマイコンに特有の特殊命令を含むアセンブリ言語に展開する請求項1に記載の並列化方法。   The parallelization method according to claim 1, wherein the second expansion procedure is expanded into an assembly language including special instructions unique to the multicore microcomputer. コアが一つであるシングルコアマイコン用のシングルプログラムにおける命令を少なくとも一つ含む複数の処理(MT0〜MT11)から、複数の前記コア(21c、21d)を有するマルチコアマイコン(21)用に並列化した並列プログラム(21a1)を生成する、コンピュータを含む並列化ツールであって、
前記並列プログラムは、前記マルチコアマイコンに対応したマイコン用コンパイラによって、字句解析及び構文解析が行われてアセンブリ言語に展開されてバイナリデータにコンパイルされるものであり、
前記シングルプログラムの字句解析及び構文解析を行いアセンブリ言語に展開する第1展開部(10a、10b)と、
前記第1展開部で展開されたアセンブリ言語における各前記処理の依存関係を解析する解析部(10c)と、
前記シングルプログラムを前記マイコン用コンパイラによって字句解析及び構文解析を行いアセンブリ言語に展開する第2展開部(10g1〜10g3)を含み、
前記第2展開部で展開されたアセンブリ言語に含まれる各前記命令の実行サイクル数に基づいて、各前記処理における実行時間を見積る見積部(10d)と、
前記解析部によって解析された前記依存関係と、前記見積部によって見積られた前記実行時間とに基づいて、各前記処理が前記依存関係を満たすように、各前記処理を各コアに割り付けて前記並列プログラムを生成するスケジューリング部(10e、10f)と、を備えている並列化ツール。
Parallel processing for a multi-core microcomputer (21) having a plurality of cores (21c, 21d) from a plurality of processes (MT0 to MT11) including at least one instruction in a single program for a single-core microcomputer having one core A parallelization tool including a computer for generating the parallel program (21a1),
The parallel program is a compiler for a microcomputer corresponding to the multi-core microcomputer, is subjected to lexical analysis and syntax analysis, is expanded into an assembly language, and is compiled into binary data,
A first expansion unit (10a, 10b) that performs lexical analysis and syntax analysis of the single program and expands into assembly language;
An analysis unit (10c) for analyzing a dependency relationship of each of the processes in the assembly language expanded by the first expansion unit;
A second expansion unit (10g1 to 10g3) that expands the single program into an assembly language by performing lexical analysis and syntax analysis by the microcomputer compiler;
An estimation unit (10d) for estimating an execution time in each of the processes based on the number of execution cycles of each of the instructions included in the assembly language expanded in the second expansion unit;
Based on the dependency relationship analyzed by the analysis unit and the execution time estimated by the estimation unit, each process is assigned to each core so that each process satisfies the dependency relationship. A parallelization tool comprising a scheduling unit (10e, 10f) for generating a program.
前記第2展開部は、前記マルチコアマイコンに特有の特殊命令を含むアセンブリ言語に展開する請求項3に記載の並列化ツール。   4. The parallelization tool according to claim 3, wherein the second expansion unit expands to an assembly language including special instructions unique to the multi-core microcomputer. 複数のコア(21c、21d)を有するマルチコアマイコン(21)と、前記コアが一つであるシングルコアマイコン用のシングルプログラムにおける命令を少なくとも一つ含む複数の処理(MT0〜MT11)から前記マルチコアマイコン用に並列化された並列プログラム(21a1)と、を備えた車載装置であって、
前記並列プログラムは、前記マルチコアマイコンに対応したマイコン用コンパイラによって、字句解析及び構文解析が行われてアセンブリ言語に展開されてバイナリデータにコンパイルされたものであり、
前記シングルプログラムの字句解析及び構文解析を行い展開されたアセンブリ言語における各前記処理の依存関係が解析され、
前記シングルプログラムを前記マイコン用コンパイラによって字句解析及び構文解析を行い展開されたアセンブリ言語に含まれる各前記命令の実行サイクル数に基づいて、各前記処理における実行時間が見積られ、
前記依存関係と前記実行時間とに基づいて、各前記処理が前記依存関係を満たすように、複数の前記処理の夫々を各コアに割り付けており、
前記マルチコアマイコンは、各コアが自身に割り付けられた前記処理を実行する車載装置。
A multi-core microcomputer (21) having a plurality of cores (21c, 21d) and a plurality of processes (MT0 to MT11) including at least one instruction in a single program for a single-core microcomputer having one core. An in-vehicle device comprising a parallel program (21a1) parallelized for
The parallel program is a compiler for a microcomputer corresponding to the multi-core microcomputer, which is subjected to lexical analysis and syntax analysis, expanded into an assembly language, and compiled into binary data.
The dependency of each processing in the assembly language expanded by performing lexical analysis and syntax analysis of the single program is analyzed,
Based on the number of execution cycles of each instruction included in the assembly language expanded by performing lexical analysis and syntax analysis on the single program by the microcomputer compiler, the execution time in each process is estimated,
Based on the dependency relationship and the execution time, each of the plurality of processes is allocated to each core so that each process satisfies the dependency relationship,
The multi-core microcomputer is an in-vehicle device that executes the processing in which each core is assigned to itself.
前記シングルプログラムは、前記マイコン用コンパイラによって、前記マルチコアマイコンに特有の特殊命令を含むアセンブリ言語に展開されている請求項5に記載の車載装置。   6. The in-vehicle apparatus according to claim 5, wherein the single program is expanded into an assembly language including special instructions unique to the multi-core microcomputer by the microcomputer compiler.
JP2015218667A 2015-11-06 2015-11-06 Parallelization method, parallelization tool, and car onboard device Pending JP2017091098A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2015218667A JP2017091098A (en) 2015-11-06 2015-11-06 Parallelization method, parallelization tool, and car onboard device
DE102016221570.1A DE102016221570A1 (en) 2015-11-06 2016-11-03 PARALLELIZATION METHOD, PARALLELIZATION TOOL AND VEHICLE-BUILDER DEVICE

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015218667A JP2017091098A (en) 2015-11-06 2015-11-06 Parallelization method, parallelization tool, and car onboard device

Publications (1)

Publication Number Publication Date
JP2017091098A true JP2017091098A (en) 2017-05-25

Family

ID=58585205

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015218667A Pending JP2017091098A (en) 2015-11-06 2015-11-06 Parallelization method, parallelization tool, and car onboard device

Country Status (2)

Country Link
JP (1) JP2017091098A (en)
DE (1) DE102016221570A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007164672A (en) * 2005-12-16 2007-06-28 Mitsubishi Electric Corp Program, operating system and compiler
JP2007328415A (en) * 2006-06-06 2007-12-20 Univ Waseda Control method of heterogeneous multiprocessor system, and multigrain parallelization compiler
JP2009146243A (en) * 2007-12-17 2009-07-02 Hitachi Ltd Power performance optimization compiler using substrate bias control and processor system
JP2015001807A (en) * 2013-06-14 2015-01-05 株式会社デンソー Parallelization compilation method, parallelization compiler, parallelization compilation device, and on-vehicle device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007164672A (en) * 2005-12-16 2007-06-28 Mitsubishi Electric Corp Program, operating system and compiler
JP2007328415A (en) * 2006-06-06 2007-12-20 Univ Waseda Control method of heterogeneous multiprocessor system, and multigrain parallelization compiler
JP2009146243A (en) * 2007-12-17 2009-07-02 Hitachi Ltd Power performance optimization compiler using substrate bias control and processor system
JP2015001807A (en) * 2013-06-14 2015-01-05 株式会社デンソー Parallelization compilation method, parallelization compiler, parallelization compilation device, and on-vehicle device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
納富 昭: "特集 第1部 Appendix2:マルチコア時代!並列処理プログラミング入門", INTERFACE, vol. 第41巻,第10号(通巻460号), JPN6019004044, 1 October 2015 (2015-10-01), JP, pages 42 - 51, ISSN: 0004089408 *

Also Published As

Publication number Publication date
DE102016221570A1 (en) 2017-05-11

Similar Documents

Publication Publication Date Title
JP6018022B2 (en) Parallel compilation method, parallel compiler, parallel compilation device, and in-vehicle device
JP6525286B2 (en) Processor core and processor system
JP4936517B2 (en) Control method for heterogeneous multiprocessor system and multi-grain parallelizing compiler
JP4629768B2 (en) Parallelization processing method, system, and program
JP2017107448A (en) Parallelization method, parallelization tool, and on-vehicle device
JP6427054B2 (en) Parallelizing compilation method and parallelizing compiler
JP6464982B2 (en) Parallelization method, parallelization tool, in-vehicle device
JP2017228029A (en) Parallelization method, parallelization tool, on-vehicle device
KR102062208B1 (en) Apparatus and Method for translating multithreaded program code
JP6427055B2 (en) Parallelizing compilation method and parallelizing compiler
JP6427053B2 (en) Parallelizing compilation method and parallelizing compiler
JP6488739B2 (en) Parallelizing compilation method and parallelizing compiler
JP6481585B2 (en) Parallelization method, parallelization tool, in-vehicle device
JP2008305337A (en) Program converter, program conversion method, program, storage medium, debugging device, debugging method and program development system
Krawczyk et al. Automated distribution of software to multi-core hardware in model based embedded systems development
JP2017091098A (en) Parallelization method, parallelization tool, and car onboard device
JP6488738B2 (en) Parallelizing compilation method and parallelizing compiler
JP6933001B2 (en) Parallelization method, parallelization tool
Han et al. Exploit the data level parallelism and schedule dependent tasks on the multi-core processors
JP6617511B2 (en) Parallelization method, parallelization tool, in-vehicle device
JP6558310B2 (en) Parallelization method, parallelization tool
JP7095513B2 (en) Multi-core microcomputers and in-vehicle devices
JP2017073083A (en) Parallelization method, parallelization tool, and on-vehicle device
US20090187895A1 (en) Device, method, program, and recording medium for converting program
WO2021098105A1 (en) Method and apparatus for functional unit assignment

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180119

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20181212

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190212

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20190806